import{S as e,_ as t,J as n,t as r,m as o,r as i,aI as a,v as s,l as u}from"./.pnpm.BudmgPu7.js";var l,c,d,f,p,h,g,v,m,y,b,E,w,C,D,A,S,x,O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function N(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function B(){return c?l:(c=1,l=function(e){try{return!!e()}catch(t){return!0}})}function T(){if(f)return d;f=1;var e=B();return d=!e(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})}function k(){if(h)return p;h=1;var e=T(),t=Function.prototype,n=t.call,r=e&&t.bind.bind(n,n);return p=e?r:function(e){return function(){return n.apply(e,arguments)}},p}function F(){if(v)return g;v=1;var e=k(),t=e({}.toString),n=e("".slice);return g=function(e){return n(t(e),8,-1)}}function P(){if(y)return m;y=1;var e=k(),t=B(),n=F(),r=Object,o=e("".split);return m=t(function(){return!r("z").propertyIsEnumerable(0)})?function(e){return"String"===n(e)?o(e,""):r(e)}:r}function I(){return E?b:(E=1,b=function(e){return null==e})}function R(){if(C)return w;C=1;var e=I(),t=TypeError;return w=function(n){if(e(n))throw new t("Can't call method on "+n);return n}}function _(){if(A)return D;A=1;var e=P(),t=R();return D=function(n){return e(t(n))}}function L(){if(x)return S;x=1;var e=function(e){return e&&e.Math===Math&&e};return S=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof O&&O)||e("object"==typeof S&&S)||function(){return this}()||Function("return this")()}var M,j,H,z,$,U,V,W,G,q,K,Y,X,Z,J,Q,ee,te,ne,re,oe,ie,ae,se,ue,le,ce,de,fe,pe={exports:{}};function he(){return j?M:(j=1,M=!1)}function ge(){if(z)return H;z=1;var e=L(),t=Object.defineProperty;return H=function(n,r){try{t(e,n,{value:r,configurable:!0,writable:!0})}catch(o){e[n]=r}return r}}function ve(){if($)return pe.exports;$=1;var e=he(),t=L(),n=ge(),r="__core-js_shared__",o=pe.exports=t[r]||n(r,{});return(o.versions||(o.versions=[])).push({version:"3.47.0",mode:e?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE",source:"https://github.com/zloirock/core-js"}),pe.exports}function me(){if(V)return U;V=1;var e=ve();return U=function(t,n){return e[t]||(e[t]=n||{})}}function ye(){if(G)return W;G=1;var e=R(),t=Object;return W=function(n){return t(e(n))}}function be(){if(K)return q;K=1;var e=k(),t=ye(),n=e({}.hasOwnProperty);return q=Object.hasOwn||function(e,r){return n(t(e),r)}}function Ee(){if(X)return Y;X=1;var e=k(),t=0,n=Math.random(),r=e(1.1.toString);return Y=function(e){return"Symbol("+(void 0===e?"":e)+")_"+r(++t+n,36)}}function we(){if(ne)return te;ne=1;var e=function(){if(ee)return Q;ee=1;var e,t,n=L(),r=function(){if(J)return Z;J=1;var e=L().navigator,t=e&&e.userAgent;return Z=t?String(t):""}(),o=n.process,i=n.Deno,a=o&&o.versions||i&&i.version,s=a&&a.v8;return s&&(t=(e=s.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!t&&r&&(!(e=r.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=r.match(/Chrome\/(\d+)/))&&(t=+e[1]),Q=t}(),t=B(),n=L().String;return te=!!Object.getOwnPropertySymbols&&!t(function(){var t=Symbol("symbol detection");return!n(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41})}function Ce(){if(oe)return re;oe=1;var e=we();return re=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function De(){if(ae)return ie;ae=1;var e=L(),t=me(),n=be(),r=Ee(),o=we(),i=Ce(),a=e.Symbol,s=t("wks"),u=i?a.for||a:a&&a.withoutSetter||r;return ie=function(e){return n(s,e)||(s[e]=o&&n(a,e)?a[e]:u("Symbol."+e)),s[e]}}function Ae(){if(ue)return se;ue=1;var e="object"==typeof document&&document.all;return se=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(e){return"function"==typeof e}}function Se(){if(ce)return le;ce=1;var e=Ae();return le=function(t){return"object"==typeof t?null!==t:e(t)}}function xe(){if(fe)return de;fe=1;var e=Se(),t=String,n=TypeError;return de=function(r){if(e(r))return r;throw new n(t(r)+" is not an object")}}var Oe,Ne,Be,Te,ke={};function Fe(){if(Ne)return Oe;Ne=1;var e=B();return Oe=!e(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}function Pe(){if(Te)return Be;Te=1;var e=Fe(),t=B();return Be=e&&t(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}var Ie,Re,_e,Le,Me,je,He,ze,$e,Ue,Ve,We,Ge,qe,Ke,Ye,Xe,Ze,Je,Qe,et,tt,nt,rt,ot,it,at,st,ut,lt,ct,dt,ft,pt,ht,gt,vt,mt,yt,bt,Et,wt,Ct,Dt,At,St,xt,Ot,Nt,Bt,Tt,kt,Ft,Pt,It,Rt,_t,Lt,Mt,jt,Ht,zt,$t,Ut,Vt={};function Wt(){if(Re)return Ie;Re=1;var e=L(),t=Se(),n=e.document,r=t(n)&&t(n.createElement);return Ie=function(e){return r?n.createElement(e):{}}}function Gt(){if(Le)return _e;Le=1;var e=Fe(),t=B(),n=Wt();return _e=!e&&!t(function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a})}function qt(){if(je)return Me;je=1;var e=T(),t=Function.prototype.call;return Me=e?t.bind(t):function(){return t.apply(t,arguments)},Me}function Kt(){if(ze)return He;ze=1;var e=L(),t=Ae();return He=function(n,r){return arguments.length<2?(o=e[n],t(o)?o:void 0):e[n]&&e[n][r];var o},He}function Yt(){if(Ue)return $e;Ue=1;var e=k();return $e=e({}.isPrototypeOf)}function Xt(){if(We)return Ve;We=1;var e=Kt(),t=Ae(),n=Yt(),r=Ce(),o=Object;return Ve=r?function(e){return"symbol"==typeof e}:function(r){var i=e("Symbol");return t(i)&&n(i.prototype,o(r))}}function Zt(){if(qe)return Ge;qe=1;var e=String;return Ge=function(t){try{return e(t)}catch(n){return"Object"}}}function Jt(){if(Ye)return Ke;Ye=1;var e=Ae(),t=Zt(),n=TypeError;return Ke=function(r){if(e(r))return r;throw new n(t(r)+" is not a function")}}function Qt(){if(Ze)return Xe;Ze=1;var e=Jt(),t=I();return Xe=function(n,r){var o=n[r];return t(o)?void 0:e(o)}}function en(){if(rt)return nt;rt=1;var e=function(){if(tt)return et;tt=1;var e=qt(),t=Se(),n=Xt(),r=Qt(),o=function(){if(Qe)return Je;Qe=1;var e=qt(),t=Ae(),n=Se(),r=TypeError;return Je=function(o,i){var a,s;if("string"===i&&t(a=o.toString)&&!n(s=e(a,o)))return s;if(t(a=o.valueOf)&&!n(s=e(a,o)))return s;if("string"!==i&&t(a=o.toString)&&!n(s=e(a,o)))return s;throw new r("Can't convert object to primitive value")}}(),i=De(),a=TypeError,s=i("toPrimitive");return et=function(i,u){if(!t(i)||n(i))return i;var l,c=r(i,s);if(c){if(void 0===u&&(u="default"),l=e(c,i,u),!t(l)||n(l))return l;throw new a("Can't convert object to primitive value")}return void 0===u&&(u="number"),o(i,u)}}(),t=Xt();return nt=function(n){var r=e(n,"string");return t(r)?r:r+""}}function tn(){if(ot)return Vt;ot=1;var e=Fe(),t=Gt(),n=Pe(),r=xe(),o=en(),i=TypeError,a=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u="enumerable",l="configurable",c="writable";return Vt.f=e?n?function(e,t,n){if(r(e),t=o(t),r(n),"function"==typeof e&&"prototype"===t&&"value"in n&&c in n&&!n[c]){var i=s(e,t);i&&i[c]&&(e[t]=n.value,n={configurable:l in n?n[l]:i[l],enumerable:u in n?n[u]:i[u],writable:!1})}return a(e,t,n)}:a:function(e,n,s){if(r(e),n=o(n),r(s),t)try{return a(e,n,s)}catch(u){}if("get"in s||"set"in s)throw new i("Accessors not supported");return"value"in s&&(e[n]=s.value),e},Vt}function nn(){if(ut)return st;ut=1;var e=function(){if(at)return it;at=1;var e=Math.ceil,t=Math.floor;return it=Math.trunc||function(n){var r=+n;return(r>0?t:e)(r)}}();return st=function(t){var n=+t;return n!=n||0===n?0:e(n)}}function rn(){if(ft)return dt;ft=1;var e=nn(),t=Math.min;return dt=function(n){var r=e(n);return r>0?t(r,9007199254740991):0}}function on(){if(ht)return pt;ht=1;var e=rn();return pt=function(t){return e(t.length)}}function an(){return yt?mt:(yt=1,mt={})}function sn(){if(Et)return bt;Et=1;var e=k(),t=be(),n=_(),r=function(){if(vt)return gt;vt=1;var e=_(),t=function(){if(ct)return lt;ct=1;var e=nn(),t=Math.max,n=Math.min;return lt=function(r,o){var i=e(r);return i<0?t(i+o,0):n(i,o)}}(),n=on(),r=function(r){return function(o,i,a){var s=e(o),u=n(s);if(0===u)return!r&&-1;var l,c=t(a,u);if(r&&i!=i){for(;u>c;)if((l=s[c++])!=l)return!0}else for(;u>c;c++)if((r||c in s)&&s[c]===i)return r||c||0;return!r&&-1}};return gt={includes:r(!0),indexOf:r(!1)}}().indexOf,o=an(),i=e([].push);return bt=function(e,a){var s,u=n(e),l=0,c=[];for(s in u)!t(o,s)&&t(u,s)&&i(c,s);for(;a.length>l;)t(u,s=a[l++])&&(~r(c,s)||i(c,s));return c}}function un(){return Ct?wt:(Ct=1,wt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}function ln(){if(Bt)return Nt;Bt=1;var e=me(),t=Ee(),n=e("keys");return Nt=function(e){return n[e]||(n[e]=t(e))}}function cn(){if(kt)return Tt;kt=1;var e,t=xe(),n=function(){if(St)return ke;St=1;var e=Fe(),t=Pe(),n=tn(),r=xe(),o=_(),i=function(){if(At)return Dt;At=1;var e=sn(),t=un();return Dt=Object.keys||function(n){return e(n,t)}}();return ke.f=e&&!t?Object.defineProperties:function(e,t){r(e);for(var a,s=o(t),u=i(t),l=u.length,c=0;l>c;)n.f(e,a=u[c++],s[a]);return e},ke}(),r=un(),o=an(),i=function(){if(Ot)return xt;Ot=1;var e=Kt();return xt=e("document","documentElement")}(),a=Wt(),s=ln(),u="prototype",l="script",c=s("IE_PROTO"),d=function(){},f=function(e){return"<"+l+">"+e+""},p=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},h=function(){try{e=new ActiveXObject("htmlfile")}catch(c){}var t,n,o;h="undefined"!=typeof document?document.domain&&e?p(e):(n=a("iframe"),o="java"+l+":",n.style.display="none",i.appendChild(n),n.src=String(o),(t=n.contentWindow.document).open(),t.write(f("document.F=Object")),t.close(),t.F):p(e);for(var s=r.length;s--;)delete h[u][r[s]];return h()};return o[c]=!0,Tt=Object.create||function(e,r){var o;return null!==e?(d[u]=t(e),o=new d,d[u]=null,o[c]=e):o=h(),void 0===r?o:n.f(o,r)}}function dn(){return Rt?It:(Rt=1,It={})}function fn(){return jt?Mt:(jt=1,Mt=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}})}function pn(){if(zt)return Ht;zt=1;var e=Fe(),t=tn(),n=fn();return Ht=e?function(e,r,o){return t.f(e,r,n(1,o))}:function(e,t,n){return e[t]=n,e}}function hn(){if(Ut)return $t;Ut=1;var e,t,n,r=function(){if(Lt)return _t;Lt=1;var e=L(),t=Ae(),n=e.WeakMap;return _t=t(n)&&/native code/.test(String(n))}(),o=L(),i=Se(),a=pn(),s=be(),u=ve(),l=ln(),c=an(),d="Object already initialized",f=o.TypeError,p=o.WeakMap;if(r||u.state){var h=u.state||(u.state=new p);h.get=h.get,h.has=h.has,h.set=h.set,e=function(e,t){if(h.has(e))throw new f(d);return t.facade=e,h.set(e,t),t},t=function(e){return h.get(e)||{}},n=function(e){return h.has(e)}}else{var g=l("state");c[g]=!0,e=function(e,t){if(s(e,g))throw new f(d);return t.facade=e,a(e,g,t),t},t=function(e){return s(e,g)?e[g]:{}},n=function(e){return s(e,g)}}return $t={set:e,get:t,has:n,enforce:function(r){return n(r)?t(r):e(r,{})},getterFor:function(e){return function(n){var r;if(!i(n)||(r=t(n)).type!==e)throw new f("Incompatible receiver, "+e+" required");return r}}}}var gn,vn,mn={},yn={};function bn(){if(vn)return mn;vn=1;var e=Fe(),t=qt(),n=function(){if(gn)return yn;gn=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor,n=t&&!e.call({1:2},1);return yn.f=n?function(e){var n=t(this,e);return!!n&&n.enumerable}:e,yn}(),r=fn(),o=_(),i=en(),a=be(),s=Gt(),u=Object.getOwnPropertyDescriptor;return mn.f=e?u:function(e,l){if(e=o(e),l=i(l),s)try{return u(e,l)}catch(c){}if(a(e,l))return r(!t(n.f,e,l),e[l])},mn}var En,wn,Cn,Dn,An,Sn,xn,On={exports:{}};function Nn(){if(wn)return En;wn=1;var e=Fe(),t=be(),n=Function.prototype,r=e&&Object.getOwnPropertyDescriptor,o=t(n,"name"),i=o&&"something"===function(){}.name,a=o&&(!e||e&&r(n,"name").configurable);return En={EXISTS:o,PROPER:i,CONFIGURABLE:a}}function Bn(){if(Dn)return Cn;Dn=1;var e=k(),t=Ae(),n=ve(),r=e(Function.toString);return t(n.inspectSource)||(n.inspectSource=function(e){return r(e)}),Cn=n.inspectSource}function Tn(){if(xn)return Sn;xn=1;var e=Ae(),t=tn(),n=function(){if(An)return On.exports;An=1;var e=k(),t=B(),n=Ae(),r=be(),o=Fe(),i=Nn().CONFIGURABLE,a=Bn(),s=hn(),u=s.enforce,l=s.get,c=String,d=Object.defineProperty,f=e("".slice),p=e("".replace),h=e([].join),g=o&&!t(function(){return 8!==d(function(){},"length",{value:8}).length}),v=String(String).split("String"),m=On.exports=function(e,t,n){"Symbol("===f(c(t),0,7)&&(t="["+p(c(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!r(e,"name")||i&&e.name!==t)&&(o?d(e,"name",{value:t,configurable:!0}):e.name=t),g&&n&&r(n,"arity")&&e.length!==n.arity&&d(e,"length",{value:n.arity});try{n&&r(n,"constructor")&&n.constructor?o&&d(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(s){}var a=u(e);return r(a,"source")||(a.source=h(v,"string"==typeof t?t:"")),e};return Function.prototype.toString=m(function(){return n(this)&&l(this).source||a(this)},"toString"),On.exports}(),r=ge();return Sn=function(o,i,a,s){s||(s={});var u=s.enumerable,l=void 0!==s.name?s.name:i;if(e(a)&&n(a,l,s),s.global)u?o[i]=a:r(i,a);else{try{s.unsafe?o[i]&&(u=!0):delete o[i]}catch(c){}u?o[i]=a:t.f(o,i,{value:a,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return o}}var kn,Fn,Pn,In,Rn,_n,Ln,Mn,jn,Hn,zn,$n,Un,Vn,Wn,Gn,qn,Kn,Yn,Xn,Zn,Jn,Qn,er,tr,nr,rr,or,ir,ar,sr,ur,lr,cr,dr={},fr={};function pr(){if(_n)return Rn;_n=1;var e=be(),t=function(){if(In)return Pn;In=1;var e=Kt(),t=k(),n=function(){if(kn)return dr;kn=1;var e=sn(),t=un().concat("length","prototype");return dr.f=Object.getOwnPropertyNames||function(n){return e(n,t)},dr}(),r=(Fn||(Fn=1,fr.f=Object.getOwnPropertySymbols),fr),o=xe(),i=t([].concat);return Pn=e("Reflect","ownKeys")||function(e){var t=n.f(o(e)),a=r.f;return a?i(t,a(e)):t}}(),n=bn(),r=tn();return Rn=function(o,i,a){for(var s=t(i),u=r.f,l=n.f,c=0;c=t.length)return e.target=null,a(void 0,!0);switch(e.kind){case"keys":return a(n,!1);case"values":return a(t[n],!1)}return a([n,t[n]],!1)},"values");var f=n.Arguments=n.Array;if(t("keys"),t("values"),t("entries"),!s&&u&&"values"!==f.name)try{o(f,"name",{value:"values"})}catch(p){}return lr}wr();var Cr,Dr,Ar,Sr,xr,Or,Nr,Br={};function Tr(){if(Dr)return Cr;Dr=1;var e={};return e[De()("toStringTag")]="z",Cr="[object z]"===String(e)}function kr(){if(Sr)return Ar;Sr=1;var e=Tr(),t=Ae(),n=F(),r=De()("toStringTag"),o=Object,i="Arguments"===n(function(){return arguments}());return Ar=e?n:function(e){var a,s,u;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(s=function(e,t){try{return e[t]}catch(n){}}(a=o(e),r))?s:i?n(a):"Object"===(u=n(a))&&t(a.callee)?"Arguments":u}}!function(){if(Nr)return Br;Nr=1;var e=Tr(),t=Tn(),n=function(){if(Or)return xr;Or=1;var e=Tr(),t=kr();return xr=e?{}.toString:function(){return"[object "+t(this)+"]"}}();e||t(Object.prototype,"toString",n,{unsafe:!0})}();var Fr,Pr,Ir,Rr,_r,Lr,Mr,jr,Hr,zr,$r,Ur,Vr,Wr={};function Gr(){if(Pr)return Fr;Pr=1;var e=kr(),t=String;return Fr=function(n){if("Symbol"===e(n))throw new TypeError("Cannot convert a Symbol value to a string");return t(n)}}function qr(){if(Rr)return Ir;Rr=1;var e=xe();return Ir=function(){var t=e(this),n="";return t.hasIndices&&(n+="d"),t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.dotAll&&(n+="s"),t.unicode&&(n+="u"),t.unicodeSets&&(n+="v"),t.sticky&&(n+="y"),n}}function Kr(){if(Ur)return $r;Ur=1;var e,t,n=qt(),r=k(),o=Gr(),i=qr(),a=function(){if(Lr)return _r;Lr=1;var e=B(),t=L().RegExp,n=e(function(){var e=t("a","y");return e.lastIndex=2,null!==e.exec("abcd")}),r=n||e(function(){return!t("a","y").sticky}),o=n||e(function(){var e=t("^r","gy");return e.lastIndex=2,null!==e.exec("str")});return _r={BROKEN_CARET:o,MISSED_STICKY:r,UNSUPPORTED_Y:n}}(),s=me(),u=cn(),l=hn().get,c=function(){if(jr)return Mr;jr=1;var e=B(),t=L().RegExp;return Mr=e(function(){var e=t(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)})}(),d=function(){if(zr)return Hr;zr=1;var e=B(),t=L().RegExp;return Hr=e(function(){var e=t("(?b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$c")})}(),f=s("native-string-replace",String.prototype.replace),p=RegExp.prototype.exec,h=p,g=r("".charAt),v=r("".indexOf),m=r("".replace),y=r("".slice),b=(t=/b*/g,n(p,e=/a/,"a"),n(p,t,"a"),0!==e.lastIndex||0!==t.lastIndex),E=a.BROKEN_CARET,w=void 0!==/()??/.exec("")[1];return(b||w||E||c||d)&&(h=function(e){var t,r,a,s,c,d,C,D=this,A=l(D),S=o(e),x=A.raw;if(x)return x.lastIndex=D.lastIndex,t=n(h,x,S),D.lastIndex=x.lastIndex,t;var O=A.groups,N=E&&D.sticky,B=n(i,D),T=D.source,k=0,F=S;if(N&&(B=m(B,"y",""),-1===v(B,"g")&&(B+="g"),F=y(S,D.lastIndex),D.lastIndex>0&&(!D.multiline||D.multiline&&"\n"!==g(S,D.lastIndex-1))&&(T="(?: "+T+")",F=" "+F,k++),r=new RegExp("^(?:"+T+")",B)),w&&(r=new RegExp("^"+T+"$(?!\\s)",B)),b&&(a=D.lastIndex),s=n(p,N?r:D,F),N?s?(s.input=y(s.input,k),s[0]=y(s[0],k),s.index=D.lastIndex,D.lastIndex+=s[0].length):D.lastIndex=0:b&&s&&(D.lastIndex=D.global?s.index+s[0].length:a),w&&s&&s.length>1&&n(f,s[0],r,function(){for(c=1;c=p?e?"":void 0:(l=i(d,f))<55296||l>56319||f+1===p||(c=i(d,f+1))<56320||c>57343?e?o(d,f):l:e?a(d,f,f+2):c-56320+(l-55296<<10)+65536}};return Xr={codeAt:s(!1),charAt:s(!0)}}!function(){if(Jr)return Qr;Jr=1;var e=eo().charAt,t=Gr(),n=hn(),r=br(),o=Er(),i="String Iterator",a=n.set,s=n.getterFor(i);r(String,"String",function(e){a(this,{type:i,string:t(e),index:0})},function(){var t,n=s(this),r=n.string,i=n.index;return i>=r.length?o(void 0,!0):(t=e(r,i),n.index+=t.length,o(t,!1))})}();var to,no,ro,oo,io,ao,so,uo,lo,co,fo,po={};!function(){if(fo)return po;fo=1;var e=qt(),t=k(),n=function(){if(no)return to;no=1,Yr();var e=qt(),t=Tn(),n=Kr(),r=B(),o=De(),i=pn(),a=o("species"),s=RegExp.prototype;return to=function(u,l,c,d){var f=o(u),p=!r(function(){var e={};return e[f]=function(){return 7},7!==""[u](e)}),h=p&&!r(function(){var e=!1,t=/a/;if("split"===u){var n={};n[a]=function(){return t},(t={constructor:n,flags:""})[f]=/./[f]}return t.exec=function(){return e=!0,null},t[f](""),!e});if(!p||!h||c){var g=/./[f],v=l(f,""[u],function(t,r,o,i,a){var u=r.exec;return u===n||u===s.exec?p&&!a?{done:!0,value:e(g,r,o,i)}:{done:!0,value:e(t,o,r,i)}:{done:!1}});t(String.prototype,u,v[0]),t(s,f,v[1])}d&&i(s[f],"sham",!0)}}(),r=xe(),o=Se(),i=rn(),a=Gr(),s=R(),u=Qt(),l=function(){if(oo)return ro;oo=1;var e=eo().charAt;return ro=function(t,n,r){return n+(r?e(t,n).length:1)}}(),c=function(){if(uo)return so;uo=1;var e=qt(),t=be(),n=Yt(),r=function(){if(ao)return io;ao=1;var e=L(),t=B(),n=e.RegExp,r=!t(function(){var e=!0;try{n(".","d")}catch(u){e=!1}var t={},r="",o=e?"dgimsy":"gimsy",i=function(e,n){Object.defineProperty(t,e,{get:function(){return r+=n,!0}})},a={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var s in e&&(a.hasIndices="d"),a)i(s,a[s]);return Object.getOwnPropertyDescriptor(n.prototype,"flags").get.call(t)!==o||r!==o});return io={correct:r}}(),o=qr(),i=RegExp.prototype;return so=r.correct?function(e){return e.flags}:function(a){return r.correct||!n(i,a)||t(a,"flags")?a.flags:e(o,a)}}(),d=function(){if(co)return lo;co=1;var e=qt(),t=xe(),n=Ae(),r=F(),o=Kr(),i=TypeError;return lo=function(a,s){var u=a.exec;if(n(u)){var l=e(u,a,s);return null!==l&&t(l),l}if("RegExp"===r(a))return e(o,a,s);throw new i("RegExp#exec called on incompatible receiver")}}(),f=t("".indexOf);n("match",function(t,n,p){return[function(n){var r=s(this),i=o(n)?u(n,t):void 0;return i?e(i,n,r):new RegExp(n)[t](a(r))},function(e){var t=r(this),o=a(e),s=p(n,t,o);if(s.done)return s.value;var u=a(c(t));if(-1===f(u,"g"))return d(t,o);var h=-1!==f(u,"u");t.lastIndex=0;for(var g,v=[],m=0;null!==(g=d(t,o));){var y=a(g[0]);v[m]=y,""===y&&(t.lastIndex=l(o,i(t.lastIndex),h)),m++}return 0===m?null:v}]})}();var ho,go,vo,mo,yo,bo,Eo,wo,Co,Do,Ao,So,xo,Oo,No,Bo,To,ko,Fo,Po,Io,Ro,_o,Lo,Mo,jo,Ho,zo={};function $o(){if(So)return Ao;So=1;var e=function(){if(Do)return Co;Do=1;var e=F(),t=k();return Co=function(n){if("Function"===e(n))return t(n)}}(),t=Jt(),n=T(),r=e(e.bind);return Ao=function(e,o){return t(e),void 0===o?e:n?r(e,o):function(){return e.apply(o,arguments)}},Ao}function Uo(){if(Bo)return No;Bo=1;var e=kr(),t=Qt(),n=I(),r=dn(),o=De()("iterator");return No=function(i){if(!n(i))return t(i,o)||t(i,"@@iterator")||r[e(i)]}}function Vo(){if(Ro)return Io;Ro=1;var e=$o(),t=qt(),n=xe(),r=Zt(),o=function(){if(Oo)return xo;Oo=1;var e=De(),t=dn(),n=e("iterator"),r=Array.prototype;return xo=function(e){return void 0!==e&&(t.Array===e||r[n]===e)}}(),i=on(),a=Yt(),s=function(){if(ko)return To;ko=1;var e=qt(),t=Jt(),n=xe(),r=Zt(),o=Uo(),i=TypeError;return To=function(a,s){var u=arguments.length<2?o(a):s;if(t(u))return n(e(u,a));throw new i(r(a)+" is not iterable")},To}(),u=Uo(),l=function(){if(Po)return Fo;Po=1;var e=qt(),t=xe(),n=Qt();return Fo=function(r,o,i){var a,s;t(r);try{if(!(a=n(r,"return"))){if("throw"===o)throw i;return i}a=e(a,r)}catch(u){s=!0,a=u}if("throw"===o)throw i;if(s)throw a;return t(a),i}}(),c=TypeError,d=function(e,t){this.stopped=e,this.result=t},f=d.prototype;return Io=function(p,h,g){var v,m,y,b,E,w,C,D=g&&g.that,A=!(!g||!g.AS_ENTRIES),S=!(!g||!g.IS_RECORD),x=!(!g||!g.IS_ITERATOR),O=!(!g||!g.INTERRUPTED),N=e(h,D),B=function(e){return v&&l(v,"normal"),new d(!0,e)},T=function(e){return A?(n(e),O?N(e[0],e[1],B):N(e[0],e[1])):O?N(e,B):N(e)};if(S)v=p.iterator;else if(x)v=p;else{if(!(m=u(p)))throw new c(r(p)+" is not iterable");if(o(m)){for(y=0,b=i(p);b>y;y++)if((E=T(p[y]))&&a(f,E))return E;return new d(!1)}v=s(p,m)}for(w=S?p.next:v.next;!(C=t(w,v)).done;){try{E=T(C.value)}catch(k){l(v,"throw",k)}if("object"==typeof E&&E&&a(f,E))return E}return new d(!1)}}Ho||(Ho=1,jo||(jo=1,function(){if(Mo)return zo;Mo=1;var e=hr(),t=Yt(),n=gr(),r=yr(),o=pr(),i=cn(),a=pn(),s=fn(),u=function(){if(go)return ho;go=1;var e=Se(),t=pn();return ho=function(n,r){e(r)&&"cause"in r&&t(n,"cause",r.cause)}}(),l=function(){if(wo)return Eo;wo=1;var e=pn(),t=function(){if(mo)return vo;mo=1;var e=k(),t=Error,n=e("".replace),r=String(new t("zxcasd").stack),o=/\n\s*at [^:]*:[^\n]*/,i=o.test(r);return vo=function(e,r){if(i&&"string"==typeof e&&!t.prepareStackTrace)for(;r--;)e=n(e,o,"");return e}}(),n=function(){if(bo)return yo;bo=1;var e=B(),t=fn();return yo=!e(function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",t(1,7)),7!==e.stack)})}(),r=Error.captureStackTrace;return Eo=function(o,i,a,s){n&&(r?r(o,i):e(o,"stack",t(a,s)))}}(),c=Vo(),d=function(){if(Lo)return _o;Lo=1;var e=Gr();return _o=function(t,n){return void 0===t?arguments.length<2?"":n:e(t)},_o}(),f=De()("toStringTag"),p=Error,h=[].push,g=function(e,o){var s,m=t(v,this);r?s=r(new p,m?n(this):v):(s=m?this:i(v),a(s,f,"Error")),void 0!==o&&a(s,"message",d(o)),l(s,g,s.stack,1),arguments.length>2&&u(s,arguments[2]);var y=[];return c(e,h,{that:y}),a(s,"errors",y),s};r?r(g,p):o(g,p,{name:!0});var v=g.prototype=i(p.prototype,{constructor:s(1,g),message:s(1,""),name:s(1,"AggregateError")});e({global:!0,constructor:!0,arity:2},{AggregateError:g})}()));var Wo,Go,qo={};Go||(Go=1,function(){if(Wo)return qo;Wo=1;var e=hr(),t=L();e({global:!0,forced:t.globalThis!==t},{globalThis:t})}());var Ko,Yo,Xo,Zo,Jo,Qo,ei={};function ti(){return Yo?Ko:(Yo=1,Ko={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0})}function ni(){if(Zo)return Xo;Zo=1;var e=Wt()("span").classList,t=e&&e.constructor&&e.constructor.prototype;return Xo=t===Object.prototype?void 0:t}function ri(){"undefined"==typeof globalThis&&(window.globalThis=window)}function oi(){"undefined"==typeof AggregateError&&(window.AggregateError=function(e,t){var n=new Error(t);return n.errors=e,n})}(function(){if(Jo)return ei;Jo=1;var e=L(),t=ti(),n=ni(),r=wr(),o=pn(),i=mr(),a=De()("iterator"),s=r.values,u=function(e,n){if(e){if(e[a]!==s)try{o(e,a,s)}catch(l){e[a]=s}if(i(e,n,!0),t[n])for(var u in r)if(e[u]!==r[u])try{o(e,u,r[u])}catch(l){e[u]=r[u]}}};for(var l in t)u(e[l]&&e[l].prototype,l);u(n,"DOMTokenList")})(),"undefined"==typeof global?(window,ri(),oi()):global&&(null===(Qo=global.navigator)||void 0===Qo?void 0:Qo.userAgent.match("QQBrowser"))&&(ri(),oi());var ii,ai,si,ui,li,ci,di,fi,pi,hi,gi,vi,mi,yi,bi,Ei,wi={};function Ci(){if(ai)return ii;ai=1;var e=function(e){return e&&e.Math===Math&&e};return ii=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof O&&O)||e("object"==typeof ii&&ii)||function(){return this}()||Function("return this")()}function Di(){return ui?si:(ui=1,si=function(e){try{return!!e()}catch(t){return!0}})}function Ai(){return ci?li:(ci=1,li=!Di()(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))}function Si(){if(fi)return di;fi=1;var e=Ai(),t=Function.prototype,n=t.apply,r=t.call;return di="object"==typeof Reflect&&Reflect.apply||(e?r.bind(n):function(){return r.apply(n,arguments)}),di}function xi(){if(hi)return pi;hi=1;var e=Ai(),t=Function.prototype,n=t.call,r=e&&t.bind.bind(n,n);return pi=e?r:function(e){return function(){return n.apply(e,arguments)}},pi}function Oi(){if(vi)return gi;vi=1;var e=xi(),t=e({}.toString),n=e("".slice);return gi=function(e){return n(t(e),8,-1)}}function Ni(){if(yi)return mi;yi=1;var e=Oi(),t=xi();return mi=function(n){if("Function"===e(n))return t(n)}}function Bi(){if(Ei)return bi;Ei=1;var e="object"==typeof document&&document.all;return bi=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(e){return"function"==typeof e}}var Ti,ki,Fi,Pi,Ii={};function Ri(){return ki?Ti:(ki=1,Ti=!Di()(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))}function _i(){if(Pi)return Fi;Pi=1;var e=Ai(),t=Function.prototype.call;return Fi=e?t.bind(t):function(){return t.apply(t,arguments)},Fi}var Li,Mi,ji,Hi,zi,$i,Ui,Vi,Wi,Gi,qi,Ki,Yi,Xi,Zi,Ji,Qi,ea,ta,na,ra,oa,ia,aa,sa,ua,la,ca,da,fa,pa,ha,ga,va,ma,ya,ba,Ea={};function wa(){if(Li)return Ea;Li=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor,n=t&&!e.call({1:2},1);return Ea.f=n?function(e){var n=t(this,e);return!!n&&n.enumerable}:e,Ea}function Ca(){return ji?Mi:(ji=1,Mi=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}})}function Da(){if(zi)return Hi;zi=1;var e=xi(),t=Di(),n=Oi(),r=Object,o=e("".split);return Hi=t(function(){return!r("z").propertyIsEnumerable(0)})?function(e){return"String"===n(e)?o(e,""):r(e)}:r}function Aa(){return Ui?$i:(Ui=1,$i=function(e){return null==e})}function Sa(){if(Wi)return Vi;Wi=1;var e=Aa(),t=TypeError;return Vi=function(n){if(e(n))throw new t("Can't call method on "+n);return n}}function xa(){if(qi)return Gi;qi=1;var e=Da(),t=Sa();return Gi=function(n){return e(t(n))}}function Oa(){if(Yi)return Ki;Yi=1;var e=Bi();return Ki=function(t){return"object"==typeof t?null!==t:e(t)}}function Na(){return Zi?Xi:(Zi=1,Xi={})}function Ba(){if(Qi)return Ji;Qi=1;var e=Na(),t=Ci(),n=Bi(),r=function(e){return n(e)?e:void 0};return Ji=function(n,o){return arguments.length<2?r(e[n])||r(t[n]):e[n]&&e[n][o]||t[n]&&t[n][o]},Ji}function Ta(){return ta?ea:(ta=1,ea=xi()({}.isPrototypeOf))}function ka(){if(ia)return oa;ia=1;var e,t,n=Ci(),r=function(){if(ra)return na;ra=1;var e=Ci().navigator,t=e&&e.userAgent;return na=t?String(t):""}(),o=n.process,i=n.Deno,a=o&&o.versions||i&&i.version,s=a&&a.v8;return s&&(t=(e=s.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!t&&r&&(!(e=r.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=r.match(/Chrome\/(\d+)/))&&(t=+e[1]),oa=t}function Fa(){if(sa)return aa;sa=1;var e=ka(),t=Di(),n=Ci().String;return aa=!!Object.getOwnPropertySymbols&&!t(function(){var t=Symbol("symbol detection");return!n(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41})}function Pa(){return la?ua:(la=1,ua=Fa()&&!Symbol.sham&&"symbol"==typeof Symbol.iterator)}function Ia(){if(da)return ca;da=1;var e=Ba(),t=Bi(),n=Ta(),r=Object;return ca=Pa()?function(e){return"symbol"==typeof e}:function(o){var i=e("Symbol");return t(i)&&n(i.prototype,r(o))}}function Ra(){if(pa)return fa;pa=1;var e=String;return fa=function(t){try{return e(t)}catch(n){return"Object"}}}function _a(){if(ga)return ha;ga=1;var e=Bi(),t=Ra(),n=TypeError;return ha=function(r){if(e(r))return r;throw new n(t(r)+" is not a function")}}var La,Ma,ja,Ha,za,$a,Ua,Va,Wa,Ga,qa,Ka,Ya,Xa,Za,Ja,Qa,es,ts,ns,rs,os,is,as,ss,us,ls,cs,ds={exports:{}};function fs(){return Ma?La:(Ma=1,La=!0)}function ps(){if(za)return ds.exports;za=1;var e=fs(),t=Ci(),n=function(){if(Ha)return ja;Ha=1;var e=Ci(),t=Object.defineProperty;return ja=function(n,r){try{t(e,n,{value:r,configurable:!0,writable:!0})}catch(o){e[n]=r}return r}}(),r="__core-js_shared__",o=ds.exports=t[r]||n(r,{});return(o.versions||(o.versions=[])).push({version:"3.47.0",mode:e?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE",source:"https://github.com/zloirock/core-js"}),ds.exports}function hs(){if(Ua)return $a;Ua=1;var e=ps();return $a=function(t,n){return e[t]||(e[t]=n||{})}}function gs(){if(Wa)return Va;Wa=1;var e=Sa(),t=Object;return Va=function(n){return t(e(n))}}function vs(){if(qa)return Ga;qa=1;var e=xi(),t=gs(),n=e({}.hasOwnProperty);return Ga=Object.hasOwn||function(e,r){return n(t(e),r)}}function ms(){if(Ya)return Ka;Ya=1;var e=xi(),t=0,n=Math.random(),r=e(1.1.toString);return Ka=function(e){return"Symbol("+(void 0===e?"":e)+")_"+r(++t+n,36)}}function ys(){if(Za)return Xa;Za=1;var e=Ci(),t=hs(),n=vs(),r=ms(),o=Fa(),i=Pa(),a=e.Symbol,s=t("wks"),u=i?a.for||a:a&&a.withoutSetter||r;return Xa=function(e){return n(s,e)||(s[e]=o&&n(a,e)?a[e]:u("Symbol."+e)),s[e]}}function bs(){if(Qa)return Ja;Qa=1;var e=_i(),t=Oa(),n=Ia(),r=function(){if(ma)return va;ma=1;var e=_a(),t=Aa();return va=function(n,r){var o=n[r];return t(o)?void 0:e(o)}}(),o=function(){if(ba)return ya;ba=1;var e=_i(),t=Bi(),n=Oa(),r=TypeError;return ya=function(o,i){var a,s;if("string"===i&&t(a=o.toString)&&!n(s=e(a,o)))return s;if(t(a=o.valueOf)&&!n(s=e(a,o)))return s;if("string"!==i&&t(a=o.toString)&&!n(s=e(a,o)))return s;throw new r("Can't convert object to primitive value")}}(),i=TypeError,a=ys()("toPrimitive");return Ja=function(s,u){if(!t(s)||n(s))return s;var l,c=r(s,a);if(c){if(void 0===u&&(u="default"),l=e(c,s,u),!t(l)||n(l))return l;throw new i("Can't convert object to primitive value")}return void 0===u&&(u="number"),o(s,u)}}function Es(){if(ts)return es;ts=1;var e=bs(),t=Ia();return es=function(n){var r=e(n,"string");return t(r)?r:r+""}}function ws(){if(rs)return ns;rs=1;var e=Ci(),t=Oa(),n=e.document,r=t(n)&&t(n.createElement);return ns=function(e){return r?n.createElement(e):{}}}function Cs(){if(is)return os;is=1;var e=Ri(),t=Di(),n=ws();return os=!e&&!t(function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a})}function Ds(){if(as)return Ii;as=1;var e=Ri(),t=_i(),n=wa(),r=Ca(),o=xa(),i=Es(),a=vs(),s=Cs(),u=Object.getOwnPropertyDescriptor;return Ii.f=e?u:function(e,l){if(e=o(e),l=i(l),s)try{return u(e,l)}catch(c){}if(a(e,l))return r(!t(n.f,e,l),e[l])},Ii}function As(){if(cs)return ls;cs=1;var e=Ni(),t=_a(),n=Ai(),r=e(e.bind);return ls=function(e,o){return t(e),void 0===o?e:n?r(e,o):function(){return e.apply(o,arguments)}},ls}var Ss,xs,Os,Ns,Bs,Ts,ks,Fs,Ps,Is,Rs,_s,Ls,Ms,js,Hs,zs,$s,Us,Vs,Ws,Gs,qs,Ks,Ys,Xs,Zs,Js,Qs,eu,tu,nu,ru,ou,iu,au,su,uu,lu={};function cu(){return xs?Ss:(xs=1,Ss=Ri()&&Di()(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}))}function du(){if(Ns)return Os;Ns=1;var e=Oa(),t=String,n=TypeError;return Os=function(r){if(e(r))return r;throw new n(t(r)+" is not an object")}}function fu(){if(Bs)return lu;Bs=1;var e=Ri(),t=Cs(),n=cu(),r=du(),o=Es(),i=TypeError,a=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u="enumerable",l="configurable",c="writable";return lu.f=e?n?function(e,t,n){if(r(e),t=o(t),r(n),"function"==typeof e&&"prototype"===t&&"value"in n&&c in n&&!n[c]){var i=s(e,t);i&&i[c]&&(e[t]=n.value,n={configurable:l in n?n[l]:i[l],enumerable:u in n?n[u]:i[u],writable:!1})}return a(e,t,n)}:a:function(e,n,s){if(r(e),n=o(n),r(s),t)try{return a(e,n,s)}catch(u){}if("get"in s||"set"in s)throw new i("Accessors not supported");return"value"in s&&(e[n]=s.value),e},lu}function pu(){if(ks)return Ts;ks=1;var e=Ri(),t=fu(),n=Ca();return Ts=e?function(e,r,o){return t.f(e,r,n(1,o))}:function(e,t,n){return e[t]=n,e}}function hu(){if(Ps)return Fs;Ps=1;var e=Ci(),t=Si(),n=Ni(),r=Bi(),o=Ds().f,i=function(){if(us)return ss;us=1;var e=Di(),t=Bi(),n=/#|\.prototype\./,r=function(n,r){var u=i[o(n)];return u===s||u!==a&&(t(r)?e(r):!!r)},o=r.normalize=function(e){return String(e).replace(n,".").toLowerCase()},i=r.data={},a=r.NATIVE="N",s=r.POLYFILL="P";return ss=r}(),a=Na(),s=As(),u=pu(),l=vs(),c=function(e){var n=function(r,o,i){if(this instanceof n){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,o)}return new e(r,o,i)}return t(e,this,arguments)};return n.prototype=e.prototype,n};return Fs=function(t,d){var f,p,h,g,v,m,y,b,E,w=t.target,C=t.global,D=t.stat,A=t.proto,S=C?e:D?e[w]:e[w]&&e[w].prototype,x=C?a:a[w]||u(a,w,{})[w],O=x.prototype;for(g in d)p=!(f=i(C?g:w+(D?".":"#")+g,t.forced))&&S&&l(S,g),m=x[g],p&&(y=t.dontCallGetSet?(E=o(S,g))&&E.value:S[g]),v=p&&y?y:d[g],(f||A||typeof m!=typeof v)&&(b=t.bind&&p?s(v,e):t.wrap&&p?c(v):A&&r(v)?n(v):v,(t.sham||v&&v.sham||m&&m.sham)&&u(b,"sham",!0),u(x,g,b),A&&(l(a,h=w+"Prototype")||u(a,h,{}),u(a[h],g,v),t.real&&O&&(f||!O[g])&&u(O,g,v)))}}function gu(){if(Rs)return Is;Rs=1;var e=Oi();return Is=Array.isArray||function(t){return"Array"===e(t)}}function vu(){if(js)return Ms;js=1;var e=function(){if(Ls)return _s;Ls=1;var e=Math.ceil,t=Math.floor;return _s=Math.trunc||function(n){var r=+n;return(r>0?t:e)(r)}}();return Ms=function(t){var n=+t;return n!=n||0===n?0:e(n)}}function mu(){if(Us)return $s;Us=1;var e=function(){if(zs)return Hs;zs=1;var e=vu(),t=Math.min;return Hs=function(n){var r=e(n);return r>0?t(r,9007199254740991):0}}();return $s=function(t){return e(t.length)}}function yu(){if(Ys)return Ks;Ys=1;var e={};return e[ys()("toStringTag")]="z",Ks="[object z]"===String(e)}function bu(){if(Zs)return Xs;Zs=1;var e=yu(),t=Bi(),n=Oi(),r=ys()("toStringTag"),o=Object,i="Arguments"===n(function(){return arguments}());return Xs=e?n:function(e){var a,s,u;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(s=function(e,t){try{return e[t]}catch(n){}}(a=o(e),r))?s:i?n(a):"Object"===(u=n(a))&&t(a.callee)?"Arguments":u}}function Eu(){if(tu)return eu;tu=1;var e=xi(),t=Di(),n=Bi(),r=bu(),o=Ba(),i=function(){if(Qs)return Js;Qs=1;var e=xi(),t=Bi(),n=ps(),r=e(Function.toString);return t(n.inspectSource)||(n.inspectSource=function(e){return r(e)}),Js=n.inspectSource}(),a=function(){},s=o("Reflect","construct"),u=/^\s*(?:class|function)\b/,l=e(u.exec),c=!u.test(a),d=function(e){if(!n(e))return!1;try{return s(a,[],e),!0}catch(t){return!1}},f=function(e){if(!n(e))return!1;switch(r(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return c||!!l(u,i(e))}catch(t){return!0}};return f.sham=!0,eu=!s||t(function(){var e;return d(d.call)||!d(Object)||!d(function(){e=!0})||e})?f:d}function wu(){if(iu)return ou;iu=1;var e=function(){if(ru)return nu;ru=1;var e=gu(),t=Eu(),n=Oa(),r=ys()("species"),o=Array;return nu=function(i){var a;return e(i)&&(a=i.constructor,(t(a)&&(a===o||e(a.prototype))||n(a)&&null===(a=a[r]))&&(a=void 0)),void 0===a?o:a}}();return ou=function(t,n){return new(e(t))(0===n?0:n)}}var Cu,Du,Au={},Su={};function xu(){if(Du)return Cu;Du=1;var e=bu(),t=String;return Cu=function(n){if("Symbol"===e(n))throw new TypeError("Cannot convert a Symbol value to a string");return t(n)}}var Ou,Nu,Bu,Tu,ku,Fu,Pu,Iu,Ru,_u,Lu,Mu,ju,Hu,zu,$u,Uu,Vu,Wu,Gu={};function qu(){if(Tu)return Bu;Tu=1;var e=xa(),t=function(){if(Nu)return Ou;Nu=1;var e=vu(),t=Math.max,n=Math.min;return Ou=function(r,o){var i=e(r);return i<0?t(i+o,0):n(i,o)}}(),n=mu(),r=function(r){return function(o,i,a){var s=e(o),u=n(s);if(0===u)return!r&&-1;var l,c=t(a,u);if(r&&i!=i){for(;u>c;)if((l=s[c++])!=l)return!0}else for(;u>c;c++)if((r||c in s)&&s[c]===i)return r||c||0;return!r&&-1}};return Bu={includes:r(!0),indexOf:r(!1)}}function Ku(){return Fu?ku:(Fu=1,ku={})}function Yu(){if(Iu)return Pu;Iu=1;var e=xi(),t=vs(),n=xa(),r=qu().indexOf,o=Ku(),i=e([].push);return Pu=function(e,a){var s,u=n(e),l=0,c=[];for(s in u)!t(o,s)&&t(u,s)&&i(c,s);for(;a.length>l;)t(u,s=a[l++])&&(~r(c,s)||i(c,s));return c}}function Xu(){return _u?Ru:(_u=1,Ru=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}function Zu(){if(Mu)return Lu;Mu=1;var e=Yu(),t=Xu();return Lu=Object.keys||function(n){return e(n,t)}}function Ju(){if(ju)return Gu;ju=1;var e=Ri(),t=cu(),n=fu(),r=du(),o=xa(),i=Zu();return Gu.f=e&&!t?Object.defineProperties:function(e,t){r(e);for(var a,s=o(t),u=i(t),l=u.length,c=0;l>c;)n.f(e,a=u[c++],s[a]);return e},Gu}function Qu(){if(Uu)return $u;Uu=1;var e=hs(),t=ms(),n=e("keys");return $u=function(e){return n[e]||(n[e]=t(e))}}function el(){if(Wu)return Vu;Wu=1;var e,t=du(),n=Ju(),r=Xu(),o=Ku(),i=zu?Hu:(zu=1,Hu=Ba()("document","documentElement")),a=ws(),s="prototype",u="script",l=Qu()("IE_PROTO"),c=function(){},d=function(e){return"<"+u+">"+e+""},f=function(e){e.write(d("")),e.close();var t=e.parentWindow.Object;return e=null,t},p=function(){try{e=new ActiveXObject("htmlfile")}catch(c){}var t,n,o;p="undefined"!=typeof document?document.domain&&e?f(e):(n=a("iframe"),o="java"+u+":",n.style.display="none",i.appendChild(n),n.src=String(o),(t=n.contentWindow.document).open(),t.write(d("document.F=Object")),t.close(),t.F):f(e);for(var l=r.length;l--;)delete p[s][r[l]];return p()};return o[l]=!0,Vu=Object.create||function(e,r){var o;return null!==e?(c[s]=t(e),o=new c,c[s]=null,o[l]=e):o=p(),void 0===r?o:n.f(o,r)}}var tl,nl={};function rl(){if(tl)return nl;tl=1;var e=Yu(),t=Xu().concat("length","prototype");return nl.f=Object.getOwnPropertyNames||function(n){return e(n,t)},nl}var ol,il,al,sl={};function ul(){return il?ol:(il=1,ol=xi()([].slice))}var ll,cl,dl,fl,pl,hl={};function gl(){return ll||(ll=1,hl.f=Object.getOwnPropertySymbols),hl}function vl(){if(dl)return cl;dl=1;var e=pu();return cl=function(t,n,r,o){return o&&o.enumerable?t[n]=r:e(t,n,r),t}}var ml,yl,bl,El,wl,Cl,Dl,Al,Sl,xl,Ol,Nl,Bl,Tl,kl,Fl,Pl={};function Il(){if(ml)return Pl;ml=1;var e=ys();return Pl.f=e,Pl}function Rl(){if(bl)return yl;bl=1;var e=Na(),t=vs(),n=Il(),r=fu().f;return yl=function(o){var i=e.Symbol||(e.Symbol={});t(i,o)||r(i,o,{value:n.f(o)})}}function _l(){if(wl)return El;wl=1;var e=_i(),t=Ba(),n=ys(),r=vl();return El=function(){var o=t("Symbol"),i=o&&o.prototype,a=i&&i.valueOf,s=n("toPrimitive");i&&!i[s]&&r(i,s,function(t){return e(a,this)},{arity:1})}}function Ll(){if(Sl)return Al;Sl=1;var e=yu(),t=fu().f,n=pu(),r=vs(),o=function(){if(Dl)return Cl;Dl=1;var e=yu(),t=bu();return Cl=e?{}.toString:function(){return"[object "+t(this)+"]"}}(),i=ys()("toStringTag");return Al=function(a,s,u,l){var c=u?a:a&&a.prototype;c&&(r(c,i)||t(c,i,{configurable:!0,value:s}),l&&!e&&n(c,"toString",o))}}function Ml(){if(Bl)return Nl;Bl=1;var e,t,n,r=function(){if(Ol)return xl;Ol=1;var e=Ci(),t=Bi(),n=e.WeakMap;return xl=t(n)&&/native code/.test(String(n))}(),o=Ci(),i=Oa(),a=pu(),s=vs(),u=ps(),l=Qu(),c=Ku(),d="Object already initialized",f=o.TypeError,p=o.WeakMap;if(r||u.state){var h=u.state||(u.state=new p);h.get=h.get,h.has=h.has,h.set=h.set,e=function(e,t){if(h.has(e))throw new f(d);return t.facade=e,h.set(e,t),t},t=function(e){return h.get(e)||{}},n=function(e){return h.has(e)}}else{var g=l("state");c[g]=!0,e=function(e,t){if(s(e,g))throw new f(d);return t.facade=e,a(e,g,t),t},t=function(e){return s(e,g)?e[g]:{}},n=function(e){return s(e,g)}}return Nl={set:e,get:t,has:n,enforce:function(r){return n(r)?t(r):e(r,{})},getterFor:function(e){return function(n){var r;if(!i(n)||(r=t(n)).type!==e)throw new f("Incompatible receiver, "+e+" required");return r}}}}var jl,Hl,zl,$l={};function Ul(){return Hl?jl:(Hl=1,jl=Fa()&&!!Symbol.for&&!!Symbol.keyFor)}var Vl,Wl,Gl,ql,Kl,Yl,Xl,Zl,Jl={},Ql={};var ec,tc,nc={};function rc(){return tc||(tc=1,function(){if(Fl)return Su;Fl=1;var e=hu(),t=Ci(),n=_i(),r=xi(),o=fs(),i=Ri(),a=Fa(),s=Di(),u=vs(),l=Ta(),c=du(),d=xa(),f=Es(),p=xu(),h=Ca(),g=el(),v=Zu(),m=rl(),y=function(){if(al)return sl;al=1;var e=Oi(),t=xa(),n=rl().f,r=ul(),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];return sl.f=function(i){return o&&"Window"===e(i)?function(e){try{return n(e)}catch(t){return r(o)}}(i):n(t(i))},sl}(),b=gl(),E=Ds(),w=fu(),C=Ju(),D=wa(),A=vl(),S=function(){if(pl)return fl;pl=1;var e=fu();return fl=function(t,n,r){return e.f(t,n,r)}}(),x=hs(),O=Qu(),N=Ku(),B=ms(),T=ys(),k=Il(),F=Rl(),P=_l(),I=Ll(),R=Ml(),_=function(){if(kl)return Tl;kl=1;var e=As(),t=xi(),n=Da(),r=gs(),o=mu(),i=wu(),a=t([].push),s=function(t){var s=1===t,u=2===t,l=3===t,c=4===t,d=6===t,f=7===t,p=5===t||d;return function(h,g,v,m){for(var y,b,E=r(h),w=n(E),C=o(w),D=e(g,v),A=0,S=m||i,x=s?S(h,C):u||f?S(h,0):void 0;C>A;A++)if((p||A in w)&&(b=D(y=w[A],A,E),t))if(s)x[A]=b;else if(b)switch(t){case 3:return!0;case 5:return y;case 6:return A;case 2:a(x,y)}else switch(t){case 4:return!1;case 7:a(x,y)}return d?-1:l||c?c:x}};return Tl={forEach:s(0),map:s(1),filter:s(2),some:s(3),every:s(4),find:s(5),findIndex:s(6),filterReject:s(7)}}().forEach,L=O("hidden"),M="Symbol",j="prototype",H=R.set,z=R.getterFor(M),$=Object[j],U=t.Symbol,V=U&&U[j],W=t.RangeError,G=t.TypeError,q=t.QObject,K=E.f,Y=w.f,X=y.f,Z=D.f,J=r([].push),Q=x("symbols"),ee=x("op-symbols"),te=x("wks"),ne=!q||!q[j]||!q[j].findChild,re=function(e,t,n){var r=K($,t);r&&delete $[t],Y(e,t,n),r&&e!==$&&Y($,t,r)},oe=i&&s(function(){return 7!==g(Y({},"a",{get:function(){return Y(this,"a",{value:7}).a}})).a})?re:Y,ie=function(e,t){var n=Q[e]=g(V);return H(n,{type:M,tag:e,description:t}),i||(n.description=t),n},ae=function(e,t,n){e===$&&ae(ee,t,n),c(e);var r=f(t);return c(n),u(Q,r)?(n.enumerable?(u(e,L)&&e[L][r]&&(e[L][r]=!1),n=g(n,{enumerable:h(0,!1)})):(u(e,L)||Y(e,L,h(1,g(null))),e[L][r]=!0),oe(e,r,n)):Y(e,r,n)},se=function(e,t){c(e);var r=d(t),o=v(r).concat(de(r));return _(o,function(t){i&&!n(ue,r,t)||ae(e,t,r[t])}),e},ue=function(e){var t=f(e),r=n(Z,this,t);return!(this===$&&u(Q,t)&&!u(ee,t))&&(!(r||!u(this,t)||!u(Q,t)||u(this,L)&&this[L][t])||r)},le=function(e,t){var n=d(e),r=f(t);if(n!==$||!u(Q,r)||u(ee,r)){var o=K(n,r);return!o||!u(Q,r)||u(n,L)&&n[L][r]||(o.enumerable=!0),o}},ce=function(e){var t=X(d(e)),n=[];return _(t,function(e){u(Q,e)||u(N,e)||J(n,e)}),n},de=function(e){var t=e===$,n=X(t?ee:d(e)),r=[];return _(n,function(e){!u(Q,e)||t&&!u($,e)||J(r,Q[e])}),r};a||(U=function(){if(l(V,this))throw new G("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?p(arguments[0]):void 0,r=B(e),o=function(e){var i=void 0===this?t:this;i===$&&n(o,ee,e),u(i,L)&&u(i[L],r)&&(i[L][r]=!1);var a=h(1,e);try{oe(i,r,a)}catch(s){if(!(s instanceof W))throw s;re(i,r,a)}};return i&&ne&&oe($,r,{configurable:!0,set:o}),ie(r,e)},A(V=U[j],"toString",function(){return z(this).tag}),A(U,"withoutSetter",function(e){return ie(B(e),e)}),D.f=ue,w.f=ae,C.f=se,E.f=le,m.f=y.f=ce,b.f=de,k.f=function(e){return ie(T(e),e)},i&&(S(V,"description",{configurable:!0,get:function(){return z(this).description}}),o||A($,"propertyIsEnumerable",ue,{unsafe:!0}))),e({global:!0,constructor:!0,wrap:!0,forced:!a,sham:!a},{Symbol:U}),_(v(te),function(e){F(e)}),e({target:M,stat:!0,forced:!a},{useSetter:function(){ne=!0},useSimple:function(){ne=!1}}),e({target:"Object",stat:!0,forced:!a,sham:!i},{create:function(e,t){return void 0===t?g(e):se(g(e),t)},defineProperty:ae,defineProperties:se,getOwnPropertyDescriptor:le}),e({target:"Object",stat:!0,forced:!a},{getOwnPropertyNames:ce}),P(),I(U,M),N[L]=!0}(),function(){if(zl)return $l;zl=1;var e=hu(),t=Ba(),n=vs(),r=xu(),o=hs(),i=Ul(),a=o("string-to-symbol-registry"),s=o("symbol-to-string-registry");e({target:"Symbol",stat:!0,forced:!i},{for:function(e){var o=r(e);if(n(a,o))return a[o];var i=t("Symbol")(o);return a[o]=i,s[i]=o,i}})}(),function(){if(Vl)return Jl;Vl=1;var e=hu(),t=vs(),n=Ia(),r=Ra(),o=hs(),i=Ul(),a=o("symbol-to-string-registry");e({target:"Symbol",stat:!0,forced:!i},{keyFor:function(e){if(!n(e))throw new TypeError(r(e)+" is not a symbol");if(t(a,e))return a[e]}})}(),function(){if(Zl)return Ql;Zl=1;var e=hu(),t=Ba(),n=Si(),r=_i(),o=xi(),i=Di(),a=gu(),s=Bi(),u=function(){if(Gl)return Wl;Gl=1;var e=Oa(),t=Ml().get;return Wl=function(n){if(!e(n))return!1;var r=t(n);return!!r&&"RawJSON"===r.type}}(),l=Ia(),c=Oi(),d=xu(),f=ul(),p=function(){if(Kl)return ql;Kl=1;var e=xi(),t=vs(),n=SyntaxError,r=parseInt,o=String.fromCharCode,i=e("".charAt),a=e("".slice),s=e(/./.exec),u={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},l=/^[\da-f]{4}$/i,c=/^[\u0000-\u001F]$/;return ql=function(e,d){for(var f=!0,p="";d9007199254740991)throw e("Maximum allowed index exceeded");return t}}(),s=function(){if(qs)return Gs;qs=1;var e=Ri(),t=fu(),n=Ca();return Gs=function(r,o,i){e?t.f(r,o,n(0,i)):r[o]=i}}(),u=wu(),l=function(){if(su)return au;su=1;var e=Di(),t=ys(),n=ka(),r=t("species");return au=function(t){return n>=51||!e(function(){var e=[];return(e.constructor={})[r]=function(){return{foo:1}},1!==e[t](Boolean).foo})}}(),c=ys(),d=ka(),f=c("isConcatSpreadable"),p=d>=51||!t(function(){var e=[];return e[f]=!1,e.concat()[0]!==e}),h=function(e){if(!r(e))return!1;var t=e[f];return void 0!==t?!!t:n(e)};e({target:"Array",proto:!0,arity:1,forced:!p||!l("concat")},{concat:function(e){var t,n,r,l,c,d=o(this),f=u(d,0),p=0;for(t=-1,r=arguments.length;t=t.length)return e.target=null,a(void 0,!0);switch(e.kind){case"keys":return a(n,!1);case"values":return a(t[n],!1)}return a([n,t[n]],!1)},"values");var f=n.Arguments=n.Array;if(t("keys"),t("values"),t("entries"),!s&&u&&"values"!==f.name)try{o(f,"name",{value:"values"})}catch(p){}return od}function Ed(){if(ud)return dd;ud=1,bd();var e=sd?ad:(sd=1,ad={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}),t=Ci(),n=Ll(),r=fd();for(var o in e)n(t[o],o),r[o]=r.Array;return dd}var wd,Cd,Dd,Ad,Sd,xd,Od,Nd,Bd,Td,kd,Fd,Pd,Id,Rd,_d,Ld,Md,jd,Hd,zd,$d,Ud,Vd,Wd={};function Gd(){if(xd)return Sd;xd=1;var e=function(){if(cd)return ld;cd=1;var e=kc();return Ed(),ld=e}();return function(){if(wd)return Wd;wd=1;var e=ys(),t=fu().f,n=e("metadata"),r=Function.prototype;void 0===r[n]&&t(r,n,{value:null})}(),Cd||(Cd=1,sc()),Dd||(Dd=1,fc()),Ad||(Ad=1,Rl()("metadata")),Sd=e}function qd(){if(Nd)return Od;Nd=1;var e=Ba(),t=xi(),n=e("Symbol"),r=n.keyFor,o=t(n.prototype.valueOf);return Od=n.isRegisteredSymbol||function(e){try{return void 0!==r(o(e))}catch(t){return!1}}}function Kd(){if(kd)return Td;kd=1;for(var e=hs(),t=Ba(),n=xi(),r=Ia(),o=ys(),i=t("Symbol"),a=i.isWellKnownSymbol,s=t("Object","getOwnPropertyNames"),u=n(i.prototype.valueOf),l=e("wks"),c=0,d=s(i),f=d.length;c=p?e?"":void 0:(l=i(d,f))<55296||l>56319||f+1===p||(c=i(d,f+1))<56320||c>57343?e?o(d,f):l:e?a(d,f,f+2):c-56320+(l-55296<<10)+65536}};return Yd={codeAt:s(!1),charAt:s(!0)}}().charAt,t=xu(),n=Ml(),r=md(),o=yd(),i="String Iterator",a=n.set,s=n.getterFor(i);r(String,"String",function(e){a(this,{type:i,string:t(e),index:0})},function(){var t,n=s(this),r=n.string,i=n.index;return i>=r.length?o(void 0,!0):(t=e(r,i),n.index+=t.length,o(t,!1))})}(),wc(),Jd=Il().f("iterator"))}function ff(){return rf?nf:(rf=1,nf=function(){if(tf)return ef;tf=1;var e=df();return Ed(),ef=e}())}var pf=N(uf?sf:(uf=1,sf=af?of:(af=1,of=ff())));function hf(e){return(hf="function"==typeof lf&&"symbol"==typeof pf?function(e){return typeof e}:function(e){return e&&"function"==typeof lf&&e.constructor===lf&&e!==lf.prototype?"symbol":typeof e})(e)}var gf,vf={};if(function(){if(gf)return vf;gf=1;var e=hr(),t=B(),n=_(),r=bn().f,o=Fe();e({target:"Object",stat:!0,forced:!o||t(function(){r(1)}),sham:!o},{getOwnPropertyDescriptor:function(e,t){return r(n(e),t)}})}(),"object"===("undefined"==typeof global?"undefined":hf(global))){var mf=Object.getOwnPropertyDescriptor(global,"window");global.window&&!mf.set||(global.window=global,global.requestAnimationFrame=function(){},global.navigator={userAgent:""},global.location={hostname:"0.0.0.0",port:0,protocol:"http:"},global.btoa=function(){},global.crypto={getRandomValues:function(e){return nodeCrypto.randomFillSync(e)}}),null!=global.document&&null==global.document.getElementsByTagName&&(global.document.getElementsByTagName=function(){return[]})}var yf={transform(e,t){var{current:n,affinity:r}=e;if(null!=n){var o=Nf.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},bf={transform(e,t){var{current:n,affinity:r}=e;if(null!=n){var o=Op.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},Ef={transform(e,t){var{current:n,affinity:r}=e;if(null!=n){var o=If.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},wf=new WeakMap,Cf=new WeakMap,Df=new WeakMap,Af=new WeakMap,Sf=new WeakMap,xf=new WeakMap,Of=new WeakMap,Nf={ancestors(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,r=Nf.levels(e,t);return n?r.slice(1):r.slice(0,-1)},common(e,t){for(var n=[],r=0;rt[r])return 1}return 0},endsAfter(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],a=t[n];return Nf.equals(r,o)&&i>a},endsAt(e,t){var n=e.length,r=e.slice(0,n),o=t.slice(0,n);return Nf.equals(r,o)},endsBefore(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],a=t[n];return Nf.equals(r,o)&&ie.length===t.length&&e.every((e,n)=>e===t[n]),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>1===Nf.compare(e,t),isAncestor:(e,t)=>e.length-1===Nf.compare(e,t),isChild:(e,t)=>e.length===t.length+1&&0===Nf.compare(e,t),isCommon:(e,t)=>e.length<=t.length&&0===Nf.compare(e,t),isDescendant:(e,t)=>e.length>t.length&&0===Nf.compare(e,t),isParent:(e,t)=>e.length+1===t.length&&0===Nf.compare(e,t),isPath:e=>Array.isArray(e)&&e.every(e=>"number"==typeof e),isSibling(e,t){if(e.length!==t.length)return!1;var n=e.slice(0,-1),r=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&Nf.equals(n,r)},levels(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,r=[],o=0;o<=e.length;o++)r.push(e.slice(0,o));return n&&r.reverse(),r},next(e){if(0===e.length)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(0===e.length)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(0===e.length)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!Nf.isAncestor(t,e)&&!Nf.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return null;var r=[...e],{affinity:o="forward"}=n;if(0===e.length)return r;switch(t.type){case"insert_node":var{path:i}=t;(Nf.equals(i,r)||Nf.endsBefore(i,r)||Nf.isAncestor(i,r))&&(r[i.length-1]+=1);break;case"remove_node":var{path:a}=t;if(Nf.equals(a,r)||Nf.isAncestor(a,r))return null;Nf.endsBefore(a,r)&&(r[a.length-1]-=1);break;case"merge_node":var{path:s,position:u}=t;Nf.equals(s,r)||Nf.endsBefore(s,r)?r[s.length-1]-=1:Nf.isAncestor(s,r)&&(r[s.length-1]-=1,r[s.length]+=u);break;case"split_node":var{path:l,position:c}=t;if(Nf.equals(l,r)){if("forward"===o)r[r.length-1]+=1;else if("backward"!==o)return null}else Nf.endsBefore(l,r)?r[l.length-1]+=1:Nf.isAncestor(l,r)&&e[l.length]>=c&&(r[l.length-1]+=1,r[l.length]-=c);break;case"move_node":var{path:d,newPath:f}=t;if(Nf.equals(d,f))return r;if(Nf.isAncestor(d,r)||Nf.equals(d,r)){var p=f.slice();return Nf.endsBefore(d,f)&&d.length=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Ff=["anchor","focus"];function Pf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var If={edges(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,{anchor:r,focus:o}=e;return If.isBackward(e)===n?[r,o]:[o,r]},end(e){var[,t]=If.edges(e);return t},equals:(e,t)=>Op.equals(e.anchor,t.anchor)&&Op.equals(e.focus,t.focus),surrounds(e,t){var n=If.intersection(e,t);return!!n&&If.equals(n,t)},includes(e,t){if(Ap.isRange(t)){if(If.includes(e,t.anchor)||If.includes(e,t.focus))return!0;var[n,r]=If.edges(e),[o,i]=If.edges(t);return Op.isBefore(n,o)&&Op.isAfter(r,i)}var[a,s]=If.edges(e),u=!1,l=!1;return Ap.isPoint(t)?(u=Op.compare(t,a)>=0,l=Op.compare(t,s)<=0):(u=Nf.compare(t,a.path)>=0,l=Nf.compare(t,s.path)<=0),u&&l},intersection(e,t){var n=kf(e,Ff),[r,o]=If.edges(e),[i,a]=If.edges(t),s=Op.isBefore(r,i)?i:r,u=Op.isBefore(o,a)?o:a;return Op.isBefore(u,s)?null:function(e){for(var t=1;t!If.isCollapsed(e),isForward:e=>!If.isBackward(e),isRange:e=>qf(e)&&Op.isPoint(e.anchor)&&Op.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=If.edges(e);return t},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===e)return null;var r,o,{affinity:i="inward"}=n;if("inward"===i){var a=If.isCollapsed(e);If.isForward(e)?(r="forward",o=a?r:"backward"):(r="backward",o=a?r:"forward")}else"outward"===i?If.isForward(e)?(r="backward",o="forward"):(r="forward",o="backward"):(r=i,o=i);var s=Op.transform(e.anchor,t,{affinity:r}),u=Op.transform(e.focus,t,{affinity:o});return s&&u?{anchor:s,focus:u}:null}},Rf=function(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!qf(e)&&"function"!=typeof e.apply&&(t?zf.isNodeList(e.children):Array.isArray(e.children))},_f={isAncestor(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return qf(e)&&zf.isNodeList(e.children,{deep:t})},isElement:Rf,isElementList(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)&&e.every(e=>_f.isElement(e,{deep:t}))},isElementProps:e=>void 0!==e.children,isElementType:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type";return Rf(e)&&e[n]===t},matches(e,t){for(var n in t)if("children"!==n&&e[n]!==t[n])return!1;return!0}},Lf=["text"],Mf=["children"];function jf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Hf(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var r of Nf.ancestors(t,n)){var o=[zf.ancestor(e,r),r];yield o}}()},child(e,t){if(zf.isText(e))throw new Error("Cannot get the child of a text node: ".concat(Bp.stringify(e)));var n=e.children[t];if(null==n)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(Bp.stringify(e)));return n},children(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var{reverse:r=!1}=n,o=zf.ancestor(e,t),{children:i}=o,a=r?i.length-1:0;r?a>=0:a1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of zf.nodes(e,t))0!==r.length&&(yield[n,r])}()},elements(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of zf.nodes(e,t))zf.isElement(n)&&(yield[n,r])}()},extractProps:e=>zf.isText(e)?kf(e,Lf):kf(e,Mf),first(e,t){for(var n=t.slice(),r=zf.get(e,n);r&&!zf.isText(r)&&0!==r.children.length;)r=r.children[0],n.push(0);return[r,n]},fragment(e,t){var n={children:e.children},[r,o]=If.edges(t),i=zf.nodes(n,{reverse:!0,pass:e=>{var[,n]=e;return!If.includes(t,n)}}),a=function(){if(!If.includes(t,s)){var e=s[s.length-1];zp(n,Nf.parent(s),t=>jp(t,e,1))}Nf.equals(s,o.path)&&$p(n,s,e=>{var t=e.text.slice(0,o.offset);return Hf(Hf({},e),{},{text:t})}),Nf.equals(s,r.path)&&$p(n,s,e=>{var t=e.text.slice(r.offset);return Hf(Hf({},e),{},{text:t})})};for(var[,s]of i)a();return n.children},get(e,t){var n=zf.getIf(e,t);if(void 0===n)throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(Bp.stringify(e)));return n},getIf(e,t){for(var n=e,r=0;r!zf.isText(e),isEditor:e=>"function"==typeof e.apply,isElement:e=>Array.isArray(e.children)&&"function"!=typeof e.apply,isNode(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ip.isText(e)||_f.isElement(e,{deep:t})||Dp.isEditor(e,{deep:t})},isNodeList(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)&&e.every(e=>zf.isNode(e,{deep:t}))},isText:e=>"string"==typeof e.text,last(e,t){for(var n=t.slice(),r=zf.get(e,n);r&&!zf.isText(r)&&0!==r.children.length;){var o=r.children.length-1;r=r.children[o],n.push(o)}return[r,n]},leaf(e,t){var n=zf.get(e,t);if(!zf.isText(n))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Bp.stringify(n)));return n},levels(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var r of Nf.levels(t,n)){var o=zf.get(e,r);yield[o,r]}}()},matches:(e,t)=>zf.isElement(e)&&_f.isElementProps(t)&&_f.matches(e,t)||zf.isText(e)&&Ip.isTextProps(t)&&Ip.matches(e,t),nodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var{pass:n,reverse:r=!1}=t,{from:o=[],to:i}=t,a=new Set,s=[],u=e;!i||!(r?Nf.isBefore(s,i):Nf.isAfter(s,i));)if(a.has(u)||(yield[u,s]),a.has(u)||zf.isText(u)||0===u.children.length||null!=n&&!1!==n([u,s])){if(0===s.length)break;if(!r){var l=Nf.next(s);if(zf.has(e,l)){s=l,u=zf.get(e,s);continue}}r&&0!==s[s.length-1]?(s=Nf.previous(s),u=zf.get(e,s)):(s=Nf.parent(s),u=zf.get(e,s),a.add(u))}else{a.add(u);var c=r?u.children.length-1:0;Nf.isAncestor(s,o)&&(c=o[s.length]),s=s.concat(c),u=zf.get(e,s)}}()},parent(e,t){var n=Nf.parent(t),r=zf.get(e,n);if(zf.isText(r))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return r},string:e=>zf.isText(e)?e.text:e.children.map(zf.string).join(""),texts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of zf.nodes(e,t))zf.isText(n)&&(yield[n,r])}()}};function $f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Uf(e){for(var t=1;tGf.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!qf(e))return!1;switch(e.type){case"insert_node":case"remove_node":return Nf.isPath(e.path)&&zf.isNode(e.node);case"insert_text":case"remove_text":return"number"==typeof e.offset&&"string"==typeof e.text&&Nf.isPath(e.path);case"merge_node":return"number"==typeof e.position&&Nf.isPath(e.path)&&qf(e.properties);case"move_node":return Nf.isPath(e.path)&&Nf.isPath(e.newPath);case"set_node":return Nf.isPath(e.path)&&qf(e.properties)&&qf(e.newProperties);case"set_selection":return null===e.properties&&If.isRange(e.newProperties)||null===e.newProperties&&If.isRange(e.properties)||qf(e.properties)&&qf(e.newProperties);case"split_node":return Nf.isPath(e.path)&&"number"==typeof e.position&&qf(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every(e=>Gf.isOperation(e)),isSelectionOperation:e=>Gf.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>Gf.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return Uf(Uf({},e),{},{type:"remove_node"});case"insert_text":return Uf(Uf({},e),{},{type:"remove_text"});case"merge_node":return Uf(Uf({},e),{},{type:"split_node",path:Nf.previous(e.path)});case"move_node":var{newPath:t,path:n}=e;if(Nf.equals(t,n))return e;if(Nf.isSibling(n,t))return Uf(Uf({},e),{},{path:t,newPath:n});var r=Nf.transform(n,e),o=Nf.transform(Nf.next(n),e);return Uf(Uf({},e),{},{path:r,newPath:o});case"remove_node":return Uf(Uf({},e),{},{type:"insert_node"});case"remove_text":return Uf(Uf({},e),{},{type:"insert_text"});case"set_node":var{properties:i,newProperties:a}=e;return Uf(Uf({},e),{},{properties:a,newProperties:i});case"set_selection":var{properties:s,newProperties:u}=e;return Uf(Uf({},e),{},null==s?{properties:u,newProperties:null}:null==u?{properties:null,newProperties:s}:{properties:u,newProperties:s});case"split_node":return Uf(Uf({},e),{},{type:"merge_node",path:Nf.next(e.path)})}}},qf=e=>"object"==typeof e&&null!==e,Kf=(e,t)=>{for(var n in e){var r=e[n],o=t[n];if(Array.isArray(r)&&Array.isArray(o)){if(r.length!==o.length)return!1;for(var i=0;ie.selection?e.selection:e.children.length>0?Dp.end(e,[]):[0],Xf=(e,t)=>{var[n]=Dp.node(e,t);return e=>e===n},Zf=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!t,r=t?rp(e):e,o=Vf.None,i=Vf.None,a=0,s=null;for(var u of r){var l=u.codePointAt(0);if(!l)break;var c=gp(u,l);if([o,i]=n?[i,c]:[c,o],vp(o,Vf.ZWJ)&&vp(i,Vf.ExtPict)&&!Ep(n?e.substring(0,a):e.substring(0,e.length-a)))break;if(vp(o,Vf.RI)&&vp(i,Vf.RI)&&!(s=null!==s?!s:!!n||Cp(e.substring(0,e.length-a))))break;if(o!==Vf.None&&i!==Vf.None&&yp(o,i))break;a+=u.length}return a||1},Jf=/\s/,Qf=/[\u002B\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,ep=/['\u2018\u2019]/,tp=(e,t,n)=>{if(n){var r=e.length-t;return[e.slice(r,e.length),e.slice(0,r)]}return[e.slice(0,t),e.slice(t)]},np=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Jf.test(t))return!1;if(ep.test(t)){var o=Zf(n,r),[i,a]=tp(n,o,r);if(e(i,a,r))return!0}return!Qf.test(t)},rp=function*(e){for(var t=e.length-1,n=0;ne>=55296&&e<=56319,ip=e=>e>=56320&&e<=57343;(Wf=Vf||(Vf={}))[Wf.None=0]="None",Wf[Wf.Extend=1]="Extend",Wf[Wf.ZWJ=2]="ZWJ",Wf[Wf.RI=4]="RI",Wf[Wf.Prepend=8]="Prepend",Wf[Wf.SpacingMark=16]="SpacingMark",Wf[Wf.L=32]="L",Wf[Wf.V=64]="V",Wf[Wf.T=128]="T",Wf[Wf.LV=256]="LV",Wf[Wf.LVT=512]="LVT",Wf[Wf.ExtPict=1024]="ExtPict",Wf[Wf.Any=2048]="Any";var ap=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,sp=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,up=/^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,lp=/^[\u1100-\u115F\uA960-\uA97C]$/,cp=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,dp=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,fp=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/,pp=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/,hp=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,gp=(e,t)=>{var n=Vf.Any;return-1!==e.search(ap)&&(n|=Vf.Extend),8205===t&&(n|=Vf.ZWJ),t>=127462&&t<=127487&&(n|=Vf.RI),-1!==e.search(sp)&&(n|=Vf.Prepend),-1!==e.search(up)&&(n|=Vf.SpacingMark),-1!==e.search(lp)&&(n|=Vf.L),-1!==e.search(cp)&&(n|=Vf.V),-1!==e.search(dp)&&(n|=Vf.T),-1!==e.search(fp)&&(n|=Vf.LV),-1!==e.search(pp)&&(n|=Vf.LVT),-1!==e.search(hp)&&(n|=Vf.ExtPict),n};function vp(e,t){return 0!==(e&t)}var mp=[[Vf.L,Vf.L|Vf.V|Vf.LV|Vf.LVT],[Vf.LV|Vf.V,Vf.V|Vf.T],[Vf.LVT|Vf.T,Vf.T],[Vf.Any,Vf.Extend|Vf.ZWJ],[Vf.Any,Vf.SpacingMark],[Vf.Prepend,Vf.Any],[Vf.ZWJ,Vf.ExtPict],[Vf.RI,Vf.RI]];function yp(e,t){return-1===mp.findIndex(n=>vp(e,n[0])&&vp(t,n[1]))}var bp=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,Ep=e=>-1!==e.search(bp),wp=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,Cp=e=>{var t=e.match(wp);return null!==t&&t[0].length/2%2==1},Dp={above:(e,t)=>e.above(t),addMark(e,t,n){e.addMark(t,n)},after:(e,t,n)=>e.after(t,n),before:(e,t,n)=>e.before(t,n),deleteBackward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:n="character"}=t;e.deleteBackward(n)},deleteForward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:n="character"}=t;e.deleteForward(n)},deleteFragment(e,t){e.deleteFragment(t)},edges:(e,t)=>e.edges(t),elementReadOnly(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.elementReadOnly(t)},end:(e,t)=>e.end(t),first:(e,t)=>e.first(t),fragment:(e,t)=>e.fragment(t),hasBlocks:(e,t)=>e.hasBlocks(t),hasInlines:(e,t)=>e.hasInlines(t),hasPath:(e,t)=>e.hasPath(t),hasTexts:(e,t)=>e.hasTexts(t),insertBreak(e){e.insertBreak()},insertFragment(e,t,n){e.insertFragment(t,n)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock:(e,t)=>e.isBlock(t),isEdge:(e,t,n)=>e.isEdge(t,n),isEditor:function(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!qf(e)&&("function"==typeof e.above&&"function"==typeof e.addMark&&"function"==typeof e.after&&"function"==typeof e.apply&&"function"==typeof e.before&&"function"==typeof e.collapse&&"function"==typeof e.delete&&"function"==typeof e.deleteBackward&&"function"==typeof e.deleteForward&&"function"==typeof e.deleteFragment&&"function"==typeof e.deselect&&"function"==typeof e.edges&&"function"==typeof e.elementReadOnly&&"function"==typeof e.end&&"function"==typeof e.first&&"function"==typeof e.fragment&&"function"==typeof e.getDirtyPaths&&"function"==typeof e.getFragment&&"function"==typeof e.getMarks&&"function"==typeof e.hasBlocks&&"function"==typeof e.hasInlines&&"function"==typeof e.hasPath&&"function"==typeof e.hasTexts&&"function"==typeof e.insertBreak&&"function"==typeof e.insertFragment&&"function"==typeof e.insertNode&&"function"==typeof e.insertNodes&&"function"==typeof e.insertSoftBreak&&"function"==typeof e.insertText&&"function"==typeof e.isBlock&&"function"==typeof e.isEdge&&"function"==typeof e.isElementReadOnly&&"function"==typeof e.isEmpty&&"function"==typeof e.isEnd&&"function"==typeof e.isInline&&"function"==typeof e.isNormalizing&&"function"==typeof e.isSelectable&&"function"==typeof e.isStart&&"function"==typeof e.isVoid&&"function"==typeof e.last&&"function"==typeof e.leaf&&"function"==typeof e.levels&&"function"==typeof e.liftNodes&&"function"==typeof e.markableVoid&&"function"==typeof e.mergeNodes&&"function"==typeof e.move&&"function"==typeof e.moveNodes&&"function"==typeof e.next&&"function"==typeof e.node&&"function"==typeof e.nodes&&"function"==typeof e.normalize&&"function"==typeof e.normalizeNode&&"function"==typeof e.onChange&&"function"==typeof e.parent&&"function"==typeof e.path&&"function"==typeof e.pathRef&&"function"==typeof e.pathRefs&&"function"==typeof e.point&&"function"==typeof e.pointRef&&"function"==typeof e.pointRefs&&"function"==typeof e.positions&&"function"==typeof e.previous&&"function"==typeof e.range&&"function"==typeof e.rangeRef&&"function"==typeof e.rangeRefs&&"function"==typeof e.removeMark&&"function"==typeof e.removeNodes&&"function"==typeof e.select&&"function"==typeof e.setNodes&&"function"==typeof e.setNormalizing&&"function"==typeof e.setPoint&&"function"==typeof e.setSelection&&"function"==typeof e.shouldMergeNodesRemovePrevNode&&"function"==typeof e.shouldNormalize&&"function"==typeof e.splitNodes&&"function"==typeof e.start&&"function"==typeof e.string&&"function"==typeof e.unhangRange&&"function"==typeof e.unsetNodes&&"function"==typeof e.unwrapNodes&&"function"==typeof e.void&&"function"==typeof e.withoutNormalizing&&"function"==typeof e.wrapNodes&&(null===e.marks||qf(e.marks))&&(null===e.selection||If.isRange(e.selection))&&(t?zf.isNodeList(e.children)&&Gf.isOperationList(e.operations):Array.isArray(e.children)&&Array.isArray(e.operations)))},isElementReadOnly:(e,t)=>e.isElementReadOnly(t),isEmpty:(e,t)=>e.isEmpty(t),isEnd:(e,t,n)=>e.isEnd(t,n),isInline:(e,t)=>e.isInline(t),isNormalizing:e=>e.isNormalizing(),isSelectable:(e,t)=>e.isSelectable(t),isStart:(e,t,n)=>e.isStart(t,n),isVoid:(e,t)=>e.isVoid(t),last:(e,t)=>e.last(t),leaf:(e,t,n)=>e.leaf(t,n),levels:(e,t)=>e.levels(t),marks:e=>e.getMarks(),next:(e,t)=>e.next(t),node:(e,t,n)=>e.node(t,n),nodes:(e,t)=>e.nodes(t),normalize(e,t){e.normalize(t)},parent:(e,t,n)=>e.parent(t,n),path:(e,t,n)=>e.path(t,n),pathRef:(e,t,n)=>e.pathRef(t,n),pathRefs:e=>e.pathRefs(),point:(e,t,n)=>e.point(t,n),pointRef:(e,t,n)=>e.pointRef(t,n),pointRefs:e=>e.pointRefs(),positions:(e,t)=>e.positions(t),previous:(e,t)=>e.previous(t),range:(e,t,n)=>e.range(t,n),rangeRef:(e,t,n)=>e.rangeRef(t,n),rangeRefs:e=>e.rangeRefs(),removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start:(e,t)=>e.start(t),string:(e,t,n)=>e.string(t,n),unhangRange:(e,t,n)=>e.unhangRange(t,n),void:(e,t)=>e.void(t),withoutNormalizing(e,t){e.withoutNormalizing(t)},shouldMergeNodesRemovePrevNode:(e,t,n)=>e.shouldMergeNodesRemovePrevNode(t,n)},Ap={isLocation:e=>Nf.isPath(e)||Op.isPoint(e)||If.isRange(e),isPath:e=>Array.isArray(e),isPoint:e=>"offset"in e,isRange:e=>"anchor"in e,isSpan:e=>Array.isArray(e)&&Array.isArray(e[0])};function Sp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xp(e){for(var t=1;tt.offset?1:0:n},isAfter:(e,t)=>1===Op.compare(e,t),isBefore:(e,t)=>-1===Op.compare(e,t),equals:(e,t)=>e.offset===t.offset&&Nf.equals(e.path,t.path),isPoint:e=>qf(e)&&"number"==typeof e.offset&&Nf.isPath(e.path),transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===e)return null;var{affinity:r="forward"}=n,{path:o,offset:i}=e;switch(t.type){case"insert_node":case"move_node":o=Nf.transform(o,t,n);break;case"insert_text":Nf.equals(t.path,o)&&(t.offsetJSON.stringify(e,Np)},Tp=["text"],kp=["anchor","focus","merge"];function Fp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Pp(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},{loose:r=!1}=n;function o(e){return kf(e,Tp)}return Kf(r?o(e):e,r?o(t):t)},isText:e=>qf(e)&&"string"==typeof e.text,isTextList:e=>Array.isArray(e)&&e.every(e=>Ip.isText(e)),isTextProps:e=>void 0!==e.text,matches(e,t){for(var n in t)if("text"!==n&&(!e.hasOwnProperty(n)||e[n]!==t[n]))return!1;return!0},decorations(e,t){var n=[{leaf:Pp({},e)}];for(var r of t){var{anchor:o,focus:i,merge:a}=r,s=kf(r,kp),[u,l]=If.edges(r),c=[],d=0,f=u.offset,p=l.offset,h=null!=a?a:Object.assign;for(var{leaf:g}of n){var{length:v}=g.text,m=d;if(d+=v,f<=m&&d<=p)h(g,s),c.push({leaf:g});else if(f!==p&&(f===d||p===m)||f>d||pm){var C=f-m;b={leaf:Pp(Pp({},y),{},{text:y.text.slice(0,C)})},y=Pp(Pp({},y),{},{text:y.text.slice(C)})}h(y,s),b&&c.push(b),c.push({leaf:y}),E&&c.push(E)}}n=c}if(n.length>1){var D=0;for(var[A,S]of n.entries()){var x=D,O=x+S.leaf.text.length,N={start:x,end:O};0===A&&(N.isFirst=!0),A===n.length-1&&(N.isLast=!0),S.position=N,D=O}}return n}};function Rp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _p(e){for(var t=1;t2?n-2:0),o=2;o3?r-3:0),i=3;i{if(0===t.length)throw new Error("Cannot modify the editor");for(var r=zf.get(e,t),o=t.slice(),i=n(r);o.length>1;){var a=o.pop(),s=zf.get(e,o);i=_p(_p({},s),{},{children:Mp(s.children,a,1,i)})}var u=o.pop();e.children=Mp(e.children,u,1,i)},zp=(e,t,n)=>{0===t.length?e.children=n(e.children):Hp(e,t,e=>{if(zf.isText(e))throw new Error("Cannot get the element at path [".concat(t,"] because it refers to a leaf node: ").concat(Bp.stringify(e)));return _p(_p({},e),{},{children:n(e.children)})})},$p=(e,t,n)=>Hp(e,t,e=>{if(!zf.isText(e))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Bp.stringify(e)));return n(e)});function Up(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Vp(e){for(var t=1;t{var t=r[r.length-1];if(t>e.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(r,"] because the destination is past the end of the node."));return Lp(e,t,o)}),n=!0;break;case"insert_text":var{path:i,offset:a,text:s}=t;if(0===s.length)break;$p(e,i,e=>{var t=e.text.slice(0,a),n=e.text.slice(a);return Vp(Vp({},e),{},{text:t+s+n})}),n=!0;break;case"merge_node":var{path:u}=t,l=u[u.length-1],c=Nf.previous(u),d=c[c.length-1];zp(e,Nf.parent(u),e=>{var t,n=e[l],r=e[d];if(zf.isText(n)&&zf.isText(r))t=Vp(Vp({},r),{},{text:r.text+n.text});else{if(!zf.isElement(n)||!zf.isElement(r))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(u,"] to nodes of different interfaces: ").concat(Bp.stringify(n)," ").concat(Bp.stringify(r)));t=Vp(Vp({},r),{},{children:r.children.concat(n.children)})}return Mp(e,d,2,t)}),n=!0;break;case"move_node":var{path:f,newPath:p}=t,h=f[f.length-1];if(Nf.isAncestor(f,p))throw new Error("Cannot move a path [".concat(f,"] to new path [").concat(p,"] because the destination is inside itself."));var g=zf.get(e,f);zp(e,Nf.parent(f),e=>jp(e,h,1));var v=Nf.transform(f,t),m=v[v.length-1];zp(e,Nf.parent(v),e=>Lp(e,m,g)),n=!0;break;case"remove_node":var{path:y}=t,b=y[y.length-1];if(zp(e,Nf.parent(y),e=>jp(e,b,1)),e.selection){var E=Vp({},e.selection);for(var[w,C]of If.points(E)){var D=Op.transform(w,t);if(null!=E&&null!=D)E[C]=D;else{var A=void 0,S=void 0;for(var[x,O]of zf.texts(e)){if(-1!==Nf.compare(O,y)){S=[x,O];break}A=[x,O]}var N=!1;A&&S&&(N=!Nf.isSibling(A[1],y)&&(!!Nf.equals(S[1],y)||Nf.common(A[1],y).length{var t=e.text.slice(0,T),n=e.text.slice(T+k.length);return Vp(Vp({},e),{},{text:t+n})}),n=!0;break;case"set_node":var{path:F,properties:P,newProperties:I}=t;if(0===F.length)throw new Error("Cannot set properties on the root node!");Hp(e,F,e=>{var t=Vp({},e);for(var n in I){if("children"===n||"text"===n)throw new Error('Cannot set the "'.concat(n,'" property of nodes!'));var r=I[n];null==r?delete t[n]:t[n]=r}for(var o in P)I.hasOwnProperty(o)||delete t[o];return t});break;case"set_selection":var{newProperties:R}=t;if(null==R){e.selection=null;break}if(null==e.selection){if(!R.anchor||!R.focus)throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(Bp.stringify(R)," when there is no current selection."));e.selection=Vp({},R);break}var _=Vp({},e.selection);for(var L in R){var M=R[L];if(null==M){if("anchor"===L||"focus"===L)throw new Error('Cannot remove the "'.concat(L,'" selection property'));delete _[L]}else _[L]=M}e.selection=_;break;case"split_node":var{path:j,position:H,properties:z}=t,$=j[j.length-1];if(0===j.length)throw new Error('Cannot apply a "split_node" operation at path ['.concat(j,"] because the root node cannot be split."));zp(e,Nf.parent(j),e=>{var t,n,r=e[$];if(zf.isText(r)){var o=r.text.slice(0,H),i=r.text.slice(H);t=Vp(Vp({},r),{},{text:o}),n=Vp(Vp({},z),{},{text:i})}else{var a=r.children.slice(0,H),s=r.children.slice(H);t=Vp(Vp({},r),{},{children:a}),n=Vp(Vp({},z),{},{children:s})}return Mp(e,$,1,t,n)}),n=!0}if(n&&e.selection){var U=Vp({},e.selection);for(var[V,W]of If.points(U))U[W]=Op.transform(V,t);If.equals(U,e.selection)||(e.selection=U)}}},Gp={insertNodes(e,t,n){e.insertNodes(t,n)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,n){e.setNodes(t,n)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,n){e.unsetNodes(t,n)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,n){e.wrapNodes(t,n)}},qp={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,n){e.setPoint(t,n)},setSelection(e,t){e.setSelection(t)}},Kp={delete(e,t){e.delete(t)},insertFragment(e,t,n){e.insertFragment(t,n)},insertText(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Dp.withoutNormalizing(e,()=>{var{voids:r=!1}=n,{at:o=Yf(e)}=n;if(Ap.isPath(o)&&(o=Dp.range(e,o)),Ap.isRange(o))if(If.isCollapsed(o))o=o.anchor;else{var i=If.end(o);if(!r&&Dp.void(e,{at:i}))return;var a=If.start(o),s=Dp.pointRef(e,a),u=Dp.pointRef(e,i);Zp.delete(e,{at:o,voids:r});var l=s.unref(),c=u.unref();o=l||c,Zp.setSelection(e,{anchor:o,focus:o})}if(!(!r&&Dp.void(e,{at:o})||Dp.elementReadOnly(e,{at:o}))){var{path:d,offset:f}=o;t.length>0&&e.apply({type:"insert_text",path:d,offset:f,text:t})}})}};function Yp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Xp(e){for(var t=1;t{if(e){var t=e.join(",");o.has(t)||(o.add(t),r.push(e))}};if(n)for(var u of(r=[],o=new Set,i))s(n(u));else r=i,o=a;for(var l of t)s(l);wf.set(e,r),Cf.set(e,o)}function eh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function th(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Dp.withoutNormalizing(e,()=>{var{hanging:r=!1,voids:o=!1,mode:i="lowest",batchDirty:a=!0}=n,{at:s,match:u,select:l}=n;if(zf.isNode(t)&&(t=[t]),0!==t.length){var[c]=t;if(s||(s=Yf(e),!1!==l&&(l=!0)),null==l&&(l=!1),Ap.isRange(s))if(r||(s=Dp.unhangRange(e,s,{voids:o})),If.isCollapsed(s))s=s.anchor;else{var[,d]=If.edges(s),f=Dp.pointRef(e,d);Zp.delete(e,{at:s}),s=f.unref()}if(Ap.isPoint(s)){null==u&&(u=zf.isText(c)?e=>zf.isText(e):e.isInline(c)?t=>zf.isText(t)||Dp.isInline(e,t):t=>zf.isElement(t)&&Dp.isBlock(e,t));var[p]=Dp.nodes(e,{at:s.path,match:u,mode:i,voids:o});if(!p)return;var[,h]=p,g=Dp.pathRef(e,h),v=Dp.isEnd(e,s,h);Zp.splitNodes(e,{at:s,match:u,mode:i,voids:o});var m=g.unref();s=v?Nf.next(m):m}var y=Nf.parent(s),b=s[s.length-1];if(o||!Dp.void(e,{at:y})){if(a){var E=[],w=Nf.levels(y);(n=>{var r=Jp.get(n)||!1;Jp.set(n,!0);try{(()=>{var n=function(){var t=y.concat(b);b++;var n={type:"insert_node",path:t,node:r};e.apply(n),s=Nf.next(s),E.push(n),zf.isText(r)?w.push(t):w.push(...Array.from(zf.nodes(r),e=>{var[,n]=e;return t.concat(n)}))};for(var r of t)n()})(),Qp(e,w,e=>{var t=e;for(var n of E)if(Nf.operationCanTransformPath(n)&&!(t=Nf.transform(t,n)))return null;return t})}finally{Jp.set(n,r)}})(e)}else for(var C of t){var D=y.concat(b);b++,e.apply({type:"insert_node",path:D,node:C}),s=Nf.next(s)}if(s=Nf.previous(s),l){var A=Dp.end(e,s);A&&Zp.select(e,A)}}}})},mh=["text"],yh=["children"],bh=(e,t)=>t!==e&&(zf.isText(t)||Dp.isVoid(e,t)||1===t.children.length&&bh(e,t.children[0]));function Eh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wh(e){for(var t=1;t{var e={children:[],operations:[],selection:null,marks:null,isElementReadOnly:()=>!1,isInline:()=>!1,isSelectable:()=>!0,isVoid:()=>!1,markableVoid:()=>!1,onChange:()=>{},apply:function(){for(var t=arguments.length,n=new Array(t),r=0;r{for(var n of Dp.pathRefs(e))yf.transform(n,t);for(var r of Dp.pointRefs(e))bf.transform(r,t);for(var o of Dp.rangeRefs(e))Ef.transform(o,t);if(a=e,!Jp.get(a)){var i=Nf.operationCanTransformPath(t)?e=>Nf.transform(e,t):void 0;Qp(e,e.getDirtyPaths(t),i)}var a;Zp.transform(e,t),e.operations.push(t),Dp.normalize(e,{operation:t}),"set_selection"===t.type&&(e.marks=null),Df.get(e)||(Df.set(e,!0),Promise.resolve().then(()=>{Df.set(e,!1),e.onChange({operation:t}),e.operations=[]}))})(e,...n)},addMark:function(){for(var t=arguments.length,n=new Array(t),r=0;r{var{selection:r}=e;if(r){var o=(t,n)=>{if(!zf.isText(t))return!1;var[r,o]=Dp.parent(e,n);return!e.isVoid(r)||e.markableVoid(r)},i=If.isExpanded(r),a=!1;if(!i){var[s,u]=Dp.node(e,r);if(s&&o(s,u)){var[l]=Dp.parent(e,u);a=l&&e.markableVoid(l)}}if(i||a)Zp.setNodes(e,{[t]:n},{match:o,split:!0,voids:!0});else{var c=th(th({},Dp.marks(e)||{}),{},{[t]:n});e.marks=c,Df.get(e)||e.onChange()}}})(e,...n)},deleteBackward:function(){for(var t=arguments.length,n=new Array(t),r=0;r{var{selection:n}=e;n&&If.isCollapsed(n)&&Zp.delete(e,{unit:t,reverse:!0})})(e,...n)},deleteForward:function(){for(var t=arguments.length,n=new Array(t),r=0;r{var{selection:n}=e;n&&If.isCollapsed(n)&&Zp.delete(e,{unit:t})})(e,...n)},deleteFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},{selection:n}=e;n&&If.isExpanded(n)&&Zp.delete(e,{reverse:"backward"===t})}(e,...n)},getFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r{var{selection:t}=e;return t?zf.fragment(e,t):[]})(e,...n)},insertBreak:function(){for(var t=arguments.length,n=new Array(t),r=0;r{Zp.splitNodes(e,{always:!0})})(e,...n)},insertSoftBreak:function(){for(var t=arguments.length,n=new Array(t),r=0;r{Zp.splitNodes(e,{always:!0})})(e,...n)},insertFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Dp.withoutNormalizing(e,()=>{var{hanging:r=!1,voids:o=!1}=n,{at:i=Yf(e),batchDirty:a=!0}=n;if(t.length){if(Ap.isRange(i))if(r||(i=Dp.unhangRange(e,i,{voids:o})),If.isCollapsed(i))i=i.anchor;else{var[,s]=If.edges(i);if(!o&&Dp.void(e,{at:s}))return;var u=Dp.pointRef(e,s);Zp.delete(e,{at:i}),i=u.unref()}else Ap.isPath(i)&&(i=Dp.start(e,i));if(o||!Dp.void(e,{at:i})){var l=Dp.above(e,{at:i,match:t=>zf.isElement(t)&&Dp.isInline(e,t),mode:"highest",voids:o});if(l){var[,c]=l;Dp.isEnd(e,i,c)?i=Dp.after(e,c):Dp.isStart(e,i,c)&&(i=Dp.before(e,c))}var d=Dp.above(e,{match:t=>zf.isElement(t)&&Dp.isBlock(e,t),at:i,voids:o}),[,f]=d,p=Dp.isStart(e,i,f),h=Dp.isEnd(e,i,f),g=p&&h,[,v]=zf.first({children:t},[]),[,m]=zf.last({children:t},[]),y=t=>{var[n,r]=t;return!(0===r.length||!g&&(!p&&Nf.isAncestor(r,v)&&zf.isElement(n)&&!e.isVoid(n)&&!e.isInline(n)||!h&&Nf.isAncestor(r,m)&&zf.isElement(n)&&!e.isVoid(n)&&!e.isInline(n)))},b=!0,E=[],w=[],C=[];for(var D of zf.nodes({children:t},{pass:y})){var[A,S]=D;b&&zf.isElement(A)&&!e.isInline(A)&&!Nf.isAncestor(S,v)&&(b=!1),y(D)&&(zf.isElement(A)&&!e.isInline(A)?(b=!1,w.push(A)):b?E.push(A):C.push(A))}var[x]=Dp.nodes(e,{at:i,match:t=>zf.isText(t)||Dp.isInline(e,t),mode:"highest",voids:o}),[,O]=x,N=Dp.isStart(e,i,O),B=Dp.isEnd(e,i,O),T=Dp.pathRef(e,h&&!C.length?Nf.next(f):f),k=Dp.pathRef(e,B?Nf.next(O):O),F=C.length>0;Zp.splitNodes(e,{at:i,match:t=>F?zf.isElement(t)&&Dp.isBlock(e,t):zf.isText(t)||Dp.isInline(e,t),mode:F?"lowest":"highest",always:F&&(!p||E.length>0)&&(!h||C.length>0),voids:o});var P,I=Dp.pathRef(e,!N||N&&B?Nf.next(O):O);if(Zp.insertNodes(e,E,{at:I.current,match:t=>zf.isText(t)||Dp.isInline(e,t),mode:"highest",voids:o,batchDirty:a}),g&&!E.length&&w.length&&!C.length&&Zp.delete(e,{at:f,voids:o}),Zp.insertNodes(e,w,{at:T.current,match:t=>zf.isElement(t)&&Dp.isBlock(e,t),mode:"lowest",voids:o,batchDirty:a}),Zp.insertNodes(e,C,{at:k.current,match:t=>zf.isText(t)||Dp.isInline(e,t),mode:"highest",voids:o,batchDirty:a}),!n.at&&(C.length>0&&k.current?P=Nf.previous(k.current):w.length>0&&T.current?P=Nf.previous(T.current):I.current&&(P=Nf.previous(I.current)),P)){var R=Dp.end(e,P);Zp.select(e,R)}I.unref(),T.unref(),k.unref()}}})}(e,...n)},insertNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r{Zp.insertNodes(e,t,n)})(e,...n)},insertText:function(){for(var t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{},{selection:r,marks:o}=e;if(r){if(o){var i=function(e){for(var t=1;t{var[r,o]=t;if(!zf.isText(r)){"children"in r||(r.children=[]);var i=r;if(i!==e&&0===i.children.length&&(Zp.insertNodes(e,{text:""},{at:o.concat(0),voids:!0}),i=zf.get(e,o)),i!==e&&(e.isInline(i)||zf.isText(i.children[0])||e.isInline(i.children[0])))for(var a=0;a{var{selection:n}=e;if(n){var r=(t,n)=>{if(!zf.isText(t))return!1;var[r,o]=Dp.parent(e,n);return!e.isVoid(r)||e.markableVoid(r)},o=If.isExpanded(n),i=!1;if(!o){var[a,s]=Dp.node(e,n);if(a&&r(a,s)){var[u]=Dp.parent(e,s);i=u&&e.markableVoid(u)}}if(o||i)Zp.unsetNodes(e,t,{match:r,split:!0,voids:!0});else{var l=function(e){for(var t=1;t{switch(t.type){case"insert_text":case"remove_text":case"set_node":var{path:n}=t;return Nf.levels(n);case"insert_node":var{node:r,path:o}=t;return[...Nf.levels(o),...zf.isText(r)?[]:Array.from(zf.nodes(r),e=>{var[,t]=e;return o.concat(t)})];case"merge_node":var{path:i}=t;return[...Nf.ancestors(i),Nf.previous(i)];case"move_node":var{path:a,newPath:s}=t;if(Nf.equals(a,s))return[];var u=[],l=[];for(var c of Nf.ancestors(a)){var d=Nf.transform(c,t);u.push(d)}for(var f of Nf.ancestors(s)){var p=Nf.transform(f,t);l.push(p)}var h=l[l.length-1],g=s[s.length-1],v=h.concat(g);return[...u,...l,v];case"remove_node":var{path:m}=t;return[...Nf.ancestors(m)];case"split_node":var{path:y}=t;return[...Nf.levels(y),Nf.next(y)];default:return[]}})(e,...n)},shouldNormalize:function(){for(var t=arguments.length,n=new Array(t),r=0;r{var{iteration:n,initialDirtyPathsLength:r}=t,o=42*r;if(n>o)throw new Error("Could not completely normalize the editor after ".concat(o," iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state."));return!0})(e,...n)},above:function(){for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},{voids:n=!1,mode:r="lowest",at:o=e.selection,match:i}=t;if(o){var a=Dp.path(e,o);if(!Ap.isRange(o)||Nf.equals(o.focus.path,o.anchor.path)){if(0===a.length)return;a=Nf.parent(a)}var s="lowest"===r,[u]=Dp.levels(e,{at:a,voids:n,match:i,reverse:s});return u}}(e,...n)},after:function(){for(var t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{},o={anchor:Dp.point(e,t,{edge:"end"}),focus:Dp.end(e,[])},{distance:i=1}=r,a=0;for(var s of Dp.positions(e,rh(rh({},r),{},{at:o}))){if(a>i)break;0!==a&&(n=s),a++}return n}(e,...n)},before:function(){for(var t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{},o={anchor:Dp.start(e,[]),focus:Dp.point(e,t,{edge:"start"})},{distance:i=1}=r,a=0;for(var s of Dp.positions(e,ih(ih({},r),{},{at:o,reverse:!0}))){if(a>i)break;0!==a&&(n=s),a++}return n}(e,...n)},collapse:function(){for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},{edge:n="anchor"}=t,{selection:r}=e;if(r)if("anchor"===n)Zp.select(e,r.anchor);else if("focus"===n)Zp.select(e,r.focus);else if("start"===n){var[o]=If.edges(r);Zp.select(e,o)}else if("end"===n){var[,i]=If.edges(r);Zp.select(e,i)}}(e,...n)},delete:function(){for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};Dp.withoutNormalizing(e,()=>{var n,r,{reverse:o=!1,unit:i="character",distance:a=1,voids:s=!1}=t,{at:u=e.selection,hanging:l=!1}=t;if(u){var c=!1;if(Ap.isRange(u)&&If.isCollapsed(u)&&(c=!0,u=u.anchor),Ap.isPoint(u)){var d=Dp.void(e,{at:u,mode:"highest"});if(!s&&d){var[,f]=d;u=f}else{var p={unit:i,distance:a};u={anchor:u,focus:o?Dp.before(e,u,p)||Dp.start(e,[]):Dp.after(e,u,p)||Dp.end(e,[])},l=!0}}if(Ap.isPath(u))Zp.removeNodes(e,{at:u,voids:s});else if(!If.isCollapsed(u)){if(!l){var[,h]=If.edges(u),g=Dp.end(e,[]);Op.equals(h,g)||(u=Dp.unhangRange(e,u,{voids:s}))}var[v,m]=If.edges(u),y=Dp.above(e,{match:t=>zf.isElement(t)&&Dp.isBlock(e,t),at:v,voids:s}),b=Dp.above(e,{match:t=>zf.isElement(t)&&Dp.isBlock(e,t),at:m,voids:s}),E=y&&b&&!Nf.equals(y[1],b[1]),w=Nf.equals(v.path,m.path),C=s?null:null!==(n=Dp.void(e,{at:v,mode:"highest"}))&&void 0!==n?n:Dp.elementReadOnly(e,{at:v,mode:"highest"}),D=s?null:null!==(r=Dp.void(e,{at:m,mode:"highest"}))&&void 0!==r?r:Dp.elementReadOnly(e,{at:m,mode:"highest"});if(C){var A=Dp.before(e,v);A&&y&&Nf.isAncestor(y[1],A.path)&&(v=A)}if(D){var S=Dp.after(e,m);S&&b&&Nf.isAncestor(b[1],S.path)&&(m=S)}var x,O=[];for(var N of Dp.nodes(e,{at:u,voids:s})){var[B,T]=N;x&&0===Nf.compare(T,x)||(!s&&zf.isElement(B)&&(Dp.isVoid(e,B)||Dp.isElementReadOnly(e,B))||!Nf.isCommon(T,v.path)&&!Nf.isCommon(T,m.path))&&(O.push(N),x=T)}var k=Array.from(O,t=>{var[,n]=t;return Dp.pathRef(e,n)}),F=Dp.pointRef(e,v),P=Dp.pointRef(e,m),I="";if(!w&&!C){var R=F.current,[_]=Dp.leaf(e,R),{path:L}=R,{offset:M}=v,j=_.text.slice(M);j.length>0&&(e.apply({type:"remove_text",path:L,offset:M,text:j}),I=j)}if(k.reverse().map(e=>e.unref()).filter(e=>null!==e).forEach(t=>Zp.removeNodes(e,{at:t,voids:s})),!D){var H=P.current,[z]=Dp.leaf(e,H),{path:$}=H,U=w?v.offset:0,V=z.text.slice(U,m.offset);V.length>0&&(e.apply({type:"remove_text",path:$,offset:U,text:V}),I=V)}!w&&E&&P.current&&F.current&&Zp.mergeNodes(e,{at:P.current,hanging:!0,voids:s}),c&&o&&"character"===i&&I.length>1&&I.match(/[\u0980-\u09FF\u0E00-\u0E7F\u1000-\u109F\u0900-\u097F\u1780-\u17FF\u0D00-\u0D7F\u0B00-\u0B7F\u0A00-\u0A7F\u0B80-\u0BFF\u0C00-\u0C7F]+/)&&Zp.insertText(e,I.slice(0,I.length-a));var W=F.unref(),G=P.unref(),q=o?W||G:G||W;null==t.at&&q&&Zp.select(e,q)}}})}(e,...n)},deselect:function(){for(var t=arguments.length,n=new Array(t),r=0;r{var{selection:t}=e;t&&e.apply({type:"set_selection",properties:t,newProperties:null})})(e,...n)},edges:function(){for(var t=arguments.length,n=new Array(t),r=0;r[Dp.start(e,t),Dp.end(e,t)])(e,...n)},elementReadOnly:function(){for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return Dp.above(e,sh(sh({},t),{},{match:t=>zf.isElement(t)&&Dp.isElementReadOnly(e,t)}))}(e,...n)},end:function(){for(var t=arguments.length,n=new Array(t),r=0;rDp.point(e,t,{edge:"end"}))(e,...n)},first:function(){for(var t=arguments.length,n=new Array(t),r=0;r{var n=Dp.path(e,t,{edge:"start"});return Dp.node(e,n)})(e,...n)},fragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r{var n=Dp.range(e,t);return zf.fragment(e,n)})(e,...n)},getMarks:function(){for(var t=arguments.length,n=new Array(t),r=0;rzf.isElement(t)&&Dp.isVoid(e,t)&&e.markableVoid(t)})){var d=Dp.above(e,{match:t=>zf.isElement(t)&&Dp.isBlock(e,t)});if(c&&d){var[f,p]=c,[,h]=d;Nf.isAncestor(h,p)&&(l=f)}}}return kf(l,fh)}(e,...n)},hasBlocks:function(){for(var t=arguments.length,n=new Array(t),r=0;rt.children.some(t=>zf.isElement(t)&&Dp.isBlock(e,t)))(e,...n)},hasInlines:function(){for(var t=arguments.length,n=new Array(t),r=0;rt.children.some(t=>zf.isText(t)||Dp.isInline(e,t)))(e,...n)},hasPath:function(){for(var t=arguments.length,n=new Array(t),r=0;rzf.has(e,t))(e,...n)},hasTexts:function(){for(var t=arguments.length,n=new Array(t),r=0;rt.children.every(e=>zf.isText(e)))(e,...n)},insertNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r!e.isInline(t))(e,...n)},isEdge:function(){for(var t=arguments.length,n=new Array(t),r=0;rDp.isStart(e,t,n)||Dp.isEnd(e,t,n))(e,...n)},isEmpty:function(){for(var t=arguments.length,n=new Array(t),r=0;r{var{children:n}=t,[r]=n;return 0===n.length||1===n.length&&zf.isText(r)&&""===r.text&&!e.isVoid(t)})(e,...n)},isEnd:function(){for(var t=arguments.length,n=new Array(t),r=0;r{var r=Dp.end(e,n);return Op.equals(t,r)})(e,...n)},isNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r{var t=Af.get(e);return void 0===t||t})(e,...n)},isStart:function(){for(var t=arguments.length,n=new Array(t),r=0;r{if(0!==t.offset)return!1;var r=Dp.start(e,n);return Op.equals(t,r)})(e,...n)},last:function(){for(var t=arguments.length,n=new Array(t),r=0;r{var n=Dp.path(e,t,{edge:"end"});return Dp.node(e,n)})(e,...n)},leaf:function(){for(var t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{},r=Dp.path(e,t,n);return[zf.leaf(e,r),r]}(e,...n)},levels:function(){for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var{at:n=e.selection,reverse:r=!1,voids:o=!1}=t,{match:i}=t;if(null==i&&(i=()=>!0),n){var a=[],s=Dp.path(e,n);for(var[u,l]of zf.levels(e,s))if(i(u,l)&&(a.push([u,l]),!o&&zf.isElement(u)&&Dp.isVoid(e,u)))break;r&&a.reverse(),yield*a}}()}(e,...n)},liftNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};Dp.withoutNormalizing(e,()=>{var{at:n=e.selection,mode:r="lowest",voids:o=!1}=t,{match:i}=t;if(n){null==i&&(i=Ap.isPath(n)?Xf(e,n):t=>zf.isElement(t)&&Dp.isBlock(e,t));var a=Dp.nodes(e,{at:n,match:i,mode:r,voids:o}),s=Array.from(a,t=>{var[,n]=t;return Dp.pathRef(e,n)});for(var u of s){var l=u.unref();if(l.length<2)throw new Error("Cannot lift node at a path [".concat(l,"] because it has a depth of less than `2`."));var c=Dp.node(e,Nf.parent(l)),[d,f]=c,p=l[l.length-1],{length:h}=d.children;if(1===h){var g=Nf.next(f);Zp.moveNodes(e,{at:l,to:g,voids:o}),Zp.removeNodes(e,{at:f,voids:o})}else if(0===p)Zp.moveNodes(e,{at:l,to:f,voids:o});else if(p===h-1){var v=Nf.next(f);Zp.moveNodes(e,{at:l,to:v,voids:o})}else{var m=Nf.next(l),y=Nf.next(f);Zp.splitNodes(e,{at:m,voids:o}),Zp.moveNodes(e,{at:l,to:y,voids:o})}}}})}(e,...n)},mergeNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};Dp.withoutNormalizing(e,()=>{var{match:n,at:r=e.selection}=t,{hanging:o=!1,voids:i=!1,mode:a="lowest"}=t;if(r){if(null==n)if(Ap.isPath(r)){var[s]=Dp.parent(e,r);n=e=>s.children.includes(e)}else n=t=>zf.isElement(t)&&Dp.isBlock(e,t);if(!o&&Ap.isRange(r)&&(r=Dp.unhangRange(e,r,{voids:i})),Ap.isRange(r))if(If.isCollapsed(r))r=r.anchor;else{var[,u]=If.edges(r),l=Dp.pointRef(e,u);Zp.delete(e,{at:r}),r=l.unref(),null==t.at&&Zp.select(e,r)}var[c]=Dp.nodes(e,{at:r,match:n,voids:i,mode:a}),d=Dp.previous(e,{at:r,match:n,voids:i,mode:a});if(c&&d){var[f,p]=c,[h,g]=d;if(0!==p.length&&0!==g.length){var v,m,y=Nf.next(g),b=Nf.common(p,g),E=Nf.isSibling(p,g),w=Array.from(Dp.levels(e,{at:p}),e=>{var[t]=e;return t}).slice(b.length).slice(0,-1),C=Dp.above(e,{at:p,mode:"highest",match:t=>w.includes(t)&&bh(e,t)}),D=C&&Dp.pathRef(e,C[1]);if(zf.isText(f)&&zf.isText(h)){var A=kf(f,mh);m=h.text.length,v=A}else{if(!zf.isElement(f)||!zf.isElement(h))throw new Error("Cannot merge the node at path [".concat(p,"] with the previous sibling because it is not the same kind: ").concat(Bp.stringify(f)," ").concat(Bp.stringify(h)));A=kf(f,yh),m=h.children.length,v=A}E||Zp.moveNodes(e,{at:p,to:y,voids:i}),D&&Zp.removeNodes(e,{at:D.current,voids:i}),Dp.shouldMergeNodesRemovePrevNode(e,d,c)?Zp.removeNodes(e,{at:g,voids:i}):e.apply({type:"merge_node",path:y,position:m,properties:v}),D&&D.unref()}}}})}(e,...n)},move:function(){for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},{selection:n}=e,{distance:r=1,unit:o="character",reverse:i=!1}=t,{edge:a=null}=t;if(n){"start"===a&&(a=If.isBackward(n)?"focus":"anchor"),"end"===a&&(a=If.isBackward(n)?"anchor":"focus");var{anchor:s,focus:u}=n,l={distance:r,unit:o},c={};if(null==a||"anchor"===a){var d=i?Dp.before(e,s,l):Dp.after(e,s,l);d&&(c.anchor=d)}if(null==a||"focus"===a){var f=i?Dp.before(e,u,l):Dp.after(e,u,l);f&&(c.focus=f)}Zp.setSelection(e,c)}}(e,...n)},moveNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r{Dp.withoutNormalizing(e,()=>{var{to:n,at:r=e.selection,mode:o="lowest",voids:i=!1}=t,{match:a}=t;if(r){null==a&&(a=Ap.isPath(r)?Xf(e,r):t=>zf.isElement(t)&&Dp.isBlock(e,t));var s=Dp.pathRef(e,n),u=Dp.nodes(e,{at:r,match:a,mode:o,voids:i}),l=Array.from(u,t=>{var[,n]=t;return Dp.pathRef(e,n)});for(var c of l){var d=c.unref(),f=s.current;0!==d.length&&e.apply({type:"move_node",path:d,newPath:f}),s.current&&Nf.isSibling(f,d)&&Nf.isAfter(f,d)&&(s.current=Nf.next(s.current))}s.unref()}})})(e,...n)},next:function(){for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection}=t;if(i){var a=Dp.after(e,i,{voids:r});if(a){var[,s]=Dp.last(e,[]),u=[a.path,s];if(Ap.isPath(i)&&0===i.length)throw new Error("Cannot get the next node from the root node!");if(null==o)if(Ap.isPath(i)){var[l]=Dp.parent(e,i);o=e=>l.children.includes(e)}else o=()=>!0;var[c]=Dp.nodes(e,{at:u,match:o,mode:n,voids:r});return c}}}(e,...n)},node:function(){for(var t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{},r=Dp.path(e,t,n);return[zf.get(e,r),r]}(e,...n)},nodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var{at:n=e.selection,mode:r="all",universal:o=!1,reverse:i=!1,voids:a=!1,pass:s}=t,{match:u}=t;if(u||(u=()=>!0),n){var l,c;if(Ap.isSpan(n))l=n[0],c=n[1];else{var d=Dp.path(e,n,{edge:"start"}),f=Dp.path(e,n,{edge:"end"});l=i?f:d,c=i?d:f}var p,h=zf.nodes(e,{reverse:i,from:l,to:c,pass:t=>{var[n,r]=t;return!(!s||!s([n,r]))||!!zf.isElement(n)&&!(a||!Dp.isVoid(e,n)&&!Dp.isElementReadOnly(e,n))}}),g=[];for(var[v,m]of h){var y=p&&0===Nf.compare(m,p[1]);if("highest"!==r||!y)if(u(v,m))if("lowest"===r&&y)p=[v,m];else{var b="lowest"===r?p:[v,m];b&&(o?g.push(b):yield b),p=[v,m]}else if(o&&!y&&zf.isText(v))return}"lowest"===r&&p&&(o?g.push(p):yield p),o&&(yield*g)}}()}(e,...n)},normalize:function(){for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},{force:n=!1,operation:r}=t,o=e=>wf.get(e)||[],i=e=>{var t,n=o(e).pop(),r=n.join(",");return(t=e,Cf.get(t)||new Set).delete(r),n};if(Dp.isNormalizing(e)){if(n){var a=Array.from(zf.nodes(e),e=>{var[,t]=e;return t}),s=new Set(a.map(e=>e.join(",")));wf.set(e,a),Cf.set(e,s)}0!==o(e).length&&Dp.withoutNormalizing(e,()=>{for(var t of o(e))if(zf.has(e,t)){var n=Dp.node(e,t),[a,s]=n;zf.isElement(a)&&0===a.children.length&&e.normalizeNode(n,{operation:r})}for(var u=o(e),l=u.length,c=0;0!==u.length;){if(!e.shouldNormalize({dirtyPaths:u,iteration:c,initialDirtyPathsLength:l,operation:r}))return;var d=i(e);if(zf.has(e,d)){var f=Dp.node(e,d);e.normalizeNode(f,{operation:r})}c++,u=o(e)}})}}(e,...n)},parent:function(){for(var t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{},r=Dp.path(e,t,n),o=Nf.parent(r);return Dp.node(e,o)}(e,...n)},path:function(){for(var t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{},{depth:r,edge:o}=n;if(Ap.isPath(t))if("start"===o){var[,i]=zf.first(e,t);t=i}else if("end"===o){var[,a]=zf.last(e,t);t=a}return Ap.isRange(t)&&(t="start"===o?If.start(t):"end"===o?If.end(t):Nf.common(t.anchor.path,t.focus.path)),Ap.isPoint(t)&&(t=t.path),null!=r&&(t=t.slice(0,r)),t}(e,...n)},pathRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o;return Dp.pathRefs(e).delete(o),o.current=null,t}};return Dp.pathRefs(e).add(o),o}(e,...n)},pathRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r{var t=Sf.get(e);return t||(t=new Set,Sf.set(e,t)),t})(e,...n)},point:function(){for(var t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{},{edge:r="start"}=n;if(Ap.isPath(t)){var o;if("end"===r){var[,i]=zf.last(e,t);o=i}else{var[,a]=zf.first(e,t);o=a}var s=zf.get(e,o);if(!zf.isText(s))throw new Error("Cannot get the ".concat(r," point in the node at path [").concat(t,"] because it has no ").concat(r," text node."));return{path:o,offset:"end"===r?s.text.length:0}}if(Ap.isRange(t)){var[u,l]=If.edges(t);return"start"===r?u:l}return t}(e,...n)},pointRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o;return Dp.pointRefs(e).delete(o),o.current=null,t}};return Dp.pointRefs(e).add(o),o}(e,...n)},pointRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r{var t=xf.get(e);return t||(t=new Set,xf.set(e,t)),t})(e,...n)},positions:function(){for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var{at:n=e.selection,unit:r="offset",reverse:o=!1,voids:i=!1}=t;if(n){var a=Dp.range(e,n),[s,u]=If.edges(a),l=o?u:s,c=!1,d="",f=0,p=0,h=0,g=[],v=function*(t){var n=g.some(e=>Nf.isAncestor(e,t));function*a(e){n||(yield e)}if(zf.isElement(m)){if(!e.isSelectable(m)){if(g.push(t),o)return Nf.hasPrevious(t)&&(yield*a(Dp.end(e,Nf.previous(t)))),0;var v=Nf.next(t);return Dp.hasPath(e,v)&&(yield*a(Dp.start(e,v))),0}if(!i&&(e.isVoid(m)||e.isElementReadOnly(m)))return yield*a(Dp.start(e,t)),0;if(e.isInline(m))return 0;if(Dp.hasInlines(e,m)){var y=Nf.isAncestor(t,u.path)?u:Dp.end(e,t),E=Nf.isAncestor(t,s.path)?s:Dp.start(e,t);d=Dp.string(e,{anchor:E,focus:y},{voids:i}),c=!0}}if(zf.isText(m)){var w=Nf.equals(t,l.path);for(w?(p=o?l.offset:m.text.length-l.offset,h=l.offset):(p=m.text.length,h=o?p:0),(w||c||"offset"===r)&&(yield*a({path:t,offset:h}),c=!1);;){if(0===f){if(""===d)break;f=b(d,r,o),d=tp(d,f,o)[1]}if(h=o?h-f:h+f,(p-=f)<0){f=-p;break}f=0,yield*a({path:t,offset:h})}}};for(var[m,y]of Dp.nodes(e,{at:n,reverse:o,voids:i}))yield*v(y)}function b(e,t,n){return"character"===t?Zf(e,n):"word"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0,r=!1;e.length>0;){var o=Zf(e,t),[i,a]=tp(e,o,t);if(np(i,a,t))r=!0,n+=o;else{if(r)break;n+=o}e=a}return n}(e,n):"line"===t||"block"===t?e.length:1}}()}(e,...n)},previous:function(){for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection}=t;if(i){var a=Dp.before(e,i,{voids:r});if(a){var[,s]=Dp.first(e,[]),u=[a.path,s];if(Ap.isPath(i)&&0===i.length)throw new Error("Cannot get the previous node from the root node!");if(null==o)if(Ap.isPath(i)){var[l]=Dp.parent(e,i);o=e=>l.children.includes(e)}else o=()=>!0;var[c]=Dp.nodes(e,{reverse:!0,at:u,match:o,mode:n,voids:r});return c}}}(e,...n)},range:function(){for(var t=arguments.length,n=new Array(t),r=0;rAp.isRange(t)&&!n?t:{anchor:Dp.start(e,t),focus:Dp.end(e,n||t)})(e,...n)},rangeRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o;return Dp.rangeRefs(e).delete(o),o.current=null,t}};return Dp.rangeRefs(e).add(o),o}(e,...n)},rangeRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r{var t=Of.get(e);return t||(t=new Set,Of.set(e,t)),t})(e,...n)},removeNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};Dp.withoutNormalizing(e,()=>{var{hanging:n=!1,voids:r=!1,mode:o="lowest"}=t,{at:i=e.selection,match:a}=t;if(i){null==a&&(a=Ap.isPath(i)?Xf(e,i):t=>zf.isElement(t)&&Dp.isBlock(e,t)),!n&&Ap.isRange(i)&&(i=Dp.unhangRange(e,i,{voids:r}));var s=Dp.nodes(e,{at:i,match:a,mode:o,voids:r}),u=Array.from(s,t=>{var[,n]=t;return Dp.pathRef(e,n)});for(var l of u){var c=l.unref();if(c){var[d]=Dp.node(e,c);e.apply({type:"remove_node",path:c,node:d})}}}})}(e,...n)},select:function(){for(var t=arguments.length,n=new Array(t),r=0;r{var{selection:n}=e;if(t=Dp.range(e,t),n)Zp.setSelection(e,t);else{if(!Ap.isRange(t))throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(Bp.stringify(t)));e.apply({type:"set_selection",properties:n,newProperties:t})}})(e,...n)},setNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Dp.withoutNormalizing(e,()=>{var{match:r,at:o=e.selection,compare:i,merge:a}=n,{hanging:s=!1,mode:u="lowest",split:l=!1,voids:c=!1}=n;if(o){if(null==r&&(r=Ap.isPath(o)?Xf(e,o):t=>zf.isElement(t)&&Dp.isBlock(e,t)),!s&&Ap.isRange(o)&&(o=Dp.unhangRange(e,o,{voids:c})),l&&Ap.isRange(o)){if(If.isCollapsed(o)&&Dp.leaf(e,o.anchor)[0].text.length>0)return;var d=Dp.rangeRef(e,o,{affinity:"inward"}),[f,p]=If.edges(o),h="lowest"===u?"lowest":"highest",g=Dp.isEnd(e,p,p.path);Zp.splitNodes(e,{at:p,match:r,mode:h,voids:c,always:!g});var v=Dp.isStart(e,f,f.path);Zp.splitNodes(e,{at:f,match:r,mode:h,voids:c,always:!v}),o=d.unref(),null==n.at&&Zp.select(e,o)}for(var[m,y]of(i||(i=(e,t)=>e!==t),Dp.nodes(e,{at:o,match:r,mode:u,voids:c}))){var b={},E={};if(0!==y.length){var w=!1;for(var C in t)"children"!==C&&"text"!==C&&i(t[C],m[C])&&(w=!0,m.hasOwnProperty(C)&&(b[C]=m[C]),a?null!=t[C]&&(E[C]=a(m[C],t[C])):null!=t[C]&&(E[C]=t[C]));w&&e.apply({type:"set_node",path:y,properties:b,newProperties:E})}}}})}(e,...n)},setNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r{Af.set(e,t)})(e,...n)},setPoint:function(){for(var t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{},{selection:r}=e,{edge:o="both"}=n;if(r){"start"===o&&(o=If.isBackward(r)?"focus":"anchor"),"end"===o&&(o=If.isBackward(r)?"anchor":"focus");var{anchor:i,focus:a}=r,s="anchor"===o?i:a;Zp.setSelection(e,{["anchor"===o?"anchor":"focus"]:gh(gh({},s),t)})}}(e,...n)},setSelection:function(){for(var t=arguments.length,n=new Array(t),r=0;r{var{selection:n}=e,r={},o={};if(n){for(var i in t)("anchor"===i&&null!=t.anchor&&!Op.equals(t.anchor,n.anchor)||"focus"===i&&null!=t.focus&&!Op.equals(t.focus,n.focus)||"anchor"!==i&&"focus"!==i&&t[i]!==n[i])&&(r[i]=n[i],o[i]=t[i]);Object.keys(r).length>0&&e.apply({type:"set_selection",properties:r,newProperties:o})}})(e,...n)},splitNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};Dp.withoutNormalizing(e,()=>{var{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection,height:a=0,always:s=!1}=t;if(i&&(null==o&&(o=t=>zf.isElement(t)&&Dp.isBlock(e,t)),!Ap.isRange(i)||(i=((e,t)=>{if(If.isCollapsed(t))return t.anchor;var[,n]=If.edges(t),r=Dp.pointRef(e,n);return Zp.delete(e,{at:t}),r.unref()})(e,i)))){if(Ap.isPath(i)){var u=i,l=Dp.point(e,u),[c]=Dp.parent(e,u);o=e=>e===c,a=l.path.length-u.length+1,i=l,s=!0}var d,f=Dp.pointRef(e,i,{affinity:"backward"});try{var[p]=Dp.nodes(e,{at:i,match:o,mode:n,voids:r});if(!p)return;var h=Dp.void(e,{at:i,mode:"highest"});if(!r&&h){var[g,v]=h;if(e.isInline(g)){var m=Dp.after(e,v);if(!m){var y=Nf.next(v);Zp.insertNodes(e,{text:""},{at:y,voids:r}),m=Dp.point(e,y)}i=m,s=!0}a=i.path.length-v.length+1,s=!0}d=Dp.pointRef(e,i);var b=i.path.length-a,[,E]=p,w=i.path.slice(0,b),C=0===a?i.offset:i.path[b]+0;for(var[D,A]of Dp.levels(e,{at:w,reverse:!0,voids:r})){var S=!1;if(A.lengthDp.point(e,t,{edge:"start"}))(e,...n)},string:function(){for(var t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{},{voids:r=!1}=n,o=Dp.range(e,t),[i,a]=If.edges(o),s="";for(var[u,l]of Dp.nodes(e,{at:o,match:zf.isText,voids:r})){var c=u.text;Nf.equals(l,a.path)&&(c=c.slice(0,a.offset)),Nf.equals(l,i.path)&&(c=c.slice(i.offset)),s+=c}return s}(e,...n)},unhangRange:function(){for(var t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{},{voids:r=!1}=n,[o,i]=If.edges(t);if(0!==o.offset||0!==i.offset||If.isCollapsed(t)||Nf.hasPrevious(i.path))return t;var a=Dp.above(e,{at:i,match:t=>zf.isElement(t)&&Dp.isBlock(e,t),voids:r}),s=a?a[1]:[],u={anchor:Dp.start(e,o),focus:i},l=!0;for(var[c,d]of Dp.nodes(e,{at:u,match:zf.isText,reverse:!0,voids:r}))if(l)l=!1;else if(""!==c.text||Nf.isBefore(d,s)){i={path:d,offset:c.text.length};break}return{anchor:o,focus:i}}(e,...n)},unsetNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Array.isArray(t)||(t=[t]);var r={};for(var o of t)r[o]=null;Zp.setNodes(e,r,n)}(e,...n)},unwrapNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};Dp.withoutNormalizing(e,()=>{var{mode:n="lowest",split:r=!1,voids:o=!1}=t,{at:i=e.selection,match:a}=t;if(i){null==a&&(a=Ap.isPath(i)?Xf(e,i):t=>zf.isElement(t)&&Dp.isBlock(e,t)),Ap.isPath(i)&&(i=Dp.range(e,i));var s=Ap.isRange(i)?Dp.rangeRef(e,i):null,u=Dp.nodes(e,{at:i,match:a,mode:n,voids:o}),l=Array.from(u,t=>{var[,n]=t;return Dp.pathRef(e,n)}).reverse(),c=function(){var t=d.unref(),[n]=Dp.node(e,t),i=Dp.range(e,t);r&&s&&(i=If.intersection(s.current,i)),Zp.liftNodes(e,{at:i,match:e=>!zf.isText(n)&&n.children.includes(e),voids:o})};for(var d of l)c();s&&s.unref()}})}(e,...n)},void:function(){for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return Dp.above(e,lh(lh({},t),{},{match:t=>zf.isElement(t)&&Dp.isVoid(e,t)}))}(e,...n)},withoutNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r{var n=Dp.isNormalizing(e);Dp.setNormalizing(e,!1);try{t()}finally{Dp.setNormalizing(e,n)}Dp.normalize(e)})(e,...n)},wrapNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Dp.withoutNormalizing(e,()=>{var{mode:r="lowest",split:o=!1,voids:i=!1}=n,{match:a,at:s=e.selection}=n;if(s){if(null==a&&(a=Ap.isPath(s)?Xf(e,s):e.isInline(t)?t=>zf.isElement(t)&&Dp.isInline(e,t)||zf.isText(t):t=>zf.isElement(t)&&Dp.isBlock(e,t)),o&&Ap.isRange(s)){var[u,l]=If.edges(s),c=Dp.rangeRef(e,s,{affinity:"inward"}),d=t=>{var n=Dp.above(e,{at:t,match:t=>zf.isElement(t)&&Dp.isBlock(e,t)});return n&&Dp.isEdge(e,t,n[1])};Zp.splitNodes(e,{at:l,match:a,voids:i,always:!d(l)}),Zp.splitNodes(e,{at:u,match:a,voids:i,always:!d(u)}),s=c.unref(),null==n.at&&Zp.select(e,s)}var f=Array.from(Dp.nodes(e,{at:s,match:e.isInline(t)?t=>zf.isElement(t)&&Dp.isBlock(e,t):e=>zf.isEditor(e),mode:"lowest",voids:i})),p=function(){var n=Ap.isRange(s)?If.intersection(s,Dp.range(e,h)):s;if(!n)return 0;var o=Array.from(Dp.nodes(e,{at:n,match:a,mode:r,voids:i}));if(o.length>0){var[u]=o,l=o[o.length-1],[,c]=u,[,d]=l;if(0===c.length&&0===d.length)return 0;var f=Nf.equals(c,d)?Nf.parent(c):Nf.common(c,d),p=Dp.range(e,c,d),g=Dp.node(e,f),[v]=g,m=f.length+1,y=Nf.next(d.slice(0,m)),b=wh(wh({},t),{},{children:[]});Zp.insertNodes(e,b,{at:y,voids:i}),Zp.moveNodes(e,{at:p,match:e=>!zf.isText(v)&&v.children.includes(e),to:y.concat(0),voids:i})}};for(var[,h]of f)p()}})}(e,...n)},shouldMergeNodesRemovePrevNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r{var[n,r]=t;return zf.isElement(n)&&Dp.isEmpty(e,n)||zf.isText(n)&&""===n.text&&0!==r[r.length-1]})(e,...n)}};return e},Dh=e=>qf(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(0===e.redos.length||Gf.isOperationList(e.redos[0].operations))&&(0===e.undos.length||Gf.isOperationList(e.undos[0].operations)),Ah=new WeakMap,Sh=new WeakMap,xh=new WeakMap,Oh={isHistoryEditor:e=>Dh(e.history)&&Dp.isEditor(e),isMerging:e=>Sh.get(e),isSplittingOnce:e=>xh.get(e),setSplittingOnce(e,t){xh.set(e,t)},isSaving:e=>Ah.get(e),redo(e){e.redo()},undo(e){e.undo()},withMerging(e,t){var n=Oh.isMerging(e);Sh.set(e,!0),t(),Sh.set(e,n)},withNewBatch(e,t){var n=Oh.isMerging(e);Sh.set(e,!0),xh.set(e,!0),t(),Sh.set(e,n),xh.delete(e)},withoutMerging(e,t){var n=Oh.isMerging(e);Sh.set(e,!1),t(),Sh.set(e,n)},withoutSaving(e,t){var n=Oh.isSaving(e);Ah.set(e,!1);try{t()}finally{Ah.set(e,n)}}},Nh=e=>{var t=e,{apply:n}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:e}=t,{redos:n}=e;if(n.length>0){var r=n[n.length-1];r.selectionBefore&&Zp.setSelection(t,r.selectionBefore),Oh.withoutSaving(t,()=>{Dp.withoutNormalizing(t,()=>{for(var e of r.operations)t.apply(e)})}),e.redos.pop(),t.writeHistory("undos",r)}},t.undo=()=>{var{history:e}=t,{undos:n}=e;if(n.length>0){var r=n[n.length-1];Oh.withoutSaving(t,()=>{Dp.withoutNormalizing(t,()=>{var e=r.operations.map(Gf.inverse).reverse();for(var n of e)t.apply(n);r.selectionBefore&&Zp.setSelection(t,r.selectionBefore)})}),t.writeHistory("redos",r),e.undos.pop()}},t.apply=e=>{var{operations:r,history:o}=t,{undos:i}=o,a=i[i.length-1],s=a&&a.operations[a.operations.length-1],u=Oh.isSaving(t),l=Oh.isMerging(t);if(null==u&&(u=Th(e)),u){if(null==l&&(l=null!=a&&(!!r.includes(s)||Bh(e,s))),Oh.isSplittingOnce(t)&&(l=!1,Oh.setSplittingOnce(t,void 0)),a&&l)a.operations.push(e);else{var c={operations:[e],selectionBefore:t.selection};t.writeHistory("undos",c)}for(;i.length>100;)i.shift();o.redos=[]}n(e)},t.writeHistory=(e,n)=>{t.history[e].push(n)},t},Bh=(e,t)=>!(!t||"insert_text"!==e.type||"insert_text"!==t.type||e.offset!==t.offset+t.text.length||!Nf.equals(e.path,t.path))||!(!t||"remove_text"!==e.type||"remove_text"!==t.type||e.offset+e.text.length!==t.offset||!Nf.equals(e.path,t.path)),Th=(e,t)=>"set_selection"!==e.type,kh=function(e,t){return(kh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function Fh(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}kh(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Ph=function(){return Ph=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Lh(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function Mh(e,t,n){if(2===arguments.length)for(var r,o=0,i=t.length;o-1},Oe.prototype.set=function(e,t){var n=this.__data__,r=ke(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Ne.prototype.clear=function(){this.__data__={hash:new xe,map:new(he||Oe),string:new xe}},Ne.prototype.delete=function(e){return Re(this,e).delete(e)},Ne.prototype.get=function(e){return Re(this,e).get(e)},Ne.prototype.has=function(e){return Re(this,e).has(e)},Ne.prototype.set=function(e,t){return Re(this,e).set(e,t),this},Be.prototype.clear=function(){this.__data__=new Oe},Be.prototype.delete=function(e){return this.__data__.delete(e)},Be.prototype.get=function(e){return this.__data__.get(e)},Be.prototype.has=function(e){return this.__data__.has(e)},Be.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Oe){var r=n.__data__;if(!he||r.length<199)return r.push([e,t]),this;n=this.__data__=new Ne(r)}return n.set(e,t),this};var Le=ce?W(ce,Object):function(){return[]},Me=function(e){return te.call(e)};function je(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||F.test(e))&&e>-1&&e%1==0&&e-1&&t%1==0&&t<=r)&&!Ge(e);var t}var We=de||function(){return!1};function Ge(e){var t=qe(e)?te.call(e):"";return t==s||t==u}function qe(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ke(e){return Ve(e)?function(e){var t,n,r=Ue(e)||function(e){return!!e&&"object"==typeof e}(n=t=e)&&Ve(n)&&ee.call(t,"callee")&&(!ue.call(t,"callee")||te.call(t)==o)?function(e,t){for(var n=-1,r=Array(e);++n-1&&n%1==0&&n-1&&n%1==0&&n<=e)&&!function(e){var t,n,r=(n=typeof(t=e),!t||"object"!=n&&"function"!=n?"":s.call(e));return"[object Function]"==r||"[object GeneratorFunction]"==r}(t);var n}function v(e){return g(e)?function(e){var t,n,r=h(e)||function(e){return!!e&&"object"==typeof e}(n=t=e)&&g(n)&&a.call(t,"callee")&&(!u.call(t,"callee")||"[object Arguments]"==s.call(t))?function(e,t){for(var n=-1,r=Array(e);++n" "}).join("").toLowerCase());return!o||!o.startsWith(Xh)&&!o.startsWith("vbscript:")&&(!o.startsWith("data:")||"href"!==t&&"xlink:href"!==t&&("img"===e||"poster"===t)&&o.startsWith("data:image/"))}(t,r,o))&&e.removeAttribute(n.name)})}),t.body.innerHTML}var Jh={},Qh="created",eg="destroyed",tg="change",ng="scroll",rg="fullscreen",og="unFullScreen",ig={};var ag=new WeakMap,sg=new WeakMap,ug=new WeakMap,lg=new WeakMap,cg=new WeakMap,dg=new WeakMap,fg=new WeakMap,pg=new WeakMap,hg=new WeakMap,gg=new WeakMap,vg=new WeakMap,mg=new WeakMap,yg=new WeakMap,bg=new WeakMap,Eg=new WeakMap,wg=new WeakMap,Cg=new WeakMap,Dg=new WeakMap,Ag=new WeakMap,Sg=new WeakMap,xg=new WeakMap,Og=new WeakMap,Ng=new WeakMap,Bg=new WeakMap,Tg=new WeakMap,kg=new WeakMap,Fg=new WeakMap,Pg=new WeakMap,Ig=new WeakMap,Rg=function(e){var t=e;return t.getAllMenuKeys=function(){var e=[];for(var t in ig)e.push(t);return e},t.getConfig=function(){var e=gg.get(t);if(null==e)throw new Error("Can not get editor config");return e},t.getMenuConfig=function(e){var n=t.getConfig().MENU_CONF;return(void 0===n?{}:n)[e]||{}},t.alert=function(e,n){void 0===n&&(n="info");var r=t.getConfig().customAlert;r&&r(e,n)},t},_g=new Set(["doctype","!doctype","meta","script","style","link","frame","iframe","title","svg"]);function Lg(e){return null!==e&&"object"==typeof e&&"constructor"in e&&e.constructor===Object}function Mg(e={},t={}){Object.keys(t).forEach(n=>{void 0===e[n]?e[n]=t[n]:Lg(t[n])&&Lg(e[n])&&Object.keys(t[n]).length>0&&Mg(e[n],t[n])})}const jg={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function Hg(){const e="undefined"!=typeof document?document:{};return Mg(e,jg),e}const zg={document:jg,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:e=>"undefined"==typeof setTimeout?(e(),null):setTimeout(e,0),cancelAnimationFrame(e){"undefined"!=typeof setTimeout&&clearTimeout(e)}};function $g(){const e="undefined"!=typeof window?window:{};return Mg(e,zg),e}class Ug extends Array{constructor(e){"number"==typeof e?super(e):(super(...e||[]),function(e){const t=e.__proto__;Object.defineProperty(e,"__proto__",{get:()=>t,set(e){t.__proto__=e}})}(this))}}function Vg(e=[]){const t=[];return e.forEach(e=>{Array.isArray(e)?t.push(...Vg(e)):t.push(e)}),t}function Wg(e,t){return Array.prototype.filter.call(e,t)}function Gg(e){return e.toLowerCase().replace(/-(.)/g,(e,t)=>t.toUpperCase())}function qg(e,t){const n=$g(),r=Hg();let o=[];if(!t&&e instanceof Ug)return e;if(!e)return new Ug(o);if("string"==typeof e){const n=e.trim();if(n.indexOf("<")>=0&&n.indexOf(">")>=0){let e="div";0===n.indexOf("e.split(" ")));return this.forEach(e=>{e.classList.add(...t)}),this}function Yg(...e){const t=Vg(e.map(e=>e.split(" ")));return this.forEach(e=>{e.classList.remove(...t)}),this}function Xg(...e){const t=Vg(e.map(e=>e.split(" ")));return Wg(this,e=>t.filter(t=>e.classList.contains(t)).length>0).length>0}function Zg(e,t){if(1===arguments.length&&"string"==typeof e)return this[0]?this[0].getAttribute(e):void 0;for(let n=0;n=0&&(t[Gg(r.name.split("data-")[1])]=r.value)}for(const n in t)"false"===t[n]?t[n]=!1:"true"===t[n]?t[n]=!0:parseFloat(t[n])===1*t[n]&&(t[n]*=1);return t}function tv(e){if(void 0===e){const e=this[0];if(!e)return;if(e.multiple&&"select"===e.nodeName.toLowerCase()){const t=[];for(let n=0;n=0;else n.value=e}return this}function nv(...e){let[t,n,r,o]=e;function i(e){const t=e.target;if(!t)return;const o=e.target.dom7EventData||[];if(o.indexOf(e)<0&&o.unshift(e),qg(t).is(n))r.apply(t,o);else{const e=qg(t).parents();for(let t=0;t=0;t-=1){const n=a[t];r&&n.listener===r||r&&n.listener&&n.listener.dom7proxy&&n.listener.dom7proxy===r?(i.removeEventListener(e,n.proxyListener,o),a.splice(t,1)):r||(i.removeEventListener(e,n.proxyListener,o),a.splice(t,1))}}}return this}function ov(){const e=$g();return this[0]===e?e.innerWidth:this.length>0?parseFloat(this.css("width")):null}function iv(){const e=$g();return this[0]===e?e.innerHeight:this.length>0?parseFloat(this.css("height")):null}function av(){if(this.length>0){const e=$g(),t=Hg(),n=this[0],r=n.getBoundingClientRect(),o=t.body,i=n.clientTop||o.clientTop||0,a=n.clientLeft||o.clientLeft||0,s=n===e?e.scrollY:n.scrollTop,u=n===e?e.scrollX:n.scrollLeft;return{top:r.top+s-i,left:r.left+u-a}}return null}function sv(){for(let e=0;e{e.apply(t,[t,n])}),this):this}function dv(e){return qg(Wg(this,e))}function fv(e){if(void 0===e)return this[0]?this[0].innerHTML:null;for(let t=0;t=0;r-=1)this[n].insertBefore(o.childNodes[r],this[n].childNodes[0])}else if(e instanceof Ug)for(r=0;r{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};function Bv(e){Promise.resolve().then(e)}function Tv(e){return e.replace(/ /g," ").replace(/</g,"<").replace(/>/g,">").replace(/®/g,"®").replace(/©/g,"©").replace(/™/g,"™").replace(/"/g,'"')}var kv,Fv=function(e){return Object.prototype.toString.call(e)},Pv=globalThis.Node;lv&&(qg.fn.css=lv),gv&&(qg.fn.append=gv),Kg&&(qg.fn.addClass=Kg),Yg&&(qg.fn.removeClass=Yg),Xg&&(qg.fn.hasClass=Xg),nv&&(qg.fn.on=nv),xv&&(qg.fn.focus=xv),Zg&&(qg.fn.attr=Zg),Jg&&(qg.fn.removeAttr=Jg),sv&&(qg.fn.hide=sv),uv&&(qg.fn.show=uv),av&&(qg.fn.offset=av),ov&&(qg.fn.width=ov),iv&&(qg.fn.height=iv),mv&&(qg.fn.parent=mv),yv&&(qg.fn.parents=yv),hv&&(qg.fn.is=hv),ev&&(qg.fn.dataset=ev),tv&&(qg.fn.val=tv),pv&&(qg.fn.text=pv),fv&&(qg.fn.html=fv),Ev&&(qg.fn.children=Ev),wv&&(qg.fn.remove=wv),bv&&(qg.fn.find=bv),cv&&(qg.fn.each=cv),Cv&&(qg.fn.empty=Cv),function(e){e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"}(kv||(kv={}));var Iv=/\[object HTML([A-Z][a-z]*)*Element\]/,Rv=function(e){return Iv.test(Fv(e))},_v=function(e){return null!=e&&"number"==typeof e.nodeType},Lv=function(e){return _v(e)&&e.nodeType===kv.COMMENT_NODE},Mv=function(e){return _v(e)&&e.nodeType===kv.ELEMENT_NODE},jv=function(e){return"[object Selection]"===Fv(e)},Hv=function(e){return _v(e)&&e.nodeType===kv.TEXT_NODE},zv=function(e){var t,n,r;return null!==(t=window&&window.document.getElementById(e))&&void 0!==t?t:window&&(null===(r=null===(n=window.document.activeElement)||void 0===n?void 0:n.shadowRoot)||void 0===r?void 0:r.getElementById(e))||null},$v=function(e,t,n){for(var r=e.childNodes,o=r[t],i=t,a=!1,s=!1;(Lv(o)||Mv(o)&&0===o.childNodes.length||Mv(o)&&"false"===o.getAttribute("contenteditable"))&&(!a||!s);)i>=r.length?(a=!0,i=t-1,n="backward"):i<0?(s=!0,i=t+1,n="forward"):(o=r[i],t=i,i+="forward"===n?1:-1);return[o,t]},Uv=function(e,t,n){return Lh($v(e,t,n),1)[0]},Vv=function(e){var t,n,r="";if(Hv(e)&&e.nodeValue)return e.nodeValue;if(Mv(e)){try{for(var o=_h(Array.from(e.childNodes)),i=o.next();!i.done;i=o.next()){var a=i.value;r+=Vv(a)}}catch(u){t={error:u}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}var s=getComputedStyle(e).getPropertyValue("display");"block"!==s&&"list"!==s&&"table-row"!==s&&"BR"!==e.tagName||(r+="\n")}return r};function Wv(e,t){if(!Rv(e)||"true"!==e.dataset.slateVoid)for(var n=e.childNodes,r=n.length;r-=1;){var o=n[r],i=o.nodeType;Hv(o)?t(o,e):[kv.ELEMENT_NODE,kv.DOCUMENT_NODE,kv.DOCUMENT_FRAGMENT_NODE].includes(i)&&Wv(o,t)}}function Gv(e){if(0===e.length)return"";var t=e[0];return t.nodeType!==kv.ELEMENT_NODE?"":t.tagName.toLowerCase()}var qv=new RegExp(String.fromCharCode(160),"g");function Kv(e){return e.replace(qv," ")}var Yv=["span","b","strong","i","em","s","strike","u","font","sub","sup"],Xv=[],Zv=[],Jv={};function Qv(e,t){var n=e.length;if(n){var r=e[n-1];if(Ip.isText(r)){var o=Object.keys(r);if(1===o.length&&"text"===o[0])return r.text+=t,!0}}return!1}function em(e,t,n){return{type:"paragraph",children:[{text:qg(e).text().replace(/\s+/gm," ")}]}}function tm(e,t){var n=function(e,t){var n=[];if(null!=e.attr("data-w-e-is-void"))return n;var r=e[0].childNodes;return 1===r.length&&"BR"===r[0].nodeName?(n.push({text:""}),n):(r.forEach(function(e){if(Mv(e)){if("BR"===e.nodeName)return void(Qv(n,"\n")||n.push({text:"\n"}));var r=am(qg(e),t);Array.isArray(r)?r.forEach(function(e){return n.push(e)}):n.push(r)}else if(Hv(e)){var o=e.textContent||"";if(""===o.trim()&&o.indexOf("\n")>=0)return;o&&(o=Kv(o),Qv(n,o)||n.push({text:o}))}}),n)}(e,t),r=function(e){for(var t in Jv)if(e[0].matches(t))return Jv[t];return em}(e)(e[0],n,t);return Array.isArray(r)||(r=[r]),r.forEach(function(r){Dp.isVoid(t,r)||(0===n.length&&(r.children=[{text:e.text().replace(/\s+/gm," ")}]),Zv.forEach(function(n){r=n(e[0],r,t)}))}),r}function nm(e,t){0===e.parents("pre").length&&(e[0].innerHTML=e[0].innerHTML.replace(/[\r\n\t]+/g,"").replace(/
/g,"\n"));var n=e[0].textContent||"",r={text:n=Kv(n=Tv(n))};return Zv.forEach(function(n){r=n(e[0],r,t)}),r}function rm(e,t){var n={text:""};return Zv.forEach(function(r){n=r(e[0],n,t)}),n}function om(e,t){var n=t.parentElement;return null==n?e:(null==n.closest("pre")&&(e=e.replace(/[\r\n\t]+/g,"")),e=Kv(e=Tv(e)))}function im(e,t,n){var r=e[0];if(Mv(r)){var o=am(e,n);return delete t.text,Array.isArray(o)?o.map(function(e){return Ph(Ph({},t),e)}):[Ph(Ph({},t),o)]}if(Lv(r))return null;var i=Hv(r)?{text:om(r.textContent||"",r)}:nm(e,n);return[Ph(Ph({},t),i)]}function am(e,t){Xv.forEach(function(t){var n=t.selector,r=t.preParseHtml;e[0].matches(n)&&(e=qg(r(e[0])))});var n=Gv(e);if("span"===n){if(e.attr("data-w-e-type"))return tm(e,t);if((o=Array.from(e[0].childNodes)).some(function(e){return!Hv(e)&&!Lv(e)})){var r=rm(qg(e[0]),t);return o.flatMap(function(e){return im(qg(e),r,t)||[]})}return nm(e,t)}if("code"===n)return"pre"===Gv(e.parent())?tm(e,t):nm(e,t);if(Yv.includes(n)){var o;if((o=Array.from(e[0].childNodes)).some(function(e){return!Hv(e)&&!Lv(e)})){var i=rm(qg(e[0]),t);return o.flatMap(function(e){return im(qg(e),i,t)||[]})}return nm(e,t)}return tm(e,t)}function sm(e,t,n){var r=qg(n);return!!r.attr(t)||(r.attr(t,"true"),e.on(eg,function(){r.removeAttr(t)}),!1)}function um(e,t){void 0===t&&(t="");var n=[],r=e.getConfig().sanitizeHtml;""===t&&(t="


"),0!==t.indexOf("<")&&(t=t.split(/\n/).map(function(e){return"

".concat(e,"

")}).join("")),t=r?r(t):t;var o=qg("
".concat(t,"
"));return Array.from(o.children()).forEach(function(t){var r=am(qg(t),e);Array.isArray(r)?r.forEach(function(e){return n.push(e)}):n.push(r)}),n}function lm(e,t){return"w-e-element-".concat(e,"-").concat(t)}var cm,dm,fm=[],pm={};function hm(e,t,n){var r=n.isInline(e)?"span":"div";return"<".concat(r,">").concat(t,"")}var gm=function(){if(dm)return cm;dm=1;var e=9007199254740991,t="[object Map]",n="[object Promise]",r="[object Set]",o="[object WeakMap]",i="[object DataView]",a=/^\[object .+?Constructor\]$/,s=/^(?:0|[1-9]\d*)$/,u="\\ud800-\\udfff",l="\\u0300-\\u036f\\ufe20-\\ufe23",c="\\u20d0-\\u20f0",d="\\ufe0e\\ufe0f",f="["+u+"]",p="["+l+c+"]",h="\\ud83c[\\udffb-\\udfff]",g="[^"+u+"]",v="(?:\\ud83c[\\udde6-\\uddff]){2}",m="[\\ud800-\\udbff][\\udc00-\\udfff]",y="\\u200d",b="(?:"+p+"|"+h+")?",E="["+d+"]?",w=E+b+"(?:"+y+"(?:"+[g,v,m].join("|")+")"+E+b+")*",C="(?:"+[g+p+"?",p,v,m,f].join("|")+")",D=RegExp(h+"(?="+h+")|"+C+w,"g"),A=RegExp("["+y+u+l+c+d+"]"),S="object"==typeof O&&O&&O.Object===Object&&O,x="object"==typeof self&&self&&self.Object===Object&&self,N=S||x||Function("return this")();function B(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function T(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var k,F,P,I=Function.prototype,R=Object.prototype,_=N["__core-js_shared__"],L=(P=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||""))?"Symbol(src)_1."+P:"",M=I.toString,j=R.hasOwnProperty,H=R.toString,z=RegExp("^"+M.call(j).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$=N.Symbol,U=$?$.iterator:void 0,V=R.propertyIsEnumerable,W=(k=Object.keys,F=Object,function(e){return k(F(e))}),G=ne(N,"DataView"),q=ne(N,"Map"),K=ne(N,"Promise"),Y=ne(N,"Set"),X=ne(N,"WeakMap"),Z=ie(G),J=ie(q),Q=ie(K),ee=ie(Y),te=ie(X);function ne(e,t){var n,r,o=(r=t,null==(n=e)?void 0:n[r]);return function(e){if(!le(e)||(t=e,L&&L in t))return!1;var t,n=ue(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(n){}return t}(e)?z:a;return n.test(ie(e))}(o)?o:void 0}var re=function(e){return H.call(e)};function oe(t,n){return!!(n=null==n?e:n)&&("number"==typeof t||s.test(t))&&t>-1&&t%1==0&&t-1&&n%1==0&&n<=e)&&!ue(t);var n}function ue(e){var t=le(e)?H.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}function le(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ce(e){return!!e&&"object"==typeof e}function de(e){return e?function(e,t){return function(e,t){for(var n=-1,r=e?e.length:0,o=Array(r);++n=0;O-=1){var N=B[O];if(xm(b,N)){E=N,f="backward";break}}if(!(E||"forward"!==f&&f)){var B=Mh(Mh([],Lh(S(x)),!1),Lh(S(null==x?void 0:x.nextElementSibling)),!1);try{for(var T=_h(B),k=T.next();!k.done;k=T.next())if(N=k.value,Om(b,N)){E=N,f="forward";break}}catch(I){r={error:I}}finally{try{k&&!k.done&&(o=T.return)&&o.call(T)}finally{if(r)throw r.error}}}E&&(p=E.closest('[data-slate-node="text"]'),w=E,"forward"===f?h=0:(h=w.textContent.length,w.querySelectorAll("[data-slate-zero-width]").forEach(function(e){h-=e.textContent.length})))}w&&h===w.textContent.length&&(d.hasAttribute("data-slate-zero-width")||Em&&(null===(i=w.textContent)||void 0===i?void 0:i.endsWith("\n")))&&(h-=1)}if(!p){if(s)return null;throw new Error("Cannot resolve a Slate point from DOM point: ".concat(t))}var F,P=Nm.toSlateNode(e,p);try{F=Nm.findPath(e,P)}catch(I){if(s)return null;throw I}return{path:F,offset:h}},hasRange:function(e,t){var n=t.anchor,r=t.focus;return Dp.hasPath(e,n.path)&&Dp.hasPath(e,r.path)},getNodeType:function(e){return _f.isElement(e)?e.type:""},checkNodeType:function(e,t){return this.getNodeType(e)===t},getNodesStr:function(e){return e.map(function(e){return zf.string(e)}).join("")},getSelectedElems:function(e){var t,n,r=[],o=Dp.nodes(e,{universal:!0});try{for(var i=_h(o),a=i.next();!a.done;a=i.next()){var s=Lh(a.value,1)[0];_f.isElement(s)&&r.push(s)}}catch(u){t={error:u}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},getSelectedNodeByType:function(e,t){var n=this,r=Lh(Dp.nodes(e,{match:function(e){return n.checkNodeType(e,t)},universal:!0}),1)[0];return null==r?null:r[0]},getSelectedTextNode:function(e){var t=Lh(Dp.nodes(e,{match:function(e){return Ip.isText(e)},universal:!0}),1)[0];return null==t?null:t[0]},isNodeSelected:function(e,t){var n=Lh(Dp.nodes(e,{match:function(e){return e===t},universal:!0}),1)[0];return null!=n&&Lh(n,1)[0]===t},isSelectionAtLineEnd:function(e,t){var n=e.selection;return!!n&&(Dp.isEnd(e,n.anchor,t)||Dp.isEnd(e,n.focus,t))},getTextarea:function(e){var t=ag.get(e);if(null==t)throw new Error("Cannot find textarea instance by editor");return t},getToolbar:function(e){return lg.get(e)||null},getHoverbar:function(e){return dg.get(e)||null},normalizeContent:function(e){e.children.forEach(function(t,n){e.normalizeNode([t,[n]])})},getLeftLengthOfMaxLength:function(e){var t=e.getConfig(),n=t.maxLength,r=t.onMaxLength;if("number"!=typeof n||n<=0)return 1/0;var o=n-e.getText().replace(/\r|\n|(\r\n)|(\n\r)/g,"").length;return o<=0&&r&&r(e),o},cleanExposedTexNodeInSelectionBlock:function(e){var t,n,r,o,i=Nm.getTextarea(e).$textArea,a=null==i?void 0:i[0].childNodes;if(a)try{for(var s=_h(Array.from(a)),u=s.next();!u.done;u=s.next()){var l=u.value;if(!Hv(l))break;l.remove()}}catch(g){t={error:g}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}var c=Dp.nodes(e,{match:function(t){return!(!_f.isElement(t)||e.isInline(t))},universal:!0});try{for(var d=_h(c),f=d.next();!f.done;f=d.next()){var p=f.value;if(null!=p){var h=p[0];Wv(Nm.toDOMNode(e,h),function(e,t){var n=qg(t);n.attr("data-slate-string")||n.attr("data-slate-zero-width")||n.attr("data-w-e-reserve")||t.removeChild(e)})}}}catch(g){r={error:g}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}},isLastNode:function(e,t){var n=e.children||[];return n[n.length-1]===t},genEmptyParagraph:function(){return{type:"paragraph",children:[{text:""}]}},isSelectedVoidNode:function(e){var t,n,r=Dp.nodes(e,{match:function(t){return e.isVoid(t)}}),o=0;try{for(var i=_h(r),a=i.next();!a.done;a=i.next())a.value&&(o+=1)}catch(s){t={error:s}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return o>0},isSelectedEmptyParagraph:function(e){var t=e.selection;if(null==t)return!1;if(If.isExpanded(t))return!1;var n=Nm.getSelectedNodeByType(e,"paragraph");if(null===n)return!1;var r=n.children;return 1===r.length&&(""===r[0].text||void 0)},isEmptyPath:function(e,t){var n=Dp.node(e,t);if(null==n)return!1;var r=Lh(n,1)[0].children;return 1===r.length&&""===r[0].text}};function Bm(e,t){return _f.isElement(e)?function(e,t){var n=e.type,r=void 0===n?"":n,o=e.children,i=void 0===o?[]:o,a=Dp.isVoid(t,e),s="";a||(s=i.map(function(e){return Bm(e,t)}).join(""));var u=(pm[r]||hm)(e,s,t),l="";if(l="string"==typeof u?u:u.html||"",a||fm.forEach(function(n){return l=n(e,l,t)}),"string"==typeof u)return l;var c=u.prefix,d=void 0===c?"":c,f=u.suffix,p=void 0===f?"":f;return d&&(l=d+l),p&&(l+=p),l}(e,t):function(e,t){var n=e.text;if(null==n)throw new Error("Current node is not slate Text ".concat(JSON.stringify(e)));var r=n;r=r.replace(/ {2}/g,"  ").replace(//g,">").replace(/®/g,"®").replace(/©/g,"©").replace(/™/g,"™");var o=Nm.getParentsNodes(t,e).some(function(e){return"pre"===Nm.getNodeType(e)});if(o||(r=r.replace(/\n\r|\r\n|\r|\n/g,"
")),o&&(r=r.replace(/ /g," ")),""===r){var i=Nm.getParentNode(null,e);if(!i||0!==i.children.length)return r;r="
"}return fm.forEach(function(n){return r=n(e,r,t)}),r}(e,t)}var Tm=function(e,t){var n=(t.top+t.bottom)/2;return e.top<=n&&e.bottom>=n},km=function(e,t,n){var r=Nm.toDOMRange(e,t).getBoundingClientRect(),o=Nm.toDOMRange(e,n).getBoundingClientRect();return Tm(r,o)&&Tm(o,r)},Fm=function(e,t){var n,r,o=[];try{for(var i=_h(Dp.levels(e,{at:t})),a=i.next();!a.done;a=i.next()){var s=Lh(a.value,2),u=s[0],l=s[1],c=Nm.findKey(e,u);o.push([l,c])}}catch(d){n={error:d}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o};function Pm(e,t){e.isInline(t)?(e.insertNode(t),"link"===t.type&&e.insertFragment([{text:""}])):Zp.insertNodes(e,t,{mode:"highest"})}var Im,Rm,_m,Lm,Mm,jm,Hm,zm,$m,Um,Vm,Wm,Gm,qm,Km,Ym,Xm,Zm,Jm,Qm,ey,ty,ny,ry,oy,iy,ay,sy,uy,ly,cy,dy,fy,py,hy,gy,vy,my,yy,by,Ey=function(e){var t=e,n=t.onChange,r=t.insertText,o=t.apply,i=t.deleteBackward,a=t.deleteFragment;return t.insertText=function(e){t.getConfig().readOnly||r(e)},t.apply=function(e){var n,r,i,a,s,u,l,c,d=[];switch(e.type){case"insert_text":case"remove_text":case"set_node":case"split_node":d.push.apply(d,Mh([],Lh(Fm(t,e.path)),!1));break;case"insert_node":case"remove_node":d.push.apply(d,Mh([],Lh(Fm(t,Nf.parent(e.path))),!1));break;case"merge_node":var f=Nf.previous(e.path);d.push.apply(d,Mh([],Lh(Fm(t,f)),!1));break;case"move_node":var p=Nf.common(Nf.parent(e.path),Nf.parent(e.newPath));d.push.apply(d,Mh([],Lh(Fm(t,p)),!1));break;case"set_selection":(null===(a=null===(i=e.newProperties)||void 0===i?void 0:i.focus)||void 0===a?void 0:a.path)&&(d.push.apply(d,Mh([],Lh(Fm(t,null===(u=null===(s=e.newProperties)||void 0===s?void 0:s.focus)||void 0===u?void 0:u.path)),!1)),d.push.apply(d,Mh([],Lh(Fm(t,null===(c=null===(l=e.properties)||void 0===l?void 0:l.focus)||void 0===c?void 0:c.path)),!1)))}o(e);try{for(var h=_h(d),g=h.next();!g.done;g=h.next()){var v=Lh(g.value,2),m=v[0],y=v[1],b=Lh(Dp.node(t,m),1)[0];Og.set(b,y),"type"in b&&(bg.has(b)&&bg.delete(b),Eg.has(b)&&Eg.delete(b))}}catch(E){n={error:E}}finally{try{g&&!g.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}},t.deleteBackward=function(n){if("line"!==n)return i(n);if(e.selection&&If.isCollapsed(e.selection)){var r=Dp.above(e,{match:function(t){return _f.isElement(t)&&Dp.isBlock(e,t)},at:e.selection});if(r){var o=Lh(r,2)[1],a=Dp.range(e,o,e.selection.anchor),s=function(e,t){var n=Dp.range(e,If.end(t)),r=Array.from(Dp.positions(e,{at:t})),o=0,i=r.length,a=Math.floor(i/2);if(km(e,Dp.range(e,r[o]),n))return Dp.range(e,r[o],n);if(r.length<2)return Dp.range(e,r[r.length-1],n);for(;a!==r.length&&a!==o;)km(e,Dp.range(e,r[a]),n)?i=a:o=a,a=Math.floor((o+i)/2);return Dp.range(e,r[i],n)}(t,a);If.isCollapsed(s)||Zp.delete(e,{at:s})}}},t.deleteFragment=function(e){var n,r,o=function(e){var t=e.selection;if(null==t||If.isCollapsed(t))return!1;var n=Lh(If.edges(t),2),r=n[0],o=n[1],i=Lh(Dp.edges(e,[]),2),a=i[0],s=i[1];return Op.equals(r,a)&&Op.equals(o,s)}(t);a(e),o&&(n=t,r=[{type:"paragraph",children:[{text:""}]}],Dp.withoutNormalizing(n,function(){for(var e=n.children.length-1;e>=0;e-=1)Zp.removeNodes(n,{at:[e]});Zp.insertNodes(n,r,{at:[0]})}),t.children.length>0&&Zp.select(t,Dp.start(t,[])))},t.onChange=function(){var e=t.selection;null!=e&&Tg.set(t,e),t.emit(tg),n()},t.handleTab=function(){t.insertText(" ")},t.getHtml=function(){var e=t.children,n=void 0===e?[]:e,r=t.getConfig().skipCacheTypes,o=void 0===r?["list-item"]:r;return n.map(function(e){var n=Nm.getNodeType(e);if(o.includes(n))return Bm(e,t);var r=Eg.get(e);if(r)return r;var i=Bm(e,t);return Eg.set(e,i),i}).join("")},t.getText=function(){var e=t.children;return(void 0===e?[]:e).map(function(e){return zf.string(e)}).join("\n")},t.getSelectionText=function(){var n=t.selection;return null==n?"":Dp.string(e,n)},t.getElemsByType=function(e,n){var r,o;void 0===n&&(n=!1);var i=[],a=Dp.nodes(t,{at:[],universal:!0});try{for(var s=_h(a),u=s.next();!u.done;u=s.next()){var l=Lh(u.value,1)[0];if(_f.isElement(l)&&(n?l.type.indexOf(e)>=0:l.type===e)){var c=Nm.findKey(t,l),d=lm(l.type,c.id);i.push(Ph(Ph({},l),{id:d}))}}}catch(f){r={error:f}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return i},t.getElemsByTypePrefix=function(e){return t.getElemsByType(e,!0)},t.isEmpty=function(){var e=t.children,n=void 0===e?[]:e;if(n.length>1)return!1;var r=n[0];if(null==r)return!0;if(!_f.isElement(r)||"paragraph"!==r.type)return!1;var o=r.children,i=void 0===o?[]:o;if(i.length>1)return!1;var a=i[0];return null==a||Ip.isText(a)&&""===a.text},t.clear=function(){Zp.delete(t,{at:{anchor:Dp.start(t,[]),focus:Dp.end(t,[])}}),0!==t.children.length?function(e){var t=e.children[0];if(1===e.children.length&&_f.isElement(t)&&("paragraph"!==t.type||""!==zf.string(t))&&""===zf.string(t)){var n=[{type:"paragraph",children:[{text:""}]}];Dp.withoutNormalizing(e,function(){Zp.removeNodes(e,{at:[0]}),Zp.insertNodes(e,n,{at:[0]})})}}(t):Zp.insertNodes(t,[{type:"paragraph",children:[{text:""}]}])},t.getParentNode=function(e){return Nm.getParentNode(t,e)},t.dangerouslyInsertHtml=function(e,n){if(void 0===e&&(e=""),void 0===n&&(n=!1),e){var r=document.createElement("div");r.innerHTML=e;var o=Array.from(r.childNodes);if(0!==(o=o.filter(function(e){var t=e.nodeName;return!!Hv(e)||!!Mv(e)&&!_g.has(t.toLowerCase())})).length){var i=t.selection;if(null!=i){var a=null;Nm.isSelectedEmptyParagraph(t)&&!n&&(a=[i.focus.path[0]]),r.setAttribute("hidden","true"),document.body.appendChild(r);var s=0;o.forEach(function(e,n){var r,i=e.nodeName,a=e.textContent,u=void 0===a?"":a;if(Hv(e)){if(!u||!u.trim())return;t.insertNode({text:u})}else if("BR"!==i){var l=e,c=!1;if(Yv.includes(i.toLowerCase()))c=!0;else for(var d in Jv)if(l.matches(d)){c=!0;break}if(c){var f=am(qg(l),t);return Array.isArray(f)?(f.forEach(function(e){return Pm(t,e)}),s+=1):(Pm(t,f),s+=1),void(Nm.isSelectedVoidNode(t)&&t.move(1))}var p=window.getComputedStyle(l).display;!Nm.isSelectedEmptyParagraph(t)&&p.indexOf("inline")<0&&(n>=1&&("matches"in(r=o[n-1])&&/^[ou]l$/i.test(r.tagName)&&!r.hasAttribute("data-w-e-type")&&t.insertBreak()),t.insertBreak()),t.dangerouslyInsertHtml(l.innerHTML,!0)}else t.insertText("\n")}),s&&a&&Nm.isEmptyPath(t,a)&&Zp.removeNodes(t,{at:a}),r.remove()}}}},t.setHtml=function(e){void 0===e&&(e="");var n=t.isDisabled(),r=t.isFocused(),o=JSON.stringify(t.selection);t.enable(),Tg.delete(t),t.focus(),t.clear();var i=um(t,null==e?"":e);if(Zp.insertFragment(t,i),r||(t.deselect(),t.blur()),n&&(t.deselect(),t.disable()),t.isFocused())try{var a=JSON.parse(o);If.isRange(a)&&Nm.hasRange(t,a)?t.select(a):t.select(Dp.start(t,[]))}catch(s){t.select(Dp.start(t,[]))}},t},wy=1,Cy=function(e){var t=e;return t.id="wangEditor-".concat(wy),wy+=1,t.isDestroyed=!1,t.isFullScreen=!1,t.focus=function(e){if(Nm.toDOMNode(t,t).focus({preventScroll:!0}),Bg.set(t,!0),e){var n=Dp.end(t,[]);Zp.select(t,n)}else{var r=Tg.get(t);r?Zp.select(t,r):Zp.select(t,Dp.start(t,[]))}},t.isFocused=function(){return!!Bg.get(t)},t.blur=function(){Nm.toDOMNode(t,t).blur(),Zp.deselect(t),Bg.set(t,!1)},t.updateView=function(){Nm.getTextarea(t).changeViewState();var e=Nm.getToolbar(t);e&&e.changeToolbarState();var n=Nm.getHoverbar(t);n&&n.changeHoverbarState()},t.destroy=function(){if(!t.isDestroyed){var e=Nm.getTextarea(t);e.destroy(),ag.delete(t),sg.delete(e);var n=Nm.getToolbar(t);n&&(n.destroy(),lg.delete(t),ug.delete(n));var r=Nm.getHoverbar(t);r&&(r.destroy(),dg.delete(t),cg.delete(r)),t.isDestroyed=!0,t.emit(eg)}},t.scrollToElem=function(e){if(t.getConfig().scroll){var n=qg("#".concat(e));if(0!==n.length){var r=n[0];if(!Nm.hasDOMNode(t,r))return"Element (found by id is '".concat(e,"') is not in editor DOM"),void"\n 通过 id '".concat(e,"' 找到的 element 不在 editor DOM 之内");var o=Nm.getTextarea(t),i=o.$textAreaContainer,a=o.$scroll,s=n.offset().top,u=i.offset().top;a[0].scrollBy({top:s-u,behavior:"smooth"})}}else{0}},t.showProgressBar=function(e){e<1||Nm.getTextarea(t).changeProgress(e)},t.hidePanelOrModal=function(){var e=pg.get(t);null!=e&&e.forEach(function(e){return e.hide()})},t.enable=function(){t.getConfig().readOnly=!1,t.updateView()},t.disable=function(){t.getConfig().readOnly=!0,t.updateView()},t.isDisabled=function(){return t.getConfig().readOnly},t.toDOMNode=function(e){return Nm.toDOMNode(t,e)},t.fullScreen=function(){if(!t.isFullScreen){var e=null,n=Nm.getToolbar(t);n&&(e=n.$box);var r=Nm.getTextarea(t).$box.parent();if(e&&e.parent()[0]!==r[0])throw new Error("Can not set full screen, cause toolbar DOM parent is not equal to textarea DOM parent\n不能设置全屏,因为 toolbar DOM 父节点和 textarea DOM 父节点不一致");r.addClass("w-e-full-screen-container");var o=r.css("z-index");r.attr("data-z-index",o.toString()),t.isFullScreen=!0,t.emit(rg)}},t.unFullScreen=function(){if(t.isFullScreen){var e=Nm.getTextarea(t).$box.parent();setTimeout(function(){e.removeClass("w-e-full-screen-container"),t.isFullScreen=!1,t.emit(og)},200)}},t.getEditableContainer=function(){return Nm.getTextarea(t).$textAreaContainer[0]},t},Dy={exports:{}},Ay={exports:{}};function Sy(){return Rm?Im:(Rm=1,Im=function(e){return null!=e})}function xy(){if(Um)return $m;Um=1;var e=function(){if(zm)return Hm;zm=1;var e=function(){if(jm)return Mm;jm=1;var t=function(){if(Lm)return _m;Lm=1;var e=Sy(),t={object:!0,function:!0,undefined:!0};return _m=function(n){return!!e(n)&&hasOwnProperty.call(t,typeof n)}}();return Mm=function(n){if(!t(n))return!1;try{return!!n.constructor&&n.constructor.prototype===n}catch(e){return!1}}}();return Hm=function(t){if("function"!=typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!=typeof t.length)return!1;if("function"!=typeof t.call)return!1;if("function"!=typeof t.apply)return!1}catch(n){return!1}return!e(t)}}(),t=/^\s*class[\s{/}]/,n=Function.prototype.toString;return $m=function(r){return!!e(r)&&!t.test(n.call(r))}}function Oy(){if(Zm)return Xm;Zm=1;var e=(Ym?Km:(Ym=1,Km=function(){}))();return Xm=function(t){return t!==e&&null!==t}}function Ny(){if(iy)return oy;iy=1;var e=(ty||(ty=1,ey=(qm?Gm:(qm=1,Gm=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}))()?Object.keys:function(){if(Qm)return Jm;Qm=1;var e=Oy(),t=Object.keys;return Jm=function(n){return t(e(n)?Object(n):n)}}()),ey),t=function(){if(ry)return ny;ry=1;var e=Oy();return ny=function(t){if(!e(t))throw new TypeError("Cannot use null or undefined");return t}}(),n=Math.max;return oy=function(r,o){var i,a,s,u=n(arguments.length,2);for(r=Object(t(r)),s=function(e){try{r[e]=o[e]}catch(t){i||(i=t)}},a=1;a-1},fy}()),hy),i=Ay.exports=function(t,i){var a,s,u,l,c;return arguments.length<2||"string"!=typeof t?(l=i,i=t,t=null):l=arguments[2],e(t)?(a=o.call(t,"c"),s=o.call(t,"e"),u=o.call(t,"w")):(a=u=!0,s=!1),c={value:i,configurable:a,enumerable:s,writable:u},l?n(r(l),c):c};return i.gs=function(i,a,s){var u,l,c,d;return"string"!=typeof i?(c=s,s=a,a=i,i=null):c=arguments[3],e(a)?t(a)?e(s)?t(s)||(c=s,s=void 0):s=void 0:(c=a,a=s=void 0):a=void 0,e(i)?(u=o.call(i,"c"),l=o.call(i,"e")):(u=!0,l=!1),d={get:a,set:s,configurable:u,enumerable:l},c?n(r(c),d):d},Ay.exports}var Ty=(by||(by=1,function(e,t){var n,r,o,i,a,s,u,l=By(),c=yy?my:(yy=1,my=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}),d=Function.prototype.apply,f=Function.prototype.call,p=Object.create,h=Object.defineProperty,g=Object.defineProperties,v=Object.prototype.hasOwnProperty,m={configurable:!0,enumerable:!1,writable:!0};r=function(e,t){var r,i;return c(t),i=this,n.call(this,e,r=function(){o.call(i,e,r),d.call(t,this,arguments)}),r.__eeOnceListener__=t,this},i=function(e){var t,n,r,o,i;if(v.call(this,"__ee__")&&(o=this.__ee__[e]))if("object"==typeof o){for(n=arguments.length,i=new Array(n-1),t=1;t0){var n=e[0];if(Nm.getLeftLengthOfMaxLength(t)0};return o(n),n.innerHTML}(e,r);o&&i(o,n)}}else i(e,n)},t};function Hy(e){var t=Nm.getTextarea(e).$textAreaContainer,n=t.width(),r=t.height(),o=t.offset();return{top:o.top,left:o.left,width:n,height:r}}function zy(e){var t={top:"0",left:"0"},n=e.selection;if(null==n)return t;var r=Hy(e);if(null==r)return t;var o=r.top,i=r.left,a=r.width,s=r.height,u=Nm.toDOMRange(e,n).getClientRects(),l=u?u[0]:null;if(null==l)return t;var c={},d=l.top-o,f=l.left-i;if(f>a/2){var p=a-f;c.right="".concat(p+5,"px")}else c.left="".concat(f+5,"px");if(d>s/2){var h=s-d;c.bottom="".concat(h+5,"px")}else{var g=u[u.length-1],v=g.top-o+g.height;v<0&&(v=0),c.top="".concat(v+5,"px")}return c}function $y(e,t,n){void 0===n&&(n="modal");var r={top:"0",left:"0"};if(null==e.selection)return r;var o=_f.isElement(t)&&e.isVoid(t),i=_f.isElement(t)&&e.isInline(t),a=xg.get(t);if(null==a)return r;var s=a.getBoundingClientRect(),u=s.top,l=s.left,c=s.height,d=s.width;if(o){var f=function(e){var t=[];t.push(e);for(var n=0;t.length>0;){var r=t.pop();if(null==r)break;if((n+=1)>1e4)break;var o=r.nodeName;if(r.nodeType===kv.ELEMENT_NODE){var i=o.toLowerCase();if(Ov.includes(i)||"iframe"===i||"video"===i)return r;var a=r.children||[],s=a.length;if(s)for(var u=s-1;u>=0;u-=1)t.push(a[u])}}return null}(a);if(null!=f){var p=f.getBoundingClientRect();u=p.top,c=p.height}}var h=Hy(e);if(null==h)return r;var g=h.top,v=h.left,m=h.width,y=h.height,b={},E=u-g,w=l-v;if("bar"===n)return b.left="".concat(w,"px"),E>40?b.bottom="".concat(y-E+5,"px"):b.top="".concat(E+c+5,"px"),b;if("modal"===n){if(o?i?w>(m-d)/2?b.right="".concat(m-w+5,"px"):b.left="".concat(w+d+5,"px"):b.left="20px":b.left="".concat(w,"px"),o)(C=E)<0&&(C=0),b.top="".concat(C,"px");else if(E>(y-c)/2)b.bottom="".concat(y-E+5,"px");else{var C;(C=E+c)<0&&(C=0),b.top="".concat(C+5,"px")}return b}throw new Error("type '".concat(n,"' is invalid"))}function Uy(e,t){Bv(function(){var n=Hy(e);if(null!=n){var r,o=n.top,i=n.left,a=n.width,s=n.height,u=t.offset(),l=u.top,c=u.left,d=t.width(),f=t.height(),p=l-o,h=c-i,g=t.attr("style");if(g.indexOf("top")>=0&&(r=p+f-s)>0){var v=t.css("top"),m=parseInt(v.toString(),10)-r;m<0&&(m=0),t.css("top","".concat(m,"px"))}if(g.indexOf("bottom")>=0&&l<0){var y=t.css("bottom"),b=parseInt(y.toString(),10)-Math.abs(l);t.css("bottom","".concat(b,"px"))}if(g.indexOf("left")>=0&&(r=h+d-a)>0){var E=t.css("left"),w=parseInt(E.toString(),10)-r;w<0&&(w=0),t.css("left","".concat(w,"px"))}if(g.indexOf("right")>=0&&c<0){var C=t.css("right"),D=parseInt(C.toString(),10)-Math.abs(c);t.css("right","".concat(D,"px"))}}})}var Vy,Wy,Gy=function(e){var t=e,n=t.select,r=t.deselect,o=t.move;return t.select=function(e){n(e)},t.deselect=function(){var e=t.selection,n=Nm.findDocumentOrShadowRoot(t).getSelection();n&&n.rangeCount>0&&Nm.hasDOMNode(t,n.anchorNode)&&Nm.hasDOMNode(t,n.focusNode)&&n.removeAllRanges(),e&&r()},t.move=function(e,t){void 0===t&&(t=!1),"number"==typeof e?e&&(e<0||o({distance:e,unit:"character",reverse:t})):o(e)},t.moveReverse=function(e){t.move(e,!0)},t.restoreSelection=function(){var e=Tg.get(t);null!=e&&(t.focus(),n(e))},t.getSelectionPosition=function(){return zy(t)},t.getNodePosition=function(e){return $y(t,e)},t.isSelectedAll=function(){var e=t.selection;if(null==e)return!1;var n=Lh(If.edges(e),2),r=n[0],o=n[1],i=Lh(Dp.edges(t,[]),2),a=i[0],s=i[1];return!(!Op.equals(r,a)||!Op.equals(o,s))},t.selectAll=function(){var e=Dp.start(t,[]),r=Dp.end(t,[]);n({anchor:e,focus:r})},t},qy=function(){if(Wy)return Vy;Wy=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,r=/^0o[0-7]+$/i,o=parseInt,i="object"==typeof O&&O&&O.Object===Object&&O,a="object"==typeof self&&self&&self.Object===Object&&self,s=i||a||Function("return this")(),u=Object.prototype.toString,l=Math.max,c=Math.min,d=function(){return s.Date.now()};function f(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function p(i){if("number"==typeof i)return i;if("symbol"==typeof(a=i)||function(e){return!!e&&"object"==typeof e}(a)&&"[object Symbol]"==u.call(a))return NaN;var a;if(f(i)){var s="function"==typeof i.valueOf?i.valueOf():i;i=f(s)?s+"":s}if("string"!=typeof i)return 0===i?i:+i;i=i.replace(e,"");var l=n.test(i);return l||r.test(i)?o(i.slice(2),l?2:8):t.test(i)?NaN:+i}return Vy=function(e,t,n){var r,o,i,a,s,u,h=0,g=!1,v=!1,m=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=r,i=o;return r=o=void 0,h=t,a=e.apply(i,n)}function b(e){var n=e-u;return void 0===u||n>=t||n<0||v&&e-h>=i}function E(){var e,n,r=d();if(b(r))return w(r);s=setTimeout(E,(n=t-((e=r)-u),v?c(n,i-(e-h)):n))}function w(e){return s=void 0,m&&r?y(e):(r=o=void 0,a)}function C(){var e,n=d(),i=b(n);if(r=arguments,o=this,u=n,i){if(void 0===s)return h=e=u,s=setTimeout(E,t),g?y(e):a;if(v)return s=setTimeout(E,t),y(u)}return void 0===s&&(s=setTimeout(E,t)),a}return t=p(t)||0,f(n)&&(g=!!n.leading,i=(v="maxWait"in n)?l(p(n.maxWait)||0,t):i,m="trailing"in n?!!n.trailing:m),C.cancel=function(){void 0!==s&&clearTimeout(s),h=0,r=u=o=s=void 0},C.flush=function(){return void 0===s?a:w(d())},C},Vy}(),Ky=N(qy);const Yy=e=>"string"==typeof e,Xy=()=>{let e,t;const n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},Zy=e=>null==e?"":""+e,Jy=/###/g,Qy=e=>e&&e.indexOf("###")>-1?e.replace(Jy,"."):e,eb=e=>!e||Yy(e),tb=(e,t,n)=>{const r=Yy(t)?t.split("."):t;let o=0;for(;o{const{obj:r,k:o}=tb(e,t,Object);if(void 0!==r||1===t.length)return void(r[o]=n);let i=t[t.length-1],a=t.slice(0,t.length-1),s=tb(e,a,Object);for(;void 0===s.obj&&a.length;)i=`${a[a.length-1]}.${i}`,a=a.slice(0,a.length-1),s=tb(e,a,Object),s&&s.obj&&void 0!==s.obj[`${s.k}.${i}`]&&(s.obj=void 0);s.obj[`${s.k}.${i}`]=n},rb=(e,t)=>{const{obj:n,k:r}=tb(e,t);if(n)return n[r]},ob=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?Yy(e[r])||e[r]instanceof String||Yy(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):ob(e[r],t[r],n):e[r]=t[r]);return e},ib=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var ab={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const sb=e=>Yy(e)?e.replace(/[&<>"'\/]/g,e=>ab[e]):e,ub=[" ",",","?","!",";"],lb=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),cb=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let o=e;for(let i=0;i-1&&ae&&e.replace("_","-"),fb={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]}};class pb{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||fb,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),n=0;n{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{let[t,r]=e;for(let o=0;o{let[r,o]=t;for(let i=0;i1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):Yy(n)&&o?a.push(...n.split(o)):a.push(n)));const s=rb(this.data,a);return!s&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),!s&&i&&Yy(n)?cb(this.data&&this.data[e]&&this.data[e][t],n,o):s}addResource(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(a=e.split("."),r=t,t=a[1]),this.addNamespaces(t),nb(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const o in n)(Yy(n[o])||Array.isArray(n[o]))&&this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),r=n,n=t,t=a[1]),this.addNamespaces(t);let s=rb(this.data,a)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?ob(s,n,o):s={...s,...n},nb(this.data,a,s),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var mb={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(e=>{this.processors[e]&&(t=this.processors[e].process(t,n,r,o))}),t}};const yb={};class bb extends gb{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n,r;super(),n=e,r=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(e=>{n[e]&&(r[e]=n[e])}),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=hb.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;const n=this.resolve(e,t);return n&&void 0!==n.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const r=ub.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(0===r.length)return!0;const o=lb.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`);let i=!o.test(e);if(!i){const t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i})(e,n,r));if(i&&!a){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Yy(o)?[o]:o};const i=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(r)}return{key:e,namespaces:Yy(o)?[o]:o}}translate(e,t,n){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const r=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:i,namespaces:a}=this.extractFromKey(e[e.length-1],t),s=a[a.length-1],u=t.lng||this.language,l=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&"cimode"===u.toLowerCase()){if(l){const e=t.nsSeparator||this.options.nsSeparator;return r?{res:`${s}${e}${i}`,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:s,usedParams:this.getUsedParamsDetails(t)}:`${s}${e}${i}`}return r?{res:i,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:s,usedParams:this.getUsedParamsDetails(t)}:i}const c=this.resolve(e,t);let d=c&&c.res;const f=c&&c.usedKey||i,p=c&&c.exactUsedKey||i,h=Object.prototype.toString.apply(d),g=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,m=!Yy(d)&&"boolean"!=typeof d&&"number"!=typeof d;if(!(v&&d&&m&&["[object Number]","[object Function]","[object RegExp]"].indexOf(h)<0)||Yy(g)&&Array.isArray(d))if(v&&Yy(g)&&Array.isArray(d))d=d.join(g),d&&(d=this.extendTranslation(d,e,t,n));else{let r=!1,a=!1;const l=void 0!==t.count&&!Yy(t.count),f=bb.hasDefaultValue(t),p=l?this.pluralResolver.getSuffix(u,t.count,t):"",h=t.ordinal&&l?this.pluralResolver.getSuffix(u,t.count,{ordinal:!1}):"",g=l&&!t.ordinal&&0===t.count&&this.pluralResolver.shouldUseIntlApi(),v=g&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${p}`]||t[`defaultValue${h}`]||t.defaultValue;!this.isValidLookup(d)&&f&&(r=!0,d=v),this.isValidLookup(d)||(a=!0,d=i);const m=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&a?void 0:d,y=f&&v!==d&&this.options.updateMissing;if(a||r||y){if(this.logger.log(y?"updateKey":"missingKey",u,s,i,y?v:d),o){const e=this.resolve(i,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t{const o=f&&r!==d?r:m;this.options.missingKeyHandler?this.options.missingKeyHandler(e,s,n,o,y,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,s,n,o,y,t),this.emit("missingKey",e,s,n,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&l?e.forEach(e=>{const n=this.pluralResolver.getSuffixes(e,t);g&&t[`defaultValue${this.options.pluralSeparator}zero`]&&n.indexOf(`${this.options.pluralSeparator}zero`)<0&&n.push(`${this.options.pluralSeparator}zero`),n.forEach(n=>{r([e],i+n,t[`defaultValue${n}`]||v)})}):r(e,i,v))}d=this.extendTranslation(d,e,t,c,n),a&&d===i&&this.options.appendNamespaceToMissingKey&&(d=`${s}:${i}`),(a||r)&&this.options.parseMissingKeyHandler&&(d="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${s}:${i}`:i,r?d:void 0):this.options.parseMissingKeyHandler(d))}else{if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,d,{...t,ns:a}):`key '${i} (${this.language})' returned an object instead of string.`;return r?(c.res=e,c.usedParams=this.getUsedParamsDetails(t),c):e}if(o){const e=Array.isArray(d),n=e?[]:{},r=e?p:f;for(const i in d)if(Object.prototype.hasOwnProperty.call(d,i)){const e=`${r}${o}${i}`;n[i]=this.translate(e,{...t,joinArrays:!1,ns:a}),n[i]===e&&(n[i]=d[i])}d=n}}return r?(c.res=d,c.usedParams=this.getUsedParamsDetails(t),c):d}extendTranslation(e,t,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const a=Yy(e)&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let s;if(a){const t=e.match(this.interpolator.nestingRegexp);s=t&&t.length}let u=n.replace&&!Yy(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),e=this.interpolator.interpolate(e,u,n.lng||this.language||r.usedLng,n),a){const t=e.match(this.interpolator.nestingRegexp);s<(t&&t.length)&&(n.nest=!1)}!n.lng&&"v1"!==this.options.compatibilityAPI&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,function(){for(var e=arguments.length,r=new Array(e),a=0;a1&&void 0!==arguments[1]?arguments[1]:{};return Yy(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(t))return;const s=this.extractFromKey(e,a),u=s.key;n=u;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const c=void 0!==a.count&&!Yy(a.count),d=c&&!a.ordinal&&0===a.count&&this.pluralResolver.shouldUseIntlApi(),f=void 0!==a.context&&(Yy(a.context)||"number"==typeof a.context)&&""!==a.context,p=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);l.forEach(e=>{this.isValidLookup(t)||(i=e,!yb[`${p[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(i)&&(yb[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(n=>{if(this.isValidLookup(t))return;o=n;const i=[u];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(i,u,n,e,a);else{let e;c&&(e=this.pluralResolver.getSuffix(n,a.count,a));const t=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(i.push(u+e),a.ordinal&&0===e.indexOf(r)&&i.push(u+e.replace(r,this.options.pluralSeparator)),d&&i.push(u+t)),f){const n=`${u}${this.options.contextSeparator}${a.context}`;i.push(n),c&&(i.push(n+e),a.ordinal&&0===e.indexOf(r)&&i.push(n+e.replace(r,this.options.pluralSeparator)),d&&i.push(n+t))}}let s;for(;s=i.pop();)this.isValidLookup(t)||(r=s,t=this.getResource(n,e,s,a))}))})}),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!Yy(e.replace);let r=n?e.replace:e;if(n&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}const Eb=e=>e.charAt(0).toUpperCase()+e.slice(1);class wb{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=hb.create("languageUtils")}getScriptPartFromCode(e){if(!(e=db(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=db(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Yy(e)&&e.indexOf("-")>-1){if("undefined"!=typeof Intl&&void 0!==Intl.getCanonicalLocales)try{let t=Intl.getCanonicalLocales(e)[0];if(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)return t}catch(t){}const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=e.split("-");return this.options.lowerCaseLng?r=r.map(e=>e.toLowerCase()):2===r.length?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Eb(r[1].toLowerCase()))):3===r.length&&(r[0]=r[0].toLowerCase(),2===r[1].length&&(r[1]=r[1].toUpperCase()),"sgn"!==r[0]&&2===r[2].length&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Eb(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=Eb(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:e.indexOf("-")>0&&n.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),Yy(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],o=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Yy(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):Yy(e)&&o(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&o(this.formatLanguageCode(e))}),r}}let Cb=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Db={1:e=>Number(e>1),2:e=>Number(1!=e),3:e=>0,4:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),5:e=>Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5),6:e=>Number(1==e?0:e>=2&&e<=4?1:2),7:e=>Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),8:e=>Number(1==e?0:2==e?1:8!=e&&11!=e?2:3),9:e=>Number(e>=2),10:e=>Number(1==e?0:2==e?1:e<7?2:e<11?3:4),11:e=>Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3),12:e=>Number(e%10!=1||e%100==11),13:e=>Number(0!==e),14:e=>Number(1==e?0:2==e?1:3==e?2:3),15:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2),16:e=>Number(e%10==1&&e%100!=11?0:0!==e?1:2),17:e=>Number(1==e||e%10==1&&e%100!=11?0:1),18:e=>Number(0==e?0:1==e?1:2),19:e=>Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3),20:e=>Number(1==e?0:0==e||e%100>0&&e%100<20?1:2),21:e=>Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0),22:e=>Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)};const Ab=["v1","v2","v3"],Sb=["v4"],xb={zero:0,one:1,two:2,few:3,many:4,other:5};class Ob{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=hb.create("pluralResolver"),this.options.compatibilityJSON&&!Sb.includes(this.options.compatibilityJSON)||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(()=>{const e={};return Cb.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:Db[t.fc]}})}),e})(),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi()){const r=db("dev"===e?"en":e),o=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:o});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(r,{type:o})}catch(n){if(!e.match(/-|_/))return;const r=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(r,t)}return this.pluralRulesCache[i]=a,a}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(e,t);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((e,t)=>xb[e]-xb[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):n.numbers.map(n=>this.getSuffix(e,n,t)):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=this.getRule(e,n);return r?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:this.getSuffixRetroCompatible(r,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let r=e.numbers[n];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===r?r="plural":1===r&&(r=""));const o=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?`_plural_${r.toString()}`:o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!Ab.includes(this.options.compatibilityJSON)}}const Nb=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=((e,t,n)=>{const r=rb(e,n);return void 0!==r?r:rb(t,n)})(e,t,n);return!i&&o&&Yy(n)&&(i=cb(e,n,r),void 0===i&&(i=cb(t,n,r))),i},Bb=e=>e.replace(/\$/g,"$$$$");class Tb{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=hb.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:o,prefixEscaped:i,suffix:a,suffixEscaped:s,formatSeparator:u,unescapeSuffix:l,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:h,nestingOptionsSeparator:g,maxReplaces:v,alwaysFormat:m}=e.interpolation;this.escape=void 0!==t?t:sb,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?ib(o):i||"{{",this.suffix=a?ib(a):s||"}}",this.formatSeparator=u||",",this.unescapePrefix=l?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":l||"",this.nestingPrefix=d?ib(d):f||ib("$t("),this.nestingSuffix=p?ib(p):h||ib(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=v||1e3,this.alwaysFormat=void 0!==m&&m,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e&&e.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let o,i,a;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=e=>{if(e.indexOf(this.formatSeparator)<0){const o=Nb(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}const o=e.split(this.formatSeparator),i=o.shift().trim(),a=o.join(this.formatSeparator).trim();return this.format(Nb(t,s,i,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...r,...t,interpolationkey:i})};this.resetRegExp();const l=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,c=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Bb(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Bb(this.escape(e)):Bb(e)}].forEach(t=>{for(a=0;o=t.regex.exec(e);){const n=o[1].trim();if(i=u(n),void 0===i)if("function"==typeof l){const t=l(e,o,r);i=Yy(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else{if(c){i=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else Yy(i)||this.useRawValueToEscape||(i=Zy(i));const s=t.safeValue(i);if(e=e.replace(o[0],s),c?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t){let n,r,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let i=`{${r[1]}`;e=r[0],i=this.interpolate(i,o);const a=i.match(/'/g),s=i.match(/"/g);(a&&a.length%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(u){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,u),`${e}${n}${i}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let s=[];o={...i},o=o.replace&&!Yy(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let u=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){const e=n[1].split(this.formatSeparator).map(e=>e.trim());n[1]=e.shift(),s=e,u=!0}if(r=t(a.call(this,n[1].trim(),o),o),r&&n[0]===e&&!Yy(r))return r;Yy(r)||(r=Zy(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),u&&(r=s.reduce((e,t)=>this.format(e,t,i.lng,{...i,interpolationkey:n[1].trim()}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}const kb=e=>{const t={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const a=r+JSON.stringify(i);let s=t[a];return s||(s=e(db(r),o),t[a]=s),s(n)}};class Fb{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=hb.create("formatter"),this.options=e,this.formats={number:kb((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:kb((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:kb((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:kb((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:kb((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})},this.init(e)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=kb(t)}format(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=t.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(e=>e.indexOf(")")>-1)){const e=o.findIndex(e=>e.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,e)].join(this.formatSeparator)}return o.reduce((e,t)=>{const{formatName:o,formatOptions:i}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(e=>{if(e){const[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();n[i]||(n[i]=o),"false"===o&&(n[i]=!1),"true"===o&&(n[i]=!0),isNaN(o)||(n[i]=parseInt(o,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[o]){let t=e;try{const a=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},s=a.locale||a.lng||r.locale||r.lng||n;t=this.formats[o](e,s,{...i,...r,...a})}catch(a){this.logger.warn(a)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e)}}class Pb extends gb{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=hb.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,r.backend,r)}queueLoad(e,t,n,r){const o={},i={},a={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{const a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===i[a]&&(i[a]=!0):(this.state[a]=1,r=!1,void 0===i[a]&&(i[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===s[t]&&(s[t]=!0)))}),r||(a[e]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){const r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),!t&&n&&this.store.addResourceBundle(o,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const a={};this.queue.forEach(n=>{var r,s;((e,t,n)=>{const{obj:r,k:o}=tb(e,t,Object);r[o]=r[o]||[],r[o].push(n)})(n.loaded,[o],i),s=e,void 0!==(r=n).pending[s]&&(delete r.pending[s],r.pendingCount--),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{a[e]||(a[e]={});const t=n.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:i});this.readingCalls++;const a=(a,s)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&s&&r{this.read.call(this,e,t,n,r+1,2*o,i)},o):i(a,s)},s=this.backend[n].bind(this.backend);if(2!==s.length)return s(e,t,a);try{const n=s(e,t);n&&"function"==typeof n.then?n.then(e=>a(null,e)).catch(a):a(null,n)}catch(u){a(u)}}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();Yy(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Yy(t)&&(t=[t]);const o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(n,i)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,i),this.loaded(e,n,i)})}saveMissing(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){const u={...i,isUpdate:o},l=this.backend.create.bind(this.backend);if(l.length<6)try{let o;o=5===l.length?l(e,t,n,r,u):l(e,t,n,r),o&&"function"==typeof o.then?o.then(e=>a(null,e)).catch(a):a(null,o)}catch(s){a(s)}else l(e,t,n,r,a,u)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}const Ib=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),Yy(e[1])&&(t.defaultValue=e[1]),Yy(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Rb=e=>(Yy(e.ns)&&(e.ns=[e.ns]),Yy(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Yy(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),_b=()=>{};class Lb extends gb{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var n;if(super(),this.options=Rb(e),this.services={},this.logger=hb,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&(Yy(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=Ib();this.options={...r,...this.options,...Rb(t)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);const o=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let t;this.modules.logger?hb.init(o(this.modules.logger),this.options):hb.init(null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!=typeof Intl&&(t=Fb);const n=new wb(this.options);this.store=new vb(this.options.resources,this.options);const i=this.services;i.logger=hb,i.resourceStore=this.store,i.languageUtils=n,i.pluralResolver=new Ob(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(i.formatter=o(t),i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new Tb(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new Pb(o(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o1?n-1:0),o=1;o{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,n||(n=_b),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(t=>{this[t]=function(){return e.store[t](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(t=>{this[t]=function(){return e.store[t](...arguments),e}});const i=Xy(),a=()=>{const e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(t),n(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?a():setTimeout(a,0),i}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_b;const n=Yy(e)?e:this.language;if("function"==typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&"cimode"===n.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],r=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};n?r(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>r(e)),this.options.preload&&this.options.preload.forEach(e=>r(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)})}else t(null)}reloadResources(e,t,n){const r=Xy();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=_b),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&mb.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let t=0;t-1)&&this.store.hasLanguageSomeTranslations(e)){this.resolvedLanguage=e;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;const r=Xy();this.emit("languageChanging",e);const o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(e,i)=>{i?(o(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,r.resolve(function(){return n.t(...arguments)}),t&&t(e,function(){return n.t(...arguments)})},a=t=>{e||t||!this.services.languageDetector||(t=[]);const n=Yy(t)?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||o(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,e=>{i(e,n)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),r}getFixedT(e,t,n){var r=this;const o=function(e,t){let i;if("object"!=typeof t){for(var a=arguments.length,s=new Array(a>2?a-2:0),u=2;u`${i.keyPrefix}${l}${e}`):i.keyPrefix?`${i.keyPrefix}${l}${e}`:e,r.t(c,i)};return Yy(e)?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const i=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,i);if(void 0!==e)return e}return!(!this.hasResourceBundle(n,e)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!i(n,e)||r&&!i(o,e)))}loadNamespaces(e,t){const n=Xy();return this.options.ns?(Yy(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Xy();Yy(e)&&(e=[e]);const r=this.options.preload||[],o=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services&&this.services.languageUtils||new wb(Ib());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new Lb(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_b;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},o=new Lb(r);return void 0===e.debug&&void 0===e.prefix||(o.logger=o.logger.clone(e)),["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new vb(this.store.data,r),o.services.resourceStore=o.store),o.translator=new bb(o.services,r),o.translator.on("*",function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r')}function Vb(){return qg('
')}function Wb(e,t,n,r,o){if(void 0===r&&(r=""),void 0===o&&(o=!1),t){if(r){var i=bm?"cmd":"ctrl";r=r.replace("mod",i)}if(o)r&&(e.attr("data-tooltip",r),e.addClass("w-e-menu-tooltip-v5"),e.addClass("tooltip-right"));else{var a=r?"".concat(n,"\n").concat(r):n;e.attr("data-tooltip",a),e.addClass("w-e-menu-tooltip-v5")}}}var Gb=function(){function e(e,t,n){void 0===n&&(n=!1);var r=this;this.$elem=qg('
'),this.$button=qg(''),this.disabled=!1,this.menu=t;var o=t.tag,i=t.width;if("button"!==o)throw new Error("Invalid tag '".concat(o,"', expected 'button'"));var a=t.title,s=t.hotkey,u=void 0===s?"":s,l=t.iconSvg,c=void 0===l?"":l,d=this.$button;if(c){var f=qg(c);$b(f),d.append(f)}else d.text(a);Wb(d,c,a,u,n),n&&c&&d.append(qg(''.concat(a,""))),i&&d.css("width","".concat(i,"px")),d.attr("data-menu-key",e),this.$elem.append(d),Bv(function(){return r.init()})}return e.prototype.init=function(){var e=this;this.setActive(),this.setDisabled(),this.$button.on("click",function(t){t.preventDefault(),iE(e).hidePanelOrModal(),e.disabled||(e.exec(),e.onButtonClick())})},e.prototype.exec=function(){var e=iE(this),t=this.menu,n=t.getValue(e);t.exec(e,n),this.changeMenuState()},e.prototype.setActive=function(){var e=iE(this),t=this.$button,n="active";this.menu.isActive(e)?t.addClass(n):t.removeClass(n)},e.prototype.setDisabled=function(){var e=iE(this),t=this.$button,n=this.menu.isDisabled(e);(null==e.selection||e.isDisabled())&&(n=!0),this.menu.alwaysEnable&&(n=!1);var r="disabled";n?t.addClass(r):t.removeClass(r),this.disabled=n},e.prototype.setIcon=function(){var e=iE(this),t=this.$button;if(this.menu.getIcon){var n=this.menu.getIcon(e);if(n){t.find("svg").remove();var r=qg(n);$b(r),t.append(r)}}},e.prototype.setTooltip=function(){var e=iE(this),t=this.$button;if(this.menu.getTitle){var n=this.menu.getTitle(e),r=this.menu.iconSvg;n&&r&&Wb(t,r,n)}},e.prototype.changeMenuState=function(){this.setActive(),this.setDisabled(),this.setIcon(),this.setTooltip()},e}(),qb=function(e){function t(t,n,r){return void 0===r&&(r=!1),e.call(this,t,n,r)||this}return Fh(t,e),t.prototype.onButtonClick=function(){},t}(Gb),Kb=function(){function e(e){this.isShow=!1,this.showTime=0,this.record(e)}return e.prototype.record=function(e){var t=pg.get(e);null==t&&(t=new Set,pg.set(e,t)),t.add(this),hg.set(this,e)},e.prototype.renderContent=function(e){var t=this.$elem;t.empty(),t.append(e);var n=this.genSelfElem();n&&t.append(n)},e.prototype.appendTo=function(e){var t=this.$elem;e.append(t)},e.prototype.show=function(){if(!this.isShow){this.showTime=Date.now(),this.$elem.show(),this.isShow=!0;var e=hg.get(this);e&&e.emit("modalOrPanelShow",this)}},e.prototype.hide=function(){if(this.isShow&&!(Date.now()-this.showTime<200)){this.$elem.hide(),this.isShow=!1;var e=hg.get(this);e&&e.emit("modalOrPanelHide")}},e}(),Yb=function(e){function t(t){var n=e.call(this,t)||this;return n.type="dropPanel",n.$elem=qg('
'),n}return Fh(t,e),t.prototype.genSelfElem=function(){return null},t}(Kb),Xb=function(e){function t(t,n,r){void 0===r&&(r=!1);var o=e.call(this,t,n,r)||this;if(o.dropPanel=null,o.menu=n,n.showDropPanel){var i=Ub();o.$button.append(i)}return o}return Fh(t,e),t.prototype.onButtonClick=function(){this.menu.showDropPanel&&this.handleDropPanel()},t.prototype.handleDropPanel=function(){var e=this.menu;if(null!=e.getPanelContentElem){var t=iE(this);if(null==this.dropPanel){var n=new Yb(t),r=e.getPanelContentElem(t);n.renderContent(r),n.appendTo(this.$elem),n.show(),this.dropPanel=n}else{var o=this.dropPanel;o.isShow?o.hide():(r=e.getPanelContentElem(t),o.renderContent(r),o.show())}var i=this.dropPanel;if(i.isShow){var a=this.$elem,s=a.offset().left,u=a.parents(".w-e-bar");s-u.offset().left>=u.width()/2?i.$elem.css({left:"none",right:"0"}):i.$elem.css({left:"0",right:"none"})}}},t}(Gb),Zb=function(e){function t(t,n){void 0===n&&(n=0);var r=e.call(this,t)||this;r.type="modal",r.$elem=qg('
'),r.width=0,n&&(r.width=n);var o=r.$elem;return o.on("click",function(e){return e.stopPropagation()}),o.on("keyup",function(e){"Escape"===e.code&&(r.hide(),t.restoreSelection())}),r}return Fh(t,e),t.prototype.genSelfElem=function(){var e=this,t=qg(''.concat('',"")),n=hg.get(this);return t.on("click",function(){e.hide(),null==n||n.restoreSelection()}),t},t.prototype.setStyle=function(e){var t=this.width,n=this.$elem;n.attr("style",""),t&&n.css("width","".concat(t,"px")),n.css(e)},t}(Kb);function Jb(e,t,n){var r=qg('');r.append("".concat(e,""));var o=qg(''));return r.append(o),[r[0],o[0]]}function Qb(e,t){var n=qg('
'),r=qg('"));return n.append(r),[n[0],r[0]]}var eE=function(e){function t(t,n,r){void 0===r&&(r=!1);var o=e.call(this,t,n,r)||this;return o.$body=qg("body"),o.modal=null,o.menu=n,o}return Fh(t,e),t.prototype.onButtonClick=function(){this.menu.showModal&&this.handleModal()},t.prototype.getPosition=function(){var e=iE(this),t=this.menu.getModalPositionNode(e);return _f.isElement(t)?$y(e,t,"modal"):zy(e)},t.prototype.handleModal=function(){var e=iE(this),t=this.menu;if(null==this.modal){var n=new Zb(e,t.modalWidth);this.renderAndShowModal(n,!0),this.modal=n}else(n=this.modal).isShow?n.hide():this.renderAndShowModal(n,!1)},t.prototype.renderAndShowModal=function(e,t){void 0===t&&(t=!1);var n=iE(this),r=this.menu;if(null!=r.getModalContentElem){var o=Nm.getTextarea(n),i=Nm.getToolbar(n),a=((null==i?void 0:i.getConfig())||{}).modalAppendToBody,s=r.getModalContentElem(n);if(e.renderContent(s),a)e.setStyle({left:"0",right:"0"});else{var u=this.getPosition();e.setStyle(u)}t&&(a?e.appendTo(this.$body):e.appendTo(o.$textAreaContainer)),e.show(),a||Uy(n,e.$elem),setTimeout(function(){n.blur()})}},t}(Gb),tE=function(e){function t(t,n){var r=e.call(this,t)||this;return r.type="selectList",r.$elem=qg('
'),n&&r.$elem.css("width","".concat(n,"px")),r.$elem.on("click",function(e){e.stopPropagation()}),r}return Fh(t,e),t.prototype.renderList=function(e){var t=this.$elem;t.empty();var n=qg("
    ");e.forEach(function(e){var t=e.value,r=e.text,o=e.selected,i=e.styleForRenderMenuList,a=qg('
  • '));if(i&&a.css(i),o){var s=qg('');a.append(s),a.addClass("selected")}a.append(qg('').concat(r,""))),a.attr("title",r),n.append(a)}),t.append(n)},t.prototype.genSelfElem=function(){return null},t}(Kb),nE=function(){function e(e,t,n){void 0===n&&(n=!1);var r=this;this.$elem=qg('
    '),this.$button=qg(''),this.disabled=!1,this.selectList=null;var o=t.tag,i=t.title,a=t.width,s=t.iconSvg,u=void 0===s?"":s,l=t.hotkey,c=void 0===l?"":l;if("select"!==o)throw new Error("Invalid tag '".concat(o,"', expected 'select'"));var d=this.$button;a&&d.css("width","".concat(a,"px")),d.attr("data-menu-key",e),Wb(d,u,i,c,n),this.$elem.append(d),this.menu=t,Bv(function(){return r.init()})}return e.prototype.init=function(){var e=this;this.setSelectedValue(),this.$button.on("click",function(t){t.preventDefault(),iE(e).hidePanelOrModal(),e.trigger()})},e.prototype.trigger=function(){var e=this,t=iE(this);if(!t.isDisabled()&&!this.disabled){var n=this.menu;if(null==this.selectList){this.selectList=new tE(t,n.selectPanelWidth);var r=this.selectList,o=n.getOptions(t);r.renderList(o),r.appendTo(this.$elem),r.show(),r.$elem.on("click","li",function(t){var n=t.target;if(null!=n){t.preventDefault();var r=qg(n).attr("data-value");e.onChange(r)}})}else(r=this.selectList).isShow?r.hide():(o=n.getOptions(t),r.renderList(o),r.show())}},e.prototype.onChange=function(e){var t=iE(this),n=this.menu;n.exec&&n.exec(t,e)},e.prototype.setSelectedValue=function(){var e=iE(this),t=this.menu,n=t.getValue(e),r=function(e,t){for(var n=e.length,r="",o=0;o'),this.$container=qg('
    '),this.$button=qg('');var t=e.key,n=e.iconSvg,r=e.title,o=this.$elem,i=this.$button;if(n){var a=qg(n);$b(a),i.append(a)}else i.text(r);i.attr("data-menu-key",t);var s=Ub();i.append(s),o.append(i);var u=this.$container;o.append(u);var l=this.createObserver();this.observe(l)}return e.prototype.appendBarItem=function(e){var t=e.$elem;this.$container.append(t)},e.prototype.observe=function(e){var t=this.$container;e.observe(t[0],{childList:!0,subtree:!0,attributes:!0})},e.prototype.createObserver=function(){var e=this,t=this.$container,n=this.$button,r=new MutationObserver(function(){var o=t.find("button"),i=o.length;if(0!==i){var a=0;o.each(function(e){qg(e).hasClass("disabled")&&a++}),r.disconnect(),a===i?n.addClass("disabled"):n.removeClass("disabled"),e.observe(r)}});return r},e}(),oE=new WeakMap;function iE(e){var t=fg.get(e);if(null==t)throw new Error("Can not get editor instance");return t}function aE(e,t,n){void 0===n&&(n=!1);var r=oE.get(t);if(r)return r;var o=t.tag;if("button"===o){var i=t.showDropPanel,a=t.showModal;r=i?new Xb(e,t,n):a?new eE(e,t,n):new qb(e,t,n)}if("select"===o&&(r=new nE(e,t,n)),null==r)throw new Error("Invalid tag in menu ".concat(JSON.stringify(t)));return oE.set(t,r),r}function sE(e,t){var n=e.selection;return null!=n&&!If.isCollapsed(n)&&!Nm.getSelectedElems(e).some(function(t){if(e.isVoid(t))return!0;var n=t.type;return!!["pre","code","table"].includes(n)})&&!!Ip.isText(t)}var uE,lE,cE=function(){function e(){var e=this;this.$elem=qg('
    '),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null,this.isShow=!1,this.lngListen=function(){},this.changeHoverbarState=Ky(function(){var t=e.isShow,n=e.getSelectedNodeAndMenuKeys()||{},r=n.node,o=void 0===r?null:r,i=n.menuKeys,a=void 0===i?[]:i,s=e.getEditorInstance();if(null!=o&&e.changeItemsState(),o&&_f.isElement(o)&&t){var u=e.isSamePath(o,e.prevSelectedNode);if(!Dp.isBlock(s,o)&&u)return}e.hideAndClean(),null!=o&&(e.registerItems(a),e.setPosition(o),e.show()),e.prevSelectedNode=o},200),Bv(function(){var t=e.getEditorInstance(),n=e.$elem;n.on("mousedown",function(e){return e.preventDefault()},{passive:!1}),Nm.getTextarea(t).$textAreaContainer.append(n),t.on(tg,e.changeHoverbarState);var r=e.hideAndClean.bind(e);t.on(ng,r),t.on(rg,r),t.on(og,r)}),this.lngListen=Hb(function(){e.menus={},e.hideAndClean(),e.getEditorInstance().deselect()})}return e.prototype.getMenus=function(){return this.menus},e.prototype.hideAndClean=function(){var e=this.$elem;e.removeClass("w-e-bar-show").addClass("w-e-bar-hidden"),this.hoverbarItems=[],e.empty(),this.isShow=!1},e.prototype.checkPositionBottom=function(){var e=this.$elem,t=!1,n="undefined"!=typeof window?window.innerHeight:null;n&&n>=360&&n-e[0].getBoundingClientRect().bottom<360&&(t=!0),t?e.addClass("w-e-bar-bottom"):e.removeClass("w-e-bar-bottom")},e.prototype.show=function(){this.$elem.removeClass("w-e-bar-hidden").addClass("w-e-bar-show"),this.isShow=!0,this.checkPositionBottom()},e.prototype.changeItemsState=function(){var e=this;Bv(function(){e.hoverbarItems.forEach(function(e){e.changeMenuState()})})},e.prototype.registerItems=function(e){var t=this,n=this.$elem;e.forEach(function(e){if("|"!==e)t.registerSingleItem(e);else{var r=Vb();n.append(r)}})},e.prototype.registerSingleItem=function(e){var t=this.getEditorInstance(),n=this.menus,r=n[e];if(null==r){var o=ig[e];if(null==o)throw new Error("Not found menu item factory by key '".concat(e,"'"));if("function"!=typeof o)throw new Error("Menu item factory (key='".concat(e,"') is not a function"));r=o(),n[e]=r}var i=t.getMenuConfig(e);i&&void 0!==i.iconSvg&&(r.iconSvg=i.iconSvg);var a=aE(e,r);this.hoverbarItems.push(a),fg.set(a,t),this.$elem.append(a.$elem)},e.prototype.setPosition=function(e){var t=this.getEditorInstance(),n=this.$elem;if(n.attr("style",""),_f.isElement(e)){var r=$y(t,e,"bar");return n.css(r),void Uy(t,n)}if(Ip.isText(e))return r=zy(t),n.css(r),void Uy(t,n);throw new Error("hoverbar.setPosition error, current selected node is not elem nor text")},e.prototype.getSelectedNodeAndMenuKeys=function(){var e=this.getEditorInstance();if(null==e.selection)return null;var t=this.getHoverbarKeysConf(),n=null,r=[],o=function(o){var i=t[o],a=i.match,s=i.menuKeys,u=void 0===s?[]:s,l=a||function(e,t){return Nm.checkNodeType(t,o)},c=Lh(Dp.nodes(e,{match:function(t){return l(e,t)},universal:!0}),1)[0];if(null!=c)return n=c[0],r=u,"break"};for(var i in t)if("break"===o(i))break;return null==n||0===r.length?null:{node:n,menuKeys:r}},e.prototype.getEditorInstance=function(){var e=cg.get(this);if(null==e)throw new Error("Can not get editor instance");return e},e.prototype.getHoverbarKeysConf=function(){var e=this.getEditorInstance().getConfig().hoverbarKeys,t=void 0===e?{}:e,n=t.text;return n&&null==n.match&&(n.match=sE),t},e.prototype.isSamePath=function(e,t){if(null==e||null==t)return!1;var n=Nm.findPath(null,e),r=Nm.findPath(null,t);return Nf.equals(n,r)},e.prototype.destroy=function(){var e;this.changeHoverbarState.cancel(),this.$elem.remove(),null===(e=this.lngListen)||void 0===e||e.call(this),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null},e}();function dE(){if(lE)return uE;lE=1;var e="Expected a function",t=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,o=/^0o[0-7]+$/i,i=parseInt,a="object"==typeof O&&O&&O.Object===Object&&O,s="object"==typeof self&&self&&self.Object===Object&&self,u=a||s||Function("return this")(),l=Object.prototype.toString,c=Math.max,d=Math.min,f=function(){return u.Date.now()};function p(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function h(e){if("number"==typeof e)return e;if("symbol"==typeof(a=e)||function(e){return!!e&&"object"==typeof e}(a)&&"[object Symbol]"==l.call(a))return NaN;var a;if(p(e)){var s="function"==typeof e.valueOf?e.valueOf():e;e=p(s)?s+"":s}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(t,"");var u=r.test(e);return u||o.test(e)?i(e.slice(2),u?2:8):n.test(e)?NaN:+e}return uE=function(t,n,r){var o=!0,i=!0;if("function"!=typeof t)throw new TypeError(e);return p(r)&&(o="leading"in r?!!r.leading:o,i="trailing"in r?!!r.trailing:i),function(t,n,r){var o,i,a,s,u,l,g=0,v=!1,m=!1,y=!0;if("function"!=typeof t)throw new TypeError(e);function b(e){var n=o,r=i;return o=i=void 0,g=e,s=t.apply(r,n)}function E(e){var t=e-l;return void 0===l||t>=n||t<0||m&&e-g>=a}function w(){var e,t,r=f();if(E(r))return C(r);u=setTimeout(w,(t=n-((e=r)-l),m?d(t,a-(e-g)):t))}function C(e){return u=void 0,y&&o?b(e):(o=i=void 0,s)}function D(){var e,t=f(),r=E(t);if(o=arguments,i=this,l=t,r){if(void 0===u)return g=e=l,u=setTimeout(w,n),v?b(e):s;if(m)return u=setTimeout(w,n),b(l)}return void 0===u&&(u=setTimeout(w,n)),s}return n=h(n)||0,p(r)&&(v=!!r.leading,a=(m="maxWait"in r)?c(h(r.maxWait)||0,n):a,y="trailing"in r?!!r.trailing:y),D.cancel=function(){void 0!==u&&clearTimeout(u),g=0,o=l=i=u=void 0},D.flush=function(){return void 0===u?s:C(f())},D}(t,n,{leading:o,maxWait:n,trailing:i})}}var fE=N(dE());function pE(e,t){return _v(t)&&Nm.hasDOMNode(e,t,{editable:!0})}function hE(e,t){return _v(t)&&Nm.hasDOMNode(e,t)}const gE=e=>"object"==typeof e&&null!=e&&1===e.nodeType,vE=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,mE=(e,t)=>{if(e.clientHeight{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(t){return null}})(e);return!!t&&(t.clientHeightit||i>e&&a=t&&s>=n?i-e-r:a>t&&sn?a-t+o:0,bE=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t},EE=(e,t)=>{var n,r,o,i;if("undefined"==typeof document)return[];const{scrollMode:a,block:s,inline:u,boundary:l,skipOverflowHiddenElements:c}=t,d="function"==typeof l?l:e=>e!==l;if(!gE(e))throw new TypeError("Invalid target");const f=document.scrollingElement||document.documentElement,p=[];let h=e;for(;gE(h)&&d(h);){if(h=bE(h),h===f){p.push(h);break}null!=h&&h===document.body&&mE(h)&&!mE(document.documentElement)||null!=h&&mE(h,c)&&p.push(h)}const g=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,v=null!=(i=null==(o=window.visualViewport)?void 0:o.height)?i:innerHeight,{scrollX:m,scrollY:y}=window,{height:b,width:E,top:w,right:C,bottom:D,left:A}=e.getBoundingClientRect(),{top:S,right:x,bottom:O,left:N}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let B="start"===s||"nearest"===s?w-S:"end"===s?D+O:w+b/2-S+O,T="center"===u?A+E/2-N+x:"end"===u?C+x:A-N;const k=[];for(let F=0;F=0&&A>=0&&D<=v&&C<=g&&(e===f&&!mE(e)||w>=r&&D<=i&&A>=l&&C<=o))return k;const c=getComputedStyle(e),d=parseInt(c.borderLeftWidth,10),h=parseInt(c.borderTopWidth,10),S=parseInt(c.borderRightWidth,10),x=parseInt(c.borderBottomWidth,10);let O=0,N=0;const P="offsetWidth"in e?e.offsetWidth-e.clientWidth-d-S:0,I="offsetHeight"in e?e.offsetHeight-e.clientHeight-h-x:0,R="offsetWidth"in e?0===e.offsetWidth?0:n/e.offsetWidth:0,_="offsetHeight"in e?0===e.offsetHeight?0:t/e.offsetHeight:0;if(f===e)O="start"===s?B:"end"===s?B-v:"nearest"===s?yE(y,y+v,v,h,x,y+B,y+B+b,b):B-v/2,N="start"===u?T:"center"===u?T-g/2:"end"===u?T-g:yE(m,m+g,g,d,S,m+T,m+T+E,E),O=Math.max(0,O+y),N=Math.max(0,N+m);else{O="start"===s?B-r-h:"end"===s?B-i+x+I:"nearest"===s?yE(r,i,t,h,x+I,B,B+b,b):B-(r+t/2)+I/2,N="start"===u?T-l-d:"center"===u?T-(l+n/2)+P/2:"end"===u?T-o+S+P:yE(l,o,n,d,S+P,T,T+E,E);const{scrollLeft:a,scrollTop:c}=e;O=0===_?0:Math.max(0,Math.min(c+O/_,e.scrollHeight-t/_+I)),N=0===R?0:Math.max(0,Math.min(a+N/R,e.scrollWidth-n/R+P)),B+=c-O,T+=a-N}k.push({el:e,top:O,left:N})}return k};function wE(e){null!=e.selection&&(e.selection=null,e.onChange())}function CE(e,t,n){void 0===n&&(n=!1);var r=t.selection,o=t.getConfig(),i=Nm.findDocumentOrShadowRoot(t).getSelection();if(i&&(!e.isComposing||n)&&t.isFocused()){var a="None"!==i.type;if(r||a){var s=Dg.get(t),u=!1;if(s.contains(i.anchorNode)&&s.contains(i.focusNode)&&(u=!0),a&&u&&r){var l=Nm.toSlateRange(t,i,{exactMatch:!0,suppressThrow:!0});if(l&&If.equals(l,r)){var c=!0;if(If.isCollapsed(r)){var d=i.anchorNode,f=i.anchorOffset;if(d===s){var p=s.childNodes,h=void 0;(h=p[f])&&h.matches("table")&&(c=!1),(h=p[f-1])&&h.matches("table")&&(c=!1)}}if(c)return}}if(!r||Nm.hasRange(t,r)){e.isUpdatingSelection=!0;var g=r&&Nm.toDOMRange(t,r);if(g){If.isBackward(r)?i.setBaseAndExtent(g.endContainer,g.endOffset,g.startContainer,g.startOffset):i.setBaseAndExtent(g.startContainer,g.startOffset,g.endContainer,g.endOffset);var v=g.startContainer.parentElement;if(!v.closest("[data-slate-spacer]")&&g.getBoundingClientRect){var m=g.getBoundingClientRect.bind(g)();0===m.top&&0===m.right&&0===m.bottom&&0===m.left&&0===m.height&&0===m.width||(v.getBoundingClientRect=g.getBoundingClientRect.bind(g));var y=document.body;(function(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;const n=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if("object"==typeof(r=t)&&"function"==typeof r.behavior)return t.behavior(EE(e,t));var r;const o="boolean"==typeof t||null==t?void 0:t.behavior;for(const{el:i,top:a,left:s}of EE(e,(e=>{return!1===e?{block:"end",inline:"nearest"}:(t=e)===Object(t)&&0!==Object.keys(t).length?e:{block:"start",inline:"nearest"};var t})(t))){const e=a-n.top+n.bottom,t=s-n.left+n.right;i.scroll({top:e,left:t,behavior:o})}})(v,{scrollMode:"if-needed",boundary:o.scroll&&s.parentElement||y,block:"end",behavior:"smooth"}),delete v.getBoundingClientRect}}else i.removeAllRanges();setTimeout(function(){g&&Em&&s.focus(),e.isUpdatingSelection=!1})}else t.selection=Nm.toSlateRange(t,i,{exactMatch:!1,suppressThrow:!1})}}}var DE,AE=new WeakMap,SE=new WeakMap,xE={},OE=function(){if(DE)return xE;DE=1,Object.defineProperty(xE,"__esModule",{value:!0});for(var e="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),t={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},n={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:e?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},r={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},o=1;o<20;o++)r["f"+o]=111+o;function i(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map(function(e){return a(e,t)}),o=function(e){return r.some(function(t){return s(t,e)})};return null==n?o:o(n)}function a(e,o){var i=o&&o.byKey,a={},s=(e=e.replace("++","+add")).split("+"),c=s.length;for(var d in t)a[t[d]]=!1;var f=!0,p=!1,h=void 0;try{for(var g,v=s[Symbol.iterator]();!(f=(g=v.next()).done);f=!0){var m=g.value,y=m.endsWith("?")&&m.length>1;y&&(m=m.slice(0,-1));var b=l(m),E=t[b];if(m.length>1&&!E&&!n[m]&&!r[b])throw new TypeError('Unknown modifier: "'+m+'"');1!==c&&E||(i?a.key=b:a.which=u(m)),E&&(a[E]=!y||null)}}catch(w){p=!0,h=w}finally{try{!f&&v.return&&v.return()}finally{if(p)throw h}}return a}function s(e,t){for(var n in e){var r=e[n],o=void 0;if(null!=r&&(null!=(o="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===r&&93===t.which?91:t.which:t[n])||!1!==r)&&o!==r)return!1}return!0}function u(e){return e=l(e),r[e]||e.toUpperCase().charCodeAt(0)}function l(e){return e=e.toLowerCase(),n[e]||e}return xE.default=i,xE.isHotkey=i,xE.isCodeHotkey=function(e,t){return i(e,t)},xE.isKeyHotkey=function(e,t){return i(e,{byKey:!0},t)},xE.parseHotkey=a,xE.compareHotkey=s,xE.toKeyCode=u,xE.toKeyName=l,xE}(),NE={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",splitBlock:"shift?+enter",undo:"mod+z",tab:"tab",selectAll:"mod+a"},BE={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},TE={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},kE=function(e){var t=NE[e],n=BE[e],r=TE[e],o=t&&OE.isKeyHotkey(t),i=n&&OE.isKeyHotkey(n),a=r&&OE.isKeyHotkey(r);return function(e){return!(!o||!o(e))||!!(bm&&i&&i(e))||!(bm||!a||!a(e))}},FE={isBold:kE("bold"),isCompose:kE("compose"),isMoveBackward:kE("moveBackward"),isMoveForward:kE("moveForward"),isDeleteBackward:kE("deleteBackward"),isDeleteForward:kE("deleteForward"),isDeleteLineBackward:kE("deleteLineBackward"),isDeleteLineForward:kE("deleteLineForward"),isDeleteWordBackward:kE("deleteWordBackward"),isDeleteWordForward:kE("deleteWordForward"),isExtendBackward:kE("extendBackward"),isExtendForward:kE("extendForward"),isExtendLineBackward:kE("extendLineBackward"),isExtendLineForward:kE("extendLineForward"),isItalic:kE("italic"),isMoveLineBackward:kE("moveLineBackward"),isMoveLineForward:kE("moveLineForward"),isMoveWordBackward:kE("moveWordBackward"),isMoveWordForward:kE("moveWordForward"),isRedo:kE("redo"),isSplitBlock:kE("splitBlock"),isTransposeCharacter:kE("transposeCharacter"),isUndo:kE("undo"),isTab:kE("tab"),isSelectAll:kE("selectAll")};function PE(e){e.preventDefault()}var IE={beforeinput:function(e,t,n){var r,o=e,i=n.getConfig().readOnly;if(Sm&&!i&&pE(n,o.target)){null===(r=t.flushDOMSelectionChange)||void 0===r||r.call(t);var a=n.selection,s=o.inputType,u=o.dataTransfer||o.data||void 0;if("insertCompositionText"!==s&&"deleteCompositionText"!==s){if(o.preventDefault(),!s.startsWith("delete")||s.startsWith("deleteBy")){var l=Lh(o.getTargetRanges(),1)[0];if(l){var c=Nm.toSlateRange(n,l,{exactMatch:!1,suppressThrow:!1});a&&If.equals(a,c)||Zp.select(n,c)}}if(a&&If.isExpanded(a)){var d=Nm.getSelectedElems(n),f="table"===d[0].type,p="table-cell"!==d[d.length-1].type;if(f&&p)return;if(s.startsWith("delete")){var h=s.endsWith("Backward")?"backward":"forward";return void Dp.deleteFragment(n,{direction:h})}}switch(s){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":Dp.deleteFragment(n);break;case"deleteContent":case"deleteContentForward":Dp.deleteForward(n);break;case"deleteContentBackward":Dp.deleteBackward(n);break;case"deleteEntireSoftLine":Dp.deleteBackward(n,{unit:"line"}),Dp.deleteForward(n,{unit:"line"});break;case"deleteHardLineBackward":Dp.deleteBackward(n,{unit:"block"});break;case"deleteSoftLineBackward":Dp.deleteBackward(n,{unit:"line"});break;case"deleteHardLineForward":Dp.deleteForward(n,{unit:"block"});break;case"deleteSoftLineForward":Dp.deleteForward(n,{unit:"line"});break;case"deleteWordBackward":Dp.deleteBackward(n,{unit:"word"});break;case"deleteWordForward":Dp.deleteForward(n,{unit:"word"});break;case"insertLineBreak":case"insertParagraph":Dp.insertBreak(n);break;case"insertFromDrop":case"insertFromComposition":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":if("insertFromComposition"===s&&(t.isComposing=!1,Pg.set(n,!0)),"insertFromPaste"===s&&!Fg.get(n))break;"[object DataTransfer]"===Fv(u)?n.insertData(u):"string"==typeof u&&Dp.insertText(n,u)}}}},blur:function(e,t,n){var r=e,o=t.isUpdatingSelection,i=t.latestElement;if(!n.getConfig().readOnly&&!o&&pE(n,r.target)){var a=Nm.findDocumentOrShadowRoot(n);if(i!==a.activeElement){var s=r.relatedTarget;if(!(s===Nm.toDOMNode(n,n)||Mv(s)&&s.hasAttribute("data-slate-spacer"))){if(null!=s&&_v(s)&&Nm.hasDOMNode(n,s)){var u=Nm.toSlateNode(n,s);if(_f.isElement(u)&&!n.isVoid(u))return}if(wm){var l=a.getSelection();null==l||l.removeAllRanges()}Bg.delete(n)}}}},focus:function(e,t,n){var r=Nm.toDOMNode(n,n),o=Nm.findDocumentOrShadowRoot(n);t.latestElement=o.activeElement,Em&&e.target!==r?r.focus():Bg.set(n,!0)},click:function(e,t,n){if(!n.getConfig().readOnly&&hE(n,e.target)&&_v(e.target)){var r=Nm.toSlateNode(n,e.target),o=Nm.findPath(n,r);if(Dp.hasPath(n,o)&&zf.get(n,o)===r){var i=Dp.start(n,o),a=Dp.end(n,o),s=Dp.void(n,{at:i}),u=Dp.void(n,{at:a});if(s&&u&&Nf.equals(s[1],u[1])){var l=Dp.range(n,i);Zp.select(n,l)}}}},compositionstart:function(e,t,n){if(pE(n,e.target)){Ig.delete(n);var r=n.selection;if(r&&If.isExpanded(r)&&(Dp.deleteFragment(n),Promise.resolve().then(function(){CE(t,n,!0)})),n.selection){var o=Nm.toDOMRange(n,n.selection).startContainer,i=o.textContent||"";AE.set(n,i),SE.set(n,o)}t.isComposing=!0,a=t,(s=n).getConfig().placeholder&&s.isEmpty()&&a.showPlaceholder&&(null===(u=a.$placeholder)||void 0===u||u.hide(),a.showPlaceholder=!1)}var a,s,u},compositionend:function(e,t,n){var r=e;if(pE(n,r.target)){t.isComposing=!1;var o=!0===Pg.get(n);o?(Pg.delete(n),Ig.delete(n)):Ig.delete(n);var i=n.selection;if(null!=i){(Am||Em)&&Nm.cleanExposedTexNodeInSelectionBlock(n);for(var a=If.isBackward(i)?i.focus:i.anchor,s=Lh(Dp.node(n,[a.path[0]]),1)[0],u=0;u0&&Dp.insertText(n,c.slice(0,d)),t.changeViewState()}else Dp.insertText(n,c)}else{var p=Nm.findDocumentOrShadowRoot(n).getSelection();p&&function(e,t){if(If.isCollapsed(t)){var n=t.anchor,r=t.focus;if([2,3].includes(n.path.length)&&[2,3].includes(r.path.length)&&(0===n.offset||0===r.offset)){var o=Dp.node(e,n.path),i=0===n.offset?n.path:r.path,a=[i[0],i[1]-1];if(0===i[1])return!1;var s=Dp.node(e,a);if(Ip.isText(s[0])&&Ip.isText(o[0]))return!0}}}(n,i)&&(n.selection=Nm.toSlateRange(n,p,{exactMatch:!1,suppressThrow:!1})),Dp.insertText(n,c)}wm||setTimeout(function(){var e=n.selection;if(null!=e){var t=SE.get(n);null!=t&&Nm.toDOMRange(n,e).startContainer!==t&&(t.textContent=AE.get(n)||"")}})}}}},compositionupdate:function(e,t,n){pE(n,e.target)&&(t.isComposing=!0)},keydown:function(e,t,n){var r=e,o=n.selection;if(!n.getConfig().readOnly&&!t.isComposing&&pE(n,r.target)){if(function(e,t){var n=lg.get(e),r=n&&n.getMenus(),o=dg.get(e),i=o&&o.getMenus(),a=Ph(Ph({},r),i);for(var s in a){var u=a[s],l=u.hotkey;if(l&&OE.isHotkey(l,t)&&!u.isDisabled(e)){var c=u.getValue(e);u.exec(e,c)}}}(n,r),FE.isTab(r))return PE(r),void n.handleTab();if(FE.isRedo(r))return PE(r),void("function"==typeof n.redo&&n.redo());if(FE.isUndo(r))return PE(r),void("function"==typeof n.undo&&n.undo());if(FE.isMoveLineBackward(r))return PE(r),void Zp.move(n,{unit:"line",reverse:!0});if(FE.isMoveLineForward(r))return PE(r),void Zp.move(n,{unit:"line"});if(FE.isExtendLineBackward(r))return PE(r),void Zp.move(n,{unit:"line",edge:"focus",reverse:!0});if(FE.isExtendLineForward(r))return PE(r),void Zp.move(n,{unit:"line",edge:"focus"});if(FE.isMoveBackward(r))return PE(r),void(o&&If.isCollapsed(o)?Zp.move(n,{reverse:!0}):Zp.collapse(n,{edge:"start"}));if(FE.isMoveForward(r))return PE(r),void(o&&If.isCollapsed(o)?Zp.move(n):Zp.collapse(n,{edge:"end"}));if(FE.isMoveWordBackward(r))return PE(r),o&&If.isExpanded(o)&&Zp.collapse(n,{edge:"focus"}),void Zp.move(n,{unit:"word",reverse:!0});if(FE.isMoveWordForward(r))return PE(r),o&&If.isExpanded(o)&&Zp.collapse(n,{edge:"focus"}),void Zp.move(n,{unit:"word"});if(FE.isSelectAll(r))return PE(r),void n.selectAll();if(Sm){if((Am||wm)&&o&&(FE.isDeleteBackward(r)||FE.isDeleteForward(r))&&If.isCollapsed(o)){var i=zf.parent(n,o.anchor.path);if(_f.isElement(i)&&Dp.isVoid(n,i)&&Dp.isInline(n,i))return r.preventDefault(),void Zp.delete(n,{unit:"block"})}}else{if(FE.isBold(r)||FE.isItalic(r)||FE.isTransposeCharacter(r))return void PE(r);if(FE.isSplitBlock(r))return PE(r),void Dp.insertBreak(n);if(FE.isDeleteBackward(r))return PE(r),void(o&&If.isExpanded(o)?Dp.deleteFragment(n,{direction:"backward"}):Dp.deleteBackward(n));if(FE.isDeleteForward(r))return PE(r),void(o&&If.isExpanded(o)?Dp.deleteFragment(n,{direction:"forward"}):Dp.deleteForward(n));if(FE.isDeleteLineBackward(r))return PE(r),void(o&&If.isExpanded(o)?Dp.deleteFragment(n,{direction:"backward"}):Dp.deleteBackward(n,{unit:"line"}));if(FE.isDeleteLineForward(r))return PE(r),void(o&&If.isExpanded(o)?Dp.deleteFragment(n,{direction:"forward"}):Dp.deleteForward(n,{unit:"line"}));if(FE.isDeleteWordBackward(r))return PE(r),void(o&&If.isExpanded(o)?Dp.deleteFragment(n,{direction:"backward"}):Dp.deleteBackward(n,{unit:"word"}));if(FE.isDeleteWordForward(r))return PE(r),void(o&&If.isExpanded(o)?Dp.deleteFragment(n,{direction:"forward"}):Dp.deleteForward(n,{unit:"word"}))}}},keypress:function(e,t,n){if(!Sm&&!n.getConfig().readOnly&&pE(n,e.target)){e.preventDefault();var r=e.key;Dp.insertText(n,r)}},copy:function(e,t,n){var r=e;if(pE(n,r.target)){n.getConfig().readOnly||r.preventDefault();var o=r.clipboardData;if(null!=o){n.setFragmentData(o);var i=n.getConfig().customCopy;i&&i(n,r)}}},cut:function(e,t,n){var r=e,o=n.selection;if(!n.getConfig().readOnly&&(r.preventDefault(),pE(n,r.target))){var i=r.clipboardData;if(null!=i&&(n.setFragmentData(i),o))if(If.isExpanded(o))Dp.deleteFragment(n);else{var a=zf.parent(n,o.anchor.path);_f.isElement(a)&&Dp.isVoid(n,a)&&Zp.delete(n)}}},paste:function(e,t,n){Fg.set(n,!0);var r,o=e;if(!n.getConfig().readOnly&&pE(n,o.target)){var i=n.getConfig().customPaste;if(i&&!1===i(n,o))return Fg.set(n,!1),void o.preventDefault();if(wm||!Sm||(r=o).clipboardData&&""!==r.clipboardData.getData("text/plain")&&1===r.clipboardData.types.length){o.preventDefault();var a=o.clipboardData;null!=a&&n.insertData(a)}}},dragover:function(e,t,n){if(hE(n,e.target)){var r=Nm.toSlateNode(n,e.target);_f.isElement(r)&&Dp.isVoid(n,r)&&e.preventDefault()}},dragstart:function(e,t,n){var r=e;if(hE(n,r.target)&&!n.getConfig().readOnly){var o=Nm.toSlateNode(n,r.target),i=Nm.findPath(n,o);if(_f.isElement(o)&&Dp.isVoid(n,o)||Dp.void(n,{at:i,voids:!0})){var a=Dp.range(n,i);Zp.select(n,a)}var s=r.dataTransfer;null!=s&&(Nm.getSelectedNodeByType(n,"table")||(t.isDraggingInternally=!0,n.setFragmentData(s)))}},dragend:function(e,t,n){var r=e;n.getConfig().readOnly||t.isDraggingInternally&&hE(n,r.target)&&(t.isDraggingInternally=!1)},drop:function(e,t,n){var r=e,o=r.dataTransfer;if(!n.getConfig().readOnly&&hE(n,r.target)&&null!=o&&!(Sm&&wm&&o.files.length>0)){r.preventDefault();var i=n.selection,a=Nm.findEventRange(n,r);Zp.select(n,a),t.isDraggingInternally&&(i&&Zp.delete(n,{at:i}),t.isDraggingInternally=!1),n.insertData(o),n.isFocused()||n.focus()}}};function RE(e){if(_E(e)){for(;e&&_E(e);)e=LE(e).parent;return null!=e?e:null}return e.parentNode}function _E(e){return 11===e.nodeType}function LE(e,t){var n,r,o;const i=e;return null!==(n=i.parent)&&void 0!==n||(i.parent=null!=t?t:null),null!==(r=i.firstChildNode)&&void 0!==r||(i.firstChildNode=e.firstChild),null!==(o=i.lastChildNode)&&void 0!==o||(i.lastChildNode=e.lastChild),i}const ME={createElement:function(e,t){return document.createElement(e,t)},createElementNS:function(e,t,n){return document.createElementNS(e,t,n)},createTextNode:function(e){return document.createTextNode(e)},createDocumentFragment:function(){return LE(document.createDocumentFragment())},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){if(_E(e)){let t=e;for(;t&&_E(t);)t=LE(t).parent;e=null!=t?t:e}_E(t)&&(t=LE(t,e)),n&&_E(n)&&(n=LE(n).firstChildNode),e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){_E(t)&&(t=LE(t,e)),e.appendChild(t)},parentNode:RE,nextSibling:function(e){var t;if(_E(e)){const n=LE(e),r=RE(n);if(r&&n.lastChildNode){const e=Array.from(r.childNodes),o=e.indexOf(n.lastChildNode);return null!==(t=e[o+1])&&void 0!==t?t:null}return null}return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},getTextContent:function(e){return e.textContent},isElement:function(e){return 1===e.nodeType},isText:function(e){return 3===e.nodeType},isComment:function(e){return 8===e.nodeType},isDocumentFragment:_E};function jE(e,t,n,r,o){return{sel:e,data:t,children:n,text:r,elm:o,key:void 0===t?void 0:t.key}}const HE=Array.isArray;function zE(e){return"string"==typeof e||"number"==typeof e||e instanceof String||e instanceof Number}const $E=jE("",{},[],void 0,void 0);function UE(e,t){var n,r;const o=e.key===t.key,i=(null===(n=e.data)||void 0===n?void 0:n.is)===(null===(r=t.data)||void 0===r?void 0:r.is),a=e.sel===t.sel,s=!(!e.sel&&e.sel===t.sel)||typeof e.text==typeof t.text;return a&&o&&i&&s}function VE(e,t,n){var r;const o={};for(let i=t;i<=n;++i){const t=null===(r=e[i])||void 0===r?void 0:r.key;void 0!==t&&(o[t]=i)}return o}const WE=["create","update","remove","destroy","pre","post"];function GE(e,t,n){const r={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},o=ME;for(const d of WE)for(const t of e){const e=t[d];void 0!==e&&r[d].push(e)}function i(e,t){return function(){if(0===--t){const t=o.parentNode(e);null!==t&&o.removeChild(t,e)}}}function a(e,t){var n,i,s;let u;const l=e.data,c=null==l?void 0:l.hook;null===(n=null==c?void 0:c.init)||void 0===n||n.call(c,e);const d=e.children,f=e.sel;if("!"===f)null!==(i=e.text)&&void 0!==i||(e.text=""),e.elm=o.createComment(e.text);else if(""===f)e.elm=o.createTextNode(e.text);else if(void 0!==f){const n=f.indexOf("#"),i=f.indexOf(".",n),p=n>0?n:f.length,h=i>0?i:f.length,g=-1!==n||-1!==i?f.slice(0,Math.min(p,h)):f,v=null==l?void 0:l.ns,m=void 0===v?o.createElement(g,l):o.createElementNS(v,g,l);for(e.elm=m,p0&&m.setAttribute("class",f.slice(h+1).replace(/\./g," ")),u=0;u{e[t]=n},uw(()=>{uw(r)})}function dw(e,t){let n,r;const o=t.elm;let i=e.data.style,a=t.data.style;if(!i&&!a)return;if(i===a)return;i=i||{},a=a||{};const s="delayed"in i;for(r in i)r in a||("-"===r[0]&&"-"===r[1]?o.style.removeProperty(r):o.style[r]="");for(r in a)if(n=a[r],"delayed"===r&&a.delayed)for(const e in a.delayed)n=a.delayed[e],s&&n===i.delayed[e]||cw(o.style,e,n);else"remove"!==r&&n!==i[r]&&("-"===r[0]&&"-"===r[1]?o.style.setProperty(r,n):o.style[r]=n)}const fw={pre:function(){lw=!1},create:dw,update:dw,destroy:function(e){let t,n;const r=e.elm,o=e.data.style;if(o&&(t=o.destroy))for(n in t)r.style[n]=t[n]},remove:function(e,t){const n=e.data.style;if(!n||!n.remove)return void t();let r;lw||(e.elm.offsetLeft,lw=!0);const o=e.elm;let i=0;const a=n.remove;let s=0;const u=[];for(r in a)u.push(r),o.style[r]=a[r];const l=getComputedStyle(o)["transition-property"].split(", ");for(;i{e.target===o&&--s,0===s&&t()})}};function pw(e,t){for(const n of e)null!=n&&!1!==n&&""!==n&&(Array.isArray(n)?pw(n,t):"string"==typeof n||"number"==typeof n||"boolean"==typeof n?t.push(jE(void 0,void 0,void 0,String(n),void 0)):t.push(n));return t}function hw(e,t,...n){const r=pw(n,[]);return"function"==typeof e?e(t,r):1===r.length&&!r[0].sel&&r[0].text?KE(e,t,r[0].text):KE(e,t,r)}var gw,vw,mw=[],yw={};function bw(e,t,n){return hw(n.isInline(e)?"span":"div",null,t)}function Ew(e,t){return void 0===t&&(t=!1),hw("span",{"data-slate-string":!0},t?e+"\n":e)}function ww(e,t){return void 0===e&&(e=0),void 0===t&&(t=!1),hw("span",{"data-slate-zero-width":t?"n":"z","data-slate-length":e},"\ufeff",t?hw("br",null):null)}function Cw(e,t,n,r){return wg.set(e,t),Cg.set(e,n),_f.isElement(e)?function(e,t){var n,r=Nm.findKey(t,e),o=t.isInline(e),i=Dp.isVoid(t,e),a=lm(e.type,r.id),s={id:a,key:r.id,"data-slate-node":"element","data-slate-inline":o},u=e.type,l=e.children,c=void 0===l?[]:l,d=yw[u]||bw;n=i?null:c.map(function(n,r){return Cw(n,r,e,t)});var f=d(e,n,t);if(i){s["data-slate-void"]=!0;var p=o?"span":"div",h=Lh(zf.texts(e),1),g=Lh(h[0],1)[0],v=hw(p,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},Cw(g,0,e,t));f=hw(p,{style:{position:"relative"}},f,v),wg.set(g,0),Cg.set(g,e)}return null==f.data&&(f.data={}),Object.assign(f.data,s),i||o||(m=e,y=f,b=t,E=y,mw.forEach(function(e){E=e(m,E,b)}),f=E),Bv(function(){var t=zv(a);null!=t&&(Sg.set(r,t),xg.set(e,t),Ag.set(t,e))}),f;var m,y,b,E}(e,r):function(e,t,n){if(null==e.text)throw new Error("Current node is not slate Text ".concat(JSON.stringify(e)));var r=Nm.findKey(n,e),o=n.getConfig().decorate;if(null==o)throw new Error("Can not get config.decorate");var i,a=Nm.findPath(n,e),s=o([e,a]),u=Ip.decorations(e,s),l=u.map(function(r){var o,i,a,s,l=r.leaf,c=r.position,d=function(e,t,n,r,o){void 0===t&&(t=!1);var i=e.text,a=Nm.findPath(o,n),s=Nf.parent(a);if(Dp.isEditor(r))throw new Error("Text node ".concat(JSON.stringify(n)," parent is Editor"));return o.isVoid(r)?ww(zf.string(r).length):""!==i||r.children[r.children.length-1]!==n||o.isInline(r)||""!==Dp.string(o,s)?""===i?ww():t&&"\n"===i.slice(-1)?Ew(i,!0):Ew(i):ww(0,!0)}(l,null!==(o=null==c?void 0:c.isLast)&&void 0!==o?o:1===u.length,e,t,n);return i=l,a=n,s=d,mw.forEach(function(e){s=e(i,s,a)}),hw("span",{"data-slate-leaf":!0},d=s)}),c=(i=r.id,"w-e-text-".concat(i)),d=hw("span",{"data-slate-node":"text",id:c,key:r.id},l);return Bv(function(){var t=zv(c);null!=t&&(Sg.set(r,t),xg.set(e,t),Ag.set(t,e))}),d}(e,n,r)}var Dw=function(){if(vw)return gw;vw=1;var e,t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,n=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,r="\\ud800-\\udfff",o="\\u0300-\\u036f\\ufe20-\\ufe23",i="\\u20d0-\\u20f0",a="\\u2700-\\u27bf",s="a-z\\xdf-\\xf6\\xf8-\\xff",u="A-Z\\xc0-\\xd6\\xd8-\\xde",l="\\ufe0e\\ufe0f",c="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",d="["+r+"]",f="["+c+"]",p="["+o+i+"]",h="\\d+",g="["+a+"]",v="["+s+"]",m="[^"+r+c+h+a+s+u+"]",y="\\ud83c[\\udffb-\\udfff]",b="[^"+r+"]",E="(?:\\ud83c[\\udde6-\\uddff]){2}",w="[\\ud800-\\udbff][\\udc00-\\udfff]",C="["+u+"]",D="\\u200d",A="(?:"+v+"|"+m+")",S="(?:"+C+"|"+m+")",x="(?:['’](?:d|ll|m|re|s|t|ve))?",N="(?:['’](?:D|LL|M|RE|S|T|VE))?",B="(?:"+p+"|"+y+")?",T="["+l+"]?",k=T+B+"(?:"+D+"(?:"+[b,E,w].join("|")+")"+T+B+")*",F="(?:"+[g,E,w].join("|")+")"+k,P="(?:"+[b+p+"?",p,E,w,d].join("|")+")",I=RegExp("['’]","g"),R=RegExp(p,"g"),_=RegExp(y+"(?="+y+")|"+P+k,"g"),L=RegExp([C+"?"+v+"+"+x+"(?="+[f,C,"$"].join("|")+")",S+"+"+N+"(?="+[f,C+A,"$"].join("|")+")",C+"?"+A+"+"+x,C+"+"+N,h,F].join("|"),"g"),M=RegExp("["+D+r+o+i+l+"]"),j=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,H="object"==typeof O&&O&&O.Object===Object&&O,z="object"==typeof self&&self&&self.Object===Object&&self,$=H||z||Function("return this")(),U=(e={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"},function(t){return null==e?void 0:e[t]});function V(e){return M.test(e)}var W=Object.prototype.toString,G=$.Symbol,q=G?G.prototype:void 0,K=q?q.toString:void 0;function Y(e){return null==e?"":function(e){if("string"==typeof e)return e;if("symbol"==typeof(t=e)||function(e){return!!e&&"object"==typeof e}(t)&&"[object Symbol]"==W.call(t))return K?K.call(e):"";var t,n=e+"";return"0"==n&&1/e==-1/0?"-0":n}(e)}var X,Z=(X=function(e,t,n){return t=t.toLowerCase(),e+(n?J(Y(t).toLowerCase()):t)},function(e){return function(e,t,n){for(var r=-1,o=e?e.length:0;++r=r?e:function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r0&&o.forEach(function(e){"string"!=typeof e&&xw(e)})}function Ow(e,t){var n,r,o,i=e.$scroll,a=(n=e.id,"w-e-textarea-".concat(n)),s=t.getConfig(),u=s.readOnly,l=s.autoFocus,c=(void 0===(o=u)&&(o=!1),KE("div#".concat(a),{props:{contentEditable:!o}})),d=t.children||[];c.children=d.map(function(e,n){if(bg.has(e)){var r=bg.get(e);if(r){var o=Lh(r,2),i=o[0],a=o[1];if(a)return i!==n&&(wg.set(e,n),bg.set(e,[n,a])),a}}var s=Cw(e,n,t,t);xw(s);var u=t.getConfig().skipCacheTypes,l=void 0===u?["list-item"]:u;return _f.isElement(e)&&l.includes(e.type)||bg.set(e,[n,s]),s});var f=vg.get(e);if(null==f&&(f=!0),f){var p=function(e){return qg(''))}(a);i.append(p),e.$textArea=p,r=p[0],(g=GE([JE,sw,fw,tw,iw,XE]))(r,c),vg.set(e,!1),mg.set(e,g)}else{var h=yg.get(e),g=mg.get(e);if(null==h||null==g)return;r=h.elm,g(h,c)}if(null!=r||null!=(r=zv(a))){var v;if((f?l:t.isFocused())&&r.focus({preventScroll:!0}),f){var m=(v=r)&&v.ownerDocument&&v.ownerDocument.defaultView||null;m&&Ng.set(t,m)}Dg.set(t,r),xg.set(t,r),Ag.set(r,t),yg.set(e,c)}}var Nw=1,Bw=function(){function e(e){var t=this;this.selectionChangeRoot=null,this.destroyed=!1,this.id=Nw++,this.$textArea=null,this.$progressBar=qg('
    '),this.$maxLengthInfo=qg('
    '),this.isComposing=!1,this.isUpdatingSelection=!1,this.isDraggingInternally=!1,this.latestElement=null,this.showPlaceholder=!1,this.$placeholder=null,this.latestEditorSelection=null,this.onDOMSelectionChange=fE(function(e){var n=Mv(null==e?void 0:e.target)?e.target:null,r=null==n?void 0:n.tagName;if("INPUT"!==r&&"TEXTAREA"!==r){var o=t.getActiveEditor();null!=o&&function(e,t){var n=e.isComposing,r=e.isUpdatingSelection,o=e.isDraggingInternally,i=t.getConfig();if(!r&&!o){var a=Nm.findDocumentOrShadowRoot(t),s=a.activeElement,u=Nm.toDOMNode(t,t),l=a.getSelection();if(s!==u)return Bg.delete(t),void wE(t);if(e.latestElement=s,Bg.set(t,!0),!l)return wE(t);var c=l.anchorNode,d=l.focusNode,f=function(e,t){return pE(e,t)||function(e,t){if(e.getConfig().readOnly)return!1;var n=hE(e,t)&&Nm.toSlateNode(e,t);return!!n&&_f.isElement(n)&&Dp.isVoid(e,n)}(e,t)}(t,c),p=hE(t,d);if(!n)if(f&&p){var h=Nm.toSlateRange(t,l,{exactMatch:!1,suppressThrow:!0});h&&Zp.select(t,h)}else i.readOnly&&wE(t)}}(t,o)}},100);var n=qg(e);if(0===n.length)throw new Error("Cannot find textarea DOM by selector '".concat(e,"'"));this.$box=n;var r=qg('
    ');r.append(this.$progressBar),r.append(this.$maxLengthInfo),n.append(r);var o=qg('
    ');r.append(o),this.$scroll=o,this.$textAreaContainer=r,Bv(function(){var e=t.getActiveEditor();if(null!=e){t.bindSelectionChange(e),r.on("click",function(){return e.hidePanelOrModal()}),e.on(tg,t.changeViewState.bind(t));var o=e.getConfig(),i=o.onChange,a=o.scroll;i&&e.on(tg,function(){return i(e)}),a||(n.css("position","relative"),r.addClass("no-scroll")),t.onFocusAndOnBlur(),e.on(tg,t.changeMaxLengthInfo.bind(t)),t.bindEvent()}})}return Object.defineProperty(e.prototype,"editorInstance",{get:function(){var e=sg.get(this);if(null==e)throw new Error("Can not get editor instance");return e},enumerable:!1,configurable:!0}),e.prototype.getActiveEditor=function(){if(this.destroyed)return null;var e=sg.get(this);return null==e||e.isDestroyed?null:e},e.prototype.bindSelectionChange=function(e,t){var n=this;if(void 0===t&&(t=5),null==this.selectionChangeRoot&&!e.isDestroyed){try{var r=Nm.findDocumentOrShadowRoot(e);r.addEventListener("selectionchange",this.onDOMSelectionChange),this.selectionChangeRoot=r}catch(o){if(t>0)return void setTimeout(function(){return n.bindSelectionChange(e,t-1)},0);window.document.addEventListener("selectionchange",this.onDOMSelectionChange),this.selectionChangeRoot=window.document}e.on(eg,function(){var e;null===(e=n.selectionChangeRoot)||void 0===e||e.removeEventListener("selectionchange",n.onDOMSelectionChange),n.selectionChangeRoot=null})}},e.prototype.flushDOMSelectionChange=function(){this.onDOMSelectionChange.flush()},e.prototype.bindEvent=function(){var e=this,t=this.$textArea,n=this.$scroll,r=this.editorInstance;null!=t&&(qh(IE,function(n,o){t.on(o,function(t){n(t,e,r)})}),r.getConfig().scroll&&(n.css("overflow-y","auto"),n.on("scroll",fE(function(){r.emit(ng)},100))))},e.prototype.onFocusAndOnBlur=function(){var e=this,t=this.getActiveEditor();if(null!=t){var n=t.getConfig(),r=n.onBlur,o=n.onFocus;this.latestEditorSelection=t.selection,t.on(tg,function(){null==e.latestEditorSelection&&null!=t.selection?setTimeout(function(){e.destroyed||t.isDestroyed||o&&o(t)}):null!=e.latestEditorSelection&&null==t.selection&&setTimeout(function(){e.destroyed||t.isDestroyed||r&&r(t)}),e.latestEditorSelection=t.selection})}},e.prototype.changeMaxLengthInfo=function(){var e=this.getActiveEditor();if(null!=e){var t=e.getConfig().maxLength;if(t){var n=t-Nm.getLeftLengthOfMaxLength(e);this.$maxLengthInfo[0].innerHTML="".concat(n,"/").concat(t)}}},e.prototype.changeProgress=function(e){var t=this.$progressBar;t.css("width","".concat(e,"%")),e>=100&&setTimeout(function(){t.hide(),t.css("width","0"),t.show()},1e3)},e.prototype.changeViewState=function(){var e=this,t=this.getActiveEditor();null!=t&&(Ow(this,t),function(e,t){var n,r=t.getConfig().placeholder;if(r){var o=t.isEmpty();if(o&&!e.showPlaceholder&&!e.isComposing){if(null==e.$placeholder){var i=qg('
    '.concat(r,"
    "));e.$textAreaContainer.append(i),e.$placeholder=i}return e.$placeholder.show(),void(e.showPlaceholder=!0)}!o&&e.showPlaceholder&&(null===(n=e.$placeholder)||void 0===n||n.hide(),e.showPlaceholder=!1)}}(this,t),Bv(function(){e.destroyed||t.isDestroyed||CE(e,t)}))},e.prototype.destroy=function(){var e;this.destroyed=!0,this.onDOMSelectionChange.cancel(),null===(e=this.selectionChangeRoot)||void 0===e||e.removeEventListener("selectionchange",this.onDOMSelectionChange),this.selectionChangeRoot=null,this.$textAreaContainer.remove()},e}();function Tw(e,t,n,r){if(wg.set(e,t),Cg.set(e,n),_f.isElement(e)){var o=e.children;if((void 0===o?[]:o).forEach(function(t,n){return Tw(t,n,e,r)}),Dp.isVoid(r,e)){var i=Lh(zf.texts(e),1),a=Lh(i[0],1)[0];wg.set(a,0),Cg.set(a,e)}}}function kw(e){var t,n=e.selector,r=void 0===n?"":n,o=e.config,i=void 0===o?{}:o,a=e.content,s=e.html,u=e.plugins,l=void 0===u?[]:u,c=(t=Ch(),[_y,Cy,Rg,Ey,Gy,Ry,jy,Nh].reduce(function(e,t){return t(e)},t));if(r&&function(e,t){return sm(e,"data-w-e-textarea",t)}(c,r))throw new Error("Repeated create editor by selector '".concat(r,"'"));var d=function(e){void 0===e&&(e={});var t=Wh(Jh),n={},r=e.MENU_CONF,o=void 0===r?{}:r;return qh(t,function(e,t){n[t]=Ph(Ph({},e),o[t]||{})}),delete e.MENU_CONF,Ph({scroll:!0,readOnly:!1,autoFocus:!0,decorate:function(){return[]},maxLength:0,MENU_CONF:n,hoverbarKeys:{},textStyleMode:"inline",classStylePolicy:"preserve-data",sanitizeHtml:Zh,customAlert:function(e,t){window.alert("".concat(t,":\n").concat(e))}},e)}(i);gg.set(c,d);var f=d.hoverbarKeys,p=void 0===f?{}:f;if(l.forEach(function(e){c=e(c)}),function(e,t){var n=t.html,r=t.content;null!=n?e.children=um(e,n):r&&r.length&&(e.children=r),0===e.children.length&&(e.children=[{type:"paragraph",children:[{text:""}]}])}(c,{html:s,content:a}),r){var h=new Bw(r);ag.set(c,h),sg.set(h,c),h.changeViewState();var g=void 0;Object.keys(p).length>0&&(g=new cE,cg.set(g,c),dg.set(c,g)),c.on(tg,function(){c.hidePanelOrModal()}),c.on(ng,function(){c.hidePanelOrModal()})}else c.children.forEach(function(e,t){return Tw(e,t,c,c)});var v=d.onCreated,m=d.onDestroyed;return v&&c.on(Qh,function(){return v(c)}),m&&c.on(eg,function(){return m(c)}),Bv(function(){return c.emit(Qh)}),c}var Fw=function(){function e(e,t){var n=this;this.$toolbar=qg('
    '),this.menus={},this.toolbarItems=[],this.config={},this.lngListen=function(){},this.syncToolbarState=function(){n.toolbarItems.forEach(function(e){e.changeMenuState()})},this.changeToolbarState=Ky(function(){n.syncToolbarState()},200),this.config=t;var r=qg(e);if(0===r.length)throw new Error("Cannot find toolbar DOM by selector '".concat(e,"'"));this.$box=r;var o=this.$toolbar;o.on("mousedown",function(e){return e.preventDefault()},{passive:!1}),r.append(o),Bv(function(){n.initToolbar(),n.lngListen=Hb(function(){return n.initToolbar()});var e=n.getEditorInstance();e.on(tg,n.changeToolbarState),e.on(rg,n.syncToolbarState),e.on(og,n.syncToolbarState)})}return e.prototype.getMenus=function(){return this.menus},e.prototype.getConfig=function(){return this.config},e.prototype.initToolbar=function(){this.menus={};var e=this.$toolbar;null==e||e.empty(),this.registerItems(),this.changeToolbarState()},e.prototype.registerItems=function(){var e=this,t="",n=this.$toolbar,r=this.config,o=r.toolbarKeys,i=void 0===o?[]:o,a=r.insertKeys,s=void 0===a?{index:0,keys:[]}:a,u=r.excludeKeys,l=void 0===u?[]:u,c=Wh(i),d=[];d=Array.isArray(s)?s:[s];var f=0;d.forEach(function(e){var t=e.index+f;if(e.replaceFn&&c[t]){var n=e.replaceFn(c[t]);if(!n)throw new Error("This function needs to return the menu configuration:string | IMenuGroup");c[t]=n}e.keys.length>0&&("string"==typeof e.keys&&(e.keys=[e.keys]),e.keys.forEach(function(e,n){c.splice(t+n,0,e)}),f+=e.keys.length)});var p=c.filter(function(e){var t="string"==typeof e?e:e.key;return!l.includes(t)}),h=p.length;p.forEach(function(r,o){if("|"===r){if(0===o)return;if(o+1===h)return;if("|"===t)return;var i=Vb();return n.append(i),void(t=r)}if("string"==typeof r)return e.registerSingleItem(r,e),void(t=r);e.registerGroup(r),t="group"})},e.prototype.registerGroup=function(e){var t=this,n=this.$toolbar,r=new rE(e),o=e.menuKeys,i=void 0===o?[]:o,a=this.config.excludeKeys,s=void 0===a?[]:a;i.forEach(function(e){s.includes(e)||t.registerSingleItem(e,r)}),n.append(r.$elem)},e.prototype.registerSingleItem=function(e,t){var n=this.getEditorInstance(),r=t instanceof rE,o=this.menus,i=o[e];if(null==i){var a=ig[e];if(null==a)throw new Error("Not found menu item factory by key '".concat(e,"'"));if("function"!=typeof a)throw new Error("Menu item factory (key='".concat(e,"') is not a function"));i=a(),o[e]=i}var s=n.getMenuConfig(e);s&&void 0!==s.iconSvg&&(i.iconSvg=s.iconSvg);var u=aE(e,i,r);this.toolbarItems.push(u),fg.set(u,n),r?t.appendBarItem(u):t.$toolbar.append(u.$elem)},e.prototype.getEditorInstance=function(){var e=ug.get(this);if(null==e)throw new Error("Can not get editor instance");return e},e.prototype.destroy=function(){var e;this.$toolbar.remove(),null===(e=this.lngListen)||void 0===e||e.call(this),this.menus={},this.toolbarItems=[]},e}();function Pw(e){return e&&"class"===e.getConfig().textStyleMode?"class":"inline"}function Iw(e){if(!e)return"preserve-data";var t=e.getConfig().classStylePolicy;return"fallback-inline"===t?"fallback-inline":"strict"===t?"strict":"preserve-data"}function Rw(e,t){var n=null==e?void 0:e.getConfig().onClassStyleUnsupported;n&&n(t)}var _w,Lw,Mw,jw,Hw,zw={exports:{}},$w={};function Uw(){if(Mw)return $w;Mw=1,Object.defineProperty($w,"__esModule",{value:!0}),$w.justErrorsLogger=$w.debugLogger=void 0;!function(){if(Lw)return _w;function e(e){return e<10?`0${e}`:e.toString()}Lw=1,_w=function(){const t=new Date;return`${e(t.getHours())}:${e(t.getMinutes())}:${e(t.getSeconds())}`}}();const e={debug:()=>{},warn:()=>{},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n{let t="",n=0|e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r="",o=0|n;for(;o--;)r+=e[Math.random()*e.length|0];return r}}),jw}var Ww,Gw,qw,Kw,Yw,Xw,Zw,Jw,Qw,eC,tC,nC,rC,oC,iC,aC,sC,uC,lC,cC,dC,fC,pC,hC,gC,vC,mC,yC,bC,EC,wC,CC={};function DC(){if(Zw)return CC;Zw=1,Object.defineProperty(CC,"__esModule",{value:!0}),CC.defaultOptions=CC.RestrictionError=CC.Restricter=void 0;const e=Gw?Ww:(Gw=1,Ww=function(e){if("number"!=typeof e||isNaN(e))throw new TypeError("Expected a number, got "+typeof e);var t=e<0,n=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";var r=Math.min(Math.floor(Math.log(e)/Math.log(1024)),n.length-1);e=Number(e/Math.pow(1024,r));var o=n[r];return e>=10||e%1==0?(t?"-":"")+e.toFixed(0)+" "+o:(t?"-":"")+e.toFixed(1)+" "+o}),t=function(){if(Xw)return Yw;Xw=1;var e=function(){if(Kw)return qw;function e(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}return Kw=1,e.prototype.match=function(e){var t,n,r=!0,o=this.parts,i=o.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(n=(e||"").split(this.separator),t=0;r&&t=2}return r?o(r.split(";")[0]):o}}();CC.defaultOptions={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class n extends Error{constructor(){super(...arguments),this.isRestriction=!0}}return CC.RestrictionError=n,"undefined"==typeof AggregateError&&(globalThis.AggregateError=class extends Error{constructor(e,t){super(t),this.errors=e}}),CC.Restricter=class{constructor(e,t){this.i18n=t,this.getOpts=()=>{const t=e();if(null!=t.restrictions.allowedFileTypes&&!Array.isArray(t.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return t}}validate(r,o){const{maxFileSize:i,minFileSize:a,maxTotalFileSize:s,maxNumberOfFiles:u,allowedFileTypes:l}=this.getOpts().restrictions;if(u){if(o.filter(e=>!e.isGhost).length+1>u)throw new n(`${this.i18n("youCanOnlyUploadX",{smart_count:u})}`)}if(l&&!l.some(e=>e.includes("/")?!!r.type&&t(r.type.replace(/;.*?$/,""),e):!("."!==e[0]||!r.extension)&&r.extension.toLowerCase()===e.slice(1).toLowerCase())){const e=l.join(", ");throw new n(this.i18n("youCanOnlyUploadFileTypes",{types:e}))}if(s&&null!=r.size){if(o.reduce((e,t)=>e+t.size,r.size)>s)throw new n(this.i18n("exceedsSize",{size:e(s),file:r.name}))}if(i&&null!=r.size&&r.size>i)throw new n(this.i18n("exceedsSize",{size:e(i),file:r.name}));if(a&&null!=r.size&&r.size"string"!=typeof e?r.push(e):t[Symbol.split](e).forEach((e,t,o)=>{""!==e&&r.push(e),t1===e?0:1},Array.isArray(t)?t.forEach(e(this,i)[i],this):e(this,i)[i](t)}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){if(!n(this.locale.strings,e))throw new Error(`missing string: ${e}`);const r=this.locale.strings[e];if("object"==typeof r){if(t&&void 0!==t.smart_count)return o(r[this.locale.pluralize(t.smart_count)],t);throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}return o(r,t)}},eC}function xC(){return rC||(rC=1,nC=function(){var e={},t=e._fns={};return e.emit=function(e,n,r,o,i,a,s){var u=function(e){for(var n=t[e]?t[e]:[],r=e.indexOf(":"),o=-1===r?[e]:[e.substring(0,r),e.substring(r+1)],i=Object.keys(t),a=0,s=i.length;a{this.callbacks.splice(this.callbacks.indexOf(e),1)}}}function r(){for(var e=arguments.length,t=new Array(e),n=0;n{e(...t)})}return n.VERSION="2.1.1",oC=function(){return new n}}(),f=function(){if(dC)return cC;dC=1;const e=OC(),t=lC?uC:(lC=1,uC={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"});return cC=function(n){var r;if(n.type)return n.type;const o=n.name?null==(r=e(n.name).extension)?void 0:r.toLowerCase():null;return o&&o in t?t[o]:"application/octet-stream"}}(),p=OC(),h=function(){if(pC)return fC;function e(e){let t="";return e.replace(/[^A-Z0-9]/gi,e=>{return t+=`-${n=e,n.charCodeAt(0).toString(32)}`,"/";var n})+t}return pC=1,fC=function(t){let n="uppy";return"string"==typeof t.name&&(n+=`-${e(t.name.toLowerCase())}`),void 0!==t.type&&(n+=`-${t.type}`),t.meta&&"string"==typeof t.meta.relativePath&&(n+=`-${e(t.meta.relativePath.toLowerCase())}`),void 0!==t.data.size&&(n+=`-${t.data.size}`),void 0!==t.data.lastModified&&(n+=`-${t.data.lastModified}`),n}}(),g=(gC||(gC=1,hC=function(e){if(null==e&&"undefined"!=typeof navigator&&(e=navigator.userAgent),!e)return!0;const t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;const n=t[1];let[r,o]=n.split(".");return r=parseInt(r,10),o=parseInt(o,10),r<15||15===r&&o<15063||r>18||18===r&&o>=18218}),hC),v=mC?vC:(mC=1,vC=function(e,t){return t.name?t.name:"image"===e.split("/")[0]?`${e.split("/")[0]}.${e.split("/")[1]}`:"noname"}),m=bC?yC:(bC=1,yC={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",emptyFolderAdded:"No files were added from empty folder",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"}}});var y=s("plugins"),b=s("restricter"),E=s("storeUnsubscribe"),w=s("emitter"),C=s("preProcessors"),D=s("uploaders"),A=s("postProcessors"),S=s("informAndEmit"),x=s("checkRequiredMetaFieldsOnFile"),O=s("checkRequiredMetaFields"),N=s("assertNewUploadAllowed"),B=s("checkAndCreateFileStateObject"),T=s("startIfAutoProceed"),k=s("addListeners"),F=s("updateOnlineStatus"),P=s("createUpload"),I=s("getUpload"),R=s("removeUpload"),_=s("runUpload");r=Symbol.for("uppy test: getPlugins"),o=Symbol.for("uppy test: createUpload");class L{constructor(e){Object.defineProperty(this,_,{value:K}),Object.defineProperty(this,R,{value:q}),Object.defineProperty(this,I,{value:G}),Object.defineProperty(this,P,{value:W}),Object.defineProperty(this,k,{value:V}),Object.defineProperty(this,T,{value:U}),Object.defineProperty(this,B,{value:$}),Object.defineProperty(this,N,{value:z}),Object.defineProperty(this,O,{value:H}),Object.defineProperty(this,x,{value:j}),Object.defineProperty(this,S,{value:M}),Object.defineProperty(this,y,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,b,{writable:!0,value:void 0}),Object.defineProperty(this,E,{writable:!0,value:void 0}),Object.defineProperty(this,w,{writable:!0,value:l()}),Object.defineProperty(this,C,{writable:!0,value:new Set}),Object.defineProperty(this,D,{writable:!0,value:new Set}),Object.defineProperty(this,A,{writable:!0,value:new Set}),Object.defineProperty(this,F,{writable:!0,value:this.updateOnlineStatus.bind(this)}),this.defaultLocale=m;const r={id:"uppy",autoProceed:!1,allowMultipleUploads:!0,allowMultipleUploadBatches:!0,debug:!1,restrictions:n.defaultOptions,meta:{},onBeforeFileAdded:e=>e,onBeforeUpload:e=>e,store:d(),logger:t.justErrorsLogger,infoTimeout:5e3};this.opts={...r,...e,restrictions:{...r.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=t.debugLogger),this.log(`Using Core v${this.constructor.VERSION}`),this.i18nInit(),this.calculateProgress=c(this.calculateProgress.bind(this),500,{leading:!0,trailing:!0}),this.store=this.opts.store,this.setState({plugins:{},files:{},currentUploads:{},allowNewUpload:!0,capabilities:{uploadProgress:g(),individualCancellation:!0,resumableUploads:!1},totalProgress:0,meta:{...this.opts.meta},info:[],recoveredState:null}),i(this,b)[b]=new n.Restricter(()=>this.opts,this.i18n),i(this,E)[E]=this.store.subscribe((e,t,n)=>{this.emit("state-update",e,t,n),this.updateAll(t)}),this.opts.debug&&"undefined"!=typeof window&&(window[this.opts.id]=this),i(this,k)[k]()}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}get state(){return this.getState()}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.setState({files:{...this.getState().files,[e]:{...this.getState().files[e],...t}}})}i18nInit(){const e=new u([this.defaultLocale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e&&e.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(e=>{e.setOptions()}),this.setState()}resetProgress(){const e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},n={};Object.keys(t).forEach(r=>{const o={...t[r]};o.progress={...o.progress,...e},n[r]=o}),this.setState({files:n,totalProgress:0}),this.emit("reset-progress")}addPreProcessor(e){i(this,C)[C].add(e)}removePreProcessor(e){return i(this,C)[C].delete(e)}addPostProcessor(e){i(this,A)[A].add(e)}removePostProcessor(e){return i(this,A)[A].delete(e)}addUploader(e){i(this,D)[D].add(e)}removeUploader(e){return i(this,D)[D].delete(e)}setMeta(e){const t={...this.getState().meta,...e},n={...this.getState().files};Object.keys(n).forEach(t=>{n[t]={...n[t],meta:{...n[t].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:n})}setFileMeta(e,t){const n={...this.getState().files};if(!n[e])return void this.log("Was trying to set metadata for a file that has been removed: ",e);const r={...n[e].meta,...t};n[e]={...n[e],meta:r},this.setState({files:n})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:n}=this.getState(),r=Object.values(e),o=r.filter(e=>{let{progress:t}=e;return!t.uploadComplete&&t.uploadStarted}),i=r.filter(e=>!e.progress.uploadStarted),a=r.filter(e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess),s=r.filter(e=>e.progress.uploadStarted),u=r.filter(e=>e.isPaused),l=r.filter(e=>e.progress.uploadComplete),c=r.filter(e=>e.error),d=o.filter(e=>!e.isPaused),f=r.filter(e=>e.progress.preprocess||e.progress.postprocess);return{newFiles:i,startedFiles:a,uploadStartedFiles:s,pausedFiles:u,completeFiles:l,erroredFiles:c,inProgressFiles:o,inProgressNotPausedFiles:d,processingFiles:f,isUploadStarted:s.length>0,isAllComplete:100===t&&l.length===r.length&&0===f.length,isAllErrored:!!n&&c.length===r.length,isAllPaused:0!==o.length&&u.length===o.length,isUploadInProgress:o.length>0,isSomeGhost:r.some(e=>e.isGhost)}}validateRestrictions(e,t){void 0===t&&(t=this.getFiles());try{return i(this,b)[b].validate(e,t),{result:!0}}catch(n){return{result:!1,reason:n.message}}}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!(!t[e]||t[e].isGhost)}addFile(e){i(this,N)[N](e);const{files:t}=this.getState();let n=i(this,B)[B](t,e);return t[n.id]&&t[n.id].isGhost&&(n={...t[n.id],data:e.data,isGhost:!1},this.log(`Replaced the blob in the restored ghost file: ${n.name}, ${n.id}`)),this.setState({files:{...t,[n.id]:n}}),this.emit("file-added",n),this.emit("files-added",[n]),this.log(`Added file: ${n.name}, ${n.id}, mime type: ${n.type}`),i(this,T)[T](),n.id}addFiles(e){i(this,N)[N]();const t={...this.getState().files},n=[],r=[];for(let a=0;a{this.emit("file-added",e)}),this.emit("files-added",n),n.length>5?this.log(`Added batch of ${n.length} files`):Object.keys(n).forEach(e=>{this.log(`Added file: ${n[e].name}\n id: ${n[e].id}\n type: ${n[e].type}`)}),n.length>0&&i(this,T)[T](),r.length>0){let e="Multiple errors occurred while adding files:\n";if(r.forEach(t=>{e+=`\n * ${t.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:r.length}),details:e},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw new AggregateError(r,e);{const t=new Error(e);throw t.errors=r,t}}}removeFiles(e,t){const{files:n,currentUploads:r}=this.getState(),o={...n},i={...r},a=Object.create(null);function s(e){return void 0===a[e]}e.forEach(e=>{n[e]&&(a[e]=n[e],delete o[e])}),Object.keys(i).forEach(e=>{const t=r[e].fileIDs.filter(s);if(0===t.length)return void delete i[e];const{capabilities:n}=this.getState();if(t.length!==r[e].fileIDs.length&&!n.individualCancellation)throw new Error("individualCancellation is disabled");i[e]={...r[e],fileIDs:t}});const u={currentUploads:i,files:o};0===Object.keys(o).length&&(u.allowNewUpload=!0,u.error=null,u.recoveredState=null),this.setState(u),this.calculateTotalProgress();const l=Object.keys(a);l.forEach(e=>{this.emit("file-removed",a[e],t)}),l.length>5?this.log(`Removed ${l.length} files`):this.log(`Removed files: ${l.join(", ")}`)}removeFile(e,t){void 0===t&&(t=null),this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).uploadComplete)return;const t=!this.getFile(e).isPaused;return this.setFileState(e,{isPaused:t}),this.emit("upload-pause",e,t),t}pauseAll(){const e={...this.getState().files};Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{const n={...e[t],isPaused:!0};e[t]=n}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n}),this.setState({files:e}),this.emit("resume-all")}retryAll(){const e={...this.getState().files},t=Object.keys(e).filter(t=>e[t].error);if(t.forEach(t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n}),this.setState({files:e,error:null}),this.emit("retry-all",t),0===t.length)return Promise.resolve({successful:[],failed:[]});const n=i(this,P)[P](t,{forceAllowNewUpload:!0});return i(this,_)[_](n)}cancelAll(e){let{reason:t="user"}=void 0===e?{}:e;if(this.emit("cancel-all",{reason:t}),"user"===t){const{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t,"cancel-all"),this.setState({totalProgress:0,error:null,recoveredState:null})}}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);const t=i(this,P)[P]([e],{forceAllowNewUpload:!0});return i(this,_)[_](t)}reset(){this.cancelAll(...arguments)}logout(){this.iteratePlugins(e=>{e.provider&&e.provider.logout&&e.provider.logout()})}calculateProgress(e,t){if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const n=Number.isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:n?Math.round(t.bytesUploaded/t.bytesTotal*100):0}}),this.calculateTotalProgress()}calculateTotalProgress(){const e=this.getFiles().filter(e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess);if(0===e.length)return this.emit("progress",0),void this.setState({totalProgress:0});const t=e.filter(e=>null!=e.progress.bytesTotal),n=e.filter(e=>null==e.progress.bytesTotal);if(0===t.length){const t=100*e.length,r=n.reduce((e,t)=>e+t.progress.percentage,0),o=Math.round(r/t*100);return void this.setState({totalProgress:o})}let r=t.reduce((e,t)=>e+t.progress.bytesTotal,0);const o=r/t.length;r+=o*n.length;let i=0;t.forEach(e=>{i+=e.progress.bytesUploaded}),n.forEach(e=>{i+=o*(e.progress.percentage||0)/100});let a=0===r?0:Math.round(i/r*100);a>100&&(a=100),this.setState({totalProgress:a}),this.emit("progress",a)}updateOnlineStatus(){void 0===window.navigator.onLine||window.navigator.onLine?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e,t){if("function"!=typeof e)throw new TypeError(`Expected a plugin class, but got ${null===e?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`);const n=new e(this,t),r=n.id;if(!r)throw new Error("Your plugin must have an id");if(!n.type)throw new Error("Your plugin must have a type");const o=this.getPlugin(r);if(o){const e=`Already found a plugin named '${o.id}'. Tried to use: '${r}'.\nUppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;throw new Error(e)}return e.VERSION&&this.log(`Using ${r} v${e.VERSION}`),n.type in i(this,y)[y]?i(this,y)[y][n.type].push(n):i(this,y)[y][n.type]=[n],n.install(),this}getPlugin(e){for(const t of Object.values(i(this,y)[y])){const n=t.find(t=>t.id===e);if(null!=n)return n}}[r](e){return i(this,y)[y][e]}iteratePlugins(e){Object.values(i(this,y)[y]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=i(this,y)[y][e.type],n=t.findIndex(t=>t.id===e.id);-1!==n&&t.splice(n,1);const r={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(r)}close(e){let{reason:t}=void 0===e?{}:e;this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll({reason:t}),i(this,E)[E](),this.iteratePlugins(e=>{this.removePlugin(e)}),"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener("online",i(this,F)[F]),window.removeEventListener("offline",i(this,F)[F]))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,n){void 0===t&&(t="info"),void 0===n&&(n=3e3);const r="object"==typeof e;this.setState({info:[...this.getState().info,{type:t,message:r?e.message:e,details:r?e.details:null}]}),setTimeout(()=>this.hideInfo(),n),this.emit("info-visible")}log(e,t){const{logger:n}=this.opts;switch(t){case"error":n.error(e);break;case"warning":n.warn(e);break;default:n.debug(e)}}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?i(this,_)[_](e):(i(this,R)[R](e),Promise.reject(new Error("Nonexistent upload")))}[o](){return i(this,P)[P](...arguments)}addResultData(e,t){if(!i(this,I)[I](e))return void this.log(`Not setting result for an upload that has been removed: ${e}`);const{currentUploads:n}=this.getState(),r={...n[e],result:{...n[e].result,...t}};this.setState({currentUploads:{...n,[e]:r}})}upload(){var e;null!=(e=i(this,y)[y].uploader)&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();const r=this.opts.onBeforeUpload(t);return!1===r?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(r&&"object"==typeof r&&(t=r,this.setState({files:t})),Promise.resolve().then(()=>i(this,b)[b].validateMinNumberOfFiles(t)).catch(e=>{throw i(this,S)[S](e),e}).then(()=>{if(!i(this,O)[O](t))throw new n.RestrictionError(this.i18n("missingRequiredMetaField"))}).catch(e=>{throw e}).then(()=>{const{currentUploads:e}=this.getState(),n=Object.values(e).flatMap(e=>e.fileIDs),r=[];Object.keys(t).forEach(e=>{const t=this.getFile(e);t.progress.uploadStarted||-1!==n.indexOf(e)||r.push(t.id)});const o=i(this,P)[P](r);return i(this,_)[_](o)}).catch(e=>{throw this.emit("error",e),this.log(e,"error"),e}))}}function M(e,t){const{message:n,details:r=""}=e;e.isRestriction?this.emit("restriction-failed",t,e):this.emit("error",e),this.info({message:n,details:r},"error",this.opts.infoTimeout),this.log(`${n} ${r}`.trim(),"error")}function j(e){const{missingFields:t,error:n}=i(this,b)[b].getMissingRequiredMetaFields(e);return!(t.length>0&&(this.setFileState(e.id,{missingRequiredMetaFields:t}),this.log(n.message),this.emit("restriction-failed",e,n),1))}function H(e){let t=!0;for(const n of Object.values(e))i(this,x)[x](n)||(t=!1);return t}function z(e){const{allowNewUpload:t}=this.getState();if(!1===t){const t=new n.RestrictionError(this.i18n("noMoreFilesAllowed"));throw i(this,S)[S](t,e),t}}function $(e,t){const r=f(t),o=v(r,t),a=p(o).extension,s=Boolean(t.isRemote),u=h({...t,type:r});if(this.checkIfFileAlreadyExists(u)){const e=new n.RestrictionError(this.i18n("noDuplicates",{fileName:o}));throw i(this,S)[S](e,t),e}const l=t.meta||{};l.name=o,l.type=r;const c=Number.isFinite(t.data.size)?t.data.size:null;let d={source:t.source||"",id:u,name:o,extension:a||"",meta:{...this.getState().meta,...l},type:r,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:c,uploadComplete:!1,uploadStarted:null},size:c,isRemote:s,remote:t.remote||"",preview:t.preview};const g=this.opts.onBeforeFileAdded(d,e);if(!1===g){const e=new n.RestrictionError("Cannot add the file because onBeforeFileAdded returned false.");throw this.emit("restriction-failed",t,e),e}"object"==typeof g&&null!==g&&(d=g);try{const t=Object.keys(e).map(t=>e[t]);i(this,b)[b].validate(d,t)}catch(m){throw i(this,S)[S](m,d),m}return d}function U(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))}function V(){const e=(e,t,n)=>{let r=e.message||"Unknown error";e.details&&(r+=` ${e.details}`),this.setState({error:r}),null!=t&&t.id in this.getState().files&&this.setFileState(t.id,{error:r,response:n})};this.on("error",e),this.on("upload-error",(t,n,r)=>{if(e(n,t,r),"object"==typeof n&&n.message){const e=new Error(n.message);e.details=n.message,n.details&&(e.details+=` ${n.details}`),e.message=this.i18n("failedToUpload",{file:null==t?void 0:t.name}),i(this,S)[S](e)}else i(this,S)[S](n)}),this.on("upload",()=>{this.setState({error:null})}),this.on("upload-started",e=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:e.size}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)}),this.on("upload-progress",this.calculateProgress),this.on("upload-success",(e,t)=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const n=this.getFile(e.id).progress;this.setFileState(e.id,{progress:{...n,postprocess:i(this,A)[A].size>0?{mode:"indeterminate"}:null,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal},response:t,uploadURL:t.uploadURL,isPaused:!1}),null==e.size&&this.setFileState(e.id,{size:t.bytesUploaded||n.bytesTotal}),this.calculateTotalProgress()}),this.on("preprocess-progress",(e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,preprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)}),this.on("preprocess-complete",e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.preprocess,this.setState({files:t})}),this.on("postprocess-progress",(e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getState().files[e.id].progress,postprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)}),this.on("postprocess-complete",e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.postprocess,this.setState({files:t})}),this.on("restored",()=>{this.calculateTotalProgress()}),this.on("dashboard:file-edit-complete",e=>{e&&i(this,x)[x](e)}),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",i(this,F)[F]),window.addEventListener("offline",i(this,F)[F]),setTimeout(i(this,F)[F],3e3))}function W(t,n){void 0===n&&(n={});const{forceAllowNewUpload:r=!1}=n,{allowNewUpload:o,currentUploads:i}=this.getState();if(!o&&!r)throw new Error("Cannot create a new upload: already uploading.");const a=(0,e.nanoid)();return this.emit("upload",{id:a,fileIDs:t}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...i,[a]:{fileIDs:t,step:0,result:{}}}}),a}function G(e){const{currentUploads:t}=this.getState();return t[e]}function q(e){const t={...this.getState().currentUploads};delete t[e],this.setState({currentUploads:t})}async function K(e){let{currentUploads:t}=this.getState(),n=t[e];const r=n.step||0,o=[...i(this,C)[C],...i(this,D)[D],...i(this,A)[A]];try{for(let i=r;i{const t=this.getFile(e);t&&t.progress.postprocess&&this.emit("postprocess-complete",t)});const r=n.fileIDs.map(e=>this.getFile(e)),o=r.filter(e=>!e.error),i=r.filter(e=>e.error);await this.addResultData(e,{successful:o,failed:i,uploadID:e}),t=this.getState().currentUploads,n=t[e]}let a;return n&&(a=n.result,this.emit("complete",a),i(this,R)[R](e)),null==a&&this.log(`Not setting result for an upload that has been removed: ${e}`),a}return L.VERSION="2.3.4",EC=L}var BC,TC,kC,FC,PC,IC,RC,_C,LC,MC,jC,HC,zC,$C={},UC=[],VC=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,WC=Array.isArray;function GC(e,t){for(var n in t)e[n]=t[n];return e}function qC(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function KC(e,t,n){var r,o,i,a={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?BC.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===a[i]&&(a[i]=e.defaultProps[i]);return YC(e,a,r,o,null)}function YC(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++kC:o,__i:-1,__u:0};return null==o&&null!=TC.vnode&&TC.vnode(i),i}function XC(e){return e.children}function ZC(e,t){this.props=e,this.context=t}function JC(e,t){if(null==t)return e.__?JC(e.__,e.__i+1):null;for(var n;ts&&PC.sort(_C),e=PC.shift(),s=PC.length,e.__d&&(n=void 0,r=void 0,o=(r=(t=e).__v).__e,i=[],a=[],t.__P&&((n=GC({},r)).__v=r.__v+1,TC.vnode&&TC.vnode(n),uD(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[o]:null,i,null==o?JC(r):o,!!(32&r.__u),a),n.__v=r.__v,n.__.__k[n.__i]=n,cD(i,n,a),r.__e=r.__=null,n.__e!=o&&QC(n)));tD.__r=0}function nD(e,t,n,r,o,i,a,s,u,l,c){var d,f,p,h,g,v,m,y=r&&r.__k||UC,b=t.length;for(u=function(e,t,n,r,o){var i,a,s,u,l,c=n.length,d=c,f=0;for(e.__k=new Array(o),i=0;i0?YC(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,s=null,-1!=(l=a.__i=oD(a,n,u,d))&&(d--,(s=n[l])&&(s.__u|=2)),null==s||null==s.__v?(-1==l&&(o>c?f--:ou?f--:f++,a.__u|=4))):e.__k[i]=null;if(d)for(i=0;i(c?1:0))for(o=n-1,i=n+1;o>=0||i=0?o--:i++])&&!(2&l.__u)&&s==l.key&&u==l.type)return a;return-1}function iD(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||VC.test(t)?n:n+"px"}function aD(e,t,n,r,o){var i,a;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||iD(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||iD(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(LC,"$1")),a=t.toLowerCase(),t=a in e||"onFocusOut"==t||"onFocusIn"==t?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=MC,e.addEventListener(t,i?HC:jC,i)):e.removeEventListener(t,i?HC:jC,i);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(s){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function sD(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=MC++;else if(t.t0?e:WC(e)?e.map(dD):GC({},e)}function fD(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(o){TC.__e(o,n)}}function pD(e,t,n){var r,o;if(TC.unmount&&TC.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||fD(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){TC.__e(i,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o2&&(s.children=arguments.length>3?BC.call(arguments,2):n),YC(e.type,s,r||e.key,o||e.ref,null)},createContext:function(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,eD(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+zC++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t},createElement:KC,createRef:function(){return{current:null}},h:KC,hydrate:function e(t,n){gD(t,n,e)},get isValidElement(){return FC},get options(){return TC},render:gD,toChildArray:function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(WC(t)?t.some(function(t){e(t,n)}):n.push(t)),n}}),ND=function(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var n=function e(){var n=!1;try{n=this instanceof e}catch{}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}(OD);function BD(){if(DD)return CD;DD=1;const e=SC();return CD=class{constructor(e,t){void 0===t&&(t={}),this.uppy=e,this.opts=t}getPluginState(){const{plugins:e}=this.uppy.getState();return e[this.id]||{}}setPluginState(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(),this.i18nInit()}i18nInit(){const t=new e([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.setPluginState()}addTarget(){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}render(){throw new Error("Extend the render method to add your plugin to a DOM element")}update(){}afterUpdate(){}}}function TD(){if(SD)return AD;SD=1;var e=ND;function t(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var n=0;const r=function(){if(bD)return yD;bD=1;const e=mD?vD:(mD=1,vD=function(e){return(null==e?void 0:e.nodeType)===Node.ELEMENT_NODE});return yD=function(t,n){return void 0===n&&(n=document),"string"==typeof t?n.querySelector(t):e(t)?t:null}}(),o=wD?ED:(wD=1,ED=function(e){for(var t;e&&!e.dir;)e=e.parentNode;return null==(t=e)?void 0:t.dir}),i=BD();var a="__private_"+n+++"_"+"updateUI";class s extends i{constructor(){super(...arguments),Object.defineProperty(this,a,{writable:!0,value:void 0})}mount(n,i){const u=i.id,l=r(n);if(l){this.isTargetDOMEl=!0;const r=document.createElement("div");return r.classList.add("uppy-Root"),t(this,a)[a]=function(e){let t=null,n=null;return function(){for(var r=arguments.length,o=new Array(r),i=0;i(t=null,e(...n)))),t}}(t=>{this.uppy.getPlugin(this.id)&&((0,e.render)(this.render(t),r),this.afterUpdate())}),this.uppy.log(`Installing ${u} to a DOM element '${n}'`),this.opts.replaceTargetContent&&(l.innerHTML=""),(0,e.render)(this.render(this.uppy.getState()),r),this.el=r,l.appendChild(r),r.dir=this.opts.direction||o(r)||"ltr",this.onMount(),this.el}let c;if("object"==typeof n&&n instanceof s)c=n;else if("function"==typeof n){const e=n;this.uppy.iteratePlugins(t=>{t instanceof e&&(c=t)})}if(c)return this.uppy.log(`Installing ${u} to ${c.id}`),this.parent=c,this.el=c.addTarget(i),this.onMount(),this.el;this.uppy.log(`Not installing ${u}`);let d=`Invalid target option given to ${u}.`;throw d+="function"==typeof n?" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":"If you meant to target an HTML element, please make sure that the element exists. Check that the