Files

1 line
228 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("quill")):"function"==typeof define&&define.amd?define(["quill"],t):"object"==typeof exports?exports.QuillTableBetter=t(require("quill")):e.QuillTableBetter=t(e.Quill)}(self,(function(e){return function(){var t={386:function(e){var t=-1,r=1,n=0;function i(e,g,b,m,v){if(e===g)return e?[[n,e]]:[];if(null!=b){var w=function(e,t,r){var n="number"==typeof r?{index:r,length:0}:r.oldRange,i="number"==typeof r?null:r.newRange,l=e.length,o=t.length;if(0===n.length&&(null===i||0===i.length)){var s=n.index,a=e.slice(0,s),c=e.slice(s),d=i?i.index:null,u=s+o-l;if((null===d||d===u)&&!(u<0||u>o)){var h=t.slice(0,u);if((g=t.slice(u))===c){var p=Math.min(s,u);if((m=a.slice(0,p))===(w=h.slice(0,p)))return y(m,a.slice(p),h.slice(p),c)}}if(null===d||d===s){var f=s,g=(h=t.slice(0,f),t.slice(f));if(h===a){var b=Math.min(l-f,o-f);if((v=c.slice(c.length-b))===(C=g.slice(g.length-b)))return y(a,c.slice(0,c.length-b),g.slice(0,g.length-b),v)}}}if(n.length>0&&i&&0===i.length){var m=e.slice(0,n.index),v=e.slice(n.index+n.length);if(!(o<(p=m.length)+(b=v.length))){var w=t.slice(0,p),C=t.slice(o-b);if(m===w&&v===C)return y(m,e.slice(p,l-b),t.slice(p,o-b),v)}}return null}(e,g,b);if(w)return w}var C=o(e,g),x=e.substring(0,C);C=a(e=e.substring(C),g=g.substring(C));var k=e.substring(e.length-C),T=function(e,s){var c;if(!e)return[[r,s]];if(!s)return[[t,e]];var d=e.length>s.length?e:s,u=e.length>s.length?s:e,h=d.indexOf(u);if(-1!==h)return c=[[r,d.substring(0,h)],[n,u],[r,d.substring(h+u.length)]],e.length>s.length&&(c[0][0]=c[2][0]=t),c;if(1===u.length)return[[t,e],[r,s]];var p=function(e,t){var r=e.length>t.length?e:t,n=e.length>t.length?t:e;if(r.length<4||2*n.length<r.length)return null;function i(e,t,r){for(var n,i,l,s,c=e.substring(r,r+Math.floor(e.length/4)),d=-1,u="";-1!==(d=t.indexOf(c,d+1));){var h=o(e.substring(r),t.substring(d)),p=a(e.substring(0,r),t.substring(0,d));u.length<p+h&&(u=t.substring(d-p,d)+t.substring(d,d+h),n=e.substring(0,r-p),i=e.substring(r+h),l=t.substring(0,d-p),s=t.substring(d+h))}return 2*u.length>=e.length?[n,i,l,s,u]:null}var l,s,c,d,u,h=i(r,n,Math.ceil(r.length/4)),p=i(r,n,Math.ceil(r.length/2));return h||p?(l=p?h&&h[4].length>p[4].length?h:p:h,e.length>t.length?(s=l[0],c=l[1],d=l[2],u=l[3]):(d=l[0],u=l[1],s=l[2],c=l[3]),[s,c,d,u,l[4]]):null}(e,s);if(p){var f=p[0],g=p[1],b=p[2],m=p[3],v=p[4],y=i(f,b),w=i(g,m);return y.concat([[n,v]],w)}return function(e,n){for(var i=e.length,o=n.length,s=Math.ceil((i+o)/2),a=s,c=2*s,d=new Array(c),u=new Array(c),h=0;h<c;h++)d[h]=-1,u[h]=-1;d[a+1]=0,u[a+1]=0;for(var p=i-o,f=p%2!=0,g=0,b=0,m=0,v=0,y=0;y<s;y++){for(var w=-y+g;w<=y-b;w+=2){for(var C=a+w,x=(A=w===-y||w!==y&&d[C-1]<d[C+1]?d[C+1]:d[C-1]+1)-w;A<i&&x<o&&e.charAt(A)===n.charAt(x);)A++,x++;if(d[C]=A,A>i)b+=2;else if(x>o)g+=2;else if(f&&(_=a+p-w)>=0&&_<c&&-1!==u[_]&&A>=(T=i-u[_]))return l(e,n,A,x)}for(var k=-y+m;k<=y-v;k+=2){for(var T,_=a+k,N=(T=k===-y||k!==y&&u[_-1]<u[_+1]?u[_+1]:u[_-1]+1)-k;T<i&&N<o&&e.charAt(i-T-1)===n.charAt(o-N-1);)T++,N++;if(u[_]=T,T>i)v+=2;else if(N>o)m+=2;else if(!f){var A;if((C=a+p-k)>=0&&C<c&&-1!==d[C])if(x=a+(A=d[C])-C,A>=(T=i-T))return l(e,n,A,x)}}}return[[t,e],[r,n]]}(e,s)}(e=e.substring(0,e.length-C),g=g.substring(0,g.length-C));return x&&T.unshift([n,x]),k&&T.push([n,k]),f(T,v),m&&function(e){for(var i=!1,l=[],o=0,g=null,b=0,m=0,v=0,y=0,w=0;b<e.length;)e[b][0]==n?(l[o++]=b,m=y,v=w,y=0,w=0,g=e[b][1]):(e[b][0]==r?y+=e[b][1].length:w+=e[b][1].length,g&&g.length<=Math.max(m,v)&&g.length<=Math.max(y,w)&&(e.splice(l[o-1],0,[t,g]),e[l[o-1]+1][0]=r,o--,b=--o>0?l[o-1]:-1,m=0,v=0,y=0,w=0,g=null,i=!0)),b++;for(i&&f(e),function(e){function t(e,t){if(!e||!t)return 6;var r=e.charAt(e.length-1),n=t.charAt(0),i=r.match(c),l=n.match(c),o=i&&r.match(d),s=l&&n.match(d),a=o&&r.match(u),f=s&&n.match(u),g=a&&e.match(h),b=f&&t.match(p);return g||b?5:a||f?4:i&&!o&&s?3:o||s?2:i||l?1:0}for(var r=1;r<e.length-1;){if(e[r-1][0]==n&&e[r+1][0]==n){var i=e[r-1][1],l=e[r][1],o=e[r+1][1],s=a(i,l);if(s){var f=l.substring(l.length-s);i=i.substring(0,i.length-s),l=f+l.substring(0,l.length-s),o=f+o}for(var g=i,b=l,m=o,v=t(i,l)+t(l,o);l.charAt(0)===o.charAt(0);){i+=l.charAt(0),l=l.substring(1)+o.charAt(0),o=o.substring(1);var y=t(i,l)+t(l,o);y>=v&&(v=y,g=i,b=l,m=o)}e[r-1][1]!=g&&(g?e[r-1][1]=g:(e.splice(r-1,1),r--),e[r][1]=b,m?e[r+1][1]=m:(e.splice(r+1,1),r--))}r++}}(e),b=1;b<e.length;){if(e[b-1][0]==t&&e[b][0]==r){var C=e[b-1][1],x=e[b][1],k=s(C,x),T=s(x,C);k>=T?(k>=C.length/2||k>=x.length/2)&&(e.splice(b,0,[n,x.substring(0,k)]),e[b-1][1]=C.substring(0,C.length-k),e[b+1][1]=x.substring(k),b++):(T>=C.length/2||T>=x.length/2)&&(e.splice(b,0,[n,C.substring(0,T)]),e[b-1][0]=r,e[b-1][1]=x.substring(0,x.length-T),e[b+1][0]=t,e[b+1][1]=C.substring(T),b++),b++}b++}}(T),T}function l(e,t,r,n){var l=e.substring(0,r),o=t.substring(0,n),s=e.substring(r),a=t.substring(n),c=i(l,o),d=i(s,a);return c.concat(d)}function o(e,t){if(!e||!t||e.charAt(0)!==t.charAt(0))return 0;for(var r=0,n=Math.min(e.length,t.length),i=n,l=0;r<i;)e.substring(l,i)==t.substring(l,i)?l=r=i:n=i,i=Math.floor((n-r)/2+r);return g(e.charCodeAt(i-1))&&i--,i}function s(e,t){var r=e.length,n=t.length;if(0==r||0==n)return 0;r>n?e=e.substring(r-n):r<n&&(t=t.substring(0,r));var i=Math.min(r,n);if(e==t)return i;for(var l=0,o=1;;){var s=e.substring(i-o),a=t.indexOf(s);if(-1==a)return l;o+=a,0!=a&&e.substring(i-o)!=t.substring(0,o)||(l=o,o++)}}function a(e,t){if(!e||!t||e.slice(-1)!==t.slice(-1))return 0;for(var r=0,n=Math.min(e.length,t.length),i=n,l=0;r<i;)e.substring(e.length-i,e.length-l)==t.substring(t.length-i,t.length-l)?l=r=i:n=i,i=Math.floor((n-r)/2+r);return b(e.charCodeAt(e.length-i))&&i--,i}var c=/[^a-zA-Z0-9]/,d=/\s/,u=/[\r\n]/,h=/\n\r?\n$/,p=/^\r?\n\r?\n/;function f(e,i){e.push([n,""]);for(var l,s=0,c=0,d=0,u="",h="";s<e.length;)if(s<e.length-1&&!e[s][1])e.splice(s,1);else switch(e[s][0]){case r:d++,h+=e[s][1],s++;break;case t:c++,u+=e[s][1],s++;break;case n:var p=s-d-c-1;if(i){if(p>=0&&v(e[p][1])){var g=e[p][1].slice(-1);if(e[p][1]=e[p][1].slice(0,-1),u=g+u,h=g+h,!e[p][1]){e.splice(p,1),s--;var b=p-1;e[b]&&e[b][0]===r&&(d++,h=e[b][1]+h,b--),e[b]&&e[b][0]===t&&(c++,u=e[b][1]+u,b--),p=b}}m(e[s][1])&&(g=e[s][1].charAt(0),e[s][1]=e[s][1].slice(1),u+=g,h+=g)}if(s<e.length-1&&!e[s][1]){e.splice(s,1);break}if(u.length>0||h.length>0){u.length>0&&h.length>0&&(0!==(l=o(h,u))&&(p>=0?e[p][1]+=h.substring(0,l):(e.splice(0,0,[n,h.substring(0,l)]),s++),h=h.substring(l),u=u.substring(l)),0!==(l=a(h,u))&&(e[s][1]=h.substring(h.length-l)+e[s][1],h=h.substring(0,h.length-l),u=u.substring(0,u.length-l)));var y=d+c;0===u.length&&0===h.length?(e.splice(s-y,y),s-=y):0===u.length?(e.splice(s-y,y,[r,h]),s=s-y+1):0===h.length?(e.splice(s-y,y,[t,u]),s=s-y+1):(e.splice(s-y,y,[t,u],[r,h]),s=s-y+2)}0!==s&&e[s-1][0]===n?(e[s-1][1]+=e[s][1],e.splice(s,1)):s++,d=0,c=0,u="",h=""}""===e[e.length-1][1]&&e.pop();var w=!1;for(s=1;s<e.length-1;)e[s-1][0]===n&&e[s+1][0]===n&&(e[s][1].substring(e[s][1].length-e[s-1][1].length)===e[s-1][1]?(e[s][1]=e[s-1][1]+e[s][1].substring(0,e[s][1].length-e[s-1][1].length),e[s+1][1]=e[s-1][1]+e[s+1][1],e.splice(s-1,1),w=!0):e[s][1].substring(0,e[s+1][1].length)==e[s+1][1]&&(e[s-1][1]+=e[s+1][1],e[s][1]=e[s][1].substring(e[s+1][1].length)+e[s+1][1],e.splice(s+1,1),w=!0)),s++;w&&f(e,i)}function g(e){return e>=55296&&e<=56319}function b(e){return e>=56320&&e<=57343}function m(e){return b(e.charCodeAt(0))}function v(e){return g(e.charCodeAt(e.length-1))}function y(e,i,l,o){return v(e)||m(o)?null:function(e){for(var t=[],r=0;r<e.length;r++)e[r][1].length>0&&t.push(e[r]);return t}([[n,e],[t,i],[r,l],[n,o]])}function w(e,t,r,n){return i(e,t,r,n,!0)}w.INSERT=r,w.DELETE=t,w.EQUAL=n,e.exports=w},861:function(e,t,r){e=r.nmd(e);var n="__lodash_hash_undefined__",i=9007199254740991,l="[object Arguments]",o="[object Boolean]",s="[object Date]",a="[object Function]",c="[object GeneratorFunction]",d="[object Map]",u="[object Number]",h="[object Object]",p="[object Promise]",f="[object RegExp]",g="[object Set]",b="[object String]",m="[object Symbol]",v="[object WeakMap]",y="[object ArrayBuffer]",w="[object DataView]",C="[object Float32Array]",x="[object Float64Array]",k="[object Int8Array]",T="[object Int16Array]",_="[object Int32Array]",N="[object Uint8Array]",A="[object Uint8ClampedArray]",L="[object Uint16Array]",S="[object Uint32Array]",j=/\w*$/,q=/^\[object .+?Constructor\]$/,E=/^(?:0|[1-9]\d*)$/,M={};M[l]=M["[object Array]"]=M[y]=M[w]=M[o]=M[s]=M[C]=M[x]=M[k]=M[T]=M[_]=M[d]=M[u]=M[h]=M[f]=M[g]=M[b]=M[m]=M[N]=M[A]=M[L]=M[S]=!0,M["[object Error]"]=M[a]=M[v]=!1;var B="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,R="object"==typeof self&&self&&self.Object===Object&&self,O=B||R||Function("return this")(),P=t&&!t.nodeType&&t,I=P&&e&&!e.nodeType&&e,z=I&&I.exports===P;function D(e,t){return e.set(t[0],t[1]),e}function H(e,t){return e.add(t),e}function F(e,t,r,n){var i=-1,l=e?e.length:0;for(n&&l&&(r=e[++i]);++i<l;)r=t(r,e[i],i,e);return r}function V(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function W(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function U(e,t){return function(r){return e(t(r))}}function G(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var $,K=Array.prototype,Z=Function.prototype,Y=Object.prototype,J=O["__core-js_shared__"],X=($=/[^.]+$/.exec(J&&J.keys&&J.keys.IE_PROTO||""))?"Symbol(src)_1."+$:"",Q=Z.toString,ee=Y.hasOwnProperty,te=Y.toString,re=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ne=z?O.Buffer:void 0,ie=O.Symbol,le=O.Uint8Array,oe=U(Object.getPrototypeOf,Object),se=Object.create,ae=Y.propertyIsEnumerable,ce=K.splice,de=Object.getOwnPropertySymbols,ue=ne?ne.isBuffer:void 0,he=U(Object.keys,Object),pe=Oe(O,"DataView"),fe=Oe(O,"Map"),ge=Oe(O,"Promise"),be=Oe(O,"Set"),me=Oe(O,"WeakMap"),ve=Oe(Object,"create"),ye=He(pe),we=He(fe),Ce=He(ge),xe=He(be),ke=He(me),Te=ie?ie.prototype:void 0,_e=Te?Te.valueOf:void 0;function Ne(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Ae(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Le(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Se(e){this.__data__=new Ae(e)}function je(e,t,r){var n=e[t];ee.call(e,t)&&Fe(n,r)&&(void 0!==r||t in e)||(e[t]=r)}function qe(e,t){for(var r=e.length;r--;)if(Fe(e[r][0],t))return r;return-1}function Ee(e,t,r,n,i,p,v){var q;if(n&&(q=p?n(e,i,p,v):n(e)),void 0!==q)return q;if(!$e(e))return e;var E=Ve(e);if(E){if(q=function(e){var t=e.length,r=e.constructor(t);return t&&"string"==typeof e[0]&&ee.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!t)return function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}(e,q)}else{var B=Ie(e),R=B==a||B==c;if(Ue(e))return function(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}(e,t);if(B==h||B==l||R&&!p){if(V(e))return p?e:{};if(q=function(e){return"function"!=typeof e.constructor||De(e)?{}:$e(t=oe(e))?se(t):{};var t}(R?{}:e),!t)return function(e,t){return Be(e,Pe(e),t)}(e,function(e,t){return e&&Be(t,Ke(t),e)}(q,e))}else{if(!M[B])return p?e:{};q=function(e,t,r,n){var i,l=e.constructor;switch(t){case y:return Me(e);case o:case s:return new l(+e);case w:return function(e,t){var r=t?Me(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,n);case C:case x:case k:case T:case _:case N:case A:case L:case S:return function(e,t){var r=t?Me(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}(e,n);case d:return function(e,t,r){return F(t?r(W(e),!0):W(e),D,new e.constructor)}(e,n,r);case u:case b:return new l(e);case f:return function(e){var t=new e.constructor(e.source,j.exec(e));return t.lastIndex=e.lastIndex,t}(e);case g:return function(e,t,r){return F(t?r(G(e),!0):G(e),H,new e.constructor)}(e,n,r);case m:return i=e,_e?Object(_e.call(i)):{}}}(e,B,Ee,t)}}v||(v=new Se);var O=v.get(e);if(O)return O;if(v.set(e,q),!E)var P=r?function(e){return function(e,t,r){var n=t(e);return Ve(e)?n:function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}(n,r(e))}(e,Ke,Pe)}(e):Ke(e);return function(e,t){for(var r=-1,n=e?e.length:0;++r<n&&!1!==t(e[r],r););}(P||e,(function(i,l){P&&(i=e[l=i]),je(q,l,Ee(i,t,r,n,l,e,v))})),q}function Me(e){var t=new e.constructor(e.byteLength);return new le(t).set(new le(e)),t}function Be(e,t,r,n){r||(r={});for(var i=-1,l=t.length;++i<l;){var o=t[i],s=n?n(r[o],e[o],o,r,e):void 0;je(r,o,void 0===s?e[o]:s)}return r}function Re(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function Oe(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!$e(e)||(t=e,X&&X in t))&&(Ge(e)||V(e)?re:q).test(He(e));var t}(r)?r:void 0}Ne.prototype.clear=function(){this.__data__=ve?ve(null):{}},Ne.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Ne.prototype.get=function(e){var t=this.__data__;if(ve){var r=t[e];return r===n?void 0:r}return ee.call(t,e)?t[e]:void 0},Ne.prototype.has=function(e){var t=this.__data__;return ve?void 0!==t[e]:ee.call(t,e)},Ne.prototype.set=function(e,t){return this.__data__[e]=ve&&void 0===t?n:t,this},Ae.prototype.clear=function(){this.__data__=[]},Ae.prototype.delete=function(e){var t=this.__data__,r=qe(t,e);return!(r<0||(r==t.length-1?t.pop():ce.call(t,r,1),0))},Ae.prototype.get=function(e){var t=this.__data__,r=qe(t,e);return r<0?void 0:t[r][1]},Ae.prototype.has=function(e){return qe(this.__data__,e)>-1},Ae.prototype.set=function(e,t){var r=this.__data__,n=qe(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},Le.prototype.clear=function(){this.__data__={hash:new Ne,map:new(fe||Ae),string:new Ne}},Le.prototype.delete=function(e){return Re(this,e).delete(e)},Le.prototype.get=function(e){return Re(this,e).get(e)},Le.prototype.has=function(e){return Re(this,e).has(e)},Le.prototype.set=function(e,t){return Re(this,e).set(e,t),this},Se.prototype.clear=function(){this.__data__=new Ae},Se.prototype.delete=function(e){return this.__data__.delete(e)},Se.prototype.get=function(e){return this.__data__.get(e)},Se.prototype.has=function(e){return this.__data__.has(e)},Se.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Ae){var n=r.__data__;if(!fe||n.length<199)return n.push([e,t]),this;r=this.__data__=new Le(n)}return r.set(e,t),this};var Pe=de?U(de,Object):function(){return[]},Ie=function(e){return te.call(e)};function ze(e,t){return!!(t=null==t?i:t)&&("number"==typeof e||E.test(e))&&e>-1&&e%1==0&&e<t}function De(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Y)}function He(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Fe(e,t){return e===t||e!=e&&t!=t}(pe&&Ie(new pe(new ArrayBuffer(1)))!=w||fe&&Ie(new fe)!=d||ge&&Ie(ge.resolve())!=p||be&&Ie(new be)!=g||me&&Ie(new me)!=v)&&(Ie=function(e){var t=te.call(e),r=t==h?e.constructor:void 0,n=r?He(r):void 0;if(n)switch(n){case ye:return w;case we:return d;case Ce:return p;case xe:return g;case ke:return v}return t});var Ve=Array.isArray;function We(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}(e.length)&&!Ge(e)}var Ue=ue||function(){return!1};function Ge(e){var t=$e(e)?te.call(e):"";return t==a||t==c}function $e(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ke(e){return We(e)?function(e,t){var r=Ve(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&We(e)}(e)&&ee.call(e,"callee")&&(!ae.call(e,"callee")||te.call(e)==l)}(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],n=r.length,i=!!n;for(var o in e)!t&&!ee.call(e,o)||i&&("length"==o||ze(o,n))||r.push(o);return r}(e):function(e){if(!De(e))return he(e);var t=[];for(var r in Object(e))ee.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)}e.exports=function(e){return Ee(e,!0,!0)}},842:function(e,t,r){e=r.nmd(e);var n="__lodash_hash_undefined__",i=1,l=2,o=9007199254740991,s="[object Arguments]",a="[object Array]",c="[object AsyncFunction]",d="[object Boolean]",u="[object Date]",h="[object Error]",p="[object Function]",f="[object GeneratorFunction]",g="[object Map]",b="[object Number]",m="[object Null]",v="[object Object]",y="[object Promise]",w="[object Proxy]",C="[object RegExp]",x="[object Set]",k="[object String]",T="[object Undefined]",_="[object WeakMap]",N="[object ArrayBuffer]",A="[object DataView]",L=/^\[object .+?Constructor\]$/,S=/^(?:0|[1-9]\d*)$/,j={};j["[object Float32Array]"]=j["[object Float64Array]"]=j["[object Int8Array]"]=j["[object Int16Array]"]=j["[object Int32Array]"]=j["[object Uint8Array]"]=j["[object Uint8ClampedArray]"]=j["[object Uint16Array]"]=j["[object Uint32Array]"]=!0,j[s]=j[a]=j[N]=j[d]=j[A]=j[u]=j[h]=j[p]=j[g]=j[b]=j[v]=j[C]=j[x]=j[k]=j[_]=!1;var q="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,E="object"==typeof self&&self&&self.Object===Object&&self,M=q||E||Function("return this")(),B=t&&!t.nodeType&&t,R=B&&e&&!e.nodeType&&e,O=R&&R.exports===B,P=O&&q.process,I=function(){try{return P&&P.binding&&P.binding("util")}catch(e){}}(),z=I&&I.isTypedArray;function D(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function H(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function F(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var V,W,U,G=Array.prototype,$=Function.prototype,K=Object.prototype,Z=M["__core-js_shared__"],Y=$.toString,J=K.hasOwnProperty,X=(V=/[^.]+$/.exec(Z&&Z.keys&&Z.keys.IE_PROTO||""))?"Symbol(src)_1."+V:"",Q=K.toString,ee=RegExp("^"+Y.call(J).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),te=O?M.Buffer:void 0,re=M.Symbol,ne=M.Uint8Array,ie=K.propertyIsEnumerable,le=G.splice,oe=re?re.toStringTag:void 0,se=Object.getOwnPropertySymbols,ae=te?te.isBuffer:void 0,ce=(W=Object.keys,U=Object,function(e){return W(U(e))}),de=Re(M,"DataView"),ue=Re(M,"Map"),he=Re(M,"Promise"),pe=Re(M,"Set"),fe=Re(M,"WeakMap"),ge=Re(Object,"create"),be=ze(de),me=ze(ue),ve=ze(he),ye=ze(pe),we=ze(fe),Ce=re?re.prototype:void 0,xe=Ce?Ce.valueOf:void 0;function ke(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Te(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function _e(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Ne(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new _e;++t<r;)this.add(e[t])}function Ae(e){var t=this.__data__=new Te(e);this.size=t.size}function Le(e,t){for(var r=e.length;r--;)if(De(e[r][0],t))return r;return-1}function Se(e){return null==e?void 0===e?T:m:oe&&oe in Object(e)?function(e){var t=J.call(e,oe),r=e[oe];try{e[oe]=void 0;var n=!0}catch(e){}var i=Q.call(e);return n&&(t?e[oe]=r:delete e[oe]),i}(e):function(e){return Q.call(e)}(e)}function je(e){return $e(e)&&Se(e)==s}function qe(e,t,r,n,o){return e===t||(null==e||null==t||!$e(e)&&!$e(t)?e!=e&&t!=t:function(e,t,r,n,o,c){var p=Fe(e),f=Fe(t),m=p?a:Pe(e),y=f?a:Pe(t),w=(m=m==s?v:m)==v,T=(y=y==s?v:y)==v,_=m==y;if(_&&Ve(e)){if(!Ve(t))return!1;p=!0,w=!1}if(_&&!w)return c||(c=new Ae),p||Ke(e)?Ee(e,t,r,n,o,c):function(e,t,r,n,o,s,a){switch(r){case A:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case N:return!(e.byteLength!=t.byteLength||!s(new ne(e),new ne(t)));case d:case u:case b:return De(+e,+t);case h:return e.name==t.name&&e.message==t.message;case C:case k:return e==t+"";case g:var c=H;case x:var p=n&i;if(c||(c=F),e.size!=t.size&&!p)return!1;var f=a.get(e);if(f)return f==t;n|=l,a.set(e,t);var m=Ee(c(e),c(t),n,o,s,a);return a.delete(e),m;case"[object Symbol]":if(xe)return xe.call(e)==xe.call(t)}return!1}(e,t,m,r,n,o,c);if(!(r&i)){var L=w&&J.call(e,"__wrapped__"),S=T&&J.call(t,"__wrapped__");if(L||S){var j=L?e.value():e,q=S?t.value():t;return c||(c=new Ae),o(j,q,r,n,c)}}return!!_&&(c||(c=new Ae),function(e,t,r,n,l,o){var s=r&i,a=Me(e),c=a.length;if(c!=Me(t).length&&!s)return!1;for(var d=c;d--;){var u=a[d];if(!(s?u in t:J.call(t,u)))return!1}var h=o.get(e);if(h&&o.get(t))return h==t;var p=!0;o.set(e,t),o.set(t,e);for(var f=s;++d<c;){var g=e[u=a[d]],b=t[u];if(n)var m=s?n(b,g,u,t,e,o):n(g,b,u,e,t,o);if(!(void 0===m?g===b||l(g,b,r,n,o):m)){p=!1;break}f||(f="constructor"==u)}if(p&&!f){var v=e.constructor,y=t.constructor;v==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof y&&y instanceof y||(p=!1)}return o.delete(e),o.delete(t),p}(e,t,r,n,o,c))}(e,t,r,n,qe,o))}function Ee(e,t,r,n,o,s){var a=r&i,c=e.length,d=t.length;if(c!=d&&!(a&&d>c))return!1;var u=s.get(e);if(u&&s.get(t))return u==t;var h=-1,p=!0,f=r&l?new Ne:void 0;for(s.set(e,t),s.set(t,e);++h<c;){var g=e[h],b=t[h];if(n)var m=a?n(b,g,h,t,e,s):n(g,b,h,e,t,s);if(void 0!==m){if(m)continue;p=!1;break}if(f){if(!D(t,(function(e,t){if(i=t,!f.has(i)&&(g===e||o(g,e,r,n,s)))return f.push(t);var i}))){p=!1;break}}else if(g!==b&&!o(g,b,r,n,s)){p=!1;break}}return s.delete(e),s.delete(t),p}function Me(e){return function(e,t,r){var n=t(e);return Fe(e)?n:function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}(n,r(e))}(e,Ze,Oe)}function Be(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function Re(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Ge(e)||function(e){return!!X&&X in e}(e))&&(We(e)?ee:L).test(ze(e))}(r)?r:void 0}ke.prototype.clear=function(){this.__data__=ge?ge(null):{},this.size=0},ke.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ke.prototype.get=function(e){var t=this.__data__;if(ge){var r=t[e];return r===n?void 0:r}return J.call(t,e)?t[e]:void 0},ke.prototype.has=function(e){var t=this.__data__;return ge?void 0!==t[e]:J.call(t,e)},ke.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ge&&void 0===t?n:t,this},Te.prototype.clear=function(){this.__data__=[],this.size=0},Te.prototype.delete=function(e){var t=this.__data__,r=Le(t,e);return!(r<0||(r==t.length-1?t.pop():le.call(t,r,1),--this.size,0))},Te.prototype.get=function(e){var t=this.__data__,r=Le(t,e);return r<0?void 0:t[r][1]},Te.prototype.has=function(e){return Le(this.__data__,e)>-1},Te.prototype.set=function(e,t){var r=this.__data__,n=Le(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},_e.prototype.clear=function(){this.size=0,this.__data__={hash:new ke,map:new(ue||Te),string:new ke}},_e.prototype.delete=function(e){var t=Be(this,e).delete(e);return this.size-=t?1:0,t},_e.prototype.get=function(e){return Be(this,e).get(e)},_e.prototype.has=function(e){return Be(this,e).has(e)},_e.prototype.set=function(e,t){var r=Be(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Ne.prototype.add=Ne.prototype.push=function(e){return this.__data__.set(e,n),this},Ne.prototype.has=function(e){return this.__data__.has(e)},Ae.prototype.clear=function(){this.__data__=new Te,this.size=0},Ae.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Ae.prototype.get=function(e){return this.__data__.get(e)},Ae.prototype.has=function(e){return this.__data__.has(e)},Ae.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Te){var n=r.__data__;if(!ue||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new _e(n)}return r.set(e,t),this.size=r.size,this};var Oe=se?function(e){return null==e?[]:(e=Object(e),function(t,r){for(var n=-1,i=null==t?0:t.length,l=0,o=[];++n<i;){var s=t[n];a=s,ie.call(e,a)&&(o[l++]=s)}var a;return o}(se(e)))}:function(){return[]},Pe=Se;function Ie(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||S.test(e))&&e>-1&&e%1==0&&e<t}function ze(e){if(null!=e){try{return Y.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function De(e,t){return e===t||e!=e&&t!=t}(de&&Pe(new de(new ArrayBuffer(1)))!=A||ue&&Pe(new ue)!=g||he&&Pe(he.resolve())!=y||pe&&Pe(new pe)!=x||fe&&Pe(new fe)!=_)&&(Pe=function(e){var t=Se(e),r=t==v?e.constructor:void 0,n=r?ze(r):"";if(n)switch(n){case be:return A;case me:return g;case ve:return y;case ye:return x;case we:return _}return t});var He=je(function(){return arguments}())?je:function(e){return $e(e)&&J.call(e,"callee")&&!ie.call(e,"callee")},Fe=Array.isArray,Ve=ae||function(){return!1};function We(e){if(!Ge(e))return!1;var t=Se(e);return t==p||t==f||t==c||t==w}function Ue(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function Ge(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function $e(e){return null!=e&&"object"==typeof e}var Ke=z?function(e){return function(t){return e(t)}}(z):function(e){return $e(e)&&Ue(e.length)&&!!j[Se(e)]};function Ze(e){return null!=(t=e)&&Ue(t.length)&&!We(t)?function(e,t){var r=Fe(e),n=!r&&He(e),i=!r&&!n&&Ve(e),l=!r&&!n&&!i&&Ke(e),o=r||n||i||l,s=o?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],a=s.length;for(var c in e)!t&&!J.call(e,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||l&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Ie(c,a))||s.push(c);return s}(e):function(e){if(r=(t=e)&&t.constructor,t!==("function"==typeof r&&r.prototype||K))return ce(e);var t,r,n=[];for(var i in Object(e))J.call(e,i)&&"constructor"!=i&&n.push(i);return n}(e);var t}e.exports=function(e,t){return qe(e,t)}},930:function(e,t,r){e=r.nmd(e);var n="__lodash_hash_undefined__",i=9007199254740991,l="[object Arguments]",o="[object AsyncFunction]",s="[object Function]",a="[object GeneratorFunction]",c="[object Null]",d="[object Object]",u="[object Proxy]",h="[object Undefined]",p=/^\[object .+?Constructor\]$/,f=/^(?:0|[1-9]\d*)$/,g={};g["[object Float32Array]"]=g["[object Float64Array]"]=g["[object Int8Array]"]=g["[object Int16Array]"]=g["[object Int32Array]"]=g["[object Uint8Array]"]=g["[object Uint8ClampedArray]"]=g["[object Uint16Array]"]=g["[object Uint32Array]"]=!0,g[l]=g["[object Array]"]=g["[object ArrayBuffer]"]=g["[object Boolean]"]=g["[object DataView]"]=g["[object Date]"]=g["[object Error]"]=g[s]=g["[object Map]"]=g["[object Number]"]=g[d]=g["[object RegExp]"]=g["[object Set]"]=g["[object String]"]=g["[object WeakMap]"]=!1;var b,m,v,y="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,w="object"==typeof self&&self&&self.Object===Object&&self,C=y||w||Function("return this")(),x=t&&!t.nodeType&&t,k=x&&e&&!e.nodeType&&e,T=k&&k.exports===x,_=T&&y.process,N=function(){try{return k&&k.require&&k.require("util").types||_&&_.binding&&_.binding("util")}catch(e){}}(),A=N&&N.isTypedArray,L=Array.prototype,S=Function.prototype,j=Object.prototype,q=C["__core-js_shared__"],E=S.toString,M=j.hasOwnProperty,B=(b=/[^.]+$/.exec(q&&q.keys&&q.keys.IE_PROTO||""))?"Symbol(src)_1."+b:"",R=j.toString,O=E.call(Object),P=RegExp("^"+E.call(M).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),I=T?C.Buffer:void 0,z=C.Symbol,D=C.Uint8Array,H=(I&&I.allocUnsafe,m=Object.getPrototypeOf,v=Object,function(e){return m(v(e))}),F=Object.create,V=j.propertyIsEnumerable,W=L.splice,U=z?z.toStringTag:void 0,G=function(){try{var e=he(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),$=I?I.isBuffer:void 0,K=Math.max,Z=Date.now,Y=he(C,"Map"),J=he(Object,"create"),X=function(){function e(){}return function(t){if(!Te(t))return{};if(F)return F(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function Q(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ee(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function te(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function re(e){var t=this.__data__=new ee(e);this.size=t.size}function ne(e,t,r){(void 0!==r&&!me(e[t],r)||void 0===r&&!(t in e))&&oe(e,t,r)}function ie(e,t,r){var n=e[t];M.call(e,t)&&me(n,r)&&(void 0!==r||t in e)||oe(e,t,r)}function le(e,t){for(var r=e.length;r--;)if(me(e[r][0],t))return r;return-1}function oe(e,t,r){"__proto__"==t&&G?G(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}Q.prototype.clear=function(){this.__data__=J?J(null):{},this.size=0},Q.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Q.prototype.get=function(e){var t=this.__data__;if(J){var r=t[e];return r===n?void 0:r}return M.call(t,e)?t[e]:void 0},Q.prototype.has=function(e){var t=this.__data__;return J?void 0!==t[e]:M.call(t,e)},Q.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=J&&void 0===t?n:t,this},ee.prototype.clear=function(){this.__data__=[],this.size=0},ee.prototype.delete=function(e){var t=this.__data__,r=le(t,e);return!(r<0||(r==t.length-1?t.pop():W.call(t,r,1),--this.size,0))},ee.prototype.get=function(e){var t=this.__data__,r=le(t,e);return r<0?void 0:t[r][1]},ee.prototype.has=function(e){return le(this.__data__,e)>-1},ee.prototype.set=function(e,t){var r=this.__data__,n=le(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},te.prototype.clear=function(){this.size=0,this.__data__={hash:new Q,map:new(Y||ee),string:new Q}},te.prototype.delete=function(e){var t=ue(this,e).delete(e);return this.size-=t?1:0,t},te.prototype.get=function(e){return ue(this,e).get(e)},te.prototype.has=function(e){return ue(this,e).has(e)},te.prototype.set=function(e,t){var r=ue(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},re.prototype.clear=function(){this.__data__=new ee,this.size=0},re.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},re.prototype.get=function(e){return this.__data__.get(e)},re.prototype.has=function(e){return this.__data__.has(e)},re.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ee){var n=r.__data__;if(!Y||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new te(n)}return r.set(e,t),this.size=r.size,this};function se(e){return null==e?void 0===e?h:c:U&&U in Object(e)?function(e){var t=M.call(e,U),r=e[U];try{e[U]=void 0;var n=!0}catch(e){}var i=R.call(e);return n&&(t?e[U]=r:delete e[U]),i}(e):function(e){return R.call(e)}(e)}function ae(e){return _e(e)&&se(e)==l}function ce(e,t,r,n,i){e!==t&&function(e,t,r){for(var n=-1,i=Object(e),l=r(e),o=l.length;o--;){var s=l[++n];if(!1===t(i[s],s,i))break}}(t,(function(l,o){if(i||(i=new re),Te(l))!function(e,t,r,n,i,l,o){var s=ge(e,r),a=ge(t,r),c=o.get(a);if(c)ne(e,r,c);else{var u,h,p,f,g,b=l?l(s,a,r+"",e,t,o):void 0,m=void 0===b;if(m){var v=ye(a),y=!v&&Ce(a),w=!v&&!y&&Ne(a);b=a,v||y||w?ye(s)?b=s:_e(g=s)&&we(g)?b=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}(s):y?(m=!1,b=function(e,t){return e.slice()}(a)):w?(m=!1,f=new(p=(u=a).buffer).constructor(p.byteLength),new D(f).set(new D(p)),h=f,b=new u.constructor(h,u.byteOffset,u.length)):b=[]:function(e){if(!_e(e)||se(e)!=d)return!1;var t=H(e);if(null===t)return!0;var r=M.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&E.call(r)==O}(a)||ve(a)?(b=s,ve(s)?b=function(e){return function(e,t,r,n){var i=!r;r||(r={});for(var l=-1,o=t.length;++l<o;){var s=t[l],a=void 0;void 0===a&&(a=e[s]),i?oe(r,s,a):ie(r,s,a)}return r}(e,Ae(e))}(s):Te(s)&&!xe(s)||(b=function(e){return"function"!=typeof e.constructor||fe(e)?{}:X(H(e))}(a))):m=!1}m&&(o.set(a,b),i(b,a,n,l,o),o.delete(a)),ne(e,r,b)}}(e,t,o,r,ce,n,i);else{var s=n?n(ge(e,o),l,o+"",e,t,i):void 0;void 0===s&&(s=l),ne(e,o,s)}}),Ae)}var de=G?function(e,t){return G(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:je;function ue(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function he(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Te(e)||function(e){return!!B&&B in e}(e))&&(xe(e)?P:p).test(function(e){if(null!=e){try{return E.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}(r)?r:void 0}function pe(e,t){var r=typeof e;return!!(t=null==t?i:t)&&("number"==r||"symbol"!=r&&f.test(e))&&e>-1&&e%1==0&&e<t}function fe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||j)}function ge(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var be=function(e){var t=0,r=0;return function(){var n=Z(),i=16-(n-r);if(r=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(de);function me(e,t){return e===t||e!=e&&t!=t}var ve=ae(function(){return arguments}())?ae:function(e){return _e(e)&&M.call(e,"callee")&&!V.call(e,"callee")},ye=Array.isArray;function we(e){return null!=e&&ke(e.length)&&!xe(e)}var Ce=$||function(){return!1};function xe(e){if(!Te(e))return!1;var t=se(e);return t==s||t==a||t==o||t==u}function ke(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}function Te(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function _e(e){return null!=e&&"object"==typeof e}var Ne=A?function(e){return function(t){return e(t)}}(A):function(e){return _e(e)&&ke(e.length)&&!!g[se(e)]};function Ae(e){return we(e)?function(e,t){var r=ye(e),n=!r&&ve(e),i=!r&&!n&&Ce(e),l=!r&&!n&&!i&&Ne(e),o=r||n||i||l,s=o?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],a=s.length;for(var c in e)!t&&!M.call(e,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||l&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||pe(c,a))||s.push(c);return s}(e,!0):function(e){if(!Te(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=fe(e),r=[];for(var n in e)("constructor"!=n||!t&&M.call(e,n))&&r.push(n);return r}(e)}var Le,Se=(Le=function(e,t,r){ce(e,t,r)},function(e,t){return be(function(e,t,r){return t=K(void 0===t?e.length-1:t,0),function(){for(var n=arguments,i=-1,l=K(n.length-t,0),o=Array(l);++i<l;)o[i]=n[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=n[i];return s[t]=r(o),function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(e,this,s)}}(e,t,je),e+"")}((function(e,t){var r=-1,n=t.length,i=n>1?t[n-1]:void 0,l=n>2?t[2]:void 0;for(i=Le.length>3&&"function"==typeof i?(n--,i):void 0,l&&function(e,t,r){if(!Te(r))return!1;var n=typeof t;return!!("number"==n?we(r)&&pe(t,r.length):"string"==n&&t in r)&&me(r[t],e)}(t[0],t[1],l)&&(i=n<3?void 0:i,n=1),e=Object(e);++r<n;){var o=t[r];o&&Le(e,o,r)}return e})));function je(e){return e}e.exports=Se},382:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(861),i=r(842);var l;!function(e){e.compose=function(e={},t={},r=!1){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});let i=n(t);r||(i=Object.keys(i).reduce(((e,t)=>(null!=i[t]&&(e[t]=i[t]),e)),{}));for(const r in e)void 0!==e[r]&&void 0===t[r]&&(i[r]=e[r]);return Object.keys(i).length>0?i:void 0},e.diff=function(e={},t={}){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});const r=Object.keys(e).concat(Object.keys(t)).reduce(((r,n)=>(i(e[n],t[n])||(r[n]=void 0===t[n]?null:t[n]),r)),{});return Object.keys(r).length>0?r:void 0},e.invert=function(e={},t={}){e=e||{};const r=Object.keys(t).reduce(((r,n)=>(t[n]!==e[n]&&void 0!==e[n]&&(r[n]=t[n]),r)),{});return Object.keys(e).reduce(((r,n)=>(e[n]!==t[n]&&void 0===t[n]&&(r[n]=null),r)),r)},e.transform=function(e,t,r=!1){if("object"!=typeof e)return t;if("object"!=typeof t)return;if(!r)return t;const n=Object.keys(t).reduce(((r,n)=>(void 0===e[n]&&(r[n]=t[n]),r)),{});return Object.keys(n).length>0?n:void 0}}(l||(l={})),t.default=l},32:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0;const n=r(386),i=r(861),l=r(842),o=r(382);t.AttributeMap=o.default;const s=r(427);t.Op=s.default;const a=r(505);t.OpIterator=a.default;const c=String.fromCharCode(0),d=(e,t)=>{if("object"!=typeof e||null===e)throw new Error("cannot retain a "+typeof e);if("object"!=typeof t||null===t)throw new Error("cannot retain a "+typeof t);const r=Object.keys(e)[0];if(!r||r!==Object.keys(t)[0])throw new Error(`embed types not matched: ${r} != ${Object.keys(t)[0]}`);return[r,e[r],t[r]]};class u{constructor(e){Array.isArray(e)?this.ops=e:null!=e&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]}static registerEmbed(e,t){this.handlers[e]=t}static unregisterEmbed(e){delete this.handlers[e]}static getHandler(e){const t=this.handlers[e];if(!t)throw new Error(`no handlers for embed type "${e}"`);return t}insert(e,t){const r={};return"string"==typeof e&&0===e.length?this:(r.insert=e,null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(r.attributes=t),this.push(r))}delete(e){return e<=0?this:this.push({delete:e})}retain(e,t){if("number"==typeof e&&e<=0)return this;const r={retain:e};return null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(r.attributes=t),this.push(r)}push(e){let t=this.ops.length,r=this.ops[t-1];if(e=i(e),"object"==typeof r){if("number"==typeof e.delete&&"number"==typeof r.delete)return this.ops[t-1]={delete:r.delete+e.delete},this;if("number"==typeof r.delete&&null!=e.insert&&(t-=1,r=this.ops[t-1],"object"!=typeof r))return this.ops.unshift(e),this;if(l(e.attributes,r.attributes)){if("string"==typeof e.insert&&"string"==typeof r.insert)return this.ops[t-1]={insert:r.insert+e.insert},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this;if("number"==typeof e.retain&&"number"==typeof r.retain)return this.ops[t-1]={retain:r.retain+e.retain},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this}chop(){const e=this.ops[this.ops.length-1];return e&&"number"==typeof e.retain&&!e.attributes&&this.ops.pop(),this}filter(e){return this.ops.filter(e)}forEach(e){this.ops.forEach(e)}map(e){return this.ops.map(e)}partition(e){const t=[],r=[];return this.forEach((n=>{(e(n)?t:r).push(n)})),[t,r]}reduce(e,t){return this.ops.reduce(e,t)}changeLength(){return this.reduce(((e,t)=>t.insert?e+s.default.length(t):t.delete?e-t.delete:e),0)}length(){return this.reduce(((e,t)=>e+s.default.length(t)),0)}slice(e=0,t=1/0){const r=[],n=new a.default(this.ops);let i=0;for(;i<t&&n.hasNext();){let l;i<e?l=n.next(e-i):(l=n.next(t-i),r.push(l)),i+=s.default.length(l)}return new u(r)}compose(e){const t=new a.default(this.ops),r=new a.default(e.ops),n=[],i=r.peek();if(null!=i&&"number"==typeof i.retain&&null==i.attributes){let e=i.retain;for(;"insert"===t.peekType()&&t.peekLength()<=e;)e-=t.peekLength(),n.push(t.next());i.retain-e>0&&r.next(i.retain-e)}const s=new u(n);for(;t.hasNext()||r.hasNext();)if("insert"===r.peekType())s.push(r.next());else if("delete"===t.peekType())s.push(t.next());else{const e=Math.min(t.peekLength(),r.peekLength()),n=t.next(e),i=r.next(e);if(i.retain){const a={};if("number"==typeof n.retain)a.retain="number"==typeof i.retain?e:i.retain;else if("number"==typeof i.retain)null==n.retain?a.insert=n.insert:a.retain=n.retain;else{const e=null==n.retain?"insert":"retain",[t,r,l]=d(n[e],i.retain),o=u.getHandler(t);a[e]={[t]:o.compose(r,l,"retain"===e)}}const c=o.default.compose(n.attributes,i.attributes,"number"==typeof n.retain);if(c&&(a.attributes=c),s.push(a),!r.hasNext()&&l(s.ops[s.ops.length-1],a)){const e=new u(t.rest());return s.concat(e).chop()}}else"number"==typeof i.delete&&("number"==typeof n.retain||"object"==typeof n.retain&&null!==n.retain)&&s.push(i)}return s.chop()}concat(e){const t=new u(this.ops.slice());return e.ops.length>0&&(t.push(e.ops[0]),t.ops=t.ops.concat(e.ops.slice(1))),t}diff(e,t){if(this.ops===e.ops)return new u;const r=[this,e].map((t=>t.map((r=>{if(null!=r.insert)return"string"==typeof r.insert?r.insert:c;throw new Error("diff() called "+(t===e?"on":"with")+" non-document")})).join(""))),i=new u,s=n(r[0],r[1],t,!0),d=new a.default(this.ops),h=new a.default(e.ops);return s.forEach((e=>{let t=e[1].length;for(;t>0;){let r=0;switch(e[0]){case n.INSERT:r=Math.min(h.peekLength(),t),i.push(h.next(r));break;case n.DELETE:r=Math.min(t,d.peekLength()),d.next(r),i.delete(r);break;case n.EQUAL:r=Math.min(d.peekLength(),h.peekLength(),t);const e=d.next(r),s=h.next(r);l(e.insert,s.insert)?i.retain(r,o.default.diff(e.attributes,s.attributes)):i.push(s).delete(r)}t-=r}})),i.chop()}eachLine(e,t="\n"){const r=new a.default(this.ops);let n=new u,i=0;for(;r.hasNext();){if("insert"!==r.peekType())return;const l=r.peek(),o=s.default.length(l)-r.peekLength(),a="string"==typeof l.insert?l.insert.indexOf(t,o)-o:-1;if(a<0)n.push(r.next());else if(a>0)n.push(r.next(a));else{if(!1===e(n,r.next(1).attributes||{},i))return;i+=1,n=new u}}n.length()>0&&e(n,{},i)}invert(e){const t=new u;return this.reduce(((r,n)=>{if(n.insert)t.delete(s.default.length(n));else{if("number"==typeof n.retain&&null==n.attributes)return t.retain(n.retain),r+n.retain;if(n.delete||"number"==typeof n.retain){const i=n.delete||n.retain;return e.slice(r,r+i).forEach((e=>{n.delete?t.push(e):n.retain&&n.attributes&&t.retain(s.default.length(e),o.default.invert(n.attributes,e.attributes))})),r+i}if("object"==typeof n.retain&&null!==n.retain){const i=e.slice(r,r+1),l=new a.default(i.ops).next(),[s,c,h]=d(n.retain,l.insert),p=u.getHandler(s);return t.retain({[s]:p.invert(c,h)},o.default.invert(n.attributes,l.attributes)),r+1}}return r}),0),t.chop()}transform(e,t=!1){if(t=!!t,"number"==typeof e)return this.transformPosition(e,t);const r=e,n=new a.default(this.ops),i=new a.default(r.ops),l=new u;for(;n.hasNext()||i.hasNext();)if("insert"!==n.peekType()||!t&&"insert"===i.peekType())if("insert"===i.peekType())l.push(i.next());else{const e=Math.min(n.peekLength(),i.peekLength()),r=n.next(e),s=i.next(e);if(r.delete)continue;if(s.delete)l.push(s);else{const n=r.retain,i=s.retain;let a="object"==typeof i&&null!==i?i:e;if("object"==typeof n&&null!==n&&"object"==typeof i&&null!==i){const e=Object.keys(n)[0];if(e===Object.keys(i)[0]){const r=u.getHandler(e);r&&(a={[e]:r.transform(n[e],i[e],t)})}}l.retain(a,o.default.transform(r.attributes,s.attributes,t))}}else l.retain(s.default.length(n.next()));return l.chop()}transformPosition(e,t=!1){t=!!t;const r=new a.default(this.ops);let n=0;for(;r.hasNext()&&n<=e;){const i=r.peekLength(),l=r.peekType();r.next(),"delete"!==l?("insert"===l&&(n<e||!t)&&(e+=i),n+=i):e-=Math.min(i,e-n)}return e}}u.Op=s.default,u.OpIterator=a.default,u.AttributeMap=o.default,u.handlers={},t.default=u,e.exports=u,e.exports.default=u},427:function(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.length=function(e){return"number"==typeof e.delete?e.delete:"number"==typeof e.retain?e.retain:"object"==typeof e.retain&&null!==e.retain?1:"string"==typeof e.insert?e.insert.length:1}}(r||(r={})),t.default=r},505:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(427);t.default=class{constructor(e){this.ops=e,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(e){e||(e=1/0);const t=this.ops[this.index];if(t){const r=this.offset,i=n.default.length(t);if(e>=i-r?(e=i-r,this.index+=1,this.offset=0):this.offset+=e,"number"==typeof t.delete)return{delete:e};{const n={};return t.attributes&&(n.attributes=t.attributes),"number"==typeof t.retain?n.retain=e:"object"==typeof t.retain&&null!==t.retain?n.retain=t.retain:"string"==typeof t.insert?n.insert=t.insert.substr(r,e):n.insert=t.insert,n}}return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?n.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const e=this.ops[this.index];return e?"number"==typeof e.delete?"delete":"number"==typeof e.retain||"object"==typeof e.retain&&null!==e.retain?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);{const e=this.offset,t=this.index,r=this.next(),n=this.ops.slice(this.index);return this.offset=e,this.index=t,[r].concat(n)}}return[]}}},912:function(t){"use strict";t.exports=e}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var l=r[e]={id:e,loaded:!1,exports:{}};return t[e](l,l.exports,n),l.loaded=!0,l.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e};var i={};return function(){"use strict";n.d(i,{default:function(){return mn}});var e=n(912),t=n.n(e),r=n(32),l=n.n(r),o='<?xml version="1.0" encoding="UTF-8"?><svg width="16" height="16" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M36 19H12" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M42 9H6" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M42 29H6" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M36 39H12" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>',s='<?xml version="1.0" encoding="UTF-8"?><svg width="16" height="16" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M42 9H6" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M34 19H6" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M42 29H6" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M34 39H6" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>',a='<?xml version="1.0" encoding="UTF-8"?><svg width="16" height="16" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M42 9H6" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M42 19H14" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M42 29H6" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M42 39H14" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>';const c=["data-row","width","height","colspan","rowspan","style"],d={"border-style":"none","border-color":"","border-width":"","background-color":"",width:"",height:"",padding:"","text-align":"left","vertical-align":"middle"},u=["border-style","border-color","border-width","background-color","width","height","padding","text-align","vertical-align"],h=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","currentcolor","currentcolor","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","transparent","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],p=["border-style","border-color","border-width","background-color","width","height","align"];const f=t().import("formats/list"),g=t().import("blots/container"),b=["colspan","rowspan"];class m extends g{static create(e){const t=super.create();for(const t of b)"1"==e[t]&&delete e[t];const r=Object.keys(e);for(const n of r)"data-row"===n?t.setAttribute(n,e[n]):"cellId"===n?t.setAttribute("data-cell",e[n]):t.setAttribute(`data-${n}`,e[n]);return t}format(e,t){return this.wrap(e,t)}static formats(e){const t=c.reduce(((t,r)=>{const n=r.includes("data")?r:`data-${r}`;return e.hasAttribute(n)&&(t[r]=e.getAttribute(n)),t}),{});t.cellId=e.getAttribute("data-cell");for(const e of b)t[e]||(t[e]="1");return t}formats(){const e=this.statics.formats(this.domNode,this.scroll);return{[this.statics.blotName]:e}}}m.blotName="table-list-container",m.className="table-list-container",m.tagName="OL";class v extends f{format(e,t,r){const n=this.formats()[this.statics.blotName];if("list"===e){const[e,i]=this.getCellFormats(this.parent);if(!t||t===n)return this.setReplace(r,e),this.replaceWith($.blotName,i);if(t!==n)return this.replaceWith(this.statics.blotName,t)}else if(e===m.blotName){"string"==typeof t&&(t={cellId:t});const[r,n,i]=this.getCorrectCellFormats(t);this.wrap(i,r),this.wrap(e,Object.assign(Object.assign({},r),{cellId:n}))}else{if("header"===e){const[e,n]=this.getCellFormats(this.parent);return this.setReplace(r,e),this.replaceWith("table-header",{cellId:n,value:t})}if(!t||e!==Z.blotName&&e!==Y.blotName)if(e!==this.statics.blotName||t)super.format(e,t);else{const[,e]=this.getCellFormats(this.parent);this.replaceWith($.blotName,e)}else{const r=this.getListContainer(this.parent);if(!r)return;const n=r.formats()[r.statics.blotName];this.wrap(e,t),this.wrap(m.blotName,Object.assign(Object.assign({},n),t))}}}getCellFormats(e){return N(B(e))}getCorrectCellFormats(e){const t=B(this.parent);if(t){const r=t.statics.blotName,[n,i]=N(t),l=Object.assign(Object.assign({},n),e),o=l.cellId||i;return delete l.cellId,[l,o,r]}{const t=e.cellId,r=Object.assign({},e);return delete r.cellId,[r,t,Z.blotName]}}getListContainer(e){for(;e;){if(e.statics.blotName===m.blotName)return e;e=e.parent}return null}static register(){t().register(m)}setReplace(e,t){e?this.parent.replaceWith(Z.blotName,t):this.wrap(Z.blotName,t)}}v.blotName="table-list",v.className="table-list",t().register({"formats/table-list":v},!0),m.allowedChildren=[v],v.requiredContainer=m;const y=t().import("formats/header");class w extends y{static create(e){const{cellId:t,value:r}=e,n=super.create(r);return n.setAttribute("data-cell",t),n}format(e,t,r){if("header"===e){const e=this.statics.formats(this.domNode).value,r=this.domNode.getAttribute("data-cell");e!=t&&t?super.format("table-header",{cellId:r,value:t}):this.replaceWith($.blotName,r)}else{if("list"===e){const[e,n,i]=this.getCellFormats(this.parent);return r?this.wrap(m.blotName,Object.assign(Object.assign({},e),{cellId:n})):this.wrap(i,e),this.replaceWith("table-list",t)}if(t&&(e===Z.blotName||e===Y.blotName))return this.wrap(e,t);if(e!==this.statics.blotName||t)super.format(e,t);else{const e=this.domNode.getAttribute("data-cell");this.replaceWith($.blotName,e)}}}static formats(e){return{cellId:e.getAttribute("data-cell"),value:this.tagName.indexOf(e.tagName)+1}}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return null!=t&&(e[this.statics.blotName]=t),e}getCellFormats(e){const t=B(e);return[...N(t),t.statics.blotName]}}w.blotName="table-header",w.className="ql-table-header",t().register({"formats/table-header":w},!0);var C=w;function x(e){if("string"!=typeof e||!e||e.endsWith("%"))return e;const t=e.replace(/\d+\.?\d*/,""),r=e.slice(0,-t.length);return`${Math.round(parseFloat(r))}${t}`}function k(e){const t=document.createElement("div");return t.innerText=e,t.classList.add("ql-table-tooltip","ql-hidden"),t}function T(e){return e.replace(/mso.*?;/g,"")}function _(e){const[t]=e.descendant($),[r]=e.descendant(m),[n]=e.descendant(C);return t||r||n}function N(e){const t=Z.formats(e.domNode),r=_(e);if(r)return[t,A(r.formats()[r.statics.blotName])];{const e=t["data-row"].split("-")[1];return[t,`cell-${e}`]}}function A(e){return e instanceof Object?e.cellId:e}function L(e,t){return e.closest(t)}function S(e,t){return{left:Math.min(e.left,t.left),right:Math.max(e.right,t.right),top:Math.min(e.top,t.top),bottom:Math.max(e.bottom,t.bottom)}}function j(e,r,n){const i=t().find(r).descendants(re);let l=0;return i.reduce(((t,r)=>{const{left:i,width:o}=M(r.domNode,n);return l=l||i,l+2>=e.left&&l-2+o<=e.right&&t.push(r.domNode),l+=o,t}),[])}function q(e,r,n,i){return t().find(r).descendants(Z).reduce(((t,r)=>{const{left:l,top:o,width:s,height:a}=M(r.domNode,n);switch(i){case"column":(l+2>=e.left&&l-2+s<=e.right||l+2<e.right&&e.right<l-2+s||e.left>l+2&&e.left<l-2+s)&&t.push(r.domNode);break;case"row":break;default:l+2>=e.left&&l-2+s<=e.right&&o+2>=e.top&&o-2+a<=e.bottom&&t.push(r.domNode)}return t}),[])}function E(e){return e.replace(/data-(?!list)[a-z]+="[^"]*"/g,"").replace(/class="[^"]*"/g,(e=>e.replace(/ql-cell-[^"]*/g,"").replace(/ql-table-[^"]*/,"").replace(/table-list(?:[^"]*)?/g,""))).replace(/class="\s*"/g,"")}function M(e,t){const r=e.getBoundingClientRect(),n=t.getBoundingClientRect(),i=r.left-n.left-t.scrollLeft,l=r.top-n.top-t.scrollTop,o=r.width,s=r.height;return{left:i,top:l,width:o,height:s,right:i+o,bottom:l+s}}function B(e){for(;e;){if(e.statics.blotName===Z.blotName||e.statics.blotName===Y.blotName)return e;e=e.parent}return null}function R(){const e=document.querySelector(".ql-editor"),{clientWidth:t}=e,r=getComputedStyle(e);return t-~~r.getPropertyValue("padding-left")-~~r.getPropertyValue("padding-right")}function O(e,t){return t?`${(e/R()*100).toFixed(2)}%`:`${e}px`}function P(e,t){const r=getComputedStyle(e),n=e.style;return t.reduce(((e,t)=>{return e[t]=(i=n.getPropertyValue(t)||r.getPropertyValue(t)).startsWith("rgba(")?function(e){e=e.replace(/^[^\d]+/,"").replace(/[^\d]+$/,"");const t=Math.round(+e[0]),r=Math.round(+e[1]),n=Math.round(+e[2]),i=Math.round(255*+e[3]).toString(16).toUpperCase().padStart(2,"0");return"#"+((1<<24)+(t<<16)+(r<<8)+n).toString(16).slice(1)+i}(i):i.startsWith("rgb(")?`#${(i=i.replace(/^[^\d]+/,"").replace(/[^\d]+$/,"")).split(",").map((e=>`00${parseInt(e,10).toString(16)}`.slice(-2))).join("")}`:i,e;var i}),{})}function I(e){return!e||(!!/^#([A-Fa-f0-9]{3,6})$/.test(e)||!!/^rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)$/.test(e)||function(e){for(const t of h)if(t===e)return!0;return!1}(e))}function z(e){if(!e)return!0;const t=e.replace(/\d+\.?\d*/,"");return!t||"px"===t||"em"===t||"%"===t||!/[a-z]/.test(t)&&!isNaN(parseFloat(t))}function D(e,t){for(const r in t)e.setAttribute(r,t[r])}function H(e,t){const r=e.style;if(r)for(const e in t)r.setProperty(e,t[e]);else e.setAttribute("style",t.toString())}function F(e,r,n){const i=t().find(e);if(!i)return;const l=i.isPercent();if(l&&!n)return;const o=i.colgroup(),s=i.temporary();if(o)if(l){let e=0;const t=o.domNode.querySelectorAll("col");for(const r of t){const t=r.style.getPropertyValue("width");e+=t?parseFloat(t):0}H(s.domNode,{width:`${e}%`})}else{let e=0;const t=o.domNode.querySelectorAll("col");for(const r of t)e+=~~r.getAttribute("width");H(s.domNode,{width:O(e,l)})}else H(s.domNode,{width:O(r.width+n,l)})}const V=t().import("blots/block"),W=t().import("blots/container"),U=["border","cellspacing","style","data-class"],G=["width"];class $ extends V{static create(e){const t=super.create();return e?t.setAttribute("data-cell",e):t.setAttribute("data-cell",le()),t}format(e,t){const r=this.formats()[this.statics.blotName];if(e===Z.blotName&&t)return this.wrap(J.blotName),this.wrap(e,t);if(e===Y.blotName&&t)return this.wrap(X.blotName),this.wrap(e,t);if(e===ie.blotName)this.wrap(e,t);else{if("header"===e)return this.replaceWith("table-header",{cellId:r,value:t});if("table-header"===e&&t)return this.wrapTableCell(this.parent),this.replaceWith(e,t);if("list"===e||"table-list"===e&&t){const e=this.getCellFormats(this.parent);return this.wrap(m.blotName,Object.assign(Object.assign({},e),{cellId:r})),this.replaceWith("table-list",t)}super.format(e,t)}}formats(){const e=this.attributes.values(),t=this.domNode.getAttribute("data-cell");return null!=t&&(e[this.statics.blotName]=t),e}getCellFormats(e){const t=B(e);if(!t)return{};const[r]=N(t);return r}wrapTableCell(e){const t=B(e);if(!t)return;const[r]=N(t);this.wrap(t.statics.blotName,r)}}$.blotName="table-cell-block",$.className="ql-table-block",$.tagName="P";class K extends ${}K.blotName="table-th-block",K.className="table-th-block",K.tagName="P";class Z extends W{checkMerge(){if(super.checkMerge()&&null!=this.next.children.head&&this.next.children.head.formats){const e=this.children.head.formats()[this.children.head.statics.blotName],t=this.children.tail.formats()[this.children.tail.statics.blotName],r=this.next.children.head.formats()[this.next.children.head.statics.blotName],n=this.next.children.tail.formats()[this.next.children.tail.statics.blotName],i=A(e),l=A(t),o=A(r),s=A(n);return i===l&&i===o&&i===s}return!1}static create(e){const t=super.create(),r=Object.keys(e);for(const n of r)e[n]&&t.setAttribute(n,e[n]);return t}static formats(e){const t=this.getEmptyRowspan(e),r=c.reduce(((r,n)=>(e.hasAttribute(n)&&(r[n]="rowspan"===n&&t?""+(~~e.getAttribute(n)-t):T(e.getAttribute(n))),r)),{});return this.hasColgroup(e)&&(delete r.width,r.style&&(r.style=r.style.replace(/width.*?;/g,""))),r}formats(){const e=this.statics.formats(this.domNode,this.scroll);return{[this.statics.blotName]:e}}static getEmptyRowspan(e){let t=e.parentElement.nextElementSibling,r=0;for(;t&&"TR"===t.tagName&&!t.innerHTML.replace(/\s/g,"");)r++,t=t.nextElementSibling;return r}static hasColgroup(e){for(;e&&"TBODY"!==e.tagName;)e=e.parentElement;for(;e;){if("COLGROUP"===e.tagName)return!0;e=e.previousElementSibling}return!1}html(){return this.domNode.outerHTML.replace(/<(ol)[^>]*><li[^>]* data-list="bullet">(?:.*?)<\/li><\/(ol)>/gi,((e,t,r)=>e.replace(t,"ul").replace(r,"ul")))}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}setChildrenId(e){this.children.forEach((t=>{t.domNode.setAttribute("data-cell",e)}))}table(){let e=this.parent;for(;null!=e&&"table-container"!==e.statics.blotName;)e=e.parent;return e}optimize(e){super.optimize(e),this.children.forEach((e=>{if(null!=e.next&&A(e.formats()[e.statics.blotName])!==A(e.next.formats()[e.next.statics.blotName])){const t=this.splitAfter(e);t&&t.optimize(),this.prev&&this.prev.optimize()}}))}}Z.blotName="table-cell",Z.tagName="TD";class Y extends Z{}Y.blotName="table-th",Y.tagName="TH";class J extends W{checkMerge(){if(super.checkMerge()&&null!=this.next.children.head&&this.next.children.head.formats){const e=this.children.head.formats()[this.children.head.statics.blotName],t=this.children.tail.formats()[this.children.tail.statics.blotName],r=this.next.children.head.formats()[this.next.children.head.statics.blotName],n=this.next.children.tail.formats()[this.next.children.tail.statics.blotName];return e["data-row"]===t["data-row"]&&e["data-row"]===r["data-row"]&&e["data-row"]===n["data-row"]}return!1}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}}J.blotName="table-row",J.tagName="TR";class X extends J{}X.blotName="table-th-row",X.tagName="TR";class Q extends W{}Q.blotName="table-body",Q.tagName="TBODY";class ee extends Q{}ee.blotName="table-thead",ee.tagName="THEAD";class te extends V{static create(e){const t=super.create(),r=Object.keys(e),n=ie.defaultClassName;for(const i of r)"data-class"!==i||~e[i].indexOf(n)?t.setAttribute(i,e[i]):t.setAttribute(i,`${n} ${e[i]}`);return t}static formats(e){return U.reduce(((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t)),{})}formats(){const e=this.statics.formats(this.domNode,this.scroll);return{[this.statics.blotName]:e}}optimize(...e){if(this.statics.requiredContainer&&this.parent instanceof this.statics.requiredContainer){const e=this.formats()[this.statics.blotName];for(const t of U)e[t]?"data-class"===t?this.parent.domNode.setAttribute("class",e[t]):this.parent.domNode.setAttribute(t,e[t]):this.parent.domNode.removeAttribute(t)}super.optimize(...e)}}te.blotName="table-temporary",te.className="ql-table-temporary",te.tagName="temporary";class re extends V{static create(e){const t=super.create(),r=Object.keys(e);for(const n of r)t.setAttribute(n,e[n]);return t}static formats(e){return G.reduce(((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t)),{})}formats(){const e=this.statics.formats(this.domNode,this.scroll);return{[this.statics.blotName]:e}}html(){return this.domNode.outerHTML}}re.blotName="table-col",re.tagName="COL";class ne extends W{}ne.blotName="table-colgroup",ne.tagName="COLGROUP";class ie extends W{colgroup(){const[e]=this.descendant(ne);return e||this.findChild("table-colgroup")}deleteColumn(e,r,n,i=[]){const l=this.tbody(),o=this.descendants(Z);if(null!=l&&null!=l.children.head)if(r.length===o.length)n();else{for(const[r,n]of e)this.setCellColspan(t().find(r),n);for(const e of[...r,...i])1===e.parentElement.children.length&&this.setCellRowspan(e.parentElement.previousElementSibling),e.remove()}}deleteRow(e,t){const r=this.tbody();if(null!=r&&null!=r.children.head)if(e.length===r.children.length)t();else{const t=new WeakMap,n=[],i=[],l=this.getMaxColumns(r.children.head.children);for(const r of e){const n=this.getCorrectRow(r,l);n&&n.children.forEach((r=>{var n;const l=~~r.domNode.getAttribute("rowspan")||1;if(l>1){const o=r.statics.blotName,[s]=N(r);if(e.includes(r.parent)){const e=null===(n=r.parent)||void 0===n?void 0:n.next;if(t.has(r)){const{rowspan:n}=t.get(r);t.set(r,{next:e,rowspan:n-1})}else t.set(r,{next:e,rowspan:l-1}),i.push(r)}else r.replaceWith(o,Object.assign(Object.assign({},s),{rowspan:l-1}))}}))}for(const e of i){const[r]=N(e),{right:i,width:l}=e.domNode.getBoundingClientRect(),{next:o,rowspan:s}=t.get(e);this.setColumnCells(o,n,{position:i,width:l},r,s,e)}for(const[e,t,r,i]of n){const n=this.scroll.create(Z.blotName,t);i.moveChildren(n);const l=le();n.setChildrenId(l),e.insertBefore(n,r),i.remove()}for(const t of e)t.remove()}}deleteTable(){this.remove()}findChild(e){let t=this.children.head;for(;t;){if(t.statics.blotName===e)return t;t=t.next}return null}getCopyTable(e=this.domNode.outerHTML){return e.replace(/<temporary[^>]*>(.*?)<\/temporary>/gi,"").replace(/<td[^>]*>(.*?)<\/td>/gi,(e=>E(e)))}getCorrectRow(e,t){let r=!1;for(;e&&!r;){if(t===this.getMaxColumns(e.children))return r=!0,e;e=e.prev}return e}getInsertRow(e,t,r,n){const i=this.tbody(),l=this.thead();if(!(null!=i&&null!=i.children.head||null!=l&&null!=l.children.head))return;const o=oe(),s=n?X.blotName:J.blotName,a=this.scroll.create(s),c=this.getMaxColumns((i||l).children.head.children);return this.getMaxColumns(e.children)===c?(e.children.forEach((e=>{const t={height:"24","data-row":o},r=~~e.domNode.getAttribute("colspan")||1;this.insertTableCell(r,t,a,n)})),a):(this.getCorrectRow(e.prev,c).children.forEach((e=>{const i={height:"24","data-row":o},l=~~e.domNode.getAttribute("colspan")||1,s=~~e.domNode.getAttribute("rowspan")||1;if(s>1)if(r>0&&!t)this.insertTableCell(l,i,a,n);else{const[t]=N(e);e.replaceWith(e.statics.blotName,Object.assign(Object.assign({},t),{rowspan:s+1}))}else this.insertTableCell(l,i,a,n)})),a)}getMaxColumns(e){return e.reduce(((e,t)=>e+(~~t.domNode.getAttribute("colspan")||1)),0)}insertColumn(e,t,r,n){const i=this.colgroup(),l=this.tbody(),o=this.thead();if(!(null!=l&&null!=l.children.head||null!=o&&null!=o.children.head))return;const s=[],a=[],c=this.descendants(J);for(const i of c)if(t&&n>0){const e=i.children.tail.domNode.getAttribute("data-row");s.push([i,e,null,null])}else this.setColumnCells(i,s,{position:e,width:r});if(i)if(t)a.push([i,null]);else{let t=0,r=0,n=i.children.head;for(;n;){const{left:l,width:o}=n.domNode.getBoundingClientRect();if(t=t||l,r=t+o,Math.abs(t-e)<=2){a.push([i,n]);break}if(Math.abs(r-e)<=2&&!n.next){a.push([i,null]);break}t+=o,n=n.next}}for(const[e,t,r]of s)e?this.insertColumnCell(e,t,r):this.setCellColspan(r,1);for(const[e,t]of a)this.insertCol(e,t)}insertCol(e,t){const r=this.scroll.create(re.blotName,{width:"72"});e.insertBefore(r,t)}insertColumnCell(e,t,r){if(!e){const t=this.tbody();e=this.scroll.create(J.blotName),t.insertBefore(e,null)}const n=this.colgroup()?{"data-row":t}:{"data-row":t,width:"72"},i=e.statics.blotName===J.blotName,l=i?Z.blotName:Y.blotName,o=i?$.blotName:K.blotName,s=this.scroll.create(l,n),a=this.scroll.create(o,le());return s.appendChild(a),e.insertBefore(s,r),a.optimize(),s}insertRow(e,t,r){const n=this.tbody(),i=this.thead();if(!(null!=n&&null!=n.children.head||null!=i&&null!=i.children.head))return;const l=r?i:n,o=r?i.children.at(e):n.children.at(e),s=o||n.children.at(e-1),a=this.getInsertRow(s,o,t,r);l.insertBefore(a,o)}insertTableCell(e,t,r,n){e>1?Object.assign(t,{colspan:e}):delete t.colspan;const i=n?Y.blotName:Z.blotName,l=n?K.blotName:$.blotName,o=this.scroll.create(i,t),s=this.scroll.create(l,le());o.appendChild(s),r.appendChild(o),s.optimize()}isPercent(){const e=this.domNode.getAttribute("width")||this.domNode.style.getPropertyValue("width");return!!e&&e.endsWith("%")}optimize(e){super.optimize(e);const t=this.descendants(te);if(this.setClassName(t),t.length>1){t.shift();for(const e of t)e.remove()}}setCellColspan(e,t){const r=e.statics.blotName,n=e.formats()[r],i=(~~n.colspan||1)+t;i>1?Object.assign(n,{colspan:i}):delete n.colspan,e.replaceWith(r,n)}setCellRowspan(e){for(;e;){const r=e.querySelectorAll("td[rowspan]");if(r.length){for(const e of r){const r=t().find(e),n=r.statics.blotName,i=r.formats()[n],l=(~~i.rowspan||1)-1,o=_(r);l>1?Object.assign(i,{rowspan:l}):delete i.rowspan,o.format(n,i)}break}e=e.previousElementSibling}}setClassName(e){const t=this.statics.defaultClassName,r=e[0],n=this.domNode.getAttribute("class"),i=(e,r)=>{const n=e.domNode.getAttribute("data-class");n!==r&&null!=r&&e.domNode.setAttribute("data-class",(e=>{const r=(e||"").split(/\s+/);return r.find((e=>e===t))||r.unshift(t),r.join(" ").trim()})(r)),r||n||e.domNode.setAttribute("data-class",t)};if(r)i(r,n);else{const e=this.prev;if(!e)return;const[t]=e.descendant(Z),[r]=e.descendant(te);!t&&r&&i(r,n)}}setColumnCells(e,t,r,n,i,l){if(!e)return;const{position:o,width:s}=r;let a=e.children.head;for(;a;){const{left:r,right:c}=a.domNode.getBoundingClientRect(),d=a.domNode.getAttribute("data-row");"object"==typeof n&&Object.assign(n,{rowspan:i,"data-row":d});const u=n||d;if(Math.abs(r-o)<=2){t.push([e,u,a,l]);break}if(Math.abs(c-o)<=2&&!a.next){t.push([e,u,null,l]);break}if(Math.abs(r-o-s)<=2){t.push([e,u,a,l]);break}if(o>r&&o<c){t.push([null,u,a,l]);break}a=a.next}}tbody(){const[e]=this.descendant(Q);return e||this.findChild("table-body")}temporary(){const[e]=this.descendant(te);return e}thead(){const[e]=this.descendant(ee);return e||this.findChild("table-thead")}}function le(){return`cell-${Math.random().toString(36).slice(2,6)}`}function oe(){return`row-${Math.random().toString(36).slice(2,6)}`}ie.blotName="table-container",ie.defaultClassName="ql-table-better",ie.tagName="TABLE",ie.allowedChildren=[Q,ee,te,ne],Q.requiredContainer=ie,ee.requiredContainer=ie,te.requiredContainer=ie,ne.requiredContainer=ie,Q.allowedChildren=[J],J.requiredContainer=Q,ee.allowedChildren=[X],X.requiredContainer=ee,ne.allowedChildren=[re],re.requiredContainer=ne,J.allowedChildren=[Z],Z.requiredContainer=J,X.allowedChildren=[Y],Y.requiredContainer=X,Z.allowedChildren=[$,C,m],$.requiredContainer=Z,C.requiredContainer=Z,m.requiredContainer=Z;var se=n(930),ae=n.n(se);const ce=["border","cellspacing","style","class"];function de(e,t,r){return"object"==typeof t?Object.keys(t).reduce(((e,r)=>de(e,r,t[r])),e):e.reduce(((e,n)=>n.attributes&&n.attributes[t]?e.push(n):e.insert(n.insert,ae()({},{[t]:r},n.attributes))),new(l()))}function ue(e,t){const r=e.querySelectorAll("th"),n=(null==r?void 0:r.length)?"table-th":"table-cell",i="TABLE"===e.parentNode.tagName?e.parentNode:e.parentNode.parentNode,o=Array.from(i.querySelectorAll("tr")).indexOf(e)+1;return e.innerHTML.replace(/\s/g,"")?de(t,n,o):new(l())}function he(e,t){var r;const n=e.tagName,i="TD"===n,l=i?"table-cell":"table-th",o=i?"table-cell-block":"table-th-block",s="TABLE"===e.parentNode.parentNode.tagName?e.parentNode.parentNode:e.parentNode.parentNode.parentNode,a=Array.from(s.querySelectorAll("tr")),c=Array.from(e.parentNode.querySelectorAll(n)),d=e.getAttribute("data-row")||a.indexOf(e.parentNode)+1,u=(null===(r=null==e?void 0:e.firstElementChild)||void 0===r?void 0:r.getAttribute("data-cell"))||c.indexOf(e)+1;return t.length()||t.insert("\n",{[l]:{"data-row":d}}),t.ops.forEach((e=>{e.attributes&&e.attributes[l]&&(e.attributes[l]=Object.assign(Object.assign({},e.attributes[l]),{"data-row":d}))})),de(function(e,t){return"TH"===e.tagName&&t.ops.forEach((e=>{"string"!=typeof e.insert||e.insert.endsWith("\n")||(e.insert+="\n")})),t}(e,t),o,u)}function pe(e,t){let r=~~e.getAttribute("span")||1;const n=e.getAttribute("width"),i=new(l());for(;r>1;)i.insert("\n",{"table-col":{width:n}}),r--;return i.concat(t)}function fe(e,t){const r=ce.reduce(((t,r)=>(e.hasAttribute(r)&&("class"===r?t["data-class"]=e.getAttribute(r):t[r]=T(e.getAttribute(r))),t)),{});return(new(l())).insert("\n",{"table-temporary":r}).concat(t)}var ge={col:"Column",insColL:"Insert column left",insColR:"Insert column right",delCol:"Delete column",selCol:"Select column",row:"Row",headerRow:"Header row",insRowAbv:"Insert row above",insRowBlw:"Insert row below",delRow:"Delete row",selRow:"Select row",mCells:"Merge cells",sCell:"Split cell",tblProps:"Table properties",cellProps:"Cell properties",insParaOTbl:"Insert paragraph outside the table",insB4:"Insert before",insAft:"Insert after",copyTable:"Copy table",delTable:"Delete table",border:"Border",color:"Color",width:"Width",background:"Background",dims:"Dimensions",height:"Height",padding:"Padding",tblCellTxtAlm:"Table cell text alignment",alCellTxtL:"Align cell text to the left",alCellTxtC:"Align cell text to the center",alCellTxtR:"Align cell text to the right",jusfCellTxt:"Justify cell text",alCellTxtT:"Align cell text to the top",alCellTxtM:"Align cell text to the middle",alCellTxtB:"Align cell text to the bottom",dimsAlm:"Dimensions and alignment",alTblL:"Align table to the left",tblC:"Center table",alTblR:"Align table to the right",save:"Save",cancel:"Cancel",colorMsg:'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".',dimsMsg:'The value is invalid. Try "10px" or "2em" or "2%" or simply "2".',colorPicker:"Color picker",removeColor:"Remove color",black:"Black",dimGrey:"Dim grey",grey:"Grey",lightGrey:"Light grey",white:"White",red:"Red",orange:"Orange",yellow:"Yellow",lightGreen:"Light green",green:"Green",aquamarine:"Aquamarine",turquoise:"Turquoise",lightBlue:"Light blue",blue:"Blue",purple:"Purple"},be={col:"列",insColL:"向左插入列",insColR:"向右插入列",delCol:"删除列",selCol:"选择列",row:"行",headerRow:"标题行",insRowAbv:"在上面插入行",insRowBlw:"在下面插入行",delRow:"删除行",selRow:"选择行",mCells:"合并单元格",sCell:"拆分单元格",tblProps:"表格属性",cellProps:"单元格属性",insParaOTbl:"在表格外插入段落",insB4:"在表格前面插入",insAft:"在表格后面插入",copyTable:"复制表格",delTable:"删除表格",border:"边框",color:"颜色",width:"宽度",background:"背景",dims:"尺寸",height:"高度",padding:"内边距",tblCellTxtAlm:"单元格文本对齐方式",alCellTxtL:"左对齐",alCellTxtC:"水平居中对齐",alCellTxtR:"右对齐",jusfCellTxt:"两边对齐",alCellTxtT:"顶端对齐",alCellTxtM:"垂直居中对齐",alCellTxtB:"底部对齐",dimsAlm:"尺寸和对齐方式",alTblL:"表格左对齐",tblC:"表格居中",alTblR:"表格右对齐",save:"保存",cancel:"取消",colorMsg:'无效颜色,请使用 "#FF0000" 或者 "rgb(255,0,0)" 或者 "red"',dimsMsg:'无效值,请使用 "10px" 或者 "2em" 或者 "2%" 或者 "2"',colorPicker:"颜色选择器",removeColor:"删除颜色",black:"黑色",dimGrey:"暗灰色",grey:"灰色",lightGrey:"浅灰色",white:"白色",red:"红色",orange:"橙色",yellow:"黄色",lightGreen:"浅绿色",green:"绿色",aquamarine:"海蓝色",turquoise:"青绿色",lightBlue:"浅蓝色",blue:"蓝色",purple:"紫色"},me={col:"Colonne",insColL:"Insérer colonne à gauche",insColR:"Insérer colonne à droite",delCol:"Supprimer la colonne",selCol:"Sélectionner la colonne",row:"Ligne",headerRow:"Ligne d'en-tête",insRowAbv:"Insérer ligne au-dessus",insRowBlw:"Insérer ligne en dessous",delRow:"Supprimer la ligne",selRow:"Sélectionner la ligne",mCells:"Fusionner les cellules",sCell:"Diviser la cellule",tblProps:"Propriétés du tableau",cellProps:"Propriétés de la cellule",insParaOTbl:"Insérer paragraphe en dehors du tableau",insB4:"Insérer avant",insAft:"Insérer après",copyTable:"Copier le tableau",delTable:"Supprimer le tableau",border:"Bordure",color:"Couleur",width:"Largeur",background:"Arrière-plan",dims:"Dimensions",height:"Hauteur",padding:"Marge intérieure",tblCellTxtAlm:"Alignement du texte de la cellule du tableau",alCellTxtL:"Aligner le texte de la cellule à gauche",alCellTxtC:"Aligner le texte de la cellule au centre",alCellTxtR:"Aligner le texte de la cellule à droite",jusfCellTxt:"Justifier le texte de la cellule",alCellTxtT:"Aligner le texte de la cellule en haut",alCellTxtM:"Aligner le texte de la cellule au milieu",alCellTxtB:"Aligner le texte de la cellule en bas",dimsAlm:"Dimensions et alignement",alTblL:"Aligner le tableau à gauche",tblC:"Centrer le tableau",alTblR:"Aligner le tableau à droite",save:"Enregistrer",cancel:"Annuler",colorMsg:'La couleur est invalide. Essayez "#FF0000" ou "rgb(255,0,0)" ou "rouge".',dimsMsg:'La valeur est invalide. Essayez "10px" ou "2em" ou "2%" ou simplement "2".',colorPicker:"Sélecteur de couleur",removeColor:"Supprimer la couleur",black:"Noir",dimGrey:"Gris foncé",grey:"Gris",lightGrey:"Gris clair",white:"Blanc",red:"Rouge",orange:"Orange",yellow:"Jaune",lightGreen:"Vert clair",green:"Vert",aquamarine:"Aigue-marine",turquoise:"Turquoise",lightBlue:"Bleu clair",blue:"Bleu",purple:"Violet"},ve={col:"Kolumna",insColL:"Wstaw kolumnę z lewej",insColR:"Wstaw kolumnę z prawej",delCol:"Usuń kolumnę",selCol:"Wybierz kolumnę",row:"Wiersz",headerRow:"Wiersz nagłówka",insRowAbv:"Wstaw wiersz powyżej",insRowBlw:"Wstaw wiersz poniżej",delRow:"Usuń wiersz",selRow:"Wybierz wiersz",mCells:"Scal komórki",sCell:"Podziel komórkę",tblProps:"Właściwości tabeli",cellProps:"Właściwości komórki",insParaOTbl:"Wstaw akapit poza tabelą",insB4:"Wstaw przed",insAft:"Wstaw po",copyTable:"Kopiuj tabelę",delTable:"Usuń tabelę",border:"Obramowanie",color:"Kolor",width:"Szerokość",background:"Tło",dims:"Wymiary",height:"Wysokość",padding:"Margines wewnętrzny",tblCellTxtAlm:"Wyrównanie tekstu w komórce tabeli",alCellTxtL:"Wyrównaj tekst w komórce do lewej",alCellTxtC:"Wyrównaj tekst w komórce do środka",alCellTxtR:"Wyrównaj tekst w komórce do prawej",jusfCellTxt:"Wyjustuj tekst w komórce",alCellTxtT:"Wyrównaj tekst w komórce do góry",alCellTxtM:"Wyrównaj tekst w komórce do środka",alCellTxtB:"Wyrównaj tekst w komórce do dołu",dimsAlm:"Wymiary i wyrównanie",alTblL:"Wyrównaj tabelę do lewej",tblC:"Wyśrodkuj tabelę",alTblR:"Wyrównaj tabelę do prawej",save:"Zapisz",cancel:"Anuluj",colorMsg:'Kolor jest nieprawidłowy. Spróbuj "#FF0000" lub "rgb(255,0,0)" lub "red".',dimsMsg:'Wartość jest nieprawidłowa. Spróbuj "10px" lub "2em" lub "2%" lub po prostu "2".',colorPicker:"Wybór koloru",removeColor:"Usuń kolor",black:"Czarny",dimGrey:"Przyciemniony szary",grey:"Szary",lightGrey:"Jasnoszary",white:"Biały",red:"Czerwony",orange:"Pomarańczowy",yellow:"Żółty",lightGreen:"Jasnozielony",green:"Zielony",aquamarine:"Akwamaryna",turquoise:"Turkusowy",lightBlue:"Jasnoniebieski",blue:"Niebieski",purple:"Fioletowy"},ye={col:"Spalte",insColL:"Spalte links einfügen",insColR:"Spalte rechts einfügen",delCol:"Spalte löschen",selCol:"Spalte auswählen",row:"Zeile",headerRow:"Kopfzeile",insRowAbv:"Zeile oberhalb einfügen",insRowBlw:"Zeile unterhalb einfügen",delRow:"Zeile löschen",selRow:"Zeile auswählen",mCells:"Zellen verbinden",sCell:"Zelle teilen",tblProps:"Tabelleneingenschaften",cellProps:"Zelleneigenschaften",insParaOTbl:"Absatz außerhalb der Tabelle einfügen",insB4:"Davor einfügen",insAft:"Danach einfügen",copyTable:"Tabelle kopieren",delTable:"Tabelle löschen",border:"Rahmen",color:"Farbe",width:"Breite",background:"Schattierung",dims:"Maße",height:"Höhe",padding:"Abstand",tblCellTxtAlm:"Ausrichtung",alCellTxtL:"Zellentext links ausrichten",alCellTxtC:"Zellentext mittig ausrichten",alCellTxtR:"Zellentext rechts ausrichten",jusfCellTxt:"Zellentext Blocksatz",alCellTxtT:"Zellentext oben ausrichten",alCellTxtM:"Zellentext mittig ausrichten",alCellTxtB:"Zellentext unten ausrichten",dimsAlm:"Maße und Ausrichtung",alTblL:"Tabelle links ausrichten",tblC:"Tabelle mittig ausrichten",alTblR:"Tabelle rechts ausrichten",save:"Speichern",cancel:"Abbrechen",colorMsg:'Die Farbe ist ungültig. Probiere "#FF0000", "rgb(255,0,0)" oder "red".',dimsMsg:'Der Wert ist ungültig. Probiere "10px", "2em" oder "2%" oder einfach "2".',colorPicker:"Farbwähler",removeColor:"Farbe entfernen",black:"Schwarz",dimGrey:"Dunkelgrau",grey:"Grau",lightGrey:"Hellgrau",white:"Weiß",red:"Rot",orange:"Orange",yellow:"Gelb",lightGreen:"Hellgrün",green:"Grün",aquamarine:"Aquamarin",turquoise:"Türkis",lightBlue:"Hellblau",blue:"Blau",purple:"Lila"},we={col:"Столбец",insColL:"Вставить столбец слева",insColR:"Вставить столбец справа",delCol:"Удалить столбец",selCol:"Выбрать столбец",row:"Строка",headerRow:"Строка заголовка",insRowAbv:"Вставить строку сверху",insRowBlw:"Вставить строку снизу",delRow:"Удалить строку",selRow:"Выбрать строку",mCells:"Объединить ячейки",sCell:"Разбить ячейку",tblProps:"Свойства таблицы",cellProps:"Свойства ячейки",insParaOTbl:"Вставить абзац за пределами таблицы",insB4:"Вставить абзац перед",insAft:"Вставить абзац после",copyTable:"Копировать таблицу",delTable:"Удалить таблицу",border:"Обводка",color:"Цвет",width:"Ширина",background:"Фон",dims:"Размеры",height:"Высота",padding:"Отступ",tblCellTxtAlm:"Выравнивание текста в ячейке таблицы",alCellTxtL:"Выровнять текст в ячейке по левому краю",alCellTxtC:"Выровнять текст в ячейке по центру",alCellTxtR:"Выровнять текст в ячейке по правому краю",jusfCellTxt:"Выровнять текст в ячейке по ширине",alCellTxtT:"Выровнять текст в ячейке по верху",alCellTxtM:"Выровнять текст в ячейке по середине",alCellTxtB:"Выровнять текст в ячейке по низу",dimsAlm:"Размеры и выравнивание",alTblL:"Выровнять таблицу по левому краю",tblC:"Центрировать таблицу",alTblR:"Выровнять таблицу по правому краю",save:"Сохранить",cancel:"Отменить",colorMsg:'Неверный цвет. Попробуйте "#FF0000", "rgb(255,0,0)" или "red".',dimsMsg:'Недопустимое значение. Попробуйте "10px", "2em" или "2%" или просто "2".',colorPicker:"Выбор цвета",removeColor:"Удалить цвет",black:"Черный",dimGrey:"Темно-серый",grey:"Серый",lightGrey:"Светло-серый",white:"Белый",red:"Красный",orange:"Оранжевый",yellow:"Желтый",lightGreen:"Светло-зеленый",green:"Зеленый",aquamarine:"Аквамарин",turquoise:"Бирюзовый",lightBlue:"Светло-голубой",blue:"Синий",purple:"Фиолетовый"},Ce={col:"Sütun",insColL:"Sola sütun ekle",insColR:"Sağa sütun ekle",delCol:"Sütunu sil",selCol:"Sütunu seç",row:"Satır",headerRow:"Başlık satırı",insRowAbv:"Üstüne satır ekle",insRowBlw:"Altına satır ekle",delRow:"Satırı sil",selRow:"Satır seç",mCells:"Hücreleri birleştir",sCell:"Hücreyi böl",tblProps:"Tablo özellikleri",cellProps:"Hücre özellikleri",insParaOTbl:"Tablo dışında paragraf ekle",insB4:"Öncesine ekle",insAft:"Sonrasına ekle",copyTable:"Tabloyu kopyala",delTable:"Tabloyu sil",border:"Kenarlık",color:"Renk",width:"Genişlik",background:"Arka plan",dims:"Boyutlar",height:"Yükseklik",padding:"Dolgu",tblCellTxtAlm:"Tablo hücresi metin hizalaması",alCellTxtL:"Hücre metnini sola hizala",alCellTxtC:"Hücre metnini ortaya hizala",alCellTxtR:"Hücre metnini sağa hizala",jusfCellTxt:"Hücre metnini yasla",alCellTxtT:"Hücre metnini üste hizala",alCellTxtM:"Hücre metnini ortaya hizala",alCellTxtB:"Hücre metnini alta hizala",dimsAlm:"Boyutlar ve hizalama",alTblL:"Tabloyu sola hizala",tblC:"Tabloyu ortala",alTblR:"Tabloyu sağa hizala",save:"Kaydet",cancel:"İptal",colorMsg:'Renk geçersiz. "#FF0000", "rgb(255,0,0)" veya "red" deneyin.',dimsMsg:'Değer geçersiz. "10px", "2em" veya "2%" veya sadece "2" deneyin.',colorPicker:"Renk seçici",removeColor:"Rengi kaldır",black:"Siyah",dimGrey:"Koyu gri",grey:"Gri",lightGrey:"Açık gri",white:"Beyaz",red:"Kırmızı",orange:"Turuncu",yellow:"Sarı",lightGreen:"Açık yeşil",green:"Yeşil",aquamarine:"Akuamarin",turquoise:"Turkuaz",lightBlue:"Açık mavi",blue:"Mavi",purple:"Mor"},xe={col:"Coluna",insColL:"Inserir coluna à esquerda",insColR:"Inserir coluna à direita",delCol:"Eliminar coluna",selCol:"Selecionar coluna",row:"Linha",headerRow:"Linha de cabeçalho",insRowAbv:"Inserir linha acima",insRowBlw:"Inserir linha abaixo",delRow:"Eliminar linha",selRow:"Selecionar linha",mCells:"Unir células",sCell:"Dividir célula",tblProps:"Propriedades da tabela",cellProps:"Propriedades da célula",insParaOTbl:"Inserir parágrafo fora da tabela",insB4:"Inserir antes",insAft:"Inserir depois",copyTable:"Copiar tabela",delTable:"Eliminar tabela",border:"Borda",color:"Cor",width:"Largura",background:"Cor de Fundo",dims:"Dimensões",height:"Altura",padding:"Margem interna",tblCellTxtAlm:"Alinhamento do texto",alCellTxtL:"Alinhar texto da célula à esquerda",alCellTxtC:"Alinhar texto da célula ao centro",alCellTxtR:"Alinhar texto da célula à direita",jusfCellTxt:"Justificar texto da célula",alCellTxtT:"Alinhar texto da célula no topo",alCellTxtM:"Alinhar texto da célula ao meio",alCellTxtB:"Alinhar texto da célula na parte inferior",dimsAlm:"Dimensões e alinhamento",alTblL:"Alinhar tabela à esquerda",tblC:"Centrar tabela",alTblR:"Alinhar tabela à direita",save:"Guardar",cancel:"Cancelar",colorMsg:'A cor é inválida. Tente "#FF0000" ou "rgb(255,0,0)" ou "vermelho".',dimsMsg:'O valor é inválido. Tente "10px" ou "2em" ou "2%" ou apenas "2".',colorPicker:"Selecionar cor",removeColor:"Remover cor",black:"Preto",dimGrey:"Cinzento escuro",grey:"Cinzento",lightGrey:"Cinzento claro",white:"Branco",red:"Vermelho",orange:"Laranja",yellow:"Amarelo",lightGreen:"Verde claro",green:"Verde",aquamarine:"Azul marinho",turquoise:"Azul turquesa",lightBlue:"Azul claro",blue:"Azul",purple:"Roxo"},ke={col:"列",insColL:"左に列を挿入",insColR:"右に列を挿入",delCol:"列を削除",selCol:"列を選択",row:"行",headerRow:"ヘッダー行",insRowAbv:"上に行を挿入",insRowBlw:"下に行を挿入",delRow:"行を削除",selRow:"行を選択",mCells:"セルを結合",sCell:"セルを分割",tblProps:"テーブルのプロパティ",cellProps:"セルのプロパティ",insParaOTbl:"テーブル外に段落を挿入",insB4:"前に挿入",insAft:"後に挿入",copyTable:"テーブルをコピー",delTable:"テーブルを削除",border:"枠線",color:"色",width:"幅",background:"背景",dims:"サイズ",height:"高さ",padding:"パディング",tblCellTxtAlm:"セルのテキスト配置",alCellTxtL:"セルのテキストを左揃え",alCellTxtC:"セルのテキストを中央揃え",alCellTxtR:"セルのテキストを右揃え",jusfCellTxt:"セルのテキストを両端揃え",alCellTxtT:"セルのテキストを上揃え",alCellTxtM:"セルのテキストを中央揃え(縦)",alCellTxtB:"セルのテキストを下揃え",dimsAlm:"サイズと配置",alTblL:"テーブルを左揃え",tblC:"テーブルを中央揃え",alTblR:"テーブルを右揃え",save:"保存",cancel:"キャンセル",colorMsg:'色が無効です。"#FF0000"や"rgb(255,0,0)"や"red"を試してください。',dimsMsg:'値が無効です。"10px"や"2em"や"2%"または単に"2"を試してください。',colorPicker:"カラーピッカー",removeColor:"色を削除",black:"黒",dimGrey:"ダークグレー",grey:"グレー",lightGrey:"ライトグレー",white:"白",red:"赤",orange:"オレンジ",yellow:"黄色",lightGreen:"ライトグリーン",green:"緑",aquamarine:"アクアマリン",turquoise:"ターコイズ",lightBlue:"ライトブルー",blue:"青",purple:"紫"},Te={col:"Coluna",insColL:"Inserir coluna à esquerda",insColR:"Inserir coluna à direita",delCol:"Excluir coluna",selCol:"Selecionar coluna",row:"Linha",headerRow:"Linha de título",insRowAbv:"Inserir linha acima",insRowBlw:"Inserir linha abaixo",delRow:"Excluir linha",selRow:"Selecionar linha",mCells:"Mesclar células",sCell:"Dividir célula",tblProps:"Propriedades da tabela",cellProps:"Propriedades da célula",insParaOTbl:"Inserir parágrafo fora da tabela",insB4:"Inserir parágrafo antes",insAft:"Inserir parágrafo depois",copyTable:"Copiar tabela",delTable:"Excluir tabela",border:"Borda",color:"Cor",width:"Largura",background:"Fundo",dims:"Dimensões",height:"Altura",padding:"Espaçamento",tblCellTxtAlm:"Alinhamento do texto da célula",alCellTxtL:"Alinhar texto à esquerda",alCellTxtC:"Centralizar texto",alCellTxtR:"Alinhar texto à direita",jusfCellTxt:"Justificar texto",alCellTxtT:"Alinhar texto ao topo",alCellTxtM:"Alinhar texto ao meio",alCellTxtB:"Alinhar texto à base",dimsAlm:"Dimensões e alinhamento",alTblL:"Alinhar tabela à esquerda",tblC:"Centralizar tabela",alTblR:"Alinhar tabela à direita",save:"Salvar",cancel:"Cancelar",colorMsg:'A cor é inválida. Tente "#FF0000" ou "rgb(255,0,0)" ou "vermelho".',dimsMsg:'O valor é inválido. Tente "10px" ou "2em" ou "2%" ou simplesmente "2".',colorPicker:"Seletor de cor",removeColor:"Remover cor",black:"Preto",dimGrey:"Cinza escuro",grey:"Cinza",lightGrey:"Cinza claro",white:"Branco",red:"Vermelho",orange:"Laranja",yellow:"Amarelo",lightGreen:"Verde claro",green:"Verde",aquamarine:"Água-marinha",turquoise:"Turquesa",lightBlue:"Azul claro",blue:"Azul",purple:"Roxo"},_e={col:"Sloupec",insColL:"Vložit sloupec vlevo",insColR:"Vložit sloupec vpravo",delCol:"Smazat sloupec",selCol:"Vybrat sloupec",row:"Řádek",headerRow:"Řádek záhlaví",insRowAbv:"Vložit řádek nad",insRowBlw:"Vložit řádek pod",delRow:"Smazat řádek",selRow:"Vybrat řádek",mCells:"Sloučit buňky",sCell:"Rozdělit buňku",tblProps:"Vlastnosti tabulky",cellProps:"Vlastnosti buňky",insParaOTbl:"Vložit odstavec mimo tabulku",insB4:"Vložit před",insAft:"Vložit za",copyTable:"Kopírovat tabulku",delTable:"Smazat tabulku",border:"Okraj",color:"Barva",width:"Šířka",background:"Pozadí",dims:"Rozměry",height:"Výška",padding:"Vnitřní okraj",tblCellTxtAlm:"Zarovnání textu v buňce",alCellTxtL:"Zarovnat text vlevo",alCellTxtC:"Zarovnat text na střed",alCellTxtR:"Zarovnat text vpravo",jusfCellTxt:"Zarovnat text do bloku",alCellTxtT:"Zarovnat text nahoru",alCellTxtM:"Zarovnat text na střed (vertikálně)",alCellTxtB:"Zarovnat text dolů",dimsAlm:"Rozměry a zarovnání",alTblL:"Zarovnat tabulku vlevo",tblC:"Zarovnat tabulku na střed",alTblR:"Zarovnat tabulku vpravo",save:"Uložit",cancel:"Zrušit",colorMsg:'Barva je neplatná. Zkuste např. "#FF0000", "rgb(255,0,0)" nebo "red".',dimsMsg:'Hodnota je neplatná. Zkuste "10px", "2em" nebo "2%" nebo jednoduše "2".',colorPicker:"Výběr barvy",removeColor:"Odebrat barvu",black:"Černá",dimGrey:"Tmavě šedá",grey:"Šedá",lightGrey:"Světle šedá",white:"Bílá",red:"Červená",orange:"Oranžová",yellow:"Žlutá",lightGreen:"Světle zelená",green:"Zelená",aquamarine:"Akvamarínová",turquoise:"Tyrkysová",lightBlue:"Světle modrá",blue:"Modrá",purple:"Fialová"},Ne={col:"Kolonne",insColL:"Indsæt kolonne til venstre",insColR:"Indsæt kolonne til højre",delCol:"Slet kolonne",selCol:"Vælg kolonne",row:"Række",headerRow:"Overskriftsrække",insRowAbv:"Indsæt række ovenfor",insRowBlw:"Indsæt række nedenfor",delRow:"Slet række",selRow:"Vælg række",mCells:"Flet celler",sCell:"Opdel celle",tblProps:"Tabellegenskaber",cellProps:"Celleegenskaber",insParaOTbl:"Indsæt afsnit uden for tabellen",insB4:"Indsæt før",insAft:"Indsæt efter",copyTable:"Kopiér tabel",delTable:"Slet tabel",border:"Kant",color:"Farve",width:"Bredde",background:"Baggrund",dims:"Mål",height:"Højde",padding:"Indre afstand",tblCellTxtAlm:"Justering",alCellTxtL:"Venstrejuster celletekst",alCellTxtC:"Centrer celletekst",alCellTxtR:"Højrejuster celletekst",jusfCellTxt:"Juster celletekst",alCellTxtT:"Topjuster celletekst",alCellTxtM:"Centrer celletekst (lodret)",alCellTxtB:"Bundjuster celletekst",dimsAlm:"Mål og justering",alTblL:"Venstrejuster tabel",tblC:"Centrer tabel",alTblR:"Højrejuster tabel",save:"Gem",cancel:"Annuller",colorMsg:'Farven er ugyldig. Prøv "#FF0000", "rgb(255,0,0)" eller "red".',dimsMsg:'Værdien er ugyldig. Prøv "10px", "2em" eller "2%" eller blot "2".',colorPicker:"Farvevælger",removeColor:"Fjern farve",black:"Sort",dimGrey:"Mørkegrå",grey:"Grå",lightGrey:"Lysegrå",white:"Hvid",red:"Rød",orange:"Orange",yellow:"Gul",lightGreen:"Lysegrøn",green:"Grøn",aquamarine:"Akvamarin",turquoise:"Turkis",lightBlue:"Lyseblå",blue:"Blå",purple:"Lilla"},Ae={col:"Kolonne",insColL:"Sett inn kolonne til venstre",insColR:"Sett inn kolonne til høyre",delCol:"Slett kolonne",selCol:"Velg kolonne",row:"Rad",headerRow:"Overskriftsrad",insRowAbv:"Sett inn rad over",insRowBlw:"Sett inn rad under",delRow:"Slett rad",selRow:"Velg rad",mCells:"Slå sammen celler",sCell:"Del celle",tblProps:"Tabellegenskaper",cellProps:"Celleegenskaper",insParaOTbl:"Sett inn avsnitt utenfor tabellen",insB4:"Sett inn før",insAft:"Sett inn etter",copyTable:"Kopier tabell",delTable:"Slett tabell",border:"Ramme",color:"Farge",width:"Bredde",background:"Bakgrunn",dims:"Mål",height:"Høyde",padding:"Polstring",tblCellTxtAlm:"Justering",alCellTxtL:"Venstrejuster celletekst",alCellTxtC:"Sentrer celletekst",alCellTxtR:"Høyrejuster celletekst",jusfCellTxt:"Blokjuster celletekst",alCellTxtT:"Toppjuster celletekst",alCellTxtM:"Sentrer celletekst (loddrett)",alCellTxtB:"Bunnjuster celletekst",dimsAlm:"Mål og justering",alTblL:"Venstrejuster tabell",tblC:"Sentrer tabell",alTblR:"Høyrejuster tabell",save:"Lagre",cancel:"Avbryt",colorMsg:'Fargen er ugyldig. Prøv "#FF0000", "rgb(255,0,0)" eller "red".',dimsMsg:'Verdien er ugyldig. Prøv "10px", "2em" eller "2%" eller bare "2".',colorPicker:"Fargevelger",removeColor:"Fjern farge",black:"Svart",dimGrey:"Mørkegrå",grey:"Grå",lightGrey:"Lysegrå",white:"Hvit",red:"Rød",orange:"Oransje",yellow:"Gul",lightGreen:"Lysegrønn",green:"Grønn",aquamarine:"Akvamarin",turquoise:"Turkis",lightBlue:"Lyseblå",blue:"Blå",purple:"Lilla"},Le={col:"Colonna",insColL:"Inserisci colonna a sinistra",insColR:"Inserisci colonna a destra",delCol:"Elimina colonna",selCol:"Seleziona colonna",row:"Riga",headerRow:"Riga di intestazione",insRowAbv:"Inserisci riga sopra",insRowBlw:"Inserisci riga sotto",delRow:"Elimina riga",selRow:"Seleziona riga",mCells:"Unisci celle",sCell:"Dividi cella",tblProps:"Proprietà tabella",cellProps:"Proprietà cella",insParaOTbl:"Inserisci paragrafo fuori dalla tabella",insB4:"Inserisci prima",insAft:"Inserisci dopo",copyTable:"Copia tabella",delTable:"Elimina tabella",border:"Bordo",color:"Colore",width:"Larghezza",background:"Sfondo",dims:"Dimensioni",height:"Altezza",padding:"Spaziatura interna",tblCellTxtAlm:"Allineamento testo cella",alCellTxtL:"Allinea testo cella a sinistra",alCellTxtC:"Allinea testo cella al centro",alCellTxtR:"Allinea testo cella a destra",jusfCellTxt:"Giustifica testo cella",alCellTxtT:"Allinea testo cella in alto",alCellTxtM:"Allinea testo cella al centro verticale",alCellTxtB:"Allinea testo cella in basso",dimsAlm:"Dimensioni e allineamento",alTblL:"Allinea tabella a sinistra",tblC:"Centra tabella",alTblR:"Allinea tabella a destra",save:"Salva",cancel:"Annulla",colorMsg:'Il colore non è valido. Prova con "#FF0000", "rgb(255,0,0)" o "red".',dimsMsg:'Il valore non è valido. Prova con "10px", "2em", "2%" oppure semplicemente "2".',colorPicker:"Selettore colore",removeColor:"Rimuovi colore",black:"Nero",dimGrey:"Grigio scuro",grey:"Grigio",lightGrey:"Grigio chiaro",white:"Bianco",red:"Rosso",orange:"Arancione",yellow:"Giallo",lightGreen:"Verde chiaro",green:"Verde",aquamarine:"Acquamarina",turquoise:"Turchese",lightBlue:"Azzurro",blue:"Blu",purple:"Viola"},Se={col:"Kolumn",insColL:"Infoga kolumn till vänster",insColR:"Infoga kolumn till höger",delCol:"Ta bort kolumn",selCol:"Markera kolumn",row:"Rad",headerRow:"Rubrikrad",insRowAbv:"Infoga rad ovanför",insRowBlw:"Infoga rad nedanför",delRow:"Ta bort rad",selRow:"Markera rad",mCells:"Sammanfoga celler",sCell:"Dela cell",tblProps:"Tabellinställningar",cellProps:"Cellinställningar",insParaOTbl:"Infoga stycke utanför tabellen",insB4:"Infoga före",insAft:"Infoga efter",copyTable:"Kopiera tabell",delTable:"Ta bort tabell",border:"Kant",color:"Färg",width:"Bredd",background:"Bakgrund",dims:"Dimensioner",height:"Höjd",padding:"Inre avstånd",tblCellTxtAlm:"Cellens textjustering",alCellTxtL:"Justera text vänster",alCellTxtC:"Centrera text",alCellTxtR:"Justera text höger",jusfCellTxt:"Justera text",alCellTxtT:"Justera text upptill",alCellTxtM:"Justera text i mitten",alCellTxtB:"Justera text nederst",dimsAlm:"Dimensioner och justering",alTblL:"Justera tabell vänster",tblC:"Centrera tabell",alTblR:"Justera tabell höger",save:"Spara",cancel:"Avbryt",colorMsg:'Färgen är ogiltig. Testa "#FF0000" eller "rgb(255,0,0)" eller "red".',dimsMsg:'Värdet är ogiltigt. Testa "10px", "2em", "2%" eller bara "2".',colorPicker:"Färgval",removeColor:"Ta bort färg",black:"Svart",dimGrey:"Mörkgrå",grey:"Grå",lightGrey:"Ljusgrå",white:"Vit",red:"Röd",orange:"Orange",yellow:"Gul",lightGreen:"Ljusgrön",green:"Grön",aquamarine:"Akvamarin",turquoise:"Turkos",lightBlue:"Ljusblå",blue:"Blå",purple:"Lila"},je={col:"欄",insColL:"向左插入欄",insColR:"向右插入欄",delCol:"刪除欄",selCol:"選取欄",row:"列",headerRow:"標題列",insRowAbv:"在上方插入列",insRowBlw:"在下方插入列",delRow:"刪除列",selRow:"選取列",mCells:"合併儲存格",sCell:"拆分儲存格",tblProps:"表格屬性",cellProps:"儲存格屬性",insParaOTbl:"在表格外插入段落",insB4:"在表格前插入",insAft:"在表格後插入",copyTable:"複製表格",delTable:"刪除表格",border:"邊框",color:"顏色",width:"寬度",background:"背景",dims:"尺寸",height:"高度",padding:"內距",tblCellTxtAlm:"儲存格文字對齊方式",alCellTxtL:"左對齊",alCellTxtC:"水平置中",alCellTxtR:"右對齊",jusfCellTxt:"左右對齊",alCellTxtT:"頂端對齊",alCellTxtM:"垂直置中",alCellTxtB:"底部對齊",dimsAlm:"尺寸與對齊方式",alTblL:"表格左對齊",tblC:"表格置中",alTblR:"表格右對齊",save:"儲存",cancel:"取消",colorMsg:'無效的顏色,請使用 "#FF0000"、"rgb(255,0,0)" 或 "red"',dimsMsg:'無效的值,請使用 "10px"、"2em"、"2%" 或 "2"',colorPicker:"顏色選擇器",removeColor:"移除顏色",black:"黑色",dimGrey:"深灰色",grey:"灰色",lightGrey:"淺灰色",white:"白色",red:"紅色",orange:"橘色",yellow:"黃色",lightGreen:"淺綠色",green:"綠色",aquamarine:"海藍色",turquoise:"青綠色",lightBlue:"淺藍色",blue:"藍色",purple:"紫色"},qe=class{constructor(e){this.config={en_US:ge,zh_CN:be,fr_FR:me,pl_PL:ve,de_DE:ye,ru_RU:we,tr_TR:Ce,pt_PT:xe,ja_JP:ke,pt_BR:Te,cs_CZ:_e,da_DK:Ne,nb_NO:Ae,it_IT:Le,sv_SE:Se,zh_TW:je},this.init(e)}changeLanguage(e){this.name=e}init(e){if(void 0===e||"string"==typeof e)this.changeLanguage(e||"en_US");else{const{name:t,content:r}=e;r&&this.registry(t,r),t&&this.changeLanguage(t)}}registry(e,t){this.config=Object.assign(Object.assign({},this.config),{[e]:t})}useLanguage(e){return this.config[this.name][e]}},Ee=(e=>(e[e.TYPE=3]="TYPE",e[e.LEVEL=12]="LEVEL",e[e.ATTRIBUTE=13]="ATTRIBUTE",e[e.BLOT=14]="BLOT",e[e.INLINE=7]="INLINE",e[e.BLOCK=11]="BLOCK",e[e.BLOCK_BLOT=10]="BLOCK_BLOT",e[e.INLINE_BLOT=6]="INLINE_BLOT",e[e.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",e[e.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",e[e.ANY=15]="ANY",e))(Ee||{});class Me{constructor(e,t,r={}){this.attrName=e,this.keyName=t;const n=Ee.TYPE&Ee.ATTRIBUTE;this.scope=null!=r.scope?r.scope&Ee.LEVEL|n:Ee.ATTRIBUTE,null!=r.whitelist&&(this.whitelist=r.whitelist)}static keys(e){return Array.from(e.attributes).map((e=>e.name))}add(e,t){return!!this.canAdd(e,t)&&(e.setAttribute(this.keyName,t),!0)}canAdd(e,t){return null==this.whitelist||("string"==typeof t?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1)}remove(e){e.removeAttribute(this.keyName)}value(e){const t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}}class Be extends Error{constructor(e){super(e="[Parchment] "+e),this.message=e,this.name=this.constructor.name}}const Re=class e{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(null==e)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let r=null;try{r=e.parentNode}catch{return null}return this.find(r,t)}return null}create(t,r,n){const i=this.query(r);if(null==i)throw new Be(`Unable to create ${r} blot`);const l=i,o=r instanceof Node||r.nodeType===Node.TEXT_NODE?r:l.create(n),s=new l(t,o,n);return e.blots.set(s.domNode,s),s}find(t,r=!1){return e.find(t,r)}query(e,t=Ee.ANY){let r;return"string"==typeof e?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:"number"==typeof e?e&Ee.LEVEL&Ee.BLOCK?r=this.types.block:e&Ee.LEVEL&Ee.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some((e=>(r=this.classes[e],!!r))),r=r||this.tags[e.tagName]),null==r?null:"scope"in r&&t&Ee.LEVEL&r.scope&&t&Ee.TYPE&r.scope?r:null}register(...e){return e.map((e=>{const t="blotName"in e,r="attrName"in e;if(!t&&!r)throw new Be("Invalid definition");if(t&&"abstract"===e.blotName)throw new Be("Cannot register abstract class");const n=t?e.blotName:r?e.attrName:void 0;return this.types[n]=e,r?"string"==typeof e.keyName&&(this.attributes[e.keyName]=e):t&&(e.className&&(this.classes[e.className]=e),e.tagName&&(Array.isArray(e.tagName)?e.tagName=e.tagName.map((e=>e.toUpperCase())):e.tagName=e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach((t=>{(null==this.tags[t]||null==e.className)&&(this.tags[t]=e)})))),e}))}};Re.blots=new WeakMap;let Oe=Re;function Pe(e,t){return(e.getAttribute("class")||"").split(/\s+/).filter((e=>0===e.indexOf(`${t}-`)))}const Ie=class extends Me{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map((e=>e.split("-").slice(0,-1).join("-")))}add(e,t){return!!this.canAdd(e,t)&&(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0)}remove(e){Pe(e,this.keyName).forEach((t=>{e.classList.remove(t)})),0===e.classList.length&&e.removeAttribute("class")}value(e){const t=(Pe(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}};function ze(e){const t=e.split("-"),r=t.slice(1).map((e=>e[0].toUpperCase()+e.slice(1))).join("");return t[0]+r}const De=class extends Me{static keys(e){return(e.getAttribute("style")||"").split(";").map((e=>e.split(":")[0].trim()))}add(e,t){return!!this.canAdd(e,t)&&(e.style[ze(this.keyName)]=t,!0)}remove(e){e.style[ze(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[ze(this.keyName)];return this.canAdd(e,t)?t:""}},He=class{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(null!=e.value(this.domNode)?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=Oe.find(this.domNode);if(null==e)return;const t=Me.keys(this.domNode),r=Ie.keys(this.domNode),n=De.keys(this.domNode);t.concat(r).concat(n).forEach((t=>{const r=e.scroll.query(t,Ee.ATTRIBUTE);r instanceof Me&&(this.attributes[r.attrName]=r)}))}copy(e){Object.keys(this.attributes).forEach((t=>{const r=this.attributes[t].value(this.domNode);e.format(t,r)}))}move(e){this.copy(e),Object.keys(this.attributes).forEach((e=>{this.attributes[e].remove(this.domNode)})),this.attributes={}}values(){return Object.keys(this.attributes).reduce(((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e)),{})}},Fe=class{constructor(e,t){this.scroll=e,this.domNode=t,Oe.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(null==this.tagName)throw new Be("Blot definition missing tagName");let t,r;return Array.isArray(this.tagName)?("string"==typeof e?(r=e.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):"number"==typeof e&&(r=e),t="number"==typeof r?document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?document.createElement(r):document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){null!=this.parent&&this.parent.removeChild(this),Oe.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,r,n){const i=this.isolate(e,t);if(null!=this.scroll.query(r,Ee.BLOT)&&n)i.wrap(r,n);else if(null!=this.scroll.query(r,Ee.ATTRIBUTE)){const e=this.scroll.create(this.statics.scope);i.wrap(e),e.format(r,n)}}insertAt(e,t,r){const n=null==r?this.scroll.create("text",t):this.scroll.create(t,r),i=this.split(e);this.parent.insertBefore(n,i||void 0)}isolate(e,t){const r=this.split(e);if(null==r)throw new Error("Attempt to isolate at end");return r.split(t),r}length(){return 1}offset(e=this.parent){return null==this.parent||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,t){const r="string"==typeof e?this.scroll.create(e,t):e;return null!=this.parent&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,t){return 0===e?this:this.next}update(e,t){}wrap(e,t){const r="string"==typeof e?this.scroll.create(e,t):e;if(null!=this.parent&&this.parent.insertBefore(r,this.next||void 0),"function"!=typeof r.appendChild)throw new Be(`Cannot wrap ${e}`);return r.appendChild(this),r}};Fe.blotName="abstract";let Ve=Fe;const We=class extends Ve{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};We.scope=Ee.INLINE_BLOT;const Ue=We;class Ge{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let r=t();for(;r&&e>0;)e-=1,r=t();return r}contains(e){const t=this.iterator();let r=t();for(;r;){if(r===e)return!0;r=t()}return!1}indexOf(e){const t=this.iterator();let r=t(),n=0;for(;r;){if(r===e)return n;n+=1,r=t()}return-1}insertBefore(e,t){null!=e&&(this.remove(e),e.next=t,null!=t?(e.prev=t.prev,null!=t.prev&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):null!=this.tail?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let t=0,r=this.head;for(;null!=r;){if(r===e)return t;t+=r.length(),r=r.next}return-1}remove(e){this.contains(e)&&(null!=e.prev&&(e.prev.next=e.next),null!=e.next&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const t=e;return null!=e&&(e=e.next),t}}find(e,t=!1){const r=this.iterator();let n=r();for(;n;){const i=n.length();if(e<i||t&&e===i&&(null==n.next||0!==n.next.length()))return[n,e];e-=i,n=r()}return[null,0]}forEach(e){const t=this.iterator();let r=t();for(;r;)e(r),r=t()}forEachAt(e,t,r){if(t<=0)return;const[n,i]=this.find(e);let l=e-i;const o=this.iterator(n);let s=o();for(;s&&l<e+t;){const n=s.length();e>l?r(s,e-l,Math.min(t,l+n-e)):r(s,0,Math.min(n,e+t-l)),l+=n,s=o()}}map(e){return this.reduce(((t,r)=>(t.push(e(r)),t)),[])}reduce(e,t){const r=this.iterator();let n=r();for(;n;)t=e(t,n),n=r();return t}}function $e(e,t){const r=t.find(e);if(r)return r;try{return t.create(e)}catch{const r=t.create(Ee.INLINE);return Array.from(e.childNodes).forEach((e=>{r.domNode.appendChild(e)})),e.parentNode&&e.parentNode.replaceChild(r.domNode,e),r.attach(),r}}const Ke=class e extends Ve{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach((e=>{e.attach()}))}attachUI(t){null!=this.uiNode&&this.uiNode.remove(),this.uiNode=t,e.uiClass&&this.uiNode.classList.add(e.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new Ge,Array.from(this.domNode.childNodes).filter((e=>e!==this.uiNode)).reverse().forEach((e=>{try{const t=$e(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(e){if(e instanceof Be)return;throw e}}))}deleteAt(e,t){if(0===e&&t===this.length())return this.remove();this.children.forEachAt(e,t,((e,t,r)=>{e.deleteAt(t,r)}))}descendant(t,r=0){const[n,i]=this.children.find(r);return null==t.blotName&&t(n)||null!=t.blotName&&n instanceof t?[n,i]:n instanceof e?n.descendant(t,i):[null,-1]}descendants(t,r=0,n=Number.MAX_VALUE){let i=[],l=n;return this.children.forEachAt(r,n,((r,n,o)=>{(null==t.blotName&&t(r)||null!=t.blotName&&r instanceof t)&&i.push(r),r instanceof e&&(i=i.concat(r.descendants(t,n,l))),l-=o})),i}detach(){this.children.forEach((e=>{e.detach()})),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach((r=>{t||this.statics.allowedChildren.some((e=>r instanceof e))||(r.statics.scope===Ee.BLOCK_BLOT?(null!=r.next&&this.splitAfter(r),null!=r.prev&&this.splitAfter(r.prev),r.parent.unwrap(),t=!0):r instanceof e?r.unwrap():r.remove())}))}formatAt(e,t,r,n){this.children.forEachAt(e,t,((e,t,i)=>{e.formatAt(t,i,r,n)}))}insertAt(e,t,r){const[n,i]=this.children.find(e);if(n)n.insertAt(i,t,r);else{const e=null==r?this.scroll.create("text",t):this.scroll.create(t,r);this.appendChild(e)}}insertBefore(e,t){null!=e.parent&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,t||null),e.parent=this,null!=t&&(r=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce(((e,t)=>e+t.length()),0)}moveChildren(e,t){this.children.forEach((r=>{e.insertBefore(r,t)}))}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e)}else this.remove()}path(t,r=!1){const[n,i]=this.children.find(t,r),l=[[this,t]];return n instanceof e?l.concat(n.path(i,r)):(null!=n&&l.push([n,i]),l)}removeChild(e){this.children.remove(e)}replaceWith(t,r){const n="string"==typeof t?this.scroll.create(t,r):t;return n instanceof e&&this.moveChildren(n),super.replaceWith(n)}split(e,t=!1){if(!t){if(0===e)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),((e,n,i)=>{const l=e.split(n,t);null!=l&&r.appendChild(l)})),r}splitAfter(e){const t=this.clone();for(;null!=e.next;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){const r=[],n=[];e.forEach((e=>{e.target===this.domNode&&"childList"===e.type&&(r.push(...e.addedNodes),n.push(...e.removedNodes))})),n.forEach((e=>{if(null!=e.parentNode&&"IFRAME"!==e.tagName&&document.body.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const t=this.scroll.find(e);null!=t&&(null==t.domNode.parentNode||t.domNode.parentNode===this.domNode)&&t.detach()})),r.filter((e=>e.parentNode===this.domNode&&e!==this.uiNode)).sort(((e,t)=>e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1)).forEach((e=>{let t=null;null!=e.nextSibling&&(t=this.scroll.find(e.nextSibling));const r=$e(e,this.scroll);(r.next!==t||null==r.next)&&(null!=r.parent&&r.parent.removeChild(this),this.insertBefore(r,t||void 0))})),this.enforceAllowedChildren()}};Ke.uiClass="";const Ze=Ke,Ye=class e extends Ze{static create(e){return super.create(e)}static formats(t,r){const n=r.query(e.blotName);if(null==n||t.tagName!==n.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new He(this.domNode)}format(t,r){if(t!==this.statics.blotName||r){const e=this.scroll.query(t,Ee.INLINE);if(null==e)return;e instanceof Me?this.attributes.attribute(e,r):r&&(t!==this.statics.blotName||this.formats()[t]!==r)&&this.replaceWith(t,r)}else this.children.forEach((t=>{t instanceof e||(t=t.wrap(e.blotName,!0)),this.attributes.copy(t)})),this.unwrap()}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return null!=t&&(e[this.statics.blotName]=t),e}formatAt(e,t,r,n){null!=this.formats()[r]||this.scroll.query(r,Ee.ATTRIBUTE)?this.isolate(e,t).format(r,n):super.formatAt(e,t,r,n)}optimize(t){super.optimize(t);const r=this.formats();if(0===Object.keys(r).length)return this.unwrap();const n=this.next;n instanceof e&&n.prev===this&&function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}(r,n.formats())&&(n.moveChildren(this),n.remove())}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some((e=>e.target===this.domNode&&"attributes"===e.type))&&this.attributes.build()}wrap(t,r){const n=super.wrap(t,r);return n instanceof e&&this.attributes.move(n),n}};Ye.allowedChildren=[Ye,Ue],Ye.blotName="inline",Ye.scope=Ee.INLINE_BLOT,Ye.tagName="SPAN";const Je=Ye,Xe=class e extends Ze{static create(e){return super.create(e)}static formats(t,r){const n=r.query(e.blotName);if(null==n||t.tagName!==n.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new He(this.domNode)}format(t,r){const n=this.scroll.query(t,Ee.BLOCK);null!=n&&(n instanceof Me?this.attributes.attribute(n,r):t!==this.statics.blotName||r?r&&(t!==this.statics.blotName||this.formats()[t]!==r)&&this.replaceWith(t,r):this.replaceWith(e.blotName))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return null!=t&&(e[this.statics.blotName]=t),e}formatAt(e,t,r,n){null!=this.scroll.query(r,Ee.BLOCK)?this.format(r,n):super.formatAt(e,t,r,n)}insertAt(e,t,r){if(null==r||null!=this.scroll.query(t,Ee.INLINE))super.insertAt(e,t,r);else{const n=this.split(e);if(null==n)throw new Error("Attempt to insertAt after block boundaries");{const e=this.scroll.create(t,r);n.parent.insertBefore(e,n)}}}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some((e=>e.target===this.domNode&&"attributes"===e.type))&&this.attributes.build()}};Xe.blotName="block",Xe.scope=Ee.BLOCK_BLOT,Xe.tagName="P",Xe.allowedChildren=[Je,Xe,Ue];const Qe=Xe,et=class extends Ze{checkMerge(){return null!==this.next&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,r,n){super.formatAt(e,t,r,n),this.enforceAllowedChildren()}insertAt(e,t,r){super.insertAt(e,t,r),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};et.blotName="container",et.scope=Ee.BLOCK_BLOT;const tt=et,rt=class extends Ue{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,r,n){0===e&&t===this.length()?this.format(r,n):super.formatAt(e,t,r,n)}formats(){return this.statics.formats(this.domNode,this.scroll)}},nt={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},it=class extends Ze{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver((e=>{this.update(e)})),this.observer.observe(this.domNode,nt),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const r=this.registry.find(e,t);return r?r.scroll===this?r:t?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,t=Ee.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){null!=this.scroll&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),0===e&&t===this.length()?this.children.forEach((e=>{e.remove()})):super.deleteAt(e,t)}formatAt(e,t,r,n){this.update(),super.formatAt(e,t,r,n)}insertAt(e,t,r){this.update(),super.insertAt(e,t,r)}optimize(e=[],t={}){super.optimize(t);const r=t.mutationsMap||new WeakMap;let n=Array.from(this.observer.takeRecords());for(;n.length>0;)e.push(n.pop());const i=(e,t=!0)=>{null==e||e===this||null!=e.domNode.parentNode&&(r.has(e.domNode)||r.set(e.domNode,[]),t&&i(e.parent))},l=e=>{r.has(e.domNode)&&(e instanceof Ze&&e.children.forEach(l),r.delete(e.domNode),e.optimize(t))};let o=e;for(let t=0;o.length>0;t+=1){if(t>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(o.forEach((e=>{const t=this.find(e.target,!0);null!=t&&(t.domNode===e.target&&("childList"===e.type?(i(this.find(e.previousSibling,!1)),Array.from(e.addedNodes).forEach((e=>{const t=this.find(e,!1);i(t,!1),t instanceof Ze&&t.children.forEach((e=>{i(e,!1)}))}))):"attributes"===e.type&&i(t.prev)),i(t))})),this.children.forEach(l),o=Array.from(this.observer.takeRecords()),n=o.slice();n.length>0;)e.push(n.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map((e=>{const t=this.find(e.target,!0);return null==t?null:r.has(t.domNode)?(r.get(t.domNode).push(e),null):(r.set(t.domNode,[e]),t)})).forEach((e=>{null!=e&&e!==this&&r.has(e.domNode)&&e.update(r.get(e.domNode)||[],t)})),t.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),t),this.optimize(e,t)}};it.blotName="scroll",it.defaultChild=Qe,it.allowedChildren=[Qe,tt],it.scope=Ee.BLOCK_BLOT,it.tagName="DIV";const lt=class e extends Ue{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,r){null==r?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,r)}length(){return this.text.length}optimize(t){super.optimize(t),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(0===e)return this;if(e===this.length())return this.next}const r=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(e,t){e.some((e=>"characterData"===e.type&&e.target===this.domNode))&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};lt.blotName="text",lt.scope=Ee.INLINE_BLOT;const ot=["bold","italic","underline","strike","size","color","background","font","list","header","align","link","image"],st=["link","image"];var at,ct,dt,ut,ht,pt=class{constructor(e,t){this.quill=e,this.selectedTds=[],this.startTd=null,this.endTd=null,this.disabledList=[],this.singleList=[],this.tableBetter=t,this.quill.root.addEventListener("click",this.handleClick.bind(this)),this.initDocumentListener(),this.initWhiteList()}attach(e){let t=Array.from(e.classList).find((e=>0===e.indexOf("ql-")));if(!t)return;const[r,n]=this.getButtonsWhiteList(),i=this.getCorrectDisabled(e,t);t=t.slice(3),r.includes(t)||this.disabledList.push(...i),n.includes(t)&&this.singleList.push(...i)}clearSelected(){for(const e of this.selectedTds)e.classList&&e.classList.remove("ql-cell-focused","ql-cell-selected");this.selectedTds=[],this.startTd=null,this.endTd=null}exitTableFocus(e,r){const n=B(e).table(),i=r?-1:n.length(),l=n.offset(this.quill.scroll)+i;this.tableBetter.hideTools(),this.quill.setSelection(l,0,t().sources.USER)}getButtonsWhiteList(){const{options:e={}}=this.tableBetter,{toolbarButtons:t={}}=e,{whiteList:r=ot,singleWhiteList:n=st}=t;return[r,n]}getCopyColumns(e){const t=e.querySelector("tr");return Array.from(t.querySelectorAll("td,th")).reduce(((e,t)=>e+(~~t.getAttribute("colspan")||1)),0)}getCopyData(){const e=t().find(this.selectedTds[0]).table();if(e.descendants(Z).length===this.selectedTds.length){const t=e.getCopyTable();return{html:t,text:this.getText(t)}}let r="";const n={};for(const e of this.selectedTds){const t=e.getAttribute("data-row");n[t]||(n[t]=[]),n[t].push(e)}for(const e of Object.values(n)){let t="";for(const r of e)t+=E(r.outerHTML);t=`<tr>${t}</tr>`,r+=t}return r=`<table><tbody>${r}</tbody></table>`,r=e.getCopyTable(r),{html:r,text:this.getText(r)}}getCorrectDisabled(e,t){if("SELECT"!==e.tagName)return[e];const r=e.closest("span.ql-formats");return r?[...r.querySelectorAll(`span.${t}.ql-picker`),e]:[e]}getCorrectRow(e,r){const n="next"===r?0:-1;let i=(~~e.getAttribute("rowspan")||1)+n||1,l=t().find(e).parent;for(;l&&i;)l=l[r],i--;return null==l?void 0:l.domNode}getCorrectValue(e,r){for(const n of this.selectedTds){const i=t().find(n).html()||n.outerHTML,l=this.quill.clipboard.convert({html:i,text:"\n"});for(const t of l.ops)if(!this.isContinue(t)&&(r=this.getListCorrectValue(e,r,null==t?void 0:t.attributes))!=((null==t?void 0:t.attributes)&&(null==t?void 0:t.attributes[e])||!1))return r}return!r}getListCorrectValue(e,t,r={}){return"list"!==e?t:"check"===t?"checked"!==r[e]&&"unchecked"!==r[e]&&"unchecked":t}getPasteComputeBounds(e,t,r){const n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),l=r.domNode.getBoundingClientRect(),o=this.quill.container.getBoundingClientRect(),s=this.quill.container.scrollLeft,a=this.quill.container.scrollTop;return{left:n.left-o.left-s,right:i.right-o.left-s,top:n.top-o.top-a,bottom:l.bottom-o.top-a}}getPasteInfo(e,t,r){let n=0,i=null,l=null,o=e.parentElement;for(;e;){if(n+=~~e.getAttribute("colspan")||1,n>=t){n=t,i=e;break}e=e.nextElementSibling}for(;--r;){if(!o.nextElementSibling){l=o.firstElementChild;break}o=o.nextElementSibling}return[{clospan:Math.abs(t-n),cloTd:i},{rowspan:r,rowTd:l}]}getPasteLastRow(e,t){for(;--t&&e;)e=e.next;return e}getPasteTds(e){const t={};for(const r of e){const e=r.getAttribute("data-row");t[e]||(t[e]=[]),t[e].push(r)}return Object.values(t)}getTableArrowVerticalRow(e,t){var r,n;const i=e.table(),l=i.tbody(),o=i.thead(),s=t?"prev":"next",a=e.parent.statics.blotName;let c=e.parent[s];return!c&&t&&a===J.blotName&&(c=null===(r=null==o?void 0:o.children)||void 0===r?void 0:r.tail),c||t||a!==X.blotName||(c=null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.head),c}getText(e){return this.quill.clipboard.convert({html:e}).filter((e=>"string"==typeof e.insert)).map((e=>e.insert)).join("")}handleClick(e){if(e.detail<3||!this.selectedTds.length)return;const{index:r,length:n}=this.quill.getSelection(!0);this.quill.setSelection(r,n-1,t().sources.SILENT),this.quill.scrollSelectionIntoView()}handleDeleteKeyup(e){var t;(null===(t=this.selectedTds)||void 0===t?void 0:t.length)<2||"Backspace"!==e.key&&"Delete"!==e.key||(e.ctrlKey?(this.tableBetter.tableMenus.deleteColumn(!0),this.tableBetter.tableMenus.deleteRow(!0)):this.removeSelectedTdsContent())}handleKeyup(e){switch(e.key){case"ArrowLeft":case"ArrowRight":this.makeTableArrowLevelHandler(e.key);break;case"ArrowUp":case"ArrowDown":this.makeTableArrowVerticalHandler(e.key)}}handleMousedown(e){const t=e.target.closest("table");if(!t)return;this.tableBetter.tableMenus.destroyTablePropertiesForm();const r=e.target.closest("td,th");if(!r)return;this.clearSelected(),this.startTd=r,this.endTd=r,this.selectedTds=[r],r.classList.add("ql-cell-focused"),this.setHeaderRowSwitch(),this.setMenuDisable("merge");const n=e=>{const n=e.target.closest("td,th");if(!n)return;const i=r.isEqualNode(n);if(i)return;this.clearSelected(),this.startTd=r,this.endTd=n;const l=S(M(r,this.quill.container),M(n,this.quill.container));this.selectedTds=q(l,t,this.quill.container);for(const e of this.selectedTds)e.classList&&e.classList.add("ql-cell-selected");i||this.quill.blur()},i=e=>{this.setSingleDisabled(),this.setCorrectPositionTds(this.startTd,this.endTd,this.selectedTds),this.setHeaderRowSwitch(),this.setMenuDisable("merge"),this.quill.root.removeEventListener("mousemove",n),this.quill.root.removeEventListener("mouseup",i)};this.quill.root.addEventListener("mousemove",n),this.quill.root.addEventListener("mouseup",i)}hasTdTh(e){return{hasTd:e.some((e=>"TD"===e.tagName)),hasTh:e.some((e=>"TH"===e.tagName))}}initDocumentListener(){document.addEventListener("copy",(e=>this.onCaptureCopy(e,!1))),document.addEventListener("cut",(e=>this.onCaptureCopy(e,!0))),document.addEventListener("keyup",this.handleDeleteKeyup.bind(this)),document.addEventListener("paste",this.onCapturePaste.bind(this))}initWhiteList(){const e=this.quill.getModule("toolbar");Array.from(e.container.querySelectorAll("button, select")).forEach((e=>{this.attach(e)}))}insertColumnCell(e,t){const r=e.tbody();r&&r.children.forEach((r=>{const n=r.children.tail.domNode.getAttribute("data-row");for(let i=0;i<t;i++)e.insertColumnCell(r,n,null)}))}insertRow(e,r,n){const i=t().find(n).rowOffset();for(;r--;)e.insertRow(i+1,1)}insertWith(e){return"string"==typeof e&&e.startsWith("\n")&&e.endsWith("\n")}isContinue(e){return!(!this.insertWith(e.insert)||e.attributes&&!e.attributes["table-list"]&&!e.attributes["table-header"])}lines(e){const t=e=>{let r=[];return e.children.forEach((e=>{e instanceof tt?r=r.concat(t(e)):function(e){return e instanceof Qe||e instanceof rt}(e)&&r.push(e)})),r};return t(e)}makeTableArrowLevelHandler(e){const t="ArrowLeft"===e?this.startTd:this.endTd,r=this.quill.getSelection();if(!r)return;const[n]=this.quill.getLine(r.index),i=B(n);if(!i)return this.tableBetter.hideTools();!i||t&&t.isEqualNode(i.domNode)||(this.setSelected(i.domNode,!1),this.tableBetter.showTools(!1))}makeTableArrowVerticalHandler(e){const r="ArrowUp"===e,n=this.quill.getSelection();if(!n)return;const[i,l]=this.quill.getLine(n.index),o=r?"prev":"next";if(i[o]&&this.selectedTds.length){const e=i[o].offset(this.quill.scroll)+Math.min(l,i[o].length()-1);this.quill.setSelection(e,0,t().sources.USER)}else{if(!this.selectedTds.length){const e=B(i);if(!e)return;return this.tableArrowSelection(r,e),void this.tableBetter.showTools(!1)}const e=r?this.startTd:this.endTd,n=t().find(e),l=this.getTableArrowVerticalRow(n,r),{left:s,right:a}=e.getBoundingClientRect();if(l){let e=null,t=l;for(;t&&!e;){let r=t.children.head;for(;r;){const{left:t,right:n}=r.domNode.getBoundingClientRect();if(Math.abs(t-s)<=2){e=r;break}if(Math.abs(n-a)<=2){e=r;break}r=r.next}t=t[o]}e?this.tableArrowSelection(r,e):this.exitTableFocus(i,r)}else this.exitTableFocus(i,r)}}onCaptureCopy(e,t=!1){var r,n,i;if((null===(r=this.selectedTds)||void 0===r?void 0:r.length)<2)return;if(e.defaultPrevented)return;e.preventDefault();const{html:l,text:o}=this.getCopyData();null===(n=e.clipboardData)||void 0===n||n.setData("text/plain",o),null===(i=e.clipboardData)||void 0===i||i.setData("text/html",l),t&&this.removeSelectedTdsContent()}onCapturePaste(e){var r,n,i;if(!(null===(r=this.selectedTds)||void 0===r?void 0:r.length))return;e.preventDefault();const l=null===(n=e.clipboardData)||void 0===n?void 0:n.getData("text/html"),o=(null===(i=e.clipboardData)||void 0===i||i.getData("text/plain"),document.createElement("div"));o.innerHTML=l;const s=Array.from(o.querySelectorAll("tr"));if(!s.length)return;const a=t().find(this.startTd),c=a.row(),d=a.table();this.quill.history.cutoff();const u=this.getCopyColumns(o),[h,p]=this.getPasteInfo(this.startTd,u,s.length),{clospan:f,cloTd:g}=h,{rowspan:b,rowTd:m}=p;f&&this.insertColumnCell(d,f),b&&this.insertRow(d,b,m);const v=f?c.children.tail.domNode:g,y=this.getPasteLastRow(c,s.length),w=this.getPasteComputeBounds(this.startTd,v,y),C=this.getPasteTds(q(w,d.domNode,this.quill.container)),x=s.reduce(((e,t)=>(e.push(Array.from(t.querySelectorAll("td,th"))),e)),[]),k=[];for(;x.length;){const e=x.shift(),r=C.shift();let n=null,i=null;for(;e.length;){const l=e.shift(),o=r.shift();if(o)n=o,i=this.pasteSelectedTd(o,l);else{const e=n.getAttribute("data-row"),r=t().find(n);i=d.insertColumnCell(r.parent,e,r.next),i=this.pasteSelectedTd(i.domNode,l),n=i.domNode}i&&k.push(i.domNode)}for(;r.length;)r.shift().remove()}this.quill.blur(),this.setSelectedTds(k),this.tableBetter.tableMenus.updateMenus(),this.quill.scrollSelectionIntoView()}pasteSelectedTd(e,r){const n=e.getAttribute("data-row"),i=Z.formats(r);Object.assign(i,{"data-row":n});const o=t().find(e),s=o.replaceWith(o.statics.blotName,i);this.quill.setSelection(s.offset(this.quill.scroll)+s.length()-1,0,t().sources.USER);const a=this.quill.getSelection(!0),c=this.quill.getFormat(a.index),d=r.innerHTML,u=this.getText(d),h=this.quill.clipboard.convert({text:u,html:d}),p=(new(l())).retain(a.index).delete(a.length).concat(de(h,c));return this.quill.updateContents(p,t().sources.USER),s}removeCursor(){const e=this.quill.getSelection(!0);e&&0===e.length&&(this.quill.selection.cursor.remove(),this.quill.blur())}removeSelectedTdContent(e){const r=t().find(e);let n=r.children.head;const i=n.formats()[$.blotName],l=this.quill.scroll.create($.blotName,i);for(r.insertBefore(l,n);n;)n.remove(),n=n.next}removeSelectedTdsContent(){if(!(this.selectedTds.length<2)){for(const e of this.selectedTds)this.removeSelectedTdContent(e);this.tableBetter.tableMenus.updateMenus()}}setCorrectPositionTds(e,t,r){if(!e||!t||r.length<2)return;const n=r[0],i=r[r.length-1],l=[...new Set([e,t,n,i])];l.sort(((e,t)=>{const r=e.getBoundingClientRect(),n=t.getBoundingClientRect();return(r.top<=n.top||r.bottom<=n.bottom)&&(r.left<=n.left||r.right<=n.right)?-1:1})),this.startTd=l[0],this.endTd=l[l.length-1]}setDisabled(e){for(const t of this.disabledList)e?t.classList.add("ql-table-button-disabled"):t.classList.remove("ql-table-button-disabled");this.setSingleDisabled()}setHeaderRowSwitch(){const{hasTd:e,hasTh:t}=this.hasTdTh(this.selectedTds);t&&!e?this.tableBetter.tableMenus.toggleHeaderRowSwitch("true"):this.tableBetter.tableMenus.toggleHeaderRowSwitch("false")}setMenuDisable(e){const{hasTd:t,hasTh:r}=this.hasTdTh(this.selectedTds),n=t&&r;this.tableBetter.tableMenus.disableMenu(e,n)}setSelected(e,r=!0){const n=t().find(e);this.clearSelected(),this.startTd=e,this.endTd=e,this.selectedTds=[e],e.classList.add("ql-cell-focused"),r&&this.quill.setSelection(n.offset(this.quill.scroll)+n.length()-1,0,t().sources.USER)}setSelectedTds(e){this.clearSelected(),this.startTd=e[0],this.endTd=e[e.length-1],this.selectedTds=e;for(const e of this.selectedTds)e.classList&&e.classList.add("ql-cell-selected")}setSelectedTdsFormat(e,r){const n=[],i=this.quill.getModule("toolbar");for(const l of this.selectedTds)if(null!=i.handlers[e]){const o=t().find(l),s=this.lines(o),a=i.handlers[e].call(i,r,s);a&&n.push(B(a).domNode)}else{const n=window.getSelection();n.selectAllChildren(l),this.quill.format(e,r,t().sources.USER),n.removeAllRanges()}this.quill.blur(),n.length&&this.setSelectedTds(n)}setSingleDisabled(){for(const e of this.singleList)this.selectedTds.length>1?e.classList.add("ql-table-button-disabled"):e.classList.remove("ql-table-button-disabled")}tableArrowSelection(e,r){const n=e?"tail":"head",i=e?r.children[n].length()-1:0;this.setSelected(r.domNode,!1);const l=r.children[n].offset(this.quill.scroll)+i;this.quill.setSelection(l,0,t().sources.USER)}updateSelected(e){switch(e){case"column":{const e=this.endTd.nextElementSibling||this.startTd.previousElementSibling;if(!e)return this.tableBetter.hideTools();this.setSelected(e)}break;case"row":{const e=this.getCorrectRow(this.endTd,"next")||this.getCorrectRow(this.startTd,"prev");if(!e)return this.tableBetter.hideTools();const t=M(this.startTd,this.quill.container);let r=e.firstElementChild;for(;r;){const e=M(r,this.quill.container);if(e.left+2>=t.left||e.right-2>=t.left)return void this.setSelected(r);r=r.nextElementSibling}this.setSelected(e.firstElementChild)}}}},ft=class{constructor(e,t){this.quill=e,this.options=null,this.drag=!1,this.line=null,this.dragBlock=null,this.dragTable=null,this.direction=null,this.tableBetter=t,this.quill.root.addEventListener("mousemove",this.handleMouseMove.bind(this))}createDragBlock(){const e=document.createElement("div");e.classList.add("ql-operate-block");const{dragBlockProps:t}=this.getProperty(this.options);H(e,t),this.dragBlock=e,this.quill.container.appendChild(e),this.updateCell(e)}createDragTable(e){const t=document.createElement("div"),r=this.getDragTableProperty(e);t.classList.add("ql-operate-drag-table"),H(t,r),this.dragTable=t,this.quill.container.appendChild(t)}createOperateLine(){const e=document.createElement("div"),t=document.createElement("div");e.classList.add("ql-operate-line-container");const{containerProps:r,lineProps:n}=this.getProperty(this.options);H(e,r),H(t,n),e.appendChild(t),this.quill.container.appendChild(e),this.line=e,this.updateCell(e)}getCorrectCol(e,t){let r=e.children.head;for(;r&&--t;)r=r.next;return r}getDragTableProperty(e){const{left:t,top:r,width:n,height:i}=e.getBoundingClientRect(),l=this.quill.container.getBoundingClientRect();return{left:t-l.left+"px",top:r-l.top+"px",width:`${n}px`,height:`${i}px`,display:"block"}}getLevelColSum(e){let t=e,r=0;for(;t;)r+=~~t.getAttribute("colspan")||1,t=t.previousSibling;return r}getMaxColNum(e){const t=e.parentElement.children;let r=0;for(const e of t)r+=~~e.getAttribute("colspan")||1;return r}getProperty(e){const t=this.quill.container.getBoundingClientRect(),{tableNode:r,cellNode:n,mousePosition:i}=e,{clientX:l,clientY:o}=i,s=r.getBoundingClientRect(),a=n.getBoundingClientRect(),c=a.left+a.width,d=a.top+a.height,u={width:"8px",height:"8px",top:s.bottom-t.top+"px",left:s.right-t.left+"px",display:s.bottom>t.bottom?"none":"block"};return Math.abs(c-l)<=5?(this.direction="level",{dragBlockProps:u,containerProps:{width:"5px",height:`${t.height}px`,top:"0",left:c-t.left-2.5+"px",display:"flex",cursor:"col-resize"},lineProps:{width:"1px",height:"100%"}}):Math.abs(d-o)<=5?(this.direction="vertical",{dragBlockProps:u,containerProps:{width:`${t.width}px`,height:"5px",top:d-t.top-2.5+"px",left:"0",display:"flex",cursor:"row-resize"},lineProps:{width:"100%",height:"1px"}}):(this.hideLine(),{dragBlockProps:u})}getVerticalCells(e,t){let r=e.parentElement;for(;t>1&&r;)r=r.nextSibling,t--;return r.children}handleMouseMove(e){if(!this.quill.isEnabled())return;const t=e.target.closest("table");if(t&&!this.quill.root.contains(t))return;const r=e.target.closest("td,th"),n={clientX:e.clientX,clientY:e.clientY};if(!t||!r)return void(this.line&&!this.drag&&(this.hideLine(),this.hideDragBlock()));const i={tableNode:t,cellNode:r,mousePosition:n};if(this.line){if(this.drag||!r)return;this.updateProperty(i)}else this.options=i,this.createOperateLine(),this.createDragBlock()}hideDragBlock(){this.dragBlock&&H(this.dragBlock,{display:"none"})}hideDragTable(){this.dragTable&&H(this.dragTable,{display:"none"})}hideLine(){this.line&&H(this.line,{display:"none"})}isLine(e){return e.classList.contains("ql-operate-line-container")}setCellLevelRect(e,r){const{right:n}=e.getBoundingClientRect(),i=~~(r-n),l=this.getLevelColSum(e),o=t().find(e).table(),s=o.isPercent(),a=o.colgroup(),c=o.domNode.getBoundingClientRect();if(a){const e=this.getCorrectCol(a,l),t=e.next,{width:r}=e.domNode.getBoundingClientRect();if(this.setColWidth(e.domNode,`${r+i}`,s),t){const{width:e}=t.domNode.getBoundingClientRect();this.setColWidth(t.domNode,""+(e-i),s)}}else{const t=null==e.nextElementSibling,r=e.parentElement.parentElement.children,n=[];for(const e of r){const r=e.children;if(t){const e=r[r.length-1],{width:t}=e.getBoundingClientRect();n.push([e,""+~~(t+i)]);continue}let o=0;for(const e of r){if(o+=~~e.getAttribute("colspan")||1,o>l)break;if(o===l){const{width:t}=e.getBoundingClientRect(),r=e.nextElementSibling;if(!r)continue;const{width:l}=r.getBoundingClientRect();n.push([e,""+~~(t+i)],[r,""+~~(l-i)])}}}for(const[e,t]of n){const r=O(~~t,s);D(e,{width:r}),H(e,{width:r})}}null==e.nextElementSibling&&F(o.domNode,c,i)}setCellRect(e,t,r){"level"===this.direction?this.setCellLevelRect(e,t):"vertical"===this.direction&&this.setCellVerticalRect(e,r)}setCellsRect(e,r,n){const i=e.parentElement.parentElement.children,l=r/this.getMaxColNum(e),o=n/i.length,s=[],a=t().find(e).table(),c=a.isPercent(),d=a.colgroup(),u=a.domNode.getBoundingClientRect();for(const e of i){const t=e.children;for(const e of t){const t=~~e.getAttribute("colspan")||1,{width:r,height:n}=e.getBoundingClientRect();s.push([e,`${Math.ceil(r+l*t)}`,`${Math.ceil(n+o)}`])}}if(d){let e=d.children.head;for(const[e,,t]of s)D(e,{height:t}),H(e,{height:`${t}px`});for(;e;){const{width:t}=e.domNode.getBoundingClientRect();this.setColWidth(e.domNode,`${Math.ceil(t+l)}`,c),e=e.next}}else for(const[e,t,r]of s){const n=O(~~t,c);D(e,{height:r,width:n}),H(e,{height:r,width:n})}F(a.domNode,u,r)}setColWidth(e,t,r){r?(t=O(parseFloat(t),r),e.style.setProperty("width",t)):D(e,{width:t})}setCellVerticalRect(e,t){const r=~~e.getAttribute("rowspan")||1,n=r>1?this.getVerticalCells(e,r):e.parentElement.children;for(const e of n){const{top:r}=e.getBoundingClientRect(),n=""+~~(t-r);D(e,{height:n}),H(e,{height:`${n}px`})}}toggleLineChildClass(e){const t=this.line.firstElementChild;e?t.classList.add("ql-operate-line"):t.classList.remove("ql-operate-line")}updateCell(e){if(!e)return;const t=this.isLine(e),r=e=>{e.preventDefault(),this.drag&&(t?(this.updateDragLine(e.clientX,e.clientY),this.hideDragBlock()):(this.updateDragBlock(e.clientX,e.clientY),this.hideLine()))},n=e=>{e.preventDefault();const{cellNode:i,tableNode:l}=this.options;if(t)this.setCellRect(i,e.clientX,e.clientY),this.toggleLineChildClass(!1);else{const{right:t,bottom:r}=l.getBoundingClientRect(),n=e.clientX-t,o=e.clientY-r;this.setCellsRect(i,n,o),this.dragBlock.classList.remove("ql-operate-block-move"),this.hideDragBlock(),this.hideDragTable()}this.drag=!1,document.removeEventListener("mousemove",r,!1),document.removeEventListener("mouseup",n,!1),this.tableBetter.tableMenus.updateMenus(l)};e.addEventListener("mousedown",(e=>{e.preventDefault();const{tableNode:i}=this.options;if(t)this.toggleLineChildClass(!0);else if(this.dragTable){const e=this.getDragTableProperty(i);H(this.dragTable,e)}else this.createDragTable(i);this.drag=!0,document.addEventListener("mousemove",r),document.addEventListener("mouseup",n)}))}updateDragBlock(e,t){const r=this.quill.container.getBoundingClientRect();this.dragBlock.classList.add("ql-operate-block-move"),H(this.dragBlock,{top:~~(t-r.top-4)+"px",left:~~(e-r.left-4)+"px"}),this.updateDragTable(e,t)}updateDragLine(e,t){const r=this.quill.container.getBoundingClientRect();"level"===this.direction?H(this.line,{left:~~(e-r.left-2.5)+"px"}):"vertical"===this.direction&&H(this.line,{top:~~t-r.top-2.5+"px"})}updateDragTable(e,t){const{top:r,left:n}=this.dragTable.getBoundingClientRect(),i=e-n,l=t-r;H(this.dragTable,{width:`${i}px`,height:`${l}px`,display:"block"})}updateProperty(e){const{containerProps:t,lineProps:r,dragBlockProps:n}=this.getProperty(e);t&&r&&(this.options=e,H(this.line,t),H(this.line.firstChild,r),H(this.dragBlock,n))}},gt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1692084293475" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2632" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M1012.62222223 944.76190506a78.01904747 78.01904747 0 0 1-78.01904747 78.01904747H76.3936505a78.01904747 78.01904747 0 0 1-78.01904747-78.01904747V86.55238079a78.01904747 78.01904747 0 0 1 78.01904747-78.01904746h858.20952426a78.01904747 78.01904747 0 0 1 78.01904747 78.01904746v858.20952427zM466.4888889 554.66666666H76.3936505v390.0952384h390.0952384V554.66666666z m468.11428586 0H544.50793636v390.0952384h390.0952384V554.66666666zM466.4888889 86.55238079H76.3936505v390.0952384h390.0952384V86.55238079z m468.11428586 0H544.50793636v390.0952384h390.0952384V86.55238079z" fill="#515151" p-id="2633"></path></svg>',bt='<?xml version="1.0" encoding="UTF-8"?><svg width="18" height="18" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M36 18L24 30L12 18" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>',mt={},vt=[],yt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i;function wt(e,t){for(var r in t)e[r]=t[r];return e}function Ct(e){var t=e.parentNode;t&&t.removeChild(e)}function xt(e,t,r){var n,i,l,o,s=arguments;if(t=wt({},t),arguments.length>3)for(r=[r],n=3;n<arguments.length;n++)r.push(s[n]);if(null!=r&&(t.children=r),null!=e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===t[i]&&(t[i]=e.defaultProps[i]);return o=t.key,null!=(l=t.ref)&&delete t.ref,null!=o&&delete t.key,kt(e,t,o,l)}function kt(e,t,r,n){var i={type:e,props:t,key:r,ref:n,__k:null,__p:null,__b:0,__e:null,l:null,__c:null,constructor:void 0};return at.vnode&&at.vnode(i),i}function Tt(e){return e.children}function _t(e,t){this.props=e,this.context=t}function Nt(e,t){if(null==t)return e.__p?Nt(e.__p,e.__p.__k.indexOf(e)+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?Nt(e):null}function At(e){var t,r;if(null!=(e=e.__p)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return At(e)}}function Lt(e){(!e.__d&&(e.__d=!0)&&1===ct.push(e)||ut!==at.debounceRendering)&&(ut=at.debounceRendering,(at.debounceRendering||dt)(St))}function St(){var e,t,r,n,i,l,o,s;for(ct.sort((function(e,t){return t.__v.__b-e.__v.__b}));e=ct.pop();)e.__d&&(r=void 0,n=void 0,l=(i=(t=e).__v).__e,o=t.__P,s=t.u,t.u=!1,o&&(r=[],n=Rt(o,i,wt({},i),t.__n,void 0!==o.ownerSVGElement,null,r,s,null==l?Nt(i):l),Ot(r,i),n!=l&&At(i)))}function jt(e,t,r,n,i,l,o,s,a){var c,d,u,h,p,f,g,b=r&&r.__k||vt,m=b.length;if(s==mt&&(s=null!=l?l[0]:m?Nt(r,0):null),c=0,t.__k=qt(t.__k,(function(r){if(null!=r){if(r.__p=t,r.__b=t.__b+1,null===(u=b[c])||u&&r.key==u.key&&r.type===u.type)b[c]=void 0;else for(d=0;d<m;d++){if((u=b[d])&&r.key==u.key&&r.type===u.type){b[d]=void 0;break}u=null}if(h=Rt(e,r,u=u||mt,n,i,l,o,null,s,a),(d=r.ref)&&u.ref!=d&&(g||(g=[])).push(d,r.__c||h,r),null!=h){if(null==f&&(f=h),null!=r.l)h=r.l,r.l=null;else if(l==u||h!=s||null==h.parentNode){e:if(null==s||s.parentNode!==e)e.appendChild(h);else{for(p=s,d=0;(p=p.nextSibling)&&d<m;d+=2)if(p==h)break e;e.insertBefore(h,s)}"option"==t.type&&(e.value="")}s=h.nextSibling,"function"==typeof t.type&&(t.l=h)}}return c++,r})),t.__e=f,null!=l&&"function"!=typeof t.type)for(c=l.length;c--;)null!=l[c]&&Ct(l[c]);for(c=m;c--;)null!=b[c]&&zt(b[c],b[c]);if(g)for(c=0;c<g.length;c++)It(g[c],g[++c],g[++c])}function qt(e,t,r){if(null==r&&(r=[]),null==e||"boolean"==typeof e)t&&r.push(t(null));else if(Array.isArray(e))for(var n=0;n<e.length;n++)qt(e[n],t,r);else r.push(t?t(function(e){if(null==e||"boolean"==typeof e)return null;if("string"==typeof e||"number"==typeof e)return kt(null,e,null,null);if(null!=e.__e||null!=e.__c){var t=kt(e.type,e.props,e.key,null);return t.__e=e.__e,t}return e}(e)):e);return r}function Et(e,t,r){"-"===t[0]?e.setProperty(t,r):e[t]="number"==typeof r&&!1===yt.test(t)?r+"px":null==r?"":r}function Mt(e,t,r,n,i){var l,o,s,a,c;if("key"===(t=i?"className"===t?"class":t:"class"===t?"className":t)||"children"===t);else if("style"===t)if(l=e.style,"string"==typeof r)l.cssText=r;else{if("string"==typeof n&&(l.cssText="",n=null),n)for(o in n)r&&o in r||Et(l,o,"");if(r)for(s in r)n&&r[s]===n[s]||Et(l,s,r[s])}else"o"===t[0]&&"n"===t[1]?(a=t!==(t=t.replace(/Capture$/,"")),c=t.toLowerCase(),t=(c in e?c:t).slice(2),r?(n||e.addEventListener(t,Bt,a),(e.t||(e.t={}))[t]=r):e.removeEventListener(t,Bt,a)):"list"!==t&&"tagName"!==t&&"form"!==t&&!i&&t in e?e[t]=null==r?"":r:"function"!=typeof r&&"dangerouslySetInnerHTML"!==t&&(t!==(t=t.replace(/^xlink:?/,""))?null==r||!1===r?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):null==r||!1===r?e.removeAttribute(t):e.setAttribute(t,r))}function Bt(e){return this.t[e.type](at.event?at.event(e):e)}function Rt(e,t,r,n,i,l,o,s,a,c){var d,u,h,p,f,g,b,m,v,y,w=t.type;if(void 0!==t.constructor)return null;(d=at.__b)&&d(t);try{e:if("function"==typeof w){if(m=t.props,v=(d=w.contextType)&&n[d.__c],y=d?v?v.props.value:d.__p:n,r.__c?b=(u=t.__c=r.__c).__p=u.__E:("prototype"in w&&w.prototype.render?t.__c=u=new w(m,y):(t.__c=u=new _t(m,y),u.constructor=w,u.render=Dt),v&&v.sub(u),u.props=m,u.state||(u.state={}),u.context=y,u.__n=n,h=u.__d=!0,u.__h=[]),null==u.__s&&(u.__s=u.state),null!=w.getDerivedStateFromProps&&wt(u.__s==u.state?u.__s=wt({},u.__s):u.__s,w.getDerivedStateFromProps(m,u.__s)),h)null==w.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&o.push(u);else{if(null==w.getDerivedStateFromProps&&null==s&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(m,y),!s&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(m,u.__s,y)){for(u.props=m,u.state=u.__s,u.__d=!1,u.__v=t,t.__e=null!=a?a!==r.__e?a:r.__e:null,t.__k=r.__k,d=0;d<t.__k.length;d++)t.__k[d]&&(t.__k[d].__p=t);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(m,u.__s,y)}for(p=u.props,f=u.state,u.context=y,u.props=m,u.state=u.__s,(d=at.__r)&&d(t),u.__d=!1,u.__v=t,u.__P=e,d=u.render(u.props,u.state,u.context),t.__k=qt(null!=d&&d.type==Tt&&null==d.key?d.props.children:d),null!=u.getChildContext&&(n=wt(wt({},n),u.getChildContext())),h||null==u.getSnapshotBeforeUpdate||(g=u.getSnapshotBeforeUpdate(p,f)),jt(e,t,r,n,i,l,o,a,c),u.base=t.__e;d=u.__h.pop();)u.__s&&(u.state=u.__s),d.call(u);h||null==p||null==u.componentDidUpdate||u.componentDidUpdate(p,f,g),b&&(u.__E=u.__p=null)}else t.__e=Pt(r.__e,t,r,n,i,l,o,c);(d=at.diffed)&&d(t)}catch(e){at.__e(e,t,r)}return t.__e}function Ot(e,t){for(var r;r=e.pop();)try{r.componentDidMount()}catch(e){at.__e(e,r.__v)}at.__c&&at.__c(t)}function Pt(e,t,r,n,i,l,o,s){var a,c,d,u,h=r.props,p=t.props;if(i="svg"===t.type||i,null==e&&null!=l)for(a=0;a<l.length;a++)if(null!=(c=l[a])&&(null===t.type?3===c.nodeType:c.localName===t.type)){e=c,l[a]=null;break}if(null==e){if(null===t.type)return document.createTextNode(p);e=i?document.createElementNS("http://www.w3.org/2000/svg",t.type):document.createElement(t.type),l=null}return null===t.type?h!==p&&(null!=l&&(l[l.indexOf(e)]=null),e.data=p):t!==r&&(null!=l&&(l=vt.slice.call(e.childNodes)),d=(h=r.props||mt).dangerouslySetInnerHTML,u=p.dangerouslySetInnerHTML,s||(u||d)&&(u&&d&&u.__html==d.__html||(e.innerHTML=u&&u.__html||"")),function(e,t,r,n,i){var l;for(l in r)l in t||Mt(e,l,null,r[l],n);for(l in t)i&&"function"!=typeof t[l]||"value"===l||"checked"===l||r[l]===t[l]||Mt(e,l,t[l],r[l],n)}(e,p,h,i,s),t.__k=t.props.children,u||jt(e,t,r,n,"foreignObject"!==t.type&&i,l,o,mt,s),s||("value"in p&&void 0!==p.value&&p.value!==e.value&&(e.value=null==p.value?"":p.value),"checked"in p&&void 0!==p.checked&&p.checked!==e.checked&&(e.checked=p.checked))),e}function It(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){at.__e(e,r)}}function zt(e,t,r){var n,i,l;if(at.unmount&&at.unmount(e),(n=e.ref)&&It(n,null,t),r||"function"==typeof e.type||(r=null!=(i=e.__e)),e.__e=e.l=null,null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){at.__e(e,t)}n.base=n.__P=null}if(n=e.__k)for(l=0;l<n.length;l++)n[l]&&zt(n[l],t,r);null!=i&&Ct(i)}function Dt(e,t,r){return this.constructor(e,r)}function Ht(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ft(){return Ft=Object.assign||function(e){for(var t=arguments,r=1;r<arguments.length;r++){var n=t[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ft.apply(this,arguments)}at={},_t.prototype.setState=function(e,t){var r=this.__s!==this.state&&this.__s||(this.__s=wt({},this.state));("function"!=typeof e||(e=e(r,this.props)))&&wt(r,e),null!=e&&this.__v&&(this.u=!1,t&&this.__h.push(t),Lt(this))},_t.prototype.forceUpdate=function(e){this.__v&&(e&&this.__h.push(e),this.u=!0,Lt(this))},_t.prototype.render=Tt,ct=[],dt="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ut=at.debounceRendering,at.__e=function(e,t,r){for(var n;t=t.__p;)if((n=t.__c)&&!n.__p)try{if(n.constructor&&null!=n.constructor.getDerivedStateFromError)n.setState(n.constructor.getDerivedStateFromError(e));else{if(null==n.componentDidCatch)continue;n.componentDidCatch(e)}return Lt(n.__E=n)}catch(t){e=t}throw e},ht=mt;var Vt="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",Wt="[\\s|\\(]+("+Vt+")[,|\\s]+("+Vt+")[,|\\s]+("+Vt+")\\s*\\)?",Ut="[\\s|\\(]+("+Vt+")[,|\\s]+("+Vt+")[,|\\s]+("+Vt+")[,|\\s]+("+Vt+")\\s*\\)?",Gt=new RegExp("rgb"+Wt),$t=new RegExp("rgba"+Ut),Kt=new RegExp("hsl"+Wt),Zt=new RegExp("hsla"+Ut),Yt="^(?:#?|0x?)",Jt="([0-9a-fA-F]{1})",Xt="([0-9a-fA-F]{2})",Qt=new RegExp(Yt+Jt+Jt+Jt+"$"),er=new RegExp(Yt+Jt+Jt+Jt+Jt+"$"),tr=new RegExp(Yt+Xt+Xt+Xt+"$"),rr=new RegExp(Yt+Xt+Xt+Xt+Xt+"$"),nr=Math.log,ir=Math.round,lr=Math.floor;function or(e,t,r){return Math.min(Math.max(e,t),r)}function sr(e,t){var r=e.indexOf("%")>-1,n=parseFloat(e);return r?t/100*n:n}function ar(e){return parseInt(e,16)}function cr(e){return e.toString(16).padStart(2,"0")}var dr=function(){function e(e,t){this.$={h:0,s:0,v:0,a:1},e&&this.set(e),this.onChange=t,this.initialValue=Ft({},this.$)}var t,r,n=e.prototype;return n.set=function(t){if("string"==typeof t)/^(?:#?|0x?)[0-9a-fA-F]{3,8}$/.test(t)?this.hexString=t:/^rgba?/.test(t)?this.rgbString=t:/^hsla?/.test(t)&&(this.hslString=t);else{if("object"!=typeof t)throw new Error("Invalid color value");t instanceof e?this.hsva=t.hsva:"r"in t&&"g"in t&&"b"in t?this.rgb=t:"h"in t&&"s"in t&&"v"in t?this.hsv=t:"h"in t&&"s"in t&&"l"in t?this.hsl=t:"kelvin"in t&&(this.kelvin=t.kelvin)}},n.setChannel=function(e,t,r){var n;this[e]=Ft({},this[e],((n={})[t]=r,n))},n.reset=function(){this.hsva=this.initialValue},n.clone=function(){return new e(this)},n.unbind=function(){this.onChange=void 0},e.hsvToRgb=function(e){var t=e.h/60,r=e.s/100,n=e.v/100,i=lr(t),l=t-i,o=n*(1-r),s=n*(1-l*r),a=n*(1-(1-l)*r),c=i%6,d=[a,n,n,s,o,o][c],u=[o,o,a,n,n,s][c];return{r:or(255*[n,s,o,o,a,n][c],0,255),g:or(255*d,0,255),b:or(255*u,0,255)}},e.rgbToHsv=function(e){var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.max(t,r,n),l=Math.min(t,r,n),o=i-l,s=0,a=i,c=0===i?0:o/i;switch(i){case l:s=0;break;case t:s=(r-n)/o+(r<n?6:0);break;case r:s=(n-t)/o+2;break;case n:s=(t-r)/o+4}return{h:60*s%360,s:or(100*c,0,100),v:or(100*a,0,100)}},e.hsvToHsl=function(e){var t=e.s/100,r=e.v/100,n=(2-t)*r,i=n<=1?n:2-n,l=i<1e-9?0:t*r/i;return{h:e.h,s:or(100*l,0,100),l:or(50*n,0,100)}},e.hslToHsv=function(e){var t=2*e.l,r=e.s*(t<=100?t:200-t)/100,n=t+r<1e-9?0:2*r/(t+r);return{h:e.h,s:or(100*n,0,100),v:or((t+r)/2,0,100)}},e.kelvinToRgb=function(e){var t,r,n,i=e/100;return i<66?(t=255,r=-155.25485562709179-.44596950469579133*(r=i-2)+104.49216199393888*nr(r),n=i<20?0:.8274096064007395*(n=i-10)-254.76935184120902+115.67994401066147*nr(n)):(t=351.97690566805693+.114206453784165*(t=i-55)-40.25366309332127*nr(t),r=325.4494125711974+.07943456536662342*(r=i-50)-28.0852963507957*nr(r),n=255),{r:or(lr(t),0,255),g:or(lr(r),0,255),b:or(lr(n),0,255)}},e.rgbToKelvin=function(t){for(var r,n=t.r,i=t.b,l=2e3,o=4e4;o-l>.4;){r=.5*(o+l);var s=e.kelvinToRgb(r);s.b/s.r>=i/n?o=r:l=r}return r},t=e,r=[{key:"hsv",get:function(){var e=this.$;return{h:e.h,s:e.s,v:e.v}},set:function(e){var t=this.$;if(e=Ft({},t,e),this.onChange){var r={h:!1,v:!1,s:!1,a:!1};for(var n in t)r[n]=e[n]!=t[n];this.$=e,(r.h||r.s||r.v||r.a)&&this.onChange(this,r)}else this.$=e}},{key:"hsva",get:function(){return Ft({},this.$)},set:function(e){this.hsv=e}},{key:"hue",get:function(){return this.$.h},set:function(e){this.hsv={h:e}}},{key:"saturation",get:function(){return this.$.s},set:function(e){this.hsv={s:e}}},{key:"value",get:function(){return this.$.v},set:function(e){this.hsv={v:e}}},{key:"alpha",get:function(){return this.$.a},set:function(e){this.hsv=Ft({},this.hsv,{a:e})}},{key:"kelvin",get:function(){return e.rgbToKelvin(this.rgb)},set:function(t){this.rgb=e.kelvinToRgb(t)}},{key:"red",get:function(){return this.rgb.r},set:function(e){this.rgb=Ft({},this.rgb,{r:e})}},{key:"green",get:function(){return this.rgb.g},set:function(e){this.rgb=Ft({},this.rgb,{g:e})}},{key:"blue",get:function(){return this.rgb.b},set:function(e){this.rgb=Ft({},this.rgb,{b:e})}},{key:"rgb",get:function(){var t=e.hsvToRgb(this.$),r=t.r,n=t.g,i=t.b;return{r:ir(r),g:ir(n),b:ir(i)}},set:function(t){this.hsv=Ft({},e.rgbToHsv(t),{a:void 0===t.a?1:t.a})}},{key:"rgba",get:function(){return Ft({},this.rgb,{a:this.alpha})},set:function(e){this.rgb=e}},{key:"hsl",get:function(){var t=e.hsvToHsl(this.$),r=t.h,n=t.s,i=t.l;return{h:ir(r),s:ir(n),l:ir(i)}},set:function(t){this.hsv=Ft({},e.hslToHsv(t),{a:void 0===t.a?1:t.a})}},{key:"hsla",get:function(){return Ft({},this.hsl,{a:this.alpha})},set:function(e){this.hsl=e}},{key:"rgbString",get:function(){var e=this.rgb;return"rgb("+e.r+", "+e.g+", "+e.b+")"},set:function(e){var t,r,n,i,l=1;if((t=Gt.exec(e))?(r=sr(t[1],255),n=sr(t[2],255),i=sr(t[3],255)):(t=$t.exec(e))&&(r=sr(t[1],255),n=sr(t[2],255),i=sr(t[3],255),l=sr(t[4],1)),!t)throw new Error("Invalid rgb string");this.rgb={r:r,g:n,b:i,a:l}}},{key:"rgbaString",get:function(){var e=this.rgba;return"rgba("+e.r+", "+e.g+", "+e.b+", "+e.a+")"},set:function(e){this.rgbString=e}},{key:"hexString",get:function(){var e=this.rgb;return"#"+cr(e.r)+cr(e.g)+cr(e.b)},set:function(e){var t,r,n,i,l=255;if((t=Qt.exec(e))?(r=17*ar(t[1]),n=17*ar(t[2]),i=17*ar(t[3])):(t=er.exec(e))?(r=17*ar(t[1]),n=17*ar(t[2]),i=17*ar(t[3]),l=17*ar(t[4])):(t=tr.exec(e))?(r=ar(t[1]),n=ar(t[2]),i=ar(t[3])):(t=rr.exec(e))&&(r=ar(t[1]),n=ar(t[2]),i=ar(t[3]),l=ar(t[4])),!t)throw new Error("Invalid hex string");this.rgb={r:r,g:n,b:i,a:l/255}}},{key:"hex8String",get:function(){var e=this.rgba;return"#"+cr(e.r)+cr(e.g)+cr(e.b)+cr(lr(255*e.a))},set:function(e){this.hexString=e}},{key:"hslString",get:function(){var e=this.hsl;return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},set:function(e){var t,r,n,i,l=1;if((t=Kt.exec(e))?(r=sr(t[1],360),n=sr(t[2],100),i=sr(t[3],100)):(t=Zt.exec(e))&&(r=sr(t[1],360),n=sr(t[2],100),i=sr(t[3],100),l=sr(t[4],1)),!t)throw new Error("Invalid hsl string");this.hsl={h:r,s:n,l:i,a:l}}},{key:"hslaString",get:function(){var e=this.hsla;return"hsla("+e.h+", "+e.s+"%, "+e.l+"%, "+e.a+")"},set:function(e){this.hslString=e}}],r&&Ht(t.prototype,r),e}();function ur(e){var t,r=e.width,n=e.sliderSize,i=e.borderWidth,l=e.handleRadius,o=e.padding,s=e.sliderShape,a="horizontal"===e.layoutDirection;return n=null!=(t=n)?t:2*o+2*l,"circle"===s?{handleStart:e.padding+e.handleRadius,handleRange:r-2*o-2*l,width:r,height:r,cx:r/2,cy:r/2,radius:r/2-i/2}:{handleStart:n/2,handleRange:r-n,radius:n/2,x:0,y:0,width:a?n:r,height:a?r:n}}var hr,pr=2*Math.PI,fr=function(e,t){return(e%t+t)%t},gr=function(e,t){return Math.sqrt(e*e+t*t)};function br(e){return e.width/2-e.padding-e.handleRadius-e.borderWidth}function mr(e){var t=e.width/2;return{width:e.width,radius:t-e.borderWidth,cx:t,cy:t}}function vr(e,t,r){var n=e.wheelAngle,i=e.wheelDirection;return r&&"clockwise"===i?t=n+t:"clockwise"===i?t=360-n+t:r&&"anticlockwise"===i?t=n+180-t:"anticlockwise"===i&&(t=n-t),fr(t,360)}function yr(e,t,r){var n=mr(e),i=n.cx,l=n.cy,o=br(e);t=i-t,r=l-r;var s=vr(e,Math.atan2(-r,-t)*(360/pr)),a=Math.min(gr(t,r),o);return{h:Math.round(s),s:Math.round(100/o*a)}}function wr(e){var t=e.width,r=e.boxHeight;return{width:t,height:null!=r?r:t,radius:e.padding+e.handleRadius}}function Cr(e,t,r){var n=wr(e),i=n.width,l=n.height,o=n.radius,s=(t-o)/(i-2*o)*100,a=(r-o)/(l-2*o)*100;return{s:Math.max(0,Math.min(s,100)),v:Math.max(0,Math.min(100-a,100))}}function xr(e){hr||(hr=document.getElementsByTagName("base"));var t=window.navigator.userAgent,r=/^((?!chrome|android).)*safari/i.test(t),n=/iPhone|iPod|iPad/i.test(t),i=window.location;return(r||n)&&hr.length>0?i.protocol+"//"+i.host+i.pathname+i.search+e:e}function kr(e,t,r,n){for(var i=0;i<n.length;i++){var l=n[i].x-t,o=n[i].y-r;if(Math.sqrt(l*l+o*o)<e.handleRadius)return i}return null}function Tr(e){return{boxSizing:"border-box",border:e.borderWidth+"px solid "+e.borderColor}}function _r(e,t,r){return e+"-gradient("+t+", "+r.map((function(e){var t=e[0];return e[1]+" "+t+"%"})).join(",")+")"}function Nr(e){return"string"==typeof e?e:e+"px"}var Ar=["mousemove","touchmove","mouseup","touchend"],Lr=function(e){function t(t){e.call(this,t),this.uid=(Math.random()+1).toString(36).substring(5)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(e){var t=this.handleEvent.bind(this),r={onMouseDown:t,ontouchstart:t},n="horizontal"===e.layoutDirection,i=null===e.margin?e.sliderMargin:e.margin,l={overflow:"visible",display:n?"inline-block":"block"};return e.index>0&&(l[n?"marginLeft":"marginTop"]=i),xt(Tt,null,e.children(this.uid,r,l))},t.prototype.handleEvent=function(e){var t=this,r=this.props.onInput,n=this.base.getBoundingClientRect();e.preventDefault();var i=e.touches?e.changedTouches[0]:e,l=i.clientX-n.left,o=i.clientY-n.top;switch(e.type){case"mousedown":case"touchstart":!1!==r(l,o,0)&&Ar.forEach((function(e){document.addEventListener(e,t,{passive:!1})}));break;case"mousemove":case"touchmove":r(l,o,1);break;case"mouseup":case"touchend":r(l,o,2),Ar.forEach((function(e){document.removeEventListener(e,t,{passive:!1})}))}},t}(_t);function Sr(e){var t=e.r,r=e.url,n=t,i=t;return xt("svg",{className:"IroHandle IroHandle--"+e.index+" "+(e.isActive?"IroHandle--isActive":""),style:{"-webkit-tap-highlight-color":"rgba(0, 0, 0, 0);",transform:"translate("+Nr(e.x)+", "+Nr(e.y)+")",willChange:"transform",top:Nr(-t),left:Nr(-t),width:Nr(2*t),height:Nr(2*t),position:"absolute",overflow:"visible"}},r&&xt("use",Object.assign({xlinkHref:xr(r)},e.props)),!r&&xt("circle",{cx:n,cy:i,r:t,fill:"none","stroke-width":2,stroke:"#000"}),!r&&xt("circle",{cx:n,cy:i,r:t-2,fill:e.fill,"stroke-width":2,stroke:"#fff"}))}function jr(e){var t=e.activeIndex,r=void 0!==t&&t<e.colors.length?e.colors[t]:e.color,n=ur(e),i=n.width,l=n.height,o=n.radius,s=function(e,t){var r=ur(e),n=r.width,i=r.height,l=r.handleRange,o=r.handleStart,s="horizontal"===e.layoutDirection,a=function(e,t){var r=t.hsva,n=t.rgb;switch(e.sliderType){case"red":return n.r/2.55;case"green":return n.g/2.55;case"blue":return n.b/2.55;case"alpha":return 100*r.a;case"kelvin":var i=e.minTemperature,l=e.maxTemperature-i,o=(t.kelvin-i)/l*100;return Math.max(0,Math.min(o,100));case"hue":return r.h/=3.6;case"saturation":return r.s;default:return r.v}}(e,t),c=s?n/2:i/2,d=o+a/100*l;return s&&(d=-1*d+l+2*o),{x:s?c:d,y:s?d:c}}(e,r),a=function(e,t){var r=t.hsv,n=t.rgb;switch(e.sliderType){case"red":return[[0,"rgb(0,"+n.g+","+n.b+")"],[100,"rgb(255,"+n.g+","+n.b+")"]];case"green":return[[0,"rgb("+n.r+",0,"+n.b+")"],[100,"rgb("+n.r+",255,"+n.b+")"]];case"blue":return[[0,"rgb("+n.r+","+n.g+",0)"],[100,"rgb("+n.r+","+n.g+",255)"]];case"alpha":return[[0,"rgba("+n.r+","+n.g+","+n.b+",0)"],[100,"rgb("+n.r+","+n.g+","+n.b+")"]];case"kelvin":for(var i=[],l=e.minTemperature,o=e.maxTemperature,s=o-l,a=l,c=0;a<o;a+=s/8,c+=1){var d=dr.kelvinToRgb(a),u=d.r,h=d.g,p=d.b;i.push([12.5*c,"rgb("+u+","+h+","+p+")"])}return i;case"hue":return[[0,"#f00"],[16.666,"#ff0"],[33.333,"#0f0"],[50,"#0ff"],[66.666,"#00f"],[83.333,"#f0f"],[100,"#f00"]];case"saturation":var f=dr.hsvToHsl({h:r.h,s:0,v:r.v}),g=dr.hsvToHsl({h:r.h,s:100,v:r.v});return[[0,"hsl("+f.h+","+f.s+"%,"+f.l+"%)"],[100,"hsl("+g.h+","+g.s+"%,"+g.l+"%)"]];default:var b=dr.hsvToHsl({h:r.h,s:r.s,v:100});return[[0,"#000"],[100,"hsl("+b.h+","+b.s+"%,"+b.l+"%)"]]}}(e,r);return xt(Lr,Object.assign({},e,{onInput:function(t,n,i){var l=function(e,t,r){var n,i=ur(e),l=i.handleRange,o=i.handleStart;n="horizontal"===e.layoutDirection?-1*r+l+o:t-o,n=Math.max(Math.min(n,l),0);var s=Math.round(100/l*n);switch(e.sliderType){case"kelvin":var a=e.minTemperature;return a+(e.maxTemperature-a)*(s/100);case"alpha":return s/100;case"hue":return 3.6*s;case"red":case"blue":case"green":return 2.55*s;default:return s}}(e,t,n);e.parent.inputActive=!0,r[e.sliderType]=l,e.onInput(i,e.id)}}),(function(t,n,c){return xt("div",Object.assign({},n,{className:"IroSlider",style:Object.assign({},{position:"relative",width:Nr(i),height:Nr(l),borderRadius:Nr(o),background:"conic-gradient(#ccc 25%, #fff 0 50%, #ccc 0 75%, #fff 0)",backgroundSize:"8px 8px"},c)}),xt("div",{className:"IroSliderGradient",style:Object.assign({},{position:"absolute",top:0,left:0,width:"100%",height:"100%",borderRadius:Nr(o),background:_r("linear","horizontal"===e.layoutDirection?"to top":"to right",a)},Tr(e))}),xt(Sr,{isActive:!0,index:r.index,r:e.handleRadius,url:e.handleSvg,props:e.handleProps,x:s.x,y:s.y}))}))}function qr(e){var t=wr(e),r=t.width,n=t.height,i=t.radius,l=e.colors,o=e.parent,s=e.activeIndex,a=void 0!==s&&s<e.colors.length?e.colors[s]:e.color,c=[[[0,"#fff"],[100,"hsl("+a.hue+",100%,50%)"]],[[0,"rgba(0,0,0,0)"],[100,"#000"]]],d=l.map((function(t){return function(e,t){var r=wr(e),n=r.width,i=r.height,l=r.radius,o=t.hsv,s=l,a=n-2*l,c=i-2*l;return{x:s+o.s/100*a,y:s+(c-o.v/100*c)}}(e,t)}));return xt(Lr,Object.assign({},e,{onInput:function(t,r,n){if(0===n){var i=kr(e,t,r,d);null!==i?o.setActiveColor(i):(o.inputActive=!0,a.hsv=Cr(e,t,r),e.onInput(n,e.id))}else 1===n&&(o.inputActive=!0,a.hsv=Cr(e,t,r));e.onInput(n,e.id)}}),(function(t,o,s){return xt("div",Object.assign({},o,{className:"IroBox",style:Object.assign({},{width:Nr(r),height:Nr(n),position:"relative"},s)}),xt("div",{className:"IroBox",style:Object.assign({},{width:"100%",height:"100%",borderRadius:Nr(i)},Tr(e),{background:_r("linear","to bottom",c[1])+","+_r("linear","to right",c[0])})}),l.filter((function(e){return e!==a})).map((function(t){return xt(Sr,{isActive:!1,index:t.index,fill:t.hslString,r:e.handleRadius,url:e.handleSvg,props:e.handleProps,x:d[t.index].x,y:d[t.index].y})})),xt(Sr,{isActive:!0,index:a.index,fill:a.hslString,r:e.activeHandleRadius||e.handleRadius,url:e.handleSvg,props:e.handleProps,x:d[a.index].x,y:d[a.index].y}))}))}function Er(e){var t=mr(e).width,r=e.colors,n=(e.borderWidth,e.parent),i=e.color,l=i.hsv,o=r.map((function(t){return function(e,t){var r=t.hsv,n=mr(e),i=n.cx,l=n.cy,o=br(e),s=(180+vr(e,r.h,!0))*(pr/360),a=r.s/100*o,c="clockwise"===e.wheelDirection?-1:1;return{x:i+a*Math.cos(s)*c,y:l+a*Math.sin(s)*c}}(e,t)})),s={position:"absolute",top:0,left:0,width:"100%",height:"100%",borderRadius:"50%",boxSizing:"border-box"};return xt(Lr,Object.assign({},e,{onInput:function(t,r,l){if(0===l){if(!function(e,t,r){var n=mr(e),i=n.cx,l=n.cy,o=e.width/2;return gr(i-t,l-r)<o}(e,t,r))return!1;var s=kr(e,t,r,o);null!==s?n.setActiveColor(s):(n.inputActive=!0,i.hsv=yr(e,t,r),e.onInput(l,e.id))}else 1===l&&(n.inputActive=!0,i.hsv=yr(e,t,r));e.onInput(l,e.id)}}),(function(n,a,c){return xt("div",Object.assign({},a,{className:"IroWheel",style:Object.assign({},{width:Nr(t),height:Nr(t),position:"relative"},c)}),xt("div",{className:"IroWheelHue",style:Object.assign({},s,{transform:"rotateZ("+(e.wheelAngle+90)+"deg)",background:"clockwise"===e.wheelDirection?"conic-gradient(red, yellow, lime, aqua, blue, magenta, red)":"conic-gradient(red, magenta, blue, aqua, lime, yellow, red)"})}),xt("div",{className:"IroWheelSaturation",style:Object.assign({},s,{background:"radial-gradient(circle closest-side, #fff, transparent)"})}),e.wheelLightness&&xt("div",{className:"IroWheelLightness",style:Object.assign({},s,{background:"#000",opacity:1-l.v/100})}),xt("div",{className:"IroWheelBorder",style:Object.assign({},s,Tr(e))}),r.filter((function(e){return e!==i})).map((function(t){return xt(Sr,{isActive:!1,index:t.index,fill:t.hslString,r:e.handleRadius,url:e.handleSvg,props:e.handleProps,x:o[t.index].x,y:o[t.index].y})})),xt(Sr,{isActive:!0,index:i.index,fill:i.hslString,r:e.activeHandleRadius||e.handleRadius,url:e.handleSvg,props:e.handleProps,x:o[i.index].x,y:o[i.index].y}))}))}Sr.defaultProps={fill:"none",x:0,y:0,r:8,url:null,props:{x:0,y:0}},jr.defaultProps=Object.assign({},{sliderShape:"bar",sliderType:"value",minTemperature:2200,maxTemperature:11e3});var Mr=function(e){function t(t){var r=this;e.call(this,t),this.colors=[],this.inputActive=!1,this.events={},this.activeEvents={},this.deferredEvents={},this.id=t.id,(t.colors.length>0?t.colors:[t.color]).forEach((function(e){return r.addColor(e)})),this.setActiveColor(0),this.state=Object.assign({},t,{color:this.color,colors:this.colors,layout:t.layout})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.addColor=function(e,t){void 0===t&&(t=this.colors.length);var r=new dr(e,this.onColorChange.bind(this));this.colors.splice(t,0,r),this.colors.forEach((function(e,t){return e.index=t})),this.state&&this.setState({colors:this.colors}),this.deferredEmit("color:init",r)},t.prototype.removeColor=function(e){var t=this.colors.splice(e,1)[0];t.unbind(),this.colors.forEach((function(e,t){return e.index=t})),this.state&&this.setState({colors:this.colors}),t.index===this.color.index&&this.setActiveColor(0),this.emit("color:remove",t)},t.prototype.setActiveColor=function(e){this.color=this.colors[e],this.state&&this.setState({color:this.color}),this.emit("color:setActive",this.color)},t.prototype.setColors=function(e,t){var r=this;void 0===t&&(t=0),this.colors.forEach((function(e){return e.unbind()})),this.colors=[],e.forEach((function(e){return r.addColor(e)})),this.setActiveColor(t),this.emit("color:setAll",this.colors)},t.prototype.on=function(e,t){var r=this,n=this.events;(Array.isArray(e)?e:[e]).forEach((function(e){(n[e]||(n[e]=[])).push(t),r.deferredEvents[e]&&(r.deferredEvents[e].forEach((function(e){t.apply(null,e)})),r.deferredEvents[e]=[])}))},t.prototype.off=function(e,t){var r=this;(Array.isArray(e)?e:[e]).forEach((function(e){var n=r.events[e];n&&n.splice(n.indexOf(t),1)}))},t.prototype.emit=function(e){for(var t=this,r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];var i=this.activeEvents;i.hasOwnProperty(e)&&i[e]||(i[e]=!0,(this.events[e]||[]).forEach((function(e){return e.apply(t,r)})),i[e]=!1)},t.prototype.deferredEmit=function(e){for(var t,r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];var i=this.deferredEvents;(t=this).emit.apply(t,[e].concat(r)),(i[e]||(i[e]=[])).push(r)},t.prototype.setOptions=function(e){this.setState(e)},t.prototype.resize=function(e){this.setOptions({width:e})},t.prototype.reset=function(){this.colors.forEach((function(e){return e.reset()})),this.setState({colors:this.colors})},t.prototype.onMount=function(e){this.el=e,this.deferredEmit("mount",this)},t.prototype.onColorChange=function(e,t){this.setState({color:this.color}),this.inputActive&&(this.inputActive=!1,this.emit("input:change",e,t)),this.emit("color:change",e,t)},t.prototype.emitInputEvent=function(e,t){0===e?this.emit("input:start",this.color,t):1===e?this.emit("input:move",this.color,t):2===e&&this.emit("input:end",this.color,t)},t.prototype.render=function(e,t){var r=this,n=t.layout;return Array.isArray(n)||(n=[{component:Er},{component:jr}],t.transparency&&n.push({component:jr,options:{sliderType:"alpha"}})),xt("div",{class:"IroColorPicker",id:t.id,style:{display:t.display}},n.map((function(e,n){var i=e.component,l=e.options;return xt(i,Object.assign({},t,l,{ref:void 0,onInput:r.emitInputEvent.bind(r),parent:r,index:n}))})))},t}(_t);Mr.defaultProps=Object.assign({},{width:300,height:300,color:"#fff",colors:[],padding:6,layoutDirection:"vertical",borderColor:"#fff",borderWidth:0,handleRadius:8,activeHandleRadius:null,handleSvg:null,handleProps:{x:0,y:0},wheelLightness:!0,wheelAngle:0,wheelDirection:"anticlockwise",sliderSize:null,sliderMargin:12,boxHeight:null},{colors:[],display:"block",id:null,layout:"default",margin:null});var Br,Rr,Or,Pr=(Rr=function(e,t){var r,n=document.createElement("div");function i(){var t=e instanceof Element?e:document.querySelector(e);t.appendChild(r.base),r.onMount(t)}return function(e,t,r){var n,i,l;at.__p&&at.__p(e,t),i=(n=r===ht)?null:t.__k,e=xt(Tt,null,[e]),l=[],Rt(t,t.__k=e,i||mt,mt,void 0!==t.ownerSVGElement,i?null:vt.slice.call(t.childNodes),l,!1,mt,n),Ot(l,e)}(xt(Br,Object.assign({},{ref:function(e){return r=e}},t)),n),"loading"!==document.readyState?i():document.addEventListener("DOMContentLoaded",i),r},Rr.prototype=(Br=Mr).prototype,Object.assign(Rr,Br),Rr.__component=Br,Rr);!function(e){var t;e.version="5.5.2",e.Color=dr,e.ColorPicker=Pr,(t=e.ui||(e.ui={})).h=xt,t.ComponentBase=Lr,t.Handle=Sr,t.Slider=jr,t.Wheel=Er,t.Box=qr}(Or||(Or={}));var Ir=Or;const zr=[{icon:'<?xml version="1.0" encoding="UTF-8"?><svg width="16" height="16" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M43 11L16.875 37L5 25.1818" stroke="#008a00" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>',label:"save",type:"button"},{icon:'<?xml version="1.0" encoding="UTF-8"?><svg width="16" height="16" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8 8L40 40" stroke="#db3700" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M8 40L40 8" stroke="#db3700" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>',label:"cancel",type:"button"}],Dr=[{value:"#000000",describe:"black"},{value:"#4d4d4d",describe:"dimGrey"},{value:"#808080",describe:"grey"},{value:"#e6e6e6",describe:"lightGrey"},{value:"#ffffff",describe:"white"},{value:"#ff0000",describe:"red"},{value:"#ffa500",describe:"orange"},{value:"#ffff00",describe:"yellow"},{value:"#99e64d",describe:"lightGreen"},{value:"#008000",describe:"green"},{value:"#7fffd4",describe:"aquamarine"},{value:"#40e0d0",describe:"turquoise"},{value:"#4d99e6",describe:"lightBlue"},{value:"#0000ff",describe:"blue"},{value:"#800080",describe:"purple"}];var Hr,Fr=class{constructor(e,t){this.tableMenus=e,this.options=t,this.attrs=Object.assign({},t.attribute),this.borderForm=[],this.saveButton=null,this.form=this.createPropertiesForm(t)}checkBtnsAction(e){"save"===e&&this.saveAction(this.options.type),this.removePropertiesForm(),this.tableMenus.showMenus(),this.tableMenus.updateMenus()}createActionBtns(e,t){const r=this.getUseLanguage(),n=document.createElement("div"),i=document.createDocumentFragment();n.classList.add("properties-form-action-row");for(const{icon:e,label:n,type:l}of zr){const o=document.createElement("button"),s=document.createElement("span");if(s.innerHTML=e,o.appendChild(s),D(o,{label:n,type:l}),t){const e=document.createElement("span");e.innerText=r(n),o.appendChild(e)}i.appendChild(o)}return n.addEventListener("click",(t=>e(t))),n.appendChild(i),n}createCheckBtns(e){const{menus:t,propertyName:r}=e,n=document.createElement("div"),i=document.createDocumentFragment();for(const{icon:e,describe:n,align:l}of t){const t=document.createElement("span");t.innerHTML=e,t.setAttribute("data-align",l),t.classList.add("ql-table-tooltip-hover"),this.options.attribute[r]===l&&t.classList.add("ql-table-btns-checked");const o=k(n);t.appendChild(o),i.appendChild(t)}return n.classList.add("ql-table-check-container"),n.appendChild(i),n.addEventListener("click",(e=>{const t=e.target.closest("span.ql-table-tooltip-hover"),i=t.getAttribute("data-align");this.switchButton(n,t),this.setAttribute(r,i)})),n}createColorContainer(e){const t=document.createElement("div");t.classList.add("ql-table-color-container");const r=this.createColorInput(e),n=this.createColorPicker(e);return t.appendChild(r),t.appendChild(n),t}createColorInput(e){const t=this.createInput(e);return t.classList.add("label-field-view-color"),t}createColorList(e){const t=this.getUseLanguage(),r=document.createElement("ul"),n=document.createDocumentFragment();r.classList.add("color-list");for(const{value:e,describe:r}of Dr){const i=document.createElement("li"),l=k(t(r));i.setAttribute("data-color",e),i.classList.add("ql-table-tooltip-hover"),H(i,{"background-color":e}),i.appendChild(l),n.appendChild(i)}return r.appendChild(n),r.addEventListener("click",(t=>{const n=t.target,i=("DIV"===n.tagName?n.parentElement:n).getAttribute("data-color");this.setAttribute(e,i,r),this.updateInputStatus(r,!1,!0)})),r}createColorPicker(e){const{propertyName:t,value:r}=e,n=document.createElement("span"),i=document.createElement("span");n.classList.add("color-picker"),i.classList.add("color-button"),r?H(i,{"background-color":r}):i.classList.add("color-unselected");const l=this.createColorPickerSelect(t);return i.addEventListener("click",(()=>{this.toggleHidden(l);const e=this.getColorClosest(n),t=null==e?void 0:e.querySelector(".property-input");this.updateSelectedStatus(l,null==t?void 0:t.value,"color")})),n.appendChild(i),n.appendChild(l),n}createColorPickerIcon(e,t,r){const n=document.createElement("div"),i=document.createElement("span"),l=document.createElement("button");return i.innerHTML=e,l.innerText=t,n.classList.add("erase-container"),n.appendChild(i),n.appendChild(l),n.addEventListener("click",r),n}createColorPickerSelect(e){const t=this.getUseLanguage(),r=document.createElement("div"),n=this.createColorPickerIcon('<?xml version="1.0" encoding="UTF-8"?><svg width="16" height="16" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4 42H44" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M31 4L7 28L13 34H21L41 14L31 4Z" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>',t("removeColor"),(()=>{this.setAttribute(e,"",r),this.updateInputStatus(r,!1,!0)})),i=this.createColorList(e),l=this.createPalette(e,t,r);return r.classList.add("color-picker-select","ql-hidden"),r.appendChild(n),r.appendChild(i),r.appendChild(l),r}createDropdown(e,t){const r=document.createElement("div"),n=document.createElement("span"),i=document.createElement("span");return"dropdown"===t&&(i.innerHTML=bt,i.classList.add("ql-table-dropdown-icon")),e&&(n.innerText=e),r.classList.add("ql-table-dropdown-properties"),n.classList.add("ql-table-dropdown-text"),r.appendChild(n),"dropdown"===t&&r.appendChild(i),{dropdown:r,dropText:n}}createInput(e){const{attribute:t,message:r,propertyName:n,value:i,valid:l}=e,{placeholder:o=""}=t,s=document.createElement("div"),a=document.createElement("div"),c=document.createElement("label"),d=document.createElement("input"),u=document.createElement("div");return s.classList.add("label-field-view"),a.classList.add("label-field-view-input-wrapper"),c.innerText=o,D(d,t),d.classList.add("property-input"),d.value=i,d.addEventListener("input",(e=>{const t=e.target.value;l&&this.switchHidden(u,l(t)),this.updateInputStatus(a,l&&!l(t)),this.setAttribute(n,t,s)})),u.classList.add("label-field-view-status","ql-hidden"),r&&(u.innerText=r),a.appendChild(d),a.appendChild(c),s.appendChild(a),l&&s.appendChild(u),s}createList(e,t){const{options:r,propertyName:n}=e;if(!r.length)return null;const i=document.createElement("ul");for(const e of r){const t=document.createElement("li");t.innerText=e,i.appendChild(t)}return i.classList.add("ql-table-dropdown-list","ql-hidden"),i.addEventListener("click",(e=>{const r=e.target.innerText;t.innerText=r,this.toggleBorderDisabled(r),this.setAttribute(n,r)})),i}createPalette(e,t,r){const n=document.createElement("div"),i=document.createElement("div"),l=document.createElement("div"),o=document.createElement("div"),s=new Ir.ColorPicker(o,{width:110,layout:[{component:Ir.ui.Wheel,options:{}}]}),a=this.createColorPickerIcon('<?xml version="1.0" encoding="UTF-8"?><svg width="16" height="16" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M24 44C29.9601 44 26.3359 35.136 30 31C33.1264 27.4709 44 29.0856 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/><path d="M28 17C29.6569 17 31 15.6569 31 14C31 12.3431 29.6569 11 28 11C26.3431 11 25 12.3431 25 14C25 15.6569 26.3431 17 28 17Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/><path d="M16 21C17.6569 21 19 19.6569 19 18C19 16.3431 17.6569 15 16 15C14.3431 15 13 16.3431 13 18C13 19.6569 14.3431 21 16 21Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/><path d="M17 34C18.6569 34 20 32.6569 20 31C20 29.3431 18.6569 28 17 28C15.3431 28 14 29.3431 14 31C14 32.6569 15.3431 34 17 34Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/></svg>',t("colorPicker"),(()=>this.toggleHidden(i))),c=this.createActionBtns((t=>{const l=t.target.closest("button");l&&("save"===l.getAttribute("label")&&(this.setAttribute(e,s.color.hexString,r),this.updateInputStatus(n,!1,!0)),i.classList.add("ql-hidden"),r.classList.add("ql-hidden"))}),!1);return i.classList.add("color-picker-palette","ql-hidden"),l.classList.add("color-picker-wrap"),o.classList.add("iro-container"),l.appendChild(o),l.appendChild(c),i.appendChild(l),n.appendChild(a),n.appendChild(i),n}createProperty(e){const{content:t,children:r}=e,n=this.getUseLanguage(),i=document.createElement("div"),l=document.createElement("label");l.innerText=t,l.classList.add("ql-table-dropdown-label"),i.classList.add("properties-form-row"),1===r.length&&i.classList.add("properties-form-row-full"),i.appendChild(l);for(const e of r){const r=this.createPropertyChild(e);r&&i.appendChild(r),r&&t===n("border")&&this.borderForm.push(r)}return i}createPropertyChild(e){const{category:t,value:r}=e;switch(t){case"dropdown":const{dropdown:n,dropText:i}=this.createDropdown(r,t),l=this.createList(e,i);return n.appendChild(l),n.addEventListener("click",(()=>{this.toggleHidden(l),this.updateSelectedStatus(n,i.innerText,"dropdown")})),n;case"color":return this.createColorContainer(e);case"menus":return this.createCheckBtns(e);case"input":return this.createInput(e)}}createPropertiesForm(e){const t=this.getUseLanguage(),{title:r,properties:n}=function({type:e,attribute:t},r){return"table"===e?function(e,t){return{title:t("tblProps"),properties:[{content:t("border"),children:[{category:"dropdown",propertyName:"border-style",value:e["border-style"],options:["dashed","dotted","double","groove","inset","none","outset","ridge","solid"]},{category:"color",propertyName:"border-color",value:e["border-color"],attribute:{type:"text",placeholder:t("color")},valid:I,message:t("colorMsg")},{category:"input",propertyName:"border-width",value:x(e["border-width"]),attribute:{type:"text",placeholder:t("width")},valid:z,message:t("dimsMsg")}]},{content:t("background"),children:[{category:"color",propertyName:"background-color",value:e["background-color"],attribute:{type:"text",placeholder:t("color")},valid:I,message:t("colorMsg")}]},{content:t("dimsAlm"),children:[{category:"input",propertyName:"width",value:x(e.width),attribute:{type:"text",placeholder:t("width")},valid:z,message:t("dimsMsg")},{category:"input",propertyName:"height",value:x(e.height),attribute:{type:"text",placeholder:t("height")},valid:z,message:t("dimsMsg")},{category:"menus",propertyName:"align",value:e.align,menus:[{icon:s,describe:t("alTblL"),align:"left"},{icon:o,describe:t("tblC"),align:"center"},{icon:a,describe:t("alTblR"),align:"right"}]}]}]}}(t,r):function(e,t){return{title:t("cellProps"),properties:[{content:t("border"),children:[{category:"dropdown",propertyName:"border-style",value:e["border-style"],options:["dashed","dotted","double","groove","inset","none","outset","ridge","solid"]},{category:"color",propertyName:"border-color",value:e["border-color"],attribute:{type:"text",placeholder:t("color")},valid:I,message:t("colorMsg")},{category:"input",propertyName:"border-width",value:x(e["border-width"]),attribute:{type:"text",placeholder:t("width")},valid:z,message:t("dimsMsg")}]},{content:t("background"),children:[{category:"color",propertyName:"background-color",value:e["background-color"],attribute:{type:"text",placeholder:t("color")},valid:I,message:t("colorMsg")}]},{content:t("dims"),children:[{category:"input",propertyName:"width",value:x(e.width),attribute:{type:"text",placeholder:t("width")},valid:z,message:t("dimsMsg")},{category:"input",propertyName:"height",value:x(e.height),attribute:{type:"text",placeholder:t("height")},valid:z,message:t("dimsMsg")},{category:"input",propertyName:"padding",value:x(e.padding),attribute:{type:"text",placeholder:t("padding")},valid:z,message:t("dimsMsg")}]},{content:t("tblCellTxtAlm"),children:[{category:"menus",propertyName:"text-align",value:e["text-align"],menus:[{icon:s,describe:t("alCellTxtL"),align:"left"},{icon:o,describe:t("alCellTxtC"),align:"center"},{icon:a,describe:t("alCellTxtR"),align:"right"},{icon:'<?xml version="1.0" encoding="UTF-8"?><svg width="16" height="16" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M42 19H6" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M42 9H6" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M42 29H6" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M42 39H6" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>',describe:t("jusfCellTxt"),align:"justify"}]},{category:"menus",propertyName:"vertical-align",value:e["vertical-align"],menus:[{icon:'<?xml version="1.0" encoding="UTF-8"?><svg width="16" height="16" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 36.3056H42" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M6 42H42" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M30 12L24 6L18 12V12" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M24 6V29" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>',describe:t("alCellTxtT"),align:"top"},{icon:'<?xml version="1.0" encoding="UTF-8"?><svg width="16" height="16" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18 36L24 30L30 36" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M23.9999 30.9998V43.9998" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M18 12L24 18L30 12" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M23.9999 17.0002V4.00022" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M6 24.0004H42" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>',describe:t("alCellTxtM"),align:"middle"},{icon:'<?xml version="1.0" encoding="UTF-8"?><svg width="16" height="16" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 36.3056H42" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M6 42H42" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M30 23L24 29L18 23V23" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M24 6V29" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>',describe:t("alCellTxtB"),align:"bottom"}]}]}]}}(t,r)}(e,t),i=document.createElement("div");i.classList.add("ql-table-properties-form");const l=document.createElement("h2"),c=this.createActionBtns((e=>{const t=e.target.closest("button");t&&this.checkBtnsAction(t.getAttribute("label"))}),!0);l.innerText=r,l.classList.add("properties-form-header"),i.appendChild(l);for(const e of n){const t=this.createProperty(e);i.appendChild(t)}return i.appendChild(c),this.setBorderDisabled(),this.tableMenus.quill.container.appendChild(i),this.updatePropertiesForm(i,e.type),this.setSaveButton(c),i.addEventListener("click",(e=>{const t=e.target;this.hiddenSelectList(t)})),i}getCellStyle(e,t){const r=(e.getAttribute("style")||"").split(";").filter((e=>e.trim())).reduce(((e,t)=>{const r=t.split(":");return Object.assign(Object.assign({},e),{[r[0].trim()]:r[1].trim()})}),{});return Object.assign(r,t),Object.keys(r).reduce(((e,t)=>e+`${t}: ${r[t]}; `),"")}getColorClosest(e){return L(e,".ql-table-color-container")}getComputeBounds(e){if("table"===e){const{table:e}=this.tableMenus,[t,r]=this.tableMenus.getCorrectBounds(e);return t.bottom>r.bottom?Object.assign(Object.assign({},t),{bottom:r.height}):t}{const{computeBounds:e}=this.tableMenus.getSelectedTdsInfo();return e}}getDiffProperties(){const e=this.attrs,t=this.options.attribute;return Object.keys(e).reduce(((r,n)=>{var i;return e[n]!==t[n]&&(r[n]=function(e){return!(!e.endsWith("width")&&!e.endsWith("height"))}(n)?(i=e[n])?i.replace(/\d+\.?\d*/,"")?i:i+"px":i:e[n]),r}),{})}getUseLanguage(){const{language:e}=this.tableMenus.tableBetter;return e.useLanguage.bind(e)}getViewportSize(){return{viewWidth:document.documentElement.clientWidth,viewHeight:document.documentElement.clientHeight}}hiddenSelectList(e){var t,r;const n=".ql-table-dropdown-properties",i=".color-picker",l=this.form.querySelectorAll(".ql-table-dropdown-list"),o=this.form.querySelectorAll(".color-picker-select");for(const s of[...l,...o])(null===(t=s.closest(n))||void 0===t?void 0:t.isEqualNode(e.closest(n)))||(null===(r=s.closest(i))||void 0===r?void 0:r.isEqualNode(e.closest(i)))||s.classList.add("ql-hidden")}removePropertiesForm(){this.form.remove(),this.borderForm=[]}saveAction(e){"table"===e?this.saveTableAction():this.saveCellAction()}saveCellAction(){var e;const{selectedTds:r}=this.tableMenus.tableBetter.cellSelection,{quill:n,table:i}=this.tableMenus,l=t().find(i),o=l.colgroup(),s=l.isPercent(),a=this.getDiffProperties(),c=parseFloat(a.width),d=(null===(e=a.width)||void 0===e?void 0:e.endsWith("%"))?c*R()/100:c,u=a["text-align"];u&&delete a["text-align"];const h=[];if(o&&d){delete a.width;const{operateLine:e}=this.tableMenus.tableBetter,{computeBounds:t}=this.tableMenus.getSelectedTdsInfo(),r=j(t,i,n.container);for(const t of r)e.setColWidth(t,`${d}`,s)}for(const e of r){const r=t().find(e),n=r.statics.blotName,i=r.formats()[n],l=this.getCellStyle(e,a);if(u){const e="left"===u?"":u;r.children.forEach((t=>{t.statics.blotName===m.blotName?t.children.forEach((t=>{t.format&&t.format("align",e)})):t.format("align",e)}))}const o=r.replaceWith(n,Object.assign(Object.assign({},i),{style:l}));h.push(o.domNode)}this.tableMenus.tableBetter.cellSelection.setSelectedTds(h),s||this.updateTableWidth(i,l,s)}saveTableAction(){var e;const{table:r,tableBetter:n}=this.tableMenus,i=null===(e=t().find(r).temporary())||void 0===e?void 0:e.domNode,l=r.querySelector("td,th"),o=this.getDiffProperties(),s=o.align;switch(delete o.align,s){case"center":Object.assign(o,{margin:"0 auto"});break;case"left":Object.assign(o,{margin:""});break;case"right":Object.assign(o,{"margin-left":"auto","margin-right":""})}H(i||r,o),n.cellSelection.setSelected(l)}setAttribute(e,t,r){this.attrs[e]=t,e.includes("-color")&&this.updateSelectColor(this.getColorClosest(r),t)}setBorderDisabled(){const[e]=this.borderForm,t=e.querySelector(".ql-table-dropdown-text").innerText;this.toggleBorderDisabled(t)}setSaveButton(e){const t=e.querySelector('button[label="save"]');this.saveButton=t}setSaveButtonDisabled(e){this.saveButton&&(e?this.saveButton.setAttribute("disabled","true"):this.saveButton.removeAttribute("disabled"))}switchButton(e,t){const r=e.querySelectorAll("span.ql-table-tooltip-hover");for(const e of r)e.classList.remove("ql-table-btns-checked");t.classList.add("ql-table-btns-checked")}switchHidden(e,t){t?e.classList.add("ql-hidden"):e.classList.remove("ql-hidden")}toggleBorderDisabled(e){const[,t,r]=this.borderForm;"none"!==e&&e?(t.classList.remove("ql-table-disabled"),r.classList.remove("ql-table-disabled")):(this.attrs["border-color"]="",this.attrs["border-width"]="",this.updateSelectColor(t,""),this.updateInputValue(r,""),t.classList.add("ql-table-disabled"),r.classList.add("ql-table-disabled"))}toggleHidden(e){e.classList.toggle("ql-hidden")}updateInputValue(e,t){e.querySelector(".property-input").value=t}updateInputStatus(e,t,r){const n=(r?this.getColorClosest(e):L(e,".label-field-view")).querySelector(".label-field-view-input-wrapper");t?(n.classList.add("label-field-view-error"),this.setSaveButtonDisabled(!0)):(n.classList.remove("label-field-view-error"),this.form.querySelectorAll(".label-field-view-error").length||this.setSaveButtonDisabled(!1))}updatePropertiesForm(e,t){e.classList.remove("ql-table-triangle-none");const{height:r,width:n}=e.getBoundingClientRect(),i=this.tableMenus.quill.container.getBoundingClientRect(),{top:l,left:o,right:s,bottom:a}=this.getComputeBounds(t),{viewHeight:c}=this.getViewportSize();let d=a+10,u=o+s-n>>1;d+i.top+r>c?(d=l-r-10,d<0?(d=i.height-r>>1,e.classList.add("ql-table-triangle-none")):(e.classList.add("ql-table-triangle-up"),e.classList.remove("ql-table-triangle-down"))):(e.classList.add("ql-table-triangle-down"),e.classList.remove("ql-table-triangle-up")),u<i.left?(u=0,e.classList.add("ql-table-triangle-none")):u+n>i.right&&(u=i.right-n,e.classList.add("ql-table-triangle-none")),H(e,{left:`${u}px`,top:`${d}px`})}updateSelectColor(e,t){const r=e.querySelector(".property-input"),n=e.querySelector(".color-button"),i=e.querySelector(".color-picker-select"),l=e.querySelector(".label-field-view-status");t?n.classList.remove("color-unselected"):n.classList.add("color-unselected"),r.value=t,H(n,{"background-color":t}),i.classList.add("ql-hidden"),this.switchHidden(l,I(t))}updateSelectedStatus(e,t,r){const n="color"===r?".color-list":".ql-table-dropdown-list",i=e.querySelector(n);if(!i)return;const l=Array.from(i.querySelectorAll("li"));for(const e of l)e.classList.remove(`ql-table-${r}-selected`);const o=l.find((e=>("color"===r?e.getAttribute("data-color"):e.innerText)===t));o&&o.classList.add(`ql-table-${r}-selected`)}updateTableWidth(e,t,r){const n=t.temporary();H(e,{width:"auto"});const{width:i}=e.getBoundingClientRect();e.style.removeProperty("width"),H(n.domNode,{width:O(i,r)})}};!function(e){e.left="margin-left",e.right="margin-right"}(Hr||(Hr={}));var Vr=class{constructor(e,t){this.quill=e,this.table=null,this.prevList=null,this.prevTooltip=null,this.scroll=!1,this.tableBetter=t,this.tablePropertiesForm=null,this.tableHeaderRow=null,this.quill.root.addEventListener("click",this.handleClick.bind(this)),this.root=this.createMenus()}convertToRow(){var e;const r=t().find(this.table),n=r.tbody(),i=n||this.quill.scroll.create(Q.blotName),l=null===(e=null==i?void 0:i.children)||void 0===e?void 0:e.head,o=this.getCorrectRows(),s=[];let a=o[0].next;for(;a;)o.unshift(a),a=a.next;for(const e of o){const t=this.quill.scroll.create(J.blotName);e.children.forEach((e=>{const r=e.formats()[e.statics.blotName],n=e.domNode.cloneNode(!0),i=this.quill.scroll.create(n).replaceWith(Z.blotName,r);t.insertBefore(i,null)})),s.unshift([t,l]),e.remove()}for(const[e,t]of s)i.insertBefore(e,t);n||r.insertBefore(i,null);const[c]=i.descendant(Z);this.tableBetter.cellSelection.setSelected(c.domNode)}convertToHeaderRow(){const e=t().find(this.table);let r=e.thead();if(!r){const t=e.tbody();r=this.quill.scroll.create(ee.blotName),e.insertBefore(r,t)}const n=this.getCorrectRows();let i=n[0].prev;for(;i;)n.unshift(i),i=i.prev;for(const e of n){const t=this.quill.scroll.create(X.blotName);e.children.forEach((e=>{const r=e.formats()[e.statics.blotName],n=e.domNode.cloneNode(!0),i=this.quill.scroll.create(n).replaceWith(Y.blotName,r);t.insertBefore(i,null)})),r.insertBefore(t,null),e.remove()}const[l]=r.descendant(Y);this.tableBetter.cellSelection.setSelected(l.domNode)}copyTable(){return function(e,t,r,n){return new(r||(r=Promise))((function(i,l){function o(e){try{a(n.next(e))}catch(e){l(e)}}function s(e){try{a(n.throw(e))}catch(e){l(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}a((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){if(!this.table)return;const e=t().find(this.table);if(!e)return;const r="<p><br></p>"+e.getCopyTable(),n=this.tableBetter.cellSelection.getText(r),i=new ClipboardItem({"text/html":new Blob([r],{type:"text/html"}),"text/plain":new Blob([n],{type:"text/plain"})});try{yield navigator.clipboard.write([i]);const r=this.quill.getIndex(e),n=e.length();this.quill.setSelection(r+n,t().sources.SILENT),this.tableBetter.hideTools(),this.quill.scrollSelectionIntoView()}catch(e){console.error("Failed to copy table:",e)}}))}createList(e){if(!e)return null;const t=document.createElement("ul");for(const[,r]of Object.entries(e)){const{content:e,divider:n,createSwitch:i,handler:l}=r,o=document.createElement("li");if(i?(o.classList.add("ql-table-header-row"),o.appendChild(this.createSwitch(e)),this.tableHeaderRow=o):o.innerText=e,o.addEventListener("click",l.bind(this)),t.appendChild(o),n){const e=document.createElement("li");e.classList.add("ql-table-divider"),t.appendChild(e)}}return t.classList.add("ql-table-dropdown-list","ql-hidden"),t}createMenu(e,t,r,n){const i=document.createElement("div"),l=document.createElement("span");return l.innerHTML=r?e+t:e,i.classList.add("ql-table-dropdown"),l.classList.add("ql-table-tooltip-hover"),i.setAttribute("data-category",n),i.appendChild(l),i}createMenus(){const{language:e,options:t={}}=this.tableBetter,{menus:r}=t,n=e.useLanguage.bind(e),i=document.createElement("div");i.classList.add("ql-table-menus-container","ql-hidden");for(const[e,t]of Object.entries(function(e,t){const r={column:{content:e("col"),icon:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1692084271333" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2200" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M9.14372835 1039.20071111L1020.26808889 1039.20071111l0-1048.576L9.14372835-9.37528889 9.14372835 1039.20071111z m252.77672107-711.53454649l1e-8-262.144 175.00150897 0 0 262.144L261.92044942 327.66616462zM942.48705138 702.1592576l0 262.14400001-178.89289103-1e-8 1e-8-262.144 178.89289102 0z m-256.66810311 0l0 262.144-171.11595236 0 0-262.144 171.11595236 0z m-248.89698987 0l0 262.144L261.92044943 964.3032576l-1e-8-262.144 175.00150898 0z m505.56509298-299.59563948L942.48705139 627.26180409l-178.89289104 0 0-224.69818596 178.89289103-1e-8z m-256.66810311 1e-8L685.81894827 627.26180409l-171.11595236 0 0-224.69818596 171.11595236 0z m-248.89698987 0L436.9219584 627.26180409 261.92044943 627.26180409l0-224.69818596 175.00150897 0z m505.56509298-337.04145352l0 262.14400001-178.89289102 0-1e-8-262.144 178.89289103-1e-8z m-256.66810311 1e-8l0 262.144-171.11595236 0 0-262.144 171.11595236 0z" fill="#515151" p-id="2201"></path></svg>',handler(e,t){this.toggleAttribute(e,t)},children:{left:{content:e("insColL"),handler(){const{leftTd:e}=this.getSelectedTdsInfo(),t=this.table.getBoundingClientRect();this.insertColumn(e,0),F(this.table,t,72),this.updateMenus()}},right:{content:e("insColR"),handler(){const{rightTd:e}=this.getSelectedTdsInfo(),t=this.table.getBoundingClientRect();this.insertColumn(e,1),F(this.table,t,72),this.updateMenus()}},delete:{content:e("delCol"),handler(){this.deleteColumn()}},select:{content:e("selCol"),handler(){this.selectColumn()}}}},row:{content:e("row"),icon:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1692084279720" class="icon" viewBox="0 0 1181 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2344" xmlns:xlink="http://www.w3.org/1999/xlink" width="18.453125" height="16"><path d="M1142.15367111 0H39.38417778C7.99630222 0 0 8.27050667 0 39.38531555v945.2293689C0 1015.72949333 7.99516445 1024 39.38531555 1024h1102.76835556c31.39128889 0 39.38417778-8.27050667 39.38417778-39.38531555V39.38531555c0-31.11480889-7.99516445-39.38531555-39.38417778-39.38531555zM354.46328889 945.23050667l-276.992 3.26997333V749.568l276.992-1.25952v196.92202667z m0-275.69265778H78.76835555V472.61468445h275.69265778v196.92316444z m0-275.69152H78.76835555V236.30848h275.69265778v157.53671111z m393.84632889 551.38417778H433.23050667V748.30848h315.07683555v196.92202667z m0-275.69265778H433.23050667V472.61468445h315.07683555v196.92316444z m0-275.69152H433.23050667V236.30848h315.07683555v157.53671111z m354.46101333 551.38417778H827.07683555V748.30848h275.69265778v196.92202667z m0-275.69265778H827.07683555V472.61468445h275.69265778v196.92316444z m0-275.69152H827.07683555V236.30848h275.69265778v157.53671111z" fill="#515151" p-id="2345"></path></svg>',handler(e,t,r){this.toggleAttribute(e,t,r)},children:{header:{content:e("headerRow"),divider:!0,createSwitch:!0,handler(){this.toggleHeaderRow(),this.toggleHeaderRowSwitch()}},above:{content:e("insRowAbv"),handler(){const{leftTd:e}=this.getSelectedTdsInfo();this.insertRow(e,0),this.updateMenus()}},below:{content:e("insRowBlw"),handler(){const{rightTd:e}=this.getSelectedTdsInfo();this.insertRow(e,1),this.updateMenus()}},delete:{content:e("delRow"),handler(){this.deleteRow()}},select:{content:e("selRow"),handler(){this.selectRow()}}}},merge:{content:e("mCells"),icon:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1692084199654" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1975" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M776.08580741 364.42263703c-15.53445925-7.76722963-31.06891852-7.76722963-46.60337778 0L589.6722963 512l139.81013333 147.57736297c15.53445925 7.76722963 31.06891852 7.76722963 46.60337778 0 15.53445925-15.53445925 15.53445925-31.06891852 0-46.60337779L706.18074075 543.06891852h163.11182222c15.53445925 0 31.06891852-15.53445925 31.06891851-31.06891852s-15.53445925-31.06891852-31.06891851-31.06891852H706.18074075l69.90506666-69.90506666c7.76722963-15.53445925 7.76722963-31.06891852 0-46.60337779z m-528.17161482 0c-15.53445925 15.53445925-15.53445925 31.06891852 0 46.60337779l69.90506666 69.90506666H154.70743703c-15.53445925 0-31.06891852 15.53445925-31.06891851 31.06891852s15.53445925 31.06891852 31.06891851 31.06891852H317.81925925l-69.90506666 69.90506666c-15.53445925 15.53445925-15.53445925 31.06891852 0 46.60337779 15.53445925 7.76722963 31.06891852 7.76722963 46.60337778 0L434.3277037 512 294.51757037 364.42263703c-15.53445925-7.76722963-31.06891852-7.76722963-46.60337778 0z" fill="#515151" p-id="1976"></path><path d="M317.81925925 939.19762963H84.80237037V84.80237037h233.01688888v116.50844445h77.6722963V7.13007408H7.13007408v1009.73985184h388.36148147V822.68918518h-77.6722963zM628.50844445 7.13007408v194.18074074h77.6722963v-116.50844445h233.01688888v854.39525926H706.18074075v-116.50844445h-77.6722963v194.18074074h388.36148147V7.13007408z" fill="#515151" p-id="1977"></path></svg>',handler(e,t){this.toggleAttribute(e,t)},children:{merge:{content:e("mCells"),handler(){this.mergeCells(),this.updateMenus()}},split:{content:e("sCell"),handler(){this.splitCell(),this.updateMenus()}}}},table:{content:e("tblProps"),icon:gt,handler(e,t){const r=Object.assign(Object.assign({},P(this.table,p)),{align:this.getTableAlignment(this.table)});this.toggleAttribute(e,t),this.tablePropertiesForm=new Fr(this,{attribute:r,type:"table"}),this.hideMenus()}},cell:{content:e("cellProps"),icon:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1692084286647" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2488" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M1058.13333333 0v1024H-34.13333333V0h1092.26666666zM460.8 563.2H68.26666667V921.6h392.53333333V563.2z m494.93333333 0H563.2V921.6h392.53333333V563.2zM460.8 102.4H68.26666667v358.4h392.53333333V102.4z" fill="#515151" p-id="2489"></path></svg>',handler(e,t){const{selectedTds:r}=this.tableBetter.cellSelection,n=r.length>1?this.getSelectedTdsAttrs(r):this.getSelectedTdAttrs(r[0]);this.toggleAttribute(e,t),this.tablePropertiesForm=new Fr(this,{attribute:n,type:"cell"}),this.hideMenus()}},wrap:{content:e("insParaOTbl"),icon:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1692084879007" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="968" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M512 332.57913685H49.39294151c-20.56031346 0-41.12062691-17.13359531-41.12062805-41.12062692V44.73474502c0-20.56031346 17.13359531-41.12062691 41.12062805-41.12062691H512c20.56031346 0 41.12062691 17.13359531 41.12062691 41.12062691v246.72376491c0 23.98703275-17.13359531 41.12062691-41.12062691 41.12062692zM90.51356843 250.33788188h380.36580466V85.85537308H90.51356843v164.4825088z m884.09349006 757.30488889h-925.21411698c-20.56031346 0-41.12062691-17.13359531-41.12062805-41.12062692v-246.72376491c0-20.56031346 17.13359531-41.12062691 41.12062805-41.12062691h921.78739883c20.56031346 0 41.12062691 17.13359531 41.12062691 41.12062691v246.72376491c0 23.98703275-17.13359531 41.12062691-37.69390876 41.12062692zM90.51356843 928.82823509h842.97286314v-164.48250994H90.51356843v164.48250994z" fill="#515151" p-id="969"></path><path d="M974.60705849 1017.92292864h-925.21411698c-27.41375203 0-47.97406549-20.56031346-47.97406549-47.97406549v-246.72376491c0-27.41375203 20.56031346-47.97406549 47.97406549-47.97406549h921.78739883c27.41375203 0 47.97406549 20.56031346 47.97406435 47.97406549v246.72376491c3.42671929 23.98703275-20.56031346 47.97406549-44.5473462 47.97406549z m-925.21411698-325.53830173c-17.13359531 0-30.84047019 13.70687602-30.84047132 30.84047133v246.72376491c0 17.13359531 13.70687602 30.84047019 30.84047132 30.84047018h921.78739883c17.13359531 0 30.84047019-13.70687602 30.84047019-30.84047018v-246.72376491c0-17.13359531-13.70687602-30.84047019-30.84047019-30.84047133H49.39294151z m890.9469275 243.29704675h-856.67973802v-181.61610523h860.10645731v181.61610523h-3.42671929zM100.79372515 921.97479765h825.83926784V774.62588188H100.79372515v147.34891577z m411.20627485-582.54222223H49.39294151c-27.41375203 0-47.97406549-20.56031346-47.97406549-47.97406549V44.73474502c0-27.41375203 20.56031346-47.97406549 47.97406549-47.97406549H512c27.41375203 0 47.97406549 20.56031346 47.97406549 47.97406549v246.72376491c0 27.41375203-20.56031346 47.97406549-47.97406549 47.97406549zM49.39294151 13.89427484c-17.13359531 0-30.84047019 13.70687602-30.84047132 30.84047018v246.72376491c0 17.13359531 13.70687602 30.84047019 30.84047132 30.84047019H512c17.13359531 0 30.84047019-13.70687602 30.84047019-30.84047019V44.73474502c0-17.13359531-13.70687602-30.84047019-30.84047019-30.84047018H49.39294151zM481.15952981 260.61803974H83.66013099V79.00193451h397.49939882V260.61803974zM100.79372515 243.48444444h363.23220936V96.13552981H100.79372515v147.34891463z" fill="#515151" p-id="970"></path><path d="M974.60705849 130.40271929H628.50844445c-6.85343744 0-10.28015673 3.42671929-10.28015674 10.28015672v58.25422223c0 6.85343744 3.42671929 10.28015673 10.28015674 10.28015673h304.97798712V466.2211766H546.26718947l27.41375204-20.56031345c3.42671929-3.42671929 6.85343744-10.28015673 6.85343744-17.13359531v-58.25422223c0-6.85343744-3.42671929-10.28015673-10.28015673-10.28015672-3.42671929 0-3.42671929 0-6.85343744 3.42671928L409.19843157 486.78149006c-10.28015673 6.85343744-10.28015673 20.56031346-3.42671928 27.41375203l3.42671928 3.42671816 157.62907136 130.21532045c3.42671929 3.42671929 10.28015673 3.42671929 13.70687602 0 0-3.42671929 3.42671929-3.42671929 3.42671929-6.85343744v-61.6809415c0-6.85343744-3.42671929-10.28015673-6.85343858-13.70687602l-20.56031345-17.13359417h421.48643157c20.56031346 0 41.12062691-17.13359531 41.12062691-41.12062805V168.09662691c-6.85343744-20.56031346-23.98703275-37.69390877-44.5473462-37.69390762z" fill="#515151" p-id="971"></path><path d="M573.68094151 661.54415673c-3.42671929 0-6.85343744 0-10.28015673-3.42671929l-157.62907249-130.21531933-3.4267193-3.42671928c-3.42671929-6.85343744-6.85343744-13.70687602-6.85343744-20.56031346 0-6.85343744 3.42671929-13.70687602 10.28015674-20.5603146l157.62907249-126.78860117c3.42671929-3.42671929 6.85343744-3.42671929 10.28015673-3.42671815 10.28015673 0 17.13359531 6.85343744 17.13359417 17.13359416v58.25422223c0 10.28015673-3.42671929 17.13359531-10.28015673 23.98703275l-10.28015673 6.85343744H923.20627485v-239.87032634h-294.6978304c-10.28015673 0-17.13359531-6.85343744-17.13359531-17.13359416V140.68287601c0-10.28015673 6.85343744-17.13359531 17.13359531-17.13359531h346.09861404c27.41375203 0 47.97406549 20.56031346 47.97406549 47.9740655v335.81845732c0 27.41375203-20.56031346 47.97406549-47.97406549 47.97406549H577.10765966l3.42671929 3.42671929c6.85343744 6.85343744 10.28015673 13.70687602 10.28015673 20.56031346v61.6809415c0 3.42671929 0 6.85343744-3.42671815 10.28015674-3.42671929 6.85343744-10.28015673 10.28015673-13.70687602 10.28015673z m0-291.27111112l-157.6290725 126.78860117c-3.42671929 3.42671929-3.42671929 3.42671929-3.42671815 6.85343859s0 6.85343744 3.42671815 10.28015672l157.6290725 130.21532047h3.42671815v-61.68094151c0-3.42671929 0-6.85343744-3.42671815-10.28015673l-41.12062805-34.26718948h442.04674503c17.13359531 0 30.84047019-13.70687602 30.84047132-30.84047132V168.09662691c0-17.13359531-13.70687602-30.84047019-30.84047132-30.84047018H628.50844445v61.68094151h311.83142456v274.1375158H522.28015673l47.97406549-37.69390763c3.42671929-3.42671929 3.42671929-6.85343744 3.42671929-10.28015787v-54.82750293z" fill="#515151" p-id="972"></path></svg>',handler(e,t){this.toggleAttribute(e,t)},children:{before:{content:e("insB4"),handler(){this.insertParagraph(-1)}},after:{content:e("insAft"),handler(){this.insertParagraph(1)}}}},delete:{content:e("delTable"),icon:'<?xml version="1.0" encoding="UTF-8"?><svg width="16" height="16" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 10V44H39V10H9Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/><path d="M20 20V33" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M28 20V33" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M4 10H44" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M16 10L19.289 4H28.7771L32 10H16Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/></svg>',handler(){this.deleteTable()}}},n={copy:{content:e("copyTable"),icon:'<?xml version="1.0" encoding="UTF-8"?><svg width="16" height="16" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13 12.4316V7.8125C13 6.2592 14.2592 5 15.8125 5H40.1875C41.7408 5 43 6.2592 43 7.8125V32.1875C43 33.7408 41.7408 35 40.1875 35H35.5163" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M32.1875 13H7.8125C6.2592 13 5 14.2592 5 15.8125V40.1875C5 41.7408 6.2592 43 7.8125 43H32.1875C33.7408 43 35 41.7408 35 40.1875V15.8125C35 14.2592 33.7408 13 32.1875 13Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/></svg>',handler(){this.copyTable()}}};return(null==t?void 0:t.length)?Object.values(t).reduce(((e,t)=>{const i=Object.assign({},r,n);return"string"==typeof t&&(e[t]=i[t]),null!=t&&"object"==typeof t&&t.name&&(e[t.name]=ae()(i[t.name],t)),e}),{}):r}(n,r))){const{content:r,icon:n,children:l,handler:o}=t,s=this.createList(l),a=k(r),c=this.createMenu(n,bt,!!l,e);c.appendChild(a),s&&c.appendChild(s),i.appendChild(c),c.addEventListener("click",o.bind(this,s,a))}return this.quill.container.appendChild(i),i}createSwitch(e){const t=document.createDocumentFragment(),r=document.createElement("span"),n=document.createElement("span"),i=document.createElement("span");return r.innerText=e,n.classList.add("ql-table-switch"),i.classList.add("ql-table-switch-inner"),i.setAttribute("aria-checked","false"),n.appendChild(i),t.append(r,n),t}deleteColumn(e=!1){const{computeBounds:r,leftTd:n,rightTd:i}=this.getSelectedTdsInfo(),l=this.table.getBoundingClientRect(),o=q(r,this.table,this.quill.container,"column"),s=j(r,this.table,this.quill.container),a=t().find(n).table(),{changeTds:c,selTds:d}=this.getCorrectTds(o,r,n,i);e&&d.length!==this.tableBetter.cellSelection.selectedTds.length||(this.tableBetter.cellSelection.updateSelected("column"),a.deleteColumn(c,d,this.deleteTable.bind(this),s),F(this.table,l,r.left-r.right),this.updateMenus())}deleteRow(e=!1){const r=this.tableBetter.cellSelection.selectedTds,n=this.getCorrectRows();if(e){if(n.reduce(((e,t)=>e+t.children.length),0)!==r.length)return}this.tableBetter.cellSelection.updateSelected("row"),t().find(r[0]).table().deleteRow(n,this.deleteTable.bind(this)),this.updateMenus()}deleteTable(){const e=t().find(this.table);if(!e)return;const r=e.offset(this.quill.scroll);e.remove(),this.tableBetter.hideTools(),this.quill.setSelection(r-1,0,t().sources.USER)}destroyTablePropertiesForm(){this.tablePropertiesForm&&(this.tablePropertiesForm.removePropertiesForm(),this.tablePropertiesForm=null)}disableMenu(e,t){if(!this.root)return;const r=this.root.querySelector(`[data-category=${e}]`);r&&(t?r.classList.add("ql-table-disabled"):r.classList.remove("ql-table-disabled"))}getCellsOffset(e,r,n,i){const l=t().find(this.table).descendants(Z),o=Math.max(r.left,e.left),s=Math.min(r.right,e.right),a=new Map,c=new Map,d=new Map;for(const t of l){const{left:n,right:i}=M(t.domNode,this.quill.container);n+2>=o&&i<=s+2?this.setCellsMap(t,a):n+2>=e.left&&i<=r.left+2?this.setCellsMap(t,c):n+2>=r.right&&i<=e.right+2&&this.setCellsMap(t,d)}return this.getDiffOffset(a)||this.getDiffOffset(c,n)+this.getDiffOffset(d,i)}getColsOffset(e,t,r){let n=e.children.head;const i=Math.max(r.left,t.left),l=Math.min(r.right,t.right);let o=null,s=null,a=0;for(;n;){const{width:e}=n.domNode.getBoundingClientRect();if(o||s?(o=s,s+=e):(o=M(n.domNode,this.quill.container).left,s=o+e),o>l)break;o>=i&&s<=l&&a--,n=n.next}return a}getCorrectBounds(e){const t=this.quill.container.getBoundingClientRect(),r=M(e,this.quill.container);return r.width>=t.width?[Object.assign(Object.assign({},r),{left:0,right:t.width}),t]:[r,t]}getCorrectTds(e,r,n,i){const l=[],o=[],s=t().find(n).table().colgroup(),a=~~n.getAttribute("colspan")||1,c=~~i.getAttribute("colspan")||1;if(s)for(const t of e){const e=M(t,this.quill.container);if(e.left+2>=r.left&&e.right<=r.right+2)o.push(t);else{const n=this.getColsOffset(s,r,e);l.push([t,n])}}else for(const t of e){const e=M(t,this.quill.container);if(e.left+2>=r.left&&e.right<=r.right+2)o.push(t);else{const n=this.getCellsOffset(r,e,a,c);l.push([t,n])}}return{changeTds:l,selTds:o}}getCorrectRows(){const e=this.tableBetter.cellSelection.selectedTds,r={};for(const n of e){let e=~~n.getAttribute("rowspan")||1,i=t().find(n.parentElement);if(e>1)for(;i&&e;){const t=i.children.head.domNode.getAttribute("data-row");r[t]||(r[t]=i),i=i.next,e--}else{const e=n.getAttribute("data-row");r[e]||(r[e]=i)}}return Object.values(r)}getDiffOffset(e,t){let r=0;const n=this.getTdsFromMap(e);if(n.length)if(t){for(const e of n)r+=~~e.getAttribute("colspan")||1;r-=t}else for(const e of n)r-=~~e.getAttribute("colspan")||1;return r}getRefInfo(e,t){let r=null;if(!e)return{id:oe(),ref:r};let n=e.children.head;const i=n.domNode.getAttribute("data-row");for(;n;){const{left:e}=n.domNode.getBoundingClientRect();if(Math.abs(e-t)<=2)return{id:i,ref:n};Math.abs(e-t)>=2&&!r&&(r=n),n=n.next}return{id:i,ref:r}}getSelectedTdAttrs(e){const r=function(e){const t="left";let r=null;const n=e.descendants($),i=e.descendants(v),l=e.descendants(C);function o(e){for(const t of e.domNode.classList)if(/ql-align-/.test(t))return t.split("ql-align-")[1];return t}for(const e of[...n,...i,...l]){const n=o(e);if(null!=(s=r)&&s!==n)return t;r=n}var s;return null!=r?r:t}(t().find(e));return r?Object.assign(Object.assign({},P(e,u)),{"text-align":r}):P(e,u)}getSelectedTdsAttrs(e){const t=new Map;let r=null;for(const n of e){const e=this.getSelectedTdAttrs(n);if(r)for(const n of Object.keys(r))t.has(n)||e[n]!==r[n]&&t.set(n,!1);else r=e}for(const e of Object.keys(r))t.has(e)&&(r[e]=d[e]);return r}getSelectedTdsInfo(){const{startTd:e,endTd:t}=this.tableBetter.cellSelection,r=M(e,this.quill.container),n=M(t,this.quill.container),i=S(r,n);return r.left<=n.left&&r.top<=n.top?{computeBounds:i,leftTd:e,rightTd:t}:{computeBounds:i,leftTd:t,rightTd:e}}getTableAlignment(e){const t=e.getAttribute("align");if(!t){const{[Hr.left]:t,[Hr.right]:r}=P(e,[Hr.left,Hr.right]);return"auto"===t?"auto"===r?"center":"right":"left"}return t||"center"}getTdsFromMap(e){return Object.values(Object.fromEntries(e)).reduce(((e,t)=>e.length>t.length?e:t),[])}handleClick(e){if(!this.quill.isEnabled())return;const t=e.target.closest("table");if(!t||this.quill.root.contains(t)){if(this.prevList&&this.prevList.classList.add("ql-hidden"),this.prevTooltip&&this.prevTooltip.classList.remove("ql-table-tooltip-hidden"),this.prevList=null,this.prevTooltip=null,!t&&!this.tableBetter.cellSelection.selectedTds.length)return this.hideMenus(),void this.destroyTablePropertiesForm();this.tablePropertiesForm||(this.showMenus(),this.updateMenus(t),(t&&!t.isEqualNode(this.table)||this.scroll)&&this.updateScroll(!1),this.table=t)}}hideMenus(){this.root.classList.add("ql-hidden")}insertColumn(e,r){const{left:n,right:i,width:l}=e.getBoundingClientRect(),o=t().find(e).table(),s=e.parentElement.lastChild.isEqualNode(e),a=r>0?i:n;o.insertColumn(a,s,l,r),this.quill.scrollSelectionIntoView()}insertParagraph(e){const r=t().find(this.table),n=this.quill.getIndex(r),i=e>0?r.length():0,o=(new(l())).retain(n+i).insert("\n");this.quill.updateContents(o,t().sources.USER),this.quill.setSelection(n+i,t().sources.SILENT),this.tableBetter.hideTools(),this.quill.scrollSelectionIntoView()}insertRow(e,r){const n=t().find(e),i=n.rowOffset(),l=n.table(),o=n.statics.blotName===Y.blotName;if(r>0){const t=~~e.getAttribute("rowspan")||1;l.insertRow(i+r+t-1,r,o)}else l.insertRow(i+r,r,o);this.quill.scrollSelectionIntoView()}mergeCells(){var e,r;const{selectedTds:n}=this.tableBetter.cellSelection,{computeBounds:i,leftTd:l}=this.getSelectedTdsInfo(),o=t().find(l),[s,a]=N(o),c=o.children.head,d=o.table().tbody().children,u=o.row(),h=u.children.reduce(((e,t)=>{const r=M(t.domNode,this.quill.container);return r.left>=i.left&&r.right<=i.right&&(e+=~~t.domNode.getAttribute("colspan")||1),e}),0),p=d.reduce(((e,t)=>{const r=M(t.domNode,this.quill.container);if(r.top>=i.top&&r.bottom<=i.bottom){let r=Number.MAX_VALUE;t.children.forEach((e=>{const t=~~e.domNode.getAttribute("rowspan")||1;r=Math.min(r,t)})),e+=r}return e}),0);let f=0;for(const i of n){if(l.isEqualNode(i))continue;const n=t().find(i);n.moveChildren(o),n.remove(),(null===(r=null===(e=n.parent)||void 0===e?void 0:e.children)||void 0===r?void 0:r.length)||f++}f&&u.children.forEach((e=>{if(e.domNode.isEqualNode(l))return;const t=e.domNode.getAttribute("rowspan"),[r]=N(e);e.replaceWith(e.statics.blotName,Object.assign(Object.assign({},r),{rowspan:t-f}))})),o.setChildrenId(a),c.format(o.statics.blotName,Object.assign(Object.assign({},s),{colspan:h,rowspan:p-f})),this.tableBetter.cellSelection.setSelected(c.parent.domNode),this.quill.scrollSelectionIntoView()}selectColumn(){const{computeBounds:e,leftTd:t,rightTd:r}=this.getSelectedTdsInfo(),n=q(e,this.table,this.quill.container,"column"),{selTds:i}=this.getCorrectTds(n,e,t,r);this.tableBetter.cellSelection.setSelectedTds(i),this.updateMenus()}selectRow(){const e=this.getCorrectRows().reduce(((e,t)=>(e.push(...Array.from(t.domNode.children)),e)),[]);this.tableBetter.cellSelection.setSelectedTds(e),this.updateMenus()}setCellsMap(e,t){const r=e.domNode.getAttribute("data-row");t.has(r)?t.set(r,[...t.get(r),e.domNode]):t.set(r,[e.domNode])}showMenus(){this.root.classList.remove("ql-hidden")}splitCell(){const{selectedTds:e}=this.tableBetter.cellSelection,{leftTd:r}=this.getSelectedTdsInfo(),n=t().find(r).children.head;for(const r of e){const e=~~r.getAttribute("colspan")||1,n=~~r.getAttribute("rowspan")||1;if(1===e&&1===n)continue;const i=[],{width:l,right:o}=r.getBoundingClientRect(),s=t().find(r),a=s.table(),c=s.next,d=s.row();if(n>1)if(e>1){let t=d.next;for(let r=1;r<n;r++){const{ref:r,id:n}=this.getRefInfo(t,o);for(let l=0;l<e;l++)i.push([t,n,r]);t&&(t=t.next)}}else{let e=d.next;for(let t=1;t<n;t++){const{ref:t,id:r}=this.getRefInfo(e,o);i.push([e,r,t]),e&&(e=e.next)}}if(e>1){const t=r.getAttribute("data-row");for(let r=1;r<e;r++)i.push([d,t,c])}for(const[e,t,r]of i)a.insertColumnCell(e,t,r);const[u]=N(s);s.replaceWith(s.statics.blotName,Object.assign(Object.assign({},u),{width:~~(l/e),colspan:null,rowspan:null}))}this.tableBetter.cellSelection.setSelected(n.parent.domNode),this.quill.scrollSelectionIntoView()}toggleAttribute(e,t,r){r&&r.target.closest("li.ql-table-header-row")||(this.prevList&&!this.prevList.isEqualNode(e)&&(this.prevList.classList.add("ql-hidden"),this.prevTooltip.classList.remove("ql-table-tooltip-hidden")),e&&(e.classList.toggle("ql-hidden"),t.classList.toggle("ql-table-tooltip-hidden"),this.prevList=e,this.prevTooltip=t))}toggleHeaderRow(){const{selectedTds:e,hasTdTh:t}=this.tableBetter.cellSelection,{hasTd:r,hasTh:n}=t(e);!r&&n?this.convertToRow():this.convertToHeaderRow()}toggleHeaderRowSwitch(e){if(!this.tableHeaderRow)return;const t=this.tableHeaderRow.querySelector(".ql-table-switch-inner");e||(e="false"===t.getAttribute("aria-checked")?"true":"false"),t.setAttribute("aria-checked",e)}updateMenus(e=this.table){e&&requestAnimationFrame((()=>{this.root.classList.remove("ql-table-triangle-none");const[t,r]=this.getCorrectBounds(e),{left:n,right:i,top:l,bottom:o}=t,{height:s,width:a}=this.root.getBoundingClientRect(),c=this.quill.getModule("toolbar"),d=getComputedStyle(c.container);let u=l-s-10,h=n+i-a>>1;u>-parseInt(d.paddingBottom)?(this.root.classList.add("ql-table-triangle-up"),this.root.classList.remove("ql-table-triangle-down")):(u=o>r.height?r.height+10:o+10,this.root.classList.add("ql-table-triangle-down"),this.root.classList.remove("ql-table-triangle-up")),h<r.left?(h=0,this.root.classList.add("ql-table-triangle-none")):h+a>r.right&&(h=r.right-a,this.root.classList.add("ql-table-triangle-none")),H(this.root,{left:`${h}px`,top:`${u}px`})}))}updateScroll(e){this.scroll=e}updateTable(e){this.table=e}};const Wr=t().import("blots/inline");t().import("ui/icons")["table-better"]=gt;class Ur extends Wr{}class Gr{constructor(){this.computeChildren=[],this.root=this.createContainer()}clearSelected(e){for(const t of e)t.classList&&t.classList.remove("ql-cell-selected");this.computeChildren=[],this.root&&this.setLabelContent(this.root.lastElementChild,null)}createContainer(){const e=document.createElement("div"),t=document.createElement("div"),r=document.createElement("div"),n=document.createDocumentFragment();for(let e=1;e<=10;e++)for(let t=1;t<=10;t++){const r=document.createElement("span");r.setAttribute("row",`${e}`),r.setAttribute("column",`${t}`),n.appendChild(r)}return r.innerHTML="0 x 0",e.classList.add("ql-table-select-container","ql-hidden"),t.classList.add("ql-table-select-list"),r.classList.add("ql-table-select-label"),t.appendChild(n),e.appendChild(t),e.appendChild(r),e.addEventListener("mousemove",(t=>this.handleMouseMove(t,e))),e}getClickInfo(e){const t=e.target,r=t.closest("div.ql-table-select-container"),n=t.closest("span[row]");return r&&!n?[!0,n]:[!1,n]}getComputeChildren(e,t){const r=[],{clientX:n,clientY:i}=t;for(const t of e){const{left:e,top:l}=t.getBoundingClientRect();n>=e&&i>=l&&r.push(t)}return r}getSelectAttrs(e){return[~~e.getAttribute("row"),~~e.getAttribute("column")]}handleClick(e,t){const[r,n]=this.getClickInfo(e);if(this.toggle(this.root,r),n)this.insertTable(n,t);else{const e=this.computeChildren[this.computeChildren.length-1];e&&this.insertTable(e,t)}}handleMouseMove(e,t){const r=t.firstElementChild.children;this.clearSelected(this.computeChildren);const n=this.getComputeChildren(r,e);for(const e of n)e.classList&&e.classList.add("ql-cell-selected");this.computeChildren=n,this.setLabelContent(t.lastElementChild,n[n.length-1])}hide(e){this.clearSelected(this.computeChildren),e&&e.classList.add("ql-hidden")}insertTable(e,t){const[r,n]=this.getSelectAttrs(e);t(r,n),this.hide(this.root)}setLabelContent(e,t){if(t){const[r,n]=this.getSelectAttrs(t);e.innerHTML=`${r} x ${n}`}else e.innerHTML="0 x 0"}show(e){this.clearSelected(this.computeChildren),e&&e.classList.remove("ql-hidden")}toggle(e,t){t||this.clearSelected(this.computeChildren),e&&e.classList.toggle("ql-hidden")}}t().import("core/module");const $r=t().import("blots/container"),Kr=t().import("modules/toolbar");class Zr extends Kr{attach(e){let t=Array.from(e.classList).find((e=>0===e.indexOf("ql-")));if(!t)return;if(t=t.slice(3),"BUTTON"===e.tagName&&e.setAttribute("type","button"),null==this.handlers[t]&&null==this.quill.scroll.query(t))return void console.warn("ignoring attaching to nonexistent format",t,e);const r="SELECT"===e.tagName?"change":"click";e.addEventListener(r,(r=>{var n;const{cellSelection:i}=this.getTableBetter();(null===(n=null==i?void 0:i.selectedTds)||void 0===n?void 0:n.length)>1?this.cellSelectionAttach(e,t,r,i):this.toolbarAttach(e,t,r)})),this.controls.push([t,e])}cellSelectionAttach(e,t,r,n){if("SELECT"===e.tagName){if(e.selectedIndex<0)return;const r=e.options[e.selectedIndex],i="string"!=typeof(null==r?void 0:r.value)||(null==r?void 0:r.value),l=n.getCorrectValue(t,i);n.setSelectedTdsFormat(t,l)}else{const i=(null==e?void 0:e.value)||!0,l=n.getCorrectValue(t,i);n.setSelectedTdsFormat(t,l),r.preventDefault()}}getTableBetter(){return this.quill.getModule("table-better")}setTableFormat(e,r,n,i,l){let o=null;const{cellSelection:s,tableMenus:a}=this.getTableBetter(),c=function(e,r,n){if(1===r.length){const i=function(e,t=0,r=Number.MAX_VALUE){const n=(e,t,r)=>{let i=[],l=r;return e.children.forEachAt(t,r,((e,t,r)=>{e instanceof $r&&(i.push(e),i=i.concat(n(e,t,l))),l-=r})),i};return n(e,t,r)}(t().find(r[0]),e.index,e.length);return Jr(i)===Jr(n)}return!!(r.length>1)}(e,r,l);for(const e of l){const t=Yr(r,i,e,c);o=e.format(i,n,t)}if(r.length<2){if(c||1===l.length){const e=B(o);Promise.resolve().then((()=>{e&&this.quill.root.contains(e.domNode)?s.setSelected(e.domNode,!1):s.setSelected(r[0],!1)}))}else s.setSelected(r[0],!1);this.quill.setSelection(e,t().sources.SILENT)}return a.updateMenus(),o}toolbarAttach(e,r,n){let i;if("SELECT"===e.tagName){if(e.selectedIndex<0)return;const t=e.options[e.selectedIndex];i=!t.hasAttribute("selected")&&(t.value||!1)}else i=!e.classList.contains("ql-active")&&(e.value||!e.hasAttribute("value")),n.preventDefault();this.quill.focus();const[o]=this.quill.selection.getRange();if(null!=this.handlers[r])this.handlers[r].call(this,i);else if(this.quill.scroll.query(r).prototype instanceof rt){if(i=prompt(`Enter ${r}`),!i)return;this.quill.updateContents((new(l())).retain(o.index).delete(o.length).insert({[r]:i}),t().sources.USER)}else this.quill.format(r,i,t().sources.USER);this.update(o)}}function Yr(e,t,r,n){return 1===e.length&&"list"===t&&r.statics.blotName===C.blotName||n}function Jr(e){return e.reduce(((e,t)=>e+t.length()),0)}function Xr(e,t,r,n){const i=this.quill.getSelection();if(!n)if(i.length||1!==t.length)n=this.quill.getLines(i);else{const[e]=this.quill.getLine(i.index);n=[e]}return this.setTableFormat(i,t,e,r,n)}Zr.DEFAULTS=ae()({},Kr.DEFAULTS,{handlers:{header(e,r){const{cellSelection:n}=this.getTableBetter(),i=null==n?void 0:n.selectedTds;if(null==i?void 0:i.length)return Xr.call(this,e,i,"header",r);this.quill.format("header",e,t().sources.USER)},list(e,r){const{cellSelection:n}=this.getTableBetter(),i=null==n?void 0:n.selectedTds;if(null==i?void 0:i.length){if(1===i.length){const t=this.quill.getSelection(!0),r=this.quill.getFormat(t);e=n.getListCorrectValue("list",e,r)}return Xr.call(this,e,i,"list",r)}const l=this.quill.getSelection(!0),o=this.quill.getFormat(l);"check"===e?"checked"===o.list||"unchecked"===o.list?this.quill.format("list",!1,t().sources.USER):this.quill.format("list","unchecked",t().sources.USER):this.quill.format("list",e,t().sources.USER)},"table-better"(){}}});var Qr=Zr;const en=["error","warn","log","info"];let tn="warn";function rn(e){if(tn&&en.indexOf(e)<=en.indexOf(tn)){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];console[e](...r)}}function nn(e){return en.reduce(((t,r)=>(t[r]=rn.bind(console,r,e),t)),{})}nn.level=e=>{tn=e},rn.level=nn.level;var ln=nn;t().import("core/module");const on=t().import("modules/clipboard"),sn=ln("quill:clipboard");var an=class extends on{onPaste(e,{text:r,html:n}){const i=this.quill.getFormat(e.index),o=this.getTableDelta({text:r,html:n},i);sn.log("onPaste",o,{text:r,html:n});const s=(new(l())).retain(e.index).delete(e.length).concat(o);this.quill.updateContents(s,t().sources.USER),this.quill.setSelection(s.length()-e.length,t().sources.SILENT),this.quill.scrollSelectionIntoView()}getTableDelta({html:e,text:t},r){var n,i,o,s,a;const c=this.convert({text:t,html:e},r);if(r[$.blotName]||r[K.blotName])for(const e of c.ops){if(null===(n=null==e?void 0:e.attributes)||void 0===n?void 0:n[te.blotName])return new(l());!(null===(i=null==e?void 0:e.attributes)||void 0===i?void 0:i.header)&&!(null===(o=null==e?void 0:e.attributes)||void 0===o?void 0:o.list)&&(null===(s=null==e?void 0:e.attributes)||void 0===s?void 0:s[$.blotName])&&(null===(a=null==e?void 0:e.attributes)||void 0===a?void 0:a[K.blotName])||(e.attributes=Object.assign(Object.assign({},e.attributes),r))}return c}};const cn=t().import("core/module");class dn extends cn{constructor(e,t){super(e,t),e.clipboard.addMatcher("td, th",he),e.clipboard.addMatcher("tr",ue),e.clipboard.addMatcher("col",pe),e.clipboard.addMatcher("table",fe),this.language=new qe(null==t?void 0:t.language),this.cellSelection=new pt(e,this),this.operateLine=new ft(e,this),this.tableMenus=new Vr(e,this),this.tableSelect=new Gr,e.root.addEventListener("keyup",this.handleKeyup.bind(this)),e.root.addEventListener("mousedown",this.handleMousedown.bind(this)),e.root.addEventListener("scroll",this.handleScroll.bind(this)),this.listenDeleteTable(),this.registerToolbarTable(null==t?void 0:t.toolbarTable)}static register(){t().register($,!0),t().register(K,!0),t().register(Z,!0),t().register(Y,!0),t().register(J,!0),t().register(X,!0),t().register(Q,!0),t().register(ee,!0),t().register(te,!0),t().register(ie,!0),t().register(re,!0),t().register(ne,!0),t().register({"modules/toolbar":Qr,"modules/clipboard":an},!0)}clearHistorySelected(){const[e]=this.getTable();if(!e)return;const t=Array.from(e.domNode.querySelectorAll("td.ql-cell-focused, td.ql-cell-selected"));for(const e of t)e.classList&&e.classList.remove("ql-cell-focused","ql-cell-selected")}deleteTable(){const[e]=this.getTable();if(null==e)return;const r=e.offset();e.remove(),this.hideTools(),this.quill.update(t().sources.USER),this.quill.setSelection(r,t().sources.SILENT)}deleteTableTemporary(e=t().sources.API){const r=this.quill.scroll.descendants(te);for(const e of r)e.remove();this.hideTools(),this.quill.update(e)}getTable(e=this.quill.getSelection()){if(null==e)return[null,null,null,-1];const[t,r]=this.quill.getLine(e.index);if(null==t||t.statics.blotName!==$.blotName)return[null,null,null,-1];const n=t.parent,i=n.parent;return[i.parent.parent,i,n,r]}handleKeyup(e){this.quill.isEnabled()&&(this.cellSelection.handleKeyup(e),!e.ctrlKey||"z"!==e.key&&"y"!==e.key||(this.hideTools(),this.clearHistorySelected()),this.updateMenus(e))}handleMousedown(e){var t;if(!this.quill.isEnabled())return;null===(t=this.tableSelect)||void 0===t||t.hide(this.tableSelect.root);const r=e.target.closest("table");if(!r||this.quill.root.contains(r)){if(!r)return this.hideTools(),void this.handleMouseMove();this.cellSelection.handleMousedown(e),this.cellSelection.setDisabled(!0)}else this.hideTools()}handleMouseMove(){let e=null;const r=t=>{e||(e=t.target.closest("table"))},n=i=>{if(e){const r=t().find(e);if(!r)return;const n=r.offset(this.quill.scroll),i=r.length(),l=this.quill.getSelection(),o=Math.min(l.index,n),s=Math.max(l.index+l.length,n+i);this.quill.setSelection(o,s-o,t().sources.USER)}this.quill.root.removeEventListener("mousemove",r),this.quill.root.removeEventListener("mouseup",n)};this.quill.root.addEventListener("mousemove",r),this.quill.root.addEventListener("mouseup",n)}handleScroll(){var e;this.quill.isEnabled()&&(this.hideTools(),null===(e=this.tableMenus)||void 0===e||e.updateScroll(!0))}hideTools(){var e,t,r,n,i,l,o;null===(e=this.cellSelection)||void 0===e||e.clearSelected(),null===(t=this.cellSelection)||void 0===t||t.setDisabled(!1),null===(r=this.operateLine)||void 0===r||r.hideDragBlock(),null===(n=this.operateLine)||void 0===n||n.hideDragTable(),null===(i=this.operateLine)||void 0===i||i.hideLine(),null===(l=this.tableMenus)||void 0===l||l.hideMenus(),null===(o=this.tableMenus)||void 0===o||o.destroyTablePropertiesForm()}insertTable(e,r){const n=this.quill.getSelection(!0);if(null==n)return;if(this.isTable(n))return;const i=this.quill.getFormat(n.index-1),[,o]=this.quill.getLine(n.index),s=!!i[$.blotName]||0!==o,a=s?2:1,c=s?(new(l())).insert("\n"):new(l()),d=(new(l())).retain(n.index).delete(n.length).concat(c).insert("\n",{[te.blotName]:{style:"width: 100%"}}),u=new Array(e).fill(0).reduce((e=>{const t=oe();return new Array(r).fill("\n").reduce(((e,r)=>e.insert(r,{[$.blotName]:le(),[Z.blotName]:{"data-row":t}})),e)}),d);this.quill.updateContents(u,t().sources.USER),this.quill.setSelection(n.index+a,t().sources.SILENT),this.showTools()}isTable(e){return!!this.quill.getFormat(e.index)[$.blotName]}listenDeleteTable(){this.quill.on(t().events.TEXT_CHANGE,((e,r,n)=>{if(n!==t().sources.USER)return;const i=this.quill.scroll.descendants(ie);if(!i.length)return;const l=[];if(i.forEach((e=>{const t=e.tbody(),r=e.thead();t||r||l.push(e)})),l.length){for(const e of l)e.remove();this.hideTools(),this.quill.update(t().sources.API)}}))}registerToolbarTable(e){if(!e)return;t().register({"formats/table-better":Ur},!0);const r=this.quill.getModule("toolbar").container.querySelector("button.ql-table-better");r&&this.tableSelect.root&&(r.appendChild(this.tableSelect.root),r.addEventListener("click",(e=>{this.tableSelect.handleClick(e,this.insertTable.bind(this))})),document.addEventListener("click",(e=>{e.composedPath().includes(r)||this.tableSelect.root.classList.contains("ql-hidden")||this.tableSelect.hide(this.tableSelect.root)})))}showTools(e){const[t,,r]=this.getTable();t&&r&&(this.cellSelection.setDisabled(!0),this.cellSelection.setSelected(r.domNode,e),this.tableMenus.showMenus(),this.tableMenus.updateMenus(t.domNode),this.tableMenus.updateTable(t.domNode))}updateMenus(e){this.cellSelection.selectedTds.length&&("Enter"===e.key||e.ctrlKey&&"v"===e.key)&&this.tableMenus.updateMenus()}}const un={"table-cell down":pn(!1),"table-cell up":pn(!0),"table-cell-block backspace":hn("Backspace"),"table-cell-block delete":hn("Delete"),"table-header backspace":fn("Backspace"),"table-header delete":fn("Delete"),"table-header enter":{key:"Enter",collapsed:!0,format:["table-header"],suffix:/^$/,handler(e,r){const[n,i]=this.quill.getLine(e.index),o=(new(l())).retain(e.index).insert("\n",r.format).retain(n.length()-i-1).retain(1,{header:null});this.quill.updateContents(o,t().sources.USER),this.quill.setSelection(e.index+1,t().sources.SILENT),this.quill.scrollSelectionIntoView()}},"table-list backspace":gn("Backspace"),"table-list delete":gn("Delete"),"table-list empty enter":{key:"Enter",collapsed:!0,format:["table-list"],empty:!0,handler(e,t){const{line:r}=t,{cellId:n}=r.parent.formats()[r.parent.statics.blotName],i=r.replaceWith($.blotName,n),l=this.quill.getModule("table-better"),o=B(i);o&&l.cellSelection.setSelected(o.domNode,!1)}}};function hn(e){return{key:e,format:["table-cell-block","table-th-block"],collapsed:!0,handler(t,r){var n;const[i]=this.quill.getLine(t.index),{offset:l,suffix:o}=r;if(0===l&&!i.prev)return!1;const s=null===(n=i.prev)||void 0===n?void 0:n.statics.blotName;return 0!==l||s!==m.blotName&&s!==$.blotName&&s!==C.blotName?!(0!==l&&!o&&"Delete"===e):bn.call(this,i,t)}}}function pn(e){return{key:e?"ArrowUp":"ArrowDown",collapsed:!0,format:["table-cell","table-th"],handler(){return!1}}}function fn(e){return{key:e,format:["table-header"],collapsed:!0,empty:!0,handler(e,t){const[r]=this.quill.getLine(e.index);if(r.prev)return bn.call(this,r,e);{const e=A(r.formats()[r.statics.blotName]);r.replaceWith($.blotName,e)}}}}function gn(e){return{key:e,format:["table-list"],collapsed:!0,empty:!0,handler(e,t){const[r]=this.quill.getLine(e.index),n=A(r.parent.formats()[r.parent.statics.blotName]);r.replaceWith($.blotName,n)}}}function bn(e,r){const n=this.quill.getModule("table-better");return e.remove(),null==n||n.tableMenus.updateMenus(),this.quill.setSelection(r.index-1,t().sources.SILENT),!1}dn.keyboardBindings=un;var mn=dn}(),i.default}()}));