!function(){function t(i){var r=n[i];if(void 0!==r)return r.exports;var o=n[i]={exports:{}};return e[i](o,o.exports,t),o.exports}var e={24601:function(t,e,n){var i=n(78420),r=n(13838),o=TypeError;t.exports=function(t){if(i(t))return t;throw o(r(t)+" is not a function")}},57849:function(t,e,n){var i=n(1466),r=n(13838),o=TypeError;t.exports=function(t){if(i(t))return t;throw o(r(t)+" is not a constructor")}},7473:function(t,e,n){var i=n(78420),r=String,o=TypeError;t.exports=function(t){if("object"==typeof t||i(t))return t;throw o("Can't set "+r(t)+" as a prototype")}},40298:function(t,e,n){var i=n(31602),r=n(53105),o=n(43610).f,s=i("unscopables"),a=Array.prototype;null==a[s]&&o(a,s,{configurable:!0,value:r(null)}),t.exports=function(t){a[s][t]=!0}},67234:function(t,e,n){"use strict";var i=n(77804).charAt;t.exports=function(t,e,n){return e+(n?i(t,e).length:1)}},65190:function(t,e,n){var i=n(47658),r=TypeError;t.exports=function(t,e){if(i(e,t))return t;throw r("Incorrect invocation")}},73938:function(t,e,n){var i=n(65335),r=String,o=TypeError;t.exports=function(t){if(i(t))return t;throw o(r(t)+" is not an object")}},9809:function(t){t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},22085:function(t,e,n){var i=n(92074);t.exports=i((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},85343:function(t,e,n){"use strict";var i,r,o,s=n(9809),a=n(65077),c=n(30200),l=n(78420),u=n(65335),h=n(36490),d=n(83062),f=n(13838),m=n(97712),g=n(7485),p=n(43610).f,w=n(47658),v=n(97970),b=n(39686),y=n(31602),_=n(50665),k=n(99206),A=k.enforce,x=k.get,T=c.Int8Array,C=T&&T.prototype,E=c.Uint8ClampedArray,S=E&&E.prototype,P=T&&v(T),R=C&&v(C),O=Object.prototype,I=c.TypeError,M=y("toStringTag"),N=_("TYPED_ARRAY_TAG"),V="TypedArrayConstructor",D=s&&!!b&&"Opera"!==d(c.opera),B=!1,F={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},L={BigInt64Array:8,BigUint64Array:8},z=function(t){var e=v(t);if(u(e)){var n=x(e);return n&&h(n,V)?n.TypedArrayConstructor:z(e)}},j=function(t){if(!u(t))return!1;var e=d(t);return h(F,e)||h(L,e)};for(i in F)(o=(r=c[i])&&r.prototype)?A(o).TypedArrayConstructor=r:D=!1;for(i in L)(o=(r=c[i])&&r.prototype)&&(A(o).TypedArrayConstructor=r);if((!D||!l(P)||P===Function.prototype)&&(P=function(){throw I("Incorrect invocation")},D))for(i in F)c[i]&&b(c[i],P);if((!D||!R||R===O)&&(R=P.prototype,D))for(i in F)c[i]&&b(c[i].prototype,R);if(D&&v(S)!==R&&b(S,R),a&&!h(R,M))for(i in B=!0,p(R,M,{get:function(){return u(this)?this[N]:void 0}}),F)c[i]&&m(c[i],N,i);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:D,TYPED_ARRAY_TAG:B&&N,aTypedArray:function(t){if(j(t))return t;throw I("Target is not a typed array")},aTypedArrayConstructor:function(t){if(l(t)&&(!b||w(P,t)))return t;throw I(f(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,n,i){if(a){if(n)for(var r in F){var o=c[r];if(o&&h(o.prototype,t))try{delete o.prototype[t]}catch(n){try{o.prototype[t]=e}catch(t){}}}R[t]&&!n||g(R,t,n?e:D&&C[t]||e,i)}},exportTypedArrayStaticMethod:function(t,e,n){var i,r;if(a){if(b){if(n)for(i in F)if((r=c[i])&&h(r,t))try{delete r[t]}catch(t){}if(P[t]&&!n)return;try{return g(P,t,n?e:D&&P[t]||e)}catch(t){}}for(i in F)!(r=c[i])||r[t]&&!n||g(r,t,e)}},getTypedArrayConstructor:z,isView:function(t){if(!u(t))return!1;var e=d(t);return"DataView"===e||h(F,e)||h(L,e)},isTypedArray:j,TypedArray:P,TypedArrayPrototype:R}},24497:function(t,e,n){"use strict";var i=n(30200),r=n(30281),o=n(65077),s=n(9809),a=n(12071),c=n(97712),l=n(92760),u=n(92074),h=n(65190),d=n(79328),f=n(33747),m=n(6283),g=n(46431),p=n(97970),w=n(39686),v=n(64789).f,b=n(43610).f,y=n(27806),_=n(76056),k=n(75282),A=n(99206),x=a.PROPER,T=a.CONFIGURABLE,C=A.get,E=A.set,S="ArrayBuffer",P="DataView",R="Wrong index",O=i.ArrayBuffer,I=O,M=I&&I.prototype,N=i.DataView,V=N&&N.prototype,D=Object.prototype,B=i.Array,F=i.RangeError,L=r(y),z=r([].reverse),j=g.pack,H=g.unpack,U=function(t){return[255&t]},W=function(t){return[255&t,t>>8&255]},$=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},q=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},K=function(t){return j(t,23,4)},G=function(t){return j(t,52,8)},J=function(t,e){b(t.prototype,e,{get:function(){return C(this)[e]}})},Y=function(t,e,n,i){var r=m(n),o=C(t);if(r+e>o.byteLength)throw F(R);var s=C(o.buffer).bytes,a=r+o.byteOffset,c=_(s,a,a+e);return i?c:z(c)},Q=function(t,e,n,i,r,o){var s=m(n),a=C(t);if(s+e>a.byteLength)throw F(R);for(var c=C(a.buffer).bytes,l=s+a.byteOffset,u=i(+r),h=0;h<e;h++)c[l+h]=u[o?h:e-h-1]};if(s){var X=x&&O.name!==S;if(u((function(){O(1)}))&&u((function(){new O(-1)}))&&!u((function(){return new O,new O(1.5),new O(NaN),X&&!T})))X&&T&&c(O,"name",S);else{(I=function(t){return h(this,M),new O(m(t))}).prototype=M;for(var Z,tt=v(O),et=0;tt.length>et;)(Z=tt[et++])in I||c(I,Z,O[Z]);M.constructor=I}w&&p(V)!==D&&w(V,D);var nt=new N(new I(2)),it=r(V.setInt8);nt.setInt8(0,2147483648),nt.setInt8(1,2147483649),!nt.getInt8(0)&&nt.getInt8(1)||l(V,{setInt8:function(t,e){it(this,t,e<<24>>24)},setUint8:function(t,e){it(this,t,e<<24>>24)}},{unsafe:!0})}else M=(I=function(t){h(this,M);var e=m(t);E(this,{bytes:L(B(e),0),byteLength:e}),o||(this.byteLength=e)}).prototype,V=(N=function(t,e,n){h(this,V),h(t,M);var i=C(t).byteLength,r=d(e);if(r<0||r>i)throw F("Wrong offset");if(r+(n=void 0===n?i-r:f(n))>i)throw F("Wrong length");E(this,{buffer:t,byteLength:n,byteOffset:r}),o||(this.buffer=t,this.byteLength=n,this.byteOffset=r)}).prototype,o&&(J(I,"byteLength"),J(N,"buffer"),J(N,"byteLength"),J(N,"byteOffset")),l(V,{getInt8:function(t){return Y(this,1,t)[0]<<24>>24},getUint8:function(t){return Y(this,1,t)[0]},getInt16:function(t){var e=Y(this,2,t,arguments.length>1?arguments[1]:void 0);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Y(this,2,t,arguments.length>1?arguments[1]:void 0);return e[1]<<8|e[0]},getInt32:function(t){return q(Y(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return q(Y(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return H(Y(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return H(Y(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,e){Q(this,1,t,U,e)},setUint8:function(t,e){Q(this,1,t,U,e)},setInt16:function(t,e){Q(this,2,t,W,e,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,e){Q(this,2,t,W,e,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,e){Q(this,4,t,$,e,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,e){Q(this,4,t,$,e,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,e){Q(this,4,t,K,e,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,e){Q(this,8,t,G,e,arguments.length>2?arguments[2]:void 0)}});k(I,S),k(N,P),t.exports={ArrayBuffer:I,DataView:N}},29688:function(t,e,n){"use strict";var i=n(92612),r=n(6539),o=n(23493),s=n(24881),a=Math.min;t.exports=[].copyWithin||function(t,e){var n=i(this),c=o(n),l=r(t,c),u=r(e,c),h=arguments.length>2?arguments[2]:void 0,d=a((void 0===h?c:r(h,c))-u,c-l),f=1;for(u<l&&l<u+d&&(f=-1,u+=d-1,l+=d-1);d-- >0;)u in n?n[l]=n[u]:s(n,l),l+=f,u+=f;return n}},27806:function(t,e,n){"use strict";var i=n(92612),r=n(6539),o=n(23493);t.exports=function(t){for(var e=i(this),n=o(e),s=arguments.length,a=r(s>1?arguments[1]:void 0,n),c=s>2?arguments[2]:void 0,l=void 0===c?n:r(c,n);l>a;)e[a++]=t;return e}},10516:function(t,e,n){"use strict";var i=n(91344).forEach,r=n(92349)("forEach");t.exports=r?[].forEach:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}},40447:function(t,e,n){var i=n(23493);t.exports=function(t,e){for(var n=0,r=i(e),o=new t(r);r>n;)o[n]=e[n++];return o}},51027:function(t,e,n){"use strict";var i=n(46885),r=n(72368),o=n(92612),s=n(41332),a=n(99034),c=n(1466),l=n(23493),u=n(52057),h=n(79526),d=n(51898),f=Array;t.exports=function(t){var e=o(t),n=c(this),m=arguments.length,g=m>1?arguments[1]:void 0,p=void 0!==g;p&&(g=i(g,m>2?arguments[2]:void 0));var w,v,b,y,_,k,A=d(e),x=0;if(!A||this===f&&a(A))for(w=l(e),v=n?new this(w):f(w);w>x;x++)k=p?g(e[x],x):e[x],u(v,x,k);else for(_=(y=h(e,A)).next,v=n?new this:[];!(b=r(_,y)).done;x++)k=p?s(y,g,[b.value,x],!0):b.value,u(v,x,k);return v.length=x,v}},58186:function(t,e,n){var i=n(5476),r=n(6539),o=n(23493),s=function(t){return function(e,n,s){var a,c=i(e),l=o(c),u=r(s,l);if(t&&n!=n){for(;l>u;)if((a=c[u++])!=a)return!0}else for(;l>u;u++)if((t||u in c)&&c[u]===n)return t||u||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},45582:function(t,e,n){var i=n(46885),r=n(48664),o=n(92612),s=n(23493),a=function(t){var e=1==t;return function(n,a,c){for(var l,u=o(n),h=r(u),d=i(a,c),f=s(h);f-- >0;)if(d(l=h[f],f,u))switch(t){case 0:return l;case 1:return f}return e?-1:void 0}};t.exports={findLast:a(0),findLastIndex:a(1)}},91344:function(t,e,n){var i=n(46885),r=n(30281),o=n(48664),s=n(92612),a=n(23493),c=n(62998),l=r([].push),u=function(t){var e=1==t,n=2==t,r=3==t,u=4==t,h=6==t,d=7==t,f=5==t||h;return function(m,g,p,w){for(var v,b,y=s(m),_=o(y),k=i(g,p),A=a(_),x=0,T=w||c,C=e?T(m,A):n||d?T(m,0):void 0;A>x;x++)if((f||x in _)&&(b=k(v=_[x],x,y),t))if(e)C[x]=b;else if(b)switch(t){case 3:return!0;case 5:return v;case 6:return x;case 2:l(C,v)}else switch(t){case 4:return!1;case 7:l(C,v)}return h?-1:r||u?u:C}};t.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},3470:function(t,e,n){"use strict";var i=n(99070),r=n(5476),o=n(79328),s=n(23493),a=n(92349),c=Math.min,l=[].lastIndexOf,u=!!l&&1/[1].lastIndexOf(1,-0)<0,h=a("lastIndexOf"),d=u||!h;t.exports=d?function(t){if(u)return i(l,this,arguments)||0;var e=r(this),n=s(e),a=n-1;for(arguments.length>1&&(a=c(a,o(arguments[1]))),a<0&&(a=n+a);a>=0;a--)if(a in e&&e[a]===t)return a||0;return-1}:l},45634:function(t,e,n){var i=n(92074),r=n(31602),o=n(6845),s=r("species");t.exports=function(t){return o>=51||!i((function(){var e=[];return(e.constructor={})[s]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},92349:function(t,e,n){"use strict";var i=n(92074);t.exports=function(t,e){var n=[][t];return!!n&&i((function(){n.call(null,e||function(){return 1},1)}))}},52237:function(t,e,n){var i=n(24601),r=n(92612),o=n(48664),s=n(23493),a=TypeError,c=function(t){return function(e,n,c,l){i(n);var u=r(e),h=o(u),d=s(u),f=t?d-1:0,m=t?-1:1;if(c<2)for(;;){if(f in h){l=h[f],f+=m;break}if(f+=m,t?f<0:d<=f)throw a("Reduce of empty array with no initial value")}for(;t?f>=0:d>f;f+=m)f in h&&(l=n(l,h[f],f,u));return l}};t.exports={left:c(!1),right:c(!0)}},76056:function(t,e,n){var i=n(6539),r=n(23493),o=n(52057),s=Array,a=Math.max;t.exports=function(t,e,n){for(var c=r(t),l=i(e,c),u=i(void 0===n?c:n,c),h=s(a(u-l,0)),d=0;l<u;l++,d++)o(h,d,t[l]);return h.length=d,h}},29609:function(t,e,n){var i=n(30281);t.exports=i([].slice)},68039:function(t,e,n){var i=n(76056),r=Math.floor,o=function(t,e){var n=t.length,c=r(n/2);return n<8?s(t,e):a(t,o(i(t,0,c),e),o(i(t,c),e),e)},s=function(t,e){for(var n,i,r=t.length,o=1;o<r;){for(i=o,n=t[o];i&&e(t[i-1],n)>0;)t[i]=t[--i];i!==o++&&(t[i]=n)}return t},a=function(t,e,n,i){for(var r=e.length,o=n.length,s=0,a=0;s<r||a<o;)t[s+a]=s<r&&a<o?i(e[s],n[a])<=0?e[s++]:n[a++]:s<r?e[s++]:n[a++];return t};t.exports=o},93892:function(t,e,n){var i=n(18679),r=n(1466),o=n(65335),s=n(31602)("species"),a=Array;t.exports=function(t){var e;return i(t)&&(e=t.constructor,(r(e)&&(e===a||i(e.prototype))||o(e)&&null===(e=e[s]))&&(e=void 0)),void 0===e?a:e}},62998:function(t,e,n){var i=n(93892);t.exports=function(t,e){return new(i(t))(0===e?0:e)}},71787:function(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n={},i=0;i<66;i++)n[e.charAt(i)]=i;t.exports={itoc:e,ctoi:n}},41332:function(t,e,n){var i=n(73938),r=n(69868);t.exports=function(t,e,n,o){try{return o?e(i(n)[0],n[1]):e(n)}catch(e){r(t,"throw",e)}}},97499:function(t,e,n){var i=n(31602)("iterator"),r=!1;try{var o=0,s={next:function(){return{done:!!o++}},return:function(){r=!0}};s[i]=function(){return this},Array.from(s,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!r)return!1;var n=!1;try{var o={};o[i]=function(){return{next:function(){return{done:n=!0}}}},t(o)}catch(t){}return n}},18569:function(t,e,n){var i=n(30281),r=i({}.toString),o=i("".slice);t.exports=function(t){return o(r(t),8,-1)}},83062:function(t,e,n){var i=n(43129),r=n(78420),o=n(18569),s=n(31602)("toStringTag"),a=Object,c="Arguments"==o(function(){return arguments}());t.exports=i?o:function(t){var e,n,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=a(t),s))?n:c?o(e):"Object"==(i=o(e))&&r(e.callee)?"Arguments":i}},26820:function(t,e,n){var i=n(30281),r=Error,o=i("".replace),s=String(r("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,c=a.test(s);t.exports=function(t,e){if(c&&"string"==typeof t&&!r.prepareStackTrace)for(;e--;)t=o(t,a,"");return t}},5959:function(t,e,n){"use strict";var i=n(43610).f,r=n(53105),o=n(92760),s=n(46885),a=n(65190),c=n(52929),l=n(45723),u=n(93524),h=n(65077),d=n(82014).fastKey,f=n(99206),m=f.set,g=f.getterFor;t.exports={getConstructor:function(t,e,n,l){var u=t((function(t,i){a(t,f),m(t,{type:e,index:r(null),first:void 0,last:void 0,size:0}),h||(t.size=0),null!=i&&c(i,t[l],{that:t,AS_ENTRIES:n})})),f=u.prototype,p=g(e),w=function(t,e,n){var i,r,o=p(t),s=v(t,e);return s?s.value=n:(o.last=s={index:r=d(e,!0),key:e,value:n,previous:i=o.last,next:void 0,removed:!1},o.first||(o.first=s),i&&(i.next=s),h?o.size++:t.size++,"F"!==r&&(o.index[r]=s)),t},v=function(t,e){var n,i=p(t),r=d(e);if("F"!==r)return i.index[r];for(n=i.first;n;n=n.next)if(n.key==e)return n};return o(f,{clear:function(){for(var t=p(this),e=t.index,n=t.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete e[n.index],n=n.next;t.first=t.last=void 0,h?t.size=0:this.size=0},delete:function(t){var e=this,n=p(e),i=v(e,t);if(i){var r=i.next,o=i.previous;delete n.index[i.index],i.removed=!0,o&&(o.next=r),r&&(r.previous=o),n.first==i&&(n.first=r),n.last==i&&(n.last=o),h?n.size--:e.size--}return!!i},forEach:function(t){for(var e,n=p(this),i=s(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:n.first;)for(i(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!v(this,t)}}),o(f,n?{get:function(t){var e=v(this,t);return e&&e.value},set:function(t,e){return w(this,0===t?0:t,e)}}:{add:function(t){return w(this,t=0===t?0:t,t)}}),h&&i(f,"size",{get:function(){return p(this).size}}),u},setStrong:function(t,e,n){var i=e+" Iterator",r=g(e),o=g(i);l(t,e,(function(t,e){m(this,{type:i,target:t,state:r(t),kind:e,last:void 0})}),(function(){for(var t=o(this),e=t.kind,n=t.last;n&&n.removed;)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?"keys"==e?{value:n.key,done:!1}:"values"==e?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),n?"entries":"values",!n,!0),u(e)}}},76784:function(t,e,n){"use strict";var i=n(30281),r=n(92760),o=n(82014).getWeakData,s=n(73938),a=n(65335),c=n(65190),l=n(52929),u=n(91344),h=n(36490),d=n(99206),f=d.set,m=d.getterFor,g=u.find,p=u.findIndex,w=i([].splice),v=0,b=function(t){return t.frozen||(t.frozen=new y)},y=function(){this.entries=[]},_=function(t,e){return g(t.entries,(function(t){return t[0]===e}))};y.prototype={get:function(t){var e=_(this,t);if(e)return e[1]},has:function(t){return!!_(this,t)},set:function(t,e){var n=_(this,t);n?n[1]=e:this.entries.push([t,e])},delete:function(t){var e=p(this.entries,(function(e){return e[0]===t}));return~e&&w(this.entries,e,1),!!~e}},t.exports={getConstructor:function(t,e,n,i){var u=t((function(t,r){c(t,d),f(t,{type:e,id:v++,frozen:void 0}),null!=r&&l(r,t[i],{that:t,AS_ENTRIES:n})})),d=u.prototype,g=m(e),p=function(t,e,n){var i=g(t),r=o(s(e),!0);return!0===r?b(i).set(e,n):r[i.id]=n,t};return r(d,{delete:function(t){var e=g(this);if(!a(t))return!1;var n=o(t);return!0===n?b(e).delete(t):n&&h(n,e.id)&&delete n[e.id]},has:function(t){var e=g(this);if(!a(t))return!1;var n=o(t);return!0===n?b(e).has(t):n&&h(n,e.id)}}),r(d,n?{get:function(t){var e=g(this);if(a(t)){var n=o(t);return!0===n?b(e).get(t):n?n[e.id]:void 0}},set:function(t,e){return p(this,t,e)}}:{add:function(t){return p(this,t,!0)}}),u}}},92327:function(t,e,n){"use strict";var i=n(51605),r=n(30200),o=n(30281),s=n(84977),a=n(7485),c=n(82014),l=n(52929),u=n(65190),h=n(78420),d=n(65335),f=n(92074),m=n(97499),g=n(75282),p=n(93054);t.exports=function(t,e,n){var w=-1!==t.indexOf("Map"),v=-1!==t.indexOf("Weak"),b=w?"set":"add",y=r[t],_=y&&y.prototype,k=y,A={},x=function(t){var e=o(_[t]);a(_,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(v&&!d(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return v&&!d(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(v&&!d(t))&&e(this,0===t?0:t)}:function(t,n){return e(this,0===t?0:t,n),this})};if(s(t,!h(y)||!(v||_.forEach&&!f((function(){(new y).entries().next()})))))k=n.getConstructor(e,t,w,b),c.enable();else if(s(t,!0)){var T=new k,C=T[b](v?{}:-0,1)!=T,E=f((function(){T.has(1)})),S=m((function(t){new y(t)})),P=!v&&f((function(){for(var t=new y,e=5;e--;)t[b](e,e);return!t.has(-0)}));S||((k=e((function(t,e){u(t,_);var n=p(new y,t,k);return null!=e&&l(e,n[b],{that:n,AS_ENTRIES:w}),n}))).prototype=_,_.constructor=k),(E||P)&&(x("delete"),x("has"),w&&x("get")),(P||C)&&x(b),v&&_.clear&&delete _.clear}return A[t]=k,i({global:!0,constructor:!0,forced:k!=y},A),g(k,t),v||n.setStrong(k,t,w),k}},84361:function(t,e,n){var i=n(36490),r=n(15816),o=n(97632),s=n(43610);t.exports=function(t,e,n){for(var a=r(e),c=s.f,l=o.f,u=0;u<a.length;u++){var h=a[u];i(t,h)||n&&i(n,h)||c(t,h,l(e,h))}}},44177:function(t,e,n){var i=n(31602)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[i]=!1,"/./"[t](e)}catch(t){}}return!1}},7168:function(t,e,n){var i=n(92074);t.exports=!i((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},19877:function(t,e,n){var i=n(30281),r=n(71229),o=n(95362),s=/"/g,a=i("".replace);t.exports=function(t,e,n,i){var c=o(r(t)),l="<"+e;return""!==n&&(l+=" "+n+'="'+a(o(i),s,"&quot;")+'"'),l+">"+c+"</"+e+">"}},72147:function(t,e,n){"use strict";var i=n(49306).IteratorPrototype,r=n(53105),o=n(66843),s=n(75282),a=n(52228),c=function(){return this};t.exports=function(t,e,n,l){var u=e+" Iterator";return t.prototype=r(i,{next:o(+!l,n)}),s(t,u,!1,!0),a[u]=c,t}},97712:function(t,e,n){var i=n(65077),r=n(43610),o=n(66843);t.exports=i?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},66843:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},52057:function(t,e,n){"use strict";var i=n(86032),r=n(43610),o=n(66843);t.exports=function(t,e,n){var s=i(e);s in t?r.f(t,s,o(0,n)):t[s]=n}},38523:function(t,e,n){"use strict";var i=n(30281),r=n(92074),o=n(45214).start,s=RangeError,a=Math.abs,c=Date.prototype,l=c.toISOString,u=i(c.getTime),h=i(c.getUTCDate),d=i(c.getUTCFullYear),f=i(c.getUTCHours),m=i(c.getUTCMilliseconds),g=i(c.getUTCMinutes),p=i(c.getUTCMonth),w=i(c.getUTCSeconds);t.exports=r((function(){return"0385-07-25T07:06:39.999Z"!=l.call(new Date(-50000000000001))}))||!r((function(){l.call(new Date(NaN))}))?function(){if(!isFinite(u(this)))throw s("Invalid time value");var t=this,e=d(t),n=m(t),i=e<0?"-":e>9999?"+":"";return i+o(a(e),i?6:4,0)+"-"+o(p(t)+1,2,0)+"-"+o(h(t),2,0)+"T"+o(f(t),2,0)+":"+o(g(t),2,0)+":"+o(w(t),2,0)+"."+o(n,3,0)+"Z"}:l},31137:function(t,e,n){"use strict";var i=n(73938),r=n(69751),o=TypeError;t.exports=function(t){if(i(this),"string"===t||"default"===t)t="string";else if("number"!==t)throw o("Incorrect hint");return r(this,t)}},76477:function(t,e,n){var i=n(48218),r=n(43610);t.exports=function(t,e,n){return n.get&&i(n.get,e,{getter:!0}),n.set&&i(n.set,e,{setter:!0}),r.f(t,e,n)}},7485:function(t,e,n){var i=n(78420),r=n(43610),o=n(48218),s=n(59430);t.exports=function(t,e,n,a){a||(a={});var c=a.enumerable,l=void 0!==a.name?a.name:e;if(i(n)&&o(n,l,a),a.global)c?t[e]=n:s(e,n);else{try{a.unsafe?t[e]&&(c=!0):delete t[e]}catch(t){}c?t[e]=n:r.f(t,e,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},92760:function(t,e,n){var i=n(7485);t.exports=function(t,e,n){for(var r in e)i(t,r,e[r],n);return t}},59430:function(t,e,n){var i=n(30200),r=Object.defineProperty;t.exports=function(t,e){try{r(i,t,{value:e,configurable:!0,writable:!0})}catch(n){i[t]=e}return e}},45723:function(t,e,n){"use strict";var i=n(51605),r=n(72368),o=n(6926),s=n(12071),a=n(78420),c=n(72147),l=n(97970),u=n(39686),h=n(75282),d=n(97712),f=n(7485),m=n(31602),g=n(52228),p=n(49306),w=s.PROPER,v=s.CONFIGURABLE,b=p.IteratorPrototype,y=p.BUGGY_SAFARI_ITERATORS,_=m("iterator"),k="keys",A="values",x="entries",T=function(){return this};t.exports=function(t,e,n,s,m,p,C){c(n,e,s);var E,S,P,R=function(t){if(t===m&&V)return V;if(!y&&t in M)return M[t];switch(t){case k:case A:case x:return function(){return new n(this,t)}}return function(){return new n(this)}},O=e+" Iterator",I=!1,M=t.prototype,N=M[_]||M["@@iterator"]||m&&M[m],V=!y&&N||R(m),D="Array"==e&&M.entries||N;if(D&&(E=l(D.call(new t)))!==Object.prototype&&E.next&&(o||l(E)===b||(u?u(E,b):a(E[_])||f(E,_,T)),h(E,O,!0,!0),o&&(g[O]=T)),w&&m==A&&N&&N.name!==A&&(!o&&v?d(M,"name",A):(I=!0,V=function(){return r(N,this)})),m)if(S={values:R(A),keys:p?V:R(k),entries:R(x)},C)for(P in S)(y||I||!(P in M))&&f(M,P,S[P]);else i({target:e,proto:!0,forced:y||I},S);return o&&!C||M[_]===V||f(M,_,V,{name:m}),g[e]=V,S}},91272:function(t,e,n){var i=n(29720),r=n(36490),o=n(30802),s=n(43610).f;t.exports=function(t){var e=i.Symbol||(i.Symbol={});r(e,t)||s(e,t,{value:o.f(t)})}},24881:function(t,e,n){"use strict";var i=n(13838),r=TypeError;t.exports=function(t,e){if(!delete t[e])throw r("Cannot delete property "+i(e)+" of "+i(t))}},65077:function(t,e,n){var i=n(92074);t.exports=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},23262:function(t,e,n){var i=n(30200),r=n(65335),o=i.document,s=r(o)&&r(o.createElement);t.exports=function(t){return s?o.createElement(t):{}}},57242:function(t){var e=TypeError;t.exports=function(t){if(t>9007199254740991)throw e("Maximum allowed index exceeded");return t}},26567:function(t){t.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},5549:function(t){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},22975:function(t,e,n){var i=n(23262)("span").classList,r=i&&i.constructor&&i.constructor.prototype;t.exports=r===Object.prototype?void 0:r},3727:function(t,e,n){var i=n(47061).match(/firefox\/(\d+)/i);t.exports=!!i&&+i[1]},60904:function(t){t.exports="object"==typeof window&&"object"!=typeof Deno},20419:function(t){t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},77413:function(t,e,n){var i=n(47061);t.exports=/MSIE|Trident/.test(i)},12671:function(t,e,n){var i=n(47061),r=n(30200);t.exports=/ipad|iphone|ipod/i.test(i)&&void 0!==r.Pebble},62050:function(t,e,n){var i=n(47061);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(i)},75223:function(t,e,n){var i=n(18569),r=n(30200);t.exports="process"==i(r.process)},94318:function(t,e,n){var i=n(47061);t.exports=/web0s(?!.*chrome)/i.test(i)},47061:function(t,e,n){var i=n(56492);t.exports=i("navigator","userAgent")||""},6845:function(t,e,n){var i,r,o=n(30200),s=n(47061),a=o.process,c=o.Deno,l=a&&a.versions||c&&c.version,u=l&&l.v8;u&&(r=(i=u.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1])),!r&&s&&(!(i=s.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=s.match(/Chrome\/(\d+)/))&&(r=+i[1]),t.exports=r},79965:function(t,e,n){var i=n(47061).match(/AppleWebKit\/(\d+)\./);t.exports=!!i&&+i[1]},30290:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},70462:function(t,e,n){var i=n(92074),r=n(66843);t.exports=!i((function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",r(1,7)),7!==t.stack)}))},73353:function(t,e,n){"use strict";var i=n(65077),r=n(92074),o=n(73938),s=n(53105),a=n(20610),c=Error.prototype.toString,l=r((function(){if(i){var t=s(Object.defineProperty({},"name",{get:function(){return this===t}}));if("true"!==c.call(t))return!0}return"2: 1"!==c.call({message:1,name:2})||"Error"!==c.call({})}));t.exports=l?function(){var t=o(this),e=a(t.name,"Error"),n=a(t.message);return e?n?e+": "+n:e:n}:c},51605:function(t,e,n){var i=n(30200),r=n(97632).f,o=n(97712),s=n(7485),a=n(59430),c=n(84361),l=n(84977);t.exports=function(t,e){var n,u,h,d,f,m=t.target,g=t.global,p=t.stat;if(n=g?i:p?i[m]||a(m,{}):(i[m]||{}).prototype)for(u in e){if(d=e[u],h=t.dontCallGetSet?(f=r(n,u))&&f.value:n[u],!l(g?u:m+(p?".":"#")+u,t.forced)&&void 0!==h){if(typeof d==typeof h)continue;c(d,h)}(t.sham||h&&h.sham)&&o(d,"sham",!0),s(n,u,d,t)}}},92074:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},20779:function(t,e,n){"use strict";n(87136);var i=n(30281),r=n(7485),o=n(70054),s=n(92074),a=n(31602),c=n(97712),l=a("species"),u=RegExp.prototype;t.exports=function(t,e,n,h){var d=a(t),f=!s((function(){var e={};return e[d]=function(){return 7},7!=""[t](e)})),m=f&&!s((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[l]=function(){return n},n.flags="",n[d]=/./[d]),n.exec=function(){return e=!0,null},n[d](""),!e}));if(!f||!m||n){var g=i(/./[d]),p=e(d,""[t],(function(t,e,n,r,s){var a=i(t),c=e.exec;return c===o||c===u.exec?f&&!s?{done:!0,value:g(e,n,r)}:{done:!0,value:a(n,e,r)}:{done:!1}}));r(String.prototype,t,p[0]),r(u,d,p[1])}h&&c(u[d],"sham",!0)}},89608:function(t,e,n){"use strict";var i=n(18679),r=n(23493),o=n(57242),s=n(46885),a=function(t,e,n,c,l,u,h,d){for(var f,m,g=l,p=0,w=!!h&&s(h,d);p<c;)p in n&&(f=w?w(n[p],p,e):n[p],u>0&&i(f)?(m=r(f),g=a(t,e,f,m,g,u-1)-1):(o(g+1),t[g]=f),g++),p++;return g};t.exports=a},55159:function(t,e,n){var i=n(92074);t.exports=!i((function(){return Object.isExtensible(Object.preventExtensions({}))}))},99070:function(t,e,n){var i=n(38823),r=Function.prototype,o=r.apply,s=r.call;t.exports="object"==typeof Reflect&&Reflect.apply||(i?s.bind(o):function(){return s.apply(o,arguments)})},46885:function(t,e,n){var i=n(30281),r=n(24601),o=n(38823),s=i(i.bind);t.exports=function(t,e){return r(t),void 0===e?t:o?s(t,e):function(){return t.apply(e,arguments)}}},38823:function(t,e,n){var i=n(92074);t.exports=!i((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},38891:function(t,e,n){"use strict";var i=n(30281),r=n(24601),o=n(65335),s=n(36490),a=n(29609),c=n(38823),l=Function,u=i([].concat),h=i([].join),d={},f=function(t,e,n){if(!s(d,e)){for(var i=[],r=0;r<e;r++)i[r]="a["+r+"]";d[e]=l("C,a","return new C("+h(i,",")+")")}return d[e](t,n)};t.exports=c?l.bind:function(t){var e=r(this),n=e.prototype,i=a(arguments,1),s=function(){var n=u(i,a(arguments));return this instanceof s?f(e,n.length,n):e.apply(t,n)};return o(n)&&(s.prototype=n),s}},72368:function(t,e,n){var i=n(38823),r=Function.prototype.call;t.exports=i?r.bind(r):function(){return r.apply(r,arguments)}},12071:function(t,e,n){var i=n(65077),r=n(36490),o=Function.prototype,s=i&&Object.getOwnPropertyDescriptor,a=r(o,"name"),c=a&&"something"===function(){}.name,l=a&&(!i||i&&s(o,"name").configurable);t.exports={EXISTS:a,PROPER:c,CONFIGURABLE:l}},30281:function(t,e,n){var i=n(38823),r=Function.prototype,o=r.bind,s=r.call,a=i&&o.bind(s,s);t.exports=i?function(t){return t&&a(t)}:function(t){return t&&function(){return s.apply(t,arguments)}}},56492:function(t,e,n){var i=n(30200),r=n(78420),o=function(t){return r(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?o(i[t]):i[t]&&i[t][e]}},51898:function(t,e,n){var i=n(83062),r=n(46457),o=n(52228),s=n(31602)("iterator");t.exports=function(t){if(null!=t)return r(t,s)||r(t,"@@iterator")||o[i(t)]}},79526:function(t,e,n){var i=n(72368),r=n(24601),o=n(73938),s=n(13838),a=n(51898),c=TypeError;t.exports=function(t,e){var n=arguments.length<2?a(t):e;if(r(n))return o(i(n,t));throw c(s(t)+" is not iterable")}},46457:function(t,e,n){var i=n(24601);t.exports=function(t,e){var n=t[e];return null==n?void 0:i(n)}},94433:function(t,e,n){var i=n(30281),r=n(92612),o=Math.floor,s=i("".charAt),a=i("".replace),c=i("".slice),l=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,n,i,h,d){var f=n+t.length,m=i.length,g=u;return void 0!==h&&(h=r(h),g=l),a(d,g,(function(r,a){var l;switch(s(a,0)){case"$":return"$";case"&":return t;case"`":return c(e,0,n);case"'":return c(e,f);case"<":l=h[c(a,1,-1)];break;default:var u=+a;if(0===u)return r;if(u>m){var d=o(u/10);return 0===d?r:d<=m?void 0===i[d-1]?s(a,1):i[d-1]+s(a,1):r}l=i[u-1]}return void 0===l?"":l}))}},30200:function(t,e,n){var i=function(t){return t&&t.Math==Math&&t};t.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},36490:function(t,e,n){var i=n(30281),r=n(92612),o=i({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return o(r(t),e)}},67708:function(t){t.exports={}},69778:function(t,e,n){var i=n(30200);t.exports=function(t,e){var n=i.console;n&&n.error&&(1==arguments.length?n.error(t):n.error(t,e))}},28890:function(t,e,n){var i=n(56492);t.exports=i("document","documentElement")},87694:function(t,e,n){var i=n(65077),r=n(92074),o=n(23262);t.exports=!i&&!r((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},46431:function(t){var e=Array,n=Math.abs,i=Math.pow,r=Math.floor,o=Math.log,s=Math.LN2;t.exports={pack:function(t,a,c){var l,u,h,d=e(c),f=8*c-a-1,m=(1<<f)-1,g=m>>1,p=23===a?i(2,-24)-i(2,-77):0,w=t<0||0===t&&1/t<0?1:0,v=0;for((t=n(t))!=t||t===1/0?(u=t!=t?1:0,l=m):(l=r(o(t)/s),t*(h=i(2,-l))<1&&(l--,h*=2),(t+=l+g>=1?p/h:p*i(2,1-g))*h>=2&&(l++,h/=2),l+g>=m?(u=0,l=m):l+g>=1?(u=(t*h-1)*i(2,a),l+=g):(u=t*i(2,g-1)*i(2,a),l=0));a>=8;)d[v++]=255&u,u/=256,a-=8;for(l=l<<a|u,f+=a;f>0;)d[v++]=255&l,l/=256,f-=8;return d[--v]|=128*w,d},unpack:function(t,e){var n,r=t.length,o=8*r-e-1,s=(1<<o)-1,a=s>>1,c=o-7,l=r-1,u=t[l--],h=127&u;for(u>>=7;c>0;)h=256*h+t[l--],c-=8;for(n=h&(1<<-c)-1,h>>=-c,c+=e;c>0;)n=256*n+t[l--],c-=8;if(0===h)h=1-a;else{if(h===s)return n?NaN:u?-1/0:1/0;n+=i(2,e),h-=a}return(u?-1:1)*n*i(2,h-e)}}},48664:function(t,e,n){var i=n(30281),r=n(92074),o=n(18569),s=Object,a=i("".split);t.exports=r((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?a(t,""):s(t)}:s},93054:function(t,e,n){var i=n(78420),r=n(65335),o=n(39686);t.exports=function(t,e,n){var s,a;return o&&i(s=e.constructor)&&s!==n&&r(a=s.prototype)&&a!==n.prototype&&o(t,a),t}},69965:function(t,e,n){var i=n(30281),r=n(78420),o=n(49310),s=i(Function.toString);r(o.inspectSource)||(o.inspectSource=function(t){return s(t)}),t.exports=o.inspectSource},55833:function(t,e,n){var i=n(65335),r=n(97712);t.exports=function(t,e){
i(e)&&"cause"in e&&r(t,"cause",e.cause)}},82014:function(t,e,n){var i=n(51605),r=n(30281),o=n(67708),s=n(65335),a=n(36490),c=n(43610).f,l=n(64789),u=n(56509),h=n(40111),d=n(50665),f=n(55159),m=!1,g=d("meta"),p=0,w=function(t){c(t,g,{value:{objectID:"O"+p++,weakData:{}}})},v=t.exports={enable:function(){v.enable=function(){},m=!0;var t=l.f,e=r([].splice),n={};n[g]=1,t(n).length&&(l.f=function(n){for(var i=t(n),r=0,o=i.length;r<o;r++)if(i[r]===g){e(i,r,1);break}return i},i({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:u.f}))},fastKey:function(t,e){if(!s(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!a(t,g)){if(!h(t))return"F";if(!e)return"E";w(t)}return t[g].objectID},getWeakData:function(t,e){if(!a(t,g)){if(!h(t))return!0;if(!e)return!1;w(t)}return t[g].weakData},onFreeze:function(t){return f&&m&&h(t)&&!a(t,g)&&w(t),t}};o[g]=!0},99206:function(t,e,n){var i,r,o,s=n(82886),a=n(30200),c=n(30281),l=n(65335),u=n(97712),h=n(36490),d=n(49310),f=n(25904),m=n(67708),g="Object already initialized",p=a.TypeError,w=a.WeakMap;if(s||d.state){var v=d.state||(d.state=new w),b=c(v.get),y=c(v.has),_=c(v.set);i=function(t,e){if(y(v,t))throw new p(g);return e.facade=t,_(v,t,e),e},r=function(t){return b(v,t)||{}},o=function(t){return y(v,t)}}else{var k=f("state");m[k]=!0,i=function(t,e){if(h(t,k))throw new p(g);return e.facade=t,u(t,k,e),e},r=function(t){return h(t,k)?t[k]:{}},o=function(t){return h(t,k)}}t.exports={set:i,get:r,has:o,enforce:function(t){return o(t)?r(t):i(t,{})},getterFor:function(t){return function(e){var n;if(!l(e)||(n=r(e)).type!==t)throw p("Incompatible receiver, "+t+" required");return n}}}},99034:function(t,e,n){var i=n(31602),r=n(52228),o=i("iterator"),s=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||s[o]===t)}},18679:function(t,e,n){var i=n(18569);t.exports=Array.isArray||function(t){return"Array"==i(t)}},78420:function(t){t.exports=function(t){return"function"==typeof t}},1466:function(t,e,n){var i=n(30281),r=n(92074),o=n(78420),s=n(83062),a=n(56492),c=n(69965),l=function(){},u=[],h=a("Reflect","construct"),d=/^\s*(?:class|function)\b/,f=i(d.exec),m=!d.exec(l),g=function(t){if(!o(t))return!1;try{return h(l,u,t),!0}catch(t){return!1}},p=function(t){if(!o(t))return!1;switch(s(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return m||!!f(d,c(t))}catch(t){return!0}};p.sham=!0,t.exports=!h||r((function(){var t;return g(g.call)||!g(Object)||!g((function(){t=!0}))||t}))?p:g},66060:function(t,e,n){var i=n(36490);t.exports=function(t){return void 0!==t&&(i(t,"value")||i(t,"writable"))}},84977:function(t,e,n){var i=n(92074),r=n(78420),o=/#|\.prototype\./,s=function(t,e){var n=c[a(t)];return n==u||n!=l&&(r(e)?i(e):!!e)},a=s.normalize=function(t){return String(t).replace(o,".").toLowerCase()},c=s.data={},l=s.NATIVE="N",u=s.POLYFILL="P";t.exports=s},83496:function(t,e,n){var i=n(65335),r=Math.floor;t.exports=Number.isInteger||function(t){return!i(t)&&isFinite(t)&&r(t)===t}},65335:function(t,e,n){var i=n(78420);t.exports=function(t){return"object"==typeof t?null!==t:i(t)}},6926:function(t){t.exports=!1},62449:function(t,e,n){var i=n(65335),r=n(18569),o=n(31602)("match");t.exports=function(t){var e;return i(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==r(t))}},32328:function(t,e,n){var i=n(56492),r=n(78420),o=n(47658),s=n(5225),a=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return r(e)&&o(e.prototype,a(t))}},52929:function(t,e,n){var i=n(46885),r=n(72368),o=n(73938),s=n(13838),a=n(99034),c=n(23493),l=n(47658),u=n(79526),h=n(51898),d=n(69868),f=TypeError,m=function(t,e){this.stopped=t,this.result=e},g=m.prototype;t.exports=function(t,e,n){var p,w,v,b,y,_,k,A=n&&n.that,x=!(!n||!n.AS_ENTRIES),T=!(!n||!n.IS_RECORD),C=!(!n||!n.IS_ITERATOR),E=!(!n||!n.INTERRUPTED),S=i(e,A),P=function(t){return p&&d(p,"normal",t),new m(!0,t)},R=function(t){return x?(o(t),E?S(t[0],t[1],P):S(t[0],t[1])):E?S(t,P):S(t)};if(T)p=t.iterator;else if(C)p=t;else{if(!(w=h(t)))throw f(s(t)+" is not iterable");if(a(w)){for(v=0,b=c(t);b>v;v++)if((y=R(t[v]))&&l(g,y))return y;return new m(!1)}p=u(t,w)}for(_=T?t.next:p.next;!(k=r(_,p)).done;){try{y=R(k.value)}catch(t){d(p,"throw",t)}if("object"==typeof y&&y&&l(g,y))return y}return new m(!1)}},69868:function(t,e,n){var i=n(72368),r=n(73938),o=n(46457);t.exports=function(t,e,n){var s,a;r(t);try{if(!(s=o(t,"return"))){if("throw"===e)throw n;return n}s=i(s,t)}catch(t){a=!0,s=t}if("throw"===e)throw n;if(a)throw s;return r(s),n}},49306:function(t,e,n){"use strict";var i,r,o,s=n(92074),a=n(78420),c=n(53105),l=n(97970),u=n(7485),h=n(31602),d=n(6926),f=h("iterator"),m=!1;[].keys&&("next"in(o=[].keys())?(r=l(l(o)))!==Object.prototype&&(i=r):m=!0),null==i||s((function(){var t={};return i[f].call(t)!==t}))?i={}:d&&(i=c(i)),a(i[f])||u(i,f,(function(){return this})),t.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:m}},52228:function(t){t.exports={}},23493:function(t,e,n){var i=n(33747);t.exports=function(t){return i(t.length)}},48218:function(t,e,n){var i=n(92074),r=n(78420),o=n(36490),s=n(65077),a=n(12071).CONFIGURABLE,c=n(69965),l=n(99206),u=l.enforce,h=l.get,d=Object.defineProperty,f=s&&!i((function(){return 8!==d((function(){}),"length",{value:8}).length})),m=String(String).split("String"),g=t.exports=function(t,e,n){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!o(t,"name")||a&&t.name!==e)&&(s?d(t,"name",{value:e,configurable:!0}):t.name=e),f&&n&&o(n,"arity")&&t.length!==n.arity&&d(t,"length",{value:n.arity});try{n&&o(n,"constructor")&&n.constructor?s&&d(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var i=u(t);return o(i,"source")||(i.source=m.join("string"==typeof e?e:"")),t};Function.prototype.toString=g((function(){return r(this)&&h(this).source||c(this)}),"toString")},76709:function(t){var e=Math.expm1,n=Math.exp;t.exports=!e||e(10)>22025.465794806718||e(10)<22025.465794806718||-2e-17!=e(-2e-17)?function(t){var e=+t;return 0==e?e:e>-1e-6&&e<1e-6?e+e*e/2:n(e)-1}:e},94812:function(t,e,n){var i=n(51211),r=Math.abs,o=Math.pow,s=o(2,-52),a=o(2,-23),c=o(2,127)*(2-a),l=o(2,-126);t.exports=Math.fround||function(t){var e,n,o=+t,u=r(o),h=i(o);return u<l?h*function(t){return t+1/s-1/s}(u/l/a)*l*a:(n=(e=(1+a/s)*u)-(e-u))>c||n!=n?h*(1/0):h*n}},13103:function(t){var e=Math.log,n=Math.LOG10E;t.exports=Math.log10||function(t){return e(t)*n}},31855:function(t){var e=Math.log;t.exports=Math.log1p||function(t){var n=+t;return n>-1e-8&&n<1e-8?n-n*n/2:e(1+n)}},51211:function(t){t.exports=Math.sign||function(t){var e=+t;return 0==e||e!=e?e:e<0?-1:1}},19830:function(t){var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var i=+t;return(i>0?n:e)(i)}},47462:function(t,e,n){var i,r,o,s,a,c,l,u,h=n(30200),d=n(46885),f=n(97632).f,m=n(74922).set,g=n(62050),p=n(12671),w=n(94318),v=n(75223),b=h.MutationObserver||h.WebKitMutationObserver,y=h.document,_=h.process,k=h.Promise,A=f(h,"queueMicrotask"),x=A&&A.value;x||(i=function(){var t,e;for(v&&(t=_.domain)&&t.exit();r;){e=r.fn,r=r.next;try{e()}catch(t){throw r?s():o=void 0,t}}o=void 0,t&&t.enter()},g||v||w||!b||!y?!p&&k&&k.resolve?((l=k.resolve(void 0)).constructor=k,u=d(l.then,l),s=function(){u(i)}):v?s=function(){_.nextTick(i)}:(m=d(m,h),s=function(){m(i)}):(a=!0,c=y.createTextNode(""),new b(i).observe(c,{characterData:!0}),s=function(){c.data=a=!a})),t.exports=x||function(t){var e={fn:t,next:void 0};o&&(o.next=e),r||(r=e,s()),o=e}},37957:function(t,e,n){var i=n(61849);t.exports=i&&!!Symbol.for&&!!Symbol.keyFor},61849:function(t,e,n){var i=n(6845),r=n(92074);t.exports=!!Object.getOwnPropertySymbols&&!r((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&i&&i<41}))},84516:function(t,e,n){var i=n(92074),r=n(31602),o=n(6926),s=r("iterator");t.exports=!i((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,n="";return t.pathname="c%20d",e.forEach((function(t,i){e.delete("b"),n+=i+t})),o&&!t.toJSON||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://\u0442\u0435\u0441\u0442").host||"#%D0%B1"!==new URL("http://a#\u0431").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host}))},82886:function(t,e,n){var i=n(30200),r=n(78420),o=n(69965),s=i.WeakMap;t.exports=r(s)&&/native code/.test(o(s))},39836:function(t,e,n){"use strict";var i=n(24601),r=function(t){var e,n;this.promise=new t((function(t,i){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=i})),this.resolve=i(e),this.reject=i(n)};t.exports.f=function(t){return new r(t)}},20610:function(t,e,n){var i=n(95362);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:i(t)}},92588:function(t,e,n){var i=n(62449),r=TypeError;t.exports=function(t){if(i(t))throw r("The method doesn't accept regular expressions");return t}},11071:function(t,e,n){var i=n(30200).isFinite;t.exports=Number.isFinite||function(t){return"number"==typeof t&&i(t)}},35963:function(t,e,n){var i=n(30200),r=n(92074),o=n(30281),s=n(95362),a=n(69163).trim,c=n(55073),l=o("".charAt),u=i.parseFloat,h=i.Symbol,d=h&&h.iterator,f=1/u(c+"-0")!=-1/0||d&&!r((function(){u(Object(d))}));t.exports=f?function(t){var e=a(s(t)),n=u(e);return 0===n&&"-"==l(e,0)?-0:n}:u},27292:function(t,e,n){var i=n(30200),r=n(92074),o=n(30281),s=n(95362),a=n(69163).trim,c=n(55073),l=i.parseInt,u=i.Symbol,h=u&&u.iterator,d=/^[+-]?0x/i,f=o(d.exec),m=8!==l(c+"08")||22!==l(c+"0x16")||h&&!r((function(){l(Object(h))}));t.exports=m?function(t,e){var n=a(s(t));return l(n,e>>>0||(f(d,n)?16:10))}:l},81688:function(t,e,n){"use strict";var i=n(65077),r=n(30281),o=n(72368),s=n(92074),a=n(91641),c=n(18916),l=n(9304),u=n(92612),h=n(48664),d=Object.assign,f=Object.defineProperty,m=r([].concat);t.exports=!d||s((function(){if(i&&1!==d({b:1},d(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=d({},t)[n]||a(d({},e)).join("")!=r}))?function(t){for(var e=u(t),n=arguments.length,r=1,s=c.f,d=l.f;n>r;)for(var f,g=h(arguments[r++]),p=s?m(a(g),s(g)):a(g),w=p.length,v=0;w>v;)f=p[v++],i&&!o(d,g,f)||(e[f]=g[f]);return e}:d},53105:function(t,e,n){var i,r=n(73938),o=n(65318),s=n(30290),a=n(67708),c=n(28890),l=n(23262),u=n(25904)("IE_PROTO"),h=function(){},d=function(t){return"<script>"+t+"</script>"},f=function(t){t.write(d("")),t.close();var e=t.parentWindow.Object;return t=null,e},m=function(){try{i=new ActiveXObject("htmlfile")}catch(t){}var t,e;m="undefined"!=typeof document?document.domain&&i?f(i):((e=l("iframe")).style.display="none",c.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(d("document.F=Object")),t.close(),t.F):f(i);for(var n=s.length;n--;)delete m.prototype[s[n]];return m()};a[u]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(h.prototype=r(t),n=new h,h.prototype=null,n[u]=t):n=m(),void 0===e?n:o.f(n,e)}},65318:function(t,e,n){var i=n(65077),r=n(94491),o=n(43610),s=n(73938),a=n(5476),c=n(91641);e.f=i&&!r?Object.defineProperties:function(t,e){s(t);for(var n,i=a(e),r=c(e),l=r.length,u=0;l>u;)o.f(t,n=r[u++],i[n]);return t}},43610:function(t,e,n){var i=n(65077),r=n(87694),o=n(94491),s=n(73938),a=n(86032),c=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,h="enumerable",d="configurable",f="writable";e.f=i?o?function(t,e,n){if(s(t),e=a(e),s(n),"function"==typeof t&&"prototype"===e&&"value"in n&&f in n&&!n.writable){var i=u(t,e);i&&i.writable&&(t[e]=n.value,n={configurable:d in n?n.configurable:i.configurable,enumerable:h in n?n.enumerable:i.enumerable,writable:!1})}return l(t,e,n)}:l:function(t,e,n){if(s(t),e=a(e),s(n),r)try{return l(t,e,n)}catch(t){}if("get"in n||"set"in n)throw c("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},97632:function(t,e,n){var i=n(65077),r=n(72368),o=n(9304),s=n(66843),a=n(5476),c=n(86032),l=n(36490),u=n(87694),h=Object.getOwnPropertyDescriptor;e.f=i?h:function(t,e){if(t=a(t),e=c(e),u)try{return h(t,e)}catch(t){}if(l(t,e))return s(!r(o.f,t,e),t[e])}},56509:function(t,e,n){var i=n(18569),r=n(5476),o=n(64789).f,s=n(76056),a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"Window"==i(t)?function(t){try{return o(t)}catch(t){return s(a)}}(t):o(r(t))}},64789:function(t,e,n){var i=n(16347),r=n(30290).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,r)}},18916:function(t,e){e.f=Object.getOwnPropertySymbols},97970:function(t,e,n){var i=n(36490),r=n(78420),o=n(92612),s=n(25904),a=n(7168),c=s("IE_PROTO"),l=Object,u=l.prototype;t.exports=a?l.getPrototypeOf:function(t){var e=o(t);if(i(e,c))return e[c];var n=e.constructor;return r(n)&&e instanceof n?n.prototype:e instanceof l?u:null}},40111:function(t,e,n){var i=n(92074),r=n(65335),o=n(18569),s=n(22085),a=Object.isExtensible,c=i((function(){a(1)}));t.exports=c||s?function(t){return!!r(t)&&(!s||"ArrayBuffer"!=o(t))&&(!a||a(t))}:a},47658:function(t,e,n){var i=n(30281);t.exports=i({}.isPrototypeOf)},16347:function(t,e,n){var i=n(30281),r=n(36490),o=n(5476),s=n(58186).indexOf,a=n(67708),c=i([].push);t.exports=function(t,e){var n,i=o(t),l=0,u=[];for(n in i)!r(a,n)&&r(i,n)&&c(u,n);for(;e.length>l;)r(i,n=e[l++])&&(~s(u,n)||c(u,n));return u}},91641:function(t,e,n){var i=n(16347),r=n(30290);t.exports=Object.keys||function(t){return i(t,r)}},9304:function(t,e){"use strict";var n={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,r=i&&!n.call({1:2},1);e.f=r?function(t){var e=i(this,t);return!!e&&e.enumerable}:n},61342:function(t,e,n){"use strict";var i=n(6926),r=n(30200),o=n(92074),s=n(79965);t.exports=i||!o((function(){if(!(s&&s<535)){var t=Math.random();__defineSetter__.call(null,t,(function(){})),delete r[t]}}))},39686:function(t,e,n){var i=n(30281),r=n(73938),o=n(7473);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=i(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),e=n instanceof Array}catch(t){}return function(n,i){return r(n),o(i),e?t(n,i):n.__proto__=i,n}}():void 0)},23172:function(t,e,n){var i=n(65077),r=n(30281),o=n(91641),s=n(5476),a=r(n(9304).f),c=r([].push),l=function(t){return function(e){for(var n,r=s(e),l=o(r),u=l.length,h=0,d=[];u>h;)n=l[h++],i&&!a(r,n)||c(d,t?[n,r[n]]:r[n]);return d}};t.exports={entries:l(!0),values:l(!1)}},94972:function(t,e,n){"use strict";var i=n(43129),r=n(83062);t.exports=i?{}.toString:function(){return"[object "+r(this)+"]"}},69751:function(t,e,n){var i=n(72368),r=n(78420),o=n(65335),s=TypeError;t.exports=function(t,e){var n,a;if("string"===e&&r(n=t.toString)&&!o(a=i(n,t)))return a;if(r(n=t.valueOf)&&!o(a=i(n,t)))return a;if("string"!==e&&r(n=t.toString)&&!o(a=i(n,t)))return a;throw s("Can't convert object to primitive value")}},15816:function(t,e,n){var i=n(56492),r=n(30281),o=n(64789),s=n(18916),a=n(73938),c=r([].concat);t.exports=i("Reflect","ownKeys")||function(t){var e=o.f(a(t)),n=s.f;return n?c(e,n(t)):e}},29720:function(t,e,n){var i=n(30200);t.exports=i},50242:function(t){t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},39053:function(t,e,n){var i=n(30200),r=n(2413),o=n(78420),s=n(84977),a=n(69965),c=n(31602),l=n(60904),u=n(6926),h=n(6845),d=r&&r.prototype,f=c("species"),m=!1,g=o(i.PromiseRejectionEvent),p=s("Promise",(function(){var t=a(r),e=t!==String(r);if(!e&&66===h)return!0;if(u&&(!d.catch||!d.finally))return!0;if(h>=51&&/native code/.test(t))return!1;var n=new r((function(t){t(1)})),i=function(t){t((function(){}),(function(){}))};return(n.constructor={})[f]=i,!(m=n.then((function(){}))instanceof i)||!e&&l&&!g}));t.exports={CONSTRUCTOR:p,REJECTION_EVENT:g,SUBCLASSING:m}},2413:function(t,e,n){var i=n(30200);t.exports=i.Promise},9803:function(t,e,n){var i=n(73938),r=n(65335),o=n(39836);t.exports=function(t,e){if(i(t),r(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},39772:function(t,e,n){var i=n(2413),r=n(97499),o=n(39053).CONSTRUCTOR;t.exports=o||!r((function(t){i.all(t).then(void 0,(function(){}))}))},56527:function(t,e,n){var i=n(43610).f;t.exports=function(t,e,n){n in t||i(t,n,{configurable:!0,get:function(){return e[n]},set:function(t){e[n]=t}})}},97600:function(t){var e=function(){this.head=null,this.tail=null};e.prototype={add:function(t){var e={item:t,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}},t.exports=e},66793:function(t,e,n){var i=n(72368),r=n(73938),o=n(78420),s=n(18569),a=n(70054),c=TypeError;t.exports=function(t,e){var n=t.exec;if(o(n)){var l=i(n,t,e);return null!==l&&r(l),l}if("RegExp"===s(t))return i(a,t,e);throw c("RegExp#exec called on incompatible receiver")}},70054:function(t,e,n){"use strict";var i,r,o=n(72368),s=n(30281),a=n(95362),c=n(16844),l=n(12192),u=n(50002),h=n(53105),d=n(99206).get,f=n(31036),m=n(28121),g=u("native-string-replace",String.prototype.replace),p=RegExp.prototype.exec,w=p,v=s("".charAt),b=s("".indexOf),y=s("".replace),_=s("".slice),k=(r=/b*/g,o(p,i=/a/,"a"),o(p,r,"a"),0!==i.lastIndex||0!==r.lastIndex),A=l.BROKEN_CARET,x=void 0!==/()??/.exec("")[1];(k||x||A||f||m)&&(w=function(t){var e,n,i,r,s,l,u,f=this,m=d(f),T=a(t),C=m.raw;if(C)return C.lastIndex=f.lastIndex,e=o(w,C,T),f.lastIndex=C.lastIndex,e;var E=m.groups,S=A&&f.sticky,P=o(c,f),R=f.source,O=0,I=T;if(S&&(P=y(P,"y",""),-1===b(P,"g")&&(P+="g"),I=_(T,f.lastIndex),f.lastIndex>0&&(!f.multiline||f.multiline&&"\n"!==v(T,f.lastIndex-1))&&(R="(?: "+R+")",I=" "+I,O++),n=new RegExp("^(?:"+R+")",P)),x&&(n=new RegExp("^"+R+"$(?!\\s)",P)),k&&(i=f.lastIndex),r=o(p,S?n:f,I),S?r?(r.input=_(r.input,O),r[0]=_(r[0],O),r.index=f.lastIndex,f.lastIndex+=r[0].length):f.lastIndex=0:k&&r&&(f.lastIndex=f.global?r.index+r[0].length:i),x&&r&&r.length>1&&o(g,r[0],n,(function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(r[s]=void 0)})),r&&E)for(r.groups=l=h(null),s=0;s<E.length;s++)l[(u=E[s])[0]]=r[u[1]];return r}),t.exports=w},16844:function(t,e,n){"use strict";var i=n(73938);t.exports=function(){var t=i(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},10353:function(t,e,n){var i=n(72368),r=n(36490),o=n(47658),s=n(16844),a=RegExp.prototype;t.exports=function(t){var e=t.flags;return void 0!==e||"flags"in a||r(t,"flags")||!o(a,t)?e:i(s,t)}},12192:function(t,e,n){var i=n(92074),r=n(30200).RegExp,o=i((function(){var t=r("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),s=o||i((function(){return!r("a","y").sticky})),a=o||i((function(){var t=r("^r","gy");return t.lastIndex=2,null!=t.exec("str")}));t.exports={BROKEN_CARET:a,MISSED_STICKY:s,UNSUPPORTED_Y:o}},31036:function(t,e,n){var i=n(92074),r=n(30200).RegExp;t.exports=i((function(){var t=r(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)}))},28121:function(t,e,n){var i=n(92074),r=n(30200).RegExp;t.exports=i((function(){var t=r("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},71229:function(t){var e=TypeError;t.exports=function(t){if(null==t)throw e("Can't call method on "+t);return t}},54741:function(t){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},18827:function(t,e,n){var i=n(30200),r=n(99070),o=n(78420),s=n(47061),a=n(29609),c=n(56589),l=/MSIE .\./.test(s),u=i.Function,h=function(t){return l?function(e,n){var i=c(arguments.length,1)>2,s=o(e)?e:u(e),l=i?a(arguments,2):void 0;return t(i?function(){r(s,this,l)}:s,n)}:t};t.exports={setTimeout:h(i.setTimeout),setInterval:h(i.setInterval)}},93524:function(t,e,n){"use strict";var i=n(56492),r=n(43610),o=n(31602),s=n(65077),a=o("species");t.exports=function(t){var e=i(t),n=r.f;s&&e&&!e[a]&&n(e,a,{configurable:!0,get:function(){return this}})}},75282:function(t,e,n){var i=n(43610).f,r=n(36490),o=n(31602)("toStringTag");t.exports=function(t,e,n){t&&!n&&(t=t.prototype),t&&!r(t,o)&&i(t,o,{configurable:!0,value:e})}},25904:function(t,e,n){var i=n(50002),r=n(50665),o=i("keys");t.exports=function(t){return o[t]||(o[t]=r(t))}},49310:function(t,e,n){var i=n(30200),r=n(59430),o="__core-js_shared__",s=i[o]||r(o,{});t.exports=s},50002:function(t,e,n){var i=n(6926),r=n(49310);(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.23.5",mode:i?"pure":"global",copyright:"\xa9 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.23.5/LICENSE",source:"https://github.com/zloirock/core-js"})},23444:function(t,e,n){var i=n(73938),r=n(57849),o=n(31602)("species");t.exports=function(t,e){var n,s=i(t).constructor;return void 0===s||null==(n=i(s)[o])?e:r(n)}},88478:function(t,e,n){var i=n(92074);t.exports=function(t){return i((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}))}},77804:function(t,e,n){var i=n(30281),r=n(79328),o=n(95362),s=n(71229),a=i("".charAt),c=i("".charCodeAt),l=i("".slice),u=function(t){return function(e,n){var i,u,h=o(s(e)),d=r(n),f=h.length;return d<0||d>=f?t?"":void 0:(i=c(h,d))<55296||i>56319||d+1===f||(u=c(h,d+1))<56320||u>57343?t?a(h,d):i:t?l(h,d,d+2):u-56320+(i-55296<<10)+65536}};t.exports={codeAt:u(!1),charAt:u(!0)}},97046:function(t,e,n){var i=n(47061);t.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(i)},45214:function(t,e,n){var i=n(30281),r=n(33747),o=n(95362),s=n(10140),a=n(71229),c=i(s),l=i("".slice),u=Math.ceil,h=function(t){return function(e,n,i){var s,h,d=o(a(e)),f=r(n),m=d.length,g=void 0===i?" ":o(i);return f<=m||""==g?d:((h=c(g,u((s=f-m)/g.length))).length>s&&(h=l(h,0,s)),t?d+h:h+d)}};t.exports={start:h(!1),end:h(!0)}},83150:function(t,e,n){"use strict";var i=n(30281),r=2147483647,o=/[^\0-\u007E]/,s=/[.\u3002\uFF0E\uFF61]/g,a="Overflow: input needs wider integers to process",c=RangeError,l=i(s.exec),u=Math.floor,h=String.fromCharCode,d=i("".charCodeAt),f=i([].join),m=i([].push),g=i("".replace),p=i("".split),w=i("".toLowerCase),v=function(t){return t+22+75*(t<26)},b=function(t,e,n){var i=0;for(t=n?u(t/700):t>>1,t+=u(t/e);t>455;)t=u(t/35),i+=36;return u(i+36*t/(t+38))},y=function(t){var e=[];t=function(t){for(var e=[],n=0,i=t.length;n<i;){var r=d(t,n++);if(r>=55296&&r<=56319&&n<i){var o=d(t,n++);56320==(64512&o)?m(e,((1023&r)<<10)+(1023&o)+65536):(m(e,r),n--)}else m(e,r)}return e}(t);var n,i,o=t.length,s=128,l=0,g=72;for(n=0;n<t.length;n++)(i=t[n])<128&&m(e,h(i));var p=e.length,w=p;for(p&&m(e,"-");w<o;){var y=r;for(n=0;n<t.length;n++)(i=t[n])>=s&&i<y&&(y=i);var _=w+1;if(y-s>u((r-l)/_))throw c(a);for(l+=(y-s)*_,s=y,n=0;n<t.length;n++){if((i=t[n])<s&&++l>r)throw c(a);if(i==s){for(var k=l,A=36;;){var x=A<=g?1:A>=g+26?26:A-g;if(k<x)break;var T=k-x,C=36-x;m(e,h(v(x+T%C))),k=u(T/C),A+=36}m(e,h(v(k))),g=b(l,_,w==p),l=0,w++}}l++,s++}return f(e,"")};t.exports=function(t){var e,n,i=[],r=p(g(w(t),s,"."),".");for(e=0;e<r.length;e++)n=r[e],m(i,l(o,n)?"xn--"+y(n):n);return f(i,".")}},10140:function(t,e,n){"use strict";var i=n(79328),r=n(95362),o=n(71229),s=RangeError;t.exports=function(t){var e=r(o(this)),n="",a=i(t);if(a<0||a==1/0)throw s("Wrong number of repetitions");for(;a>0;(a>>>=1)&&(e+=e))1&a&&(n+=e);return n}},75079:function(t,e,n){"use strict";var i=n(69163).end,r=n(89233);t.exports=r("trimEnd")?function(){return i(this)}:"".trimEnd},89233:function(t,e,n){var i=n(12071).PROPER,r=n(92074),o=n(55073);t.exports=function(t){return r((function(){return!!o[t]()||"\u200b\x85\u180e"!=="\u200b\x85\u180e"[t]()||i&&o[t].name!==t}))}},23322:function(t,e,n){"use strict";var i=n(69163).start,r=n(89233);t.exports=r("trimStart")?function(){return i(this)}:"".trimStart},69163:function(t,e,n){var i=n(30281),r=n(71229),o=n(95362),s=n(55073),a=i("".replace),c="["+s+"]",l=RegExp("^"+c+c+"*"),u=RegExp(c+c+"*$"),h=function(t){return function(e){var n=o(r(e));return 1&t&&(n=a(n,l,"")),2&t&&(n=a(n,u,"")),n}};t.exports={start:h(1),end:h(2),trim:h(3)}},28237:function(t,e,n){var i=n(72368),r=n(56492),o=n(31602),s=n(7485);t.exports=function(){var t=r("Symbol"),e=t&&t.prototype,n=e&&e.valueOf,a=o("toPrimitive");e&&!e[a]&&s(e,a,(function(){return i(n,this)}),{arity:1})}},74922:function(t,e,n){var i,r,o,s,a=n(30200),c=n(99070),l=n(46885),u=n(78420),h=n(36490),d=n(92074),f=n(28890),m=n(29609),g=n(23262),p=n(56589),w=n(62050),v=n(75223),b=a.setImmediate,y=a.clearImmediate,_=a.process,k=a.Dispatch,A=a.Function,x=a.MessageChannel,T=a.String,C=0,E={},S="onreadystatechange";try{i=a.location}catch(t){}var P=function(t){if(h(E,t)){var e=E[t];delete E[t],e()}},R=function(t){return function(){P(t)}},O=function(t){P(t.data)},I=function(t){a.postMessage(T(t),i.protocol+"//"+i.host)};b&&y||(b=function(t){p(arguments.length,1);var e=u(t)?t:A(t),n=m(arguments,1);return E[++C]=function(){c(e,void 0,n)},r(C),C},y=function(t){delete E[t]},v?r=function(t){_.nextTick(R(t))}:k&&k.now?r=function(t){k.now(R(t))}:x&&!w?(s=(o=new x).port2,o.port1.onmessage=O,r=l(s.postMessage,s)):a.addEventListener&&u(a.postMessage)&&!a.importScripts&&i&&"file:"!==i.protocol&&!d(I)?(r=I,a.addEventListener("message",O,!1)):r=S in g("script")?function(t){f.appendChild(g("script")).onreadystatechange=function(){f.removeChild(this),P(t)}}:function(t){setTimeout(R(t),0)}),t.exports={set:b,clear:y}},7809:function(t,e,n){var i=n(30281);t.exports=i(1..valueOf)},6539:function(t,e,n){var i=n(79328),r=Math.max,o=Math.min;t.exports=function(t,e){var n=i(t);return n<0?r(n+e,0):o(n,e)}},3005:function(t,e,n){var i=n(50874),r=TypeError;t.exports=function(t){var e=i(t,"number");if("number"==typeof e)throw r("Can't convert number to bigint");return BigInt(e)}},6283:function(t,e,n){var i=n(79328),r=n(33747),o=RangeError;t.exports=function(t){if(void 0===t)return 0;var e=i(t),n=r(e);if(e!==n)throw o("Wrong length or index");return n}},5476:function(t,e,n){var i=n(48664),r=n(71229);t.exports=function(t){return i(r(t))}},79328:function(t,e,n){var i=n(19830);t.exports=function(t){var e=+t;return e!=e||0===e?0:i(e)}},33747:function(t,e,n){var i=n(79328),r=Math.min;t.exports=function(t){return t>0?r(i(t),9007199254740991):0}},92612:function(t,e,n){var i=n(71229),r=Object;t.exports=function(t){return r(i(t))}},73720:function(t,e,n){var i=n(45955),r=RangeError;t.exports=function(t,e){var n=i(t);if(n%e)throw r("Wrong offset");return n}},45955:function(t,e,n){var i=n(79328),r=RangeError;t.exports=function(t){var e=i(t);if(e<0)throw r("The argument can't be less than 0");return e}},50874:function(t,e,n){var i=n(72368),r=n(65335),o=n(32328),s=n(46457),a=n(69751),c=n(31602),l=TypeError,u=c("toPrimitive");t.exports=function(t,e){if(!r(t)||o(t))return t;var n,c=s(t,u);if(c){if(void 0===e&&(e="default"),n=i(c,t,e),!r(n)||o(n))return n;throw l("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},86032:function(t,e,n){var i=n(50874),r=n(32328);t.exports=function(t){var e=i(t,"string");return r(e)?e:e+""}},43129:function(t,e,n){var i={};i[n(31602)("toStringTag")]="z",t.exports="[object z]"===String(i)},95362:function(t,e,n){var i=n(83062),r=String;t.exports=function(t){if("Symbol"===i(t))throw TypeError("Cannot convert a Symbol value to a string");return r(t)}},92785:function(t,e,n){var i=n(75223);t.exports=function(t){try{if(i)return Function('return require("'+t+'")')()}catch(t){}}},13838:function(t){var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},43106:function(t,e,n){"use strict";var i=n(51605),r=n(30200),o=n(72368),s=n(65077),a=n(53668),c=n(85343),l=n(24497),u=n(65190),h=n(66843),d=n(97712),f=n(83496),m=n(33747),g=n(6283),p=n(73720),w=n(86032),v=n(36490),b=n(83062),y=n(65335),_=n(32328),k=n(53105),A=n(47658),x=n(39686),T=n(64789).f,C=n(22180),E=n(91344).forEach,S=n(93524),P=n(43610),R=n(97632),O=n(99206),I=n(93054),M=O.get,N=O.set,V=O.enforce,D=P.f,B=R.f,F=Math.round,L=r.RangeError,z=l.ArrayBuffer,j=z.prototype,H=l.DataView,U=c.NATIVE_ARRAY_BUFFER_VIEWS,W=c.TYPED_ARRAY_TAG,$=c.TypedArray,q=c.TypedArrayPrototype,K=c.aTypedArrayConstructor,G=c.isTypedArray,J="BYTES_PER_ELEMENT",Y="Wrong length",Q=function(t,e){K(t);for(var n=0,i=e.length,r=new t(i);i>n;)r[n]=e[n++];return r},X=function(t,e){D(t,e,{get:function(){return M(this)[e]}})},Z=function(t){var e;return A(j,t)||"ArrayBuffer"==(e=b(t))||"SharedArrayBuffer"==e},tt=function(t,e){return G(t)&&!_(e)&&e in t&&f(+e)&&e>=0},et=function(t,e){return e=w(e),tt(t,e)?h(2,t[e]):B(t,e)},nt=function(t,e,n){return e=w(e),!(tt(t,e)&&y(n)&&v(n,"value"))||v(n,"get")||v(n,"set")||n.configurable||v(n,"writable")&&!n.writable||v(n,"enumerable")&&!n.enumerable?D(t,e,n):(t[e]=n.value,t)};s?(U||(R.f=et,P.f=nt,X(q,"buffer"),X(q,"byteOffset"),X(q,"byteLength"),X(q,"length")),i({target:"Object",stat:!0,forced:!U},{getOwnPropertyDescriptor:et,defineProperty:nt}),t.exports=function(t,e,n){var s=t.match(/\d+$/)[0]/8,c=t+(n?"Clamped":"")+"Array",l="get"+t,h="set"+t,f=r[c],w=f,v=w&&w.prototype,b={},_=function(t,e){D(t,e,{get:function(){return function(t,e){var n=M(t);return n.view[l](e*s+n.byteOffset,!0)}(this,e)},set:function(t){return function(t,e,i){var r=M(t);n&&(i=(i=F(i))<0?0:i>255?255:255&i),r.view[h](e*s+r.byteOffset,i,!0)}(this,e,t)},enumerable:!0})};U?a&&(w=e((function(t,e,n,i){return u(t,v),I(y(e)?Z(e)?void 0!==i?new f(e,p(n,s),i):void 0!==n?new f(e,p(n,s)):new f(e):G(e)?Q(w,e):o(C,w,e):new f(g(e)),t,w)})),x&&x(w,$),E(T(f),(function(t){t in w||d(w,t,f[t])})),w.prototype=v):(w=e((function(t,e,n,i){u(t,v);var r,a,c,l=0,h=0;if(y(e)){if(!Z(e))return G(e)?Q(w,e):o(C,w,e);r=e,h=p(n,s);var d=e.byteLength;if(void 0===i){if(d%s)throw L(Y);if((a=d-h)<0)throw L(Y)}else if((a=m(i)*s)+h>d)throw L(Y);c=a/s}else c=g(e),r=new z(a=c*s);for(N(t,{buffer:r,byteOffset:h,byteLength:a,length:c,view:new H(r)});l<c;)_(t,l++)})),x&&x(w,$),v=w.prototype=k(q)),v.constructor!==w&&d(v,"constructor",w),V(v).TypedArrayConstructor=w,W&&d(v,W,c);var A=w!=f;b[c]=w,i({global:!0,constructor:!0,forced:A,sham:!U},b),J in w||d(w,J,s),J in v||d(v,J,s),S(c)}):t.exports=function(){}},53668:function(t,e,n){var i=n(30200),r=n(92074),o=n(97499),s=n(85343).NATIVE_ARRAY_BUFFER_VIEWS,a=i.ArrayBuffer,c=i.Int8Array;t.exports=!s||!r((function(){c(1)}))||!r((function(){new c(-1)}))||!o((function(t){new c,new c(null),new c(1.5),new c(t)}),!0)||r((function(){return 1!==new c(new a(2),1,void 0).length}))},30800:function(t,e,n){var i=n(40447),r=n(79601);t.exports=function(t,e){return i(r(t),e)}},22180:function(t,e,n){var i=n(46885),r=n(72368),o=n(57849),s=n(92612),a=n(23493),c=n(79526),l=n(51898),u=n(99034),h=n(85343).aTypedArrayConstructor;t.exports=function(t){var e,n,d,f,m,g,p=o(this),w=s(t),v=arguments.length,b=v>1?arguments[1]:void 0,y=void 0!==b,_=l(w);if(_&&!u(_))for(g=(m=c(w,_)).next,w=[];!(f=r(g,m)).done;)w.push(f.value);for(y&&v>2&&(b=i(b,arguments[2])),n=a(w),d=new(h(p))(n),e=0;n>e;e++)d[e]=y?b(w[e],e):w[e];return d}},79601:function(t,e,n){var i=n(85343),r=n(23444),o=i.aTypedArrayConstructor,s=i.getTypedArrayConstructor;t.exports=function(t){return o(r(t,s(t)))}},50665:function(t,e,n){var i=n(30281),r=0,o=Math.random(),s=i(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++r+o,36)}},5225:function(t,e,n){var i=n(61849);t.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},94491:function(t,e,n){var i=n(65077),r=n(92074);t.exports=i&&r((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},56589:function(t){var e=TypeError;t.exports=function(t,n){if(t<n)throw e("Not enough arguments");return t}},30802:function(t,e,n){var i=n(31602);e.f=i},31602:function(t,e,n){var i=n(30200),r=n(50002),o=n(36490),s=n(50665),a=n(61849),c=n(5225),l=r("wks"),u=i.Symbol,h=u&&u.for,d=c?u:u&&u.withoutSetter||s;t.exports=function(t){if(!o(l,t)||!a&&"string"!=typeof l[t]){var e="Symbol."+t;a&&o(u,t)?l[t]=u[t]:l[t]=c&&h?h(e):d(e)}return l[t]}},55073:function(t){t.exports="\t\n\v\f\r \xa0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\ufeff"},78120:function(t,e,n){"use strict";var i=n(56492),r=n(36490),o=n(97712),s=n(47658),a=n(39686),c=n(84361),l=n(56527),u=n(93054),h=n(20610),d=n(55833),f=n(26820),m=n(70462),g=n(65077),p=n(6926);t.exports=function(t,e,n,w){var v="stackTraceLimit",b=w?2:1,y=t.split("."),_=y[y.length-1],k=i.apply(null,y);if(k){var A=k.prototype;if(!p&&r(A,"cause")&&delete A.cause,!n)return k
;var x=i("Error"),T=e((function(t,e){var n=h(w?e:t,void 0),i=w?new k(t):new k;return void 0!==n&&o(i,"message",n),m&&o(i,"stack",f(i.stack,2)),this&&s(A,this)&&u(i,this,T),arguments.length>b&&d(i,arguments[b]),i}));if(T.prototype=A,"Error"!==_?a?a(T,x):c(T,x,{name:!0}):g&&v in k&&(l(T,k,v),l(T,k,"prepareStackTrace")),c(T,k),!p)try{A.name!==_&&o(A,"name",_),A.constructor=T}catch(t){}return T}}},86489:function(t,e,n){var i=n(51605),r=n(56492),o=n(99070),s=n(92074),a=n(78120),c="AggregateError",l=r(c),u=!s((function(){return 1!==l([1]).errors[0]}))&&s((function(){return 7!==l([1],c,{cause:7}).cause}));i({global:!0,constructor:!0,arity:2,forced:u},{AggregateError:a(c,(function(t){return function(e,n){return o(t,this,arguments)}}),u,!0)})},70894:function(t,e,n){"use strict";var i=n(51605),r=n(47658),o=n(97970),s=n(39686),a=n(84361),c=n(53105),l=n(97712),u=n(66843),h=n(26820),d=n(55833),f=n(52929),m=n(20610),g=n(31602),p=n(70462),w=g("toStringTag"),v=Error,b=[].push,y=function(t,e){var n,i=arguments.length>2?arguments[2]:void 0,a=r(_,this);s?n=s(new v,a?o(this):_):(n=a?this:c(_),l(n,w,"Error")),void 0!==e&&l(n,"message",m(e)),p&&l(n,"stack",h(n.stack,1)),d(n,i);var u=[];return f(t,b,{that:u}),l(n,"errors",u),n};s?s(y,v):a(y,v,{name:!0});var _=y.prototype=c(v.prototype,{constructor:u(1,y),message:u(1,""),name:u(1,"AggregateError")});i({global:!0,constructor:!0,arity:2},{AggregateError:y})},50624:function(t,e,n){n(70894)},3446:function(t,e,n){"use strict";var i=n(51605),r=n(30200),o=n(24497),s=n(93524),a="ArrayBuffer",c=o.ArrayBuffer;i({global:!0,constructor:!0,forced:r.ArrayBuffer!==c},{ArrayBuffer:c}),s(a)},93016:function(t,e,n){var i=n(51605),r=n(85343);i({target:"ArrayBuffer",stat:!0,forced:!r.NATIVE_ARRAY_BUFFER_VIEWS},{isView:r.isView})},1772:function(t,e,n){"use strict";var i=n(51605),r=n(30281),o=n(92074),s=n(24497),a=n(73938),c=n(6539),l=n(33747),u=n(23444),h=s.ArrayBuffer,d=s.DataView,f=d.prototype,m=r(h.prototype.slice),g=r(f.getUint8),p=r(f.setUint8);i({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:o((function(){return!new h(2).slice(1,void 0).byteLength}))},{slice:function(t,e){if(m&&void 0===e)return m(a(this),t);for(var n=a(this).byteLength,i=c(t,n),r=c(void 0===e?n:e,n),o=new(u(this,h))(l(r-i)),s=new d(this),f=new d(o),w=0;i<r;)p(f,w++,g(s,i++));return o}})},48642:function(t,e,n){"use strict";var i=n(51605),r=n(92612),o=n(23493),s=n(79328),a=n(40298);i({target:"Array",proto:!0},{at:function(t){var e=r(this),n=o(e),i=s(t),a=i>=0?i:n+i;return a<0||a>=n?void 0:e[a]}}),a("at")},80115:function(t,e,n){"use strict";var i=n(51605),r=n(92074),o=n(18679),s=n(65335),a=n(92612),c=n(23493),l=n(57242),u=n(52057),h=n(62998),d=n(45634),f=n(31602),m=n(6845),g=f("isConcatSpreadable"),p=m>=51||!r((function(){var t=[];return t[g]=!1,t.concat()[0]!==t})),w=d("concat"),v=function(t){if(!s(t))return!1;var e=t[g];return void 0!==e?!!e:o(t)};i({target:"Array",proto:!0,arity:1,forced:!p||!w},{concat:function(){var t,e,n,i,r,o=a(this),s=h(o,0),d=0;for(t=-1,n=arguments.length;t<n;t++)if(v(r=-1===t?o:arguments[t]))for(i=c(r),l(d+i),e=0;e<i;e++,d++)e in r&&u(s,d,r[e]);else l(d+1),u(s,d++,r);return s.length=d,s}})},61408:function(t,e,n){var i=n(51605),r=n(29688),o=n(40298);i({target:"Array",proto:!0},{copyWithin:r}),o("copyWithin")},23604:function(t,e,n){"use strict";var i=n(51605),r=n(91344).every;i({target:"Array",proto:!0,forced:!n(92349)("every")},{every:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},32982:function(t,e,n){var i=n(51605),r=n(27806),o=n(40298);i({target:"Array",proto:!0},{fill:r}),o("fill")},17:function(t,e,n){"use strict";var i=n(51605),r=n(91344).filter;i({target:"Array",proto:!0,forced:!n(45634)("filter")},{filter:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},92157:function(t,e,n){"use strict";var i=n(51605),r=n(91344).findIndex,o=n(40298),s="findIndex",a=!0;s in[]&&Array(1).findIndex((function(){a=!1})),i({target:"Array",proto:!0,forced:a},{findIndex:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),o(s)},70640:function(t,e,n){"use strict";var i=n(51605),r=n(45582).findLastIndex,o=n(40298);i({target:"Array",proto:!0},{findLastIndex:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),o("findLastIndex")},31133:function(t,e,n){"use strict";var i=n(51605),r=n(45582).findLast,o=n(40298);i({target:"Array",proto:!0},{findLast:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),o("findLast")},18636:function(t,e,n){"use strict";var i=n(51605),r=n(91344).find,o=n(40298),s="find",a=!0;s in[]&&Array(1).find((function(){a=!1})),i({target:"Array",proto:!0,forced:a},{find:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),o(s)},95755:function(t,e,n){"use strict";var i=n(51605),r=n(89608),o=n(24601),s=n(92612),a=n(23493),c=n(62998);i({target:"Array",proto:!0},{flatMap:function(t){var e,n=s(this),i=a(n);return o(t),(e=c(n,0)).length=r(e,n,n,i,0,1,t,arguments.length>1?arguments[1]:void 0),e}})},41128:function(t,e,n){"use strict";var i=n(51605),r=n(89608),o=n(92612),s=n(23493),a=n(79328),c=n(62998);i({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=o(this),n=s(e),i=c(e,0);return i.length=r(i,e,e,n,0,void 0===t?1:a(t)),i}})},58476:function(t,e,n){"use strict";var i=n(51605),r=n(10516);i({target:"Array",proto:!0,forced:[].forEach!=r},{forEach:r})},15195:function(t,e,n){var i=n(51605),r=n(51027);i({target:"Array",stat:!0,forced:!n(97499)((function(t){Array.from(t)}))},{from:r})},47746:function(t,e,n){"use strict";var i=n(51605),r=n(58186).includes,o=n(92074),s=n(40298);i({target:"Array",proto:!0,forced:o((function(){return!Array(1).includes()}))},{includes:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),s("includes")},19693:function(t,e,n){"use strict";var i=n(51605),r=n(30281),o=n(58186).indexOf,s=n(92349),a=r([].indexOf),c=!!a&&1/a([1],1,-0)<0,l=s("indexOf");i({target:"Array",proto:!0,forced:c||!l},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return c?a(this,t,e)||0:o(this,t,e)}})},4895:function(t,e,n){n(51605)({target:"Array",stat:!0},{isArray:n(18679)})},18665:function(t,e,n){"use strict";var i=n(5476),r=n(40298),o=n(52228),s=n(99206),a=n(43610).f,c=n(45723),l=n(6926),u=n(65077),h="Array Iterator",d=s.set,f=s.getterFor(h);t.exports=c(Array,"Array",(function(t,e){d(this,{type:h,target:i(t),index:0,kind:e})}),(function(){var t=f(this),e=t.target,n=t.kind,i=t.index++;return!e||i>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:i,done:!1}:"values"==n?{value:e[i],done:!1}:{value:[i,e[i]],done:!1}}),"values");var m=o.Arguments=o.Array;if(r("keys"),r("values"),r("entries"),!l&&u&&"values"!==m.name)try{a(m,"name",{value:"values"})}catch(t){}},80475:function(t,e,n){"use strict";var i=n(51605),r=n(30281),o=n(48664),s=n(5476),a=n(92349),c=r([].join),l=o!=Object,u=a("join",",");i({target:"Array",proto:!0,forced:l||!u},{join:function(t){return c(s(this),void 0===t?",":t)}})},94582:function(t,e,n){var i=n(51605),r=n(3470);i({target:"Array",proto:!0,forced:r!==[].lastIndexOf},{lastIndexOf:r})},59581:function(t,e,n){"use strict";var i=n(51605),r=n(91344).map;i({target:"Array",proto:!0,forced:!n(45634)("map")},{map:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},92630:function(t,e,n){"use strict";var i=n(51605),r=n(92074),o=n(1466),s=n(52057),a=Array;i({target:"Array",stat:!0,forced:r((function(){function t(){}return!(a.of.call(t)instanceof t)}))},{of:function(){for(var t=0,e=arguments.length,n=new(o(this)?this:a)(e);e>t;)s(n,t,arguments[t++]);return n.length=e,n}})},28743:function(t,e,n){"use strict";var i=n(51605),r=n(92612),o=n(23493),s=n(57242),a=n(92074)((function(){return 4294967297!==[].push.call({length:4294967296},1)})),c=!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}();i({target:"Array",proto:!0,arity:1,forced:a||c},{push:function(){var t=r(this),e=o(t),n=arguments.length;s(e+n);for(var i=0;i<n;i++)t[e]=arguments[i],e++;return t.length=e,e}})},39958:function(t,e,n){"use strict";var i=n(51605),r=n(52237).right,o=n(92349),s=n(6845),a=n(75223);i({target:"Array",proto:!0,forced:!o("reduceRight")||!a&&s>79&&s<83},{reduceRight:function(t){return r(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}})},533:function(t,e,n){"use strict";var i=n(51605),r=n(52237).left,o=n(92349),s=n(6845),a=n(75223);i({target:"Array",proto:!0,forced:!o("reduce")||!a&&s>79&&s<83},{reduce:function(t){var e=arguments.length;return r(this,t,e,e>1?arguments[1]:void 0)}})},10557:function(t,e,n){"use strict";var i=n(51605),r=n(30281),o=n(18679),s=r([].reverse),a=[1,2];i({target:"Array",proto:!0,forced:String(a)===String(a.reverse())},{reverse:function(){return o(this)&&(this.length=this.length),s(this)}})},14913:function(t,e,n){"use strict";var i=n(51605),r=n(18679),o=n(1466),s=n(65335),a=n(6539),c=n(23493),l=n(5476),u=n(52057),h=n(31602),d=n(45634),f=n(29609),m=d("slice"),g=h("species"),p=Array,w=Math.max;i({target:"Array",proto:!0,forced:!m},{slice:function(t,e){var n,i,h,d=l(this),m=c(d),v=a(t,m),b=a(void 0===e?m:e,m);if(r(d)&&(n=d.constructor,(o(n)&&(n===p||r(n.prototype))||s(n)&&null===(n=n[g]))&&(n=void 0),n===p||void 0===n))return f(d,v,b);for(i=new(void 0===n?p:n)(w(b-v,0)),h=0;v<b;v++,h++)v in d&&u(i,h,d[v]);return i.length=h,i}})},63555:function(t,e,n){"use strict";var i=n(51605),r=n(91344).some;i({target:"Array",proto:!0,forced:!n(92349)("some")},{some:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},35231:function(t,e,n){"use strict";var i=n(51605),r=n(30281),o=n(24601),s=n(92612),a=n(23493),c=n(24881),l=n(95362),u=n(92074),h=n(68039),d=n(92349),f=n(3727),m=n(77413),g=n(6845),p=n(79965),w=[],v=r(w.sort),b=r(w.push),y=u((function(){w.sort(void 0)})),_=u((function(){w.sort(null)})),k=d("sort"),A=!u((function(){if(g)return g<70;if(!(f&&f>3)){if(m)return!0;if(p)return p<603;var t,e,n,i,r="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(i=0;i<47;i++)w.push({k:e+i,v:n})}for(w.sort((function(t,e){return e.v-t.v})),i=0;i<w.length;i++)e=w[i].k.charAt(0),r.charAt(r.length-1)!==e&&(r+=e);return"DGBEFHACIJK"!==r}}));i({target:"Array",proto:!0,forced:y||!_||!k||!A},{sort:function(t){void 0!==t&&o(t);var e=s(this);if(A)return void 0===t?v(e):v(e,t);var n,i,r=[],u=a(e);for(i=0;i<u;i++)i in e&&b(r,e[i]);for(h(r,function(t){return function(e,n){return void 0===n?-1:void 0===e?1:void 0!==t?+t(e,n)||0:l(e)>l(n)?1:-1}}(t)),n=r.length,i=0;i<n;)e[i]=r[i++];for(;i<u;)c(e,i++);return e}})},5941:function(t,e,n){n(93524)("Array")},68763:function(t,e,n){"use strict";var i=n(51605),r=n(92612),o=n(6539),s=n(79328),a=n(23493),c=n(57242),l=n(62998),u=n(52057),h=n(24881),d=n(45634)("splice"),f=Math.max,m=Math.min;i({target:"Array",proto:!0,forced:!d},{splice:function(t,e){var n,i,d,g,p,w,v=r(this),b=a(v),y=o(t,b),_=arguments.length;for(0===_?n=i=0:1===_?(n=0,i=b-y):(n=_-2,i=m(f(s(e),0),b-y)),c(b+n-i),d=l(v,i),g=0;g<i;g++)(p=y+g)in v&&u(d,g,v[p]);if(d.length=i,n<i){for(g=y;g<b-i;g++)w=g+n,(p=g+i)in v?v[w]=v[p]:h(v,w);for(g=b;g>b-i+n;g--)h(v,g-1)}else if(n>i)for(g=b-i;g>y;g--)w=g+n-1,(p=g+i-1)in v?v[w]=v[p]:h(v,w);for(g=0;g<n;g++)v[g+y]=arguments[g+2];return v.length=b-i+n,d}})},79432:function(t,e,n){n(40298)("flatMap")},95843:function(t,e,n){n(40298)("flat")},19078:function(t,e,n){"use strict";var i=n(51605),r=n(92612),o=n(23493),s=n(24881),a=n(57242),c=1!==[].unshift(0),l=!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(t){return t instanceof TypeError}}();i({target:"Array",proto:!0,arity:1,forced:c||l},{unshift:function(){var t=r(this),e=o(t),n=arguments.length;if(n){a(e+n);for(var i=e;i--;){var c=i+n;i in t?t[c]=t[i]:s(t,c)}for(var l=0;l<n;l++)t[l]=arguments[l]}return t.length=e+n}})},87792:function(t,e,n){var i=n(51605),r=n(24497);i({global:!0,constructor:!0,forced:!n(9809)},{DataView:r.DataView})},33734:function(t,e,n){n(87792)},31180:function(t,e,n){"use strict";var i=n(51605),r=n(30281),o=n(92074)((function(){return 120!==new Date(16e11).getYear()})),s=r(Date.prototype.getFullYear);i({target:"Date",proto:!0,forced:o},{getYear:function(){return s(this)-1900}})},89560:function(t,e,n){var i=n(51605),r=n(30281),o=Date,s=r(o.prototype.getTime);i({target:"Date",stat:!0},{now:function(){return s(new o)}})},54696:function(t,e,n){"use strict";var i=n(51605),r=n(30281),o=n(79328),s=Date.prototype,a=r(s.getTime),c=r(s.setFullYear);i({target:"Date",proto:!0},{setYear:function(t){a(this);var e=o(t);return c(this,0<=e&&e<=99?e+1900:e)}})},31462:function(t,e,n){n(51605)({target:"Date",proto:!0},{toGMTString:Date.prototype.toUTCString})},42169:function(t,e,n){var i=n(51605),r=n(38523);i({target:"Date",proto:!0,forced:Date.prototype.toISOString!==r},{toISOString:r})},53270:function(t,e,n){"use strict";var i=n(51605),r=n(92074),o=n(92612),s=n(50874);i({target:"Date",proto:!0,arity:1,forced:r((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}))},{toJSON:function(){var t=o(this),e=s(t,"number");return"number"!=typeof e||isFinite(e)?t.toISOString():null}})},87787:function(t,e,n){var i=n(36490),r=n(7485),o=n(31137),s=n(31602)("toPrimitive"),a=Date.prototype;i(a,s)||r(a,s,o)},79389:function(t,e,n){var i=n(30281),r=n(7485),o=Date.prototype,s="Invalid Date",a="toString",c=i(o.toString),l=i(o.getTime);String(new Date(NaN))!=s&&r(o,a,(function(){var t=l(this);return t==t?c(this):s}))},83515:function(t,e,n){var i=n(51605),r=n(30200),o=n(99070),s=n(78120),a="WebAssembly",c=r.WebAssembly,l=7!==Error("e",{cause:7}).cause,u=function(t,e){var n={};n[t]=s(t,e,l),i({global:!0,constructor:!0,arity:1,forced:l},n)},h=function(t,e){if(c&&c[t]){var n={};n[t]=s("WebAssembly."+t,e,l),i({target:a,stat:!0,constructor:!0,arity:1,forced:l},n)}};u("Error",(function(t){return function(e){return o(t,this,arguments)}})),u("EvalError",(function(t){return function(e){return o(t,this,arguments)}})),u("RangeError",(function(t){return function(e){return o(t,this,arguments)}})),u("ReferenceError",(function(t){return function(e){return o(t,this,arguments)}})),u("SyntaxError",(function(t){return function(e){return o(t,this,arguments)}})),u("TypeError",(function(t){return function(e){return o(t,this,arguments)}})),u("URIError",(function(t){return function(e){return o(t,this,arguments)}})),h("CompileError",(function(t){return function(e){return o(t,this,arguments)}})),h("LinkError",(function(t){return function(e){return o(t,this,arguments)}})),h("RuntimeError",(function(t){return function(e){return o(t,this,arguments)}}))},14117:function(t,e,n){var i=n(7485),r=n(73353),o=Error.prototype;o.toString!==r&&i(o,"toString",r)},91189:function(t,e,n){"use strict";var i=n(51605),r=n(30281),o=n(95362),s=r("".charAt),a=r("".charCodeAt),c=r(/./.exec),l=r(1..toString),u=r("".toUpperCase),h=/[\w*+\-./@]/,d=function(t,e){for(var n=l(t,16);n.length<e;)n="0"+n;return n};i({global:!0},{escape:function(t){for(var e,n,i=o(t),r="",l=i.length,f=0;f<l;)e=s(i,f++),c(h,e)?r+=e:r+=(n=a(e,0))<256?"%"+d(n,2):"%u"+u(d(n,4));return r}})},64189:function(t,e,n){var i=n(51605),r=n(38891);i({target:"Function",proto:!0,forced:Function.bind!==r},{bind:r})},37514:function(t,e,n){"use strict";var i=n(78420),r=n(65335),o=n(43610),s=n(97970),a=n(31602),c=n(48218),l=a("hasInstance"),u=Function.prototype;l in u||o.f(u,l,{value:c((function(t){if(!i(this)||!r(t))return!1;var e=this.prototype;if(!r(e))return t instanceof this;for(;t=s(t);)if(e===t)return!0;return!1}),l)})},98741:function(t,e,n){var i=n(65077),r=n(12071).EXISTS,o=n(30281),s=n(43610).f,a=Function.prototype,c=o(a.toString),l=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,u=o(l.exec);i&&!r&&s(a,"name",{configurable:!0,get:function(){try{return u(l,c(this))[1]}catch(t){return""}}})},258:function(t,e,n){n(51605)({global:!0},{globalThis:n(30200)})},30959:function(t,e,n){var i=n(51605),r=n(56492),o=n(99070),s=n(72368),a=n(30281),c=n(92074),l=n(18679),u=n(78420),h=n(65335),d=n(32328),f=n(29609),m=n(61849),g=r("JSON","stringify"),p=a(/./.exec),w=a("".charAt),v=a("".charCodeAt),b=a("".replace),y=a(1..toString),_=/[\uD800-\uDFFF]/g,k=/^[\uD800-\uDBFF]$/,A=/^[\uDC00-\uDFFF]$/,x=!m||c((function(){var t=r("Symbol")();return"[null]"!=g([t])||"{}"!=g({a:t})||"{}"!=g(Object(t))})),T=c((function(){return'"\\udf06\\ud834"'!==g("\udf06\ud834")||'"\\udead"'!==g("\udead")})),C=function(t,e){var n=f(arguments),i=e;if((h(e)||void 0!==t)&&!d(t))return l(e)||(e=function(t,e){if(u(i)&&(e=s(i,this,t,e)),!d(e))return e}),n[1]=e,o(g,null,n)},E=function(t,e,n){var i=w(n,e-1),r=w(n,e+1);return p(k,t)&&!p(A,r)||p(A,t)&&!p(k,i)?"\\u"+y(v(t,0),16):t};g&&i({target:"JSON",stat:!0,arity:3,forced:x||T},{stringify:function(t,e,n){var i=f(arguments),r=o(x?C:g,null,i);return T&&"string"==typeof r?b(r,_,E):r}})},31586:function(t,e,n){var i=n(30200);n(75282)(i.JSON,"JSON",!0)},53656:function(t,e,n){"use strict";n(92327)("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),n(5959))},7918:function(t,e,n){n(53656)},48252:function(t,e,n){var i=n(51605),r=n(31855),o=Math.acosh,s=Math.log,a=Math.sqrt,c=Math.LN2;i({target:"Math",stat:!0,forced:!o||710!=Math.floor(o(Number.MAX_VALUE))||o(1/0)!=1/0},{acosh:function(t){var e=+t;return e<1?NaN:e>94906265.62425156?s(e)+c:r(e-1+a(e-1)*a(e+1))}})},42799:function(t,e,n){var i=n(51605),r=Math.asinh,o=Math.log,s=Math.sqrt;i({target:"Math",stat:!0,forced:!(r&&1/r(0)>0)},{asinh:function t(e){var n=+e;return isFinite(n)&&0!=n?n<0?-t(-n):o(n+s(n*n+1)):n}})},36772:function(t,e,n){var i=n(51605),r=Math.atanh,o=Math.log;i({target:"Math",stat:!0,forced:!(r&&1/r(-0)<0)},{atanh:function(t){var e=+t;return 0==e?e:o((1+e)/(1-e))/2}})},75483:function(t,e,n){var i=n(51605),r=n(51211),o=Math.abs,s=Math.pow;i({target:"Math",stat:!0},{cbrt:function(t){var e=+t;return r(e)*s(o(e),1/3)}})},27956:function(t,e,n){var i=n(51605),r=Math.floor,o=Math.log,s=Math.LOG2E;i({target:"Math",stat:!0},{clz32:function(t){var e=t>>>0;return e?31-r(o(e+.5)*s):32}})},53733:function(t,e,n){var i=n(51605),r=n(76709),o=Math.cosh,s=Math.abs,a=Math.E;i({target:"Math",stat:!0,forced:!o||o(710)===1/0},{cosh:function(t){var e=r(s(t)-1)+1;return(e+1/(e*a*a))*(a/2)}})},49639:function(t,e,n){var i=n(51605),r=n(76709);i({target:"Math",stat:!0,forced:r!=Math.expm1},{expm1:r})},19570:function(t,e,n){n(51605)({target:"Math",stat:!0},{fround:n(94812)})},956:function(t,e,n){var i=n(51605),r=Math.hypot,o=Math.abs,s=Math.sqrt;i({target:"Math",stat:!0,arity:2,forced:!!r&&r(1/0,NaN)!==1/0},{hypot:function(t,e){for(var n,i,r=0,a=0,c=arguments.length,l=0;a<c;)l<(n=o(arguments[a++]))?(r=r*(i=l/n)*i+1,l=n):r+=n>0?(i=n/l)*i:n;return l===1/0?1/0:l*s(r)}})},19323:function(t,e,n){var i=n(51605),r=n(92074),o=Math.imul;i({target:"Math",stat:!0,forced:r((function(){return-5!=o(4294967295,5)||2!=o.length}))},{imul:function(t,e){var n=65535,i=+t,r=+e,o=n&i,s=n&r;return 0|o*s+((n&i>>>16)*s+o*(n&r>>>16)<<16>>>0)}})},41145:function(t,e,n){n(51605)({target:"Math",stat:!0},{log10:n(13103)})},59897:function(t,e,n){n(51605)({target:"Math",stat:!0},{log1p:n(31855)})},3212:function(t,e,n){var i=n(51605),r=Math.log,o=Math.LN2;i({target:"Math",stat:!0},{log2:function(t){return r(t)/o}})},82157:function(t,e,n){n(51605)({target:"Math",stat:!0},{sign:n(51211)})},1610:function(t,e,n){var i=n(51605),r=n(92074),o=n(76709),s=Math.abs,a=Math.exp,c=Math.E;i({target:"Math",stat:!0,forced:r((function(){return-2e-17!=Math.sinh(-2e-17)}))},{sinh:function(t){var e=+t;return s(e)<1?(o(e)-o(-e))/2:(a(e-1)-a(-e-1))*(c/2)}})},46097:function(t,e,n){var i=n(51605),r=n(76709),o=Math.exp;i({target:"Math",stat:!0},{tanh:function(t){var e=+t,n=r(e),i=r(-e);return n==1/0?1:i==1/0?-1:(n-i)/(o(e)+o(-e))}})},96982:function(t,e,n){n(75282)(Math,"Math",!0)},15812:function(t,e,n){n(51605)({target:"Math",stat:!0},{trunc:n(19830)})},94009:function(t,e,n){"use strict";var i=n(65077),r=n(30200),o=n(30281),s=n(84977),a=n(7485),c=n(36490),l=n(93054),u=n(47658),h=n(32328),d=n(50874),f=n(92074),m=n(64789).f,g=n(97632).f,p=n(43610).f,w=n(7809),v=n(69163).trim,b="Number",y=r.Number,_=y.prototype,k=r.TypeError,A=o("".slice),x=o("".charCodeAt),T=function(t){var e=d(t,"number");return"bigint"==typeof e?e:C(e)},C=function(t){var e,n,i,r,o,s,a,c,l=d(t,"number");if(h(l))throw k("Cannot convert a Symbol value to a number");if("string"==typeof l&&l.length>2)if(l=v(l),43===(e=x(l,0))||45===e){if(88===(n=x(l,2))||120===n)return NaN}else if(48===e){switch(x(l,1)){case 66:case 98:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+l}for(s=(o=A(l,2)).length,a=0;a<s;a++)if((c=x(o,a))<48||c>r)return NaN;return parseInt(o,i)}return+l};if(s(b,!y(" 0o1")||!y("0b1")||y("+0x1"))){for(var E,S=function(t){var e=arguments.length<1?0:y(T(t)),n=this;return u(_,n)&&f((function(){w(n)}))?l(Object(e),n,S):e},P=i?m(y):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),R=0;P.length>R;R++)c(y,E=P[R])&&!c(S,E)&&p(S,E,g(y,E));S.prototype=_,_.constructor=S,a(r,b,S,{constructor:!0})}},96943:function(t,e,n){n(51605)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)})},80577:function(t,e,n){n(51605)({target:"Number",stat:!0},{isFinite:n(11071)})},4038:function(t,e,n){n(51605)({target:"Number",stat:!0},{isInteger:n(83496)})},85365:function(t,e,n){n(51605)({target:"Number",stat:!0},{isNaN:function(t){return t!=t}})},96316:function(t,e,n){var i=n(51605),r=n(83496),o=Math.abs;i({target:"Number",stat:!0},{isSafeInteger:function(t){return r(t)&&o(t)<=9007199254740991}})},42006:function(t,e,n){n(51605)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991})},88844:function(t,e,n){n(51605)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991})},26161:function(t,e,n){var i=n(51605),r=n(35963);i({target:"Number",stat:!0,forced:Number.parseFloat!=r},{parseFloat:r})},11902:function(t,e,n){var i=n(51605),r=n(27292);i({target:"Number",stat:!0,forced:Number.parseInt!=r},{parseInt:r})},56402:function(t,e,n){"use strict";var i=n(51605),r=n(30281),o=n(79328),s=n(7809),a=n(10140),c=n(13103),l=n(92074),u=RangeError,h=String,d=isFinite,f=Math.abs,m=Math.floor,g=Math.pow,p=Math.round,w=r(1..toExponential),v=r(a),b=r("".slice),y="-6.9000e-11"===w(-69e-12,4)&&"1.25e+0"===w(1.255,2)&&"1.235e+4"===w(12345,3)&&"3e+1"===w(25,0),_=l((function(){w(1,1/0)}))&&l((function(){w(1,-1/0)})),k=!l((function(){w(1/0,1/0)}))&&!l((function(){w(NaN,1/0)}));i({target:"Number",proto:!0,forced:!y||!_||!k},{toExponential:function(t){var e=s(this);if(void 0===t)return w(e);var n=o(t);if(!d(e))return String(e);if(n<0||n>20)throw u("Incorrect fraction digits");if(y)return w(e,n);var i="",r="",a=0,l="",_="";if(e<0&&(i="-",e=-e),0===e)a=0,r=v("0",n+1);else{var k=c(e);a=m(k);var A=0,x=g(10,a-n);2*e>=(2*(A=p(e/x))+1)*x&&(A+=1),A>=g(10,n+1)&&(A/=10,a+=1),r=h(A)}return 0!==n&&(r=b(r,0,1)+"."+b(r,1)),0===a?(l="+",_="0"):(l=a>0?"+":"-",_=h(f(a))),i+(r+"e")+l+_}})},34867:function(t,e,n){"use strict";var i=n(51605),r=n(30281),o=n(79328),s=n(7809),a=n(10140),c=n(92074),l=RangeError,u=String,h=Math.floor,d=r(a),f=r("".slice),m=r(1..toFixed),g=function(t,e,n){return 0===e?n:e%2==1?g(t,e-1,n*t):g(t*t,e/2,n)},p=function(t,e,n){for(var i=-1,r=n;++i<6;)r+=e*t[i],t[i]=r%1e7,r=h(r/1e7)},w=function(t,e){for(var n=6,i=0;--n>=0;)i+=t[n],t[n]=h(i/e),i=i%e*1e7},v=function(t){for(var e=6,n="";--e>=0;)if(""!==n||0===e||0!==t[e]){var i=u(t[e]);n=""===n?i:n+d("0",7-i.length)+i}return n};i({target:"Number",proto:!0,forced:c((function(){return"0.000"!==m(8e-5,3)||"1"!==m(.9,0)||"1.25"!==m(1.255,2)||"1000000000000000128"!==m(0xde0b6b3a7640080,0)}))||!c((function(){m({})}))},{toFixed:function(t){var e,n,i,r,a=s(this),c=o(t),h=[0,0,0,0,0,0],m="",b="0";if(c<0||c>20)throw l("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return u(a);if(a<0&&(m="-",a=-a),a>1e-21)if(n=(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(a*g(2,69,1))-69)<0?a*g(2,-e,1):a/g(2,e,1),n*=4503599627370496,(e=52-e)>0){for(p(h,0,n),i=c;i>=7;)p(h,1e7,0),i-=7;for(p(h,g(10,i,1),0),i=e-1;i>=23;)w(h,1<<23),i-=23;w(h,1<<i),p(h,1,1),w(h,2),b=v(h)}else p(h,0,n),p(h,1<<-e,0),b=v(h)+d("0",c);return c>0?m+((r=b.length)<=c?"0."+d("0",c-r)+b:f(b,0,r-c)+"."+f(b,r-c)):m+b}})},60769:function(t,e,n){"use strict";var i=n(51605),r=n(30281),o=n(92074),s=n(7809),a=r(1..toPrecision);i({target:"Number",proto:!0,forced:o((function(){return"1"!==a(1,void 0)}))||!o((function(){a({})}))},{toPrecision:function(t){return void 0===t?a(s(this)):a(s(this),t)}})},69218:function(t,e,n){var i=n(51605),r=n(81688);i({target:"Object",stat:!0,arity:2,forced:Object.assign!==r},{assign:r})},97755:function(t,e,n){n(51605)({target:"Object",stat:!0,sham:!n(65077)},{create:n(53105)})},8538:function(t,e,n){"use strict";var i=n(51605),r=n(65077),o=n(61342),s=n(24601),a=n(92612),c=n(43610);r&&i({target:"Object",proto:!0,forced:o},{__defineGetter__:function(t,e){c.f(a(this),t,{get:s(e),enumerable:!0,configurable:!0})}})},36012:function(t,e,n){var i=n(51605),r=n(65077),o=n(65318).f;i({target:"Object",stat:!0,forced:Object.defineProperties!==o,sham:!r},{defineProperties:o})},15852:function(t,e,n){var i=n(51605),r=n(65077),o=n(43610).f;i({target:"Object",stat:!0,forced:Object.defineProperty!==o,sham:!r},{defineProperty:o})},56582:function(t,e,n){"use strict";var i=n(51605),r=n(65077),o=n(61342),s=n(24601),a=n(92612),c=n(43610);r&&i({target:"Object",proto:!0,forced:o},{__defineSetter__:function(t,e){c.f(a(this),t,{set:s(e),enumerable:!0,configurable:!0})}})},84095:function(t,e,n){var i=n(51605),r=n(23172).entries;i({target:"Object",stat:!0},{entries:function(t){return r(t)}})},12824:function(t,e,n){var i=n(51605),r=n(55159),o=n(92074),s=n(65335),a=n(82014).onFreeze,c=Object.freeze;i({target:"Object",stat:!0,forced:o((function(){c(1)})),sham:!r},{freeze:function(t){return c&&s(t)?c(a(t)):t}})},75670:function(t,e,n){var i=n(51605),r=n(52929),o=n(52057);i({target:"Object",stat:!0},{fromEntries:function(t){var e={};return r(t,(function(t,n){o(e,t,n)}),{AS_ENTRIES:!0}),e}})},10678:function(t,e,n){var i=n(51605),r=n(92074),o=n(5476),s=n(97632).f,a=n(65077),c=r((function(){s(1)}));i({target:"Object",stat:!0,forced:!a||c,sham:!a},{getOwnPropertyDescriptor:function(t,e){return s(o(t),e)}})},3101:function(t,e,n){var i=n(51605),r=n(65077),o=n(15816),s=n(5476),a=n(97632),c=n(52057);i({target:"Object",stat:!0,sham:!r},{getOwnPropertyDescriptors:function(t){for(var e,n,i=s(t),r=a.f,l=o(i),u={},h=0;l.length>h;)void 0!==(n=r(i,e=l[h++]))&&c(u,e,n);return u}})},67579:function(t,e,n){var i=n(51605),r=n(92074),o=n(56509).f;i({target:"Object",stat:!0,forced:r((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:o})},91074:function(t,e,n){var i=n(51605),r=n(61849),o=n(92074),s=n(18916),a=n(92612);i({target:"Object",stat:!0,forced:!r||o((function(){s.f(1)}))},{getOwnPropertySymbols:function(t){var e=s.f;return e?e(a(t)):[]}})},41412:function(t,e,n){var i=n(51605),r=n(92074),o=n(92612),s=n(97970),a=n(7168);i({target:"Object",stat:!0,forced:r((function(){s(1)})),sham:!a},{getPrototypeOf:function(t){return s(o(t))}})},19322:function(t,e,n){n(51605)({target:"Object",stat:!0},{hasOwn:n(36490)})},65933:function(t,e,n){var i=n(51605),r=n(40111);i({target:"Object",stat:!0,forced:Object.isExtensible!==r},{isExtensible:r})},59250:function(t,e,n){var i=n(51605),r=n(92074),o=n(65335),s=n(18569),a=n(22085),c=Object.isFrozen;i({target:"Object",stat:!0,forced:r((function(){c(1)}))||a},{isFrozen:function(t){return!o(t)||!(!a||"ArrayBuffer"!=s(t))||!!c&&c(t)}})},64484:function(t,e,n){var i=n(51605),r=n(92074),o=n(65335),s=n(18569),a=n(22085),c=Object.isSealed;i({target:"Object",stat:!0,forced:r((function(){c(1)}))||a},{isSealed:function(t){return!o(t)||!(!a||"ArrayBuffer"!=s(t))||!!c&&c(t)}})},23023:function(t,e,n){n(51605)({target:"Object",stat:!0},{is:n(54741)})},7899:function(t,e,n){var i=n(51605),r=n(92612),o=n(91641);i({target:"Object",stat:!0,forced:n(92074)((function(){o(1)}))},{keys:function(t){return o(r(t))}})},94641:function(t,e,n){"use strict";var i=n(51605),r=n(65077),o=n(61342),s=n(92612),a=n(86032),c=n(97970),l=n(97632).f;r&&i({target:"Object",proto:!0,forced:o},{__lookupGetter__:function(t){var e,n=s(this),i=a(t);do{if(e=l(n,i))return e.get}while(n=c(n))}})},99437:function(t,e,n){"use strict";var i=n(51605),r=n(65077),o=n(61342),s=n(92612),a=n(86032),c=n(97970),l=n(97632).f;r&&i({target:"Object",proto:!0,forced:o},{__lookupSetter__:function(t){var e,n=s(this),i=a(t);do{if(e=l(n,i))return e.set}while(n=c(n))}})},8240:function(t,e,n){var i=n(51605),r=n(65335),o=n(82014).onFreeze,s=n(55159),a=n(92074),c=Object.preventExtensions;i({target:"Object",stat:!0,forced:a((function(){c(1)})),sham:!s},{preventExtensions:function(t){return c&&r(t)?c(o(t)):t}})},47258:function(t,e,n){var i=n(51605),r=n(65335),o=n(82014).onFreeze,s=n(55159),a=n(92074),c=Object.seal;i({target:"Object",stat:!0,forced:a((function(){c(1)})),sham:!s},{seal:function(t){return c&&r(t)?c(o(t)):t}})},4632:function(t,e,n){n(51605)({target:"Object",stat:!0},{setPrototypeOf:n(39686)})},5086:function(t,e,n){var i=n(43129),r=n(7485),o=n(94972);i||r(Object.prototype,"toString",o,{unsafe:!0})},90345:function(t,e,n){var i=n(51605),r=n(23172).values;i({target:"Object",stat:!0},{values:function(t){return r(t)}})},96088:function(t,e,n){var i=n(51605),r=n(35963);i({global:!0,forced:parseFloat!=r},{parseFloat:r})},52231:function(t,e,n){var i=n(51605),r=n(27292);i({global:!0,forced:parseInt!=r},{parseInt:r})},5880:function(t,e,n){"use strict";var i=n(51605),r=n(72368),o=n(24601),s=n(39836),a=n(50242),c=n(52929);i({target:"Promise",stat:!0},{allSettled:function(t){var e=this,n=s.f(e),i=n.resolve,l=n.reject,u=a((function(){var n=o(e.resolve),s=[],a=0,l=1;c(t,(function(t){var o=a++,c=!1;l++,r(n,e,t).then((function(t){c||(c=!0,s[o]={status:"fulfilled",value:t},--l||i(s))}),(function(t){c||(c=!0,s[o]={status:"rejected",reason:t},--l||i(s))}))})),--l||i(s)}));return u.error&&l(u.value),n.promise}})},6704:function(t,e,n){"use strict";var i=n(51605),r=n(72368),o=n(24601),s=n(39836),a=n(50242),c=n(52929);i({target:"Promise",stat:!0,forced:n(39772)},{all:function(t){var e=this,n=s.f(e),i=n.resolve,l=n.reject,u=a((function(){var n=o(e.resolve),s=[],a=0,u=1;c(t,(function(t){var o=a++,c=!1;u++,r(n,e,t).then((function(t){c||(c=!0,s[o]=t,--u||i(s))}),l)})),--u||i(s)}));return u.error&&l(u.value),n.promise}})},45773:function(t,e,n){"use strict";var i=n(51605),r=n(72368),o=n(24601),s=n(56492),a=n(39836),c=n(50242),l=n(52929),u="No one promise resolved";i({target:"Promise",stat:!0},{any:function(t){var e=this,n=s("AggregateError"),i=a.f(e),h=i.resolve,d=i.reject,f=c((function(){var i=o(e.resolve),s=[],a=0,c=1,f=!1;l(t,(function(t){var o=a++,l=!1;c++,r(i,e,t).then((function(t){l||f||(f=!0,h(t))}),(function(t){l||f||(l=!0,s[o]=t,--c||d(new n(s,u)))}))})),--c||d(new n(s,u))}));return f.error&&d(f.value),i.promise}})},55540:function(t,e,n){"use strict";var i=n(51605),r=n(6926),o=n(39053).CONSTRUCTOR,s=n(2413),a=n(56492),c=n(78420),l=n(7485),u=s&&s.prototype;if(i({target:"Promise",proto:!0,forced:o,real:!0},{catch:function(t){return this.then(void 0,t)}}),!r&&c(s)){var h=a("Promise").prototype.catch;u.catch!==h&&l(u,"catch",h,{unsafe:!0})}},1811:function(t,e,n){"use strict";var i,r,o,s=n(51605),a=n(6926),c=n(75223),l=n(30200),u=n(72368),h=n(7485),d=n(39686),f=n(75282),m=n(93524),g=n(24601),p=n(78420),w=n(65335),v=n(65190),b=n(23444),y=n(74922).set,_=n(47462),k=n(69778),A=n(50242),x=n(97600),T=n(99206),C=n(2413),E=n(39053),S=n(39836),P="Promise",R=E.CONSTRUCTOR,O=E.REJECTION_EVENT,I=E.SUBCLASSING,M=T.getterFor(P),N=T.set,V=C&&C.prototype,D=C,B=V,F=l.TypeError,L=l.document,z=l.process,j=S.f,H=j,U=!!(L&&L.createEvent&&l.dispatchEvent),W="unhandledrejection",$=function(t){var e;return!(!w(t)||!p(e=t.then))&&e},q=function(t,e){var n,i,r,o=e.value,s=1==e.state,a=s?t.ok:t.fail,c=t.resolve,l=t.reject,h=t.domain;try{a?(s||(2===e.rejection&&Q(e),e.rejection=1),!0===a?n=o:(h&&h.enter(),n=a(o),h&&(h.exit(),r=!0)),n===t.promise?l(F("Promise-chain cycle")):(i=$(n))?u(i,n,c,l):c(n)):l(o)}catch(t){h&&!r&&h.exit(),l(t)}},K=function(t,e){t.notified||(t.notified=!0,_((function(){for(var n,i=t.reactions;n=i.get();)q(n,t);t.notified=!1,e&&!t.rejection&&J(t)})))},G=function(t,e,n){var i,r;U?((i=L.createEvent("Event")).promise=e,i.reason=n,i.initEvent(t,!1,!0),l.dispatchEvent(i)):i={promise:e,reason:n},
!O&&(r=l["on"+t])?r(i):t===W&&k("Unhandled promise rejection",n)},J=function(t){u(y,l,(function(){var e,n=t.facade,i=t.value;if(Y(t)&&(e=A((function(){c?z.emit("unhandledRejection",i,n):G(W,n,i)})),t.rejection=c||Y(t)?2:1,e.error))throw e.value}))},Y=function(t){return 1!==t.rejection&&!t.parent},Q=function(t){u(y,l,(function(){var e=t.facade;c?z.emit("rejectionHandled",e):G("rejectionhandled",e,t.value)}))},X=function(t,e,n){return function(i){t(e,i,n)}},Z=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,K(t,!0))},tt=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw F("Promise can't be resolved itself");var i=$(e);i?_((function(){var n={done:!1};try{u(i,e,X(tt,n,t),X(Z,n,t))}catch(e){Z(n,e,t)}})):(t.value=e,t.state=1,K(t,!1))}catch(e){Z({done:!1},e,t)}}};if(R&&(B=(D=function(t){v(this,B),g(t),u(i,this);var e=M(this);try{t(X(tt,e),X(Z,e))}catch(t){Z(e,t)}}).prototype,(i=function(){N(this,{type:P,done:!1,notified:!1,parent:!1,reactions:new x,rejection:!1,state:0,value:void 0})}).prototype=h(B,"then",(function(t,e){var n=M(this),i=j(b(this,D));return n.parent=!0,i.ok=!p(t)||t,i.fail=p(e)&&e,i.domain=c?z.domain:void 0,0==n.state?n.reactions.add(i):_((function(){q(i,n)})),i.promise})),r=function(){var t=new i,e=M(t);this.promise=t,this.resolve=X(tt,e),this.reject=X(Z,e)},S.f=j=function(t){return t===D||void 0===t?new r(t):H(t)},!a&&p(C)&&V!==Object.prototype)){o=V.then,I||h(V,"then",(function(t,e){var n=this;return new D((function(t,e){u(o,n,t,e)})).then(t,e)}),{unsafe:!0});try{delete V.constructor}catch(t){}d&&d(V,B)}s({global:!0,constructor:!0,wrap:!0,forced:R},{Promise:D}),f(D,P,!1,!0),m(P)},83396:function(t,e,n){"use strict";var i=n(51605),r=n(6926),o=n(2413),s=n(92074),a=n(56492),c=n(78420),l=n(23444),u=n(9803),h=n(7485),d=o&&o.prototype;if(i({target:"Promise",proto:!0,real:!0,forced:!!o&&s((function(){d.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=l(this,a("Promise")),n=c(t);return this.then(n?function(n){return u(e,t()).then((function(){return n}))}:t,n?function(n){return u(e,t()).then((function(){throw n}))}:t)}}),!r&&c(o)){var f=a("Promise").prototype.finally;d.finally!==f&&h(d,"finally",f,{unsafe:!0})}},69193:function(t,e,n){n(1811),n(6704),n(55540),n(58670),n(40528),n(91635)},58670:function(t,e,n){"use strict";var i=n(51605),r=n(72368),o=n(24601),s=n(39836),a=n(50242),c=n(52929);i({target:"Promise",stat:!0,forced:n(39772)},{race:function(t){var e=this,n=s.f(e),i=n.reject,l=a((function(){var s=o(e.resolve);c(t,(function(t){r(s,e,t).then(n.resolve,i)}))}));return l.error&&i(l.value),n.promise}})},40528:function(t,e,n){"use strict";var i=n(51605),r=n(72368),o=n(39836);i({target:"Promise",stat:!0,forced:n(39053).CONSTRUCTOR},{reject:function(t){var e=o.f(this);return r(e.reject,void 0,t),e.promise}})},91635:function(t,e,n){"use strict";var i=n(51605),r=n(56492),o=n(6926),s=n(2413),a=n(39053).CONSTRUCTOR,c=n(9803),l=r("Promise"),u=o&&!a;i({target:"Promise",stat:!0,forced:o||a},{resolve:function(t){return c(u&&this===l?s:this,t)}})},67811:function(t,e,n){var i=n(51605),r=n(99070),o=n(24601),s=n(73938);i({target:"Reflect",stat:!0,forced:!n(92074)((function(){Reflect.apply((function(){}))}))},{apply:function(t,e,n){return r(o(t),e,s(n))}})},34606:function(t,e,n){var i=n(51605),r=n(56492),o=n(99070),s=n(38891),a=n(57849),c=n(73938),l=n(65335),u=n(53105),h=n(92074),d=r("Reflect","construct"),f=Object.prototype,m=[].push,g=h((function(){function t(){}return!(d((function(){}),[],t)instanceof t)})),p=!h((function(){d((function(){}))})),w=g||p;i({target:"Reflect",stat:!0,forced:w,sham:w},{construct:function(t,e){a(t),c(e);var n=arguments.length<3?t:a(arguments[2]);if(p&&!g)return d(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var i=[null];return o(m,i,e),new(o(s,t,i))}var r=n.prototype,h=u(l(r)?r:f),w=o(t,h,e);return l(w)?w:h}})},57948:function(t,e,n){var i=n(51605),r=n(65077),o=n(73938),s=n(86032),a=n(43610);i({target:"Reflect",stat:!0,forced:n(92074)((function(){Reflect.defineProperty(a.f({},1,{value:1}),1,{value:2})})),sham:!r},{defineProperty:function(t,e,n){o(t);var i=s(e);o(n);try{return a.f(t,i,n),!0}catch(t){return!1}}})},60436:function(t,e,n){var i=n(51605),r=n(73938),o=n(97632).f;i({target:"Reflect",stat:!0},{deleteProperty:function(t,e){var n=o(r(t),e);return!(n&&!n.configurable)&&delete t[e]}})},98182:function(t,e,n){var i=n(51605),r=n(65077),o=n(73938),s=n(97632);i({target:"Reflect",stat:!0,sham:!r},{getOwnPropertyDescriptor:function(t,e){return s.f(o(t),e)}})},92276:function(t,e,n){var i=n(51605),r=n(73938),o=n(97970);i({target:"Reflect",stat:!0,sham:!n(7168)},{getPrototypeOf:function(t){return o(r(t))}})},12091:function(t,e,n){var i=n(51605),r=n(72368),o=n(65335),s=n(73938),a=n(66060),c=n(97632),l=n(97970);i({target:"Reflect",stat:!0},{get:function t(e,n){var i,u,h=arguments.length<3?e:arguments[2];return s(e)===h?e[n]:(i=c.f(e,n))?a(i)?i.value:void 0===i.get?void 0:r(i.get,h):o(u=l(e))?t(u,n,h):void 0}})},95031:function(t,e,n){n(51605)({target:"Reflect",stat:!0},{has:function(t,e){return e in t}})},89853:function(t,e,n){var i=n(51605),r=n(73938),o=n(40111);i({target:"Reflect",stat:!0},{isExtensible:function(t){return r(t),o(t)}})},94308:function(t,e,n){n(51605)({target:"Reflect",stat:!0},{ownKeys:n(15816)})},14912:function(t,e,n){var i=n(51605),r=n(56492),o=n(73938);i({target:"Reflect",stat:!0,sham:!n(55159)},{preventExtensions:function(t){o(t);try{var e=r("Object","preventExtensions");return e&&e(t),!0}catch(t){return!1}}})},27144:function(t,e,n){var i=n(51605),r=n(73938),o=n(7473),s=n(39686);s&&i({target:"Reflect",stat:!0},{setPrototypeOf:function(t,e){r(t),o(e);try{return s(t,e),!0}catch(t){return!1}}})},37759:function(t,e,n){var i=n(51605),r=n(72368),o=n(73938),s=n(65335),a=n(66060),c=n(92074),l=n(43610),u=n(97632),h=n(97970),d=n(66843);i({target:"Reflect",stat:!0,forced:c((function(){var t=function(){},e=l.f(new t,"a",{configurable:!0});return!1!==Reflect.set(t.prototype,"a",1,e)}))},{set:function t(e,n,i){var c,f,m,g=arguments.length<4?e:arguments[3],p=u.f(o(e),n);if(!p){if(s(f=h(e)))return t(f,n,i,g);p=d(0)}if(a(p)){if(!1===p.writable||!s(g))return!1;if(c=u.f(g,n)){if(c.get||c.set||!1===c.writable)return!1;c.value=i,l.f(g,n,c)}else l.f(g,n,d(0,i))}else{if(void 0===(m=p.set))return!1;r(m,g,i)}return!0}})},73719:function(t,e,n){var i=n(51605),r=n(30200),o=n(75282);i({global:!0},{Reflect:{}}),o(r.Reflect,"Reflect",!0)},79073:function(t,e,n){var i=n(65077),r=n(30200),o=n(30281),s=n(84977),a=n(93054),c=n(97712),l=n(64789).f,u=n(47658),h=n(62449),d=n(95362),f=n(10353),m=n(12192),g=n(56527),p=n(7485),w=n(92074),v=n(36490),b=n(99206).enforce,y=n(93524),_=n(31602),k=n(31036),A=n(28121),x=_("match"),T=r.RegExp,C=T.prototype,E=r.SyntaxError,S=o(C.exec),P=o("".charAt),R=o("".replace),O=o("".indexOf),I=o("".slice),M=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,N=/a/g,V=/a/g,D=new T(N)!==N,B=m.MISSED_STICKY,F=m.UNSUPPORTED_Y;if(s("RegExp",i&&(!D||B||k||A||w((function(){return V[x]=!1,T(N)!=N||T(V)==V||"/a/i"!=T(N,"i")}))))){for(var L=function(t,e){var n,i,r,o,s,l,m=u(C,this),g=h(t),p=void 0===e,w=[],y=t;if(!m&&g&&p&&t.constructor===L)return t;if((g||u(C,t))&&(t=t.source,p&&(e=f(y))),t=void 0===t?"":d(t),e=void 0===e?"":d(e),y=t,k&&"dotAll"in N&&(i=!!e&&O(e,"s")>-1)&&(e=R(e,/s/g,"")),n=e,B&&"sticky"in N&&(r=!!e&&O(e,"y")>-1)&&F&&(e=R(e,/y/g,"")),A&&(o=function(t){for(var e,n=t.length,i=0,r="",o=[],s={},a=!1,c=!1,l=0,u="";i<=n;i++){if("\\"===(e=P(t,i)))e+=P(t,++i);else if("]"===e)a=!1;else if(!a)switch(!0){case"["===e:a=!0;break;case"("===e:S(M,I(t,i+1))&&(i+=2,c=!0),r+=e,l++;continue;case">"===e&&c:if(""===u||v(s,u))throw new E("Invalid capture group name");s[u]=!0,o[o.length]=[u,l],c=!1,u="";continue}c?u+=e:r+=e}return[r,o]}(t),t=o[0],w=o[1]),s=a(T(t,e),m?this:C,L),(i||r||w.length)&&(l=b(s),i&&(l.dotAll=!0,l.raw=L(function(t){for(var e,n=t.length,i=0,r="",o=!1;i<=n;i++)"\\"!==(e=P(t,i))?o||"."!==e?("["===e?o=!0:"]"===e&&(o=!1),r+=e):r+="[\\s\\S]":r+=e+P(t,++i);return r}(t),n)),r&&(l.sticky=!0),w.length&&(l.groups=w)),t!==y)try{c(s,"source",""===y?"(?:)":y)}catch(t){}return s},z=l(T),j=0;z.length>j;)g(L,T,z[j++]);C.constructor=L,L.prototype=C,p(r,"RegExp",L,{constructor:!0})}y("RegExp")},84216:function(t,e,n){var i=n(65077),r=n(31036),o=n(18569),s=n(76477),a=n(99206).get,c=RegExp.prototype,l=TypeError;i&&r&&s(c,"dotAll",{configurable:!0,get:function(){if(this!==c){if("RegExp"===o(this))return!!a(this).dotAll;throw l("Incompatible receiver, RegExp required")}}})},87136:function(t,e,n){"use strict";var i=n(51605),r=n(70054);i({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},38802:function(t,e,n){var i=n(30200),r=n(65077),o=n(76477),s=n(16844),a=n(92074),c=i.RegExp,l=c.prototype;r&&a((function(){var t=!0;try{c(".","d")}catch(e){t=!1}var e={},n="",i=t?"dgimsy":"gimsy",r=function(t,i){Object.defineProperty(e,t,{get:function(){return n+=i,!0}})},o={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var s in t&&(o.hasIndices="d"),o)r(s,o[s]);return Object.getOwnPropertyDescriptor(l,"flags").get.call(e)!==i||n!==i}))&&o(l,"flags",{configurable:!0,get:s})},13334:function(t,e,n){var i=n(65077),r=n(12192).MISSED_STICKY,o=n(18569),s=n(76477),a=n(99206).get,c=RegExp.prototype,l=TypeError;i&&r&&s(c,"sticky",{configurable:!0,get:function(){if(this!==c){if("RegExp"===o(this))return!!a(this).sticky;throw l("Incompatible receiver, RegExp required")}}})},70617:function(t,e,n){"use strict";n(87136);var i,r,o=n(51605),s=n(72368),a=n(30281),c=n(78420),l=n(65335),u=(i=!1,(r=/[ac]/).exec=function(){return i=!0,/./.exec.apply(this,arguments)},!0===r.test("abc")&&i),h=TypeError,d=a(/./.test);o({target:"RegExp",proto:!0,forced:!u},{test:function(t){var e=this.exec;if(!c(e))return d(this,t);var n=s(e,this,t);if(null!==n&&!l(n))throw new h("RegExp exec method returned something other than an Object or null");return!!n}})},6048:function(t,e,n){"use strict";var i=n(12071).PROPER,r=n(7485),o=n(73938),s=n(95362),a=n(92074),c=n(10353),l="toString",u=RegExp.prototype.toString,h=a((function(){return"/a/b"!=u.call({source:"a",flags:"b"})})),d=i&&u.name!=l;(h||d)&&r(RegExp.prototype,l,(function(){var t=o(this);return"/"+s(t.source)+"/"+s(c(t))}),{unsafe:!0})},13938:function(t,e,n){"use strict";n(92327)("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),n(5959))},45708:function(t,e,n){n(13938)},39596:function(t,e,n){"use strict";var i=n(51605),r=n(19877);i({target:"String",proto:!0,forced:n(88478)("anchor")},{anchor:function(t){return r(this,"a","name",t)}})},46590:function(t,e,n){"use strict";var i=n(51605),r=n(30281),o=n(71229),s=n(79328),a=n(95362),c=n(92074),l=r("".charAt);i({target:"String",proto:!0,forced:c((function(){return"\ud842"!=="\ud842\udfb7".at(-2)}))},{at:function(t){var e=a(o(this)),n=e.length,i=s(t),r=i>=0?i:n+i;return r<0||r>=n?void 0:l(e,r)}})},34607:function(t,e,n){"use strict";var i=n(51605),r=n(19877);i({target:"String",proto:!0,forced:n(88478)("big")},{big:function(){return r(this,"big","","")}})},8915:function(t,e,n){"use strict";var i=n(51605),r=n(19877);i({target:"String",proto:!0,forced:n(88478)("blink")},{blink:function(){return r(this,"blink","","")}})},35594:function(t,e,n){"use strict";var i=n(51605),r=n(19877);i({target:"String",proto:!0,forced:n(88478)("bold")},{bold:function(){return r(this,"b","","")}})},4657:function(t,e,n){"use strict";var i=n(51605),r=n(77804).codeAt;i({target:"String",proto:!0},{codePointAt:function(t){return r(this,t)}})},67500:function(t,e,n){"use strict";var i,r=n(51605),o=n(30281),s=n(97632).f,a=n(33747),c=n(95362),l=n(92588),u=n(71229),h=n(44177),d=n(6926),f=o("".endsWith),m=o("".slice),g=Math.min,p=h("endsWith");r({target:"String",proto:!0,forced:!(!d&&!p&&(i=s(String.prototype,"endsWith"),i&&!i.writable)||p)},{endsWith:function(t){var e=c(u(this));l(t);var n=arguments.length>1?arguments[1]:void 0,i=e.length,r=void 0===n?i:g(a(n),i),o=c(t);return f?f(e,o,r):m(e,r-o.length,r)===o}})},69607:function(t,e,n){"use strict";var i=n(51605),r=n(19877);i({target:"String",proto:!0,forced:n(88478)("fixed")},{fixed:function(){return r(this,"tt","","")}})},75193:function(t,e,n){"use strict";var i=n(51605),r=n(19877);i({target:"String",proto:!0,forced:n(88478)("fontcolor")},{fontcolor:function(t){return r(this,"font","color",t)}})},8505:function(t,e,n){"use strict";var i=n(51605),r=n(19877);i({target:"String",proto:!0,forced:n(88478)("fontsize")},{fontsize:function(t){return r(this,"font","size",t)}})},5784:function(t,e,n){var i=n(51605),r=n(30281),o=n(6539),s=RangeError,a=String.fromCharCode,c=String.fromCodePoint,l=r([].join);i({target:"String",stat:!0,arity:1,forced:!!c&&1!=c.length},{fromCodePoint:function(t){for(var e,n=[],i=arguments.length,r=0;i>r;){if(e=+arguments[r++],o(e,1114111)!==e)throw s(e+" is not a valid code point");n[r]=e<65536?a(e):a(55296+((e-=65536)>>10),e%1024+56320)}return l(n,"")}})},43148:function(t,e,n){"use strict";var i=n(51605),r=n(30281),o=n(92588),s=n(71229),a=n(95362),c=n(44177),l=r("".indexOf);i({target:"String",proto:!0,forced:!c("includes")},{includes:function(t){return!!~l(a(s(this)),a(o(t)),arguments.length>1?arguments[1]:void 0)}})},53024:function(t,e,n){"use strict";var i=n(51605),r=n(19877);i({target:"String",proto:!0,forced:n(88478)("italics")},{italics:function(){return r(this,"i","","")}})},29979:function(t,e,n){"use strict";var i=n(77804).charAt,r=n(95362),o=n(99206),s=n(45723),a="String Iterator",c=o.set,l=o.getterFor(a);s(String,"String",(function(t){c(this,{type:a,string:r(t),index:0})}),(function(){var t,e=l(this),n=e.string,r=e.index;return r>=n.length?{value:void 0,done:!0}:(t=i(n,r),e.index+=t.length,{value:t,done:!1})}))},77249:function(t,e,n){"use strict";var i=n(51605),r=n(19877);i({target:"String",proto:!0,forced:n(88478)("link")},{link:function(t){return r(this,"a","href",t)}})},17870:function(t,e,n){"use strict";var i=n(51605),r=n(72368),o=n(30281),s=n(72147),a=n(71229),c=n(33747),l=n(95362),u=n(73938),h=n(18569),d=n(62449),f=n(10353),m=n(46457),g=n(7485),p=n(92074),w=n(31602),v=n(23444),b=n(67234),y=n(66793),_=n(99206),k=n(6926),A=w("matchAll"),x="RegExp String",T="RegExp String Iterator",C=_.set,E=_.getterFor(T),S=RegExp.prototype,P=TypeError,R=o("".indexOf),O=o("".matchAll),I=!!O&&!p((function(){O("a",/./)})),M=s((function(t,e,n,i){C(this,{type:T,regexp:t,string:e,global:n,unicode:i,done:!1})}),x,(function(){var t=E(this);if(t.done)return{value:void 0,done:!0};var e=t.regexp,n=t.string,i=y(e,n);return null===i?{value:void 0,done:t.done=!0}:t.global?(""===l(i[0])&&(e.lastIndex=b(n,c(e.lastIndex),t.unicode)),{value:i,done:!1}):(t.done=!0,{value:i,done:!1})})),N=function(t){var e,n,i,r=u(this),o=l(t),s=v(r,RegExp),a=l(f(r));return e=new s(s===RegExp?r.source:r,a),n=!!~R(a,"g"),i=!!~R(a,"u"),e.lastIndex=c(r.lastIndex),new M(e,o,n,i)};i({target:"String",proto:!0,forced:I},{matchAll:function(t){var e,n,i,o,s=a(this);if(null!=t){if(d(t)&&(e=l(a(f(t))),!~R(e,"g")))throw P("`.matchAll` does not allow non-global regexes");if(I)return O(s,t);if(void 0===(i=m(t,A))&&k&&"RegExp"==h(t)&&(i=N),i)return r(i,t,s)}else if(I)return O(s,t);return n=l(s),o=new RegExp(t,"g"),k?r(N,o,n):o[A](n)}}),k||A in S||g(S,A,N)},78636:function(t,e,n){"use strict";var i=n(72368),r=n(20779),o=n(73938),s=n(33747),a=n(95362),c=n(71229),l=n(46457),u=n(67234),h=n(66793);r("match",(function(t,e,n){return[function(e){var n=c(this),r=null==e?void 0:l(e,t);return r?i(r,e,n):new RegExp(e)[t](a(n))},function(t){var i=o(this),r=a(t),c=n(e,i,r);if(c.done)return c.value;if(!i.global)return h(i,r);var l=i.unicode;i.lastIndex=0;for(var d,f=[],m=0;null!==(d=h(i,r));){var g=a(d[0]);f[m]=g,""===g&&(i.lastIndex=u(r,s(i.lastIndex),l)),m++}return 0===m?null:f}]}))},3848:function(t,e,n){"use strict";var i=n(51605),r=n(45214).end;i({target:"String",proto:!0,forced:n(97046)},{padEnd:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},48825:function(t,e,n){"use strict";var i=n(51605),r=n(45214).start;i({target:"String",proto:!0,forced:n(97046)},{padStart:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},67287:function(t,e,n){var i=n(51605),r=n(30281),o=n(5476),s=n(92612),a=n(95362),c=n(23493),l=r([].push),u=r([].join);i({target:"String",stat:!0},{raw:function(t){for(var e=o(s(t).raw),n=c(e),i=arguments.length,r=[],h=0;n>h;){if(l(r,a(e[h++])),h===n)return u(r,"");h<i&&l(r,a(arguments[h]))}}})},61890:function(t,e,n){n(51605)({target:"String",proto:!0},{repeat:n(10140)})},60243:function(t,e,n){"use strict";var i=n(51605),r=n(72368),o=n(30281),s=n(71229),a=n(78420),c=n(62449),l=n(95362),u=n(46457),h=n(10353),d=n(94433),f=n(31602),m=n(6926),g=f("replace"),p=TypeError,w=o("".indexOf),v=o("".replace),b=o("".slice),y=Math.max,_=function(t,e,n){return n>t.length?-1:""===e?n:w(t,e,n)};i({target:"String",proto:!0},{replaceAll:function(t,e){var n,i,o,f,k,A,x,T,C,E=s(this),S=0,P=0,R="";if(null!=t){if((n=c(t))&&(i=l(s(h(t))),!~w(i,"g")))throw p("`.replaceAll` does not allow non-global regexes");if(o=u(t,g))return r(o,t,E,e);if(m&&n)return v(l(E),t,e)}for(f=l(E),k=l(t),(A=a(e))||(e=l(e)),x=k.length,T=y(1,x),S=_(f,k,0);-1!==S;)C=A?l(e(k,S,f)):d(k,f,S,[],void 0,e),R+=b(f,P,S)+C,P=S+x,S=_(f,k,S+T);return P<f.length&&(R+=b(f,P)),R}})},40173:function(t,e,n){"use strict";var i=n(99070),r=n(72368),o=n(30281),s=n(20779),a=n(92074),c=n(73938),l=n(78420),u=n(79328),h=n(33747),d=n(95362),f=n(71229),m=n(67234),g=n(46457),p=n(94433),w=n(66793),v=n(31602)("replace"),b=Math.max,y=Math.min,_=o([].concat),k=o([].push),A=o("".indexOf),x=o("".slice),T="$0"==="a".replace(/./,"$0"),C=!!/./[v]&&""===/./[v]("a","$0");s("replace",(function(t,e,n){var o=C?"$":"$0";return[function(t,n){var i=f(this),o=null==t?void 0:g(t,v);return o?r(o,t,i,n):r(e,d(i),t,n)},function(t,r){var s=c(this),a=d(t);if("string"==typeof r&&-1===A(r,o)&&-1===A(r,"$<")){var f=n(e,s,a,r);if(f.done)return f.value}var g=l(r);g||(r=d(r));var v=s.global;if(v){var T=s.unicode;s.lastIndex=0}for(var C=[];;){var E=w(s,a);if(null===E)break;if(k(C,E),!v)break;""===d(E[0])&&(s.lastIndex=m(a,h(s.lastIndex),T))}for(var S,P="",R=0,O=0;O<C.length;O++){for(var I=d((E=C[O])[0]),M=b(y(u(E.index),a.length),0),N=[],V=1;V<E.length;V++)k(N,void 0===(S=E[V])?S:String(S));var D=E.groups;if(g){var B=_([I],N,M,a);void 0!==D&&k(B,D);var F=d(i(r,void 0,B))}else F=p(I,a,M,N,D,r);M>=R&&(P+=x(a,R,M)+F,R=M+I.length)}return P+x(a,R)}]}),!!a((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!T||C)},50785:function(t,e,n){"use strict";var i=n(72368),r=n(20779),o=n(73938),s=n(71229),a=n(54741),c=n(95362),l=n(46457),u=n(66793);r("search",(function(t,e,n){return[function(e){var n=s(this),r=null==e?void 0:l(e,t);return r?i(r,e,n):new RegExp(e)[t](c(n))},function(t){var i=o(this),r=c(t),s=n(e,i,r);if(s.done)return s.value;var l=i.lastIndex;a(l,0)||(i.lastIndex=0);var h=u(i,r);return a(i.lastIndex,l)||(i.lastIndex=l),null===h?-1:h.index}]}))},5038:function(t,e,n){"use strict";var i=n(51605),r=n(19877);i({target:"String",proto:!0,forced:n(88478)("small")},{small:function(){return r(this,"small","","")}})},58649:function(t,e,n){"use strict";var i=n(99070),r=n(72368),o=n(30281),s=n(20779),a=n(62449),c=n(73938),l=n(71229),u=n(23444),h=n(67234),d=n(33747),f=n(95362),m=n(46457),g=n(76056),p=n(66793),w=n(70054),v=n(12192),b=n(92074),y=v.UNSUPPORTED_Y,_=4294967295,k=Math.min,A=[].push,x=o(/./.exec),T=o(A),C=o("".slice),E=!b((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));s("split",(function(t,e,n){var o;return o="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var o=f(l(this)),s=void 0===n?_:n>>>0;if(0===s)return[];if(void 0===t)return[o];if(!a(t))return r(e,o,t,s);for(var c,u,h,d=[],m=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),p=0,v=new RegExp(t.source,m+"g");(c=r(w,v,o))&&!((u=v.lastIndex)>p&&(T(d,C(o,p,c.index)),c.length>1&&c.index<o.length&&i(A,d,g(c,1)),h=c[0].length,p=u,d.length>=s));)v.lastIndex===c.index&&v.lastIndex++;return p===o.length?!h&&x(v,"")||T(d,""):T(d,C(o,p)),d.length>s?g(d,0,s):d}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:r(e,this,t,n)}:e,[function(e,n){var i=l(this),s=null==e?void 0:m(e,t);return s?r(s,e,i,n):r(o,f(i),e,n)},function(t,i){var r=c(this),s=f(t),a=n(o,r,s,i,o!==e);if(a.done)return a.value;var l=u(r,RegExp),m=r.unicode,g=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(y?"g":"y"),w=new l(y?"^(?:"+r.source+")":r,g),v=void 0===i?_:i>>>0;if(0===v)return[];if(0===s.length)return null===p(w,s)?[s]:[];for(var b=0,A=0,x=[];A<s.length;){w.lastIndex=y?0:A;var E,S=p(w,y?C(s,A):s);if(null===S||(E=k(d(w.lastIndex+(y?A:0)),s.length))===b)A=h(s,A,m);else{if(T(x,C(s,b,A)),x.length===v)return x;for(var P=1;P<=S.length-1;P++)if(T(x,S[P]),x.length===v)return x;A=b=E}}return T(x,C(s,b)),x}]}),!E,y)},54989:function(t,e,n){"use strict";var i,r=n(51605),o=n(30281),s=n(97632).f,a=n(33747),c=n(95362),l=n(92588),u=n(71229),h=n(44177),d=n(6926),f=o("".startsWith),m=o("".slice),g=Math.min,p=h("startsWith");r({target:"String",proto:!0,forced:!(!d&&!p&&(i=s(String.prototype,"startsWith"),i&&!i.writable)||p)},{startsWith:function(t){var e=c(u(this));l(t);var n=a(g(arguments.length>1?arguments[1]:void 0,e.length)),i=c(t);return f?f(e,i,n):m(e,n,n+i.length)===i}})},34427:function(t,e,n){"use strict";var i=n(51605),r=n(19877);i({target:"String",proto:!0,forced:n(88478)("strike")},{strike:function(){return r(this,"strike","","")}})},65987:function(t,e,n){"use strict";var i=n(51605),r=n(19877);i({target:"String",proto:!0,forced:n(88478)("sub")},{sub:function(){return r(this,"sub","","")}})},73648:function(t,e,n){"use strict";var i=n(51605),r=n(30281),o=n(71229),s=n(79328),a=n(95362),c=r("".slice),l=Math.max,u=Math.min;i({target:"String",proto:!0,forced:!"".substr||"b"!=="ab".substr(-1)},{substr:function(t,e){var n,i,r=a(o(this)),h=r.length,d=s(t);return d===1/0&&(d=0),d<0&&(d=l(h+d,0)),(n=void 0===e?h:s(e))<=0||n===1/0||d>=(i=u(d+n,h))?"":c(r,d,i)}})},18293:function(t,e,n){"use strict";var i=n(51605),r=n(19877);i({target:"String",proto:!0,forced:n(88478)("sup")},{sup:function(){return r(this,"sup","","")}})},70825:function(t,e,n){n(5314);var i=n(51605),r=n(75079);i({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==r},{trimEnd:r})},70075:function(t,e,n){var i=n(51605),r=n(23322);i({target:"String",proto:!0,name:"trimStart",forced:"".trimLeft!==r},{trimLeft:r})},5314:function(t,e,n){var i=n(51605),r=n(75079);i({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==r},{trimRight:r})},5336:function(t,e,n){n(70075);var i=n(51605),r=n(23322);i({target:"String",proto:!0,name:"trimStart",forced:"".trimStart!==r},{trimStart:r})},68329:function(t,e,n){"use strict";var i=n(51605),r=n(69163).trim;i({target:"String",proto:!0,forced:n(89233)("trim")},{trim:function(){return r(this)}})},27727:function(t,e,n){n(91272)("asyncIterator")},27896:function(t,e,n){"use strict";var i=n(51605),r=n(30200),o=n(72368),s=n(30281),a=n(6926),c=n(65077),l=n(61849),u=n(92074),h=n(36490),d=n(47658),f=n(73938),m=n(5476),g=n(86032),p=n(95362),w=n(66843),v=n(53105),b=n(91641),y=n(64789),_=n(56509),k=n(18916),A=n(97632),x=n(43610),T=n(65318),C=n(9304),E=n(7485),S=n(50002),P=n(25904),R=n(67708),O=n(50665),I=n(31602),M=n(30802),N=n(91272),V=n(28237),D=n(75282),B=n(99206),F=n(91344).forEach,L=P("hidden"),z="Symbol",j=B.set,H=B.getterFor(z),U=Object.prototype,W=r.Symbol,$=W&&W.prototype,q=r.TypeError,K=r.QObject,G=A.f,J=x.f,Y=_.f,Q=C.f,X=s([].push),Z=S("symbols"),tt=S("op-symbols"),et=S("wks"),nt=!K||!K.prototype||!K.prototype.findChild,it=c&&u((function(){return 7!=v(J({},"a",{get:function(){return J(this,"a",{value:7}).a}})).a}))?function(t,e,n){var i=G(U,e);i&&delete U[e],J(t,e,n),i&&t!==U&&J(U,e,i)}:J,rt=function(t,e){var n=Z[t]=v($);return j(n,{type:z,tag:t,description:e}),c||(n.description=e),n},ot=function(t,e,n){t===U&&ot(tt,e,n),f(t);var i=g(e);return f(n),h(Z,i)?(n.enumerable?(h(t,L)&&t[L][i]&&(t[L][i]=!1),n=v(n,{enumerable:w(0,!1)})):(h(t,L)||J(t,L,w(1,{})),t[L][i]=!0),it(t,i,n)):J(t,i,n)},st=function(t,e){f(t);var n=m(e),i=b(n).concat(ut(n));return F(i,(function(e){c&&!o(at,n,e)||ot(t,e,n[e])})),t},at=function(t){var e=g(t),n=o(Q,this,e);return!(this===U&&h(Z,e)&&!h(tt,e))&&(!(n||!h(this,e)||!h(Z,e)||h(this,L)&&this[L][e])||n)},ct=function(t,e){var n=m(t),i=g(e);if(n!==U||!h(Z,i)||h(tt,i)){var r=G(n,i);return!r||!h(Z,i)||h(n,L)&&n[L][i]||(r.enumerable=!0),r}},lt=function(t){var e=Y(m(t)),n=[];return F(e,(function(t){h(Z,t)||h(R,t)||X(n,t)})),n},ut=function(t){var e=t===U,n=Y(e?tt:m(t)),i=[];return F(n,(function(t){!h(Z,t)||e&&!h(U,t)||X(i,Z[t])})),i};l||(W=function(){if(d($,this))throw q("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?p(arguments[0]):void 0,e=O(t),n=function(t){this===U&&o(n,tt,t),h(this,L)&&h(this[L],e)&&(this[L][e]=!1),it(this,e,w(1,t))};return c&&nt&&it(U,e,{configurable:!0,set:n}),rt(e,t)},E($=W.prototype,"toString",(function(){return H(this).tag})),E(W,"withoutSetter",(function(t){return rt(O(t),t)})),C.f=at,x.f=ot,T.f=st,A.f=ct,y.f=_.f=lt,k.f=ut,M.f=function(t){return rt(I(t),t)},c&&(J($,"description",{configurable:!0,get:function(){return H(this).description}}),a||E(U,"propertyIsEnumerable",at,{unsafe:!0}))),i({global:!0,constructor:!0,wrap:!0,forced:!l,sham:!l},{Symbol:W}),F(b(et),(function(t){N(t)})),i({target:z,stat:!0,forced:!l},{useSetter:function(){nt=!0},useSimple:function(){nt=!1}}),i({target:"Object",stat:!0,forced:!l,sham:!c},{create:function(t,e){return void 0===e?v(t):st(v(t),e)},defineProperty:ot,defineProperties:st,getOwnPropertyDescriptor:ct}),i({target:"Object",stat:!0,forced:!l},{getOwnPropertyNames:lt}),V(),D(W,z),R[L]=!0},40590:function(t,e,n){"use strict";var i=n(51605),r=n(65077),o=n(30200),s=n(30281),a=n(36490),c=n(78420),l=n(47658),u=n(95362),h=n(43610).f,d=n(84361),f=o.Symbol,m=f&&f.prototype;if(r&&c(f)&&(!("description"in m)||void 0!==f().description)){var g={},p=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:u(arguments[0]),e=l(m,this)?new f(t):void 0===t?f():f(t);return""===t&&(g[e]=!0),e};d(p,f),p.prototype=m,m.constructor=p;var w="Symbol(test)"==String(f("test")),v=s(m.toString),b=s(m.valueOf),y=/^Symbol\((.*)\)[^)]+$/,_=s("".replace),k=s("".slice);h(m,"description",{configurable:!0,get:function(){var t=b(this),e=v(t);if(a(g,t))return"";var n=w?k(e,7,-1):_(e,y,"$1");return""===n?void 0:n}}),i({global:!0,constructor:!0,forced:!0},{Symbol:p})}},3883:function(t,e,n){var i=n(51605),r=n(56492),o=n(36490),s=n(95362),a=n(50002),c=n(37957),l=a("string-to-symbol-registry"),u=a("symbol-to-string-registry");i({target:"Symbol",stat:!0,forced:!c},{for:function(t){var e=s(t);if(o(l,e))return l[e];var n=r("Symbol")(e);return l[e]=n,u[n]=e,n}})},68290:function(t,e,n){n(91272)("hasInstance")},12619:function(t,e,n){n(91272)("isConcatSpreadable")},64216:function(t,e,n){n(91272)("iterator")},63534:function(t,e,n){n(27896),n(3883),n(35245),n(30959),n(91074)},35245:function(t,e,n){var i=n(51605),r=n(36490),o=n(32328),s=n(13838),a=n(50002),c=n(37957),l=a("symbol-to-string-registry");i({target:"Symbol",stat:!0,forced:!c},{keyFor:function(t){if(!o(t))throw TypeError(s(t)+" is not a symbol");if(r(l,t))return l[t]}})},66195:function(t,e,n){n(91272)("matchAll")},2957:function(t,e,n){n(91272)("match")},64100:function(t,e,n){n(91272)("replace")},53006:function(t,e,n){n(91272)("search")},74910:function(t,e,n){n(91272)("species")},42820:function(t,e,n){n(91272)("split")},36611:function(t,e,n){var i=n(91272),r=n(28237);i("toPrimitive"),r()},49576:function(t,e,n){var i=n(56492),r=n(91272),o=n(75282);r("toStringTag"),o(i("Symbol"),"Symbol")},59747:function(t,e,n){n(91272)("unscopables")},28921:function(t,e,n){"use strict";var i=n(85343),r=n(23493),o=n(79328),s=i.aTypedArray;(0,i.exportTypedArrayMethod)("at",(function(t){var e=s(this),n=r(e),i=o(t),a=i>=0?i:n+i;return a<0||a>=n?void 0:e[a]}))},20861:function(t,e,n){"use strict";var i=n(30281),r=n(85343),o=i(n(29688)),s=r.aTypedArray;(0,r.exportTypedArrayMethod)("copyWithin",(function(t,e){return o(s(this),t,e,arguments.length>2?arguments[2]:void 0)}))},71905:function(t,e,n){"use strict";var i=n(85343),r=n(91344).every,o=i.aTypedArray;(0,i.exportTypedArrayMethod)("every",(function(t){return r(o(this),t,arguments.length>1?arguments[1]:void 0)}))},85213:function(t,e,n){"use strict";var i=n(85343),r=n(27806),o=n(3005),s=n(83062),a=n(72368),c=n(30281),l=n(92074),u=i.aTypedArray,h=i.exportTypedArrayMethod,d=c("".slice);h("fill",(function(t){var e=arguments.length;u(this);var n="Big"===d(s(this),0,3)?o(t):+t;return a(r,this,n,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)}),l((function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),1!==t})))},97182:function(t,e,n){"use strict";var i=n(85343),r=n(91344).filter,o=n(30800),s=i.aTypedArray;(0,i.exportTypedArrayMethod)("filter",(function(t){var e=r(s(this),t,arguments.length>1?arguments[1]:void 0);return o(this,e)}))},39302:function(t,e,n){"use strict";var i=n(85343),r=n(91344).findIndex,o=i.aTypedArray;(0,i.exportTypedArrayMethod)("findIndex",(function(t){return r(o(this),t,arguments.length>1?arguments[1]:void 0)}))},4973:function(t,e,n){"use strict";var i=n(85343),r=n(45582).findLastIndex,o=i.aTypedArray;(0,i.exportTypedArrayMethod)("findLastIndex",(function(t){return r(o(this),t,arguments.length>1?arguments[1]:void 0)}))},81308:function(t,e,n){"use strict";var i=n(85343),r=n(45582).findLast,o=i.aTypedArray;(0,i.exportTypedArrayMethod)("findLast",(function(t){return r(o(this),t,arguments.length>1?arguments[1]:void 0)}))},12279:function(t,e,n){"use strict";var i=n(85343),r=n(91344).find,o=i.aTypedArray;(0,i.exportTypedArrayMethod)("find",(function(t){return r(o(this),t,arguments.length>1?arguments[1]:void 0)}))},95889:function(t,e,n){n(43106)("Float32",(function(t){return function(e,n,i){return t(this,e,n,i)}}))},14758:function(t,e,n){n(43106)("Float64",(function(t){return function(e,n,i){return t(this,e,n,i)}}))},70147:function(t,e,n){"use strict";var i=n(85343),r=n(91344).forEach,o=i.aTypedArray;(0,i.exportTypedArrayMethod)("forEach",(function(t){r(o(this),t,arguments.length>1?arguments[1]:void 0)}))},36148:function(t,e,n){"use strict";var i=n(53668);(0,n(85343).exportTypedArrayStaticMethod)("from",n(22180),i)},66217:function(t,e,n){"use strict";var i=n(85343),r=n(58186).includes,o=i.aTypedArray;(0,i.exportTypedArrayMethod)("includes",(function(t){return r(o(this),t,arguments.length>1?arguments[1]:void 0)}))},97966:function(t,e,n){"use strict";var i=n(85343),r=n(58186).indexOf,o=i.aTypedArray;(0,i.exportTypedArrayMethod)("indexOf",(function(t){return r(o(this),t,arguments.length>1?arguments[1]:void 0)}))},9096:function(t,e,n){n(43106)("Int16",(function(t){return function(e,n,i){return t(this,e,n,i)}}))},47950:function(t,e,n){n(43106)("Int32",(function(t){return function(e,n,i){return t(this,e,n,i)}}))},15679:function(t,e,n){n(43106)("Int8",(function(t){return function(e,n,i){return t(this,e,n,i)}}))},35186:function(t,e,n){"use strict";var i=n(30200),r=n(92074),o=n(30281),s=n(85343),a=n(18665),c=n(31602)("iterator"),l=i.Uint8Array,u=o(a.values),h=o(a.keys),d=o(a.entries),f=s.aTypedArray,m=s.exportTypedArrayMethod,g=l&&l.prototype,p=!r((function(){g[c].call([1])})),w=!!g&&g.values&&g[c]===g.values&&"values"===g.values.name,v=function(){return u(f(this))};m("entries",(function(){return d(f(this))}),p),m("keys",(function(){return h(f(this))}),p),m("values",v,p||!w,{name:"values"}),m(c,v,p||!w,{name:"values"})},35944:function(t,e,n){"use strict";var i=n(85343),r=n(30281),o=i.aTypedArray,s=i.exportTypedArrayMethod,a=r([].join);s("join",(function(t){return a(o(this),t)}))},44787:function(t,e,n){"use strict";var i=n(85343),r=n(99070),o=n(3470),s=i.aTypedArray;(0,i.exportTypedArrayMethod)("lastIndexOf",(function(t){var e=arguments.length;return r(o,s(this),e>1?[t,arguments[1]]:[t])}))},50632:function(t,e,n){"use strict";var i=n(85343),r=n(91344).map,o=n(79601),s=i.aTypedArray;(0,i.exportTypedArrayMethod)("map",(function(t){return r(s(this),t,arguments.length>1?arguments[1]:void 0,(function(t,e){return new(o(t))(e)}))}))},66609:function(t,e,n){"use strict";var i=n(85343),r=n(53668),o=i.aTypedArrayConstructor;(0,i.exportTypedArrayStaticMethod)("of",(function(){for(var t=0,e=arguments.length,n=new(o(this))(e);e>t;)n[t]=arguments[t++];return n}),r)},14245:function(t,e,n){"use strict"
;var i=n(85343),r=n(52237).right,o=i.aTypedArray;(0,i.exportTypedArrayMethod)("reduceRight",(function(t){var e=arguments.length;return r(o(this),t,e,e>1?arguments[1]:void 0)}))},52278:function(t,e,n){"use strict";var i=n(85343),r=n(52237).left,o=i.aTypedArray;(0,i.exportTypedArrayMethod)("reduce",(function(t){var e=arguments.length;return r(o(this),t,e,e>1?arguments[1]:void 0)}))},52492:function(t,e,n){"use strict";var i=n(85343),r=i.aTypedArray,o=i.exportTypedArrayMethod,s=Math.floor;o("reverse",(function(){for(var t,e=this,n=r(e).length,i=s(n/2),o=0;o<i;)t=e[o],e[o++]=e[--n],e[n]=t;return e}))},93266:function(t,e,n){"use strict";var i=n(30200),r=n(72368),o=n(85343),s=n(23493),a=n(73720),c=n(92612),l=n(92074),u=i.RangeError,h=i.Int8Array,d=h&&h.prototype,f=d&&d.set,m=o.aTypedArray,g=o.exportTypedArrayMethod,p=!l((function(){var t=new Uint8ClampedArray(2);return r(f,t,{length:1,0:3},1),3!==t[1]})),w=p&&o.NATIVE_ARRAY_BUFFER_VIEWS&&l((function(){var t=new h(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]}));g("set",(function(t){m(this);var e=a(arguments.length>1?arguments[1]:void 0,1),n=c(t);if(p)return r(f,this,n,e);var i=this.length,o=s(n),l=0;if(o+e>i)throw u("Wrong length");for(;l<o;)this[e+l]=n[l++]}),!p||w)},37192:function(t,e,n){"use strict";var i=n(85343),r=n(79601),o=n(92074),s=n(29609),a=i.aTypedArray;(0,i.exportTypedArrayMethod)("slice",(function(t,e){for(var n=s(a(this),t,e),i=r(this),o=0,c=n.length,l=new i(c);c>o;)l[o]=n[o++];return l}),o((function(){new Int8Array(1).slice()})))},37220:function(t,e,n){"use strict";var i=n(85343),r=n(91344).some,o=i.aTypedArray;(0,i.exportTypedArrayMethod)("some",(function(t){return r(o(this),t,arguments.length>1?arguments[1]:void 0)}))},82432:function(t,e,n){"use strict";var i=n(30200),r=n(30281),o=n(92074),s=n(24601),a=n(68039),c=n(85343),l=n(3727),u=n(77413),h=n(6845),d=n(79965),f=c.aTypedArray,m=c.exportTypedArrayMethod,g=i.Uint16Array,p=g&&r(g.prototype.sort),w=!(!p||o((function(){p(new g(2),null)}))&&o((function(){p(new g(2),{})}))),v=!!p&&!o((function(){if(h)return h<74;if(l)return l<67;if(u)return!0;if(d)return d<602;var t,e,n=new g(516),i=Array(516);for(t=0;t<516;t++)e=t%4,n[t]=515-t,i[t]=t-2*e+3;for(p(n,(function(t,e){return(t/4|0)-(e/4|0)})),t=0;t<516;t++)if(n[t]!==i[t])return!0}));m("sort",(function(t){return void 0!==t&&s(t),v?p(this,t):a(f(this),function(t){return function(e,n){return void 0!==t?+t(e,n)||0:n!=n?-1:e!=e?1:0===e&&0===n?1/e>0&&1/n<0?1:-1:e>n}}(t))}),!v||w)},32483:function(t,e,n){"use strict";var i=n(85343),r=n(33747),o=n(6539),s=n(79601),a=i.aTypedArray;(0,i.exportTypedArrayMethod)("subarray",(function(t,e){var n=a(this),i=n.length,c=o(t,i);return new(s(n))(n.buffer,n.byteOffset+c*n.BYTES_PER_ELEMENT,r((void 0===e?i:o(e,i))-c))}))},36696:function(t,e,n){"use strict";var i=n(30200),r=n(99070),o=n(85343),s=n(92074),a=n(29609),c=i.Int8Array,l=o.aTypedArray,u=o.exportTypedArrayMethod,h=[].toLocaleString,d=!!c&&s((function(){h.call(new c(1))}));u("toLocaleString",(function(){return r(h,d?a(l(this)):l(this),a(arguments))}),s((function(){return[1,2].toLocaleString()!=new c([1,2]).toLocaleString()}))||!s((function(){c.prototype.toLocaleString.call([1,2])})))},58083:function(t,e,n){"use strict";var i=n(85343).exportTypedArrayMethod,r=n(92074),o=n(30200),s=n(30281),a=o.Uint8Array,c=a&&a.prototype||{},l=[].toString,u=s([].join);r((function(){l.call({})}))&&(l=function(){return u(this)});var h=c.toString!=l;i("toString",l,h)},46395:function(t,e,n){n(43106)("Uint16",(function(t){return function(e,n,i){return t(this,e,n,i)}}))},52357:function(t,e,n){n(43106)("Uint32",(function(t){return function(e,n,i){return t(this,e,n,i)}}))},53746:function(t,e,n){n(43106)("Uint8",(function(t){return function(e,n,i){return t(this,e,n,i)}}))},9513:function(t,e,n){n(43106)("Uint8",(function(t){return function(e,n,i){return t(this,e,n,i)}}),!0)},20898:function(t,e,n){"use strict";var i=n(51605),r=n(30281),o=n(95362),s=String.fromCharCode,a=r("".charAt),c=r(/./.exec),l=r("".slice),u=/^[\da-f]{2}$/i,h=/^[\da-f]{4}$/i;i({global:!0},{unescape:function(t){for(var e,n,i=o(t),r="",d=i.length,f=0;f<d;){if("%"===(e=a(i,f++)))if("u"===a(i,f)){if(n=l(i,f+1,f+5),c(h,n)){r+=s(parseInt(n,16)),f+=5;continue}}else if(n=l(i,f,f+2),c(u,n)){r+=s(parseInt(n,16)),f+=2;continue}r+=e}return r}})},13811:function(t,e,n){"use strict";var i,r=n(30200),o=n(30281),s=n(92760),a=n(82014),c=n(92327),l=n(76784),u=n(65335),h=n(40111),d=n(99206).enforce,f=n(82886),m=!r.ActiveXObject&&"ActiveXObject"in r,g=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},p=c("WeakMap",g,l);if(f&&m){i=l.getConstructor(g,"WeakMap",!0),a.enable();var w=p.prototype,v=o(w.delete),b=o(w.has),y=o(w.get),_=o(w.set);s(w,{delete:function(t){if(u(t)&&!h(t)){var e=d(this);return e.frozen||(e.frozen=new i),v(this,t)||e.frozen.delete(t)}return v(this,t)},has:function(t){if(u(t)&&!h(t)){var e=d(this);return e.frozen||(e.frozen=new i),b(this,t)||e.frozen.has(t)}return b(this,t)},get:function(t){if(u(t)&&!h(t)){var e=d(this);return e.frozen||(e.frozen=new i),b(this,t)?y(this,t):e.frozen.get(t)}return y(this,t)},set:function(t,e){if(u(t)&&!h(t)){var n=d(this);n.frozen||(n.frozen=new i),b(this,t)?_(this,t,e):n.frozen.set(t,e)}else _(this,t,e);return this}})}},10121:function(t,e,n){n(13811)},27373:function(t,e,n){"use strict";n(92327)("WeakSet",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),n(76784))},70863:function(t,e,n){n(27373)},69858:function(t,e,n){var i=n(51605),r=n(56492),o=n(30281),s=n(92074),a=n(95362),c=n(36490),l=n(56589),u=n(71787).ctoi,h=/[^\d+/a-z]/i,d=/[\t\n\f\r ]+/g,f=/[=]+$/,m=r("atob"),g=String.fromCharCode,p=o("".charAt),w=o("".replace),v=o(h.exec),b=s((function(){return""!==m(" ")})),y=!s((function(){m("a")})),_=!b&&!y&&!s((function(){m()})),k=!b&&!y&&1!==m.length;i({global:!0,enumerable:!0,forced:b||y||_||k},{atob:function(t){if(l(arguments.length,1),_||k)return m(t);var e,n,i=w(a(t),d,""),o="",s=0,b=0;if(i.length%4==0&&(i=w(i,f,"")),i.length%4==1||v(h,i))throw new(r("DOMException"))("The string is not correctly encoded","InvalidCharacterError");for(;e=p(i,s++);)c(u,e)&&(n=b%4?64*n+u[e]:u[e],b++%4&&(o+=g(255&n>>(-2*b&6))));return o}})},54072:function(t,e,n){var i=n(51605),r=n(56492),o=n(30281),s=n(92074),a=n(95362),c=n(56589),l=n(71787).itoc,u=r("btoa"),h=o("".charAt),d=o("".charCodeAt),f=!!u&&!s((function(){u()})),m=!!u&&s((function(){return"bnVsbA=="!==u(null)})),g=!!u&&1!==u.length;i({global:!0,enumerable:!0,forced:f||m||g},{btoa:function(t){if(c(arguments.length,1),f||m||g)return u(a(t));for(var e,n,i=a(t),o="",s=0,p=l;h(i,s)||(p="=",s%1);){if((n=d(i,s+=3/4))>255)throw new(r("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");o+=h(p,63&(e=e<<8|n)>>8-s%1*8)}return o}})},61857:function(t,e,n){var i=n(51605),r=n(30200),o=n(74922).clear;i({global:!0,bind:!0,enumerable:!0,forced:r.clearImmediate!==o},{clearImmediate:o})},58379:function(t,e,n){var i=n(30200),r=n(5549),o=n(22975),s=n(10516),a=n(97712),c=function(t){if(t&&t.forEach!==s)try{a(t,"forEach",s)}catch(e){t.forEach=s}};for(var l in r)r[l]&&c(i[l]&&i[l].prototype);c(o)},14602:function(t,e,n){var i=n(30200),r=n(5549),o=n(22975),s=n(18665),a=n(97712),c=n(31602),l=c("iterator"),u=c("toStringTag"),h=s.values,d=function(t,e){if(t){if(t[l]!==h)try{a(t,l,h)}catch(e){t[l]=h}if(t[u]||a(t,u,e),r[e])for(var n in s)if(t[n]!==s[n])try{a(t,n,s[n])}catch(e){t[n]=s[n]}}};for(var f in r)d(i[f]&&i[f].prototype,f);d(o,"DOMTokenList")},54754:function(t,e,n){"use strict";var i=n(51605),r=n(92785),o=n(56492),s=n(92074),a=n(53105),c=n(66843),l=n(43610).f,u=n(7485),h=n(76477),d=n(36490),f=n(65190),m=n(73938),g=n(73353),p=n(20610),w=n(26567),v=n(26820),b=n(99206),y=n(65077),_=n(6926),k="DOMException",A="DATA_CLONE_ERR",x=o("Error"),T=o(k)||function(){try{(new(o("MessageChannel")||r("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(t){if(t.name==A&&25==t.code)return t.constructor}}(),C=T&&T.prototype,E=x.prototype,S=b.set,P=b.getterFor(k),R="stack"in x(k),O=function(t){return d(w,t)&&w[t].m?w[t].c:0},I=function(){f(this,M);var t=arguments.length,e=p(t<1?void 0:arguments[0]),n=p(t<2?void 0:arguments[1],"Error"),i=O(n);if(S(this,{type:k,name:n,message:e,code:i}),y||(this.name=n,this.message=e,this.code=i),R){var r=x(e);r.name=k,l(this,"stack",c(1,v(r.stack,1)))}},M=I.prototype=a(E),N=function(t){return{enumerable:!0,configurable:!0,get:t}},V=function(t){return N((function(){return P(this)[t]}))};y&&(h(M,"code",V("code")),h(M,"message",V("message")),h(M,"name",V("name"))),l(M,"constructor",c(1,I));var D=s((function(){return!(new T instanceof x)})),B=D||s((function(){return E.toString!==g||"2: 1"!==String(new T(1,2))})),F=D||s((function(){return 25!==new T(1,"DataCloneError").code})),L=D||25!==T.DATA_CLONE_ERR||25!==C.DATA_CLONE_ERR,z=_?B||F||L:D;i({global:!0,constructor:!0,forced:z},{DOMException:z?I:T});var j=o(k),H=j.prototype;for(var U in B&&(_||T===j)&&u(H,"toString",g),F&&y&&T===j&&h(H,"code",N((function(){return O(m(this).name)}))),w)if(d(w,U)){var W=w[U],$=W.s,q=c(6,W.c);d(j,$)||l(j,$,q),d(H,$)||l(H,$,q)}},99078:function(t,e,n){"use strict";var i=n(51605),r=n(30200),o=n(56492),s=n(66843),a=n(43610).f,c=n(36490),l=n(65190),u=n(93054),h=n(20610),d=n(26567),f=n(26820),m=n(65077),g=n(6926),p="DOMException",w=o("Error"),v=o(p),b=function(){l(this,y);var t=arguments.length,e=h(t<1?void 0:arguments[0]),n=h(t<2?void 0:arguments[1],"Error"),i=new v(e,n),r=w(e);return r.name=p,a(i,"stack",s(1,f(r.stack,1))),u(i,this,b),i},y=b.prototype=v.prototype,_="stack"in w(p),k="stack"in new v(1,2),A=v&&m&&Object.getOwnPropertyDescriptor(r,p),x=!(!A||A.writable&&A.configurable),T=_&&!x&&!k;i({global:!0,constructor:!0,forced:g||T},{DOMException:T?b:v});var C=o(p),E=C.prototype;if(E.constructor!==C)for(var S in g||a(E,"constructor",s(1,C)),d)if(c(d,S)){var P=d[S],R=P.s;c(C,R)||a(C,R,s(6,P.c))}},91954:function(t,e,n){var i=n(56492),r="DOMException";n(75282)(i(r),r)},75417:function(t,e,n){n(61857),n(19708)},85183:function(t,e,n){var i=n(51605),r=n(30200),o=n(47462),s=n(24601),a=n(56589),c=n(75223),l=r.process;i({global:!0,enumerable:!0,dontCallGetSet:!0},{queueMicrotask:function(t){a(arguments.length,1),s(t);var e=c&&l.domain;o(e?e.bind(t):t)}})},19708:function(t,e,n){var i=n(51605),r=n(30200),o=n(74922).set;i({global:!0,bind:!0,enumerable:!0,forced:r.setImmediate!==o},{setImmediate:o})},62776:function(t,e,n){var i=n(51605),r=n(30200),o=n(18827).setInterval;i({global:!0,bind:!0,forced:r.setInterval!==o},{setInterval:o})},40538:function(t,e,n){var i=n(51605),r=n(30200),o=n(18827).setTimeout;i({global:!0,bind:!0,forced:r.setTimeout!==o},{setTimeout:o})},26413:function(t,e,n){var i,r=n(6926),o=n(51605),s=n(30200),a=n(56492),c=n(30281),l=n(92074),u=n(50665),h=n(78420),d=n(1466),f=n(65335),m=n(32328),g=n(52929),p=n(73938),w=n(83062),v=n(36490),b=n(52057),y=n(97712),_=n(23493),k=n(56589),A=n(10353),x=n(70462),T=n(6845),C=n(60904),E=n(20419),S=n(75223),P=s.Object,R=s.Date,O=s.Error,I=s.EvalError,M=s.RangeError,N=s.ReferenceError,V=s.SyntaxError,D=s.TypeError,B=s.URIError,F=s.PerformanceMark,L=s.WebAssembly,z=L&&L.CompileError||O,j=L&&L.LinkError||O,H=L&&L.RuntimeError||O,U=a("DOMException"),W=a("Set"),$=a("Map"),q=$.prototype,K=c(q.has),G=c(q.get),J=c(q.set),Y=c(W.prototype.add),Q=a("Object","keys"),X=c([].push),Z=c((!0).valueOf),tt=c(1..valueOf),et=c("".valueOf),nt=c(R.prototype.getTime),it=u("structuredClone"),rt="DataCloneError",ot="Transferring",st=function(t){return!l((function(){var e=new s.Set([7]),n=t(e),i=t(P(7));return n==e||!n.has(7)||"object"!=typeof i||7!=i}))&&t},at=function(t,e){return!l((function(){var n=new e,i=t({a:n,b:n});return!(i&&i.a===i.b&&i.a instanceof e&&i.a.stack===n.stack)}))},ct=s.structuredClone,lt=r||!at(ct,O)||!at(ct,U)||(i=ct,!!l((function(){var t=i(new s.AggregateError([1],it,{cause:3}));return"AggregateError"!=t.name||1!=t.errors[0]||t.message!=it||3!=t.cause}))),ut=!ct&&st((function(t){return new F(it,{detail:t}).detail})),ht=st(ct)||ut,dt=function(t){throw new U("Uncloneable type: "+t,rt)},ft=function(t,e){throw new U((e||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",rt)},mt=function(t,e){if(m(t)&&dt("Symbol"),!f(t))return t;if(e){if(K(e,t))return G(e,t)}else e=new $;var n,i,r,o,c,l,u,g,p,k,T=w(t),C=!1;switch(T){case"Array":r=[],C=!0;break;case"Object":r={},C=!0;break;case"Map":r=new $,C=!0;break;case"Set":r=new W,C=!0;break;case"RegExp":r=new RegExp(t.source,A(t));break;case"Error":switch(i=t.name){case"AggregateError":r=a("AggregateError")([]);break;case"EvalError":r=I();break;case"RangeError":r=M();break;case"ReferenceError":r=N();break;case"SyntaxError":r=V();break;case"TypeError":r=D();break;case"URIError":r=B();break;case"CompileError":r=z();break;case"LinkError":r=j();break;case"RuntimeError":r=H();break;default:r=O()}C=!0;break;case"DOMException":r=new U(t.message,t.name),C=!0;break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":n=s[T],f(n)||ft(T),r=new n(mt(t.buffer,e),t.byteOffset,"DataView"===T?t.byteLength:t.length);break;case"DOMQuad":try{r=new DOMQuad(mt(t.p1,e),mt(t.p2,e),mt(t.p3,e),mt(t.p4,e))}catch(e){ht?r=ht(t):ft(T)}break;case"FileList":if(n=s.DataTransfer,d(n)){for(o=new n,c=0,l=_(t);c<l;c++)o.items.add(mt(t[c],e));r=o.files}else ht?r=ht(t):ft(T);break;case"ImageData":try{r=new ImageData(mt(t.data,e),t.width,t.height,{colorSpace:t.colorSpace})}catch(e){ht?r=ht(t):ft(T)}break;default:if(ht)r=ht(t);else switch(T){case"BigInt":r=P(t.valueOf());break;case"Boolean":r=P(Z(t));break;case"Number":r=P(tt(t));break;case"String":r=P(et(t));break;case"Date":r=new R(nt(t));break;case"ArrayBuffer":(n=s.DataView)||"function"==typeof t.slice||ft(T);try{if("function"==typeof t.slice)r=t.slice(0);else for(l=t.byteLength,r=new ArrayBuffer(l),p=new n(t),k=new n(r),c=0;c<l;c++)k.setUint8(c,p.getUint8(c))}catch(t){throw new U("ArrayBuffer is detached",rt)}break;case"SharedArrayBuffer":r=t;break;case"Blob":try{r=t.slice(0,t.size,t.type)}catch(t){ft(T)}break;case"DOMPoint":case"DOMPointReadOnly":n=s[T];try{r=n.fromPoint?n.fromPoint(t):new n(t.x,t.y,t.z,t.w)}catch(t){ft(T)}break;case"DOMRect":case"DOMRectReadOnly":n=s[T];try{r=n.fromRect?n.fromRect(t):new n(t.x,t.y,t.width,t.height)}catch(t){ft(T)}break;case"DOMMatrix":case"DOMMatrixReadOnly":n=s[T];try{r=n.fromMatrix?n.fromMatrix(t):new n(t)}catch(t){ft(T)}break;case"AudioData":case"VideoFrame":h(t.clone)||ft(T);try{r=t.clone()}catch(t){dt(T)}break;case"File":try{r=new File([t],t.name,t)}catch(t){ft(T)}break;case"CryptoKey":case"GPUCompilationMessage":case"GPUCompilationInfo":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":ft(T);default:dt(T)}}if(J(e,t,r),C)switch(T){case"Array":case"Object":for(u=Q(t),c=0,l=_(u);c<l;c++)g=u[c],b(r,g,mt(t[g],e));break;case"Map":t.forEach((function(t,n){J(r,mt(n,e),mt(t,e))}));break;case"Set":t.forEach((function(t){Y(r,mt(t,e))}));break;case"Error":y(r,"message",mt(t.message,e)),v(t,"cause")&&y(r,"cause",mt(t.cause,e)),"AggregateError"==i&&(r.errors=mt(t.errors,e));case"DOMException":x&&y(r,"stack",mt(t.stack,e))}return r},gt=ct&&!l((function(){if(E&&T>92||S&&T>94||C&&T>97)return!1;var t=new ArrayBuffer(8),e=ct(t,{transfer:[t]});return 0!=t.byteLength||8!=e.byteLength})),pt=function(t,e){if(!f(t))throw D("Transfer option cannot be converted to a sequence");var n=[];g(t,(function(t){X(n,p(t))}));var i,r,o,a,c,l,u=0,m=_(n);if(gt)for(a=ct(n,{transfer:n});u<m;)J(e,n[u],a[u++]);else for(;u<m;){if(i=n[u++],K(e,i))throw new U("Duplicate transferable",rt);switch(r=w(i)){case"ImageBitmap":o=s.OffscreenCanvas,d(o)||ft(r,ot);try{(l=new o(i.width,i.height)).getContext("bitmaprenderer").transferFromImageBitmap(i),c=l.transferToImageBitmap()}catch(t){}break;case"AudioData":case"VideoFrame":h(i.clone)&&h(i.close)||ft(r,ot);try{c=i.clone(),i.close()}catch(t){}break;case"ArrayBuffer":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":ft(r,ot)}if(void 0===c)throw new U("This object cannot be transferred: "+r,rt);J(e,i,c)}};o({global:!0,enumerable:!0,sham:!gt,forced:lt},{structuredClone:function(t){var e,n=k(arguments.length,1)>1&&null!=arguments[1]?p(arguments[1]):void 0,i=n?n.transfer:void 0;return void 0!==i&&(e=new $,pt(i,e)),mt(t,e)}})},18772:function(t,e,n){n(62776),n(40538)},77895:function(t,e,n){"use strict";n(18665);var i=n(51605),r=n(30200),o=n(72368),s=n(30281),a=n(65077),c=n(84516),l=n(7485),u=n(92760),h=n(75282),d=n(72147),f=n(99206),m=n(65190),g=n(78420),p=n(36490),w=n(46885),v=n(83062),b=n(73938),y=n(65335),_=n(95362),k=n(53105),A=n(66843),x=n(79526),T=n(51898),C=n(56589),E=n(31602),S=n(68039),P=E("iterator"),R="URLSearchParams",O="URLSearchParamsIterator",I=f.set,M=f.getterFor(R),N=f.getterFor(O),V=Object.getOwnPropertyDescriptor,D=function(t){if(!a)return r[t];var e=V(r,t);return e&&e.value},B=D("fetch"),F=D("Request"),L=D("Headers"),z=F&&F.prototype,j=L&&L.prototype,H=r.RegExp,U=r.TypeError,W=r.decodeURIComponent,$=r.encodeURIComponent,q=s("".charAt),K=s([].join),G=s([].push),J=s("".replace),Y=s([].shift),Q=s([].splice),X=s("".split),Z=s("".slice),tt=/\+/g,et=Array(4),nt=function(t){return et[t-1]||(et[t-1]=H("((?:%[\\da-f]{2}){"+t+"})","gi"))},it=function(t){try{return W(t)}catch(e){return t}},rt=function(t){var e=J(t,tt," "),n=4;try{return W(e)}catch(t){for(;n;)e=J(e,nt(n--),it);return e}},ot=/[!'()~]|%20/g,st={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},at=function(t){return st[t]},ct=function(t){return J($(t),ot,at)},lt=d((function(t,e){I(this,{type:O,iterator:x(M(t).entries),kind:e})}),"Iterator",(function(){var t=N(this),e=t.kind,n=t.iterator.next(),i=n.value;return n.done||(n.value="keys"===e?i.key:"values"===e?i.value:[i.key,i.value]),n}),!0),ut=function(t){this.entries=[],this.url=null,void 0!==t&&(y(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===q(t,0)?Z(t,1):t:_(t)))};ut.prototype={type:R,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e,n,i,r,s,a,c,l=T(t);if(l)for(n=(e=x(t,l)).next;!(i=o(n,e)).done;){if(s=(r=x(b(i.value))).next,(a=o(s,r)).done||(c=o(s,r)).done||!o(s,r).done)throw U("Expected sequence with length 2");G(this.entries,{key:_(a.value),value:_(c.value)})}else for(var u in t)p(t,u)&&G(this.entries,{key:u,value:_(t[u])})},parseQuery:function(t){if(t)for(var e,n,i=X(t,"&"),r=0;r<i.length;)(e=i[r++]).length&&(n=X(e,"="),G(this.entries,{key:rt(Y(n)),value:rt(K(n,"="))}))},serialize:function(){for(var t,e=this.entries,n=[],i=0;i<e.length;)t=e[i++],G(n,ct(t.key)+"="+ct(t.value));return K(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ht=function(){m(this,dt);var t=arguments.length>0?arguments[0]:void 0;I(this,new ut(t))},dt=ht.prototype;if(u(dt,{append:function(t,e){C(arguments.length,2);var n=M(this);G(n.entries,{key:_(t),value:_(e)}),n.updateURL()},delete:function(t){C(arguments.length,1);for(var e=M(this),n=e.entries,i=_(t),r=0;r<n.length;)n[r].key===i?Q(n,r,1):r++;e.updateURL()},get:function(t){C(arguments.length,1);for(var e=M(this).entries,n=_(t),i=0;i<e.length;i++)if(e[i].key===n)return e[i].value;return null},getAll:function(t){C(arguments.length,1);for(var e=M(this).entries,n=_(t),i=[],r=0;r<e.length;r++)e[r].key===n&&G(i,e[r].value);return i},has:function(t){C(arguments.length,1);for(var e=M(this).entries,n=_(t),i=0;i<e.length;)if(e[i++].key===n)return!0;return!1},set:function(t,e){C(arguments.length,1);for(var n,i=M(this),r=i.entries,o=!1,s=_(t),a=_(e),c=0;c<r.length;c++)(n=r[c]).key===s&&(o?Q(r,c--,1):(o=!0,n.value=a));o||G(r,{key:s,value:a}),i.updateURL()},sort:function(){var t=M(this);S(t.entries,(function(t,e){return t.key>e.key?1:-1})),t.updateURL()},forEach:function(t){for(var e,n=M(this).entries,i=w(t,arguments.length>1?arguments[1]:void 0),r=0;r<n.length;)i((e=n[r++]).value,e.key,this)},keys:function(){return new lt(this,"keys")},values:function(){return new lt(this,"values")},entries:function(){return new lt(this,"entries")}},{enumerable:!0}),l(dt,P,dt.entries,{name:"entries"}),l(dt,"toString",(function(){return M(this).serialize()}),{enumerable:!0}),h(ht,R),i({global:!0,constructor:!0,forced:!c},{URLSearchParams:ht}),!c&&g(L)){var ft=s(j.has),mt=s(j.set),gt=function(t){if(y(t)){var e,n=t.body;if(v(n)===R)return e=t.headers?new L(t.headers):new L,ft(e,"content-type")||mt(e,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),k(t,{body:A(0,_(n)),headers:A(0,e)})}return t};if(g(B)&&i({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return B(t,arguments.length>1?gt(arguments[1]):{})}}),g(F)){var pt=function(t){return m(this,z),new F(t,arguments.length>1?gt(arguments[1]):{})};z.constructor=pt,pt.prototype=z,i({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:pt})}}t.exports={URLSearchParams:ht,getState:M}},60933:function(t,e,n){n(77895)},55847:function(t,e,n){"use strict";n(29979);var i,r=n(51605),o=n(65077),s=n(84516),a=n(30200),c=n(46885),l=n(30281),u=n(7485),h=n(76477),d=n(65190),f=n(36490),m=n(81688),g=n(51027),p=n(76056),w=n(77804).codeAt,v=n(83150),b=n(95362),y=n(75282),_=n(56589),k=n(77895),A=n(99206),x=A.set,T=A.getterFor("URL"),C=k.URLSearchParams,E=k.getState,S=a.URL,P=a.TypeError,R=a.parseInt,O=Math.floor,I=Math.pow,M=l("".charAt),N=l(/./.exec),V=l([].join),D=l(1..toString),B=l([].pop),F=l([].push),L=l("".replace),z=l([].shift),j=l("".split),H=l("".slice),U=l("".toLowerCase),W=l([].unshift),$="Invalid scheme",q="Invalid host",K="Invalid port",G=/[a-z]/i,J=/[\d+-.a-z]/i,Y=/\d/,Q=/^0x/i,X=/^[0-7]+$/,Z=/^\d+$/,tt=/^[\da-f]+$/i,et=/[\0\t\n\r #%/:<>?@[\\\]^|]/,nt=/[\0\t\n\r #/:<>?@[\\\]^|]/,it=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,rt=/[\t\n\r]/g,ot=function(t){var e,n,i,r;if("number"==typeof t){for(e=[],n=0;n<4;n++)W(e,t%256),t=O(t/256);return V(e,".")}if("object"==typeof t){for(e="",i=function(t){for(var e=null,n=1,i=null,r=0,o=0;o<8;o++)0!==t[o]?(r>n&&(e=i,n=r),i=null,r=0):(null===i&&(i=o),++r);return r>n&&(e=i,n=r),e}(t),n=0;n<8;n++)r&&0===t[n]||(r&&(r=!1),i===n?(e+=n?":":"::",r=!0):(e+=D(t[n],16),n<7&&(e+=":")));return"["+e+"]"}return t},st={},at=m({},st,{" ":1,'"':1,"<":1,">":1,"`":1}),ct=m({},at,{"#":1,"?":1,"{":1,"}":1}),lt=m({},ct,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ut=function(t,e){var n=w(t,0);return n>32&&n<127&&!f(e,t)?t:encodeURIComponent(t)},ht={ftp:21,file:null,http:80,https:443,ws:80,wss:443},dt=function(t,e){var n;return 2==t.length&&N(G,M(t,0))&&(":"==(n=M(t,1))||!e&&"|"==n)},ft=function(t){var e;return t.length>1&&dt(H(t,0,2))&&(2==t.length||"/"===(e=M(t,2))||"\\"===e||"?"===e||"#"===e)},mt=function(t){return"."===t||"%2e"===U(t)},gt={},pt={},wt={},vt={},bt={},yt={},_t={},kt={},At={},xt={},Tt={},Ct={},Et={},St={},Pt={},Rt={},Ot={},It={},Mt={},Nt={},Vt={},Dt=function(t,e,n){var i,r,o,s=b(t);if(e){if(r=this.parse(s))throw P(r);this.searchParams=null}else{if(void 0!==n&&(i=new Dt(n,!0)),r=this.parse(s,null,i))throw P(r);(o=E(new C)).bindURL(this),this.searchParams=o}};Dt.prototype={type:"URL",parse:function(t,e,n){var r,o,s,a,c,l=this,u=e||gt,h=0,d="",m=!1,w=!1,v=!1;for(t=b(t),e||(l.scheme="",l.username="",l.password="",l.host=null,l.port=null,l.path=[],l.query=null,l.fragment=null,l.cannotBeABaseURL=!1,t=L(t,it,"")),t=L(t,rt,""),r=g(t);h<=r.length;){switch(o=r[h],u){case gt:if(!o||!N(G,o)){if(e)return $;u=wt;continue}d+=U(o),u=pt;break;case pt:if(o&&(N(J,o)||"+"==o||"-"==o||"."==o))d+=U(o);else{if(":"!=o){if(e)return $;d="",u=wt,h=0;continue}if(e&&(l.isSpecial()!=f(ht,d)||"file"==d&&(l.includesCredentials()||null!==l.port)||"file"==l.scheme&&!l.host))return;if(l.scheme=d,e)return void(l.isSpecial()&&ht[l.scheme]==l.port&&(l.port=null));d="","file"==l.scheme?u=St:l.isSpecial()&&n&&n.scheme==l.scheme?u=vt:l.isSpecial()?u=kt:"/"==r[h+1]?(u=bt,h++):(l.cannotBeABaseURL=!0,F(l.path,""),u=Mt)}break;case wt:if(!n||n.cannotBeABaseURL&&"#"!=o)return $;if(n.cannotBeABaseURL&&"#"==o){l.scheme=n.scheme,l.path=p(n.path),l.query=n.query,l.fragment="",l.cannotBeABaseURL=!0,u=Vt;break}u="file"==n.scheme?St:yt;continue;case vt:if("/"!=o||"/"!=r[h+1]){u=yt;continue}u=At,h++;break;case bt:if("/"==o){u=xt;break}u=It;continue;case yt:if(l.scheme=n.scheme,o==i)l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=p(n.path),l.query=n.query;else if("/"==o||"\\"==o&&l.isSpecial())u=_t;else if("?"==o)l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=p(n.path),l.query="",u=Nt;else{if("#"!=o){l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=p(n.path),l.path.length--,u=It;continue}l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=p(n.path),l.query=n.query,l.fragment="",u=Vt}break;case _t:if(!l.isSpecial()||"/"!=o&&"\\"!=o){if("/"!=o){l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,u=It;continue}u=xt}else u=At;break;case kt:if(u=At,"/"!=o||"/"!=M(d,h+1))continue;h++;break;case At:if("/"!=o&&"\\"!=o){u=xt;continue}break;case xt:if("@"==o){m&&(d="%40"+d),m=!0,s=g(d);for(var y=0;y<s.length;y++){var _=s[y];if(":"!=_||v){var k=ut(_,lt);v?l.password+=k:l.username+=k}else v=!0}d=""}else if(o==i||"/"==o||"?"==o||"#"==o||"\\"==o&&l.isSpecial()){if(m&&""==d)return"Invalid authority";h-=g(d).length+1,d="",u=Tt}else d+=o;break;case Tt:case Ct:if(e&&"file"==l.scheme){u=Rt;continue}if(":"!=o||w){if(o==i||"/"==o||"?"==o||"#"==o||"\\"==o&&l.isSpecial()){if(l.isSpecial()&&""==d)return q;if(e&&""==d&&(l.includesCredentials()||null!==l.port))return;if(a=l.parseHost(d))return a;if(d="",u=Ot,e)return;continue}"["==o?w=!0:"]"==o&&(w=!1),d+=o}else{if(""==d)return q;if(a=l.parseHost(d))return a;if(d="",u=Et,e==Ct)return}break;case Et:if(!N(Y,o)){if(o==i||"/"==o||"?"==o||"#"==o||"\\"==o&&l.isSpecial()||e){if(""!=d){var A=R(d,10);if(A>65535)return K;l.port=l.isSpecial()&&A===ht[l.scheme]?null:A,d=""}if(e)return;u=Ot;continue}return K}d+=o;break;case St:if(l.scheme="file","/"==o||"\\"==o)u=Pt;else{if(!n||"file"!=n.scheme){u=It;continue}if(o==i)l.host=n.host,l.path=p(n.path),l.query=n.query;else if("?"==o)l.host=n.host,l.path=p(n.path),l.query="",u=Nt;else{if("#"!=o){ft(V(p(r,h),""))||(l.host=n.host,l.path=p(n.path),l.shortenPath()),u=It;continue}l.host=n.host,l.path=p(n.path),l.query=n.query,l.fragment="",u=Vt}}break;case Pt:if("/"==o||"\\"==o){u=Rt;break}n&&"file"==n.scheme&&!ft(V(p(r,h),""))&&(dt(n.path[0],!0)?F(l.path,n.path[0]):l.host=n.host),u=It;continue;case Rt:if(o==i||"/"==o||"\\"==o||"?"==o||"#"==o){if(!e&&dt(d))u=It;else if(""==d){if(l.host="",e)return;u=Ot}else{if(a=l.parseHost(d))return a;if("localhost"==l.host&&(l.host=""),e)return;d="",u=Ot}continue}d+=o;break;case Ot:if(l.isSpecial()){if(u=It,"/"!=o&&"\\"!=o)continue}else if(e||"?"!=o)if(e||"#"!=o){if(o!=i&&(u=It,"/"!=o))continue}else l.fragment="",u=Vt;else l.query="",u=Nt;break;case It:if(o==i||"/"==o||"\\"==o&&l.isSpecial()||!e&&("?"==o||"#"==o)){if(".."===(c=U(c=d))||"%2e."===c||".%2e"===c||"%2e%2e"===c?(l.shortenPath(),"/"==o||"\\"==o&&l.isSpecial()||F(l.path,"")):mt(d)?"/"==o||"\\"==o&&l.isSpecial()||F(l.path,""):("file"==l.scheme&&!l.path.length&&dt(d)&&(l.host&&(l.host=""),d=M(d,0)+":"),F(l.path,d)),d="","file"==l.scheme&&(o==i||"?"==o||"#"==o))for(;l.path.length>1&&""===l.path[0];)z(l.path);"?"==o?(l.query="",u=Nt):"#"==o&&(l.fragment="",u=Vt)}else d+=ut(o,ct);break;case Mt:"?"==o?(l.query="",u=Nt):"#"==o?(l.fragment="",u=Vt):o!=i&&(l.path[0]+=ut(o,st));break;case Nt:e||"#"!=o?o!=i&&("'"==o&&l.isSpecial()?l.query+="%27":l.query+="#"==o?"%23":ut(o,st)):(l.fragment="",u=Vt);break;case Vt:o!=i&&(l.fragment+=ut(o,at))}h++}},parseHost:function(t){var e,n,i;if("["==M(t,0)){if("]"!=M(t,t.length-1))return q;if(e=function(t){var e,n,i,r,o,s,a,c=[0,0,0,0,0,0,0,0],l=0,u=null,h=0,d=function(){return M(t,h)};if(":"==d()){if(":"!=M(t,1))return;h+=2,u=++l}for(;d();){if(8==l)return;if(":"!=d()){for(e=n=0;n<4&&N(tt,d());)e=16*e+R(d(),16),h++,n++;if("."==d()){if(0==n)return;if(h-=n,l>6)return;for(i=0;d();){if(r=null,i>0){if(!("."==d()&&i<4))return;h++}if(!N(Y,d()))return;for(;N(Y,d());){if(o=R(d(),10),null===r)r=o;else{if(0==r)return;r=10*r+o}if(r>255)return;h++}c[l]=256*c[l]+r,2!=++i&&4!=i||l++}if(4!=i)return;break}if(":"==d()){if(h++,!d())return}else if(d())return;c[l++]=e}else{if(null!==u)return;h++,u=++l}}if(null!==u)for(s=l-u,l=7;0!=l&&s>0;)a=c[l],c[l--]=c[u+s-1],c[u+--s]=a;else if(8!=l)return;return c}(H(t,1,-1)),!e)return q;this.host=e}else if(this.isSpecial()){if(t=v(t),N(et,t))return q;if(e=function(t){var e,n,i,r,o,s,a,c=j(t,".");if(c.length&&""==c[c.length-1]&&c.length--,(e=c.length)>4)return t;for(n=[],i=0;i<e;i++){if(""==(r=c[i]))return t;if(o=10,r.length>1&&"0"==M(r,0)&&(o=N(Q,r)?16:8,r=H(r,8==o?1:2)),""===r)s=0;else{if(!N(10==o?Z:8==o?X:tt,r))return t;s=R(r,o)}F(n,s)}for(i=0;i<e;i++)if(s=n[i],i==e-1){if(s>=I(256,5-e))return null}else if(s>255)return null;for(a=B(n),i=0;i<n.length;i++)a+=n[i]*I(256,3-i);return a}(t),null===e)return q;this.host=e}else{if(N(nt,t))return q;for(e="",n=g(t),i=0;i<n.length;i++)e+=ut(n[i],st);this.host=e}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return f(ht,this.scheme)},shortenPath:function(){var t=this.path,e=t.length;!e||"file"==this.scheme&&1==e&&dt(t[0],!0)||t.length--},serialize:function(){var t=this,e=t.scheme,n=t.username,i=t.password,r=t.host,o=t.port,s=t.path,a=t.query,c=t.fragment,l=e+":";return null!==r?(l+="//",t.includesCredentials()&&(l+=n+(i?":"+i:"")+"@"),l+=ot(r),null!==o&&(l+=":"+o)):"file"==e&&(l+="//"),l+=t.cannotBeABaseURL?s[0]:s.length?"/"+V(s,"/"):"",null!==a&&(l+="?"+a),null!==c&&(l+="#"+c),l},setHref:function(t){var e=this.parse(t);if(e)throw P(e);this.searchParams.update()},getOrigin:function(){var t=this.scheme,e=this.port;if("blob"==t)try{return new Bt(t.path[0]).origin}catch(t){return"null"}return"file"!=t&&this.isSpecial()?t+"://"+ot(this.host)+(null!==e?":"+e:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(b(t)+":",gt)},getUsername:function(){return this.username},setUsername:function(t){var e=g(b(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<e.length;n++)this.username+=ut(e[n],lt)}},getPassword:function(){return this.password},setPassword:function(t){var e=g(b(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<e.length;n++)this.password+=ut(e[n],lt)}},getHost:function(){var t=this.host,e=this.port;return null===t?"":null===e?ot(t):ot(t)+":"+e},setHost:function(t){this.cannotBeABaseURL||this.parse(t,Tt)},getHostname:function(){var t=this.host;return null===t?"":ot(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,Ct)},getPort:function(){var t=this.port;return null===t?"":b(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(""==(t=b(t))?this.port=null:this.parse(t,Et))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+V(t,"/"):""},setPathname:function(t){this.cannotBeABaseURL||(this.path=[],this.parse(t,Ot))},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){""==(t=b(t))?this.query=null:("?"==M(t,0)&&(t=H(t,1)),this.query="",this.parse(t,Nt)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){""!=(t=b(t))?("#"==M(t,0)&&(t=H(t,1)),this.fragment="",this.parse(t,Vt)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Bt=function(t){var e=d(this,Ft),n=_(arguments.length,1)>1?arguments[1]:void 0,i=x(e,new Dt(t,!1,n));o||(e.href=i.serialize(),e.origin=i.getOrigin(),e.protocol=i.getProtocol(),e.username=i.getUsername(),e.password=i.getPassword(),e.host=i.getHost(),e.hostname=i.getHostname(),e.port=i.getPort(),e.pathname=i.getPathname(),e.search=i.getSearch(),e.searchParams=i.getSearchParams(),e.hash=i.getHash())},Ft=Bt.prototype,Lt=function(t,e){return{get:function(){return T(this)[t]()},set:e&&function(t){return T(this)[e](t)},configurable:!0,enumerable:!0}};if(o&&(h(Ft,"href",Lt("serialize","setHref")),h(Ft,"origin",Lt("getOrigin")),h(Ft,"protocol",Lt("getProtocol","setProtocol")),h(Ft,"username",Lt("getUsername","setUsername")),h(Ft,"password",Lt("getPassword","setPassword")),h(Ft,"host",Lt("getHost","setHost")),h(Ft,"hostname",Lt("getHostname","setHostname")),h(Ft,"port",Lt("getPort","setPort")),
h(Ft,"pathname",Lt("getPathname","setPathname")),h(Ft,"search",Lt("getSearch","setSearch")),h(Ft,"searchParams",Lt("getSearchParams")),h(Ft,"hash",Lt("getHash","setHash"))),u(Ft,"toJSON",(function(){return T(this).serialize()}),{enumerable:!0}),u(Ft,"toString",(function(){return T(this).serialize()}),{enumerable:!0}),S){var zt=S.createObjectURL,jt=S.revokeObjectURL;zt&&u(Bt,"createObjectURL",c(zt,S)),jt&&u(Bt,"revokeObjectURL",c(jt,S))}y(Bt,"URL"),r({global:!0,constructor:!0,forced:!s,sham:!o},{URL:Bt})},30789:function(t,e,n){n(55847)},58565:function(t,e,n){"use strict";var i=n(51605),r=n(72368);i({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return r(URL.prototype.toString,this)}})},55108:function(t,e,n){n(63534),n(40590),n(27727),n(68290),n(12619),n(64216),n(2957),n(66195),n(64100),n(53006),n(74910),n(42820),n(36611),n(49576),n(59747),n(83515),n(14117),n(50624),n(86489),n(48642),n(80115),n(61408),n(23604),n(32982),n(17),n(18636),n(92157),n(31133),n(70640),n(41128),n(95755),n(58476),n(15195),n(47746),n(19693),n(4895),n(18665),n(80475),n(94582),n(59581),n(92630),n(28743),n(533),n(39958),n(10557),n(14913),n(63555),n(35231),n(5941),n(68763),n(95843),n(79432),n(19078),n(3446),n(93016),n(1772),n(33734),n(31180),n(89560),n(54696),n(31462),n(42169),n(53270),n(87787),n(79389),n(91189),n(64189),n(37514),n(98741),n(258),n(30959),n(31586),n(7918),n(48252),n(42799),n(36772),n(75483),n(27956),n(53733),n(49639),n(19570),n(956),n(19323),n(41145),n(59897),n(3212),n(82157),n(1610),n(46097),n(96982),n(15812),n(94009),n(96943),n(80577),n(4038),n(85365),n(96316),n(42006),n(88844),n(26161),n(11902),n(56402),n(34867),n(60769),n(69218),n(97755),n(8538),n(36012),n(15852),n(56582),n(84095),n(12824),n(75670),n(10678),n(3101),n(67579),n(41412),n(19322),n(23023),n(65933),n(59250),n(64484),n(7899),n(94641),n(99437),n(8240),n(47258),n(4632),n(5086),n(90345),n(96088),n(52231),n(69193),n(5880),n(45773),n(83396),n(67811),n(34606),n(57948),n(60436),n(12091),n(98182),n(92276),n(95031),n(89853),n(94308),n(14912),n(37759),n(27144),n(73719),n(79073),n(84216),n(87136),n(38802),n(13334),n(70617),n(6048),n(45708),n(46590),n(4657),n(67500),n(5784),n(43148),n(29979),n(78636),n(17870),n(3848),n(48825),n(67287),n(61890),n(40173),n(60243),n(50785),n(58649),n(54989),n(73648),n(68329),n(70825),n(5336),n(39596),n(34607),n(8915),n(35594),n(69607),n(75193),n(8505),n(53024),n(77249),n(5038),n(34427),n(65987),n(18293),n(95889),n(14758),n(15679),n(9096),n(47950),n(53746),n(9513),n(46395),n(52357),n(28921),n(20861),n(71905),n(85213),n(97182),n(12279),n(39302),n(81308),n(4973),n(70147),n(36148),n(66217),n(97966),n(35186),n(35944),n(44787),n(50632),n(66609),n(52278),n(14245),n(52492),n(93266),n(37192),n(37220),n(82432),n(32483),n(36696),n(58083),n(20898),n(10121),n(70863),n(69858),n(54072),n(58379),n(14602),n(54754),n(99078),n(91954),n(75417),n(85183),n(26413),n(18772),n(30789),n(58565),n(60933),n(29720)},96243:function(){},12312:function(){},28989:function(){},90385:function(){},38868:function(){},84586:function(){},21945:function(){},16044:function(){},69318:function(){},93729:function(){},88993:function(){},39982:function(){},85785:function(){},72352:function(){},6158:function(){},37704:function(){},6166:function(){},29190:function(){},64284:function(){},62756:function(){},39900:function(){},11767:function(){},18065:function(){},92124:function(){},90652:function(){},99780:function(){},1964:function(){},28496:function(){},9271:function(){},73680:function(){},55861:function(){},8245:function(){},36964:function(){},96589:function(){},18023:function(){},54877:function(){},13737:function(){},58348:function(){},87644:function(){},50331:function(){},15946:function(){},73954:function(){},35721:function(){},7452:function(t){var e=function(t){"use strict";function e(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}function n(t,e,n,o){var s=e&&e.prototype instanceof r?e:r,a=Object.create(s.prototype),c=new d(o||[]);return a._invoke=function(t,e,n){var r=k;return function(o,s){if(r===x)throw new Error("Generator is already running");if(r===T){if("throw"===o)throw s;return m()}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var c=l(a,n);if(c){if(c===C)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===k)throw r=T,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=x;var u=i(t,e,n);if("normal"===u.type){if(r=n.done?T:A,u.arg===C)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=T,n.method="throw",n.arg=u.arg)}}}(t,n,c),a}function i(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function r(){}function o(){}function s(){}function a(t){["next","throw","return"].forEach((function(n){e(t,n,(function(t){return this._invoke(n,t)}))}))}function c(t,e){function n(r,o,s,a){var c=i(t[r],t,o);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==typeof u&&w.call(u,"__await")?e.resolve(u.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):e.resolve(u).then((function(t){l.value=t,s(l)}),(function(t){return n("throw",t,s,a)}))}a(c.arg)}var r;this._invoke=function(t,i){function o(){return new e((function(e,r){n(t,i,e,r)}))}return r=r?r.then(o,o):o()}}function l(t,e){var n=t.iterator[e.method];if(n===g){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=g,l(t,e),"throw"===e.method))return C;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return C}var r=i(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,C;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=g),e.delegate=null,C):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,C)}function u(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function h(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function d(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(u,this),this.reset(!0)}function f(t){if(t){var e=t[b];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(w.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=g,e.done=!0,e};return i.next=i}}return{next:m}}function m(){return{value:g,done:!0}}var g,p=Object.prototype,w=p.hasOwnProperty,v="function"==typeof Symbol?Symbol:{},b=v.iterator||"@@iterator",y=v.asyncIterator||"@@asyncIterator",_=v.toStringTag||"@@toStringTag";try{e({},"")}catch(t){e=function(t,e,n){return t[e]=n}}t.wrap=n;var k="suspendedStart",A="suspendedYield",x="executing",T="completed",C={},E={};e(E,b,(function(){return this}));var S=Object.getPrototypeOf,P=S&&S(S(f([])));P&&P!==p&&w.call(P,b)&&(E=P);var R=s.prototype=r.prototype=Object.create(E);return o.prototype=s,e(R,"constructor",s),e(s,"constructor",o),o.displayName=e(s,_,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===o||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,e(t,_,"GeneratorFunction")),t.prototype=Object.create(R),t},t.awrap=function(t){return{__await:t}},a(c.prototype),e(c.prototype,y,(function(){return this})),t.AsyncIterator=c,t.async=function(e,i,r,o,s){void 0===s&&(s=Promise);var a=new c(n(e,i,r,o),s);return t.isGeneratorFunction(i)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},a(R),e(R,_,"Generator"),e(R,b,(function(){return this})),e(R,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var i=e.pop();if(i in t)return n.value=i,n.done=!1,n}return n.done=!0,n}},t.values=f,d.prototype={constructor:d,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=g,this.done=!1,this.delegate=null,this.method="next",this.arg=g,this.tryEntries.forEach(h),!t)for(var e in this)"t"===e.charAt(0)&&w.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=g)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){function e(e,i){return o.type="throw",o.arg=t,n.next=e,i&&(n.method="next",n.arg=g),!!i}if(this.done)throw t;for(var n=this,i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i],o=r.completion;if("root"===r.tryLoc)return e("end");if(r.tryLoc<=this.prev){var s=w.call(r,"catchLoc"),a=w.call(r,"finallyLoc");if(s&&a){if(this.prev<r.catchLoc)return e(r.catchLoc,!0);if(this.prev<r.finallyLoc)return e(r.finallyLoc)}else if(s){if(this.prev<r.catchLoc)return e(r.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return e(r.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&w.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var r=i;break}}r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc&&(r=null);var o=r?r.completion:{};return o.type=t,o.arg=e,r?(this.method="next",this.next=r.finallyLoc,C):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),C},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),h(n),C}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;h(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:f(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=g),C}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},85072:function(t,e,n){"use strict";function i(t){for(var e=-1,n=0;n<f.length;n++)if(f[n].identifier===t){e=n;break}return e}function r(t,e){for(var n={},r=[],o=0;o<t.length;o++){var s=t[o],a=e.base?s[0]+e.base:s[0],l=n[a]||0,u="".concat(a," ").concat(l);n[a]=l+1;var h=i(u),d={css:s[1],media:s[2],sourceMap:s[3]};-1!==h?(f[h].references++,f[h].updater(d)):f.push({identifier:u,updater:c(d,e),references:1}),r.push(u)}return r}function o(t){var e=document.createElement("style"),i=t.attributes||{};if(void 0===i.nonce){var r=n.nc;r&&(i.nonce=r)}if(Object.keys(i).forEach((function(t){e.setAttribute(t,i[t])})),"function"==typeof t.insert)t.insert(e);else{var o=d(t.insert||"head");if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(e)}return e}function s(t,e,n,i){var r=n?"":i.media?"@media ".concat(i.media," {").concat(i.css,"}"):i.css;if(t.styleSheet)t.styleSheet.cssText=m(e,r);else{var o=document.createTextNode(r),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(o,s[e]):t.appendChild(o)}}function a(t,e,n){var i=n.css,r=n.media,o=n.sourceMap;if(r?t.setAttribute("media",r):t.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleSheet)t.styleSheet.cssText=i;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(i))}}function c(t,e){var n,i,r;if(e.singleton){var c=p++;n=g||(g=o(e)),i=s.bind(null,n,c,!1),r=s.bind(null,n,c,!0)}else n=o(e),i=a.bind(null,n,e),r=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else r()}}var l,u,h=function(){return void 0===l&&(l=Boolean(window&&document&&document.all&&!window.atob)),l},d=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),f=[],m=(u=[],function(t,e){return u[t]=e,u.filter(Boolean).join("\n")}),g=null,p=0;t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=h());var n=r(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var o=0;o<n.length;o++){var s=i(n[o]);f[s].references--}for(var a=r(t,e),c=0;c<n.length;c++){var l=i(n[c]);0===f[l].references&&(f[l].updater(),f.splice(l,1))}n=a}}}}},n={};t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,{a:n}),n},t.d=function(e,n){for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},t.nc=void 0,function(){"use strict";function e(t){return t.indexOf("macintosh")>-1}function n(t,e,n,o){n=n||function(t,e){return t===e};const s=Array.isArray(t)?t:Array.prototype.slice.call(t),a=Array.isArray(e)?e:Array.prototype.slice.call(e),c=function(t,e,n){const o=i(t,e,n);if(-1===o)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const s=i(r(t,o),r(e,o),n);return{firstIndex:o,lastIndexOld:t.length-s,lastIndexNew:e.length-s}}(s,a,n),l=o?function(t,e){const{firstIndex:n,lastIndexOld:i,lastIndexNew:r}=t;if(-1===n)return Array(e).fill("equal");let o=[];return n>0&&(o=o.concat(Array(n).fill("equal"))),r-n>0&&(o=o.concat(Array(r-n).fill("insert"))),i-n>0&&(o=o.concat(Array(i-n).fill("delete"))),r<e&&(o=o.concat(Array(e-r).fill("equal"))),o}(c,a.length):function(t,e){const n=[],{firstIndex:i,lastIndexOld:r,lastIndexNew:o}=e;return o-i>0&&n.push({index:i,type:"insert",values:t.slice(i,o)}),r-i>0&&n.push({index:i+(o-i),type:"delete",howMany:r-i}),n}(a,c);return l}function i(t,e,n){for(let i=0;i<Math.max(t.length,e.length);i++)if(void 0===t[i]||void 0===e[i]||!n(t[i],e[i]))return i;return-1}function r(t,e){return t.slice(e).reverse()}function o(t,e,n){function i(i){const r=(void 0!==f[i-1]?f[i-1]:-1)+1,o=void 0!==f[i+1]?f[i+1]:-1,s=r>o?-1:1;d[i+s]&&(d[i]=d[i+s].slice(0)),d[i]||(d[i]=[]),d[i].push(r>o?a:c);let h=Math.max(r,o),m=h-i;for(;m<l&&h<u&&n(t[m],e[h]);)m++,h++,d[i].push("equal");return h}n=n||function(t,e){return t===e};const r=t.length,s=e.length;if(r>200||s>200||r+s>300)return o.fastDiff(t,e,n,!0);let a,c;if(s<r){const n=t;t=e,e=n,a="delete",c="insert"}else a="insert",c="delete";const l=t.length,u=e.length,h=u-l,d={},f={};let m,g=0;do{for(m=-g;m<h;m++)f[m]=i(m);for(m=h+g;m>h;m--)f[m]=i(m);f[h]=i(h),g++}while(f[h]!==u);return d[h].slice(1)}function s(t,...e){e.forEach((e=>{const n=Object.getOwnPropertyNames(e),i=Object.getOwnPropertySymbols(e);n.concat(i).forEach((n=>{if(n in t.prototype)return;if("function"==typeof e&&("length"==n||"name"==n||"prototype"==n))return;const i=Object.getOwnPropertyDescriptor(e,n);i.enumerable=!1,Object.defineProperty(t.prototype,n,i)}))}))}function a(){const t=4294967296*Math.random()>>>0,e=4294967296*Math.random()>>>0,n=4294967296*Math.random()>>>0,i=4294967296*Math.random()>>>0;return"e"+Ws[t>>0&255]+Ws[t>>8&255]+Ws[t>>16&255]+Ws[t>>24&255]+Ws[e>>0&255]+Ws[e>>8&255]+Ws[e>>16&255]+Ws[e>>24&255]+Ws[n>>0&255]+Ws[n>>8&255]+Ws[n>>16&255]+Ws[n>>24&255]+Ws[i>>0&255]+Ws[i>>8&255]+Ws[i>>16&255]+Ws[i>>24&255]}function c(t,e){const n=$s.get(e.priority);for(let i=0;i<t.length;i++)if($s.get(t[i].priority)<n)return void t.splice(i,0,e);t.push(e)}function l(t,e){console.warn(...h(t,e))}function u(t){return`\nRead more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-${t}`}function h(t,e){const n=u(t);return e?[t,e,n]:[t,n]}function d(t){return t?class extends t{on(t,e,n){this.listenTo(this,t,e,n)}once(t,e,n){let i=!1;this.listenTo(this,t,((t,...n)=>{i||(i=!0,t.off(),e.call(this,t,...n))}),n)}off(t,e){this.stopListening(this,t,e)}listenTo(t,e,n,i={}){let r,o;this[Js]||(this[Js]={});const s=this[Js];m(t)||f(t);const a=m(t);(r=s[a])||(r=s[a]={emitter:t,callbacks:{}}),(o=r.callbacks[e])||(o=r.callbacks[e]=[]),o.push(n),function(t,e,n,i,r){e._addEventListener?e._addEventListener(n,i,r):t._addEventListener.call(e,n,i,r)}(this,t,e,n,i)}stopListening(t,e,n){const i=this[Js];let r=t&&m(t);const o=i&&r?i[r]:void 0,s=o&&e?o.callbacks[e]:void 0;if(!(!i||t&&!o||e&&!s))if(n)b(this,t,e,n),-1!==s.indexOf(n)&&(1===s.length?delete o.callbacks[e]:b(this,t,e,n));else if(s){for(;n=s.pop();)b(this,t,e,n);delete o.callbacks[e]}else if(o){for(e in o.callbacks)this.stopListening(t,e);delete i[r]}else{for(r in i)this.stopListening(i[r].emitter);delete this[Js]}}fire(t,...e){try{const n=t instanceof Us?t:new Us(this,t),i=n.name;let r=w(this,i);if(n.path.push(this),r){const t=[n,...e];r=Array.from(r);for(let e=0;e<r.length&&(r[e].callback.apply(this,t),n.off.called&&(delete n.off.called,this._removeEventListener(i,r[e].callback)),!n.stop.called);e++);}const o=this[Qs];if(o){const t=o.get(i),r=o.get("*");t&&v(t,n,e),r&&v(r,n,e)}return n.return}catch(t){qs.rethrowUnexpectedError(t,this)}}delegate(...t){return{to:(e,n)=>{this[Qs]||(this[Qs]=new Map),t.forEach((t=>{const i=this[Qs].get(t);i?i.set(e,n):this[Qs].set(t,new Map([[e,n]]))}))}}}stopDelegating(t,e){if(this[Qs])if(t)if(e){const n=this[Qs].get(t);n&&n.delete(e)}else this[Qs].delete(t);else this[Qs].clear()}_addEventListener(t,e,n){!function(t,e){const n=g(t);if(n[e])return;let i=e,r=null;const o=[];for(;""!==i&&!n[i];)n[i]={callbacks:[],childEvents:[]},o.push(n[i]),r&&n[i].childEvents.push(r),r=i,i=i.substr(0,i.lastIndexOf(":"));if(""!==i){for(const t of o)t.callbacks=n[i].callbacks.slice();n[i].childEvents.push(r)}}(this,t);const i=p(this,t),r={callback:e,priority:$s.get(n.priority)};for(const t of i)c(t,r)}_removeEventListener(t,e){const n=p(this,t);for(const t of n)for(let n=0;n<t.length;n++)t[n].callback==e&&(t.splice(n,1),n--)}}:Xs}function f(t,e){t[Ys]||(t[Ys]=e||a())}function m(t){return t[Ys]}function g(t){return t._events||Object.defineProperty(t,"_events",{value:{}}),t._events}function p(t,e){const n=g(t)[e];if(!n)return[];let i=[n.callbacks];for(let e=0;e<n.childEvents.length;e++){const r=p(t,n.childEvents[e]);i=i.concat(r)}return i}function w(t,e){let n;return t._events&&(n=t._events[e])&&n.callbacks.length?n.callbacks:e.indexOf(":")>-1?w(t,e.substr(0,e.lastIndexOf(":"))):null}function v(t,e,n){for(let[i,r]of t){r?"function"==typeof r&&(r=r(e.name)):r=e.name;const t=new Us(e.source,r);t.path=[...e.path],i.fire(t,...n)}}function b(t,e,n,i){e._removeEventListener?e._removeEventListener(n,i):t._removeEventListener.call(e,n,i)}function y(t){return t?class extends t{set(t,e){if(Zs(t))return void Object.keys(t).forEach((e=>{this.set(e,t[e])}),this);_(this);const n=this[ta];if(t in this&&!n.has(t))throw new qs("observable-set-cannot-override",this);Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get:()=>n.get(t),set(e){const i=n.get(t);let r=this.fire(`set:${t}`,t,e,i);void 0===r&&(r=e),i===r&&n.has(t)||(n.set(t,r),this.fire(`change:${t}`,t,r,i))}}),this[t]=e}bind(...t){if(!t.length||!x(t))throw new qs("observable-bind-wrong-properties",this);if(new Set(t).size!==t.length)throw new qs("observable-bind-duplicate-properties",this);_(this);const e=this[na];t.forEach((t=>{if(e.has(t))throw new qs("observable-bind-rebind",this)}));const n=new Map;return t.forEach((t=>{const i={property:t,to:[]};e.set(t,i),n.set(t,i)})),{to:k,toMany:A,_observable:this,_bindProperties:t,_to:[],_bindings:n}}unbind(...t){if(!this[ta])return;const e=this[na],n=this[ea];if(t.length){if(!x(t))throw new qs("observable-unbind-wrong-properties",this);t.forEach((t=>{const i=e.get(t);i&&(i.to.forEach((([t,e])=>{const r=n.get(t),o=r[e];o.delete(i),o.size||delete r[e],Object.keys(r).length||(n.delete(t),this.stopListening(t,"change"))})),e.delete(t))}))}else n.forEach(((t,e)=>{this.stopListening(e,"change")})),n.clear(),e.clear()}decorate(t){_(this);const e=this[t];if(!e)throw new qs("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:t});this.on(t,((t,n)=>{t.return=e.apply(this,n)})),this[t]=function(...e){return this.fire(t,e)},this[t][ra]=e,this[ia]||(this[ia]=[]),this[ia].push(t)}stopListening(t,e,n){if(!t&&this[ia]){for(const t of this[ia])this[t]=this[t][ra];delete this[ia]}super.stopListening(t,e,n)}}:oa}function _(t){t[ta]||(Object.defineProperty(t,ta,{value:new Map}),Object.defineProperty(t,ea,{value:new Map}),Object.defineProperty(t,na,{value:new Map}))}function k(...t){const e=function(...t){if(!t.length)throw new qs("observable-bind-to-parse-error",null);const e={to:[]};let n;return"function"==typeof t[t.length-1]&&(e.callback=t.pop()),t.forEach((t=>{if("string"==typeof t)n.properties.push(t);else{if("object"!=typeof t)throw new qs("observable-bind-to-parse-error",null);n={observable:t,properties:[]},e.to.push(n)}})),e}(...t),n=Array.from(this._bindings.keys()),i=n.length;if(!e.callback&&e.to.length>1)throw new qs("observable-bind-to-no-callback",this);if(i>1&&e.callback)throw new qs("observable-bind-to-extra-callback",this);var r;e.to.forEach((t=>{if(t.properties.length&&t.properties.length!==i)throw new qs("observable-bind-to-properties-length",this);t.properties.length||(t.properties=this._bindProperties)})),this._to=e.to,e.callback&&(this._bindings.get(n[0]).callback=e.callback),r=this._observable,this._to.forEach((t=>{const e=r[ea];let n;e.get(t.observable)||r.listenTo(t.observable,"change",((i,o)=>{n=e.get(t.observable)[o],n&&n.forEach((t=>{T(r,t.property)}))}))})),function(t){let e;t._bindings.forEach(((n,i)=>{t._to.forEach((r=>{e=r.properties[n.callback?0:t._bindProperties.indexOf(i)],n.to.push([r.observable,e]),function(t,e,n,i){const r=t[ea],o=r.get(n),s=o||{};s[i]||(s[i]=new Set),s[i].add(e),o||r.set(n,s)}(t._observable,n,r.observable,e)}))}))}(this),this._bindProperties.forEach((t=>{T(this._observable,t)}))}function A(t,e,n){if(this._bindings.size>1)throw new qs("observable-bind-to-many-not-one-binding",this);this.to(...function(t,e){const n=t.map((t=>[t,e]));return Array.prototype.concat.apply([],n)}(t,e),n)}function x(t){return t.every((t=>"string"==typeof t))}function T(t,e){const n=t[na].get(e);let i;n.callback?i=n.callback.apply(t,n.to.map((t=>t[0][t[1]]))):(i=n.to[0],i=i[0][i[1]]),Object.prototype.hasOwnProperty.call(t,e)?t[e]=i:t.set(e,i)}function C(t){let e=0;for(const n of t)e++;return e}function E(t,e){const n=Math.min(t.length,e.length);for(let i=0;i<n;i++)if(t[i]!=e[i])return i;return t.length==e.length?"same":t.length<e.length?"prefix":"extension"}function S(t){return!(!t||!t[Symbol.iterator])}function P(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function R(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function O(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function I(t){var e=this.__data__=new Fa(t);this.size=e.size}function M(t){return ku(t,N)}function N(t){return Au(t)?t:void 0}function V(t){if(t){if(t.defaultView)return t instanceof t.defaultView.Document;if(t.ownerDocument&&t.ownerDocument.defaultView)return t instanceof t.ownerDocument.defaultView.Node}return!1}function D(t){const e=Object.prototype.toString.apply(t);return"[object Window]"==e||"[object global]"==e}function B(t){return t?class extends t{listenTo(t,e,n,i={}){if(V(t)||D(t)){const r={capture:!!i.useCapture,passive:!!i.usePassive},o=this._getProxyEmitter(t,r)||new Cu(t,r);this.listenTo(o,e,n,i)}else super.listenTo(t,e,n,i)}stopListening(t,e,n){if(V(t)||D(t)){const i=this._getAllProxyEmitters(t);for(const t of i)this.stopListening(t,e,n)}else super.stopListening(t,e,n)}_getProxyEmitter(t,e){return function(t,e){const n=t[Js];return n&&n[e]?n[e].emitter:null}(this,F(t,e))}_getAllProxyEmitters(t){return[{capture:!1,passive:!1},{capture:!1,passive:!0},{capture:!0,passive:!1},{capture:!0,passive:!0}].map((e=>this._getProxyEmitter(t,e))).filter((t=>!!t))}}:Tu}function F(t,e){let n=function(t){return t["data-ck-expando"]||(t["data-ck-expando"]=a())}(t);for(const t of Object.keys(e).sort())e[t]&&(n+="-"+t);return n}function L(t){const e=[];let n=t;for(;n&&n.nodeType!=Node.DOCUMENT_NODE;)e.unshift(n),n=n.parentNode;return e}function z(t){return"[object Text]"==Object.prototype.toString.call(t)}function j(t){return"[object Range]"==Object.prototype.toString.apply(t)}function H(t){const e=t.ownerDocument.defaultView.getComputedStyle(t);return{top:parseInt(e.borderTopWidth,10),right:parseInt(e.borderRightWidth,10),bottom:parseInt(e.borderBottomWidth,10),left:parseInt(e.borderLeftWidth,10)}}function U(t,e){for(const n of Pu)t[n]=e[n]}function W(t){return!!$(t)&&t===t.ownerDocument.body}function $(t){return null!==t&&"object"==typeof t&&1===t.nodeType&&"function"==typeof t.getBoundingClientRect}function q(t,e){t instanceof HTMLTextAreaElement&&(t.value=e),t.innerHTML=e}function K(t){return e=>e+t}function G(t){let e=0;for(;t.previousSibling;)t=t.previousSibling,e++;return e}function J(t,e,n){t.insertBefore(n,t.childNodes[e]||null)}function Y(t){return t&&t.nodeType===Node.COMMENT_NODE}function Q(t){return!!(t&&t.getClientRects&&t.getClientRects().length)}function X({element:t,target:e,positions:n,limiter:i,fitInViewport:r,viewportOffsetConfig:o}){Ua(e)&&(e=e()),Ua(i)&&(i=i());const s=function(t){return t&&t.parentNode?t.offsetParent===Su.document.body?null:t.offsetParent:null}(t),a=new Ru(t),c=new Ru(e);let l;const u=r&&function(t){t=Object.assign({top:0,bottom:0,left:0,right:0},t);const e=new Ru(Su.window);return e.top+=t.top,e.height-=t.top,e.bottom-=t.bottom,e.height-=t.bottom,e}(o)||null,h={targetRect:c,elementRect:a,positionedElementAncestor:s,viewportRect:u};if(i||r){const t=i&&new Ru(i).getVisible();Object.assign(h,{limiterRect:t,viewportRect:u}),l=function(t,e){const{elementRect:n}=e,i=n.getArea(),r=t.map((t=>new Iu(t,e))).filter((t=>!!t.name));let o=0,s=null;for(const t of r){const{limiterIntersectionArea:e,viewportIntersectionArea:n}=t;if(e===i)return t;const r=n**2+e**2;r>o&&(o=r,s=t)}return s}(n,h)||new Iu(n[0],h)}else l=new Iu(n[0],h);return l}function Z(t){const{scrollX:e,scrollY:n}=Su.window;return t.clone().moveBy(e,n)}function tt(t){const e=t.parentNode;e&&e.removeChild(t)}function et(t,e,n){const i=e.clone().moveBy(0,n),r=e.clone().moveBy(0,-n),o=new Ru(t).excludeScrollbarsAndBorders();if(![r,i].every((t=>o.contains(t)))){let{scrollX:s,scrollY:a}=t;rt(r,o)?a-=o.top-e.top+n:it(i,o)&&(a+=e.bottom-o.bottom+n),ot(e,o)?s-=o.left-e.left+n:st(e,o)&&(s+=e.right-o.right+n),t.scrollTo(s,a)}}function nt(t,e){const n=at(t);let i,r;for(;t!=n.document.body;)r=e(),i=new Ru(t).excludeScrollbarsAndBorders(),i.contains(r)||(rt(r,i)?t.scrollTop-=i.top-r.top:it(r,i)&&(t.scrollTop+=r.bottom-i.bottom),ot(r,i)?t.scrollLeft-=i.left-r.left:st(r,i)&&(t.scrollLeft+=r.right-i.right)),t=t.parentNode}function it(t,e){return t.bottom>e.bottom}function rt(t,e){return t.top<e.top}function ot(t,e){return t.left<e.left}function st(t,e){return t.right>e.right}function at(t){return j(t)?t.startContainer.ownerDocument.defaultView:t.ownerDocument.defaultView}function ct(t){if(j(t)){let e=t.commonAncestorContainer;return z(e)&&(e=e.parentNode),e}return t.parentNode}function lt(t,e){const n=at(t),i=new Ru(t);if(n===e)return i;{let t=n;for(;t!=e;){const e=t.frameElement,n=new Ru(e).excludeScrollbarsAndBorders();i.moveBy(n.left,n.top),t=t.parent}}return i}function ut(t){let e;if("string"==typeof t){if(e=Vu[t.toLowerCase()],!e)throw new qs("keyboard-unknown-key",null,{key:t})}else e=t.keyCode+(t.altKey?Vu.alt:0)+(t.ctrlKey?Vu.ctrl:0)+(t.shiftKey?Vu.shift:0)+(t.metaKey?Vu.cmd:0);return e}function ht(t){return"string"==typeof t&&(t=function(t){return t.split("+").map((t=>t.trim()))}(t)),t.map((t=>"string"==typeof t?function(t){if(t.endsWith("!"))return ut(t.slice(0,-1));const e=ut(t);return js.isMac&&e==Vu.ctrl?Vu.cmd:e}(t):t)).reduce(((t,e)=>e+t),0)}function dt(t){let e=ht(t);return Object.entries(js.isMac?Mu:Nu).reduce(((t,[n,i])=>(0!=(e&Vu[n])&&(e&=~Vu[n],t+=i),t)),"")+(e?Du[e]:"")}function ft(t,e){const n="ltr"===e;switch(t){case Vu.arrowleft:return n?"left":"right";case Vu.arrowright:return n?"right":"left";case Vu.arrowup:return"up";case Vu.arrowdown:return"down"}}function mt(t){return Array.isArray(t)?t:[t]}function gt(t,e,n=1){if("number"!=typeof n)throw new qs("translation-service-quantity-not-a-number",null,{quantity:n});const i=Object.keys(Su.window.CKEDITOR_TRANSLATIONS).length;1===i&&(t=Object.keys(Su.window.CKEDITOR_TRANSLATIONS)[0]);const r=e.id||e.string;if(0===i||!function(t,e){return!!Su.window.CKEDITOR_TRANSLATIONS[t]&&!!Su.window.CKEDITOR_TRANSLATIONS[t].dictionary[e]}(t,r))return 1!==n?e.plural:e.string;const o=Su.window.CKEDITOR_TRANSLATIONS[t].dictionary,s=Su.window.CKEDITOR_TRANSLATIONS[t].getPluralForm||(t=>1===t?0:1),a=o[r];return"string"==typeof a?a:a[Number(s(n))]}function pt(t){return Bu.includes(t)?"rtl":"ltr"}function wt(t){const e=t.next();return e.done?null:e.value}function vt(t){return S(t)?new Map(t):function(t){const e=new Map;for(const n in t)e.set(n,t[n]);return e}(t)}function bt(t,e){return!!(n=t.charAt(e-1))&&1==n.length&&/[\ud800-\udbff]/.test(n)&&function(t){return!!t&&1==t.length&&/[\udc00-\udfff]/.test(t)}(t.charAt(e));var n}function yt(t,e){return!!(n=t.charAt(e))&&1==n.length&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(n);var n}function _t(t,e){const n=String(t).matchAll(Hu);return Array.from(n).some((t=>t.index<e&&e<t.index+t[0].length))}function kt(t){t.return=!1,t.stop()}function At(t){t.return=!1,t.stop()}function xt(t,e){return!!e.hasClass("ck-placeholder")&&(t.removeClass("ck-placeholder",e),!0)}function Tt(t,e){const n=th.get(t),i=[];let r=!1;for(const[t,o]of n)o.isDirectHost&&(i.push(t),Ct(e,t,o)&&(r=!0));for(const[t,o]of n){if(o.isDirectHost)continue;const n=Et(t);n&&(i.includes(n)||(o.hostElement=n,Ct(e,t,o)&&(r=!0)))}return r}function Ct(t,e,n){const{text:i,isDirectHost:r,hostElement:o}=n;let s=!1;return o.getAttribute("data-placeholder")!==i&&(t.setAttribute("data-placeholder",i,o),s=!0),(r||1==e.childCount)&&function(t,e){if(!t.isAttached())return!1;const n=Array.from(t.getChildren()).some((t=>!t.is("uiElement")));if(n)return!1;const i=t.document,r=i.selection.anchor;return!(i.isComposing&&r&&r.parent===t||!e&&i.isFocused&&(!r||r.parent===t))}(o,n.keepOnFocus)?function(t,e){return!e.hasClass("ck-placeholder")&&(t.addClass("ck-placeholder",e),!0)}(t,o)&&(s=!0):xt(t,o)&&(s=!0),s}function Et(t){if(t.childCount){const e=t.getChild(0);if(e.is("element")&&!e.is("uiElement")&&!e.is("attributeElement"))return e}return null}function St(t,e){if("function"==typeof e)return e(t);const n={};return e.name&&(n.name=function(t,e){return t instanceof RegExp?!!e.match(t):t===e}(e.name,t.name),!n.name)||e.attributes&&(n.attributes=function(t,e){const n=new Set(e.getAttributeKeys());return Pa(t)?(void 0!==t.style&&l("matcher-pattern-deprecated-attributes-style-key",t),void 0!==t.class&&l("matcher-pattern-deprecated-attributes-class-key",t)):(n.delete("style"),n.delete("class")),Pt(t,n,(t=>e.getAttribute(t)))}(e.attributes,t),!n.attributes)||e.classes&&(n.classes=function(t,e){return Pt(t,e.getClassNames(),(()=>{}))}(e.classes,t),!n.classes)||e.styles&&(n.styles=function(t,e){return Pt(t,e.getStyleNames(!0),(t=>e.getStyle(t)))}(e.styles,t),!n.styles)?null:n}function Pt(t,e,n){const i=function(t){return Array.isArray(t)?t.map((t=>Pa(t)?(void 0!==t.key&&void 0!==t.value||l("matcher-pattern-missing-key-or-value",t),[t.key,t.value]):[t,!0])):Pa(t)?Object.entries(t):[[t,!0]]}(t),r=Array.from(e),o=[];if(i.forEach((([t,e])=>{r.forEach((i=>{(function(t,e){return!0===t||t===e||t instanceof RegExp&&e.match(t)})(t,i)&&function(t,e,n){if(!0===t)return!0;const i=n(e);return t===i||t instanceof RegExp&&!!String(i).match(t)}(e,i,n)&&o.push(i)}))})),i.length&&!(o.length<i.length))return o}function Rt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var i=arguments,r=e?e.apply(this,i):i[0],o=n.cache;if(o.has(r))return o.get(r);var s=t.apply(this,i);return n.cache=o.set(r,s)||o,s};return n.cache=new(Rt.Cache||_c),n}function Ot(t){return t.replace("-",".")}function It(t,e,n){let i=n;Zs(n)&&(i=Jh({},Ph(t,e),n)),Qh(t,e,i)}function Mt(t,e){const n=e.split(/\s+/);t.clear(),
n.forEach((e=>t.add(e)))}function Nt(){const t=[...this.getChildren()],e=t[this.childCount-1];if(e&&e.is("element","br"))return this.childCount;for(const e of t)if(!e.is("uiElement"))return null;return this.childCount}function Vt(t){return!(!t.item.is("attributeElement")&&!t.item.is("uiElement"))}function Dt(t){return class extends t{fire(t,...e){try{const n=t instanceof Us?t:new Us(this,t),i=zt(this);if(!i.size)return;if(Bt(n,"capturing",this),Ft(i,"$capture",n,...e))return n.return;const r=n.startRange||this.selection.getFirstRange(),o=r?r.getContainedElement():null,s=!!o&&Boolean(Lt(i,o));let a=o||function(t){if(!t)return null;const e=t.start.parent,n=t.end.parent,i=e.getPath(),r=n.getPath();return i.length>r.length?e:n}(r);if(Bt(n,"atTarget",a),!s){if(Ft(i,"$text",n,...e))return n.return;Bt(n,"bubbling",a)}for(;a;){if(a.is("rootElement")){if(Ft(i,"$root",n,...e))return n.return}else if(a.is("element")&&Ft(i,a.name,n,...e))return n.return;if(Ft(i,a,n,...e))return n.return;a=a.parent,Bt(n,"bubbling",a)}return Bt(n,"bubbling",this),Ft(i,"$document",n,...e),n.return}catch(t){qs.rethrowUnexpectedError(t,this)}}_addEventListener(t,e,n){const i=mt(n.context||"$document"),r=zt(this);for(const o of i){let i=r.get(o);i||(i=new(d()),r.set(o,i)),this.listenTo(i,t,e,n)}}_removeEventListener(t,e){const n=zt(this);for(const i of n.values())this.stopListening(i,t,e)}}}function Bt(t,e,n){t instanceof ud&&(t._eventPhase=e,t._currentTarget=n)}function Ft(t,e,n,...i){const r="string"==typeof e?t.get(e):Lt(t,e);return!!r&&(r.fire(n,...i),n.stop.called)}function Lt(t,e){for(const[n,i]of t)if("function"==typeof n&&n(e))return i;return null}function zt(t){return t[hd]||(t[hd]=new Map),t[hd]}function jt(){if(Ht(this))return null;let t=this.parent;for(;t&&t.is("attributeElement");){if(Ht(t)>1)return null;t=t.parent}return!t||Ht(t)>1?null:this.childCount}function Ht(t){return Array.from(t.getChildren()).filter((t=>!t.is("uiElement"))).length}function Ut(){return null}function Wt(t){t.document.on("arrowKey",((e,n)=>function(t,e,n){if(e.keyCode==Vu.arrowright){const t=e.domTarget.ownerDocument.defaultView.getSelection(),i=1==t.rangeCount&&t.getRangeAt(0).collapsed;if(i||e.shiftKey){const e=t.focusNode,r=t.focusOffset,o=n.domPositionToView(e,r);if(null===o)return;let s=!1;const a=o.getLastMatchingPosition((t=>(t.item.is("uiElement")&&(s=!0),!(!t.item.is("uiElement")&&!t.item.is("attributeElement")))));if(s){const e=n.viewPositionToDom(a);i?t.collapse(e.parent,e.offset):t.extend(e.parent,e.offset)}}}}(0,n,t.domConverter)),{priority:"low"})}function $t(){return null}function qt(){return null}function Kt(t){let e=t.parent;for(;!Zt(e);){if(!e)return;e=e.parent}return e}function Gt(t,e){return t.priority<e.priority||!(t.priority>e.priority)&&t.getIdentity()<e.getIdentity()}function Jt(t){const e=t.nodeBefore;if(e&&e.is("$text"))return new sd(e,e.data.length);const n=t.nodeAfter;return n&&n.is("$text")?new sd(n,0):t}function Yt(t){if(t.offset==t.parent.data.length)return new sd(t.parent.parent,t.parent.index+1);if(0===t.offset)return new sd(t.parent.parent,t.parent.index);const e=t.parent.data.slice(t.offset);return t.parent._data=t.parent.data.slice(0,t.offset),t.parent.parent._insertChild(t.parent.index+1,new rh(t.root.document,e)),new sd(t.parent.parent,t.parent.index+1)}function Qt(t,e){const n=t.data.length;return t._data+=e.data,e._remove(),new sd(t,n)}function Xt(t,e){for(const n of t){if(!bd.some((t=>n instanceof t)))throw new qs("view-writer-insert-invalid-node-type",e);n.is("$text")||Xt(n.getChildren(),e)}}function Zt(t){return t&&(t.is("containerElement")||t.is("documentFragment"))}function te(t,e){const n=Kt(t.start),i=Kt(t.end);if(!n||!i||n!==i)throw new qs("view-writer-invalid-range-container",e)}function ee(t,e){return null===t.id&&null===e.id}function ne(t){return z(t)&&t.data.substr(0,7)===Ad}function ie(t){return 7==t.data.length&&ne(t)}function re(t){return ne(t)?t.data.slice(7):t.data}function oe(t,e){if(e.keyCode==Vu.arrowleft){const t=e.domTarget.ownerDocument.defaultView.getSelection();if(1==t.rangeCount&&t.getRangeAt(0).collapsed){const e=t.getRangeAt(0).startContainer,n=t.getRangeAt(0).startOffset;ne(e)&&n<=7&&t.collapse(e,0)}}}function se(t,e,n){const i=e instanceof Array?e:e.childNodes,r=i[n];if(z(r))return r.data=Ad+r.data,r;{const r=t.createTextNode(Ad);return Array.isArray(e)?i.splice(n,0,r):J(e,n,r),r}}function ae(t,e){return V(t)&&V(e)&&!z(t)&&!z(e)&&!Y(t)&&!Y(e)&&t.tagName.toLowerCase()===e.tagName.toLowerCase()}function ce(t,e){return V(t)&&V(e)&&z(t)&&z(e)}function le(t,e,n){return e===n||(z(e)&&z(n)?e.data===n.data:!(!t.isBlockFiller(e)||!t.isBlockFiller(n)))}function ue(t,e){const i=t.data;if(i==e)return;const r=n(i,e);for(const e of r)"insert"===e.type?t.insertData(e.index,e.values.join("")):t.deleteData(e.index,e.howMany)}function he(t,e){let n=t;for(;n;)e(n),n=n.parentElement}function de(t,e){const n=t.parentNode;return!!n&&!!n.tagName&&e.includes(n.tagName.toLowerCase())}function fe(t){"script"===t&&l("domconverter-unsafe-script-element-detected"),"style"===t&&l("domconverter-unsafe-style-element-detected")}function me(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new _c;++e<n;)this.add(t[e])}function ge(t,e){if(!Array.isArray(t))return t===e||!(!t.is("$text")||!e.is("$text"))&&t.data===e.data}function pe(t){const e=Array.from(t.files||[]),n=Array.from(t.items||[]);return e.length?e:n.filter((t=>"file"===t.kind)).map((t=>t.getAsFile()))}function we(t,e,n,i,r){return{done:!1,value:{type:t,item:e,previousPosition:n,nextPosition:i,length:r}}}function ve(t,e){const n=e.getChild(e.offsetToIndex(t.offset));return n&&n.is("$text")&&n.startOffset<t.offset?n:null}function be(t,e,n){return null!==n?null:e.getChild(e.offsetToIndex(t.offset))}function ye(t,e,n){return null!==n?null:e.getChild(e.offsetToIndex(t.offset)-1)}function _e(t,e,n){return n+1!==t.path.length&&!!ke(e.path,n+1)&&!!function(t,e){let n=t.parent,i=t.path.length-1,r=0;for(;i>=e;){if(t.path[i]+r!==n.maxOffset)return!1;r=1,i--,n=n.parent}return!0}(t,n+1)}function ke(t,e){for(;e<t.length;){if(0!==t[e])return!1;e++}return!0}function Ae(t){const e=t.split(":");return"insert"==e[0]?e[0]:"addMarker"==e[0]||"removeMarker"==e[0]?t:e.length>1?e[0]+":"+e[1]:e[0]}function xe(t,e,n){const i=e.getRange(),r=Array.from(t.getAncestors());return r.shift(),r.reverse(),!r.some((t=>{if(i.containsItem(t))return!!n.toViewElement(t).getCustomProperty("addHighlight")}))}function Te(t){return{item:t.item,range:Bf._createFromPositionAndShift(t.previousPosition,t.length)}}function Ce(t,e){return!e.has(t)&&(e.add(t),t.root.document.model.schema.isBlock(t)&&!!t.parent)}function Ee(t,e,n){return Ce(t,e)&&Pe(t,n)}function Se(t,e){const n=t.parent.root.document.model.schema,i=t.parent.getAncestors({parentFirst:!0,includeSelf:!0});let r=!1;const o=i.find((t=>!r&&(r=n.isLimit(t),!r&&Ce(t,e))));return i.forEach((t=>e.add(t))),o}function Pe(t,e){const n=function(t){const e=t.root.document.model.schema;let n=t.parent;for(;n;){if(e.isBlock(n))return n;n=n.parent}}(t);return!n||!e.containsRange(Bf._createOn(n),!0)}function Re(){this.listenTo(this.root.document.model,"applyOperation",((t,e)=>{const n=e[0];n.isDocumentOperation&&Oe.call(this,n)}),{priority:"low"})}function Oe(t){const e=this.getTransformedByOperation(t),n=Bf._createFromRanges(e),i=!n.isEqual(this),r=function(t,e){switch(e.type){case"insert":return t.containsPosition(e.position);case"move":case"remove":case"reinsert":case"merge":return t.containsPosition(e.sourcePosition)||t.start.isEqual(e.sourcePosition)||t.containsPosition(e.targetPosition);case"split":return t.containsPosition(e.splitPosition)||t.containsPosition(e.insertionPosition)}return!1}(this,t);let o=null;if(i){"$graveyard"==n.root.rootName&&(o="remove"==t.type?t.sourcePosition:t.deletionPosition);const e=this.toRange();this.start=n.start,this.end=n.end,this.fire("change:range",e,{deletionPosition:o})}else r&&this.fire("change:content",this.toRange(),{deletionPosition:o})}function Ie(t){return t instanceof Mf||t instanceof If?t.getAttributes():null}function Me(t,e){const n=t.createAttributeElement("span",e.attributes);return e.classes&&n._addClass(e.classes),"number"==typeof e.priority&&(n._priority=e.priority),n._id=e.id,n}function Ne(t,e,n,i,r){const o=e?t.start:t.end,s=o.nodeAfter&&o.nodeAfter.is("element")?o.nodeAfter:null,a=o.nodeBefore&&o.nodeBefore.is("element")?o.nodeBefore:null;if(s||a){let t,o;e&&s||!e&&!a?(t=s,o=!0):(t=a,o=!1);const c=n.mapper.toViewElement(t);if(c)return void function(t,e,n,i,r,o){const s=`data-${o.group}-${e?"start":"end"}-${n?"before":"after"}`,a=t.hasAttribute(s)?t.getAttribute(s).split(","):[];a.unshift(o.name),i.writer.setAttribute(s,a.join(","),t),i.mapper.bindElementToMarker(t,r.markerName)}(c,e,o,n,i,r)}!function(t,e,n,i,r){const o=`${r.group}-${e?"start":"end"}`,s=r.name?{name:r.name}:null,a=n.writer.createUIElement(o,s);n.writer.insert(t,a),n.mapper.bindElementToMarker(a,i.markerName)}(n.mapper.toViewPosition(o),e,n,i,r)}function Ve(t){return"string"==typeof t&&(t={name:t}),t.attributes?Array.isArray(t.attributes)||(t.attributes=[t.attributes]):t.attributes=[],t.children=!!t.children,t}function De(t,e){return"function"==typeof t?t:(n,i)=>function(t,e,n){let i;"string"==typeof t&&(t={name:t});const r=e.writer,o=Object.assign({},t.attributes);if("container"==n)i=r.createContainerElement(t.name,o);else if("attribute"==n){const e={priority:t.priority||fd.DEFAULT_PRIORITY};i=r.createAttributeElement(t.name,o,e)}else i=r.createUIElement(t.name,o);if(t.styles){const e=Object.keys(t.styles);for(const n of e)r.setStyle(n,t.styles[n],i)}if(t.classes){const e=t.classes;if("string"==typeof e)r.addClass(e,i);else for(const t of e)r.addClass(t,i)}return i}(t,i,e)}function Be(t){return t.model.values?(e,n,i)=>{const r=t.view[e];return r?r(e,n,i):null}:t.view}function Fe(t){return"string"==typeof t?e=>({key:t,value:e}):"object"==typeof t?t.value?()=>t:e=>({key:t.key,value:e}):t}function Le(t,e,n){const i="function"==typeof t?t(e,n):t;return i?(i.priority||(i.priority=10),i.id||(i.id=e.markerName),i):null}function ze(t){const e=function(t){return(e,n)=>{if(!e.is("element",t.name))return!1;if("attribute"==n.type){if(t.attributes.includes(n.attributeKey))return!0}else if(t.children)return!0;return!1}}(t);return(t,n)=>{const i=[];n.reconvertedElements||(n.reconvertedElements=new Set);for(const t of n.changes){const r="attribute"==t.type?t.range.start.nodeAfter:t.position.parent;if(r&&e(r,t)){if(!n.reconvertedElements.has(r)){n.reconvertedElements.add(r);const t=Df._createBefore(r);i.push({type:"remove",name:r.name,position:t,length:1},{type:"reinsert",name:r.name,position:t,length:1})}}else i.push(t)}n.changes=i}}function je(t){return(e,n,i={})=>{const r=["insert"];for(const n of t.attributes)e.hasAttribute(n)&&r.push(`attribute:${n}`);return!!r.every((t=>n.test(e,t)))&&(i.preflight||r.forEach((t=>n.consume(e,t))),!0)}}function He(t,e,n,i){for(const r of e)Ue(t.root,r,n,i)||n.convertItem(r)}function Ue(t,e,n,i){const{writer:r,mapper:o}=n;if(!i.reconversion)return!1;const s=o.toViewElement(e);return!(!s||s.root==t||!n.canReuseView(s)||(r.move(r.createRangeOn(s),o.toViewPosition(Df._createBefore(e))),0))}function We(t,e,{preflight:n}={}){return n?e.test(t,"insert"):e.consume(t,"insert")}function $e(t){const{schema:e,document:n}=t.model;for(const i of n.getRootNames()){const r=n.getRoot(i);if(r.isEmpty&&!e.checkChild(r,"$text")&&e.checkChild(r,"paragraph"))return t.insertElement("paragraph",r),!0}return!1}function qe(t,e,n){const i=n.createContext(t);return!!n.checkChild(i,"paragraph")&&!!n.checkChild(i.push("paragraph"),e)}function Ke(t,e){const n=e.createElement("paragraph");return e.insert(n,t),e.createPositionAt(n,0)}function Ge(t){const e=Ye(t=Kf(t)),n=Je(t.view),i=n?`element:${n}`:"element";return n=>{n.on(i,e,{priority:t.converterPriority||"normal"})}}function Je(t){return"string"==typeof t?t:"object"==typeof t&&"string"==typeof t.name?t.name:null}function Ye(t){const e=new sh(t.view);return(n,i,r)=>{const o=e.match(i.viewItem);if(!o)return;const s=o.match;if(s.name=!0,!r.consumable.test(i.viewItem,s))return;const a=function(t,e,n){return t instanceof Function?t(e,n):n.writer.createElement(t)}(t.model,i.viewItem,r);a&&r.safeInsert(a,i.modelCursor)&&(r.consumable.consume(i.viewItem,s),r.convertChildren(i.viewItem,a),r.updateConversionResult(a,i))}}function Qe(t,e=null){const n=null===e||(t=>t.getAttribute(e)),i="object"!=typeof t.model?t.model:t.model.key,r="object"!=typeof t.model||void 0===t.model.value?n:t.model.value;t.model={key:i,value:r}}function Xe(t,e){const n=new sh(t.view);return(i,r,o)=>{if(!r.modelRange&&e)return;const s=n.match(r.viewItem);if(!s)return;if(function(t,e){const n="function"==typeof t?t(e):t;return!("object"==typeof n&&!Je(n))&&(!n.classes&&!n.attributes&&!n.styles)}(t.view,r.viewItem)?s.match.name=!0:delete s.match.name,!o.consumable.test(r.viewItem,s.match))return;const a=t.model.key,c="function"==typeof t.model.value?t.model.value(r.viewItem,o):t.model.value;if(null===c)return;r.modelRange||Object.assign(r,o.convertChildren(r.viewItem,r.modelCursor));const l=function(t,e,n,i){let r=!1;for(const o of Array.from(t.getItems({shallow:n})))i.schema.checkAttribute(o,e.key)&&(r=!0,o.hasAttribute(e.key)||i.writer.setAttribute(e.key,e.value,o));return r}(r.modelRange,{key:a,value:c},e,o);l&&(o.consumable.test(r.viewItem,{name:!0})&&(s.match.name=!0),o.consumable.consume(r.viewItem,s.match))}}function Ze(t,e){return{view:`${t.view}-${e}`,model:(e,n)=>{const i=e.getAttribute("name"),r=t.model(i,n);return n.writer.createElement("$marker",{"data-name":r})}}}function tn(t,e){const n={name:e,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],allowChildren:[],inheritTypesFrom:[]};return function(t,e){for(const n of t){const t=Object.keys(n).filter((t=>t.startsWith("is")));for(const i of t)e[i]=!!n[i]}}(t,n),un(t,n,"allowIn"),un(t,n,"allowContentOf"),un(t,n,"allowWhere"),un(t,n,"allowAttributes"),un(t,n,"allowAttributesOf"),un(t,n,"allowChildren"),un(t,n,"inheritTypesFrom"),function(t,e){for(const n of t){const t=n.inheritAllFrom;t&&(e.allowContentOf.push(t),e.allowWhere.push(t),e.allowAttributesOf.push(t),e.inheritTypesFrom.push(t))}}(t,n),n}function en(t,e){const n=t[e];for(const i of n.allowChildren){const n=t[i];n&&n.allowIn.push(e)}n.allowChildren.length=0}function nn(t,e){for(const n of t[e].allowContentOf)t[n]&&hn(t,n).forEach((t=>{t.allowIn.push(e)}));delete t[e].allowContentOf}function rn(t,e){for(const n of t[e].allowWhere){const i=t[n];if(i){const n=i.allowIn;t[e].allowIn.push(...n)}}delete t[e].allowWhere}function on(t,e){for(const n of t[e].allowAttributesOf){const i=t[n];if(i){const n=i.allowAttributes;t[e].allowAttributes.push(...n)}}delete t[e].allowAttributesOf}function sn(t,e){const n=t[e];for(const e of n.inheritTypesFrom){const i=t[e];if(i){const t=Object.keys(i).filter((t=>t.startsWith("is")));for(const e of t)e in n||(n[e]=i[e])}}delete n.inheritTypesFrom}function an(t,e){const n=t[e],i=n.allowIn.filter((e=>t[e]));n.allowIn=Array.from(new Set(i))}function cn(t,e){const n=t[e];for(const i of n.allowIn)t[i].allowChildren.push(e)}function ln(t,e){const n=t[e];n.allowAttributes=Array.from(new Set(n.allowAttributes))}function un(t,e,n){for(const i of t){const t=i[n];"string"==typeof t?e[n].push(t):Array.isArray(t)&&e[n].push(...t)}}function hn(t,e){const n=t[e];return(i=t,Object.keys(i).map((t=>i[t]))).filter((t=>t.allowIn.includes(n.name)));var i}function dn(t){return"string"==typeof t||t.is("documentFragment")?{name:"string"==typeof t?t:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:t.is("element")?t.name:"$text",*getAttributeKeys(){yield*t.getAttributeKeys()},getAttribute:e=>t.getAttribute(e)}}function fn(t,e,n){for(const i of e.getAttributeKeys())t.checkAttribute(e,i)||n.removeAttribute(i,e)}function*mn(t){if(t.model.values)for(const e of t.model.values){const n={key:t.model.key,value:e},i=t.view[e],r=t.upcastAlso?t.upcastAlso[e]:void 0;yield*gn(n,i,r)}else yield*gn(t.model,t.view,t.upcastAlso)}function*gn(t,e,n){if(yield{model:t,view:e},n)for(const e of mt(n))yield{model:t,view:e}}function pn(t,e){const n=bn(e),i=n.reduce(((t,e)=>t+e.offsetSize),0),r=t.parent;_n(t);const o=t.index;return r._insertChild(o,n),yn(r,o+n.length),yn(r,o),new Bf(t,t.getShiftedBy(i))}function wn(t){if(!t.isFlat)throw new qs("operation-utils-remove-range-not-flat",this);const e=t.start.parent;_n(t.start),_n(t.end);const n=e._removeChildren(t.start.index,t.end.index-t.start.index);return yn(e,t.start.index),n}function vn(t,e){if(!t.isFlat)throw new qs("operation-utils-move-range-not-flat",this);const n=wn(t);return pn(e=e._getTransformedByDeletion(t.start,t.end.offset-t.start.offset),n)}function bn(t){const e=[];!function t(n){if("string"==typeof n)e.push(new If(n));else if(n instanceof Mf)e.push(new If(n.data,n.getAttributes()));else if(n instanceof Rf)e.push(n);else if(S(n))for(const e of n)t(e)}(t);for(let t=1;t<e.length;t++){const n=e[t],i=e[t-1];n instanceof If&&i instanceof If&&kn(n,i)&&(e.splice(t-1,2,new If(i.data+n.data,i.getAttributes())),t--)}return e}function yn(t,e){const n=t.getChild(e-1),i=t.getChild(e);if(n&&i&&n.is("$text")&&i.is("$text")&&kn(n,i)){const r=new If(n.data+i.data,n.getAttributes());t._removeChildren(e-1,2),t._insertChild(e-1,r)}}function _n(t){const e=t.textNode,n=t.parent;if(e){const i=t.offset-e.startOffset,r=e.index;n._removeChildren(r,1);const o=new If(e.data.substr(0,i),e.getAttributes()),s=new If(e.data.substr(i),e.getAttributes());n._insertChild(r,[o,s])}}function kn(t,e){const n=t.getAttributes(),i=e.getAttributes();for(const t of n){if(t[1]!==e.getAttribute(t[0]))return!1;i.next()}return i.next().done}function An(t,e,n){let i=bm.get(t);i||(i=new Map,bm.set(t,i)),i.set(e,n)}function xn(t){return[t]}function Tn(t,e,n={}){const i=function(t,e){const n=bm.get(t);return n&&n.has(e)?n.get(e):xn}(t.constructor,e.constructor);try{return i(t=t.clone(),e,n)}catch(t){throw t}}function Cn(t,e,n){t=t.slice(),e=e.slice();const i=new ym(n.document,n.useRelations,n.forceWeakRemove);i.setOriginalOperations(t),i.setOriginalOperations(e);const r=i.originalOperations;if(0==t.length||0==e.length)return{operationsA:t,operationsB:e,originalOperations:r};const o=new WeakMap;for(const e of t)o.set(e,0);const s={nextBaseVersionA:t[t.length-1].baseVersion+1,nextBaseVersionB:e[e.length-1].baseVersion+1,originalOperationsACount:t.length,originalOperationsBCount:e.length};let a=0;for(;a<t.length;){const n=t[a],r=o.get(n);if(r==e.length){a++;continue}const s=e[r],c=Tn(n,s,i.getContext(n,s,!0)),l=Tn(s,n,i.getContext(s,n,!1));i.updateRelation(n,s),i.setOriginalOperations(c,n),i.setOriginalOperations(l,s);for(const t of c)o.set(t,r+l.length);t.splice(a,1,...c),e.splice(r,1,...l)}if(n.padWithNoOps){const n=t.length-s.originalOperationsACount,i=e.length-s.originalOperationsBCount;Sn(t,i-n),Sn(e,n-i)}return En(t,s.nextBaseVersionB),En(e,s.nextBaseVersionA),{operationsA:t,operationsB:e,originalOperations:r}}function En(t,e){for(const n of t)n.baseVersion=e++}function Sn(t,e){for(let n=0;n<e;n++)t.push(new fm(0))}function Pn(t,e,n){const i=t.nodes.getNode(0).getAttribute(e);if(i==n)return null;const r=new Bf(t.position,t.position.getShiftedBy(t.howMany));return new dm(r,e,i,n,0)}function Rn(t,e){return null===t.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany)}function On(t,e){const n=[];for(let i=0;i<t.length;i++){const r=t[i],o=new cm(r.start,r.end.offset-r.start.offset,e,0);n.push(o);for(let e=i+1;e<t.length;e++)t[e]=t[e]._getTransformedByMove(o.sourcePosition,o.targetPosition,o.howMany)[0];e=e._getTransformedByMove(o.sourcePosition,o.targetPosition,o.howMany)}return n}function In(){this.listenTo(this.root.document.model,"applyOperation",((t,e)=>{const n=e[0];n.isDocumentOperation&&Mn.call(this,n)}),{priority:"low"})}function Mn(t){const e=this.getTransformedByOperation(t);if(!this.isEqual(e)){const t=this.toPosition();this.path=e.path,this.root=e.root,this.fire("change",t)}}function Nn(t){const e=[];for(const n of t)if(n.is("$text"))for(let t=0;t<n.data.length;t++)e.push({name:"$text",attributes:new Map(n.getAttributes())});else e.push({name:n.name,attributes:new Map(n.getAttributes())});return e}function Vn(t,e){const n=[];let i=0,r=0;for(const t of e){if(t.offset>i){for(let e=0;e<t.offset-i;e++)n.push("e");r+=t.offset-i}if("insert"==t.type){for(let e=0;e<t.howMany;e++)n.push("i");i=t.offset+t.howMany}else if("remove"==t.type){for(let e=0;e<t.howMany;e++)n.push("r");i=t.offset,r+=t.howMany}else n.push(..."a".repeat(t.howMany).split("")),i=t.offset+t.howMany,r+=t.howMany}if(r<t)for(let e=0;e<t-r-i;e++)n.push("e");return n}function Dn(t){const e="position"in t&&"$graveyard"==t.position.root.rootName,n="range"in t&&"$graveyard"==t.range.root.rootName;return!e&&!n}function Bn(t){const e=t.textNode;if(e){const n=e.data,i=t.offset-e.startOffset;return!bt(n,i)&&!yt(n,i)}return!0}function Fn(t,e,n,i){function r(){const i=new Bf(u,a),r=i.root.document?s.version:null,l=new dm(i,e,c,n,r);t.batch.addOperation(l),o.applyOperation(l)}const o=t.model,s=o.document;let a,c,l,u=i.start;for(const t of i.getWalker({shallow:!0}))l=t.item.getAttribute(e),a&&c!=l&&(c!=n&&r(),u=a),a=t.nextPosition,c=l;a instanceof Df&&a!=u&&c!=n&&r()}function Ln(t,e,n,i){const r=t.model,o=r.document,s=i.getAttribute(e);let a,c;if(s!=n){if(i.root===i){const t=i.document?o.version:null;c=new gm(i,e,s,n,t)}else{a=new Bf(Df._createBefore(i),t.createPositionAfter(i));const r=a.root.document?o.version:null;c=new dm(a,e,s,n,r)}t.batch.addOperation(c),r.applyOperation(c)}}function zn(t,e,n,i,r){const o=t.model,s=o.document,a=new um(e,n,i,o.markers,!!r,s.version);t.batch.addOperation(a),o.applyOperation(a)}function jn(t,e,n,i){let r;if(t.root.document){const n=i.document,o=new Df(n.graveyard,[0]);r=new cm(t,e,o,n.version)}else r=new Rm(t,e);n.addOperation(r),i.applyOperation(r)}function Hn(t,e){return t===e||t instanceof Tm&&e instanceof Tm}function Un(t){t.document.registerPostFixer((e=>function(t,e){const n=e.document.selection,i=e.schema,r=[];let o=!1;for(const t of n.getRanges()){const e=Wn(t,i);e&&!e.isEqual(t)?(r.push(e),o=!0):r.push(t)}return o&&t.setSelection(function(t){const e=[...t],n=new Set;let i=1;for(;i<e.length;){const t=e[i],r=e.slice(0,i);for(const[o,s]of r.entries())if(!n.has(o))if(t.isEqual(s))n.add(o);else if(t.isIntersecting(s)){n.add(o),n.add(i);const r=t.getJoined(s);e.push(r)}i++}return e.filter(((t,e)=>!n.has(e)))}(r),{backward:n.isBackward}),!1}(e,t)))}function Wn(t,e){return t.isCollapsed?function(t,e){const n=t.start,i=e.getNearestSelectionRange(n);if(!i){const t=n.getAncestors().reverse().find((t=>e.isObject(t)));return t?Bf._createOn(t):null}if(!i.isCollapsed)return i;const r=i.start;return n.isEqual(r)?null:new Bf(r)}(t,e):function(t,e){const{start:n,end:i}=t,r=e.checkChild(n,"$text"),o=e.checkChild(i,"$text"),s=e.getLimitElement(n),a=e.getLimitElement(i);if(s===a){if(r&&o)return null;if(function(t,e,n){const i=t.nodeAfter&&!n.isLimit(t.nodeAfter)||n.checkChild(t,"$text"),r=e.nodeBefore&&!n.isLimit(e.nodeBefore)||n.checkChild(e,"$text");return i||r}(n,i,e)){const t=n.nodeAfter&&e.isSelectable(n.nodeAfter)?null:e.getNearestSelectionRange(n,"forward"),r=i.nodeBefore&&e.isSelectable(i.nodeBefore)?null:e.getNearestSelectionRange(i,"backward"),o=t?t.start:n,s=r?r.end:i;return new Bf(o,s)}}const c=s&&!s.is("rootElement"),l=a&&!a.is("rootElement");if(c||l){const t=n.nodeAfter&&i.nodeBefore&&n.nodeAfter.parent===i.nodeBefore.parent,r=c&&(!t||!qn(n.nodeAfter,e)),o=l&&(!t||!qn(i.nodeBefore,e));let u=n,h=i;return r&&(u=Df._createBefore($n(s,e))),o&&(h=Df._createAfter($n(a,e))),new Bf(u,h)}return null}(t,e)}function $n(t,e){let n=t,i=n;for(;e.isLimit(i)&&i.parent;)n=i,i=i.parent;return n}function qn(t,e){return t&&e.isSelectable(t)}function Kn(t,e,n={}){if(e.isCollapsed)return;const i=e.getFirstRange();if("$graveyard"==i.root.rootName)return;const r=t.schema;t.change((t=>{if(!n.doNotResetEntireContent&&function(t,e){const n=t.getLimitElement(e);if(!e.containsEntireContent(n))return!1;const i=e.getFirstRange();return i.start.parent!=i.end.parent&&t.checkChild(n,"paragraph")}(r,e))return void function(t,e){const n=t.model.schema.getLimitElement(e);t.remove(t.createRangeIn(n)),Qn(t,t.createPositionAt(n,0),e)}(t,e);const o={};if(!n.doNotAutoparagraph){const t=e.getSelectedElement();t&&Object.assign(o,r.getAttributesWithProperty(t,"copyOnReplace",!0))}const[s,a]=function(t){const e=t.root.document.model,n=t.start;let i=t.end;if(e.hasContent(t,{ignoreMarkers:!0})){const n=function(t){const e=t.parent,n=e.root.document.model.schema,i=e.getAncestors({parentFirst:!0,includeSelf:!0});for(const t of i){if(n.isLimit(t))return null;if(n.isBlock(t))return t}}(i);if(n&&i.isTouching(e.createPositionAt(n,0))){const n=e.createSelection(t);e.modifySelection(n,{direction:"backward"});const r=n.getLastPosition(),o=e.createRange(r,i);e.hasContent(o,{ignoreMarkers:!0})||(i=r)}}return[_m.fromPosition(n,"toPrevious"),_m.fromPosition(i,"toNext")]}(i);s.isTouching(a)||t.remove(t.createRange(s,a)),n.leaveUnmerged||(function(t,e,n){const i=t.model;if(!Yn(t.model.schema,e,n))return;const[r,o]=function(t,e){const n=t.getAncestors(),i=e.getAncestors();let r=0;for(;n[r]&&n[r]==i[r];)r++;return[n[r],i[r]]}(e,n);r&&o&&(!i.hasContent(r,{ignoreMarkers:!0})&&i.hasContent(o,{ignoreMarkers:!0})?Jn(t,e,n,r.parent):Gn(t,e,n,r.parent))}(t,s,a),r.removeDisallowedAttributes(s.parent.getChildren(),t)),Xn(t,e,s),!n.doNotAutoparagraph&&function(t,e){const n=t.checkChild(e,"$text"),i=t.checkChild(e,"paragraph");return!n&&i}(r,s)&&Qn(t,s,e,o),s.detach(),a.detach()}))}function Gn(t,e,n,i){const r=e.parent,o=n.parent;if(r!=i&&o!=i){for(e=t.createPositionAfter(r),(n=t.createPositionBefore(o)).isEqual(e)||t.insert(o,e),t.merge(e);n.parent.isEmpty;){const e=n.parent;n=t.createPositionBefore(e),t.remove(e)}Yn(t.model.schema,e,n)&&Gn(t,e,n,i)}}function Jn(t,e,n,i){const r=e.parent,o=n.parent;if(r!=i&&o!=i){for(e=t.createPositionAfter(r),(n=t.createPositionBefore(o)).isEqual(e)||t.insert(r,n);e.parent.isEmpty;){const n=e.parent;e=t.createPositionBefore(n),t.remove(n)}n=t.createPositionBefore(o),function(t,e){const n=e.nodeBefore,i=e.nodeAfter;n.name!=i.name&&t.rename(n,i.name),t.clearAttributes(n),t.setAttributes(Object.fromEntries(i.getAttributes()),n),t.merge(e)}(t,n),Yn(t.model.schema,e,n)&&Jn(t,e,n,i)}}function Yn(t,e,n){const i=e.parent,r=n.parent;return i!=r&&!t.isLimit(i)&&!t.isLimit(r)&&function(t,e,n){const i=new Bf(t,e);for(const t of i.getWalker())if(n.isLimit(t.item))return!1;return!0}(e,n,t)}function Qn(t,e,n,i={}){const r=t.createElement("paragraph");t.model.schema.setAllowedAttributes(r,i,t),t.insert(r,e),Xn(t,n,t.createPositionAt(r,0))}function Xn(t,e,n){e instanceof Wf?t.setSelection(n):e.setTo(n)}function Zn(t,e){const n=[];Array.from(t.getItems({direction:"backward"})).map((t=>e.createRangeOn(t))).filter((e=>(e.start.isAfter(t.start)||e.start.isEqual(t.start))&&(e.end.isBefore(t.end)||e.end.isEqual(t.end)))).forEach((t=>{n.push(t.start.parent),e.remove(t)})),n.forEach((t=>{let n=t;for(;n.parent&&n.isEmpty;){const t=e.createRangeOn(n);n=n.parent,e.remove(t)}}))}function ti(t,e,n="auto"){const i=t.getSelectedElement();if(i&&e.schema.isObject(i)&&!e.schema.isInline(i))return"before"==n||"after"==n?e.createRange(e.createPositionAt(i,n)):e.createRangeOn(i);const r=wt(t.getSelectedBlocks());if(!r)return e.createRange(t.focus);if(r.isEmpty)return e.createRange(e.createPositionAt(r,0));const o=e.createPositionAfter(r);return t.focus.isTouching(o)?e.createRange(o):e.createRange(e.createPositionBefore(r))}function ei(t,e,n,i,r={}){if(!t.schema.isObject(e))throw new qs("insertobject-element-not-an-object",t,{object:e});let o;o=n?n instanceof jf||n instanceof Wf?n:t.createSelection(n,i):t.document.selection;let s=o;r.findOptimalPosition&&t.schema.isBlock(e)&&(s=t.createSelection(ti(o,t,r.findOptimalPosition)));const a=wt(o.getSelectedBlocks()),c={};return a&&Object.assign(c,t.schema.getAttributesWithProperty(a,"copyOnReplace",!0)),t.change((n=>{s.isCollapsed||t.deleteContent(s,{doNotAutoparagraph:!0});let i=e;const o=s.anchor.parent;!t.schema.checkChild(o,e)&&t.schema.checkChild(o,"paragraph")&&t.schema.checkChild("paragraph",e)&&(i=n.createElement("paragraph"),n.insert(e,i)),t.schema.setAllowedAttributes(i,c,n);const a=t.insertContent(i,s);return a.isCollapsed||r.setSelection&&function(t,e,n,i){const r=t.model;if("on"==n)return void t.setSelection(e,"on");if("after"!=n)throw new qs("insertobject-invalid-place-parameter-value",r);let o=e.nextSibling;r.schema.isInline(e)?t.setSelection(e,"after"):(o&&r.schema.checkChild(o,"$text")||!r.schema.checkChild(e.parent,"paragraph")||(o=t.createElement("paragraph"),r.schema.setAllowedAttributes(o,i,t),r.insertContent(o,t.createPositionAfter(e))),o&&t.setSelection(o,0))}(n,e,r.setSelection,c),a}))}function ni(t,e){const{isForward:n,walker:i,unit:r,schema:o,treatEmojiAsSingleUnit:s}=t,{type:a,item:c,nextPosition:l}=e;if("text"==a)return"word"===t.unit?function(t,e){let n=t.position.textNode;for(n||(n=e?t.position.nodeAfter:t.position.nodeBefore);n&&n.is("$text");){const i=t.position.offset-n.startOffset;if(oi(n,i,e))n=e?t.position.nodeAfter:t.position.nodeBefore;else{if(ri(n.data,i,e))break;t.next()}}return t.position}(i,n):function(t,e,n){const i=t.position.textNode;if(i){const r=i.data;let o=t.position.offset-i.startOffset;for(;bt(r,o)||"character"==e&&yt(r,o)||n&&_t(r,o);)t.next(),o=t.position.offset-i.startOffset}return t.position}(i,r,s);if(a==(n?"elementStart":"elementEnd")){if(o.isSelectable(c))return Df._createAt(c,n?"after":"before");if(o.checkChild(l,"$text"))return l}else{if(o.isLimit(c))return void i.skip((()=>!0));if(o.checkChild(l,"$text"))return l}}function ii(t,e){const n=t.root,i=Df._createAt(n,e?"end":0);return e?new Bf(t,i):new Bf(i,t)}function ri(t,e,n){const i=e+(n?0:-1);return' ,.?!:;"-()'.includes(t.charAt(i))}function oi(t,e,n){return e===(n?t.offsetSize:0)}function si(t=""){if(""===t)return{top:void 0,right:void 0,bottom:void 0,left:void 0};const e=t.replace(/, /g,",").split(" ").map((t=>t.replace(/,/g,", "))),n=e[0],i=e[2]||n,r=e[1]||n;return{top:n,bottom:i,right:r,left:e[3]||r}}function ai({top:t,right:e,bottom:n,left:i}){const r=[];return i!==e?r.push(t,e,n,i):n!==t?r.push(t,e,n):e!==t?r.push(t,e):r.push(t),r.join(" ")}function ci(t){var e,n;t.setNormalizer("margin",(e="margin",t=>({path:e,value:si(t)}))),t.setNormalizer("margin-top",(t=>({path:"margin.top",value:t}))),t.setNormalizer("margin-right",(t=>({path:"margin.right",value:t}))),t.setNormalizer("margin-bottom",(t=>({path:"margin.bottom",value:t}))),t.setNormalizer("margin-left",(t=>({path:"margin.left",value:t}))),t.setReducer("margin",(n="margin",t=>{const{top:e,right:i,bottom:r,left:o}=t,s=[];return[e,i,o,r].every((t=>!!t))?s.push([n,ai(t)]):(e&&s.push([n+"-top",e]),i&&s.push([n+"-right",i]),r&&s.push([n+"-bottom",r]),o&&s.push([n+"-left",o])),s})),t.setStyleRelation("margin",["margin-top","margin-right","margin-bottom","margin-left"])}function li(t){return class extends t{setData(t){this.data.set(t)}getData(t){return this.data.get(t)}}}function ui(t){return class extends t{updateSourceElement(t=this.data.get()){if(!this.sourceElement)throw new qs("editor-missing-sourceelement",this);const e=this.config.get("updateSourceElementOnDestroy"),n=this.sourceElement instanceof HTMLTextAreaElement;q(this.sourceElement,e||n?t:"")}}}function hi({emitter:t,activator:e,callback:n,contextElements:i}){t.listenTo(document,"mousedown",((t,r)=>{if(!e())return;const o="function"==typeof r.composedPath?r.composedPath():[],s="function"==typeof i?i():i;for(const t of s)if(t.contains(r.target)||o.includes(t))return;n()}))}function di(t){const e=t;e.set("_isCssTransitionsDisabled",!1),e.disableCssTransitions=()=>{e._isCssTransitionsDisabled=!0},e.enableCssTransitions=()=>{e._isCssTransitionsDisabled=!1},e.extendTemplate({attributes:{class:[e.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}function fi({view:t}){t.listenTo(t.element,"submit",((e,n)=>{n.preventDefault(),t.fire("submit")}),{useCapture:!0})}function mi({keystrokeHandler:t,focusTracker:e,gridItems:n,numberOfColumns:i,uiLanguageDirection:r}){function o(t){return i=>{const r=n.find((t=>t.element===e.focusedElement)),o=n.getIndex(r),s=t(o,n);n.get(s).focus(),i.stopPropagation(),i.preventDefault()}}function s(t,e){return t===e-1?0:t+1}function a(t,e){return 0===t?e-1:t-1}const c="number"==typeof i?()=>i:i;t.set("arrowright",o(((t,e)=>"rtl"===r?a(t,e.length):s(t,e.length)))),t.set("arrowleft",o(((t,e)=>"rtl"===r?s(t,e.length):a(t,e.length)))),t.set("arrowup",o(((t,e)=>{let n=t-c();return n<0&&(n=t+c()*Math.floor(e.length/c()),n>e.length-1&&(n-=c())),n}))),
t.set("arrowdown",o(((t,e)=>{let n=t+c();return n>e.length-1&&(n=t%c()),n})))}function gi(t){return!!t&&(t.value&&(t=t.value),Array.isArray(t)?t.some(gi):t instanceof ng)}function pi(t,e,{node:n}){const i=function(t,e){return t.map((t=>t instanceof ng?t.getValue(e):t))}(t,n);let r;r=1==t.length&&t[0]instanceof rg?i[0]:i.reduce(Ai,""),Ci(r)?e.remove():e.set(r)}function wi(t){return{set(e){t.textContent=e},remove(){t.textContent=""}}}function vi(t,e,n){return{set(i){t.setAttributeNS(n,e,i)},remove(){t.removeAttributeNS(n,e)}}}function bi(t,e){return{set(n){t.style[e]=n},remove(){t.style[e]=null}}}function yi(t){return ku(t,(t=>{if(t&&(t instanceof ng||Si(t)||Ei(t)||Pi(t)))return t}))}function _i(t){if("string"==typeof t?t=function(t){return{text:[t]}}(t):t.text&&function(t){t.text=mt(t.text)}(t),t.on&&(t.eventListeners=function(t){for(const e in t)ki(t,e);return t}(t.on),delete t.on),!t.text){t.attributes&&function(t){for(const e in t)t[e].value&&(t[e].value=mt(t[e].value)),ki(t,e)}(t.attributes);const e=[];if(t.children)if(Pi(t.children))e.push(t.children);else for(const n of t.children)Si(n)||Ei(n)||V(n)?e.push(n):e.push(new eg(n));t.children=e}return t}function ki(t,e){t[e]=mt(t[e])}function Ai(t,e){return Ci(e)?t:Ci(t)?e:`${t} ${e}`}function xi(t,e){for(const n in e)t[n]?t[n].push(...e[n]):t[n]=e[n]}function Ti(t,e){if(e.attributes&&(t.attributes||(t.attributes={}),xi(t.attributes,e.attributes)),e.eventListeners&&(t.eventListeners||(t.eventListeners={}),xi(t.eventListeners,e.eventListeners)),e.text&&t.text.push(...e.text),e.children&&e.children.length){if(t.children.length!=e.children.length)throw new qs("ui-template-extend-children-mismatch",t);let n=0;for(const i of e.children)Ti(t.children[n++],i)}}function Ci(t){return!t&&0!==t}function Ei(t){return t instanceof tg}function Si(t){return t instanceof eg}function Pi(t){return t instanceof Ym}function Ri(t){return Zs(t[0])&&t[0].ns}function Oi(t){return"class"==t||"style"==t}function Ii(t){return String(t).toLowerCase()}function Mi(t){return!(!t.focus||!Q(t.element))}function Ni(t){return Array.isArray(t)?{items:t,removeItems:[]}:t?Object.assign({items:[],removeItems:[]},t):{items:[],removeItems:[]}}function Vi(t,e=Eg){const n=new e(t),i=new Ig(t),r=new Tg(t,n,i);return n.bind("isEnabled").to(r),n instanceof Og?n.arrowView.bind("isOn").to(r,"isOpen"):n.bind("isOn").to(r,"isOpen"),function(t){(function(t){t.on("render",(()=>{hi({emitter:t,activator:()=>t.isOpen,callback:()=>{t.isOpen=!1},contextElements:[t.element]})}))})(t),function(t){t.on("execute",(e=>{e.source instanceof wg||(t.isOpen=!1)}))}(t),function(t){t.focusTracker.on("change:isFocused",((e,n,i)=>{t.isOpen&&!i&&(t.isOpen=!1)}))}(t),function(t){t.keystrokes.set("arrowdown",((e,n)=>{t.isOpen&&(t.panelView.focus(),n())})),t.keystrokes.set("arrowup",((e,n)=>{t.isOpen&&(t.panelView.focusLast(),n())}))}(t),function(t){t.on("change:isOpen",((e,n,i)=>{if(i)return;const r=t.panelView.element;r&&r.contains(Su.document.activeElement)&&t.buttonView.focus()}))}(t),function(t){t.on("change:isOpen",((e,n,i)=>{i&&t.panelView.focus()}),{priority:"low"})}(t)}(r),r}function Di(t,e,n={}){t.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),t.isOpen?Bi(t,e,n):t.once("change:isOpen",(()=>Bi(t,e,n)),{priority:"highest"}),n.enableActiveItemFocusOnDropdownOpen&&zi(t,(()=>t.toolbarView.items.find((t=>t.isOn))))}function Bi(t,e,n){const i=t.locale,r=i.t,o=t.toolbarView=new jg(i),s="function"==typeof e?e():e;o.ariaLabel=n.ariaLabel||r("Dropdown toolbar"),n.maxWidth&&(o.maxWidth=n.maxWidth),n.class&&(o.class=n.class),n.isCompact&&(o.isCompact=n.isCompact),n.isVertical&&(o.isVertical=!0),s instanceof Ym?o.items.bindTo(s).using((t=>t)):o.items.addMany(s),t.panelView.children.add(o),o.items.delegate("execute").to(t)}function Fi(t,e,n={}){t.isOpen?Li(t,e,n):t.once("change:isOpen",(()=>Li(t,e,n)),{priority:"highest"}),zi(t,(()=>t.listView.items.find((t=>t instanceof Jg&&t.children.first.isOn))))}function Li(t,e,n){const i=t.locale,r=t.listView=new Gg(i),o="function"==typeof e?e():e;r.ariaLabel=n.ariaLabel,r.items.bindTo(o).using((t=>{if("separator"===t.type)return new Yg(i);if("button"===t.type||"switchbutton"===t.type){const e=new Jg(i);let n;return n="button"===t.type?new fg(i):new wg(i),n.bind(...Object.keys(t.model)).to(t.model),n.delegate("execute").to(e),e.children.add(n),e}return null})),t.panelView.children.add(r),r.items.delegate("execute").to(t)}function zi(t,e){t.on("change:isOpen",(()=>{if(!t.isOpen)return;const n=e();n&&("function"==typeof n.focus?n.focus():l("ui-dropdown-focus-child-on-open-child-missing-focus",{view:n}))}),{priority:$s.low-10})}function ji(t){return Au(t)?t:j(t)?t.commonAncestorContainer:"function"==typeof t?ji(t()):null}function Hi(t={}){function e(t,e){return t.top-e.height-r}function n(t){return t.bottom+r}const{sideOffset:i=cp.arrowSideOffset,heightOffset:r=cp.arrowHeightOffset,stickyVerticalOffset:o=cp.stickyVerticalOffset,config:s}=t;return{northWestArrowSouthWest:(t,n)=>({top:e(t,n),left:t.left-i,name:"arrow_sw",...s&&{config:s}}),northWestArrowSouthMiddleWest:(t,n)=>({top:e(t,n),left:t.left-.25*n.width-i,name:"arrow_smw",...s&&{config:s}}),northWestArrowSouth:(t,n)=>({top:e(t,n),left:t.left-n.width/2,name:"arrow_s",...s&&{config:s}}),northWestArrowSouthMiddleEast:(t,n)=>({top:e(t,n),left:t.left-.75*n.width+i,name:"arrow_sme",...s&&{config:s}}),northWestArrowSouthEast:(t,n)=>({top:e(t,n),left:t.left-n.width+i,name:"arrow_se",...s&&{config:s}}),northArrowSouthWest:(t,n)=>({top:e(t,n),left:t.left+t.width/2-i,name:"arrow_sw",...s&&{config:s}}),northArrowSouthMiddleWest:(t,n)=>({top:e(t,n),left:t.left+t.width/2-.25*n.width-i,name:"arrow_smw",...s&&{config:s}}),northArrowSouth:(t,n)=>({top:e(t,n),left:t.left+t.width/2-n.width/2,name:"arrow_s",...s&&{config:s}}),northArrowSouthMiddleEast:(t,n)=>({top:e(t,n),left:t.left+t.width/2-.75*n.width+i,name:"arrow_sme",...s&&{config:s}}),northArrowSouthEast:(t,n)=>({top:e(t,n),left:t.left+t.width/2-n.width+i,name:"arrow_se",...s&&{config:s}}),northEastArrowSouthWest:(t,n)=>({top:e(t,n),left:t.right-i,name:"arrow_sw",...s&&{config:s}}),northEastArrowSouthMiddleWest:(t,n)=>({top:e(t,n),left:t.right-.25*n.width-i,name:"arrow_smw",...s&&{config:s}}),northEastArrowSouth:(t,n)=>({top:e(t,n),left:t.right-n.width/2,name:"arrow_s",...s&&{config:s}}),northEastArrowSouthMiddleEast:(t,n)=>({top:e(t,n),left:t.right-.75*n.width+i,name:"arrow_sme",...s&&{config:s}}),northEastArrowSouthEast:(t,n)=>({top:e(t,n),left:t.right-n.width+i,name:"arrow_se",...s&&{config:s}}),southWestArrowNorthWest:t=>({top:n(t),left:t.left-i,name:"arrow_nw",...s&&{config:s}}),southWestArrowNorthMiddleWest:(t,e)=>({top:n(t),left:t.left-.25*e.width-i,name:"arrow_nmw",...s&&{config:s}}),southWestArrowNorth:(t,e)=>({top:n(t),left:t.left-e.width/2,name:"arrow_n",...s&&{config:s}}),southWestArrowNorthMiddleEast:(t,e)=>({top:n(t),left:t.left-.75*e.width+i,name:"arrow_nme",...s&&{config:s}}),southWestArrowNorthEast:(t,e)=>({top:n(t),left:t.left-e.width+i,name:"arrow_ne",...s&&{config:s}}),southArrowNorthWest:t=>({top:n(t),left:t.left+t.width/2-i,name:"arrow_nw",...s&&{config:s}}),southArrowNorthMiddleWest:(t,e)=>({top:n(t),left:t.left+t.width/2-.25*e.width-i,name:"arrow_nmw",...s&&{config:s}}),southArrowNorth:(t,e)=>({top:n(t),left:t.left+t.width/2-e.width/2,name:"arrow_n",...s&&{config:s}}),southArrowNorthMiddleEast:(t,e)=>({top:n(t),left:t.left+t.width/2-.75*e.width+i,name:"arrow_nme",...s&&{config:s}}),southArrowNorthEast:(t,e)=>({top:n(t),left:t.left+t.width/2-e.width+i,name:"arrow_ne",...s&&{config:s}}),southEastArrowNorthWest:t=>({top:n(t),left:t.right-i,name:"arrow_nw",...s&&{config:s}}),southEastArrowNorthMiddleWest:(t,e)=>({top:n(t),left:t.right-.25*e.width-i,name:"arrow_nmw",...s&&{config:s}}),southEastArrowNorth:(t,e)=>({top:n(t),left:t.right-e.width/2,name:"arrow_n",...s&&{config:s}}),southEastArrowNorthMiddleEast:(t,e)=>({top:n(t),left:t.right-.75*e.width+i,name:"arrow_nme",...s&&{config:s}}),southEastArrowNorthEast:(t,e)=>({top:n(t),left:t.right-e.width+i,name:"arrow_ne",...s&&{config:s}}),westArrowEast:(t,e)=>({top:t.top+t.height/2-e.height/2,left:t.left-e.width-r,name:"arrow_e",...s&&{config:s}}),eastArrowWest:(t,e)=>({top:t.top+t.height/2-e.height/2,left:t.right+r,name:"arrow_w",...s&&{config:s}}),viewportStickyNorth:(t,e,n)=>t.getIntersection(n)?{top:n.top+o,left:t.left+t.width/2-e.width/2,name:"arrowless",config:{withArrow:!1,...s}}:null}}function Ui(t){return Au(t)?t.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}function Wi(t){const{toolbarView:e,options:n}=t;let i=10;return Q(e.element)&&i--,n.isContextual&&i--,i}function $i(t,e,n){const i=new Ip(t.locale);return i.set({id:e,ariaDescribedById:n}),i.bind("isReadOnly").to(t,"isEnabled",(t=>!t)),i.bind("hasError").to(t,"errorText",(t=>!!t)),i.on("input",(()=>{t.errorText=null})),t.bind("isEmpty","isFocused","placeholder").to(i),i}function qi(t){return Au(t)}function Ki(t){let e="";if(t.is("$text")||t.is("$textProxy"))e=t.data;else if(t.is("element","img")&&t.hasAttribute("alt"))e=t.getAttribute("alt");else if(t.is("element","br"))e="\n";else{let n=null;for(const i of t.getChildren()){const t=Ki(i);n&&(n.is("containerElement")||i.is("containerElement"))&&(aw.includes(n.name)||aw.includes(i.name)?e+="\n":e+="\n\n"),e+=t,n=i}}return e}function Gi(t,e){if(!e.isEnabled)return;const n=e.buffer;n.lock(),t.enqueueChange(n.batch,(()=>{t.deleteContent(t.document.selection)})),n.unlock()}function Ji(t,e){let n=t.start;return{text:Array.from(t.getItems()).reduce(((t,i)=>i.is("$text")||i.is("$textProxy")?t+i.data:(n=e.createPositionAfter(i),"")),""),range:e.createRange(n,t.end)}}function Yi(t,e){for(const n of e)if(t.hasAttribute(n))return!0;return!1}function Qi(t,e,n){const i=n.nodeBefore;t.change((t=>{i?t.setSelectionAttribute(i.getAttributes()):t.removeSelectionAttribute(e)}))}function Xi(t){t.preventDefault()}function Zi(t,e){const{nodeBefore:n,nodeAfter:i}=t;for(const t of e){const e=n?n.getAttribute(t):void 0;if((i?i.getAttribute(t):void 0)!==e)return!0}return!1}function tr(t){return new RegExp(`(^|\\s)(${t})([^${t}]*)(${t})$`)}function er(t,e,n,i){return i.createRange(nr(t,e,n,!0,i),nr(t,e,n,!1,i))}function nr(t,e,n,i,r){let o=t.textNode||(i?t.nodeBefore:t.nodeAfter),s=null;for(;o&&o.getAttribute(e)==n;)s=o,o=i?o.previousSibling:o.nextSibling;return s?r.createPositionAt(s,i?"before":"after"):t}function*ir(t,e){for(const n of e)n&&t.getAttributeProperties(n[0]).copyOnEnter&&(yield n)}function rr(t,e){t.split(e),t.setSelection(e.parent.nextSibling,0)}function or(t,e,n){const i=e.createElement("softBreak");t.insertContent(i,n),e.setSelection(i,"after")}function sr(t,e){return!t.is("rootElement")&&(e.isLimit(t)||sr(t.parent,e))}function ar(t,e){return t&&e&&t.priority==e.priority&&lr(t.classes)==lr(e.classes)}function cr(t,e){return t.priority>e.priority||!(t.priority<e.priority)&&lr(t.classes)>lr(e.classes)}function lr(t){return Array.isArray(t)?t.sort().join(","):t}function ur(t){return!!t.is("element")&&!!t.getCustomProperty("widget")}function hr(t,e,n={}){if(!t.is("containerElement"))throw new qs("widget-to-widget-wrong-element-type",null,{element:t});return e.setAttribute("contenteditable","false",t),e.addClass("ck-widget",t),e.setCustomProperty("widget",!0,t),t.getFillerOffset=pr,e.setCustomProperty("widgetLabel",[],t),n.label&&function(t,e){t.getCustomProperty("widgetLabel").push(e)}(t,n.label),n.hasSelectionHandle&&function(t,e){const n=e.createUIElement("div",{class:"ck ck-widget__selection-handle"},(function(t){const e=this.toDomElement(t),n=new lg;return n.set("content",Iw),n.render(),e.appendChild(n.element),e}));e.insert(e.createPositionAt(t,0),n),e.addClass(["ck-widget_with-selection-handle"],t)}(t,e),mr(t,e),t}function dr(t,e,n){if(e.classes&&n.addClass(mt(e.classes),t),e.attributes)for(const i in e.attributes)n.setAttribute(i,e.attributes[i],t)}function fr(t,e,n){if(e.classes&&n.removeClass(mt(e.classes),t),e.attributes)for(const i in e.attributes)n.removeAttribute(i,t)}function mr(t,e,n=dr,i=fr){const r=new Ow;r.on("change:top",((e,r)=>{r.oldDescriptor&&i(t,r.oldDescriptor,r.writer),r.newDescriptor&&n(t,r.newDescriptor,r.writer)})),e.setCustomProperty("addHighlight",((t,e,n)=>r.add(e,n)),t),e.setCustomProperty("removeHighlight",((t,e,n)=>r.remove(e,n)),t)}function gr(t,e,n={}){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],t),e.setAttribute("role","textbox",t),n.label&&e.setAttribute("aria-label",n.label,t),e.setAttribute("contenteditable",t.isReadOnly?"false":"true",t),t.on("change:isReadOnly",((n,i,r)=>{e.setAttribute("contenteditable",r?"false":"true",t)})),t.on("change:isFocused",((n,i,r)=>{r?e.addClass("ck-editor__nested-editable_focused",t):e.removeClass("ck-editor__nested-editable_focused",t)})),mr(t,e),t}function pr(){return null}function wr(t,e,n){return!!t&&ur(t)&&!n.isInline(e)}function vr(t){return t.getAttribute(Nw)}function br(t){const e=t.model;return(n,i)=>{const r=i.keyCode==Vu.arrowup,o=i.keyCode==Vu.arrowdown,s=i.shiftKey,a=e.document.selection;if(!r&&!o)return;const c=o;if(s&&function(t,e){return!t.isCollapsed&&t.isBackward==e}(a,c))return;const l=function(t,e,n){const i=t.model;if(n){const t=e.isCollapsed?e.focus:e.getLastPosition(),n=yr(i,t,"forward");if(!n)return null;const r=i.createRange(t,n),o=_r(i.schema,r,"backward");return o?i.createRange(t,o):null}{const t=e.isCollapsed?e.focus:e.getFirstPosition(),n=yr(i,t,"backward");if(!n)return null;const r=i.createRange(n,t),o=_r(i.schema,r,"forward");return o?i.createRange(o,t):null}}(t,a,c);if(l){if(l.isCollapsed){if(a.isCollapsed)return;if(s)return}(l.isCollapsed||function(t,e,n){const i=t.model,r=t.view.domConverter;if(n){const t=i.createSelection(e.start);i.modifySelection(t),t.focus.isAtEnd||e.start.isEqual(t.focus)||(e=i.createRange(t.focus,e.end))}const o=t.mapper.toViewRange(e),s=r.viewRangeToDom(o),a=Ru.getDomRangeRects(s);let c;for(const t of a)if(void 0!==c){if(Math.round(t.top)>=c)return!1;c=Math.max(c,Math.round(t.bottom))}else c=Math.round(t.bottom);return!0}(t,l,c))&&(e.change((t=>{const n=c?l.end:l.start;if(s){const i=e.createSelection(a.anchor);i.setFocus(n),t.setSelection(i)}else t.setSelection(n)})),n.stop(),i.preventDefault(),i.stopPropagation())}}}function yr(t,e,n){const i=t.schema,r=t.createRangeIn(e.root),o="forward"==n?"elementStart":"elementEnd";for(const{previousPosition:t,item:s,type:a}of r.getWalker({startPosition:e,direction:n})){if(i.isLimit(s)&&!i.isInline(s))return t;if(a==o&&i.isBlock(s))return null}return null}function _r(t,e,n){const i="backward"==n?e.end:e.start;if(t.checkChild(i,"$text"))return i;for(const{nextPosition:i}of e.getWalker({direction:n}))if(t.checkChild(i,"$text"))return i;return null}function kr(t,e){return!!e&&Array.from(t.getAncestors()).includes(e)}function Ar(t,e){const n=t.plugins.get("ContextualBalloon"),i=xr(t,e);n.updatePosition(i)}function xr(t,e){const n=t.editing.view,i=cp.defaultPositions;return{target:n.domConverter.mapViewToDom(e),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast,i.viewportStickyNorth]}}function Tr(t,e,n){const i=t.model,r=t.editing.mapper;let o=null;const s=e?e[0].start:null;if(n.is("uiElement")&&(n=n.parent),o=function(t,e){const n=t.model,i=t.editing.mapper;if(ur(e))return n.createRangeOn(i.toModelElement(e));if(!e.is("editableElement")){const t=e.findAncestor((t=>ur(t)||t.is("editableElement")));if(ur(t))return n.createRangeOn(i.toModelElement(t))}return null}(t,n),o)return o;const a=function(t,e){const n=t.editing.mapper,i=t.editing.view,r=n.toModelElement(e);if(r)return r;const o=i.createPositionBefore(e),s=n.findMappedViewAncestor(o);return n.toModelElement(s)}(t,n),c=s?r.toModelPosition(s):null;return c?(o=function(t,e,n){const i=t.model;if(!i.schema.checkChild(n,"$block"))return null;const r=i.createPositionAt(n,0),o=e.path.slice(0,r.path.length),s=i.createPositionFromPath(e.root,o).nodeAfter;return s&&i.schema.isObject(s)?i.createRangeOn(s):null}(t,c,a),o||(o=i.schema.getNearestSelectionRange(c,js.isGecko?"forward":"backward"),o||function(t,e){const n=t.model;let i=e;for(;i;){if(n.schema.isObject(i))return n.createRangeOn(i);i=i.parent}return null}(t,c.parent))):function(t,e){const n=t.model,i=n.schema,r=n.createPositionAt(e,0);return i.getNearestSelectionRange(r,"forward")}(t,a)}function Cr(t){return js.isGecko?t.dropEffect:["all","copyMove"].includes(t.effectAllowed)?"move":"copy"}function Er(t,e){function n(...r){n.cancel(),i=setTimeout((()=>t(...r)),e)}let i;return n.cancel=()=>{clearTimeout(i)},n}function Sr(t){if(t.is("editableElement"))return null;if(t.hasClass("ck-widget__selection-handle"))return t.findAncestor(ur);if(ur(t))return t;const e=t.findAncestor((t=>ur(t)||t.is("editableElement")));return ur(e)?e:null}function Pr(t,e){return t.isLimit(e)&&(t.checkChild(e,"$text")||t.checkChild(e,"paragraph"))}function Rr(t){t.sort(((t,e)=>t.start.isBefore(e.start)?-1:1));for(let e=1;e<t.length;e++){const n=t[e-1].getJoined(t[e],!0);n&&(e--,t.splice(e,2,n))}}function Or(t,e){return e.some((e=>e!==t&&e.containsRange(t,!0)))}function Ir(t,e,n,i){let r,o=null;"function"==typeof i?r=i:(o=t.commands.get(i),r=()=>{t.execute(i)}),t.model.document.on("change:data",((s,a)=>{if(o&&!o.isEnabled||!e.isEnabled)return;const c=wt(t.model.document.selection.getRanges());if(!c.isCollapsed)return;if(a.isUndo||!a.isLocal)return;const l=Array.from(t.model.document.differ.getChanges()),u=l[0];if(1!=l.length||"insert"!==u.type||"$text"!=u.name||1!=u.length)return;const h=u.position.parent;if(h.is("element","codeBlock"))return;if(h.is("element","listItem")&&"function"!=typeof i&&!["numberedList","bulletedList","todoList"].includes(i))return;if(o&&!0===o.value)return;const d=h.getChild(0),f=t.model.createRangeOn(d);if(!f.containsRange(c)&&!c.end.isEqual(f.end))return;const m=n.exec(d.data.substr(0,c.end.offset));m&&t.model.enqueueChange((e=>{const n=e.createPositionAt(h,0),i=e.createPositionAt(h,m[0].length),o=new Hf(n,i);if(!1!==r({match:m})){e.remove(o);const n=t.model.document.selection.getFirstRange(),i=e.createRangeIn(h);!h.isEmpty||i.isEqual(n)||i.containsRange(n,!0)||e.remove(h)}o.detach(),t.model.enqueueChange((()=>{t.plugins.get("Delete").requestUndoOnBackspace()}))}))}))}function Mr(t,e,n,i){let r,o;n instanceof RegExp?r=n:o=n,o=o||(t=>{let e;const n=[],i=[];for(;null!==(e=r.exec(t))&&!(e&&e.length<4);){let{index:t,1:r,2:o,3:s}=e;const a=r+o+s;t+=e[0].length-a.length;const c=[t,t+r.length],l=[t+r.length+o.length,t+r.length+o.length+s.length];n.push(c),n.push(l),i.push([t+r.length,t+r.length+o.length])}return{remove:n,format:i}}),t.model.document.on("change:data",((n,r)=>{if(r.isUndo||!r.isLocal||!e.isEnabled)return;const s=t.model,a=s.document.selection;if(!a.isCollapsed)return;const c=Array.from(s.document.differ.getChanges()),l=c[0];if(1!=c.length||"insert"!==l.type||"$text"!=l.name||1!=l.length)return;const u=a.focus,h=u.parent,{text:d,range:f}=function(t,e){let n=t.start;return{text:Array.from(t.getItems()).reduce(((t,i)=>!i.is("$text")&&!i.is("$textProxy")||i.getAttribute("code")?(n=e.createPositionAfter(i),""):t+i.data),""),range:e.createRange(n,t.end)}}(s.createRange(s.createPositionAt(h,0),u),s),m=o(d),g=Nr(f.start,m.format,s),p=Nr(f.start,m.remove,s);g.length&&p.length&&s.enqueueChange((e=>{if(!1!==i(e,g)){for(const t of p.reverse())e.remove(t);s.enqueueChange((()=>{t.plugins.get("Delete").requestUndoOnBackspace()}))}}))}))}function Nr(t,e,n){return e.filter((t=>void 0!==t[0]&&void 0!==t[1])).map((e=>n.createRange(t.getShiftedBy(e[0]),t.getShiftedBy(e[1]))))}function Vr(t,e){return(n,i)=>{if(!t.commands.get(e).isEnabled)return!1;const r=t.model.schema.getValidRanges(i,e);for(const t of r)n.setAttribute(e,!0,t);n.removeSelectionAttribute(e)}}function Dr(t){return Mv.includes(t)}function Br(t,e){return"rtl"==e.contentLanguageDirection?"right"===t:"left"===t}function Fr(t){const e=t.map((t=>{let e;return e="string"==typeof t?{name:t}:t,e})).filter((t=>{const e=Mv.includes(t.name);return e||l("alignment-config-name-not-recognized",{option:t}),e})),n=e.filter((t=>Boolean(t.className))).length;if(n&&n<e.length)throw new qs("alignment-config-classnames-are-missing",{configuredOptions:t});return e.forEach(((e,n,i)=>{const r=i.slice(n+1);if(r.some((t=>t.name==e.name)))throw new qs("alignment-config-name-already-defined",{option:e,configuredOptions:t});if(e.className&&r.some((t=>t.className==e.className)))throw new qs("alignment-config-classname-already-defined",{option:e,configuredOptions:t})})),e}function Lr(t){return"blockQuote"==t.parent.name?t.parent:null}function zr(t,e){let n,i=0;const r=[];for(;i<e.length;){const o=e[i],s=e[i+1];n||(n=t.createPositionBefore(o)),s&&o.nextSibling==s||(r.push(t.createRange(n,t.createPositionAfter(o))),n=null),i++}return r}function jr(t,e){const n=t.checkChild(e.parent,"blockQuote"),i=t.checkChild(["$root","blockQuote"],e);return n&&i}function Hr(t,{writer:e}){const n=e.createAttributeElement("a",{href:t},{priority:5});return e.setCustomProperty("link",!0,n),n}function Ur(t){return function(t){return t.replace(ub,"").match(hb)}(t=String(t))?t:"#"}function Wr(t,e){return!!t&&e.checkAttribute(t.name,"linkHref")}function $r(t,e){const n=(i=t,db.test(i)?"mailto:":e);var i;const r=!!n&&!qr(t);return t&&r?n+t:t}function qr(t){return fb.test(t)}function Kr(t){window.open(t,"_blank","noopener")}function Gr(t,e){t.removeSelectionAttribute("linkHref");for(const n of e)t.removeSelectionAttribute(n)}function Jr(t){return t.model.change((t=>t.batch)).isTyping}function Yr(t){return t.getDefinition("$text").allowAttributes.filter((t=>t.startsWith("link")))}function Qr(t){return t.getAncestors().find((t=>{return(e=t).is("attributeElement")&&!!e.getCustomProperty("link");var e}))}function Xr(t){const e=Lb.exec(t);return e?e[2]:null}function Zr(t,e,n){const i=e?t[0]:t[t.length-1];if(i.is("element","listItem")){let r=i[e?"previousSibling":"nextSibling"],o=i.getAttribute("listIndent");for(;r&&r.is("element","listItem")&&r.getAttribute("listIndent")>=n;)o>r.getAttribute("listIndent")&&(o=r.getAttribute("listIndent")),r.getAttribute("listIndent")==o&&t[e?"unshift":"push"](r),r=r[e?"previousSibling":"nextSibling"]}}function to(t,e){return e.checkChild(t.parent,"listItem")&&!e.isObject(t)}function eo(t,e){const n=e.mapper,i=e.writer,r="numbered"==t.getAttribute("listType")?"ol":"ul",o=function(t){const e=t.createContainerElement("li");return e.getFillerOffset=co,e}(i),s=i.createContainerElement(r,null);return i.insert(i.createPositionAt(s,0),o),n.bindElements(t,o),o}function no(t,e,n,i){const r=e.parent,o=n.mapper,s=n.writer;let a=o.toViewPosition(i.createPositionBefore(t));const c=oo(t.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:t.getAttribute("listIndent")}),l=t.previousSibling;if(c&&c.getAttribute("listIndent")==t.getAttribute("listIndent")){const t=o.toViewElement(c);a=s.breakContainer(s.createPositionAfter(t))}else if(l&&"listItem"==l.name){a=o.toViewPosition(i.createPositionAt(l,"end"));const t=o.findMappedViewAncestor(a),e=function(t){for(const e of t.getChildren())if("ul"==e.name||"ol"==e.name)return e;return null}(t);a=e?s.createPositionBefore(e):s.createPositionAt(t,"end")}else a=o.toViewPosition(i.createPositionBefore(t));if(a=ro(a),s.insert(a,r),l&&"listItem"==l.name){const t=o.toViewElement(l),n=s.createRange(s.createPositionAt(t,0),a).getWalker({ignoreElementEnd:!0});for(const t of n)if(t.item.is("element","li")){const i=s.breakContainer(s.createPositionBefore(t.item)),r=t.item.parent,o=s.createPositionAt(e,"end");io(s,o.nodeBefore,o.nodeAfter),s.move(s.createRangeOn(r),o),n.position=i}}else{const n=r.nextSibling;if(n&&(n.is("element","ul")||n.is("element","ol"))){let i=null;for(const e of n.getChildren()){const n=o.toModelElement(e);if(!(n&&n.getAttribute("listIndent")>t.getAttribute("listIndent")))break;i=e}i&&(s.breakContainer(s.createPositionAfter(i)),s.move(s.createRangeOn(i.parent),s.createPositionAt(e,"end")))}}io(s,r,r.nextSibling),io(s,r.previousSibling,r)}function io(t,e,n){return!e||!n||"ul"!=e.name&&"ol"!=e.name||e.name!=n.name||e.getAttribute("class")!==n.getAttribute("class")?null:t.mergeContainers(t.createPositionAfter(e))}function ro(t){return t.getLastMatchingPosition((t=>t.item.is("uiElement")))}function oo(t,e){const n=!!e.sameIndent,i=!!e.smallerIndent,r=e.listIndent;let o=t;for(;o&&"listItem"==o.name;){const t=o.getAttribute("listIndent");if(n&&r==t||i&&r>t)return o;o="forward"===e.direction?o.nextSibling:o.previousSibling}return null}function so(t,e,n,i){t.ui.componentFactory.add(e,(r=>{const o=t.commands.get(e),s=new fg(r);return s.set({label:n,icon:i,tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(o,"value","isEnabled"),s.on("execute",(()=>{t.execute(e),t.editing.view.focus()})),s}))}function ao(t,e){const n=[],i=t.parent,r={ignoreElementEnd:!1,startPosition:t,shallow:!0,direction:e},o=i.getAttribute("listIndent"),s=[...new Vf(r)].filter((t=>t.item.is("element"))).map((t=>t.item));for(const t of s){if(!t.is("element","listItem"))break;if(t.getAttribute("listIndent")<o)break;if(!(t.getAttribute("listIndent")>o)){if(t.getAttribute("listType")!==i.getAttribute("listType"))break;if(t.getAttribute("listStyle")!==i.getAttribute("listStyle"))break;if(t.getAttribute("listReversed")!==i.getAttribute("listReversed"))break;if(t.getAttribute("listStart")!==i.getAttribute("listStart"))break;"backward"===e?n.unshift(t):n.push(t)}}return n}function co(){const t=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||t?0:Nt.call(this)}function lo(t){return(e,n,i)=>{const r=i.consumable;if(!r.test(n.item,"insert")||!r.test(n.item,"attribute:listType")||!r.test(n.item,"attribute:listIndent"))return;r.consume(n.item,"insert"),r.consume(n.item,"attribute:listType"),r.consume(n.item,"attribute:listIndent");const o=n.item;no(o,eo(o,i),i,t)}}function uo(t){return(e,n)=>{if(n.isPhantom)return;const i=n.modelPosition.nodeBefore;if(i&&i.is("element","listItem")){const e=n.mapper.toViewElement(i),r=e.getAncestors().find(mo),o=t.createPositionAt(e,0).getWalker();for(const t of o){if("elementStart"==t.type&&t.item.is("element","li")){n.viewPosition=t.previousPosition;break}if("elementEnd"==t.type&&t.item==r){n.viewPosition=t.nextPosition;break}}}}}function ho(t){const e=new Vf({startPosition:t});let n;do{n=e.next()}while(!n.value.item.is("element","listItem"));return n.value.item}function fo(t,e,n,i,r,o){const s=oo(e.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:t}),a=r.mapper,c=r.writer,l=s?s.getAttribute("listIndent"):null;let u;if(s)if(l==t){const t=a.toViewElement(s).parent;u=c.createPositionAfter(t)}else{const t=o.createPositionAt(s,"end");u=a.toViewPosition(t)}else u=n;u=ro(u);for(const t of[...i.getChildren()])mo(t)&&(u=c.move(c.createRangeOn(t),u).end,io(c,t,t.nextSibling),io(c,t.previousSibling,t))}function mo(t){return t.is("element","ol")||t.is("element","ul")}function go(t){let e=1;for(const n of t.getChildren())if("ul"==n.name||"ol"==n.name)for(const t of n.getChildren())e+=go(t);return e}function po(t,e){function n(n,i,r){if(!r.consumable.consume(i.item,n.name))return;const o=i.attributeNewValue,s=r.writer,a=r.mapper.toViewElement(i.item),c=[...a.getChildren()].find((t=>t.getCustomProperty("media-content")));s.remove(c);const l=t.getMediaViewElement(s,o,e);s.insert(s.createPositionAt(a,0),l)}return t=>{t.on("attribute:url:media",n)}}function wo(t,e,n,i){return t.createContainerElement("figure",{class:"media"},[e.getMediaViewElement(t,n,i),t.createSlot()])}function vo(t){const e=t.getSelectedElement();return e&&e.is("element","media")?e:null}function bo(t,e,n,i){t.change((r=>{const o=r.createElement("media",{url:e});t.insertObject(o,n,null,{setSelection:"on",findOptimalPosition:i})}))}function yo(t,e){return e.checkChild(t.parent,"paragraph")&&!e.isObject(t)}function _o(t,e,n,{blockElements:i,inlineObjectElements:r}){let o=n.createPositionAt(t,"forward"==e?"after":"before");return o=o.getLastMatchingPosition((({item:t})=>t.is("element")&&!i.includes(t.name)&&!r.includes(t.name)),{direction:e}),"forward"==e?o.nodeAfter:o.nodeBefore}function ko(t,e){return!!t&&t.is("element")&&e.includes(t.name)}function Ao(t,e){if(!t.childCount)return;const n=new Bm(t.document),i=function(t,e){const n=e.createRangeIn(t),i=new sh({name:/^p|h\d+$/,styles:{"mso-list":/.*/}}),r=[];for(const t of n)if("elementStart"===t.type&&i.match(t.item)){const e=Co(t.item);r.push({element:t.item,id:e.id,order:e.order,indent:e.indent})}return r}(t,n);if(!i.length)return;let r=null,o=1;i.forEach(((t,s)=>{const a=function(t,e){if(!t)return!0;if(t.id!==e.id)return e.indent-t.indent!=1;const n=e.element.previousSibling;return!n||!((i=n).is("element","ol")||i.is("element","ul"));var i}(i[s-1],t),c=(u=t,(l=a?null:i[s-1])?u.indent-l.indent:u.indent-1);var l,u;if(a&&(r=null,o=1),!r||0!==c){const i=function(t,e){const n=/mso-level-number-format:([^;]{0,100});/gi,i=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,r=new RegExp(`@list l${t.id}:level${t.indent}\\s*({[^}]*)`,"gi").exec(e);let o="decimal",s="ol",a=null;if(r&&r[1]){const e=n.exec(r[1]);if(e&&e[1]&&(o=e[1].trim(),s="bullet"!==o&&"image"!==o?"ol":"ul"),"bullet"===o){const e=function(t){const e=function(t){if(t.getChild(0).is("$text"))return null;for(const e of t.getChildren()){if(!e.is("element","span"))continue;const t=e.getChild(0);return t.is("$text")?t:t.getChild(0)}return null}(t);if(!e)return null;const n=e._data;return"o"===n?"circle":"\xb7"===n?"disc":"\xa7"===n?"square":null}(t.element);e&&(o=e)}else{const t=i.exec(r[1]);t&&t[1]&&(a=parseInt(t[1]))}}return{type:s,startIndex:a,style:xo(o)}}(t,e);if(r){if(t.indent>o){const t=r.getChild(r.childCount-1),e=t.getChild(t.childCount-1);r=To(i,e,n),o+=1}else if(t.indent<o){const e=o-t.indent;r=function(t,e){const n=t.getAncestors({parentFirst:!0});let i=null,r=0;for(const t of n)if((t.is("element","ul")||t.is("element","ol"))&&r++,r===e){i=t;break}return i}(r,e),o=t.indent}}else r=To(i,t.element,n);t.indent<=o&&(r.is("element",i.type)||(r=n.rename(i.type,r)))}const h=function(t,e){return function(t,e){const n=new sh({name:"span",styles:{"mso-list":"Ignore"}}),i=e.createRangeIn(t);for(const t of i)"elementStart"===t.type&&n.match(t.item)&&e.remove(t.item)}(t,e),e.rename("li",t)}(t.element,n);n.appendChild(h,r)}))}function xo(t){if(t.startsWith("arabic-leading-zero"))return"decimal-leading-zero";switch(t){case"alpha-upper":return"upper-alpha";case"alpha-lower":return"lower-alpha";case"roman-upper":return"upper-roman";case"roman-lower":return"lower-roman";case"circle":case"disc":case"square":return t;default:return null}}function To(t,e,n){const i=e.parent,r=n.createElement(t.type),o=i.getChildIndex(e)+1;return n.insertChild(o,r,i),t.style&&n.setStyle("list-style-type",t.style,r),t.startIndex&&t.startIndex>1&&n.setAttribute("start",t.startIndex,r),r}function Co(t){const e={},n=t.getStyle("mso-list");if(n){const t=n.match(/(^|\s{1,100})l(\d+)/i),i=n.match(/\s{0,100}lfo(\d+)/i),r=n.match(/\s{0,100}level(\d+)/i);t&&i&&r&&(e.id=t[2],e.order=i[1],e.indent=parseInt(r[1]))}return e}function Eo(t,e){if(!t.childCount)return;const n=new Bm(t.document),i=function(t,e){const n=e.createRangeIn(t),i=new sh({name:/v:(.+)/}),r=[];for(const t of n){if("elementStart"!=t.type)continue;const e=t.item,n=e.previousSibling,o=n&&n.is("element")?n.name:null;i.match(e)&&e.getAttribute("o:gfxdata")&&"v:shapetype"!==o&&r.push(t.item.getAttribute("id"))}return r}(t,n);!function(t,e,n){const i=n.createRangeIn(e),r=new sh({name:"img"}),o=[];for(const e of i)if(e.item.is("element")&&r.match(e.item)){const n=e.item,i=n.getAttribute("v:shapes")?n.getAttribute("v:shapes").split(" "):[];i.length&&i.every((e=>t.indexOf(e)>-1))?o.push(n):n.getAttribute("src")||o.push(n)}for(const t of o)n.remove(t)}(i,t,n),function(t,e,n){function i(t,e){for(const n of t)if(n.is("element")){if("img"==n.name&&n.getAttribute("v:shapes")==e)return!0;if(i(n.getChildren(),e))return!0}return!1}function r(t){for(const e of t.getChildren())if(e.is("element")&&e.getAttribute("src"))return e.getAttribute("src")}const o=n.createRangeIn(e),s=[];for(const e of o)if("elementStart"==e.type&&e.item.is("element","v:shape")){const n=e.item.getAttribute("id");if(t.includes(n))continue;i(e.item.parent.getChildren(),n)||s.push(e.item)}for(const t of s){const e={src:r(t)};t.hasAttribute("alt")&&(e.alt=t.getAttribute("alt"));const i=n.createElement("img",e);n.insertChild(t.index+1,i,t.parent)}}(i,t,n),function(t,e){const n=e.createRangeIn(t),i=new sh({name:/v:(.+)/}),r=[];for(const t of n)"elementStart"==t.type&&i.match(t.item)&&r.push(t.item);for(const t of r)e.remove(t)}(t,n);const r=function(t,e){const n=e.createRangeIn(t),i=new sh({name:"img"}),r=[]
;for(const t of n)t.item.is("element")&&i.match(t.item)&&t.item.getAttribute("src").startsWith("file://")&&r.push(t.item);return r}(t,n);r.length&&function(t,e,n){if(t.length===e.length)for(let i=0;i<t.length;i++){const r=`data:${e[i].type};base64,${So(e[i].hex)}`;n.setAttribute("src",r,t[i])}}(r,function(t){if(!t)return[];const e=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,n=new RegExp("(?:("+e.source+"))([\\da-fA-F\\s]+)\\}","g"),i=t.match(n),r=[];if(i)for(const t of i){let n=!1;t.includes("\\pngblip")?n="image/png":t.includes("\\jpegblip")&&(n="image/jpeg"),n&&r.push({hex:t.replace(e,"").replace(/[^\da-fA-F]/g,""),type:n})}return r}(e),n)}function So(t){return btoa(t.match(/\w{2}/g).map((t=>String.fromCharCode(parseInt(t,16)))).join(""))}function Po(t){return t.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,((t,e)=>1===e.length?" ":Array(e.length+1).join("\xa0 ").substr(0,e.length)))}function Ro(t,e){const n=new DOMParser,i=function(t){return Po(Po(t)).replace(/(<span\s+style=['"]mso-spacerun:yes['"]>[^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<span\s+style=['"]mso-spacerun:yes['"]><\/span>/g,"").replace(/ <\//g,"\xa0</").replace(/ <o:p><\/o:p>/g,"\xa0<o:p></o:p>").replace(/<o:p>(&nbsp;|\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)</g,"><")}(function(t){const e="</body>",n="</html>",i=t.indexOf(e);if(i<0)return t;const r=t.indexOf(n,i+e.length);return t.substring(0,i+e.length)+(r>=0?t.substring(r):"")}(t=t.replace(/<!--\[if gte vml 1]>/g,""))),r=n.parseFromString(i,"text/html");!function(t){t.querySelectorAll("span[style*=spacerun]").forEach((t=>{const e=t,n=e.innerText.length||0;e.innerText=Array(n+1).join("\xa0 ").substr(0,n)}))}(r);const o=r.body.innerHTML,s=function(t,e){const n=new dd(e),i=new Md(n,{renderingMode:"data"}),r=t.createDocumentFragment(),o=t.body.childNodes;for(;o.length>0;)r.appendChild(o[0]);return i.domToView(r,{skipComments:!0})}(r,e),a=function(t){const e=[],n=[],i=Array.from(t.getElementsByTagName("style"));for(const t of i)t.sheet&&t.sheet.cssRules&&t.sheet.cssRules.length&&(e.push(t.sheet),n.push(t.innerHTML));return{styles:e,stylesString:n.join(" ")}}(r);return{body:s,bodyString:o,styles:a.styles,stylesString:a.stylesString}}function Oo(t,e,n,i,r=1){e>r?i.setAttribute(t,e,n):i.removeAttribute(t,n)}function Io(t,e,n={}){const i=t.createElement("tableCell",n);return t.insertElement("paragraph",i),t.insert(i,e),i}function Mo(t,e){const n=e.parent.parent,i=parseInt(n.getAttribute("headingColumns")||0),{column:r}=t.getCellLocation(e);return!!i&&r<i}function No(){return t=>{t.on("element:table",((t,e,n)=>{const i=e.viewItem;if(!n.consumable.test(i,{name:!0}))return;const{rows:r,headingRows:o,headingColumns:s}=function(t){const e={headingRows:0,headingColumns:0},n=[],i=[];let r;for(const o of Array.from(t.getChildren()))if("tbody"===o.name||"thead"===o.name||"tfoot"===o.name){"thead"!==o.name||r||(r=o);const t=Array.from(o.getChildren()).filter((t=>t.is("element","tr")));for(const o of t)if("thead"===o.parent.name&&o.parent===r)e.headingRows++,n.push(o);else{i.push(o);const t=Do(o);t>e.headingColumns&&(e.headingColumns=t)}}return e.rows=[...n,...i],e}(i),a={};s&&(a.headingColumns=s),o&&(a.headingRows=o);const c=n.writer.createElement("table",a);if(n.safeInsert(c,e.modelCursor)){if(n.consumable.consume(i,{name:!0}),r.forEach((t=>n.convertItem(t,n.writer.createPositionAt(c,"end")))),n.convertChildren(i,n.writer.createPositionAt(c,"end")),c.isEmpty){const t=n.writer.createElement("tableRow");n.writer.insert(t,n.writer.createPositionAt(c,"end")),Io(n.writer,n.writer.createPositionAt(t,"end"))}n.updateConversionResult(c,e)}}))}}function Vo(t){return e=>{e.on(`element:${t}`,((t,e,{writer:n})=>{if(!e.modelRange)return;const i=e.modelRange.start.nodeAfter,r=n.createPositionAt(i,0);if(e.viewItem.isEmpty)return void n.insertElement("paragraph",r);const o=Array.from(i.getChildren());if(o.every((t=>t.is("element","$marker")))){const t=n.createElement("paragraph");n.insert(t,n.createPositionAt(i,0));for(const e of o)n.move(n.createRangeOn(e),n.createPositionAt(t,"end"))}}),{priority:"low"})}}function Do(t){let e=0,n=0;const i=Array.from(t.getChildren()).filter((t=>"th"===t.name||"td"===t.name));for(;n<i.length&&"th"===i[n].name;){const t=i[n];e+=parseInt(t.getAttribute("colspan")||1),n++}return e}function Bo(t,e={}){return(n,{writer:i})=>{const r=n.getAttribute("headingRows")||0,o=[];r>0&&o.push(i.createContainerElement("thead",null,i.createSlot((t=>t.is("element","tableRow")&&t.index<r)))),r<t.getRows(n)&&o.push(i.createContainerElement("tbody",null,i.createSlot((t=>t.is("element","tableRow")&&t.index>=r))));const s=i.createContainerElement("figure",{class:"table"},[i.createContainerElement("table",null,o),i.createSlot((t=>!t.is("element","tableRow")))]);return e.asWidget?function(t,e){return e.setCustomProperty("table",!0,t),hr(t,e,{hasSelectionHandle:!0})}(s,i):s}}function Fo(t={}){return(e,{writer:n})=>{const i=e.parent,r=i.parent,o=r.getChildIndex(i),s=new Ry(r,{row:o}),a=r.getAttribute("headingRows")||0,c=r.getAttribute("headingColumns")||0;for(const i of s)if(i.cell==e){const e=i.row<a||i.column<c?"th":"td";return t.asWidget?gr(n.createEditableElement(e),n):n.createContainerElement(e)}}}function Lo(t={}){return(e,{writer:n})=>{if(e.parent.is("element","tableCell")&&zo(e)){if(t.asWidget)return n.createContainerElement("span",{class:"ck-table-bogus-paragraph"});{const t=n.createContainerElement("p");return n.setCustomProperty("dataPipeline:transparentRendering",!0,t),t}}}}function zo(t){return 1==t.parent.childCount&&![...t.getAttributeKeys()].length}function jo(t,e,n){const{startRow:i,startColumn:r,endRow:o,endColumn:s}=e,a=n.createElement("table"),c=o-i+1;for(let t=0;t<c;t++)n.insertElement("tableRow",a,"end");const l=[...new Ry(t,{startRow:i,endRow:o,startColumn:r,endColumn:s,includeAllSlots:!0})];for(const{row:t,column:e,cell:c,isAnchor:u,cellAnchorRow:h,cellAnchorColumn:d}of l){const l=t-i,f=a.getChild(l);if(u){const i=n.cloneElement(c);n.append(i,f),qo(i,t,e,o,s,n)}else(h<i||d<r)&&Io(n,n.createPositionAt(f,"end"))}return function(t,e,n,i,r){const o=parseInt(e.getAttribute("headingRows")||0);o>0&&Oo("headingRows",o-n,t,r,0);const s=parseInt(e.getAttribute("headingColumns")||0);s>0&&Oo("headingColumns",s-i,t,r,0)}(a,t,i,r,n),a}function Ho(t,e,n=0){const i=[],r=new Ry(t,{startRow:n,endRow:e-1});for(const t of r){const{row:n,cellHeight:r}=t,o=n+r-1;n<e&&e<=o&&i.push(t)}return i}function Uo(t,e,n){const i=t.parent,r=i.parent,o=i.index,s=e-o,a={},c=parseInt(t.getAttribute("rowspan"))-s;c>1&&(a.rowspan=c);const l=parseInt(t.getAttribute("colspan")||1);l>1&&(a.colspan=l);const u=o+s,h=[...new Ry(r,{startRow:o,endRow:u,includeAllSlots:!0})];let d,f=null;for(const e of h){const{row:i,column:r,cell:o}=e;o===t&&void 0===d&&(d=r),void 0!==d&&d===r&&i===u&&(f=Io(n,e.getPositionBefore(),a))}return Oo("rowspan",s,t,n),f}function Wo(t,e){const n=[],i=new Ry(t);for(const t of i){const{column:i,cellWidth:r}=t,o=i+r-1;i<e&&e<=o&&n.push(t)}return n}function $o(t,e,n,i){const r=n-e,o={},s=parseInt(t.getAttribute("colspan"))-r;s>1&&(o.colspan=s);const a=parseInt(t.getAttribute("rowspan")||1);a>1&&(o.rowspan=a);const c=Io(i,i.createPositionAfter(t),o);return Oo("colspan",r,t,i),c}function qo(t,e,n,i,r,o){const s=parseInt(t.getAttribute("colspan")||1),a=parseInt(t.getAttribute("rowspan")||1);n+s-1>r&&Oo("colspan",r-n+1,t,o,1),e+a-1>i&&Oo("rowspan",i-e+1,t,o,1)}function Ko(t,e){const n=e.getColumns(t),i=new Array(n).fill(0);for(const{column:e}of new Ry(t))i[e]++;const r=i.reduce(((t,e,n)=>e?t:[...t,n]),[]);if(r.length>0){const n=r[r.length-1];return e.removeColumns(t,{at:n}),!0}return!1}function Go(t,e){const n=[],i=e.getRows(t);for(let e=0;e<i;e++)t.getChild(e).isEmpty&&n.push(e);if(n.length>0){const i=n[n.length-1];return e.removeRows(t,{at:i}),!0}return!1}function Jo(t,e){Ko(t,e)||Go(t,e)}function Yo(t,e){const n=Array.from(new Ry(t,{startColumn:e.firstColumn,endColumn:e.lastColumn,row:e.lastRow}));if(n.every((({cellHeight:t})=>1===t)))return e.lastRow;const i=n[0].cellHeight-1;return e.lastRow+i}function Qo(t,e){const n=Array.from(new Ry(t,{startRow:e.firstRow,endRow:e.lastRow,column:e.lastColumn}));if(n.every((({cellWidth:t})=>1===t)))return e.lastColumn;const i=n[0].cellWidth-1;return e.lastColumn+i}function Xo(t){return 1==t.childCount&&t.getChild(0).is("element","paragraph")&&t.getChild(0).isEmpty}function Zo(t,e,n,i,r,o={}){for(let s=0;s<i;s++){const i=t.createElement("tableRow");t.insert(i,e,n),ts(r,t,t.createPositionAt(i,"end"),o)}}function ts(t,e,n,i={}){for(let r=0;r<t;r++)Io(e,n,i)}function es(t,e){if(t<e)return{newCellsSpan:1,updatedSpan:1};const n=Math.floor(t/e);return{newCellsSpan:n,updatedSpan:t-n*e+n}}function ns(t,e){const n=t.start,i=e.start;return n.isBefore(i)?-1:1}function is(t,e,n){rs(t)||(rs(e)&&n.remove(n.createRangeIn(e)),n.move(n.createRangeIn(t),n.createPositionAt(e,"end"))),n.remove(t)}function rs(t){return 1==t.childCount&&t.getChild(0).is("element","paragraph")&&t.getChild(0).isEmpty}function os(t,e,n,i){const r=parseInt(t.getAttribute(i)||1);return Math.max(n,e+r)}function ss(t){t.document.registerPostFixer((e=>function(t,e){const n=e.document.differ.getChanges();let i=!1;const r=new Set;for(const e of n){let n;"table"==e.name&&"insert"==e.type&&(n=e.position.nodeAfter),"tableRow"!=e.name&&"tableCell"!=e.name||(n=e.position.findAncestor("table")),ls(e)&&(n=e.range.start.findAncestor("table")),n&&!r.has(n)&&(i=as(n,t)||i,i=cs(n,t)||i,r.add(n))}return i}(e,t)))}function as(t,e){let n=!1;const i=function(t){const e=parseInt(t.getAttribute("headingRows")||0),n=Array.from(t.getChildren()).reduce(((t,e)=>e.is("element","tableRow")?t+1:t),0),i=[];for(const{row:r,cell:o,cellHeight:s}of new Ry(t)){if(s<2)continue;const t=r<e?e:n;if(r+s>t){const e=t-r;i.push({cell:o,rowspan:e})}}return i}(t);if(i.length){n=!0;for(const t of i)Oo("rowspan",t.rowspan,t.cell,e,1)}return n}function cs(t,e){let n=!1;const i=function(t){const e=new Array(t.childCount).fill(0);for(const{rowIndex:n}of new Ry(t,{includeAllSlots:!0}))e[n]++;return e}(t),r=[];for(const[e,n]of i.entries())!n&&t.getChild(e).is("element","tableRow")&&r.push(e);if(r.length){n=!0;for(const n of r.reverse())e.remove(t.getChild(n)),i.splice(n,1)}const o=i.filter(((e,n)=>t.getChild(n).is("element","tableRow"))),s=o[0];if(!o.every((t=>t===s))){const i=o.reduce(((t,e)=>e>t?e:t),0);for(const[r,s]of o.entries()){const o=i-s;if(o){for(let n=0;n<o;n++)Io(e,e.createPositionAt(t.getChild(r),"end"));n=!0}}}return n}function ls(t){const e="attribute"===t.type,n=t.attributeKey;return e&&("headingRows"===n||"colspan"===n||"rowspan"===n)}function us(t){t.document.registerPostFixer((e=>function(t,e){const n=e.document.differ.getChanges();let i=!1;for(const e of n)"insert"==e.type&&"table"==e.name&&(i=hs(e.position.nodeAfter,t)||i),"insert"==e.type&&"tableRow"==e.name&&(i=ds(e.position.nodeAfter,t)||i),"insert"==e.type&&"tableCell"==e.name&&(i=fs(e.position.nodeAfter,t)||i),ms(e)&&(i=fs(e.position.parent,t)||i);return i}(e,t)))}function hs(t,e){let n=!1;for(const i of t.getChildren())i.is("element","tableRow")&&(n=ds(i,e)||n);return n}function ds(t,e){let n=!1;for(const i of t.getChildren())n=fs(i,e)||n;return n}function fs(t,e){if(0==t.childCount)return e.insertElement("paragraph",t),!0;const n=Array.from(t.getChildren()).filter((t=>t.is("$text")));for(const t of n)e.wrap(e.createRangeOn(t),"paragraph");return!!n.length}function ms(t){return!(!t.position||!t.position.parent.is("element","tableCell"))&&("insert"==t.type&&"$text"==t.name||"remove"==t.type)}function gs(t,e){if(!t.is("element","paragraph"))return!1;const n=e.toViewElement(t);return!!n&&zo(t)!==n.is("element","span")}function ps(t){return e=>{const n=parseInt(e.getAttribute(t));return Number.isNaN(n)||n<=0?null:n}}function ws(t,e,n,i){const r=t.model=new Bp(t.model),{commandName:o,bindIsOn:s}=t.model;if("button"===t.type||"switchbutton"===t.type){const t=e.commands.get(o);n.push(t),r.set({commandName:o}),r.bind("isEnabled").to(t),s&&r.bind("isOn").to(t,"value")}r.set({withText:!0}),i.add(t)}function vs(t,e){if(!t.is("documentFragment")&&!t.is("element"))return null;if(t.is("element","table"))return t;if(1==t.childCount&&t.getChild(0).is("element","table"))return t.getChild(0);const n=e.createRangeIn(t);for(const t of n.getItems())if(t.is("element","table")){const i=e.createRange(n.start,e.createPositionBefore(t));if(e.hasContent(i,{ignoreWhitespaces:!0}))return null;const r=e.createRange(e.createPositionAfter(t),n.end);return e.hasContent(r,{ignoreWhitespaces:!0})?null:t}return null}function bs(t,e,n,i,r=0){if(!(e<1))return Ho(t,e,r).filter((({column:t,cellWidth:e})=>_s(t,e,n))).map((({cell:t})=>Uo(t,e,i)))}function ys(t,e,n,i){if(!(e<1))return Wo(t,e).filter((({row:t,cellHeight:e})=>_s(t,e,n))).map((({cell:t,column:n})=>$o(t,n,e,i)))}function _s(t,e,n){const i=t+e-1,{first:r,last:o}=n;return t>=r&&t<=o||t<r&&i>=r}function ks(t,e){return t.parent.parent==e.parent.parent}function As(t){const e=t.getSelectedElement();return e&&Ts(e)?e:null}function xs(t){const e=t.getFirstPosition();if(!e)return null;let n=e.parent;for(;n;){if(n.is("element")&&Ts(n))return n;n=n.parent}return null}function Ts(t){return!!t.getCustomProperty("table")&&ur(t)}function Cs(t,e,n){return n.checkChild(t.parent,e)&&!n.isObject(t)}function Es(t){return!!t.getCustomProperty(P_)&&ur(t)}function Ss(t){const e=t.getSelectedElement();return e&&Es(e)?e:null}function Ps(t){return t instanceof Nf&&"asset"===t.name}function Rs(){return Object.getOwnPropertyNames(R_)}function Os(t){return R_[t]||null}function Is(t){const e=t.editing.view,n=cp.defaultPositions;return{target:e.domConverter.viewToDom(e.document.selection.getSelectedElement()),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}}function Ms(t){const e=t.plugins.get("ContextualBalloon");Ss(t.editing.view.document.selection)&&e.updatePosition(Is(t))}function Ns(t,e){const n=Os(t.getAttribute("type"));let i;return"image"===n.id?i=e.createContainerElement(n.element):["audio","video"].includes(n.id)&&(i=e.createContainerElement(n.element,{controls:"controls"})),i}function Vs(t,e){for(const n of e)if(n.name===t)return n;return null}function Ds(t=[]){return t.map(Bs).map((t=>Object.assign({},t)))}function Bs(t){if("string"==typeof t){const e=t;ik[e]?t=Object.assign({},ik[e]):(console.warn("There is no such asset style of given name.",{name:e}),t={name:e})}else if(ik[t.name]){const e=ik[t.name],n=Object.assign({},t);for(const i in e)t.hasOwnProperty(i)||(n[i]=e[i]);t=n}return"string"==typeof t.icon&&rk[t.icon]&&(t.icon=rk[t.icon]),t}function Fs(t,e,n=!0){const i=t.getAttribute("innerHtml"),r={"data-html-widget":!0};let o,s;n?(o=r,s={class:"html-widget-wrapper"}):(o={},s=r);let a=e.createUIElement("div",s,(function(t){const e=this.toDomElement(t);return e.innerHTML=i,e}));if(n){const t=e.createContainerElement("div",o);e.insert(e.createPositionAt(t,0),a),a=t}return a}t(55108),t(7452);const Ls=function(){try{return navigator.userAgent.toLowerCase()}catch(t){return""}}(),zs={isMac:e(Ls),isWindows:function(t){return t.indexOf("windows")>-1}(Ls),isGecko:function(t){return!!t.match(/gecko\/\d+/)}(Ls),isSafari:function(t){return t.indexOf(" applewebkit/")>-1&&-1===t.indexOf("chrome")}(Ls),isiOS:function(t){return!!t.match(/iphone|ipad/i)||e(t)&&navigator.maxTouchPoints>0}(Ls),isAndroid:function(t){return t.indexOf("android")>-1}(Ls),isBlink:function(t){return t.indexOf("chrome/")>-1&&t.indexOf("edge/")<0}(Ls),features:{isRegExpUnicodePropertySupported:function(){let t=!1;try{t=0==="\u0107".search(new RegExp("[\\p{L}]","u"))}catch(t){}return t}()}};var js=zs;o.fastDiff=n;var Hs=function(){return function t(){t.called=!0}};class Us{constructor(t,e){this.source=t,this.name=e,this.path=[],this.stop=Hs(),this.off=Hs()}}const Ws=new Array(256).fill("").map(((t,e)=>("0"+e.toString(16)).slice(-2)));var $s={get(t="normal"){return"number"!=typeof t?this[t]||this.normal:t},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};class qs extends Error{constructor(t,e,n){super(function(t,e){const n=new WeakSet,i=(t,e)=>{if("object"==typeof e&&null!==e){if(n.has(e))return`[object ${e.constructor.name}]`;n.add(e)}return e};return t+(e?` ${JSON.stringify(e,i)}`:"")+u(t)}(t,n)),this.name="CKEditorError",this.context=e,this.data=n}is(t){return"CKEditorError"===t}static rethrowUnexpectedError(t,e){if(t.is&&t.is("CKEditorError"))throw t;const n=new qs(t.message,e);throw n.stack=t.stack,n}}const Ks="36.0.1",Gs="object"==typeof window?window:t.g;if(Gs.CKEDITOR_VERSION)throw new qs("ckeditor-duplicated-modules",null);Gs.CKEDITOR_VERSION=Ks;const Js=Symbol("listeningTo"),Ys=Symbol("emitterId"),Qs=Symbol("delegations"),Xs=d(Object);["on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((t=>{d[t]=Xs.prototype[t]}));var Zs=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};const ta=Symbol("observableProperties"),ea=Symbol("boundObservables"),na=Symbol("boundProperties"),ia=Symbol("decoratedMethods"),ra=Symbol("decoratedOriginal"),oa=y(d());["set","bind","unbind","decorate","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((t=>{y[t]=oa.prototype[t]}));var sa="object"==typeof global&&global&&global.Object===Object&&global,aa="object"==typeof self&&self&&self.Object===Object&&self,ca=sa||aa||Function("return this")(),la=ca.Symbol,ua=Object.prototype,ha=ua.hasOwnProperty,da=ua.toString,fa=la?la.toStringTag:void 0,ma=function(t){var e=ha.call(t,fa),n=t[fa];try{t[fa]=void 0;var i=!0}catch(t){}var r=da.call(t);return i&&(e?t[fa]=n:delete t[fa]),r},ga=Object.prototype.toString,pa=function(t){return ga.call(t)},wa=la?la.toStringTag:void 0,va=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":wa&&wa in Object(t)?ma(t):pa(t)},ba=Array.isArray,ya=function(t){return null!=t&&"object"==typeof t},_a=function(t){return"string"==typeof t||!ba(t)&&ya(t)&&"[object String]"==va(t)},ka=function(t,e){return function(n){return t(e(n))}},Aa=ka(Object.getPrototypeOf,Object),xa=Function.prototype,Ta=Object.prototype,Ca=xa.toString,Ea=Ta.hasOwnProperty,Sa=Ca.call(Object),Pa=function(t){if(!ya(t)||"[object Object]"!=va(t))return!1;var e=Aa(t);if(null===e)return!0;var n=Ea.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Ca.call(n)==Sa},Ra=function(){this.__data__=[],this.size=0},Oa=function(t,e){return t===e||t!=t&&e!=e},Ia=function(t,e){for(var n=t.length;n--;)if(Oa(t[n][0],e))return n;return-1},Ma=Array.prototype.splice,Na=function(t){var e=this.__data__,n=Ia(e,t);return!(n<0||(n==e.length-1?e.pop():Ma.call(e,n,1),--this.size,0))},Va=function(t){var e=this.__data__,n=Ia(e,t);return n<0?void 0:e[n][1]},Da=function(t){return Ia(this.__data__,t)>-1},Ba=function(t,e){var n=this.__data__,i=Ia(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this};P.prototype.clear=Ra,P.prototype.delete=Na,P.prototype.get=Va,P.prototype.has=Da,P.prototype.set=Ba;var Fa=P,La=function(){this.__data__=new Fa,this.size=0},za=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},ja=function(t){return this.__data__.get(t)},Ha=function(t){return this.__data__.has(t)},Ua=function(t){if(!Zs(t))return!1;var e=va(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},Wa=ca["__core-js_shared__"],$a=function(){var t=/[^.]+$/.exec(Wa&&Wa.keys&&Wa.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),qa=function(t){return!!$a&&$a in t},Ka=Function.prototype.toString,Ga=function(t){if(null!=t){try{return Ka.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Ja=/^\[object .+?Constructor\]$/,Ya=Function.prototype,Qa=Object.prototype,Xa=Ya.toString,Za=Qa.hasOwnProperty,tc=RegExp("^"+Xa.call(Za).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ec=function(t){return!(!Zs(t)||qa(t))&&(Ua(t)?tc:Ja).test(Ga(t))},nc=function(t,e){return null==t?void 0:t[e]},ic=function(t,e){var n=nc(t,e);return ec(n)?n:void 0},rc=ic(ca,"Map"),oc=ic(Object,"create"),sc=function(){this.__data__=oc?oc(null):{},this.size=0},ac=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},cc=Object.prototype.hasOwnProperty,lc=function(t){var e=this.__data__;if(oc){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return cc.call(e,t)?e[t]:void 0},uc=Object.prototype.hasOwnProperty,hc=function(t){var e=this.__data__;return oc?void 0!==e[t]:uc.call(e,t)},dc=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=oc&&void 0===e?"__lodash_hash_undefined__":e,this};R.prototype.clear=sc,R.prototype.delete=ac,R.prototype.get=lc,R.prototype.has=hc,R.prototype.set=dc;var fc=R,mc=function(){this.size=0,this.__data__={hash:new fc,map:new(rc||Fa),string:new fc}},gc=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t},pc=function(t,e){var n=t.__data__;return gc(e)?n["string"==typeof e?"string":"hash"]:n.map},wc=function(t){var e=pc(this,t).delete(t);return this.size-=e?1:0,e},vc=function(t){return pc(this,t).get(t)},bc=function(t){return pc(this,t).has(t)},yc=function(t,e){var n=pc(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this};O.prototype.clear=mc,O.prototype.delete=wc,O.prototype.get=vc,O.prototype.has=bc,O.prototype.set=yc;var _c=O,kc=function(t,e){var n=this.__data__;if(n instanceof Fa){var i=n.__data__;if(!rc||i.length<199)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new _c(i)}return n.set(t,e),this.size=n.size,this};I.prototype.clear=La,I.prototype.delete=za,I.prototype.get=ja,I.prototype.has=Ha,I.prototype.set=kc;var Ac=I,xc=function(t,e){for(var n=-1,i=null==t?0:t.length;++n<i&&!1!==e(t[n],n,t););return t},Tc=function(){try{var t=ic(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Cc=function(t,e,n){"__proto__"==e&&Tc?Tc(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},Ec=Object.prototype.hasOwnProperty,Sc=function(t,e,n){var i=t[e];Ec.call(t,e)&&Oa(i,n)&&(void 0!==n||e in t)||Cc(t,e,n)},Pc=function(t,e,n,i){var r=!n;n||(n={});for(var o=-1,s=e.length;++o<s;){var a=e[o],c=i?i(n[a],t[a],a,n,t):void 0;void 0===c&&(c=t[a]),r?Cc(n,a,c):Sc(n,a,c)}return n},Rc=function(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i},Oc=function(t){return ya(t)&&"[object Arguments]"==va(t)},Ic=Object.prototype,Mc=Ic.hasOwnProperty,Nc=Ic.propertyIsEnumerable,Vc=Oc(function(){return arguments}())?Oc:function(t){return ya(t)&&Mc.call(t,"callee")&&!Nc.call(t,"callee")},Dc=Vc,Bc=function(){return!1},Fc="object"==typeof exports&&exports&&!exports.nodeType&&exports,Lc=Fc&&"object"==typeof module&&module&&!module.nodeType&&module,zc=Lc&&Lc.exports===Fc?ca.Buffer:void 0,jc=(zc?zc.isBuffer:void 0)||Bc,Hc=/^(?:0|[1-9]\d*)$/,Uc=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&Hc.test(t))&&t>-1&&t%1==0&&t<e},Wc=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},$c={};$c["[object Float32Array]"]=$c["[object Float64Array]"]=$c["[object Int8Array]"]=$c["[object Int16Array]"]=$c["[object Int32Array]"]=$c["[object Uint8Array]"]=$c["[object Uint8ClampedArray]"]=$c["[object Uint16Array]"]=$c["[object Uint32Array]"]=!0,$c["[object Arguments]"]=$c["[object Array]"]=$c["[object ArrayBuffer]"]=$c["[object Boolean]"]=$c["[object DataView]"]=$c["[object Date]"]=$c["[object Error]"]=$c["[object Function]"]=$c["[object Map]"]=$c["[object Number]"]=$c["[object Object]"]=$c["[object RegExp]"]=$c["[object Set]"]=$c["[object String]"]=$c["[object WeakMap]"]=!1;var qc=function(t){return ya(t)&&Wc(t.length)&&!!$c[va(t)]},Kc=function(t){return function(e){return t(e)}},Gc="object"==typeof exports&&exports&&!exports.nodeType&&exports,Jc=Gc&&"object"==typeof module&&module&&!module.nodeType&&module,Yc=Jc&&Jc.exports===Gc&&sa.process,Qc=function(){try{return Jc&&Jc.require&&Jc.require("util").types||Yc&&Yc.binding&&Yc.binding("util")}catch(t){}}(),Xc=Qc&&Qc.isTypedArray,Zc=Xc?Kc(Xc):qc,tl=Object.prototype.hasOwnProperty,el=function(t,e){var n=ba(t),i=!n&&Dc(t),r=!n&&!i&&jc(t),o=!n&&!i&&!r&&Zc(t),s=n||i||r||o,a=s?Rc(t.length,String):[],c=a.length;for(var l in t)!e&&!tl.call(t,l)||s&&("length"==l||r&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Uc(l,c))||a.push(l);return a},nl=Object.prototype,il=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||nl)},rl=ka(Object.keys,Object),ol=Object.prototype.hasOwnProperty,sl=function(t){if(!il(t))return rl(t);var e=[];for(var n in Object(t))ol.call(t,n)&&"constructor"!=n&&e.push(n);return e},al=function(t){return null!=t&&Wc(t.length)&&!Ua(t)},cl=function(t){return al(t)?el(t):sl(t)},ll=function(t,e){return t&&Pc(e,cl(e),t)},ul=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e},hl=Object.prototype.hasOwnProperty,dl=function(t){if(!Zs(t))return ul(t);var e=il(t),n=[];for(var i in t)("constructor"!=i||!e&&hl.call(t,i))&&n.push(i);return n},fl=function(t){return al(t)?el(t,!0):dl(t)},ml=function(t,e){return t&&Pc(e,fl(e),t)},gl="object"==typeof exports&&exports&&!exports.nodeType&&exports,pl=gl&&"object"==typeof module&&module&&!module.nodeType&&module,wl=pl&&pl.exports===gl?ca.Buffer:void 0,vl=wl?wl.allocUnsafe:void 0,bl=function(t,e){if(e)return t.slice();var n=t.length,i=vl?vl(n):new t.constructor(n);return t.copy(i),i},yl=function(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e},_l=function(t,e){for(var n=-1,i=null==t?0:t.length,r=0,o=[];++n<i;){var s=t[n];e(s,n,t)&&(o[r++]=s)}return o},kl=function(){return[]},Al=Object.prototype.propertyIsEnumerable,xl=Object.getOwnPropertySymbols,Tl=xl?function(t){return null==t?[]:(t=Object(t),_l(xl(t),(function(e){return Al.call(t,e)})))}:kl,Cl=Tl,El=function(t,e){return Pc(t,Cl(t),e)},Sl=function(t,e){for(var n=-1,i=e.length,r=t.length;++n<i;)t[r+n]=e[n];return t},Pl=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Sl(e,Cl(t)),t=Aa(t);return e}:kl,Rl=function(t,e){return Pc(t,Pl(t),e)},Ol=function(t,e,n){var i=e(t);return ba(t)?i:Sl(i,n(t))},Il=function(t){return Ol(t,cl,Cl)},Ml=function(t){return Ol(t,fl,Pl)},Nl=ic(ca,"DataView"),Vl=ic(ca,"Promise"),Dl=ic(ca,"Set"),Bl=ic(ca,"WeakMap"),Fl="[object Map]",Ll="[object Promise]",zl="[object Set]",jl="[object WeakMap]",Hl="[object DataView]",Ul=Ga(Nl),Wl=Ga(rc),$l=Ga(Vl),ql=Ga(Dl),Kl=Ga(Bl),Gl=va;(Nl&&Gl(new Nl(new ArrayBuffer(1)))!=Hl||rc&&Gl(new rc)!=Fl||Vl&&Gl(Vl.resolve())!=Ll||Dl&&Gl(new Dl)!=zl||Bl&&Gl(new Bl)!=jl)&&(Gl=function(t){var e=va(t),n="[object Object]"==e?t.constructor:void 0,i=n?Ga(n):"";if(i)switch(i){case Ul:return Hl;case Wl:return Fl;case $l:return Ll;case ql:return zl;case Kl:return jl}return e});var Jl=Gl,Yl=Object.prototype.hasOwnProperty,Ql=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Yl.call(t,"index")&&(n.index=t.index,n.input=t.input),n},Xl=ca.Uint8Array,Zl=function(t){var e=new t.constructor(t.byteLength);return new Xl(e).set(new Xl(t)),e},tu=function(t,e){var n=e?Zl(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)},eu=/\w*$/,nu=function(t){var e=new t.constructor(t.source,eu.exec(t));return e.lastIndex=t.lastIndex,e},iu=la?la.prototype:void 0,ru=iu?iu.valueOf:void 0,ou=function(t){return ru?Object(ru.call(t)):{}},su=function(t,e){var n=e?Zl(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)},au=function(t,e,n){var i=t.constructor;switch(e){case"[object ArrayBuffer]":return Zl(t);case"[object Boolean]":case"[object Date]":return new i(+t);case"[object DataView]":return tu(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return su(t,n);case"[object Map]":case"[object Set]":return new i;case"[object Number]":case"[object String]":return new i(t);case"[object RegExp]":return nu(t);case"[object Symbol]":return ou(t)}},cu=Object.create,lu=function(){function t(){}return function(e){if(!Zs(e))return{};if(cu)return cu(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),uu=function(t){return"function"!=typeof t.constructor||il(t)?{}:lu(Aa(t))},hu=function(t){return ya(t)&&"[object Map]"==Jl(t)},du=Qc&&Qc.isMap,fu=du?Kc(du):hu,mu=function(t){return ya(t)&&"[object Set]"==Jl(t)},gu=Qc&&Qc.isSet,pu=gu?Kc(gu):mu,wu="[object Arguments]",vu="[object Function]",bu="[object Object]",yu={};yu[wu]=yu["[object Array]"]=yu["[object ArrayBuffer]"]=yu["[object DataView]"]=yu["[object Boolean]"]=yu["[object Date]"]=yu["[object Float32Array]"]=yu["[object Float64Array]"]=yu["[object Int8Array]"]=yu["[object Int16Array]"]=yu["[object Int32Array]"]=yu["[object Map]"]=yu["[object Number]"]=yu["[object Object]"]=yu["[object RegExp]"]=yu["[object Set]"]=yu["[object String]"]=yu["[object Symbol]"]=yu["[object Uint8Array]"]=yu["[object Uint8ClampedArray]"]=yu["[object Uint16Array]"]=yu["[object Uint32Array]"]=!0,yu["[object Error]"]=yu[vu]=yu["[object WeakMap]"]=!1;var _u=function t(e,n,i,r,o,s){var a,c=1&n,l=2&n,u=4&n;if(i&&(a=o?i(e,r,o,s):i(e)),void 0!==a)return a;if(!Zs(e))return e;var h=ba(e);if(h){if(a=Ql(e),!c)return yl(e,a)}else{var d=Jl(e),f=d==vu||"[object GeneratorFunction]"==d;if(jc(e))return bl(e,c);if(d==bu||d==wu||f&&!o){if(a=l||f?{}:uu(e),!c)return l?Rl(e,ml(a,e)):El(e,ll(a,e))}else{if(!yu[d])return o?e:{};a=au(e,d,c)}}s||(s=new Ac);var m=s.get(e);if(m)return m;s.set(e,a),pu(e)?e.forEach((function(r){a.add(t(r,n,i,r,e,s))})):fu(e)&&e.forEach((function(r,o){a.set(o,t(r,n,i,o,e,s))}));var g=h?void 0:(u?l?Ml:Il:l?fl:cl)(e);return xc(g||e,(function(r,o){g&&(r=e[o=r]),Sc(a,o,t(r,n,i,o,e,s))})),a},ku=function(t,e){return _u(t,5,e="function"==typeof e?e:void 0)},Au=function(t){return ya(t)&&1===t.nodeType&&!Pa(t)};class xu{constructor(t,e){this._config={},e&&this.define(M(e)),t&&this._setObjectToTarget(this._config,t)}set(t,e){this._setToTarget(this._config,t,e)}define(t,e){this._setToTarget(this._config,t,e,!0)}get(t){return this._getFromSource(this._config,t)}*names(){for(const t of Object.keys(this._config))yield t}_setToTarget(t,e,n,i=!1){if(Pa(e))return void this._setObjectToTarget(t,e,i);const r=e.split(".");e=r.pop();for(const e of r)Pa(t[e])||(t[e]={}),t=t[e];if(Pa(n))return Pa(t[e])||(t[e]={}),t=t[e],void this._setObjectToTarget(t,n,i);i&&void 0!==t[e]||(t[e]=n)}_getFromSource(t,e){const n=e.split(".");e=n.pop();for(const e of n){if(!Pa(t[e])){t=null;break}t=t[e]}return t?M(t[e]):void 0}_setObjectToTarget(t,e,n){Object.keys(e).forEach((i=>{this._setToTarget(t,i,e[i],n)}))}}const Tu=B(d());["_getProxyEmitter","_getAllProxyEmitters","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((t=>{B[t]=Tu.prototype[t]}));class Cu extends(d()){constructor(t,e){super(),f(this,F(t,e)),this._domNode=t,this._options=e}attach(t){if(this._domListeners&&this._domListeners[t])return;const e=this._createDomListener(t);this._domNode.addEventListener(t,e,this._options),this._domListeners||(this._domListeners={}),this._domListeners[t]=e}detach(t){let e;!this._domListeners[t]||(e=this._events[t])&&e.callbacks.length||this._domListeners[t].removeListener()}_addEventListener(t,e,n){this.attach(t),d().prototype._addEventListener.call(this,t,e,n)}_removeEventListener(t,e){d().prototype._removeEventListener.call(this,t,e),this.detach(t)}_createDomListener(t){const e=e=>{this.fire(t,e)};return e.removeListener=()=>{this._domNode.removeEventListener(t,e,this._options),delete this._domListeners[t]},e}}let Eu;try{Eu={window:window,document:document}}catch(Ls){Eu={window:{},document:{}}}var Su=Eu;const Pu=["top","right","bottom","left","width","height"];class Ru{constructor(t){const e=j(t);if(Object.defineProperty(this,"_source",{value:t._source||t,writable:!0,enumerable:!1}),$(t)||e)if(e){const e=Ru.getDomRangeRects(t);U(this,Ru.getBoundingRect(e))}else U(this,t.getBoundingClientRect());else if(D(t)){const{innerWidth:e,innerHeight:n}=t;U(this,{top:0,right:e,bottom:n,left:0,width:e,height:n})}else U(this,t)}clone(){return new Ru(this)}moveTo(t,e){return this.top=e,this.right=t+this.width,this.bottom=e+this.height,this.left=t,this}moveBy(t,e){return this.top+=e,this.right+=t,this.left+=t,this.bottom+=e,this}getIntersection(t){const e={top:Math.max(this.top,t.top),right:Math.min(this.right,t.right),
bottom:Math.min(this.bottom,t.bottom),left:Math.max(this.left,t.left),width:0,height:0};return e.width=e.right-e.left,e.height=e.bottom-e.top,e.width<0||e.height<0?null:new Ru(e)}getIntersectionArea(t){const e=this.getIntersection(t);return e?e.getArea():0}getArea(){return this.width*this.height}getVisible(){const t=this._source;let e=this.clone();if(!W(t)){let n=t.parentNode||t.commonAncestorContainer;for(;n&&!W(n);){const t=new Ru(n),i=e.getIntersection(t);if(!i)return null;i.getArea()<e.getArea()&&(e=i),n=n.parentNode}}return e}isEqual(t){for(const e of Pu)if(this[e]!==t[e])return!1;return!0}contains(t){const e=this.getIntersection(t);return!(!e||!e.isEqual(t))}excludeScrollbarsAndBorders(){const t=this._source;let e,n,i;if(D(t))e=t.innerWidth-t.document.documentElement.clientWidth,n=t.innerHeight-t.document.documentElement.clientHeight,i=t.getComputedStyle(t.document.documentElement).direction;else{const r=H(t);e=t.offsetWidth-t.clientWidth-r.left-r.right,n=t.offsetHeight-t.clientHeight-r.top-r.bottom,i=t.ownerDocument.defaultView.getComputedStyle(t).direction,this.left+=r.left,this.top+=r.top,this.right-=r.right,this.bottom-=r.bottom,this.width=this.right-this.left,this.height=this.bottom-this.top}return this.width-=e,"ltr"===i?this.right-=e:this.left+=e,this.height-=n,this.bottom-=n,this}static getDomRangeRects(t){const e=[],n=Array.from(t.getClientRects());if(n.length)for(const t of n)e.push(new Ru(t));else{let n=t.startContainer;z(n)&&(n=n.parentNode);const i=new Ru(n.getBoundingClientRect());i.right=i.left,i.width=0,e.push(i)}return e}static getBoundingRect(t){const e={left:Number.POSITIVE_INFINITY,top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,width:0,height:0};let n=0;for(const i of t)n++,e.left=Math.min(e.left,i.left),e.top=Math.min(e.top,i.top),e.right=Math.max(e.right,i.right),e.bottom=Math.max(e.bottom,i.bottom);return 0==n?null:(e.width=e.right-e.left,e.height=e.bottom-e.top,new Ru(e))}}class Ou{constructor(t,e){Ou._observerInstance||Ou._createObserver(),this._element=t,this._callback=e,Ou._addElementCallback(t,e),Ou._observerInstance.observe(t)}destroy(){Ou._deleteElementCallback(this._element,this._callback)}static _addElementCallback(t,e){Ou._elementCallbacks||(Ou._elementCallbacks=new Map);let n=Ou._elementCallbacks.get(t);n||(n=new Set,Ou._elementCallbacks.set(t,n)),n.add(e)}static _deleteElementCallback(t,e){const n=Ou._getElementCallbacks(t);n&&(n.delete(e),n.size||(Ou._elementCallbacks.delete(t),Ou._observerInstance.unobserve(t))),Ou._elementCallbacks&&!Ou._elementCallbacks.size&&(Ou._observerInstance=null,Ou._elementCallbacks=null)}static _getElementCallbacks(t){return Ou._elementCallbacks?Ou._elementCallbacks.get(t):null}static _createObserver(){Ou._observerInstance=new Su.window.ResizeObserver((t=>{for(const e of t){const t=Ou._getElementCallbacks(e.target);if(t)for(const n of t)n(e)}}))}}Ou._observerInstance=null,Ou._elementCallbacks=null;class Iu{constructor(t,e){const n=t(e.targetRect,e.elementRect,e.viewportRect);if(!n)return;const{left:i,top:r,name:o,config:s}=n;this.name=o,this.config=s,this._positioningFunctionCorrdinates={left:i,top:r},this._options=e}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get limiterIntersectionArea(){const t=this._options.limiterRect;if(t){const e=this._options.viewportRect;if(!e)return t.getIntersectionArea(this._rect);{const n=t.getIntersection(e);if(n)return n.getIntersectionArea(this._rect)}}return 0}get viewportIntersectionArea(){const t=this._options.viewportRect;return t?t.getIntersectionArea(this._rect):0}get _rect(){return this._cachedRect||(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCorrdinates.left,this._positioningFunctionCorrdinates.top)),this._cachedRect}get _absoluteRect(){return this._cachedAbsoluteRect||(this._cachedAbsoluteRect=Z(this._rect),this._options.positionedElementAncestor&&function(t,e){const n=Z(new Ru(e)),i=H(e);let r=0,o=0;r-=n.left,o-=n.top,r+=e.scrollLeft,o+=e.scrollTop,r-=i.left,o-=i.top,t.moveBy(r,o)}(this._cachedAbsoluteRect,this._options.positionedElementAncestor)),this._cachedAbsoluteRect}}const Mu={ctrl:"\u2303",cmd:"\u2318",alt:"\u2325",shift:"\u21e7"},Nu={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},Vu=function(){const t={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let e=65;e<=90;e++){t[String.fromCharCode(e).toLowerCase()]=e}for(let e=48;e<=57;e++)t[e-48]=e;for(let e=112;e<=123;e++)t["f"+(e-111)]=e;for(const e of"`-=[];',./\\")t[e]=e.charCodeAt(0);return t}(),Du=Object.fromEntries(Object.entries(Vu).map((([t,e])=>[e,t.charAt(0).toUpperCase()+t.slice(1)])));Su.window.CKEDITOR_TRANSLATIONS||(Su.window.CKEDITOR_TRANSLATIONS={});const Bu=["ar","ara","fa","per","fas","he","heb","ku","kur","ug","uig"];class Fu{constructor({uiLanguage:t="en",contentLanguage:e}={}){this.uiLanguage=t,this.contentLanguage=e||this.uiLanguage,this.uiLanguageDirection=pt(this.uiLanguage),this.contentLanguageDirection=pt(this.contentLanguage),this.t=(t,e)=>this._t(t,e)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(t,e=[]){e=mt(e),"string"==typeof t&&(t={string:t});const n=t.plural?e[0]:1;return function(t,e){return t.replace(/%(\d+)/g,((t,n)=>n<e.length?e[n]:t))}(gt(this.uiLanguage,t,n),e)}}class Lu extends(d()){constructor(t={},e={}){super();const n=S(t);if(n||(e=t),this._items=[],this._itemMap=new Map,this._idProperty=e.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],n)for(const e of t)this._items.push(e),this._itemMap.set(this._getItemIdBeforeAdding(e),e)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(t,e){return this.addMany([t],e)}addMany(t,e){if(void 0===e)e=this._items.length;else if(e>this._items.length||e<0)throw new qs("collection-add-item-invalid-index",this);let n=0;for(const i of t){const t=this._getItemIdBeforeAdding(i),r=e+n;this._items.splice(r,0,i),this._itemMap.set(t,i),this.fire("add",i,r),n++}return this.fire("change",{added:t,removed:[],index:e}),this}get(t){let e;if("string"==typeof t)e=this._itemMap.get(t);else{if("number"!=typeof t)throw new qs("collection-get-invalid-arg",this);e=this._items[t]}return e||null}has(t){if("string"==typeof t)return this._itemMap.has(t);{const e=t[this._idProperty];return e&&this._itemMap.has(e)}}getIndex(t){let e;return e="string"==typeof t?this._itemMap.get(t):t,e?this._items.indexOf(e):-1}remove(t){const[e,n]=this._remove(t);return this.fire("change",{added:[],removed:[e],index:n}),e}map(t,e){return this._items.map(t,e)}find(t,e){return this._items.find(t,e)}filter(t,e){return this._items.filter(t,e)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);const t=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:t,index:0})}bindTo(t){if(this._bindToCollection)throw new qs("collection-bind-to-rebind",this);return this._bindToCollection=t,{as:t=>{this._setUpBindToBinding((e=>new t(e)))},using:t=>{"function"==typeof t?this._setUpBindToBinding(t):this._setUpBindToBinding((e=>e[t]))}}}_setUpBindToBinding(t){const e=this._bindToCollection,n=(n,i,r)=>{const o=e._bindToCollection==this,s=e._bindToInternalToExternalMap.get(i);if(o&&s)this._bindToExternalToInternalMap.set(i,s),this._bindToInternalToExternalMap.set(s,i);else{const n=t(i);if(!n)return void this._skippedIndexesFromExternal.push(r);let o=r;for(const t of this._skippedIndexesFromExternal)r>t&&o--;for(const t of e._skippedIndexesFromExternal)o>=t&&o++;this._bindToExternalToInternalMap.set(i,n),this._bindToInternalToExternalMap.set(n,i),this.add(n,o);for(let t=0;t<e._skippedIndexesFromExternal.length;t++)o<=e._skippedIndexesFromExternal[t]&&e._skippedIndexesFromExternal[t]++}};for(const t of e)n(0,t,e.getIndex(t));this.listenTo(e,"add",n),this.listenTo(e,"remove",((t,e,n)=>{const i=this._bindToExternalToInternalMap.get(e);i&&this.remove(i),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce(((t,e)=>(n<e&&t.push(e-1),n>e&&t.push(e),t)),[])}))}_getItemIdBeforeAdding(t){const e=this._idProperty;let n;if(e in t){if(n=t[e],"string"!=typeof n)throw new qs("collection-add-invalid-id",this);if(this.get(n))throw new qs("collection-add-item-already-exists",this)}else t[e]=n=a();return n}_remove(t){let e,n,i,r=!1;const o=this._idProperty;if("string"==typeof t?(n=t,i=this._itemMap.get(n),r=!i,i&&(e=this._items.indexOf(i))):"number"==typeof t?(e=t,i=this._items[e],r=!i,i&&(n=i[o])):(i=t,n=i[o],e=this._items.indexOf(i),r=-1==e||!this._itemMap.get(n)),r)throw new qs("collection-remove-404",this);this._items.splice(e,1),this._itemMap.delete(n);const s=this._bindToInternalToExternalMap.get(i);return this._bindToInternalToExternalMap.delete(i),this._bindToExternalToInternalMap.delete(s),this.fire("remove",i,e),[i,e]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}class zu extends(B(y())){constructor(){super(),this._elements=new Set,this._nextEventLoopTimeout=null,this.set("isFocused",!1),this.set("focusedElement",null)}add(t){if(this._elements.has(t))throw new qs("focustracker-add-element-already-exist",this);this.listenTo(t,"focus",(()=>this._focus(t)),{useCapture:!0}),this.listenTo(t,"blur",(()=>this._blur()),{useCapture:!0}),this._elements.add(t)}remove(t){t===this.focusedElement&&this._blur(),this._elements.has(t)&&(this.stopListening(t),this._elements.delete(t))}destroy(){this.stopListening()}_focus(t){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=t,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout((()=>{this.focusedElement=null,this.isFocused=!1}),0)}}class ju{constructor(){this._listener=new(B())}listenTo(t){this._listener.listenTo(t,"keydown",((t,e)=>{this._listener.fire("_keydown:"+ut(e),e)}))}set(t,e,n={}){const i=ht(t),r=n.priority;this._listener.listenTo(this._listener,"_keydown:"+i,((t,n)=>{e(n,(()=>{n.preventDefault(),n.stopPropagation(),t.stop()})),t.return=!0}),{priority:r})}press(t){return!!this._listener.fire("_keydown:"+ut(t),t)}destroy(){this._listener.stopListening()}}const Hu=function(){const t=/\p{Regional_Indicator}{2}/u.source,e="(?:"+[/\p{Emoji}[\u{E0020}-\u{E007E}]+\u{E007F}/u,/\p{Emoji}\u{FE0F}?\u{20E3}/u,/\p{Emoji}\u{FE0F}/u,/(?=\p{General_Category=Other_Symbol})\p{Emoji}\p{Emoji_Modifier}*/u].map((t=>t.source)).join("|")+")";return new RegExp(`${t}|${e}(?:\u200d${e})*`,"ug")}();class Uu extends(y()){constructor(t){super(),this.editor=t,this.set("isEnabled",!0),this._disableStack=new Set}forceDisabled(t){this._disableStack.add(t),1==this._disableStack.size&&(this.on("set:isEnabled",kt,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(t){this._disableStack.delete(t),0==this._disableStack.size&&(this.off("set:isEnabled",kt),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}class Wu extends(y()){constructor(t){super(),this.editor=t,this.set("value",void 0),this.set("isEnabled",!1),this._affectsData=!0,this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",(()=>{this.refresh()})),this.on("execute",(t=>{this.isEnabled||t.stop()}),{priority:"high"}),this.listenTo(t,"change:isReadOnly",((t,e,n)=>{n&&this.affectsData?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}))}get affectsData(){return this._affectsData}set affectsData(t){this._affectsData=t}refresh(){this.isEnabled=!0}forceDisabled(t){this._disableStack.add(t),1==this._disableStack.size&&(this.on("set:isEnabled",At,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(t){this._disableStack.delete(t),0==this._disableStack.size&&(this.off("set:isEnabled",At),this.refresh())}execute(...t){}destroy(){this.stopListening()}}class $u extends Wu{constructor(t){super(t),this._childCommandsDefinitions=[]}refresh(){}execute(...t){const e=this._getFirstEnabledCommand();return!!e&&e.execute(t)}registerChildCommand(t,e={}){c(this._childCommandsDefinitions,{command:t,priority:e.priority||"normal"}),t.on("change:isEnabled",(()=>this._checkEnabled())),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){const t=this._childCommandsDefinitions.find((({command:t})=>t.isEnabled));return t&&t.command}}class qu extends(d()){constructor(t,e=[],n=[]){super(),this._context=t,this._plugins=new Map,this._availablePlugins=new Map;for(const t of e)t.pluginName&&this._availablePlugins.set(t.pluginName,t);this._contextPlugins=new Map;for(const[t,e]of n)this._contextPlugins.set(t,e),this._contextPlugins.set(e,t),t.pluginName&&this._availablePlugins.set(t.pluginName,t)}*[Symbol.iterator](){for(const t of this._plugins)"function"==typeof t[0]&&(yield t)}get(t){const e=this._plugins.get(t);if(!e){let e=t;throw"function"==typeof t&&(e=t.pluginName||t.name),new qs("plugincollection-plugin-not-loaded",this._context,{plugin:e})}return e}has(t){return this._plugins.has(t)}init(t,e=[],n=[]){function i(t){return"function"==typeof t}function r(t){return i(t)&&t.isContextPlugin}function o(t,e){return e.some((e=>e===t||s(t)===e||s(e)===t))}function s(t){return i(t)?t.pluginName||t.name:t}function a(t,n=null){t.map((t=>i(t)?t:l._availablePlugins.get(t)||t)).forEach((t=>{!function(t,e){if(!i(t)){if(e)throw new qs("plugincollection-soft-required",u,{missingPlugin:t,requiredBy:s(e)});throw new qs("plugincollection-plugin-not-found",u,{plugin:t})}}(t,n),function(t,e){if(r(e)&&!r(t))throw new qs("plugincollection-context-required",u,{plugin:s(t),requiredBy:s(e)})}(t,n),function(t,n){if(n&&o(t,e))throw new qs("plugincollection-required",u,{plugin:s(t),requiredBy:s(n)})}(t,n)}))}function c(t,e){return t.reduce(((t,n)=>n[e]?l._contextPlugins.has(n)?t:t.then(n[e].bind(n)):t),Promise.resolve())}const l=this,u=this._context;!function t(e,n=new Set){e.forEach((e=>{i(e)&&(n.has(e)||(n.add(e),e.pluginName&&!l._availablePlugins.has(e.pluginName)&&l._availablePlugins.set(e.pluginName,e),e.requires&&t(e.requires,n)))}))}(t),a(t);const h=[...function t(e,n=new Set){return e.map((t=>i(t)?t:l._availablePlugins.get(t))).reduce(((e,i)=>n.has(i)?e:(n.add(i),i.requires&&(a(i.requires,i),t(i.requires,n).forEach((t=>e.add(t)))),e.add(i))),new Set)}(t.filter((t=>!o(t,e))))];!function(t,e){for(const n of e){if("function"!=typeof n)throw new qs("plugincollection-replace-plugin-invalid-type",null,{pluginItem:n});const e=n.pluginName;if(!e)throw new qs("plugincollection-replace-plugin-missing-name",null,{pluginItem:n});if(n.requires&&n.requires.length)throw new qs("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:e});const i=l._availablePlugins.get(e);if(!i)throw new qs("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:e});const r=t.indexOf(i);if(-1===r){if(l._contextPlugins.has(i))return;throw new qs("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:e})}if(i.requires&&i.requires.length)throw new qs("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:e});t.splice(r,1,n),l._availablePlugins.set(e,n)}}(h,n);const d=function(t){return t.map((t=>{let e=l._contextPlugins.get(t);return e=e||new t(u),l._add(t,e),e}))}(h);return c(d,"init").then((()=>c(d,"afterInit"))).then((()=>d))}destroy(){const t=[];for(const[,e]of this)"function"!=typeof e.destroy||this._contextPlugins.has(e)||t.push(e.destroy());return Promise.all(t)}_add(t,e){this._plugins.set(t,e);const n=t.pluginName;if(n){if(this._plugins.has(n))throw new qs("plugincollection-plugin-name-conflict",null,{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:t});this._plugins.set(n,e)}}}class Ku{constructor(t){this.config=new xu(t,this.constructor.defaultConfig);const e=this.constructor.builtinPlugins;this.config.define("plugins",e),this.plugins=new qu(this,e);const n=this.config.get("language")||{};this.locale=new Fu({uiLanguage:"string"==typeof n?n:n.ui,contentLanguage:this.config.get("language.content")}),this.t=this.locale.t,this.editors=new Lu,this._contextOwner=null}initPlugins(){const t=this.config.get("plugins")||[],e=this.config.get("substitutePlugins")||[];for(const n of t.concat(e)){if("function"!=typeof n)throw new qs("context-initplugins-constructor-only",null,{Plugin:n});if(!0!==n.isContextPlugin)throw new qs("context-initplugins-invalid-plugin",null,{Plugin:n})}return this.plugins.init(t,[],e)}destroy(){return Promise.all(Array.from(this.editors,(t=>t.destroy()))).then((()=>this.plugins.destroy()))}_addEditor(t,e){if(this._contextOwner)throw new qs("context-addeditor-private-context");this.editors.add(t),e&&(this._contextOwner=t)}_removeEditor(t){return this.editors.has(t)&&this.editors.remove(t),this._contextOwner===t?this.destroy():Promise.resolve()}_getEditorConfig(){const t={};for(const e of this.config.names())["plugins","removePlugins","extraPlugins"].includes(e)||(t[e]=this.config.get(e));return t}static create(t){return new Promise((e=>{const n=new this(t);e(n.initPlugins().then((()=>n)))}))}}class Gu extends(y()){constructor(t){super(),this.context=t}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}var Ju=t(85072),Yu=t.n(Ju),Qu=t(28989),Xu=t.n(Qu),Zu={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(Xu(),Zu),Xu().locals;const th=new WeakMap;class eh{is(){throw new Error("is() method is abstract")}}var nh=function(t){return _u(t,4)};class ih extends(d(eh)){constructor(t){super(),this.document=t,this.parent=null}get index(){let t;if(!this.parent)return null;if(-1==(t=this.parent.getChildIndex(this)))throw new qs("view-node-not-found-in-parent",this);return t}get nextSibling(){const t=this.index;return null!==t&&this.parent.getChild(t+1)||null}get previousSibling(){const t=this.index;return null!==t&&this.parent.getChild(t-1)||null}get root(){let t=this;for(;t.parent;)t=t.parent;return t}isAttached(){return this.root.is("rootElement")}getPath(){const t=[];let e=this;for(;e.parent;)t.unshift(e.index),e=e.parent;return t}getAncestors(t={}){const e=[];let n=t.includeSelf?this:this.parent;for(;n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}getCommonAncestor(t,e={}){const n=this.getAncestors(e),i=t.getAncestors(e);let r=0;for(;n[r]==i[r]&&n[r];)r++;return 0===r?null:n[r-1]}isBefore(t){if(this==t)return!1;if(this.root!==t.root)return!1;const e=this.getPath(),n=t.getPath(),i=E(e,n);switch(i){case"prefix":return!0;case"extension":return!1;default:return e[i]<n[i]}}isAfter(t){return this!=t&&this.root===t.root&&!this.isBefore(t)}_remove(){this.parent._removeChildren(this.index)}_fireChange(t,e){this.fire(`change:${t}`,e),this.parent&&this.parent._fireChange(t,e)}toJSON(){const t=nh(this);return delete t.parent,t}}ih.prototype.is=function(t){return"node"===t||"view:node"===t};class rh extends ih{constructor(t,e){super(t),this._textData=e}get data(){return this._textData}get _data(){return this.data}set _data(t){this._fireChange("text",this),this._textData=t}isSimilar(t){return t instanceof rh&&(this===t||this.data===t.data)}_clone(){return new rh(this.document,this.data)}}rh.prototype.is=function(t){return"$text"===t||"view:$text"===t||"text"===t||"view:text"===t||"node"===t||"view:node"===t};class oh extends eh{constructor(t,e,n){if(super(),this.textNode=t,e<0||e>t.data.length)throw new qs("view-textproxy-wrong-offsetintext",this);if(n<0||e+n>t.data.length)throw new qs("view-textproxy-wrong-length",this);this.data=t.data.substring(e,e+n),this.offsetInText=e}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}getAncestors(t={}){const e=[];let n=t.includeSelf?this.textNode:this.parent;for(;null!==n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}}oh.prototype.is=function(t){return"$textProxy"===t||"view:$textProxy"===t||"textProxy"===t||"view:textProxy"===t};class sh{constructor(...t){this._patterns=[],this.add(...t)}add(...t){for(let e of t)("string"==typeof e||e instanceof RegExp)&&(e={name:e}),this._patterns.push(e)}match(...t){for(const e of t)for(const t of this._patterns){const n=St(e,t);if(n)return{element:e,pattern:t,match:n}}return null}matchAll(...t){const e=[];for(const n of t)for(const t of this._patterns){const i=St(n,t);i&&e.push({element:n,pattern:t,match:i})}return e.length>0?e:null}getElementName(){if(1!==this._patterns.length)return null;const t=this._patterns[0],e=t.name;return"function"==typeof t||!e||e instanceof RegExp?null:e}}var ah=function(t){return"symbol"==typeof t||ya(t)&&"[object Symbol]"==va(t)},ch=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,lh=/^\w*$/,uh=function(t,e){if(ba(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ah(t))||lh.test(t)||!ch.test(t)||null!=e&&t in Object(e)};Rt.Cache=_c;var hh=Rt,dh=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fh=/\\(\\)?/g,mh=function(t){var e=hh(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(dh,(function(t,n,i,r){e.push(i?r.replace(fh,"$1"):n||t)})),e})),gh=mh,ph=function(t,e){for(var n=-1,i=null==t?0:t.length,r=Array(i);++n<i;)r[n]=e(t[n],n,t);return r},wh=la?la.prototype:void 0,vh=wh?wh.toString:void 0,bh=function t(e){if("string"==typeof e)return e;if(ba(e))return ph(e,t)+"";if(ah(e))return vh?vh.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n},yh=function(t){return null==t?"":bh(t)},_h=function(t,e){return ba(t)?t:uh(t,e)?[t]:gh(yh(t))},kh=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0},Ah=function(t){if("string"==typeof t||ah(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e},xh=function(t,e){for(var n=0,i=(e=_h(e,t)).length;null!=t&&n<i;)t=t[Ah(e[n++])];return n&&n==i?t:void 0},Th=function(t,e,n){var i=-1,r=t.length;e<0&&(e=-e>r?0:r+e),(n=n>r?r:n)<0&&(n+=r),r=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(r);++i<r;)o[i]=t[i+e];return o},Ch=function(t,e){return e.length<2?t:xh(t,Th(e,0,-1))},Eh=function(t,e){return e=_h(e,t),null==(t=Ch(t,e))||delete t[Ah(kh(e))]},Sh=function(t,e){return null==t||Eh(t,e)},Ph=function(t,e,n){var i=null==t?void 0:xh(t,e);return void 0===i?n:i},Rh=function(t,e,n){(void 0!==n&&!Oa(t[e],n)||void 0===n&&!(e in t))&&Cc(t,e,n)},Oh=function(t){return function(e,n,i){for(var r=-1,o=Object(e),s=i(e),a=s.length;a--;){var c=s[t?a:++r];if(!1===n(o[c],c,o))break}return e}}(),Ih=function(t){return ya(t)&&al(t)},Mh=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},Nh=function(t){return Pc(t,fl(t))},Vh=function(t,e,n,i,r,o,s){var a=Mh(t,n),c=Mh(e,n),l=s.get(c);if(l)Rh(t,n,l);else{var u=o?o(a,c,n+"",t,e,s):void 0,h=void 0===u;if(h){var d=ba(c),f=!d&&jc(c),m=!d&&!f&&Zc(c);u=c,d||f||m?ba(a)?u=a:Ih(a)?u=yl(a):f?(h=!1,u=bl(c,!0)):m?(h=!1,u=su(c,!0)):u=[]:Pa(c)||Dc(c)?(u=a,Dc(a)?u=Nh(a):Zs(a)&&!Ua(a)||(u=uu(c))):h=!1}h&&(s.set(c,u),r(u,c,i,o,s),s.delete(c)),Rh(t,n,u)}},Dh=function t(e,n,i,r,o){e!==n&&Oh(n,(function(s,a){if(o||(o=new Ac),Zs(s))Vh(e,n,a,i,t,r,o);else{var c=r?r(Mh(e,a),s,a+"",e,n,o):void 0;void 0===c&&(c=s),Rh(e,a,c)}}),fl)},Bh=function(t){return t},Fh=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)},Lh=Math.max,zh=function(t,e,n){return e=Lh(void 0===e?t.length-1:e,0),function(){for(var i=arguments,r=-1,o=Lh(i.length-e,0),s=Array(o);++r<o;)s[r]=i[e+r];r=-1;for(var a=Array(e+1);++r<e;)a[r]=i[r];return a[e]=n(s),Fh(t,this,a)}},jh=function(t){return function(){return t}},Hh=Tc?function(t,e){return Tc(t,"toString",{configurable:!0,enumerable:!1,value:jh(e),writable:!0})}:Bh,Uh=Date.now,Wh=function(t){var e=0,n=0;return function(){var i=Uh(),r=16-(i-n);if(n=i,r>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}},$h=Wh(Hh),qh=function(t,e){return $h(zh(t,e,Bh),t+"")},Kh=function(t,e,n){if(!Zs(n))return!1;var i=typeof e;return!!("number"==i?al(n)&&Uc(e,n.length):"string"==i&&e in n)&&Oa(n[e],t)},Gh=function(t){return qh((function(e,n){var i=-1,r=n.length,o=r>1?n[r-1]:void 0,s=r>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(r--,o):void 0,s&&Kh(n[0],n[1],s)&&(o=r<3?void 0:o,r=1),e=Object(e);++i<r;){var a=n[i];a&&t(e,a,i,o)}return e}))},Jh=Gh((function(t,e,n){Dh(t,e,n)})),Yh=function(t,e,n,i){if(!Zs(t))return t;for(var r=-1,o=(e=_h(e,t)).length,s=o-1,a=t;null!=a&&++r<o;){var c=Ah(e[r]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return t;if(r!=s){var u=a[c];void 0===(l=i?i(u,c,a):void 0)&&(l=Zs(u)?u:Uc(e[r+1])?[]:{})}Sc(a,c,l),a=a[c]}return t},Qh=function(t,e,n){return null==t?t:Yh(t,e,n)};class Xh{constructor(t){this._styles={},this._styleProcessor=t}get isEmpty(){const t=Object.entries(this._styles);return!Array.from(t).length}get size(){return this.isEmpty?0:this.getStyleNames().length}setTo(t){this.clear();const e=Array.from(function(t){let e=null,n=0,i=0,r=null;const o=new Map;if(""===t)return o;";"!=t.charAt(t.length-1)&&(t+=";");for(let s=0;s<t.length;s++){const a=t.charAt(s);if(null===e)switch(a){case":":r||(r=t.substr(n,s-n),i=s+1);break;case'"':case"'":e=a;break;case";":{const e=t.substr(i,s-i);r&&o.set(r.trim(),e.trim()),r=null,n=s+1;break}}else a===e&&(e=null)}return o}(t).entries());for(const[t,n]of e)this._styleProcessor.toNormalizedForm(t,n,this._styles)}has(t){if(this.isEmpty)return!1;const e=this._styleProcessor.getReducedForm(t,this._styles).find((([e])=>e===t));return Array.isArray(e)}set(t,e){if(Zs(t))for(const[e,n]of Object.entries(t))this._styleProcessor.toNormalizedForm(e,n,this._styles);else this._styleProcessor.toNormalizedForm(t,e,this._styles)}remove(t){const e=Ot(t);Sh(this._styles,e),delete this._styles[t],this._cleanEmptyObjectsOnPath(e)}getNormalized(t){return this._styleProcessor.getNormalized(t,this._styles)}toString(){return this.isEmpty?"":this._getStylesEntries().map((t=>t.join(":"))).sort().join(";")+";"}getAsString(t){if(this.isEmpty)return;if(this._styles[t]&&!Zs(this._styles[t]))return this._styles[t];const e=this._styleProcessor.getReducedForm(t,this._styles).find((([e])=>e===t));return Array.isArray(e)?e[1]:void 0}getStyleNames(t=!1){return this.isEmpty?[]:t?this._styleProcessor.getStyleNames(this._styles):this._getStylesEntries().map((([t])=>t))}clear(){this._styles={}}_getStylesEntries(){const t=[],e=Object.keys(this._styles);for(const n of e)t.push(...this._styleProcessor.getReducedForm(n,this._styles));return t}_cleanEmptyObjectsOnPath(t){const e=t.split(".");if(!(e.length>1))return;const n=e.splice(0,e.length-1).join("."),i=Ph(this._styles,n);i&&!Array.from(Object.keys(i)).length&&this.remove(n)}}class Zh{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(t,e,n){if(Zs(e))It(n,Ot(t),e);else if(this._normalizers.has(t)){const i=this._normalizers.get(t),{path:r,value:o}=i(e);It(n,r,o)}else It(n,t,e)}getNormalized(t,e){if(!t)return Jh({},e);if(void 0!==e[t])return e[t];if(this._extractors.has(t)){const n=this._extractors.get(t);if("string"==typeof n)return Ph(e,n);const i=n(t,e);if(i)return i}return Ph(e,Ot(t))}getReducedForm(t,e){const n=this.getNormalized(t,e);return void 0===n?[]:this._reducers.has(t)?this._reducers.get(t)(n):[[t,n]]}getStyleNames(t){const e=Array.from(this._consumables.keys()).filter((e=>{const n=this.getNormalized(e,t);return n&&"object"==typeof n?Object.keys(n).length:n})),n=new Set([...e,...Object.keys(t)]);return Array.from(n.values())}getRelatedStyles(t){return this._consumables.get(t)||[]}setNormalizer(t,e){this._normalizers.set(t,e)}setExtractor(t,e){this._extractors.set(t,e)}setReducer(t,e){this._reducers.set(t,e)}setStyleRelation(t,e){this._mapStyleNames(t,e);for(const n of e)this._mapStyleNames(n,[t])}_mapStyleNames(t,e){this._consumables.has(t)||this._consumables.set(t,[]),this._consumables.get(t).push(...e)}}class td extends ih{constructor(t,e,n,i){if(super(t),this.name=e,this._attrs=function(t){const e=vt(t);for(const[t,n]of e)null===n?e.delete(t):"string"!=typeof n&&e.set(t,String(n));return e}(n),this._children=[],i&&this._insertChild(0,i),this._classes=new Set,this._attrs.has("class")){const t=this._attrs.get("class");Mt(this._classes,t),this._attrs.delete("class")}this._styles=new Xh(this.document.stylesProcessor),this._attrs.has("style")&&(this._styles.setTo(this._attrs.get("style")),this._attrs.delete("style")),this._customProperties=new Map,this._unsafeAttributesToRender=[]}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(t){if("class"==t)return this._classes.size>0?[...this._classes].join(" "):void 0;if("style"==t){const t=this._styles.toString();return""==t?void 0:t}return this._attrs.get(t)}hasAttribute(t){return"class"==t?this._classes.size>0:"style"==t?!this._styles.isEmpty:this._attrs.has(t)}isSimilar(t){if(!(t instanceof td))return!1;if(this===t)return!0;if(this.name!=t.name)return!1;if(this._attrs.size!==t._attrs.size||this._classes.size!==t._classes.size||this._styles.size!==t._styles.size)return!1;for(const[e,n]of this._attrs)if(!t._attrs.has(e)||t._attrs.get(e)!==n)return!1;for(const e of this._classes)if(!t._classes.has(e))return!1;for(const e of this._styles.getStyleNames())if(!t._styles.has(e)||t._styles.getAsString(e)!==this._styles.getAsString(e))return!1;return!0}hasClass(...t){for(const e of t)if(!this._classes.has(e))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(t){return this._styles.getAsString(t)}getNormalizedStyle(t){return this._styles.getNormalized(t)}getStyleNames(t){return this._styles.getStyleNames(t)}hasStyle(...t){for(const e of t)if(!this._styles.has(e))return!1;return!0}findAncestor(...t){const e=new sh(...t);let n=this.parent;for(;n&&!n.is("documentFragment");){if(e.match(n))return n;n=n.parent}return null}getCustomProperty(t){return this._customProperties.get(t)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const t=Array.from(this._classes).sort().join(","),e=this._styles.toString(),n=Array.from(this._attrs).map((t=>`${t[0]}="${t[1]}"`)).sort().join(" ");return this.name+(""==t?"":` class="${t}"`)+(e?` style="${e}"`:"")+(""==n?"":` ${n}`)}shouldRenderUnsafeAttribute(t){return this._unsafeAttributesToRender.includes(t)}_clone(t=!1){const e=[];if(t)for(const n of this.getChildren())e.push(n._clone(t));const n=new this.constructor(this.document,this.name,this._attrs,e);return n._classes=new Set(this._classes),n._styles.set(this._styles.getNormalized()),n._customProperties=new Map(this._customProperties),n.getFillerOffset=this.getFillerOffset,n._unsafeAttributesToRender=this._unsafeAttributesToRender,n}_appendChild(t){return this._insertChild(this.childCount,t)}_insertChild(t,e){this._fireChange("children",this);let n=0;const i=function(t,e){return"string"==typeof e?[new rh(t,e)]:(S(e)||(e=[e]),Array.from(e).map((e=>"string"==typeof e?new rh(t,e):e instanceof oh?new rh(t,e.data):e)))}(this.document,e);for(const e of i)null!==e.parent&&e._remove(),e.parent=this,e.document=this.document,this._children.splice(t,0,e),t++,n++;return n}_removeChildren(t,e=1){this._fireChange("children",this);for(let n=t;n<t+e;n++)this._children[n].parent=null;return this._children.splice(t,e)}_setAttribute(t,e){const n=String(e);this._fireChange("attributes",this),"class"==t?Mt(this._classes,n):"style"==t?this._styles.setTo(n):this._attrs.set(t,n)}_removeAttribute(t){return this._fireChange("attributes",this),"class"==t?this._classes.size>0&&(this._classes.clear(),!0):"style"==t?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(t)}_addClass(t){this._fireChange("attributes",this);for(const e of mt(t))this._classes.add(e)}_removeClass(t){
this._fireChange("attributes",this);for(const e of mt(t))this._classes.delete(e)}_setStyle(t,e){this._fireChange("attributes",this),Pa(t)?this._styles.set(t):this._styles.set(t,e)}_removeStyle(t){this._fireChange("attributes",this);for(const e of mt(t))this._styles.remove(e)}_setCustomProperty(t,e){this._customProperties.set(t,e)}_removeCustomProperty(t){return this._customProperties.delete(t)}}td.prototype.is=function(t,e){return e?e===this.name&&("element"===t||"view:element"===t):"element"===t||"view:element"===t||"node"===t||"view:node"===t};class ed extends td{constructor(...t){super(...t),this.getFillerOffset=Nt}}ed.prototype.is=function(t,e){return e?e===this.name&&("containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t};class nd extends(y(ed)){constructor(...t){super(...t);const e=t[0];this.set("isReadOnly",!1),this.set("isFocused",!1),this.bind("isReadOnly").to(e),this.bind("isFocused").to(e,"isFocused",(t=>t&&e.selection.editableElement==this)),this.listenTo(e.selection,"change",(()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this}))}destroy(){this.stopListening()}}nd.prototype.is=function(t,e){return e?e===this.name&&("editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t};const id=Symbol("rootName");class rd extends nd{constructor(t,e){super(t,e),this.rootName="main"}get rootName(){return this.getCustomProperty(id)}set rootName(t){this._setCustomProperty(id,t)}set _name(t){this.name=t}}rd.prototype.is=function(t,e){return e?e===this.name&&("rootElement"===t||"view:rootElement"===t||"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"rootElement"===t||"view:rootElement"===t||"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t};class od{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new qs("view-tree-walker-no-start-position",null);if(t.direction&&"forward"!=t.direction&&"backward"!=t.direction)throw new qs("view-tree-walker-unknown-direction",t.startPosition,{direction:t.direction});this.boundaries=t.boundaries||null,t.startPosition?this.position=sd._createAt(t.startPosition):this.position=sd._createAt(t.boundaries["backward"==t.direction?"end":"start"]),this.direction=t.direction||"forward",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(t){let e,n,i;do{i=this.position,({done:e,value:n}=this.next())}while(!e&&t(n));e||(this.position=i)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let t=this.position.clone();const e=this.position,n=t.parent;if(null===n.parent&&t.offset===n.childCount)return{done:!0,value:void 0};if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0,value:void 0};let i;if(n instanceof rh){if(t.isAtEnd)return this.position=sd._createAfter(n),this._next();i=n.data[t.offset]}else i=n.getChild(t.offset);if(i instanceof td)return this.shallow?t.offset++:t=new sd(i,0),this.position=t,this._formatReturnValue("elementStart",i,e,t,1);if(i instanceof rh){if(this.singleCharacters)return t=new sd(i,0),this.position=t,this._next();{let n,r=i.data.length;return i==this._boundaryEndParent?(r=this.boundaries.end.offset,n=new oh(i,0,r),t=sd._createAfter(n)):(n=new oh(i,0,i.data.length),t.offset++),this.position=t,this._formatReturnValue("text",n,e,t,r)}}if("string"==typeof i){let i;i=this.singleCharacters?1:(n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length)-t.offset;const r=new oh(n,t.offset,i);return t.offset+=i,this.position=t,this._formatReturnValue("text",r,e,t,i)}return t=sd._createAfter(n),this.position=t,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",n,e,t)}_previous(){let t=this.position.clone();const e=this.position,n=t.parent;if(null===n.parent&&0===t.offset)return{done:!0,value:void 0};if(n==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0,value:void 0};let i;if(n instanceof rh){if(t.isAtStart)return this.position=sd._createBefore(n),this._previous();i=n.data[t.offset-1]}else i=n.getChild(t.offset-1);if(i instanceof td)return this.shallow?(t.offset--,this.position=t,this._formatReturnValue("elementStart",i,e,t,1)):(t=new sd(i,i.childCount),this.position=t,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",i,e,t));if(i instanceof rh){if(this.singleCharacters)return t=new sd(i,i.data.length),this.position=t,this._previous();{let n,r=i.data.length;if(i==this._boundaryStartParent){const e=this.boundaries.start.offset;n=new oh(i,e,i.data.length-e),r=n.data.length,t=sd._createBefore(n)}else n=new oh(i,0,i.data.length),t.offset--;return this.position=t,this._formatReturnValue("text",n,e,t,r)}}if("string"==typeof i){let i;if(this.singleCharacters)i=1;else{const e=n===this._boundaryStartParent?this.boundaries.start.offset:0;i=t.offset-e}t.offset-=i;const r=new oh(n,t.offset,i);return this.position=t,this._formatReturnValue("text",r,e,t,i)}return t=sd._createBefore(n),this.position=t,this._formatReturnValue("elementStart",n,e,t,1)}_formatReturnValue(t,e,n,i,r){return e instanceof oh&&(e.offsetInText+e.data.length==e.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=sd._createAfter(e.textNode):(i=sd._createAfter(e.textNode),this.position=i)),0===e.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=sd._createBefore(e.textNode):(i=sd._createBefore(e.textNode),this.position=i))),{done:!1,value:{type:t,item:e,previousPosition:n,nextPosition:i,length:r}}}}class sd extends eh{constructor(t,e){super(),this.parent=t,this.offset=e}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){const t=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===t}get root(){return this.parent.root}get editableElement(){let t=this.parent;for(;!(t instanceof nd);){if(!t.parent)return null;t=t.parent}return t}getShiftedBy(t){const e=sd._createAt(this),n=e.offset+t;return e.offset=n<0?0:n,e}getLastMatchingPosition(t,e={}){e.startPosition=this;const n=new od(e);return n.skip(t),n.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(t){const e=this.getAncestors(),n=t.getAncestors();let i=0;for(;e[i]==n[i]&&e[i];)i++;return 0===i?null:e[i-1]}isEqual(t){return this.parent==t.parent&&this.offset==t.offset}isBefore(t){return"before"==this.compareWith(t)}isAfter(t){return"after"==this.compareWith(t)}compareWith(t){if(this.root!==t.root)return"different";if(this.isEqual(t))return"same";const e=this.parent.is("node")?this.parent.getPath():[],n=t.parent.is("node")?t.parent.getPath():[];e.push(this.offset),n.push(t.offset);const i=E(e,n);switch(i){case"prefix":return"before";case"extension":return"after";default:return e[i]<n[i]?"before":"after"}}getWalker(t={}){return t.startPosition=this,new od(t)}clone(){return new sd(this.parent,this.offset)}static _createAt(t,e){if(t instanceof sd)return new this(t.parent,t.offset);{const n=t;if("end"==e)e=n.is("$text")?n.data.length:n.childCount;else{if("before"==e)return this._createBefore(n);if("after"==e)return this._createAfter(n);if(0!==e&&!e)throw new qs("view-createpositionat-offset-required",n)}return new sd(n,e)}}static _createAfter(t){if(t.is("$textProxy"))return new sd(t.textNode,t.offsetInText+t.data.length);if(!t.parent)throw new qs("view-position-after-root",t,{root:t});return new sd(t.parent,t.index+1)}static _createBefore(t){if(t.is("$textProxy"))return new sd(t.textNode,t.offsetInText);if(!t.parent)throw new qs("view-position-before-root",t,{root:t});return new sd(t.parent,t.index)}}sd.prototype.is=function(t){return"position"===t||"view:position"===t};class ad extends eh{constructor(t,e=null){super(),this.start=t.clone(),this.end=e?e.clone():t.clone()}*[Symbol.iterator](){yield*new od({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return this.start.parent===this.end.parent}get root(){return this.start.root}getEnlarged(){let t=this.start.getLastMatchingPosition(Vt,{direction:"backward"}),e=this.end.getLastMatchingPosition(Vt);return t.parent.is("$text")&&t.isAtStart&&(t=sd._createBefore(t.parent)),e.parent.is("$text")&&e.isAtEnd&&(e=sd._createAfter(e.parent)),new ad(t,e)}getTrimmed(){let t=this.start.getLastMatchingPosition(Vt);if(t.isAfter(this.end)||t.isEqual(this.end))return new ad(t,t);let e=this.end.getLastMatchingPosition(Vt,{direction:"backward"});const n=t.nodeAfter,i=e.nodeBefore;return n&&n.is("$text")&&(t=new sd(n,0)),i&&i.is("$text")&&(e=new sd(i,i.data.length)),new ad(t,e)}isEqual(t){return this==t||this.start.isEqual(t.start)&&this.end.isEqual(t.end)}containsPosition(t){return t.isAfter(this.start)&&t.isBefore(this.end)}containsRange(t,e=!1){t.isCollapsed&&(e=!1);const n=this.containsPosition(t.start)||e&&this.start.isEqual(t.start),i=this.containsPosition(t.end)||e&&this.end.isEqual(t.end);return n&&i}getDifference(t){const e=[];return this.isIntersecting(t)?(this.containsPosition(t.start)&&e.push(new ad(this.start,t.start)),this.containsPosition(t.end)&&e.push(new ad(t.end,this.end))):e.push(this.clone()),e}getIntersection(t){if(this.isIntersecting(t)){let e=this.start,n=this.end;return this.containsPosition(t.start)&&(e=t.start),this.containsPosition(t.end)&&(n=t.end),new ad(e,n)}return null}getWalker(t={}){return t.boundaries=this,new od(t)}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}getContainedElement(){if(this.isCollapsed)return null;let t=this.start.nodeAfter,e=this.end.nodeBefore;return this.start.parent.is("$text")&&this.start.isAtEnd&&this.start.parent.nextSibling&&(t=this.start.parent.nextSibling),this.end.parent.is("$text")&&this.end.isAtStart&&this.end.parent.previousSibling&&(e=this.end.parent.previousSibling),t&&t.is("element")&&t===e?t:null}clone(){return new ad(this.start,this.end)}*getItems(t={}){t.boundaries=this,t.ignoreElementEnd=!0;const e=new od(t);for(const t of e)yield t.item}*getPositions(t={}){t.boundaries=this;const e=new od(t);yield e.position;for(const t of e)yield t.nextPosition}isIntersecting(t){return this.start.isBefore(t.end)&&this.end.isAfter(t.start)}static _createFromParentsAndOffsets(t,e,n,i){return new this(new sd(t,e),new sd(n,i))}static _createFromPositionAndShift(t,e){const n=t,i=t.getShiftedBy(e);return e>0?new this(n,i):new this(i,n)}static _createIn(t){return this._createFromParentsAndOffsets(t,0,t,t.childCount)}static _createOn(t){const e=t.is("$textProxy")?t.offsetSize:1;return this._createFromPositionAndShift(sd._createBefore(t),e)}}ad.prototype.is=function(t){return"range"===t||"view:range"===t};class cd extends(d(eh)){constructor(...t){super(),this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",t.length&&this.setTo(...t)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.end:t.start).clone()}get focus(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.start:t.end).clone()}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const t of this._ranges)yield t.clone()}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?t.clone():null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?t.clone():null}getFirstPosition(){const t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){const t=this.getLastRange();return t?t.end.clone():null}isEqual(t){if(this.isFake!=t.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=t.fakeSelectionLabel)return!1;if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let n=!1;for(const i of t._ranges)if(e.isEqual(i)){n=!0;break}if(!n)return!1}return!0}isSimilar(t){if(this.isBackward!=t.isBackward)return!1;const e=C(this.getRanges());if(e!=C(t.getRanges()))return!1;if(0==e)return!0;for(let e of this.getRanges()){e=e.getTrimmed();let n=!1;for(let i of t.getRanges())if(i=i.getTrimmed(),e.start.isEqual(i.start)&&e.end.isEqual(i.end)){n=!0;break}if(!n)return!1}return!0}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}setTo(...t){let[e,n,i]=t;if("object"==typeof n&&(i=n,n=void 0),null===e)this._setRanges([]),this._setFakeOptions(i);else if(e instanceof cd||e instanceof ld)this._setRanges(e.getRanges(),e.isBackward),this._setFakeOptions({fake:e.isFake,label:e.fakeSelectionLabel});else if(e instanceof ad)this._setRanges([e],i&&i.backward),this._setFakeOptions(i);else if(e instanceof sd)this._setRanges([new ad(e)]),this._setFakeOptions(i);else if(e instanceof ih){const t=!!i&&!!i.backward;let r;if(void 0===n)throw new qs("view-selection-setto-required-second-parameter",this);r="in"==n?ad._createIn(e):"on"==n?ad._createOn(e):new ad(sd._createAt(e,n)),this._setRanges([r],t),this._setFakeOptions(i)}else{if(!S(e))throw new qs("view-selection-setto-not-selectable",this);this._setRanges(e,i&&i.backward),this._setFakeOptions(i)}this.fire("change")}setFocus(t,e){if(null===this.anchor)throw new qs("view-selection-setfocus-no-ranges",this);const n=sd._createAt(t,e);if("same"==n.compareWith(this.focus))return;const i=this.anchor;this._ranges.pop(),"before"==n.compareWith(i)?this._addRange(new ad(n,i),!0):this._addRange(new ad(i,n)),this.fire("change")}_setRanges(t,e=!1){t=Array.from(t),this._ranges=[];for(const e of t)this._addRange(e);this._lastRangeBackward=!!e}_setFakeOptions(t={}){this._isFake=!!t.fake,this._fakeSelectionLabel=t.fake&&t.label||""}_addRange(t,e=!1){if(!(t instanceof ad))throw new qs("view-selection-add-range-not-range",this);this._pushRange(t),this._lastRangeBackward=!!e}_pushRange(t){for(const e of this._ranges)if(t.isIntersecting(e))throw new qs("view-selection-range-intersects",this,{addedRange:t,intersectingRange:e});this._ranges.push(new ad(t.start,t.end))}}cd.prototype.is=function(t){return"selection"===t||"view:selection"===t};class ld extends(d(eh)){constructor(...t){super(),this._selection=new cd,this._selection.delegate("change").to(this),t.length&&this._selection.setTo(...t)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(t){return this._selection.isEqual(t)}isSimilar(t){return this._selection.isSimilar(t)}_setTo(...t){this._selection.setTo(...t)}_setFocus(t,e){this._selection.setFocus(t,e)}}ld.prototype.is=function(t){return"selection"===t||"documentSelection"==t||"view:selection"==t||"view:documentSelection"==t};class ud extends Us{constructor(t,e,n){super(t,e),this.startRange=n,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const hd=Symbol("bubbling contexts");{const t=Dt(Object);["fire","_addEventListener","_removeEventListener"].forEach((e=>{Dt[e]=t.prototype[e]}))}class dd extends(Dt(y())){constructor(t){super(),this.selection=new ld,this.roots=new Lu({idProperty:"rootName"}),this.stylesProcessor=t,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1),this._postFixers=new Set}getRoot(t="main"){return this.roots.get(t)}registerPostFixer(t){this._postFixers.add(t)}destroy(){this.roots.map((t=>t.destroy())),this.stopListening()}_callPostFixers(t){let e=!1;do{for(const n of this._postFixers)if(e=n(t),e)break}while(e)}}class fd extends td{constructor(...t){super(...t),this.getFillerOffset=jt,this._priority=10,this._id=null,this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new qs("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}isSimilar(t){return null!==this.id||null!==t.id?this.id===t.id:super.isSimilar(t)&&this.priority==t.priority}_clone(t=!1){const e=super._clone(t);return e._priority=this._priority,e._id=this._id,e}}fd.DEFAULT_PRIORITY=10,fd.prototype.is=function(t,e){return e?e===this.name&&("attributeElement"===t||"view:attributeElement"===t||"element"===t||"view:element"===t):"attributeElement"===t||"view:attributeElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t};class md extends td{constructor(t,e,n,i){super(t,e,n,i),this.getFillerOffset=Ut}_insertChild(t,e){if(e&&(e instanceof ih||Array.from(e).length>0))throw new qs("view-emptyelement-cannot-add",[this,e]);return 0}}md.prototype.is=function(t,e){return e?e===this.name&&("emptyElement"===t||"view:emptyElement"===t||"element"===t||"view:element"===t):"emptyElement"===t||"view:emptyElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t};class gd extends td{constructor(...t){super(...t),this.getFillerOffset=$t}_insertChild(t,e){if(e&&(e instanceof ih||Array.from(e).length>0))throw new qs("view-uielement-cannot-add",[this,e]);return 0}render(t,e){return this.toDomElement(t)}toDomElement(t){const e=t.createElement(this.name);for(const t of this.getAttributeKeys())e.setAttribute(t,this.getAttribute(t));return e}}gd.prototype.is=function(t,e){return e?e===this.name&&("uiElement"===t||"view:uiElement"===t||"element"===t||"view:element"===t):"uiElement"===t||"view:uiElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t};class pd extends td{constructor(...t){super(...t),this.getFillerOffset=qt}_insertChild(t,e){if(e&&(e instanceof ih||Array.from(e).length>0))throw new qs("view-rawelement-cannot-add",[this,e]);return 0}render(){}}pd.prototype.is=function(t,e){return e?e===this.name&&("rawElement"===t||"view:rawElement"===t||"element"===t||"view:element"===t):"rawElement"===t||"view:rawElement"===t||t===this.name||t==="view:"+this.name||"element"===t||"view:element"===t||"node"===t||"view:node"===t};class wd extends(d(eh)){constructor(t,e){super(),this.document=t,this._children=[],e&&this._insertChild(0,e),this._customProperties=new Map}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}getCustomProperty(t){return this._customProperties.get(t)}*getCustomProperties(){yield*this._customProperties.entries()}_appendChild(t){return this._insertChild(this.childCount,t)}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(t,e){this._fireChange("children",this);let n=0;const i=function(t,e){return"string"==typeof e?[new rh(t,e)]:(S(e)||(e=[e]),Array.from(e).map((e=>"string"==typeof e?new rh(t,e):e instanceof oh?new rh(t,e.data):e)))}(this.document,e);for(const e of i)null!==e.parent&&e._remove(),e.parent=this,this._children.splice(t,0,e),t++,n++;return n}_removeChildren(t,e=1){this._fireChange("children",this);for(let n=t;n<t+e;n++)this._children[n].parent=null;return this._children.splice(t,e)}_fireChange(t,e){this.fire("change:"+t,e)}_setCustomProperty(t,e){this._customProperties.set(t,e)}_removeCustomProperty(t){return this._customProperties.delete(t)}}wd.prototype.is=function(t){return"documentFragment"===t||"view:documentFragment"===t};class vd{constructor(t){this.document=t,this._cloneGroups=new Map,this._slotFactory=null}setSelection(...t){this.document.selection._setTo(...t)}setSelectionFocus(...t){this.document.selection._setFocus(...t)}createDocumentFragment(t){return new wd(this.document,t)}createText(t){return new rh(this.document,t)}createAttributeElement(t,e,n={}){const i=new fd(this.document,t,e);return"number"==typeof n.priority&&(i._priority=n.priority),n.id&&(i._id=n.id),n.renderUnsafeAttributes&&i._unsafeAttributesToRender.push(...n.renderUnsafeAttributes),i}createContainerElement(t,e,n={},i={}){let r=null;Pa(n)?i=n:r=n;const o=new ed(this.document,t,e,r);return i.renderUnsafeAttributes&&o._unsafeAttributesToRender.push(...i.renderUnsafeAttributes),o}createEditableElement(t,e,n={}){const i=new nd(this.document,t,e);return n.renderUnsafeAttributes&&i._unsafeAttributesToRender.push(...n.renderUnsafeAttributes),i}createEmptyElement(t,e,n={}){const i=new md(this.document,t,e);return n.renderUnsafeAttributes&&i._unsafeAttributesToRender.push(...n.renderUnsafeAttributes),i}createUIElement(t,e,n){const i=new gd(this.document,t,e);return n&&(i.render=n),i}createRawElement(t,e,n,i={}){const r=new pd(this.document,t,e);return n&&(r.render=n),i.renderUnsafeAttributes&&r._unsafeAttributesToRender.push(...i.renderUnsafeAttributes),r}setAttribute(t,e,n){n._setAttribute(t,e)}removeAttribute(t,e){e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,n){Pa(t)&&void 0===n?e._setStyle(t):n._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,n){n._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}breakAttributes(t){return t instanceof sd?this._breakAttributes(t):this._breakAttributesRange(t)}breakContainer(t){const e=t.parent;if(!e.is("containerElement"))throw new qs("view-writer-break-non-container-element",this.document);if(!e.parent)throw new qs("view-writer-break-root",this.document);if(t.isAtStart)return sd._createBefore(e);if(!t.isAtEnd){const n=e._clone(!1);this.insert(sd._createAfter(e),n);const i=new ad(t,sd._createAt(e,"end")),r=new sd(n,0);this.move(i,r)}return sd._createAfter(e)}mergeAttributes(t){const e=t.offset,n=t.parent;if(n.is("$text"))return t;if(n.is("attributeElement")&&0===n.childCount){const t=n.parent,e=n.index;return n._remove(),this._removeFromClonedElementsGroup(n),this.mergeAttributes(new sd(t,e))}const i=n.getChild(e-1),r=n.getChild(e);if(!i||!r)return t;if(i.is("$text")&&r.is("$text"))return Qt(i,r);if(i.is("attributeElement")&&r.is("attributeElement")&&i.isSimilar(r)){const t=i.childCount;return i._appendChild(r.getChildren()),r._remove(),this._removeFromClonedElementsGroup(r),this.mergeAttributes(new sd(i,t))}return t}mergeContainers(t){const e=t.nodeBefore,n=t.nodeAfter;if(!(e&&n&&e.is("containerElement")&&n.is("containerElement")))throw new qs("view-writer-merge-containers-invalid-position",this.document);const i=e.getChild(e.childCount-1),r=i instanceof rh?sd._createAt(i,"end"):sd._createAt(e,"end");return this.move(ad._createIn(n),sd._createAt(e,"end")),this.remove(ad._createOn(n)),r}insert(t,e){Xt(e=S(e)?[...e]:[e],this.document);const n=e.reduce(((t,e)=>{const n=t[t.length-1],i=!e.is("uiElement");return n&&n.breakAttributes==i?n.nodes.push(e):t.push({breakAttributes:i,nodes:[e]}),t}),[]);let i=null,r=t;for(const{nodes:t,breakAttributes:e}of n){const n=this._insertNodes(r,t,e);i||(i=n.start),r=n.end}return i?new ad(i,r):new ad(t)}remove(t){const e=t instanceof ad?t:ad._createOn(t);if(te(e,this.document),e.isCollapsed)return new wd(this.document);const{start:n,end:i}=this._breakAttributesRange(e,!0),r=n.parent,o=i.offset-n.offset,s=r._removeChildren(n.offset,o);for(const t of s)this._removeFromClonedElementsGroup(t);const a=this.mergeAttributes(n);return e.start=a,e.end=a.clone(),new wd(this.document,s)}clear(t,e){te(t,this.document);const n=t.getWalker({direction:"backward",ignoreElementEnd:!0});for(const i of n){const n=i.item;let r;if(n.is("element")&&e.isSimilar(n))r=ad._createOn(n);else if(!i.nextPosition.isAfter(t.start)&&n.is("$textProxy")){const t=n.getAncestors().find((t=>t.is("element")&&e.isSimilar(t)));t&&(r=ad._createIn(t))}r&&(r.end.isAfter(t.end)&&(r.end=t.end),r.start.isBefore(t.start)&&(r.start=t.start),this.remove(r))}}move(t,e){let n;if(e.isAfter(t.end)){const i=(e=this._breakAttributes(e,!0)).parent,r=i.childCount;t=this._breakAttributesRange(t,!0),n=this.remove(t),e.offset+=i.childCount-r}else n=this.remove(t);return this.insert(e,n)}wrap(t,e){if(!(e instanceof fd))throw new qs("view-writer-wrap-invalid-attribute",this.document);if(te(t,this.document),t.isCollapsed){let i=t.start;i.parent.is("element")&&(n=i.parent,!Array.from(n.getChildren()).some((t=>!t.is("uiElement"))))&&(i=i.getLastMatchingPosition((t=>t.item.is("uiElement")))),i=this._wrapPosition(i,e);const r=this.document.selection;return r.isCollapsed&&r.getFirstPosition().isEqual(t.start)&&this.setSelection(i),new ad(i)}return this._wrapRange(t,e);var n}unwrap(t,e){if(!(e instanceof fd))throw new qs("view-writer-unwrap-invalid-attribute",this.document);if(te(t,this.document),t.isCollapsed)return t;const{start:n,end:i}=this._breakAttributesRange(t,!0),r=n.parent,o=this._unwrapChildren(r,n.offset,i.offset,e),s=this.mergeAttributes(o.start);s.isEqual(o.start)||o.end.offset--;const a=this.mergeAttributes(o.end);return new ad(s,a)}rename(t,e){const n=new ed(this.document,t,e.getAttributes());return this.insert(sd._createAfter(e),n),this.move(ad._createIn(e),sd._createAt(n,0)),this.remove(ad._createOn(e)),n}clearClonedElementsGroup(t){this._cloneGroups.delete(t)}createPositionAt(t,e){return sd._createAt(t,e)}createPositionAfter(t){return sd._createAfter(t)}createPositionBefore(t){return sd._createBefore(t)}createRange(...t){return new ad(...t)}createRangeOn(t){return ad._createOn(t)}createRangeIn(t){return ad._createIn(t)}createSelection(...t){return new cd(...t)}createSlot(t){if(!this._slotFactory)throw new qs("view-writer-invalid-create-slot-context",this.document);return this._slotFactory(this,t)}_registerSlotFactory(t){this._slotFactory=t}_clearSlotFactory(){this._slotFactory=null}_insertNodes(t,e,n){let i,r;if(i=n?Kt(t):t.parent.is("$text")?t.parent.parent:t.parent,!i)throw new qs("view-writer-invalid-position-container",this.document);r=n?this._breakAttributes(t,!0):t.parent.is("$text")?Yt(t):t;const o=i._insertChild(r.offset,e);for(const t of e)this._addToClonedElementsGroup(t);const s=r.getShiftedBy(o),a=this.mergeAttributes(r);a.isEqual(r)||s.offset--;const c=this.mergeAttributes(s);return new ad(a,c)}_wrapChildren(t,e,n,i){let r=e;const o=[];for(;r<n;){const e=t.getChild(r),n=e.is("$text"),s=e.is("attributeElement");if(s&&this._wrapAttributeElement(i,e))o.push(new sd(t,r));else if(n||!s||Gt(i,e)){const n=i._clone();e._remove(),n._appendChild(e),t._insertChild(r,n),this._addToClonedElementsGroup(n),o.push(new sd(t,r))}else this._wrapChildren(e,0,e.childCount,i);r++}let s=0;for(const t of o)t.offset-=s,t.offset!=e&&(this.mergeAttributes(t).isEqual(t)||(s++,n--));return ad._createFromParentsAndOffsets(t,e,t,n)}_unwrapChildren(t,e,n,i){let r=e;const o=[];for(;r<n;){const e=t.getChild(r);if(e.is("attributeElement"))if(e.isSimilar(i)){const i=e.getChildren(),s=e.childCount;e._remove(),t._insertChild(r,i),this._removeFromClonedElementsGroup(e),o.push(new sd(t,r),new sd(t,r+s)),r+=s,n+=s-1}else this._unwrapAttributeElement(i,e)?(o.push(new sd(t,r),new sd(t,r+1)),r++):(this._unwrapChildren(e,0,e.childCount,i),r++);else r++}let s=0;for(const t of o)t.offset-=s,t.offset!=e&&t.offset!=n&&(this.mergeAttributes(t).isEqual(t)||(s++,n--));return ad._createFromParentsAndOffsets(t,e,t,n)}_wrapRange(t,e){const{start:n,end:i}=this._breakAttributesRange(t,!0),r=n.parent,o=this._wrapChildren(r,n.offset,i.offset,e),s=this.mergeAttributes(o.start);s.isEqual(o.start)||o.end.offset--;const a=this.mergeAttributes(o.end);return new ad(s,a)}_wrapPosition(t,e){if(e.isSimilar(t.parent))return Jt(t.clone());t.parent.is("$text")&&(t=Yt(t));const n=this.createAttributeElement("_wrapPosition-fake-element");n._priority=Number.POSITIVE_INFINITY,n.isSimilar=()=>!1,t.parent._insertChild(t.offset,n);const i=new ad(t,t.getShiftedBy(1));this.wrap(i,e);const r=new sd(n.parent,n.index);n._remove();const o=r.nodeBefore,s=r.nodeAfter;return o instanceof rh&&s instanceof rh?Qt(o,s):Jt(r)}_wrapAttributeElement(t,e){if(!ee(t,e))return!1;if(t.name!==e.name||t.priority!==e.priority)return!1;for(const n of t.getAttributeKeys())if("class"!==n&&"style"!==n&&e.hasAttribute(n)&&e.getAttribute(n)!==t.getAttribute(n))return!1;for(const n of t.getStyleNames())if(e.hasStyle(n)&&e.getStyle(n)!==t.getStyle(n))return!1;for(const n of t.getAttributeKeys())"class"!==n&&"style"!==n&&(e.hasAttribute(n)||this.setAttribute(n,t.getAttribute(n),e));for(const n of t.getStyleNames())e.hasStyle(n)||this.setStyle(n,t.getStyle(n),e);for(const n of t.getClassNames())e.hasClass(n)||this.addClass(n,e);return!0}_unwrapAttributeElement(t,e){if(!ee(t,e))return!1;if(t.name!==e.name||t.priority!==e.priority)return!1;for(const n of t.getAttributeKeys())if("class"!==n&&"style"!==n&&(!e.hasAttribute(n)||e.getAttribute(n)!==t.getAttribute(n)))return!1;if(!e.hasClass(...t.getClassNames()))return!1;for(const n of t.getStyleNames())if(!e.hasStyle(n)||e.getStyle(n)!==t.getStyle(n))return!1;for(const n of t.getAttributeKeys())"class"!==n&&"style"!==n&&this.removeAttribute(n,e);return this.removeClass(Array.from(t.getClassNames()),e),this.removeStyle(Array.from(t.getStyleNames()),e),!0}_breakAttributesRange(t,e=!1){const n=t.start,i=t.end;if(te(t,this.document),t.isCollapsed){const n=this._breakAttributes(t.start,e);return new ad(n,n)}const r=this._breakAttributes(i,e),o=r.parent.childCount,s=this._breakAttributes(n,e);return r.offset+=r.parent.childCount-o,new ad(s,r)}_breakAttributes(t,e=!1){const n=t.offset,i=t.parent;if(t.parent.is("emptyElement"))throw new qs("view-writer-cannot-break-empty-element",this.document);if(t.parent.is("uiElement"))throw new qs("view-writer-cannot-break-ui-element",this.document);if(t.parent.is("rawElement"))throw new qs("view-writer-cannot-break-raw-element",this.document);if(!e&&i.is("$text")&&Zt(i.parent))return t.clone();if(Zt(i))return t.clone();if(i.is("$text"))return this._breakAttributes(Yt(t),e);if(n==i.childCount){const t=new sd(i.parent,i.index+1);return this._breakAttributes(t,e)}if(0===n){const t=new sd(i.parent,i.index);return this._breakAttributes(t,e)}{const t=i.index+1,r=i._clone();i.parent._insertChild(t,r),this._addToClonedElementsGroup(r);const o=i.childCount-n,s=i._removeChildren(n,o);r._appendChild(s);const a=new sd(i.parent,t);return this._breakAttributes(a,e)}}_addToClonedElementsGroup(t){if(!t.root.is("rootElement"))return;if(t.is("element"))for(const e of t.getChildren())this._addToClonedElementsGroup(e);const e=t.id;if(!e)return;let n=this._cloneGroups.get(e);n||(n=new Set,this._cloneGroups.set(e,n)),n.add(t),t._clonesGroup=n}_removeFromClonedElementsGroup(t){if(t.is("element"))for(const e of t.getChildren())this._removeFromClonedElementsGroup(e);const e=t.id;if(!e)return;const n=this._cloneGroups.get(e);n&&n.delete(t)}}const bd=[rh,fd,ed,md,pd,gd],yd=t=>t.createTextNode("\xa0"),_d=t=>{const e=t.createElement("span");return e.dataset.ckeFiller="true",e.innerText="\xa0",e},kd=t=>{const e=t.createElement("br");return e.dataset.ckeFiller="true",e},Ad="\u2060".repeat(7)
;var xd=t(90385),Td=t.n(xd),Cd={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(Td(),Cd),Td().locals;class Ed extends(y()){constructor(t,e){super(),this.domDocuments=new Set,this.domConverter=t,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=e,this.set("isFocused",!1),this.set("isSelecting",!1),js.isBlink&&!js.isAndroid&&this.on("change:isSelecting",(()=>{this.isSelecting||this.render()})),this.set("isComposing",!1),this.on("change:isComposing",(()=>{this.isComposing||this.render()})),this._inlineFiller=null,this._fakeSelectionContainer=null}markToSync(t,e){if("text"===t)this.domConverter.mapViewToDom(e.parent)&&this.markedTexts.add(e);else{if(!this.domConverter.mapViewToDom(e))return;if("attributes"===t)this.markedAttributes.add(e);else{if("children"!==t)throw new qs("view-renderer-unknown-type",this);this.markedChildren.add(e)}}}render(){if(this.isComposing&&!js.isAndroid)return;let t=null;const e=!(js.isBlink&&!js.isAndroid&&this.isSelecting);for(const t of this.markedChildren)this._updateChildrenMappings(t);e?(this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?t=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(t=this.selection.getFirstPosition(),this.markedChildren.add(t.parent))):this._inlineFiller&&this._inlineFiller.parentNode&&(t=this.domConverter.domPositionToView(this._inlineFiller),t&&t.parent.is("$text")&&(t=sd._createBefore(t.parent)));for(const t of this.markedAttributes)this._updateAttrs(t);for(const e of this.markedChildren)this._updateChildren(e,{inlineFillerPosition:t});for(const e of this.markedTexts)!this.markedChildren.has(e.parent)&&this.domConverter.mapViewToDom(e.parent)&&this._updateText(e,{inlineFillerPosition:t});if(e)if(t){const e=this.domConverter.viewPositionToDom(t),n=e.parent.ownerDocument;ne(e.parent)?this._inlineFiller=e.parent:this._inlineFiller=se(n,e.parent,e.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(t){if(!this.domConverter.mapViewToDom(t))return;const e=Array.from(this.domConverter.mapViewToDom(t).childNodes),n=Array.from(this.domConverter.viewChildrenToDom(t,{withChildren:!1})),i=this._diffNodeLists(e,n),r=this._findReplaceActions(i,e,n);if(-1!==r.indexOf("replace")){const i={equal:0,insert:0,delete:0};for(const o of r)if("replace"===o){const r=i.equal+i.insert,o=i.equal+i.delete,s=t.getChild(r);!s||s.is("uiElement")||s.is("rawElement")||this._updateElementMappings(s,e[o]),tt(n[r]),i.equal++}else i[o]++}}_updateElementMappings(t,e){this.domConverter.unbindDomElement(e),this.domConverter.bindElements(e,t),this.markedChildren.add(t),this.markedAttributes.add(t)}_getInlineFillerPosition(){const t=this.selection.getFirstPosition();return t.parent.is("$text")?sd._createBefore(t.parent):t}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=this.domConverter.viewPositionToDom(t);return!!(e&&z(e.parent)&&ne(e.parent))}_removeInlineFiller(){const t=this._inlineFiller;if(!ne(t))throw new qs("view-renderer-filler-was-lost",this);ie(t)?t.remove():t.data=t.data.substr(7),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=t.parent,n=t.offset;if(!this.domConverter.mapViewToDom(e.root))return!1;if(!e.is("element"))return!1;if(!function(t){if("false"==t.getAttribute("contenteditable"))return!1;const e=t.findAncestor((t=>t.hasAttribute("contenteditable")));return!e||"true"==e.getAttribute("contenteditable")}(e))return!1;if(n===e.getFillerOffset())return!1;const i=t.nodeBefore,r=t.nodeAfter;return!(i instanceof rh||r instanceof rh||js.isAndroid&&(i||r))}_updateText(t,e){const n=this.domConverter.findCorrespondingDomText(t);let i=this.domConverter.viewToDom(t).data;const r=e.inlineFillerPosition;r&&r.parent==t.parent&&r.offset==t.index&&(i=Ad+i),ue(n,i)}_updateAttrs(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const n=Array.from(e.attributes).map((t=>t.name)),i=t.getAttributeKeys();for(const n of i)this.domConverter.setDomElementAttribute(e,n,t.getAttribute(n),t);for(const i of n)t.hasAttribute(i)||this.domConverter.removeDomElementAttribute(e,i)}_updateChildren(t,e){const n=this.domConverter.mapViewToDom(t);if(!n)return;if(js.isAndroid){let t=null;for(const e of Array.from(n.childNodes)){if(t&&z(t)&&z(e)){n.normalize();break}t=e}}const i=e.inlineFillerPosition,r=n.childNodes,o=Array.from(this.domConverter.viewChildrenToDom(t,{bind:!0}));i&&i.parent===t&&se(n.ownerDocument,o,i.offset);const s=this._diffNodeLists(r,o),a=js.isAndroid?this._findReplaceActions(s,r,o,{replaceText:!0}):s;let c=0;const l=new Set;for(const t of a)"delete"===t?(l.add(r[c]),tt(r[c])):"equal"!==t&&"replace"!==t||c++;c=0;for(const t of a)"insert"===t?(J(n,c,o[c]),c++):"replace"===t?(ue(r[c],o[c].data),c++):"equal"===t&&(this._markDescendantTextToSync(this.domConverter.domToView(o[c])),c++);for(const t of l)t.parentNode||this.domConverter.unbindDomElement(t)}_diffNodeLists(t,e){return o(t=function(t,e){const n=Array.from(t);return 0!=n.length&&e?(n[n.length-1]==e&&n.pop(),n):n}(t,this._fakeSelectionContainer),e,le.bind(null,this.domConverter))}_findReplaceActions(t,e,n,i={}){if(-1===t.indexOf("insert")||-1===t.indexOf("delete"))return t;let r=[],s=[],a=[];const c={equal:0,insert:0,delete:0};for(const l of t)"insert"===l?a.push(n[c.equal+c.insert]):"delete"===l?s.push(e[c.equal+c.delete]):(r=r.concat(o(s,a,i.replaceText?ce:ae).map((t=>"equal"===t?"replace":t))),r.push("equal"),s=[],a=[]),c[l]++;return r.concat(o(s,a,i.replaceText?ce:ae).map((t=>"equal"===t?"replace":t)))}_markDescendantTextToSync(t){if(t)if(t.is("$text"))this.markedTexts.add(t);else if(t.is("element"))for(const e of t.getChildren())this._markDescendantTextToSync(e)}_updateSelection(){if(js.isBlink&&!js.isAndroid&&this.isSelecting&&!this.markedChildren.size)return;if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const t=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&t&&(this.selection.isFake?this._updateFakeSelection(t):this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected?(this._removeFakeSelection(),this._updateDomSelection(t)):this.isComposing&&js.isAndroid||this._updateDomSelection(t))}_updateFakeSelection(t){const e=t.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(t){const e=t.createElement("div");return e.className="ck-fake-selection-container",Object.assign(e.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),e.textContent="\xa0",e}(e));const n=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(n,this.selection),!this._fakeSelectionNeedsUpdate(t))return;n.parentElement&&n.parentElement==t||t.appendChild(n),n.textContent=this.selection.fakeSelectionLabel||"\xa0";const i=e.getSelection(),r=e.createRange();i.removeAllRanges(),r.selectNodeContents(n),i.addRange(r)}_updateDomSelection(t){const e=t.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(e))return;const n=this.domConverter.viewPositionToDom(this.selection.anchor),i=this.domConverter.viewPositionToDom(this.selection.focus);e.collapse(n.parent,n.offset),e.extend(i.parent,i.offset),js.isGecko&&function(t,e){const n=t.parent;if(n.nodeType!=Node.ELEMENT_NODE||t.offset!=n.childNodes.length-1)return;const i=n.childNodes[t.offset];i&&"BR"==i.tagName&&e.addRange(e.getRangeAt(0))}(i,e)}_domSelectionNeedsUpdate(t){if(!this.domConverter.isDomSelectionCorrect(t))return!0;const e=t&&this.domConverter.domSelectionToView(t);return!(e&&this.selection.isEqual(e)||!this.selection.isCollapsed&&this.selection.isSimilar(e))}_fakeSelectionNeedsUpdate(t){const e=this._fakeSelectionContainer,n=t.ownerDocument.getSelection();return!e||e.parentElement!==t||n.anchorNode!==e&&!e.contains(n.anchorNode)||e.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const t of this.domDocuments){const e=t.getSelection();if(e.rangeCount){const n=t.activeElement,i=this.domConverter.mapDomToView(n);n&&i&&e.removeAllRanges()}}}_removeFakeSelection(){const t=this._fakeSelectionContainer;t&&t.remove()}_updateFocus(){if(this.isFocused){const t=this.selection.editableElement;t&&this.domConverter.focus(t)}}}const Sd=kd(Su.document),Pd=yd(Su.document),Rd=_d(Su.document),Od="data-ck-unsafe-attribute-",Id="data-ck-unsafe-element";class Md{constructor(t,e={}){this.document=t,this.renderingMode=e.renderingMode||"editing",this.blockFillerMode=e.blockFillerMode||("editing"===this.renderingMode?"br":"nbsp"),this.preElements=["pre"],this.blockElements=["address","article","aside","blockquote","caption","center","dd","details","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","legend","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"],this.inlineObjectElements=["object","iframe","input","button","textarea","select","option","video","embed","audio","img","canvas"],this.unsafeElements=["script","style"],this._domDocument="editing"===this.renderingMode?Su.document:Su.document.implementation.createHTMLDocument(""),this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap,this._rawContentElementMatcher=new sh,this._encounteredRawContentDomNodes=new WeakSet}bindFakeSelection(t,e){this._fakeSelectionMapping.set(t,new cd(e))}fakeSelectionToView(t){return this._fakeSelectionMapping.get(t)}bindElements(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}unbindDomElement(t){const e=this._domToViewMapping.get(t);if(e){this._domToViewMapping.delete(t),this._viewToDomMapping.delete(e);for(const e of Array.from(t.children))this.unbindDomElement(e)}}bindDocumentFragments(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}shouldRenderAttribute(t,e,n){return"data"===this.renderingMode||!(t=t.toLowerCase()).startsWith("on")&&("srcdoc"!==t||!e.match(/\bon\S+\s*=|javascript:|<\s*\/*script/i))&&("img"===n&&("src"===t||"srcset"===t)||"source"===n&&"srcset"===t||!e.match(/^\s*(javascript:|data:(image\/svg|text\/x?html))/i))}setContentOf(t,e){if("data"===this.renderingMode)return void(t.innerHTML=e);const n=(new DOMParser).parseFromString(e,"text/html"),i=n.createDocumentFragment(),r=n.body.childNodes;for(;r.length>0;)i.appendChild(r[0]);const o=n.createTreeWalker(i,NodeFilter.SHOW_ELEMENT),s=[];let a;for(;a=o.nextNode();)s.push(a);for(const t of s){for(const e of t.getAttributeNames())this.setDomElementAttribute(t,e,t.getAttribute(e));const e=t.tagName.toLowerCase();this._shouldRenameElement(e)&&(fe(e),t.replaceWith(this._createReplacementDomElement(e,t)))}for(;t.firstChild;)t.firstChild.remove();t.append(i)}viewToDom(t,e={}){if(t.is("$text")){const e=this._processDataFromViewText(t);return this._domDocument.createTextNode(e)}{if(this.mapViewToDom(t))return this.mapViewToDom(t);let n;if(t.is("documentFragment"))n=this._domDocument.createDocumentFragment(),e.bind&&this.bindDocumentFragments(n,t);else{if(t.is("uiElement"))return n="$comment"===t.name?this._domDocument.createComment(t.getCustomProperty("$rawContent")):t.render(this._domDocument,this),e.bind&&this.bindElements(n,t),n;this._shouldRenameElement(t.name)?(fe(t.name),n=this._createReplacementDomElement(t.name)):n=t.hasAttribute("xmlns")?this._domDocument.createElementNS(t.getAttribute("xmlns"),t.name):this._domDocument.createElement(t.name),t.is("rawElement")&&t.render(n,this),e.bind&&this.bindElements(n,t);for(const e of t.getAttributeKeys())this.setDomElementAttribute(n,e,t.getAttribute(e),t)}if(!1!==e.withChildren)for(const i of this.viewChildrenToDom(t,e))n.appendChild(i);return n}}setDomElementAttribute(t,e,n,i){const r=this.shouldRenderAttribute(e,n,t.tagName.toLowerCase())||i&&i.shouldRenderUnsafeAttribute(e);r||l("domconverter-unsafe-attribute-detected",{domElement:t,key:e,value:n}),t.hasAttribute(e)&&!r?t.removeAttribute(e):t.hasAttribute(Od+e)&&r&&t.removeAttribute(Od+e),t.setAttribute(r?e:Od+e,n)}removeDomElementAttribute(t,e){e!=Id&&(t.removeAttribute(e),t.removeAttribute(Od+e))}*viewChildrenToDom(t,e={}){const n=t.getFillerOffset&&t.getFillerOffset();let i=0;for(const r of t.getChildren()){n===i&&(yield this._getBlockFiller());const t=r.is("element")&&!!r.getCustomProperty("dataPipeline:transparentRendering")&&!wt(r.getAttributes());t&&"data"==this.renderingMode?yield*this.viewChildrenToDom(r,e):(t&&l("domconverter-transparent-rendering-unsupported-in-editing-pipeline",{viewElement:r}),yield this.viewToDom(r,e)),i++}n===i&&(yield this._getBlockFiller())}viewRangeToDom(t){const e=this.viewPositionToDom(t.start),n=this.viewPositionToDom(t.end),i=this._domDocument.createRange();return i.setStart(e.parent,e.offset),i.setEnd(n.parent,n.offset),i}viewPositionToDom(t){const e=t.parent;if(e.is("$text")){const n=this.findCorrespondingDomText(e);if(!n)return null;let i=t.offset;return ne(n)&&(i+=7),{parent:n,offset:i}}{let n,i,r;if(0===t.offset){if(n=this.mapViewToDom(e),!n)return null;r=n.childNodes[0]}else{const e=t.nodeBefore;if(i=e.is("$text")?this.findCorrespondingDomText(e):this.mapViewToDom(e),!i)return null;n=i.parentNode,r=i.nextSibling}return z(r)&&ne(r)?{parent:r,offset:7}:{parent:n,offset:i?G(i)+1:0}}}domToView(t,e={}){if(this.isBlockFiller(t))return null;const n=this.getHostViewElement(t);if(n)return n;if(Y(t)&&e.skipComments)return null;if(z(t)){if(ie(t))return null;{const e=this._processDataFromDomText(t);return""===e?null:new rh(this.document,e)}}{if(this.mapDomToView(t))return this.mapDomToView(t);let n;if(this.isDocumentFragment(t))n=new wd(this.document),e.bind&&this.bindDocumentFragments(t,n);else{n=this._createViewElement(t,e),e.bind&&this.bindElements(t,n);const i=t.attributes;if(i)for(let t=i.length,e=0;e<t;e++)n._setAttribute(i[e].name,i[e].value);if(this._isViewElementWithRawContent(n,e)||Y(t)){const e=Y(t)?t.data:t.innerHTML;return n._setCustomProperty("$rawContent",e),this._encounteredRawContentDomNodes.add(t),n}}if(!1!==e.withChildren)for(const i of this.domChildrenToView(t,e))n._appendChild(i);return n}}*domChildrenToView(t,e){for(let n=0;n<t.childNodes.length;n++){const i=t.childNodes[n],r=this.domToView(i,e);null!==r&&(yield r)}}domSelectionToView(t){if(1===t.rangeCount){let e=t.getRangeAt(0).startContainer;z(e)&&(e=e.parentNode);const n=this.fakeSelectionToView(e);if(n)return n}const e=this.isDomSelectionBackward(t),n=[];for(let e=0;e<t.rangeCount;e++){const i=t.getRangeAt(e),r=this.domRangeToView(i);r&&n.push(r)}return new cd(n,{backward:e})}domRangeToView(t){const e=this.domPositionToView(t.startContainer,t.startOffset),n=this.domPositionToView(t.endContainer,t.endOffset);return e&&n?new ad(e,n):null}domPositionToView(t,e=0){if(this.isBlockFiller(t))return this.domPositionToView(t.parentNode,G(t));const n=this.mapDomToView(t);if(n&&(n.is("uiElement")||n.is("rawElement")))return sd._createBefore(n);if(z(t)){if(ie(t))return this.domPositionToView(t.parentNode,G(t));const n=this.findCorrespondingViewText(t);let i=e;return n?(ne(t)&&(i-=7,i=i<0?0:i),new sd(n,i)):null}if(0===e){const e=this.mapDomToView(t);if(e)return new sd(e,0)}else{const n=t.childNodes[e-1];if(z(n)&&ie(n))return this.domPositionToView(n.parentNode,G(n));const i=z(n)?this.findCorrespondingViewText(n):this.mapDomToView(n);if(i&&i.parent)return new sd(i.parent,i.index+1)}return null}mapDomToView(t){return this.getHostViewElement(t)||this._domToViewMapping.get(t)}findCorrespondingViewText(t){if(ie(t))return null;const e=this.getHostViewElement(t);if(e)return e;const n=t.previousSibling;if(n){if(!this.isElement(n))return null;const t=this.mapDomToView(n);if(t){const e=t.nextSibling;return e instanceof rh?e:null}}else{const e=this.mapDomToView(t.parentNode);if(e){const t=e.getChild(0);return t instanceof rh?t:null}}return null}mapViewToDom(t){return this._viewToDomMapping.get(t)}findCorrespondingDomText(t){const e=t.previousSibling;return e&&this.mapViewToDom(e)?this.mapViewToDom(e).nextSibling:!e&&t.parent&&this.mapViewToDom(t.parent)?this.mapViewToDom(t.parent).childNodes[0]:null}focus(t){const e=this.mapViewToDom(t);if(e&&e.ownerDocument.activeElement!==e){const{scrollX:t,scrollY:n}=Su.window,i=[];he(e,(t=>{const{scrollLeft:e,scrollTop:n}=t;i.push([e,n])})),e.focus(),he(e,(t=>{const[e,n]=i.shift();t.scrollLeft=e,t.scrollTop=n})),Su.window.scrollTo(t,n)}}isElement(t){return t&&t.nodeType==Node.ELEMENT_NODE}isDocumentFragment(t){return t&&t.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isBlockFiller(t){return"br"==this.blockFillerMode?t.isEqualNode(Sd):!("BR"!==t.tagName||!de(t,this.blockElements)||1!==t.parentNode.childNodes.length)||t.isEqualNode(Rd)||function(t,e){return t.isEqualNode(Pd)&&de(t,e)&&1===t.parentNode.childNodes.length}(t,this.blockElements)}isDomSelectionBackward(t){if(t.isCollapsed)return!1;const e=this._domDocument.createRange();try{e.setStart(t.anchorNode,t.anchorOffset),e.setEnd(t.focusNode,t.focusOffset)}catch(t){return!1}const n=e.collapsed;return e.detach(),n}getHostViewElement(t){const e=L(t);for(e.pop();e.length;){const t=e.pop(),n=this._domToViewMapping.get(t);if(n&&(n.is("uiElement")||n.is("rawElement")))return n}return null}isDomSelectionCorrect(t){return this._isDomSelectionPositionCorrect(t.anchorNode,t.anchorOffset)&&this._isDomSelectionPositionCorrect(t.focusNode,t.focusOffset)}registerRawContentMatcher(t){this._rawContentElementMatcher.add(t)}_getBlockFiller(){switch(this.blockFillerMode){case"nbsp":return yd(this._domDocument);case"markedNbsp":return _d(this._domDocument);case"br":return kd(this._domDocument)}}_isDomSelectionPositionCorrect(t,e){if(z(t)&&ne(t)&&e<7)return!1;if(this.isElement(t)&&ne(t.childNodes[e]))return!1;const n=this.mapDomToView(t);return!n||!n.is("uiElement")&&!n.is("rawElement")}_processDataFromViewText(t){let e=t.data;if(t.getAncestors().some((t=>this.preElements.includes(t.name))))return e;if(" "==e.charAt(0)){const n=this._getTouchingInlineViewNode(t,!1);!(n&&n.is("$textProxy")&&this._nodeEndsWithSpace(n))&&n||(e="\xa0"+e.substr(1))}if(" "==e.charAt(e.length-1)){const n=this._getTouchingInlineViewNode(t,!0),i=n&&n.is("$textProxy")&&" "==n.data.charAt(0);" "!=e.charAt(e.length-2)&&n&&!i||(e=e.substr(0,e.length-1)+"\xa0")}return e.replace(/ {2}/g," \xa0")}_nodeEndsWithSpace(t){if(t.getAncestors().some((t=>this.preElements.includes(t.name))))return!1;const e=this._processDataFromViewText(t);return" "==e.charAt(e.length-1)}_processDataFromDomText(t){let e=t.data;if(function(t,e){return L(t).some((t=>t.tagName&&e.includes(t.tagName.toLowerCase())))}(t,this.preElements))return re(t);e=e.replace(/[ \n\t\r]{1,}/g," ");const n=this._getTouchingInlineDomNode(t,!1),i=this._getTouchingInlineDomNode(t,!0),r=this._checkShouldLeftTrimDomText(t,n),o=this._checkShouldRightTrimDomText(t,i);r&&(e=e.replace(/^ /,"")),o&&(e=e.replace(/ $/,"")),e=re(new Text(e)),e=e.replace(/ \u00A0/g,"  ");const s=i&&this.isElement(i)&&"BR"!=i.tagName,a=i&&z(i)&&" "==i.data.charAt(0);return(/( |\u00A0)\u00A0$/.test(e)||!i||s||a)&&(e=e.replace(/\u00A0$/," ")),(r||n&&this.isElement(n)&&"BR"!=n.tagName)&&(e=e.replace(/^\u00A0/," ")),e}_checkShouldLeftTrimDomText(t,e){return!e||(this.isElement(e)?"BR"===e.tagName:!this._encounteredRawContentDomNodes.has(t.previousSibling)&&/[^\S\u00A0]/.test(e.data.charAt(e.data.length-1)))}_checkShouldRightTrimDomText(t,e){return!e&&!ne(t)}_getTouchingInlineViewNode(t,e){const n=new od({startPosition:e?sd._createAfter(t):sd._createBefore(t),direction:e?"forward":"backward"});for(const t of n){if(t.item.is("element")&&this.inlineObjectElements.includes(t.item.name))return t.item;if(t.item.is("containerElement"))return null;if(t.item.is("element","br"))return null;if(t.item.is("$textProxy"))return t.item}return null}_getTouchingInlineDomNode(t,e){if(!t.parentNode)return null;const n=e?"firstChild":"lastChild",i=e?"nextSibling":"previousSibling";let r=!0,o=t;do{if(!r&&o[n]?o=o[n]:o[i]?(o=o[i],r=!1):(o=o.parentNode,r=!0),!o||this._isBlockElement(o))return null}while(!z(o)&&"BR"!=o.tagName&&!this._isInlineObjectElement(o));return o}_isBlockElement(t){return this.isElement(t)&&this.blockElements.includes(t.tagName.toLowerCase())}_isInlineObjectElement(t){return this.isElement(t)&&this.inlineObjectElements.includes(t.tagName.toLowerCase())}_createViewElement(t,e){if(Y(t))return new gd(this.document,"$comment");const n=e.keepOriginalCase?t.tagName:t.tagName.toLowerCase();return new td(this.document,n)}_isViewElementWithRawContent(t,e){return!1!==e.withChildren&&!!this._rawContentElementMatcher.match(t)}_shouldRenameElement(t){const e=t.toLowerCase();return"editing"===this.renderingMode&&this.unsafeElements.includes(e)}_createReplacementDomElement(t,e){const n=this._domDocument.createElement("span");if(n.setAttribute(Id,t),e){for(;e.firstChild;)n.appendChild(e.firstChild);for(const t of e.getAttributeNames())n.setAttribute(t,e.getAttribute(t))}return n}}class Nd extends(B()){constructor(t){super(),this.view=t,this.document=t.document,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(t){return t&&3===t.nodeType&&(t=t.parentNode),!(!t||1!==t.nodeType)&&t.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}var Vd=Gh((function(t,e){Pc(e,fl(e),t)}));class Dd{constructor(t,e,n){this.view=t,this.document=t.document,this.domEvent=e,this.domTarget=e.target,Vd(this,n)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class Bd extends Nd{constructor(t){super(t),this.useCapture=!1}observe(t){("string"==typeof this.domEventType?[this.domEventType]:this.domEventType).forEach((e=>{this.listenTo(t,e,((t,e)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(e.target)&&this.onDomEvent(e)}),{useCapture:this.useCapture})}))}fire(t,e,n){this.isEnabled&&this.document.fire(t,new Dd(this.view,e,n))}}class Fd extends Bd{constructor(t){super(t),this.domEventType=["keydown","keyup"]}onDomEvent(t){const e={keyCode:t.keyCode,altKey:t.altKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,metaKey:t.metaKey,get keystroke(){return ut(this)}};this.fire(t.type,t,e)}}var Ld=function(){return ca.Date.now()},zd=/\s/,jd=function(t){for(var e=t.length;e--&&zd.test(t.charAt(e)););return e},Hd=/^\s+/,Ud=function(t){return t?t.slice(0,jd(t)+1).replace(Hd,""):t},Wd=/^[-+]0x[0-9a-f]+$/i,$d=/^0b[01]+$/i,qd=/^0o[0-7]+$/i,Kd=parseInt,Gd=function(t){if("number"==typeof t)return t;if(ah(t))return NaN;if(Zs(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Zs(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ud(t);var n=$d.test(t);return n||qd.test(t)?Kd(t.slice(2),n?2:8):Wd.test(t)?NaN:+t},Jd=Math.max,Yd=Math.min,Qd=function(t,e,n){function i(e){var n=l,i=u;return l=u=void 0,g=e,d=t.apply(i,n)}function r(t){return g=t,f=setTimeout(s,e),p?i(t):d}function o(t){var n=t-m;return void 0===m||n>=e||n<0||w&&t-g>=h}function s(){var t=Ld();if(o(t))return a(t);f=setTimeout(s,function(t){var n=e-(t-m);return w?Yd(n,h-(t-g)):n}(t))}function a(t){return f=void 0,v&&l?i(t):(l=u=void 0,d)}function c(){var t=Ld(),n=o(t);if(l=arguments,u=this,m=t,n){if(void 0===f)return r(m);if(w)return clearTimeout(f),f=setTimeout(s,e),i(m)}return void 0===f&&(f=setTimeout(s,e)),d}var l,u,h,d,f,m,g=0,p=!1,w=!1,v=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return e=Gd(e)||0,Zs(n)&&(p=!!n.leading,h=(w="maxWait"in n)?Jd(Gd(n.maxWait)||0,e):h,v="trailing"in n?!!n.trailing:v),c.cancel=function(){void 0!==f&&clearTimeout(f),g=0,l=m=u=f=void 0},c.flush=function(){return void 0===f?d:a(Ld())},c};class Xd extends Nd{constructor(t){super(t),this._fireSelectionChangeDoneDebounced=Qd((t=>{this.document.fire("selectionChangeDone",t)}),200)}observe(){const t=this.document;t.on("arrowKey",((e,n)=>{t.selection.isFake&&this.isEnabled&&n.preventDefault()}),{context:"$capture"}),t.on("arrowKey",((e,n)=>{t.selection.isFake&&this.isEnabled&&this._handleSelectionMove(n.keyCode)}),{priority:"lowest"})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(t){const e=this.document.selection,n=new cd(e.getRanges(),{backward:e.isBackward,fake:!1});t!=Vu.arrowleft&&t!=Vu.arrowup||n.setTo(n.getFirstPosition()),t!=Vu.arrowright&&t!=Vu.arrowdown||n.setTo(n.getLastPosition());const i={oldSelection:e,newSelection:n,domSelection:null};this.document.fire("selectionChange",i),this._fireSelectionChangeDoneDebounced(i)}}var Zd=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},tf=function(t){return this.__data__.has(t)};me.prototype.add=me.prototype.push=Zd,me.prototype.has=tf;var ef=me,nf=function(t,e){for(var n=-1,i=null==t?0:t.length;++n<i;)if(e(t[n],n,t))return!0;return!1},rf=function(t,e){return t.has(e)},of=function(t,e,n,i,r,o){var s=1&n,a=t.length,c=e.length;if(a!=c&&!(s&&c>a))return!1;var l=o.get(t),u=o.get(e);if(l&&u)return l==e&&u==t;var h=-1,d=!0,f=2&n?new ef:void 0;for(o.set(t,e),o.set(e,t);++h<a;){var m=t[h],g=e[h];if(i)var p=s?i(g,m,h,e,t,o):i(m,g,h,t,e,o);if(void 0!==p){if(p)continue;d=!1;break}if(f){if(!nf(e,(function(t,e){if(!rf(f,e)&&(m===t||r(m,t,n,i,o)))return f.push(e)}))){d=!1;break}}else if(m!==g&&!r(m,g,n,i,o)){d=!1;break}}return o.delete(t),o.delete(e),d},sf=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,i){n[++e]=[i,t]})),n},af=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n},cf=la?la.prototype:void 0,lf=cf?cf.valueOf:void 0,uf=function(t,e,n,i,r,o,s){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new Xl(t),new Xl(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Oa(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=sf;case"[object Set]":var c=1&i;if(a||(a=af),t.size!=e.size&&!c)return!1;var l=s.get(t);if(l)return l==e;i|=2,s.set(t,e);var u=of(a(t),a(e),i,r,o,s);return s.delete(t),u;case"[object Symbol]":if(lf)return lf.call(t)==lf.call(e)}return!1},hf=Object.prototype.hasOwnProperty,df=function(t,e,n,i,r,o){var s=1&n,a=Il(t),c=a.length;if(c!=Il(e).length&&!s)return!1;for(var l=c;l--;){var u=a[l];if(!(s?u in e:hf.call(e,u)))return!1}var h=o.get(t),d=o.get(e);if(h&&d)return h==e&&d==t;var f=!0;o.set(t,e),o.set(e,t);for(var m=s;++l<c;){var g=t[u=a[l]],p=e[u];if(i)var w=s?i(p,g,u,e,t,o):i(g,p,u,t,e,o);if(!(void 0===w?g===p||r(g,p,n,i,o):w)){f=!1;break}m||(m="constructor"==u)}if(f&&!m){var v=t.constructor,b=e.constructor;v==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof v&&v instanceof v&&"function"==typeof b&&b instanceof b||(f=!1)}return o.delete(t),o.delete(e),f},ff="[object Arguments]",mf="[object Array]",gf="[object Object]",pf=Object.prototype.hasOwnProperty,wf=function(t,e,n,i,r,o){var s=ba(t),a=ba(e),c=s?mf:Jl(t),l=a?mf:Jl(e),u=(c=c==ff?gf:c)==gf,h=(l=l==ff?gf:l)==gf,d=c==l;if(d&&jc(t)){if(!jc(e))return!1;s=!0,u=!1}if(d&&!u)return o||(o=new Ac),s||Zc(t)?of(t,e,n,i,r,o):uf(t,e,c,n,i,r,o);if(!(1&n)){var f=u&&pf.call(t,"__wrapped__"),m=h&&pf.call(e,"__wrapped__");if(f||m){var g=f?t.value():t,p=m?e.value():e;return o||(o=new Ac),r(g,p,n,i,o)}}return!!d&&(o||(o=new Ac),df(t,e,n,i,r,o))},vf=function t(e,n,i,r,o){return e===n||(null==e||null==n||!ya(e)&&!ya(n)?e!=e&&n!=n:wf(e,n,i,r,t,o))},bf=function(t,e,n){var i=(n="function"==typeof n?n:void 0)?n(t,e):void 0;return void 0===i?vf(t,e,void 0,n):!!i};class yf extends Nd{constructor(t){super(t),this._config={childList:!0,characterData:!0,subtree:!0},this.domConverter=t.domConverter,this.renderer=t._renderer,this._domElements=[],this._mutationObserver=new window.MutationObserver(this._onMutations.bind(this))}flush(){this._onMutations(this._mutationObserver.takeRecords())}observe(t){this._domElements.push(t),this.isEnabled&&this._mutationObserver.observe(t,this._config)}enable(){super.enable();for(const t of this._domElements)this._mutationObserver.observe(t,this._config)}disable(){super.disable(),this._mutationObserver.disconnect()}destroy(){super.destroy(),this._mutationObserver.disconnect()}_onMutations(t){if(0===t.length)return;const e=this.domConverter,n=new Set,i=new Set;for(const n of t){const t=e.mapDomToView(n.target);t&&(t.is("uiElement")||t.is("rawElement")||"childList"!==n.type||this._isBogusBrMutation(n)||i.add(t))}for(const r of t){const t=e.mapDomToView(r.target);if((!t||!t.is("uiElement")&&!t.is("rawElement"))&&"characterData"===r.type){const t=e.findCorrespondingViewText(r.target);t&&!i.has(t.parent)?n.add(t):!t&&ne(r.target)&&i.add(e.mapDomToView(r.target.parentNode))}}let r=!1;for(const t of n)r=!0,this.renderer.markToSync("text",t);for(const t of i){const n=e.mapViewToDom(t),i=Array.from(t.getChildren()),o=Array.from(e.domChildrenToView(n,{withChildren:!1}));bf(i,o,ge)||(r=!0,this.renderer.markToSync("children",t))}r&&this.view.forceRender()}_isBogusBrMutation(t){let e=null;return null===t.nextSibling&&0===t.removedNodes.length&&1==t.addedNodes.length&&(e=this.domConverter.domToView(t.addedNodes[0],{withChildren:!1})),e&&e.is("element","br")}}class _f extends Bd{constructor(t){super(t),this._isFocusChanging=!1,this.domEventType=["focus","blur"],this.useCapture=!0;const e=this.document;e.on("focus",(()=>{this._isFocusChanging=!0,this._renderTimeoutId=setTimeout((()=>{this.flush(),t.change((()=>{}))}),50)})),e.on("blur",((n,i)=>{const r=e.selection.editableElement;null!==r&&r!==i.target||(e.isFocused=!1,this._isFocusChanging=!1,t.change((()=>{})))}))}flush(){this._isFocusChanging&&(this._isFocusChanging=!1,this.document.isFocused=!0)}onDomEvent(t){this.fire(t.type,t)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class kf extends Nd{constructor(t){super(t),this.mutationObserver=t.getObserver(yf),this.focusObserver=t.getObserver(_f),this.selection=this.document.selection,this.domConverter=t.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=Qd((t=>{this.document.fire("selectionChangeDone",t)}),200),this._clearInfiniteLoopInterval=setInterval((()=>this._clearInfiniteLoop()),1e3),this._documentIsSelectingInactivityTimeoutDebounced=Qd((()=>this.document.isSelecting=!1),5e3),this._loopbackCounter=0}observe(t){const e=t.ownerDocument,n=()=>{this.document.isSelecting&&(this._handleSelectionChange(null,e),this.document.isSelecting=!1,this._documentIsSelectingInactivityTimeoutDebounced.cancel())};this.listenTo(t,"selectstart",(()=>{this.document.isSelecting=!0,this._documentIsSelectingInactivityTimeoutDebounced()}),{priority:"highest"}),this.listenTo(t,"keydown",n,{priority:"highest",useCapture:!0}),this.listenTo(t,"keyup",n,{priority:"highest",useCapture:!0}),this._documents.has(e)||(this.listenTo(e,"mouseup",n,{priority:"highest",useCapture:!0}),this.listenTo(e,"selectionchange",((t,n)=>{this.document.isComposing&&!js.isAndroid||(this._handleSelectionChange(n,e),this._documentIsSelectingInactivityTimeoutDebounced())})),this._documents.add(e))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel(),this._documentIsSelectingInactivityTimeoutDebounced.cancel()}_handleSelectionChange(t,e){if(!this.isEnabled)return;const n=e.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(n.anchorNode))return;this.mutationObserver.flush();const i=this.domConverter.domSelectionToView(n);if(0!=i.rangeCount){if(this.view.hasDomSelection=!0,!(this.selection.isEqual(i)&&this.domConverter.isDomSelectionCorrect(n)||++this._loopbackCounter>60))if(this.focusObserver.flush(),this.selection.isSimilar(i))this.view.forceRender();else{const t={oldSelection:this.selection,newSelection:i,domSelection:n};this.document.fire("selectionChange",t),this._fireSelectionChangeDoneDebounced(t)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class Af extends Bd{constructor(t){super(t),this.domEventType=["compositionstart","compositionupdate","compositionend"];const e=this.document;e.on("compositionstart",(()=>{e.isComposing=!0}),{priority:"low"}),e.on("compositionend",(()=>{e.isComposing=!1}),{priority:"low"})}onDomEvent(t){this.fire(t.type,t,{data:t.data})}}class xf{constructor(t,e={}){
this._files=e.cacheFiles?pe(t):null,this._native=t}get files(){return this._files||(this._files=pe(this._native)),this._files}get types(){return this._native.types}getData(t){return this._native.getData(t)}setData(t,e){this._native.setData(t,e)}set effectAllowed(t){this._native.effectAllowed=t}get effectAllowed(){return this._native.effectAllowed}set dropEffect(t){this._native.dropEffect=t}get dropEffect(){return this._native.dropEffect}get isCanceled(){return"none"==this._native.dropEffect||!!this._native.mozUserCancelled}}class Tf extends Bd{constructor(t){super(t),this.domEventType=["beforeinput"]}onDomEvent(t){const e=t.getTargetRanges(),n=this.view,i=n.document;let r=null,o=null,s=[];if(t.dataTransfer&&(r=new xf(t.dataTransfer)),null!==t.data?o=t.data:r&&(o=r.getData("text/plain")),i.selection.isFake)s=Array.from(i.selection.getRanges());else if(e.length)s=e.map((t=>n.domConverter.domRangeToView(t)));else if(js.isAndroid){const e=t.target.ownerDocument.defaultView.getSelection();s=Array.from(n.domConverter.domSelectionToView(e).getRanges())}if(js.isAndroid&&"insertCompositionText"==t.inputType&&o&&o.endsWith("\n"))this.fire(t.type,t,{inputType:"insertParagraph",targetRanges:[n.createRange(s[0].end)]});else if("insertText"==t.inputType&&o&&o.includes("\n")){const e=o.split(/\n{1,2}/g);let n=s;for(let o=0;o<e.length;o++){const s=e[o];""!=s&&(this.fire(t.type,t,{data:s,dataTransfer:r,targetRanges:n,inputType:t.inputType,isComposing:t.isComposing}),n=[i.selection.getFirstRange()]),o+1<e.length&&(this.fire(t.type,t,{inputType:"insertParagraph",targetRanges:n}),n=[i.selection.getFirstRange()])}}else this.fire(t.type,t,{data:o,dataTransfer:r,targetRanges:s,inputType:t.inputType,isComposing:t.isComposing})}}class Cf extends Nd{constructor(t){super(t),this.document.on("keydown",((t,e)=>{if(this.isEnabled&&((n=e.keyCode)==Vu.arrowright||n==Vu.arrowleft||n==Vu.arrowup||n==Vu.arrowdown)){const n=new ud(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(n,e),n.stop.called&&t.stop()}var n}))}observe(){}}class Ef extends Nd{constructor(t){super(t);const e=this.document;e.on("keydown",((t,n)=>{if(!this.isEnabled||n.keyCode!=Vu.tab||n.ctrlKey)return;const i=new ud(e,"tab",e.selection.getFirstRange());e.fire(i,n),i.stop.called&&t.stop()}))}observe(){}}class Sf extends(y()){constructor(t){super(),this.document=new dd(t),this.domConverter=new Md(this.document),this.domRoots=new Map,this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new Ed(this.domConverter,this.document.selection),this._renderer.bind("isFocused","isSelecting","isComposing").to(this.document,"isFocused","isSelecting","isComposing"),this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this._writer=new vd(this.document),this.addObserver(yf),this.addObserver(_f),this.addObserver(kf),this.addObserver(Fd),this.addObserver(Xd),this.addObserver(Af),this.addObserver(Cf),this.addObserver(Tf),this.addObserver(Ef),this.document.on("arrowKey",oe,{priority:"low"}),Wt(this),this.on("render",(()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1})),this.listenTo(this.document.selection,"change",(()=>{this._hasChangedSinceTheLastRendering=!0})),this.listenTo(this.document,"change:isFocused",(()=>{this._hasChangedSinceTheLastRendering=!0}))}attachDomRoot(t,e="main"){const n=this.document.getRoot(e);n._name=t.tagName.toLowerCase();const i={};for(const{name:e,value:r}of Array.from(t.attributes))i[e]=r,"class"===e?this._writer.addClass(r.split(" "),n):this._writer.setAttribute(e,r,n);this._initialDomRootAttributes.set(t,i);const r=()=>{this._writer.setAttribute("contenteditable",(!n.isReadOnly).toString(),n),n.isReadOnly?this._writer.addClass("ck-read-only",n):this._writer.removeClass("ck-read-only",n)};r(),this.domRoots.set(e,t),this.domConverter.bindElements(t,n),this._renderer.markToSync("children",n),this._renderer.markToSync("attributes",n),this._renderer.domDocuments.add(t.ownerDocument),n.on("change:children",((t,e)=>this._renderer.markToSync("children",e))),n.on("change:attributes",((t,e)=>this._renderer.markToSync("attributes",e))),n.on("change:text",((t,e)=>this._renderer.markToSync("text",e))),n.on("change:isReadOnly",(()=>this.change(r))),n.on("change",(()=>{this._hasChangedSinceTheLastRendering=!0}));for(const n of this._observers.values())n.observe(t,e)}detachDomRoot(t){const e=this.domRoots.get(t);Array.from(e.attributes).forEach((({name:t})=>e.removeAttribute(t)));const n=this._initialDomRootAttributes.get(e);for(const t in n)e.setAttribute(t,n[t]);this.domRoots.delete(t),this.domConverter.unbindDomElement(e)}getDomRoot(t="main"){return this.domRoots.get(t)}addObserver(t){let e=this._observers.get(t);if(e)return e;e=new t(this),this._observers.set(t,e);for(const[t,n]of this.domRoots)e.observe(n,t);return e.enable(),e}getObserver(t){return this._observers.get(t)}disableObservers(){for(const t of this._observers.values())t.disable()}enableObservers(){for(const t of this._observers.values())t.enable()}scrollToTheSelection(){const t=this.document.selection.getFirstRange();t&&function({target:t,viewportOffset:e=0}){const n=at(t);let i=n,r=null;for(;i;){let o;o=ct(i==n?t:r),nt(o,(()=>lt(t,i)));const s=lt(t,i);if(et(i,s,e),i.parent!=i){if(r=i.frameElement,i=i.parent,!r)return}else i=null}}({target:this.domConverter.viewRangeToDom(t),viewportOffset:20})}focus(){if(!this.document.isFocused){const t=this.document.selection.editableElement;t&&(this.domConverter.focus(t),this.forceRender())}}change(t){if(this.isRenderingInProgress||this._postFixersInProgress)throw new qs("cannot-change-view-tree",this);try{if(this._ongoingChange)return t(this._writer);this._ongoingChange=!0;const e=t(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),e}catch(t){qs.rethrowUnexpectedError(t,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.getObserver(_f).flush(),this.change((()=>{}))}destroy(){for(const t of this._observers.values())t.destroy();this.document.destroy(),this.stopListening()}createPositionAt(t,e){return sd._createAt(t,e)}createPositionAfter(t){return sd._createAfter(t)}createPositionBefore(t){return sd._createBefore(t)}createRange(...t){return new ad(...t)}createRangeOn(t){return ad._createOn(t)}createRangeIn(t){return ad._createIn(t)}createSelection(...t){return new cd(...t)}_disableRendering(t){this._renderingDisabled=t,0==t&&this.change((()=>{}))}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}class Pf{is(){throw new Error("is() method is abstract")}}class Rf extends Pf{constructor(t){super(),this.parent=null,this._attrs=vt(t)}get document(){return null}get index(){let t;if(!this.parent)return null;if(null===(t=this.parent.getChildIndex(this)))throw new qs("model-node-not-found-in-parent",this);return t}get startOffset(){let t;if(!this.parent)return null;if(null===(t=this.parent.getChildStartOffset(this)))throw new qs("model-node-not-found-in-parent",this);return t}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const t=this.index;return null!==t&&this.parent.getChild(t+1)||null}get previousSibling(){const t=this.index;return null!==t&&this.parent.getChild(t-1)||null}get root(){let t=this;for(;t.parent;)t=t.parent;return t}isAttached(){return this.root.is("rootElement")}getPath(){const t=[];let e=this;for(;e.parent;)t.unshift(e.startOffset),e=e.parent;return t}getAncestors(t={}){const e=[];let n=t.includeSelf?this:this.parent;for(;n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}getCommonAncestor(t,e={}){const n=this.getAncestors(e),i=t.getAncestors(e);let r=0;for(;n[r]==i[r]&&n[r];)r++;return 0===r?null:n[r-1]}isBefore(t){if(this==t)return!1;if(this.root!==t.root)return!1;const e=this.getPath(),n=t.getPath(),i=E(e,n);switch(i){case"prefix":return!0;case"extension":return!1;default:return e[i]<n[i]}}isAfter(t){return this!=t&&this.root===t.root&&!this.isBefore(t)}hasAttribute(t){return this._attrs.has(t)}getAttribute(t){return this._attrs.get(t)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}toJSON(){const t={};return this._attrs.size&&(t.attributes=Array.from(this._attrs).reduce(((t,e)=>(t[e[0]]=e[1],t)),{})),t}_clone(t){return new this.constructor(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(t,e){this._attrs.set(t,e)}_setAttributesTo(t){this._attrs=vt(t)}_removeAttribute(t){return this._attrs.delete(t)}_clearAttributes(){this._attrs.clear()}}Rf.prototype.is=function(t){return"node"===t||"model:node"===t};class Of{constructor(t){this._nodes=[],t&&this._insertNodes(0,t)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce(((t,e)=>t+e.offsetSize),0)}getNode(t){return this._nodes[t]||null}getNodeIndex(t){const e=this._nodes.indexOf(t);return-1==e?null:e}getNodeStartOffset(t){const e=this.getNodeIndex(t);return null===e?null:this._nodes.slice(0,e).reduce(((t,e)=>t+e.offsetSize),0)}indexToOffset(t){if(t==this._nodes.length)return this.maxOffset;const e=this._nodes[t];if(!e)throw new qs("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(e)}offsetToIndex(t){let e=0;for(const n of this._nodes){if(t>=e&&t<e+n.offsetSize)return this.getNodeIndex(n);e+=n.offsetSize}if(e!=t)throw new qs("model-nodelist-offset-out-of-bounds",this,{offset:t,nodeList:this});return this.length}_insertNodes(t,e){for(const t of e)if(!(t instanceof Rf))throw new qs("model-nodelist-insertnodes-not-node",this);this._nodes=function(t,e,n,i){if(Math.max(e.length,t.length)>1e4)return t.slice(0,n).concat(e).concat(t.slice(n+i,t.length));{const r=Array.from(t);return r.splice(n,i,...e),r}}(this._nodes,Array.from(e),t,0)}_removeNodes(t,e=1){return this._nodes.splice(t,e)}toJSON(){return this._nodes.map((t=>t.toJSON()))}}class If extends Rf{constructor(t,e){super(e),this._data=t||""}get offsetSize(){return this.data.length}get data(){return this._data}toJSON(){const t=super.toJSON();return t.data=this.data,t}_clone(){return new If(this.data,this.getAttributes())}static fromJSON(t){return new If(t.data,t.attributes)}}If.prototype.is=function(t){return"$text"===t||"model:$text"===t||"text"===t||"model:text"===t||"node"===t||"model:node"===t};class Mf extends Pf{constructor(t,e,n){if(super(),this.textNode=t,e<0||e>t.offsetSize)throw new qs("model-textproxy-wrong-offsetintext",this);if(n<0||e+n>t.offsetSize)throw new qs("model-textproxy-wrong-length",this);this.data=t.data.substring(e,e+n),this.offsetInText=e}get startOffset(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}getPath(){const t=this.textNode.getPath();return t.length>0&&(t[t.length-1]+=this.offsetInText),t}getAncestors(t={}){const e=[];let n=t.includeSelf?this:this.parent;for(;n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}hasAttribute(t){return this.textNode.hasAttribute(t)}getAttribute(t){return this.textNode.getAttribute(t)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}Mf.prototype.is=function(t){return"$textProxy"===t||"model:$textProxy"===t||"textProxy"===t||"model:textProxy"===t};class Nf extends Rf{constructor(t,e,n){super(e),this._children=new Of,this.name=t,n&&this._insertChild(0,n)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}offsetToIndex(t){return this._children.offsetToIndex(t)}getNodeByPath(t){let e=this;for(const n of t)e=e.getChild(e.offsetToIndex(n));return e}findAncestor(t,e={}){let n=e.includeSelf?this:this.parent;for(;n;){if(n.name===t)return n;n=n.parent}return null}toJSON(){const t=super.toJSON();if(t.name=this.name,this._children.length>0){t.children=[];for(const e of this._children)t.children.push(e.toJSON())}return t}_clone(t=!1){const e=t?Array.from(this._children).map((t=>t._clone(!0))):void 0;return new Nf(this.name,this.getAttributes(),e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const n=function(t){return"string"==typeof t?[new If(t)]:(S(t)||(t=[t]),Array.from(t).map((t=>"string"==typeof t?new If(t):t instanceof Mf?new If(t.data,t.getAttributes()):t)))}(e);for(const t of n)null!==t.parent&&t._remove(),t.parent=this;this._children._insertNodes(t,n)}_removeChildren(t,e=1){const n=this._children._removeNodes(t,e);for(const t of n)t.parent=null;return n}static fromJSON(t){let e;if(t.children){e=[];for(const n of t.children)n.name?e.push(Nf.fromJSON(n)):e.push(If.fromJSON(n))}return new Nf(t.name,t.attributes,e)}}Nf.prototype.is=function(t,e){return e?e===this.name&&("element"===t||"model:element"===t):"element"===t||"model:element"===t||"node"===t||"model:node"===t};class Vf{constructor(t){if(!t||!t.boundaries&&!t.startPosition)throw new qs("model-tree-walker-no-start-position",null);const e=t.direction||"forward";if("forward"!=e&&"backward"!=e)throw new qs("model-tree-walker-unknown-direction",t,{direction:e});this.direction=e,this.boundaries=t.boundaries||null,t.startPosition?this.position=t.startPosition.clone():this.position=Df._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}skip(t){let e,n,i,r;do{i=this.position,r=this._visitedParent,({done:e,value:n}=this.next())}while(!e&&t(n));e||(this.position=i,this._visitedParent=r)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const t=this.position,e=this.position.clone(),n=this._visitedParent;if(null===n.parent&&e.offset===n.maxOffset)return{done:!0,value:void 0};if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0,value:void 0};const i=ve(e,n),r=i||be(e,n,i);if(r instanceof Nf)return this.shallow?e.offset++:(e.path.push(0),this._visitedParent=r),this.position=e,we("elementStart",r,t,e,1);if(r instanceof If){let i;if(this.singleCharacters)i=1;else{let t=r.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offset<t&&(t=this.boundaries.end.offset),i=t-e.offset}const o=e.offset-r.startOffset,s=new Mf(r,o,i);return e.offset+=i,this.position=e,we("text",s,t,e,i)}return e.path.pop(),e.offset++,this.position=e,this._visitedParent=n.parent,this.ignoreElementEnd?this._next():we("elementEnd",n,t,e)}_previous(){const t=this.position,e=this.position.clone(),n=this._visitedParent;if(null===n.parent&&0===e.offset)return{done:!0,value:void 0};if(n==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0,value:void 0};const i=e.parent,r=ve(e,i),o=r||ye(e,i,r);if(o instanceof Nf)return e.offset--,this.shallow?(this.position=e,we("elementStart",o,t,e,1)):(e.path.push(o.maxOffset),this.position=e,this._visitedParent=o,this.ignoreElementEnd?this._previous():we("elementEnd",o,t,e));if(o instanceof If){let i;if(this.singleCharacters)i=1;else{let t=o.startOffset;this._boundaryStartParent==n&&this.boundaries.start.offset>t&&(t=this.boundaries.start.offset),i=e.offset-t}const r=e.offset-o.startOffset,s=new Mf(o,r-i,i);return e.offset-=i,this.position=e,we("text",s,t,e,i)}return e.path.pop(),this.position=e,this._visitedParent=n.parent,we("elementStart",n,t,e,1)}}class Df extends Pf{constructor(t,e,n="toNone"){if(super(),!t.is("element")&&!t.is("documentFragment"))throw new qs("model-position-root-invalid",t);if(!(e instanceof Array)||0===e.length)throw new qs("model-position-path-incorrect-format",t,{path:e});t.is("rootElement")?e=e.slice():(e=[...t.getPath(),...e],t=t.root),this.root=t,this.path=e,this.stickiness=n}get offset(){return this.path[this.path.length-1]}set offset(t){this.path[this.path.length-1]=t}get parent(){let t=this.root;for(let e=0;e<this.path.length-1;e++)if(t=t.getChild(t.offsetToIndex(this.path[e])),!t)throw new qs("model-position-path-incorrect",this,{position:this});if(t.is("$text"))throw new qs("model-position-path-incorrect",this,{position:this});return t}get index(){return this.parent.offsetToIndex(this.offset)}get textNode(){return ve(this,this.parent)}get nodeAfter(){const t=this.parent;return be(this,t,ve(this,t))}get nodeBefore(){const t=this.parent;return ye(this,t,ve(this,t))}get isAtStart(){return 0===this.offset}get isAtEnd(){return this.offset==this.parent.maxOffset}compareWith(t){if(this.root!=t.root)return"different";const e=E(this.path,t.path);switch(e){case"same":return"same";case"prefix":return"before";case"extension":return"after";default:return this.path[e]<t.path[e]?"before":"after"}}getLastMatchingPosition(t,e={}){e.startPosition=this;const n=new Vf(e);return n.skip(t),n.position}getParentPath(){return this.path.slice(0,-1)}getAncestors(){const t=this.parent;return t.is("documentFragment")?[t]:t.getAncestors({includeSelf:!0})}findAncestor(t){const e=this.parent;return e.is("element")?e.findAncestor(t,{includeSelf:!0}):null}getCommonPath(t){if(this.root!=t.root)return[];const e=E(this.path,t.path),n="string"==typeof e?Math.min(this.path.length,t.path.length):e;return this.path.slice(0,n)}getCommonAncestor(t){const e=this.getAncestors(),n=t.getAncestors();let i=0;for(;e[i]==n[i]&&e[i];)i++;return 0===i?null:e[i-1]}getShiftedBy(t){const e=this.clone(),n=e.offset+t;return e.offset=n<0?0:n,e}isAfter(t){return"after"==this.compareWith(t)}isBefore(t){return"before"==this.compareWith(t)}isEqual(t){return"same"==this.compareWith(t)}isTouching(t){if(this.root!==t.root)return!1;const e=Math.min(this.path.length,t.path.length);for(let n=0;n<e;n++){const e=this.path[n]-t.path[n];if(e<-1||e>1)return!1;if(1===e)return _e(t,this,n);if(-1===e)return _e(this,t,n)}return this.path.length===t.path.length||(this.path.length>t.path.length?ke(this.path,e):ke(t.path,e))}hasSameParentAs(t){return this.root===t.root&&"same"==E(this.getParentPath(),t.getParentPath())}getTransformedByOperation(t){let e;switch(t.type){case"insert":e=this._getTransformedByInsertOperation(t);break;case"move":case"remove":case"reinsert":e=this._getTransformedByMoveOperation(t);break;case"split":e=this._getTransformedBySplitOperation(t);break;case"merge":e=this._getTransformedByMergeOperation(t);break;default:e=Df._createAt(this)}return e}_getTransformedByInsertOperation(t){return this._getTransformedByInsertion(t.position,t.howMany)}_getTransformedByMoveOperation(t){return this._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany)}_getTransformedBySplitOperation(t){const e=t.movedRange;return e.containsPosition(this)||e.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(t.splitPosition,t.moveTargetPosition):t.graveyardPosition?this._getTransformedByMove(t.graveyardPosition,t.insertionPosition,1):this._getTransformedByInsertion(t.insertionPosition,1)}_getTransformedByMergeOperation(t){const e=t.movedRange;let n;return e.containsPosition(this)||e.start.isEqual(this)?(n=this._getCombined(t.sourcePosition,t.targetPosition),t.sourcePosition.isBefore(t.targetPosition)&&(n=n._getTransformedByDeletion(t.deletionPosition,1))):n=this.isEqual(t.deletionPosition)?Df._createAt(t.deletionPosition):this._getTransformedByMove(t.deletionPosition,t.graveyardPosition,1),n}_getTransformedByDeletion(t,e){const n=Df._createAt(this);if(this.root!=t.root)return n;if("same"==E(t.getParentPath(),this.getParentPath())){if(t.offset<this.offset){if(t.offset+e>this.offset)return null;n.offset-=e}}else if("prefix"==E(t.getParentPath(),this.getParentPath())){const i=t.path.length-1;if(t.offset<=this.path[i]){if(t.offset+e>this.path[i])return null;n.path[i]-=e}}return n}_getTransformedByInsertion(t,e){const n=Df._createAt(this);if(this.root!=t.root)return n;if("same"==E(t.getParentPath(),this.getParentPath()))(t.offset<this.offset||t.offset==this.offset&&"toPrevious"!=this.stickiness)&&(n.offset+=e);else if("prefix"==E(t.getParentPath(),this.getParentPath())){const i=t.path.length-1;t.offset<=this.path[i]&&(n.path[i]+=e)}return n}_getTransformedByMove(t,e,n){if(e=e._getTransformedByDeletion(t,n),t.isEqual(e))return Df._createAt(this);const i=this._getTransformedByDeletion(t,n);return null===i||t.isEqual(this)&&"toNext"==this.stickiness||t.getShiftedBy(n).isEqual(this)&&"toPrevious"==this.stickiness?this._getCombined(t,e):i._getTransformedByInsertion(e,n)}_getCombined(t,e){const n=t.path.length-1,i=Df._createAt(e);return i.stickiness=this.stickiness,i.offset=i.offset+this.path[n]-t.offset,i.path=[...i.path,...this.path.slice(n+1)],i}toJSON(){return{root:this.root.toJSON(),path:Array.from(this.path),stickiness:this.stickiness}}clone(){return new this.constructor(this.root,this.path,this.stickiness)}static _createAt(t,e,n="toNone"){if(t instanceof Df)return new Df(t.root,t.path,t.stickiness);{const i=t;if("end"==e)e=i.maxOffset;else{if("before"==e)return this._createBefore(i,n);if("after"==e)return this._createAfter(i,n);if(0!==e&&!e)throw new qs("model-createpositionat-offset-required",[this,t])}if(!i.is("element")&&!i.is("documentFragment"))throw new qs("model-position-parent-incorrect",[this,t]);const r=i.getPath();return r.push(e),new this(i.root,r,n)}}static _createAfter(t,e){if(!t.parent)throw new qs("model-position-after-root",[this,t],{root:t});return this._createAt(t.parent,t.endOffset,e)}static _createBefore(t,e){if(!t.parent)throw new qs("model-position-before-root",t,{root:t});return this._createAt(t.parent,t.startOffset,e)}static fromJSON(t,e){if("$graveyard"===t.root){const n=new Df(e.graveyard,t.path);return n.stickiness=t.stickiness,n}if(!e.getRoot(t.root))throw new qs("model-position-fromjson-no-root",e,{rootName:t.root});return new Df(e.getRoot(t.root),t.path,t.stickiness)}}Df.prototype.is=function(t){return"position"===t||"model:position"===t};class Bf extends Pf{constructor(t,e){super(),this.start=Df._createAt(t),this.end=e?Df._createAt(e):Df._createAt(t),this.start.stickiness=this.isCollapsed?"toNone":"toNext",this.end.stickiness=this.isCollapsed?"toNone":"toPrevious"}*[Symbol.iterator](){yield*new Vf({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return"same"==E(this.start.getParentPath(),this.end.getParentPath())}get root(){return this.start.root}containsPosition(t){return t.isAfter(this.start)&&t.isBefore(this.end)}containsRange(t,e=!1){t.isCollapsed&&(e=!1);const n=this.containsPosition(t.start)||e&&this.start.isEqual(t.start),i=this.containsPosition(t.end)||e&&this.end.isEqual(t.end);return n&&i}containsItem(t){const e=Df._createBefore(t);return this.containsPosition(e)||this.start.isEqual(e)}isEqual(t){return this.start.isEqual(t.start)&&this.end.isEqual(t.end)}isIntersecting(t){return this.start.isBefore(t.end)&&this.end.isAfter(t.start)}getDifference(t){const e=[];return this.isIntersecting(t)?(this.containsPosition(t.start)&&e.push(new Bf(this.start,t.start)),this.containsPosition(t.end)&&e.push(new Bf(t.end,this.end))):e.push(new Bf(this.start,this.end)),e}getIntersection(t){if(this.isIntersecting(t)){let e=this.start,n=this.end;return this.containsPosition(t.start)&&(e=t.start),this.containsPosition(t.end)&&(n=t.end),new Bf(e,n)}return null}getJoined(t,e=!1){let n=this.isIntersecting(t);if(n||(n=this.start.isBefore(t.start)?e?this.end.isTouching(t.start):this.end.isEqual(t.start):e?t.end.isTouching(this.start):t.end.isEqual(this.start)),!n)return null;let i=this.start,r=this.end;return t.start.isBefore(i)&&(i=t.start),t.end.isAfter(r)&&(r=t.end),new Bf(i,r)}getMinimalFlatRanges(){const t=[],e=this.start.getCommonPath(this.end).length,n=Df._createAt(this.start);let i=n.parent;for(;n.path.length>e+1;){const e=i.maxOffset-n.offset;0!==e&&t.push(new Bf(n,n.getShiftedBy(e))),n.path=n.path.slice(0,-1),n.offset++,i=i.parent}for(;n.path.length<=this.end.path.length;){const e=this.end.path[n.path.length-1],i=e-n.offset;0!==i&&t.push(new Bf(n,n.getShiftedBy(i))),n.offset=e,n.path.push(0)}return t}getWalker(t={}){return t.boundaries=this,new Vf(t)}*getItems(t={}){t.boundaries=this,t.ignoreElementEnd=!0;const e=new Vf(t);for(const t of e)yield t.item}*getPositions(t={}){t.boundaries=this;const e=new Vf(t);yield e.position;for(const t of e)yield t.nextPosition}getTransformedByOperation(t){switch(t.type){case"insert":return this._getTransformedByInsertOperation(t);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(t);case"split":return[this._getTransformedBySplitOperation(t)];case"merge":return[this._getTransformedByMergeOperation(t)]}return[new Bf(this.start,this.end)]}getTransformedByOperations(t){const e=[new Bf(this.start,this.end)];for(const n of t)for(let t=0;t<e.length;t++){const i=e[t].getTransformedByOperation(n);e.splice(t,1,...i),t+=i.length-1}for(let t=0;t<e.length;t++){const n=e[t];for(let i=t+1;i<e.length;i++){const t=e[i];(n.containsRange(t)||t.containsRange(n)||n.isEqual(t))&&e.splice(i,1)}}return e}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}getContainedElement(){if(this.isCollapsed)return null;const t=this.start.nodeAfter,e=this.end.nodeBefore;return t&&t.is("element")&&t===e?t:null}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}clone(){return new this.constructor(this.start,this.end)}_getTransformedByInsertOperation(t,e=!1){return this._getTransformedByInsertion(t.position,t.howMany,e)}_getTransformedByMoveOperation(t,e=!1){const n=t.sourcePosition,i=t.howMany,r=t.targetPosition;return this._getTransformedByMove(n,r,i,e)}_getTransformedBySplitOperation(t){const e=this.start._getTransformedBySplitOperation(t);let n=this.end._getTransformedBySplitOperation(t);return this.end.isEqual(t.insertionPosition)&&(n=this.end.getShiftedBy(1)),e.root!=n.root&&(n=this.end.getShiftedBy(-1)),new Bf(e,n)}_getTransformedByMergeOperation(t){if(this.start.isEqual(t.targetPosition)&&this.end.isEqual(t.deletionPosition))return new Bf(this.start);let e=this.start._getTransformedByMergeOperation(t),n=this.end._getTransformedByMergeOperation(t);return e.root!=n.root&&(n=this.end.getShiftedBy(-1)),e.isAfter(n)?(t.sourcePosition.isBefore(t.targetPosition)?(e=Df._createAt(n),e.offset=0):(t.deletionPosition.isEqual(e)||(n=t.deletionPosition),e=t.targetPosition),new Bf(e,n)):new Bf(e,n)}_getTransformedByInsertion(t,e,n=!1){if(n&&this.containsPosition(t))return[new Bf(this.start,t),new Bf(t.getShiftedBy(e),this.end._getTransformedByInsertion(t,e))];{const n=new Bf(this.start,this.end);return n.start=n.start._getTransformedByInsertion(t,e),n.end=n.end._getTransformedByInsertion(t,e),[n]}}_getTransformedByMove(t,e,n,i=!1){if(this.isCollapsed){const i=this.start._getTransformedByMove(t,e,n);return[new Bf(i)]}const r=Bf._createFromPositionAndShift(t,n),o=e._getTransformedByDeletion(t,n);if(this.containsPosition(e)&&!i&&(r.containsPosition(this.start)||r.containsPosition(this.end))){const i=this.start._getTransformedByMove(t,e,n),r=this.end._getTransformedByMove(t,e,n);return[new Bf(i,r)]}let s;const a=this.getDifference(r);let c=null;const l=this.getIntersection(r);if(1==a.length?c=new Bf(a[0].start._getTransformedByDeletion(t,n),a[0].end._getTransformedByDeletion(t,n)):2==a.length&&(c=new Bf(this.start,this.end._getTransformedByDeletion(t,n))),s=c?c._getTransformedByInsertion(o,n,null!==l||i):[],l){const t=new Bf(l.start._getCombined(r.start,o),l.end._getCombined(r.start,o));2==s.length?s.splice(1,0,t):s.push(t)}return s}_getTransformedByDeletion(t,e){let n=this.start._getTransformedByDeletion(t,e),i=this.end._getTransformedByDeletion(t,e);return null==n&&null==i?null:(null==n&&(n=t),null==i&&(i=t),new Bf(n,i))}static _createFromPositionAndShift(t,e){const n=t,i=t.getShiftedBy(e);return e>0?new this(n,i):new this(i,n)}static _createIn(t){return new this(Df._createAt(t,0),Df._createAt(t,t.maxOffset))}static _createOn(t){return this._createFromPositionAndShift(Df._createBefore(t),t.offsetSize)}static _createFromRanges(t){if(0===t.length)throw new qs("range-create-from-ranges-empty-array",null);if(1==t.length)return t[0].clone();const e=t[0];t.sort(((t,e)=>t.start.isAfter(e.start)?1:-1));const n=t.indexOf(e),i=new this(e.start,e.end);if(n>0)for(let e=n-1;t[e].end.isEqual(i.start);e++)i.start=Df._createAt(t[e].start);for(let e=n+1;e<t.length&&t[e].start.isEqual(i.end);e++)i.end=Df._createAt(t[e].end);return i}static fromJSON(t,e){return new this(Df.fromJSON(t.start,e),Df.fromJSON(t.end,e))}}Bf.prototype.is=function(t){return"range"===t||"model:range"===t};class Ff extends(d()){constructor(){super(),this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._viewToModelLengthCallbacks=new Map,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._deferredBindingRemovals=new Map,this._unboundMarkerNames=new Set,this.on("modelToViewPosition",((t,e)=>{if(e.viewPosition)return;const n=this._modelToViewMapping.get(e.modelPosition.parent);if(!n)throw new qs("mapping-model-position-view-parent-not-found",this,{modelPosition:e.modelPosition});e.viewPosition=this.findPositionIn(n,e.modelPosition.offset)}),{priority:"low"}),this.on("viewToModelPosition",((t,e)=>{if(e.modelPosition)return;const n=this.findMappedViewAncestor(e.viewPosition),i=this._viewToModelMapping.get(n),r=this._toModelOffset(e.viewPosition.parent,e.viewPosition.offset,n);e.modelPosition=Df._createAt(i,r)}),{priority:"low"})}bindElements(t,e){this._modelToViewMapping.set(t,e),this._viewToModelMapping.set(e,t)}unbindViewElement(t,e={}){const n=this.toModelElement(t);if(this._elementToMarkerNames.has(t))for(const e of this._elementToMarkerNames.get(t))this._unboundMarkerNames.add(e);e.defer?this._deferredBindingRemovals.set(t,t.root):(this._viewToModelMapping.delete(t),this._modelToViewMapping.get(n)==t&&this._modelToViewMapping.delete(n))}unbindModelElement(t){const e=this.toViewElement(t);this._modelToViewMapping.delete(t),this._viewToModelMapping.get(e)==t&&this._viewToModelMapping.delete(e)}bindElementToMarker(t,e){const n=this._markerNameToElements.get(e)||new Set;n.add(t);const i=this._elementToMarkerNames.get(t)||new Set;i.add(e),this._markerNameToElements.set(e,n),this._elementToMarkerNames.set(t,i)}unbindElementFromMarkerName(t,e){const n=this._markerNameToElements.get(e);n&&(n.delete(t),0==n.size&&this._markerNameToElements.delete(e));const i=this._elementToMarkerNames.get(t);i&&(i.delete(e),0==i.size&&this._elementToMarkerNames.delete(t))}flushUnboundMarkerNames(){const t=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),t}flushDeferredBindings(){for(const[t,e]of this._deferredBindingRemovals)t.root==e&&this.unbindViewElement(t);this._deferredBindingRemovals=new Map}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this._deferredBindingRemovals=new Map}toModelElement(t){return this._viewToModelMapping.get(t)}toViewElement(t){return this._modelToViewMapping.get(t)}toModelRange(t){return new Bf(this.toModelPosition(t.start),this.toModelPosition(t.end))}toViewRange(t){return new ad(this.toViewPosition(t.start),this.toViewPosition(t.end))}toModelPosition(t){const e={viewPosition:t,mapper:this};return this.fire("viewToModelPosition",e),e.modelPosition}toViewPosition(t,e={}){const n={modelPosition:t,mapper:this,isPhantom:e.isPhantom};return this.fire("modelToViewPosition",n),n.viewPosition}markerNameToElements(t){const e=this._markerNameToElements.get(t);if(!e)return null;const n=new Set;for(const t of e)if(t.is("attributeElement"))for(const e of t.getElementsWithSameId())n.add(e);else n.add(t);return n}registerViewToModelLength(t,e){this._viewToModelLengthCallbacks.set(t,e)}
findMappedViewAncestor(t){let e=t.parent;for(;!this._viewToModelMapping.has(e);)e=e.parent;return e}_toModelOffset(t,e,n){if(n!=t)return this._toModelOffset(t.parent,t.index,n)+this._toModelOffset(t,e,t);if(t.is("$text"))return e;let i=0;for(let n=0;n<e;n++)i+=this.getModelLength(t.getChild(n));return i}getModelLength(t){if(this._viewToModelLengthCallbacks.get(t.name))return this._viewToModelLengthCallbacks.get(t.name)(t);if(this._viewToModelMapping.has(t))return 1;if(t.is("$text"))return t.data.length;if(t.is("uiElement"))return 0;{let e=0;for(const n of t.getChildren())e+=this.getModelLength(n);return e}}findPositionIn(t,e){let n,i=0,r=0,o=0;if(t.is("$text"))return new sd(t,e);for(;r<e;)n=t.getChild(o),i=this.getModelLength(n),r+=i,o++;return r==e?this._moveViewPositionToTextNode(new sd(t,o)):this.findPositionIn(n,e-(r-i))}_moveViewPositionToTextNode(t){const e=t.nodeBefore,n=t.nodeAfter;return e instanceof rh?new sd(e,e.data.length):n instanceof rh?new sd(n,0):t}}class Lf{constructor(){this._consumable=new Map,this._textProxyRegistry=new Map}add(t,e){e=Ae(e),t instanceof Mf&&(t=this._getSymbolForTextProxy(t)),this._consumable.has(t)||this._consumable.set(t,new Map),this._consumable.get(t).set(e,!0)}consume(t,e){return e=Ae(e),t instanceof Mf&&(t=this._getSymbolForTextProxy(t)),!!this.test(t,e)&&(this._consumable.get(t).set(e,!1),!0)}test(t,e){e=Ae(e),t instanceof Mf&&(t=this._getSymbolForTextProxy(t));const n=this._consumable.get(t);if(void 0===n)return null;const i=n.get(e);return void 0===i?null:i}revert(t,e){e=Ae(e),t instanceof Mf&&(t=this._getSymbolForTextProxy(t));const n=this.test(t,e);return!1===n?(this._consumable.get(t).set(e,!0),!0):!0!==n&&null}verifyAllConsumed(t){const e=[];for(const[n,i]of this._consumable)for(const[r,o]of i){const i=r.split(":")[0];o&&t==i&&e.push({event:r,item:n.name||n.description})}if(e.length)throw new qs("conversion-model-consumable-not-consumed",null,{items:e})}_getSymbolForTextProxy(t){let e=null;const n=this._textProxyRegistry.get(t.startOffset);if(n){const i=n.get(t.endOffset);i&&(e=i.get(t.parent))}return e||(e=this._addSymbolForTextProxy(t)),e}_addSymbolForTextProxy(t){const e=t.startOffset,n=t.endOffset,i=t.parent,r=Symbol("$textProxy:"+t.data);let o,s;return o=this._textProxyRegistry.get(e),o||(o=new Map,this._textProxyRegistry.set(e,o)),s=o.get(n),s||(s=new Map,o.set(n,s)),s.set(i,r),r}}class zf extends(d()){constructor(t){super(),this._conversionApi={dispatcher:this,...t},this._firedEventsMap=new WeakMap}convertChanges(t,e,n){const i=this._createConversionApi(n,t.getRefreshedItems());for(const e of t.getMarkersToRemove())this._convertMarkerRemove(e.name,e.range,i);const r=this._reduceChanges(t.getChanges());for(const t of r)"insert"===t.type?this._convertInsert(Bf._createFromPositionAndShift(t.position,t.length),i):"reinsert"===t.type?this._convertReinsert(Bf._createFromPositionAndShift(t.position,t.length),i):"remove"===t.type?this._convertRemove(t.position,t.length,t.name,i):this._convertAttribute(t.range,t.attributeKey,t.attributeOldValue,t.attributeNewValue,i);for(const t of i.mapper.flushUnboundMarkerNames()){const n=e.get(t).getRange();this._convertMarkerRemove(t,n,i),this._convertMarkerAdd(t,n,i)}for(const e of t.getMarkersToAdd())this._convertMarkerAdd(e.name,e.range,i);i.mapper.flushDeferredBindings(),i.consumable.verifyAllConsumed("insert")}convert(t,e,n,i={}){const r=this._createConversionApi(n,void 0,i);this._convertInsert(t,r);for(const[t,n]of e)this._convertMarkerAdd(t,n,r);r.consumable.verifyAllConsumed("insert")}convertSelection(t,e,n){const i=Array.from(e.getMarkersAtPosition(t.getFirstPosition())),r=this._createConversionApi(n);if(this._addConsumablesForSelection(r.consumable,t,i),this.fire("selection",{selection:t},r),t.isCollapsed){for(const e of i){const n=e.getRange();if(!xe(t.getFirstPosition(),e,r.mapper))continue;const i={item:t,markerName:e.name,markerRange:n};r.consumable.test(t,"addMarker:"+e.name)&&this.fire(`addMarker:${e.name}`,i,r)}for(const e of t.getAttributeKeys()){const n={item:t,range:t.getFirstRange(),attributeKey:e,attributeOldValue:null,attributeNewValue:t.getAttribute(e)};r.consumable.test(t,"attribute:"+n.attributeKey)&&this.fire(`attribute:${n.attributeKey}:$text`,n,r)}}}_convertInsert(t,e,n={}){n.doNotAddConsumables||this._addConsumablesForInsert(e.consumable,Array.from(t));for(const n of Array.from(t.getWalker({shallow:!0})).map(Te))this._testAndFire("insert",n,e)}_convertRemove(t,e,n,i){this.fire(`remove:${n}`,{position:t,length:e},i)}_convertAttribute(t,e,n,i,r){this._addConsumablesForRange(r.consumable,t,`attribute:${e}`);for(const o of t){const t={item:o.item,range:Bf._createFromPositionAndShift(o.previousPosition,o.length),attributeKey:e,attributeOldValue:n,attributeNewValue:i};this._testAndFire(`attribute:${e}`,t,r)}}_convertReinsert(t,e){const n=Array.from(t.getWalker({shallow:!0}));this._addConsumablesForInsert(e.consumable,n);for(const t of n.map(Te))this._testAndFire("insert",{...t,reconversion:!0},e)}_convertMarkerAdd(t,e,n){if("$graveyard"==e.root.rootName)return;const i=`addMarker:${t}`;if(n.consumable.add(e,i),this.fire(i,{markerName:t,markerRange:e},n),n.consumable.consume(e,i)){this._addConsumablesForRange(n.consumable,e,i);for(const r of e.getItems()){if(!n.consumable.test(r,i))continue;const o={item:r,range:Bf._createOn(r),markerName:t,markerRange:e};this.fire(i,o,n)}}}_convertMarkerRemove(t,e,n){"$graveyard"!=e.root.rootName&&this.fire(`removeMarker:${t}`,{markerName:t,markerRange:e},n)}_reduceChanges(t){const e={changes:t};return this.fire("reduceChanges",e),e.changes}_addConsumablesForInsert(t,e){for(const n of e){const e=n.item;if(null===t.test(e,"insert")){t.add(e,"insert");for(const n of e.getAttributeKeys())t.add(e,"attribute:"+n)}}return t}_addConsumablesForRange(t,e,n){for(const i of e.getItems())t.add(i,n);return t}_addConsumablesForSelection(t,e,n){t.add(e,"selection");for(const i of n)t.add(e,"addMarker:"+i.name);for(const n of e.getAttributeKeys())t.add(e,"attribute:"+n);return t}_testAndFire(t,e,n){const i=function(t,e){return`${t}:${e.item.is("element")?e.item.name:"$text"}`}(t,e),r=e.item.is("$textProxy")?n.consumable._getSymbolForTextProxy(e.item):e.item,o=this._firedEventsMap.get(n),s=o.get(r);if(s){if(s.has(i))return;s.add(i)}else o.set(r,new Set([i]));this.fire(i,e,n)}_testAndFireAddAttributes(t,e){const n={item:t,range:Bf._createOn(t)};for(const t of n.item.getAttributeKeys())n.attributeKey=t,n.attributeOldValue=null,n.attributeNewValue=n.item.getAttribute(t),this._testAndFire(`attribute:${t}`,n,e)}_createConversionApi(t,e=new Set,n={}){const i={...this._conversionApi,consumable:new Lf,writer:t,options:n,convertItem:t=>this._convertInsert(Bf._createOn(t),i),convertChildren:t=>this._convertInsert(Bf._createIn(t),i,{doNotAddConsumables:!0}),convertAttributes:t=>this._testAndFireAddAttributes(t,i),canReuseView:t=>!e.has(i.mapper.toModelElement(t))};return this._firedEventsMap.set(i,new Map),i}}class jf extends(d(Pf)){constructor(...t){super(),this._lastRangeBackward=!1,this._attrs=new Map,this._ranges=[],t.length&&this.setTo(...t)}get anchor(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.end:t.start}return null}get focus(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.start:t.end}return null}get isCollapsed(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(t){if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let n=!1;for(const i of t._ranges)if(e.isEqual(i)){n=!0;break}if(!n)return!1}return!0}*getRanges(){for(const t of this._ranges)yield new Bf(t.start,t.end)}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?new Bf(t.start,t.end):null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?new Bf(t.start,t.end):null}getFirstPosition(){const t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){const t=this.getLastRange();return t?t.end.clone():null}setTo(...t){let[e,n,i]=t;if("object"==typeof n&&(i=n,n=void 0),null===e)this._setRanges([]);else if(e instanceof jf)this._setRanges(e.getRanges(),e.isBackward);else if(e&&"function"==typeof e.getRanges)this._setRanges(e.getRanges(),e.isBackward);else if(e instanceof Bf)this._setRanges([e],!!i&&!!i.backward);else if(e instanceof Df)this._setRanges([new Bf(e)]);else if(e instanceof Rf){const t=!!i&&!!i.backward;let r;if("in"==n)r=Bf._createIn(e);else if("on"==n)r=Bf._createOn(e);else{if(void 0===n)throw new qs("model-selection-setto-required-second-parameter",[this,e]);r=new Bf(Df._createAt(e,n))}this._setRanges([r],t)}else{if(!S(e))throw new qs("model-selection-setto-not-selectable",[this,e]);this._setRanges(e,i&&!!i.backward)}}_setRanges(t,e=!1){const n=Array.from(t),i=n.some((e=>{if(!(e instanceof Bf))throw new qs("model-selection-set-ranges-not-range",[this,t]);return this._ranges.every((t=>!t.isEqual(e)))}));(n.length!==this._ranges.length||i)&&(this._replaceAllRanges(n),this._lastRangeBackward=!!e,this.fire("change:range",{directChange:!0}))}setFocus(t,e){if(null===this.anchor)throw new qs("model-selection-setfocus-no-ranges",[this,t]);const n=Df._createAt(t,e);if("same"==n.compareWith(this.focus))return;const i=this.anchor;this._ranges.length&&this._popRange(),"before"==n.compareWith(i)?(this._pushRange(new Bf(n,i)),this._lastRangeBackward=!0):(this._pushRange(new Bf(i,n)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(t){return this._attrs.get(t)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(t){return this._attrs.has(t)}removeAttribute(t){this.hasAttribute(t)&&(this._attrs.delete(t),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}setAttribute(t,e){this.getAttribute(t)!==e&&(this._attrs.set(t,e),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}*getSelectedBlocks(){const t=new WeakSet;for(const e of this.getRanges()){const n=Se(e.start,t);n&&Pe(n,e)&&(yield n);for(const n of e.getWalker()){const i=n.item;"elementEnd"==n.type&&Ee(i,t,e)&&(yield i)}const i=Se(e.end,t);i&&!e.end.isTouching(Df._createAt(i,0))&&Pe(i,e)&&(yield i)}}containsEntireContent(t=this.anchor.root){const e=Df._createAt(t,0),n=Df._createAt(t,"end");return e.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(t){this._checkRange(t),this._ranges.push(new Bf(t.start,t.end))}_checkRange(t){for(let e=0;e<this._ranges.length;e++)if(t.isIntersecting(this._ranges[e]))throw new qs("model-selection-range-intersects",[this,t],{addedRange:t,intersectingRange:this._ranges[e]})}_replaceAllRanges(t){this._removeAllRanges();for(const e of t)this._pushRange(e)}_removeAllRanges(){for(;this._ranges.length>0;)this._popRange()}_popRange(){this._ranges.pop()}}jf.prototype.is=function(t){return"selection"===t||"model:selection"===t};class Hf extends(d(Bf)){constructor(t,e){super(t,e),Re.call(this)}detach(){this.stopListening()}toRange(){return new Bf(this.start,this.end)}static fromRange(t){return new Hf(t.start,t.end)}}Hf.prototype.is=function(t){return"liveRange"===t||"model:liveRange"===t||"range"==t||"model:range"===t};const Uf="selection:";class Wf extends(d(Pf)){constructor(t){super(),this._selection=new $f(t),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(t){return this._selection.containsEntireContent(t)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(t){return this._selection.getAttribute(t)}hasAttribute(t){return this._selection.hasAttribute(t)}refresh(){this._selection.updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(t){this._selection.observeMarkers(t)}_setFocus(t,e){this._selection.setFocus(t,e)}_setTo(...t){this._selection.setTo(...t)}_setAttribute(t,e){this._selection.setAttribute(t,e)}_removeAttribute(t){this._selection.removeAttribute(t)}_getStoredAttributes(){return this._selection.getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(t){this._selection.restoreGravity(t)}static _getStoreAttributeKey(t){return Uf+t}static _isStoreAttributeKey(t){return t.startsWith(Uf)}}Wf.prototype.is=function(t){return"selection"===t||"model:selection"==t||"documentSelection"==t||"model:documentSelection"==t};class $f extends jf{constructor(t){super(),this.markers=new Lu({idProperty:"name"}),this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this._observedMarkers=new Set,this._model=t.model,this._document=t,this.listenTo(this._model,"applyOperation",((t,e)=>{const n=e[0];n.isDocumentOperation&&"marker"!=n.type&&"rename"!=n.type&&"noop"!=n.type&&(0==this._ranges.length&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))}),{priority:"lowest"}),this.on("change:range",(()=>{this._validateSelectionRanges(this.getRanges())})),this.listenTo(this._model.markers,"update",((t,e,n,i)=>{this._updateMarker(e,i)})),this.listenTo(this._document,"change",((t,e)=>{!function(t,e){const n=t.document.differ;for(const i of n.getChanges()){if("insert"!=i.type)continue;const n=i.position.parent;i.length===n.maxOffset&&t.enqueueChange(e,(t=>{const e=Array.from(n.getAttributeKeys()).filter((t=>t.startsWith(Uf)));for(const i of e)t.removeAttribute(i,n)}))}}(this._model,e)}))}get isCollapsed(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let t=0;t<this._ranges.length;t++)this._ranges[t].detach();this.stopListening()}*getRanges(){this._ranges.length?yield*super.getRanges():yield this._document._getDefaultRange()}getFirstRange(){return super.getFirstRange()||this._document._getDefaultRange()}getLastRange(){return super.getLastRange()||this._document._getDefaultRange()}setTo(...t){super.setTo(...t),this._updateAttributes(!0),this.updateMarkers()}setFocus(t,e){super.setFocus(t,e),this._updateAttributes(!0),this.updateMarkers()}setAttribute(t,e){if(this._setAttribute(t,e)){const e=[t];this.fire("change:attribute",{attributeKeys:e,directChange:!0})}}removeAttribute(t){if(this._removeAttribute(t)){const e=[t];this.fire("change:attribute",{attributeKeys:e,directChange:!0})}}overrideGravity(){const t=a();return this._overriddenGravityRegister.add(t),1===this._overriddenGravityRegister.size&&this._updateAttributes(!0),t}restoreGravity(t){if(!this._overriddenGravityRegister.has(t))throw new qs("document-selection-gravity-wrong-restore",this,{uid:t});this._overriddenGravityRegister.delete(t),this.isGravityOverridden||this._updateAttributes(!0)}observeMarkers(t){this._observedMarkers.add(t),this.updateMarkers()}_replaceAllRanges(t){this._validateSelectionRanges(t),super._replaceAllRanges(t)}_popRange(){this._ranges.pop().detach()}_pushRange(t){const e=this._prepareRange(t);e&&this._ranges.push(e)}_validateSelectionRanges(t){for(const e of t)if(!this._document._validateSelectionRange(e))throw new qs("document-selection-wrong-position",this,{range:e})}_prepareRange(t){if(this._checkRange(t),t.root==this._document.graveyard)return;const e=Hf.fromRange(t);return e.on("change:range",((t,n,i)=>{if(this._hasChangedRange=!0,e.root==this._document.graveyard){this._selectionRestorePosition=i.deletionPosition;const t=this._ranges.indexOf(e);this._ranges.splice(t,1),e.detach()}})),e}updateMarkers(){if(!this._observedMarkers.size)return;const t=[];let e=!1;for(const e of this._model.markers){const n=e.name.split(":",1)[0];if(!this._observedMarkers.has(n))continue;const i=e.getRange();for(const n of this.getRanges())i.containsRange(n,!n.isCollapsed)&&t.push(e)}const n=Array.from(this.markers);for(const n of t)this.markers.has(n)||(this.markers.add(n),e=!0);for(const n of Array.from(this.markers))t.includes(n)||(this.markers.remove(n),e=!0);e&&this.fire("change:marker",{oldMarkers:n,directChange:!1})}_updateMarker(t,e){const n=t.name.split(":",1)[0];if(!this._observedMarkers.has(n))return;let i=!1;const r=Array.from(this.markers),o=this.markers.has(t);if(e){let n=!1;for(const t of this.getRanges())if(e.containsRange(t,!t.isCollapsed)){n=!0;break}n&&!o?(this.markers.add(t),i=!0):!n&&o&&(this.markers.remove(t),i=!0)}else o&&(this.markers.remove(t),i=!0);i&&this.fire("change:marker",{oldMarkers:r,directChange:!1})}_updateAttributes(t){const e=vt(this._getSurroundingAttributes()),n=vt(this.getAttributes());if(t)this._attributePriority=new Map,this._attrs=new Map;else for(const[t,e]of this._attributePriority)"low"==e&&(this._attrs.delete(t),this._attributePriority.delete(t));this._setAttributesTo(e);const i=[];for(const[t,e]of this.getAttributes())n.has(t)&&n.get(t)===e||i.push(t);for(const[t]of n)this.hasAttribute(t)||i.push(t);i.length>0&&this.fire("change:attribute",{attributeKeys:i,directChange:!1})}_setAttribute(t,e,n=!0){const i=n?"normal":"low";return("low"!=i||"normal"!=this._attributePriority.get(t))&&(super.getAttribute(t)!==e&&(this._attrs.set(t,e),this._attributePriority.set(t,i),!0))}_removeAttribute(t,e=!0){const n=e?"normal":"low";return!("low"==n&&"normal"==this._attributePriority.get(t)||(this._attributePriority.set(t,n),!super.hasAttribute(t)||(this._attrs.delete(t),0)))}_setAttributesTo(t){const e=new Set;for(const[e,n]of this.getAttributes())t.get(e)!==n&&this._removeAttribute(e,!1);for(const[n,i]of t)this._setAttribute(n,i,!1)&&e.add(n);return e}*getStoredAttributes(){const t=this.getFirstPosition().parent;if(this.isCollapsed&&t.isEmpty)for(const e of t.getAttributeKeys())if(e.startsWith(Uf)){const n=e.substr(Uf.length);yield[n,t.getAttribute(e)]}}_getSurroundingAttributes(){const t=this.getFirstPosition(),e=this._model.schema;let n=null;if(this.isCollapsed){const i=t.textNode?t.textNode:t.nodeBefore,r=t.textNode?t.textNode:t.nodeAfter;if(this.isGravityOverridden||(n=Ie(i)),n||(n=Ie(r)),!this.isGravityOverridden&&!n){let t=i;for(;t&&!e.isInline(t)&&!n;)t=t.previousSibling,n=Ie(t)}if(!n){let t=r;for(;t&&!e.isInline(t)&&!n;)t=t.nextSibling,n=Ie(t)}n||(n=this.getStoredAttributes())}else{const t=this.getFirstRange();for(const i of t){if(i.item.is("element")&&e.isObject(i.item))break;if("text"==i.type){n=i.item.getAttributes();break}}}return n}_fixGraveyardSelection(t){const e=this._model.schema.getNearestSelectionRange(t);e&&this._pushRange(e)}}class qf{constructor(t){this._dispatchers=t}add(t){for(const e of this._dispatchers)t(e);return this}}var Kf=function(t){return _u(t,5)};class Gf extends qf{elementToElement(t){return this.add(function(t){const e=Ve(t.model),n=De(t.view,"container");return e.attributes.length&&(e.children=!0),i=>{i.on(`insert:${e.name}`,function(t,e=We){return(n,i,r)=>{if(!e(i.item,r.consumable,{preflight:!0}))return;const o=t(i.item,r,i);if(!o)return;e(i.item,r.consumable);const s=r.mapper.toViewPosition(i.range.start);r.mapper.bindElements(i.item,o),r.writer.insert(s,o),r.convertAttributes(i.item),He(o,i.item.getChildren(),r,{reconversion:i.reconversion})}}(n,je(e)),{priority:t.converterPriority||"normal"}),(e.children||e.attributes.length)&&i.on("reduceChanges",ze(e),{priority:"low"})}}(t))}elementToStructure(t){return this.add(function(t){const e=Ve(t.model),n=De(t.view,"container");return e.children=!0,i=>{if(i._conversionApi.schema.checkChild(e.name,"$text"))throw new qs("conversion-element-to-structure-disallowed-text",i,{elementName:e.name});var r,o;i.on(`insert:${e.name}`,(r=n,o=je(e),(t,e,n)=>{if(!o(e.item,n.consumable,{preflight:!0}))return;const i=new Map;n.writer._registerSlotFactory(function(t,e,n){return(i,r="children")=>{const o=i.createContainerElement("$slot");let s=null;if("children"===r)s=Array.from(t.getChildren());else{if("function"!=typeof r)throw new qs("conversion-slot-mode-unknown",n.dispatcher,{modeOrFilter:r});s=Array.from(t.getChildren()).filter((t=>r(t)))}return e.set(o,s),o}}(e.item,i,n));const s=r(e.item,n,e);if(n.writer._clearSlotFactory(),!s)return;!function(t,e,n){const i=Array.from(e.values()).flat(),r=new Set(i);if(r.size!=i.length)throw new qs("conversion-slot-filter-overlap",n.dispatcher,{element:t});if(r.size!=t.childCount)throw new qs("conversion-slot-filter-incomplete",n.dispatcher,{element:t})}(e.item,i,n),o(e.item,n.consumable);const a=n.mapper.toViewPosition(e.range.start);n.mapper.bindElements(e.item,s),n.writer.insert(a,s),n.convertAttributes(e.item),function(t,e,n,i){function r(t,e){const n=e.modelPosition.nodeAfter,i=s.indexOf(n);i<0||(e.viewPosition=e.mapper.findPositionIn(o,i))}n.mapper.on("modelToViewPosition",r,{priority:"highest"});let o=null,s=null;for([o,s]of e)He(t,s,n,i),n.writer.move(n.writer.createRangeIn(o),n.writer.createPositionBefore(o)),n.writer.remove(o);n.mapper.off("modelToViewPosition",r)}(s,i,n,{reconversion:e.reconversion})}),{priority:t.converterPriority||"normal"}),i.on("reduceChanges",ze(e),{priority:"low"})}}(t))}attributeToElement(t){return this.add(function(t){let e=(t=Kf(t)).model;"string"==typeof e&&(e={key:e});let n=`attribute:${e.key}`;if(e.name&&(n+=":"+e.name),e.values)for(const n of e.values)t.view[n]=De(t.view[n],"attribute");else t.view=De(t.view,"attribute");const i=Be(t);return e=>{e.on(n,function(t){return(e,n,i)=>{if(!i.consumable.test(n.item,e.name))return;const r=t(n.attributeOldValue,i,n),o=t(n.attributeNewValue,i,n);if(!r&&!o)return;i.consumable.consume(n.item,e.name);const s=i.writer,a=s.document.selection;if(n.item instanceof jf||n.item instanceof Wf)s.wrap(a.getFirstRange(),o);else{let t=i.mapper.toViewRange(n.range);null!==n.attributeOldValue&&r&&(t=s.unwrap(t,r)),null!==n.attributeNewValue&&o&&s.wrap(t,o)}}}(i),{priority:t.converterPriority||"normal"})}}(t))}attributeToAttribute(t){return this.add(function(t){let e=(t=Kf(t)).model;"string"==typeof e&&(e={key:e});let n=`attribute:${e.key}`;if(e.name&&(n+=":"+e.name),e.values)for(const n of e.values)t.view[n]=Fe(t.view[n]);else t.view=Fe(t.view);const i=Be(t);return e=>{var r;e.on(n,(r=i,(t,e,n)=>{if(!n.consumable.test(e.item,t.name))return;const i=r(e.attributeOldValue,n,e),o=r(e.attributeNewValue,n,e);if(!i&&!o)return;n.consumable.consume(e.item,t.name);const s=n.mapper.toViewElement(e.item),a=n.writer;if(!s)throw new qs("conversion-attribute-to-attribute-on-text",n.dispatcher,e);if(null!==e.attributeOldValue&&i)if("class"==i.key){const t=mt(i.value);for(const e of t)a.removeClass(e,s)}else if("style"==i.key){const t=Object.keys(i.value);for(const e of t)a.removeStyle(e,s)}else a.removeAttribute(i.key,s);if(null!==e.attributeNewValue&&o)if("class"==o.key){const t=mt(o.value);for(const e of t)a.addClass(e,s)}else if("style"==o.key){const t=Object.keys(o.value);for(const e of t)a.setStyle(e,o.value[e],s)}else a.setAttribute(o.key,o.value,s)}),{priority:t.converterPriority||"normal"})}}(t))}markerToElement(t){return this.add(function(t){const e=De(t.view,"ui");return n=>{var i;n.on(`addMarker:${t.model}`,(i=e,(t,e,n)=>{e.isOpening=!0;const r=i(e,n);e.isOpening=!1;const o=i(e,n);if(!r||!o)return;const s=e.markerRange;if(s.isCollapsed&&!n.consumable.consume(s,t.name))return;for(const e of s)if(!n.consumable.consume(e.item,t.name))return;const a=n.mapper,c=n.writer;c.insert(a.toViewPosition(s.start),r),n.mapper.bindElementToMarker(r,e.markerName),s.isCollapsed||(c.insert(a.toViewPosition(s.end),o),n.mapper.bindElementToMarker(o,e.markerName)),t.stop()}),{priority:t.converterPriority||"normal"}),n.on(`removeMarker:${t.model}`,((t,e,n)=>{const i=n.mapper.markerNameToElements(e.markerName);if(i){for(const t of i)n.mapper.unbindElementFromMarkerName(t,e.markerName),n.writer.clear(n.writer.createRangeOn(t),t);n.writer.clearClonedElementsGroup(e.markerName),t.stop()}}),{priority:t.converterPriority||"normal"})}}(t))}markerToHighlight(t){return this.add(function(t){return e=>{var n;e.on(`addMarker:${t.model}`,(n=t.view,(t,e,i)=>{if(!e.item)return;if(!(e.item instanceof jf||e.item instanceof Wf||e.item.is("$textProxy")))return;const r=Le(n,e,i);if(!r)return;if(!i.consumable.consume(e.item,t.name))return;const o=i.writer,s=Me(o,r),a=o.document.selection;if(e.item instanceof jf||e.item instanceof Wf)o.wrap(a.getFirstRange(),s);else{const t=i.mapper.toViewRange(e.range),n=o.wrap(t,s);for(const t of n.getItems())if(t.is("attributeElement")&&t.isSimilar(s)){i.mapper.bindElementToMarker(t,e.markerName);break}}}),{priority:t.converterPriority||"normal"}),e.on(`addMarker:${t.model}`,function(t){return(e,n,i)=>{if(!n.item)return;if(!(n.item instanceof Nf))return;const r=Le(t,n,i);if(!r)return;if(!i.consumable.test(n.item,e.name))return;const o=i.mapper.toViewElement(n.item);if(o&&o.getCustomProperty("addHighlight")){i.consumable.consume(n.item,e.name);for(const t of Bf._createIn(n.item))i.consumable.consume(t.item,e.name);o.getCustomProperty("addHighlight")(o,r,i.writer),i.mapper.bindElementToMarker(o,n.markerName)}}}(t.view),{priority:t.converterPriority||"normal"}),e.on(`removeMarker:${t.model}`,function(t){return(e,n,i)=>{if(n.markerRange.isCollapsed)return;const r=Le(t,n,i);if(!r)return;const o=Me(i.writer,r),s=i.mapper.markerNameToElements(n.markerName);if(s){for(const t of s)i.mapper.unbindElementFromMarkerName(t,n.markerName),t.is("attributeElement")?i.writer.unwrap(i.writer.createRangeOn(t),o):t.getCustomProperty("removeHighlight")(t,r.id,i.writer);i.writer.clearClonedElementsGroup(n.markerName),e.stop()}}}(t.view),{priority:t.converterPriority||"normal"})}}(t))}markerToData(t){return this.add(function(t){const e=(t=Kf(t)).model;let n=t.view;return n||(n=n=>({group:e,name:n.substr(t.model.length+1)})),i=>{var r;i.on(`addMarker:${e}`,(r=n,(t,e,n)=>{const i=r(e.markerName,n);if(!i)return;const o=e.markerRange;n.consumable.consume(o,t.name)&&(Ne(o,!1,n,e,i),Ne(o,!0,n,e,i),t.stop())}),{priority:t.converterPriority||"normal"}),i.on(`removeMarker:${e}`,function(t){return(e,n,i)=>{function r(t,e){if(e.hasAttribute(t)){const n=new Set(e.getAttribute(t).split(","));n.delete(o.name),0==n.size?i.writer.removeAttribute(t,e):i.writer.setAttribute(t,Array.from(n).join(","),e)}}const o=t(n.markerName,i);if(!o)return;const s=i.mapper.markerNameToElements(n.markerName);if(s){for(const t of s)i.mapper.unbindElementFromMarkerName(t,n.markerName),t.is("containerElement")?(r(`data-${o.group}-start-before`,t),r(`data-${o.group}-start-after`,t),r(`data-${o.group}-end-before`,t),r(`data-${o.group}-end-after`,t)):i.writer.clear(i.writer.createRangeOn(t),t);i.writer.clearClonedElementsGroup(n.markerName),e.stop()}}}(n),{priority:t.converterPriority||"normal"})}}(t))}}class Jf extends qf{elementToElement(t){return this.add(Ge(t))}elementToAttribute(t){return this.add(function(t){Qe(t=Kf(t));const e=Xe(t,!1),n=Je(t.view),i=n?`element:${n}`:"element";return n=>{n.on(i,e,{priority:t.converterPriority||"low"})}}(t))}attributeToAttribute(t){return this.add(function(t){let e=null;("string"==typeof(t=Kf(t)).view||t.view.key)&&(e=function(t){"string"==typeof t.view&&(t.view={key:t.view});const e=t.view.key;let n;return n="class"==e||"style"==e?{["class"==e?"classes":"styles"]:t.view.value}:{attributes:{[e]:void 0===t.view.value?/[\s\S]*/:t.view.value}},t.view.name&&(n.name=t.view.name),t.view=n,e}(t)),Qe(t,e);const n=Xe(t,!0);return e=>{e.on("element",n,{priority:t.converterPriority||"low"})}}(t))}elementToMarker(t){return this.add(function(t){const e=function(t){return(e,n)=>{const i="string"==typeof t?t:t(e,n);return n.writer.createElement("$marker",{"data-name":i})}}(t.model);return Ge({...t,model:e})}(t))}dataToMarker(t){return this.add(function(t){(t=Kf(t)).model||(t.model=e=>e?t.view+":"+e:t.view);const e={view:t.view,model:t.model},n=Ye(Ze(e,"start")),i=Ye(Ze(e,"end"));return r=>{r.on(`element:${t.view}-start`,n,{priority:t.converterPriority||"normal"}),r.on(`element:${t.view}-end`,i,{priority:t.converterPriority||"normal"});const o=$s.get("low"),s=$s.get("highest"),a=$s.get(t.converterPriority)/s;r.on("element",function(t){return(e,n,i)=>{function r(e,r){for(const o of r){const r=t.model(o,i),s=i.writer.createElement("$marker",{"data-name":r});i.writer.insert(s,e),n.modelCursor.isEqual(e)?n.modelCursor=n.modelCursor.getShiftedBy(1):n.modelCursor=n.modelCursor._getTransformedByInsertion(e,1),n.modelRange=n.modelRange._getTransformedByInsertion(e,1)[0]}}const o=`data-${t.view}`;(i.consumable.test(n.viewItem,{attributes:o+"-end-after"})||i.consumable.test(n.viewItem,{attributes:o+"-start-after"})||i.consumable.test(n.viewItem,{attributes:o+"-end-before"})||i.consumable.test(n.viewItem,{attributes:o+"-start-before"}))&&(n.modelRange||Object.assign(n,i.convertChildren(n.viewItem,n.modelCursor)),i.consumable.consume(n.viewItem,{attributes:o+"-end-after"})&&r(n.modelRange.end,n.viewItem.getAttribute(o+"-end-after").split(",")),i.consumable.consume(n.viewItem,{attributes:o+"-start-after"})&&r(n.modelRange.end,n.viewItem.getAttribute(o+"-start-after").split(",")),i.consumable.consume(n.viewItem,{attributes:o+"-end-before"})&&r(n.modelRange.start,n.viewItem.getAttribute(o+"-end-before").split(",")),i.consumable.consume(n.viewItem,{attributes:o+"-start-before"})&&r(n.modelRange.start,n.viewItem.getAttribute(o+"-start-before").split(",")))}}(e),{priority:o+a})}}(t))}}class Yf extends(y()){constructor(t,e){super(),this.model=t,this.view=new Sf(e),this.mapper=new Ff,this.downcastDispatcher=new zf({mapper:this.mapper,schema:t.schema});const n=this.model.document,i=n.selection,r=this.model.markers;this.listenTo(this.model,"_beforeChanges",(()=>{this.view._disableRendering(!0)}),{priority:"highest"}),this.listenTo(this.model,"_afterChanges",(()=>{this.view._disableRendering(!1)}),{priority:"lowest"}),this.listenTo(n,"change",(()=>{this.view.change((t=>{this.downcastDispatcher.convertChanges(n.differ,r,t),this.downcastDispatcher.convertSelection(i,r,t)}))}),{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(t,e){return(n,i)=>{const r=i.newSelection,o=[];for(const t of r.getRanges())o.push(e.toModelRange(t));const s=t.createSelection(o,{backward:r.isBackward});s.isEqual(t.document.selection)||t.change((t=>{t.setSelection(s)}))}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",((t,e,n)=>{if(!n.consumable.consume(e.item,t.name))return;const i=n.writer,r=n.mapper.toViewPosition(e.range.start),o=i.createText(e.item.data);i.insert(r,o)}),{priority:"lowest"}),this.downcastDispatcher.on("insert",((t,e,n)=>{n.convertAttributes(e.item),e.reconversion||!e.item.is("element")||e.item.isEmpty||n.convertChildren(e.item)}),{priority:"lowest"}),this.downcastDispatcher.on("remove",((t,e,n)=>{const i=n.mapper.toViewPosition(e.position),r=e.position.getShiftedBy(e.length),o=n.mapper.toViewPosition(r,{isPhantom:!0}),s=n.writer.createRange(i,o),a=n.writer.remove(s.getTrimmed());for(const t of n.writer.createRangeIn(a).getItems())n.mapper.unbindViewElement(t,{defer:!0})}),{priority:"low"}),this.downcastDispatcher.on("selection",((t,e,n)=>{const i=n.writer,r=i.document.selection
;for(const t of r.getRanges())t.isCollapsed&&t.end.parent.isAttached()&&n.writer.mergeAttributes(t.start);i.setSelection(null)}),{priority:"high"}),this.downcastDispatcher.on("selection",((t,e,n)=>{const i=e.selection;if(i.isCollapsed)return;if(!n.consumable.consume(i,"selection"))return;const r=[];for(const t of i.getRanges())r.push(n.mapper.toViewRange(t));n.writer.setSelection(r,{backward:i.isBackward})}),{priority:"low"}),this.downcastDispatcher.on("selection",((t,e,n)=>{const i=e.selection;if(!i.isCollapsed)return;if(!n.consumable.consume(i,"selection"))return;const r=n.writer,o=i.getFirstPosition(),s=n.mapper.toViewPosition(o),a=r.breakAttributes(s);r.setSelection(a)}),{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using((t=>{if("$graveyard"==t.rootName)return null;const e=new rd(this.view.document,t.name);return e.rootName=t.rootName,this.mapper.bindElements(t,e),e}))}destroy(){this.view.destroy(),this.stopListening()}reconvertMarker(t){const e="string"==typeof t?t:t.name,n=this.model.markers.get(e);if(!n)throw new qs("editingcontroller-reconvertmarker-marker-not-exist",this,{markerName:e});this.model.change((()=>{this.model.markers._refresh(n)}))}reconvertItem(t){this.model.change((()=>{this.model.document.differ._refreshItem(t)}))}}class Qf{constructor(){this._consumables=new Map}add(t,e){let n;t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!0):(this._consumables.has(t)?n=this._consumables.get(t):(n=new Zf(t),this._consumables.set(t,n)),n.add(e))}test(t,e){const n=this._consumables.get(t);return void 0===n?null:t.is("$text")||t.is("documentFragment")?n:n.test(e)}consume(t,e){return!!this.test(t,e)&&(t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!1):this._consumables.get(t).consume(e),!0)}revert(t,e){const n=this._consumables.get(t);void 0!==n&&(t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!0):n.revert(e))}static consumablesFromElement(t){const e={element:t,name:!0,attributes:[],classes:[],styles:[]},n=t.getAttributeKeys();for(const t of n)"style"!=t&&"class"!=t&&e.attributes.push(t);const i=t.getClassNames();for(const t of i)e.classes.push(t);const r=t.getStyleNames();for(const t of r)e.styles.push(t);return e}static createFrom(t,e){if(e||(e=new Qf),t.is("$text"))return e.add(t),e;t.is("element")&&e.add(t,Qf.consumablesFromElement(t)),t.is("documentFragment")&&e.add(t);for(const n of t.getChildren())e=Qf.createFrom(n,e);return e}}const Xf=["attributes","classes","styles"];class Zf{constructor(t){this.element=t,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(t){t.name&&(this._canConsumeName=!0);for(const e of Xf)e in t&&this._add(e,t[e])}test(t){if(t.name&&!this._canConsumeName)return this._canConsumeName;for(const e of Xf)if(e in t){const n=this._test(e,t[e]);if(!0!==n)return n}return!0}consume(t){t.name&&(this._canConsumeName=!1);for(const e of Xf)e in t&&this._consume(e,t[e])}revert(t){t.name&&(this._canConsumeName=!0);for(const e of Xf)e in t&&this._revert(e,t[e])}_add(t,e){const n=ba(e)?e:[e],i=this._consumables[t];for(const e of n){if("attributes"===t&&("class"===e||"style"===e))throw new qs("viewconsumable-invalid-attribute",this);if(i.set(e,!0),"styles"===t)for(const t of this.element.document.stylesProcessor.getRelatedStyles(e))i.set(t,!0)}}_test(t,e){const n=ba(e)?e:[e],i=this._consumables[t];for(const e of n)if("attributes"!==t||"class"!==e&&"style"!==e){const t=i.get(e);if(void 0===t)return null;if(!t)return!1}else{const t="class"==e?"classes":"styles",n=this._test(t,[...this._consumables[t].keys()]);if(!0!==n)return n}return!0}_consume(t,e){const n=ba(e)?e:[e],i=this._consumables[t];for(const e of n)if("attributes"!==t||"class"!==e&&"style"!==e){if(i.set(e,!1),"styles"==t)for(const t of this.element.document.stylesProcessor.getRelatedStyles(e))i.set(t,!1)}else{const t="class"==e?"classes":"styles";this._consume(t,[...this._consumables[t].keys()])}}_revert(t,e){const n=ba(e)?e:[e],i=this._consumables[t];for(const e of n)if("attributes"!==t||"class"!==e&&"style"!==e)!1===i.get(e)&&i.set(e,!0);else{const t="class"==e?"classes":"styles";this._revert(t,[...this._consumables[t].keys()])}}}class tm extends(y()){constructor(){super(),this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",((t,e)=>{e[0]=new em(e[0])}),{priority:"highest"}),this.on("checkChild",((t,e)=>{e[0]=new em(e[0]),e[1]=this.getDefinition(e[1])}),{priority:"highest"})}register(t,e){if(this._sourceDefinitions[t])throw new qs("schema-cannot-register-item-twice",this,{itemName:t});this._sourceDefinitions[t]=[Object.assign({},e)],this._clearCache()}extend(t,e){if(!this._sourceDefinitions[t])throw new qs("schema-cannot-extend-missing-item",this,{itemName:t});this._sourceDefinitions[t].push(Object.assign({},e)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(t){let e;return e="string"==typeof t?t:"is"in t&&(t.is("$text")||t.is("$textProxy"))?"$text":t.name,this.getDefinitions()[e]}isRegistered(t){return!!this.getDefinition(t)}isBlock(t){const e=this.getDefinition(t);return!(!e||!e.isBlock)}isLimit(t){const e=this.getDefinition(t);return!(!e||!e.isLimit&&!e.isObject)}isObject(t){const e=this.getDefinition(t);return!!e&&!!(e.isObject||e.isLimit&&e.isSelectable&&e.isContent)}isInline(t){const e=this.getDefinition(t);return!(!e||!e.isInline)}isSelectable(t){const e=this.getDefinition(t);return!(!e||!e.isSelectable&&!e.isObject)}isContent(t){const e=this.getDefinition(t);return!(!e||!e.isContent&&!e.isObject)}checkChild(t,e){return!!e&&this._checkContextMatch(e,t)}checkAttribute(t,e){const n=this.getDefinition(t.last);return!!n&&n.allowAttributes.includes(e)}checkMerge(t,e){if(t instanceof Df){const e=t.nodeBefore,n=t.nodeAfter;if(!(e instanceof Nf))throw new qs("schema-check-merge-no-element-before",this);if(!(n instanceof Nf))throw new qs("schema-check-merge-no-element-after",this);return this.checkMerge(e,n)}for(const n of e.getChildren())if(!this.checkChild(t,n))return!1;return!0}addChildCheck(t){this.on("checkChild",((e,[n,i])=>{if(!i)return;const r=t(n,i);"boolean"==typeof r&&(e.stop(),e.return=r)}),{priority:"high"})}addAttributeCheck(t){this.on("checkAttribute",((e,[n,i])=>{const r=t(n,i);"boolean"==typeof r&&(e.stop(),e.return=r)}),{priority:"high"})}setAttributeProperties(t,e){this._attributeProperties[t]=Object.assign(this.getAttributeProperties(t),e)}getAttributeProperties(t){return this._attributeProperties[t]||{}}getLimitElement(t){let e;for(e=t instanceof Df?t.parent:(t instanceof Bf?[t]:Array.from(t.getRanges())).reduce(((t,e)=>{const n=e.getCommonAncestor();return t?t.getCommonAncestor(n,{includeSelf:!0}):n}),null);!this.isLimit(e)&&e.parent;)e=e.parent;return e}checkAttributeInSelection(t,e){if(t.isCollapsed){const n=[...t.getFirstPosition().getAncestors(),new If("",t.getAttributes())];return this.checkAttribute(n,e)}{const n=t.getRanges();for(const t of n)for(const n of t)if(this.checkAttribute(n.item,e))return!0}return!1}*getValidRanges(t,e){t=function*(t){for(const e of t)yield*e.getMinimalFlatRanges()}(t);for(const n of t)yield*this._getValidRangesForRange(n,e)}getNearestSelectionRange(t,e="both"){if(this.checkChild(t,"$text"))return new Bf(t);let n,i;const r=t.getAncestors().reverse().find((t=>this.isLimit(t)))||t.root;"both"!=e&&"backward"!=e||(n=new Vf({boundaries:Bf._createIn(r),startPosition:t,direction:"backward"})),"both"!=e&&"forward"!=e||(i=new Vf({boundaries:Bf._createIn(r),startPosition:t}));for(const t of function*(t,e){let n=!1;for(;!n;){if(n=!0,t){const e=t.next();e.done||(n=!1,yield{walker:t,value:e.value})}if(e){const t=e.next();t.done||(n=!1,yield{walker:e,value:t.value})}}}(n,i)){const e=t.walker==n?"elementEnd":"elementStart",i=t.value;if(i.type==e&&this.isObject(i.item))return Bf._createOn(i.item);if(this.checkChild(i.nextPosition,"$text"))return new Bf(i.nextPosition)}return null}findAllowedParent(t,e){let n=t.parent;for(;n;){if(this.checkChild(n,e))return n;if(this.isLimit(n))return null;n=n.parent}return null}setAllowedAttributes(t,e,n){const i=n.model;for(const[r,o]of Object.entries(e))i.schema.checkAttribute(t,r)&&n.setAttribute(r,o,t)}removeDisallowedAttributes(t,e){for(const n of t)if(n.is("$text"))fn(this,n,e);else{const t=Bf._createIn(n).getPositions();for(const n of t)fn(this,n.nodeBefore||n.parent,e)}}getAttributesWithProperty(t,e,n){const i={};for(const[r,o]of t.getAttributes()){const t=this.getAttributeProperties(r);void 0!==t[e]&&(void 0!==n&&n!==t[e]||(i[r]=o))}return i}createContext(t){return new em(t)}_clearCache(){this._compiledDefinitions=null}_compile(){const t={},e=this._sourceDefinitions,n=Object.keys(e);for(const i of n)t[i]=tn(e[i],i);for(const e of n)en(t,e);for(const e of n)nn(t,e);for(const e of n)rn(t,e);for(const e of n)on(t,e),sn(t,e);for(const e of n)an(t,e),cn(t,e),ln(t,e);this._compiledDefinitions=t}_checkContextMatch(t,e,n=e.length-1){const i=e.getItem(n);if(t.allowIn.includes(i.name)){if(0==n)return!0;{const t=this.getDefinition(i);return this._checkContextMatch(t,e,n-1)}}return!1}*_getValidRangesForRange(t,e){let n=t.start,i=t.start;for(const r of t.getItems({shallow:!0}))r.is("element")&&(yield*this._getValidRangesForRange(Bf._createIn(r),e)),this.checkAttribute(r,e)||(n.isEqual(i)||(yield new Bf(n,i)),n=Df._createAfter(r)),i=Df._createAfter(r);n.isEqual(i)||(yield new Bf(n,i))}}class em{constructor(t){if(t instanceof em)return t;let e;e="string"==typeof t?[t]:Array.isArray(t)?t:t.getAncestors({includeSelf:!0}),this._items=e.map(dn)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(t){const e=new em([t]);return e._items=[...this._items,...e._items],e}getItem(t){return this._items[t]}*getNames(){yield*this._items.map((t=>t.name))}endsWith(t){return Array.from(this.getNames()).join(" ").endsWith(t)}startsWith(t){return Array.from(this.getNames()).join(" ").startsWith(t)}}class nm extends(d()){constructor(t){super(),this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this._emptyElementsToKeep=new Set,this.conversionApi={...t,consumable:null,writer:null,store:null,convertItem:(t,e)=>this._convertItem(t,e),convertChildren:(t,e)=>this._convertChildren(t,e),safeInsert:(t,e)=>this._safeInsert(t,e),updateConversionResult:(t,e)=>this._updateConversionResult(t,e),splitToAllowedParent:(t,e)=>this._splitToAllowedParent(t,e),getSplitParts:t=>this._getSplitParts(t),keepEmptyElement:t=>this._keepEmptyElement(t)}}convert(t,e,n=["$root"]){this.fire("viewCleanup",t),this._modelCursor=function(t,e){let n;for(const i of new em(t)){const t={};for(const e of i.getAttributeKeys())t[e]=i.getAttribute(e);const r=e.createElement(i.name,t);n&&e.insert(r,n),n=Df._createAt(r,0)}return n}(n,e),this.conversionApi.writer=e,this.conversionApi.consumable=Qf.createFrom(t),this.conversionApi.store={};const{modelRange:i}=this._convertItem(t,this._modelCursor),r=e.createDocumentFragment();if(i){this._removeEmptyElements();for(const t of Array.from(this._modelCursor.parent.getChildren()))e.append(t,r);r.markers=function(t,e){const n=new Set,i=new Map,r=Bf._createIn(t).getItems();for(const t of r)t.is("element","$marker")&&n.add(t);for(const t of n){const n=t.getAttribute("data-name"),r=e.createPositionBefore(t);i.has(n)?i.get(n).end=r.clone():i.set(n,new Bf(r.clone())),e.remove(t)}return i}(r,e)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this._emptyElementsToKeep.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,r}_convertItem(t,e){const n={viewItem:t,modelCursor:e,modelRange:null};if(t.is("element")?this.fire(`element:${t.name}`,n,this.conversionApi):t.is("$text")?this.fire("text",n,this.conversionApi):this.fire("documentFragment",n,this.conversionApi),n.modelRange&&!(n.modelRange instanceof Bf))throw new qs("view-conversion-dispatcher-incorrect-result",this);return{modelRange:n.modelRange,modelCursor:n.modelCursor}}_convertChildren(t,e){let n=e.is("position")?e:Df._createAt(e,0);const i=new Bf(n);for(const e of Array.from(t.getChildren())){const t=this._convertItem(e,n);t.modelRange instanceof Bf&&(i.end=t.modelRange.end,n=t.modelCursor)}return{modelRange:i,modelCursor:n}}_safeInsert(t,e){const n=this._splitToAllowedParent(t,e);return!!n&&(this.conversionApi.writer.insert(t,n.position),!0)}_updateConversionResult(t,e){const n=this._getSplitParts(t),i=this.conversionApi.writer;e.modelRange||(e.modelRange=i.createRange(i.createPositionBefore(t),i.createPositionAfter(n[n.length-1])));const r=this._cursorParents.get(t);e.modelCursor=r?i.createPositionAt(r,0):e.modelRange.end}_splitToAllowedParent(t,e){const{schema:n,writer:i}=this.conversionApi;let r=n.findAllowedParent(e,t);if(r){if(r===e.parent)return{position:e};this._modelCursor.parent.getAncestors().includes(r)&&(r=null)}if(!r)return qe(e,t,n)?{position:Ke(e,i)}:null;const o=this.conversionApi.writer.split(e,r),s=[];for(const t of o.range.getWalker())if("elementEnd"==t.type)s.push(t.item);else{const e=s.pop(),n=t.item;this._registerSplitPair(e,n)}const a=o.range.end.parent;return this._cursorParents.set(t,a),{position:o.position,cursorParent:a}}_registerSplitPair(t,e){this._splitParts.has(t)||this._splitParts.set(t,[t]);const n=this._splitParts.get(t);this._splitParts.set(e,n),n.push(e)}_getSplitParts(t){let e;return e=this._splitParts.has(t)?this._splitParts.get(t):[t],e}_keepEmptyElement(t){this._emptyElementsToKeep.add(t)}_removeEmptyElements(){let t=!1;for(const e of this._splitParts.keys())e.isEmpty&&!this._emptyElementsToKeep.has(e)&&(this.conversionApi.writer.remove(e),this._splitParts.delete(e),t=!0);t&&this._removeEmptyElements()}}class im{getHtml(t){const e=document.implementation.createHTMLDocument("").createElement("div");return e.appendChild(t),e.innerHTML}}class rm{constructor(t){this.skipComments=!0,this.domParser=new DOMParser,this.domConverter=new Md(t,{renderingMode:"data"}),this.htmlWriter=new im}toData(t){const e=this.domConverter.viewToDom(t);return this.htmlWriter.getHtml(e)}toView(t){const e=this._toDom(t);return this.domConverter.domToView(e,{skipComments:this.skipComments})}registerRawContentMatcher(t){this.domConverter.registerRawContentMatcher(t)}useFillerType(t){this.domConverter.blockFillerMode="marked"==t?"markedNbsp":"nbsp"}_toDom(t){t.match(/<(?:html|body|head|meta)(?:\s[^>]*)?>/i)||(t=`<body>${t}</body>`);const e=this.domParser.parseFromString(t,"text/html"),n=e.createDocumentFragment(),i=e.body.childNodes;for(;i.length>0;)n.appendChild(i[0]);return n}}class om extends(d()){constructor(t,e){super(),this.model=t,this.mapper=new Ff,this.downcastDispatcher=new zf({mapper:this.mapper,schema:t.schema}),this.downcastDispatcher.on("insert:$text",((t,e,n)=>{if(!n.consumable.consume(e.item,t.name))return;const i=n.writer,r=n.mapper.toViewPosition(e.range.start),o=i.createText(e.item.data);i.insert(r,o)}),{priority:"lowest"}),this.downcastDispatcher.on("insert",((t,e,n)=>{n.convertAttributes(e.item),e.reconversion||!e.item.is("element")||e.item.isEmpty||n.convertChildren(e.item)}),{priority:"lowest"}),this.upcastDispatcher=new nm({schema:t.schema}),this.viewDocument=new dd(e),this.stylesProcessor=e,this.htmlProcessor=new rm(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new vd(this.viewDocument),this.upcastDispatcher.on("text",((t,e,{schema:n,consumable:i,writer:r})=>{let o=e.modelCursor;if(!i.test(e.viewItem))return;if(!n.checkChild(o,"$text")){if(!qe(o,"$text",n))return;if(0==e.viewItem.data.trim().length)return;const t=o.nodeBefore;o=Ke(o,r),t&&t.is("element","$marker")&&(r.move(r.createRangeOn(t),o),o=r.createPositionAfter(t))}i.consume(e.viewItem);const s=r.createText(e.viewItem.data);r.insert(s,o),e.modelRange=r.createRange(o,o.getShiftedBy(s.offsetSize)),e.modelCursor=e.modelRange.end}),{priority:"lowest"}),this.upcastDispatcher.on("element",((t,e,n)=>{if(!e.modelRange&&n.consumable.consume(e.viewItem,{name:!0})){const{modelRange:t,modelCursor:i}=n.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t,e.modelCursor=i}}),{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",((t,e,n)=>{if(!e.modelRange&&n.consumable.consume(e.viewItem,{name:!0})){const{modelRange:t,modelCursor:i}=n.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t,e.modelCursor=i}}),{priority:"lowest"}),y().prototype.decorate.call(this,"init"),y().prototype.decorate.call(this,"set"),y().prototype.decorate.call(this,"get"),y().prototype.decorate.call(this,"toView"),y().prototype.decorate.call(this,"toModel"),this.on("init",(()=>{this.fire("ready")}),{priority:"lowest"}),this.on("ready",(()=>{this.model.enqueueChange({isUndoable:!1},$e)}),{priority:"lowest"})}get(t={}){const{rootName:e="main",trim:n="empty"}=t;if(!this._checkIfRootsExists([e]))throw new qs("datacontroller-get-non-existent-root",this);const i=this.model.document.getRoot(e);return"empty"!==n||this.model.hasContent(i,{ignoreWhitespaces:!0})?this.stringify(i,t):""}stringify(t,e={}){const n=this.toView(t,e);return this.processor.toData(n)}toView(t,e={}){const n=this.viewDocument,i=this._viewWriter;this.mapper.clearBindings();const r=Bf._createIn(t),o=new wd(n);this.mapper.bindElements(t,o);const s=t.is("documentFragment")?t.markers:function(t){const e=[],n=t.root.document;if(!n)return new Map;const i=Bf._createIn(t);for(const t of n.model.markers){const n=t.getRange(),r=n.isCollapsed,o=n.start.isEqual(i.start)||n.end.isEqual(i.end);if(r&&o)e.push([t.name,n]);else{const r=i.getIntersection(n);r&&e.push([t.name,r])}}return e.sort((([t,e],[n,i])=>{if("after"!==e.end.compareWith(i.start))return 1;if("before"!==e.start.compareWith(i.end))return-1;switch(e.start.compareWith(i.start)){case"before":return 1;case"after":return-1;default:switch(e.end.compareWith(i.end)){case"before":return 1;case"after":return-1;default:return n.localeCompare(t)}}})),new Map(e)}(t);return this.downcastDispatcher.convert(r,s,i,e),o}init(t){if(this.model.document.version)throw new qs("datacontroller-init-document-not-empty",this);let e={};if("string"==typeof t?e.main=t:e=t,!this._checkIfRootsExists(Object.keys(e)))throw new qs("datacontroller-init-non-existent-root",this);return this.model.enqueueChange({isUndoable:!1},(t=>{for(const n of Object.keys(e)){const i=this.model.document.getRoot(n);t.insert(this.parse(e[n],i),i,0)}})),Promise.resolve()}set(t,e={}){let n={};if("string"==typeof t?n.main=t:n=t,!this._checkIfRootsExists(Object.keys(n)))throw new qs("datacontroller-set-non-existent-root",this);this.model.enqueueChange(e.batchType||{},(t=>{t.setSelection(null),t.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const e of Object.keys(n)){const i=this.model.document.getRoot(e);t.remove(t.createRangeIn(i)),t.insert(this.parse(n[e],i),i,0)}}))}parse(t,e="$root"){const n=this.processor.toView(t);return this.toModel(n,e)}toModel(t,e="$root"){return this.model.change((n=>this.upcastDispatcher.convert(t,n,e)))}addStyleProcessorRules(t){t(this.stylesProcessor)}registerRawContentMatcher(t){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(t),this.htmlProcessor.registerRawContentMatcher(t)}destroy(){this.stopListening()}_checkIfRootsExists(t){for(const e of t)if(!this.model.document.getRootNames().includes(e))return!1;return!0}}class sm{constructor(t,e){this._helpers=new Map,this._downcast=mt(t),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=mt(e),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(t,e){const n=this._downcast.includes(e);if(!this._upcast.includes(e)&&!n)throw new qs("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:t,dispatchers:[e],isDowncast:n})}for(t){if(!this._helpers.has(t))throw new qs("conversion-for-unknown-group",this);return this._helpers.get(t)}elementToElement(t){this.for("downcast").elementToElement(t);for(const{model:e,view:n}of mn(t))this.for("upcast").elementToElement({model:e,view:n,converterPriority:t.converterPriority})}attributeToElement(t){this.for("downcast").attributeToElement(t);for(const{model:e,view:n}of mn(t))this.for("upcast").elementToAttribute({view:n,model:e,converterPriority:t.converterPriority})}attributeToAttribute(t){this.for("downcast").attributeToAttribute(t);for(const{model:e,view:n}of mn(t))this.for("upcast").attributeToAttribute({view:n,model:e})}_createConversionHelpers({name:t,dispatchers:e,isDowncast:n}){if(this._helpers.has(t))throw new qs("conversion-group-exists",this);const i=n?new Gf(e):new Jf(e);this._helpers.set(t,i)}}class am{constructor(t){this.baseVersion=t,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const t=Object.assign({},this);return t.__className=this.constructor.className,delete t.batch,delete t.isDocumentOperation,t}static get className(){return"Operation"}static fromJSON(t,e){return new this(t.baseVersion)}}class cm extends am{constructor(t,e,n,i){super(i),this.sourcePosition=t.clone(),this.sourcePosition.stickiness="toNext",this.howMany=e,this.targetPosition=n.clone(),this.targetPosition.stickiness="toNone"}get type(){return"$graveyard"==this.targetPosition.root.rootName?"remove":"$graveyard"==this.sourcePosition.root.rootName?"reinsert":"move"}clone(){return new cm(this.sourcePosition,this.howMany,this.targetPosition,this.baseVersion)}getMovedRangeStart(){return this.targetPosition._getTransformedByDeletion(this.sourcePosition,this.howMany)}getReversed(){const t=this.sourcePosition._getTransformedByInsertion(this.targetPosition,this.howMany);return new cm(this.getMovedRangeStart(),this.howMany,t,this.baseVersion+1)}_validate(){const t=this.sourcePosition.parent,e=this.targetPosition.parent,n=this.sourcePosition.offset,i=this.targetPosition.offset;if(n+this.howMany>t.maxOffset)throw new qs("move-operation-nodes-do-not-exist",this);if(t===e&&n<i&&i<n+this.howMany)throw new qs("move-operation-range-into-itself",this);if(this.sourcePosition.root==this.targetPosition.root&&"prefix"==E(this.sourcePosition.getParentPath(),this.targetPosition.getParentPath())){const t=this.sourcePosition.path.length-1;if(this.targetPosition.path[t]>=n&&this.targetPosition.path[t]<n+this.howMany)throw new qs("move-operation-node-into-itself",this)}}_execute(){vn(Bf._createFromPositionAndShift(this.sourcePosition,this.howMany),this.targetPosition)}toJSON(){const t=super.toJSON();return t.sourcePosition=this.sourcePosition.toJSON(),t.targetPosition=this.targetPosition.toJSON(),t}static get className(){return"MoveOperation"}static fromJSON(t,e){const n=Df.fromJSON(t.sourcePosition,e),i=Df.fromJSON(t.targetPosition,e);return new this(n,t.howMany,i,t.baseVersion)}}class lm extends am{constructor(t,e,n){super(n),this.position=t.clone(),this.position.stickiness="toNone",this.nodes=new Of(bn(e)),this.shouldReceiveAttributes=!1}get type(){return"insert"}get howMany(){return this.nodes.maxOffset}clone(){const t=new Of([...this.nodes].map((t=>t._clone(!0)))),e=new lm(this.position,t,this.baseVersion);return e.shouldReceiveAttributes=this.shouldReceiveAttributes,e}getReversed(){const t=this.position.root.document.graveyard,e=new Df(t,[0]);return new cm(this.position,this.nodes.maxOffset,e,this.baseVersion+1)}_validate(){const t=this.position.parent;if(!t||t.maxOffset<this.position.offset)throw new qs("insert-operation-position-invalid",this)}_execute(){const t=this.nodes;this.nodes=new Of([...t].map((t=>t._clone(!0)))),pn(this.position,t)}toJSON(){const t=super.toJSON();return t.position=this.position.toJSON(),t.nodes=this.nodes.toJSON(),t}static get className(){return"InsertOperation"}static fromJSON(t,e){const n=[];for(const e of t.nodes)e.name?n.push(Nf.fromJSON(e)):n.push(If.fromJSON(e));const i=new lm(Df.fromJSON(t.position,e),n,t.baseVersion);return i.shouldReceiveAttributes=t.shouldReceiveAttributes,i}}class um extends am{constructor(t,e,n,i,r,o){super(o),this.name=t,this.oldRange=e?e.clone():null,this.newRange=n?n.clone():null,this.affectsData=r,this._markers=i}get type(){return"marker"}clone(){return new um(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new um(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){this.newRange?this._markers._set(this.name,this.newRange,!0,this.affectsData):this._markers._remove(this.name)}toJSON(){const t=super.toJSON();return this.oldRange&&(t.oldRange=this.oldRange.toJSON()),this.newRange&&(t.newRange=this.newRange.toJSON()),delete t._markers,t}static get className(){return"MarkerOperation"}static fromJSON(t,e){return new um(t.name,t.oldRange?Bf.fromJSON(t.oldRange,e):null,t.newRange?Bf.fromJSON(t.newRange,e):null,e.model.markers,t.affectsData,t.baseVersion)}}var hm=function(t,e){return vf(t,e)};class dm extends am{constructor(t,e,n,i,r){super(r),this.range=t.clone(),this.key=e,this.oldValue=void 0===n?null:n,this.newValue=void 0===i?null:i}get type(){return null===this.oldValue?"addAttribute":null===this.newValue?"removeAttribute":"changeAttribute"}clone(){return new dm(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new dm(this.range,this.key,this.newValue,this.oldValue,this.baseVersion+1)}toJSON(){const t=super.toJSON();return t.range=this.range.toJSON(),t}_validate(){if(!this.range.isFlat)throw new qs("attribute-operation-range-not-flat",this);for(const t of this.range.getItems({shallow:!0})){if(null!==this.oldValue&&!hm(t.getAttribute(this.key),this.oldValue))throw new qs("attribute-operation-wrong-old-value",this,{item:t,key:this.key,value:this.oldValue});if(null===this.oldValue&&null!==this.newValue&&t.hasAttribute(this.key))throw new qs("attribute-operation-attribute-exists",this,{node:t,key:this.key})}}_execute(){hm(this.oldValue,this.newValue)||function(t,e,n){_n(t.start),_n(t.end);for(const i of t.getItems({shallow:!0})){const t=i.is("$textProxy")?i.textNode:i;null!==n?t._setAttribute(e,n):t._removeAttribute(e),yn(t.parent,t.index)}yn(t.end.parent,t.end.index)}(this.range,this.key,this.newValue)}static get className(){return"AttributeOperation"}static fromJSON(t,e){return new dm(Bf.fromJSON(t.range,e),t.key,t.oldValue,t.newValue,t.baseVersion)}}class fm extends am{get type(){return"noop"}clone(){return new fm(this.baseVersion)}getReversed(){return new fm(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}class mm extends am{constructor(t,e,n,i){super(i),this.position=t,this.position.stickiness="toNext",this.oldName=e,this.newName=n}get type(){return"rename"}clone(){return new mm(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new mm(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const t=this.position.nodeAfter;if(!(t instanceof Nf))throw new qs("rename-operation-wrong-position",this);if(t.name!==this.oldName)throw new qs("rename-operation-wrong-name",this)}_execute(){this.position.nodeAfter.name=this.newName}toJSON(){const t=super.toJSON();return t.position=this.position.toJSON(),t}static get className(){return"RenameOperation"}static fromJSON(t,e){return new mm(Df.fromJSON(t.position,e),t.oldName,t.newName,t.baseVersion)}}class gm extends am{constructor(t,e,n,i,r){super(r),this.root=t,this.key=e,this.oldValue=n,this.newValue=i}get type(){return null===this.oldValue?"addRootAttribute":null===this.newValue?"removeRootAttribute":"changeRootAttribute"}clone(){return new gm(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new gm(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new qs("rootattribute-operation-not-a-root",this,{root:this.root,key:this.key});if(null!==this.oldValue&&this.root.getAttribute(this.key)!==this.oldValue)throw new qs("rootattribute-operation-wrong-old-value",this,{root:this.root,key:this.key});if(null===this.oldValue&&null!==this.newValue&&this.root.hasAttribute(this.key))throw new qs("rootattribute-operation-attribute-exists",this,{root:this.root,key:this.key})}_execute(){null!==this.newValue?this.root._setAttribute(this.key,this.newValue):this.root._removeAttribute(this.key)}toJSON(){const t=super.toJSON();return t.root=this.root.toJSON(),t}static get className(){return"RootAttributeOperation"}static fromJSON(t,e){if(!e.getRoot(t.root))throw new qs("rootattribute-operation-fromjson-no-root",this,{rootName:t.root});return new gm(e.getRoot(t.root),t.key,t.oldValue,t.newValue,t.baseVersion)}}class pm extends am{constructor(t,e,n,i,r){super(r),this.sourcePosition=t.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=e,this.targetPosition=n.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=i.clone()}get type(){return"merge"}get deletionPosition(){return new Df(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const t=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Bf(this.sourcePosition,t)}clone(){return new pm(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const t=this.targetPosition._getTransformedByMergeOperation(this),e=this.sourcePosition.path.slice(0,-1),n=new Df(this.sourcePosition.root,e)._getTransformedByMergeOperation(this);return new wm(t,this.howMany,n,this.graveyardPosition,this.baseVersion+1)}_validate(){const t=this.sourcePosition.parent,e=this.targetPosition.parent;if(!t.parent)throw new qs("merge-operation-source-position-invalid",this);if(!e.parent)throw new qs("merge-operation-target-position-invalid",this);if(this.howMany!=t.maxOffset)throw new qs("merge-operation-how-many-invalid",this)}_execute(){const t=this.sourcePosition.parent;vn(Bf._createIn(t),this.targetPosition),vn(Bf._createOn(t),this.graveyardPosition)}toJSON(){const t=super.toJSON();return t.sourcePosition=t.sourcePosition.toJSON(),t.targetPosition=t.targetPosition.toJSON(),t.graveyardPosition=t.graveyardPosition.toJSON(),t}static get className(){return"MergeOperation"}static fromJSON(t,e){const n=Df.fromJSON(t.sourcePosition,e),i=Df.fromJSON(t.targetPosition,e),r=Df.fromJSON(t.graveyardPosition,e);return new this(n,t.howMany,i,r,t.baseVersion)}}class wm extends am{constructor(t,e,n,i,r){super(r),this.splitPosition=t.clone(),this.splitPosition.stickiness="toNext",this.howMany=e,this.insertionPosition=n,this.graveyardPosition=i?i.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const t=this.insertionPosition.path.slice();return t.push(0),new Df(this.insertionPosition.root,t)}get movedRange(){const t=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Bf(this.splitPosition,t)}clone(){return new wm(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const t=this.splitPosition.root.document.graveyard,e=new Df(t,[0]);return new pm(this.moveTargetPosition,this.howMany,this.splitPosition,e,this.baseVersion+1)}_validate(){const t=this.splitPosition.parent,e=this.splitPosition.offset;if(!t||t.maxOffset<e)throw new qs("split-operation-position-invalid",this);if(!t.parent)throw new qs("split-operation-split-in-root",this);if(this.howMany!=t.maxOffset-this.splitPosition.offset)throw new qs("split-operation-how-many-invalid",this);if(this.graveyardPosition&&!this.graveyardPosition.nodeAfter)throw new qs("split-operation-graveyard-position-invalid",this)}_execute(){const t=this.splitPosition.parent;if(this.graveyardPosition)vn(Bf._createFromPositionAndShift(this.graveyardPosition,1),this.insertionPosition);else{const e=t._clone();pn(this.insertionPosition,e)}vn(new Bf(Df._createAt(t,this.splitPosition.offset),Df._createAt(t,t.maxOffset)),this.moveTargetPosition)}toJSON(){const t=super.toJSON();return t.splitPosition=this.splitPosition.toJSON(),t.insertionPosition=this.insertionPosition.toJSON(),this.graveyardPosition&&(t.graveyardPosition=this.graveyardPosition.toJSON()),t}static get className(){return"SplitOperation"}static getInsertionPosition(t){const e=t.path.slice(0,-1);return e[e.length-1]++,new Df(t.root,e,"toPrevious")}static fromJSON(t,e){const n=Df.fromJSON(t.splitPosition,e),i=Df.fromJSON(t.insertionPosition,e),r=t.graveyardPosition?Df.fromJSON(t.graveyardPosition,e):null;return new this(n,t.howMany,i,r,t.baseVersion)}}const vm={};vm[dm.className]=dm,vm[lm.className]=lm,vm[um.className]=um,vm[cm.className]=cm,
vm[fm.className]=fm,vm[am.className]=am,vm[mm.className]=mm,vm[gm.className]=gm,vm[wm.className]=wm,vm[pm.className]=pm;const bm=new Map;class ym{constructor(t,e,n=!1){this.originalOperations=new Map,this._history=t.history,this._useRelations=e,this._forceWeakRemove=!!n,this._relations=new Map}setOriginalOperations(t,e=null){const n=e?this.originalOperations.get(e):null;for(const e of t)this.originalOperations.set(e,n||e)}updateRelation(t,e){if(t instanceof cm)e instanceof pm?t.targetPosition.isEqual(e.sourcePosition)||e.movedRange.containsPosition(t.targetPosition)?this._setRelation(t,e,"insertAtSource"):t.targetPosition.isEqual(e.deletionPosition)?this._setRelation(t,e,"insertBetween"):t.targetPosition.isAfter(e.sourcePosition)&&this._setRelation(t,e,"moveTargetAfter"):e instanceof cm&&(t.targetPosition.isEqual(e.sourcePosition)||t.targetPosition.isBefore(e.sourcePosition)?this._setRelation(t,e,"insertBefore"):this._setRelation(t,e,"insertAfter"));else if(t instanceof wm){if(e instanceof pm)t.splitPosition.isBefore(e.sourcePosition)&&this._setRelation(t,e,"splitBefore");else if(e instanceof cm)if(t.splitPosition.isEqual(e.sourcePosition)||t.splitPosition.isBefore(e.sourcePosition))this._setRelation(t,e,"splitBefore");else{const n=Bf._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.splitPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(t.splitPosition)){const i=n.end.offset-t.splitPosition.offset,r=t.splitPosition.offset-n.start.offset;this._setRelation(t,e,{howMany:i,offset:r})}}}else if(t instanceof pm)e instanceof pm?(t.targetPosition.isEqual(e.sourcePosition)||this._setRelation(t,e,"mergeTargetNotMoved"),t.sourcePosition.isEqual(e.targetPosition)&&this._setRelation(t,e,"mergeSourceNotMoved"),t.sourcePosition.isEqual(e.sourcePosition)&&this._setRelation(t,e,"mergeSameElement")):e instanceof wm&&t.sourcePosition.isEqual(e.splitPosition)&&this._setRelation(t,e,"splitAtSource");else if(t instanceof um){const n=t.newRange;if(!n)return;if(e instanceof cm){const i=Bf._createFromPositionAndShift(e.sourcePosition,e.howMany),r=i.containsPosition(n.start)||i.start.isEqual(n.start),o=i.containsPosition(n.end)||i.end.isEqual(n.end);!r&&!o||i.containsRange(n)||this._setRelation(t,e,{side:r?"left":"right",path:r?n.start.path.slice():n.end.path.slice()})}else if(e instanceof pm){const i=n.start.isEqual(e.targetPosition),r=n.start.isEqual(e.deletionPosition),o=n.end.isEqual(e.deletionPosition),s=n.end.isEqual(e.sourcePosition);(i||r||o||s)&&this._setRelation(t,e,{wasInLeftElement:i,wasStartBeforeMergedElement:r,wasEndBeforeMergedElement:o,wasInRightElement:s})}}}getContext(t,e,n){return{aIsStrong:n,aWasUndone:this._wasUndone(t),bWasUndone:this._wasUndone(e),abRelation:this._useRelations?this._getRelation(t,e):null,baRelation:this._useRelations?this._getRelation(e,t):null,forceWeakRemove:this._forceWeakRemove}}_wasUndone(t){const e=this.originalOperations.get(t);return e.wasUndone||this._history.isUndoneOperation(e)}_getRelation(t,e){const n=this.originalOperations.get(e),i=this._history.getUndoneOperation(n);if(!i)return null;const r=this.originalOperations.get(t),o=this._relations.get(r);return o&&o.get(i)||null}_setRelation(t,e,n){const i=this.originalOperations.get(t),r=this.originalOperations.get(e);let o=this._relations.get(i);o||(o=new Map,this._relations.set(i,o)),o.set(r,n)}}An(dm,dm,((t,e,n)=>{if(t.key===e.key&&t.range.start.hasSameParentAs(e.range.start)){const i=t.range.getDifference(e.range).map((e=>new dm(e,t.key,t.oldValue,t.newValue,0))),r=t.range.getIntersection(e.range);return r&&n.aIsStrong&&i.push(new dm(r,e.key,e.newValue,t.newValue,0)),0==i.length?[new fm(0)]:i}return[t]})),An(dm,lm,((t,e)=>{if(t.range.start.hasSameParentAs(e.position)&&t.range.containsPosition(e.position)){const n=t.range._getTransformedByInsertion(e.position,e.howMany,!e.shouldReceiveAttributes).map((e=>new dm(e,t.key,t.oldValue,t.newValue,t.baseVersion)));if(e.shouldReceiveAttributes){const i=Pn(e,t.key,t.oldValue);i&&n.unshift(i)}return n}return t.range=t.range._getTransformedByInsertion(e.position,e.howMany,!1)[0],[t]})),An(dm,pm,((t,e)=>{const n=[];t.range.start.hasSameParentAs(e.deletionPosition)&&(t.range.containsPosition(e.deletionPosition)||t.range.start.isEqual(e.deletionPosition))&&n.push(Bf._createFromPositionAndShift(e.graveyardPosition,1));const i=t.range._getTransformedByMergeOperation(e);return i.isCollapsed||n.push(i),n.map((e=>new dm(e,t.key,t.oldValue,t.newValue,t.baseVersion)))})),An(dm,cm,((t,e)=>{const n=function(t,e){const n=Bf._createFromPositionAndShift(e.sourcePosition,e.howMany);let i=null,r=[];n.containsRange(t,!0)?i=t:t.start.hasSameParentAs(n.start)?(r=t.getDifference(n),i=t.getIntersection(n)):r=[t];const o=[];for(let t of r){t=t._getTransformedByDeletion(e.sourcePosition,e.howMany);const n=e.getMovedRangeStart(),i=t.start.hasSameParentAs(n),r=t._getTransformedByInsertion(n,e.howMany,i);o.push(...r)}return i&&o.push(i._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany,!1)[0]),o}(t.range,e);return n.map((e=>new dm(e,t.key,t.oldValue,t.newValue,t.baseVersion)))})),An(dm,wm,((t,e)=>{if(t.range.end.isEqual(e.insertionPosition))return e.graveyardPosition||t.range.end.offset++,[t];if(t.range.start.hasSameParentAs(e.splitPosition)&&t.range.containsPosition(e.splitPosition)){const n=t.clone();return n.range=new Bf(e.moveTargetPosition.clone(),t.range.end._getCombined(e.splitPosition,e.moveTargetPosition)),t.range.end=e.splitPosition.clone(),t.range.end.stickiness="toPrevious",[t,n]}return t.range=t.range._getTransformedBySplitOperation(e),[t]})),An(lm,dm,((t,e)=>{const n=[t];if(t.shouldReceiveAttributes&&t.position.hasSameParentAs(e.range.start)&&e.range.containsPosition(t.position)){const i=Pn(t,e.key,e.newValue);i&&n.push(i)}return n})),An(lm,lm,((t,e,n)=>(t.position.isEqual(e.position)&&n.aIsStrong||(t.position=t.position._getTransformedByInsertOperation(e)),[t]))),An(lm,cm,((t,e)=>(t.position=t.position._getTransformedByMoveOperation(e),[t]))),An(lm,wm,((t,e)=>(t.position=t.position._getTransformedBySplitOperation(e),[t]))),An(lm,pm,((t,e)=>(t.position=t.position._getTransformedByMergeOperation(e),[t]))),An(um,lm,((t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedByInsertOperation(e)[0]),t.newRange&&(t.newRange=t.newRange._getTransformedByInsertOperation(e)[0]),[t]))),An(um,um,((t,e,n)=>{if(t.name==e.name){if(!n.aIsStrong)return[new fm(0)];t.oldRange=e.newRange?e.newRange.clone():null}return[t]})),An(um,pm,((t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedByMergeOperation(e)),t.newRange&&(t.newRange=t.newRange._getTransformedByMergeOperation(e)),[t]))),An(um,cm,((t,e,n)=>{if(t.oldRange&&(t.oldRange=Bf._createFromRanges(t.oldRange._getTransformedByMoveOperation(e))),t.newRange){if(n.abRelation){const i=Bf._createFromRanges(t.newRange._getTransformedByMoveOperation(e));if("left"==n.abRelation.side&&e.targetPosition.isEqual(t.newRange.start))return t.newRange.end=i.end,t.newRange.start.path=n.abRelation.path,[t];if("right"==n.abRelation.side&&e.targetPosition.isEqual(t.newRange.end))return t.newRange.start=i.start,t.newRange.end.path=n.abRelation.path,[t]}t.newRange=Bf._createFromRanges(t.newRange._getTransformedByMoveOperation(e))}return[t]})),An(um,wm,((t,e,n)=>{if(t.oldRange&&(t.oldRange=t.oldRange._getTransformedBySplitOperation(e)),t.newRange){if(n.abRelation){const i=t.newRange._getTransformedBySplitOperation(e);return t.newRange.start.isEqual(e.splitPosition)&&n.abRelation.wasStartBeforeMergedElement?t.newRange.start=Df._createAt(e.insertionPosition):t.newRange.start.isEqual(e.splitPosition)&&!n.abRelation.wasInLeftElement&&(t.newRange.start=Df._createAt(e.moveTargetPosition)),t.newRange.end.isEqual(e.splitPosition)&&n.abRelation.wasInRightElement?t.newRange.end=Df._createAt(e.moveTargetPosition):t.newRange.end.isEqual(e.splitPosition)&&n.abRelation.wasEndBeforeMergedElement?t.newRange.end=Df._createAt(e.insertionPosition):t.newRange.end=i.end,[t]}t.newRange=t.newRange._getTransformedBySplitOperation(e)}return[t]})),An(pm,lm,((t,e)=>(t.sourcePosition.hasSameParentAs(e.position)&&(t.howMany+=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByInsertOperation(e),t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e),[t]))),An(pm,pm,((t,e,n)=>{if(t.sourcePosition.isEqual(e.sourcePosition)&&t.targetPosition.isEqual(e.targetPosition)){if(n.bWasUndone){const n=e.graveyardPosition.path.slice();return n.push(0),t.sourcePosition=new Df(e.graveyardPosition.root,n),t.howMany=0,[t]}return[new fm(0)]}if(t.sourcePosition.isEqual(e.sourcePosition)&&!t.targetPosition.isEqual(e.targetPosition)&&!n.bWasUndone&&"splitAtSource"!=n.abRelation){const i="$graveyard"==t.targetPosition.root.rootName,r="$graveyard"==e.targetPosition.root.rootName,o=i&&!r;if(r&&!i||!o&&n.aIsStrong){const n=e.targetPosition._getTransformedByMergeOperation(e),i=t.targetPosition._getTransformedByMergeOperation(e);return[new cm(n,t.howMany,i,0)]}return[new fm(0)]}return t.sourcePosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByMergeOperation(e),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),t.graveyardPosition.isEqual(e.graveyardPosition)&&n.aIsStrong||(t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)),[t]})),An(pm,cm,((t,e,n)=>{const i=Bf._createFromPositionAndShift(e.sourcePosition,e.howMany);return"remove"==e.type&&!n.bWasUndone&&!n.forceWeakRemove&&t.deletionPosition.hasSameParentAs(e.sourcePosition)&&i.containsPosition(t.sourcePosition)?[new fm(0)]:(t.sourcePosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.sourcePosition.hasSameParentAs(e.sourcePosition)&&(t.howMany-=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByMoveOperation(e),t.targetPosition=t.targetPosition._getTransformedByMoveOperation(e),t.graveyardPosition.isEqual(e.targetPosition)||(t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)),[t])})),An(pm,wm,((t,e,n)=>{if(e.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByDeletion(e.graveyardPosition,1),t.deletionPosition.isEqual(e.graveyardPosition)&&(t.howMany=e.howMany)),t.targetPosition.isEqual(e.splitPosition)){const i=0!=e.howMany,r=e.graveyardPosition&&t.deletionPosition.isEqual(e.graveyardPosition);if(i||r||"mergeTargetNotMoved"==n.abRelation)return t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),[t]}if(t.sourcePosition.isEqual(e.splitPosition)){if("mergeSourceNotMoved"==n.abRelation)return t.howMany=0,t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t];if("mergeSameElement"==n.abRelation||t.sourcePosition.offset>0)return t.sourcePosition=e.moveTargetPosition.clone(),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]}return t.sourcePosition.hasSameParentAs(e.splitPosition)&&(t.howMany=e.splitPosition.offset),t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]})),An(cm,lm,((t,e)=>{const n=Bf._createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByInsertOperation(e,!1)[0];return t.sourcePosition=n.start,t.howMany=n.end.offset-n.start.offset,t.targetPosition.isEqual(e.position)||(t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e)),[t]})),An(cm,cm,((t,e,n)=>{const i=Bf._createFromPositionAndShift(t.sourcePosition,t.howMany),r=Bf._createFromPositionAndShift(e.sourcePosition,e.howMany);let o,s=n.aIsStrong,a=!n.aIsStrong;if("insertBefore"==n.abRelation||"insertAfter"==n.baRelation?a=!0:"insertAfter"!=n.abRelation&&"insertBefore"!=n.baRelation||(a=!1),o=t.targetPosition.isEqual(e.targetPosition)&&a?t.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany):t.targetPosition._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Rn(t,e)&&Rn(e,t))return[e.getReversed()];if(i.containsPosition(e.targetPosition)&&i.containsRange(r,!0))return i.start=i.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),i.end=i.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),On([i],o);if(r.containsPosition(t.targetPosition)&&r.containsRange(i,!0))return i.start=i.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),i.end=i.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),On([i],o);const c=E(t.sourcePosition.getParentPath(),e.sourcePosition.getParentPath());if("prefix"==c||"extension"==c)return i.start=i.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),i.end=i.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),On([i],o);"remove"!=t.type||"remove"==e.type||n.aWasUndone||n.forceWeakRemove?"remove"==t.type||"remove"!=e.type||n.bWasUndone||n.forceWeakRemove||(s=!1):s=!0;const l=[],u=i.getDifference(r);for(const t of u){t.start=t.start._getTransformedByDeletion(e.sourcePosition,e.howMany),t.end=t.end._getTransformedByDeletion(e.sourcePosition,e.howMany);const n="same"==E(t.start.getParentPath(),e.getMovedRangeStart().getParentPath()),i=t._getTransformedByInsertion(e.getMovedRangeStart(),e.howMany,n);l.push(...i)}const h=i.getIntersection(r);return null!==h&&s&&(h.start=h.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),h.end=h.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),0===l.length?l.push(h):1==l.length?r.start.isBefore(i.start)||r.start.isEqual(i.start)?l.unshift(h):l.push(h):l.splice(1,0,h)),0===l.length?[new fm(t.baseVersion)]:On(l,o)})),An(cm,wm,((t,e,n)=>{let i=t.targetPosition.clone();t.targetPosition.isEqual(e.insertionPosition)&&e.graveyardPosition&&"moveTargetAfter"!=n.abRelation||(i=t.targetPosition._getTransformedBySplitOperation(e));const r=Bf._createFromPositionAndShift(t.sourcePosition,t.howMany);if(r.end.isEqual(e.insertionPosition))return e.graveyardPosition||t.howMany++,t.targetPosition=i,[t];if(r.start.hasSameParentAs(e.splitPosition)&&r.containsPosition(e.splitPosition)){let t=new Bf(e.splitPosition,r.end);return t=t._getTransformedBySplitOperation(e),On([new Bf(r.start,e.splitPosition),t],i)}t.targetPosition.isEqual(e.splitPosition)&&"insertAtSource"==n.abRelation&&(i=e.moveTargetPosition),t.targetPosition.isEqual(e.insertionPosition)&&"insertBetween"==n.abRelation&&(i=t.targetPosition);const o=[r._getTransformedBySplitOperation(e)];if(e.graveyardPosition){const i=r.start.isEqual(e.graveyardPosition)||r.containsPosition(e.graveyardPosition);t.howMany>1&&i&&!n.aWasUndone&&o.push(Bf._createFromPositionAndShift(e.insertionPosition,1))}return On(o,i)})),An(cm,pm,((t,e,n)=>{const i=Bf._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.deletionPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(e.sourcePosition))if("remove"!=t.type||n.forceWeakRemove){if(1==t.howMany)return n.bWasUndone?(t.sourcePosition=e.graveyardPosition.clone(),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]):[new fm(0)]}else if(!n.aWasUndone){const n=[];let i=e.graveyardPosition.clone(),r=e.targetPosition._getTransformedByMergeOperation(e);t.howMany>1&&(n.push(new cm(t.sourcePosition,t.howMany-1,t.targetPosition,0)),i=i._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany-1),r=r._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany-1));const o=e.deletionPosition._getCombined(t.sourcePosition,t.targetPosition),s=new cm(i,1,o,0),a=s.getMovedRangeStart().path.slice();a.push(0);const c=new Df(s.targetPosition.root,a);r=r._getTransformedByMove(i,o,1);const l=new cm(r,e.howMany,c,0);return n.push(s),n.push(l),n}const r=Bf._createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByMergeOperation(e);return t.sourcePosition=r.start,t.howMany=r.end.offset-r.start.offset,t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]})),An(mm,lm,((t,e)=>(t.position=t.position._getTransformedByInsertOperation(e),[t]))),An(mm,pm,((t,e)=>t.position.isEqual(e.deletionPosition)?(t.position=e.graveyardPosition.clone(),t.position.stickiness="toNext",[t]):(t.position=t.position._getTransformedByMergeOperation(e),[t]))),An(mm,cm,((t,e)=>(t.position=t.position._getTransformedByMoveOperation(e),[t]))),An(mm,mm,((t,e,n)=>{if(t.position.isEqual(e.position)){if(!n.aIsStrong)return[new fm(0)];t.oldName=e.newName}return[t]})),An(mm,wm,((t,e)=>{if("same"==E(t.position.path,e.splitPosition.getParentPath())&&!e.graveyardPosition){const e=new mm(t.position.getShiftedBy(1),t.oldName,t.newName,0);return[t,e]}return t.position=t.position._getTransformedBySplitOperation(e),[t]})),An(gm,gm,((t,e,n)=>{if(t.root===e.root&&t.key===e.key){if(!n.aIsStrong||t.newValue===e.newValue)return[new fm(0)];t.oldValue=e.newValue}return[t]})),An(wm,lm,((t,e)=>(t.splitPosition.hasSameParentAs(e.position)&&t.splitPosition.offset<e.position.offset&&(t.howMany+=e.howMany),t.splitPosition=t.splitPosition._getTransformedByInsertOperation(e),t.insertionPosition=t.insertionPosition._getTransformedByInsertOperation(e),[t]))),An(wm,pm,((t,e,n)=>{if(!t.graveyardPosition&&!n.bWasUndone&&t.splitPosition.hasSameParentAs(e.sourcePosition)){const n=e.graveyardPosition.path.slice();n.push(0);const i=new Df(e.graveyardPosition.root,n),r=wm.getInsertionPosition(new Df(e.graveyardPosition.root,n)),o=new wm(i,0,r,null,0);return t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e),t.insertionPosition=wm.getInsertionPosition(t.splitPosition),t.graveyardPosition=o.insertionPosition.clone(),t.graveyardPosition.stickiness="toNext",[o,t]}return t.splitPosition.hasSameParentAs(e.deletionPosition)&&!t.splitPosition.isAfter(e.deletionPosition)&&t.howMany--,t.splitPosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e),t.insertionPosition=wm.getInsertionPosition(t.splitPosition),t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)),[t]})),An(wm,cm,((t,e,n)=>{const i=Bf._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.graveyardPosition){const r=i.start.isEqual(t.graveyardPosition)||i.containsPosition(t.graveyardPosition);if(!n.bWasUndone&&r){const n=t.splitPosition._getTransformedByMoveOperation(e),i=t.graveyardPosition._getTransformedByMoveOperation(e),r=i.path.slice();r.push(0);const o=new Df(i.root,r);return[new cm(n,t.howMany,o,0)]}t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)}const r=t.splitPosition.isEqual(e.targetPosition);if(r&&("insertAtSource"==n.baRelation||"splitBefore"==n.abRelation))return t.howMany+=e.howMany,t.splitPosition=t.splitPosition._getTransformedByDeletion(e.sourcePosition,e.howMany),t.insertionPosition=wm.getInsertionPosition(t.splitPosition),[t];if(r&&n.abRelation&&n.abRelation.howMany){const{howMany:e,offset:i}=n.abRelation;return t.howMany+=e,t.splitPosition=t.splitPosition.getShiftedBy(i),[t]}if(t.splitPosition.hasSameParentAs(e.sourcePosition)&&i.containsPosition(t.splitPosition)){const n=e.howMany-(t.splitPosition.offset-e.sourcePosition.offset);return t.howMany-=n,t.splitPosition.hasSameParentAs(e.targetPosition)&&t.splitPosition.offset<e.targetPosition.offset&&(t.howMany+=e.howMany),t.splitPosition=e.sourcePosition.clone(),t.insertionPosition=wm.getInsertionPosition(t.splitPosition),[t]}return e.sourcePosition.isEqual(e.targetPosition)||(t.splitPosition.hasSameParentAs(e.sourcePosition)&&t.splitPosition.offset<=e.sourcePosition.offset&&(t.howMany-=e.howMany),t.splitPosition.hasSameParentAs(e.targetPosition)&&t.splitPosition.offset<e.targetPosition.offset&&(t.howMany+=e.howMany)),t.splitPosition.stickiness="toNone",t.splitPosition=t.splitPosition._getTransformedByMoveOperation(e),t.splitPosition.stickiness="toNext",t.graveyardPosition?t.insertionPosition=t.insertionPosition._getTransformedByMoveOperation(e):t.insertionPosition=wm.getInsertionPosition(t.splitPosition),[t]})),An(wm,wm,((t,e,n)=>{if(t.splitPosition.isEqual(e.splitPosition)){if(!t.graveyardPosition&&!e.graveyardPosition)return[new fm(0)];if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition))return[new fm(0)];if("splitBefore"==n.abRelation)return t.howMany=0,t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e),[t]}if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition)){const i="$graveyard"==t.splitPosition.root.rootName,r="$graveyard"==e.splitPosition.root.rootName,o=i&&!r;if(r&&!i||!o&&n.aIsStrong){const n=[];return e.howMany&&n.push(new cm(e.moveTargetPosition,e.howMany,e.splitPosition,0)),t.howMany&&n.push(new cm(t.splitPosition,t.howMany,t.moveTargetPosition,0)),n}return[new fm(0)]}if(t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e)),t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==n.abRelation)return t.howMany++,[t];if(e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==n.baRelation){const n=e.insertionPosition.path.slice();n.push(0);const i=new Df(e.insertionPosition.root,n);return[t,new cm(t.insertionPosition,1,i,0)]}return t.splitPosition.hasSameParentAs(e.splitPosition)&&t.splitPosition.offset<e.splitPosition.offset&&(t.howMany-=e.howMany),t.splitPosition=t.splitPosition._getTransformedBySplitOperation(e),t.insertionPosition=wm.getInsertionPosition(t.splitPosition),[t]}));class _m extends(d(Df)){constructor(t,e,n="toNone"){if(super(t,e,n),!this.root.is("rootElement"))throw new qs("model-liveposition-root-not-rootelement",t);In.call(this)}detach(){this.stopListening()}toPosition(){return new Df(this.root,this.path.slice(),this.stickiness)}static fromPosition(t,e){return new this(t.root,t.path.slice(),e||t.stickiness)}}_m.prototype.is=function(t){return"livePosition"===t||"model:livePosition"===t||"position"==t||"model:position"===t};class km{constructor(t={}){"string"==typeof t&&(t="transparent"===t?{isUndoable:!1}:{},l("batch-constructor-deprecated-string-type"));const{isUndoable:e=!0,isLocal:n=!0,isUndo:i=!1,isTyping:r=!1}=t;this.operations=[],this.isUndoable=e,this.isLocal=n,this.isUndo=i,this.isTyping=r}get type(){return l("batch-type-deprecated"),"default"}get baseVersion(){for(const t of this.operations)if(null!==t.baseVersion)return t.baseVersion;return null}addOperation(t){return t.batch=this,this.operations.push(t),t}}class Am{constructor(t){this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null,this._refreshedItems=new Set,this._markerCollection=t}get isEmpty(){return 0==this._changesInElement.size&&0==this._changedMarkers.size}bufferOperation(t){const e=t;switch(e.type){case"insert":if(this._isInInsertedElement(e.position.parent))return;this._markInsert(e.position.parent,e.position.offset,e.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const t of e.range.getItems({shallow:!0}))this._isInInsertedElement(t.parent)||this._markAttribute(t);break;case"remove":case"move":case"reinsert":{if(e.sourcePosition.isEqual(e.targetPosition)||e.sourcePosition.getShiftedBy(e.howMany).isEqual(e.targetPosition))return;const t=this._isInInsertedElement(e.sourcePosition.parent),n=this._isInInsertedElement(e.targetPosition.parent);t||this._markRemove(e.sourcePosition.parent,e.sourcePosition.offset,e.howMany),n||this._markInsert(e.targetPosition.parent,e.getMovedRangeStart().offset,e.howMany);break}case"rename":{if(this._isInInsertedElement(e.position.parent))return;this._markRemove(e.position.parent,e.position.offset,1),this._markInsert(e.position.parent,e.position.offset,1);const t=Bf._createFromPositionAndShift(e.position,1);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getData();this.bufferMarkerChange(e.name,t,t)}break}case"split":{const t=e.splitPosition.parent;this._isInInsertedElement(t)||this._markRemove(t,e.splitPosition.offset,e.howMany),this._isInInsertedElement(e.insertionPosition.parent)||this._markInsert(e.insertionPosition.parent,e.insertionPosition.offset,1),e.graveyardPosition&&this._markRemove(e.graveyardPosition.parent,e.graveyardPosition.offset,1);break}case"merge":{const t=e.sourcePosition.parent;this._isInInsertedElement(t.parent)||this._markRemove(t.parent,t.startOffset,1);const n=e.graveyardPosition.parent;this._markInsert(n,e.graveyardPosition.offset,1);const i=e.targetPosition.parent;this._isInInsertedElement(i)||this._markInsert(i,e.targetPosition.offset,t.maxOffset);break}}this._cachedChanges=null}bufferMarkerChange(t,e,n){const i=this._changedMarkers.get(t);i?(i.newMarkerData=n,null==i.oldMarkerData.range&&null==n.range&&this._changedMarkers.delete(t)):this._changedMarkers.set(t,{newMarkerData:n,oldMarkerData:e})}getMarkersToRemove(){const t=[];for(const[e,n]of this._changedMarkers)null!=n.oldMarkerData.range&&t.push({name:e,range:n.oldMarkerData.range});return t}getMarkersToAdd(){const t=[];for(const[e,n]of this._changedMarkers)null!=n.newMarkerData.range&&t.push({name:e,range:n.newMarkerData.range});return t}getChangedMarkers(){return Array.from(this._changedMarkers).map((([t,e])=>({name:t,data:{oldRange:e.oldMarkerData.range,newRange:e.newMarkerData.range}})))}hasDataChanges(){if(this._changesInElement.size>0)return!0;for(const{newMarkerData:t,oldMarkerData:e}of this._changedMarkers.values()){if(t.affectsData!==e.affectsData)return!0;if(t.affectsData){const n=t.range&&!e.range,i=!t.range&&e.range,r=t.range&&e.range&&!t.range.isEqual(e.range);if(n||i||r)return!0}}return!1}getChanges(t={}){if(this._cachedChanges)return t.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let e=[];for(const t of this._changesInElement.keys()){const n=this._changesInElement.get(t).sort(((t,e)=>t.offset===e.offset?t.type!=e.type?"remove"==t.type?-1:1:0:t.offset<e.offset?-1:1)),i=this._elementSnapshots.get(t),r=Nn(t.getChildren()),o=Vn(i.length,n);let s=0,a=0;for(const n of o)if("i"===n)e.push(this._getInsertDiff(t,s,r[s])),s++;else if("r"===n)e.push(this._getRemoveDiff(t,s,i[a])),a++;else if("a"===n){const n=r[s].attributes,o=i[a].attributes;let c;if("$text"==r[s].name)c=new Bf(Df._createAt(t,s),Df._createAt(t,s+1));else{const e=t.offsetToIndex(s);c=new Bf(Df._createAt(t,s),Df._createAt(t.getChild(e),0))}e.push(...this._getAttributesDiff(c,o,n)),s++,a++}else s++,a++}e.sort(((t,e)=>t.position.root!=e.position.root?t.position.root.rootName<e.position.root.rootName?-1:1:t.position.isEqual(e.position)?t.changeCount-e.changeCount:t.position.isBefore(e.position)?-1:1));for(let t=1,n=0;t<e.length;t++){const i=e[n],r=e[t],o="remove"==i.type&&"remove"==r.type&&"$text"==i.name&&"$text"==r.name&&i.position.isEqual(r.position),s="insert"==i.type&&"insert"==r.type&&"$text"==i.name&&"$text"==r.name&&i.position.parent==r.position.parent&&i.position.offset+i.length==r.position.offset,a="attribute"==i.type&&"attribute"==r.type&&i.position.parent==r.position.parent&&i.range.isFlat&&r.range.isFlat&&i.position.offset+i.length==r.position.offset&&i.attributeKey==r.attributeKey&&i.attributeOldValue==r.attributeOldValue&&i.attributeNewValue==r.attributeNewValue;o||s||a?(i.length++,a&&(i.range.end=i.range.end.getShiftedBy(1)),e[t]=null):n=t}e=e.filter((t=>t));for(const t of e)delete t.changeCount,"attribute"==t.type&&(delete t.position,delete t.length);return this._changeCount=0,this._cachedChangesWithGraveyard=e,this._cachedChanges=e.filter(Dn),t.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice()}getRefreshedItems(){return new Set(this._refreshedItems)}reset(){this._changesInElement.clear(),this._elementSnapshots.clear(),this._changedMarkers.clear(),this._refreshedItems=new Set,this._cachedChanges=null}_refreshItem(t){if(this._isInInsertedElement(t.parent))return;this._markRemove(t.parent,t.startOffset,t.offsetSize),this._markInsert(t.parent,t.startOffset,t.offsetSize),this._refreshedItems.add(t);const e=Bf._createOn(t);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getData();this.bufferMarkerChange(t.name,e,e)}this._cachedChanges=null}_markInsert(t,e,n){const i={type:"insert",offset:e,howMany:n,count:this._changeCount++};this._markChange(t,i)}_markRemove(t,e,n){const i={type:"remove",offset:e,howMany:n,count:this._changeCount++};this._markChange(t,i),this._removeAllNestedChanges(t,e,n)}_markAttribute(t){const e={type:"attribute",offset:t.startOffset,howMany:t.offsetSize,count:this._changeCount++};this._markChange(t.parent,e)}_markChange(t,e){this._makeSnapshot(t);const n=this._getChangesForElement(t);this._handleChange(e,n),n.push(e);for(let t=0;t<n.length;t++)n[t].howMany<1&&(n.splice(t,1),t--)}_getChangesForElement(t){let e;return this._changesInElement.has(t)?e=this._changesInElement.get(t):(e=[],this._changesInElement.set(t,e)),e}_makeSnapshot(t){this._elementSnapshots.has(t)||this._elementSnapshots.set(t,Nn(t.getChildren()))}_handleChange(t,e){t.nodesToHandle=t.howMany;for(const n of e){const i=t.offset+t.howMany,r=n.offset+n.howMany;if("insert"==t.type&&("insert"==n.type&&(t.offset<=n.offset?n.offset+=t.howMany:t.offset<r&&(n.howMany+=t.nodesToHandle,t.nodesToHandle=0)),"remove"==n.type&&t.offset<n.offset&&(n.offset+=t.howMany),"attribute"==n.type))if(t.offset<=n.offset)n.offset+=t.howMany;else if(t.offset<r){const r=n.howMany;n.howMany=t.offset-n.offset,e.unshift({type:"attribute",offset:i,howMany:r-n.howMany,count:this._changeCount++})}if("remove"==t.type){if("insert"==n.type)if(i<=n.offset)n.offset-=t.howMany;else if(i<=r)if(t.offset<n.offset){const e=i-n.offset;n.offset=t.offset,n.howMany-=e,t.nodesToHandle-=e}else n.howMany-=t.nodesToHandle,t.nodesToHandle=0;else if(t.offset<=n.offset)t.nodesToHandle-=n.howMany,n.howMany=0;else if(t.offset<r){const e=r-t.offset;n.howMany-=e,t.nodesToHandle-=e}if("remove"==n.type&&(i<=n.offset?n.offset-=t.howMany:t.offset<n.offset&&(t.nodesToHandle+=n.howMany,n.howMany=0)),"attribute"==n.type)if(i<=n.offset)n.offset-=t.howMany;else if(t.offset<n.offset){const e=i-n.offset;n.offset=t.offset,n.howMany-=e}else if(t.offset<r)if(i<=r){const i=n.howMany;n.howMany=t.offset-n.offset;const r=i-n.howMany-t.nodesToHandle;e.unshift({type:"attribute",offset:t.offset,howMany:r,count:this._changeCount++})}else n.howMany-=r-t.offset}if("attribute"==t.type){if("insert"==n.type)if(t.offset<n.offset&&i>n.offset){if(i>r){const t={type:"attribute",offset:r,howMany:i-r,count:this._changeCount++};this._handleChange(t,e),e.push(t)}t.nodesToHandle=n.offset-t.offset,t.howMany=t.nodesToHandle}else t.offset>=n.offset&&t.offset<r&&(i>r?(t.nodesToHandle=i-r,t.offset=r):t.nodesToHandle=0);if("remove"==n.type&&t.offset<n.offset&&i>n.offset){const r={type:"attribute",offset:n.offset,howMany:i-n.offset,count:this._changeCount++};this._handleChange(r,e),e.push(r),t.nodesToHandle=n.offset-t.offset,t.howMany=t.nodesToHandle}"attribute"==n.type&&(t.offset>=n.offset&&i<=r?(t.nodesToHandle=0,t.howMany=0,t.offset=0):t.offset<=n.offset&&i>=r&&(n.howMany=0))}}t.howMany=t.nodesToHandle,delete t.nodesToHandle}_getInsertDiff(t,e,n){return{type:"insert",position:Df._createAt(t,e),name:n.name,attributes:new Map(n.attributes),length:1,changeCount:this._changeCount++}}_getRemoveDiff(t,e,n){return{type:"remove",position:Df._createAt(t,e),name:n.name,attributes:new Map(n.attributes),length:1,changeCount:this._changeCount++}}_getAttributesDiff(t,e,n){const i=[];n=new Map(n);for(const[r,o]of e){const e=n.has(r)?n.get(r):null;e!==o&&i.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:r,attributeOldValue:o,attributeNewValue:e,changeCount:this._changeCount++}),n.delete(r)}for(const[e,r]of n)i.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:e,attributeOldValue:null,attributeNewValue:r,changeCount:this._changeCount++});return i}_isInInsertedElement(t){const e=t.parent;if(!e)return!1;const n=this._changesInElement.get(e),i=t.startOffset;if(n)for(const t of n)if("insert"==t.type&&i>=t.offset&&i<t.offset+t.howMany)return!0;return this._isInInsertedElement(e)}_removeAllNestedChanges(t,e,n){const i=new Bf(Df._createAt(t,e),Df._createAt(t,e+n));for(const t of i.getItems({shallow:!0}))t.is("element")&&(this._elementSnapshots.delete(t),this._changesInElement.delete(t),this._removeAllNestedChanges(t,0,t.maxOffset))}}class xm{constructor(){this._operations=[],this._undoPairs=new Map,this._undoneOperations=new Set,this._baseVersionToOperationIndex=new Map,this._version=0,this._gaps=new Map}get version(){return this._version}set version(t){this._operations.length&&t>this._version+1&&this._gaps.set(this._version,t),this._version=t}get lastOperation(){return this._operations[this._operations.length-1]}addOperation(t){
if(t.baseVersion!==this.version)throw new qs("model-document-history-addoperation-incorrect-version",this,{operation:t,historyVersion:this.version});this._operations.push(t),this._version++,this._baseVersionToOperationIndex.set(t.baseVersion,this._operations.length-1)}getOperations(t,e=this.version){if(!this._operations.length)return[];const n=this._operations[0];void 0===t&&(t=n.baseVersion);let i=e-1;for(const[e,n]of this._gaps)t>e&&t<n&&(t=n),i>e&&i<n&&(i=e-1);if(i<n.baseVersion||t>this.lastOperation.baseVersion)return[];let r=this._baseVersionToOperationIndex.get(t);void 0===r&&(r=0);let o=this._baseVersionToOperationIndex.get(i);return void 0===o&&(o=this._operations.length-1),this._operations.slice(r,o+1)}getOperation(t){const e=this._baseVersionToOperationIndex.get(t);if(void 0!==e)return this._operations[e]}setOperationAsUndone(t,e){this._undoPairs.set(e,t),this._undoneOperations.add(t)}isUndoingOperation(t){return this._undoPairs.has(t)}isUndoneOperation(t){return this._undoneOperations.has(t)}getUndoneOperation(t){return this._undoPairs.get(t)}reset(){this._version=0,this._undoPairs=new Map,this._operations=[],this._undoneOperations=new Set,this._gaps=new Map,this._baseVersionToOperationIndex=new Map}}class Tm extends Nf{constructor(t,e,n="main"){super(e),this._document=t,this.rootName=n}get document(){return this._document}toJSON(){return this.rootName}}Tm.prototype.is=function(t,e){return e?e===this.name&&("rootElement"===t||"model:rootElement"===t||"element"===t||"model:element"===t):"rootElement"===t||"model:rootElement"===t||"element"===t||"model:element"===t||"node"===t||"model:node"===t};const Cm="$graveyard";class Em extends(d()){constructor(t){super(),this.model=t,this.history=new xm,this.selection=new Wf(this),this.roots=new Lu({idProperty:"rootName"}),this.differ=new Am(t.markers),this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root",Cm),this.listenTo(t,"applyOperation",((t,e)=>{const n=e[0];n.isDocumentOperation&&this.differ.bufferOperation(n)}),{priority:"high"}),this.listenTo(t,"applyOperation",((t,e)=>{const n=e[0];n.isDocumentOperation&&this.history.addOperation(n)}),{priority:"low"}),this.listenTo(this.selection,"change",(()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0})),this.listenTo(t.markers,"update",((t,e,n,i,r)=>{const o={...e.getData(),range:i};this.differ.bufferMarkerChange(e.name,r,o),null===n&&e.on("change",((t,n)=>{const i=e.getData();this.differ.bufferMarkerChange(e.name,{...i,range:n},i)}))}))}get version(){return this.history.version}set version(t){this.history.version=t}get graveyard(){return this.getRoot(Cm)}createRoot(t="$root",e="main"){if(this.roots.get(e))throw new qs("model-document-createroot-name-exists",this,{name:e});const n=new Tm(this,t,e);return this.roots.add(n),n}destroy(){this.selection.destroy(),this.stopListening()}getRoot(t="main"){return this.roots.get(t)}getRootNames(){return Array.from(this.roots,(t=>t.rootName)).filter((t=>t!=Cm))}registerPostFixer(t){this._postFixers.add(t)}toJSON(){const t=nh(this);return t.selection="[engine.model.DocumentSelection]",t.model="[engine.model.Model]",t}_handleChangeBlock(t){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(t),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",t.batch):this.fire("change",t.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const t of this.roots)if(t!==this.graveyard)return t;return this.graveyard}_getDefaultRange(){const t=this._getDefaultRoot(),e=this.model,n=e.schema,i=e.createPositionFromPath(t,[0]);return n.getNearestSelectionRange(i)||e.createRange(i)}_validateSelectionRange(t){return Bn(t.start)&&Bn(t.end)}_callPostFixers(t){let e=!1;do{for(const n of this._postFixers)if(this.selection.refresh(),e=n(t),e)break}while(e)}}class Sm extends(d()){constructor(){super(...arguments),this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(t){const e=t instanceof Pm?t.name:t;return this._markers.has(e)}get(t){return this._markers.get(t)||null}_set(t,e,n=!1,i=!1){const r=t instanceof Pm?t.name:t;if(r.includes(","))throw new qs("markercollection-incorrect-marker-name",this);const o=this._markers.get(r);if(o){const t=o.getData(),s=o.getRange();let a=!1;return s.isEqual(e)||(o._attachLiveRange(Hf.fromRange(e)),a=!0),n!=o.managedUsingOperations&&(o._managedUsingOperations=n,a=!0),"boolean"==typeof i&&i!=o.affectsData&&(o._affectsData=i,a=!0),a&&this.fire(`update:${r}`,o,s,e,t),o}const s=Hf.fromRange(e),a=new Pm(r,s,n,i);return this._markers.set(r,a),this.fire(`update:${r}`,a,null,e,{...a.getData(),range:null}),a}_remove(t){const e=t instanceof Pm?t.name:t,n=this._markers.get(e);return!!n&&(this._markers.delete(e),this.fire(`update:${e}`,n,n.getRange(),null,n.getData()),this._destroyMarker(n),!0)}_refresh(t){const e=t instanceof Pm?t.name:t,n=this._markers.get(e);if(!n)throw new qs("markercollection-refresh-marker-not-exists",this);const i=n.getRange();this.fire(`update:${e}`,n,i,i,n.getData())}*getMarkersAtPosition(t){for(const e of this)e.getRange().containsPosition(t)&&(yield e)}*getMarkersIntersectingRange(t){for(const e of this)null!==e.getRange().getIntersection(t)&&(yield e)}destroy(){for(const t of this._markers.values())this._destroyMarker(t);this._markers=null,this.stopListening()}*getMarkersGroup(t){for(const e of this._markers.values())e.name.startsWith(t+":")&&(yield e)}_destroyMarker(t){t.stopListening(),t._detachLiveRange()}}class Pm extends(d(Pf)){constructor(t,e,n,i){super(),this.name=t,this._liveRange=this._attachLiveRange(e),this._managedUsingOperations=n,this._affectsData=i}get managedUsingOperations(){if(!this._liveRange)throw new qs("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new qs("marker-destroyed",this);return this._affectsData}getData(){return{range:this.getRange(),affectsData:this.affectsData,managedUsingOperations:this.managedUsingOperations}}getStart(){if(!this._liveRange)throw new qs("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new qs("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new qs("marker-destroyed",this);return this._liveRange.toRange()}_attachLiveRange(t){return this._liveRange&&this._detachLiveRange(),t.delegate("change:range").to(this),t.delegate("change:content").to(this),this._liveRange=t,t}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}Pm.prototype.is=function(t){return"marker"===t||"model:marker"===t};class Rm extends am{constructor(t,e){super(null),this.sourcePosition=t.clone(),this.howMany=e}get type(){return"detach"}toJSON(){const t=super.toJSON();return t.sourcePosition=this.sourcePosition.toJSON(),t}_validate(){if(this.sourcePosition.root.document)throw new qs("detach-operation-on-document-node",this)}_execute(){wn(Bf._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class Om extends Pf{constructor(t){super(),this.markers=new Map,this._children=new Of,t&&this._insertChild(0,t)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get nextSibling(){return null}get previousSibling(){return null}get root(){return this}get parent(){return null}get document(){return null}getAncestors(){return[]}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}getPath(){return[]}getNodeByPath(t){let e=this;for(const n of t)e=e.getChild(e.offsetToIndex(n));return e}offsetToIndex(t){return this._children.offsetToIndex(t)}toJSON(){const t=[];for(const e of this._children)t.push(e.toJSON());return t}static fromJSON(t){const e=[];for(const n of t)n.name?e.push(Nf.fromJSON(n)):e.push(If.fromJSON(n));return new Om(e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const n=function(t){return"string"==typeof t?[new If(t)]:(S(t)||(t=[t]),Array.from(t).map((t=>"string"==typeof t?new If(t):t instanceof Mf?new If(t.data,t.getAttributes()):t)))}(e);for(const t of n)null!==t.parent&&t._remove(),t.parent=this;this._children._insertNodes(t,n)}_removeChildren(t,e=1){const n=this._children._removeNodes(t,e);for(const t of n)t.parent=null;return n}}Om.prototype.is=function(t){return"documentFragment"===t||"model:documentFragment"===t};class Im{constructor(t,e){this.model=t,this.batch=e}createText(t,e){return new If(t,e)}createElement(t,e){return new Nf(t,e)}createDocumentFragment(){return new Om}cloneElement(t,e=!0){return t._clone(e)}insert(t,e,n=0){if(this._assertWriterUsedCorrectly(),t instanceof If&&""==t.data)return;const i=Df._createAt(e,n);if(t.parent){if(Hn(t.root,i.root))return void this.move(Bf._createOn(t),i);if(t.root.document)throw new qs("model-writer-insert-forbidden-move",this);this.remove(t)}const r=i.root.document?i.root.document.version:null,o=new lm(i,t,r);if(t instanceof If&&(o.shouldReceiveAttributes=!0),this.batch.addOperation(o),this.model.applyOperation(o),t instanceof Om)for(const[e,n]of t.markers){const t=Df._createAt(n.root,0),r={range:new Bf(n.start._getCombined(t,i),n.end._getCombined(t,i)),usingOperation:!0,affectsData:!0};this.model.markers.has(e)?this.updateMarker(e,r):this.addMarker(e,r)}}insertText(t,e,n,i){e instanceof Om||e instanceof Nf||e instanceof Df?this.insert(this.createText(t),e,n):this.insert(this.createText(t,e),n,i)}insertElement(t,e,n,i){e instanceof Om||e instanceof Nf||e instanceof Df?this.insert(this.createElement(t),e,n):this.insert(this.createElement(t,e),n,i)}append(t,e){this.insert(t,e,"end")}appendText(t,e,n){e instanceof Om||e instanceof Nf?this.insert(this.createText(t),e,"end"):this.insert(this.createText(t,e),n,"end")}appendElement(t,e,n){e instanceof Om||e instanceof Nf?this.insert(this.createElement(t),e,"end"):this.insert(this.createElement(t,e),n,"end")}setAttribute(t,e,n){if(this._assertWriterUsedCorrectly(),n instanceof Bf){const i=n.getMinimalFlatRanges();for(const n of i)Fn(this,t,e,n)}else Ln(this,t,e,n)}setAttributes(t,e){for(const[n,i]of vt(t))this.setAttribute(n,i,e)}removeAttribute(t,e){if(this._assertWriterUsedCorrectly(),e instanceof Bf){const n=e.getMinimalFlatRanges();for(const e of n)Fn(this,t,null,e)}else Ln(this,t,null,e)}clearAttributes(t){this._assertWriterUsedCorrectly();const e=t=>{for(const e of t.getAttributeKeys())this.removeAttribute(e,t)};if(t instanceof Bf)for(const n of t.getItems())e(n);else e(t)}move(t,e,n){if(this._assertWriterUsedCorrectly(),!(t instanceof Bf))throw new qs("writer-move-invalid-range",this);if(!t.isFlat)throw new qs("writer-move-range-not-flat",this);const i=Df._createAt(e,n);if(i.isEqual(t.start))return;if(this._addOperationForAffectedMarkers("move",t),!Hn(t.root,i.root))throw new qs("writer-move-different-document",this);const r=t.root.document?t.root.document.version:null,o=new cm(t.start,t.end.offset-t.start.offset,i,r);this.batch.addOperation(o),this.model.applyOperation(o)}remove(t){this._assertWriterUsedCorrectly();const e=(t instanceof Bf?t:Bf._createOn(t)).getMinimalFlatRanges().reverse();for(const t of e)this._addOperationForAffectedMarkers("move",t),jn(t.start,t.end.offset-t.start.offset,this.batch,this.model)}merge(t){this._assertWriterUsedCorrectly();const e=t.nodeBefore,n=t.nodeAfter;if(this._addOperationForAffectedMarkers("merge",t),!(e instanceof Nf))throw new qs("writer-merge-no-element-before",this);if(!(n instanceof Nf))throw new qs("writer-merge-no-element-after",this);t.root.document?this._merge(t):this._mergeDetached(t)}createPositionFromPath(t,e,n){return this.model.createPositionFromPath(t,e,n)}createPositionAt(t,e){return this.model.createPositionAt(t,e)}createPositionAfter(t){return this.model.createPositionAfter(t)}createPositionBefore(t){return this.model.createPositionBefore(t)}createRange(t,e){return this.model.createRange(t,e)}createRangeIn(t){return this.model.createRangeIn(t)}createRangeOn(t){return this.model.createRangeOn(t)}createSelection(...t){return this.model.createSelection(...t)}_mergeDetached(t){const e=t.nodeBefore,n=t.nodeAfter;this.move(Bf._createIn(n),Df._createAt(e,"end")),this.remove(n)}_merge(t){const e=Df._createAt(t.nodeBefore,"end"),n=Df._createAt(t.nodeAfter,0),i=t.root.document.graveyard,r=new Df(i,[0]),o=t.root.document.version,s=new pm(n,t.nodeAfter.maxOffset,e,r,o);this.batch.addOperation(s),this.model.applyOperation(s)}rename(t,e){if(this._assertWriterUsedCorrectly(),!(t instanceof Nf))throw new qs("writer-rename-not-element-instance",this);const n=t.root.document?t.root.document.version:null,i=new mm(Df._createBefore(t),t.name,e,n);this.batch.addOperation(i),this.model.applyOperation(i)}split(t,e){this._assertWriterUsedCorrectly();let n,i,r=t.parent;if(!r.parent)throw new qs("writer-split-element-no-parent",this);if(e||(e=r.parent),!t.parent.getAncestors({includeSelf:!0}).includes(e))throw new qs("writer-split-invalid-limit-element",this);do{const e=r.root.document?r.root.document.version:null,o=r.maxOffset-t.offset,s=wm.getInsertionPosition(t),a=new wm(t,o,s,null,e);this.batch.addOperation(a),this.model.applyOperation(a),n||i||(n=r,i=t.parent.nextSibling),r=(t=this.createPositionAfter(t.parent)).parent}while(r!==e);return{position:t,range:new Bf(Df._createAt(n,"end"),Df._createAt(i,0))}}wrap(t,e){if(this._assertWriterUsedCorrectly(),!t.isFlat)throw new qs("writer-wrap-range-not-flat",this);const n=e instanceof Nf?e:new Nf(e);if(n.childCount>0)throw new qs("writer-wrap-element-not-empty",this);if(null!==n.parent)throw new qs("writer-wrap-element-attached",this);this.insert(n,t.start);const i=new Bf(t.start.getShiftedBy(1),t.end.getShiftedBy(1));this.move(i,Df._createAt(n,0))}unwrap(t){if(this._assertWriterUsedCorrectly(),null===t.parent)throw new qs("writer-unwrap-element-no-parent",this);this.move(Bf._createIn(t),this.createPositionAfter(t)),this.remove(t)}addMarker(t,e){if(this._assertWriterUsedCorrectly(),!e||"boolean"!=typeof e.usingOperation)throw new qs("writer-addmarker-no-usingoperation",this);const n=e.usingOperation,i=e.range,r=void 0!==e.affectsData&&e.affectsData;if(this.model.markers.has(t))throw new qs("writer-addmarker-marker-exists",this);if(!i)throw new qs("writer-addmarker-no-range",this);return n?(zn(this,t,null,i,r),this.model.markers.get(t)):this.model.markers._set(t,i,n,r)}updateMarker(t,e){this._assertWriterUsedCorrectly();const n="string"==typeof t?t:t.name,i=this.model.markers.get(n);if(!i)throw new qs("writer-updatemarker-marker-not-exists",this);if(!e)return l("writer-updatemarker-reconvert-using-editingcontroller",{markerName:n}),void this.model.markers._refresh(i);const r="boolean"==typeof e.usingOperation,o="boolean"==typeof e.affectsData,s=o?e.affectsData:i.affectsData;if(!r&&!e.range&&!o)throw new qs("writer-updatemarker-wrong-options",this);const a=i.getRange(),c=e.range?e.range:a;r&&e.usingOperation!==i.managedUsingOperations?e.usingOperation?zn(this,n,null,c,s):(zn(this,n,a,null,s),this.model.markers._set(n,c,void 0,s)):i.managedUsingOperations?zn(this,n,a,c,s):this.model.markers._set(n,c,void 0,s)}removeMarker(t){this._assertWriterUsedCorrectly();const e="string"==typeof t?t:t.name;if(!this.model.markers.has(e))throw new qs("writer-removemarker-no-marker",this);const n=this.model.markers.get(e);n.managedUsingOperations?zn(this,e,n.getRange(),null,n.affectsData):this.model.markers._remove(e)}setSelection(...t){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(...t)}setSelectionFocus(t,e){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(t,e)}setSelectionAttribute(t,e){if(this._assertWriterUsedCorrectly(),"string"==typeof t)this._setSelectionAttribute(t,e);else for(const[e,n]of vt(t))this._setSelectionAttribute(e,n)}removeSelectionAttribute(t){if(this._assertWriterUsedCorrectly(),"string"==typeof t)this._removeSelectionAttribute(t);else for(const e of t)this._removeSelectionAttribute(e)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(t){this.model.document.selection._restoreGravity(t)}_setSelectionAttribute(t,e){const n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){const i=Wf._getStoreAttributeKey(t);this.setAttribute(i,e,n.anchor.parent)}n._setAttribute(t,e)}_removeSelectionAttribute(t){const e=this.model.document.selection;if(e.isCollapsed&&e.anchor.parent.isEmpty){const n=Wf._getStoreAttributeKey(t);this.removeAttribute(n,e.anchor.parent)}e._removeAttribute(t)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new qs("writer-incorrect-use",this)}_addOperationForAffectedMarkers(t,e){for(const n of this.model.markers){if(!n.managedUsingOperations)continue;const i=n.getRange();let r=!1;if("move"===t){const t=e;r=t.containsPosition(i.start)||t.start.isEqual(i.start)||t.containsPosition(i.end)||t.end.isEqual(i.end)}else{const t=e,n=t.nodeBefore,o=t.nodeAfter,s=i.start.parent==n&&i.start.isAtEnd,a=i.end.parent==o&&0==i.end.offset,c=i.end.nodeAfter==o,l=i.start.nodeAfter==o;r=s||a||c||l}r&&this.updateMarker(n.name,{range:i})}}}class Mm{constructor(t,e,n){this._firstNode=null,this._lastNode=null,this._lastAutoParagraph=null,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null,this._nodeToSelect=null,this.model=t,this.writer=e,this.position=n,this.canMergeWith=new Set([this.position.parent]),this.schema=t.schema,this._documentFragment=e.createDocumentFragment(),this._documentFragmentPosition=e.createPositionAt(this._documentFragment,0)}handleNodes(t){for(const e of Array.from(t))this._handleNode(e);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesOf,this.writer),this._filterAttributesOf=[]}_updateLastNodeFromAutoParagraph(t){const e=this.writer.createPositionAfter(this._lastNode),n=this.writer.createPositionAfter(t);if(n.isAfter(e)){if(this._lastNode=t,this.position.parent!=t||!this.position.isAtEnd)throw new qs("insertcontent-invalid-insertion-position",this);this.position=n,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this._nodeToSelect?Bf._createOn(this._nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new Bf(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(t){if(this.schema.isObject(t))return void this._handleObject(t);let e=this._checkAndAutoParagraphToAllowedPosition(t);e||(e=this._checkAndSplitToAllowedPosition(t),e)?(this._appendToFragment(t),this._firstNode||(this._firstNode=t),this._lastNode=t):this._handleDisallowedNode(t)}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;const t=_m.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=t.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=t.toPosition(),t.detach()}_handleObject(t){this._checkAndSplitToAllowedPosition(t)?this._appendToFragment(t):this._tryAutoparagraphing(t)}_handleDisallowedNode(t){t.is("element")?this.handleNodes(t.getChildren()):this._tryAutoparagraphing(t)}_appendToFragment(t){if(!this.schema.checkChild(this.position,t))throw new qs("insertcontent-wrong-position",this,{node:t,position:this.position});this.writer.insert(t,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(t.offsetSize),this.schema.isObject(t)&&!this.schema.checkChild(this.position,"$text")?this._nodeToSelect=t:this._nodeToSelect=null,this._filterAttributesOf.push(t)}_setAffectedBoundaries(t){this._affectedStart||(this._affectedStart=_m.fromPosition(t,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(t)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=_m.fromPosition(t,"toNext"))}_mergeOnLeft(){const t=this._firstNode;if(!(t instanceof Nf))return;if(!this._canMergeLeft(t))return;const e=_m._createBefore(t);e.stickiness="toNext";const n=_m.fromPosition(this.position,"toNext");this._affectedStart.isEqual(e)&&(this._affectedStart.detach(),this._affectedStart=_m._createAt(e.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=e.nodeBefore,this._lastNode=e.nodeBefore),this.writer.merge(e),e.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=_m._createAt(e.nodeBefore,"end","toNext")),this.position=n.toPosition(),n.detach(),this._filterAttributesOf.push(this.position.parent),e.detach()}_mergeOnRight(){const t=this._lastNode;if(!(t instanceof Nf))return;if(!this._canMergeRight(t))return;const e=_m._createAfter(t);if(e.stickiness="toNext",!this.position.isEqual(e))throw new qs("insertcontent-invalid-insertion-position",this);this.position=Df._createAt(e.nodeBefore,"end");const n=_m.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(e)&&(this._affectedEnd.detach(),this._affectedEnd=_m._createAt(e.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=e.nodeBefore,this._lastNode=e.nodeBefore),this.writer.merge(e),e.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=_m._createAt(e.nodeBefore,0,"toPrevious")),this.position=n.toPosition(),n.detach(),this._filterAttributesOf.push(this.position.parent),e.detach()}_canMergeLeft(t){const e=t.previousSibling;return e instanceof Nf&&this.canMergeWith.has(e)&&this.model.schema.checkMerge(e,t)}_canMergeRight(t){const e=t.nextSibling;return e instanceof Nf&&this.canMergeWith.has(e)&&this.model.schema.checkMerge(t,e)}_tryAutoparagraphing(t){const e=this.writer.createElement("paragraph");this._getAllowedIn(this.position.parent,e)&&this.schema.checkChild(e,t)&&(e._appendChild(t),this._handleNode(e))}_checkAndAutoParagraphToAllowedPosition(t){if(this.schema.checkChild(this.position.parent,t))return!0;if(!this.schema.checkChild(this.position.parent,"paragraph")||!this.schema.checkChild("paragraph",t))return!1;this._insertPartialFragment();const e=this.writer.createElement("paragraph");return this.writer.insert(e,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=e,this.position=this.writer.createPositionAt(e,0),!0}_checkAndSplitToAllowedPosition(t){const e=this._getAllowedIn(this.position.parent,t);if(!e)return!1;for(e!=this.position.parent&&this._insertPartialFragment();e!=this.position.parent;)if(this.position.isAtStart){const t=this.position.parent;this.position=this.writer.createPositionBefore(t),t.isEmpty&&t.parent===e&&this.writer.remove(t)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const t=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=t,this.canMergeWith.add(this.position.nodeAfter)}return!0}_getAllowedIn(t,e){return this.schema.checkChild(t,e)?t:this.schema.isLimit(t)?null:this._getAllowedIn(t.parent,e)}}class Nm extends(y()){constructor(){super(),this.markers=new Sm,this.document=new Em(this),this.schema=new tm,this._pendingChanges=[],this._currentWriter=null,["insertContent","insertObject","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach((t=>this.decorate(t))),this.on("applyOperation",((t,e)=>{e[0]._validate()}),{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$container",{allowIn:["$root","$container"]}),this.schema.register("$block",{allowIn:["$root","$container"],isBlock:!0}),this.schema.register("$blockObject",{allowWhere:"$block",isBlock:!0,isObject:!0}),this.schema.register("$inlineObject",{allowWhere:"$text",allowAttributesOf:"$text",isInline:!0,isObject:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck(((t,e)=>{if("$marker"===e.name)return!0})),Un(this),this.document.registerPostFixer($e)}change(t){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new km,callback:t}),this._runPendingChanges()[0]):t(this._currentWriter)}catch(t){qs.rethrowUnexpectedError(t,this)}}enqueueChange(t,e){try{t?"function"==typeof t?(e=t,t=new km):t instanceof km||(t=new km(t)):t=new km,this._pendingChanges.push({batch:t,callback:e}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(t){qs.rethrowUnexpectedError(t,this)}}applyOperation(t){t._execute()}insertContent(t,e,n){return function(t,e,n,i){return t.change((r=>{let o;o=n?n instanceof jf||n instanceof Wf?n:r.createSelection(n,i):t.document.selection,o.isCollapsed||t.deleteContent(o,{doNotAutoparagraph:!0});const s=new Mm(t,r,o.anchor),a=[];let c;if(e.is("documentFragment")){if(e.markers.size){const t=[];for(const[n,i]of e.markers){const{start:e,end:r}=i,o=e.isEqual(r);t.push({position:e,name:n,isCollapsed:o},{position:r,name:n,isCollapsed:o})}t.sort((({position:t},{position:e})=>t.isBefore(e)?1:-1));for(const{position:n,name:i,isCollapsed:o}of t){let t=null,s=null;const c=n.parent===e&&n.isAtStart,l=n.parent===e&&n.isAtEnd;c||l?o&&(s=c?"start":"end"):(t=r.createElement("$marker"),r.insert(t,n)),a.push({name:i,element:t,collapsed:s})}}c=e.getChildren()}else c=[e];s.handleNodes(c);let l=s.getSelectionRange();if(e.is("documentFragment")&&a.length){const t=l?Hf.fromRange(l):null,e={};for(let t=a.length-1;t>=0;t--){const{name:n,element:i,collapsed:o}=a[t],c=!e[n];if(c&&(e[n]=[]),i){const t=r.createPositionAt(i,"before");e[n].push(t),r.remove(i)}else{const t=s.getAffectedRange();if(!t){o&&e[n].push(s.position);continue}o?e[n].push(t[o]):e[n].push(c?t.start:t.end)}}for(const[t,[n,i]]of Object.entries(e))n&&i&&n.root===i.root&&r.addMarker(t,{usingOperation:!0,affectsData:!0,range:new Bf(n,i)});t&&(l=t.toRange(),t.detach())}l&&(o instanceof Wf?r.setSelection(l):o.setTo(l));const u=s.getAffectedRange()||t.createRange(o.anchor);return s.destroy(),u}))}(this,t,e,n)}insertObject(t,e,n,i){return ei(this,t,e,n,i)}deleteContent(t,e){Kn(this,t,e)}modifySelection(t,e){!function(t,e,n={}){const i=t.schema,r="backward"!=n.direction,o=n.unit?n.unit:"character",s=!!n.treatEmojiAsSingleUnit,a=e.focus,c=new Vf({boundaries:ii(a,r),singleCharacters:!0,direction:r?"forward":"backward"}),l={walker:c,schema:i,isForward:r,unit:o,treatEmojiAsSingleUnit:s};let u;for(;u=c.next();){if(u.done)return;const n=ni(l,u.value);if(n)return void(e instanceof Wf?t.change((t=>{t.setSelectionFocus(n)})):e.setFocus(n))}}(this,t,e)}getSelectedContent(t){return function(t,e){return t.change((t=>{const n=t.createDocumentFragment(),i=e.getFirstRange();if(!i||i.isCollapsed)return n;const r=i.start.root,o=i.start.getCommonPath(i.end),s=r.getNodeByPath(o);let a;a=i.start.parent==i.end.parent?i:t.createRange(t.createPositionAt(s,i.start.path[o.length]),t.createPositionAt(s,i.end.path[o.length]+1));const c=a.end.offset-a.start.offset;for(const e of a.getItems({shallow:!0}))e.is("$textProxy")?t.appendText(e.data,e.getAttributes(),n):t.append(t.cloneElement(e,!0),n);if(a!=i){const e=i._getTransformedByMove(a.start,t.createPositionAt(n,0),c)[0],r=t.createRange(t.createPositionAt(n,0),e.start);Zn(t.createRange(e.end,t.createPositionAt(n,"end")),t),Zn(r,t)}return n}))}(this,t)}hasContent(t,e={}){const n=t instanceof Bf?t:Bf._createIn(t);if(n.isCollapsed)return!1;const{ignoreWhitespaces:i=!1,ignoreMarkers:r=!1}=e;if(!r)for(const t of this.markers.getMarkersIntersectingRange(n))if(t.affectsData)return!0;for(const t of n.getItems())if(this.schema.isContent(t)){if(!t.is("$textProxy"))return!0;if(!i)return!0;if(-1!==t.data.search(/\S/))return!0}return!1}createPositionFromPath(t,e,n){return new Df(t,e,n)}createPositionAt(t,e){return Df._createAt(t,e)}createPositionAfter(t){return Df._createAfter(t)}createPositionBefore(t){return Df._createBefore(t)}createRange(t,e){return new Bf(t,e)}createRangeIn(t){return Bf._createIn(t)}createRangeOn(t){return Bf._createOn(t)}createSelection(...t){return new jf(...t)}createBatch(t){return new km(t)}createOperationFromJSON(t){return class{static fromJSON(t,e){return vm[t.__className].fromJSON(t,e)}}.fromJSON(t,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const t=[];this.fire("_beforeChanges");try{for(;this._pendingChanges.length;){const e=this._pendingChanges[0].batch;this._currentWriter=new Im(this,e);const n=this._pendingChanges[0].callback(this._currentWriter);t.push(n),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}}finally{this._pendingChanges.length=0,this._currentWriter=null,this.fire("_afterChanges")}return t}}class Vm extends Bd{constructor(t){super(t),this.domEventType="click"}onDomEvent(t){this.fire(t.type,t)}}class Dm extends Bd{constructor(t){super(t),this.domEventType=["mousedown","mouseup","mouseover","mouseout"]}onDomEvent(t){this.fire(t.type,t)}}class Bm{constructor(t){this.document=t}createDocumentFragment(t){return new wd(this.document,t)}createElement(t,e,n){return new td(this.document,t,e,n)}createText(t){return new rh(this.document,t)}clone(t,e=!1){return t._clone(e)}appendChild(t,e){return e._appendChild(t)}insertChild(t,e,n){return n._insertChild(t,e)}removeChildren(t,e,n){return n._removeChildren(t,e)}remove(t){const e=t.parent;return e?this.removeChildren(e.getChildIndex(t),1,e):[]}replace(t,e){const n=t.parent;if(n){const i=n.getChildIndex(t);return this.removeChildren(i,1,n),this.insertChild(i,e,n),!0}return!1}unwrapElement(t){const e=t.parent;if(e){const n=e.getChildIndex(t);this.remove(t),this.insertChild(n,t.getChildren(),e)}}rename(t,e){const n=new td(this.document,t,e.getAttributes(),e.getChildren());return this.replace(e,n)?n:null}setAttribute(t,e,n){n._setAttribute(t,e)}removeAttribute(t,e){e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,n){Pa(t)&&void 0===n?e._setStyle(t):n._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,n){n._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}createPositionAt(t,e){return sd._createAt(t,e)}createPositionAfter(t){return sd._createAfter(t)}createPositionBefore(t){return sd._createBefore(t)}createRange(t,e){return new ad(t,e)}createRangeOn(t){return ad._createOn(t)}createRangeIn(t){return ad._createIn(t)}createSelection(...t){return new cd(...t)}}
new Set(["black","silver","gray","white","maroon","red","purple","fuchsia","green","lime","olive","yellow","navy","blue","teal","aqua","orange","aliceblue","antiquewhite","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","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","gainsboro","ghostwhite","gold","goldenrod","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","limegreen","linen","magenta","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","oldlace","olivedrab","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","thistle","tomato","turquoise","violet","wheat","whitesmoke","yellowgreen","activeborder","activecaption","appworkspace","background","buttonface","buttonhighlight","buttonshadow","buttontext","captiontext","graytext","highlight","highlighttext","inactiveborder","inactivecaption","inactivecaptiontext","infobackground","infotext","menu","menutext","scrollbar","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","window","windowframe","windowtext","rebeccapurple","currentcolor","transparent"]);class Fm{constructor(){this._commands=new Map}add(t,e){this._commands.set(t,e)}get(t){return this._commands.get(t)}execute(t,...e){const n=this.get(t);if(!n)throw new qs("commandcollection-command-not-found",this,{commandName:t});return n.execute(...e)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const t of this.commands())t.destroy()}}class Lm extends ju{constructor(t){super(),this.editor=t}set(t,e,n={}){if("string"==typeof e){const t=e;e=(e,n)=>{this.editor.execute(t),n()}}super.set(t,e,n)}}class zm extends(y()){constructor(t={}){super();const e=this.constructor,n=t.language||e.defaultConfig&&e.defaultConfig.language;this._context=t.context||new Ku({language:n}),this._context._addEditor(this,!t.context);const i=Array.from(e.builtinPlugins||[]);this.config=new xu(t,e.defaultConfig),this.config.define("plugins",i),this.config.define(this._context._getEditorConfig()),this.plugins=new qu(this,i,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new Fm,this.set("state","initializing"),this.once("ready",(()=>this.state="ready"),{priority:"high"}),this.once("destroy",(()=>this.state="destroyed"),{priority:"high"}),this.model=new Nm;const r=new Zh;this.data=new om(this.model,r),this.editing=new Yf(this.model,r),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new sm([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new Lm(this),this.keystrokes.listenTo(this.editing.view.document)}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(t){throw new qs("editor-isreadonly-has-no-setter")}enableReadOnlyMode(t){if("string"!=typeof t&&"symbol"!=typeof t)throw new qs("editor-read-only-lock-id-invalid",null,{lockId:t});this._readOnlyLocks.has(t)||(this._readOnlyLocks.add(t),1===this._readOnlyLocks.size&&this.fire("change:isReadOnly","isReadOnly",!0,!1))}disableReadOnlyMode(t){if("string"!=typeof t&&"symbol"!=typeof t)throw new qs("editor-read-only-lock-id-invalid",null,{lockId:t});this._readOnlyLocks.has(t)&&(this._readOnlyLocks.delete(t),0===this._readOnlyLocks.size&&this.fire("change:isReadOnly","isReadOnly",!1,!0))}initPlugins(){const t=this.config,e=t.get("plugins"),n=t.get("removePlugins")||[],i=t.get("extraPlugins")||[],r=t.get("substitutePlugins")||[];return this.plugins.init(e.concat(i),n,r)}destroy(){let t=Promise.resolve();return"initializing"==this.state&&(t=new Promise((t=>this.once("ready",t)))),t.then((()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()})).then((()=>this.plugins.destroy())).then((()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()})).then((()=>this._context._removeEditor(this)))}execute(t,...e){try{return this.commands.execute(t,...e)}catch(t){qs.rethrowUnexpectedError(t,this)}}focus(){this.editing.view.focus()}}{const t=li(Object);li.setData=t.prototype.setData,li.getData=t.prototype.getData}ui.updateSourceElement=ui(Object).prototype.updateSourceElement;class jm extends Gu{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new Lu({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(t){if("string"!=typeof t)throw new qs("pendingactions-add-invalid-message",this);const e=new(y());return e.set("message",t),this._actions.add(e),this.hasAny=!0,e}remove(t){this._actions.remove(t),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}var Hm='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.591 10.177 4.243 4.242a1 1 0 0 1-1.415 1.415l-4.242-4.243-4.243 4.243a1 1 0 0 1-1.414-1.415l4.243-4.242L4.52 5.934A1 1 0 0 1 5.934 4.52l4.243 4.243 4.242-4.243a1 1 0 1 1 1.415 1.414l-4.243 4.243z"/></svg>',Um='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.972 16.615a.997.997 0 0 1-.744-.292l-4.596-4.596a1 1 0 1 1 1.414-1.414l3.926 3.926 9.937-9.937a1 1 0 0 1 1.414 1.415L7.717 16.323a.997.997 0 0 1-.745.292z"/></svg>',Wm='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5.085 6.22 2.943 4.078a.75.75 0 1 1 1.06-1.06l2.592 2.59A11.094 11.094 0 0 1 10 5.068c4.738 0 8.578 3.101 8.578 5.083 0 1.197-1.401 2.803-3.555 3.887l1.714 1.713a.75.75 0 0 1-.09 1.138.488.488 0 0 1-.15.084.75.75 0 0 1-.821-.16L6.17 7.304c-.258.11-.51.233-.757.365l6.239 6.24-.006.005.78.78c-.388.094-.78.166-1.174.215l-1.11-1.11h.011L4.55 8.197a7.2 7.2 0 0 0-.665.514l-.112.098 4.897 4.897-.005.006 1.276 1.276a10.164 10.164 0 0 1-1.477-.117l-.479-.479-.009.009-4.863-4.863-.022.031a2.563 2.563 0 0 0-.124.2c-.043.077-.08.158-.108.241a.534.534 0 0 0-.028.133.29.29 0 0 0 .008.072.927.927 0 0 0 .082.226c.067.133.145.26.234.379l3.242 3.365.025.01.59.623c-3.265-.918-5.59-3.155-5.59-4.668 0-1.194 1.448-2.838 3.663-3.93zm7.07.531a4.632 4.632 0 0 1 1.108 5.992l.345.344.046-.018a9.313 9.313 0 0 0 2-1.112c.256-.187.5-.392.727-.613.137-.134.27-.277.392-.431.072-.091.141-.185.203-.286.057-.093.107-.19.148-.292a.72.72 0 0 0 .036-.12.29.29 0 0 0 .008-.072.492.492 0 0 0-.028-.133.999.999 0 0 0-.036-.096 2.165 2.165 0 0 0-.071-.145 2.917 2.917 0 0 0-.125-.2 3.592 3.592 0 0 0-.263-.335 5.444 5.444 0 0 0-.53-.523 7.955 7.955 0 0 0-1.054-.768 9.766 9.766 0 0 0-1.879-.891c-.337-.118-.68-.219-1.027-.301zm-2.85.21-.069.002a.508.508 0 0 0-.254.097.496.496 0 0 0-.104.679.498.498 0 0 0 .326.199l.045.005c.091.003.181.003.272.012a2.45 2.45 0 0 1 2.017 1.513c.024.061.043.125.069.185a.494.494 0 0 0 .45.287h.008a.496.496 0 0 0 .35-.158.482.482 0 0 0 .13-.335.638.638 0 0 0-.048-.219 3.379 3.379 0 0 0-.36-.723 3.438 3.438 0 0 0-2.791-1.543l-.028-.001h-.013z"/></svg>',$m='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z"/></svg>',qm='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M15.003 7v5.5a1 1 0 0 1-1 1H5.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H6.5V12h6.997V7.5z"/></svg>',Km='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M18.003 7v5.5a1 1 0 0 1-1 1H8.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H9.5V12h6.997V7.5z"/></svg>',Gm='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M18 7v5.5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1zm-1.505.5H3.504V12h12.991V7.5z"/></svg>';const Jm={bold:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.187 17H5.773c-.637 0-1.092-.138-1.364-.415-.273-.277-.409-.718-.409-1.323V4.738c0-.617.14-1.062.419-1.332.279-.27.73-.406 1.354-.406h4.68c.69 0 1.288.041 1.793.124.506.083.96.242 1.36.478.341.197.644.447.906.75a3.262 3.262 0 0 1 .808 2.162c0 1.401-.722 2.426-2.167 3.075C15.05 10.175 16 11.315 16 13.01a3.756 3.756 0 0 1-2.296 3.504 6.1 6.1 0 0 1-1.517.377c-.571.073-1.238.11-2 .11zm-.217-6.217H7v4.087h3.069c1.977 0 2.965-.69 2.965-2.072 0-.707-.256-1.22-.768-1.537-.512-.319-1.277-.478-2.296-.478zM7 5.13v3.619h2.606c.729 0 1.292-.067 1.69-.2a1.6 1.6 0 0 0 .91-.765c.165-.267.247-.566.247-.897 0-.707-.26-1.176-.778-1.409-.519-.232-1.31-.348-2.375-.348H7z"/></svg>',cancel:Hm,caption:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 16h9a1 1 0 0 1 0 2H2a1 1 0 0 1 0-2z"/><path d="M17 1a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h14zm0 1.5H3a.5.5 0 0 0-.492.41L2.5 3v9a.5.5 0 0 0 .41.492L3 12.5h14a.5.5 0 0 0 .492-.41L17.5 12V3a.5.5 0 0 0-.41-.492L17 2.5z" fill-opacity=".6"/></svg>',check:Um,cog:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.333 2 .19 2.263a5.899 5.899 0 0 1 1.458.604L14.714 3.4 16.6 5.286l-1.467 1.733c.263.452.468.942.605 1.46L18 8.666v2.666l-2.263.19a5.899 5.899 0 0 1-.604 1.458l1.467 1.733-1.886 1.886-1.733-1.467a5.899 5.899 0 0 1-1.46.605L11.334 18H8.667l-.19-2.263a5.899 5.899 0 0 1-1.458-.604L5.286 16.6 3.4 14.714l1.467-1.733a5.899 5.899 0 0 1-.604-1.458L2 11.333V8.667l2.262-.189a5.899 5.899 0 0 1 .605-1.459L3.4 5.286 5.286 3.4l1.733 1.467a5.899 5.899 0 0 1 1.46-.605L8.666 2h2.666zM10 6.267a3.733 3.733 0 1 0 0 7.466 3.733 3.733 0 0 0 0-7.466z"/></svg>',eraser:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m8.636 9.531-2.758 3.94a.5.5 0 0 0 .122.696l3.224 2.284h1.314l2.636-3.736L8.636 9.53zm.288 8.451L5.14 15.396a2 2 0 0 1-.491-2.786l6.673-9.53a2 2 0 0 1 2.785-.49l3.742 2.62a2 2 0 0 1 .491 2.785l-7.269 10.053-2.147-.066z"/><path d="M4 18h5.523v-1H4zm-2 0h1v-1H2z"/></svg>',image:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.91 10.54c.26-.23.64-.21.88.03l3.36 3.14 2.23-2.06a.64.64 0 0 1 .87 0l2.52 2.97V4.5H3.2v10.12l3.71-4.08zm10.27-7.51c.6 0 1.09.47 1.09 1.05v11.84c0 .59-.49 1.06-1.09 1.06H2.79c-.6 0-1.09-.47-1.09-1.06V4.08c0-.58.49-1.05 1.1-1.05h14.38zm-5.22 5.56a1.96 1.96 0 1 1 3.4-1.96 1.96 1.96 0 0 1-3.4 1.96z"/></svg>',lowVision:Wm,importExport:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#a)"><path clip-rule="evenodd" d="M19 4.5 14 0H3v12.673l.868-1.041c.185-.222.4-.402.632-.54V1.5h8v5h5v7.626a2.24 2.24 0 0 1 1.5.822V4.5ZM14 5V2l3.3 3H14Zm-3.692 12.5c.062.105.133.206.213.303L11.52 19H8v-.876a2.243 2.243 0 0 0 1.82-.624h.488Zm7.518-.657a.75.75 0 0 0-1.152-.96L15.5 17.29V12H14v5.29l-1.174-1.408a.75.75 0 0 0-1.152.96l2.346 2.816a.95.95 0 0 0 1.46 0l2.346-2.815Zm-15.056-.38a.75.75 0 0 1-.096-1.056l2.346-2.815a.95.95 0 0 1 1.46 0l2.346 2.815a.75.75 0 1 1-1.152.96L6.5 14.96V20H5v-5.04l-1.174 1.408a.75.75 0 0 1-1.056.096Z"/></g><defs><clipPath id="a"><path d="M0 0h20v20H0z"/></clipPath></defs></svg>',paragraph:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.5 5.5H7v5h3.5a2.5 2.5 0 1 0 0-5zM5 3h6.5v.025a5 5 0 0 1 0 9.95V13H7v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"/></svg>',plus:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10 2a1 1 0 0 0-1 1v6H3a1 1 0 1 0 0 2h6v6a1 1 0 1 0 2 0v-6h6a1 1 0 1 0 0-2h-6V3a1 1 0 0 0-1-1Z"/></svg>',text:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#a)"><path d="M9.816 11.5 7.038 4.785 4.261 11.5h5.555Zm.62 1.5H3.641l-1.666 4.028H.312l5.789-14h1.875l5.789 14h-1.663L10.436 13Z"/><path clip-rule="evenodd" d="m12.09 17-.534-1.292.848-1.971.545 1.319L12.113 17h-.023Zm1.142-5.187.545 1.319L15.5 9.13l1.858 4.316h-3.45l.398.965h3.467L18.887 17H20l-3.873-9h-1.254l-1.641 3.813Z"/></g><defs><clipPath id="a"><path d="M0 0h20v20H0z"/></clipPath></defs></svg>',alignBottom:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m9.239 13.938-2.88-1.663a.75.75 0 0 1 .75-1.3L9 12.067V4.75a.75.75 0 1 1 1.5 0v7.318l1.89-1.093a.75.75 0 0 1 .75 1.3l-2.879 1.663a.752.752 0 0 1-.511.187.752.752 0 0 1-.511-.187zM4.25 17a.75.75 0 1 1 0-1.5h10.5a.75.75 0 0 1 0 1.5H4.25z"/></svg>',alignMiddle:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9.75 11.875a.752.752 0 0 1 .508.184l2.883 1.666a.75.75 0 0 1-.659 1.344l-.091-.044-1.892-1.093.001 4.318a.75.75 0 1 1-1.5 0v-4.317l-1.89 1.092a.75.75 0 0 1-.75-1.3l2.879-1.663a.752.752 0 0 1 .51-.187zM15.25 9a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5h10.5zM9.75.375a.75.75 0 0 1 .75.75v4.318l1.89-1.093.092-.045a.75.75 0 0 1 .659 1.344l-2.883 1.667a.752.752 0 0 1-.508.184.752.752 0 0 1-.511-.187L6.359 5.65a.75.75 0 0 1 .75-1.299L9 5.442V1.125a.75.75 0 0 1 .75-.75z"/></svg>',alignTop:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m10.261 7.062 2.88 1.663a.75.75 0 0 1-.75 1.3L10.5 8.933v7.317a.75.75 0 1 1-1.5 0V8.932l-1.89 1.093a.75.75 0 0 1-.75-1.3l2.879-1.663a.752.752 0 0 1 .511-.187.752.752 0 0 1 .511.187zM15.25 4a.75.75 0 1 1 0 1.5H4.75a.75.75 0 0 1 0-1.5h10.5z"/></svg>',alignLeft:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z"/></svg>',alignCenter:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm2.286 4c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75z"/></svg>',alignRight:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M18 3.75a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 8a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 4a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75zm0-8a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75z"/></svg>',alignJustify:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z"/></svg>',objectLeft:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm11.5 9H18v1.5h-4.5zm0-3H18v1.5h-4.5zm0-3H18v1.5h-4.5zM2 15h16v1.5H2z"/><path d="M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z"/></svg>',objectCenter:qm,objectRight:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2zm0-9h5v1.5H2zm0 3h5v1.5H2zm0 3h5v1.5H2z"/><path d="M18.003 7v5.5a1 1 0 0 1-1 1H8.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H9.5V12h6.997V7.5z"/></svg>',objectFullWidth:Gm,objectInline:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm11.5 9H18v1.5h-4.5zM2 15h16v1.5H2z"/><path d="M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z"/></svg>',objectBlockLeft:$m,objectBlockRight:Km,objectSizeFull:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M18.095 2H1.905C.853 2 0 2.895 0 4v12c0 1.105.853 2 1.905 2h16.19C19.147 18 20 17.105 20 16V4c0-1.105-.853-2-1.905-2zm0 1.5c.263 0 .476.224.476.5v12c0 .276-.213.5-.476.5H1.905a.489.489 0 0 1-.476-.5V4c0-.276.213-.5.476-.5h16.19z"/></svg>',objectSizeLarge:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M13 6H2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5V8a.5.5 0 0 1 .5-.5h11z"/></svg>',objectSizeSmall:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M7 10H2a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5h5z"/></svg>',objectSizeMedium:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M10 8H2a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-6a.5.5 0 0 1 .5-.5h8z"/></svg>',pencil:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m7.3 17.37-.061.088a1.518 1.518 0 0 1-.934.535l-4.178.663-.806-4.153a1.495 1.495 0 0 1 .187-1.058l.056-.086L8.77 2.639c.958-1.351 2.803-1.076 4.296-.03 1.497 1.047 2.387 2.693 1.433 4.055L7.3 17.37zM9.14 4.728l-5.545 8.346 3.277 2.294 5.544-8.346L9.14 4.728zM6.07 16.512l-3.276-2.295.53 2.73 2.746-.435zM9.994 3.506 13.271 5.8c.316-.452-.16-1.333-1.065-1.966-.905-.634-1.895-.78-2.212-.328zM8 18.5 9.375 17H19v1.5H8z"/></svg>',pilcrow:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.999 2H15a1 1 0 0 1 0 2h-1.004v13a1 1 0 1 1-2 0V4H8.999v13a1 1 0 1 1-2 0v-7A4 4 0 0 1 3 6a4 4 0 0 1 3.999-4z"/></svg>',quote:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 10.423a6.5 6.5 0 0 1 6.056-6.408l.038.67C6.448 5.423 5.354 7.663 5.22 10H9c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574zm8 0a6.5 6.5 0 0 1 6.056-6.408l.038.67c-2.646.739-3.74 2.979-3.873 5.315H17c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574z"/></svg>',threeVerticalDots:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="9.5" cy="4.5" r="1.5"/><circle cx="9.5" cy="10.5" r="1.5"/><circle cx="9.5" cy="16.5" r="1.5"/></svg>'};class Ym extends Lu{constructor(t=[]){super(t,{idProperty:"viewUid"}),this.on("add",((t,e,n)=>{this._renderViewIntoCollectionParent(e,n)})),this.on("remove",((t,e)=>{e.element&&this._parentElement&&e.element.remove()})),this._parentElement=null}destroy(){this.map((t=>t.destroy()))}setParent(t){this._parentElement=t;for(const t of this)this._renderViewIntoCollectionParent(t)}delegate(...t){if(!t.length||!t.every((t=>"string"==typeof t)))throw new qs("ui-viewcollection-delegate-wrong-events",this);return{to:e=>{for(const n of this)for(const i of t)n.delegate(i).to(e);this.on("add",((n,i)=>{for(const n of t)i.delegate(n).to(e)})),this.on("remove",((n,i)=>{for(const n of t)i.stopDelegating(n,e)}))}}}_renderViewIntoCollectionParent(t,e){t.isRendered||t.render(),t.element&&this._parentElement&&this._parentElement.insertBefore(t.element,this._parentElement.children[e])}}var Qm=t(50331),Xm=t.n(Qm),Zm={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(Xm(),Zm),Xm().locals;class tg extends(B(y())){constructor(t){super(),this.element=null,this.isRendered=!1,this.locale=t,this.t=t&&t.t,this._viewCollections=new Lu,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",((e,n)=>{n.locale=t,n.t=t&&t.t})),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=eg.bind(this,this)}createCollection(t){const e=new Ym(t);return this._viewCollections.add(e),e}registerChild(t){S(t)||(t=[t]);for(const e of t)this._unboundChildren.add(e)}deregisterChild(t){S(t)||(t=[t]);for(const e of t)this._unboundChildren.remove(e)}setTemplate(t){this.template=new eg(t)}extendTemplate(t){eg.extend(this.template,t)}render(){if(this.isRendered)throw new qs("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map((t=>t.destroy())),this.template&&this.template._revertData&&this.template.revert(this.element)}}class eg extends(d()){constructor(t){super(),Object.assign(this,_i(yi(t))),this._isRendered=!1,this._revertData=null}render(){const t=this._renderNode({intoFragment:!0});return this._isRendered=!0,t}apply(t){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:t,intoFragment:!1,isApplying:!0,revertData:this._revertData}),t}revert(t){if(!this._revertData)throw new qs("ui-template-revert-not-applied",[this,t]);this._revertTemplateFromNode(t,this._revertData)}*getViews(){yield*function*t(e){if(e.children)for(const n of e.children)Ei(n)?yield n:Si(n)&&(yield*t(n))}(this)}static bind(t,e){return{to:(n,i)=>new ig({eventNameOrFunction:n,attribute:n,observable:t,emitter:e,callback:i}),if:(n,i,r)=>new rg({observable:t,emitter:e,attribute:n,valueIfTrue:i,callback:r})}}static extend(t,e){if(t._isRendered)throw new qs("template-extend-render",[this,t]);Ti(t,_i(yi(e)))}_renderNode(t){let e;if(e=t.node?this.tag&&this.text:this.tag?this.text:!this.text,e)throw new qs("ui-template-wrong-syntax",this);return this.text?this._renderText(t):this._renderElement(t)}_renderElement(t){let e=t.node;return e||(e=t.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(t),this._renderElementChildren(t),this._setUpListeners(t),e}_renderText(t){let e=t.node;return e?t.revertData.text=e.textContent:e=t.node=document.createTextNode(""),gi(this.text)?this._bindToObservable({schema:this.text,updater:wi(e),data:t}):e.textContent=this.text.join(""),e}_renderAttributes(t){if(!this.attributes)return;const e=t.node,n=t.revertData;for(const i in this.attributes){const r=e.getAttribute(i),o=this.attributes[i];n&&(n.attributes[i]=r);const s=Ri(o)?o[0].ns:null;if(gi(o)){const a=Ri(o)?o[0].value:o;n&&Oi(i)&&a.unshift(r),this._bindToObservable({schema:a,updater:vi(e,i,s),data:t})}else if("style"==i&&"string"!=typeof o[0])this._renderStyleAttribute(o[0],t);else{n&&r&&Oi(i)&&o.unshift(r);const t=o.map((t=>t&&t.value||t)).reduce(((t,e)=>t.concat(e)),[]).reduce(Ai,"");Ci(t)||e.setAttributeNS(s,i,t)}}}_renderStyleAttribute(t,e){const n=e.node;for(const i in t){const r=t[i];gi(r)?this._bindToObservable({schema:[r],updater:bi(n,i),data:e}):n.style[i]=r}}_renderElementChildren(t){const e=t.node,n=t.intoFragment?document.createDocumentFragment():e,i=t.isApplying;let r=0;for(const o of this.children)if(Pi(o)){if(!i){o.setParent(e);for(const t of o)n.appendChild(t.element)}}else if(Ei(o))i||(o.isRendered||o.render(),n.appendChild(o.element));else if(V(o))n.appendChild(o);else if(i){const e={children:[],bindings:[],attributes:{}};t.revertData.children.push(e),o._renderNode({intoFragment:!1,node:n.childNodes[r++],isApplying:!0,revertData:e})}else n.appendChild(o.render());t.intoFragment&&e.appendChild(n)}_setUpListeners(t){if(this.eventListeners)for(const e in this.eventListeners){const n=this.eventListeners[e].map((n=>{const[i,r]=e.split("@");return n.activateDomEventListener(i,r,t)}));t.revertData&&t.revertData.bindings.push(n)}}_bindToObservable({schema:t,updater:e,data:n}){const i=n.revertData;pi(t,e,n);const r=t.filter((t=>!Ci(t))).filter((t=>t.observable)).map((i=>i.activateAttributeListener(t,e,n)));i&&i.bindings.push(r)}_revertTemplateFromNode(t,e){for(const t of e.bindings)for(const e of t)e();if(e.text)return void(t.textContent=e.text);const n=t;for(const t in e.attributes){const i=e.attributes[t];null===i?n.removeAttribute(t):n.setAttribute(t,i)}for(let t=0;t<e.children.length;++t)this._revertTemplateFromNode(n.childNodes[t],e.children[t])}}class ng{constructor(t){this.attribute=t.attribute,this.observable=t.observable,this.emitter=t.emitter,this.callback=t.callback}getValue(t){const e=this.observable[this.attribute];return this.callback?this.callback(e,t):e}activateAttributeListener(t,e,n){const i=()=>pi(t,e,n);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,i),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,i)}}}class ig extends ng{constructor(t){super(t),this.eventNameOrFunction=t.eventNameOrFunction}activateDomEventListener(t,e,n){const i=(t,n)=>{e&&!n.target.matches(e)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(n):this.observable.fire(this.eventNameOrFunction,n))};return this.emitter.listenTo(n.node,t,i),()=>{this.emitter.stopListening(n.node,t,i)}}}class rg extends ng{constructor(t){super(t),this.valueIfTrue=t.valueIfTrue}getValue(t){return!Ci(super.getValue(t))&&(this.valueIfTrue||!0)}}class og extends Ym{constructor(t,e=[]){super(e),this.locale=t}attachToDom(){this._bodyCollectionContainer=new eg({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();let t=document.querySelector(".ck-body-wrapper");t||(t=function(t,e,n={},i=[]){const r=n&&n.xmlns,o=r?t.createElementNS(r,e):t.createElement(e);for(const t in n)o.setAttribute(t,n[t]);!_a(i)&&S(i)||(i=[i]);for(let e of i)_a(e)&&(e=t.createTextNode(e)),o.appendChild(e);return o}(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(t)),t.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const t=document.querySelector(".ck-body-wrapper");t&&0==t.childElementCount&&t.remove()}}var sg=t(99780),ag=t.n(sg),cg={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(ag(),cg),ag().locals;class lg extends tg{constructor(){super();const t=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.set("isColorInherited",!0),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon","ck-reset_all-excluded",t.if("isColorInherited","ck-icon_inherit-color")],viewBox:t.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",(()=>{this._updateXMLContent(),this._colorFillPaths()})),this.on("change:fillColor",(()=>{this._colorFillPaths()}))}_updateXMLContent(){if(this.content){const t=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),e=t.getAttribute("viewBox");e&&(this.viewBox=e);for(const{name:e,value:n}of Array.from(t.attributes))lg.presentationalAttributeNames.includes(e)&&this.element.setAttribute(e,n);for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(;t.childNodes.length>0;)this.element.appendChild(t.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach((t=>{t.style.fill=this.fillColor}))}}lg.presentationalAttributeNames=["alignment-baseline","baseline-shift","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-rendering","cursor","direction","display","dominant-baseline","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","mask","opacity","overflow","paint-order","pointer-events","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-overflow","text-rendering","transform","unicode-bidi","vector-effect","visibility","white-space","word-spacing","writing-mode"];var ug=t(6166),hg=t.n(ug),dg={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(hg(),dg),hg().locals;class fg extends tg{constructor(t){super(t);const e=this.bindTemplate,n=a();this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke",void 0),this.set("label",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.labelView=this._createLabelView(n),this.iconView=new lg,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this));const i={tag:"button",attributes:{class:["ck","ck-button",e.to("class"),e.if("isEnabled","ck-disabled",(t=>!t)),e.if("isVisible","ck-hidden",(t=>!t)),e.to("isOn",(t=>t?"ck-on":"ck-off")),e.if("withText","ck-button_with-text"),e.if("withKeystroke","ck-button_with-keystroke")],type:e.to("type",(t=>t||"button")),tabindex:e.to("tabindex"),"aria-labelledby":`ck-editor__aria-label_${n}`,"aria-disabled":e.if("isEnabled",!0,(t=>!t)),"aria-pressed":e.to("isOn",(t=>!!this.isToggleable&&String(!!t))),"data-cke-tooltip-text":e.to("_tooltipString"),"data-cke-tooltip-position":e.to("tooltipPosition")},children:this.children,on:{click:e.to((t=>{this.isEnabled?this.fire("execute"):t.preventDefault()}))}};js.isSafari&&(i.on.mousedown=e.to((t=>{this.focus(),t.preventDefault()
}))),this.setTemplate(i)}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}_createLabelView(t){const e=new tg,n=this.bindTemplate;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:n.to("labelStyle"),id:`ck-editor__aria-label_${t}`},children:[{text:this.bindTemplate.to("label")}]}),e}_createKeystrokeView(){const t=new tg;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",(t=>dt(t)))}]}),t}_getTooltipString(t,e,n){return t?"string"==typeof t?t:(n&&(n=dt(n)),t instanceof Function?t(e,n):`${e}${n?` (${n})`:""}`):""}}var mg=t(29190),gg=t.n(mg),pg={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(gg(),pg),gg().locals;class wg extends fg{constructor(t){super(t),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const t=new tg;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),t}}var vg=t(64284),bg=t.n(vg),yg={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(bg(),yg),bg().locals;class _g{constructor(t){this.editor=t,this._components=new Map}*names(){for(const t of this._components.values())yield t.originalName}add(t,e){this._components.set(Ii(t),{callback:e,originalName:t})}create(t){if(!this.has(t))throw new qs("componentfactory-item-missing",this,{name:t});return this._components.get(Ii(t)).callback(this.editor.locale)}has(t){return this._components.has(Ii(t))}}var kg=t(62756),Ag=t.n(kg),xg={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(Ag(),xg),Ag().locals;class Tg extends tg{constructor(t,e,n){super(t);const i=this.bindTemplate;this.buttonView=e,this.panelView=n,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class",void 0),this.set("id",void 0),this.set("panelPosition","auto"),this.keystrokes=new ju,this.focusTracker=new zu,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",i.to("class"),i.if("isEnabled","ck-disabled",(t=>!t))],id:i.to("id"),"aria-describedby":i.to("ariaDescribedById")},children:[e,n]}),e.extendTemplate({attributes:{class:["ck-dropdown__button"],"data-cke-tooltip-disabled":i.to("isOpen")}})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.listenTo(this.buttonView,"open",(()=>{this.isOpen=!this.isOpen})),this.panelView.bind("isVisible").to(this,"isOpen"),this.on("change:isOpen",((t,e,n)=>{n&&("auto"===this.panelPosition?this.panelView.position=Tg._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions}).name:this.panelView.position=this.panelPosition)})),this.keystrokes.listenTo(this.element);const t=(t,e)=>{this.isOpen&&(this.isOpen=!1,e())};this.keystrokes.set("arrowdown",((t,e)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,e())})),this.keystrokes.set("arrowright",((t,e)=>{this.isOpen&&e()})),this.keystrokes.set("arrowleft",t),this.keystrokes.set("esc",t)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:t,north:e,southEast:n,southWest:i,northEast:r,northWest:o,southMiddleEast:s,southMiddleWest:a,northMiddleEast:c,northMiddleWest:l}=Tg.defaultPanelPositions;return"rtl"!==this.locale.uiLanguageDirection?[n,i,s,a,t,r,o,c,l,e]:[i,n,a,s,t,o,r,l,c,e]}}Tg.defaultPanelPositions={south:(t,e)=>({top:t.bottom,left:t.left-(e.width-t.width)/2,name:"s"}),southEast:t=>({top:t.bottom,left:t.left,name:"se"}),southWest:(t,e)=>({top:t.bottom,left:t.left-e.width+t.width,name:"sw"}),southMiddleEast:(t,e)=>({top:t.bottom,left:t.left-(e.width-t.width)/4,name:"sme"}),southMiddleWest:(t,e)=>({top:t.bottom,left:t.left-3*(e.width-t.width)/4,name:"smw"}),north:(t,e)=>({top:t.top-e.height,left:t.left-(e.width-t.width)/2,name:"n"}),northEast:(t,e)=>({top:t.top-e.height,left:t.left,name:"ne"}),northWest:(t,e)=>({top:t.top-e.height,left:t.left-e.width+t.width,name:"nw"}),northMiddleEast:(t,e)=>({top:t.top-e.height,left:t.left-(e.width-t.width)/4,name:"nme"}),northMiddleWest:(t,e)=>({top:t.top-e.height,left:t.left-3*(e.width-t.width)/4,name:"nmw"})},Tg._getOptimalPosition=X;var Cg='<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"><path d="M.941 4.523a.75.75 0 1 1 1.06-1.06l3.006 3.005 3.005-3.005a.75.75 0 1 1 1.06 1.06l-3.549 3.55a.75.75 0 0 1-1.168-.136L.941 4.523z"/></svg>';class Eg extends fg{constructor(t){super(t),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",(t=>String(t)))}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const t=new lg;return t.content=Cg,t.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),t}}var Sg=t(11767),Pg=t.n(Sg),Rg={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(Pg(),Rg),Pg().locals;class Og extends tg{constructor(t){super(t);const e=this.bindTemplate;this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke",void 0),this.set("withKeystroke",!1),this.set("label",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(),this.arrowView=this._createArrowView(),this.keystrokes=new ju,this.focusTracker=new zu,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",e.to("class"),e.if("isVisible","ck-hidden",(t=>!t)),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render(),this.children.add(this.actionView),this.children.add(this.arrowView),this.focusTracker.add(this.actionView.element),this.focusTracker.add(this.arrowView.element),this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",((t,e)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),e())})),this.keystrokes.set("arrowleft",((t,e)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),e())}))}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.actionView.focus()}_createActionView(){const t=new fg;return t.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),t.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),t.delegate("execute").to(this),t}_createArrowView(){const t=new fg,e=t.bindTemplate;return t.icon=Cg,t.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":e.to("isOn"),"aria-haspopup":!0,"aria-expanded":e.to("isOn",(t=>String(t)))}}),t.bind("isEnabled").to(this),t.bind("label").to(this),t.bind("tooltip").to(this),t.delegate("execute").to(this,"open"),t}}class Ig extends tg{constructor(t){super(t);const e=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",e.to("position",(t=>`ck-dropdown__panel_${t}`)),e.if("isVisible","ck-dropdown__panel-visible")]},children:this.children,on:{selectstart:e.to((t=>t.preventDefault()))}})}focus(){if(this.children.length){const t=this.children.first;"function"==typeof t.focus?t.focus():l("ui-dropdown-panel-focus-child-missing-focus",{childView:this.children.first,dropdownPanel:this})}}focusLast(){if(this.children.length){const t=this.children.last;"function"==typeof t.focusLast?t.focusLast():t.focus()}}}class Mg{constructor(t){if(this.focusables=t.focusables,this.focusTracker=t.focusTracker,this.keystrokeHandler=t.keystrokeHandler,this.actions=t.actions,t.actions&&t.keystrokeHandler)for(const e in t.actions){let n=t.actions[e];"string"==typeof n&&(n=[n]);for(const i of n)t.keystrokeHandler.set(i,((t,n)=>{this[e](),n()}))}}get first(){return this.focusables.find(Mi)||null}get last(){return this.focusables.filter(Mi).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let t=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find(((e,n)=>{const i=e.element===this.focusTracker.focusedElement;return i&&(t=n),i})),t)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(t){t&&t.focus()}_getFocusableItem(t){const e=this.current,n=this.focusables.length;if(!n)return null;if(null===e)return this[1===t?"first":"last"];let i=(e+n+t)%n;do{const e=this.focusables.get(i);if(Mi(e))return e;i=(i+n+t)%n}while(i!==e);return null}}class Ng extends tg{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class Vg extends tg{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}var Dg=t(58348),Bg=t.n(Dg),Fg={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(Bg(),Fg),Bg().locals;const{threeVerticalDots:Lg}=Jm,zg={alignLeft:Jm.alignLeft,bold:Jm.bold,importExport:Jm.importExport,paragraph:Jm.paragraph,plus:Jm.plus,text:Jm.text,threeVerticalDots:Jm.threeVerticalDots};class jg extends tg{constructor(t,e){super(t);const n=this.bindTemplate,i=this.t;this.options=e||{},this.set("ariaLabel",i("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new zu,this.keystrokes=new ju,this.set("class",void 0),this.set("isCompact",!1),this.itemsView=new Hg(t),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const r="rtl"===t.uiLanguageDirection;this._focusCycler=new Mg({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[r?"arrowright":"arrowleft","arrowup"],focusNext:[r?"arrowleft":"arrowright","arrowdown"]}});const o=["ck","ck-toolbar",n.to("class"),n.if("isCompact","ck-toolbar_compact")];var s;this.options.shouldGroupWhenFull&&this.options.isFloating&&o.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:o,role:"toolbar","aria-label":n.to("ariaLabel"),style:{maxWidth:n.to("maxWidth")}},children:this.children,on:{mousedown:(s=this,s.bindTemplate.to((t=>{t.target===s.element&&t.preventDefault()})))}}),this._behavior=this.options.shouldGroupWhenFull?new Wg(this):new Ug(this)}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",((t,e)=>{this.focusTracker.add(e.element)})),this.items.on("remove",((t,e)=>{this.focusTracker.remove(e.element)})),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(t,e,n){this.items.addMany(this._buildItemsFromConfig(t,e,n))}_buildItemsFromConfig(t,e,n){const i=Ni(t),r=n||i.removeItems;return this._cleanItemsConfiguration(i.items,e,r).map((t=>Zs(t)?this._createNestedToolbarDropdown(t,e,r):"|"===t?new Ng:"-"===t?new Vg:e.create(t))).filter((t=>!!t))}_cleanItemsConfiguration(t,e,n){const i=t.filter(((t,i,r)=>"|"===t||-1===n.indexOf(t)&&("-"===t?!this.options.shouldGroupWhenFull||(l("toolbarview-line-break-ignored-when-grouping-items",r),!1):!(!Zs(t)&&!e.has(t)&&(l("toolbarview-item-unavailable",{item:t}),1)))));return this._cleanSeparatorsAndLineBreaks(i)}_cleanSeparatorsAndLineBreaks(t){const e=t=>"-"!==t&&"|"!==t,n=t.length,i=t.findIndex(e);if(-1===i)return[];const r=n-t.slice().reverse().findIndex(e);return t.slice(i,r).filter(((t,n,i)=>!!e(t)||!(n>0&&i[n-1]===t)))}_createNestedToolbarDropdown(t,e,n){let{label:i,icon:r,items:o,tooltip:s=!0,withText:a=!1}=t;if(o=this._cleanItemsConfiguration(o,e,n),!o.length)return null;const c=Vi(this.locale);return i||l("toolbarview-nested-toolbar-dropdown-missing-label",t),c.class="ck-toolbar__nested-toolbar-dropdown",c.buttonView.set({label:i,tooltip:s,withText:!!a}),!1!==r?c.buttonView.icon=zg[r]||r||Lg:c.buttonView.withText=!0,Di(c,(()=>c.toolbarView._buildItemsFromConfig(o,e,n))),c}}class Hg extends tg{constructor(t){super(t),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class Ug{constructor(t){const e=t.bindTemplate;t.set("isVertical",!1),t.itemsView.children.bindTo(t.items).using((t=>t)),t.focusables.bindTo(t.items).using((t=>t)),t.extendTemplate({attributes:{class:[e.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class Wg{constructor(t){this.view=t,this.viewChildren=t.children,this.viewFocusables=t.focusables,this.viewItemsView=t.itemsView,this.viewFocusTracker=t.focusTracker,this.viewLocale=t.locale,this.ungroupedItems=t.createCollection(),this.groupedItems=t.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,t.itemsView.children.bindTo(this.ungroupedItems).using((t=>t)),this.ungroupedItems.on("change",this._updateFocusCycleableItems.bind(this)),t.children.on("change",this._updateFocusCycleableItems.bind(this)),t.items.on("change",((t,e)=>{const n=e.index,i=Array.from(e.added);for(const t of e.removed)n>=this.ungroupedItems.length?this.groupedItems.remove(t):this.ungroupedItems.remove(t);for(let t=n;t<n+i.length;t++){const e=i[t-n];t>this.ungroupedItems.length?this.groupedItems.add(e,t-this.ungroupedItems.length):this.ungroupedItems.add(e,t)}this._updateGrouping()})),t.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}render(t){this.viewElement=t.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(t)}destroy(){this.groupedItemsDropdown.destroy(),this.resizeObserver.destroy()}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!Q(this.viewElement))return void(this.shouldUpdateGroupingOnNextResize=!0);const t=this.groupedItems.length;let e;for(;this._areItemsOverflowing;)this._groupLastItem(),e=!0;if(!e&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==t&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const t=this.viewElement,e=this.viewLocale.uiLanguageDirection,n=new Ru(t.lastChild),i=new Ru(t);if(!this.cachedPadding){const n=Su.window.getComputedStyle(t),i="ltr"===e?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(n[i])}return"ltr"===e?n.right>i.right-this.cachedPadding:n.left<i.left+this.cachedPadding}_enableGroupingOnResize(){let t;this.resizeObserver=new Ou(this.viewElement,(e=>{t&&t===e.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),t=e.contentRect.width)})),this._updateGrouping()}_enableGroupingOnMaxWidthChange(t){t.on("change:maxWidth",(()=>{this._updateGrouping()}))}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new Ng),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){const t=this.viewLocale,e=t.t,n=Vi(t);return n.class="ck-toolbar__grouped-dropdown",n.panelPosition="ltr"===t.uiLanguageDirection?"sw":"se",Di(n,this.groupedItems),n.buttonView.set({label:e("Show more items"),tooltip:!0,tooltipPosition:"rtl"===t.uiLanguageDirection?"se":"sw",icon:Lg}),n}_updateFocusCycleableItems(){this.viewFocusables.clear(),this.ungroupedItems.map((t=>{this.viewFocusables.add(t)})),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}var $g=t(55861),qg=t.n($g),Kg={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(qg(),Kg),qg().locals;class Gg extends tg{constructor(t){super(t);const e=this.bindTemplate;this.items=this.createCollection(),this.focusTracker=new zu,this.keystrokes=new ju,this._focusCycler=new Mg({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.set("ariaLabel",void 0),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"],"aria-label":e.to("ariaLabel")},children:this.items})}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",((t,e)=>{this.focusTracker.add(e.element)})),this.items.on("remove",((t,e)=>{this.focusTracker.remove(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class Jg extends tg{constructor(t){super(t);const e=this.bindTemplate;this.set("isVisible",!0),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item",e.if("isVisible","ck-hidden",(t=>!t))]},children:this.children})}focus(){this.children.first.focus()}}class Yg extends tg{constructor(t){super(t),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}var Qg=t(18065),Xg=t.n(Qg),Zg={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0},tp=(Yu()(Xg(),Zg),Xg().locals,t(39900)),ep=t.n(tp),np={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(ep(),np),ep().locals;var ip=t(8245),rp=t.n(ip),op={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(rp(),op),rp().locals;const sp=K("px"),ap=Su.document.body;class cp extends tg{constructor(t){super(t);const e=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class",void 0),this._pinWhenIsVisibleCallback=null,this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",e.to("position",(t=>`ck-balloon-panel_${t}`)),e.if("isVisible","ck-balloon-panel_visible"),e.if("withArrow","ck-balloon-panel_with-arrow"),e.to("class")],style:{top:e.to("top",sp),left:e.to("left",sp)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(t){this.show();const e=cp.defaultPositions,n=Object.assign({},{element:this.element,positions:[e.southArrowNorth,e.southArrowNorthMiddleWest,e.southArrowNorthMiddleEast,e.southArrowNorthWest,e.southArrowNorthEast,e.northArrowSouth,e.northArrowSouthMiddleWest,e.northArrowSouthMiddleEast,e.northArrowSouthWest,e.northArrowSouthEast,e.viewportStickyNorth],limiter:ap,fitInViewport:!0},t),i=cp._getOptimalPosition(n),r=parseInt(i.left),o=parseInt(i.top),s=i.name,a=i.config||{},{withArrow:c=!0}=a;this.top=o,this.left=r,this.position=s,this.withArrow=c}pin(t){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(t):this._stopPinning()},this._startPinning(t),this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(t){this.attachTo(t);const e=ji(t.target),n=t.limiter?ji(t.limiter):ap;this.listenTo(Su.document,"scroll",((i,r)=>{const o=r.target,s=e&&o.contains(e),a=n&&o.contains(n);!s&&!a&&e&&n||this.attachTo(t)}),{useCapture:!0}),this.listenTo(Su.window,"resize",(()=>{this.attachTo(t)}))}_stopPinning(){this.stopListening(Su.document,"scroll"),this.stopListening(Su.window,"resize")}}cp.arrowSideOffset=25,cp.arrowHeightOffset=10,cp.stickyVerticalOffset=20,cp._getOptimalPosition=X,cp.defaultPositions=Hi();var lp=t(87644),up=t.n(lp),hp={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(up(),hp),up().locals;const dp="ck-tooltip";class fp extends(B()){constructor(t){if(super(),fp._editors.add(t),fp._instance)return fp._instance;fp._instance=this,this.tooltipTextView=new tg(t.locale),this.tooltipTextView.set("text",""),this.tooltipTextView.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:this.tooltipTextView.bindTemplate.to("text")}]}),this.balloonPanelView=new cp(t.locale),this.balloonPanelView.class=dp,this.balloonPanelView.content.add(this.tooltipTextView),this._resizeObserver=null,this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this._pinTooltipDebounced=Qd(this._pinTooltip,600),this.listenTo(Su.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(Su.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(Su.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(Su.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(Su.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}destroy(t){const e=t.ui.view&&t.ui.view.body;fp._editors.delete(t),this.stopListening(t.ui),e&&e.has(this.balloonPanelView)&&e.remove(this.balloonPanelView),fp._editors.size||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),fp._instance=null)}static getPositioningFunctions(t){const e=fp.defaultBalloonPositions;return{s:[e.southArrowNorth,e.southArrowNorthEast,e.southArrowNorthWest],n:[e.northArrowSouth],e:[e.eastArrowWest],w:[e.westArrowEast],sw:[e.southArrowNorthEast],se:[e.southArrowNorthWest]}[t]}_onEnterOrFocus(t,{target:e}){const n=Ui(e);var i;n&&n!==this._currentElementWithTooltip&&(this._unpinTooltip(),this._pinTooltipDebounced(n,{text:(i=n).dataset.ckeTooltipText,position:i.dataset.ckeTooltipPosition||"s",cssClass:i.dataset.ckeTooltipClass||""}))}_onLeaveOrBlur(t,{target:e,relatedTarget:n}){if("mouseleave"===t.name){if(!Au(e))return;if(this._currentElementWithTooltip&&e!==this._currentElementWithTooltip)return;const t=Ui(e),i=Ui(n);t&&t!==i&&this._unpinTooltip()}else{if(this._currentElementWithTooltip&&e!==this._currentElementWithTooltip)return;this._unpinTooltip()}}_onScroll(t,{target:e}){this._currentElementWithTooltip&&(e.contains(this.balloonPanelView.element)&&e.contains(this._currentElementWithTooltip)||this._unpinTooltip())}_pinTooltip(t,{text:e,position:n,cssClass:i}){const r=wt(fp._editors.values()).ui.view.body;r.has(this.balloonPanelView)||r.add(this.balloonPanelView),this.tooltipTextView.text=e,this.balloonPanelView.pin({target:t,positions:fp.getPositioningFunctions(n)}),this._resizeObserver=new Ou(t,(()=>{Q(t)||this._unpinTooltip()})),this.balloonPanelView.class=[dp,i].filter((t=>t)).join(" ");for(const t of fp._editors)this.listenTo(t.ui,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=t,this._currentTooltipPosition=n}_unpinTooltip(){this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin();for(const t of fp._editors)this.stopListening(t.ui,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this._resizeObserver&&this._resizeObserver.destroy()}_updateTooltipPosition(){Q(this._currentElementWithTooltip)?this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:fp.getPositioningFunctions(this._currentTooltipPosition)}):this._unpinTooltip()}}fp.defaultBalloonPositions=Hi({heightOffset:5,sideOffset:13}),fp._editors=new Set,fp._instance=null;class mp extends(y()){constructor(t){super(),this.editor=t,this.componentFactory=new _g(t),this.focusTracker=new zu,this.tooltipManager=new fp(t),this.set("viewportOffset",this._readViewportOffsetFromConfig()),this.isReady=!1,this.once("ready",(()=>{this.isReady=!0})),this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[],this.listenTo(t.editing.view.document,"layoutChanged",(()=>this.update())),this._initFocusTracking()}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy(),this.tooltipManager.destroy(this.editor);for(const t of this._editableElementsMap.values())t.ckeditorInstance=null;this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[]}setEditableElement(t,e){this._editableElementsMap.set(t,e),e.ckeditorInstance||(e.ckeditorInstance=this.editor),this.focusTracker.add(e);const n=()=>{this.editor.editing.view.getDomRoot(t)||this.editor.keystrokes.listenTo(e)};this.isReady?n():this.once("ready",n)}getEditableElement(t="main"){return this._editableElementsMap.get(t)}getEditableElementsNames(){return this._editableElementsMap.keys()}addToolbar(t,e={}){t.isRendered?(this.focusTracker.add(t.element),this.editor.keystrokes.listenTo(t.element)):t.once("render",(()=>{this.focusTracker.add(t.element),this.editor.keystrokes.listenTo(t.element)})),this._focusableToolbarDefinitions.push({toolbarView:t,options:e})}get _editableElements(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}_readViewportOffsetFromConfig(){const t=this.editor,e=t.config.get("ui.viewportOffset");if(e)return e;const n=t.config.get("toolbar.viewportTopOffset");return n?(console.warn("editor-ui-deprecated-viewport-offset-config: The `toolbar.vieportTopOffset` configuration option is deprecated. It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead."),{top:n}):{top:0}}_initFocusTracking(){const t=this.editor,e=t.editing.view;let n,i;t.keystrokes.set("Alt+F10",((t,r)=>{const o=this.focusTracker.focusedElement;Array.from(this._editableElementsMap.values()).includes(o)&&!Array.from(e.domRoots.values()).includes(o)&&(n=o);const s=this._getCurrentFocusedToolbarDefinition();s&&i||(i=this._getFocusableCandidateToolbarDefinitions());for(let t=0;t<i.length;t++){const t=i.shift();if(i.push(t),t!==s&&this._focusFocusableCandidateToolbar(t)){s&&s.options.afterBlur&&s.options.afterBlur();break}}r()})),t.keystrokes.set("Esc",((e,i)=>{const r=this._getCurrentFocusedToolbarDefinition();r&&(n?(n.focus(),n=null):t.editing.view.focus(),r.options.afterBlur&&r.options.afterBlur(),i())}))}_getFocusableCandidateToolbarDefinitions(){const t=[];for(const e of this._focusableToolbarDefinitions){const{toolbarView:n,options:i}=e;(Q(n.element)||i.beforeFocus)&&t.push(e)}return t.sort(((t,e)=>Wi(t)-Wi(e))),t}_getCurrentFocusedToolbarDefinition(){for(const t of this._focusableToolbarDefinitions)if(t.toolbarView.element&&t.toolbarView.element.contains(this.focusTracker.focusedElement))return t;return null}_focusFocusableCandidateToolbar(t){const{toolbarView:e,options:{beforeFocus:n}}=t;return n&&n(),!!Q(e.element)&&(e.focus(),!0)}}var gp=t(92124),pp=t.n(gp),wp={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(pp(),wp),pp().locals;class vp extends tg{constructor(t){super(t),this.body=new og(t)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}var bp=t(28496),yp=t.n(bp),_p={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(yp(),_p),yp().locals;class kp extends tg{constructor(t){super(t),this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${a()}`;const e=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:e.to("for")},children:[{text:e.to("text")}]})}}class Ap extends tg{constructor(t,e,n){super(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:t.contentLanguage,dir:t.contentLanguageDirection}}),this.name=null,this.set("isFocused",!1),this._editableElement=n,this._hasExternalElement=!!this._editableElement,this._editingView=e}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",(()=>this._updateIsFocusedClasses())),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}_updateIsFocusedClasses(){function t(t){e.change((n=>{const i=e.document.getRoot(t.name);n.addClass(t.isFocused?"ck-focused":"ck-blurred",i),n.removeClass(t.isFocused?"ck-blurred":"ck-focused",i)}))}const e=this._editingView;e.isRenderingInProgress?function n(i){e.once("change:isRenderingInProgress",((e,r,o)=>{o?n(i):t(i)}))}(this):t(this)}}class xp extends Ap{constructor(t,e,n,i={}){super(t,e,n);const r=t.t;this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}}),this._generateLabel=i.label||(()=>r("Editor editing area: %0",this.name))}render(){super.render();const t=this._editingView;t.change((e=>{const n=t.document.getRoot(this.name);e.setAttribute("aria-label",this._generateLabel(this),n)}))}}var Tp=t(90652),Cp=t.n(Tp),Ep={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(Cp(),Ep),Cp().locals;var Sp=t(1964),Pp=t.n(Sp),Rp={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(Pp(),Rp),Pp().locals;class Op extends tg{constructor(t){super(t),this.set("value",void 0),this.set("id",void 0),this.set("placeholder",void 0),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById",void 0),this.focusTracker=new zu,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0),this.set("inputMode","text");const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck","ck-input",e.if("isFocused","ck-input_focused"),e.if("isEmpty","ck-input-text_empty"),e.if("hasError","ck-error")],id:e.to("id"),placeholder:e.to("placeholder"),readonly:e.to("isReadOnly"),inputmode:e.to("inputMode"),"aria-invalid":e.if("hasError",!0),"aria-describedby":e.to("ariaDescribedById")},on:{input:e.to(((...t)=>{this.fire("input",...t),this._updateIsEmpty()})),change:e.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",((t,e,n)=>{this._setDomElementValue(n),this._updateIsEmpty()}))}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(t){this.element.value=t||0===t?t:""}}class Ip extends Op{constructor(t){super(t),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}}var Mp=t(9271),Np=t.n(Mp),Vp={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(Np(),Vp),Np().locals;class Dp extends tg{constructor(t,e){super(t);const n=`ck-labeled-field-view-${a()}`,i=`ck-labeled-field-view-status-${a()}`;this.fieldView=e(this,n,i),this.set("label",void 0),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class",void 0),this.set("placeholder",void 0),this.labelView=this._createLabelView(n),this.statusView=this._createStatusView(i),this.fieldWrapperChildren=this.createCollection([this.fieldView,this.labelView]),this.bind("_statusText").to(this,"errorText",this,"infoText",((t,e)=>t||e));const r=this.bindTemplate;this.setTemplate({tag:"div",attributes:{
class:["ck","ck-labeled-field-view",r.to("class"),r.if("isEnabled","ck-disabled",(t=>!t)),r.if("isEmpty","ck-labeled-field-view_empty"),r.if("isFocused","ck-labeled-field-view_focused"),r.if("placeholder","ck-labeled-field-view_placeholder"),r.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:this.fieldWrapperChildren},this.statusView]})}_createLabelView(t){const e=new kp(this.locale);return e.for=t,e.bind("text").to(this,"label"),e}_createStatusView(t){const e=new tg(this.locale),n=this.bindTemplate;return e.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",n.if("errorText","ck-labeled-field-view__status_error"),n.if("_statusText","ck-hidden",(t=>!t))],id:t,role:n.if("errorText","alert")},children:[{text:n.to("_statusText")}]}),e}focus(){this.fieldView.focus()}}class Bp extends(y()){constructor(t,e){super(),e&&Vd(this,e),t&&this.set(t)}}var Fp=t(36964),Lp=t.n(Fp),zp={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0},jp=(Yu()(Lp(),zp),Lp().locals,t(96589)),Hp=t.n(jp),Up={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(Hp(),Up),Hp().locals;const Wp=K("px");class $p extends Uu{static get pluginName(){return"ContextualBalloon"}constructor(t){super(t),this._view=null,this._rotatorView=null,this._fakePanelsView=null,this.positionLimiter=()=>{const t=this.editor.editing.view,e=t.document.selection.editableElement;return e?t.domConverter.mapViewToDom(e.root):null},this.set("visibleView",null),this._viewToStack=new Map,this._idToStack=new Map,this.set("_numberOfStacks",0),this.set("_singleViewMode",!1),this._rotatorView=null,this._fakePanelsView=null}destroy(){super.destroy(),this._view&&this._view.destroy(),this._rotatorView&&this._rotatorView.destroy(),this._fakePanelsView&&this._fakePanelsView.destroy()}get view(){return this._view||this._createPanelView(),this._view}hasView(t){return Array.from(this._viewToStack.keys()).includes(t)}add(t){if(this._view||this._createPanelView(),this.hasView(t.view))throw new qs("contextualballoon-add-view-exist",[this,t]);const e=t.stackId||"main";if(!this._idToStack.has(e))return this._idToStack.set(e,new Map([[t.view,t]])),this._viewToStack.set(t.view,this._idToStack.get(e)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!t.singleViewMode||this.showStack(e));const n=this._idToStack.get(e);t.singleViewMode&&this.showStack(e),n.set(t.view,t),this._viewToStack.set(t.view,n),n===this._visibleStack&&this._showView(t)}remove(t){if(!this.hasView(t))throw new qs("contextualballoon-remove-view-not-exist",[this,t]);const e=this._viewToStack.get(t);this._singleViewMode&&this.visibleView===t&&(this._singleViewMode=!1),this.visibleView===t&&(1===e.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(e.values())[e.size-2])),1===e.size?(this._idToStack.delete(this._getStackId(e)),this._numberOfStacks=this._idToStack.size):e.delete(t),this._viewToStack.delete(t)}updatePosition(t){t&&(this._visibleStack.get(this.visibleView).position=t),this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition()}showStack(t){this.visibleStack=t;const e=this._idToStack.get(t);if(!e)throw new qs("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==e&&this._showView(Array.from(e.values()).pop())}_createPanelView(){this._view=new cp(this.editor.locale),this.editor.ui.view.body.add(this._view),this.editor.ui.focusTracker.add(this._view.element),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(t){return Array.from(this._idToStack.entries()).find((e=>e[1]===t))[0]}_showNextStack(){const t=Array.from(this._idToStack.values());let e=t.indexOf(this._visibleStack)+1;t[e]||(e=0),this.showStack(this._getStackId(t[e]))}_showPrevStack(){const t=Array.from(this._idToStack.values());let e=t.indexOf(this._visibleStack)-1;t[e]||(e=t.length-1),this.showStack(this._getStackId(t[e]))}_createRotatorView(){const t=new qp(this.editor.locale),e=this.editor.locale.t;return this.view.content.add(t),t.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",((t,e)=>!e&&t>1)),t.on("change:isNavigationVisible",(()=>this.updatePosition()),{priority:"low"}),t.bind("counter").to(this,"visibleView",this,"_numberOfStacks",((t,n)=>{if(n<2)return"";const i=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return e("%0 of %1",[i,n])})),t.buttonNextView.on("execute",(()=>{t.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()})),t.buttonPrevView.on("execute",(()=>{t.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()})),t}_createFakePanelsView(){const t=new Kp(this.editor.locale,this.view);return t.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",((t,e)=>!e&&t>=2?Math.min(t-1,2):0)),t.listenTo(this.view,"change:top",(()=>t.updatePosition())),t.listenTo(this.view,"change:left",(()=>t.updatePosition())),this.editor.ui.view.body.add(t),t}_showView({view:t,balloonClassName:e="",withArrow:n=!0,singleViewMode:i=!1}){this.view.class=e,this.view.withArrow=n,this._rotatorView.showView(t),this.visibleView=t,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),i&&(this._singleViewMode=!0)}_getBalloonPosition(){let t=Array.from(this._visibleStack.values()).pop().position;return t&&(t.limiter||(t=Object.assign({},t,{limiter:this.positionLimiter})),t=Object.assign({},t,{viewportOffsetConfig:this.editor.ui.viewportOffset})),t}}class qp extends tg{constructor(t){super(t);const e=t.t,n=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new zu,this.buttonPrevView=this._createButtonView(e("Previous"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.463 5.187a.888.888 0 1 1 1.254 1.255L9.16 10l3.557 3.557a.888.888 0 1 1-1.254 1.255L7.26 10.61a.888.888 0 0 1 .16-1.382l4.043-4.042z"/></svg>'),this.buttonNextView=this._createButtonView(e("Next"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8.537 14.813a.888.888 0 1 1-1.254-1.255L10.84 10 7.283 6.442a.888.888 0 1 1 1.254-1.255L12.74 9.39a.888.888 0 0 1-.16 1.382l-4.043 4.042z"/></svg>'),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",n.to("isNavigationVisible",(t=>t?"":"ck-hidden"))]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:n.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}destroy(){super.destroy(),this.focusTracker.destroy()}showView(t){this.hideView(),this.content.add(t)}hideView(){this.content.clear()}_createButtonView(t,e){const n=new fg(this.locale);return n.set({label:t,icon:e,tooltip:!0}),n}}class Kp extends tg{constructor(t,e){super(t);const n=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=e,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",n.to("numberOfPanels",(t=>t?"":"ck-hidden"))],style:{top:n.to("top",Wp),left:n.to("left",Wp),width:n.to("width",Wp),height:n.to("height",Wp)}},children:this.content}),this.on("change:numberOfPanels",((t,e,n,i)=>{n>i?this._addPanels(n-i):this._removePanels(i-n),this.updatePosition()}))}_addPanels(t){for(;t--;){const t=new tg;t.setTemplate({tag:"div"}),this.content.add(t),this.registerChild(t)}}_removePanels(t){for(;t--;){const t=this.content.last;this.content.remove(t),this.deregisterChild(t),t.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:t,left:e}=this._balloonPanelView,{width:n,height:i}=new Ru(this._balloonPanelView.element);Object.assign(this,{top:t,left:e,width:n,height:i})}}}var Gp=t(18023),Jp=t.n(Gp),Yp={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(Jp(),Yp),Jp().locals,K("px"),K("px");var Qp=t(13737),Xp=t.n(Qp),Zp={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(Xp(),Zp),Xp().locals,K("px"),K("px");const{pilcrow:tw}=Jm;class ew extends mp{constructor(t,e){super(t),this.view=e,this._toolbarConfig=Ni(t.config.get("toolbar"))}get element(){return this.view.editable.element}init(){const t=this.editor,e=this.view,n=t.editing.view,i=e.editable,r=n.document.getRoot();i.name=r.rootName,e.render();const o=i.element;this.setEditableElement(i.name,o),i.bind("isFocused").to(this.focusTracker),n.attachDomRoot(o),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){super.destroy();const t=this.view;this.editor.editing.view.detachDomRoot(t.editable.name),t.destroy()}_initToolbar(){const t=this.editor,e=this.view,n=e.editable.element,i=e.toolbar;e.panel.bind("isVisible").to(this.focusTracker,"isFocused"),e.bind("viewportTopOffset").to(this,"viewportOffset",(({top:t})=>t||0)),e.listenTo(t.ui,"update",(()=>{e.panel.isVisible&&e.panel.pin({target:n,positions:e.panelPositions})})),i.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(i)}_initPlaceholder(){const t=this.editor,e=t.editing.view,n=e.document.getRoot(),i=t.sourceElement,r=t.config.get("placeholder")||i&&"textarea"===i.tagName.toLowerCase()&&i.getAttribute("placeholder");r&&function(t){const{view:e,element:n,text:i,isDirectHost:r=!0,keepOnFocus:o=!1}=t,s=e.document;th.has(s)||(th.set(s,new Map),s.registerPostFixer((t=>Tt(s,t))),s.on("change:isComposing",(()=>{e.change((t=>Tt(s,t)))}),{priority:"high"})),th.get(s).set(n,{text:i,isDirectHost:r,keepOnFocus:o,hostElement:r?n:null}),e.change((t=>Tt(s,t)))}({view:e,element:n,text:r,isDirectHost:!1,keepOnFocus:!0})}}const nw=K("px");class iw extends vp{constructor(t,e,n,i={}){super(t);const r=t.t;this.toolbar=new jg(t,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull,isFloating:!0}),this.set("viewportTopOffset",0),this.panel=new cp(t),this.panelPositions=this._getPanelPositions(),this.panel.extendTemplate({attributes:{class:"ck-toolbar-container"}}),this.editable=new xp(t,e,n,{label:t=>r("Rich Text Editor. Editing area: %0",t.name)}),this._resizeObserver=null}render(){if(super.render(),this.body.add(this.panel),this.registerChild(this.editable),this.panel.content.add(this.toolbar),this.toolbar.options.shouldGroupWhenFull){const t=this.editable.element;this._resizeObserver=new Ou(t,(()=>{this.toolbar.maxWidth=nw(new Ru(t).width)}))}}destroy(){super.destroy(),this._resizeObserver&&this._resizeObserver.destroy()}_getPanelPositionTop(t,e){let n;return n=t.top>e.height+this.viewportTopOffset?t.top-e.height:t.bottom>e.height+this.viewportTopOffset+50?this.viewportTopOffset:t.bottom,n}_getPanelPositions(){const t=[(t,e)=>({top:this._getPanelPositionTop(t,e),left:t.left,name:"toolbar_west",config:{withArrow:!1}}),(t,e)=>({top:this._getPanelPositionTop(t,e),left:t.left+t.width-e.width,name:"toolbar_east",config:{withArrow:!1}})];return"ltr"===this.locale.uiLanguageDirection?t:t.reverse()}}class rw extends(li(ui(zm))){constructor(t,e={}){if(!qi(t)&&void 0!==e.initialData)throw new qs("editor-create-initial-data",null);super(e),void 0===this.config.get("initialData")&&this.config.set("initialData",function(t){return qi(t)?(e=t)instanceof HTMLTextAreaElement?e.value:e.innerHTML:t;var e}(t)),this.model.document.createRoot(),qi(t)&&(this.sourceElement=t,function(t){const e=t.sourceElement;if(e){if(e.ckeditorInstance)throw new qs("editor-source-element-already-used",t);e.ckeditorInstance=t,t.once("destroy",(()=>{delete e.ckeditorInstance}))}}(this));const n=!this.config.get("toolbar.shouldNotGroupWhenFull"),i=new iw(this.locale,this.editing.view,this.sourceElement,{shouldToolbarGroupWhenFull:n});this.ui=new ew(this,i),function(t){if(!Ua(t.updateSourceElement))throw new qs("attachtoform-missing-elementapi-interface",t);const e=t.sourceElement;if(function(t){return!!t&&"textarea"===t.tagName.toLowerCase()}(e)&&e.form){let n;const i=e.form,r=()=>t.updateSourceElement();Ua(i.submit)&&(n=i.submit,i.submit=()=>{r(),n.apply(i)}),i.addEventListener("submit",r),t.on("destroy",(()=>{i.removeEventListener("submit",r),n&&(i.submit=n)}))}}(this)}destroy(){const t=this.getData();return this.ui.destroy(),super.destroy().then((()=>{this.sourceElement&&this.updateSourceElement(t)}))}static create(t,e={}){return new Promise((n=>{if(qi(t)&&"TEXTAREA"===t.tagName)throw new qs("editor-wrong-element",null);const i=new this(t,e);n(i.initPlugins().then((()=>i.ui.init())).then((()=>i.data.init(i.config.get("initialData")))).then((()=>i.fire("ready"))).then((()=>i)))}))}}class ow extends Uu{static get pluginName(){return"Autosave"}static get requires(){return[jm]}constructor(t){super(t);const e=t.config.get("autosave")||{},n=e.waitingTime||1e3;this.set("state","synchronized"),this._debouncedSave=Qd(this._save.bind(this),n),this._lastDocumentVersion=t.model.document.version,this._savePromise=null,this._domEmitter=Object.create(B),this._config=e,this._pendingActions=t.plugins.get(jm),this._makeImmediateSave=!1}init(){const t=this.editor,e=t.model.document;this.listenTo(t,"ready",(()=>{this.listenTo(e,"change:data",((t,e)=>{this._saveCallbacks.length&&e.isLocal&&("synchronized"===this.state&&(this.state="waiting",this._setPendingAction()),"waiting"===this.state&&this._debouncedSave())}))})),this.listenTo(t,"destroy",(()=>this._flush()),{priority:"highest"}),this._domEmitter.listenTo(window,"beforeunload",((t,e)=>{this._pendingActions.hasAny&&(e.returnValue=this._pendingActions.first.message)}))}destroy(){this._domEmitter.stopListening(),super.destroy()}save(){return this._debouncedSave.cancel(),this._save()}_flush(){this._debouncedSave.flush()}_save(){return this._savePromise?(this._makeImmediateSave=this.editor.model.document.version>this._lastDocumentVersion,this._savePromise):(this._setPendingAction(),this.state="saving",this._lastDocumentVersion=this.editor.model.document.version,this._savePromise=Promise.resolve().then((()=>Promise.all(this._saveCallbacks.map((t=>t(this.editor)))))).finally((()=>{this._savePromise=null})).then((()=>{if(this._makeImmediateSave)return this._makeImmediateSave=!1,this._save();this.editor.model.document.version>this._lastDocumentVersion?(this.state="waiting",this._debouncedSave()):(this.state="synchronized",this._pendingActions.remove(this._action),this._action=null)})).catch((t=>{throw this.state="error",this.state="saving",this._debouncedSave(),t})),this._savePromise)}_setPendingAction(){const t=this.editor.t;this._action||(this._action=this._pendingActions.add(t("Saving changes")))}get _saveCallbacks(){const t=[];return this.adapter&&this.adapter.save&&t.push(this.adapter.save),this._config.save&&t.push(this._config.save),t}}s(ow,y);class sw extends Bd{constructor(t){function e(t){return(e,i)=>{i.preventDefault();const r=i.dropRange?[i.dropRange]:null,o=new Us(n,t);n.fire(o,{dataTransfer:i.dataTransfer,method:e.name,targetRanges:r,target:i.target}),o.stop.called&&i.stopPropagation()}}super(t);const n=this.document;this.domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"],this.listenTo(n,"paste",e("clipboardInput"),{priority:"low"}),this.listenTo(n,"drop",e("clipboardInput"),{priority:"low"}),this.listenTo(n,"dragover",e("dragging"),{priority:"low"})}onDomEvent(t){const e="clipboardData"in t?t.clipboardData:t.dataTransfer,n="drop"==t.type||"paste"==t.type,i={dataTransfer:new xf(e,{cacheFiles:n})};"drop"!=t.type&&"dragover"!=t.type||(i.dropRange=function(t,e){const n=e.target.ownerDocument,i=e.clientX,r=e.clientY;let o;return n.caretRangeFromPoint&&n.caretRangeFromPoint(i,r)?o=n.caretRangeFromPoint(i,r):e.rangeParent&&(o=n.createRange(),o.setStart(e.rangeParent,e.rangeOffset),o.collapse(!0)),o?t.domConverter.domRangeToView(o):null}(this.view,t)),this.fire(t.type,t,i)}}const aw=["figcaption","li"];class cw extends Uu{static get pluginName(){return"ClipboardPipeline"}init(){this.editor.editing.view.addObserver(sw),this._setupPasteDrop(),this._setupCopyCut()}_setupPasteDrop(){const t=this.editor,e=t.model,n=t.editing.view,i=n.document;this.listenTo(i,"clipboardInput",(e=>{t.isReadOnly&&e.stop()}),{priority:"highest"}),this.listenTo(i,"clipboardInput",((t,e)=>{const i=e.dataTransfer;let r;if(e.content)r=e.content;else{let t="";i.getData("text/html")?t=function(t){return t.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,((t,e)=>1==e.length?" ":e)).replace(/<!--[\s\S]*?-->/g,"")}(i.getData("text/html")):i.getData("text/plain")&&(((o=(o=i.getData("text/plain")).replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br>").replace(/\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/^\s/,"&nbsp;").replace(/\s$/,"&nbsp;").replace(/\s\s/g," &nbsp;")).includes("</p><p>")||o.includes("<br>"))&&(o=`<p>${o}</p>`),t=o),r=this.editor.data.htmlProcessor.toView(t)}var o;const s=new Us(this,"inputTransformation");this.fire(s,{content:r,dataTransfer:i,targetRanges:e.targetRanges,method:e.method}),s.stop.called&&t.stop(),n.scrollToTheSelection()}),{priority:"low"}),this.listenTo(this,"inputTransformation",((t,n)=>{if(n.content.isEmpty)return;const i=this.editor.data.toModel(n.content,"$clipboardHolder");0!=i.childCount&&(t.stop(),e.change((()=>{this.fire("contentInsertion",{content:i,method:n.method,dataTransfer:n.dataTransfer,targetRanges:n.targetRanges})})))}),{priority:"low"}),this.listenTo(this,"contentInsertion",((t,n)=>{n.resultRange=e.insertContent(n.content)}),{priority:"low"})}_setupCopyCut(){const t=this.editor,e=t.model.document,n=t.editing.view.document,i=(i,r)=>{const o=r.dataTransfer;r.preventDefault();const s=t.data.toView(t.model.getSelectedContent(e.selection));n.fire("clipboardOutput",{dataTransfer:o,content:s,method:i.name})};this.listenTo(n,"copy",i,{priority:"low"}),this.listenTo(n,"cut",((e,n)=>{t.isReadOnly?n.preventDefault():i(e,n)}),{priority:"low"}),this.listenTo(n,"clipboardOutput",((n,i)=>{i.content.isEmpty||(i.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(i.content)),i.dataTransfer.setData("text/plain",Ki(i.content))),"cut"==i.method&&t.model.deleteContent(e.selection)}),{priority:"low"})}}class lw{constructor(t,e=20){this._batch=null,this.model=t,this._size=0,this.limit=e,this._isLocked=!1,this._changeCallback=(t,e)=>{e.isLocal&&e.isUndoable&&e!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch({isTyping:!0})),this._batch}get size(){return this._size}input(t){this._size+=t,this._size>=this.limit&&this._reset(!0)}get isLocked(){return this._isLocked}lock(){this._isLocked=!0}unlock(){this._isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(t=!1){this.isLocked&&!t||(this._batch=null,this._size=0)}}class uw extends Wu{constructor(t,e){super(t),this._buffer=new lw(t.model,e)}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(t={}){const e=this.editor.model,n=e.document,i=t.text||"",r=i.length;let o=n.selection;t.selection?o=t.selection:t.range&&(o=e.createSelection(t.range));const s=t.resultRange;e.enqueueChange(this._buffer.batch,(t=>{this._buffer.lock(),e.deleteContent(o),i&&e.insertContent(t.createText(i,n.selection.getAttributes()),o),s?t.setSelection(s):o.is("documentSelection")||t.setSelection(o),this._buffer.unlock(),this._buffer.input(r)}))}}const hw=["insertText","insertReplacementText"];class dw extends Nd{constructor(t){super(t),js.isAndroid&&hw.push("insertCompositionText");const e=t.document;e.on("beforeinput",((n,i)=>{if(!this.isEnabled)return;const{data:r,targetRanges:o,inputType:s,domEvent:a}=i;if(!hw.includes(s))return;const c=new Us(e,"insertText");e.fire(c,new Dd(t,a,{text:r,selection:t.createSelection(o)})),c.stop.called&&n.stop()})),e.on("compositionend",((n,{data:i,domEvent:r})=>{this.isEnabled&&!js.isAndroid&&i&&e.fire("insertText",new Dd(t,r,{text:i,selection:e.selection}))}),{priority:"lowest"})}observe(){}}class fw extends Uu{static get pluginName(){return"Input"}init(){const t=this.editor,e=t.model,n=t.editing.view,i=e.document.selection;n.addObserver(dw);const r=new uw(t,t.config.get("typing.undoStep")||20);t.commands.add("insertText",r),t.commands.add("input",r),this.listenTo(n.document,"insertText",((i,r)=>{n.document.isComposing||r.preventDefault();const{text:o,selection:s,resultRange:a}=r,c=Array.from(s.getRanges()).map((e=>t.editing.mapper.toModelRange(e)));let l=o;if(js.isAndroid){const t=Array.from(c[0].getItems()).reduce(((t,e)=>t+(e.is("$textProxy")?e.data:"")),"");t&&(t.length<=l.length?l.startsWith(t)&&(l=l.substring(t.length),c[0].start=c[0].start.getShiftedBy(t.length)):t.startsWith(l)&&(c[0].start=c[0].start.getShiftedBy(l.length),l=""))}const u={text:l,selection:e.createSelection(c)};a&&(u.resultRange=t.editing.mapper.toModelRange(a)),t.execute("insertText",u)})),js.isAndroid?this.listenTo(n.document,"keydown",((t,o)=>{!i.isCollapsed&&229==o.keyCode&&n.document.isComposing&&Gi(e,r)})):this.listenTo(n.document,"compositionstart",(()=>{i.isCollapsed||Gi(e,r)}))}}class mw extends Wu{constructor(t,e){super(t),this.direction=e,this._buffer=new lw(t.model,t.config.get("typing.undoStep"))}get buffer(){return this._buffer}execute(t={}){const e=this.editor.model,n=e.document;e.enqueueChange(this._buffer.batch,(i=>{this._buffer.lock();const r=i.createSelection(t.selection||n.selection),o=t.sequence||1,s=r.isCollapsed;if(r.isCollapsed&&e.modifySelection(r,{direction:this.direction,unit:t.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(o))return void this._replaceEntireContentWithParagraph(i);if(this._shouldReplaceFirstBlockWithParagraph(r,o))return void this.editor.execute("paragraph",{selection:r});if(r.isCollapsed)return;let a=0;r.getFirstRange().getMinimalFlatRanges().forEach((t=>{a+=C(t.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))})),e.deleteContent(r,{doNotResetEntireContent:s,direction:this.direction}),this._buffer.input(a),i.setSelection(r),this._buffer.unlock()}))}_shouldEntireContentBeReplacedWithParagraph(t){if(t>1)return!1;const e=this.editor.model,n=e.document.selection,i=e.schema.getLimitElement(n);if(!n.isCollapsed||!n.containsEntireContent(i))return!1;if(!e.schema.checkChild(i,"paragraph"))return!1;const r=i.getChild(0);return!r||!r.is("element","paragraph")}_replaceEntireContentWithParagraph(t){const e=this.editor.model,n=e.document.selection,i=e.schema.getLimitElement(n),r=t.createElement("paragraph");t.remove(t.createRangeIn(i)),t.insert(r,i),t.setSelection(r,0)}_shouldReplaceFirstBlockWithParagraph(t,e){const n=this.editor.model;if(e>1||"backward"!=this.direction)return!1;if(!t.isCollapsed)return!1;const i=t.getFirstPosition(),r=n.schema.getLimitElement(i),o=r.getChild(0);return i.parent==o&&!!t.containsEntireContent(o)&&!!n.schema.checkChild(r,"paragraph")&&"paragraph"!=o.name}}const gw="word",pw="selection",ww="backward",vw="forward",bw={deleteContent:{unit:pw,direction:ww},deleteContentBackward:{unit:"codePoint",direction:ww},deleteWordBackward:{unit:gw,direction:ww},deleteHardLineBackward:{unit:pw,direction:ww},deleteSoftLineBackward:{unit:pw,direction:ww},deleteContentForward:{unit:"character",direction:vw},deleteWordForward:{unit:gw,direction:vw},deleteHardLineForward:{unit:pw,direction:vw},deleteSoftLineForward:{unit:pw,direction:vw}};class yw extends Nd{constructor(t){super(t);const e=t.document;let n=0;e.on("keydown",(()=>{n++})),e.on("keyup",(()=>{n=0})),e.on("beforeinput",((i,r)=>{if(!this.isEnabled)return;const{targetRanges:o,domEvent:s,inputType:a}=r,c=bw[a];if(!c)return;const l={direction:c.direction,unit:c.unit,sequence:n};l.unit==pw&&(l.selectionToRemove=t.createSelection(o[0])),js.isAndroid&&"deleteContentBackward"===a&&(l.sequence=1,1!=o.length||o[0].start.parent==o[0].end.parent&&o[0].start.offset+1==o[0].end.offset||(l.unit=pw,l.selectionToRemove=t.createSelection(o)));const u=new ud(e,"delete",o[0]);e.fire(u,new Dd(t,s,l)),u.stop.called&&i.stop()})),js.isBlink&&function(t){function e(t){return t==Vu.backspace||t==Vu.delete}function n(t){return t==Vu.backspace?ww:vw}const i=t.view,r=i.document;let o=null,s=!1;r.on("keydown",((t,{keyCode:e})=>{o=e,s=!1})),r.on("keyup",((a,{keyCode:c,domEvent:l})=>{const u=r.selection,h=t.isEnabled&&c==o&&e(c)&&!u.isCollapsed&&!s;if(o=null,h){const t=u.getFirstRange(),e=new ud(r,"delete",t),o={unit:pw,direction:n(c),selectionToRemove:u};r.fire(e,new Dd(i,l,o))}})),r.on("beforeinput",((t,{inputType:i})=>{const r=bw[i];e(o)&&r&&r.direction==n(o)&&(s=!0)}),{priority:"high"}),r.on("beforeinput",((t,{inputType:e,data:n})=>{o==Vu.delete&&"insertText"==e&&"\x7f"==n&&t.stop()}),{priority:"high"})}(this)}observe(){}}class _w extends Uu{static get pluginName(){return"Delete"}init(){const t=this.editor,e=t.editing.view,n=e.document,i=t.model.document;e.addObserver(yw),this._undoOnBackspace=!1;const r=new mw(t,"forward");t.commands.add("deleteForward",r),t.commands.add("forwardDelete",r),t.commands.add("delete",new mw(t,"backward")),this.listenTo(n,"delete",((i,r)=>{n.isComposing||r.preventDefault();const{direction:o,sequence:s,selectionToRemove:a,unit:c}=r,l="forward"===o?"deleteForward":"delete",u={sequence:s};if("selection"==c){const e=Array.from(a.getRanges()).map((e=>t.editing.mapper.toModelRange(e)));u.selection=t.model.createSelection(e)}else u.unit=c;t.execute(l,u),e.scrollToTheSelection()}),{priority:"low"}),this.editor.plugins.has("UndoEditing")&&(this.listenTo(n,"delete",((e,n)=>{this._undoOnBackspace&&"backward"==n.direction&&1==n.sequence&&"codePoint"==n.unit&&(this._undoOnBackspace=!1,t.execute("undo"),n.preventDefault(),e.stop())}),{context:"$capture"}),this.listenTo(i,"change",(()=>{this._undoOnBackspace=!1})))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class kw extends Uu{static get requires(){return[fw,_w]}static get pluginName(){return"Typing"}}class Aw extends(y()){constructor(t,e){super(),this.model=t,this.testCallback=e,this._hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",(()=>{this.isEnabled?this._startListening():(this.stopListening(t.document.selection),this.stopListening(t.document))})),this._startListening()}get hasMatch(){return this._hasMatch}_startListening(){const t=this.model.document;this.listenTo(t.selection,"change:range",((e,{directChange:n})=>{n&&(t.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1))})),this.listenTo(t,"change:data",((t,e)=>{!e.isUndo&&e.isLocal&&this._evaluateTextBeforeSelection("data",{batch:e})}))}_evaluateTextBeforeSelection(t,e={}){const n=this.model,i=n.document.selection,r=n.createRange(n.createPositionAt(i.focus.parent,0),i.focus),{text:o,range:s}=Ji(r,n),a=this.testCallback(o);if(!a&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!a,a){const n=Object.assign(e,{text:o,range:s});"object"==typeof a&&Object.assign(n,a),this.fire(`matched:${t}`,n)}}}class xw extends Uu{static get pluginName(){return"TwoStepCaretMovement"}constructor(t){super(t),this.attributes=new Set,this._overrideUid=null}init(){const t=this.editor,e=t.model,n=t.editing.view,i=t.locale,r=e.document.selection;this.listenTo(n.document,"arrowKey",((t,e)=>{if(!r.isCollapsed)return;if(e.shiftKey||e.altKey||e.ctrlKey)return;const n=e.keyCode==Vu.arrowright,o=e.keyCode==Vu.arrowleft;if(!n&&!o)return;const s=i.contentLanguageDirection;let a=!1;a="ltr"===s&&n||"rtl"===s&&o?this._handleForwardMovement(e):this._handleBackwardMovement(e),!0===a&&t.stop()}),{context:"$text",priority:"highest"}),this._isNextGravityRestorationSkipped=!1,this.listenTo(r,"change:range",((t,e)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!e.directChange&&Zi(r.getFirstPosition(),this.attributes)||this._restoreGravity())}))}registerAttribute(t){this.attributes.add(t)}_handleForwardMovement(t){const e=this.attributes,n=this.editor.model.document.selection,i=n.getFirstPosition();return!(this._isGravityOverridden||i.isAtStart&&Yi(n,e)||!Zi(i,e)||(Xi(t),this._overrideGravity(),0))}_handleBackwardMovement(t){const e=this.attributes,n=this.editor.model,i=n.document.selection,r=i.getFirstPosition();return this._isGravityOverridden?(Xi(t),this._restoreGravity(),Qi(n,e,r),!0):r.isAtStart?!!Yi(i,e)&&(Xi(t),Qi(n,e,r),!0):!!function(t,e){return Zi(t.getShiftedBy(-1),e)}(r,e)&&(r.isAtEnd&&!Yi(i,e)&&Zi(r,e)?(Xi(t),Qi(n,e,r),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1))}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change((t=>t.overrideSelectionGravity()))}_restoreGravity(){this.editor.model.change((t=>{t.restoreSelectionGravity(this._overrideUid),this._overrideUid=null}))}}RegExp(/[\\^$.*+?()[\]{}|]/g.source),tr('"'),tr("'"),tr("'"),tr('"'),tr('"'),tr("'");class Tw extends Wu{execute(){this.editor.model.change((t=>{this.enterBlock(t),this.fire("afterExecute",{writer:t})}))}enterBlock(t){const e=this.editor.model,n=e.document.selection,i=e.schema,r=n.isCollapsed,o=n.getFirstRange(),s=o.start.parent,a=o.end.parent;if(i.isLimit(s)||i.isLimit(a))return r||s!=a||e.deleteContent(n),!1;if(r){const e=ir(t.model.schema,n.getAttributes());return rr(t,o.start),t.setSelectionAttribute(e),!0}{const i=!(o.start.isAtStart&&o.end.isAtEnd),r=s==a;if(e.deleteContent(n,{leaveUnmerged:i}),i){if(r)return rr(t,n.focus),!0;t.setSelection(a,0)}}return!1}}const Cw={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}};class Ew extends Nd{constructor(t){super(t);const e=this.document;e.on("beforeinput",((n,i)=>{if(!this.isEnabled)return;const r=i.domEvent,o=Cw[i.inputType];if(!o)return;const s=new ud(e,"enter",i.targetRanges[0]);e.fire(s,new Dd(t,r,{isSoft:o.isSoft})),s.stop.called&&n.stop()}))}observe(){}}class Sw extends Uu{static get pluginName(){return"Enter"}init(){const t=this.editor,e=t.editing.view,n=e.document;e.addObserver(Ew),t.commands.add("enter",new Tw(t)),this.listenTo(n,"enter",((i,r)=>{n.isComposing||r.preventDefault(),r.isSoft||(t.execute("enter"),e.scrollToTheSelection())}),{priority:"low"})}}class Pw extends Wu{execute(){const t=this.editor.model,e=t.document;t.change((n=>{!function(t,e,n){const i=n.isCollapsed,r=n.getFirstRange(),o=r.start.parent,s=r.end.parent,a=o==s;if(i){const i=ir(t.schema,n.getAttributes());or(t,e,r.end),e.removeSelectionAttribute(n.getAttributeKeys()),e.setSelectionAttribute(i)}else{const i=!(r.start.isAtStart&&r.end.isAtEnd);t.deleteContent(n,{leaveUnmerged:i}),a?or(t,e,n.focus):i&&e.setSelection(s,0)}}(t,n,e.selection),this.fire("afterExecute",{writer:n})}))}refresh(){const t=this.editor.model,e=t.document;this.isEnabled=function(t,e){if(e.rangeCount>1)return!1;const n=e.anchor;if(!n||!t.checkChild(n,"softBreak"))return!1;const i=e.getFirstRange(),r=i.start.parent,o=i.end.parent;return!sr(r,t)&&!sr(o,t)||r===o}(t.schema,e.selection)}}class Rw extends Uu{static get pluginName(){return"ShiftEnter"}init(){const t=this.editor,e=t.model.schema,n=t.conversion,i=t.editing.view,r=i.document;e.register("softBreak",{allowWhere:"$text",isInline:!0}),n.for("upcast").elementToElement({model:"softBreak",view:"br"}),n.for("downcast").elementToElement({model:"softBreak",view:(t,{writer:e})=>e.createEmptyElement("br")}),i.addObserver(Ew),t.commands.add("shiftEnter",new Pw(t)),this.listenTo(r,"enter",((e,n)=>{r.isComposing||n.preventDefault(),n.isSoft&&(t.execute("shiftEnter"),i.scrollToTheSelection())}),{priority:"low"})}}class Ow extends(d()){constructor(){super(),this._stack=[]}add(t,e){const n=this._stack,i=n[0];this._insertDescriptor(t);const r=n[0];i===r||ar(i,r)||this.fire("change:top",{oldDescriptor:i,newDescriptor:r,writer:e})}remove(t,e){const n=this._stack,i=n[0];this._removeDescriptor(t);const r=n[0];i===r||ar(i,r)||this.fire("change:top",{oldDescriptor:i,newDescriptor:r,writer:e})}_insertDescriptor(t){
const e=this._stack,n=e.findIndex((e=>e.id===t.id));if(ar(t,e[n]))return;n>-1&&e.splice(n,1);let i=0;for(;e[i]&&cr(e[i],t);)i++;e.splice(i,0,t)}_removeDescriptor(t){const e=this._stack,n=e.findIndex((e=>e.id===t));n>-1&&e.splice(n,1)}}var Iw='<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M4 0v1H1v3H0V.5A.5.5 0 0 1 .5 0H4zm8 0h3.5a.5.5 0 0 1 .5.5V4h-1V1h-3V0zM4 16H.5a.5.5 0 0 1-.5-.5V12h1v3h3v1zm8 0v-1h3v-3h1v3.5a.5.5 0 0 1-.5.5H12z"/><path fill-opacity=".256" d="M1 1h14v14H1z"/><g class="ck-icon__selected-indicator"><path d="M7 0h2v1H7V0zM0 7h1v2H0V7zm15 0h1v2h-1V7zm-8 8h2v1H7v-1z"/><path fill-opacity=".254" d="M1 1h14v14H1z"/></g></svg>';const Mw="ck-widget_selected",Nw="widget-type-around";var Vw=t(35721),Dw=t.n(Vw),Bw={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(Dw(),Bw),Dw().locals;const Fw=["before","after"],Lw=(new DOMParser).parseFromString('<svg viewBox="0 0 10 8" xmlns="http://www.w3.org/2000/svg"><path d="M9.055.263v3.972h-6.77M1 4.216l2-2.038m-2 2 2 2.038"/></svg>',"image/svg+xml").firstChild,zw="ck-widget__type-around_disabled";class jw extends Uu{static get pluginName(){return"WidgetTypeAround"}static get requires(){return[Sw,_w]}constructor(t){super(t),this._currentFakeCaretModelElement=null}init(){const t=this.editor,e=t.editing.view;this.on("change:isEnabled",((n,i,r)=>{e.change((t=>{for(const n of e.document.roots)r?t.removeClass(zw,n):t.addClass(zw,n)})),r||t.model.change((t=>{t.removeSelectionAttribute(Nw)}))})),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){super.destroy(),this._currentFakeCaretModelElement=null}_insertParagraph(t,e){const n=this.editor,i=n.editing.view,r=n.model.schema.getAttributesWithProperty(t,"copyOnReplace",!0);n.execute("insertParagraph",{position:n.model.createPositionAt(t,e),attributes:r}),i.focus(),i.scrollToTheSelection()}_listenToIfEnabled(t,e,n,i){this.listenTo(t,e,((...t)=>{this.isEnabled&&n(...t)}),i)}_insertParagraphAccordingToFakeCaretPosition(){const t=this.editor.model.document.selection,e=vr(t);if(!e)return!1;const n=t.getSelectedElement();return this._insertParagraph(n,e),!0}_enableTypeAroundUIInjection(){const t=this.editor,e=t.model.schema,n=t.locale.t,i={before:n("Insert paragraph before block"),after:n("Insert paragraph after block")};t.editing.downcastDispatcher.on("insert",((t,r,o)=>{const s=o.mapper.toViewElement(r.item);s&&wr(s,r.item,e)&&(!function(t,e,n){const i=t.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},(function(t){const n=this.toDomElement(t);return function(t,e){for(const n of Fw){const i=new eg({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${n}`],title:e[n],"aria-hidden":"true"},children:[t.ownerDocument.importNode(Lw,!0)]});t.appendChild(i.render())}}(n,e),function(t){const e=new eg({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});t.appendChild(e.render())}(n),n}));t.insert(t.createPositionAt(n,"end"),i)}(o.writer,i,s),s.getCustomProperty("widgetLabel").push((()=>this.isEnabled?n("Press Enter to type after or press Shift + Enter to type before the widget"):"")))}),{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){function t(t){return`ck-widget_type-around_show-fake-caret_${t}`}const e=this.editor,n=e.model,i=n.document.selection,r=n.schema,o=e.editing.view;this._listenToIfEnabled(o.document,"arrowKey",((t,e)=>{this._handleArrowKeyPress(t,e)}),{context:[ur,"$text"],priority:"high"}),this._listenToIfEnabled(i,"change:range",((t,n)=>{n.directChange&&e.model.change((t=>{t.removeSelectionAttribute(Nw)}))})),this._listenToIfEnabled(n.document,"change:data",(()=>{const t=i.getSelectedElement();t&&wr(e.editing.mapper.toViewElement(t),t,r)||e.model.change((t=>{t.removeSelectionAttribute(Nw)}))})),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",((e,n,i)=>{const o=i.writer;if(this._currentFakeCaretModelElement){const e=i.mapper.toViewElement(this._currentFakeCaretModelElement);e&&(o.removeClass(Fw.map(t),e),this._currentFakeCaretModelElement=null)}const s=n.selection.getSelectedElement();if(!s)return;const a=i.mapper.toViewElement(s);if(!wr(a,s,r))return;const c=vr(n.selection);c&&(o.addClass(t(c),a),this._currentFakeCaretModelElement=s)})),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",((t,n,i)=>{i||e.model.change((t=>{t.removeSelectionAttribute(Nw)}))}))}_handleArrowKeyPress(t,e){const n=this.editor,i=n.model,r=i.document.selection,o=i.schema,s=n.editing.view,a=function(t,e){const n=ft(t,e);return"down"===n||"right"===n}(e.keyCode,n.locale.contentLanguageDirection),c=s.document.selection.getSelectedElement();let l;wr(c,n.editing.mapper.toModelElement(c),o)?l=this._handleArrowKeyPressOnSelectedWidget(a):r.isCollapsed?l=this._handleArrowKeyPressWhenSelectionNextToAWidget(a):e.shiftKey||(l=this._handleArrowKeyPressWhenNonCollapsedSelection(a)),l&&(e.preventDefault(),t.stop())}_handleArrowKeyPressOnSelectedWidget(t){const e=this.editor.model,n=vr(e.document.selection);return e.change((e=>n?n!==(t?"after":"before")&&(e.removeSelectionAttribute(Nw),!0):(e.setSelectionAttribute(Nw,t?"after":"before"),!0)))}_handleArrowKeyPressWhenSelectionNextToAWidget(t){const e=this.editor,n=e.model,i=n.schema,r=e.plugins.get("Widget"),o=r._getObjectElementNextToSelection(t);return!!wr(e.editing.mapper.toViewElement(o),o,i)&&(n.change((e=>{r._setSelectionOverElement(o),e.setSelectionAttribute(Nw,t?"before":"after")})),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(t){const e=this.editor,n=e.model,i=n.schema,r=e.editing.mapper,o=n.document.selection,s=t?o.getLastPosition().nodeBefore:o.getFirstPosition().nodeAfter;return!!wr(r.toViewElement(s),s,i)&&(n.change((e=>{e.setSelection(s,"on"),e.setSelectionAttribute(Nw,t?"after":"before")})),!0)}_enableInsertingParagraphsOnButtonClick(){const t=this.editor,e=t.editing.view;this._listenToIfEnabled(e.document,"mousedown",((n,i)=>{const r=i.domTarget.closest(".ck-widget__type-around__button");if(!r)return;const o=function(t){return t.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(r),s=function(t,e){const n=t.closest(".ck-widget");return e.mapDomToView(n)}(r,e.domConverter),a=t.editing.mapper.toModelElement(s);this._insertParagraph(a,o),i.preventDefault(),n.stop()}))}_enableInsertingParagraphsOnEnterKeypress(){const t=this.editor,e=t.model.document.selection,n=t.editing.view;this._listenToIfEnabled(n.document,"enter",((n,i)=>{if("atTarget"!=n.eventPhase)return;const r=e.getSelectedElement(),o=t.editing.mapper.toViewElement(r),s=t.model.schema;let a;this._insertParagraphAccordingToFakeCaretPosition()?a=!0:wr(o,r,s)&&(this._insertParagraph(r,i.isSoft?"before":"after"),a=!0),a&&(i.preventDefault(),n.stop())}),{context:ur})}_enableInsertingParagraphsOnTypingKeystroke(){const t=this.editor.editing.view.document;this._listenToIfEnabled(t,"insertText",((e,n)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(n.selection=t.selection)}),{priority:"high"}),js.isAndroid?this._listenToIfEnabled(t,"keydown",((t,e)=>{229==e.keyCode&&this._insertParagraphAccordingToFakeCaretPosition()})):this._listenToIfEnabled(t,"compositionstart",(()=>{this._insertParagraphAccordingToFakeCaretPosition()}),{priority:"high"})}_enableDeleteIntegration(){const t=this.editor,e=t.editing.view,n=t.model,i=n.schema;this._listenToIfEnabled(e.document,"delete",((e,r)=>{if("atTarget"!=e.eventPhase)return;const o=vr(n.document.selection);if(!o)return;const s=r.direction,a=n.document.selection.getSelectedElement(),c="forward"==s;if("before"===o===c)t.execute("delete",{selection:n.createSelection(a,"on")});else{const e=i.getNearestSelectionRange(n.createPositionAt(a,o),s);if(e)if(e.isCollapsed){const r=n.createSelection(e.start);if(n.modifySelection(r,{direction:s}),r.focus.isEqual(e.start)){const t=function(t,e){let n=e;for(const i of e.getAncestors({parentFirst:!0})){if(i.childCount>1||t.isLimit(i))break;n=i}return n}(i,e.start.parent);n.deleteContent(n.createSelection(t,"on"),{doNotAutoparagraph:!0})}else n.change((n=>{n.setSelection(e),t.execute(c?"deleteForward":"delete")}))}else n.change((n=>{n.setSelection(e),t.execute(c?"deleteForward":"delete")}))}r.preventDefault(),e.stop()}),{context:ur})}_enableInsertContentIntegration(){const t=this.editor,e=this.editor.model,n=e.document.selection;this._listenToIfEnabled(t.model,"insertContent",((t,[i,r])=>{if(r&&!r.is("documentSelection"))return;const o=vr(n);return o?(t.stop(),e.change((t=>{const r=n.getSelectedElement(),s=e.createPositionAt(r,o),a=t.createSelection(s),c=e.insertContent(i,a);return t.setSelection(a),c}))):void 0}),{priority:"high"})}_enableInsertObjectIntegration(){const t=this.editor,e=this.editor.model.document.selection;this._listenToIfEnabled(t.model,"insertObject",((t,n)=>{const[,i,,r={}]=n;if(i&&!i.is("documentSelection"))return;const o=vr(e);o&&(r.findOptimalPosition=o,n[3]=r)}),{priority:"high"})}_enableDeleteContentIntegration(){const t=this.editor,e=this.editor.model.document.selection;this._listenToIfEnabled(t.model,"deleteContent",((t,[n])=>{n&&!n.is("documentSelection")||vr(e)&&t.stop()}),{priority:"high"})}}var Hw=t(15946),Uw=t.n(Hw),Ww={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(Uw(),Ww),Uw().locals;class $w extends Uu{static get pluginName(){return"Widget"}static get requires(){return[jw,_w]}init(){const t=this.editor,e=t.editing.view,n=e.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",((e,n,i)=>{const r=i.writer,o=n.selection;if(o.isCollapsed)return;const s=o.getSelectedElement();if(!s)return;const a=t.editing.mapper.toViewElement(s);var c;ur(a)&&i.consumable.consume(o,"selection")&&r.setSelection(r.createRangeOn(a),{fake:!0,label:(c=a,c.getCustomProperty("widgetLabel").reduce(((t,e)=>"function"==typeof e?t?t+". "+e():e():t?t+". "+e:e),""))})})),this.editor.editing.downcastDispatcher.on("selection",((t,e,n)=>{this._clearPreviouslySelectedWidgets(n.writer);const i=n.writer,r=i.document.selection;let o=null;for(const t of r.getRanges())for(const e of t){const t=e.item;ur(t)&&!kr(t,o)&&(i.addClass(Mw,t),this._previouslySelected.add(t),o=t)}}),{priority:"low"}),e.addObserver(Dm),this.listenTo(n,"mousedown",((...t)=>this._onMousedown(...t))),this.listenTo(n,"arrowKey",((...t)=>{this._handleSelectionChangeOnArrowKeyPress(...t)}),{context:[ur,"$text"]}),this.listenTo(n,"arrowKey",((...t)=>{this._preventDefaultOnArrowKeyPress(...t)}),{context:"$root"}),this.listenTo(n,"arrowKey",br(this.editor.editing),{context:"$text"}),this.listenTo(n,"delete",((t,e)=>{this._handleDelete("forward"==e.direction)&&(e.preventDefault(),t.stop())}),{context:"$root"})}_onMousedown(t,e){const n=this.editor,i=n.editing.view,r=i.document;let o=e.target;if(function(t){let e=t;for(;e;){if(e.is("editableElement")&&!e.is("rootElement"))return!0;if(ur(e))return!1;e=e.parent}return!1}(o)){if((js.isSafari||js.isGecko)&&e.domEvent.detail>=3){const t=n.editing.mapper,i=o.is("attributeElement")?o.findAncestor((t=>!t.is("attributeElement"))):o,r=t.toModelElement(i);e.preventDefault(),this.editor.model.change((t=>{t.setSelection(r,"in")}))}return}if(!ur(o)&&(o=o.findAncestor(ur),!o))return;js.isAndroid&&e.preventDefault(),r.isFocused||i.focus();const s=n.editing.mapper.toModelElement(o);this._setSelectionOverElement(s)}_handleSelectionChangeOnArrowKeyPress(t,e){const n=e.keyCode,i=this.editor.model,r=i.schema,o=i.document.selection,s=o.getSelectedElement(),a=ft(n,this.editor.locale.contentLanguageDirection),c="down"==a||"right"==a,l="up"==a||"down"==a;if(s&&r.isObject(s)){const n=c?o.getLastPosition():o.getFirstPosition(),s=r.getNearestSelectionRange(n,c?"forward":"backward");return void(s&&(i.change((t=>{t.setSelection(s)})),e.preventDefault(),t.stop()))}if(!o.isCollapsed&&!e.shiftKey){const n=o.getFirstPosition(),s=o.getLastPosition(),a=n.nodeAfter,l=s.nodeBefore;return void((a&&r.isObject(a)||l&&r.isObject(l))&&(i.change((t=>{t.setSelection(c?s:n)})),e.preventDefault(),t.stop()))}if(!o.isCollapsed)return;const u=this._getObjectElementNextToSelection(c);if(u&&r.isObject(u)){if(r.isInline(u)&&l)return;this._setSelectionOverElement(u),e.preventDefault(),t.stop()}}_preventDefaultOnArrowKeyPress(t,e){const n=this.editor.model,i=n.schema,r=n.document.selection.getSelectedElement();r&&i.isObject(r)&&(e.preventDefault(),t.stop())}_handleDelete(t){if(this.editor.isReadOnly)return;const e=this.editor.model.document.selection;if(!e.isCollapsed)return;const n=this._getObjectElementNextToSelection(t);return n?(this.editor.model.change((t=>{let i=e.anchor.parent;for(;i.isEmpty;){const e=i;i=e.parent,t.remove(e)}this._setSelectionOverElement(n)})),!0):void 0}_setSelectionOverElement(t){this.editor.model.change((e=>{e.setSelection(e.createRangeOn(t))}))}_getObjectElementNextToSelection(t){const e=this.editor.model,n=e.schema,i=e.document.selection,r=e.createSelection(i);if(e.modifySelection(r,{direction:t?"forward":"backward"}),r.isEqual(i))return null;const o=t?r.focus.nodeBefore:r.focus.nodeAfter;return o&&n.isObject(o)?o:null}_clearPreviouslySelectedWidgets(t){for(const e of this._previouslySelected)t.removeClass(Mw,e);this._previouslySelected.clear()}}class qw extends Uu{static get requires(){return[$p]}static get pluginName(){return"WidgetToolbarRepository"}init(){const t=this.editor;if(t.plugins.has("BalloonToolbar")){const e=t.plugins.get("BalloonToolbar");this.listenTo(e,"show",(e=>{(function(t){const e=t.getSelectedElement();return!(!e||!ur(e))})(t.editing.view.document.selection)&&e.stop()}),{priority:"high"})}this._toolbarDefinitions=new Map,this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",(()=>{this._updateToolbarsVisibility()})),this.listenTo(t.ui,"update",(()=>{this._updateToolbarsVisibility()})),this.listenTo(t.ui.focusTracker,"change:isFocused",(()=>{this._updateToolbarsVisibility()}),{priority:"low"})}destroy(){super.destroy();for(const t of this._toolbarDefinitions.values())t.view.destroy()}register(t,{ariaLabel:e,items:n,getRelatedElement:i,balloonClassName:r="ck-toolbar-container"}){if(!n.length)return void l("widget-toolbar-no-items",{toolbarId:t});const o=this.editor,s=o.t,a=new jg(o.locale);if(a.ariaLabel=e||s("Widget toolbar"),this._toolbarDefinitions.has(t))throw new qs("widget-toolbar-duplicated",this,{toolbarId:t});const c={view:a,getRelatedElement:i,balloonClassName:r,itemsConfig:n,initialized:!1};o.ui.addToolbar(a,{isContextual:!0,beforeFocus:()=>{const t=i(o.editing.view.document.selection);t&&this._showToolbar(c,t)},afterBlur:()=>{this._hideToolbar(c)}}),this._toolbarDefinitions.set(t,c)}_updateToolbarsVisibility(){let t=0,e=null,n=null;for(const i of this._toolbarDefinitions.values()){const r=i.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&r)if(this.editor.ui.focusTracker.isFocused){const o=r.getAncestors().length;o>t&&(t=o,e=r,n=i)}else this._isToolbarVisible(i)&&this._hideToolbar(i);else this._isToolbarInBalloon(i)&&this._hideToolbar(i)}n&&this._showToolbar(n,e)}_hideToolbar(t){this._balloon.remove(t.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(t,e){this._isToolbarVisible(t)?Ar(this.editor,e):this._isToolbarInBalloon(t)||(t.initialized||(t.initialized=!0,t.view.fillFromConfig(t.itemsConfig,this.editor.ui.componentFactory)),this._balloon.add({view:t.view,position:xr(this.editor,e),balloonClassName:t.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",(()=>{for(const t of this._toolbarDefinitions.values())if(this._isToolbarVisible(t)){const e=t.getRelatedElement(this.editor.editing.view.document.selection);Ar(this.editor,e)}})))}_isToolbarVisible(t){return this._balloon.visibleView===t.view}_isToolbarInBalloon(t){return this._balloon.hasView(t.view)}}y();y();var Kw=t(73954),Gw=t.n(Kw),Jw={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(Gw(),Jw),Gw().locals;var Yw=function(t,e,n){var i=!0,r=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return Zs(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Qd(t,e,{leading:i,maxWait:e,trailing:r})},Qw=t(12312),Xw=t.n(Qw),Zw={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(Xw(),Zw),Xw().locals;class tv extends Uu{static get pluginName(){return"DragDrop"}static get requires(){return[cw,$w]}init(){const t=this.editor,e=t.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,this._updateDropMarkerThrottled=Yw((t=>this._updateDropMarker(t)),40),this._removeDropMarkerDelayed=Er((()=>this._removeDropMarker()),40),this._clearDraggableAttributesDelayed=Er((()=>this._clearDraggableAttributes()),40),e.addObserver(sw),e.addObserver(Dm),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDropMarker(),this._setupDraggableAttributeHandling(),this.listenTo(t,"change:isReadOnly",((t,e,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})),this.on("change:isEnabled",((t,e,n)=>{n||this._finalizeDragging(!1)})),js.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._updateDropMarkerThrottled.cancel(),this._removeDropMarkerDelayed.cancel(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const t=this.editor,e=t.model,n=e.document,i=t.editing.view,r=i.document;this.listenTo(r,"dragstart",((i,o)=>{const s=n.selection;if(o.target&&o.target.is("editableElement"))return void o.preventDefault();const c=o.target?Sr(o.target):null;if(c){const n=t.editing.mapper.toModelElement(c);this._draggedRange=Hf.fromRange(e.createRangeOn(n)),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop")}else if(!r.selection.isCollapsed){const t=r.selection.getSelectedElement();t&&ur(t)||(this._draggedRange=Hf.fromRange(s.getFirstRange()))}if(!this._draggedRange)return void o.preventDefault();this._draggingUid=a(),o.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",o.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const l=e.createSelection(this._draggedRange.toRange()),u=t.data.toView(e.getSelectedContent(l));r.fire("clipboardOutput",{dataTransfer:o.dataTransfer,content:u,method:"dragstart"}),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")}),{priority:"low"}),this.listenTo(r,"dragend",((t,e)=>{this._finalizeDragging(!e.dataTransfer.isCanceled&&"move"==e.dataTransfer.dropEffect)}),{priority:"low"}),this.listenTo(r,"dragenter",(()=>{this.isEnabled&&i.focus()})),this.listenTo(r,"dragleave",(()=>{this._removeDropMarkerDelayed()})),this.listenTo(r,"dragging",((e,n)=>{if(!this.isEnabled)return void(n.dataTransfer.dropEffect="none");this._removeDropMarkerDelayed.cancel();const i=Tr(t,n.targetRanges,n.target);this._draggedRange||(n.dataTransfer.dropEffect="copy"),js.isGecko||("copy"==n.dataTransfer.effectAllowed?n.dataTransfer.dropEffect="copy":["all","copyMove"].includes(n.dataTransfer.effectAllowed)&&(n.dataTransfer.dropEffect="move")),i&&this._updateDropMarkerThrottled(i)}),{priority:"low"})}_setupClipboardInputIntegration(){const t=this.editor,e=t.editing.view.document;this.listenTo(e,"clipboardInput",((e,n)=>{if("drop"!=n.method)return;const i=Tr(t,n.targetRanges,n.target);return this._removeDropMarker(),i?(this._draggedRange&&this._draggingUid!=n.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),"move"==Cr(n.dataTransfer)&&this._draggedRange&&this._draggedRange.containsRange(i,!0)?(this._finalizeDragging(!1),void e.stop()):void(n.targetRanges=[t.editing.mapper.toViewRange(i)])):(this._finalizeDragging(!1),void e.stop())}),{priority:"high"})}_setupContentInsertionIntegration(){const t=this.editor.plugins.get(cw);t.on("contentInsertion",((t,e)=>{if(!this.isEnabled||"drop"!==e.method)return;const n=e.targetRanges.map((t=>this.editor.editing.mapper.toModelRange(t)));this.editor.model.change((t=>t.setSelection(n)))}),{priority:"high"}),t.on("contentInsertion",((t,e)=>{if(!this.isEnabled||"drop"!==e.method)return;const n="move"==Cr(e.dataTransfer),i=!e.resultRange||!e.resultRange.isCollapsed;this._finalizeDragging(i&&n)}),{priority:"lowest"})}_setupDraggableAttributeHandling(){const t=this.editor,e=t.editing.view,n=e.document;this.listenTo(n,"mousedown",((i,r)=>{if(js.isAndroid||!r)return;this._clearDraggableAttributesDelayed.cancel();let o=Sr(r.target);if(js.isBlink&&!t.isReadOnly&&!o&&!n.selection.isCollapsed){const t=n.selection.getSelectedElement();t&&ur(t)||(o=n.selection.editableElement)}o&&(e.change((t=>{t.setAttribute("draggable","true",o)})),this._draggableElement=t.editing.mapper.toModelElement(o))})),this.listenTo(n,"mouseup",(()=>{js.isAndroid||this._clearDraggableAttributesDelayed()}))}_clearDraggableAttributes(){const t=this.editor.editing;t.view.change((e=>{this._draggableElement&&"$graveyard"!=this._draggableElement.root.rootName&&e.removeAttribute("draggable",t.mapper.toViewElement(this._draggableElement)),this._draggableElement=null}))}_setupDropMarker(){const t=this.editor;t.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),t.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(e,{writer:n})=>{if(t.model.schema.checkChild(e.markerRange.start,"$text"))return n.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},(function(t){const e=this.toDomElement(t);return e.append("\u2060",t.createElement("span"),"\u2060"),e}))}})}_updateDropMarker(t){const e=this.editor,n=e.model.markers;e.model.change((e=>{n.has("drop-target")?n.get("drop-target").getRange().isEqual(t)||e.updateMarker("drop-target",{range:t}):e.addMarker("drop-target",{range:t,usingOperation:!1,affectsData:!1})}))}_removeDropMarker(){const t=this.editor.model;this._removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),t.markers.has("drop-target")&&t.change((t=>{t.removeMarker("drop-target")}))}_finalizeDragging(t){const e=this.editor,n=e.model;this._removeDropMarker(),this._clearDraggableAttributes(),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._draggedRange&&(t&&this.isEnabled&&n.deleteContent(n.createSelection(this._draggedRange),{doNotAutoparagraph:!0}),this._draggedRange.detach(),this._draggedRange=null)}}class ev extends Uu{static get pluginName(){return"PastePlainText"}static get requires(){return[cw]}init(){const t=this.editor,e=t.model,n=t.editing.view,i=n.document,r=e.document.selection;let o=!1;n.addObserver(sw),this.listenTo(i,"keydown",((t,e)=>{o=e.shiftKey})),t.plugins.get(cw).on("contentInsertion",((t,n)=>{(o||function(t,e){if(t.childCount>1)return!1;const n=t.getChild(0);return!e.isObject(n)&&0==Array.from(n.getAttributeKeys()).length}(n.content,e.schema))&&e.change((t=>{const i=Array.from(r.getAttributes()).filter((([t])=>e.schema.getAttributeProperties(t).isFormatting));r.isCollapsed||e.deleteContent(r,{doNotAutoparagraph:!0}),i.push(...r.getAttributes());const o=t.createRangeIn(n.content);for(const e of o.getItems())e.is("$textProxy")&&t.setAttributes(i,e)}))}))}}class nv extends Uu{static get pluginName(){return"Clipboard"}static get requires(){return[cw,tv,ev]}}class iv extends Wu{constructor(t){super(t),this.affectsData=!1}execute(){const t=this.editor.model,e=t.document.selection;let n=t.schema.getLimitElement(e);if(e.containsEntireContent(n)||!Pr(t.schema,n))do{if(n=n.parent,!n)return}while(!Pr(t.schema,n));t.change((t=>{t.setSelection(n,"in")}))}}const rv=ht("Ctrl+A");class ov extends Uu{static get pluginName(){return"SelectAllEditing"}init(){const t=this.editor,e=t.editing.view.document;t.commands.add("selectAll",new iv(t)),this.listenTo(e,"keydown",((e,n)=>{ut(n)===rv&&(t.execute("selectAll"),n.preventDefault())}))}}class sv extends Uu{static get pluginName(){return"SelectAllUI"}init(){const t=this.editor;t.ui.componentFactory.add("selectAll",(e=>{const n=t.commands.get("selectAll"),i=new fg(e),r=e.t;return i.set({label:r("Select all"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M.75 15.5a.75.75 0 0 1 .75.75V18l.008.09A.5.5 0 0 0 2 18.5h1.75a.75.75 0 1 1 0 1.5H1.5l-.144-.007a1.5 1.5 0 0 1-1.35-1.349L0 18.5v-2.25a.75.75 0 0 1 .75-.75zm18.5 0a.75.75 0 0 1 .75.75v2.25l-.007.144a1.5 1.5 0 0 1-1.349 1.35L18.5 20h-2.25a.75.75 0 1 1 0-1.5H18a.5.5 0 0 0 .492-.41L18.5 18v-1.75a.75.75 0 0 1 .75-.75zm-10.45 3c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm.45-5.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5h8.5zM1.3 11c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5h10.5zM1.3 7c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5h-2.5a.75.75 0 1 1 0-1.5h2.5zm-5 0a.75.75 0 1 1 0 1.5h-5.5a.75.75 0 0 1 0-1.5h5.5zm-6.5-5a.75.75 0 0 1 0 1.5H2a.5.5 0 0 0-.492.41L1.5 2v1.75a.75.75 0 0 1-1.5 0V1.5l.007-.144A1.5 1.5 0 0 1 1.356.006L1.5 0h2.25zM18.5 0l.144.007a1.5 1.5 0 0 1 1.35 1.349L20 1.5v2.25a.75.75 0 1 1-1.5 0V2l-.008-.09A.5.5 0 0 0 18 1.5h-1.75a.75.75 0 1 1 0-1.5h2.25zM8.8 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6z"/></svg>',keystroke:"Ctrl+A",tooltip:!0}),i.bind("isEnabled").to(n,"isEnabled"),this.listenTo(i,"execute",(()=>{t.execute("selectAll"),t.editing.view.focus()})),i}))}}class av extends Uu{static get requires(){return[ov,sv]}static get pluginName(){return"SelectAll"}}class cv extends Wu{constructor(t){super(t),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this.listenTo(t.data,"set",((t,e)=>{e[1]={...e[1]};const n=e[1];n.batchType||(n.batchType={isUndoable:!1})}),{priority:"high"}),this.listenTo(t.data,"set",((t,e)=>{e[1].batchType.isUndoable||this.clearStack()}))}refresh(){this.isEnabled=this._stack.length>0}addBatch(t){const e=this.editor.model.document.selection,n={ranges:e.hasOwnRange?Array.from(e.getRanges()):[],isBackward:e.isBackward};this._stack.push({batch:t,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(t,e,n){const i=this.editor.model,r=i.document,o=[],s=t.map((t=>t.getTransformedByOperations(n))),a=s.flat();for(const t of s){const e=t.filter((t=>t.root!=r.graveyard)).filter((t=>!Or(t,a)));e.length&&(Rr(e),o.push(e[0]))}o.length&&i.change((t=>{t.setSelection(o,{backward:e})}))}_undo(t,e){const n=this.editor.model,i=n.document;this._createdBatches.add(e);const r=t.operations.slice().filter((t=>t.isDocumentOperation));r.reverse();for(const t of r){const r=t.baseVersion+1,o=Array.from(i.history.getOperations(r)),s=Cn([t.getReversed()],o,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const r of s)e.addOperation(r),n.applyOperation(r),i.history.setOperationAsUndone(t,r)}}}class lv extends cv{execute(t=null){const e=t?this._stack.findIndex((e=>e.batch==t)):this._stack.length-1,n=this._stack.splice(e,1)[0],i=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(i,(()=>{this._undo(n.batch,i);const t=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,t),this.fire("revert",n.batch,i)})),this.refresh()}}class uv extends cv{execute(){const t=this._stack.pop(),e=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(e,(()=>{const n=t.batch.operations[t.batch.operations.length-1].baseVersion+1,i=this.editor.model.document.history.getOperations(n);this._restoreSelection(t.selection.ranges,t.selection.isBackward,i),this._undo(t.batch,e)})),this.refresh()}}class hv extends Uu{static get pluginName(){return"UndoEditing"}constructor(t){super(t),this._batchRegistry=new WeakSet}init(){const t=this.editor;this._undoCommand=new lv(t),this._redoCommand=new uv(t),t.commands.add("undo",this._undoCommand),t.commands.add("redo",this._redoCommand),this.listenTo(t.model,"applyOperation",((t,e)=>{const n=e[0];if(!n.isDocumentOperation)return;const i=n.batch,r=this._redoCommand._createdBatches.has(i),o=this._undoCommand._createdBatches.has(i);this._batchRegistry.has(i)||(this._batchRegistry.add(i),i.isUndoable&&(r?this._undoCommand.addBatch(i):o||(this._undoCommand.addBatch(i),this._redoCommand.clearStack())))}),{priority:"highest"}),this.listenTo(this._undoCommand,"revert",((t,e,n)=>{this._redoCommand.addBatch(n)})),t.keystrokes.set("CTRL+Z","undo"),t.keystrokes.set("CTRL+Y","redo"),t.keystrokes.set("CTRL+SHIFT+Z","redo")}}var dv='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m5.042 9.367 2.189 1.837a.75.75 0 0 1-.965 1.149l-3.788-3.18a.747.747 0 0 1-.21-.284.75.75 0 0 1 .17-.945L6.23 4.762a.75.75 0 1 1 .964 1.15L4.863 7.866h8.917A.75.75 0 0 1 14 7.9a4 4 0 1 1-1.477 7.718l.344-1.489a2.5 2.5 0 1 0 1.094-4.73l.008-.032H5.042z"/></svg>',fv='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m14.958 9.367-2.189 1.837a.75.75 0 0 0 .965 1.149l3.788-3.18a.747.747 0 0 0 .21-.284.75.75 0 0 0-.17-.945L13.77 4.762a.75.75 0 1 0-.964 1.15l2.331 1.955H6.22A.75.75 0 0 0 6 7.9a4 4 0 1 0 1.477 7.718l-.344-1.489A2.5 2.5 0 1 1 6.039 9.4l-.008-.032h8.927z"/></svg>';class mv extends Uu{static get pluginName(){return"UndoUI"}init(){const t=this.editor,e=t.locale,n=t.t,i="ltr"==e.uiLanguageDirection?dv:fv,r="ltr"==e.uiLanguageDirection?fv:dv;this._addButton("undo",n("Undo"),"CTRL+Z",i),this._addButton("redo",n("Redo"),"CTRL+Y",r)}_addButton(t,e,n,i){const r=this.editor;r.ui.componentFactory.add(t,(o=>{const s=r.commands.get(t),a=new fg(o);return a.set({label:e,icon:i,keystroke:n,tooltip:!0}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",(()=>{r.execute(t),r.editing.view.focus()})),a}))}}class gv extends Uu{static get requires(){return[hv,mv]}static get pluginName(){return"Undo"}}class pv extends Wu{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,n=e.document.selection,i=void 0===t.forceValue?!this.value:t.forceValue;e.change((t=>{if(n.isCollapsed)i?t.setSelectionAttribute(this.attributeKey,!0):t.removeSelectionAttribute(this.attributeKey);else{const r=e.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const e of r)i?t.setAttribute(this.attributeKey,i,e):t.removeAttribute(this.attributeKey,e)}}))}_getValueFromFirstAllowedNode(){const t=this.editor.model,e=t.schema,n=t.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);for(const t of n.getRanges())for(const n of t.getItems())if(e.checkAttribute(n,this.attributeKey))return n.hasAttribute(this.attributeKey);return!1}}const wv="bold";class vv extends Uu{static get pluginName(){return"BoldEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:wv}),t.model.schema.setAttributeProperties(wv,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:wv,view:"strong",upcastAlso:["b",t=>{const e=t.getStyle("font-weight");return e&&("bold"==e||Number(e)>=600)?{name:!0,styles:["font-weight"]}:null}]}),t.commands.add(wv,new pv(t,wv)),t.keystrokes.set("CTRL+B",wv)}}const bv="bold";class yv extends Uu{static get pluginName(){return"BoldUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(bv,(n=>{const i=t.commands.get(bv),r=new fg(n);return r.set({label:e("Bold"),icon:Jm.bold,keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",(()=>{t.execute(bv),
t.editing.view.focus()})),r}))}}const _v="italic";class kv extends Uu{static get pluginName(){return"ItalicEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:_v}),t.model.schema.setAttributeProperties(_v,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:_v,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),t.commands.add(_v,new pv(t,_v)),t.keystrokes.set("CTRL+I",_v)}}const Av="italic";class xv extends Uu{static get pluginName(){return"ItalicUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(Av,(n=>{const i=t.commands.get(Av),r=new fg(n);return r.set({label:e("Italic"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m9.586 14.633.021.004c-.036.335.095.655.393.962.082.083.173.15.274.201h1.474a.6.6 0 1 1 0 1.2H5.304a.6.6 0 0 1 0-1.2h1.15c.474-.07.809-.182 1.005-.334.157-.122.291-.32.404-.597l2.416-9.55a1.053 1.053 0 0 0-.281-.823 1.12 1.12 0 0 0-.442-.296H8.15a.6.6 0 0 1 0-1.2h6.443a.6.6 0 1 1 0 1.2h-1.195c-.376.056-.65.155-.823.296-.215.175-.423.439-.623.79l-2.366 9.347z"/></svg>',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",(()=>{t.execute(Av),t.editing.view.focus()})),r}))}}const Tv="underline";class Cv extends Uu{static get pluginName(){return"UnderlineEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:Tv}),t.model.schema.setAttributeProperties(Tv,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:Tv,view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),t.commands.add(Tv,new pv(t,Tv)),t.keystrokes.set("CTRL+U","underline")}}const Ev="underline";class Sv extends Uu{static get pluginName(){return"UnderlineUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(Ev,(n=>{const i=t.commands.get(Ev),r=new fg(n);return r.set({label:e("Underline"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 18v-1.5h14V18zm2.2-8V3.6c0-.4.4-.6.8-.6.3 0 .7.2.7.6v6.2c0 2 1.3 2.8 3.2 2.8 1.9 0 3.4-.9 3.4-2.9V3.6c0-.3.4-.5.8-.5.3 0 .7.2.7.5V10c0 2.7-2.2 4-4.9 4-2.6 0-4.7-1.2-4.7-4z"/></svg>',keystroke:"CTRL+U",tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",(()=>{t.execute(Ev),t.editing.view.focus()})),r}))}}const Pv="strikethrough";class Rv extends Uu{static get pluginName(){return"StrikethroughEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:Pv}),t.model.schema.setAttributeProperties(Pv,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:Pv,view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),t.commands.add(Pv,new pv(t,Pv)),t.keystrokes.set("CTRL+SHIFT+X","strikethrough")}}const Ov="strikethrough";class Iv extends Uu{static get pluginName(){return"StrikethroughUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(Ov,(n=>{const i=t.commands.get(Ov),r=new fg(n);return r.set({label:e("Strikethrough"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 16.4c-.8-.4-1.5-.9-2.2-1.5a.6.6 0 0 1-.2-.5l.3-.6h1c1 1.2 2.1 1.7 3.7 1.7 1 0 1.8-.3 2.3-.6.6-.4.6-1.2.6-1.3.2-1.2-.9-2.1-.9-2.1h2.1c.3.7.4 1.2.4 1.7v.8l-.6 1.2c-.6.8-1.1 1-1.6 1.2a6 6 0 0 1-2.4.6c-1 0-1.8-.3-2.5-.6zM6.8 9 6 8.3c-.4-.5-.5-.8-.5-1.6 0-.7.1-1.3.5-1.8.4-.6 1-1 1.6-1.3a6.3 6.3 0 0 1 4.7 0 4 4 0 0 1 1.7 1l.3.7c0 .1.2.4-.2.7-.4.2-.9.1-1 0a3 3 0 0 0-1.2-1c-.4-.2-1-.3-2-.4-.7 0-1.4.2-2 .6-.8.6-1 .8-1 1.5 0 .8.5 1 1.2 1.5.6.4 1.1.7 1.9 1H6.8z"/><path d="M3 10.5V9h14v1.5z"/></svg>',keystroke:"CTRL+SHIFT+X",tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",(()=>{t.execute(Ov),t.editing.view.focus()})),r}))}}const Mv=["left","right","center","justify"],Nv="alignment";class Vv extends Wu{refresh(){const t=this.editor.locale,e=wt(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=Boolean(e)&&this._canBeAligned(e),this.isEnabled&&e.hasAttribute("alignment")?this.value=e.getAttribute("alignment"):this.value="rtl"===t.contentLanguageDirection?"right":"left"}execute(t={}){const e=this.editor,n=e.locale,i=e.model,r=i.document,o=t.value;i.change((t=>{const e=Array.from(r.selection.getSelectedBlocks()).filter((t=>this._canBeAligned(t))),i=e[0].getAttribute("alignment");Br(o,n)||i===o||!o?function(t,e){for(const n of t)e.removeAttribute(Nv,n)}(e,t):function(t,e,n){for(const i of t)e.setAttribute(Nv,n,i)}(e,t,o)}))}_canBeAligned(t){return this.editor.model.schema.checkAttribute(t,Nv)}}class Dv extends Uu{static get pluginName(){return"AlignmentEditing"}constructor(t){super(t),t.config.define("alignment",{options:Mv.map((t=>({name:t})))})}init(){const t=this.editor,e=t.locale,n=t.model.schema,i=Fr(t.config.get("alignment.options")).filter((t=>Dr(t.name)&&!Br(t.name,e))),r=i.some((t=>!!t.className));n.extend("$block",{allowAttributes:"alignment"}),t.model.schema.setAttributeProperties("alignment",{isFormatting:!0}),r?t.conversion.attributeToAttribute(function(t){const e={};for(const n of t)e[n.name]={key:"class",value:n.className};return{model:{key:"alignment",values:t.map((t=>t.name))},view:e}}(i)):t.conversion.for("downcast").attributeToAttribute(function(t){const e={};for(const{name:n}of t)e[n]={key:"style",value:{"text-align":n}};return{model:{key:"alignment",values:t.map((t=>t.name))},view:e}}(i));const o=function(t){const e=[];for(const{name:n}of t)e.push({view:{key:"style",value:{"text-align":n}},model:{key:"alignment",value:n}});return e}(i);for(const e of o)t.conversion.for("upcast").attributeToAttribute(e);const s=function(t){const e=[];for(const{name:n}of t)e.push({view:{key:"align",value:n},model:{key:"alignment",value:n}});return e}(i);for(const e of s)t.conversion.for("upcast").attributeToAttribute(e);t.commands.add("alignment",new Vv(t))}}const Bv=new Map([["left",Jm.alignLeft],["right",Jm.alignRight],["center",Jm.alignCenter],["justify",Jm.alignJustify]]);class Fv extends Uu{get localizedOptionTitles(){const t=this.editor.t;return{left:t("Align left"),right:t("Align right"),center:t("Align center"),justify:t("Justify")}}static get pluginName(){return"AlignmentUI"}init(){const t=this.editor,e=t.ui.componentFactory,n=t.t,i=Fr(t.config.get("alignment.options"));i.map((t=>t.name)).filter(Dr).forEach((t=>this._addButton(t))),e.add("alignment",(r=>{const o=Vi(r);Di(o,(()=>i.map((t=>e.create(`alignment:${t.name}`)))),{enableActiveItemFocusOnDropdownOpen:!0,isVertical:!0,ariaLabel:n("Text alignment toolbar")}),o.buttonView.set({label:n("Text alignment"),tooltip:!0}),o.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const s="rtl"===r.contentLanguageDirection?Bv.get("right"):Bv.get("left"),a=t.commands.get("alignment");return o.buttonView.bind("icon").to(a,"value",(t=>Bv.get(t)||s)),o.bind("isEnabled").to(a,"isEnabled"),this.listenTo(o,"execute",(()=>{t.editing.view.focus()})),o}))}_addButton(t){const e=this.editor;e.ui.componentFactory.add(`alignment:${t}`,(n=>{const i=e.commands.get("alignment"),r=new fg(n);return r.set({label:this.localizedOptionTitles[t],icon:Bv.get(t),tooltip:!0,isToggleable:!0}),r.bind("isEnabled").to(i),r.bind("isOn").to(i,"value",(e=>e===t)),this.listenTo(r,"execute",(()=>{e.execute("alignment",{value:t}),e.editing.view.focus()})),r}))}}class Lv extends Wu{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,n=e.schema,i=e.document.selection,r=Array.from(i.getSelectedBlocks()),o=void 0===t.forceValue?!this.value:t.forceValue;e.change((t=>{if(o){const e=r.filter((t=>Lr(t)||jr(n,t)));this._applyQuote(t,e)}else this._removeQuote(t,r.filter(Lr))}))}_getValue(){const t=wt(this.editor.model.document.selection.getSelectedBlocks());return!(!t||!Lr(t))}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,n=wt(t.getSelectedBlocks());return!!n&&jr(e,n)}_removeQuote(t,e){zr(t,e).reverse().forEach((e=>{if(e.start.isAtStart&&e.end.isAtEnd)return void t.unwrap(e.start.parent);if(e.start.isAtStart){const n=t.createPositionBefore(e.start.parent);return void t.move(e,n)}e.end.isAtEnd||t.split(e.end);const n=t.createPositionAfter(e.end.parent);t.move(e,n)}))}_applyQuote(t,e){const n=[];zr(t,e).reverse().forEach((e=>{let i=Lr(e.start);i||(i=t.createElement("blockQuote"),t.wrap(e,i)),n.push(i)})),n.reverse().reduce(((e,n)=>e.nextSibling==n?(t.merge(t.createPositionAfter(e)),e):n))}}class zv extends Uu{static get pluginName(){return"BlockQuoteEditing"}static get requires(){return[Sw,_w]}init(){const t=this.editor,e=t.model.schema;t.commands.add("blockQuote",new Lv(t)),e.register("blockQuote",{inheritAllFrom:"$container"}),t.conversion.elementToElement({model:"blockQuote",view:"blockquote"}),t.model.document.registerPostFixer((n=>{const i=t.model.document.differ.getChanges();for(const t of i)if("insert"==t.type){const i=t.position.nodeAfter;if(!i)continue;if(i.is("element","blockQuote")&&i.isEmpty)return n.remove(i),!0;if(i.is("element","blockQuote")&&!e.checkChild(t.position,i))return n.unwrap(i),!0;if(i.is("element")){const t=n.createRangeIn(i);for(const i of t.getItems())if(i.is("element","blockQuote")&&!e.checkChild(n.createPositionBefore(i),i))return n.unwrap(i),!0}}else if("remove"==t.type){const e=t.position.parent;if(e.is("element","blockQuote")&&e.isEmpty)return n.remove(e),!0}return!1}));const n=this.editor.editing.view.document,i=t.model.document.selection,r=t.commands.get("blockQuote");this.listenTo(n,"enter",((e,n)=>{i.isCollapsed&&r.value&&i.getLastPosition().parent.isEmpty&&(t.execute("blockQuote"),t.editing.view.scrollToTheSelection(),n.preventDefault(),e.stop())}),{context:"blockquote"}),this.listenTo(n,"delete",((e,n)=>{if("backward"!=n.direction||!i.isCollapsed||!r.value)return;const o=i.getLastPosition().parent;o.isEmpty&&!o.previousSibling&&(t.execute("blockQuote"),t.editing.view.scrollToTheSelection(),n.preventDefault(),e.stop())}),{context:"blockquote"})}}var jv=t(96243),Hv=t.n(jv),Uv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(Hv(),Uv),Hv().locals;class Wv extends Uu{static get pluginName(){return"BlockQuoteUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("blockQuote",(n=>{const i=t.commands.get("blockQuote"),r=new fg(n);return r.set({label:e("Block quote"),icon:Jm.quote,tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",(()=>{t.execute("blockQuote"),t.editing.view.focus()})),r}))}}class $v{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(t){Array.isArray(t)?t.forEach((t=>this._definitions.add(t))):this._definitions.add(t)}getDispatcher(){return t=>{t.on("attribute:linkHref",((t,e,n)=>{if(!n.consumable.test(e.item,"attribute:linkHref"))return;if(!e.item.is("selection")&&!n.schema.isInline(e.item))return;const i=n.writer,r=i.document.selection;for(const t of this._definitions){const o=i.createAttributeElement("a",t.attributes,{priority:5});t.classes&&i.addClass(t.classes,o);for(const e in t.styles)i.setStyle(e,t.styles[e],o);i.setCustomProperty("link",!0,o),t.callback(e.attributeNewValue)?e.item.is("selection")?i.wrap(r.getFirstRange(),o):i.wrap(n.mapper.toViewRange(e.range),o):i.unwrap(n.mapper.toViewRange(e.range),o)}}),{priority:"high"})}}getDispatcherForLinkedImage(){return t=>{t.on("attribute:linkHref:imageBlock",((t,e,{writer:n,mapper:i})=>{const r=i.toViewElement(e.item),o=Array.from(r.getChildren()).find((t=>"a"===t.name));for(const t of this._definitions){const i=vt(t.attributes);if(t.callback(e.attributeNewValue)){for(const[t,e]of i)"class"===t?n.addClass(e,o):n.setAttribute(t,e,o);t.classes&&n.addClass(t.classes,o);for(const e in t.styles)n.setStyle(e,t.styles[e],o)}else{for(const[t,e]of i)"class"===t?n.removeClass(e,o):n.removeAttribute(t,o);t.classes&&n.removeClass(t.classes,o);for(const e in t.styles)n.removeStyle(e,o)}}}))}}}var qv=function(t,e,n){var i=t.length;return n=void 0===n?i:n,!e&&n>=i?t:Th(t,e,n)},Kv=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),Gv=function(t){return Kv.test(t)},Jv=function(t){return t.split("")},Yv="[\\ud800-\\udfff]",Qv="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Xv="\\ud83c[\\udffb-\\udfff]",Zv="[^\\ud800-\\udfff]",tb="(?:\\ud83c[\\udde6-\\uddff]){2}",eb="[\\ud800-\\udbff][\\udc00-\\udfff]",nb="(?:"+Qv+"|"+Xv+")?",ib="[\\ufe0e\\ufe0f]?",rb=ib+nb+"(?:\\u200d(?:"+[Zv,tb,eb].join("|")+")"+ib+nb+")*",ob="(?:"+[Zv+Qv+"?",Qv,tb,eb,Yv].join("|")+")",sb=RegExp(Xv+"(?="+Xv+")|"+ob+rb,"g"),ab=function(t){return t.match(sb)||[]},cb=function(t){return Gv(t)?ab(t):Jv(t)},lb=function(t){return function(e){e=yh(e);var n=Gv(e)?cb(e):void 0,i=n?n[0]:e.charAt(0),r=n?qv(n,1).join(""):e.slice(1);return i[t]()+r}}("toUpperCase");const ub=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,hb=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i,db=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,fb=/^((\w+:(\/{2,})?)|(\W))/i,mb="Ctrl+K";class gb extends Wu{constructor(t){super(t),this.manualDecorators=new Lu,this.automaticDecorators=new $v}restoreManualDecoratorStates(){for(const t of this.manualDecorators)t.value=this._getDecoratorStateFromModel(t.id)}refresh(){const t=this.editor.model,e=t.document.selection,n=e.getSelectedElement()||wt(e.getSelectedBlocks());Wr(n,t.schema)?(this.value=n.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttribute(n,"linkHref")):(this.value=e.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttributeInSelection(e,"linkHref"));for(const t of this.manualDecorators)t.value=this._getDecoratorStateFromModel(t.id)}execute(t,e={}){const n=this.editor.model,i=n.document.selection,r=[],o=[];for(const t in e)e[t]?r.push(t):o.push(t);n.change((e=>{if(i.isCollapsed){const s=i.getFirstPosition();if(i.hasAttribute("linkHref")){const a=er(s,"linkHref",i.getAttribute("linkHref"),n);e.setAttribute("linkHref",t,a),r.forEach((t=>{e.setAttribute(t,!0,a)})),o.forEach((t=>{e.removeAttribute(t,a)})),e.setSelection(e.createPositionAfter(a.end.nodeBefore))}else if(""!==t){const o=vt(i.getAttributes());o.set("linkHref",t),r.forEach((t=>{o.set(t,!0)}));const{end:a}=n.insertContent(e.createText(t,o),s);e.setSelection(a)}["linkHref",...r,...o].forEach((t=>{e.removeSelectionAttribute(t)}))}else{const s=n.schema.getValidRanges(i.getRanges(),"linkHref"),a=[];for(const t of i.getSelectedBlocks())n.schema.checkAttribute(t,"linkHref")&&a.push(e.createRangeOn(t));const c=a.slice();for(const t of s)this._isRangeToUpdate(t,a)&&c.push(t);for(const n of c)e.setAttribute("linkHref",t,n),r.forEach((t=>{e.setAttribute(t,!0,n)})),o.forEach((t=>{e.removeAttribute(t,n)}))}}))}_getDecoratorStateFromModel(t){const e=this.editor.model,n=e.document.selection,i=n.getSelectedElement();return Wr(i,e.schema)?i.getAttribute(t):n.getAttribute(t)}_isRangeToUpdate(t,e){for(const n of e)if(n.containsRange(t))return!1;return!0}}class pb extends Wu{refresh(){const t=this.editor.model,e=t.document.selection,n=e.getSelectedElement();Wr(n,t.schema)?this.isEnabled=t.schema.checkAttribute(n,"linkHref"):this.isEnabled=t.schema.checkAttributeInSelection(e,"linkHref")}execute(){const t=this.editor,e=this.editor.model,n=e.document.selection,i=t.commands.get("link");e.change((t=>{const r=n.isCollapsed?[er(n.getFirstPosition(),"linkHref",n.getAttribute("linkHref"),e)]:e.schema.getValidRanges(n.getRanges(),"linkHref");for(const e of r)if(t.removeAttribute("linkHref",e),i)for(const n of i.manualDecorators)t.removeAttribute(n.id,e)}))}}class wb{constructor({id:t,label:e,attributes:n,classes:i,styles:r,defaultValue:o}){this.id=t,this.set("value"),this.defaultValue=o,this.label=e,this.attributes=n,this.classes=i,this.styles=r}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}s(wb,y);var vb=t(84586),bb=t.n(vb),yb={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(bb(),yb),bb().locals;const _b="automatic",kb=/^(https?:)?\/\//;class Ab extends Uu{static get pluginName(){return"LinkEditing"}static get requires(){return[xw,fw,cw]}constructor(t){super(t),t.config.define("link",{addTargetToExternalLinks:!1})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"linkHref"}),t.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:Hr}),t.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(t,e)=>Hr(Ur(t),e)}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:t=>t.getAttribute("href")}}),t.commands.add("link",new gb(t)),t.commands.add("unlink",new pb(t));const e=function(t,e){const n={"Open in a new tab":t("Open in a new tab"),Downloadable:t("Downloadable")};return e.forEach((t=>(t.label&&n[t.label]&&(t.label=n[t.label]),t))),e}(t.t,function(t){const e=[];if(t)for(const[n,i]of Object.entries(t)){const t=Object.assign({},i,{id:`link${lb(n)}`});e.push(t)}return e}(t.config.get("link.decorators")));this._enableAutomaticDecorators(e.filter((t=>t.mode===_b))),this._enableManualDecorators(e.filter((t=>"manual"===t.mode))),t.plugins.get(xw).registerAttribute("linkHref"),function(t,e,n,i){const r=t.editing.view,o=new Set;r.document.registerPostFixer((r=>{const s=t.model.document.selection;let a=!1;if(s.hasAttribute(e)){const c=er(s.getFirstPosition(),e,s.getAttribute(e),t.model),l=t.editing.mapper.toViewRange(c);for(const t of l.getItems())t.is("element",n)&&!t.hasClass(i)&&(r.addClass(i,t),o.add(t),a=!0)}return a})),t.conversion.for("editingDowncast").add((t=>{function e(){r.change((t=>{for(const e of o.values())t.removeClass(i,e),o.delete(e)}))}t.on("insert",e,{priority:"highest"}),t.on("remove",e,{priority:"highest"}),t.on("attribute",e,{priority:"highest"}),t.on("selection",e,{priority:"highest"})}))}(t,"linkHref","a","ck-link_selected"),this._enableLinkOpen(),this._enableInsertContentSelectionAttributesFixer(),this._enableClickingAfterLink(),this._enableTypingOverLink(),this._handleDeleteContentAfterLink(),this._enableClipboardIntegration()}_enableAutomaticDecorators(t){const e=this.editor,n=e.commands.get("link").automaticDecorators;e.config.get("link.addTargetToExternalLinks")&&n.add({id:"linkIsExternal",mode:_b,callback:t=>kb.test(t),attributes:{target:"_blank",rel:"noopener noreferrer"}}),n.add(t),n.length&&e.conversion.for("downcast").add(n.getDispatcher())}_enableManualDecorators(t){if(!t.length)return;const e=this.editor,n=e.commands.get("link").manualDecorators;t.forEach((t=>{e.model.schema.extend("$text",{allowAttributes:t.id}),t=new wb(t),n.add(t),e.conversion.for("downcast").attributeToElement({model:t.id,view:(e,{writer:n,schema:i},{item:r})=>{if((r.is("selection")||i.isInline(r))&&e){const e=n.createAttributeElement("a",t.attributes,{priority:5});t.classes&&n.addClass(t.classes,e);for(const i in t.styles)n.setStyle(i,t.styles[i],e);return n.setCustomProperty("link",!0,e),e}}}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",...t._createPattern()},model:{key:t.id}})}))}_enableLinkOpen(){const t=this.editor,e=t.editing.view.document;this.listenTo(e,"click",((t,e)=>{if(!(js.isMac?e.domEvent.metaKey:e.domEvent.ctrlKey))return;let n=e.domTarget;if("a"!=n.tagName.toLowerCase()&&(n=n.closest("a")),!n)return;const i=n.getAttribute("href");i&&(t.stop(),e.preventDefault(),Kr(i))}),{context:"$capture"}),this.listenTo(e,"keydown",((e,n)=>{const i=t.commands.get("link").value;i&&n.keyCode===Vu.enter&&n.altKey&&(e.stop(),Kr(i))}))}_enableInsertContentSelectionAttributesFixer(){const t=this.editor.model,e=t.document.selection;this.listenTo(t,"insertContent",(()=>{const n=e.anchor.nodeBefore,i=e.anchor.nodeAfter;e.hasAttribute("linkHref")&&n&&n.hasAttribute("linkHref")&&(i&&i.hasAttribute("linkHref")||t.change((e=>{Gr(e,Yr(t.schema))})))}),{priority:"low"})}_enableClickingAfterLink(){const t=this.editor,e=t.model;t.editing.view.addObserver(Dm);let n=!1;this.listenTo(t.editing.view.document,"mousedown",(()=>{n=!0})),this.listenTo(t.editing.view.document,"selectionChange",(()=>{if(!n)return;n=!1;const t=e.document.selection;if(!t.isCollapsed)return;if(!t.hasAttribute("linkHref"))return;const i=t.getFirstPosition(),r=er(i,"linkHref",t.getAttribute("linkHref"),e);(i.isTouching(r.start)||i.isTouching(r.end))&&e.change((t=>{Gr(t,Yr(e.schema))}))}))}_enableTypingOverLink(){const t=this.editor,e=t.editing.view;let n,i;this.listenTo(e.document,"delete",(()=>{i=!0}),{priority:"high"}),this.listenTo(t.model,"deleteContent",(()=>{const e=t.model.document.selection;e.isCollapsed||(i?i=!1:Jr(t)&&function(t){const e=t.document.selection,n=e.getFirstPosition(),i=e.getLastPosition(),r=n.nodeAfter;if(!r)return!1;if(!r.is("$text"))return!1;if(!r.hasAttribute("linkHref"))return!1;return r===(i.textNode||i.nodeBefore)||er(n,"linkHref",r.getAttribute("linkHref"),t).containsRange(t.createRange(n,i),!0)}(t.model)&&(n=e.getAttributes()))}),{priority:"high"}),this.listenTo(t.model,"insertContent",((e,[r])=>{i=!1,Jr(t)&&n&&(t.model.change((t=>{for(const[e,i]of n)t.setAttribute(e,i,r)})),n=null)}),{priority:"high"})}_handleDeleteContentAfterLink(){const t=this.editor,e=t.model,n=e.document.selection,i=t.editing.view;let r=!1,o=!1;this.listenTo(i.document,"delete",((t,e)=>{o="backward"===e.direction}),{priority:"high"}),this.listenTo(e,"deleteContent",(()=>{r=!1;const t=n.getFirstPosition(),i=n.getAttribute("linkHref");if(!i)return;const o=er(t,"linkHref",i,e);r=o.containsPosition(t)||o.end.isEqual(t)}),{priority:"high"}),this.listenTo(e,"deleteContent",(()=>{o&&(o=!1,r||t.model.enqueueChange((t=>{Gr(t,Yr(e.schema))})))}),{priority:"low"})}_enableClipboardIntegration(){const t=this.editor,e=t.model,n=this.editor.config.get("link.defaultProtocol");n&&this.listenTo(t.plugins.get("ClipboardPipeline"),"contentInsertion",((t,i)=>{e.change((t=>{const e=t.createRangeIn(i.content);for(const i of e.getItems())if(i.hasAttribute("linkHref")){const e=$r(i.getAttribute("linkHref"),n);t.setAttribute("linkHref",e,i)}}))}))}}var xb=t(54877),Tb=t.n(xb),Cb={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0},Eb=(Yu()(Tb(),Cb),Tb().locals,t(16044)),Sb=t.n(Eb),Pb={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(Sb(),Pb),Sb().locals;class Rb extends tg{constructor(t,e){super(t);const n=t.t;this.focusTracker=new zu,this.keystrokes=new ju,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),Jm.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),Jm.cancel,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(e),this.children=this._createFormChildren(e.manualDecorators),this._focusables=new Ym,this._focusCycler=new Mg({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const i=["ck","ck-link-form","ck-responsive-form"];e.manualDecorators.length&&i.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:i,tabindex:"-1"},children:this.children}),di(this)}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce(((t,e)=>(t[e.name]=e.isOn,t)),{})}render(){super.render(),fi({view:this}),[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach((t=>{this._focusables.add(t),this.focusTracker.add(t.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const t=this.locale.t,e=new Dp(this.locale,$i);return e.label=t("Link URL"),e}_createButton(t,e,n,i){const r=new fg(this.locale);return r.set({label:t,icon:e,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}_createManualDecoratorSwitches(t){const e=this.createCollection();for(const n of t.manualDecorators){const i=new wg(this.locale);i.set({name:n.id,label:n.label,withText:!0}),i.bind("isOn").toMany([n,t],"value",((t,e)=>void 0===e&&void 0===t?n.defaultValue:t)),i.on("execute",(()=>{n.set("value",!i.isOn)})),e.add(i)}return e}_createFormChildren(t){const e=this.createCollection();if(e.add(this.urlInputView),t.length){const t=new tg;t.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map((t=>({tag:"li",children:[t],attributes:{class:["ck","ck-list__item"]}}))),attributes:{class:["ck","ck-reset","ck-list"]}}),e.add(t)}return e.add(this.saveButtonView),e.add(this.cancelButtonView),e}}var Ob=t(21945),Ib=t.n(Ob),Mb={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0},Nb=(Yu()(Ib(),Mb),Ib().locals,'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184zm4.919 10.562-1.414 1.414a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.061-1.06l1.414 1.414 1.414-1.415a.75.75 0 0 1 1.061 1.061l-1.414 1.414 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414z"/></svg>');class Vb extends tg{constructor(t){super(t);const e=t.t;this.focusTracker=new zu,this.keystrokes=new ju,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(e("Unlink"),Nb,"unlink"),this.editButtonView=this._createButton(e("Edit link"),Jm.pencil,"edit"),this.set("href"),this._focusables=new Ym,this._focusCycler=new Mg({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render(),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach((t=>{this._focusables.add(t),this.focusTracker.add(t.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createButton(t,e,n){const i=new fg(this.locale);return i.set({label:t,icon:e,tooltip:!0}),i.delegate("execute").to(this,n),i}_createPreviewButton(){const t=new fg(this.locale),e=this.bindTemplate,n=this.t;return t.set({withText:!0,tooltip:n("Open link in new tab")}),t.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:e.to("href",(t=>t&&Ur(t))),target:"_blank",rel:"noopener noreferrer"}}),t.bind("label").to(this,"href",(t=>t||n("This link has no URL"))),t.bind("isEnabled").to(this,"href",(t=>!!t)),t.template.tag="a",t.template.eventListeners={},t}}var Db='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184z"/></svg>';const Bb="link-ui";class Fb extends Uu{static get requires(){return[$p]}static get pluginName(){return"LinkUI"}init(){const t=this.editor;t.editing.view.addObserver(Vm),this.actionsView=null,this.formView=null,this._balloon=t.plugins.get($p),this._createToolbarLinkButton(),this._enableBalloonActivators(),t.conversion.for("editingDowncast").markerToHighlight({model:Bb,view:{classes:["ck-fake-link-selection"]}}),t.conversion.for("editingDowncast").markerToElement({model:Bb,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy(),this.formView&&this.formView.destroy(),this.actionsView&&this.actionsView.destroy()}_createViews(){this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._enableUserBalloonInteractions()}_createActionsView(){const t=this.editor,e=new Vb(t.locale),n=t.commands.get("link"),i=t.commands.get("unlink");return e.bind("href").to(n,"value"),e.editButtonView.bind("isEnabled").to(n),e.unlinkButtonView.bind("isEnabled").to(i),this.listenTo(e,"edit",(()=>{this._addFormView()})),this.listenTo(e,"unlink",(()=>{t.execute("unlink"),this._hideUI()})),e.keystrokes.set("Esc",((t,e)=>{this._hideUI(),e()})),e.keystrokes.set(mb,((t,e)=>{this._addFormView(),e()})),e}_createFormView(){const t=this.editor,e=t.commands.get("link"),n=t.config.get("link.defaultProtocol"),i=new Rb(t.locale,e);return i.urlInputView.fieldView.bind("value").to(e,"value"),i.urlInputView.bind("isReadOnly").to(e,"isEnabled",(t=>!t)),i.saveButtonView.bind("isEnabled").to(e),this.listenTo(i,"submit",(()=>{const{value:e}=i.urlInputView.fieldView.element,r=$r(e,n);t.execute("link",r,i.getDecoratorSwitchesState()),this._closeFormView()})),this.listenTo(i,"cancel",(()=>{this._closeFormView()})),i.keystrokes.set("Esc",((t,e)=>{this._closeFormView(),e()})),i}_createToolbarLinkButton(){const t=this.editor,e=t.commands.get("link"),n=t.t;t.ui.componentFactory.add("link",(t=>{const i=new fg(t);return i.isEnabled=!0,i.label=n("Link"),i.icon=Db,i.keystroke=mb,i.tooltip=!0,i.isToggleable=!0,i.bind("isEnabled").to(e,"isEnabled"),i.bind("isOn").to(e,"value",(t=>!!t)),this.listenTo(i,"execute",(()=>this._showUI(!0))),i}))}_enableBalloonActivators(){const t=this.editor,e=t.editing.view.document;this.listenTo(e,"click",(()=>{this._getSelectedLinkElement()&&this._showUI()})),t.keystrokes.set(mb,((e,n)=>{n(),t.commands.get("link").isEnabled&&this._showUI(!0)}))}_enableUserBalloonInteractions(){this.editor.keystrokes.set("Tab",((t,e)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),e())}),{priority:"high"}),this.editor.keystrokes.set("Esc",((t,e)=>{this._isUIVisible&&(this._hideUI(),e())})),hi({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this.actionsView||this._createViews(),this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this.formView||this._createViews(),this._isFormInPanel)return;const t=this.editor.commands.get("link");this.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions(),this.formView.urlInputView.fieldView.element.value=t.value||""}_closeFormView(){const t=this.editor.commands.get("link");t.restoreManualDecoratorStates(),void 0!==t.value?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(t=!1){this.formView||this._createViews(),this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),t&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),t&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const t=this.editor;this.stopListening(t.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),t.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){function t(){return n.selection.focus.getAncestors().reverse().find((t=>t.is("element")))}const e=this.editor,n=e.editing.view.document;let i=this._getSelectedLinkElement(),r=t();const o=()=>{const e=this._getSelectedLinkElement(),n=t();i&&!e||!i&&n!==r?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),i=e,r=n}
;this.listenTo(e.ui,"update",o),this.listenTo(this._balloon,"change:visibleView",o)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const t=this.editor.editing.view,e=this.editor.model,n=t.document;let i=null;if(e.markers.has(Bb)){const e=Array.from(this.editor.editing.mapper.markerNameToElements(Bb)),n=t.createRange(t.createPositionBefore(e[0]),t.createPositionAfter(e[e.length-1]));i=t.domConverter.viewRangeToDom(n)}else i=()=>{const e=this._getSelectedLinkElement();return e?t.domConverter.mapViewToDom(e):t.domConverter.viewRangeToDom(n.selection.getFirstRange())};return{target:i}}_getSelectedLinkElement(){const t=this.editor.editing.view,e=t.document.selection,n=e.getSelectedElement();if(e.isCollapsed||n&&ur(n))return Qr(e.getFirstPosition());{const n=e.getFirstRange().getTrimmed(),i=Qr(n.start),r=Qr(n.end);return i&&i==r&&t.createRangeIn(i).getTrimmed().isEqual(n)?i:null}}_showFakeVisualSelection(){const t=this.editor.model;t.change((e=>{const n=t.document.selection.getFirstRange();if(t.markers.has(Bb))e.updateMarker(Bb,{range:n});else if(n.start.isAtEnd){const i=n.start.getLastMatchingPosition((({item:e})=>!t.schema.isContent(e)),{boundaries:n});e.addMarker(Bb,{usingOperation:!1,affectsData:!1,range:e.createRange(i,n.end)})}else e.addMarker(Bb,{usingOperation:!1,affectsData:!1,range:n})}))}_hideFakeVisualSelection(){const t=this.editor.model;t.markers.has(Bb)&&t.change((t=>{t.removeMarker(Bb)}))}}const Lb=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class zb extends Uu{static get requires(){return[_w]}static get pluginName(){return"AutoLink"}init(){const t=this.editor.model.document.selection;t.on("change:range",(()=>{this.isEnabled=!t.anchor.parent.is("element","codeBlock")})),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling()}_enableTypingHandling(){const t=this.editor,e=new Aw(t.model,(t=>{if(!function(t){return t.length>4&&" "===t[t.length-1]&&" "!==t[t.length-2]}(t))return;const e=Xr(t.substr(0,t.length-1));return e?{url:e}:void 0}));e.on("matched:data",((e,n)=>{const{batch:i,range:r,url:o}=n;if(!i.isTyping)return;const s=r.end.getShiftedBy(-1),a=s.getShiftedBy(-o.length),c=t.model.createRange(a,s);this._applyAutoLink(o,c)})),e.bind("isEnabled").to(this)}_enableEnterHandling(){const t=this.editor,e=t.model,n=t.commands.get("enter");n&&n.on("execute",(()=>{const t=e.document.selection.getFirstPosition();if(!t.parent.previousSibling)return;const n=e.createRangeIn(t.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(n)}))}_enableShiftEnterHandling(){const t=this.editor,e=t.model,n=t.commands.get("shiftEnter");n&&n.on("execute",(()=>{const t=e.document.selection.getFirstPosition(),n=e.createRange(e.createPositionAt(t.parent,0),t.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(n)}))}_checkAndApplyAutoLinkOnRange(t){const e=this.editor.model,{text:n,range:i}=Ji(t,e),r=Xr(n);if(r){const t=e.createRange(i.end.getShiftedBy(-r.length),i.end);this._applyAutoLink(r,t)}}_applyAutoLink(t,e){const n=this.editor.model,i=$r(t,this.editor.config.get("link.defaultProtocol"));this.isEnabled&&function(t,e){return e.schema.checkAttributeInSelection(e.createSelection(t),"linkHref")}(e,n)&&qr(i)&&!function(t){const e=t.start.nodeAfter;return e&&e.hasAttribute("linkHref")}(e)&&this._persistAutoLink(i,e)}_persistAutoLink(t,e){const n=this.editor.model,i=this.editor.plugins.get("Delete");n.enqueueChange((r=>{r.setAttribute("linkHref",t,e),n.enqueueChange((()=>{i.requestUndoOnBackspace()}))}))}}class jb extends Wu{constructor(t,e){super(t),this.type=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,n=e.document,i=Array.from(n.selection.getSelectedBlocks()).filter((t=>to(t,e.schema))),r=void 0!==t.forceValue?!t.forceValue:this.value;e.change((t=>{if(r){let e=i[i.length-1].nextSibling,n=Number.POSITIVE_INFINITY,r=[];for(;e&&"listItem"==e.name&&0!==e.getAttribute("listIndent");){const t=e.getAttribute("listIndent");t<n&&(n=t);const i=t-n;r.push({element:e,listIndent:i}),e=e.nextSibling}r=r.reverse();for(const e of r)t.setAttribute("listIndent",e.listIndent,e.element)}if(!r){let t=Number.POSITIVE_INFINITY;for(const e of i)e.is("element","listItem")&&e.getAttribute("listIndent")<t&&(t=e.getAttribute("listIndent"));t=0===t?1:t,Zr(i,!0,t),Zr(i,!1,t)}for(const e of i.reverse())r&&"listItem"==e.name?t.rename(e,"paragraph"):r||"listItem"==e.name?r||"listItem"!=e.name||e.getAttribute("listType")==this.type||t.setAttribute("listType",this.type,e):(t.setAttributes({listType:this.type,listIndent:0},e),t.rename(e,"listItem"));this.fire("_executeCleanup",i)}))}_getValue(){const t=wt(this.editor.model.document.selection.getSelectedBlocks());return!!t&&t.is("element","listItem")&&t.getAttribute("listType")==this.type}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,n=wt(t.getSelectedBlocks());return!!n&&to(n,e)}}class Hb extends Wu{constructor(t,e){super(t),this._indentBy="forward"==e?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document;let n=Array.from(e.selection.getSelectedBlocks());t.change((t=>{const e=n[n.length-1];let i=e.nextSibling;for(;i&&"listItem"==i.name&&i.getAttribute("listIndent")>e.getAttribute("listIndent");)n.push(i),i=i.nextSibling;this._indentBy<0&&(n=n.reverse());for(const e of n){const n=e.getAttribute("listIndent")+this._indentBy;n<0?t.rename(e,"paragraph"):t.setAttribute("listIndent",n,e)}this.fire("_executeCleanup",n)}))}_checkEnabled(){const t=wt(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is("element","listItem"))return!1;if(this._indentBy>0){const e=t.getAttribute("listIndent"),n=t.getAttribute("listType");let i=t.previousSibling;for(;i&&i.is("element","listItem")&&i.getAttribute("listIndent")>=e;){if(i.getAttribute("listIndent")==e)return i.getAttribute("listType")==n;i=i.previousSibling}return!1}return!0}}const Ub=["disc","circle","square"],Wb=["decimal","decimal-leading-zero","lower-roman","upper-roman","lower-latin","upper-latin"];class $b extends Uu{static get pluginName(){return"ListUtils"}getListTypeFromListStyleType(t){return function(t){return Ub.includes(t)?"bulleted":Wb.includes(t)?"numbered":null}(t)}getSelectedListItems(t){return function(t){let e=[...t.document.selection.getSelectedBlocks()].filter((t=>t.is("element","listItem"))).map((e=>{const n=t.change((t=>t.createPositionAt(e,0)));return[...ao(n,"backward"),...ao(n,"forward")]})).flat();return e=[...new Set(e)],e}(t)}getSiblingNodes(t,e){return ao(t,e)}}const qb=(t,e,n)=>{if(!n.consumable.test(e.item,t.name))return;const i=n.mapper.toViewElement(e.item),r=n.writer;r.breakContainer(r.createPositionBefore(i)),r.breakContainer(r.createPositionAfter(i));const o=i.parent,s="numbered"==e.attributeNewValue?"ol":"ul";r.rename(s,o)},Kb=(t,e,n)=>{n.consumable.consume(e.item,t.name);const i=n.mapper.toViewElement(e.item).parent,r=n.writer;io(r,i,i.nextSibling),io(r,i.previousSibling,i)},Gb=(t,e,n)=>{if(n.consumable.test(e.item,t.name)&&"listItem"!=e.item.name){let t=n.mapper.toViewPosition(e.range.start);const i=n.writer,r=[];for(;("ul"==t.parent.name||"ol"==t.parent.name)&&(t=i.breakContainer(t),"li"==t.parent.name);){const e=t,n=i.createPositionAt(t.parent,"end");if(!e.isEqual(n)){const t=i.remove(i.createRange(e,n));r.push(t)}t=i.createPositionAfter(t.parent)}if(r.length>0){for(let e=0;e<r.length;e++){const n=t.nodeBefore;if(t=i.insert(t,r[e]).end,e>0){const e=io(i,n,n.nextSibling);e&&e.parent==n&&t.offset--}}io(i,t.nodeBefore,t.nodeAfter)}}},Jb=(t,e,n)=>{const i=n.mapper.toViewPosition(e.position),r=i.nodeBefore,o=i.nodeAfter;io(n.writer,r,o)},Yb=(t,e,n)=>{if(n.consumable.consume(e.viewItem,{name:!0})){const t=n.writer,i=t.createElement("listItem"),r=function(t){let e=0,n=t.parent;for(;n;){if(n.is("element","li"))e++;else{const t=n.previousSibling;t&&t.is("element","li")&&e++}n=n.parent}return e}(e.viewItem);t.setAttribute("listIndent",r,i);const o=e.viewItem.parent&&"ol"==e.viewItem.parent.name?"numbered":"bulleted";if(t.setAttribute("listType",o,i),!n.safeInsert(i,e.modelCursor))return;const s=function(t,e,n){const{writer:i,schema:r}=n;let o=i.createPositionAfter(t);for(const s of e)if("ul"==s.name||"ol"==s.name)o=n.convertItem(s,o).modelCursor;else{const e=n.convertItem(s,i.createPositionAt(t,"end")),a=e.modelRange.start.nodeAfter;a&&a.is("element")&&!r.checkChild(t,a.name)&&(t=e.modelCursor.parent.is("element","listItem")?e.modelCursor.parent:ho(e.modelCursor),o=i.createPositionAfter(t))}return o}(i,e.viewItem.getChildren(),n);e.modelRange=t.createRange(e.modelCursor,s),n.updateConversionResult(i,e)}},Qb=(t,e,n)=>{if(n.consumable.test(e.viewItem,{name:!0})){const t=Array.from(e.viewItem.getChildren());for(const e of t)!e.is("element","li")&&!mo(e)&&e._remove()}},Xb=(t,e,n)=>{if(n.consumable.test(e.viewItem,{name:!0})){if(0===e.viewItem.childCount)return;const t=[...e.viewItem.getChildren()];let n=!1;for(const e of t)n&&!mo(e)&&e._remove(),mo(e)&&(n=!0)}},Zb=function(t,[e,n,i]){const r=this;let o,s=e.is("documentFragment")?e.getChild(0):e;if(o=n?r.createSelection(n,i):r.document.selection,s&&s.is("element","listItem")){const t=o.getFirstPosition();let e=null;if(t.parent.is("element","listItem")?e=t.parent:t.nodeBefore&&t.nodeBefore.is("element","listItem")&&(e=t.nodeBefore),e){const t=e.getAttribute("listIndent");if(t>0)for(;s&&s.is("element","listItem");)s._setAttribute("listIndent",s.getAttribute("listIndent")+t),s=s.nextSibling}}};var ty=t(69318),ey=t.n(ty),ny={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(ey(),ny),ey().locals;class iy extends Uu{static get pluginName(){return"ListEditing"}static get requires(){return[Sw,_w,$b]}init(){const t=this.editor;t.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const e=t.data,n=t.editing;var i;t.model.document.registerPostFixer((e=>function(t,e){function n(t){const e=t.nodeBefore;if(e&&e.is("element","listItem")){let t=e;if(s.has(t))return;for(let e=t.previousSibling;e&&e.is("element","listItem");e=t.previousSibling)if(t=e,s.has(t))return;s.set(e,t)}else{const e=t.nodeAfter;e&&e.is("element","listItem")&&s.set(e,e)}}function i(t){let n=0,i=null;for(;t&&t.is("element","listItem");){const r=t.getAttribute("listIndent");if(r>n){let o;null===i?(i=r-n,o=n):(i>r&&(i=r),o=r-i),e.setAttribute("listIndent",o,t),a=!0}else i=null,n=t.getAttribute("listIndent")+1;t=t.nextSibling}}function r(t){let n=[],i=null;for(;t&&t.is("element","listItem");){const r=t.getAttribute("listIndent");if(i&&i.getAttribute("listIndent")>r&&(n=n.slice(0,r+1)),0!=r)if(n[r]){const i=n[r];t.getAttribute("listType")!=i&&(e.setAttribute("listType",i,t),a=!0)}else n[r]=t.getAttribute("listType");i=t,t=t.nextSibling}}const o=t.document.differ.getChanges(),s=new Map;let a=!1;for(const i of o)if("insert"==i.type&&"listItem"==i.name)n(i.position);else if("insert"==i.type&&"listItem"!=i.name){if("$text"!=i.name){const r=i.position.nodeAfter;r.hasAttribute("listIndent")&&(e.removeAttribute("listIndent",r),a=!0),r.hasAttribute("listType")&&(e.removeAttribute("listType",r),a=!0),r.hasAttribute("listStyle")&&(e.removeAttribute("listStyle",r),a=!0),r.hasAttribute("listReversed")&&(e.removeAttribute("listReversed",r),a=!0),r.hasAttribute("listStart")&&(e.removeAttribute("listStart",r),a=!0);for(const e of Array.from(t.createRangeIn(r)).filter((t=>t.item.is("element","listItem"))))n(e.previousPosition)}n(i.position.getShiftedBy(i.length))}else"remove"==i.type&&"listItem"==i.name?n(i.position):("attribute"==i.type&&"listIndent"==i.attributeKey||"attribute"==i.type&&"listType"==i.attributeKey)&&n(i.range.start);for(const t of s.values())i(t),r(t);return a}(t.model,e))),n.mapper.registerViewToModelLength("li",go),e.mapper.registerViewToModelLength("li",go),n.mapper.on("modelToViewPosition",uo(n.view)),n.mapper.on("viewToModelPosition",(i=t.model,(t,e)=>{const n=e.viewPosition,r=n.parent,o=e.mapper;if("ul"==r.name||"ol"==r.name){if(n.isAtEnd){const t=o.toModelElement(n.nodeBefore),r=o.getModelLength(n.nodeBefore);e.modelPosition=i.createPositionBefore(t).getShiftedBy(r)}else{const t=o.toModelElement(n.nodeAfter);e.modelPosition=i.createPositionBefore(t)}t.stop()}else if("li"==r.name&&n.nodeBefore&&("ul"==n.nodeBefore.name||"ol"==n.nodeBefore.name)){const s=o.toModelElement(r);let a=1,c=n.nodeBefore;for(;c&&mo(c);)a+=o.getModelLength(c),c=c.previousSibling;e.modelPosition=i.createPositionBefore(s).getShiftedBy(a),t.stop()}})),e.mapper.on("modelToViewPosition",uo(n.view)),t.conversion.for("editingDowncast").add((e=>{e.on("insert",Gb,{priority:"high"}),e.on("insert:listItem",lo(t.model)),e.on("attribute:listType:listItem",qb,{priority:"high"}),e.on("attribute:listType:listItem",Kb,{priority:"low"}),e.on("attribute:listIndent:listItem",function(t){return(e,n,i)=>{if(!i.consumable.consume(n.item,"attribute:listIndent"))return;const r=i.mapper.toViewElement(n.item),o=i.writer;o.breakContainer(o.createPositionBefore(r)),o.breakContainer(o.createPositionAfter(r));const s=r.parent,a=s.previousSibling,c=o.createRangeOn(s);o.remove(c),a&&a.nextSibling&&io(o,a,a.nextSibling),fo(n.attributeOldValue+1,n.range.start,c.start,r,i,t),no(n.item,r,i,t);for(const t of n.item.getChildren())i.consumable.consume(t,"insert")}}(t.model)),e.on("remove:listItem",function(t){return(e,n,i)=>{const r=i.mapper.toViewPosition(n.position).getLastMatchingPosition((t=>!t.item.is("element","li"))).nodeAfter,o=i.writer;o.breakContainer(o.createPositionBefore(r)),o.breakContainer(o.createPositionAfter(r));const s=r.parent,a=s.previousSibling,c=o.createRangeOn(s),l=o.remove(c);a&&a.nextSibling&&io(o,a,a.nextSibling),fo(i.mapper.toModelElement(r).getAttribute("listIndent")+1,n.position,c.start,r,i,t);for(const t of o.createRangeIn(l).getItems())i.mapper.unbindViewElement(t);e.stop()}}(t.model)),e.on("remove",Jb,{priority:"low"})})),t.conversion.for("dataDowncast").add((e=>{e.on("insert",Gb,{priority:"high"}),e.on("insert:listItem",lo(t.model))})),t.conversion.for("upcast").add((t=>{t.on("element:ul",Qb,{priority:"high"}),t.on("element:ol",Qb,{priority:"high"}),t.on("element:li",Xb,{priority:"high"}),t.on("element:li",Yb)})),t.model.on("insertContent",Zb,{priority:"high"}),t.commands.add("numberedList",new jb(t,"numbered")),t.commands.add("bulletedList",new jb(t,"bulleted")),t.commands.add("indentList",new Hb(t,"forward")),t.commands.add("outdentList",new Hb(t,"backward"));const r=n.view.document;this.listenTo(r,"enter",((t,e)=>{const n=this.editor.model.document,i=n.selection.getLastPosition().parent;n.selection.isCollapsed&&"listItem"==i.name&&i.isEmpty&&(this.editor.execute("outdentList"),e.preventDefault(),t.stop())}),{context:"li"}),this.listenTo(r,"delete",((t,e)=>{if("backward"!==e.direction)return;const n=this.editor.model.document.selection;if(!n.isCollapsed)return;const i=n.getFirstPosition();if(!i.isAtStart)return;const r=i.parent;"listItem"===r.name&&(r.previousSibling&&"listItem"===r.previousSibling.name||(this.editor.execute("outdentList"),e.preventDefault(),t.stop()))}),{context:"li"}),this.listenTo(t.editing.view.document,"tab",((e,n)=>{const i=n.shiftKey?"outdentList":"indentList";this.editor.commands.get(i).isEnabled&&(t.execute(i),n.stopPropagation(),n.preventDefault(),e.stop())}),{context:"li"})}afterInit(){const t=this.editor.commands,e=t.get("indent"),n=t.get("outdent");e&&e.registerChildCommand(t.get("indentList")),n&&n.registerChildCommand(t.get("outdentList"))}}class ry extends Uu{static get pluginName(){return"ListUI"}init(){const t=this.editor.t;so(this.editor,"numberedList",t("Numbered List"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM3.5 3v5H2V3.7H1v-1h2.5V3zM.343 17.857l2.59-3.257H2.92a.6.6 0 1 0-1.04 0H.302a2 2 0 1 1 3.995 0h-.001c-.048.405-.16.734-.333.988-.175.254-.59.692-1.244 1.312H4.3v1h-4l.043-.043zM7 14.75a.75.75 0 0 1 .75-.75h9.5a.75.75 0 1 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75z"/></svg>'),so(this.editor,"bulletedList",t("Bulleted List"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0C1 4.784 1.777 4 2.75 4c.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75C1.784 7.5 1 6.723 1 5.75zm6 9c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0c0-.966.777-1.75 1.75-1.75.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75-.966 0-1.75-.777-1.75-1.75z"/></svg>')}}class oy extends Wu{refresh(){const t=this.editor.model,e=t.document.selection,n=vo(e);this.value=n?n.getAttribute("url"):null,this.isEnabled=function(t){const e=t.getSelectedElement();return!!e&&"media"===e.name}(e)||function(t,e){let n=function(t,e){const n=t.getSelectedElement();if(n){const i=vr(t);if(i)return e.createRange(e.createPositionAt(n,i))}return ti(t,e)}(t,e).start.parent;return n.isEmpty&&!e.schema.isLimit(n)&&(n=n.parent),e.schema.checkChild(n,"media")}(e,t)}execute(t){const e=this.editor.model,n=e.document.selection,i=vo(n);i?e.change((e=>{e.setAttribute("url",t,i)})):bo(e,t,n,!0)}}class sy{constructor(t,e){const n=e.providers,i=e.extraProviders||[],r=new Set(e.removeProviders),o=n.concat(i).filter((t=>{const e=t.name;return e?!r.has(e):(l("media-embed-no-provider-name",{provider:t}),!1)}));this.locale=t,this.providerDefinitions=o}hasMedia(t){return!!this._getMedia(t)}getMediaViewElement(t,e,n){return this._getMedia(e).getViewElement(t,n)}_getMedia(t){if(!t)return new ay(this.locale);t=t.trim();for(const e of this.providerDefinitions){const n=e.html,i=mt(e.url);for(const e of i){const i=this._getUrlMatches(t,e);if(i)return new ay(this.locale,t,i,n)}}return null}_getUrlMatches(t,e){let n=t.match(e);if(n)return n;let i=t.replace(/^https?:\/\//,"");return n=i.match(e),n||(i=i.replace(/^www\./,""),n=i.match(e),n||null)}}class ay{constructor(t,e,n,i){this.url=this._getValidUrl(e),this._locale=t,this._match=n,this._previewRenderer=i}getViewElement(t,e){const n={};let i;if(e.renderForEditingView||e.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(n["data-oembed-url"]=this.url),e.renderForEditingView&&(n.class="ck-media__wrapper");const r=this._getPreviewHtml(e);i=t.createRawElement("div",n,((t,e)=>{e.setContentOf(t,r)}))}else this.url&&(n.url=this.url),i=t.createEmptyElement(e.elementName,n);return t.setCustomProperty("media-content",!0,i),i}_getPreviewHtml(t){return this._previewRenderer?this._previewRenderer(this._match):this.url&&t.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const t=new lg,e=this._locale.t;return t.content='<svg viewBox="0 0 64 42" xmlns="http://www.w3.org/2000/svg"><path d="M47.426 17V3.713L63.102 0v19.389h-.001l.001.272c0 1.595-2.032 3.43-4.538 4.098-2.506.668-4.538-.083-4.538-1.678 0-1.594 2.032-3.43 4.538-4.098.914-.244 2.032-.565 2.888-.603V4.516L49.076 7.447v9.556A1.014 1.014 0 0 0 49 17h-1.574zM29.5 17h-8.343a7.073 7.073 0 1 0-4.657 4.06v3.781H3.3a2.803 2.803 0 0 1-2.8-2.804V8.63a2.803 2.803 0 0 1 2.8-2.805h4.082L8.58 2.768A1.994 1.994 0 0 1 10.435 1.5h8.985c.773 0 1.477.448 1.805 1.149l1.488 3.177H26.7c1.546 0 2.8 1.256 2.8 2.805V17zm-11.637 0H17.5a1 1 0 0 0-1 1v.05A4.244 4.244 0 1 1 17.863 17zm29.684 2c.97 0 .953-.048.953.889v20.743c0 .953.016.905-.953.905H19.453c-.97 0-.953.048-.953-.905V19.89c0-.937-.016-.889.97-.889h28.077zm-4.701 19.338V22.183H24.154v16.155h18.692zM20.6 21.375v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616V37.53H20.6zm24.233-16.155v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615V37.53h-1.615zM29.485 25.283a.4.4 0 0 1 .593-.35l9.05 4.977a.4.4 0 0 1 0 .701l-9.05 4.978a.4.4 0 0 1-.593-.35v-9.956z"/></svg>',t.viewBox="0 0 64 42",new eg({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[t]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url,"data-cke-tooltip-text":e("Open media in new tab")},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]}]}]}).render().outerHTML}_getValidUrl(t){return t?t.match(/^https?/)?t:"https://"+t:null}}var cy=t(88993),ly=t.n(cy),uy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(ly(),uy),ly().locals;class hy extends Uu{static get pluginName(){return"MediaEmbedEditing"}constructor(t){super(t),t.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:/^dailymotion\.com\/video\/(\w+)/,html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; "><iframe src="https://www.dailymotion.com/embed/video/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" width="480" height="270" allowfullscreen allow="autoplay"></iframe></div>`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 126%;"><iframe src="https://open.spotify.com/embed/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe></div>`},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)(?:&t=(\d+))?/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)(?:\?t=(\d+))?/,/^youtube\.com\/embed\/([\w-]+)(?:\?start=(\d+))?/,/^youtu\.be\/([\w-]+)(?:\?t=(\d+))?/],html:t=>{const e=t[1],n=t[2];return`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://www.youtube.com/embed/${e}${n?`?start=${n}`:""}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>`}},{name:"vimeo",url:[/^vimeo\.com\/(\d+)/,/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/channels\/[^/]+\/(\d+)/,/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,/^player\.vimeo\.com\/video\/(\d+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://player.vimeo.com/video/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>`},{name:"instagram",url:/^instagram\.com\/p\/(\w+)/},{name:"twitter",url:/^twitter\.com/},{name:"googleMaps",url:[/^google\.com\/maps/,/^goo\.gl\/maps/,/^maps\.google\.com/,/^maps\.app\.goo\.gl/]},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]}),this.registry=new sy(t.locale,t.config.get("mediaEmbed"))}init(){const t=this.editor,e=t.model.schema,n=t.t,i=t.conversion,r=t.config.get("mediaEmbed.previewsInData"),o=t.config.get("mediaEmbed.elementName"),s=this.registry;t.commands.add("mediaEmbed",new oy(t)),e.register("media",{inheritAllFrom:"$blockObject",allowAttributes:["url"]}),i.for("dataDowncast").elementToStructure({model:"media",view:(t,{writer:e})=>{const n=t.getAttribute("url");return wo(e,s,n,{elementName:o,renderMediaPreview:n&&r})}}),i.for("dataDowncast").add(po(s,{elementName:o,renderMediaPreview:r})),i.for("editingDowncast").elementToStructure({model:"media",view:(t,{writer:e})=>{const i=t.getAttribute("url");return function(t,e,n){return e.setCustomProperty("media",!0,t),hr(t,e,{label:n})}(wo(e,s,i,{elementName:o,renderForEditingView:!0}),e,n("media widget"))}}),i.for("editingDowncast").add(po(s,{elementName:o,renderForEditingView:!0})),i.for("upcast").elementToElement({view:t=>["oembed",o].includes(t.name)&&t.getAttribute("url")?{name:!0}:null,model:(t,{writer:e})=>{const n=t.getAttribute("url");if(s.hasMedia(n))return e.createElement("media",{url:n})}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(t,{writer:e})=>{const n=t.getAttribute("data-oembed-url");if(s.hasMedia(n))return e.createElement("media",{url:n})}}).add((t=>{t.on("element:figure",(function(t,e,n){if(!n.consumable.consume(e.viewItem,{name:!0,classes:"media"}))return;const{modelRange:i,modelCursor:r}=n.convertChildren(e.viewItem,e.modelCursor);e.modelRange=i,e.modelCursor=r,wt(i.getItems())||n.consumable.revert(e.viewItem,{name:!0,classes:"media"})}))}))}}const dy=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class fy extends Uu{static get requires(){return[nv,_w,gv]}static get pluginName(){return"AutoMediaEmbed"}constructor(t){super(t),this._timeoutId=null,this._positionToInsert=null}init(){const t=this.editor,e=t.model.document;this.listenTo(t.plugins.get("ClipboardPipeline"),"inputTransformation",(()=>{const t=e.selection.getFirstRange(),n=_m.fromPosition(t.start);n.stickiness="toPrevious";const i=_m.fromPosition(t.end);i.stickiness="toNext",e.once("change:data",(()=>{this._embedMediaBetweenPositions(n,i),n.detach(),i.detach()}),{priority:"high"})})),t.commands.get("undo").on("execute",(()=>{this._timeoutId&&(Su.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)}),{priority:"high"})}_embedMediaBetweenPositions(t,e){const n=this.editor,i=n.plugins.get(hy).registry,r=new Hf(t,e),o=r.getWalker({ignoreElementEnd:!0});let s="";for(const t of o)t.item.is("$textProxy")&&(s+=t.item.data);s=s.trim(),s.match(dy)&&i.hasMedia(s)&&n.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=_m.fromPosition(t),this._timeoutId=Su.window.setTimeout((()=>{n.model.change((t=>{let e;this._timeoutId=null,t.remove(r),r.detach(),"$graveyard"!==this._positionToInsert.root.rootName&&(e=this._positionToInsert),bo(n.model,s,e,!1),this._positionToInsert.detach(),this._positionToInsert=null})),n.plugins.get("Delete").requestUndoOnBackspace()}),100)):r.detach()}}var my=t(39982),gy=t.n(my),py={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(gy(),py),gy().locals;class wy extends tg{constructor(t,e){super(e);const n=e.t;this.focusTracker=new zu,this.keystrokes=new ju,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),Jm.check,"ck-button-save"),this.saveButtonView.type="submit",this.saveButtonView.bind("isEnabled").to(this,"mediaURLInputValue",(t=>!!t)),this.cancelButtonView=this._createButton(n("Cancel"),Jm.cancel,"ck-button-cancel","cancel"),this._focusables=new Ym,this._focusCycler=new Mg({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=t,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView,this.saveButtonView,this.cancelButtonView]}),di(this)}render(){super.render(),fi({view:this}),[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach((t=>{this._focusables.add(t),this.focusTracker.add(t.element)})),this.keystrokes.listenTo(this.element);const t=t=>t.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t),this.listenTo(this.urlInputView.element,"selectstart",((t,e)=>{e.stopPropagation()}),{priority:"high"})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(t){this.urlInputView.fieldView.element.value=t.trim()}isValid(){this.resetFormStatus();for(const t of this._validators){const e=t(this);if(e)return this.urlInputView.errorText=e,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const t=this.locale.t,e=new Dp(this.locale,$i),n=e.fieldView;return this._urlInputViewInfoDefault=t("Paste the media URL in the input."),this._urlInputViewInfoTip=t("Tip: Paste the URL into the content to embed faster."),e.label=t("Media URL"),e.infoText=this._urlInputViewInfoDefault,n.on("input",(()=>{e.infoText=n.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=n.element.value.trim()})),e}_createButton(t,e,n,i){const r=new fg(this.locale);return r.set({label:t,icon:e,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}}class vy extends Uu{static get requires(){return[hy]}static get pluginName(){return"MediaEmbedUI"}init(){const t=this.editor,e=t.commands.get("mediaEmbed");t.ui.componentFactory.add("mediaEmbed",(t=>{const n=Vi(t);return this._setUpDropdown(n,e),n}))}_setUpDropdown(t,e){const n=this.editor,i=n.t,r=t.buttonView,o=n.plugins.get(hy).registry;t.once("change:isOpen",(()=>{const i=new wy(function(t,e){return[e=>{if(!e.url.length)return t("The URL must not be empty.")},n=>{if(!e.hasMedia(n.url))return t("This media URL is not supported.")}]}(n.t,o),n.locale);t.panelView.children.add(i),r.on("open",(()=>{i.disableCssTransitions(),i.url=e.value||"",i.urlInputView.fieldView.select(),i.enableCssTransitions()}),{priority:"low"}),t.on("submit",(()=>{i.isValid()&&(n.execute("mediaEmbed",i.url),n.editing.view.focus())})),t.on("change:isOpen",(()=>i.resetFormStatus())),t.on("cancel",(()=>{n.editing.view.focus()})),i.delegate("submit","cancel").to(t),i.urlInputView.bind("value").to(e,"value"),i.urlInputView.bind("isReadOnly").to(e,"isEnabled",(t=>!t))})),t.bind("isEnabled").to(e),r.set({label:i("Insert media"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M18.68 3.03c.6 0 .59-.03.59.55v12.84c0 .59.01.56-.59.56H1.29c-.6 0-.59.03-.59-.56V3.58c0-.58-.01-.55.6-.55h17.38zM15.77 15V5H4.2v10h11.57zM2 4v1h1V4H2zm0 2v1h1V6H2zm0 2v1h1V8H2zm0 2v1h1v-1H2zm0 2v1h1v-1H2zm0 2v1h1v-1H2zM17 4v1h1V4h-1zm0 2v1h1V6h-1zm0 2v1h1V8h-1zm0 2v1h1v-1h-1zm0 2v1h1v-1h-1zm0 2v1h1v-1h-1zM7.5 7.177a.4.4 0 0 1 .593-.351l5.133 2.824a.4.4 0 0 1 0 .7l-5.133 2.824a.4.4 0 0 1-.593-.35V7.176v.001z"/></svg>',tooltip:!0})}}var by=t(93729),yy=t.n(by),_y={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(yy(),_y),yy().locals;class ky extends Wu{refresh(){const t=this.editor.model,e=wt(t.document.selection.getSelectedBlocks());this.value=!!e&&e.is("element","paragraph"),this.isEnabled=!!e&&yo(e,t.schema)}execute(t={}){const e=this.editor.model,n=e.document;e.change((i=>{const r=(t.selection||n.selection).getSelectedBlocks();for(const t of r)!t.is("element","paragraph")&&yo(t,e.schema)&&i.rename(t,"paragraph")}))}}class Ay extends Wu{execute(t){const e=this.editor.model,n=t.attributes;let i=t.position;e.change((t=>{const r=t.createElement("paragraph");if(n&&e.schema.setAllowedAttributes(r,n,t),!e.schema.checkChild(i.parent,r)){const n=e.schema.findAllowedParent(i,r);if(!n)return;i=t.split(i,n).position}e.insertContent(r,i),t.setSelection(r,"in")}))}}class xy extends Uu{static get pluginName(){return"Paragraph"}init(){const t=this.editor,e=t.model;t.commands.add("paragraph",new ky(t)),t.commands.add("insertParagraph",new Ay(t)),e.schema.register("paragraph",{inheritAllFrom:"$block"}),t.conversion.elementToElement({model:"paragraph",view:"p"}),t.conversion.for("upcast").elementToElement({model:(t,{writer:e})=>xy.paragraphLikeElements.has(t.name)?t.isEmpty?null:e.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}}xy.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);const Ty=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i
;class Cy{constructor(t){this.document=t}isActive(t){return Ty.test(t)}execute(t){const e=new Bm(this.document),{body:n}=t._parsedData;!function(t,e){for(const n of t.getChildren())if(n.is("element","b")&&"normal"===n.getStyle("font-weight")){const i=t.getChildIndex(n);e.remove(n),e.insertChild(i,n.getChildren(),t)}}(n,e),function(t,e){for(const n of e.createRangeIn(t)){const t=n.item;if(t.is("element","li")){const n=t.getChild(0);n&&n.is("element","p")&&e.unwrapElement(n)}}}(n,e),function(t,e){const n=new dd(e.document.stylesProcessor),i=new Md(n,{renderingMode:"data"}),r=i.blockElements,o=i.inlineObjectElements,s=[];for(const n of e.createRangeIn(t)){const t=n.item;if(t.is("element","br")){const n=_o(t,"forward",e,{blockElements:r,inlineObjectElements:o}),i=_o(t,"backward",e,{blockElements:r,inlineObjectElements:o}),a=ko(n,r);(ko(i,r)||a)&&s.push(t)}}for(const t of s)t.hasClass("Apple-interchange-newline")?e.remove(t):e.replace(t,e.createElement("p"))}(n,e),t.content=n}}const Ey=/<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/i,Sy=/xmlns:o="urn:schemas-microsoft-com/i;class Py{constructor(t){this.document=t}isActive(t){return Ey.test(t)||Sy.test(t)}execute(t){const{body:e,stylesString:n}=t._parsedData;Ao(e,n),Eo(e,t.dataTransfer.getData("text/rtf")),t.content=e}}class Ry{constructor(t,e={}){this._table=t,this._startRow=void 0!==e.row?e.row:e.startRow||0,this._endRow=void 0!==e.row?e.row:e.endRow,this._startColumn=void 0!==e.column?e.column:e.startColumn||0,this._endColumn=void 0!==e.column?e.column:e.endColumn,this._includeAllSlots=!!e.includeAllSlots,this._skipRows=new Set,this._row=0,this._rowIndex=0,this._column=0,this._cellIndex=0,this._spannedCells=new Map,this._nextCellAtColumn=-1}[Symbol.iterator](){return this}next(){const t=this._table.getChild(this._rowIndex);if(!t||this._isOverEndRow())return{done:!0};if(!t.is("element","tableRow"))return this._rowIndex++,this.next();if(this._isOverEndColumn())return this._advanceToNextRow();let e=null;const n=this._getSpanned();if(n)this._includeAllSlots&&!this._shouldSkipSlot()&&(e=this._formatOutValue(n.cell,n.row,n.column));else{const n=t.getChild(this._cellIndex);if(!n)return this._advanceToNextRow();const i=parseInt(n.getAttribute("colspan")||1),r=parseInt(n.getAttribute("rowspan")||1);(i>1||r>1)&&this._recordSpans(n,r,i),this._shouldSkipSlot()||(e=this._formatOutValue(n)),this._nextCellAtColumn=this._column+i}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,e||this.next()}skipRow(t){this._skipRows.add(t)}_advanceToNextRow(){return this._row++,this._rowIndex++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}_isOverEndRow(){return void 0!==this._endRow&&this._row>this._endRow}_isOverEndColumn(){return void 0!==this._endColumn&&this._column>this._endColumn}_formatOutValue(t,e=this._row,n=this._column){return{done:!1,value:new Oy(this,t,e,n)}}_shouldSkipSlot(){const t=this._skipRows.has(this._row),e=this._row<this._startRow,n=this._column<this._startColumn,i=void 0!==this._endColumn&&this._column>this._endColumn;return t||e||n||i}_getSpanned(){const t=this._spannedCells.get(this._row);return t&&t.get(this._column)||null}_recordSpans(t,e,n){const i={cell:t,row:this._row,column:this._column};for(let t=this._row;t<this._row+e;t++)for(let e=this._column;e<this._column+n;e++)t==this._row&&e==this._column||this._markSpannedCell(t,e,i)}_markSpannedCell(t,e,n){this._spannedCells.has(t)||this._spannedCells.set(t,new Map),this._spannedCells.get(t).set(e,n)}}class Oy{constructor(t,e,n,i){this.cell=e,this.row=t._row,this.column=t._column,this.cellAnchorRow=n,this.cellAnchorColumn=i,this._cellIndex=t._cellIndex,this._rowIndex=t._rowIndex,this._table=t._table}get isAnchor(){return this.row===this.cellAnchorRow&&this.column===this.cellAnchorColumn}get cellWidth(){return parseInt(this.cell.getAttribute("colspan")||1)}get cellHeight(){return parseInt(this.cell.getAttribute("rowspan")||1)}get rowIndex(){return this._rowIndex}getPositionBefore(){return this._table.root.document.model.createPositionAt(this._table.getChild(this.row),this._cellIndex)}}class Iy extends Wu{refresh(){const t=this.editor.model,e=t.document.selection,n=t.schema;this.isEnabled=function(t,e){const n=t.getFirstPosition().parent,i=n===n.root?n:n.parent;return e.checkChild(i,"table")}(e,n)}execute(t={}){const e=this.editor.model,n=this.editor.plugins.get("TableUtils"),i=this.editor.config.get("table"),r=i.defaultHeadings.rows,o=i.defaultHeadings.columns;void 0===t.headingRows&&r&&(t.headingRows=r),void 0===t.headingColumns&&o&&(t.headingColumns=o),e.change((i=>{const r=n.createTable(i,t);e.insertObject(r,null,null,{findOptimalPosition:"auto"}),i.setSelection(i.createPositionAt(r.getNodeByPath([0,0,0]),0))}))}}class My extends Wu{constructor(t,e={}){super(t),this.order=e.order||"below"}refresh(){const t=this.editor.model.document.selection,e=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(t).length;this.isEnabled=e}execute(){const t=this.editor,e=t.model.document.selection,n=t.plugins.get("TableUtils"),i="above"===this.order,r=n.getSelectionAffectedTableCells(e),o=n.getRowIndexes(r),s=i?o.first:o.last,a=r[0].findAncestor("table");n.insertRows(a,{at:i?s:s+1,copyStructureFromAbove:!i})}}class Ny extends Wu{constructor(t,e={}){super(t),this.order=e.order||"right"}refresh(){const t=this.editor.model.document.selection,e=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(t).length;this.isEnabled=e}execute(){const t=this.editor,e=t.model.document.selection,n=t.plugins.get("TableUtils"),i="left"===this.order,r=n.getSelectionAffectedTableCells(e),o=n.getColumnIndexes(r),s=i?o.first:o.last,a=r[0].findAncestor("table");n.insertColumns(a,{columns:1,at:i?s:s+1})}}class Vy extends Wu{constructor(t,e={}){super(t),this.direction=e.direction||"horizontally"}refresh(){const t=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=1===t.length}execute(){const t=this.editor.plugins.get("TableUtils"),e=t.getSelectionAffectedTableCells(this.editor.model.document.selection)[0];"horizontally"===this.direction?t.splitCellHorizontally(e,2):t.splitCellVertically(e,2)}}class Dy extends Wu{constructor(t,e){super(t),this.direction=e.direction,this.isHorizontal="right"==this.direction||"left"==this.direction}refresh(){const t=this._getMergeableCell();this.value=t,this.isEnabled=!!t}execute(){const t=this.editor.model,e=t.document,n=this.editor.plugins.get("TableUtils").getTableCellsContainingSelection(e.selection)[0],i=this.value,r=this.direction;t.change((t=>{const e="right"==r||"down"==r,o=e?n:i,s=e?i:n,a=s.parent;!function(t,e,n){Xo(t)||(Xo(e)&&n.remove(n.createRangeIn(e)),n.move(n.createRangeIn(t),n.createPositionAt(e,"end"))),n.remove(t)}(s,o,t);const c=this.isHorizontal?"colspan":"rowspan",l=parseInt(n.getAttribute(c)||1),u=parseInt(i.getAttribute(c)||1);t.setAttribute(c,l+u,o),t.setSelection(t.createRangeIn(o));const h=this.editor.plugins.get("TableUtils");Jo(a.findAncestor("table"),h)}))}_getMergeableCell(){const t=this.editor.model.document,e=this.editor.plugins.get("TableUtils"),n=e.getTableCellsContainingSelection(t.selection)[0];if(!n)return;const i=this.isHorizontal?function(t,e,n){const i=t.parent.parent,r="right"==e?t.nextSibling:t.previousSibling,o=(i.getAttribute("headingColumns")||0)>0;if(!r)return;const s="right"==e?t:r,a="right"==e?r:t,{column:c}=n.getCellLocation(s),{column:l}=n.getCellLocation(a),u=parseInt(s.getAttribute("colspan")||1),h=Mo(n,s),d=Mo(n,a);return o&&h!=d?void 0:c+u===l?r:void 0}(n,this.direction,e):function(t,e,n){const i=t.parent,r=i.parent,o=r.getChildIndex(i);if("down"==e&&o===n.getRows(r)-1||"up"==e&&0===o)return;const s=parseInt(t.getAttribute("rowspan")||1),a=r.getAttribute("headingRows")||0;if(a&&("down"==e&&o+s===a||"up"==e&&o===a))return;const c=parseInt(t.getAttribute("rowspan")||1),l="down"==e?o+c:o,u=[...new Ry(r,{endRow:l})],h=u.find((e=>e.cell===t)).column,d=u.find((({row:t,cellHeight:n,column:i})=>i===h&&("down"==e?t===l:l===t+n)));return d&&d.cell}(n,this.direction,e);if(!i)return;const r=this.isHorizontal?"rowspan":"colspan",o=parseInt(n.getAttribute(r)||1);return parseInt(i.getAttribute(r)||1)===o?i:void 0}}class By extends Wu{refresh(){const t=this.editor.plugins.get("TableUtils"),e=t.getSelectionAffectedTableCells(this.editor.model.document.selection),n=e[0];if(n){const i=n.findAncestor("table"),r=this.editor.plugins.get("TableUtils").getRows(i)-1,o=t.getRowIndexes(e),s=0===o.first&&o.last===r;this.isEnabled=!s}else this.isEnabled=!1}execute(){const t=this.editor.model,e=this.editor.plugins.get("TableUtils"),n=e.getSelectionAffectedTableCells(t.document.selection),i=e.getRowIndexes(n),r=n[0],o=r.findAncestor("table"),s=e.getCellLocation(r).column;t.change((t=>{const n=i.last-i.first+1;e.removeRows(o,{at:i.first,rows:n});const r=function(t,e,n,i){const r=t.getChild(Math.min(e,i-1));let o=r.getChild(0),s=0;for(const t of r.getChildren()){if(s>n)return o;o=t,s+=parseInt(t.getAttribute("colspan")||1)}return o}(o,i.first,s,e.getRows(o));t.setSelection(t.createPositionAt(r,0))}))}}class Fy extends Wu{refresh(){const t=this.editor.plugins.get("TableUtils"),e=t.getSelectionAffectedTableCells(this.editor.model.document.selection),n=e[0];if(n){const i=n.findAncestor("table"),r=t.getColumns(i),{first:o,last:s}=t.getColumnIndexes(e);this.isEnabled=s-o<r-1}else this.isEnabled=!1}execute(){const t=this.editor.plugins.get("TableUtils"),[e,n]=function(t,e){const n=e.getSelectionAffectedTableCells(t),i=n[0],r=n.pop(),o=[i,r];return i.isBefore(r)?o:o.reverse()}(this.editor.model.document.selection,t),i=e.parent.parent,r=[...new Ry(i)],o={first:r.find((t=>t.cell===e)).column,last:r.find((t=>t.cell===n)).column},s=function(t,e,n,i){return parseInt(n.getAttribute("colspan")||1)>1?n:e.previousSibling||n.nextSibling?n.nextSibling||e.previousSibling:i.first?t.reverse().find((({column:t})=>t<i.first)).cell:t.reverse().find((({column:t})=>t>i.last)).cell}(r,e,n,o);this.editor.model.change((t=>{const e=o.last-o.first+1;this.editor.plugins.get("TableUtils").removeColumns(i,{at:o.first,columns:e}),t.setSelection(t.createPositionAt(s,0))}))}}class Ly extends Wu{refresh(){const t=this.editor.plugins.get("TableUtils"),e=this.editor.model,n=t.getSelectionAffectedTableCells(e.document.selection),i=n.length>0;this.isEnabled=i,this.value=i&&n.every((t=>this._isInHeading(t,t.parent.parent)))}execute(t={}){if(t.forceValue===this.value)return;const e=this.editor.plugins.get("TableUtils"),n=this.editor.model,i=e.getSelectionAffectedTableCells(n.document.selection),r=i[0].findAncestor("table"),{first:o,last:s}=e.getRowIndexes(i),a=this.value?o:s+1,c=r.getAttribute("headingRows")||0;n.change((t=>{if(a){const e=Ho(r,a,a>c?c:0);for(const{cell:n}of e)Uo(n,a,t)}Oo("headingRows",a,r,t,0)}))}_isInHeading(t,e){const n=parseInt(e.getAttribute("headingRows")||0);return!!n&&t.parent.index<n}}class zy extends Wu{refresh(){const t=this.editor.model,e=this.editor.plugins.get("TableUtils"),n=e.getSelectionAffectedTableCells(t.document.selection),i=n.length>0;this.isEnabled=i,this.value=i&&n.every((t=>Mo(e,t)))}execute(t={}){if(t.forceValue===this.value)return;const e=this.editor.plugins.get("TableUtils"),n=this.editor.model,i=e.getSelectionAffectedTableCells(n.document.selection),r=i[0].findAncestor("table"),{first:o,last:s}=e.getColumnIndexes(i),a=this.value?o:s+1;n.change((t=>{if(a){const e=Wo(r,a);for(const{cell:n,column:i}of e)$o(n,i,a,t)}Oo("headingColumns",a,r,t,0)}))}}class jy extends Uu{static get pluginName(){return"TableUtils"}init(){this.decorate("insertColumns"),this.decorate("insertRows")}getCellLocation(t){const e=t.parent,n=e.parent,i=n.getChildIndex(e),r=new Ry(n,{row:i});for(const{cell:e,row:n,column:i}of r)if(e===t)return{row:n,column:i}}createTable(t,e){const n=t.createElement("table"),i=parseInt(e.rows)||2,r=parseInt(e.columns)||2;return Zo(t,n,0,i,r),e.headingRows&&Oo("headingRows",Math.min(e.headingRows,i),n,t,0),e.headingColumns&&Oo("headingColumns",Math.min(e.headingColumns,r),n,t,0),n}insertRows(t,e={}){const n=this.editor.model,i=e.at||0,r=e.rows||1,o=void 0!==e.copyStructureFromAbove,s=e.copyStructureFromAbove?i-1:i,a=this.getRows(t),c=this.getColumns(t);if(i>a)throw new qs("tableutils-insertrows-insert-out-of-range",this,{options:e});n.change((e=>{const n=t.getAttribute("headingRows")||0;if(n>i&&Oo("headingRows",n+r,t,e,0),!o&&(0===i||i===a))return void Zo(e,t,i,r,c);const l=o?Math.max(i,s):i,u=new Ry(t,{endRow:l}),h=new Array(c).fill(1);for(const{row:t,column:n,cellHeight:a,cellWidth:c,cell:l}of u){const u=t+a-1,d=t<=s&&s<=u;t<i&&i<=u?(e.setAttribute("rowspan",a+r,l),h[n]=-c):o&&d&&(h[n]=c)}for(let n=0;n<r;n++){const n=e.createElement("tableRow");e.insert(n,t,i);for(let t=0;t<h.length;t++){const i=h[t],r=e.createPositionAt(n,"end");i>0&&Io(e,r,i>1?{colspan:i}:null),t+=Math.abs(i)-1}}}))}insertColumns(t,e={}){const n=this.editor.model,i=e.at||0,r=e.columns||1;n.change((e=>{const n=t.getAttribute("headingColumns");i<n&&e.setAttribute("headingColumns",n+r,t);const o=this.getColumns(t);if(0===i||o===i){for(const n of t.getChildren())n.is("element","tableRow")&&ts(r,e,e.createPositionAt(n,i?"end":0));return}const s=new Ry(t,{column:i,includeAllSlots:!0});for(const t of s){const{row:n,cell:o,cellAnchorColumn:a,cellAnchorRow:c,cellWidth:l,cellHeight:u}=t;if(a<i){e.setAttribute("colspan",l+r,o);const t=c+u-1;for(let e=n;e<=t;e++)s.skipRow(e)}else ts(r,e,t.getPositionBefore())}}))}removeRows(t,e){const n=this.editor.model,i=e.rows||1,r=this.getRows(t),o=e.at,s=o+i-1;if(s>r-1)throw new qs("tableutils-removerows-row-index-out-of-range",this,{table:t,options:e});n.change((e=>{const{cellsToMove:n,cellsToTrim:i}=function(t,e,n){const i=new Map,r=[];for(const{row:o,column:s,cellHeight:a,cell:c}of new Ry(t,{endRow:n})){const t=o+a-1;if(o>=e&&o<=n&&t>n){const t=a-(n-o+1);i.set(s,{cell:c,rowspan:t})}if(o<e&&t>=e){let i;i=t>=n?n-e+1:t-e+1,r.push({cell:c,rowspan:a-i})}}return{cellsToMove:i,cellsToTrim:r}}(t,o,s);n.size&&function(t,e,n,i){const r=[...new Ry(t,{includeAllSlots:!0,row:e})],o=t.getChild(e);let s;for(const{column:t,cell:e,isAnchor:a}of r)if(n.has(t)){const{cell:e,rowspan:r}=n.get(t),a=s?i.createPositionAfter(s):i.createPositionAt(o,0);i.move(i.createRangeOn(e),a),Oo("rowspan",r,e,i),s=e}else a&&(s=e)}(t,s+1,n,e);for(let n=s;n>=o;n--)e.remove(t.getChild(n));for(const{rowspan:t,cell:n}of i)Oo("rowspan",t,n,e);!function(t,e,n,i){const r=t.getAttribute("headingRows")||0;e<r&&Oo("headingRows",n<r?r-(n-e+1):e,t,i,0)}(t,o,s,e),Ko(t,this)||Go(t,this)}))}removeColumns(t,e){const n=this.editor.model,i=e.at,r=e.columns||1,o=e.at+r-1;n.change((e=>{!function(t,e,n){const i=t.getAttribute("headingColumns")||0;if(i&&e.first<i){const r=Math.min(i-1,e.last)-e.first+1;n.setAttribute("headingColumns",i-r,t)}}(t,{first:i,last:o},e);for(let n=o;n>=i;n--)for(const{cell:i,column:r,cellWidth:o}of[...new Ry(t)])r<=n&&o>1&&r+o>n?Oo("colspan",o-1,i,e):r===n&&e.remove(i);Go(t,this)||Ko(t,this)}))}splitCellVertically(t,e=2){const n=this.editor.model,i=t.parent.parent,r=parseInt(t.getAttribute("rowspan")||1),o=parseInt(t.getAttribute("colspan")||1);n.change((n=>{if(o>1){const{newCellsSpan:i,updatedSpan:s}=es(o,e);Oo("colspan",s,t,n);const a={};i>1&&(a.colspan=i),r>1&&(a.rowspan=r),ts(o>e?e-1:o-1,n,n.createPositionAfter(t),a)}if(o<e){const s=e-o,a=[...new Ry(i)],{column:c}=a.find((({cell:e})=>e===t)),l=a.filter((({cell:e,cellWidth:n,column:i})=>e!==t&&i===c||i<c&&i+n>c));for(const{cell:t,cellWidth:e}of l)n.setAttribute("colspan",e+s,t);const u={};r>1&&(u.rowspan=r),ts(s,n,n.createPositionAfter(t),u);const h=i.getAttribute("headingColumns")||0;h>c&&Oo("headingColumns",h+s,i,n)}}))}splitCellHorizontally(t,e=2){const n=this.editor.model,i=t.parent,r=i.parent,o=r.getChildIndex(i),s=parseInt(t.getAttribute("rowspan")||1),a=parseInt(t.getAttribute("colspan")||1);n.change((n=>{if(s>1){const i=[...new Ry(r,{startRow:o,endRow:o+s-1,includeAllSlots:!0})],{newCellsSpan:c,updatedSpan:l}=es(s,e);Oo("rowspan",l,t,n);const{column:u}=i.find((({cell:e})=>e===t)),h={};c>1&&(h.rowspan=c),a>1&&(h.colspan=a);for(const t of i){const{column:e,row:i}=t,r=e===u,s=(i+o+l)%c==0;i>=o+l&&r&&s&&ts(1,n,t.getPositionBefore(),h)}}if(s<e){const i=e-s,c=[...new Ry(r,{startRow:0,endRow:o})];for(const{cell:e,cellHeight:r,row:s}of c)if(e!==t&&s+r>o){const t=r+i;n.setAttribute("rowspan",t,e)}const l={};a>1&&(l.colspan=a),Zo(n,r,o+1,i,1,l);const u=r.getAttribute("headingRows")||0;u>o&&Oo("headingRows",u+i,r,n)}}))}getColumns(t){return[...t.getChild(0).getChildren()].reduce(((t,e)=>t+parseInt(e.getAttribute("colspan")||1)),0)}getRows(t){return Array.from(t.getChildren()).reduce(((t,e)=>e.is("element","tableRow")?t+1:t),0)}createTableWalker(t,e={}){return new Ry(t,e)}getSelectedTableCells(t){const e=[];for(const n of this.sortRanges(t.getRanges())){const t=n.getContainedElement();t&&t.is("element","tableCell")&&e.push(t)}return e}getTableCellsContainingSelection(t){const e=[];for(const n of t.getRanges()){const t=n.start.findAncestor("tableCell");t&&e.push(t)}return e}getSelectionAffectedTableCells(t){const e=this.getSelectedTableCells(t);return e.length?e:this.getTableCellsContainingSelection(t)}getRowIndexes(t){const e=t.map((t=>t.parent.index));return this._getFirstLastIndexesObject(e)}getColumnIndexes(t){const e=t[0].findAncestor("table"),n=[...new Ry(e)].filter((e=>t.includes(e.cell))).map((t=>t.column));return this._getFirstLastIndexesObject(n)}isSelectionRectangular(t){if(t.length<2||!this._areCellInTheSameTableSection(t))return!1;const e=new Set,n=new Set;let i=0;for(const r of t){const{row:t,column:o}=this.getCellLocation(r),s=parseInt(r.getAttribute("rowspan")||1),a=parseInt(r.getAttribute("colspan")||1);e.add(t),n.add(o),s>1&&e.add(t+s-1),a>1&&n.add(o+a-1),i+=s*a}const r=function(t,e){const n=Array.from(t.values()),i=Array.from(e.values());return(Math.max(...n)-Math.min(...n)+1)*(Math.max(...i)-Math.min(...i)+1)}(e,n);return r==i}sortRanges(t){return Array.from(t).sort(ns)}_getFirstLastIndexesObject(t){const e=t.sort(((t,e)=>t-e));return{first:e[0],last:e[e.length-1]}}_areCellInTheSameTableSection(t){const e=t[0].findAncestor("table"),n=this.getRowIndexes(t),i=parseInt(e.getAttribute("headingRows")||0);if(!this._areIndexesInSameSection(n,i))return!1;const r=parseInt(e.getAttribute("headingColumns")||0),o=this.getColumnIndexes(t);return this._areIndexesInSameSection(o,r)}_areIndexesInSameSection({first:t,last:e},n){return t<n==e<n}}class Hy extends Wu{refresh(){const t=this.editor.plugins.get(jy),e=t.getSelectedTableCells(this.editor.model.document.selection);this.isEnabled=t.isSelectionRectangular(e,this.editor.plugins.get(jy))}execute(){const t=this.editor.model,e=this.editor.plugins.get(jy);t.change((n=>{const i=e.getSelectedTableCells(t.document.selection),r=i.shift(),{mergeWidth:o,mergeHeight:s}=function(t,e,n){let i=0,r=0;for(const t of e){const{row:e,column:o}=n.getCellLocation(t);i=os(t,o,i,"colspan"),r=os(t,e,r,"rowspan")}const{row:o,column:s}=n.getCellLocation(t);return{mergeWidth:i-s,mergeHeight:r-o}}(r,i,e);Oo("colspan",o,r,n),Oo("rowspan",s,r,n);for(const t of i)is(t,r,n);Jo(r.findAncestor("table"),e),n.setSelection(r,"in")}))}}class Uy extends Wu{constructor(t){super(t),this.affectsData=!1}refresh(){const t=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=t.length>0}execute(){const t=this.editor.model,e=this.editor.plugins.get("TableUtils"),n=e.getSelectionAffectedTableCells(t.document.selection),i=e.getRowIndexes(n),r=n[0].findAncestor("table"),o=[];for(let e=i.first;e<=i.last;e++)for(const n of r.getChild(e).getChildren())o.push(t.createRangeOn(n));t.change((t=>{t.setSelection(o)}))}}class Wy extends Wu{constructor(t){super(t),this.affectsData=!1}refresh(){const t=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=t.length>0}execute(){const t=this.editor.plugins.get("TableUtils"),e=this.editor.model,n=t.getSelectionAffectedTableCells(e.document.selection),i=n[0],r=n.pop(),o=i.findAncestor("table"),s=t.getCellLocation(i),a=t.getCellLocation(r),c=Math.min(s.column,a.column),l=Math.max(s.column,a.column),u=[];for(const t of new Ry(o,{startColumn:c,endColumn:l}))u.push(e.createRangeOn(t.cell));e.change((t=>{t.setSelection(u)}))}}var $y=t(6158),qy=t.n($y),Ky={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(qy(),Ky),qy().locals;class Gy extends Uu{static get pluginName(){return"TableEditing"}static get requires(){return[jy]}init(){const t=this.editor,e=t.model,n=e.schema,i=t.conversion,r=t.plugins.get(jy);n.register("table",{inheritAllFrom:"$blockObject",allowAttributes:["headingRows","headingColumns"]}),n.register("tableRow",{allowIn:"table",isLimit:!0}),n.register("tableCell",{allowContentOf:"$container",allowIn:"tableRow",allowAttributes:["colspan","rowspan"],isLimit:!0,isSelectable:!0}),i.for("upcast").add((t=>{t.on("element:figure",((t,e,n)=>{if(!n.consumable.test(e.viewItem,{name:!0,classes:"table"}))return;const i=function(t){for(const e of t.getChildren())if(e.is("element","table"))return e}(e.viewItem);if(!i||!n.consumable.test(i,{name:!0}))return;n.consumable.consume(e.viewItem,{name:!0,classes:"table"});const r=wt(n.convertItem(i,e.modelCursor).modelRange.getItems());r?(n.convertChildren(e.viewItem,n.writer.createPositionAt(r,"end")),n.updateConversionResult(r,e)):n.consumable.revert(e.viewItem,{name:!0,classes:"table"})}))})),i.for("upcast").add(No()),i.for("editingDowncast").elementToStructure({model:{name:"table",attributes:["headingRows"]},view:Bo(r,{asWidget:!0})}),i.for("dataDowncast").elementToStructure({model:{name:"table",attributes:["headingRows"]},view:Bo(r)}),i.for("upcast").elementToElement({model:"tableRow",view:"tr"}),i.for("upcast").add((t=>{t.on("element:tr",((t,e)=>{e.viewItem.isEmpty&&0==e.modelCursor.index&&t.stop()}),{priority:"high"})})),i.for("downcast").elementToElement({model:"tableRow",view:(t,{writer:e})=>t.isEmpty?e.createEmptyElement("tr"):e.createContainerElement("tr")}),i.for("upcast").elementToElement({model:"tableCell",view:"td"}),i.for("upcast").elementToElement({model:"tableCell",view:"th"}),i.for("upcast").add(Vo("td")),i.for("upcast").add(Vo("th")),i.for("editingDowncast").elementToElement({model:"tableCell",view:Fo({asWidget:!0})}),i.for("dataDowncast").elementToElement({model:"tableCell",view:Fo()}),i.for("editingDowncast").elementToElement({model:"paragraph",view:Lo({asWidget:!0}),converterPriority:"high"}),i.for("dataDowncast").elementToElement({model:"paragraph",view:Lo(),converterPriority:"high"}),i.for("downcast").attributeToAttribute({model:"colspan",view:"colspan"}),i.for("upcast").attributeToAttribute({model:{key:"colspan",value:ps("colspan")},view:"colspan"}),i.for("downcast").attributeToAttribute({model:"rowspan",view:"rowspan"}),i.for("upcast").attributeToAttribute({model:{key:"rowspan",value:ps("rowspan")},view:"rowspan"}),t.config.define("table.defaultHeadings.rows",0),t.config.define("table.defaultHeadings.columns",0),t.commands.add("insertTable",new Iy(t)),t.commands.add("insertTableRowAbove",new My(t,{order:"above"})),t.commands.add("insertTableRowBelow",new My(t,{order:"below"})),t.commands.add("insertTableColumnLeft",new Ny(t,{order:"left"})),t.commands.add("insertTableColumnRight",new Ny(t,{order:"right"})),t.commands.add("removeTableRow",new By(t)),t.commands.add("removeTableColumn",new Fy(t)),t.commands.add("splitTableCellVertically",new Vy(t,{direction:"vertically"})),t.commands.add("splitTableCellHorizontally",new Vy(t,{direction:"horizontally"})),t.commands.add("mergeTableCells",new Hy(t)),t.commands.add("mergeTableCellRight",new Dy(t,{direction:"right"})),t.commands.add("mergeTableCellLeft",new Dy(t,{direction:"left"})),t.commands.add("mergeTableCellDown",new Dy(t,{direction:"down"})),t.commands.add("mergeTableCellUp",new Dy(t,{direction:"up"})),t.commands.add("setTableColumnHeader",new zy(t)),t.commands.add("setTableRowHeader",new Ly(t)),t.commands.add("selectTableRow",new Uy(t)),t.commands.add("selectTableColumn",new Wy(t)),ss(e),us(e),this.listenTo(e.document,"change:data",(()=>{!function(t,e){const n=t.document.differ;for(const t of n.getChanges()){let n,i=!1;if("attribute"==t.type){const e=t.range.start.nodeAfter;if(!e||!e.is("element","table"))continue;if("headingRows"!=t.attributeKey&&"headingColumns"!=t.attributeKey)continue;n=e,i="headingRows"==t.attributeKey}else"tableRow"!=t.name&&"tableCell"!=t.name||(n=t.position.findAncestor("table"),i="tableRow"==t.name);if(!n)continue;const r=n.getAttribute("headingRows")||0,o=n.getAttribute("headingColumns")||0,s=new Ry(n);for(const t of s){const n=t.row<r||t.column<o?"th":"td",s=e.mapper.toViewElement(t.cell);s&&s.is("element")&&s.name!=n&&e.reconvertItem(i?t.cell.parent:t.cell)}}}(e,t.editing),function(t,e){const n=t.document.differ,i=new Set;for(const t of n.getChanges()){const e="attribute"==t.type?t.range.start.parent:t.position.parent;e.is("element","tableCell")&&i.add(e)}for(const t of i.values()){const n=Array.from(t.getChildren()).filter((t=>gs(t,e.mapper)));for(const t of n)e.reconvertItem(t)}}(e,t.editing)}))}}var Jy=t(85785),Yy=t.n(Jy),Qy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(Yy(),Qy),Yy().locals;class Xy extends tg{constructor(t){super(t);const e=this.bindTemplate;this.items=this._createGridCollection(),this.keystrokes=new ju,this.focusTracker=new zu,this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",((t,e)=>`${e} \xd7 ${t}`)),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},on:{"mouseover@.ck-insert-table-dropdown-grid-box":e.to("boxover")},children:this.items},{tag:"div",attributes:{class:["ck","ck-insert-table-dropdown__label"],"aria-hidden":!0},children:[{text:e.to("label")}]}],on:{mousedown:e.to((t=>{t.preventDefault()})),click:e.to((()=>{this.fire("execute")}))}}),this.on("boxover",((t,e)=>{const{row:n,column:i}=e.target.dataset;this.items.get(10*(parseInt(n,10)-1)+(parseInt(i,10)-1)).focus()})),this.focusTracker.on("change:focusedElement",((t,e,n)=>{if(!n)return;const{row:i,column:r}=n.dataset;this.set({rows:parseInt(i),columns:parseInt(r)})})),this.on("change:columns",(()=>this._highlightGridBoxes())),this.on("change:rows",(()=>this._highlightGridBoxes()))}render(){super.render(),mi({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:10,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection});for(const t of this.items)this.focusTracker.add(t.element);this.keystrokes.listenTo(this.element)}focus(){this.items.get(0).focus()}focusLast(){this.items.get(0).focus()}_highlightGridBoxes(){const t=this.rows,e=this.columns;this.items.map(((n,i)=>{const r=Math.floor(i/10)<t&&i%10<e;n.set("isOn",r)}))}_createGridButton(t,e,n,i){const r=new fg(t);return r.set({label:i,class:"ck-insert-table-dropdown-grid-box"}),r.extendTemplate({attributes:{"data-row":e,"data-column":n}}),r}_createGridCollection(){const t=[];for(let e=0;e<100;e++){const n=Math.floor(e/10),i=e%10,r=`${n+1} \xd7 ${i+1}`;t.push(this._createGridButton(this.locale,n+1,i+1,r))}return this.createCollection(t)}}class Zy extends Uu{static get pluginName(){return"TableUI"}init(){const t=this.editor,e=this.editor.t,n="ltr"===t.locale.contentLanguageDirection;t.ui.componentFactory.add("insertTable",(n=>{const i=t.commands.get("insertTable"),r=Vi(n);let o;return r.bind("isEnabled").to(i),r.buttonView.set({icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 6v3h4V6H3zm0 4v3h4v-3H3zm0 4v3h4v-3H3zm5 3h4v-3H8v3zm5 0h4v-3h-4v3zm4-4v-3h-4v3h4zm0-4V6h-4v3h4zm1.5 8a1.5 1.5 0 0 1-1.5 1.5H3A1.5 1.5 0 0 1 1.5 17V4c.222-.863 1.068-1.5 2-1.5h13c.932 0 1.778.637 2 1.5v13zM12 13v-3H8v3h4zm0-4V6H8v3h4z"/></svg>',label:e("Insert table"),tooltip:!0}),r.on("change:isOpen",(()=>{o||(o=new Xy(n),r.panelView.children.add(o),o.delegate("execute").to(r),r.on("execute",(()=>{t.execute("insertTable",{rows:o.rows,columns:o.columns}),t.editing.view.focus()})))})),r})),t.ui.componentFactory.add("tableColumn",(t=>{const i=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:e("Header column"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:n?"insertTableColumnLeft":"insertTableColumnRight",label:e("Insert column left")}},{type:"button",model:{commandName:n?"insertTableColumnRight":"insertTableColumnLeft",label:e("Insert column right")}},{type:"button",model:{commandName:"removeTableColumn",label:e("Delete column")}},{type:"button",model:{commandName:"selectTableColumn",label:e("Select column")}}];return this._prepareDropdown(e("Column"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M18 7v1H2V7h16zm0 5v1H2v-1h16z" opacity=".6"/><path d="M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1zm-2 1H8v4h4V2zm0 6H8v4h4V8zm0 6H8v4h4v-4z"/></svg>',i,t)})),t.ui.componentFactory.add("tableRow",(t=>{const n=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:e("Header row"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowAbove",label:e("Insert row above")}},{type:"button",model:{commandName:"insertTableRowBelow",label:e("Insert row below")}},{type:"button",model:{commandName:"removeTableRow",label:e("Delete row")}},{type:"button",model:{commandName:"selectTableRow",label:e("Select row")}}];return this._prepareDropdown(e("Row"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v16h-1V2z" opacity=".6"/><path d="M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1 2v4h4V8H2zm6 0v4h4V8H8zm6 0v4h4V8h-4z"/></svg>',n,t)})),t.ui.componentFactory.add("mergeTableCells",(t=>{const i=[{type:"button",model:{commandName:"mergeTableCellUp",label:e("Merge cell up")}},{type:"button",model:{commandName:n?"mergeTableCellRight":"mergeTableCellLeft",label:e("Merge cell right")}},{type:"button",model:{commandName:"mergeTableCellDown",label:e("Merge cell down")}},{type:"button",model:{commandName:n?"mergeTableCellLeft":"mergeTableCellRight",label:e("Merge cell left")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:e("Split cell vertically")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:e("Split cell horizontally")}}];return this._prepareMergeSplitButtonDropdown(e("Merge cells"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v7h-1V2zm6 5v1H2V7h16zM8 12v1H2v-1h6z" opacity=".6"/><path d="M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1 2v9h10V9H8z"/></svg>',i,t)}))}_prepareDropdown(t,e,n,i){const r=this.editor,o=Vi(i),s=this._fillDropdownWithListOptions(o,n);return o.buttonView.set({label:t,icon:e,tooltip:!0}),o.bind("isEnabled").toMany(s,"isEnabled",((...t)=>t.some((t=>t)))),this.listenTo(o,"execute",(t=>{r.execute(t.source.commandName),t.source instanceof wg||r.editing.view.focus()})),o}_prepareMergeSplitButtonDropdown(t,e,n,i){const r=this.editor,o=Vi(i,Og),s="mergeTableCells",a=r.commands.get(s),c=this._fillDropdownWithListOptions(o,n);return o.buttonView.set({label:t,icon:e,tooltip:!0,isEnabled:!0}),o.bind("isEnabled").toMany([a,...c],"isEnabled",((...t)=>t.some((t=>t)))),this.listenTo(o.buttonView,"execute",(()=>{r.execute(s),r.editing.view.focus()})),this.listenTo(o,"execute",(t=>{r.execute(t.source.commandName),r.editing.view.focus()})),o}_fillDropdownWithListOptions(t,e){const n=this.editor,i=[],r=new Lu;for(const t of e)ws(t,n,i,r);return Fi(t,r),i}}var t_=t(37704),e_=t.n(t_),n_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(e_(),n_),e_().locals;class i_ extends Uu{static get pluginName(){return"TableSelection"}static get requires(){return[jy,jy]}init(){const t=this.editor,e=t.model,n=t.editing.view;this.listenTo(e,"deleteContent",((t,e)=>this._handleDeleteContent(t,e)),{priority:"high"}),this.listenTo(n.document,"insertText",((t,e)=>this._handleInsertTextEvent(t,e)),{priority:"high"}),this._defineSelectionConverter(),this._enablePluginDisabling()}
getSelectedTableCells(){const t=this.editor.plugins.get(jy),e=this.editor.model.document.selection,n=t.getSelectedTableCells(e);return 0==n.length?null:n}getSelectionAsFragment(){const t=this.editor.plugins.get(jy),e=this.getSelectedTableCells();return e?this.editor.model.change((n=>{const i=n.createDocumentFragment(),{first:r,last:o}=t.getColumnIndexes(e),{first:s,last:a}=t.getRowIndexes(e),c=e[0].findAncestor("table");let l=a,u=o;if(t.isSelectionRectangular(e)){const t={firstColumn:r,lastColumn:o,firstRow:s,lastRow:a};l=Yo(c,t),u=Qo(c,t)}const h=jo(c,{startRow:s,startColumn:r,endRow:l,endColumn:u},n);return n.insert(h,i,0),i})):null}setCellSelection(t,e){const n=this._getCellsToSelect(t,e);this.editor.model.change((t=>{t.setSelection(n.cells.map((e=>t.createRangeOn(e))),{backward:n.backward})}))}getFocusCell(){const t=[...this.editor.model.document.selection.getRanges()].pop().getContainedElement();return t&&t.is("element","tableCell")?t:null}getAnchorCell(){const t=wt(this.editor.model.document.selection.getRanges()).getContainedElement();return t&&t.is("element","tableCell")?t:null}_defineSelectionConverter(){const t=this.editor,e=new Set;t.conversion.for("editingDowncast").add((t=>t.on("selection",((t,n,i)=>{const r=i.writer;!function(t){for(const n of e)t.removeClass("ck-editor__editable_selected",n);e.clear()}(r);const o=this.getSelectedTableCells();if(!o)return;for(const t of o){const n=i.mapper.toViewElement(t);r.addClass("ck-editor__editable_selected",n),e.add(n)}const s=i.mapper.toViewElement(o[o.length-1]);r.setSelection(s,0)}),{priority:"lowest"})))}_enablePluginDisabling(){const t=this.editor;this.on("change:isEnabled",(()=>{if(!this.isEnabled){const e=this.getSelectedTableCells();if(!e)return;t.model.change((n=>{const i=n.createPositionAt(e[0],0),r=t.model.schema.getNearestSelectionRange(i);n.setSelection(r)}))}}))}_handleDeleteContent(t,e){const n=this.editor.plugins.get(jy),[i,r]=e,o=this.editor.model,s=!r||"backward"==r.direction,a=n.getSelectedTableCells(i);a.length&&(t.stop(),o.change((t=>{const e=a[s?a.length-1:0];o.change((t=>{for(const e of a)o.deleteContent(t.createSelection(e,"in"))}));const n=o.schema.getNearestSelectionRange(t.createPositionAt(e,0));i.is("documentSelection")?t.setSelection(n):i.setTo(n)})))}_handleInsertTextEvent(t,e){const n=this.editor,i=n.model.document.selection,r=this.getSelectedTableCells(i);if(!r)return;const o=n.editing.view,s=n.editing.mapper,a=r.map((t=>o.createRangeOn(s.toViewElement(t))));e.selection=o.createSelection(a)}_getCellsToSelect(t,e){const n=this.editor.plugins.get("TableUtils"),i=n.getCellLocation(t),r=n.getCellLocation(e),o=Math.min(i.row,r.row),s=Math.max(i.row,r.row),a=Math.min(i.column,r.column),c=Math.max(i.column,r.column),l=new Array(s-o+1).fill(null).map((()=>[])),u={startRow:o,endRow:s,startColumn:a,endColumn:c};for(const{row:e,cell:n}of new Ry(t.findAncestor("table"),u))l[e-o].push(n);const h=r.row<i.row,d=r.column<i.column;return h&&l.reverse(),d&&l.forEach((t=>t.reverse())),{cells:l.flat(),backward:h||d}}}class r_ extends Uu{static get pluginName(){return"TableClipboard"}static get requires(){return[i_,jy]}init(){const t=this.editor,e=t.editing.view.document;this.listenTo(e,"copy",((t,e)=>this._onCopyCut(t,e))),this.listenTo(e,"cut",((t,e)=>this._onCopyCut(t,e))),this.listenTo(t.model,"insertContent",((t,e)=>this._onInsertContent(t,...e)),{priority:"high"}),this.decorate("_replaceTableSlotCell")}_onCopyCut(t,e){const n=this.editor.plugins.get(i_);if(!n.getSelectedTableCells())return;if("cut"==t.name&&this.editor.isReadOnly)return;e.preventDefault(),t.stop();const i=this.editor.data,r=this.editor.editing.view.document,o=i.toView(n.getSelectionAsFragment());r.fire("clipboardOutput",{dataTransfer:e.dataTransfer,content:o,method:t.name})}_onInsertContent(t,e,n){if(n&&!n.is("documentSelection"))return;const i=this.editor.model,r=this.editor.plugins.get(jy);let o=vs(e,i);if(!o)return;const s=r.getSelectionAffectedTableCells(i.document.selection);s.length?(t.stop(),i.change((t=>{const e={width:r.getColumns(o),height:r.getRows(o)},n=function(t,e,n,i){const r=t[0].findAncestor("table"),o=i.getColumnIndexes(t),s=i.getRowIndexes(t),a={firstColumn:o.first,lastColumn:o.last,firstRow:s.first,lastRow:s.last},c=1===t.length;return c&&(a.lastRow+=e.height-1,a.lastColumn+=e.width-1,function(t,e,n,i){const r=i.getColumns(t),o=i.getRows(t);n>r&&i.insertColumns(t,{at:r,columns:n-r}),e>o&&i.insertRows(t,{at:o,rows:e-o})}(r,a.lastRow+1,a.lastColumn+1,i)),c||!i.isSelectionRectangular(t)?function(t,e,n){const{firstRow:i,lastRow:r,firstColumn:o,lastColumn:s}=e,a={first:i,last:r},c={first:o,last:s};ys(t,o,a,n),ys(t,s+1,a,n),bs(t,i,c,n),bs(t,r+1,c,n,i)}(r,a,n):(a.lastRow=Yo(r,a),a.lastColumn=Qo(r,a)),a}(s,e,t,r),i=n.lastRow-n.firstRow+1,a=n.lastColumn-n.firstColumn+1,c={startRow:0,startColumn:0,endRow:Math.min(i,e.height)-1,endColumn:Math.min(a,e.width)-1};o=jo(o,c,t);const l=s[0].findAncestor("table"),u=this._replaceSelectedCellsWithPasted(o,e,l,n,t);if(this.editor.plugins.get("TableSelection").isEnabled){const e=r.sortRanges(u.map((e=>t.createRangeOn(e))));t.setSelection(e)}else t.setSelection(u[0],0)}))):Jo(o,r)}_replaceSelectedCellsWithPasted(t,e,n,i,r){const{width:o,height:s}=e,a=function(t,e,n){const i=new Array(n).fill(null).map((()=>new Array(e).fill(null)));for(const{column:e,row:n,cell:r}of new Ry(t))i[n][e]=r;return i}(t,o,s),c=[...new Ry(n,{startRow:i.firstRow,endRow:i.lastRow,startColumn:i.firstColumn,endColumn:i.lastColumn,includeAllSlots:!0})],l=[];let u;for(const t of c){const{row:e,column:n}=t;n===i.firstColumn&&(u=t.getPositionBefore());const c=e-i.firstRow,h=n-i.firstColumn,d=a[c%s][h%o],f=d?r.cloneElement(d):null,m=this._replaceTableSlotCell(t,f,u,r);m&&(qo(m,e,n,i.lastRow,i.lastColumn,r),l.push(m),u=r.createPositionAfter(m))}const h=parseInt(n.getAttribute("headingRows")||0),d=parseInt(n.getAttribute("headingColumns")||0),f=i.firstRow<h&&h<=i.lastRow,m=i.firstColumn<d&&d<=i.lastColumn;if(f){const t=bs(n,h,{first:i.firstColumn,last:i.lastColumn},r,i.firstRow);l.push(...t)}if(m){const t=ys(n,d,{first:i.firstRow,last:i.lastRow},r);l.push(...t)}return l}_replaceTableSlotCell(t,e,n,i){const{cell:r,isAnchor:o}=t;return o&&i.remove(r),e?(i.insert(e,n),e):null}getTableIfOnlyTableInContent(t,e){return vs(t,e)}}class o_ extends Uu{static get pluginName(){return"TableKeyboard"}static get requires(){return[i_,jy]}init(){const t=this.editor.editing.view.document;this.listenTo(t,"arrowKey",((...t)=>this._onArrowKey(...t)),{context:"table"}),this.listenTo(t,"tab",((...t)=>this._handleTabOnSelectedTable(...t)),{context:"figure"}),this.listenTo(t,"tab",((...t)=>this._handleTab(...t)),{context:["th","td"]})}_handleTabOnSelectedTable(t,e){const n=this.editor,i=n.model.document.selection.getSelectedElement();i&&i.is("element","table")&&(e.preventDefault(),e.stopPropagation(),t.stop(),n.model.change((t=>{t.setSelection(t.createRangeIn(i.getChild(0).getChild(0)))})))}_handleTab(t,e){const n=this.editor,i=this.editor.plugins.get(jy),r=n.model.document.selection,o=!e.shiftKey;let s=i.getTableCellsContainingSelection(r)[0];if(s||(s=this.editor.plugins.get("TableSelection").getFocusCell()),!s)return;e.preventDefault(),e.stopPropagation(),t.stop();const a=s.parent,c=a.parent,l=c.getChildIndex(a),u=a.getChildIndex(s),h=0===u;if(!o&&h&&0===l)return void n.model.change((t=>{t.setSelection(t.createRangeOn(c))}));const d=u===a.childCount-1,f=l===i.getRows(c)-1;if(o&&f&&d&&(n.execute("insertTableRowBelow"),l===i.getRows(c)-1))return void n.model.change((t=>{t.setSelection(t.createRangeOn(c))}));let m;if(o&&d){const t=c.getChild(l+1);m=t.getChild(0)}else if(!o&&h){const t=c.getChild(l-1);m=t.getChild(t.childCount-1)}else m=a.getChild(u+(o?1:-1));n.model.change((t=>{t.setSelection(t.createRangeIn(m))}))}_onArrowKey(t,e){const n=this.editor,i=ft(e.keyCode,n.locale.contentLanguageDirection);this._handleArrowKeys(i,e.shiftKey)&&(e.preventDefault(),e.stopPropagation(),t.stop())}_handleArrowKeys(t,e){const n=this.editor.plugins.get(jy),i=this.editor.model,r=i.document.selection,o=["right","down"].includes(t),s=n.getSelectedTableCells(r);if(s.length){let n;return n=e?this.editor.plugins.get("TableSelection").getFocusCell():o?s[s.length-1]:s[0],this._navigateFromCellInDirection(n,t,e),!0}const a=r.focus.findAncestor("tableCell");if(!a)return!1;if(!r.isCollapsed)if(e){if(r.isBackward==o&&!r.containsEntireContent(a))return!1}else{const t=r.getSelectedElement();if(!t||!i.schema.isObject(t))return!1}return!!this._isSelectionAtCellEdge(r,a,o)&&(this._navigateFromCellInDirection(a,t,e),!0)}_isSelectionAtCellEdge(t,e,n){const i=this.editor.model,r=this.editor.model.schema,o=n?t.getLastPosition():t.getFirstPosition();if(!r.getLimitElement(o).is("element","tableCell"))return i.createPositionAt(e,n?"end":0).isTouching(o);const s=i.createSelection(o);return i.modifySelection(s,{direction:n?"forward":"backward"}),o.isEqual(s.focus)}_navigateFromCellInDirection(t,e,n=!1){const i=this.editor.model,r=t.findAncestor("table"),o=[...new Ry(r,{includeAllSlots:!0})],{row:s,column:a}=o[o.length-1],c=o.find((({cell:e})=>e==t));let{row:l,column:u}=c;switch(e){case"left":u--;break;case"up":l--;break;case"right":u+=c.cellWidth;break;case"down":l+=c.cellHeight}if(l<0||l>s||u<0&&l<=0||u>a&&l>=s)return void i.change((t=>{t.setSelection(t.createRangeOn(r))}));u<0?(u=n?0:a,l--):u>a&&(u=n?a:0,l++);const h=o.find((t=>t.row==l&&t.column==u)).cell,d=["right","down"].includes(e),f=this.editor.plugins.get("TableSelection");if(n&&f.isEnabled){const e=f.getAnchorCell()||t;f.setCellSelection(e,h)}else{const t=i.createPositionAt(h,d?0:"end");i.change((e=>{e.setSelection(t)}))}}}class s_ extends Bd{constructor(t){super(t),this.domEventType=["mousemove","mouseleave"]}onDomEvent(t){this.fire(t.type,t)}}class a_ extends Uu{static get pluginName(){return"TableMouse"}static get requires(){return[i_,jy]}init(){this.editor.editing.view.addObserver(s_),this._enableShiftClickSelection(),this._enableMouseDragSelection()}_enableShiftClickSelection(){const t=this.editor,e=t.plugins.get(jy);let n=!1;const i=t.plugins.get(i_);this.listenTo(t.editing.view.document,"mousedown",((r,o)=>{const s=t.model.document.selection;if(!this.isEnabled||!i.isEnabled)return;if(!o.domEvent.shiftKey)return;const a=i.getAnchorCell()||e.getTableCellsContainingSelection(s)[0];if(!a)return;const c=this._getModelTableCellFromDomEvent(o);c&&ks(a,c)&&(n=!0,i.setCellSelection(a,c),o.preventDefault())})),this.listenTo(t.editing.view.document,"mouseup",(()=>{n=!1})),this.listenTo(t.editing.view.document,"selectionChange",(t=>{n&&t.stop()}),{priority:"highest"})}_enableMouseDragSelection(){const t=this.editor;let e,n,i=!1,r=!1;const o=t.plugins.get(i_);this.listenTo(t.editing.view.document,"mousedown",((t,n)=>{this.isEnabled&&o.isEnabled&&(n.domEvent.shiftKey||n.domEvent.ctrlKey||n.domEvent.altKey||(e=this._getModelTableCellFromDomEvent(n)))})),this.listenTo(t.editing.view.document,"mousemove",((t,s)=>{if(!s.domEvent.buttons)return;if(!e)return;const a=this._getModelTableCellFromDomEvent(s);a&&ks(e,a)&&(n=a,i||n==e||(i=!0)),i&&(r=!0,o.setCellSelection(e,n),s.preventDefault())})),this.listenTo(t.editing.view.document,"mouseup",(()=>{i=!1,r=!1,e=null,n=null})),this.listenTo(t.editing.view.document,"selectionChange",(t=>{r&&t.stop()}),{priority:"highest"})}_getModelTableCellFromDomEvent(t){const e=t.target,n=this.editor.editing.view.createPositionAt(e,0);return this.editor.editing.mapper.toModelPosition(n).parent.findAncestor("tableCell",{includeSelf:!0})}}var c_=t(72352),l_=t.n(c_),u_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(l_(),u_),l_().locals;class h_ extends Uu{static get pluginName(){return"IndentEditing"}init(){const t=this.editor;t.commands.add("indent",new $u(t)),t.commands.add("outdent",new $u(t))}}var d_='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zM1.632 6.95 5.02 9.358a.4.4 0 0 1-.013.661l-3.39 2.207A.4.4 0 0 1 1 11.892V7.275a.4.4 0 0 1 .632-.326z"/></svg>',f_='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zm1.618-9.55L.98 9.358a.4.4 0 0 0 .013.661l3.39 2.207A.4.4 0 0 0 5 11.892V7.275a.4.4 0 0 0-.632-.326z"/></svg>';class m_ extends Uu{static get pluginName(){return"IndentUI"}init(){const t=this.editor,e=t.locale,n=t.t,i="ltr"==e.uiLanguageDirection?d_:f_,r="ltr"==e.uiLanguageDirection?f_:d_;this._defineButton("indent",n("Increase indent"),i),this._defineButton("outdent",n("Decrease indent"),r)}_defineButton(t,e,n){const i=this.editor;i.ui.componentFactory.add(t,(r=>{const o=i.commands.get(t),s=new fg(r);return s.set({label:e,icon:n,tooltip:!0}),s.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(s,"execute",(()=>{i.execute(t),i.editing.view.focus()})),s}))}}class g_ extends Wu{constructor(t,e){super(t),this._indentBehavior=e}refresh(){const t=this.editor.model,e=wt(t.document.selection.getSelectedBlocks());e&&t.schema.checkAttribute(e,"blockIndent")?this.isEnabled=this._indentBehavior.checkEnabled(e.getAttribute("blockIndent")):this.isEnabled=!1}execute(){const t=this.editor.model,e=function(t){const e=t.document.selection,n=t.schema;return Array.from(e.getSelectedBlocks()).filter((t=>n.checkAttribute(t,"blockIndent")))}(t);t.change((t=>{for(const n of e){const e=n.getAttribute("blockIndent"),i=this._indentBehavior.getNextIndent(e);i?t.setAttribute("blockIndent",i,n):t.removeAttribute("blockIndent",n)}}))}}class p_{constructor(t){this.isForward="forward"===t.direction,this.offset=t.offset,this.unit=t.unit}checkEnabled(t){const e=parseFloat(t||0);return this.isForward||e>0}getNextIndent(t){const e=parseFloat(t||0);if(t&&!t.endsWith(this.unit))return this.isForward?this.offset+this.unit:void 0;const n=e+(this.isForward?this.offset:-this.offset);return n>0?n+this.unit:void 0}}class w_{constructor(t){this.isForward="forward"===t.direction,this.classes=t.classes}checkEnabled(t){const e=this.classes.indexOf(t);return this.isForward?e<this.classes.length-1:e>=0}getNextIndent(t){const e=this.classes.indexOf(t),n=this.isForward?1:-1;return this.classes[e+n]}}const v_=["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"];class b_ extends Wu{constructor(t,e){super(t),this.modelElements=e}refresh(){const t=wt(this.editor.model.document.selection.getSelectedBlocks());this.value=!!t&&this.modelElements.includes(t.name)&&t.name,this.isEnabled=!!t&&this.modelElements.some((e=>Cs(t,e,this.editor.model.schema)))}execute(t){const e=this.editor.model,n=e.document,i=t.value;e.change((t=>{const r=Array.from(n.selection.getSelectedBlocks()).filter((t=>Cs(t,i,e.schema)));for(const e of r)e.is("element",i)||t.rename(e,i)}))}}const y_="paragraph";class __ extends Uu{static get pluginName(){return"HeadingEditing"}constructor(t){super(t),t.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[xy]}init(){const t=this.editor,e=t.config.get("heading.options"),n=[];for(const i of e)"paragraph"!==i.model&&(t.model.schema.register(i.model,{inheritAllFrom:"$block"}),t.conversion.elementToElement(i),n.push(i.model));this._addDefaultH1Conversion(t),t.commands.add("heading",new b_(t,n))}afterInit(){const t=this.editor,e=t.commands.get("enter"),n=t.config.get("heading.options");e&&this.listenTo(e,"afterExecute",((e,i)=>{const r=t.model.document.selection.getFirstPosition().parent;n.some((t=>r.is("element",t.model)))&&!r.is("element",y_)&&0===r.childCount&&i.writer.rename(r,y_)}))}_addDefaultH1Conversion(t){t.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:$s.get("low")+1})}}class k_ extends __{static get pluginName(){return"Block Style Editing"}static get requires(){return[xy]}init(){const t=this.editor,e=t.config.get("heading.options"),n=[];for(const i of e)"paragraph"!==i.model&&(t.model.schema.register(i.model,{inheritAllFrom:"$block",allowAttributes:["id","class"]}),t.conversion.elementToElement({model:i.model,view:{name:i.view,classes:i.classes.split(" ")}}),n.push(i.model)),t.commands.add("heading",new b_(t,n))}}var A_=t(38868),x_=t.n(A_),T_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(x_(),T_),x_().locals;class C_ extends Uu{static get pluginName(){return"HeadingUI"}init(){const t=this.editor,e=t.t,n=function(t){const e=t.t,n={Paragraph:e("Paragraph"),"Heading 1":e("Heading 1"),"Heading 2":e("Heading 2"),"Heading 3":e("Heading 3"),"Heading 4":e("Heading 4"),"Heading 5":e("Heading 5"),"Heading 6":e("Heading 6")};return t.config.get("heading.options").map((t=>{const e=n[t.title];return e&&e!=t.title&&(t.title=e),t}))}(t),i=e("Choose heading"),r=e("Heading");t.ui.componentFactory.add("heading",(e=>{const o={},s=new Lu,a=t.commands.get("heading"),c=t.commands.get("paragraph"),l=[a];for(const t of n){const e={type:"button",model:new Bp({label:t.title,class:t.class,withText:!0})};"paragraph"===t.model?(e.model.bind("isOn").to(c,"value"),e.model.set("commandName","paragraph"),l.push(c)):(e.model.bind("isOn").to(a,"value",(e=>e===t.model)),e.model.set({commandName:"heading",commandValue:t.model})),s.add(e),o[t.model]=t.title}const u=Vi(e);return Fi(u,s),u.buttonView.set({isOn:!1,withText:!0,tooltip:r}),u.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),u.bind("isEnabled").toMany(l,"isEnabled",((...t)=>t.some((t=>t)))),u.buttonView.bind("label").to(a,"value",c,"value",((t,e)=>{const n=t||e&&"paragraph";return"boolean"==typeof n?i:o[n]?o[n]:i})),this.listenTo(u,"execute",(e=>{const{commandName:n,commandValue:i}=e.source;t.execute(n,i?{value:i}:void 0),t.editing.view.focus()})),u}))}}class E_ extends pv{execute(){const t=this.editor.model,e=t.document.selection,n=!this.value,i=this.editor.config.get("styles.options").filter((t=>"inline"===t.type&&t.model!==this.attributeKey)).map((t=>t.model));t.change((r=>{if(e.isCollapsed)n?(r.setSelectionAttribute(this.attributeKey,!0),i.forEach((t=>r.removeSelectionAttribute(t)))):r.removeSelectionAttribute(this.attributeKey);else{const o=t.schema.getValidRanges(e.getRanges(),this.attributeKey);for(const t of o)n?(r.setAttribute(this.attributeKey,n,t),i.forEach((e=>r.removeAttribute(e,t)))):r.removeAttribute(this.attributeKey,t)}}))}}class S_ extends Uu{init(){const t=this.editor;t.config.get("styles.options").filter((t=>"inline"===t.type)).forEach((({model:e,classes:n})=>{t.model.schema.extend("$text",{allowAttributes:e}),t.conversion.attributeToElement({model:e,view:{name:"span",classes:n}}),t.commands.add(e,new E_(t,e))}))}}const P_=Symbol("isAsset"),R_={audio:{id:"audio",element:"audio",mime:["audio/aac","audio/flac","audio/mp3","audio/mpeg","audio/mpeg3","audio/ogg","audio/wav","audio/wave","audio/webm","audio/x-aac","audio/x-flac","audio/x-mp3","audio/x-mpeg","audio/x-mpeg3","audio/x-pn-wav","audio/x-wav"]},image:{id:"image",element:"img",mime:["image/gif","image/jpeg","image/png","image/svg+xml","image/webp"]},video:{id:"video",element:"video",mime:["video/mp4","video/ogg","video/webm"]}};class O_ extends Bd{constructor(t){super(t),this.domEventType="dblclick"}onDomEvent(t){this.fire(t.type,t)}}class I_ extends Uu{init(){const t=this.editor,e=t.model.schema,n=t.conversion,i=t.editing.view,r=Rs();i.addObserver(O_),this.listenTo(i.document,"dblclick",((e,n)=>{if(Es(n.target)){const e=t.editing.mapper.toModelElement(n.target),r=e.getAttribute("type"),o=e.getAttribute("src");t.fire("assetBrowser_showBrowser",`${(i=r)[0].toUpperCase()}${i.substring(1)}`,o)}var i})),e.register("asset",{allowAttributes:["alt","height","src","type","width","href","data-target"],allowWhere:"$block",isBlock:!0,isObject:!0}),n.for("dataDowncast").elementToElement({model:"asset",view:(t,{writer:e})=>Ns(t,e)}),n.for("editingDowncast").elementToElement({model:"asset",view:(t,{writer:e})=>{return n=Ns(t,e),(i=e).setCustomProperty(P_,!0,n),hr(n,i);var n,i}}),["alt","src","href","data-target"].forEach((t=>n.for("downcast").attributeToAttribute({model:t,view:t}))),["height","width","max-width","float"].forEach((t=>{n.for("downcast").attributeToAttribute({model:{name:"asset",key:t},view:e=>e?{key:"style",value:{[t]:e}}:null})})),r.forEach((t=>{const e=Os(t);n.for("upcast").elementToElement({view:{name:e.element,attributes:{src:!0}},model:(t,n)=>{const i=t.getAttribute("src"),r=t.getAttribute("alt"),o=t.getAttribute("href"),s=t.getAttribute("data-target"),a=t.getStyle("height")||t.hasAttribute("height")&&`${t.getAttribute("height")}px`,c=t.getStyle("width")||t.hasAttribute("width")&&`${t.getAttribute("width")}px`,l=t.getStyle("max-width")||t.hasAttribute("max-width")&&`${t.getAttribute("max-width")}px`,u=t.getStyle("float")||t.hasAttribute("float");let h={src:i,type:e.id,width:c,height:a,alt:r,"max-width":l,float:u};return o&&(h={...h,href:o,"data-target":s}),n.writer.createElement("asset",h)}})}))}}class M_ extends Wu{refresh(){const t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=Ps(t),Ps(t)&&t.hasAttribute("alt")?this.value=t.getAttribute("alt"):this.value=!1}execute(t){const e=this.editor.model,n=e.document.selection.getSelectedElement();e.change((e=>{e.setAttribute("alt",t.newValue,n)}))}}class N_ extends Uu{init(){this.editor.commands.add("assetTextAlternative",new M_(this.editor))}}var V_=t(73680),D_=t.n(V_),B_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Yu()(D_(),B_),D_().locals;class F_ extends tg{constructor(t,e){super(t);const n=`ck-input-${a()}`,i=`ck-status-${a()}`;this.set("label",void 0),this.set("value",void 0),this.set("isReadOnly",!1),this.set("errorText",null),this.set("infoText",null),this.labelView=this._createLabelView(n),this.inputView=this._createInputView(e,n,i),this.statusView=this._createStatusView(i),this.bind("_statusText").to(this,"errorText",this,"infoText",((t,e)=>t||e));const r=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-input",r.if("isReadOnly","ck-disabled")]},children:[this.labelView,this.inputView,this.statusView]})}_createLabelView(t){const e=new kp(this.locale);return e.for=t,e.bind("text").to(this,"label"),e}_createInputView(t,e,n){const i=new t(this.locale,n);return i.id=e,i.ariaDescribedById=n,i.bind("value").to(this),i.bind("isReadOnly").to(this),i.bind("hasError").to(this,"errorText",(t=>!!t)),i.on("input",(()=>{this.errorText=null})),i}_createStatusView(t){const e=new tg(this.locale),n=this.bindTemplate;return e.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-input__status",n.if("errorText","ck-labeled-input__status_error"),n.if("_statusText","ck-hidden",(t=>!t))],id:t,role:n.if("errorText","alert")},children:[{text:n.to("_statusText")}]}),e}select(){this.inputView.select()}focus(){this.inputView.focus()}}class L_ extends tg{constructor(t){super(t);const e=this.locale.t;this.focusTracker=new zu,this.keystrokes=new ju,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(e("Save"),Um,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(e("Cancel"),Hm,"ck-button-cancel","cancel"),this._focusables=new Ym,this._focusCycler=new Mg({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),this.keystrokes.listenTo(this.element),fi({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach((t=>{this._focusables.add(t),this.focusTracker.add(t.element)}))}_createButton(t,e,n,i){const r=new fg(this.locale);return r.set({label:t,icon:e,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}_createLabeledInputView(){const t=this.locale.t,e=new F_(this.locale,Ip);return e.label=t("Text alternative"),e.inputView.placeholder=t("Text alternative"),e}}class z_ extends Uu{static get requires(){return[$p]}init(){this._createButton(),this._createForm()}_createButton(){const t=this.editor,e=t.t;t.ui.componentFactory.add("assetTextAlternative",(n=>{const i=t.commands.get("assetTextAlternative"),r=new fg(n);return r.set({label:e("Change asset text alternative"),icon:Wm,tooltip:!0}),r.bind("isEnabled").to(i,"isEnabled"),this.listenTo(r,"execute",(()=>this._showForm())),r}))}_createForm(){const t=this.editor,e=t.editing.view,n=e.document;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new L_(t.locale),this._form.render(),this.listenTo(this._form,"submit",(()=>{t.execute("assetTextAlternative",{newValue:this._form.labeledInput.inputView.element.value}),this._hideForm(!0)})),this.listenTo(this._form,"cancel",(()=>{this._hideForm(!0)})),this._form.keystrokes.set("Esc",((t,e)=>{this._hideForm(!0),e()})),this.listenTo(e,"render",(()=>{Ss(n.selection)?this._isVisible&&Ms(t):this._hideForm(!0)})),hi({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._form.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const t=this.editor,e=t.commands.get("assetTextAlternative"),n=this._form.labeledInput;this._balloon.hasView(this._form)||this._balloon.add({view:this._form,position:Is(t)}),n.inputView.element.value=e.value||"",n.value=n.inputView.element.value,this._form.labeledInput.select()}_hideForm(t){this._isVisible&&(this._balloon.remove(this._form),t&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView===this._form}}class j_ extends Uu{static get requires(){return[N_,z_]}static get pluginName(){return"AssetTextAlternative"}}class H_ extends Wu{refresh(){const t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=Ps(t)&&"audio"!==t.getAttribute("type").id,Ps(t)&&t.hasAttribute("width")?this.value=t.getAttribute("width"):this.value=!1}execute(t){const e=this.editor.model,n=e.document.selection.getSelectedElement();e.change((e=>{e.setAttribute("width",t.newValue,n)}))}}class U_ extends Uu{init(){this.editor.commands.add("assetWidth",new H_(this.editor))}}class W_ extends tg{constructor(t){super(t);const e=this.locale.t;this.focusTracker=new zu,this.keystrokes=new ju,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(e("Save"),Um,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(e("Cancel"),Hm,"ck-button-cancel","cancel"),this._focusables=new Ym,this._focusCycler=new Mg({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-asset-width-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),this.keystrokes.listenTo(this.element),fi({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach((t=>{this._focusables.add(t),this.focusTracker.add(t.element)}))}_createButton(t,e,n,i){const r=new fg(this.locale);return r.set({label:t,icon:e,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}_createLabeledInputView(){const t=this.locale.t,e=new F_(this.locale,Ip);return e.label=t("Width"),e.inputView.placeholder=t("Width"),e}}class $_ extends Uu{static get requires(){return[$p]}init(){this._createButton(),this._createForm()}_createButton(){const t=this.editor,e=t.t;t.ui.componentFactory.add("assetWidth",(n=>{const i=t.commands.get("assetWidth"),r=new fg(n);return r.set({label:e("Change width"),icon:'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="20" height="20" viewBox="0, 0, 100, 100" class="ck ck-icon ck-button__icon">\n  <path d="M35,65 L35,55 L65,55 L65,65 L80,50 L65,35 L65,45 L35,45 L35,35 L20,50 z"/>\n  <path d="M5,25 L15,25 L15,75 L5,75 z"/>\n  <path d="M85,25 L95,25 L95,75 L85,75 z"/>\n</svg>\n',tooltip:!0}),r.bind("isEnabled").to(i,"isEnabled"),this.listenTo(r,"execute",(()=>this._showForm())),r}))}_createForm(){const t=this.editor,e=t.editing.view,n=e.document;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new W_(t.locale),this._form.render(),this.listenTo(this._form,"submit",(()=>{t.execute("assetWidth",{newValue:this._form.labeledInput.inputView.element.value}),this._hideForm(!0)})),this.listenTo(this._form,"cancel",(()=>{this._hideForm(!0)})),this._form.keystrokes.set("Esc",((t,e)=>{this._hideForm(!0),e()})),this.listenTo(e,"render",(()=>{Ss(n.selection)?this._isVisible&&Ms(t):this._hideForm(!0)})),hi({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._form.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const t=this.editor,e=t.commands.get("assetWidth"),n=this._form.labeledInput;n.inputView.element.setAttribute("placeholder","e.g. 50% or 250px"),this._balloon.hasView(this._form)||this._balloon.add({view:this._form,position:Is(t)}),n.inputView.element.value=e.value||"",n.value=n.inputView.element.value,this._form.labeledInput.select()}_hideForm(t){this._isVisible&&(this._balloon.remove(this._form),t&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView===this._form}}class q_ extends Uu{static get requires(){return[U_,$_]}static get pluginName(){return"AssetWidth"}}class K_ extends Wu{refresh(){const t=this.editor.model.document.selection.getSelectedElement();t&&(this.isEnabled="image"===t.getAttribute("type"),Ps(t)&&t.hasAttribute("href")?this.value=t.getAttribute("href"):this.value=!1)}execute(t,e){const n=this.editor.model,i=n.document.selection.getSelectedElement();n.change((n=>{t&&n.setAttribute("href",t,i),e&&n.setAttribute("data-target",e,i)}))}}class G_ extends Wu{refresh(){const t=this.editor.model.document.selection.getSelectedElement();t&&(this.isEnabled="image"===t.getAttribute("type")&&t.hasAttribute("href"),Ps(t)&&t.hasAttribute("href")?this.value=t.getAttribute("href"):this.value=!1)}execute(){const t=this.editor.model,e=t.document.selection.getSelectedElement();t.change((t=>{t.removeAttribute("href",e),t.removeAttribute("data-target",e)}))}}class J_ extends Uu{init(){this.editor.commands.add("assetHref",new K_(this.editor)),this.editor.commands.add("assetHrefUnlink",new G_(this.editor))}}class Y_ extends Uu{init(){this._createLinkButton(),this._createUnlinkButton()}_createLinkButton(){const t=this.editor,e=t.t;t.ui.componentFactory.add("assetHref",(n=>{const i=t.commands.get("assetHref"),r=new fg(n);return r.set({label:e("Change image link"),icon:Db,tooltip:!0}),r.bind("isEnabled").to(i,"isEnabled"),this.listenTo(r,"execute",(()=>{const e=t.model.document.selection.getSelectedElement().getAttribute("href"),n=t.model.document.selection.getSelectedElement().getAttribute("data-target");t.fire("linkTo_showOptions",!0,e,n)})),t.on("linkTo_urlSelected",((e,n,i)=>{i&&t.execute("assetHref",n,i)})),r}))}_createUnlinkButton(){const t=this.editor,e=t.t;t.ui.componentFactory.add("assetHrefUnlink",(n=>{const i=t.commands.get("assetHrefUnlink"),r=new fg(n);return r.set({label:e("Remove image link"),icon:Nb,tooltip:!0}),r.bind("isEnabled").to(i,"isEnabled"),this.listenTo(r,"execute",(()=>t.execute("assetHrefUnlink"))),r}))}}class Q_ extends Uu{static get requires(){return[J_,Y_]}static get pluginName(){return"AssetHref"}}class X_ extends Wu{execute(t){const e=this.editor;e.model.change((n=>{let i=t.type||null;!i&&(i=function(t){const e=new XMLHttpRequest;try{e.open("HEAD",t,!1),e.send()}catch(t){return console.log(t),null}if(e.readyState===e.DONE&&e.status>=200&&e.status<300){const t=e.getResponseHeader("Content-Type").split(";")[0].trim(),n=Rs();for(let e=0;e<n.length;++e)if(R_[n[e]].mime.includes(t))return R_[n[e]]}return null}(t.src))&&(i=i.id),e.model.insertContent(n.createElement("asset",{alt:t.alt||"",src:t.src,type:i.toLowerCase()
}),e.model.document.selection)}))}}class Z_ extends Uu{init(){const t=this.editor;t.commands.add("assetBrowser",new X_(t))}}class tk extends tg{constructor(t,e){super(t);const n=this.bindTemplate,i=new Lu;for(const t of e)i.add(new eg({tag:"p",attributes:{class:["ck-insert-asset-dropdown-item"],"data-type":t},children:[t],on:{mousedown:n.to((t=>{t.preventDefault()})),click:n.to((t=>{this.fire("execute",t.currentTarget.dataset.type)}))}}));this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-asset-dropdown"]},children:i}]})}}class ek extends Uu{static get requires(){return[Vi]}init(){const t=this.editor;t.on("assetBrowser_assetSelected",((e,n,i)=>{t.execute("assetBrowser",{src:n,type:i})})),t.ui.componentFactory.add("assetBrowser",(e=>{const n=t.commands.get("assetBrowser"),i=Vi(e);i.bind("isEnabled").to(n),i.buttonView.set({icon:'<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5C3.9,3 3,3.9 3,5V19C3,20.1 3.9,21 5,21H19C20.1,21 21,20.1 21,19Z" /></svg>',label:"Insert Asset",tooltip:!0});const r=new tk(e,["Image","Video","Audio"]);return i.panelView.children.add(r),r.delegate("execute").to(i),i.on("execute",((e,n)=>{t.fire("assetBrowser_showBrowser",n)})),i}))}}class nk extends Wu{constructor(t,e){super(t),this._defaultStyle=!1,this.styles=e.reduce(((t,e)=>(t[e.name]=e,e.isDefault&&(this._defaultStyle=e.name),t)),{})}refresh(){const t=this.editor.model.document.selection.getSelectedElement();if(this.isEnabled=Ps(t),t)if(t.hasAttribute("assetStyle")){const e=t.getAttribute("assetStyle");this.value=!!this.styles[e]&&e}else this.value=this._defaultStyle;else this.value=!1}execute(t){const e=t.value,n=this.editor.model,i=n.document.selection.getSelectedElement();n.change((t=>{this.styles[e].isDefault?t.removeAttribute("assetStyle",i):t.setAttribute("assetStyle",e,i)}))}}const ik={full:{name:"full",title:"Full size asset",icon:Gm,isDefault:!0},left:{name:"left",title:"Left aligned asset",icon:$m,className:"pull-left"},right:{name:"right",title:"Right aligned asset",icon:Km,className:"pull-right"},center:{name:"center",title:"Centered asset",icon:qm,className:"centered"}},rk={full:Gm,left:$m,right:Km,center:qm};class ok extends Uu{static get requires(){return[I_]}static get pluginName(){return"AssetStyleEditing"}init(){const t=this.editor,e=t.model.schema,n=t.data,i=t.editing,r=Object.values(R_).map((t=>t.element));t.config.define("asset.styles",["full","left","right","center"]);const o=Ds(t.config.get("asset.styles"));e.extend("asset",{allowAttributes:"assetStyle"}),e.addAttributeCheck(((t,e)=>{if("assetStyle"===e&&r.includes(t.last.name))return!0}));const s=function(t){return(e,n,i)=>{if(!i.consumable.consume(n.item,e.name))return;const r=Vs(n.attributeNewValue,t),o=Vs(n.attributeOldValue,t),s=i.mapper.toViewElement(n.item),a=i.writer;o&&a.removeClass(o.className,s),r&&a.addClass(r.className,s)}}(o);i.downcastDispatcher.on("attribute:assetStyle:asset",s),n.downcastDispatcher.on("attribute:assetStyle:asset",s),r.forEach((t=>{n.upcastDispatcher.on(`element:${t}`,function(t){const e=t.filter((t=>!t.isDefault));return(t,n,i)=>{if(!n.modelRange)return;const r=n.viewItem;if(i.schema.checkAttribute(r,"assetStyle"))for(const t of e)i.consumable.consume(r,{classes:t.className})&&i.writer.setAttribute("assetStyle",t.name,n.modelRange)}}(o),{priority:"low"})})),t.commands.add("assetStyle",new nk(t,o))}}class sk extends Uu{get localizedDefaultStylesTitles(){const t=this.editor.t;return{"Full size asset":t("Full size asset"),"Side asset":t("Side asset"),"Left aligned asset":t("Left aligned asset"),"Centered asset":t("Centered asset"),"Right aligned asset":t("Right aligned asset")}}init(){const t=function(t,e){for(const n of t)e[n.title]&&(n.title=e[n.title]);return t}(Ds(this.editor.config.get("asset.styles")),this.localizedDefaultStylesTitles);for(const e of t)this._createButton(e)}_createButton(t){const e=this.editor,n=`assetStyle:${t.name}`;e.ui.componentFactory.add(n,(n=>{const i=e.commands.get("assetStyle"),r=new fg(n);return r.set({label:t.title,icon:t.icon,tooltip:!0}),r.bind("isEnabled").to(i,"isEnabled"),r.bind("isOn").to(i,"value",(e=>e===t.name)),this.listenTo(r,"execute",(()=>e.execute("assetStyle",{value:t.name}))),r}))}}const ak="groupwidget",ck="groupWidget",lk=Symbol("groupWidget");class uk extends Wu{refresh(){let t=null,e=!this.editor.isFreeTier;const n=wt(this.editor.model.document.selection.getSelectedBlocks()),i=n.is(ak)?n:n.getAncestors().find((t=>t.is(ak)));i&&(t={groupId:i.getAttribute("id"),size:i.getAttribute("size")}),this.value=t,this.isEnabled=e}execute(t){const e=this.editor;e.model.change((n=>{let{group_id:i,group_size:r,inner_html:o,css:s}=t,a=n.createElement(ak,{id:i,size:r,innerHtml:o,css:s});e.model.insertContent(a,e.model.document.selection)}))}}const hk="htmlWidget",dk="htmlWidget",fk=Symbol("htmlWidget");class mk extends Wu{refresh(){let t=null;const e=wt(this.editor.model.document.selection.getSelectedBlocks()),n=e.is(hk)?e:e.getAncestors().find((t=>t.is(hk)));n&&(t=n.getAttribute("innerHtml")),this.value=t,this.isEnabled=!0}execute(t){const e=this.editor;e.model.change((n=>{let i=n.createElement(hk,{innerHtml:t});e.model.insertContent(i,e.model.document.selection)}))}}class gk extends Wu{execute(){const t=this.editor.model,e=t.document.selection;t.change((n=>{t.insertContent(n.createElement(pk),e)}))}}const pk="horizontalrule",wk="horizontalrule",vk="hr";class bk extends Uu{static get requires(){return[$w]}static get pluginName(){return"Horizontal Rule Editing"}init(){const t=this.editor;t.commands.add(wk,new gk(t)),t.model.schema.register(pk,{allowIn:"$root",isBlock:!0,isObject:!0}),t.conversion.for("editingDowncast").elementToElement({model:pk,view:(t,{writer:e})=>hr(e.createContainerElement(vk),e)}),t.conversion.for("dataDowncast").elementToElement({model:pk,view:(t,{writer:e})=>e.createEmptyElement(vk)}),t.conversion.for("upcast").elementToElement({view:vk,model:pk})}}class yk extends Uu{static get requires(){return[bk]}static get pluginName(){return"Horizontal Rule UI"}init(){const t=this.editor;t.ui.componentFactory.add("horizontalRule",(e=>{const n=new fg(e);return n.set({label:"Horizontal Line",icon:'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="512" height="512" viewBox="0, 0, 512, 512">\n  <g id="Layer_1">\n    <path d="M32,256 C32,267.485 40.321,276.806 51.806,276.806 L459.194,276.806 C470.685,276.806 480,267.491 480,256 C480,244.509 470.685,235.194 459.194,235.194 L51.806,235.194 C40.315,235.194 32,244.509 32,256 z" fill="#000000"/>\n    <path d="M86.2,160.656 C86.2,149.166 94.915,146.698 105.665,146.698 L406.335,146.698 C417.085,146.698 425.8,149.166 425.8,160.656 C425.8,172.147 417.085,174.614 406.335,174.614 L105.665,174.614 C94.92,174.614 86.2,172.141 86.2,160.656 z" fill="#000000"/>\n    <path d="M86.2,88.595 C86.2,77.104 94.915,74.636 105.665,74.636 L406.335,74.636 C417.085,74.636 425.8,77.104 425.8,88.595 C425.8,100.086 417.085,102.553 406.335,102.553 L105.665,102.553 C94.92,102.553 86.2,100.08 86.2,88.595 z" fill="#000000"/>\n    <path d="M86.2,351.344 C86.2,339.853 94.915,337.386 105.665,337.386 L406.335,337.386 C417.085,337.386 425.8,339.853 425.8,351.344 C425.8,362.835 417.085,365.303 406.335,365.303 L105.665,365.303 C94.92,365.303 86.2,362.829 86.2,351.344 z" fill="#000000"/>\n    <path d="M86.2,423.405 C86.2,411.915 94.915,409.448 105.665,409.448 L406.335,409.448 C417.085,409.448 425.8,411.915 425.8,423.405 C425.8,434.896 417.085,437.364 406.335,437.364 L105.665,437.364 C94.92,437.364 86.2,434.89 86.2,423.405 z" fill="#000000"/>\n  </g>\n</svg>\n',tooltip:!0}),n.on("execute",(()=>t.execute(wk))),n}))}}class _k extends rw{}_k.builtinPlugins=[ow,class extends Uu{static get requires(){return[nv,Sw,av,Rw,kw,gv]}static get pluginName(){return"Essentials"}},class extends Uu{static get requires(){return[_w]}static get pluginName(){return"Autoformat"}afterInit(){this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats(),this._addCodeBlockAutoformats(),this._addHorizontalLineAutoformats()}_addListAutoformats(){const t=this.editor.commands;t.get("bulletedList")&&Ir(this.editor,this,/^[*-]\s$/,"bulletedList"),t.get("numberedList")&&Ir(this.editor,this,/^1[.|)]\s$/,"numberedList"),t.get("todoList")&&Ir(this.editor,this,/^\[\s?\]\s$/,"todoList"),t.get("checkTodoList")&&Ir(this.editor,this,/^\[\s?x\s?\]\s$/,(()=>{this.editor.execute("todoList"),this.editor.execute("checkTodoList")}))}_addBasicStylesAutoformats(){const t=this.editor.commands;if(t.get("bold")){const t=Vr(this.editor,"bold");Mr(this.editor,this,/(?:^|\s)(\*\*)([^*]+)(\*\*)$/g,t),Mr(this.editor,this,/(?:^|\s)(__)([^_]+)(__)$/g,t)}if(t.get("italic")){const t=Vr(this.editor,"italic");Mr(this.editor,this,/(?:^|\s)(\*)([^*_]+)(\*)$/g,t),Mr(this.editor,this,/(?:^|\s)(_)([^_]+)(_)$/g,t)}if(t.get("code")){const t=Vr(this.editor,"code");Mr(this.editor,this,/(`)([^`]+)(`)$/g,t)}if(t.get("strikethrough")){const t=Vr(this.editor,"strikethrough");Mr(this.editor,this,/(~~)([^~]+)(~~)$/g,t)}}_addHeadingAutoformats(){const t=this.editor.commands.get("heading");t&&t.modelElements.filter((t=>t.match(/^heading[1-6]$/))).forEach((e=>{const n=e[7],i=new RegExp(`^(#{${n}})\\s$`);Ir(this.editor,this,i,(()=>{if(!t.isEnabled||t.value===e)return!1;this.editor.execute("heading",{value:e})}))}))}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&Ir(this.editor,this,/^>\s$/,"blockQuote")}_addCodeBlockAutoformats(){const t=this.editor,e=t.model.document.selection;t.commands.get("codeBlock")&&Ir(t,this,/^```$/,(()=>{if(e.getFirstPosition().parent.is("element","listItem"))return!1;this.editor.execute("codeBlock",{usePreviousLanguageChoice:!0})}))}_addHorizontalLineAutoformats(){this.editor.commands.get("horizontalLine")&&Ir(this.editor,this,/^---$/,"horizontalLine")}},class extends Uu{static get requires(){return[vv,yv]}static get pluginName(){return"Bold"}},class extends Uu{static get requires(){return[kv,xv]}static get pluginName(){return"Italic"}},class extends Uu{static get requires(){return[Cv,Sv]}static get pluginName(){return"Underline"}},class extends Uu{static get requires(){return[Rv,Iv]}static get pluginName(){return"Strikethrough"}},class extends Uu{static get requires(){return[Dv,Fv]}static get pluginName(){return"Alignment"}},class extends Uu{static get requires(){return[zv,Wv]}static get pluginName(){return"BlockQuote"}},class extends Uu{static get requires(){return[I_,j_,q_,Q_,$w]}static get pluginName(){return"Asset"}},class extends Uu{static get requires(){return[Z_,ek]}static get pluginName(){return"AssetBrowser"}},class extends Uu{static get requires(){return[ok,sk]}static get pluginName(){return"AssetStyle"}},class extends Uu{static get requires(){return[qw]}static get pluginName(){return"AssetToolbar"}init(){this.editor.config.define("asset.toolbar",["assetStyle:left","assetStyle:center","assetStyle:right","|","assetTextAlternative","assetStyle:full","assetWidth","assetHref","assetHrefUnlink"])}afterInit(){const t=this.editor;t.plugins.get(qw).register("asset",{items:t.config.get("asset.toolbar")||[],getRelatedElement:t=>Ss(t)})}},class extends Uu{static get requires(){return[$w]}static get pluginName(){return"Group Widget"}init(){const t=this.editor,e=t.editing.view,n=ak;t.commands.add(ck,new uk(t)),t.model.schema.register(ak,{allowIn:"$root",isBlock:!0,isObject:!0,allowAttributes:["id","css","size","innerHtml"]}),e.addObserver(O_),this.listenTo(e.document,"dblclick",((e,n)=>{const i=ur(n.target)?n.target:n.target.parent;if((r=i).getCustomProperty(lk)&&ur(r)){const e=t.editing.mapper.toModelElement(i),n=e.getAttribute("id"),r=e.getAttribute("size");t.fire("groupWidget_showOptions",n,r)}var r})),t.conversion.for("editingDowncast").elementToElement({model:n,view:(t,{writer:e})=>{return n=function(t,e,n=!0){const i=t.getAttribute("id"),r=t.getAttribute("css"),o=t.getAttribute("size"),s=t.getAttribute("innerHtml"),a={id:`group_widget_${i}`,class:r,"data-group-id":i,"data-group-size":o};let c,l;n?(c=a,l={class:"group-widget-wrapper"}):(c={},l=a);let u=e.createUIElement("div",l,(function(t){const e=this.toDomElement(t);return e.innerHTML=s,e}));if(n){const t=e.createContainerElement("div",c);e.insert(e.createPositionAt(t,0),u),u=t}return u}(t,e),(i=e).setCustomProperty(lk,!0,n),hr(n,i);var n,i}}),t.conversion.for("dataDowncast").elementToElement({model:n,view:(t,{writer:e})=>{const n=t.getAttribute("id"),i=t.getAttribute("size");return e.createEmptyElement("group-widget",{"group-id":n,"group-size":i})}}),t.conversion.for("upcast").elementToElement({view:{name:"div",attributes:{"data-group-id":!0}},model:(t,{writer:e})=>{const n=t.getAttribute("data-group-id"),i=t.getAttribute("data-group-size"),r=t.getAttribute("class"),o=new Md,s=wt(t.getChildren()),a=s.hasClass("group-widget-wrapper")?s:t,c=Array.from(a.getChildren()).map((t=>{const e=document.implementation.createHTMLDocument("");return o.viewToDom(t,e).outerHTML})).join("\n");return e.createElement(ak,{id:n,size:i,css:r,innerHtml:c})}}),t.on("groupWidget_widgetReady",((e,n)=>{t.execute(ck,n)})),t.ui.componentFactory.add("groupWidget",(e=>{const n=new fg(e),i=t.commands.get(ck);return n.set({label:"Group Link",icon:'<?xml version="1.0" encoding="utf-8"?>\n<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 500 500" style="enable-background:new 0 0 500 500;" xml:space="preserve">\n<style type="text/css">\n\t.st0{fill:none;stroke:#000000;stroke-width:25;stroke-miterlimit:10;}\n</style>\n<circle class="st0" cx="254.5" cy="250.9" r="68.2" fill="none" />\n<path class="st0" d="M190.6,321.8c0,0-46.8,13.9-46.8,95.6" />\n<path class="st0" d="M317.6,321.8c0,0,46.8,13.9,46.8,95.6" />\n<circle class="st0" cx="394.2" cy="188.2" r="45.2" fill="none" />\n<path class="st0" d="M350.2,242.8c0,0-19.7,7.7-31.5,31.1" />\n<path class="st0" d="M440.1,242.8c0,0,39.9,15.7,39.9,69.8" />\n<g>\n\t<circle class="st0" cx="113.1" cy="188.2" r="45.2" fill="none" />\n\t<path class="st0" d="M157.1,242.8c0,0,19.7,7.7,31.5,31.1" />\n\t<path class="st0" d="M67.2,242.8c0,0-39.9,15.7-39.9,69.8" />\n</g>\n</svg>\n',tooltip:!0}),n.bind("isEnabled").to(i),n.on("execute",(()=>{const e=t.commands.get(ck),{groupId:n,size:i}=e.value||{};t.fire("groupWidget_showOptions",n,i)})),n}))}},class extends Uu{static get requires(){return[$w]}static get pluginName(){return"HTML Widget"}init(){const t=this.editor,e=t.editing.view,n=hk;t.commands.add(dk,new mk(t)),t.model.schema.register(hk,{allowIn:"$root",isBlock:!0,isObject:!0,allowAttributes:["innerHtml"]}),e.addObserver(O_),this.listenTo(e.document,"dblclick",((e,n)=>{const i=ur(n.target)?n.target:n.target.parent;if((r=i).getCustomProperty(fk)&&ur(r)){const e=t.editing.mapper.toModelElement(i).getAttribute("innerHtml");t.fire("htmlWidget_editSource",e)}var r})),t.conversion.for("editingDowncast").elementToElement({model:n,view:(t,{writer:e})=>{return n=Fs(t,e),(i=e).setCustomProperty(fk,!0,n),hr(n,i);var n,i}}),t.conversion.for("dataDowncast").elementToElement({model:n,view:(t,{writer:e})=>Fs(t,e,!1)}),t.conversion.for("upcast").elementToElement({view:{name:"div",attributes:{"data-html-widget":"true"}},model:(t,{writer:e})=>{const n=new Md,i=wt(t.getChildren()),r=i.hasClass&&i.hasClass("html-widget-wrapper")?i:t,o=Array.from(r.getChildren()).map((t=>{const e=document.implementation.createHTMLDocument("");return n.viewToDom(t,e).outerHTML})).join("\n");return e.createElement(hk,{innerHtml:o})}}),t.on("htmlWidget_widgetReady",((e,n)=>{t.commands.get(dk).execute(n)})),t.ui.componentFactory.add("htmlWidget",(e=>{const n=new fg(e);return n.set({label:"HTML Block",icon:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 100 125" enable-background="new 0 0 100 100" xml:space="preserve">\n  <g>\n    <path d="M45.655,81.579c-0.479,1.579-2.162,2.479-3.741,2.001l-3.828-1.16c-1.579-0.479-2.479-2.162-2.001-3.741l18.26-60.258   c0.479-1.579,2.162-2.479,3.741-2.001l3.828,1.16c1.579,0.479,2.479,2.162,2.001,3.741L45.655,81.579z M33.412,68.494   c1.056,1.268,0.883,3.169-0.384,4.226l-3.073,2.561c-1.268,1.057-3.169,0.884-4.225-0.384L6.263,51.536   c-0.704-0.845-0.704-2.228,0-3.072l19.469-23.36c1.056-1.268,2.958-1.44,4.225-0.384l3.072,2.561   c1.268,1.057,1.44,2.958,0.384,4.226L18,50L33.412,68.494z M82,50L66.587,31.506c-1.056-1.268-0.883-3.169,0.384-4.226l3.072-2.561   c1.268-1.057,3.169-0.884,4.225,0.384l19.469,23.36c0.704,0.845,0.704,2.228,0,3.072l-19.467,23.36   c-1.056,1.268-2.958,1.44-4.225,0.384l-3.073-2.561c-1.268-1.057-1.44-2.958-0.384-4.226L82,50z"/>\n  </g>\n</svg>\n',tooltip:!0}),n.on("execute",(()=>{const e=t.commands.get(dk);t.fire("htmlWidget_editSource",e.value||"")})),n}))}},class extends Uu{static get requires(){return[hy,vy,fy,$w]}static get pluginName(){return"MediaEmbed"}},class extends Uu{static get requires(){return[Ab,Fb,zb]}static get pluginName(){return"Link"}},class extends Uu{static get pluginName(){return"Link to"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"linkHref"}),t.on("linkTo_urlSelected",((e,n)=>{t.execute("link",n)})),t.ui.componentFactory.add("linkTo",(e=>{const n=new fg(e);return n.set({label:"Link to",icon:Db,tooltip:!0}),n.on("execute",(()=>{t.fire("linkTo_showOptions")})),n}))}},class extends Uu{static get requires(){return[iy,ry]}static get pluginName(){return"List"}},xy,class extends Uu{static get pluginName(){return"PasteFromOffice"}static get requires(){return[cw]}init(){const t=this.editor,e=t.editing.view.document,n=[];n.push(new Py(e)),n.push(new Cy(e)),t.plugins.get("ClipboardPipeline").on("inputTransformation",((i,r)=>{if(r._isTransformedWithPasteFromOffice)return;if(t.model.document.selection.getFirstPosition().parent.is("element","codeBlock"))return;const o=r.dataTransfer.getData("text/html"),s=n.find((t=>t.isActive(o)));s&&(r._parsedData=Ro(o,e.stylesProcessor),s.execute(r),r._isTransformedWithPasteFromOffice=!0)}),{priority:"high"})}},class extends C_{static get requires(){return[k_,S_]}init(){const t=this.editor,e=t.t,n=t.config.get("styles.options"),i=e("Styles"),r=e("Styles");t.ui.componentFactory.add("heading",(e=>{const o={},s=new Lu,a=t.commands.get("heading"),c=t.commands.get("paragraph"),l=[a];let u=null;for(const e of n){const n={type:"button",model:new Bp({label:e.title,class:e.classes,withText:!0,icon:!1})};if("normal"===e.model)n.model.bind("isOn").to(c,"value"),n.model.set("commandName","paragraph"),l.push(c);else if("inline"===e.type){let i=t.commands.get(e.model);n.model.bind("isOn").to(i,"value"),n.model.set("commandName",e.model),l.push(i)}else n.model.bind("isOn").to(a,"value",(t=>t===e.model)),n.model.set({commandName:"heading",commandValue:e.model});s.add(n),u&&u.type!==e.type&&s.add({type:"separator"}),u=e,o[e.model]=e.title}const h=Vi(e);return Fi(h,s),h.buttonView.set({isOn:!1,withText:!0,tooltip:r,icon:!1}),h.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),h.bind("isEnabled").toMany(l,"isEnabled",((...t)=>t.some((t=>t)))),h.buttonView.bind("label").to(a,"value",c,"value",((t,e)=>{const n=t||e&&"paragraph";return o[n]?o[n]:i})),this.listenTo(h,"execute",(e=>{"Normal"===e.source.commandName&&t.execute("paragraph"),t.execute(e.source.commandName,e.source.commandValue?{value:e.source.commandValue}:void 0),t.editing.view.focus()})),h}))}},class extends Uu{static get requires(){return[Gy,Zy,i_,a_,o_,r_,$w]}static get pluginName(){return"Table"}},class extends Uu{static get requires(){return[qw]}static get pluginName(){return"TableToolbar"}afterInit(){const t=this.editor,e=t.t,n=t.plugins.get(qw),i=t.config.get("table.contentToolbar"),r=t.config.get("table.tableToolbar");i&&n.register("tableContent",{ariaLabel:e("Table toolbar"),items:i,getRelatedElement:xs}),r&&n.register("table",{ariaLabel:e("Table toolbar"),items:r,getRelatedElement:As})}},class extends Uu{static get pluginName(){return"Indent"}static get requires(){return[h_,m_]}},class extends Uu{constructor(t){super(t),t.config.define("indentBlock",{offset:40,unit:"px"})}static get pluginName(){return"IndentBlock"}init(){const t=this.editor,e=t.config.get("indentBlock"),n=!e.classes||!e.classes.length,i=Object.assign({direction:"forward"},e),r=Object.assign({direction:"backward"},e);n?(t.data.addStyleProcessorRules(ci),this._setupConversionUsingOffset(t.conversion),t.commands.add("indentBlock",new g_(t,new p_(i))),t.commands.add("outdentBlock",new g_(t,new p_(r)))):(this._setupConversionUsingClasses(e.classes),t.commands.add("indentBlock",new g_(t,new w_(i))),t.commands.add("outdentBlock",new g_(t,new w_(r))))}afterInit(){const t=this.editor,e=t.model.schema,n=t.commands.get("indent"),i=t.commands.get("outdent"),r=t.config.get("heading.options");(r&&r.map((t=>t.model))||v_).forEach((t=>{e.isRegistered(t)&&e.extend(t,{allowAttributes:"blockIndent"})})),e.setAttributeProperties("blockIndent",{isFormatting:!0}),n.registerChildCommand(t.commands.get("indentBlock")),i.registerChildCommand(t.commands.get("outdentBlock"))}_setupConversionUsingOffset(){const t=this.editor.conversion,e="rtl"===this.editor.locale.contentLanguageDirection?"margin-right":"margin-left";t.for("upcast").attributeToAttribute({view:{styles:{[e]:/[\s\S]+/}},model:{key:"blockIndent",value:t=>t.getStyle(e)}}),t.for("downcast").attributeToAttribute({model:"blockIndent",view:t=>({key:"style",value:{[e]:t}})})}_setupConversionUsingClasses(t){const e={model:{key:"blockIndent",values:[]},view:{}};for(const n of t)e.model.values.push(n),e.view[n]={key:"class",value:[n]};this.editor.conversion.attributeToAttribute(e)}},class extends Uu{static get requires(){return[bk,yk]}static get pluginName(){return"Horizontal Rule"}}],_k.defaultConfig={toolbar:{items:["heading","|","bold","italic","underline","strikethrough","|","alignment","bulletedList","numberedList","blockQuote","outdent","indent","|","undo","redo","|","linkTo","horizontalRule","assetBrowser","mediaEmbed","insertTable","groupWidget","htmlWidget"]},alignment:{options:["left","right","center","justify"]},heading:{options:JSON.parse(Unite.meta("tenant_styles")).filter((t=>"block"===t.type))},styles:{options:JSON.parse(Unite.meta("tenant_styles"))},image:{toolbar:["imageStyle:full","imageStyle:side","|","imageTextAlternative"]},indentBlock:{offset:40,unit:"px"},table:{contentToolbar:["tableColumn","tableRow","mergeTableCells"]},mediaEmbed:{previewsInData:!0},link:{decorators:{addTargetToLinks:{mode:"manual",label:"Open in a new tab",attributes:{target:"_blank",rel:"noopener noreferrer"}}}},language:"en"},window.InlineEditor=_k}()}();