roosterjs 9.10.0 → 9.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- define((()=>(()=>{var e={5659:(e,t,r)=>{var n=r(8156),o={};for(var i in n)n.hasOwnProperty(i)&&(o[n[i]]=i);var a=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var l in a)if(a.hasOwnProperty(l)){if(!("channels"in a[l]))throw new Error("missing channels property: "+l);if(!("labels"in a[l]))throw new Error("missing channel labels property: "+l);if(a[l].labels.length!==a[l].channels)throw new Error("channel and label counts mismatch: "+l);var s=a[l].channels,c=a[l].labels;delete a[l].channels,delete a[l].labels,Object.defineProperty(a[l],"channels",{value:s}),Object.defineProperty(a[l],"labels",{value:c})}a.rgb.hsl=function(e){var t,r,n=e[0]/255,o=e[1]/255,i=e[2]/255,a=Math.min(n,o,i),l=Math.max(n,o,i),s=l-a;return l===a?t=0:n===l?t=(o-i)/s:o===l?t=2+(i-n)/s:i===l&&(t=4+(n-o)/s),(t=Math.min(60*t,360))<0&&(t+=360),r=(a+l)/2,[t,100*(l===a?0:r<=.5?s/(l+a):s/(2-l-a)),100*r]},a.rgb.hsv=function(e){var t,r,n,o,i,a=e[0]/255,l=e[1]/255,s=e[2]/255,c=Math.max(a,l,s),d=c-Math.min(a,l,s),u=function(e){return(c-e)/6/d+.5};return 0===d?o=i=0:(i=d/c,t=u(a),r=u(l),n=u(s),a===c?o=n-r:l===c?o=1/3+t-n:s===c&&(o=2/3+r-t),o<0?o+=1:o>1&&(o-=1)),[360*o,100*i,100*c]},a.rgb.hwb=function(e){var t=e[0],r=e[1],n=e[2];return[a.rgb.hsl(e)[0],1/255*Math.min(t,Math.min(r,n))*100,100*(n=1-1/255*Math.max(t,Math.max(r,n)))]},a.rgb.cmyk=function(e){var t,r=e[0]/255,n=e[1]/255,o=e[2]/255;return[100*((1-r-(t=Math.min(1-r,1-n,1-o)))/(1-t)||0),100*((1-n-t)/(1-t)||0),100*((1-o-t)/(1-t)||0),100*t]},a.rgb.keyword=function(e){var t=o[e];if(t)return t;var r,i,a,l=1/0;for(var s in n)if(n.hasOwnProperty(s)){var c=(i=e,a=n[s],Math.pow(i[0]-a[0],2)+Math.pow(i[1]-a[1],2)+Math.pow(i[2]-a[2],2));c<l&&(l=c,r=s)}return r},a.keyword.rgb=function(e){return n[e]},a.rgb.xyz=function(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255;return[100*(.4124*(t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*t+.7152*r+.0722*n),100*(.0193*t+.1192*r+.9505*n)]},a.rgb.lab=function(e){var t=a.rgb.xyz(e),r=t[0],n=t[1],o=t[2];return n/=100,o/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]},a.hsl.rgb=function(e){var t,r,n,o,i,a=e[0]/360,l=e[1]/100,s=e[2]/100;if(0===l)return[i=255*s,i,i];t=2*s-(r=s<.5?s*(1+l):s+l-s*l),o=[0,0,0];for(var c=0;c<3;c++)(n=a+1/3*-(c-1))<0&&n++,n>1&&n--,i=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,o[c]=255*i;return o},a.hsl.hsv=function(e){var t=e[0],r=e[1]/100,n=e[2]/100,o=r,i=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,o*=i<=1?i:2-i,[t,100*(0===n?2*o/(i+o):2*r/(n+r)),(n+r)/2*100]},a.hsv.rgb=function(e){var t=e[0]/60,r=e[1]/100,n=e[2]/100,o=Math.floor(t)%6,i=t-Math.floor(t),a=255*n*(1-r),l=255*n*(1-r*i),s=255*n*(1-r*(1-i));switch(n*=255,o){case 0:return[n,s,a];case 1:return[l,n,a];case 2:return[a,n,s];case 3:return[a,l,n];case 4:return[s,a,n];case 5:return[n,a,l]}},a.hsv.hsl=function(e){var t,r,n,o=e[0],i=e[1]/100,a=e[2]/100,l=Math.max(a,.01);return n=(2-i)*a,r=i*l,[o,100*(r=(r/=(t=(2-i)*l)<=1?t:2-t)||0),100*(n/=2)]},a.hwb.rgb=function(e){var t,r,n,o,i,a,l,s=e[0]/360,c=e[1]/100,d=e[2]/100,u=c+d;switch(u>1&&(c/=u,d/=u),n=6*s-(t=Math.floor(6*s)),1&t&&(n=1-n),o=c+n*((r=1-d)-c),t){default:case 6:case 0:i=r,a=o,l=c;break;case 1:i=o,a=r,l=c;break;case 2:i=c,a=r,l=o;break;case 3:i=c,a=o,l=r;break;case 4:i=o,a=c,l=r;break;case 5:i=r,a=c,l=o}return[255*i,255*a,255*l]},a.cmyk.rgb=function(e){var t=e[0]/100,r=e[1]/100,n=e[2]/100,o=e[3]/100;return[255*(1-Math.min(1,t*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o))]},a.xyz.rgb=function(e){var t,r,n,o=e[0]/100,i=e[1]/100,a=e[2]/100;return r=-.9689*o+1.8758*i+.0415*a,n=.0557*o+-.204*i+1.057*a,t=(t=3.2406*o+-1.5372*i+-.4986*a)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(t=Math.min(Math.max(0,t),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},a.xyz.lab=function(e){var t=e[0],r=e[1],n=e[2];return r/=100,n/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(t-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},a.lab.xyz=function(e){var t,r,n,o=e[0];t=e[1]/500+(r=(o+16)/116),n=r-e[2]/200;var i=Math.pow(r,3),a=Math.pow(t,3),l=Math.pow(n,3);return r=i>.008856?i:(r-16/116)/7.787,t=a>.008856?a:(t-16/116)/7.787,n=l>.008856?l:(n-16/116)/7.787,[t*=95.047,r*=100,n*=108.883]},a.lab.lch=function(e){var t,r=e[0],n=e[1],o=e[2];return(t=360*Math.atan2(o,n)/2/Math.PI)<0&&(t+=360),[r,Math.sqrt(n*n+o*o),t]},a.lch.lab=function(e){var t,r=e[0],n=e[1];return t=e[2]/360*2*Math.PI,[r,n*Math.cos(t),n*Math.sin(t)]},a.rgb.ansi16=function(e){var t=e[0],r=e[1],n=e[2],o=1 in arguments?arguments[1]:a.rgb.hsv(e)[2];if(0===(o=Math.round(o/50)))return 30;var i=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(t/255));return 2===o&&(i+=60),i},a.hsv.ansi16=function(e){return a.rgb.ansi16(a.hsv.rgb(e),e[2])},a.rgb.ansi256=function(e){var t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},a.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var r=.5*(1+~~(e>50));return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},a.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var r;return e-=16,[Math.floor(e/36)/5*255,Math.floor((r=e%36)/6)/5*255,r%6/5*255]},a.rgb.hex=function(e){var t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},a.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var r=t[0];3===t[0].length&&(r=r.split("").map((function(e){return e+e})).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},a.rgb.hcg=function(e){var t,r=e[0]/255,n=e[1]/255,o=e[2]/255,i=Math.max(Math.max(r,n),o),a=Math.min(Math.min(r,n),o),l=i-a;return t=l<=0?0:i===r?(n-o)/l%6:i===n?2+(o-r)/l:4+(r-n)/l+4,t/=6,[360*(t%=1),100*l,100*(l<1?a/(1-l):0)]},a.hsl.hcg=function(e){var t,r=e[1]/100,n=e[2]/100,o=0;return(t=n<.5?2*r*n:2*r*(1-n))<1&&(o=(n-.5*t)/(1-t)),[e[0],100*t,100*o]},a.hsv.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=t*r,o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],100*n,100*o]},a.hcg.rgb=function(e){var t=e[0]/360,r=e[1]/100,n=e[2]/100;if(0===r)return[255*n,255*n,255*n];var o,i=[0,0,0],a=t%1*6,l=a%1,s=1-l;switch(Math.floor(a)){case 0:i[0]=1,i[1]=l,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=l;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=l,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return o=(1-r)*n,[255*(r*i[0]+o),255*(r*i[1]+o),255*(r*i[2]+o)]},a.hcg.hsv=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t),n=0;return r>0&&(n=t/r),[e[0],100*n,100*r]},a.hcg.hsl=function(e){var t=e[1]/100,r=e[2]/100*(1-t)+.5*t,n=0;return r>0&&r<.5?n=t/(2*r):r>=.5&&r<1&&(n=t/(2*(1-r))),[e[0],100*n,100*r]},a.hcg.hwb=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],100*(r-t),100*(1-r)]},a.hwb.hcg=function(e){var t=e[1]/100,r=1-e[2]/100,n=r-t,o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],100*n,100*o]},a.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},a.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},a.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},a.gray.hsl=a.gray.hsv=function(e){return[0,0,e[0]]},a.gray.hwb=function(e){return[0,100,e[0]]},a.gray.cmyk=function(e){return[0,0,0,e[0]]},a.gray.lab=function(e){return[e[0],0,0]},a.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},a.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},734:(e,t,r)=>{var n=r(5659),o=r(8507),i={};Object.keys(n).forEach((function(e){i[e]={},Object.defineProperty(i[e],"channels",{value:n[e].channels}),Object.defineProperty(i[e],"labels",{value:n[e].labels});var t=o(e);Object.keys(t).forEach((function(r){var n=t[r];i[e][r]=function(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var r=e(t);if("object"==typeof r)for(var n=r.length,o=0;o<n;o++)r[o]=Math.round(r[o]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}(n),i[e][r].raw=function(e){var t=function(t){return null==t?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(n)}))})),e.exports=i},8507:(e,t,r)=>{var n=r(5659);function o(e,t){return function(r){return t(e(r))}}function i(e,t){for(var r=[t[e].parent,e],i=n[t[e].parent][e],a=t[e].parent;t[a].parent;)r.unshift(t[a].parent),i=o(n[t[a].parent][a],i),a=t[a].parent;return i.conversion=r,i}e.exports=function(e){for(var t=function(e){var t=function(){for(var e={},t=Object.keys(n),r=t.length,o=0;o<r;o++)e[t[o]]={distance:-1,parent:null};return e}(),r=[e];for(t[e].distance=0;r.length;)for(var o=r.pop(),i=Object.keys(n[o]),a=i.length,l=0;l<a;l++){var s=i[l],c=t[s];-1===c.distance&&(c.distance=t[o].distance+1,c.parent=o,r.unshift(s))}return t}(e),r={},o=Object.keys(t),a=o.length,l=0;l<a;l++){var s=o[l];null!==t[s].parent&&(r[s]=i(s,t))}return r}},8156:e=>{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},8854:(e,t,r)=>{var n=r(8156),o=r(9872),i={};for(var a in n)n.hasOwnProperty(a)&&(i[n[a]]=a);var l=e.exports={to:{},get:{}};function s(e,t,r){return Math.min(Math.max(t,e),r)}function c(e){var t=e.toString(16).toUpperCase();return t.length<2?"0"+t:t}l.get=function(e){var t,r;switch(e.substring(0,3).toLowerCase()){case"hsl":t=l.get.hsl(e),r="hsl";break;case"hwb":t=l.get.hwb(e),r="hwb";break;default:t=l.get.rgb(e),r="rgb"}return t?{model:r,value:t}:null},l.get.rgb=function(e){if(!e)return null;var t,r,o,i=[0,0,0,1];if(t=e.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=t[2],t=t[1],r=0;r<3;r++){var a=2*r;i[r]=parseInt(t.slice(a,a+2),16)}o&&(i[3]=parseInt(o,16)/255)}else if(t=e.match(/^#([a-f0-9]{3,4})$/i)){for(o=(t=t[1])[3],r=0;r<3;r++)i[r]=parseInt(t[r]+t[r],16);o&&(i[3]=parseInt(o+o,16)/255)}else if(t=e.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/)){for(r=0;r<3;r++)i[r]=parseInt(t[r+1],0);t[4]&&(i[3]=parseFloat(t[4]))}else{if(!(t=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/)))return(t=e.match(/(\D+)/))?"transparent"===t[1]?[0,0,0,0]:(i=n[t[1]])?(i[3]=1,i):null:null;for(r=0;r<3;r++)i[r]=Math.round(2.55*parseFloat(t[r+1]));t[4]&&(i[3]=parseFloat(t[4]))}for(r=0;r<3;r++)i[r]=s(i[r],0,255);return i[3]=s(i[3],0,1),i},l.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/);if(t){var r=parseFloat(t[4]);return[(parseFloat(t[1])+360)%360,s(parseFloat(t[2]),0,100),s(parseFloat(t[3]),0,100),s(isNaN(r)?1:r,0,1)]}return null},l.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/);if(t){var r=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,s(parseFloat(t[2]),0,100),s(parseFloat(t[3]),0,100),s(isNaN(r)?1:r,0,1)]}return null},l.to.hex=function(){var e=o(arguments);return"#"+c(e[0])+c(e[1])+c(e[2])+(e[3]<1?c(Math.round(255*e[3])):"")},l.to.rgb=function(){var e=o(arguments);return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},l.to.rgb.percent=function(){var e=o(arguments),t=Math.round(e[0]/255*100),r=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+t+"%, "+r+"%, "+n+"%)":"rgba("+t+"%, "+r+"%, "+n+"%, "+e[3]+")"},l.to.hsl=function(){var e=o(arguments);return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},l.to.hwb=function(){var e=o(arguments),t="";return e.length>=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},l.to.keyword=function(e){return i[e.slice(0,3)]}},2520:(e,t,r)=>{"use strict";var n=r(8854),o=r(734),i=[].slice,a=["keyword","gray","hex"],l={};Object.keys(o).forEach((function(e){l[i.call(o[e].labels).sort().join("")]=e}));var s={};function c(e,t){if(!(this instanceof c))return new c(e,t);if(t&&t in a&&(t=null),t&&!(t in o))throw new Error("Unknown model: "+t);var r,d;if(null==e)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof c)this.model=e.model,this.color=e.color.slice(),this.valpha=e.valpha;else if("string"==typeof e){var u=n.get(e);if(null===u)throw new Error("Unable to parse color from string: "+e);this.model=u.model,d=o[this.model].channels,this.color=u.value.slice(0,d),this.valpha="number"==typeof u.value[d]?u.value[d]:1}else if(e.length){this.model=t||"rgb",d=o[this.model].channels;var f=i.call(e,0,d);this.color=p(f,d),this.valpha="number"==typeof e[d]?e[d]:1}else if("number"==typeof e)e&=16777215,this.model="rgb",this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;var m=Object.keys(e);"alpha"in e&&(m.splice(m.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);var g=m.sort().join("");if(!(g in l))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=l[g];var h=o[this.model].labels,v=[];for(r=0;r<h.length;r++)v.push(e[h[r]]);this.color=p(v)}if(s[this.model])for(d=o[this.model].channels,r=0;r<d;r++){var y=s[this.model][r];y&&(this.color[r]=y(this.color[r]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function d(e,t,r){return(e=Array.isArray(e)?e:[e]).forEach((function(e){(s[e]||(s[e]=[]))[t]=r})),e=e[0],function(n){var o;return arguments.length?(r&&(n=r(n)),(o=this[e]()).color[t]=n,o):(o=this[e]().color[t],r&&(o=r(o)),o)}}function u(e){return function(t){return Math.max(0,Math.min(e,t))}}function p(e,t){for(var r=0;r<t;r++)"number"!=typeof e[r]&&(e[r]=0);return e}c.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(e){var t=this.model in n.to?this:this.rgb(),r=1===(t=t.round("number"==typeof e?e:1)).valpha?t.color:t.color.concat(this.valpha);return n.to[t.model](r)},percentString:function(e){var t=this.rgb().round("number"==typeof e?e:1),r=1===t.valpha?t.color:t.color.concat(this.valpha);return n.to.rgb.percent(r)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var e={},t=o[this.model].channels,r=o[this.model].labels,n=0;n<t;n++)e[r[n]]=this.color[n];return 1!==this.valpha&&(e.alpha=this.valpha),e},unitArray:function(){var e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,1!==this.valpha&&e.push(this.valpha),e},unitObject:function(){var e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,1!==this.valpha&&(e.alpha=this.valpha),e},round:function(e){return e=Math.max(e||0,0),new c(this.color.map(function(e){return function(t){return function(e,t){return Number(e.toFixed(t))}(t,e)}}(e)).concat(this.valpha),this.model)},alpha:function(e){return arguments.length?new c(this.color.concat(Math.max(0,Math.min(1,e))),this.model):this.valpha},red:d("rgb",0,u(255)),green:d("rgb",1,u(255)),blue:d("rgb",2,u(255)),hue:d(["hsl","hsv","hsl","hwb","hcg"],0,(function(e){return(e%360+360)%360})),saturationl:d("hsl",1,u(100)),lightness:d("hsl",2,u(100)),saturationv:d("hsv",1,u(100)),value:d("hsv",2,u(100)),chroma:d("hcg",1,u(100)),gray:d("hcg",2,u(100)),white:d("hwb",1,u(100)),wblack:d("hwb",2,u(100)),cyan:d("cmyk",0,u(100)),magenta:d("cmyk",1,u(100)),yellow:d("cmyk",2,u(100)),black:d("cmyk",3,u(100)),x:d("xyz",0,u(100)),y:d("xyz",1,u(100)),z:d("xyz",2,u(100)),l:d("lab",0,u(100)),a:d("lab",1),b:d("lab",2),keyword:function(e){return arguments.length?new c(e):o[this.model].keyword(this.color)},hex:function(e){return arguments.length?new c(e):n.to.hex(this.rgb().round().color)},rgbNumber:function(){var e=this.rgb().color;return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},luminosity:function(){for(var e=this.rgb().color,t=[],r=0;r<e.length;r++){var n=e[r]/255;t[r]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast:function(e){var t=this.luminosity(),r=e.luminosity();return t>r?(t+.05)/(r+.05):(r+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},isDark:function(){var e=this.rgb().color;return(299*e[0]+587*e[1]+114*e[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var e=this.rgb(),t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten:function(e){var t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken:function(e){var t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate:function(e){var t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate:function(e){var t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten:function(e){var t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken:function(e){var t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale:function(){var e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return c.rgb(t,t,t)},fade:function(e){return this.alpha(this.valpha-this.valpha*e)},opaquer:function(e){return this.alpha(this.valpha+this.valpha*e)},rotate:function(e){var t=this.hsl(),r=t.color[0];return r=(r=(r+e)%360)<0?360+r:r,t.color[0]=r,t},mix:function(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);var r=e.rgb(),n=this.rgb(),o=void 0===t?.5:t,i=2*o-1,a=r.alpha()-n.alpha(),l=((i*a==-1?i:(i+a)/(1+i*a))+1)/2,s=1-l;return c.rgb(l*r.red()+s*n.red(),l*r.green()+s*n.green(),l*r.blue()+s*n.blue(),r.alpha()*o+n.alpha()*(1-o))}},Object.keys(o).forEach((function(e){if(-1===a.indexOf(e)){var t=o[e].channels;c.prototype[e]=function(){if(this.model===e)return new c(this);if(arguments.length)return new c(arguments,e);var r,n="number"==typeof arguments[t]?t:this.valpha;return new c((r=o[this.model][e].raw(this.color),Array.isArray(r)?r:[r]).concat(n),e)},c[e]=function(r){return"number"==typeof r&&(r=p(i.call(arguments),t)),new c(r,e)}}})),e.exports=c},6195:e=>{e.exports=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))}},9872:(e,t,r)=>{"use strict";var n=r(6195),o=Array.prototype.concat,i=Array.prototype.slice,a=e.exports=function(e){for(var t=[],r=0,a=e.length;r<a;r++){var l=e[r];n(l)?t=o.call(t,i.call(l)):t.push(l)}return t};a.wrap=function(e){return function(){return e(a(arguments))}}},285:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDarkColor=void 0;var n=r(1816);Object.defineProperty(t,"getDarkColor",{enumerable:!0,get:function(){return n.default}})},1816:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2520);t.default=function(e,t){void 0===t&&(t=21.247);try{var r=n(e||void 0),o=r.lab().array(),i=(100-o[0])*((100-t)/100)+t;e=n.lab(i,o[1],o[2]).rgb().alpha(r.alpha()).toString()}catch(e){}return e}},5978:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatSegmentWithContentModel=t.formatParagraphWithContentModel=t.formatImageWithContentModel=t.formatTableWithContentModel=t.clearSelectedCells=t.insertTableColumn=t.insertTableRow=t.insertEntity=t.toggleCode=t.setParagraphMargin=t.adjustImageSelection=t.setImageAltText=t.adjustLinkSelection=t.removeLink=t.insertLink=t.clearFormat=t.getFormatState=t.changeImage=t.setImageBoxShadow=t.setImageBorder=t.setSpacing=t.toggleBlockQuote=t.setHeadingLevel=t.setDirection=t.setAlignment=t.setIndentation=t.setListStartNumber=t.setListStyle=t.insertImage=t.splitTextSegment=t.changeCapitalization=t.applySegmentFormat=t.changeFontSize=t.setTextColor=t.setFontSize=t.setFontName=t.setBackgroundColor=t.toggleSuperscript=t.toggleSubscript=t.toggleStrikethrough=t.toggleUnderline=t.toggleItalic=t.toggleBold=t.toggleNumbering=t.toggleBullet=t.applyTableBorderFormat=t.editTable=t.setTableCellShade=t.formatTable=t.insertTable=void 0,t.getListAnnounceData=t.matchLink=t.setModelIndentation=t.findListItemsInSameThread=t.setModelListStartNumber=t.setModelListStyle=t.setListType=t.formatInsertPointWithContentModel=t.formatTextSegmentBeforeSelectionMarker=void 0;var n=r(6598);Object.defineProperty(t,"insertTable",{enumerable:!0,get:function(){return n.insertTable}});var o=r(5308);Object.defineProperty(t,"formatTable",{enumerable:!0,get:function(){return o.formatTable}});var i=r(8632);Object.defineProperty(t,"setTableCellShade",{enumerable:!0,get:function(){return i.setTableCellShade}});var a=r(8649);Object.defineProperty(t,"editTable",{enumerable:!0,get:function(){return a.editTable}});var l=r(9276);Object.defineProperty(t,"applyTableBorderFormat",{enumerable:!0,get:function(){return l.applyTableBorderFormat}});var s=r(2903);Object.defineProperty(t,"toggleBullet",{enumerable:!0,get:function(){return s.toggleBullet}});var c=r(275);Object.defineProperty(t,"toggleNumbering",{enumerable:!0,get:function(){return c.toggleNumbering}});var d=r(6985);Object.defineProperty(t,"toggleBold",{enumerable:!0,get:function(){return d.toggleBold}});var u=r(6634);Object.defineProperty(t,"toggleItalic",{enumerable:!0,get:function(){return u.toggleItalic}});var p=r(1384);Object.defineProperty(t,"toggleUnderline",{enumerable:!0,get:function(){return p.toggleUnderline}});var f=r(8227);Object.defineProperty(t,"toggleStrikethrough",{enumerable:!0,get:function(){return f.toggleStrikethrough}});var m=r(8741);Object.defineProperty(t,"toggleSubscript",{enumerable:!0,get:function(){return m.toggleSubscript}});var g=r(3312);Object.defineProperty(t,"toggleSuperscript",{enumerable:!0,get:function(){return g.toggleSuperscript}});var h=r(8573);Object.defineProperty(t,"setBackgroundColor",{enumerable:!0,get:function(){return h.setBackgroundColor}});var v=r(2886);Object.defineProperty(t,"setFontName",{enumerable:!0,get:function(){return v.setFontName}});var y=r(1444);Object.defineProperty(t,"setFontSize",{enumerable:!0,get:function(){return y.setFontSize}});var b=r(2452);Object.defineProperty(t,"setTextColor",{enumerable:!0,get:function(){return b.setTextColor}});var S=r(9150);Object.defineProperty(t,"changeFontSize",{enumerable:!0,get:function(){return S.changeFontSize}});var C=r(5028);Object.defineProperty(t,"applySegmentFormat",{enumerable:!0,get:function(){return C.applySegmentFormat}});var _=r(786);Object.defineProperty(t,"changeCapitalization",{enumerable:!0,get:function(){return _.changeCapitalization}});var E=r(3066);Object.defineProperty(t,"splitTextSegment",{enumerable:!0,get:function(){return E.splitTextSegment}});var T=r(18);Object.defineProperty(t,"insertImage",{enumerable:!0,get:function(){return T.insertImage}});var k=r(5170);Object.defineProperty(t,"setListStyle",{enumerable:!0,get:function(){return k.setListStyle}});var M=r(2042);Object.defineProperty(t,"setListStartNumber",{enumerable:!0,get:function(){return M.setListStartNumber}});var O=r(5875);Object.defineProperty(t,"setIndentation",{enumerable:!0,get:function(){return O.setIndentation}});var P=r(7391);Object.defineProperty(t,"setAlignment",{enumerable:!0,get:function(){return P.setAlignment}});var w=r(635);Object.defineProperty(t,"setDirection",{enumerable:!0,get:function(){return w.setDirection}});var x=r(9036);Object.defineProperty(t,"setHeadingLevel",{enumerable:!0,get:function(){return x.setHeadingLevel}});var D=r(5793);Object.defineProperty(t,"toggleBlockQuote",{enumerable:!0,get:function(){return D.toggleBlockQuote}});var L=r(1807);Object.defineProperty(t,"setSpacing",{enumerable:!0,get:function(){return L.setSpacing}});var I=r(5313);Object.defineProperty(t,"setImageBorder",{enumerable:!0,get:function(){return I.setImageBorder}});var F=r(6694);Object.defineProperty(t,"setImageBoxShadow",{enumerable:!0,get:function(){return F.setImageBoxShadow}});var R=r(1185);Object.defineProperty(t,"changeImage",{enumerable:!0,get:function(){return R.changeImage}});var N=r(2522);Object.defineProperty(t,"getFormatState",{enumerable:!0,get:function(){return N.getFormatState}});var A=r(5810);Object.defineProperty(t,"clearFormat",{enumerable:!0,get:function(){return A.clearFormat}});var B=r(5318);Object.defineProperty(t,"insertLink",{enumerable:!0,get:function(){return B.insertLink}});var j=r(9463);Object.defineProperty(t,"removeLink",{enumerable:!0,get:function(){return j.removeLink}});var H=r(8652);Object.defineProperty(t,"adjustLinkSelection",{enumerable:!0,get:function(){return H.adjustLinkSelection}});var z=r(1699);Object.defineProperty(t,"setImageAltText",{enumerable:!0,get:function(){return z.setImageAltText}});var W=r(9828);Object.defineProperty(t,"adjustImageSelection",{enumerable:!0,get:function(){return W.adjustImageSelection}});var G=r(2934);Object.defineProperty(t,"setParagraphMargin",{enumerable:!0,get:function(){return G.setParagraphMargin}});var U=r(9719);Object.defineProperty(t,"toggleCode",{enumerable:!0,get:function(){return U.toggleCode}});var K=r(5052);Object.defineProperty(t,"insertEntity",{enumerable:!0,get:function(){return K.insertEntity}});var V=r(1470);Object.defineProperty(t,"insertTableRow",{enumerable:!0,get:function(){return V.insertTableRow}});var q=r(6682);Object.defineProperty(t,"insertTableColumn",{enumerable:!0,get:function(){return q.insertTableColumn}});var Z=r(878);Object.defineProperty(t,"clearSelectedCells",{enumerable:!0,get:function(){return Z.clearSelectedCells}});var X=r(7307);Object.defineProperty(t,"formatTableWithContentModel",{enumerable:!0,get:function(){return X.formatTableWithContentModel}});var Y=r(2270);Object.defineProperty(t,"formatImageWithContentModel",{enumerable:!0,get:function(){return Y.formatImageWithContentModel}});var $=r(8213);Object.defineProperty(t,"formatParagraphWithContentModel",{enumerable:!0,get:function(){return $.formatParagraphWithContentModel}});var Q=r(8578);Object.defineProperty(t,"formatSegmentWithContentModel",{enumerable:!0,get:function(){return Q.formatSegmentWithContentModel}});var J=r(1328);Object.defineProperty(t,"formatTextSegmentBeforeSelectionMarker",{enumerable:!0,get:function(){return J.formatTextSegmentBeforeSelectionMarker}});var ee=r(8210);Object.defineProperty(t,"formatInsertPointWithContentModel",{enumerable:!0,get:function(){return ee.formatInsertPointWithContentModel}});var te=r(4877);Object.defineProperty(t,"setListType",{enumerable:!0,get:function(){return te.setListType}});var re=r(7023);Object.defineProperty(t,"setModelListStyle",{enumerable:!0,get:function(){return re.setModelListStyle}});var ne=r(2439);Object.defineProperty(t,"setModelListStartNumber",{enumerable:!0,get:function(){return ne.setModelListStartNumber}});var oe=r(9221);Object.defineProperty(t,"findListItemsInSameThread",{enumerable:!0,get:function(){return oe.findListItemsInSameThread}});var ie=r(9786);Object.defineProperty(t,"setModelIndentation",{enumerable:!0,get:function(){return ie.setModelIndentation}});var ae=r(7276);Object.defineProperty(t,"matchLink",{enumerable:!0,get:function(){return ae.matchLink}});var le=r(2778);Object.defineProperty(t,"getListAnnounceData",{enumerable:!0,get:function(){return le.getListAnnounceData}})},4544:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setModelAlignment=void 0;var n=r(3824),o=r(4990),i={left:{ltr:"start",rtl:"end"},center:{ltr:"center",rtl:"center"},right:{ltr:"end",rtl:"start"},justify:{ltr:"justify",rtl:"justify"}},a={left:{ltr:"alignLeft",rtl:"alignRight"},center:{ltr:"alignCenter",rtl:"alignCenter"},right:{ltr:"alignRight",rtl:"alignLeft"}};t.setModelAlignment=function(e,t){var r=(0,o.getOperationalBlocks)(e,["ListItem"],["TableCell"]);return r.forEach((function(e){var r=e.block,l=(0,o.mutateBlock)(r),s=i[t]["rtl"==l.format.direction?"rtl":"ltr"];"Table"===l.blockType&&"justify"!==t?(0,n.alignTable)(l,a[t]["rtl"==l.format.direction?"rtl":"ltr"]):l&&("BlockGroup"===l.blockType&&"ListItem"===l.blockGroupType&&l.blocks.forEach((function(e){(0,o.mutateBlock)(e).format.textAlign=s})),l.format.textAlign=s)})),r.length>0}},7484:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setModelDirection=void 0;var n=r(9221),o=r(4990);function i(e,t){if("rtl"==e.format.direction!=("rtl"==t)){var r=(0,o.mutateBlock)(e).format;r.direction=t;var n=r.marginLeft,i=r.paddingLeft;a(r,"marginLeft",r.marginRight),a(r,"marginRight",n),a(r,"paddingLeft",r.paddingRight),a(r,"paddingRight",i),e&&"Table"==e.blockType&&(e.rows.forEach((function(e){e.cells.forEach((function(e){(0,o.updateTableCellMetadata)((0,o.mutateBlock)(e),(function(t){if(null==t?void 0:t.borderOverride){var r=e.format.borderLeft;a(e.format,"borderLeft",e.format.borderRight),a(e.format,"borderRight",r)}return t}))}))})),(0,o.applyTableFormat)(e,void 0,!0))}}function a(e,t,r){r?e[t]=r:delete e[t]}t.setModelDirection=function(e,t){var r=(0,o.getOperationalBlocks)(e,["ListItem"],["TableCell"]);return r.forEach((function(r){var a=r.block;(0,o.isBlockGroupOfType)(a,"ListItem")?(0,n.findListItemsInSameThread)(e,a).forEach((function(e){var r=(0,o.mutateBlock)(e);r.levels.forEach((function(e){e.format.direction=t})),r.blocks.forEach((function(e){return i(e,t)}))})):a&&i(a,t)})),r.length>0}},9786:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setModelIndentation=void 0;var n=r(1635),o=r(9221),i=r(2778),a=r(4990);function l(e){return e.blocks.some((function(e){if("Paragraph"==e.blockType)return e.segments.some((function(e){return e.isSelected}))}))}function s(e,t,r){void 0===r&&(r=40);var n=e.marginLeft,o=e.marginRight,i="rtl"==e.direction,l=(0,a.parseValueWithUnit)(i?o:n),s=(t?Math.ceil:Math.floor)(l/r)*r;return s==l&&(s=Math.max(s+r*(t?1:-1),0)),s==l?null:s}t.setModelIndentation=function(e,t,r,c){void 0===r&&(r=40);var d=(0,a.getOperationalBlocks)(e,["ListItem"],["TableCell"]),u="indent"==t,p=[];return d.forEach((function(t){var d=t.block,f=t.parent,m=t.path;if((0,a.isBlockGroupOfType)(d,"ListItem")){var g=(0,o.findListItemsInSameThread)(e,d)[0];if(l(g)&&1==g.levels.length){var h=d.levels[0],v=(M=h.format).marginLeft,y=M.marginRight,b=s(M,u,r),S="rtl"==M.direction,C=(0,a.parseValueWithUnit)(S?y:v);u||0!=C?null!==b&&(S?h.format.marginRight=b+"px":h.format.marginLeft=b+"px"):d.levels.pop()}else if(1==d.levels.length||!function(e,t,r){for(var n=r.blocks.indexOf(t)-1;n>=0;n--){var i=r.blocks[n];if((0,a.isBlockGroupOfType)(i,"ListItem")&&1==i.levels.length&&l(i))return l((0,o.findListItemsInSameThread)(e,i)[0]);if(!(0,a.isBlockGroupOfType)(i,"ListItem"))return!1}return!1}(e,d,f)){if(u){var _=d.levels[d.levels.length-1],E=(0,a.createListLevel)((null==_?void 0:_.listType)||"UL",null==_?void 0:_.format);(0,a.updateListMetadata)(E,(function(e){return(e=e||{}).applyListStyleFromLevel=!0,e})),delete E.format.startNumberOverride,d.levels.push(E)}else d.levels.pop();d.levels.length>0&&c&&(c.announceData=(0,i.getListAnnounceData)((0,n.__spreadArray)([d],(0,n.__read)(m),!1)))}}else if(d)for(var T=d,k=f;k&&p.indexOf(T)<0;){var M,O=m.indexOf(k);if(null!==(b=s(M=(0,a.mutateBlock)(T).format,u,r))){(S="rtl"==M.direction)?M.marginRight=b+"px":M.marginLeft=b+"px",p.push(T);break}if(!("FormatContainer"==k.blockGroupType&&O>=0))break;(0,a.mutateBlock)(k),T=k,k=m[O+1]}})),d.length>0}},6428:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleModelBlockQuote=void 0;var n=r(7545),o=r(4990);function i(e){return(0,o.isBlockGroupOfType)(e,"FormatContainer")&&"blockquote"==e.tagName}t.toggleModelBlockQuote=function(e,t,r){var a=(0,o.getOperationalBlocks)(e,["FormatContainer","ListItem"],["TableCell"],!0);if(a.every((function(e){return i(e.block)})))a.forEach((function(e){var t=e.block,r=e.parent;(0,o.unwrapBlock)(r,t)}));else{var l=[],s=function(e){return(0,o.createFormatContainer)("blockquote",e?r:t)},c=function(e,n,a){return function(e,t){return i(e)&&(0,o.areSameFormats)(t,e.format)}(n,(null==a?void 0:a.format)||(e?r:t))};a.forEach((function(e){var t=e.block,r=e.parent;i(t)||(0,n.wrapBlockStep1)(l,r,t,s,c)})),(0,n.wrapBlockStep2)(l,c)}return a.length>0}},291:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearModelFormat=void 0;var n=r(1635),o=r(1486),i=r(4990);function a(e,t){var r=(0,i.getClosestAncestorBlockGroupIndex)(e,["FormatContainer"],["TableCell"]);if(r>=0&&r<e.length-1){var n=(0,i.mutateBlock)(e[r]),o=e[r+1].blocks.indexOf(n),a=n.blocks.indexOf(t);if(a>=0&&o>=0){var l=(0,i.createFormatContainer)(n.tagName,n.format);n.blocks.splice(a,1),l.blocks=n.blocks.splice(a),(0,i.mutateBlock)(e[r+1]).blocks.splice(o+1,0,t,l)}}}function l(e){var t=e[(0,i.getClosestAncestorBlockGroupIndex)(e,["ListItem"],["TableCell"])];t&&((0,i.mutateBlock)(t).levels=[])}function s(e,t){if("Divider"==t.blockType){var r=e[0].blocks.indexOf(t);r>=0&&(0,i.mutateBlock)(e[0]).blocks.splice(r,1)}else"Paragraph"==t.blockType&&(t.format={},delete t.decorator)}t.clearModelFormat=function(e,t,r,c){(0,i.iterateSelections)(e,(function(e,o,a,l){if(l)if("Paragraph"==(null==a?void 0:a.blockType)){var s=(0,n.__read)((0,i.mutateSegments)(a,l),2)[1];r.push.apply(r,(0,n.__spreadArray)([],(0,n.__read)(s),!1))}else"ListItem"==e[0].blockGroupType&&1==l.length&&e[0].formatHolder==l[0]&&r.push((0,i.mutateBlock)(e[0]).formatHolder);a?t.push([e,(0,i.mutateBlock)(a)]):o&&function(e,t){if(e){var r=e.table,n=e.colIndex,o=e.rowIndex,a=e.isWholeTableSelected,l=r.rows[o].cells[n];if(l.isSelected){var s=(0,i.mutateBlock)(l);(0,i.updateTableCellMetadata)(s,(function(){return null})),s.isHeader=!1,s.format={useBorderBox:l.format.useBorderBox}}t.find((function(e){return e[0]==r}))||t.push([(0,i.mutateBlock)(r),a])}}(o,c)}),{includeListFormatHolder:e.format?"never":"anySegment"});var d=r[0];if(1==t.length&&function(e){var t="Paragraph"==e.blockType?e.segments.filter((function(e){return e.isSelected})):[];return 1==t.length&&"SelectionMarker"==t[0].segmentType}(t[0][1])&&1==t.length)r.splice.apply(r,(0,n.__spreadArray)([0,r.length],(0,n.__read)((0,o.adjustWordSelection)(e,d)),!1)),l(t[0][0]);else if(t.length>1||t.some((function(e){return function(e){return e.isSelected||"Paragraph"==e.blockType&&e.segments.every((function(e){return e.isSelected}))}(e[1])})))for(var u=t.length-1;u>=0;u--){var p=(0,n.__read)(t[u],2),f=p[0],m=p[1];s(f,m),l(f),a(f,m)}!function(e,t){e.forEach((function(e){e.format=(0,n.__assign)({},t||{}),e.link&&delete e.link.format.textColor,delete e.code}))}(r,e.format),function(e){e.forEach((function(e){var t=(0,n.__read)(e,2),r=t[0];t[1]&&(r.format={useBorderBox:r.format.useBorderBox,borderCollapse:r.format.borderCollapse},(0,i.updateTableMetadata)(r,(function(){return null}))),(0,i.applyTableFormat)(r,void 0,!0)}))}(c)}},8839:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reducedModelChildProcessor=void 0;var n=r(1635),o=r(4990);t.reducedModelChildProcessor=function(e,t,r){if(!r.nodeStack){var i=(0,o.getSelectionRootNode)(r.selection);r.nodeStack=i?function(e,t){for(var r=[],n=t;n&&e!=n&&e.contains(n);)(0,o.isNodeOfType)(n,"ELEMENT_NODE")&&"TABLE"==n.tagName?r.splice(0,r.length,n):r.push(n),n=n.parentNode;return r}(t,i):[]}var a=r.nodeStack.pop();if(a){var l=(0,n.__read)((0,o.getRegularSelectionOffsets)(r,t),2),s=l[0],c=l[1],d=s>=0||c>=0?function(e,t){for(var r=0,n=e.firstChild;n&&n!=t;)r++,n=n.nextSibling;return r}(t,a):-1;d>=0&&(0,o.handleRegularSelection)(d,r,e,s,c),(0,o.processChildNode)(e,a,r),d>=0&&(0,o.handleRegularSelection)(d+1,r,e,s,c)}else r.defaultElementProcessors.child(e,t,r)}},7545:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wrapBlockStep2=t.wrapBlockStep1=void 0;var n=r(1635),o=r(4990);t.wrapBlockStep1=function(e,t,r,n,i){var a,l=t?(0,o.mutateBlock)(t):null,s=(0,o.mutateBlock)(r),c=null!==(a=null==l?void 0:l.blocks.indexOf(s))&&void 0!==a?a:-1;if(l&&c>=0){l.blocks.splice(c,1);var d=l.blocks[c-1],u=d?(0,o.mutateBlock)(d):null,p="rtl"==s.format.direction,f=u&&i(p,u)?u:function(e,t,r,n){var i=r(n);return(0,o.mutateBlock)(e).blocks.splice(t,0,i),i}(l,c,n,p);(0,o.setParagraphNotImplicit)(s),(0,o.addBlock)(f,s),e.unshift({parent:l,wrapper:f})}},t.wrapBlockStep2=function(e,t){e.forEach((function(e){var r,i=e.parent,a=e.wrapper,l=i.blocks.indexOf(a),s=i.blocks[l+1],c=s?(0,o.mutateBlock)(s):null,d="rtl"==a.format.direction;l>=0&&c&&t(d,c,a)&&(a.blocks.forEach(o.setParagraphNotImplicit),(r=a.blocks).push.apply(r,(0,n.__spreadArray)([],(0,n.__read)(c.blocks),!1)),(0,o.mutateBlock)(i).blocks.splice(l+1,1))}))}},2837:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertEntityModel=void 0;var n=r(1635),o=r(4990);t.insertEntityModel=function(e,t,r,i,a,l,s){var c,d,u,p,f=-1;if("begin"==r||"end"==r)u=e,f="begin"==r?0:e.blocks.length,i||Object.assign(t.format,e.format);else if(p=function(e,t,r){if(t){var n=t.paragraph,i=t.marker,a=t.tableContext,l=t.path,s=n.segments.indexOf(i),c=s>0?n.segments[s-1]:null;return"SelectionMarker"==(null==c?void 0:c.segmentType)&&c.isSelected?{marker:c,paragraph:n,tableContext:a,path:l}:t}var d=(0,o.deleteSelection)(e,[],r),u=d.insertPoint;return"range"==d.deleteResult&&(0,o.normalizeContentModel)(e),u}(e,s,l)){var m=p.marker,g=p.paragraph,h=p.path;if(i){var v="root"==r?(0,o.getClosestAncestorBlockGroupIndex)(h,["TableCell","Document"]):0;u=(0,o.mutateBlock)(h[v]);var y=h[v-1],b="FormatContainer"==(null==y?void 0:y.blockGroupType)||"General"==(null==y?void 0:y.blockGroupType)||"ListItem"==(null==y?void 0:y.blockGroupType)?y:g,S=u.blocks.indexOf(b);f=S>=0?S+1:-1}else{var C=g.segments.indexOf(m);Object.assign(t.format,m.format),C>=0&&g.segments.splice(a?C:C+1,0,t)}}if(f>=0&&u){var _=[],E=void 0;if(i){var T=u.blocks[f];_.push(t),"Paragraph"==(null==T?void 0:T.blockType)?E=(0,o.mutateBlock)(T):T&&"Entity"!=T.blockType&&!a||((E=(0,o.createParagraph)(!1,{},e.format)).segments.push((0,o.createBr)(e.format)),_.push(E))}else(E=(0,o.createParagraph)(!1,void 0,e.format)).segments.push(t),_.push(E);if((c=(0,o.mutateBlock)(u).blocks).splice.apply(c,(0,n.__spreadArray)([f,0],(0,n.__read)(_),!1)),a&&E){m=(0,o.createSelectionMarker)((null===(d=E.segments[0])||void 0===d?void 0:d.format)||e.format);var k=E.segments;i?k.unshift(m):k.push(m),(0,o.setSelection)(e,m,m)}}}},4604:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyImageBorderFormat=void 0;var n=r(4990);t.applyImageBorderFormat=function(e,t,r){if(t){var o=e.format,i=t.width,a=t.style,l=t.color,s=(0,n.extractBorderValues)(o.borderTop),c=s.color,d=s.width,u=s.style,p="";p=i?(0,n.parseValueWithUnit)(i)+"px":d||"1px",a?p=p+" "+a:u?p=p+" "+u:p+=" solid",l?p=p+" "+l:c&&(p=p+" "+c),e.format.borderLeft=p,e.format.borderTop=p,e.format.borderBottom=p,e.format.borderRight=p}else delete e.format.borderLeft,delete e.format.borderTop,delete e.format.borderBottom,delete e.format.borderRight;r&&(e.format.borderRadius=r)}},7276:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matchLink=void 0;var n=r(1635),o=r(4990),i=/^[^?]+%[^0-9a-f]+|^[^?]+%[0-9a-f][^0-9a-f]+|^[^?]+%00|^[^?]+%$|^https?:\/\/[^?\/]+@|^www\.[^?\/]+@/i,a="[a-z0-9](?:[a-z0-9-]*[a-z0-9])?",l="(?:"+a+"\\.)*"+a+"(?:\\:[0-9]+)?(?:[\\/\\?]\\S*)?",s={http:{match:new RegExp("^(?:microsoft-edge:)?http:\\/\\/"+l+"|www\\."+l,"i"),except:i,normalizeUrl:function(e){return new RegExp("^(?:microsoft-edge:)?http:\\/\\/","i").test(e)?e:"http://"+e}},https:{match:new RegExp("^(?:microsoft-edge:)?https:\\/\\/"+l,"i"),except:i},mailto:{match:new RegExp("^mailto:\\S+@\\S+\\.\\S+","i")},notes:{match:new RegExp("^notes:\\/\\/\\S+","i")},file:{match:new RegExp("^file:\\/\\/\\/?\\S+","i")},unc:{match:new RegExp("^\\\\\\\\\\S+","i")},ftp:{match:new RegExp("^ftp:\\/\\/"+l+"|ftp\\."+l,"i"),normalizeUrl:function(e){return new RegExp("^ftp:\\/\\/","i").test(e)?e:"ftp://"+e}},news:{match:new RegExp("^news:(\\/\\/)?"+l,"i")},telnet:{match:new RegExp("^telnet:(\\/\\/)?"+l,"i")},gopher:{match:new RegExp("^gopher:\\/\\/"+l,"i")},wais:{match:new RegExp("^wais:(\\/\\/)?"+l,"i")}};t.matchLink=function(e){var t,r;if(e)try{for(var i=(0,n.__values)((0,o.getObjectKeys)(s)),a=i.next();!a.done;a=i.next()){var l=a.value,c=s[l],d=e.match(c.match);if(d&&d[0]==e&&(!c.except||!c.except.test(e)))return{scheme:l,originalUrl:e,normalizedUrl:c.normalizeUrl?c.normalizeUrl(e):e}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return null}},9221:(e,t)=>{"use strict";function r(e,t){e.blocks.forEach((function(e){switch(e.blockType){case"BlockGroup":"ListItem"==e.blockGroupType?t.push(e):(n(t),r(e,t),n(t));break;case"Paragraph":n(t),e.segments.forEach((function(e){"General"==e.segmentType&&r(e,t)})),n(t);break;case"Table":n(t),e.rows.forEach((function(e){return e.cells.forEach((function(e){r(e,t)}))})),n(t)}}))}function n(e){var t=e[e.length-1];t&&null===t||e.push(null)}function o(e,t,r){var n=e[t].levels,o=e[r].levels;return n.length<=o.length&&n.every((function(e,t){return e.listType==o[t].listType}))}function i(e,t){return e.levels.slice(0,t).some((function(e){return void 0!==e.format.startNumberOverride}))}Object.defineProperty(t,"__esModule",{value:!0}),t.findListItemsInSameThread=void 0,t.findListItemsInSameThread=function(e,t){var n=[];return r(e,n),function(e,t){var r,n=[],a=e.indexOf(t),l=t.levels.length,s="OL"==(null===(r=t.levels[l-1])||void 0===r?void 0:r.listType);if(a>=0){for(var c=a;c>=0;c--){if(!(u=e[c])){if(s)continue;break}var d=i(u,l);if(o(e,a,c)){if(n.unshift(u),s&&d)break}else if(!s||d||u.levels.length<t.levels.length)break}for(c=a+1;c<e.length;c++){var u;if(!(u=e[c])){if(s)continue;break}if(d=i(u,l),o(e,a,c)&&!d)n.push(u);else if(!s||d||u.levels.length<t.levels.length)break}}return n}(n,t)}},2778:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getListAnnounceData=void 0;var n=r(9221),o=r(4990);t.getListAnnounceData=function(e){var t=(0,o.getClosestAncestorBlockGroupIndex)(e,["ListItem"],["TableCell"]);if(t>=0){var r=e[t],i=r.levels[r.levels.length-1];if(i.format.displayForDummyItem)return null;if("OL"==i.listType){var a=function(e,t){for(var r,o,i=(0,n.findListItemsInSameThread)(e[e.length-1],t),a=0,l=0;l<i.length;l++){var s=i[l];if(0==a&&s.levels.length==t.levels.length&&(a=null!==(o=null===(r=s.levels[s.levels.length-1])||void 0===r?void 0:r.format.startNumberOverride)&&void 0!==o?o:1),s==t)break;if(s.levels.length<t.levels.length)a=0;else{if(s.levels.length>t.levels.length)continue;s.levels[s.levels.length-1].format.displayForDummyItem||a++}}return a}(e,r),l=(0,o.getListMetadata)(i),s=(0,o.getAutoListStyleType)("OL",null!=l?l:{},r.levels.length-1,i.format.listStyleType);return void 0===s?null:{defaultStrings:"announceListItemNumbering",formatStrings:[(0,o.getOrderedListNumberStr)(s,a)]}}return{defaultStrings:"announceListItemBullet"}}return null}},4877:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setListType=void 0;var n=r(4990);function o(e){switch(e.blockType){case"Table":return!1;case"Paragraph":return e.segments.every((function(e){return"Br"==e.segmentType||"SelectionMarker"==e.segmentType}));default:return!0}}t.setListType=function(e,t,r){void 0===r&&(r=!1);var i=(0,n.getOperationalBlocks)(e,["ListItem"],[]),a=i.every((function(e){var r,i=e.block;return(0,n.isBlockGroupOfType)(i,"ListItem")?(null===(r=i.levels[i.levels.length-1])||void 0===r?void 0:r.listType)==t:o(i)})),l=[];return i.forEach((function(e,s){var c,d,u=e.block,p=e.parent;if((0,n.isBlockGroupOfType)(u,"ListItem")){var f=u.levels.pop();!a&&f?(f.listType=t,u.levels.push(f)):1==u.blocks.length&&(0,n.setParagraphNotImplicit)(u.blocks[0]),a&&u.blocks.forEach((function(e){u.format.marginLeft&&(e.format.marginLeft=u.format.marginLeft),u.format.marginRight&&(e.format.marginRight=u.format.marginRight),u.format.textAlign&&(e.format.textAlign=u.format.textAlign)}))}else{var m=p.blocks.indexOf(u);if(m>=0)if(1!=i.length&&o(u))l.forEach((function(e){return(0,n.mutateBlock)(e).levels[0].format.marginBottom="0px"})),l=[];else{var g=p.blocks[m-1],h="Paragraph"==u.blockType&&(null===(c=u.segments[0])||void 0===c?void 0:c.format)||{},v=(0,n.createListItem)([(0,n.createListLevel)(t,{startNumberOverride:s>0||"BlockGroup"==(null==g?void 0:g.blockType)&&"ListItem"==g.blockGroupType&&"OL"==(null===(d=g.levels[0])||void 0===d?void 0:d.listType)?void 0:1,direction:u.format.direction,textAlign:u.format.textAlign,marginBottom:r?"0px":void 0,marginTop:r?"0px":void 0})],{fontFamily:h.fontFamily,fontSize:h.fontSize,textColor:h.textColor});"Paragraph"==u.blockType&&(0,n.setParagraphNotImplicit)(u);var y=(0,n.mutateBlock)(u);v.blocks.push(y),y.format.marginRight&&(v.format.marginRight=y.format.marginRight,y.format.marginRight=void 0),y.format.marginLeft&&(v.format.marginLeft=y.format.marginLeft,y.format.marginLeft=void 0),y.format.textAlign&&(v.format.textAlign=y.format.textAlign),(0,n.mutateBlock)(p).blocks.splice(m,1,v),l.push(v);var b=v.levels.length-1;(f=(0,n.mutateBlock)(v).levels[b])&&(0,n.updateListMetadata)(f,(function(e){return Object.assign({},e,{applyListStyleFromLevel:!0})}))}}})),(0,n.normalizeContentModel)(e),i.length>0}},2439:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setModelListStartNumber=void 0;var n=r(4990);t.setModelListStartNumber=function(e,t){var r=(0,n.getFirstSelectedListItem)(e),o=r?(0,n.mutateBlock)(r).levels[(null==r?void 0:r.levels.length)-1]:null;return!!o&&(o.format.startNumberOverride=t,!0)}},7023:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setModelListStyle=void 0;var n=r(9221),o=r(4990);t.setModelListStyle=function(e,t){var r=(0,o.getFirstSelectedListItem)(e);if(r){var i=(0,n.findListItemsInSameThread)(e,r),a=r.levels.length-1;i.forEach((function(e){var r=(0,o.mutateBlock)(e).levels[a];r&&(0,o.updateListMetadata)(r,(function(e){return Object.assign({},e,t)}))}))}return!!r}},4135:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.adjustSegmentSelection=void 0;var n=r(4990);t.adjustSegmentSelection=function(e,t,r){var o,i,a=(0,n.getSelectedParagraphs)(e),l=!1;return a.forEach((function(e){var n=o?0:e.segments.findIndex((function(r){return t(r,e)})),a=e.segments;if(!o){o=a[n];for(var s=n;s>0;s--){if(!r(a[s-1],o,e)){l=l||!!a[s-1].isSelected;break}o=a[s-1],l=l||!a[s-1].isSelected}}if(o)for(s=n;s<e.segments.length;s++){if(s!=n&&!r(a[s],i||a[n],e)){l=l||!!a[s].isSelected;break}i=a[s],l=l||!a[s].isSelected}})),o&&i&&(0,n.setSelection)(e,o,i),l}},210:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.adjustTrailingSpaceSelection=void 0;var n=r(1635),o=r(4990);function i(e){return e.isSelected&&(t=e.text).trimRight()!==t&&!function(e){return 0==e.trimRight().length}(e.text);var t}function a(e,t){(0,o.mutateSegment)(e,t,(function(e,t){var r,i=e.text.trimRight(),a=e.text.substring(i.length),l=(0,o.createText)(i,e.format,e.link,e.code);l.isSelected=!0;var s=e.link?(0,n.__assign)((0,n.__assign)({},e.link),{format:(0,n.__assign)((0,n.__assign)({},null===(r=e.link)||void 0===r?void 0:r.format),{underline:!1})}):void 0,c=(0,o.createText)(a,void 0,s,e.code);c.isSelected=!0;var d=t.segments.indexOf(e);t.segments.splice(d,1,l,c)}))}t.adjustTrailingSpaceSelection=function(e){(0,o.iterateSelections)(e,(function(e,t,r,n){if("Paragraph"===(null==r?void 0:r.blockType)&&n&&n.length>0)if(1===n.length&&"Text"===n[0].segmentType&&i(n[0]))a(r,n[0]);else{var o="SelectionMarker"===n[n.length-1].segmentType?n[n.length-2]:n[n.length-1];o&&"Text"===o.segmentType&&i(o)&&a(r,o)}return!1}))}},1486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.adjustWordSelection=void 0;var n=r(1635),o=r(4990);function i(e,t){var r=e.text,n=-1;if(t)for(var i=0;i<r.length;i++){var a=r[i];if((0,o.isPunctuation)(a)||(0,o.isSpace)(a)){n=i;break}}else for(i=r.length-1;i>=0;i--)if(a=r[i],(0,o.isPunctuation)(a)||(0,o.isSpace)(a)){n=i+1;break}return n}function a(e,t,r,n){var i=t.text,a=(0,o.createText)(i.substring(0,n),t.format,t.link,t.code),l=(0,o.createText)(i.substring(n,i.length),t.format,t.link,t.code);e.splice(r,1,a,l)}t.adjustWordSelection=function(e,t){var r;(0,o.iterateSelections)(e,(function(e,n,i,a){return"Paragraph"==(null==i?void 0:i.blockType)&&1==(null==a?void 0:a.length)&&a[0]==t&&(r=(0,o.mutateBlock)(i)),!0}));var l=r?(0,n.__spreadArray)([],(0,n.__read)(r.segments),!1):void 0;if(l&&r){for(var s=[],c=l.indexOf(t),d=c-1;d>=0&&"Text"==(u=l[d]).segmentType;d--){if((p=i(u,!1))>-1){if(p==u.text.length)break;a(l,u,d,p),s.push(l[d+1]);break}s.push(l[d])}if(c=l.indexOf(t),s.push(t),s.length<=1)return s;for(d=c+1;d<l.length;d++){var u,p;if("Text"!=(u=l[d]).segmentType)break;if((p=i(u,!0))>-1){if(0==p)break;a(l,u,d,p),s.push(l[d]);break}s.push(l[d])}return s[s.length-1]==t?[t]:(r.segments=l,s)}return[t]}},5496:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.collapseTableSelection=void 0;var n=r(4990);t.collapseTableSelection=function(e,t){var r,o=t.firstColumn,i=null===(r=e[t.firstRow])||void 0===r?void 0:r.cells[o];i&&(0,n.addSegment)((0,n.mutateBlock)(i),(0,n.createSelectionMarker)())}},3824:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.alignTable=void 0,t.alignTable=function(e,t){e.format.marginLeft="alignLeft"==t?"":"auto",e.format.marginRight="alignRight"==t?"":"auto"}},2920:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.alignTableCellVertically=t.alignTableCellHorizontally=void 0;var n=r(4990),o={alignCellLeft:"start",alignCellCenter:"center",alignCellRight:"end"},i={alignCellTop:"top",alignCellMiddle:"middle",alignCellBottom:"bottom"};function a(e,t){var r,o=(0,n.getSelectedCells)(e);if(o)for(var i=o.firstRow;i<=o.lastRow;i++)for(var a=o.firstColumn;a<=o.lastColumn;a++){var l=null===(r=e.rows[i])||void 0===r?void 0:r.cells[a];(null==l?void 0:l.format)&&(t((0,n.mutateBlock)(l)),l.blocks.forEach((function(e){"Paragraph"===e.blockType&&e.format.textAlign&&delete(0,n.mutateBlock)(e).format.textAlign})))}}t.alignTableCellHorizontally=function(e,t){a(e,(function(e){e.format.textAlign=o[t]}))},t.alignTableCellVertically=function(e,t){a(e,(function(e){e.format.verticalAlign=i[t],(0,n.updateTableCellMetadata)(e,(function(e){return(e=e||{}).vAlignOverride=!0,e}))}))}},9044:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canMergeCells=void 0,t.canMergeCells=function(e,t,r,n,o){var i=r==o||e[t].cells.every((function(e,t){return t<r||t>o||!e.spanAbove})),a=t==n||e.every((function(e,o){return o<t||o>n||!e.cells[r].spanLeft})),l=e[n].cells.map((function(t,i){return i>=r&&i<=o?function(e,t,r){for(var n,o,i=0,a=t+1;a<e.length&&(null===(o=null===(n=e[a])||void 0===n?void 0:n.cells[r])||void 0===o?void 0:o.spanAbove);a++)i++;return i}(e,n,i):-1})).every((function(e,t,n){return e<0||e==n[r]})),s=e.map((function(r,i){return i>=t&&i<=n?function(e,t,r){for(var n,o,i,a=0,l=r+1;l<(null===(n=e[t])||void 0===n?void 0:n.cells.length)&&(null===(i=null===(o=e[t])||void 0===o?void 0:o.cells[l])||void 0===i?void 0:i.spanLeft);l++)a++;return a}(e,i,o):-1})).every((function(e,r,n){return e<0||e==n[t]}));return i&&a&&l&&s}},878:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearSelectedCells=void 0;var n=r(4990);t.clearSelectedCells=function(e,t){if(t.firstColumn>=0&&t.firstRow>=0&&t.lastColumn<e.widths.length&&t.lastRow<e.rows.length)for(var r=t.firstRow;r<=t.lastRow;r++)for(var o=e.rows[r],i=t.firstColumn;i<=t.lastColumn;i++){var a=o.cells[i];a.isSelected&&((0,n.mutateBlock)(a).isSelected=!1),(0,n.setSelection)(a)}}},9414:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTableStructure=void 0;var n=r(4990);t.createTableStructure=function(e,t,r){var o=(0,n.createTable)(r);return(0,n.addBlock)(e,o),o.rows.forEach((function(e){for(var r=0;r<t;r++){var o=(0,n.createTableCell)();e.cells.push(o)}})),o}},9842:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteTable=void 0,t.deleteTable=function(e){e.rows=[]}},4776:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteTableColumn=void 0;var n=r(5496),o=r(4990);t.deleteTableColumn=function(e){var t=(0,o.getSelectedCells)(e);if(t){for(var r=0;r<e.rows.length;r++){var i=e.rows[r].cells[t.lastColumn+1];i&&((0,o.mutateBlock)(i).spanLeft=i.spanLeft&&e.rows[r].cells[t.firstColumn].spanLeft),e.rows[r].cells.splice(t.firstColumn,t.lastColumn-t.firstColumn+1)}e.widths.splice(t.firstColumn,t.lastColumn-t.firstColumn+1),(0,n.collapseTableSelection)(e.rows,t)}}},9256:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteTableRow=void 0;var n=r(5496),o=r(4990);t.deleteTableRow=function(e){var t=(0,o.getSelectedCells)(e);t&&(e.rows[t.firstRow].cells.forEach((function(r,n){var i,a=null===(i=e.rows[t.lastRow+1])||void 0===i?void 0:i.cells[n];a&&((0,o.mutateBlock)(a).spanAbove=a.spanAbove&&r.spanAbove)})),e.rows.splice(t.firstRow,t.lastRow-t.firstRow+1),(0,n.collapseTableSelection)(e.rows,t))}},1190:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ensureFocusableParagraphForTable=void 0;var n=r(4990);function o(e){var t=(0,n.createParagraph)(!1,void 0,e.format),r=(0,n.createBr)(e.format);return t.segments.push(r),t}t.ensureFocusableParagraphForTable=function(e,t,r){var i,a,l,s=null===(i=r.rows.filter((function(e){return e.cells.length>0}))[0])||void 0===i?void 0:i.cells[0];if(s)(l=s.blocks.filter((function(e){return"Paragraph"==e.blockType}))[0])||(l=o(e),(0,n.mutateBlock)(s).blocks.push(l));else{var c,d=r;for(l=o(e);c=t.shift();){var u=null!==(a=c.blocks.indexOf(d))&&void 0!==a?a:-1;if(c&&u>=0&&(0,n.mutateBlock)(c).blocks.splice(u,1,l),"FormatContainer"!=c.blockGroupType||1!=c.blocks.length||c.blocks[0]!=l)break;d=c}}return l}},6682:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertTableColumn=void 0;var n=r(878),o=r(4990);t.insertTableColumn=function(e,t){var r=(0,o.getSelectedCells)(e),i="insertLeft"==t;if(r){(0,n.clearSelectedCells)(e,r);for(var a=null==r?void 0:r.firstColumn;a<=r.lastColumn;a++)e.rows.forEach((function(e){var t=e.cells[i?r.firstColumn:r.lastColumn],n=(0,o.createTableCell)(t.spanLeft,t.spanAbove,t.isHeader,t.format,t.dataset);n.isSelected=!0,e.cells.splice(i?r.firstColumn:r.lastColumn+1,0,n)})),e.widths.splice(i?r.firstColumn:r.lastColumn+1,0,e.widths[i?r.firstColumn:r.lastColumn])}}},1470:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertTableRow=void 0;var n=r(1635),o=r(878),i=r(4990);t.insertTableRow=function(e,t){var r=(0,i.getSelectedCells)(e),a="insertAbove"==t;if(r){(0,o.clearSelectedCells)(e,r);for(var l=r.firstRow;l<=r.lastRow;l++){var s=e.rows[a?r.firstRow:r.lastRow];e.rows.splice(a?r.firstRow:r.lastRow+1,0,{format:(0,n.__assign)({},s.format),cells:s.cells.map((function(e){var t=(0,i.createTableCell)(e.spanLeft,e.spanAbove,e.isHeader,e.format,e.dataset);return t.isSelected=!0,t})),height:s.height})}}}},7378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeTableCells=void 0;var n=r(9044),o=r(4990);t.mergeTableCells=function(e){var t=(0,o.getSelectedCells)(e);if(t&&(0,n.canMergeCells)(e.rows,t.firstRow,t.firstColumn,t.lastRow,t.lastColumn))for(var r=t.firstRow;r<=t.lastRow;r++)for(var i=t.firstColumn;i<=t.lastColumn;i++){var a=e.rows[r].cells[i];if(a){var l=(0,o.mutateBlock)(a);l.spanLeft=i>t.firstColumn,l.spanAbove=r>t.firstRow}}}},6553:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeTableColumn=void 0;var n=r(9044),o=r(4990);t.mergeTableColumn=function(e,t){var r,i,a,l,s=(0,o.getSelectedCells)(e);if(s){var c="mergeLeft"==t?s.firstColumn:s.lastColumn+1;if(c>0&&c<e.rows[0].cells.length)for(var d=s.firstRow;d<=s.lastRow;d++){var u=null===(r=e.rows[d])||void 0===r?void 0:r.cells[c];if(u&&(0,n.canMergeCells)(e.rows,d,c-1,d,c)){(0,o.mutateBlock)(u).spanLeft=!0;for(var p=c;null===(a=null===(i=e.rows[d])||void 0===i?void 0:i.cells[p])||void 0===a?void 0:a.spanLeft;)(0,o.mutateBlock)(e.rows[d].cells[p]),p--;var f=null===(l=e.rows[d])||void 0===l?void 0:l.cells[p];f&&((0,o.mutateBlock)(f).isSelected=!0)}}}}},863:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeTableRow=void 0;var n=r(9044),o=r(4990);t.mergeTableRow=function(e,t){var r,i,a,l=(0,o.getSelectedCells)(e);if(l){var s="mergeAbove"==t?l.firstRow:l.lastRow+1;if(s>0&&s<e.rows.length)for(var c=l.firstColumn;c<=l.lastColumn;c++){var d=e.rows[s].cells[c];if(d&&(0,n.canMergeCells)(e.rows,s-1,c,s,c)){(0,o.mutateBlock)(d).spanAbove=!0;for(var u=s;null===(i=null===(r=e.rows[u])||void 0===r?void 0:r.cells[c])||void 0===i?void 0:i.spanAbove;)(0,o.mutateBlock)(e.rows[u].cells[c]),u--;var p=null===(a=e.rows[u])||void 0===a?void 0:a.cells[c];p&&((0,o.mutateBlock)(p).isSelected=!0)}}}}},36:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitTableCellHorizontally=void 0;var n=r(1635),o=r(4990);t.splitTableCellHorizontally=function(e){var t=(0,o.getSelectedCells)(e);if(t)for(var r=function(r){if(e.rows.every((function(e,n){var o;return n<t.firstRow||n>t.lastRow||(null===(o=e.cells[r+1])||void 0===o?void 0:o.spanLeft)})))e.rows.forEach((function(e,n){(0,o.mutateBlock)(e.cells[r]),n>=t.firstRow&&n<=t.lastRow&&((0,o.mutateBlock)(e.cells[r+1]).spanLeft=!1)}));else{e.rows.forEach((function(e,i){var a=e.cells[r];if(a){var l=(0,o.createTableCell)(a.spanLeft,a.spanAbove,a.isHeader,a.format);l.dataset=(0,n.__assign)({},a.dataset),i<t.firstRow||i>t.lastRow?l.spanLeft=!0:l.isSelected=a.isSelected,e.cells.splice(r+1,0,l),(0,o.mutateBlock)(e.cells[r])}}));var i=Math.max(e.widths[r]/2,30);e.widths.splice(r,1,i,i)}},i=t.lastColumn;i>=t.firstColumn;i--)r(i)}},7062:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitTableCellVertically=void 0;var n=r(1635),o=r(4990);t.splitTableCellVertically=function(e){var t=(0,o.getSelectedCells)(e);if(t)for(var r=t.lastRow;r>=t.firstRow;r--){var i=e.rows[r],a=e.rows[r+1];if(i.cells.forEach(o.mutateBlock),null==a?void 0:a.cells.every((function(e,r){return r<t.firstColumn||r>t.lastColumn||e.spanAbove})))a.cells.forEach((function(e,r){r>=t.firstColumn&&r<=t.lastColumn&&((0,o.mutateBlock)(e).spanAbove=!1)}));else{var l=Math.max(i.height/=2,22),s={format:(0,n.__assign)({},i.format),height:l,cells:i.cells.map((function(e,r){var i=(0,o.createTableCell)(e.spanLeft,e.spanAbove,e.isHeader,e.format);return i.dataset=(0,n.__assign)({},e.dataset),r<t.firstColumn||r>t.lastColumn?i.spanAbove=!0:i.isSelected=e.isSelected,i}))};i.height=l,e.rows.splice(r+1,0,s)}}}},7391:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setAlignment=void 0;var n=r(4544);t.setAlignment=function(e,t){e.focus(),e.formatContentModel((function(e){return(0,n.setModelAlignment)(e,t)}),{apiName:"setAlignment"})}},635:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setDirection=void 0;var n=r(7484);t.setDirection=function(e,t){e.focus(),e.formatContentModel((function(e){return(0,n.setModelDirection)(e,t)}),{apiName:"setDirection"})}},9036:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setHeadingLevel=void 0;var n=r(8213),o={h1:"2em",h2:"1.5em",h3:"1.17em",h4:"1em",h5:"0.83em",h6:"0.67em"};t.setHeadingLevel=function(e,t){e.focus(),(0,n.formatParagraphWithContentModel)(e,"setHeadingLevel",(function(e){var r,n,i,a=t>0?"h"+t:(n=(null==(r=e.decorator)?void 0:r.tagName)||"",(i=parseInt(n.substring(1)))>=1&&i<=6?n:null);t>0?(e.decorator={tagName:a,format:a?{fontWeight:"bold",fontSize:o[a]}:{}},e.segments.forEach((function(e){delete e.format.fontSize,delete e.format.fontWeight}))):a&&delete e.decorator}))}},5875:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setIndentation=void 0;var n=r(4990),o=r(9786);t.setIndentation=function(e,t,r){e.focus(),e.formatContentModel((function(e,i){var a=(0,o.setModelIndentation)(e,t,r);return a&&(0,n.normalizeContentModel)(e),i.newPendingFormat="preserve",a}),{apiName:"setIndentation"})}},2934:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setParagraphMargin=void 0;var n=r(4990),o=r(8213);t.setParagraphMargin=function(e,t,r){e.focus(),(0,o.formatParagraphWithContentModel)(e,"setParagraphMargin",(function(e){e.decorator||(e.decorator=(0,n.createParagraphDecorator)("p")),t?e.format.marginTop=t:null===t&&delete e.format.marginTop,r?e.format.marginBottom=r:null===r&&delete e.format.marginBottom}))}},1807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setSpacing=void 0;var n=r(8213);t.setSpacing=function(e,t){e.focus(),(0,n.formatParagraphWithContentModel)(e,"setSpacing",(function(e){e.format.lineHeight=t.toString(),e.segments.forEach((function(e){e.format.lineHeight&&delete e.format.lineHeight}))}))}},5793:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleBlockQuote=void 0;var n=r(1635),o=r(6428),i={borderLeft:"3px solid rgb(200, 200, 200)",textColor:"rgb(102, 102, 102)"},a={borderRight:"3px solid rgb(200, 200, 200)",textColor:"rgb(102, 102, 102)"},l={marginTop:"1em",marginBottom:"1em",marginLeft:"40px",marginRight:"40px"};t.toggleBlockQuote=function(e,t,r){var s,c=(0,n.__assign)((0,n.__assign)((0,n.__assign)({},l),{paddingLeft:"10px"}),null!=t?t:i),d=(0,n.__assign)((0,n.__assign)((0,n.__assign)({},l),{paddingRight:"10px",direction:"rtl"}),null!==(s=null!=r?r:t)&&void 0!==s?s:a);e.focus(),e.formatContentModel((function(e,t){return t.newPendingFormat="preserve",(0,o.toggleModelBlockQuote)(e,c,d)}),{apiName:"toggleBlockQuote"})}},5052:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertEntity=void 0;var n=r(8210),o=r(2837),i=r(4990);t.insertEntity=function(e,t,r,a,l){var s=l||{},c=s.contentNode,d=s.focusAfterEntity,u=s.wrapperDisplay,p=s.skipUndoSnapshot,f=s.initialEntityState,m=e.getDocument().createElement(r?"div":"span"),g=null!=u?u:r?void 0:"inline-block";m.style.setProperty("display",g||null),null==g&&r&&(m.style.setProperty("width","100%"),m.style.setProperty("display","inline-block")),c&&m.appendChild(c);var h=(0,i.createEntity)(m,!0,void 0,t);p||e.takeSnapshot();var v={changeSource:i.ChangeSource.InsertEntity,getChangeData:function(){return{wrapper:m,type:t,id:"",isReadonly:!0}},apiName:"insertEntity"},y=function(e,t,n){return(0,o.insertEntityModel)(e,h,"string"==typeof a?a:"focus",r,d,t,n),(0,i.normalizeContentModel)(e),t.skipUndoSnapshot=!0,t.newEntities.push(h),!0};if("object"==typeof a?(0,n.formatInsertPointWithContentModel)(e,a,y,v):e.formatContentModel(y,v),!p){var b=void 0;if(f){var S=(0,i.parseEntityFormat)(m),C=S.id,_=S.entityType;b=C&&_?{id:C,type:_,state:f}:void 0}e.takeSnapshot(b)}return h}},5810:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearFormat=void 0;var n=r(291),o=r(4990);t.clearFormat=function(e){e.focus(),e.formatContentModel((function(e){var t=[],r=[],i=[];return(0,n.clearModelFormat)(e,t,r,i),(0,o.normalizeContentModel)(e),t.length>0||r.length>0||i.length>0}),{apiName:"clearFormat"})}},2522:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFormatState=void 0;var n=r(8839),o=r(4990);t.getFormatState=function(e){var t=e.getPendingFormat(),r=e.getSnapshotsManager(),i={canUndo:r.hasNewContent||r.canMove(-1),canRedo:r.canMove(1),isDarkMode:e.isDarkMode()};return e.formatContentModel((function(e){return(0,o.retrieveModelFormatState)(e,t,i),!1}),void 0,{processorOverride:{child:n.reducedModelChildProcessor},tryGetFromCache:!0}),i}},9828:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.adjustImageSelection=void 0;var n=r(4135),o=r(4990);t.adjustImageSelection=function(e){var t=null;return e.formatContentModel((function(e){return(0,n.adjustSegmentSelection)(e,(function(e,r){return!(!e.isSelected||"Image"!=e.segmentType||((0,o.mutateSegment)(r,e,(function(e){t=e})),0))}),(function(e,t){return e==t}))}),{apiName:"adjustImageSelection"}),t}},1185:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.changeImage=void 0;var n=r(2270),o=r(4990);t.changeImage=function(e,t){e.focus();var r=e.getDOMSelection();(0,o.readFile)(t,(function(t){t&&!e.isDisposed()&&"image"===(null==r?void 0:r.type)&&(0,n.formatImageWithContentModel)(e,"changeImage",(function(n){var i,a,l=null!==(a=null===(i=(0,o.getImageMetadata)(n))||void 0===i?void 0:i.src)&&void 0!==a?a:"",s=n.src;n.src=t,n.dataset={},n.format.width="",n.format.height="",n.alt="",e.triggerEvent("editImage",{image:r.image,previousSrc:s,newSrc:t,originalSrc:l})}))}))}},18:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertImage=void 0;var n=r(4990);function o(e,t){e.formatContentModel((function(e,r){var o=(0,n.createImage)(t,{backgroundColor:""}),i=(0,n.createContentModelDocument)();return(0,n.addSegment)(i,o),(0,n.mergeModel)(e,i,r,{mergeFormat:"mergeAll"}),o.isSelected=!0,(0,n.setSelection)(e,o),!0}),{apiName:"insertImage"})}t.insertImage=function(e,t){e.focus(),"string"==typeof t?o(e,t):(0,n.readFile)(t,(function(t){t&&!e.isDisposed()&&o(e,t)}))}},1699:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setImageAltText=void 0;var n=r(2270);t.setImageAltText=function(e,t){e.focus(),(0,n.formatImageWithContentModel)(e,"setImageAltText",(function(e){e.alt=t}))}},5313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setImageBorder=void 0;var n=r(4604),o=r(2270);t.setImageBorder=function(e,t,r){e.focus(),(0,o.formatImageWithContentModel)(e,"setImageBorder",(function(e){(0,n.applyImageBorderFormat)(e,t,r)}))}},6694:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setImageBoxShadow=void 0;var n=r(2270);t.setImageBoxShadow=function(e,t,r){e.focus(),(0,n.formatImageWithContentModel)(e,"setImageBoxShadow",(function(e){e.format.boxShadow=t,r?(e.format.marginBottom=r,e.format.marginLeft=r,e.format.marginRight=r,e.format.marginTop=r):null===r&&(delete e.format.marginBottom,delete e.format.marginLeft,delete e.format.marginRight,delete e.format.marginTop)}))}},8652:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.adjustLinkSelection=void 0;var n=r(4135),o=r(1486),i=r(4990);t.adjustLinkSelection=function(e){var t="",r=null;return e.formatContentModel((function(e){var a,l,s=(0,n.adjustSegmentSelection)(e,(function(e){return!!e.isSelected&&!!e.link}),(function(e,t){return!!e.link&&e.link.format.href==t.link.format.href})),c=(0,i.getSelectedSegments)(e,!1,!0),d=c[0];return 1==c.length&&"SelectionMarker"==d.segmentType&&(c=(0,o.adjustWordSelection)(e,d)).length>1&&(s=!0,(0,i.setSelection)(e,c[0],c[c.length-1])),t=c.map((function(e){return"Text"==e.segmentType?e.text:""})).join(""),r=(null===(l=null===(a=c[0])||void 0===a?void 0:a.link)||void 0===l?void 0:l.format.href)||null,s}),{apiName:"adjustLinkSelection"}),[t,r]}},5318:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertLink=void 0;var n=r(1635),o=r(210),i=r(7276),a=r(4990),l=/^[a-zA-Z]+:/i,s=/^[\w.%+-]+@/i,c=/^ftp\./i;t.insertLink=function(e,t,r,u,p){e.focus();var f=(function(e){return e.match(/s\n*c\n*r\n*i\n*p\n*t\n*:/i)?"":e}(t)||"").trim();if(f){var m,g=(0,i.matchLink)(f),h=g?g.normalizedUrl:function(e){if(!e)return e;var t="";return e.search(l)<0&&(t=0==e.search(s)?"mailto:":0==e.search(c)?"ftp://":"http://"),t+e}(f),v=[];e.formatContentModel((function(t,i){var l,s=(0,a.getSelectedSegments)(t,!1,!0),c=s.map((function(e){return"Text"==e.segmentType?e.text:""})).join(""),m=u||c||"";if(s.some((function(e){return"SelectionMarker"!=e.segmentType}))&&c==m)s.forEach((function(e){var t=d(h,r,p,"Text"==e.segmentType);(0,a.addLink)(e,t),e.link&&v.push(e.link)}));else if(s.every((function(e){return"SelectionMarker"==e.segmentType}))||m&&m!=c){var y=(0,a.createText)(m||(g?g.originalUrl:f),(0,n.__assign)((0,n.__assign)({},null===(l=s[0])||void 0===l?void 0:l.format),e.getPendingFormat())),b=(0,a.createContentModelDocument)(),S=d(h,r,p);(0,a.addLink)(y,S),(0,a.addSegment)(b,y),y.link&&v.push(y.link),(0,a.mergeModel)(t,b,i,{mergeFormat:"mergeAll"})}return(0,o.adjustTrailingSpaceSelection)(t),s.length>0}),{changeSource:a.ChangeSource.CreateLink,onNodeCreated:function(e,t){!m&&v.indexOf(e)>=0&&(m=t)},getChangeData:function(){return m},apiName:"insertLink"})}};var d=function(e,t,r,n){return void 0===n&&(n=!0),{dataset:{},format:{href:e,anchorTitle:t,target:r,underline:n}}}},9463:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeLink=void 0;var n=r(4135),o=r(4990);t.removeLink=function(e){e.focus(),e.formatContentModel((function(e){(0,n.adjustSegmentSelection)(e,(function(e){return!!e.isSelected&&!!e.link}),(function(e,t){return e.isSelected||!!e.link&&e.link.format.href==t.link.format.href}));var t=(0,o.getSelectedSegments)(e,!1,!0),r=!1;return t.forEach((function(e){e.link&&(r=!0,delete e.link)})),r}),{apiName:"removeLink"})}},2042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setListStartNumber=void 0;var n=r(2439);t.setListStartNumber=function(e,t){e.focus(),e.formatContentModel((function(e){return(0,n.setModelListStartNumber)(e,t)}),{apiName:"setListStartNumber"})}},5170:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setListStyle=void 0;var n=r(7023);t.setListStyle=function(e,t){e.focus(),e.formatContentModel((function(e){return(0,n.setModelListStyle)(e,t)}),{apiName:"setListStyle"})}},2903:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleBullet=void 0;var n=r(4877);t.toggleBullet=function(e,t){void 0===t&&(t=!1),e.focus(),e.formatContentModel((function(e,r){return r.newPendingFormat="preserve",(0,n.setListType)(e,"UL",t)}),{apiName:"toggleBullet"})}},275:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleNumbering=void 0;var n=r(4877);t.toggleNumbering=function(e,t){void 0===t&&(t=!1),e.focus(),e.formatContentModel((function(e,r){return r.newPendingFormat="preserve",(0,n.setListType)(e,"OL",t)}),{apiName:"toggleNumbering"})}},5028:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applySegmentFormat=void 0;var n=r(8578);t.applySegmentFormat=function(e,t){(0,n.formatSegmentWithContentModel)(e,"applySegmentFormat",(function(e){e.backgroundColor=t.backgroundColor,e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontWeight=t.fontWeight,e.italic=t.italic,e.strikethrough=t.strikethrough,e.superOrSubScriptSequence=t.superOrSubScriptSequence,e.textColor=t.textColor,e.underline=t.underline}),void 0,!0)}},786:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.changeCapitalization=void 0;var n=r(8578);t.changeCapitalization=function(e,t,r){e.focus(),(0,n.formatSegmentWithContentModel)(e,"changeCapitalization",(function(e,n,o){if("Text"==(null==o?void 0:o.segmentType))switch(t){case"lowerCase":o.text=o.text.toLocaleLowerCase(r);break;case"upperCase":o.text=o.text.toLocaleUpperCase(r);break;case"capitalize":for(var i=o.text.toLocaleLowerCase(r).split(" "),a=0;a<i.length;a++)i[a]=i[a].charAt(0).toLocaleUpperCase(r)+i[a].slice(1);o.text=i.join(" ");break;case"sentence":var l=new RegExp("^\\s*\\w|[\\.\\!\\?]\\s+\\w","g");o.text=o.text.toLocaleLowerCase(r).replace(l,(function(e){return e.toLocaleUpperCase(r)}))}}))}},9150:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.changeFontSize=void 0;var n=r(8578),o=r(4990),i=r(1444),a=[8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72];t.changeFontSize=function(e,t){e.focus(),(0,n.formatSegmentWithContentModel)(e,"changeFontSize",(function(e,r,n,l){return function(e,t,r){if(t.fontSize){var n=(0,o.parseValueWithUnit)(t.fontSize,void 0,"pt");if(n>0){var l=function(e,t,r){e=1==t?Math.floor(e):Math.ceil(e);var n=r[r.length-1];if(e<=r[0])e=Math.max(e+t,1);else if(e>n||e==n&&1==t)e/=10,e=1==t?Math.floor(e):Math.ceil(e),e=Math.min(Math.max(10*(e+t),n),1e3);else if(1==t){for(var o=0;o<r.length;o++)if(e<r[o]){e=r[o];break}}else for(o=r.length-1;o>=0;o--)if(e>r[o]){e=r[o];break}return e}(n,"increase"==e?1:-1,a);(0,i.setFontSizeInternal)(l+"pt",t,r)}}}(t,e,l)}),void 0,!0)}},8573:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setBackgroundColor=void 0;var n=r(4990),o=r(8578);t.setBackgroundColor=function(e,t){e.focus();var r=null,i=-1;(0,o.formatSegmentWithContentModel)(e,"setBackgroundColor",(function(e,n,o,a){null===t?delete e.backgroundColor:e.backgroundColor=t,o&&a&&"SelectionMarker"!=o.segmentType&&(i=(r=a).segments.indexOf(o))}),void 0,void 0,(function(e){var t;if(r&&i>=0){var o=(0,n.createSelectionMarker)(null===(t=r.segments[i])||void 0===t?void 0:t.format);r.segments.splice(i+1,0,o),(0,n.setSelection)(e,o,o)}}))}},2886:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setFontName=void 0;var n=r(8578);t.setFontName=function(e,t){e.focus(),(0,n.formatSegmentWithContentModel)(e,"setFontName",(function(e,r,n){e.fontFamily=t,(null==n?void 0:n.code)&&(n.code.format.fontFamily=t)}),void 0,!0)}},1444:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setFontSizeInternal=t.setFontSize=void 0;var n=r(8578);function o(e,t,r){var n;if(t.fontSize=e,null===(n=null==r?void 0:r.segmentFormat)||void 0===n?void 0:n.fontSize){var o=r.segmentFormat.fontSize;r.segments.forEach((function(e){e.format.fontSize||(e.format.fontSize=o)})),delete r.segmentFormat.fontSize}}t.setFontSize=function(e,t){e.focus(),(0,n.formatSegmentWithContentModel)(e,"setFontSize",(function(e,r,n,i){return o(t,e,i)}),void 0,!0)},t.setFontSizeInternal=o},2452:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setTextColor=void 0;var n=r(8578);t.setTextColor=function(e,t){e.focus(),(0,n.formatSegmentWithContentModel)(e,"setTextColor",null===t?function(e,t,r){delete e.textColor,(null==r?void 0:r.link)&&delete r.link.format.textColor}:function(e,r,n){e.textColor=t,(null==n?void 0:n.link)&&(n.link.format.textColor=t)},void 0,!0)}},3066:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitTextSegment=void 0;var n=r(1635),o=r(4990);t.splitTextSegment=function(e,t,r,i){var a,l=e.text,s=t.segments.indexOf(e),c=(0,o.createText)(l.substring(r,i),e.format,e.link,e.code),d=[c];return r>0&&d.unshift((0,o.createText)(l.substring(0,r),e.format,e.link,e.code)),i<l.length&&d.push((0,o.createText)(l.substring(i),e.format,e.link,e.code)),d.forEach((function(t){return t.isSelected=e.isSelected})),(a=t.segments).splice.apply(a,(0,n.__spreadArray)([s,1],(0,n.__read)(d),!1)),c}},6985:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleBold=void 0;var n=r(8578),o=r(4990);t.toggleBold=function(e){e.focus(),(0,n.formatSegmentWithContentModel)(e,"toggleBold",(function(e,t){e.fontWeight=t?"bold":"normal"}),(function(e,t,r){var n;return(0,o.isBold)(void 0===e.fontWeight?null===(n=null==r?void 0:r.decorator)||void 0===n?void 0:n.format.fontWeight:e.fontWeight)}))}},9719:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleCode=void 0;var n=r(4990),o=r(8578),i={format:{fontFamily:"monospace"}};t.toggleCode=function(e){e.focus(),(0,o.formatSegmentWithContentModel)(e,"toggleCode",(function(e,t,r){r&&(t?(0,n.addCode)(r,i):delete r.code)}),(function(e,t){return!!(null==t?void 0:t.code)}))}},6634:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleItalic=void 0;var n=r(8578);t.toggleItalic=function(e){e.focus(),(0,n.formatSegmentWithContentModel)(e,"toggleItalic",(function(e,t){e.italic=!!t}),(function(e){return!!e.italic}))}},8227:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleStrikethrough=void 0;var n=r(8578);t.toggleStrikethrough=function(e){e.focus(),(0,n.formatSegmentWithContentModel)(e,"toggleStrikethrough",(function(e,t){e.strikethrough=!!t}),(function(e){return!!e.strikethrough}))}},8741:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleSubscript=void 0;var n=r(8578);t.toggleSubscript=function(e){e.focus(),(0,n.formatSegmentWithContentModel)(e,"toggleSubscript",(function(e,t){e.superOrSubScriptSequence=t?"sub":""}),(function(e){var t;return"sub"==(null===(t=e.superOrSubScriptSequence)||void 0===t?void 0:t.split(" ").pop())}))}},3312:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleSuperscript=void 0;var n=r(8578);t.toggleSuperscript=function(e){e.focus(),(0,n.formatSegmentWithContentModel)(e,"toggleSuperscript",(function(e,t){e.superOrSubScriptSequence=t?"super":""}),(function(e){var t;return"super"==(null===(t=e.superOrSubScriptSequence)||void 0===t?void 0:t.split(" ").pop())}))}},1384:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleUnderline=void 0;var n=r(210),o=r(8578);t.toggleUnderline=function(e){e.focus(),(0,o.formatSegmentWithContentModel)(e,"toggleUnderline",(function(e,t,r){e.underline=!!t,(null==r?void 0:r.link)&&(r.link.format.underline=!!t)}),(function(e,t){var r,n;return!!e.underline||!!(null===(n=null===(r=null==t?void 0:t.link)||void 0===r?void 0:r.format)||void 0===n?void 0:n.underline)}),!1,n.adjustTrailingSpaceSelection)}},9276:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyTableBorderFormat=void 0;var n=r(1635),o=r(4990);function i(e,t,r){var n=(0,o.mutateBlock)(e);r.forEach((function(e){n.format[e]=t})),(0,o.updateTableCellMetadata)(n,(function(e){return(e=e||{}).borderOverride=!0,e}))}t.applyTableBorderFormat=function(e,t,r){e.formatContentModel((function(e){var a=(0,n.__read)((0,o.getFirstSelectedTable)(e),1)[0];if(a){var l=(0,o.getSelectedCells)(a),s={Top:!1,Bottom:!1,Left:!1,Right:!1},c="",d=a.format,u=t.width,p=t.style,f=t.color,m=(0,o.extractBorderValues)(d.borderTop),g=m.color,h=m.width,v=m.style;c=u?(0,o.parseValueWithUnit)(u)+"px":h||"1px",p?c=c+" "+p:v?c=c+" "+v:c+=" solid",f?c=c+" "+f:g&&(c=c+" "+g);var y="rtl"==a.format.direction;if(l){for(var b=[r];b.length;)switch(b.pop()){case"noBorders":c="",b.push("allBorders");break;case"allBorders":for(var S=["borderTop","borderBottom","borderLeft","borderRight"],C=l.firstRow;C<=l.lastRow;C++)for(var _=l.firstColumn;_<=l.lastColumn;_++)i(a.rows[C].cells[_],c,S);s.Top=!0,s.Bottom=!0,s.Left=!0,s.Right=!0;break;case"leftBorders":var E=["borderLeft"];for(C=l.firstRow;C<=l.lastRow;C++)i(a.rows[C].cells[y?l.lastColumn:l.firstColumn],c,E);y?s.Right=!0:s.Left=!0;break;case"rightBorders":var T=["borderRight"];for(C=l.firstRow;C<=l.lastRow;C++)i(a.rows[C].cells[y?l.firstColumn:l.lastColumn],c,T);y?s.Left=!0:s.Right=!0;break;case"topBorders":var k=["borderTop"];for(_=l.firstColumn;_<=l.lastColumn;_++)i(a.rows[l.firstRow].cells[_],c,k);s.Top=!0;break;case"bottomBorders":var M=["borderBottom"];for(_=l.firstColumn;_<=l.lastColumn;_++)i(a.rows[l.lastRow].cells[_],c,M);s.Bottom=!0;break;case"insideBorders":var O=l.lastColumn==l.firstColumn,P=l.lastRow==l.firstRow;if(O&&P)break;if(O){for(i(a.rows[l.firstRow].cells[l.firstColumn],c,["borderBottom"]),C=l.firstRow+1;C<=l.lastRow-1;C++)i(a.rows[C].cells[l.firstColumn],c,["borderTop","borderBottom"]);i(a.rows[l.lastRow].cells[l.firstColumn],c,["borderTop"]);break}if(P){for(i(a.rows[l.firstRow].cells[y?l.lastColumn:l.firstColumn],c,["borderRight"]),_=l.firstColumn+1;_<=l.lastColumn-1;_++)i(a.rows[l.firstRow].cells[_],c,["borderLeft","borderRight"]);i(a.rows[l.firstRow].cells[y?l.firstColumn:l.lastColumn],c,["borderLeft"]);break}for(i(a.rows[l.firstRow].cells[y?l.lastColumn:l.firstColumn],c,["borderBottom","borderRight"]),i(a.rows[l.firstRow].cells[y?l.firstColumn:l.lastColumn],c,["borderBottom","borderLeft"]),i(a.rows[l.lastRow].cells[y?l.lastColumn:l.firstColumn],c,["borderTop","borderRight"]),i(a.rows[l.lastRow].cells[y?l.firstColumn:l.lastColumn],c,["borderTop","borderLeft"]),_=l.firstColumn+1;_<l.lastColumn;_++)i(a.rows[l.firstRow].cells[_],c,["borderBottom","borderLeft","borderRight"]);for(_=l.firstColumn+1;_<l.lastColumn;_++)i(a.rows[l.lastRow].cells[_],c,["borderTop","borderLeft","borderRight"]);for(C=l.firstRow+1;C<l.lastRow;C++)i(a.rows[C].cells[l.firstColumn],c,["borderTop","borderBottom",y?"borderLeft":"borderRight"]);for(C=l.firstRow+1;C<l.lastRow;C++)i(a.rows[C].cells[l.lastColumn],c,["borderTop","borderBottom",y?"borderRight":"borderLeft"]);l.firstColumn++,l.firstRow++,l.lastColumn--,l.lastRow--,b.push("allBorders");break;case"outsideBorders":b.push("topBorders"),b.push("bottomBorders"),b.push("leftBorders"),b.push("rightBorders")}!function(e,t,r,n,o){if(n.Top&&t.firstRow-1>=0)for(var a=t.firstColumn;a<=t.lastColumn;a++)i(e.rows[t.firstRow-1].cells[a],r,["borderBottom"]);if(n.Bottom&&t.lastRow+1<e.rows.length)for(a=t.firstColumn;a<=t.lastColumn;a++)i(e.rows[t.lastRow+1].cells[a],r,["borderTop"]);if(n.Left&&t.firstColumn-1>=0)for(var l=t.firstRow;l<=t.lastRow;l++)i(e.rows[l].cells[t.firstColumn-1],r,[o?"borderLeft":"borderRight"]);if(n.Right&&t.lastColumn+1<e.rows[0].cells.length)for(l=t.firstRow;l<=t.lastRow;l++)i(e.rows[l].cells[t.lastColumn+1],r,[o?"borderRight":"borderLeft"])}(a,l,c,s,y)}var w=(0,o.getTableMetadata)(a);return w&&(0,o.setFirstColumnFormatBorders)((0,o.mutateBlock)(a).rows,w),!0}return!1}),{apiName:"tableBorder"})}},8649:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.editTable=void 0;var n=r(3824),o=r(9842),i=r(4776),a=r(9256),l=r(7307),s=r(6682),c=r(1470),d=r(7378),u=r(6553),p=r(863),f=r(36),m=r(7062),g=r(2920);t.editTable=function(e,t){e.focus(),function(e){if(e.getEnvironment().isSafari){var t=e.getDOMSelection();"range"!=(null==t?void 0:t.type)||t.range.collapsed||(t.range.collapse(!0),e.setDOMSelection({type:"range",range:t.range,isReverted:!1}))}}(e),(0,l.formatTableWithContentModel)(e,"editTable",(function(e){switch(t){case"alignCellLeft":case"alignCellCenter":case"alignCellRight":(0,g.alignTableCellHorizontally)(e,t);break;case"alignCellTop":case"alignCellMiddle":case"alignCellBottom":(0,g.alignTableCellVertically)(e,t);break;case"alignCenter":case"alignLeft":case"alignRight":(0,n.alignTable)(e,t);break;case"deleteColumn":(0,i.deleteTableColumn)(e);break;case"deleteRow":(0,a.deleteTableRow)(e);break;case"deleteTable":(0,o.deleteTable)(e);break;case"insertAbove":case"insertBelow":(0,c.insertTableRow)(e,t);break;case"insertLeft":case"insertRight":(0,s.insertTableColumn)(e,t);break;case"mergeAbove":case"mergeBelow":(0,p.mergeTableRow)(e,t);break;case"mergeCells":(0,d.mergeTableCells)(e);break;case"mergeLeft":case"mergeRight":(0,u.mergeTableColumn)(e,t);break;case"splitHorizontally":(0,f.splitTableCellHorizontally)(e);break;case"splitVertically":(0,m.splitTableCellVertically)(e)}}))}},5308:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatTable=void 0;var n=r(1635),o=r(4990);t.formatTable=function(e,t,r){e.focus(),e.formatContentModel((function(e){var i=(0,n.__read)((0,o.getFirstSelectedTable)(e),1)[0];return!!i&&(i.rows.forEach((function(e){e.cells.forEach((function(e){(0,o.updateTableCellMetadata)((0,o.mutateBlock)(e),(function(e){return e&&delete e.borderOverride,e}))}))})),(0,o.applyTableFormat)(i,t,r),!0)}),{apiName:"formatTable"})}},6598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertTable=void 0;var n=r(9414),o=r(4990);t.insertTable=function(e,t,r,i){e.focus(),e.formatContentModel((function(a,l){var s,c,d,u=(0,o.deleteSelection)(a,[],l).insertPoint;if(u){var p=(0,o.createContentModelDocument)(),f=(0,n.createTableStructure)(p,t,r);(0,o.normalizeTable)(f,e.getPendingFormat()||u.marker.format),i=i||{verticalAlign:"top"},(0,o.applyTableFormat)(f,i),(0,o.mergeModel)(a,p,l,{insertPosition:u,mergeFormat:"mergeAll"});var m=null===(c=null===(s=f.rows[0])||void 0===s?void 0:s.cells[0])||void 0===c?void 0:c.blocks[0];if("Paragraph"==(null==m?void 0:m.blockType)){var g=(0,o.createSelectionMarker)(null===(d=m.segments[0])||void 0===d?void 0:d.format);m.segments.unshift(g),(0,o.setSelection)(a,g)}return!0}return!1}),{apiName:"insertTable"})}},8632:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setTableCellShade=void 0;var n=r(1635),o=r(4990);t.setTableCellShade=function(e,t){e.focus(),e.formatContentModel((function(e){var r=(0,n.__read)((0,o.getFirstSelectedTable)(e),1)[0];return!!r&&(r.rows.forEach((function(e){return e.cells.forEach((function(e){(0,o.hasSelectionInBlockGroup)(e)&&(0,o.setTableCellBackgroundColor)((0,o.mutateBlock)(e),t,!0)}))})),!0)}),{apiName:"setTableCellShade"})}},2270:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatImageWithContentModel=void 0;var n=r(8578);t.formatImageWithContentModel=function(e,t,r){(0,n.formatSegmentWithContentModel)(e,t,(function(e,t,n){"Image"==(null==n?void 0:n.segmentType)&&r(n)}),void 0,void 0)}},8210:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatInsertPointWithContentModel=void 0;var n=r(1635),o=r(4990);function i(e){return function(t,r,n){var i=n;i.path=i.path||[];var l=!1;i.path[0]!=t&&(i.path.unshift(t),l=!0);for(var s=c(n,e,r),d=0,u=r.firstChild;u;u=u.nextSibling)a(e,d,n,t,s,r),(0,o.processChildNode)(t,u,n),d++;a(e,d,n,t,s,r),l&&i.path.shift()}}function a(e,t,r,n,o,i){t==o[2]&&(t<=o[0]||o[0]<0)&&(t<o[1]||o[1]<0)&&(s(n,r,i,t,e),o[2]=-1),t==o[0]&&(r.isInSelection=!0,s(n,r,i,t)),t==o[2]&&(t<o[1]||o[1]<0)&&(s(n,r,i,t,e),o[2]=-1),t==o[1]&&(s(n,r,i,t),r.isInSelection=!1),t==o[2]&&s(n,r,i,t,e)}t.formatInsertPointWithContentModel=function(e,t,r,n){var a={input:t};e.formatContentModel((function(e,t){if(r(e,t,a.result),null==a?void 0:a.result){var n=a.result,i=n.paragraph,l=n.marker,s=i.segments.indexOf(l);s>=0&&(0,o.mutateBlock)(i).segments.splice(s,1)}return!0}),n,{processorOverride:{child:i(a),textWithSelection:l(a)},tryGetFromCache:!1})};var l=function(e){return function(t,r,i){var a=r.nodeValue||"",l=c(i,e,r),d=(0,n.__read)(l,3),u=d[0],p=d[1],f=d[2],m=function(e,n,c){(0,o.addTextSegment)(t,a.substring(0,e),i),s(t,i,r,n,c),l[0]-=e,l[1]-=e,l[2]=c?-1:l[2]-e,a=a.substring(e)};l[2]>=0&&(l[2]<=l[0]||l[0]<0)&&(l[2]<l[1]||l[1]<0)&&m(l[2],f,e),l[0]>=0&&(m(l[0],u),i.isInSelection=!0),l[2]>=0&&l[2]>l[0]&&(l[2]<l[1]||l[1]<0)&&m(l[2],f,e),l[1]>=0&&(m(l[1],p),i.isInSelection=!1),l[2]>=0&&l[2]>=l[1]&&m(l[2],f,e),(0,o.addTextSegment)(t,a,i)}};function s(e,t,r,i,a){var l=(0,o.buildSelectionMarker)(e,t,r,i);l.isSelected=!a;var s=(0,o.addSegment)(e,l,t.blockFormat,l.format);a&&t.path&&(a.result={path:(0,n.__spreadArray)([],(0,n.__read)(t.path),!1),paragraph:s,marker:l})}function c(e,t,r){var i=(0,n.__read)((0,o.getRegularSelectionOffsets)(e,r),2);return[i[0],i[1],t.input.node==r?t.input.offset:-1]}},8213:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatParagraphWithContentModel=void 0;var n=r(4990);t.formatParagraphWithContentModel=function(e,t,r){e.formatContentModel((function(e,t){var o=(0,n.getSelectedParagraphs)(e,!0);return o.forEach(r),t.newPendingFormat="preserve",o.length>0}),{apiName:t})}},8578:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatSegmentWithContentModel=void 0;var n=r(1635),o=r(1486),i=r(4990);t.formatSegmentWithContentModel=function(e,t,r,a,l,s){e.formatContentModel((function(t,c){var d=(0,i.getSelectedSegmentsAndParagraphs)(t,!!l,!1,!0),u=d.length>=1&&d.every((function(e){return"SelectionMarker"==e[0].segmentType}));if(u){var p=d[0][1],f=d[0][2];(d=(0,o.adjustWordSelection)(t,d[0][0]).map((function(e){return[e,p,f]}))).length>1&&(u=!1)}var m=d.map((function(e){return[e[0].format,e[0],e[1]]})),g=!!a&&m.every((function(e){var t=(0,n.__read)(e,3),r=t[0],o=t[1],i=t[2];return a(r,o,i)}));return m.forEach((function(e){var t=(0,n.__read)(e,3),o=t[0],i=t[1],a=t[2];return r(o,!g,i,a)})),null==s||s(t),u?(c.newPendingFormat=d[0][0].format,e.focus(),!1):m.length>0}),{apiName:t})}},7307:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatTableWithContentModel=void 0;var n=r(1635),o=r(1190),i=r(4990);t.formatTableWithContentModel=function(e,t,r,a){e.formatContentModel((function(e){var t=(0,n.__read)((0,i.getFirstSelectedTable)(e),2),a=t[0],l=t[1];if(a){var s=(0,i.mutateBlock)(a);if(r(s),!(0,i.hasSelectionInBlock)(s)){var c=(0,o.ensureFocusableParagraphForTable)(e,l,s);if(c){var d=(0,i.createSelectionMarker)(e.format);c.segments.unshift(d),(0,i.setParagraphNotImplicit)(c),(0,i.setSelection)(e,d)}}return(0,i.normalizeTable)(s,e.format),(0,i.hasMetadata)(s)&&(0,i.applyTableFormat)(s,void 0,!0),!0}return!1}),{apiName:t,selectionOverride:a})}},1328:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatTextSegmentBeforeSelectionMarker=void 0;var n=r(4990);t.formatTextSegmentBeforeSelectionMarker=function(e,t,r){var o=!1;return e.formatContentModel((function(e,r){var i=(0,n.getSelectedSegmentsAndParagraphs)(e,!1),a=!1;return i.length>0&&"SelectionMarker"==i[0][0].segmentType&&i[0][1]&&(0,n.mutateSegment)(i[0][1],i[0][0],(function(n,i,l){var s=i.segments[l-1];s&&"Text"===s.segmentType&&(o=!0,a=t(e,s,i,n.format,r))})),a}),r),o}},8959:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertInlineCss=t.retrieveCssRules=void 0;var n=r(1635),o=r(4990);t.retrieveCssRules=function(e){var t=(0,o.toArray)(e.querySelectorAll("style")),r=[];return t.forEach((function(e){var t,n,o=e.sheet;if(o)for(var i=0;i<o.cssRules.length;i++){var a=o.cssRules[i];a.type==CSSRule.STYLE_RULE&&a.selectorText&&r.push({selectors:(n=a.selectorText,n.split(/(?![^(]*\)),/).map((function(e){return e.trim()}))),text:a.style.cssText})}null===(t=e.parentNode)||void 0===t||t.removeChild(e)})),r},t.convertInlineCss=function(e,t){for(var r=function(r){var i,a,l=t[r],s=l.selectors,c=l.text;try{for(var d=(i=void 0,(0,n.__values)(s)),u=d.next();!u.done;u=d.next()){var p=u.value;p&&p.trim()&&(0,o.toArray)(e.querySelectorAll(p)).forEach((function(e){return e.setAttribute("style",c+(e.getAttribute("style")||""))}))}}catch(e){i={error:e}}finally{try{u&&!u.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}},i=t.length-1;i>=0;i--)r(i)}},558:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDomToModelContextForSanitizing=void 0;var n=r(1635),o=r(4764),i=r(4990),a=r(3912),l=r(7801),s=r(332),c=r(8219),d=r(8735),u=r(9724),p={processorOverride:{},formatParserOverride:{},additionalFormatParsers:{},additionalAllowedTags:[],additionalDisallowedTags:[],styleSanitizers:{},attributeSanitizers:{}};t.createDomToModelContextForSanitizing=function(e,t,r,f){var m=(0,n.__assign)((0,n.__assign)({},p),f);return(0,i.createDomToModelContext)((0,n.__assign)((0,n.__assign)({defaultFormat:t},(0,s.getRootComputedStyleForContext)(e)),{experimentalFeatures:[]}),r,{processorOverride:{"#text":u.pasteTextProcessor,entity:(0,a.createPasteEntityProcessor)(m),"*":(0,l.createPasteGeneralProcessor)(m)},formatParserOverride:{display:d.pasteDisplayFormatParser},additionalFormatParsers:{container:[o.containerSizeFormatParser],entity:[c.pasteBlockEntityParser]}},m)}},1724:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createModelFromHtml=void 0;var n=r(8959),o=r(558),i=r(4990);t.createModelFromHtml=function(e,t,r,a){var l,s=e?(new DOMParser).parseFromString(null!==(l=null==r?void 0:r(e))&&void 0!==l?l:e,"text/html"):null;if(null==s?void 0:s.body){var c=(0,o.createDomToModelContextForSanitizing)(s,a,void 0,t),d=s?(0,n.retrieveCssRules)(s):[];return(0,n.convertInlineCss)(s,d),(0,i.parseFormat)(s.body,c.formatParsers.segmentOnBlock,c.segmentFormat,c),(0,i.domToContentModel)(s.body,c)}return(0,i.createEmptyModel)(a)}},6973:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSanitizedElement=t.sanitizeElement=t.DisallowedTags=t.AllowedTags=void 0;var n=r(4990);t.AllowedTags=["a","abbr","address","area","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","em","fieldset","figcaption","figure","font","footer","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","menu","menuitem","meter","nav","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","small","span","strike","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","tt","u","ul","var","wbr","xmp"],t.DisallowedTags=["applet","audio","base","basefont","embed","frame","frameset","iframe","link","meta","noscript","object","param","script","slot","source","style","template","title","track","video"];var o=/^\s*var\(\s*[a-zA-Z0-9-_]+\s*(,\s*(.*))?\)\s*$/,i="var(",a=["accept","align","alt","checked","cite","class","color","cols","colspan","contextmenu","coords","datetime","default","dir","dirname","disabled","download","face","headers","height","hidden","high","href","hreflang","ismap","kind","label","lang","list","low","max","maxlength","media","min","multiple","open","optimum","pattern","placeholder","readonly","rel","required","reversed","rows","rowspan","scope","selected","shape","size","sizes","span","spellcheck","src","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","valign","value","width","wrap","bgColor"],l={"background-color":"transparent","border-bottom-color":"rgb(0, 0, 0)","border-bottom-style":"none","border-bottom-width":"0px","border-image-outset":"0","border-image-repeat":"stretch","border-image-slice":"100%","border-image-source":"none","border-image-width":"1","border-left-color":"rgb(0, 0, 0)","border-left-style":"none","border-left-width":"0px","border-right-color":"rgb(0, 0, 0)","border-right-style":"none","border-right-width":"0px","border-top-color":"rgb(0, 0, 0)","border-top-style":"none","border-top-width":"0px","outline-color":"transparent","outline-style":"none","outline-width":"0px",overflow:"visible","-webkit-text-stroke-width":"0px","word-wrap":"break-word","margin-left":"0px","margin-right":"0px",padding:"0px","padding-top":"0px","padding-left":"0px","padding-right":"0px","padding-bottom":"0px",border:"0px","border-top":"0px","border-left":"0px","border-right":"0px","border-bottom":"0px","vertical-align":"baseline",float:"none","font-style":"normal","font-variant-ligatures":"normal","font-variant-caps":"normal","font-weight":"400","letter-spacing":"normal",orphans:"2","text-align":"start","text-indent":"0px","text-transform":"none",widows:"2","word-spacing":"0px","white-space":"normal"};function s(e,t,r,n,o){for(var i=e.createElement(t),l=0;l<r.length;l++){var s=r[l],d=s.name.toLowerCase().trim(),u=s.value,p=null==o?void 0:o[d],f="style"==d?c(t,u,n):"function"==typeof p?p(u,t):"boolean"==typeof p?p?u:null:a.indexOf(d)>=0||0==d.indexOf("data-")?u:null;null==f||f.match(/s\n*c\n*r\n*i\n*p\n*t\n*:/i)||i.setAttribute(d,f)}return i}function c(e,t,r){var n=t.split(";"),a=[];return n.forEach((function(t){var n=t.indexOf(":"),s=t.slice(0,n).trim(),c=t.slice(n+1).trim();if(s&&c){(function(e){return 0==e.indexOf(i)})(c)&&(c=function(e){var t=o.exec(e);return(null==t?void 0:t[2])||""}(c));var d=null==r?void 0:r[s],u="function"==typeof d?d(c,e):!1===d?null:c;u&&"inherit"!=u&&"initial"!=u&&u.indexOf("expression")<0&&!s.startsWith("-")&&l[s]!=u&&a.push(s+":"+u)}})),a.join(";")}t.sanitizeElement=function e(t,r,o,i,a){var l=t.tagName.toLowerCase(),c=o.indexOf(l)>=0?null:s(t.ownerDocument,r.indexOf(l)>=0?l:"span",t.attributes,i,a);if(c)for(var d=t.firstChild;d;d=d.nextSibling){var u=(0,n.isNodeOfType)(d,"ELEMENT_NODE")?e(d,r,o,i,a):(0,n.isNodeOfType)(d,"TEXT_NODE")?d.cloneNode():null;u&&(null==c||c.appendChild(u))}return c},t.createSanitizedElement=s},3980:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exportContent=void 0;var n=r(4990);t.exportContent=function(e,t,r){if(void 0===t&&(t="HTML"),"PlainTextFast"==t)return e.getDOMHelper().getTextContent();var o=e.getContentModelCopy("clean");if("PlainText"==t)return(0,n.contentModelToText)(o,void 0,r);var i=e.getDocument(),a=i.createElement("div");return(0,n.contentModelToDom)(i,a,o,(0,n.createModelToDomContext)(void 0,r)),e.triggerEvent("extractContentWithDom",{clonedRoot:a},!0),a.innerHTML}},6584:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPasteFragment=void 0;var n=r(4990);t.createPasteFragment=function(e,t,r,o){var i=t.imageDataUri,a=t.text,l=e.createDocumentFragment();if("asImage"==r&&i||"asPlainText"!=r&&!a&&i){var s=e.createElement("img");s.style.maxWidth="100%",s.src=i,l.appendChild(s)}else"asPlainText"!=r&&o?(0,n.moveChildNodes)(l,o):a&&a.split("\n").forEach((function(t,r,o){(t=t.replace(/^ /g," ").replace(/ $/g," ").replace(/\r/g,"").replace(/ {2}/g,"  ")).includes("\t")&&(t=function(e,t){void 0===t&&(t=0);for(var r,n=e;-1!=(r=n.indexOf("\t"));){var o=n.slice(0,r),i=n.slice(r+1),a=6-(o.length+t)%6;n=o+Array(a).fill(" ").join("")+i}return n}(t));var i=e.createTextNode(t);2==o.length&&0==r?(l.appendChild(i),l.appendChild(e.createElement("br"))):r>0&&r<o.length-1?l.appendChild((0,n.wrap)(e,""==t?e.createElement("br"):i,"div")):l.appendChild(i)}));return l}},5158:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generatePasteOptionFromPlugins=void 0,t.generatePasteOptionFromPlugins=function(e,t,r,n,o){var i,a,l={eventType:"beforePaste",clipboardData:t,fragment:r,htmlBefore:null!==(i=n.htmlBefore)&&void 0!==i?i:"",htmlAfter:null!==(a=n.htmlAfter)&&void 0!==a?a:"",htmlAttributes:n.metadata,pasteType:o,domToModelOption:{additionalAllowedTags:[],additionalDisallowedTags:[],additionalFormatParsers:{},formatParserOverride:{},processorOverride:{},styleSanitizers:{},attributeSanitizers:{}},containsBlockElements:!!n.containsBlockElements};return"asPlainText"==o?l:e.triggerEvent("beforePaste",l,!0)}},9499:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergePasteContent=t.cloneModelForPaste=void 0;var n=r(1635),o=r(558),i=r(4990),a={includeCachedElement:function(e,t){return"cache"==t?void 0:e}};function l(e){return(0,i.cloneModel)(e,a)}function s(e){return 2==e.blocks.length&&"Table"===e.blocks[0].blockType&&"Paragraph"===e.blocks[1].blockType&&1===e.blocks[1].segments.length&&"Br"===e.blocks[1].segments[0].segmentType&&e.blocks.splice(1),1===e.blocks.length&&"Table"===e.blocks[0].blockType}t.cloneModelForPaste=l,t.mergePasteContent=function(e,t){var r=t.fragment,a=t.domToModelOption,c=t.customizedMerge,d=t.pasteType,u=t.clipboardData,p=t.containsBlockElements;e.formatContentModel((function(t,f){if(u.modelBeforePaste){var m=l(u.modelBeforePaste);t.blocks=m.blocks}var g=(0,o.createDomToModelContextForSanitizing)(e.getDocument(),void 0,e.getEnvironment().domToModelSettings.customized,a);g.segmentFormat=function(e,t){var r=(0,i.getSelectedSegments)(e,!0)[0];if(r){var n=(0,i.getSegmentTextFormat)(r);return"normal"==t&&(n.textColor="rgb(0,0,0)"),n}return{}}(t,d);var h=(0,i.domToContentModel)(r,g),v={mergeFormat:"mergeFormat"==d?"keepSourceEmphasisFormat":"none",mergeTable:s(h),addParagraphAfterMergedContent:p},y=c?c(t,h):(0,i.mergeModel)(t,h,f,v);return y&&(f.newPendingFormat=(0,n.__assign)((0,n.__assign)((0,n.__assign)({},i.EmptySegmentFormat),t.format),"normal"!=d||p?y.marker.format:function(e){if(1==e.blocks.length){var t=(0,n.__read)(e.blocks,1)[0];if("Paragraph"==t.blockType){var r=t.segments[t.segments.length-1];return(0,n.__assign)({},r.format)}}return{}}(h))),!0}),{changeSource:i.ChangeSource.Paste,getChangeData:function(){return u},scrollCaretIntoView:!0,apiName:"paste"})}},292:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.paste=void 0;var n=r(9499),o=r(8959),i=r(6584),a=r(5158),l=r(1810);function s(e,t){return e?(new DOMParser).parseFromString(t(e),"text/html"):null}t.paste=function(e,t,r){var c;void 0===r&&(r="normal"),e.focus();var d=e.getTrustedHTMLHandler();t.modelBeforePaste||e.formatContentModel((function(e){return t.modelBeforePaste=(0,n.cloneModelForPaste)(e),!1}));var u=s(t.rawHtml,d),p="function"==typeof r?r(u,t):r,f=(0,l.retrieveHtmlInfo)(u,t),m=(0,i.createPasteFragment)(e.getDocument(),t,p,null===(c=t.rawHtml==t.html?u:s(t.html,d))||void 0===c?void 0:c.body),g=(0,a.generatePasteOptionFromPlugins)(e,t,m,f,p);(0,o.convertInlineCss)(g.fragment,f.globalCssRules),(0,n.mergePasteContent)(e,g)}},1810:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retrieveHtmlInfo=void 0;var n=r(1635),o=r(4990),i=r(8959),a="\x3c!--StartFragment--\x3e",l="\x3c!--EndFragment--\x3e";function s(e){var t,r={},n=null===(t=e.querySelector("html"))||void 0===t?void 0:t.attributes;return(n?(0,o.toArray)(n):[]).forEach((function(e){r[e.name]=e.value})),(0,o.toArray)(e.querySelectorAll("meta")).forEach((function(e){r[e.name]=e.content})),r}function c(e){return(0,o.toArray)(e.body.querySelectorAll("*")).some((function(e){return(0,o.isNodeOfType)(e,"ELEMENT_NODE")&&(0,o.isBlockElement)(e)}))}t.retrieveHtmlInfo=function(e,t){var r={metadata:{},globalCssRules:[]};return e&&(r=(0,n.__assign)((0,n.__assign)({},function(e){var t,r=null!==(t=e.rawHtml)&&void 0!==t?t:"",n=r.indexOf(a),o=r.lastIndexOf(l),i="",s="";return n>=0&&o>=n+20?(i=r.substring(0,n),s=r.substring(o+18),e.html=r.substring(n+20,o)):e.html=r,{htmlBefore:i,htmlAfter:s}}(t)),{globalCssRules:(0,i.retrieveCssRules)(e),metadata:s(e),containsBlockElements:c(e)}),t.htmlFirstLevelChildTags=function(e){for(var t,r=[],n=e.body.firstChild;n;n=n.nextSibling)(0,o.isNodeOfType)(n,"TEXT_NODE")?(null===(t=n.nodeValue)||void 0===t?void 0:t.replace(/(\r\n|\r|\n)/gm,"").trim())&&r.push(""):(0,o.isNodeOfType)(n,"ELEMENT_NODE")&&r.push(n.tagName);return r}(e)),r}},5942:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.redo=void 0,t.redo=function(e){e.focus();var t=e.getSnapshotsManager().move(1);t&&e.restoreSnapshot(t)}},674:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.undo=void 0,t.undo=function(e){e.focus();var t=e.getSnapshotsManager();t.hasNewContent&&e.takeSnapshot();var r=t.move(-1);r&&e.restoreSnapshot(r)}},1064:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addUndoSnapshot=void 0;var n=r(4990),o=r(5339),i=r(2998);t.addUndoSnapshot=function(e,t,r){var a=e.lifecycle,l=e.physicalRoot,s=e.logicalRoot,c=e.undo,d=null;if(!a.shadowEditFragment){var u=(0,o.createSnapshotSelection)(e),p=l.innerHTML;if(s!==l){var f=(0,n.findClosestEntityWrapper)(s,e.domHelper);if(!r&&f){var m=(0,n.parseEntityFormat)(f);if(m.entityType&&m.id){var g={eventType:"entityOperation",operation:"snapshotEntityState",entity:{type:m.entityType,id:m.id,wrapper:f,isReadonly:m.isReadonly},state:void 0};e.api.triggerEvent(e,g,!1),g.state&&(r=[{type:m.entityType,id:m.id,state:g.state}])}}}d={html:p,entityStates:r,isDarkMode:!!a.isDarkMode,selection:u},s!==l&&(d.logicalRootPath=(0,i.getPath)(s,0,l)),c.snapshotsManager.addSnapshot(d,!!t),c.snapshotsManager.hasNewContent=!1}return d}},5339:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSnapshotSelection=void 0;var n=r(4990),o=r(2998);function i(e,t){for(var r=e,o=!1;r&&t.contains(r);)(0,n.isNodeOfType)(r,"ELEMENT_NODE")&&(0,n.isElementOfType)(r,"table")&&(o=a(r)||o),r=r.parentNode;return o}function a(e){for(var t,r=!1,o=null,i=e.firstChild;i;i=i.nextSibling)switch((0,n.isNodeOfType)(i,"ELEMENT_NODE")?i.tagName:null){case"TR":o||(o=e.ownerDocument.createElement("tbody"),e.insertBefore(o,i)),o.appendChild(i),i=o,r=!0;break;case"TBODY":o?((0,n.moveChildNodes)(o,i,!0),null===(t=i.parentNode)||void 0===t||t.removeChild(i),i=o,r=!0):o=i;break;default:o=null}var a=e.querySelectorAll("colgroup"),l=e.querySelector("thead");return l&&a.forEach((function(e){l.contains(e)||l.appendChild(e)})),r}t.createSnapshotSelection=function(e){var t=e.physicalRoot,r=e.api,n=r.getDOMSelection(e);if("range"==(null==n?void 0:n.type)){var a=n.range,l=a.startContainer,s=a.startOffset,c=a.endContainer,d=a.endOffset,u=i(l,t);if(c!=l&&(u=i(c,t)||u),u){var p=t.ownerDocument.createRange();p.setStart(l,s),p.setEnd(c,d),r.setDOMSelection(e,{type:"range",range:p,isReverted:!!n.isReverted},!0)}}switch(null==n?void 0:n.type){case"image":return{type:"image",imageId:n.image.id};case"table":return{type:"table",tableId:n.table.id,firstColumn:n.firstColumn,lastColumn:n.lastColumn,firstRow:n.firstRow,lastRow:n.lastRow};case"range":var f=n.range;return{type:"range",start:(0,o.getPath)(f.startContainer,f.startOffset,t),end:(0,o.getPath)(f.endContainer,f.endOffset,t),isReverted:!!n.isReverted};default:return{type:"range",start:[],end:[],isReverted:!1}}}},2998:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPath=void 0;var n=r(4990);t.getPath=function(e,t,r){var o,i,a,l=[];if(!e||!r.contains(e))return l;if((0,n.isNodeOfType)(e,"TEXT_NODE")){for(a=e.parentNode;e.previousSibling&&(0,n.isNodeOfType)(e.previousSibling,"TEXT_NODE");)t+=(null===(o=e.previousSibling.nodeValue)||void 0===o?void 0:o.length)||0,e=e.previousSibling;l.unshift(t)}else a=e,e=e.childNodes[t];do{t=0;for(var s=!1,c=(null==a?void 0:a.firstChild)||null;c&&c!=e;c=c.nextSibling){if((0,n.isNodeOfType)(c,"TEXT_NODE")){if(0===(null===(i=c.nodeValue)||void 0===i?void 0:i.length)||s)continue;s=!0}else s=!1;t++}l.unshift(t),e=a,a=(null==a?void 0:a.parentNode)||null}while(e&&e!=r);return l}},3784:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.announce=void 0;var n=r(1782);t.announce=function(e,t){var r=t.text,o=t.defaultStrings,i=t.formatStrings,a=void 0===i?[]:i,l=t.ariaLiveMode,s=void 0===l?"assertive":l,c=e.lifecycle.announcerStringGetter,d=function(e,t){return null==e||(e=e.replace(/\{(\d+)\}/g,(function(e,r){var n=parseInt(r),o=t[n];return null!=o?o:""}))),e}(o&&(null==c?void 0:c(o))||r,a);if(e.lifecycle.announceContainer||(e.lifecycle.announceContainer=(0,n.createAriaLiveElement)(e.physicalRoot.ownerDocument)),d&&e.lifecycle.announceContainer){var u=e.lifecycle.announceContainer;u.ariaLive!=s&&(u.ariaLive=s),d==u.textContent&&(d+="."),u&&(u.textContent=d)}}},1268:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.attachDomEvent=void 0;var n=r(4990);t.attachDomEvent=function(e,t){var r=(0,n.getObjectKeys)(t||{}).map((function(r){var n=t[r],o=n.pluginEventType,i=n.beforeDispatch,a=r,l=function(t){i&&i(t),null!=o&&e.api.triggerEvent(e,{eventType:o,rawEvent:t},!1)};return e.logicalRoot.addEventListener(a,l),function(){e.logicalRoot.removeEventListener(a,l)}}));return function(){return r.forEach((function(e){return e()}))}}},4694:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.coreApiMap=void 0;var n=r(1064),o=r(3784),i=r(1268),a=r(9538),l=r(1984),s=r(60),c=r(8060),d=r(5704),u=r(3834),p=r(7488),f=r(3472),m=r(1616),g=r(2830),h=r(7832),v=r(6558),y=r(4486);t.coreApiMap={createContentModel:a.createContentModel,createEditorContext:l.createEditorContext,formatContentModel:c.formatContentModel,setContentModel:f.setContentModel,setLogicalRoot:h.setLogicalRoot,getDOMSelection:d.getDOMSelection,setDOMSelection:m.setDOMSelection,focus:s.focus,addUndoSnapshot:n.addUndoSnapshot,restoreUndoSnapshot:p.restoreUndoSnapshot,attachDomEvent:i.attachDomEvent,triggerEvent:y.triggerEvent,switchShadowEdit:v.switchShadowEdit,getVisibleViewport:u.getVisibleViewport,setEditorStyle:g.setEditorStyle,announce:o.announce}},9538:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createContentModel=void 0;var n=r(2994),o=r(4990);t.createContentModel=function(e,t,r){var i;if(null===(i=e.cache.textMutationObserver)||void 0===i||i.flushMutations(),!r&&(!t||t.tryGetFromCache)){var a=e.cache.cachedModel;if(a)return e.lifecycle.shadowEditFragment?(0,o.cloneModel)(a,{includeCachedElement:!0}):a}var l="none"==r?void 0:r||e.api.getDOMSelection(e)||void 0,s=!t&&!r,c=e.api.createEditorContext(e,s),d=e.environment.domToModelSettings,u=t?(0,o.createDomToModelContext)(c,d.builtIn,d.customized,t):(0,o.createDomToModelContextWithConfig)(d.calculated,c);l&&(u.selection=l);var p=(0,o.domToContentModel)(e.logicalRoot,u);return s&&(0,n.updateCache)(e.cache,p,l),p}},1984:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEditorContext=void 0;var n=r(1635),o=r(332);t.createEditorContext=function(e,t){var r,i,a=e.lifecycle,l=e.format,s=e.darkColorHandler,c=e.logicalRoot,d=e.cache,u=e.domHelper;t=t&&!e.lifecycle.shadowEditFragment;var p=(0,n.__assign)({isDarkMode:a.isDarkMode,defaultFormat:l.defaultFormat,pendingFormat:null!==(r=l.pendingFormat)&&void 0!==r?r:void 0,darkColorHandler:s,addDelimiterForEntity:!0,allowCacheElement:!0,domIndexer:t?d.domIndexer:void 0,zoomScale:u.calculateZoomScale(),experimentalFeatures:null!==(i=e.experimentalFeatures)&&void 0!==i?i:[]},(0,o.getRootComputedStyleForContext)(c.ownerDocument));return e.domHelper.isRightToLeft()&&(p.isRootRtl=!0),p}},332:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRootComputedStyleForContext=void 0;var n=r(4990);t.getRootComputedStyleForContext=function(e){var t,r=null===(t=e.defaultView)||void 0===t?void 0:t.getComputedStyle(e.documentElement);return{rootFontSize:(0,n.parseValueWithUnit)(null==r?void 0:r.fontSize)||16}}},60:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.focus=void 0,t.focus=function(e){var t;if(!e.lifecycle.shadowEditFragment){var r=e.api,n=e.domHelper,o=e.selection;n.hasFocus()||"range"!=(null===(t=o.selection)||void 0===t?void 0:t.type)||r.setDOMSelection(e,o.selection,!0),n.hasFocus()||e.logicalRoot.focus()}}},8060:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatContentModel=void 0;var n=r(1635),o=r(4990),i=r(2066);function a(e,t,r){var o,i="preserve"==t.newPendingFormat?null===(o=e.format.pendingFormat)||void 0===o?void 0:o.format:t.newPendingFormat;i&&"range"==(null==r?void 0:r.type)&&r.range.collapsed&&(e.format.pendingFormat={format:(0,n.__assign)({},i),insertPoint:{node:r.range.startContainer,offset:r.range.startOffset}})}function l(e,t){return e.newEntities.map((function(e){return{entity:e,operation:"newEntity",rawEvent:t}})).concat(e.deletedEntities.map((function(e){return{entity:e.entity,operation:e.operation,rawEvent:t}})))}t.formatContentModel=function(e,t,r,n){var s,c=r||{},d=c.onNodeCreated,u=c.getChangeData,p=c.rawEvent,f=c.selectionOverride,m=c.scrollCaretIntoView,g=e.api.createContentModel(e,n,f),h={newEntities:[],deletedEntities:[],rawEvent:p,newImages:[]},v=e.domHelper.hasFocus(),y=t(g,h),b=h.skipUndoSnapshot,S=h.clearModelCache,C=h.entityStates,_=h.canUndoByBackspace;if(y){var E=e.undo.isNested,T=!b&&!E,k=void 0;T&&(e.undo.isNested=!0,e.api.addUndoSnapshot(e,!!_,C));try{!function(e,t){if(t.newImages.length>0){var r=e.domHelper.getClientWidth(),n=Math.max(r,10);t.newImages.forEach((function(e){e.format.maxWidth=n+"px"}))}}(e,h),k=null!==(s=e.api.setContentModel(e,g,v?void 0:{ignoreSelection:!0},d))&&void 0!==s?s:void 0,a(e,h,k),!m||"range"!=(null==k?void 0:k.type)&&"image"!=(null==k?void 0:k.type)||(0,i.scrollCaretIntoView)(e,k);var M={eventType:"contentChanged",contentModel:S?void 0:g,selection:S?void 0:k,source:(null==r?void 0:r.changeSource)||o.ChangeSource.Format,data:null==u?void 0:u(),formatApiName:null==r?void 0:r.apiName,changedEntities:l(h,p)};e.api.triggerEvent(e,M,!0),_&&"range"==(null==k?void 0:k.type)&&(e.undo.autoCompleteInsertPoint={node:k.range.startContainer,offset:k.range.startOffset}),T?e.api.addUndoSnapshot(e,!1,C):e.undo.snapshotsManager.hasNewContent=!0}finally{E||(e.undo.isNested=!1)}}else S&&(e.cache.cachedModel=void 0,e.cache.cachedSelection=void 0),a(e,h,e.api.getDOMSelection(e));h.announceData&&e.api.announce(e,h.announceData)}},2066:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scrollCaretIntoView=void 0;var n=r(4990);t.scrollCaretIntoView=function(e,t){var r=(0,n.getDOMInsertPointRect)(e.physicalRoot.ownerDocument,"image"==t.type?{node:t.image,offset:0}:t.isReverted?{node:t.range.startContainer,offset:t.range.startOffset}:{node:t.range.endContainer,offset:t.range.endOffset}),o=e.api.getVisibleViewport(e),i=e.domEvent.scrollContainer;if(r&&o)if(r.bottom>o.bottom){var a=e.domHelper.calculateZoomScale();i.scrollTop+=(r.bottom-o.bottom)/a}else r.top<o.top&&(a=e.domHelper.calculateZoomScale(),i.scrollTop+=(r.top-o.top)/a)}},5704:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDOMSelection=void 0,t.getDOMSelection=function(e){if(e.lifecycle.shadowEditFragment)return null;var t=e.selection.selection;return!t||"range"==t.type&&e.domHelper.hasFocus()?function(e){var t,r=null===(t=e.logicalRoot.ownerDocument.defaultView)||void 0===t?void 0:t.getSelection(),n=r&&r.rangeCount>0?r.getRangeAt(0):null;return r&&n&&e.logicalRoot.contains(n.commonAncestorContainer)?{type:"range",range:n,isReverted:r.focusNode!=n.endContainer||r.focusOffset!=n.endOffset}:null}(e):t}},3834:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVisibleViewport=void 0;var n=r(1635),o=r(4990);t.getVisibleViewport=function(e){var t=e.domEvent.scrollContainer;return function(e,t){void 0===t&&(t=[]);var r=e.map((function(e){return(0,o.normalizeRect)(e.getBoundingClientRect())})).concat(t).filter((function(e){return!!e})),i={top:Math.max.apply(Math,(0,n.__spreadArray)([],(0,n.__read)(r.map((function(e){return e.top}))),!1)),bottom:Math.min.apply(Math,(0,n.__spreadArray)([],(0,n.__read)(r.map((function(e){return e.bottom}))),!1)),left:Math.max.apply(Math,(0,n.__spreadArray)([],(0,n.__read)(r.map((function(e){return e.left}))),!1)),right:Math.min.apply(Math,(0,n.__spreadArray)([],(0,n.__read)(r.map((function(e){return e.right}))),!1))};return i.top<i.bottom&&i.left<i.right?i:null}(t==e.physicalRoot?[t]:[t,e.physicalRoot])}},3976:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPositionFromPath=void 0;var n=r(4990);t.getPositionFromPath=function(e,t){for(var r=0,o=0;o<t.length&&(r=t[o],o<t.length-1&&e&&(0,n.isNodeOfType)(e,"ELEMENT_NODE")&&e.childNodes.length>r);o++)e=e.childNodes[r];return{node:e,offset:r}}},9830:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.restoreSnapshotColors=void 0;var n=r(4990);t.restoreSnapshotColors=function(e,t){var r=e.lifecycle.isDarkMode;e.darkColorHandler.updateKnownColor(r),!!t.isDarkMode!=!!r&&(0,n.transformColor)(e.physicalRoot,!1,r?"lightToDark":"darkToLight",e.darkColorHandler)}},6691:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.restoreSnapshotHTML=void 0;var n=r(4990);function o(e,t){var r=null;return(0,n.isNodeOfType)(t,"ELEMENT_NODE")&&((0,n.isEntityElement)(t)?r=i(e,(0,n.parseEntityFormat)(t).id):(0,n.isBlockEntityContainer)(t)&&(r=function(e,t){for(var r,o=e.firstChild;o;o=o.nextSibling)if((0,n.isEntityElement)(o)&&(0,n.isNodeOfType)(o,"ELEMENT_NODE")){var a=null===(r=i(t,(0,n.parseEntityFormat)(o).id))||void 0===r?void 0:r.parentElement;return(0,n.isNodeOfType)(a,"ELEMENT_NODE")&&(0,n.isBlockEntityContainer)(a)?a:null}return null}(t,e))),r}function i(e,t){var r=t?e[t]:void 0;return(null==r?void 0:r.canPersist)?r.element:null}t.restoreSnapshotHTML=function(e,t){for(var r,i,a,l=e.physicalRoot,s=e.entity.entityMap,c=l.firstChild,d=(new DOMParser).parseFromString(null!==(i=null===(r=e.trustedHTMLHandler)||void 0===r?void 0:r.call(e,t.html))&&void 0!==i?i:t.html,"text/html").body.firstChild;d;){var u=d.nextSibling,p=o(s,d);p?c=(0,n.reuseCachedElement)(l,p,c):(l.insertBefore(d,c),(0,n.isNodeOfType)(d,"ELEMENT_NODE")&&(0,n.getAllEntityWrappers)(d).forEach((function(e){var t,r=o(s,e);if(r){if(r==c){var n=r.cloneNode();l.insertBefore(n,c),c=n}null===(t=e.parentNode)||void 0===t||t.replaceChild(r,e)}}))),d=u}for(;c;)u=c.nextSibling,null===(a=c.parentNode)||void 0===a||a.removeChild(c),c=u}},7419:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.restoreSnapshotLogicalRoot=void 0;var n=r(3976);t.restoreSnapshotLogicalRoot=function(e,t){if(t.logicalRootPath&&t.logicalRootPath.length>0){var r=(0,n.getPositionFromPath)(e.physicalRoot,t.logicalRootPath).node;r!==e.logicalRoot&&e.api.setLogicalRoot(e,r)}else e.api.setLogicalRoot(e,null)}},3466:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.restoreSnapshotSelection=void 0;var n=r(3976),o=r(4990);t.restoreSnapshotSelection=function(e,t){var r=t.selection,i=e.physicalRoot,a=null;try{if(r)switch(r.type){case"range":var l=(0,n.getPositionFromPath)(i,r.start),s=(0,n.getPositionFromPath)(i,r.end),c=i.ownerDocument.createRange();c.setStart(l.node,l.offset),c.setEnd(s.node,s.offset),a={type:"range",range:c,isReverted:r.isReverted};break;case"table":var d=i.querySelector((0,o.getSafeIdSelector)(r.tableId));d&&(a={type:"table",table:d,firstColumn:r.firstColumn,firstRow:r.firstRow,lastColumn:r.lastColumn,lastRow:r.lastRow});break;case"image":var u=i.querySelector((0,o.getSafeIdSelector)(r.imageId));u&&(a={type:"image",image:u})}a&&e.api.setDOMSelection(e,a)}catch(e){}}},7488:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.restoreUndoSnapshot=void 0;var n=r(4990),o=r(9830),i=r(6691),a=r(7419),l=r(3466);t.restoreUndoSnapshot=function(e,t){e.api.triggerEvent(e,{eventType:"beforeSetContent",newContent:t.html},!0);try{e.undo.isRestoring=!0,(0,i.restoreSnapshotHTML)(e,t),(0,a.restoreSnapshotLogicalRoot)(e,t),(0,l.restoreSnapshotSelection)(e,t),(0,o.restoreSnapshotColors)(e,t);var r={eventType:"contentChanged",entityStates:t.entityStates,source:n.ChangeSource.SetContent};e.api.triggerEvent(e,r,!1)}finally{e.undo.isRestoring=!1}}},3472:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setContentModel=void 0;var n=r(2994),o=r(4990);t.setContentModel=function(e,t,r,i){var a,l=e.api.createEditorContext(e,!0),s=r?(0,o.createModelToDomContext)(l,e.environment.modelToDomSettings.builtIn,e.environment.modelToDomSettings.customized,r):(0,o.createModelToDomContextWithConfig)(e.environment.modelToDomSettings.calculated,l);s.onNodeCreated=i;var c=(0,o.contentModelToDom)(e.logicalRoot.ownerDocument,e.logicalRoot,t,s);return e.lifecycle.shadowEditFragment||(null===(a=e.cache.textMutationObserver)||void 0===a||a.flushMutations(!0),(0,n.updateCache)(e.cache,t,c),!(null==r?void 0:r.ignoreSelection)&&c?e.api.setDOMSelection(e,c):e.selection.selection=c),c}},2407:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addRangeToSelection=void 0;var n=r(480);t.addRangeToSelection=function(e,t,r){var o;void 0===r&&(r=!1);var i=null===(o=e.defaultView)||void 0===o?void 0:o.getSelection();if(i){var a=i.rangeCount>0&&i.getRangeAt(0);if(a&&(0,n.areSameRanges)(a,t))return;i.removeAllRanges(),r?i.setBaseAndExtent(t.endContainer,t.endOffset,t.startContainer,t.startOffset):i.addRange(t)}}},3211:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findLastedCoInMergedCell=void 0,t.findLastedCoInMergedCell=function(e,t){for(var r,n,o,i,a=t.row,l=t.col;a>=0&&l>=0&&a<e.length&&l<(null!==(n=null===(r=e[a])||void 0===r?void 0:r.length)&&void 0!==n?n:0);){var s=null===(o=e[a])||void 0===o?void 0:o[l+1],c=null===(i=e[a+1])||void 0===i?void 0:i[l];if("spanLeft"==s||"spanBoth"==s)l++;else{if("spanTop"!=c&&"spanBoth"!=c)return{row:a,col:l};a++}}return null}},8079:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findTableCellElement=void 0,t.findTableCellElement=function(e,t){for(var r,n,o,i=t.row,a=t.col;i>=0&&a>=0&&i<e.length&&a<(null!==(n=null===(r=e[i])||void 0===r?void 0:r.length)&&void 0!==n?n:0);){var l=null===(o=e[i])||void 0===o?void 0:o[a];if(!l)break;if("object"==typeof l)return{cell:l,row:i,col:a};"spanLeft"==l||"spanBoth"==l?a--:i--}return null}},1616:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setDOMSelection=void 0;var n=r(2407),o=r(480),i=r(9212),a=r(3211),l=r(8079),s=r(4990),c="_DOMSelection",d="_DOMSelectionHideCursor",u="_DOMSelectionHideSelection";function p(e,t,r){var o;if(t&&e.contains(t)){var i=e.createRange(),a=void 0;if(i.selectNode(t),r)i.collapse();else{var l=null===(o=e.defaultView)||void 0===o?void 0:o.getSelection(),s=l&&l.rangeCount>0&&l.getRangeAt(0);l&&s&&(a=l.focusNode!=s.endContainer||l.focusOffset!=s.endOffset)}(0,n.addRangeToSelection)(e,i,a)}}t.setDOMSelection=function(e,t,r){var f,m,g,h=e.api.getDOMSelection(e);if(!(h&&t&&(0,o.areSameSelections)(h,t))){var v=e.selection.skipReselectOnFocus,y=e.physicalRoot.ownerDocument,b=e.lifecycle.isDarkMode;e.selection.skipReselectOnFocus=!0,e.api.setEditorStyle(e,c,null),e.api.setEditorStyle(e,d,null),e.api.setEditorStyle(e,u,null);try{switch(null==t?void 0:t.type){case"image":var S=t.image;e.selection.selection=t;var C=b?e.selection.imageSelectionBorderColorDark:e.selection.imageSelectionBorderColor;e.api.setEditorStyle(e,c,"outline-style:solid!important; outline-color:"+(C||"#DB626C")+"!important;",[(0,s.getSafeIdSelector)((0,i.ensureUniqueId)(S,"image"))]),e.api.setEditorStyle(e,u,"background-color: transparent !important;",["*::selection"]),p(y,S,!1);break;case"table":var _=t.table,E=t.firstColumn,T=t.firstRow,k=t.lastColumn,M=t.lastRow,O=(0,s.parseTableCells)(t.table),P={row:Math.min(T,M),col:Math.min(E,k),cell:null},w={row:Math.max(T,M),col:Math.max(E,k)};if(P=(0,l.findTableCellElement)(O,P)||P,w=(0,a.findLastedCoInMergedCell)(O,w)||w,isNaN(P.row)||isNaN(P.col)||isNaN(w.row)||isNaN(w.col))return;t={type:"table",table:_,firstRow:P.row,firstColumn:P.col,lastRow:w.row,lastColumn:w.col};var x=(0,i.ensureUniqueId)(_,"table"),D=(0,s.getSafeIdSelector)(x),L=0==P.row&&0==P.col&&w.row==O.length-1&&w.col==(null!==(m=null===(f=O[w.row])||void 0===f?void 0:f.length)&&void 0!==m?m:0)-1?[D,D+" *"]:function(e,t,r,n,o){var i=[],a=0,l=(0,s.toArray)(r.childNodes).filter((function(e){return["THEAD","TBODY","TFOOT"].indexOf((0,s.isNodeOfType)(e,"ELEMENT_NODE")?e.tagName:"")>-1})).map((function(e){var t={el:e.tagName,start:a,end:e.childNodes.length+a};return a=t.end,t}));return e.forEach((function(e,r){for(var a=0,s=l.filter((function(e){return e.start<=r&&e.end>r}))[0],c=s?">"+s.el+">":">",d=s&&r+1>=s.start?r+1-s.start:r+1,u=0;u<e.length;u++){var p=e[u];if("object"==typeof p&&(a++,r>=n.row&&r<=o.row&&u>=n.col&&u<=o.col)){var f=""+t+c+" tr:nth-child("+d+")>"+p.tagName+":nth-child("+a+")";i.push(f,f+" *")}}})),i}(O,D,_,P,w);e.selection.selection=t;var I=b?e.selection.tableCellSelectionBackgroundColorDark:e.selection.tableCellSelectionBackgroundColor;e.api.setEditorStyle(e,c,"background-color:"+I+"!important;",L),e.api.setEditorStyle(e,d,"caret-color: transparent");var F=(null===(g=P.cell)||void 0===g?void 0:g.firstElementChild)||P.cell;F&&p(y,F||void 0,!0);break;case"range":(0,n.addRangeToSelection)(y,t.range,t.isReverted),e.selection.selection=e.domHelper.hasFocus()?null:t;break;default:e.selection.selection=null}}finally{e.selection.skipReselectOnFocus=v}if(!r){var R={eventType:"selectionChanged",newSelection:t};e.api.triggerEvent(e,R,!0)}}}},9212:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ensureUniqueId=void 0;var n=r(4990);t.ensureUniqueId=function(e,t){t=e.id||t;for(var r=e.ownerDocument,o=0;!e.id||r.querySelectorAll((0,n.getSafeIdSelector)(e.id)).length>1;)e.id=t+"_"+o++;return e.id}},2830:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setEditorStyle=void 0;var n=r(9212),o=r(4990);t.setEditorStyle=function(e,t,r,i,a){void 0===a&&(a=9e3);var l=e.lifecycle.styleElements[t];if(!l&&r){var s=e.physicalRoot.ownerDocument;l=s.createElement("style"),s.head.appendChild(l),l.dataset.roosterjsStyleKey=t,e.lifecycle.styleElements[t]=l}var c=null==l?void 0:l.sheet;if(c){for(var d=c.cssRules.length-1;d>=0;d--)c.deleteRule(d);if(r){var u=(0,o.getSafeIdSelector)((0,n.ensureUniqueId)(e.physicalRoot,"contentDiv")),p=i?"string"==typeof i?[u+"::"+i]:function(e,t,r){var n=[],o=[],i=0;return t.forEach((function(t){i>=r&&(n.push(o.join(",")),o=[],i=0);var a=e+" "+t;i+=a.length+1,o.push(a)})),n.push(o.join(",")),n}(u,i,a-r.length-3):[u];p.forEach((function(e){c.insertRule(e+" {"+r+"}")}))}}}},7832:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setLogicalRoot=void 0,t.setLogicalRoot=function(e,t){if(t&&!e.physicalRoot.contains(t))return null;if(t||(t=e.physicalRoot),t!==e.logicalRoot){e.logicalRoot.contentEditable="false",t.contentEditable="true",e.logicalRoot=t,e.selection.selection=null,e.cache.cachedModel=void 0,e.cache.cachedSelection=void 0;var r={eventType:"logicalRootChanged",logicalRoot:t};e.api.triggerEvent(e,r,!1)}}},6558:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchShadowEdit=void 0;var n=r(4990);t.switchShadowEdit=function(e,t){var r=e;if(t!=!!r.lifecycle.shadowEditFragment)if(t){var o=r.cache.cachedModel?null:r.api.createContentModel(r),i=r.logicalRoot.ownerDocument.createDocumentFragment(),a=r.logicalRoot.cloneNode(!0);(0,n.moveChildNodes)(i,a),r.api.triggerEvent(r,{eventType:"enteredShadowEdit"},!1),!r.cache.cachedModel&&o&&(r.cache.cachedModel=o),r.lifecycle.shadowEditFragment=i}else r.lifecycle.shadowEditFragment=null,r.api.triggerEvent(r,{eventType:"leavingShadowEdit"},!1),r.cache.cachedModel&&((0,n.iterateSelections)(r.cache.cachedModel,(function(){})),r.api.setContentModel(r,r.cache.cachedModel,{ignoreSelection:!0}))}},4486:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.triggerEvent=void 0;var r=["editorReady","beforeDispose","extractContentWithDom","zoomChanged"];t.triggerEvent=function(e,t,n){e.lifecycle.shadowEditFragment&&!(r.indexOf(t.eventType)>=0)||!n&&e.plugins.some((function(e){return function(e,t){var r;return!(!t.onPluginEvent||!(null===(r=t.willHandleEventExclusively)||void 0===r?void 0:r.call(t,e)))&&(t.onPluginEvent(e),!0)}(t,e)}))||e.plugins.forEach((function(e){e.onPluginEvent&&e.onPluginEvent(t)}))}},7014:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCachePlugin=void 0;var n=r(480),o=r(9213),i=r(9826),a=r(2994),l=function(){function e(e,t){var r=this;this.editor=null,this.onMutation=function(e){var t,n;if(r.editor)switch(e.type){case"childList":(null===(t=r.state.domIndexer)||void 0===t?void 0:t.reconcileChildList(e.addedNodes,e.removedNodes))||r.invalidateCache();break;case"text":r.updateCachedModel(r.editor,!0);break;case"elementId":var o=e.element;(null===(n=r.state.domIndexer)||void 0===n?void 0:n.reconcileElementId(o))||r.invalidateCache();break;case"unknown":r.invalidateCache()}},this.onNativeSelectionChange=function(){var e;(null===(e=r.editor)||void 0===e?void 0:e.hasFocus())&&r.updateCachedModel(r.editor)},this.state=e.disableCache?{}:{domIndexer:new i.DomIndexerImpl(e.experimentalFeatures&&e.experimentalFeatures.indexOf("PersistCache")>=0),textMutationObserver:(0,o.createTextMutationObserver)(t,this.onMutation)}}return e.prototype.getName=function(){return"Cache"},e.prototype.initialize=function(e){var t;this.editor=e,this.editor.getDocument().addEventListener("selectionchange",this.onNativeSelectionChange),null===(t=this.state.textMutationObserver)||void 0===t||t.startObserving()},e.prototype.dispose=function(){var e;null===(e=this.state.textMutationObserver)||void 0===e||e.stopObserving(),this.editor&&(this.editor.getDocument().removeEventListener("selectionchange",this.onNativeSelectionChange),this.editor=null)},e.prototype.getState=function(){return this.state},e.prototype.onPluginEvent=function(e){if(this.editor)switch(e.eventType){case"logicalRootChanged":this.invalidateCache(),this.state.textMutationObserver&&(this.state.textMutationObserver.stopObserving(),this.state.textMutationObserver=(0,o.createTextMutationObserver)(e.logicalRoot,this.onMutation),this.state.textMutationObserver.startObserving());break;case"keyDown":case"input":this.state.textMutationObserver||this.invalidateCache();break;case"selectionChanged":this.updateCachedModel(this.editor);break;case"contentChanged":var t=e.contentModel,r=e.selection;t&&this.state.domIndexer?(0,a.updateCache)(this.state,t,r):this.invalidateCache()}},e.prototype.invalidateCache=function(){var e;(null===(e=this.editor)||void 0===e?void 0:e.isInShadowEdit())||(this.state.cachedModel=void 0,this.state.cachedSelection=void 0)},e.prototype.updateCachedModel=function(e,t){var r;if(!e.isInShadowEdit()){var o=this.state.cachedSelection;this.state.cachedSelection=void 0;var i=e.getDOMSelection()||void 0,l=this.state.cachedModel;!t&&o&&i&&(0,n.areSameSelections)(i,o)?this.state.cachedSelection=o:l&&i&&(null===(r=this.state.domIndexer)||void 0===r?void 0:r.reconcileSelection(l,i,o))?(0,a.updateCache)(this.state,l,i):this.invalidateCache()}},e}();t.createCachePlugin=function(e,t){return new l(e,t)}},480:(e,t)=>{"use strict";function r(e,t,r){return r.every((function(r){return e[r]==t[r]}))}Object.defineProperty(t,"__esModule",{value:!0}),t.areSameRanges=t.areSameTableSelections=t.areSameSelections=void 0,t.areSameSelections=function(e,t){if(e==t)return!0;switch(e.type){case"image":return"image"==t.type&&t.image==e.image;case"table":return"table"==t.type&&i(e,t);default:if("range"==t.type){var r=e.range;if(t.start){var n=t.start,o=t.end;return r.startContainer==n.node&&r.endContainer==o.node&&r.startOffset==n.offset&&r.endOffset==o.offset}return a(r,t.range)}return!1}};var n=["table","firstColumn","lastColumn","firstRow","lastRow"],o=["startContainer","endContainer","startOffset","endOffset"];function i(e,t){return r(e,t,n)}function a(e,t){return r(e,t,o)}t.areSameTableSelections=i,t.areSameRanges=a},9826:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DomIndexerImpl=void 0;var n=r(1635),o=r(4990);function i(e){var t,r=null!==(t=e.__roosterjsContentModel)&&void 0!==t?t:{},n=r.paragraph,o=r.segments;return n&&"Paragraph"==n.blockType&&Array.isArray(n.segments)&&Array.isArray(o)}function a(e){return e&&i(e)?e.__roosterjsContentModel:null}function l(e){var t=e.__roosterjsContentModel,r=null==t?void 0:t.table;return"Table"==(null==r?void 0:r.blockType)&&Array.isArray(r.rows)&&r.rows.every((function(e){return Array.isArray(null==e?void 0:e.cells)&&e.cells.every((function(e){return"TableCell"==(null==e?void 0:e.blockGroupType)}))}))?t:null}var s=function(){function e(e){this.persistCache=e}return e.prototype.onSegment=function(e,t,r){e.__roosterjsContentModel={paragraph:t,segments:r}},e.prototype.onParagraph=function(e){for(var t=null,r=e.firstChild;r;r=r.nextSibling)if((0,o.isNodeOfType)(r,"TEXT_NODE"))if(t){var n=a(t);n&&i(r)&&(n.segments=n.segments.concat(r.__roosterjsContentModel.segments),r.__roosterjsContentModel.segments=[])}else t=r;else(0,o.isNodeOfType)(r,"ELEMENT_NODE")?(t=null,this.onParagraph(r)):t=null},e.prototype.onTable=function(e,t){e.__roosterjsContentModel={table:t}},e.prototype.onBlockEntity=function(e,t){this.onBlockEntityDelimiter(e.wrapper.previousSibling,e,t),this.onBlockEntityDelimiter(e.wrapper.nextSibling,e,t)},e.prototype.reconcileSelection=function(e,t,r){var n,s;switch(r&&("range"==r.type&&this.isCollapsed(r)&&(0,o.isNodeOfType)(r.start.node,"TEXT_NODE")&&i(r.start.node)?this.reconcileTextSelection(r.start.node):(0,o.setSelection)(e)),t.type){case"image":var c=a(t.image),d=null==c?void 0:c.segments[0];return!!d&&(d.isSelected=!0,(0,o.setSelection)(e,d),!0);case"table":var u=l(t.table);if(u){var p=null===(n=u.table.rows[t.firstRow])||void 0===n?void 0:n.cells[t.firstColumn],f=null===(s=u.table.rows[t.lastRow])||void 0===s?void 0:s.cells[t.lastColumn];if(p&&f)return(0,o.setSelection)(e,p,f),!0}return!1;case"range":var m=t.range;if(m){var g=m.startContainer,h=m.startOffset,v=m.endContainer,y=m.endOffset,b=m.collapsed;if(delete e.hasRevertedRangeSelection,b)return!!this.reconcileNodeSelection(g,h,e.format);if(g==v&&(0,o.isNodeOfType)(g,"TEXT_NODE"))return t.isReverted&&(e.hasRevertedRangeSelection=!0),i(g)&&!!this.reconcileTextSelection(g,h,y);var S=this.reconcileNodeSelection(g,h),C=this.reconcileNodeSelection(v,y);return!(!S||!C||(t.isReverted&&(e.hasRevertedRangeSelection=!0),(0,o.setSelection)(e,S,C),0))}}return!1},e.prototype.reconcileChildList=function(e,t){if(!this.persistCache)return!1;var r=!0,n={segIndex:-1},i=e[0];1==e.length&&(0,o.isNodeOfType)(i,"TEXT_NODE")?r=this.reconcileAddedNode(i,n):e.length>0&&(r=!1);var a=t[0];return r&&1==t.length?r=this.reconcileRemovedNode(a,n):t.length>0&&(r=!1),r&&!n.pendingTextNode},e.prototype.reconcileElementId=function(e){var t;if((0,o.isElementOfType)(e,"img")){var r=a(e);return"Image"==(null===(t=null==r?void 0:r.segments[0])||void 0===t?void 0:t.segmentType)&&(r.segments[0].format.id=e.id,!0)}if((0,o.isElementOfType)(e,"table")){var n=l(e);return!!n&&(n.table.format.id=e.id,!0)}return!1},e.prototype.onBlockEntityDelimiter=function(e,t,r){(0,o.isNodeOfType)(e,"ELEMENT_NODE")&&(0,o.isEntityDelimiter)(e)&&e.firstChild&&(e.firstChild.__roosterjsContentModel={entity:t,parent:r})},e.prototype.isCollapsed=function(e){var t=e.start,r=e.end;return t.node==r.node&&t.offset==r.offset},e.prototype.reconcileNodeSelection=function(e,t,r){return(0,o.isNodeOfType)(e,"TEXT_NODE")?i(e)?this.reconcileTextSelection(e,t):function(e){var t,r=null!==(t=e.__roosterjsContentModel)&&void 0!==t?t:{},n=r.entity,o=r.parent;return"Entity"==(null==n?void 0:n.blockType)&&n.wrapper&&(null==o?void 0:o.blockGroupType)&&Array.isArray(o.blocks)}(e)?this.reconcileDelimiterSelection(e,r):void 0:t>=e.childNodes.length?this.insertMarker(e.lastChild,!0):this.insertMarker(e.childNodes[t],!1)},e.prototype.insertMarker=function(e,t){var r,n=e&&a(e);if(n){var i=n.paragraph,l=n.segments,s=i.segments.indexOf(l[0]);if(s>=0){var c=!t&&i.segments[s-1]||i.segments[s];r=(0,o.createSelectionMarker)(c.format),i.segments.splice(t?s+1:s,0,r)}}return r},e.prototype.reconcileTextSelection=function(e,t,r){var i,a,l,s=e.__roosterjsContentModel,c=s.paragraph,d=s.segments,u=d[0],p=d[d.length-1];if("Text"==(null==u?void 0:u.segmentType)&&"Text"==(null==p?void 0:p.segmentType)){var f=[],m=e.nodeValue||"",g=[];if(void 0===t)u.text=m,f.push(u),g.push(u);else{if(t>0&&(u.text=m.substring(0,t),f.push(u),g.push(u)),void 0===r){var h=(0,o.createSelectionMarker)(u.format);f.push(h),l=h,r=t}else if(r>t){var v=(0,o.createText)(m.substring(t,r),u.format,u.link,u.code);v.isSelected=!0,f.push(v),g.push(v),l=v}if(r<m.length){var y=(0,o.createText)(m.substring(r),u.format,u.link,u.code);f.push(y),g.push(y)}}var b=c.segments.indexOf(u),S=c.segments.indexOf(p);if(b>=0&&S>=0){for(;b>0&&"SelectionMarker"==c.segments[b-1].segmentType;)b--;for(;S<c.segments.length-1&&"SelectionMarker"==c.segments[S+1].segmentType;)S++;(i=c.segments).splice.apply(i,(0,n.__spreadArray)([b,S-b+1],(0,n.__read)(f),!1))}this.onSegment(e,c,g),this.persistCache||delete c.cachedElement}else if("Entity"==(null==u?void 0:u.segmentType)&&u==p){var C=u.wrapper,_=c.segments.indexOf(u),E=e.parentElement,T=C.previousSibling==E,k=C.nextSibling==E;_>=0&&E&&(0,o.isEntityDelimiter)(E)&&(T||k)&&(h=(0,o.createSelectionMarker)((null!==(a=c.segments[k?_+1:_-1])&&void 0!==a?a:u).format),c.segments.splice(k?_+1:_,0,h),l=h)}return l},e.prototype.reconcileDelimiterSelection=function(e,t){var r,n=e.__roosterjsContentModel,i=n.entity,a=n.parent,l=a.blocks.indexOf(i),s=e.parentElement,c=i.wrapper,d=c.previousSibling==s,u=c.nextSibling==s;if(l>=0&&s&&(0,o.isEntityDelimiter)(s)&&(d||u)){r=(0,o.createSelectionMarker)(t);var p=(0,o.createParagraph)(!0,void 0,t);p.segments.push(r),a.blocks.splice(d?l:l+1,0,p)}return r},e.prototype.reconcileAddedNode=function(e,t){var r,n=null,o=-1,i=e.previousSibling,l=e.nextSibling;if((n=a(i))&&(r=n.segments[n.segments.length-1])&&(o=n.paragraph.segments.indexOf(r))>=0)this.indexNode(n.paragraph,o+1,e,r.format);else if((n=a(l))&&(r=n.segments[0])&&(o=n.paragraph.segments.indexOf(r))>=0)this.indexNode(n.paragraph,o,e,r.format);else if(t.paragraph&&t.segIndex>=0)this.indexNode(t.paragraph,t.segIndex,e,t.format);else{if(void 0!==t.pendingTextNode)return!1;t.pendingTextNode=e}return!0},e.prototype.reconcileRemovedNode=function(e,t){var r,n=null;if(t.segIndex<0&&!t.paragraph&&(n=a(e))&&(r=n.segments[0])){if(t.format=r.format,t.paragraph=n.paragraph,t.segIndex=n.paragraph.segments.indexOf(n.segments[0]),t.segIndex<0)return!1;for(var o=0;o<n.segments.length;o++){var i=n.paragraph.segments.indexOf(n.segments[o]);i>=0&&n.paragraph.segments.splice(i,1)}return t.pendingTextNode&&(this.indexNode(t.paragraph,t.segIndex,t.pendingTextNode,n.segments[0].format),t.pendingTextNode=null),!0}return!1},e.prototype.indexNode=function(e,t,r,i){var a,l=i?(0,n.__assign)({},i):void 0;l&&(0,o.getObjectKeys)(l).forEach((function(e){void 0===o.EmptySegmentFormat[e]&&delete l[e]}));var s=(0,o.createText)(null!==(a=r.textContent)&&void 0!==a?a:"",l);e.segments.splice(t,0,s),this.onSegment(r,e,[s])},e}();t.DomIndexerImpl=s},9213:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTextMutationObserver=void 0;var n=r(2233),o=r(4990),i=function(){function e(e,t){var r=this;this.contentDiv=e,this.onMutation=t,this.onMutationInternal=function(e){for(var t=!0,n=null,i=null,a=[],l=[],s=!1,c=new Set,d=new Set,u=0;u<e.length&&t;u++){var p=e[u],f=p.target;if(!c.has(f)){if(!d.has(f)){if((0,o.findClosestEntityWrapper)(f,r.domHelper)||(0,o.findClosestBlockEntityContainer)(f,r.domHelper)){c.add(f);continue}d.add(f)}switch(p.type){case"attributes":r.domHelper.isNodeInEditor(f,!0)&&("id"==p.attributeName&&(0,o.isNodeOfType)(f,"ELEMENT_NODE")?r.onMutation({type:"elementId",element:f}):t=!1);break;case"characterData":i&&i!=p.target?t=!1:(i=p.target,s=!0);break;case"childList":n?n!=p.target&&(t=!1):n=p.target,t&&(a=a.concat(Array.from(p.addedNodes)),l=l.concat(Array.from(p.removedNodes)))}}}t?((a.length>0||l.length>0)&&r.onMutation({type:"childList",addedNodes:a,removedNodes:l}),s&&r.onMutation({type:"text"})):r.onMutation({type:"unknown"})},this.observer=new MutationObserver(this.onMutationInternal),this.domHelper=(0,n.createDOMHelper)(e)}return e.prototype.startObserving=function(){this.observer.observe(this.contentDiv,{subtree:!0,childList:!0,attributes:!0,characterData:!0})},e.prototype.stopObserving=function(){this.observer.disconnect()},e.prototype.flushMutations=function(e){var t=this.observer.takeRecords();e||this.onMutationInternal(t)},e}();t.createTextMutationObserver=function(e,t){return new i(e,t)}},2994:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateCache=void 0,t.updateCache=function(e,t,r){if(e.cachedModel=t,"range"==(null==r?void 0:r.type)){var n=r.range,o=n.startContainer,i=n.startOffset,a=n.endContainer,l=n.endOffset,s=r.isReverted;e.cachedSelection={type:"range",isReverted:s,start:{node:o,offset:i},end:{node:a,offset:l}}}else e.cachedSelection=null!=r?r:void 0}},1330:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createContextMenuPlugin=void 0;var n=r(1635),o=r(4990),i=function(){function e(e){var t,r=this;this.editor=null,this.disposer=null,this.onContextMenuEvent=function(e){var t;if(r.editor){var o=[],i=e,a=2==i.button?i.target:r.getFocusedNode(r.editor);a&&r.state.contextMenuProviders.forEach((function(e){var t,r=null!==(t=e.getContextMenuItems(a))&&void 0!==t?t:[];(null==r?void 0:r.length)>0&&(o.length>0&&o.push(null),o.push.apply(o,(0,n.__spreadArray)([],(0,n.__read)(r),!1)))})),null===(t=r.editor)||void 0===t||t.triggerEvent("contextMenu",{rawEvent:i,items:o})}},this.state={contextMenuProviders:(null===(t=e.plugins)||void 0===t?void 0:t.filter(a))||[]}}return e.prototype.getName=function(){return"ContextMenu"},e.prototype.initialize=function(e){this.editor=e,this.disposer=this.editor.attachDomEvent({contextmenu:{beforeDispatch:this.onContextMenuEvent}})},e.prototype.dispose=function(){var e;null===(e=this.disposer)||void 0===e||e.call(this),this.disposer=null,this.editor=null},e.prototype.getState=function(){return this.state},e.prototype.getFocusedNode=function(e){var t=e.getDOMSelection();return t?("range"==t.type&&t.range.collapse(!0),(0,o.getSelectionRootNode)(t)||null):null},e}();function a(e){var t;return!!(null===(t=e)||void 0===t?void 0:t.getContextMenuItems)}t.createContextMenuPlugin=function(e){return new i(e)}},6818:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCopyPastePlugin=t.preprocessTable=t.onNodeCreated=t.adjustSelectionForCopyCut=void 0;var n=r(1635),o=r(2407),i=r(1993),a=r(8219),l=r(292),s=r(4990),c=function(){function e(e){var t=this;this.editor=null,this.disposer=null,this.onPaste=function(e){if(t.editor&&function(e){return!!e.clipboardData}(e)){var r=t.editor,n=e.clipboardData;(null==n?void 0:n.items)&&(e.preventDefault(),(0,s.extractClipboardItems)((0,s.toArray)(n.items),t.state.allowedCustomPasteType).then((function(e){r.isDisposed()||(0,l.paste)(r,e,t.state.defaultPasteType)})))}},this.state={allowedCustomPasteType:e.allowedCustomPasteType||[],tempDiv:null,defaultPasteType:e.defaultPasteType}}return e.prototype.getName=function(){return"CopyPaste"},e.prototype.initialize=function(e){var t=this;this.editor=e,this.disposer=this.editor.attachDomEvent({paste:{beforeDispatch:function(e){return t.onPaste(e)}},copy:{beforeDispatch:function(e){return t.onCutCopy(e,!1)}},cut:{beforeDispatch:function(e){return t.onCutCopy(e,!0)}}})},e.prototype.dispose=function(){var e;this.state.tempDiv&&(null===(e=this.state.tempDiv.parentNode)||void 0===e||e.removeChild(this.state.tempDiv),this.state.tempDiv=null),this.disposer&&this.disposer(),this.disposer=null,this.editor=null},e.prototype.getState=function(){return this.state},e.prototype.onCutCopy=function(e,r){var n,a=this;if(this.editor){var l=this.editor.getDocument(),c=this.editor.getDOMSelection();if(c&&("range"!=c.type||!c.range.collapsed)){var f=this.editor.getContentModelCopy("disconnected");"table"===c.type?(0,s.iterateSelections)(f,(function(e,t){return!!(null==t?void 0:t.table)&&(p(t.table),!0)})):"range"===c.type&&d(f);var m=this.getTempDiv(this.editor.getDocument()),g=(0,s.createModelToDomContext)();g.onNodeCreated=t.onNodeCreated;var h=(0,s.contentModelToDom)(m.ownerDocument,m,f,g),v=h?function(e,t){var r,n=null;if("table"===t.type){var o=t.table,i=1==(null===(r=o.parentElement)||void 0===r?void 0:r.childElementCount)?o.parentElement:o;(n=e.createRange()).selectNode(i)}else"image"===t.type?(n=e.createRange()).selectNode(t.image):n=t.range;return n}(l,h):null;v?((v=this.editor.triggerEvent("beforeCutCopy",{clonedRoot:m,range:v,rawEvent:e,isCut:r}).range)&&(0,o.addRangeToSelection)(l,v),null===(n=l.defaultView)||void 0===n||n.requestAnimationFrame((function(){a.editor&&(u(m),a.editor.setDOMSelection(c),a.editor.focus(),r&&a.editor.formatContentModel((function(e,t){return"range"==(0,s.deleteSelection)(e,[i.deleteEmptyList],t).deleteResult&&(0,s.normalizeContentModel)(e),!0}),{apiName:"cut",changeSource:s.ChangeSource.Cut}))}))):u(m)}}},e.prototype.getTempDiv=function(e){if(!this.state.tempDiv){var t=e.createElement("div");t.style.width="600px",t.style.height="1px",t.style.overflow="hidden",t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.userSelect="text",t.contentEditable="true",e.body.appendChild(t),this.state.tempDiv=t}var r=this.state.tempDiv;return r.style.backgroundColor="white",r.style.color="black",r.childNodes.forEach((function(e){return r.removeChild(e)})),r.style.display="",r.focus(),r},e}();function d(e){var t,r,n;(0,s.iterateSelections)(e,(function(e,o,i,a){if(t)return o!=n&&(null==r?void 0:r.segments.includes(t))&&r.segments.splice(r.segments.indexOf(t),1),!0;var l=null==a?void 0:a.find((function(e){return"SelectionMarker"==e.segmentType}));return!t&&l&&(n=o,r="Paragraph"==(null==i?void 0:i.blockType)?i:void 0,t=l),!1}))}function u(e){e.style.backgroundColor="",e.style.color="",e.style.display="none",(0,s.moveChildNodes)(e)}function p(e){var t=(0,s.getSelectedCells)(e);e.rows=e.rows.map((function(e){return(0,n.__assign)((0,n.__assign)({},e),{cells:e.cells.filter((function(e){return e.isSelected}))})})).filter((function(e){return e.cells.length>0})),delete e.format.width,e.widths=t?e.widths.filter((function(e,r){return r>=(null==t?void 0:t.firstColumn)&&r<=(null==t?void 0:t.lastColumn)})):[]}t.adjustSelectionForCopyCut=d,t.onNodeCreated=function(e,t){(0,s.isNodeOfType)(t,"ELEMENT_NODE")&&(0,s.isElementOfType)(t,"table")&&(0,s.wrap)(t.ownerDocument,t,"div"),(0,s.isNodeOfType)(t,"ELEMENT_NODE")&&!t.isContentEditable&&t.removeAttribute("contenteditable"),(0,a.onCreateCopyEntityNode)(e,t)},t.preprocessTable=p,t.createCopyPastePlugin=function(e){return new c(e)}},1993:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteEmptyList=void 0;var n=r(4990);function o(e){return e&&"Paragraph"==e.blockType?e.segments.every((function(e){return"SelectionMarker"!==e.segmentType&&"Br"==e.segmentType})):e&&"BlockGroup"==e.blockType?e.blocks.every(o):!!e}t.deleteEmptyList=function(e){var t=e.insertPoint;if("range"==e.deleteResult&&(null==t?void 0:t.path)){var r=(0,n.getClosestAncestorBlockGroupIndex)(t.path,["ListItem"],["TableCell"]),i=t.path[r];if(r>=0&&i&&"ListItem"==i.blockGroupType){var a=t.path[r+1].blocks.indexOf(i),l=a>-1?t.path[r+1].blocks[a-1]:void 0,s=a>-1?t.path[r+1].blocks[a+1]:void 0;(0,n.hasSelectionInBlockGroup)(i)&&(!l||(0,n.hasSelectionInBlock)(l))&&s&&o(s)&&((0,n.mutateBlock)(i).levels=[])}}}},4732:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEditorCorePlugins=void 0;var n=r(7014),o=r(1330),i=r(6818),a=r(4348),l=r(1858),s=r(6314),c=r(8118),d=r(8226),u=r(8656);t.createEditorCorePlugins=function(e,t){return{cache:(0,n.createCachePlugin)(e,t),format:(0,s.createFormatPlugin)(e),copyPaste:(0,i.createCopyPastePlugin)(e),domEvent:(0,a.createDOMEventPlugin)(e,t),lifecycle:(0,c.createLifecyclePlugin)(e,t),entity:(0,l.createEntityPlugin)(),selection:(0,d.createSelectionPlugin)(e),contextMenu:(0,o.createContextMenuPlugin)(e),undo:(0,u.createUndoPlugin)(e)}}},4348:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDOMEventPlugin=void 0;var n=r(4990),o={keydown:"keyDown",keyup:"keyUp",keypress:"keyPress"},i=function(){function e(e,t){var r=this;this.editor=null,this.disposer=null,this.onDragStart=function(e){var t=e,r=t.target,o=(0,n.isNodeOfType)(r,"ELEMENT_NODE")?r:r.parentElement;o&&!o.isContentEditable&&t.preventDefault()},this.onDrop=function(){var e,t,o=null===(e=r.editor)||void 0===e?void 0:e.getDocument();null===(t=null==o?void 0:o.defaultView)||void 0===t||t.requestAnimationFrame((function(){r.editor&&(r.editor.takeSnapshot(),r.editor.triggerEvent("contentChanged",{source:n.ChangeSource.Drop}))}))},this.onScroll=function(e){var t;null===(t=r.editor)||void 0===t||t.triggerEvent("scroll",{rawEvent:e,scrollContainer:r.state.scrollContainer})},this.keyboardEventHandler={beforeDispatch:function(e){var t=o[e.type];((0,n.isCharacterValue)(e)||(0,n.isCursorMovingKey)(e))&&e.stopPropagation(),r.editor&&t&&!e.isComposing&&!r.state.isInIME&&r.editor.triggerEvent(t,{rawEvent:e})}},this.inputEventHandler={beforeDispatch:function(e){e.stopPropagation(),!r.editor||e.isComposing||r.state.isInIME||r.editor.triggerEvent("input",{rawEvent:e})}},this.onMouseDown=function(e){r.editor&&(r.state.mouseUpEventListerAdded||(r.editor.getDocument().addEventListener("mouseup",r.onMouseUp,!0),r.state.mouseUpEventListerAdded=!0,r.state.mouseDownX=e.pageX,r.state.mouseDownY=e.pageY),r.editor.triggerEvent("mouseDown",{rawEvent:e}))},this.onMouseUp=function(e){r.editor&&(r.removeMouseUpEventListener(),r.editor.triggerEvent("mouseUp",{rawEvent:e,isClicking:r.state.mouseDownX==e.pageX&&r.state.mouseDownY==e.pageY}))},this.onCompositionStart=function(){r.state.isInIME=!0},this.onCompositionEnd=function(e){var t;r.state.isInIME=!1,null===(t=r.editor)||void 0===t||t.triggerEvent("compositionEnd",{rawEvent:e})},this.state={isInIME:!1,scrollContainer:e.scrollContainer||t,mouseDownX:null,mouseDownY:null,mouseUpEventListerAdded:!1}}return e.prototype.getName=function(){return"DOMEvent"},e.prototype.initialize=function(e){var t,r;this.editor=e;var n=this.editor.getDocument(),o={keypress:this.keyboardEventHandler,keydown:this.keyboardEventHandler,keyup:this.keyboardEventHandler,input:this.inputEventHandler,mousedown:{beforeDispatch:this.onMouseDown},compositionstart:{beforeDispatch:this.onCompositionStart},compositionend:{beforeDispatch:this.onCompositionEnd},dragstart:{beforeDispatch:this.onDragStart},drop:{beforeDispatch:this.onDrop}};this.disposer=this.editor.attachDomEvent(o),this.state.scrollContainer.addEventListener("scroll",this.onScroll),null===(t=n.defaultView)||void 0===t||t.addEventListener("scroll",this.onScroll),null===(r=n.defaultView)||void 0===r||r.addEventListener("resize",this.onScroll)},e.prototype.dispose=function(){var e,t,r,n;this.removeMouseUpEventListener();var o=null===(e=this.editor)||void 0===e?void 0:e.getDocument();null===(t=null==o?void 0:o.defaultView)||void 0===t||t.removeEventListener("resize",this.onScroll),null===(r=null==o?void 0:o.defaultView)||void 0===r||r.removeEventListener("scroll",this.onScroll),this.state.scrollContainer.removeEventListener("scroll",this.onScroll),null===(n=this.disposer)||void 0===n||n.call(this),this.disposer=null,this.editor=null},e.prototype.getState=function(){return this.state},e.prototype.removeMouseUpEventListener=function(){this.editor&&this.state.mouseUpEventListerAdded&&(this.state.mouseUpEventListerAdded=!1,this.editor.getDocument().removeEventListener("mouseup",this.onMouseUp,!0))},e}();t.createDOMEventPlugin=function(e,t){return new i(e,t)}},1858:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEntityPlugin=void 0;var n=r(9677),o=r(4990),i=r(9531),a=/_(\d{1,8})$/,l=function(){function e(){this.editor=null,this.state={entityMap:{}}}return e.prototype.getName=function(){return"Entity"},e.prototype.initialize=function(e){this.editor=e},e.prototype.dispose=function(){this.editor=null,this.state.entityMap={}},e.prototype.getState=function(){return this.state},e.prototype.onPluginEvent=function(e){if(this.editor)switch(e.eventType){case"mouseUp":this.handleMouseUpEvent(this.editor,e);break;case"contentChanged":this.handleContentChangedEvent(this.editor,e);break;case"keyDown":(0,i.handleDelimiterKeyDownEvent)(this.editor,e);break;case"compositionEnd":(0,i.handleCompositionEndEvent)(this.editor,e);break;case"editorReady":this.handleContentChangedEvent(this.editor);break;case"extractContentWithDom":this.handleExtractContentWithDomEvent(this.editor,e.clonedRoot)}},e.prototype.handleMouseUpEvent=function(e,t){var r=t.rawEvent,n=t.isClicking,i=r.target;if(n&&this.editor)for(;i&&this.editor.getDOMHelper().isNodeInEditor(i);){if((0,o.isEntityElement)(i)){this.triggerEvent(e,i,"click",r);break}i=i.parentNode}},e.prototype.handleContentChangedEvent=function(e,t){var r,n=this,a=null!==(r=null==t?void 0:t.changedEntities)&&void 0!==r?r:this.getChangedEntities(e),l=null==t?void 0:t.entityStates;a.forEach((function(t){var r=t.entity,i=t.operation,a=t.rawEvent,l=r.entityFormat,s=l.id,c=l.entityType,d=l.isFakeEntity,u=r.wrapper;if(c&&!d)if("newEntity"==i){r.entityFormat.id=n.ensureUniqueId(c,null!=s?s:"",u),u.className=(0,o.generateEntityClassNames)(r.entityFormat),r.entityFormat.isReadonly&&(u.contentEditable="false");var p=n.triggerEvent(e,u,i,a);n.state.entityMap[r.entityFormat.id]={element:u,canPersist:null==p?void 0:p.shouldPersist},e.isDarkMode()&&(0,o.transformColor)(u,!0,"lightToDark",e.getColorManager())}else if(s){var f=n.state.entityMap[s];f&&(f.isDeleted=!0),n.triggerEvent(e,u,i,a)}})),null==l||l.forEach((function(t){var r,o=t.id,i=t.state,a=null===(r=n.state.entityMap[o])||void 0===r?void 0:r.element;a&&n.triggerEvent(e,a,"updateEntityState",void 0,i)})),(0,i.handleDelimiterContentChangedEvent)(e)},e.prototype.getChangedEntities=function(e){var t=this,r=[];return e.formatContentModel((function(e){return(0,n.findAllEntities)(e,r),!1})),(0,o.getObjectKeys)(this.state.entityMap).forEach((function(e){var n=t.state.entityMap[e];if(!n.isDeleted){var i=r.findIndex((function(t){return"newEntity"==t.operation&&t.entity.entityFormat.id==e&&t.entity.wrapper==n.element}));if(i>=0)r.splice(i,1);else{var a=(0,o.parseEntityFormat)(n.element);if(!a.isFakeEntity){var l=(0,o.createEntity)(n.element,a.isReadonly,{},a.entityType,a.id);r.push({entity:l,operation:"overwrite"})}}}})),r},e.prototype.handleExtractContentWithDomEvent=function(e,t){var r=this;(0,o.getAllEntityWrappers)(t).forEach((function(t){t.removeAttribute("contentEditable"),r.triggerEvent(e,t,"replaceTemporaryContent")}))},e.prototype.triggerEvent=function(e,t,r,n,i){var a=(0,o.parseEntityFormat)(t);return a.id&&a.entityType&&!a.isFakeEntity?e.triggerEvent("entityOperation",{operation:r,rawEvent:n,entity:{id:a.id,type:a.entityType,isReadonly:!!a.isReadonly,wrapper:t},state:"updateEntityState"==r?i:void 0,shouldPersist:"newEntity"==r||void 0}):null},e.prototype.ensureUniqueId=function(e,t,r){for(var n=a.exec(t),o=(n?t.substr(0,t.length-n[0].length):t)||e,i="",l=n&&parseInt(n[1])||0;;l++){i=l>0?o+"_"+l:o;var s=this.state.entityMap[i];if(!s||s.element==r)break}return i},e}();t.createEntityPlugin=function(){return new l}},6125:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.adjustSelectionAroundEntity=void 0;var n=r(1635),o=r(4990);t.adjustSelectionAroundEntity=function(e,t,r){var i,a=e.isDisposed()?null:e.getDOMSelection();if(a&&"range"==a.type){var l=a.range,s=a.isReverted,c=s?l.startContainer:l.endContainer,d=s?l.startOffset:l.endOffset,u=(0,o.isNodeOfType)(c,"ELEMENT_NODE")?c:c.parentElement,p="ArrowLeft"==t!=!(!u||"rtl"!=(null===(i=e.getDocument().defaultView)||void 0===i?void 0:i.getComputedStyle(u).direction));u&&((0,o.isEntityDelimiter)(u,!p)&&(p&&0==d||!p&&1==d)||(0,o.isBlockEntityContainer)(u))&&e.formatContentModel((function(t){var i,a,c=(0,o.getSelectedSegmentsAndParagraphs)(t,!1,!0),d=c[s?0:c.length-1],u=null!==(a=null===(i=null==d?void 0:d[1])||void 0===i?void 0:i.segments.indexOf(d[0]))&&void 0!==a?a:-1;if(d&&d[1]&&u>=0){var f=(0,n.__read)(d,3),m=f[0],g=f[1],h=f[2],v=r&&!l.collapsed&&p!=!!s,y=function(e,t,r,n){var i=null;if("Entity"==(null==e?void 0:e.segmentType))i=e;else{var a=t[0].blocks,l=a.indexOf(r),s=l>=0?a[n?l-1:l+1]:null;"Entity"==(null==s?void 0:s.blockType)&&(i=s)}var c=i?n?i.wrapper.previousElementSibling:i.wrapper.nextElementSibling:null;return(0,o.isNodeOfType)(c,"ELEMENT_NODE")&&(0,o.isEntityDelimiter)(c,n)?c:null}(v?m:g.segments[p?u-1:u+1],h,g,p);if(y){var b=function(e,t,r,n,o){var i=e.cloneRange();return t?r?i.setEndBefore(n):i.setStartAfter(n):(r?i.setStartBefore(n):i.setEndAfter(n),o||(r?i.setEndBefore(n):i.setStartAfter(n))),i}(l,v,p,y,r);e.setDOMSelection({type:"range",range:b,isReverted:!b.collapsed&&s})}}return!1}))}}},9531:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleEnterInlineEntity=t.handleKeyDownInBlockDelimiter=t.handleDelimiterKeyDownEvent=t.handleCompositionEndEvent=t.handleDelimiterContentChangedEvent=t.preventTypeInDelimiter=void 0;var n=r(1635),o=r(6125),i=r(7104),a=r(4990),l="entityDelimiterBefore",s="entityDelimiterAfter",c="."+s+",."+l,d="​";function u(e,t){var r=e.classList.contains(s)?e.previousElementSibling:e.nextElementSibling;r&&(0,a.isEntityElement)(r)&&(p([r.previousElementSibling,r.nextElementSibling].filter((function(e){return!!e}))),t.formatContentModel((function(e,t){return(0,a.iterateSelections)(e,(function(e,t,r,n){"Paragraph"==(null==r?void 0:r.blockType)&&r.segments.forEach((function(e){"Text"==e.segmentType&&e.text.indexOf(d)>=0&&(0,a.mutateSegment)(r,e,(function(e){e.text=e.text.replace(d,"")}))}))})),t.skipUndoSnapshot=!0,!0})))}function p(e){e.forEach((function(e){var t,r;if((0,a.isNodeOfType)(e,"ELEMENT_NODE"))if((0,a.isEntityDelimiter)(e)){var n=e.classList.contains(l)?e.nextElementSibling:e.previousElementSibling;(0,a.isNodeOfType)(n,"ELEMENT_NODE")&&(0,a.isEntityElement)(n)||null===(r=null==(t=e)?void 0:t.parentElement)||void 0===r||r.removeChild(t)}else!function(e,t){if(void 0===t&&(t=!0),e){var r=e.classList.contains(s)?e.previousElementSibling:e.nextElementSibling;t&&r&&(0,a.isEntityElement)(r)||(e.classList.remove(s,l),e.normalize(),e.childNodes.forEach((function(e){var t,r,n=null!==(r=null===(t=e.textContent)||void 0===t?void 0:t.indexOf(d))&&void 0!==r?r:-1;if(n>=0){var o=new Range;o.setStart(e,n),o.setEnd(e,n+1),o.deleteContents()}})))}}(e)}))}function f(e,t){var r,n,o,l,s,u=e.range,p=e.isReverted,f=p?u.startContainer:u.endContainer,m=p?u.startOffset:u.endOffset;if(f){var g=(0,i.normalizePos)(f,m);f=g.node,m=g.offset}if((0,a.isNodeOfType)(f,"ELEMENT_NODE"))f=f.childNodes.length==m?f:f.childNodes.item(m);else{var h=t?d+t:d;f=f.textContent!=h&&(f.textContent||"").length==m?null!==(o=null!==(r=f.nextSibling)&&void 0!==r?r:null===(n=f.parentElement)||void 0===n?void 0:n.closest(c))&&void 0!==o?o:null:null!==(s=null===(l=null==f?void 0:f.parentElement)||void 0===l?void 0:l.closest(c))&&void 0!==s?s:null}return f&&!f.hasChildNodes()&&(f=f.nextSibling),(0,a.isNodeOfType)(f,"ELEMENT_NODE")?f:null}function m(e,r,n,o){var i,l=e.getDOMHelper();if(n&&(0,a.isEntityDelimiter)(n)&&l.isNodeInEditor(n)){var c=(0,a.findClosestBlockEntityContainer)(n,l),d="Enter"===o.key;c&&l.isNodeInEditor(c)?(n.classList.contains(s)?r.setStartAfter(c):r.setStartBefore(c),r.collapse(!0),d&&o.preventDefault(),e.formatContentModel(t.handleKeyDownInBlockDelimiter,{selectionOverride:{type:"range",isReverted:!1,range:r}})):d?(o.preventDefault(),e.formatContentModel(t.handleEnterInlineEntity)):(e.takeSnapshot(),null===(i=e.getDocument().defaultView)||void 0===i||i.requestAnimationFrame((function(){return u(n,e)})))}}t.preventTypeInDelimiter=u,t.handleDelimiterContentChangedEvent=function(e){var t=e.getDOMHelper();p(t.queryElements(c)),function(e,t){if(e.length>0){var r=(0,a.createModelToDomContext)();e.forEach((function(e){(0,a.isNodeOfType)(e,"ELEMENT_NODE")&&(0,a.isEntityElement)(e)&&!e.isContentEditable&&(0,a.addDelimiters)(e.ownerDocument,e,t,r)}))}}(t.queryElements("span._Entity"),e.getPendingFormat())},t.handleCompositionEndEvent=function(e,t){var r=e.getDOMSelection();if("range"==(null==r?void 0:r.type)&&r.range.collapsed){var n=f(r,t.rawEvent.data);(null==n?void 0:n.firstChild)&&(0,a.isNodeOfType)(n.firstChild,"TEXT_NODE")&&n.matches(c)&&n.textContent==d+t.rawEvent.data&&u(n,e)}},t.handleDelimiterKeyDownEvent=function(e,t){var r,n=e.getDOMSelection();if(n&&"range"==n.type){var i=t.rawEvent,l=n.range,s=i.key;switch(s){case"Enter":if(l.collapsed)m(e,l,f(n),i);else{var c=e.getDOMHelper(),d=(0,a.findClosestEntityWrapper)(l.startContainer,c);d&&(0,a.isNodeOfType)(d,"ELEMENT_NODE")&&c.isNodeInEditor(d)&&g(e,d,i)}break;case"ArrowLeft":case"ArrowRight":i.altKey||i.ctrlKey||i.metaKey||null===(r=e.getDocument().defaultView)||void 0===r||r.requestAnimationFrame((function(){(0,o.adjustSelectionAroundEntity)(e,s,i.shiftKey)}));break;default:(0,a.isCharacterValue)(i)&&l.collapsed&&m(e,l,f(n),i)}}},t.handleKeyDownInBlockDelimiter=function(e,t){return(0,a.iterateSelections)(e,(function(e,r,o){if("Paragraph"==(null==o?void 0:o.blockType)){var i=(0,a.mutateBlock)(o);delete i.isImplicit;var l=i.segments.find((function(e){return"SelectionMarker"==e.segmentType}));"SelectionMarker"==(null==l?void 0:l.segmentType)&&(i.segmentFormat=(0,n.__assign)({},l.format),t.newPendingFormat=(0,n.__assign)({},l.format)),i.segments.unshift((0,a.createBr)())}})),!0},t.handleEnterInlineEntity=function(e){var t,r,o;if((0,a.iterateSelections)(e,(function(e,t,n){"Paragraph"==(null==n?void 0:n.blockType)&&(r=n,o=e[e.length-1])})),r&&o){var i=r.segments.findIndex((function(e){return"SelectionMarker"==e.segmentType}));if(i>=0){var l=(0,a.mutateBlock)(r),s=l.segments.splice(i),c=(0,a.createParagraph)(!1,l.format,l.segmentFormat,l.decorator);(l.segments.every((function(e){return"SelectionMarker"==e.segmentType||"Br"==e.segmentType}))||s.every((function(e){return"SelectionMarker"==e.segmentType})))&&c.segments.push((0,a.createBr)(l.format)),(t=c.segments).push.apply(t,(0,n.__spreadArray)([],(0,n.__read)(s),!1));var d=o.blocks.indexOf(l);d>=0&&(0,a.mutateBlock)(o).blocks.splice(d+1,0,c)}}return!0};var g=function(e,t,r){var n=(0,a.parseEntityFormat)(t);n.id&&n.entityType&&!n.isFakeEntity&&e.triggerEvent("entityOperation",{operation:"click",entity:{id:n.id,type:n.entityType,isReadonly:!!n.isReadonly,wrapper:t},rawEvent:r})}},9677:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findAllEntities=void 0,t.findAllEntities=function e(t,r){t.blocks.forEach((function(t){switch(t.blockType){case"BlockGroup":e(t,r);break;case"Entity":r.push({entity:t,operation:"newEntity"});break;case"Paragraph":t.segments.forEach((function(t){switch(t.segmentType){case"Entity":r.push({entity:t,operation:"newEntity"});break;case"General":e(t,r)}}));break;case"Table":t.rows.forEach((function(t){return t.cells.forEach((function(t){return e(t,r)}))}))}}))}},6314:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFormatPlugin=void 0;var n=r(1635),o=r(3104),i=r(3354),a=r(4990),l={backgroundColor:"backgroundColor",textColor:"color",fontFamily:"fontFamily",fontSize:"fontSize"},s=function(){function e(e){var t=this;this.editor=null,this.lastCheckedNode=null,this.state={defaultFormat:(0,n.__assign)({},e.defaultSegmentFormat),pendingFormat:null},this.defaultFormatKeys=new Set,(0,a.getObjectKeys)(l).forEach((function(e){t.state.defaultFormat[e]&&t.defaultFormatKeys.add(l[e])}))}return e.prototype.getName=function(){return"Format"},e.prototype.initialize=function(e){this.editor=e},e.prototype.dispose=function(){this.editor=null},e.prototype.getState=function(){return this.state},e.prototype.onPluginEvent=function(e){if(this.editor)switch(e.eventType){case"input":case"compositionEnd":this.checkAndApplyPendingFormat(e.rawEvent.data);break;case"keyDown":var t=this.editor.getEnvironment().isAndroid&&"Unidentified"==e.rawEvent.key;(0,a.isCursorMovingKey)(e.rawEvent)?(this.clearPendingFormat(),this.lastCheckedNode=null):this.defaultFormatKeys.size>0&&(t||(0,a.isCharacterValue)(e.rawEvent)||"Process"==e.rawEvent.key)&&this.shouldApplyDefaultFormat(this.editor)&&(0,o.applyDefaultFormat)(this.editor,this.state.defaultFormat);break;case"mouseUp":case"contentChanged":this.lastCheckedNode=null,this.canApplyPendingFormat()||this.clearPendingFormat()}},e.prototype.checkAndApplyPendingFormat=function(e){this.editor&&e&&this.state.pendingFormat&&((0,i.applyPendingFormat)(this.editor,e,this.state.pendingFormat.format),this.clearPendingFormat())},e.prototype.clearPendingFormat=function(){this.state.pendingFormat=null},e.prototype.canApplyPendingFormat=function(){var e=!1;if(this.state.pendingFormat&&this.editor){var t=this.editor.getDOMSelection(),r="range"==(null==t?void 0:t.type)&&t.range.collapsed?t.range:null,n=this.state.pendingFormat.insertPoint,o=n.node,i=n.offset;r&&r.startContainer==o&&r.startOffset==i&&(e=!0)}return e},e.prototype.shouldApplyDefaultFormat=function(e){var t,r,n=e.getDOMSelection(),o="range"==(null==n?void 0:n.type)?n.range:null,i=null!==(t=null==o?void 0:o.startContainer)&&void 0!==t?t:null;if(i&&i!=this.lastCheckedNode){this.lastCheckedNode=i;for(var l=e.getDOMHelper(),s=(0,a.isNodeOfType)(i,"ELEMENT_NODE")?i:i.parentElement,c=new Set,d=function(){if(null===(r=s.getAttribute)||void 0===r?void 0:r.call(s,"style")){var e=s.style;if(u.defaultFormatKeys.forEach((function(t){e[t]&&c.add(t)})),c.size==u.defaultFormatKeys.size)return{value:!1}}if((0,a.isBlockElement)(s))return"break";s=s.parentElement},u=this;(null==s?void 0:s.parentElement)&&l.isNodeInEditor(s.parentElement);){var p=d();if("object"==typeof p)return p.value;if("break"===p)break}return!0}return!1},e}();t.createFormatPlugin=function(e){return new s(e)}},3104:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyDefaultFormat=void 0;var n=r(1635),o=r(4990);function i(e,t,r){return(0,n.__assign)((0,n.__assign)((0,n.__assign)({},t),e.getPendingFormat()),r)}t.applyDefaultFormat=function(e,t){e.formatContentModel((function(r,n){var a=(0,o.deleteSelection)(r,[],n);if("range"==a.deleteResult)return(0,o.normalizeContentModel)(r),e.takeSnapshot(),!0;if("notDeleted"==a.deleteResult&&a.insertPoint){var l=a.insertPoint,s=l.paragraph,c=l.path,d=l.marker,u=c[0].blocks,p=u.length,f=u.indexOf(s);if(s.isImplicit&&1==s.segments.length&&s.segments[0]==d&&p>0&&f==p-1){var m=u[f-1];"Paragraph"!=(null==m?void 0:m.blockType)&&(n.newPendingFormat=i(e,t,d.format))}else s.segments.every((function(e){return"Text"!=e.segmentType}))&&(n.newPendingFormat=i(e,t,d.format))}return!1}))}},3354:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyPendingFormat=void 0;var n=r(1635),o=r(4990);t.applyPendingFormat=function(e,t,r){var i=!1;e.formatContentModel((function(e,a){return(0,o.iterateSelections)(e,(function(e,a,l,s){if("Paragraph"==(null==l?void 0:l.blockType)&&1==(null==s?void 0:s.length)&&"SelectionMarker"==s[0].segmentType){var c=s[0],d=l.segments.indexOf(c),u=l.segments[d-1];if("Text"==(null==u?void 0:u.segmentType)){var p=u.text,f=p.substr(-t.length,t.length);(f==t||" "==t&&" "==f)&&((0,o.mutateSegment)(l,u,(function(e){e.text=p.substring(0,p.length-t.length)})),(0,o.mutateSegment)(l,c,(function(e,i){e.format=(0,n.__assign)({},r);var a=(0,o.createText)(" "==t?" ":t,(0,n.__assign)((0,n.__assign)({},u.format),r));i.segments.splice(d,0,a),(0,o.setParagraphNotImplicit)(i)})),i=!0)}}return!0})),i&&((0,o.normalizeContentModel)(e),a.skipUndoSnapshot=!0),i}),{apiName:"applyPendingFormat"})}},8118:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLifecyclePlugin=void 0;var n=r(4990),o=r(1782),i="contenteditable",a=function(){function e(e,t){var r=this;this.editor=null,this.initializer=null,this.disposer=null,null===t.getAttribute(i)&&(this.initializer=function(){t.contentEditable="true",t.style.userSelect="text"},this.disposer=function(){t.style.userSelect="",t.removeAttribute(i)}),this.adjustColor=e.doNotAdjustEditorColor?function(){}:function(){r.adjustContainerColor(t)},this.state={isDarkMode:!!e.inDarkMode,shadowEditFragment:null,styleElements:{},announcerStringGetter:e.announcerStringGetter}}return e.prototype.getName=function(){return"Lifecycle"},e.prototype.initialize=function(e){var t;this.editor=e,null===(t=this.initializer)||void 0===t||t.call(this),this.adjustColor(),this.editor.triggerEvent("editorReady",{},!0),this.state.announceContainer=(0,o.createAriaLiveElement)(e.getDocument())},e.prototype.dispose=function(){var e,t,r=this;null===(e=this.editor)||void 0===e||e.triggerEvent("beforeDispose",{},!0),(0,n.getObjectKeys)(this.state.styleElements).forEach((function(e){var t,n=r.state.styleElements[e];null===(t=n.parentElement)||void 0===t||t.removeChild(n),delete r.state.styleElements[e]}));var o=this.state.announceContainer;o&&(null===(t=o.parentElement)||void 0===t||t.removeChild(o),delete this.state.announceContainer),this.disposer&&(this.disposer(),this.disposer=null,this.initializer=null),this.editor=null},e.prototype.getState=function(){return this.state},e.prototype.onPluginEvent=function(e){"contentChanged"!=e.eventType||e.source!=n.ChangeSource.SwitchToDarkMode&&e.source!=n.ChangeSource.SwitchToLightMode||this.adjustColor()},e.prototype.adjustContainerColor=function(e){if(this.editor){var t=this.state.isDarkMode,r=this.editor.getColorManager();(0,n.setColor)(e,"#000000",!1,t,r),(0,n.setColor)(e,"#ffffff",!0,t,r)}},e}();t.createLifecyclePlugin=function(e,t){return new a(e,t)}},8226:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionPlugin=t.DEFAULT_TABLE_CELL_SELECTION_BACKGROUND_COLOR=t.DEFAULT_SELECTION_BORDER_COLOR=void 0;var n=r(6630),o=r(8079),i=r(9219),a=r(7104),l=r(4990),s="ArrowUp",c="ArrowDown",d="ArrowLeft",u="ArrowRight";t.DEFAULT_SELECTION_BORDER_COLOR="#DB626C",t.DEFAULT_TABLE_CELL_SELECTION_BACKGROUND_COLOR="#C6C6C6";var p=function(){function e(e){var r,o,a=this;this.editor=null,this.disposer=null,this.isSafari=!1,this.isMac=!1,this.scrollTopCache=0,this.onMouseMove=function(e){var t,r,o;if(a.editor&&a.state.tableSelection){var i=!!a.state.tableSelection.lastCo,s=e.target,c=a.editor.getDOMHelper(),d=a.editor.getDocument().createRange(),u=a.state.tableSelection.startNode,p=s.compareDocumentPosition(u)==Node.DOCUMENT_POSITION_FOLLOWING;p?(d.setStart(s,0),d.setEnd(u,(0,l.isNodeOfType)(u,"TEXT_NODE")?null!==(r=null===(t=u.nodeValue)||void 0===t?void 0:t.length)&&void 0!==r?r:0:u.childNodes.length)):(d.setStart(u,0),d.setEnd(s,0));var f=d.commonAncestorContainer,m=a.parseTableSelection(f,u,c);if(m){var g=(0,n.findCoordinate)(m.parsedTable,s,c);m.table!=a.state.tableSelection.table&&(a.state.tableSelection=m,a.state.tableSelection.lastCo=null!=g?g:void 0);var h=g&&a.updateTableSelection(g);(i||h)&&e.preventDefault()}else"table"==(null===(o=a.editor.getDOMSelection())||void 0===o?void 0:o.type)&&a.setDOMSelection({type:"range",range:d,isReverted:p},a.state.tableSelection)}},this.onDrop=function(){a.detachMouseEvent()},this.getContainedTargetImage=function(e,t){if(!a.isMac||!t||"image"!==t.type)return null;var r=e.target;return(0,l.isNodeOfType)(r,"ELEMENT_NODE")&&(0,l.isElementOfType)(r,"span")&&r.firstChild===t.image?t.image:null},this.onFocus=function(){var e;!a.state.skipReselectOnFocus&&a.state.selection&&a.setDOMSelection(a.state.selection,a.state.tableSelection),"range"!=(null===(e=a.state.selection)||void 0===e?void 0:e.type)||a.isSafari||(a.state.selection=null),a.scrollTopCache&&a.editor&&(a.editor.getScrollContainer().scrollTop=a.scrollTopCache,a.scrollTopCache=0)},this.onBlur=function(){if(a.editor){a.state.selection||(a.state.selection=a.editor.getDOMSelection());var e=a.editor.getScrollContainer();a.scrollTopCache=e.scrollTop}},this.onSelectionChange=function(){var e;if((null===(e=a.editor)||void 0===e?void 0:e.hasFocus())&&!a.editor.isInShadowEdit()){var t=a.editor.getDOMSelection(),r=a.editor.getDocument().getSelection();if("image"==(null==t?void 0:t.type)&&r&&r.focusNode&&!(0,i.isSingleImageInSelection)(r)){var n=r.getRangeAt(0);a.editor.setDOMSelection({type:"range",range:n,isReverted:r.focusNode!=n.endContainer||r.focusOffset!=n.endOffset})}"range"==(null==t?void 0:t.type)&&a.isSafari&&(a.state.selection=t)}},this.state={selection:null,tableSelection:null,imageSelectionBorderColor:null!==(r=e.imageSelectionBorderColor)&&void 0!==r?r:t.DEFAULT_SELECTION_BORDER_COLOR,imageSelectionBorderColorDark:e.imageSelectionBorderColor?void 0:t.DEFAULT_SELECTION_BORDER_COLOR,tableCellSelectionBackgroundColor:null!==(o=e.tableCellSelectionBackgroundColor)&&void 0!==o?o:t.DEFAULT_TABLE_CELL_SELECTION_BACKGROUND_COLOR,tableCellSelectionBackgroundColorDark:e.tableCellSelectionBackgroundColor?void 0:t.DEFAULT_TABLE_CELL_SELECTION_BACKGROUND_COLOR}}return e.prototype.getName=function(){return"Selection"},e.prototype.initialize=function(e){this.editor=e,!this.state.imageSelectionBorderColorDark&&this.state.imageSelectionBorderColor&&(this.state.imageSelectionBorderColorDark=e.getColorManager().getDarkColor(this.state.imageSelectionBorderColor,void 0,"border")),!this.state.tableCellSelectionBackgroundColorDark&&this.state.tableCellSelectionBackgroundColor&&(this.state.tableCellSelectionBackgroundColorDark=e.getColorManager().getDarkColor(this.state.tableCellSelectionBackgroundColor,void 0,"background"));var t=this.editor.getEnvironment(),r=this.editor.getDocument();this.isSafari=!!t.isSafari,this.isMac=!!t.isMac,r.addEventListener("selectionchange",this.onSelectionChange),this.isSafari?this.disposer=this.editor.attachDomEvent({focus:{beforeDispatch:this.onFocus},drop:{beforeDispatch:this.onDrop}}):this.disposer=this.editor.attachDomEvent({focus:{beforeDispatch:this.onFocus},blur:{beforeDispatch:this.onBlur},drop:{beforeDispatch:this.onDrop}})},e.prototype.dispose=function(){var e;null===(e=this.editor)||void 0===e||e.getDocument().removeEventListener("selectionchange",this.onSelectionChange),this.disposer&&(this.disposer(),this.disposer=null),this.detachMouseEvent(),this.editor=null},e.prototype.getState=function(){return this.state},e.prototype.onPluginEvent=function(e){if(this.editor)switch(e.eventType){case"mouseDown":this.onMouseDown(this.editor,e.rawEvent);break;case"mouseUp":this.onMouseUp(this.editor,e);break;case"keyDown":this.onKeyDown(this.editor,e.rawEvent);break;case"contentChanged":this.state.tableSelection=null;break;case"scroll":this.editor.hasFocus()||(this.scrollTopCache=e.scrollContainer.scrollTop)}},e.prototype.onMouseDown=function(e,t){var r,o,i,a,l=e.getDOMSelection();if(e.isExperimentalFeatureEnabled("LegacyImageSelection")){if(2===t.button&&(i=null!==(r=this.getClickingImage(t))&&void 0!==r?r:this.getContainedTargetImage(t,l))&&i.isContentEditable)return void this.selectImageWithRange(i,t);if("image"==(null==l?void 0:l.type)&&l.image!==t.target)return void this.selectBeforeOrAfterElement(e,l.image)}else if("image"!=(null==l?void 0:l.type)||0!=t.button&&(2!=t.button||this.getClickingImage(t)||this.getContainedTargetImage(t,l))||this.setDOMSelection(null,null),(i=null!==(o=this.getClickingImage(t))&&void 0!==o?o:this.getContainedTargetImage(t,l))&&i.isContentEditable)return void this.setDOMSelection({type:"image",image:i},null);"table"==(null==l?void 0:l.type)&&0==t.button&&this.setDOMSelection(null,null);var s=t.target;if(s&&0==t.button&&(a=this.parseTableSelection(s,s,e.getDOMHelper()))){if(this.state.tableSelection=a,t.detail>=3){var c=(0,n.findCoordinate)(a.parsedTable,t.target,e.getDOMHelper());c&&(a.lastCo=c,this.updateTableSelection(c),t.preventDefault())}this.state.mouseDisposer=e.attachDomEvent({mousemove:{beforeDispatch:this.onMouseMove}})}},e.prototype.selectImageWithRange=function(e,t){var r,n=e.ownerDocument.createRange();n.selectNode(e);var o=null===(r=this.editor)||void 0===r?void 0:r.getDOMSelection();"image"==(null==o?void 0:o.type)&&e==o.image?t.preventDefault():this.setDOMSelection({type:"range",isReverted:!1,range:n},null)},e.prototype.onMouseUp=function(e,t){var r;e.isExperimentalFeatureEnabled("LegacyImageSelection")&&(r=this.getClickingImage(t.rawEvent))&&r.isContentEditable&&1!=t.rawEvent.button&&(2==t.rawEvent.button||t.isClicking)&&this.selectImageWithRange(r,t.rawEvent),this.detachMouseEvent()},e.prototype.onKeyDown=function(e,t){var r,n=this,o=t.key,i=e.getDOMSelection(),a=e.getDocument().defaultView;switch(null==i?void 0:i.type){case"image":if((0,l.isModifierKey)(t)||t.shiftKey||!i.image.parentNode||("Escape"===o?(this.selectBeforeOrAfterElement(e,i.image),t.stopPropagation()):"Delete"!==o&&"Backspace"!==o&&this.selectBeforeOrAfterElement(e,i.image)),((0,l.isModifierKey)(t)||t.shiftKey)&&i.image&&!this.isSafari){var p=i.image.ownerDocument.createRange();p.selectNode(i.image),this.setDOMSelection({type:"range",range:p,isReverted:!1},null)}break;case"range":if(o==s||o==c||o==d||o==u||"Tab"==o){var f=i.range.startContainer;this.state.tableSelection=this.parseTableSelection(f,f,e.getDOMHelper()),this.state.tableSelection&&!t.defaultPrevented&&("Tab"==o?(this.handleSelectionInTable(this.getTabKey(t)),t.preventDefault()):null==a||a.requestAnimationFrame((function(){return n.handleSelectionInTable(o)})))}break;case"table":if(null===(r=this.state.tableSelection)||void 0===r?void 0:r.lastCo){var m=t.shiftKey,g=t.key;if(!m||g!=d&&g!=u)!m||g!=s&&g!=c?"Shift"==g||(0,l.isCharacterValue)(t)||g!=s&&g!=c&&g!=d&&g!=u||(this.setDOMSelection(null,this.state.tableSelection),null==a||a.requestAnimationFrame((function(){return n.handleSelectionInTable(g)}))):(this.updateTableSelectionFromKeyboard(g==s?-1:1,0),t.preventDefault());else{var h="rtl"==(null==a?void 0:a.getComputedStyle(this.state.tableSelection.table).direction);this.updateTableSelectionFromKeyboard(0,(g==d?-1:1)*(h?-1:1)),t.preventDefault()}}}},e.prototype.getTabKey=function(e){return e.shiftKey?"TabLeft":"TabRight"},e.prototype.handleSelectionInTable=function(e){var t,r,i,a,l,d;if(this.editor&&this.state.tableSelection){var u=this.editor.getDOMSelection(),p=this.editor.getDOMHelper();if("range"==(null==u?void 0:u.type)){var f=u.range,m=f.collapsed,g=f.startContainer,h=f.endContainer,v=f.commonAncestorContainer,y=u.isReverted,b=y?h:g,S=y?g:h,C=this.parseTableSelection(v,b,p);if(!C)return;var _=(0,n.findCoordinate)(null==C?void 0:C.parsedTable,S,p),E=!1,T=this.state.tableSelection,k=T.parsedTable,M=T.firstCo,O=T.table;if(_&&C.table==O){if(_.col==M.col||e!=s&&e!=c)if("TabLeft"==e||"TabRight"==e)for(var P="TabLeft"==e,w=P?-1:1,x=null!==(i=_.row)&&void 0!==i?i:0,D=(null!==(a=_.col)&&void 0!==a?a:0)+w;;D+=w){if(D<0||D>=k[x].length){if((x+=w)<0){this.selectBeforeOrAfterElement(this.editor,C.table);break}if(x>=k.length){this.selectBeforeOrAfterElement(this.editor,C.table,!0);break}D=P?k[x].length-1:0}var L=k[x][D];if("string"!=typeof L){E=!0,this.setRangeSelectionInTable(L,0,this.editor,!0),_.row=x,_.col=D;break}}else this.state.tableSelection=null;else{var I=e==s?-1:1,F=null===(t=(0,o.findTableCellElement)(k,M))||void 0===t?void 0:t.cell,R=null;for(_={row:M.row+I,col:M.col};_.row>=0&&_.row<k.length&&(R=(null===(r=(0,o.findTableCellElement)(k,_))||void 0===r?void 0:r.cell)||null)==F;)_.row+=I;m&&R?this.setRangeSelectionInTable(R,e==s?R.childNodes.length:0,this.editor):!R&&(-1==_.row||_.row<=k.length)&&this.selectBeforeOrAfterElement(this.editor,O,1==I,1!=I)}m&&(_.col!=M.col||_.row!=M.row)&&_.row>=0&&_.row==k.length-1&&_.col==(null===(l=k[_.row])||void 0===l?void 0:l.length)-1&&(null===(d=this.editor)||void 0===d||d.announce({defaultStrings:"announceOnFocusLastCell"}))}m||!_||E||(this.state.tableSelection=C,this.updateTableSelection(_))}}},e.prototype.setRangeSelectionInTable=function(e,t,r,n){var o=r.getDocument().createRange();if(n&&e.firstChild&&e.lastChild){var i=e.firstChild,l=e.lastChild,s=(0,a.normalizePos)(i,0),c=(0,a.normalizePos)(l,l.childNodes.length);o.setStart(s.node,s.offset),o.setEnd(c.node,c.offset)}else{var d=(0,a.normalizePos)(e,t),u=d.node,p=d.offset;o.setStart(u,p),o.collapse(!0)}this.setDOMSelection({type:"range",range:o,isReverted:!1},null)},e.prototype.updateTableSelectionFromKeyboard=function(e,t){var r;if((null===(r=this.state.tableSelection)||void 0===r?void 0:r.lastCo)&&this.editor){var n=this.state.tableSelection,o=n.lastCo,i=n.parsedTable,a=o.row+e,l=o.col+t;a>=0&&a<i.length&&l>=0&&l<i[a].length&&this.updateTableSelection({row:a,col:l})}},e.prototype.selectBeforeOrAfterElement=function(e,t,r,n){var o,i=e.getDocument(),a=t.parentNode,s=a&&(0,l.toArray)(a.childNodes).indexOf(t);if(a&&null!==s&&s>=0){var c=i.createRange();n&&(o=r?t.nextElementSibling:t.previousElementSibling)&&(0,l.isNodeOfType)(o,"ELEMENT_NODE")?(c.selectNodeContents(o),c.collapse(!1)):(c.setStart(a,s+(r?1:0)),c.collapse()),this.setDOMSelection({type:"range",range:c,isReverted:!1},null)}},e.prototype.getClickingImage=function(e){var t=e.target;return(0,l.isNodeOfType)(t,"ELEMENT_NODE")&&(0,l.isElementOfType)(t,"img")?t:null},e.prototype.parseTableSelection=function(e,t,r){var o,i,a;return(o=r.findClosestElementAncestor(e,"table"))&&o.isContentEditable&&(i=(0,l.parseTableCells)(o))&&(a=(0,n.findCoordinate)(i,t,r))?{table:o,parsedTable:i,firstCo:a,startNode:t}:null},e.prototype.updateTableSelection=function(e){if(this.state.tableSelection&&this.editor){var t=this.state.tableSelection,r=t.table,n=t.firstCo,o=t.parsedTable,i=t.startNode;if(t.lastCo||n.row!=e.row||n.col!=e.col)return this.state.tableSelection.lastCo=e,this.setDOMSelection({type:"table",table:r,firstRow:n.row,firstColumn:n.col,lastRow:e.row,lastColumn:e.col},{table:r,firstCo:n,lastCo:e,parsedTable:o,startNode:i}),!0}return!1},e.prototype.setDOMSelection=function(e,t){var r;null===(r=this.editor)||void 0===r||r.setDOMSelection(e),this.state.tableSelection=t},e.prototype.detachMouseEvent=function(){this.state.mouseDisposer&&(this.state.mouseDisposer(),this.state.mouseDisposer=void 0)},e}();t.createSelectionPlugin=function(e){return new p(e)}},6630:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findCoordinate=void 0,t.findCoordinate=function(e,t,r){var n=r.findClosestElementAncestor(t,"TH,TD"),o=null;return n&&e.some((function(e,t){var r=n?e.indexOf(n):-1;return o=r>=0?{row:t,col:r}:null})),o||e.some((function(e,r){var n=e.findIndex((function(e){return"object"==typeof e&&e.contains(t)}));return o=n>=0?{row:r,col:n}:null})),o}},9219:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSingleImageInSelection=void 0;var n=r(4990);t.isSingleImageInSelection=function(e){var t=function(e){return function(e){return!!e.getRangeAt}(e)?{startNode:e.anchorNode,endNode:e.focusNode,startOffset:e.anchorOffset,endOffset:e.focusOffset}:{startNode:e.startContainer,endNode:e.endContainer,startOffset:e.startOffset,endOffset:e.endOffset}}(e),r=t.startNode,o=t.endNode,i=t.startOffset,a=t.endOffset,l=Math.max(i,a),s=Math.min(i,a);if(r&&o&&r==o&&l-s==1){var c=null==r?void 0:r.childNodes.item(s);if((0,n.isNodeOfType)(c,"ELEMENT_NODE")&&(0,n.isElementOfType)(c,"img"))return c}return null}},7104:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizePos=void 0;var n=r(4990),o=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];t.normalizePos=function(e,t){var r,i,a,l,s=(0,n.isNodeOfType)(e,"TEXT_NODE")?null!==(i=null===(r=e.nodeValue)||void 0===r?void 0:r.length)&&void 0!==i?i:0:e.childNodes.length;for(t=Math.max(Math.min(t,s),0);null==e?void 0:e.lastChild;)if(t>=e.childNodes.length)e=e.lastChild,t=(0,n.isNodeOfType)(e,"TEXT_NODE")?null!==(l=null===(a=e.nodeValue)||void 0===a?void 0:a.length)&&void 0!==l?l:0:e.childNodes.length;else{var c=e.childNodes[t];if((0,n.isNodeOfType)(c,"ELEMENT_NODE")&&o.indexOf(c.tagName)>=0)break;e=e.childNodes[t],t=0}return{node:e,offset:t}}},9299:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSnapshotsManager=void 0;var r=function(){function e(e){this.hasNewContentValue=!1,this.snapshots=null!=e?e:{snapshots:[],totalSize:0,currentIndex:-1,autoCompleteIndex:-1,maxSize:1e7}}return Object.defineProperty(e.prototype,"hasNewContent",{get:function(){return this.hasNewContentValue},set:function(e){this.hasNewContentValue=e},enumerable:!1,configurable:!0}),e.prototype.canMove=function(e){var t=this.snapshots.currentIndex+e;return t>=0&&t<this.snapshots.snapshots.length},e.prototype.move=function(e){var t,r,n=null;return this.canMove(e)&&(this.snapshots.currentIndex+=e,this.snapshots.autoCompleteIndex=-1,n=this.snapshots.snapshots[this.snapshots.currentIndex]),null===(r=(t=this.snapshots).onChanged)||void 0===r||r.call(t,"move"),n},e.prototype.addSnapshot=function(e,t){var r,n,o=this.snapshots.snapshots[this.snapshots.currentIndex],i=o&&o.html==e.html&&!o.entityStates&&!e.entityStates,a=!o||function(e,t){return e.html!==t.html||e.entityStates&&t.entityStates&&e.entityStates!==t.entityStates||!e.entityStates&&t.entityStates}(o,e);if(this.snapshots.currentIndex<0||a){this.clearRedo(),this.snapshots.snapshots.push(e),this.snapshots.currentIndex++,this.snapshots.totalSize+=this.getSnapshotLength(e);for(var l=0;l<this.snapshots.snapshots.length&&this.snapshots.totalSize>this.snapshots.maxSize;)this.snapshots.totalSize-=this.getSnapshotLength(this.snapshots.snapshots[l]),l++;l>0&&(this.snapshots.snapshots.splice(0,l),this.snapshots.currentIndex-=l,this.snapshots.autoCompleteIndex>=0&&(this.snapshots.autoCompleteIndex-=l)),t&&(this.snapshots.autoCompleteIndex=this.snapshots.currentIndex)}else i&&this.snapshots.snapshots.splice(this.snapshots.currentIndex,1,e);null===(n=(r=this.snapshots).onChanged)||void 0===n||n.call(r,"add")},e.prototype.clearRedo=function(){var e,t;if(this.canMove(1)){for(var r=0,n=this.snapshots.currentIndex+1;n<this.snapshots.snapshots.length;n++)r+=this.getSnapshotLength(this.snapshots.snapshots[n]);this.snapshots.snapshots.splice(this.snapshots.currentIndex+1),this.snapshots.totalSize-=r,this.snapshots.autoCompleteIndex=-1,null===(t=(e=this.snapshots).onChanged)||void 0===t||t.call(e,"clear")}},e.prototype.canUndoAutoComplete=function(){return this.snapshots.autoCompleteIndex>=0&&this.snapshots.currentIndex-this.snapshots.autoCompleteIndex==1},e.prototype.getSnapshotLength=function(e){var t,r;return null!==(r=null===(t=e.html)||void 0===t?void 0:t.length)&&void 0!==r?r:0},e}();t.createSnapshotsManager=function(e){return new r(e)}},8656:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUndoPlugin=void 0;var n=r(4990),o=r(9299),i=r(674),a="Backspace",l="Delete",s="Enter",c=function(){function e(e){this.editor=null,this.state={snapshotsManager:(0,o.createSnapshotsManager)(e.snapshots),isRestoring:!1,isNested:!1,autoCompleteInsertPoint:null,lastKeyPress:null}}return e.prototype.getName=function(){return"Undo"},e.prototype.initialize=function(e){this.editor=e},e.prototype.dispose=function(){this.editor=null},e.prototype.getState=function(){return this.state},e.prototype.willHandleEventExclusively=function(e){return!!this.editor&&"keyDown"==e.eventType&&e.rawEvent.key==a&&!e.rawEvent.ctrlKey&&this.canUndoAutoComplete(this.editor)},e.prototype.onPluginEvent=function(e){if(this.editor)switch(e.eventType){case"editorReady":var t=this.state.snapshotsManager,r=t.hasNewContent||t.canMove(-1),n=t.canMove(1);r||n||this.addUndoSnapshot();break;case"keyDown":this.onKeyDown(this.editor,e.rawEvent);break;case"keyPress":this.onKeyPress(this.editor,e.rawEvent);break;case"compositionEnd":this.clearRedoForInput(),this.addUndoSnapshot();break;case"contentChanged":this.onContentChanged(e);break;case"beforeKeyboardEditing":this.onBeforeKeyboardEditing(e.rawEvent);break;case"mouseDown":this.state.snapshotsManager.hasNewContent&&this.addUndoSnapshot()}},e.prototype.onKeyDown=function(e,t){var r=this.state.snapshotsManager;if(t.key==a&&!t.altKey||t.key==l){if(t.key==a&&!t.ctrlKey&&this.canUndoAutoComplete(e))t.preventDefault(),(0,i.undo)(e),this.state.autoCompleteInsertPoint=null,this.state.lastKeyPress=t.key;else if(!t.defaultPrevented){var o=e.getDOMSelection();!o||"range"==o.type&&o.range.collapsed&&this.state.lastKeyPress==t.key&&!this.isCtrlOrMetaPressed(e,t)||this.addUndoSnapshot(),r.hasNewContent=!0,this.state.lastKeyPress=t.key}}else(0,n.isCursorMovingKey)(t)?(r.hasNewContent&&this.addUndoSnapshot(),this.state.lastKeyPress=null):this.state.lastKeyPress!=a&&this.state.lastKeyPress!=l||r.hasNewContent&&this.addUndoSnapshot()},e.prototype.onKeyPress=function(e,t){if(!t.metaKey){var r=e.getDOMSelection();r&&("range"!=r.type||!r.range.collapsed)||" "==t.key&&" "!=this.state.lastKeyPress||t.key==s?(this.addUndoSnapshot(),t.key==s&&(this.state.snapshotsManager.hasNewContent=!0)):this.clearRedoForInput(),this.state.lastKeyPress=t.key}},e.prototype.onBeforeKeyboardEditing=function(e){e.key!=this.state.lastKeyPress&&this.addUndoSnapshot(),this.state.lastKeyPress=e.key,this.state.snapshotsManager.hasNewContent=!0},e.prototype.onContentChanged=function(e){this.state.isRestoring||e.source==n.ChangeSource.SwitchToDarkMode||e.source==n.ChangeSource.SwitchToLightMode||e.source==n.ChangeSource.Keyboard||this.clearRedoForInput()},e.prototype.clearRedoForInput=function(){this.state.snapshotsManager.clearRedo(),this.state.lastKeyPress=null,this.state.snapshotsManager.hasNewContent=!0},e.prototype.canUndoAutoComplete=function(e){var t,r=e.getDOMSelection();return this.state.snapshotsManager.canUndoAutoComplete()&&"range"==(null==r?void 0:r.type)&&r.range.collapsed&&r.range.startContainer==(null===(t=this.state.autoCompleteInsertPoint)||void 0===t?void 0:t.node)&&r.range.startOffset==this.state.autoCompleteInsertPoint.offset},e.prototype.addUndoSnapshot=function(){var e;null===(e=this.editor)||void 0===e||e.takeSnapshot(),this.state.autoCompleteInsertPoint=null},e.prototype.isCtrlOrMetaPressed=function(e,t){return e.getEnvironment().isMac?t.metaKey:t.ctrlKey},e}();t.createUndoPlugin=function(e){return new c(e)}},3550:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Editor=void 0;var n=r(1635),o=r(3901),i=r(4990),a=function(){function e(e,t){var r,n=this;void 0===t&&(t={}),this.core=null,this.cloneOptionCallback=function(e,t){if("cache"!=t){var r=e.cloneNode(!0);if(n.isDarkMode()){var o=n.getColorManager();(0,i.transformColor)(r,!0,"darkToLight",o),r.style.color=r.style.color||"inherit",r.style.backgroundColor=r.style.backgroundColor||"inherit"}return r}},this.core=(0,o.createEditorCore)(e,t);var a=null!==(r=t.initialModel)&&void 0!==r?r:(0,i.createEmptyModel)(t.defaultSegmentFormat);this.core.api.setContentModel(this.core,a,{ignoreSelection:!0}),this.core.plugins.forEach((function(e){return e.initialize(n)}))}return e.prototype.dispose=function(){for(var e,t=this.getCore(),r=t.plugins.length-1;r>=0;r--){var n=t.plugins[r];try{n.dispose()}catch(r){null===(e=t.disposeErrorHandler)||void 0===e||e.call(t,n,r)}}t.darkColorHandler.reset(),this.core=null},e.prototype.isDisposed=function(){return!this.core},e.prototype.getContentModelCopy=function(e){var t=this.getCore();switch(e){case"connected":case"disconnected":return(0,i.cloneModel)(t.api.createContentModel(t,{processorOverride:{table:i.tableProcessor},tryGetFromCache:!1}),{includeCachedElement:this.cloneOptionCallback});case"clean":var r=(0,i.createDomToModelContextWithConfig)(t.environment.domToModelSettings.calculated,t.api.createEditorContext(t,!1));return(0,i.cloneModel)((0,i.domToContentModel)(t.physicalRoot,r),{includeCachedElement:this.cloneOptionCallback})}},e.prototype.getEnvironment=function(){return this.getCore().environment},e.prototype.getDOMSelection=function(){var e=this.getCore();return e.api.getDOMSelection(e)},e.prototype.setDOMSelection=function(e){var t=this.getCore();t.api.setDOMSelection(t,e)},e.prototype.setLogicalRoot=function(e){var t=this.getCore();t.api.setLogicalRoot(t,e)},e.prototype.formatContentModel=function(e,t,r){var n=this.getCore();n.api.formatContentModel(n,e,t,r)},e.prototype.getPendingFormat=function(){var e,t;return null!==(t=null===(e=this.getCore().format.pendingFormat)||void 0===e?void 0:e.format)&&void 0!==t?t:null},e.prototype.getDOMHelper=function(){return this.getCore().domHelper},e.prototype.takeSnapshot=function(e){var t=this.getCore();return t.api.addUndoSnapshot(t,!1,e?[e]:void 0)},e.prototype.restoreSnapshot=function(e){var t=this.getCore();t.api.restoreUndoSnapshot(t,e)},e.prototype.getDocument=function(){return this.getCore().physicalRoot.ownerDocument},e.prototype.focus=function(){var e=this.getCore();e.api.focus(e)},e.prototype.hasFocus=function(){return this.getCore().domHelper.hasFocus()},e.prototype.triggerEvent=function(e,t,r){void 0===r&&(r=!1);var o=this.getCore(),i=(0,n.__assign)({eventType:e},t);return o.api.triggerEvent(o,i,r),i},e.prototype.attachDomEvent=function(e){var t=this.getCore();return t.api.attachDomEvent(t,e)},e.prototype.getSnapshotsManager=function(){return this.getCore().undo.snapshotsManager},e.prototype.isDarkMode=function(){return this.getCore().lifecycle.isDarkMode},e.prototype.setDarkModeState=function(e){var t=this.getCore();!!e!=t.lifecycle.isDarkMode&&((0,i.transformColor)(t.physicalRoot,!1,e?"lightToDark":"darkToLight",t.darkColorHandler),t.lifecycle.isDarkMode=!!e,t.api.triggerEvent(t,{eventType:"contentChanged",source:e?i.ChangeSource.SwitchToDarkMode:i.ChangeSource.SwitchToLightMode},!0))},e.prototype.isInShadowEdit=function(){return!!this.getCore().lifecycle.shadowEditFragment},e.prototype.startShadowEdit=function(){var e=this.getCore();e.api.switchShadowEdit(e,!0)},e.prototype.stopShadowEdit=function(){var e=this.getCore();e.api.switchShadowEdit(e,!1)},e.prototype.getColorManager=function(){return this.getCore().darkColorHandler},e.prototype.getTrustedHTMLHandler=function(){return this.getCore().trustedHTMLHandler},e.prototype.getScrollContainer=function(){return this.getCore().domEvent.scrollContainer},e.prototype.getVisibleViewport=function(){return this.getCore().api.getVisibleViewport(this.getCore())},e.prototype.setEditorStyle=function(e,t,r){var n=this.getCore();n.api.setEditorStyle(n,e,t,r)},e.prototype.announce=function(e){var t=this.getCore();t.api.announce(t,e)},e.prototype.isExperimentalFeatureEnabled=function(e){return this.getCore().experimentalFeatures.indexOf(e)>=0},e.prototype.getCore=function(){if(!this.core)throw new Error("Editor is already disposed");return this.core},e}();t.Editor=a},2233:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDOMHelper=void 0;var n=r(4990),o=function(){function e(e){this.contentDiv=e}return e.prototype.queryElements=function(e){return(0,n.toArray)(this.contentDiv.querySelectorAll(e))},e.prototype.getTextContent=function(){return this.contentDiv.textContent||""},e.prototype.isNodeInEditor=function(e,t){return(!t||e!=this.contentDiv)&&this.contentDiv.contains(e)},e.prototype.calculateZoomScale=function(){var e,t=(null===(e=this.contentDiv.getBoundingClientRect())||void 0===e?void 0:e.width)||0,r=this.contentDiv.offsetWidth;return r>0&&t>0?Math.round(t/r*100)/100:1},e.prototype.setDomAttribute=function(e,t){null===t?this.contentDiv.removeAttribute(e):this.contentDiv.setAttribute(e,t)},e.prototype.getDomAttribute=function(e){return this.contentDiv.getAttribute(e)},e.prototype.getDomStyle=function(e){return this.contentDiv.style[e]},e.prototype.findClosestElementAncestor=function(e,t){var r=(0,n.isNodeOfType)(e,"ELEMENT_NODE")?e:e.parentElement,o=t?null==r?void 0:r.closest(t):r;return o&&this.isNodeInEditor(o)&&o!=this.contentDiv?o:null},e.prototype.hasFocus=function(){var e=this.contentDiv.ownerDocument.activeElement;return!(!e||!this.contentDiv.contains(e))},e.prototype.isRightToLeft=function(){var e,t=this.contentDiv,r=null===(e=t.ownerDocument.defaultView)||void 0===e?void 0:e.getComputedStyle(t);return"rtl"==(null==r?void 0:r.direction)},e.prototype.getClientWidth=function(){var e,t=this.contentDiv,r=null===(e=t.ownerDocument.defaultView)||void 0===e?void 0:e.getComputedStyle(t),o=(0,n.parseValueWithUnit)(null==r?void 0:r.paddingLeft),i=(0,n.parseValueWithUnit)(null==r?void 0:r.paddingRight);return this.contentDiv.clientWidth-(o+i)},e}();t.createDOMHelper=function(e){return new o(e)}},4416:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDarkColorHandler=void 0;var n=r(4990),o=function(){function e(e,t,r,n){this.root=e,this.getDarkColor=t,this.knownColors=r,this.generateColorKey=n}return e.prototype.updateKnownColor=function(e,t,r){var n=this;t&&r?(this.knownColors[t]||(this.knownColors[t]=r),e&&this.root.style.setProperty(t,r.darkModeColor)):e&&Object.keys(this.knownColors).forEach((function(e){n.root.style.setProperty(e,n.knownColors[e].darkModeColor)}))},e.prototype.reset=function(){var e=this;Object.keys(this.knownColors).forEach((function(t){e.root.style.removeProperty(t)}))},e}();t.createDarkColorHandler=function(e,t,r,i){return void 0===r&&(r={}),void 0===i&&(i=n.defaultGenerateColorKey),new o(e,t,r,i)}},3901:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDarkColorFallback=t.defaultTrustHtmlHandler=t.createEditorCore=void 0;var n=r(1635),o=r(4694),i=r(4416),a=r(2233),l=r(9092),s=r(4732);function c(e,t){var r,n,o,i=null===(r=e.ownerDocument.defaultView)||void 0===r?void 0:r.navigator,a=null!==(n=null==i?void 0:i.userAgent)&&void 0!==n?n:"",s=null!==(o=null==i?void 0:i.appVersion)&&void 0!==o?o:"";return{domToModelSettings:(0,l.createDomToModelSettings)(t),modelToDomSettings:(0,l.createModelToDomSettings)(t),isMac:-1!=s.indexOf("Mac"),isAndroid:/android/i.test(a),isSafari:a.indexOf("Safari")>=0&&a.indexOf("Chrome")<0&&a.indexOf("Android")<0,isMobileOrTablet:d(a)}}function d(e){return!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substring(0,4)))}function u(e){return e}function p(e){return e}t.createEditorCore=function(e,t){var r,l,d=(0,s.createEditorCorePlugins)(t,e);return(0,n.__assign)((0,n.__assign)({physicalRoot:e,logicalRoot:e,api:(0,n.__assign)((0,n.__assign)({},o.coreApiMap),t.coreApiOverride),originalApi:(0,n.__assign)({},o.coreApiMap),plugins:(0,n.__spreadArray)((0,n.__spreadArray)([d.cache,d.format,d.copyPaste,d.domEvent,d.selection,d.entity],(0,n.__read)((null!==(r=t.plugins)&&void 0!==r?r:[]).filter((function(e){return!!e}))),!1),[d.undo,d.contextMenu,d.lifecycle],!1),environment:c(e,t),darkColorHandler:(0,i.createDarkColorHandler)(e,null!==(l=t.getDarkColor)&&void 0!==l?l:p,t.knownColors,t.generateColorKey),trustedHTMLHandler:t.trustedHTMLHandler||u,domHelper:(0,a.createDOMHelper)(e)},function(e){return{domEvent:e.domEvent.getState(),copyPaste:e.copyPaste.getState(),cache:e.cache.getState(),format:e.format.getState(),lifecycle:e.lifecycle.getState(),entity:e.entity.getState(),selection:e.selection.getState(),contextMenu:e.contextMenu.getState(),undo:e.undo.getState()}}(d)),{disposeErrorHandler:t.disposeErrorHandler,experimentalFeatures:t.experimentalFeatures?(0,n.__spreadArray)([],(0,n.__read)(t.experimentalFeatures),!1):[]})},t.defaultTrustHtmlHandler=u,t.getDarkColorFallback=p},9092:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createModelToDomSettings=t.createDomToModelSettings=void 0;var n=r(4990),o=r(377),i=r(9946);t.createDomToModelSettings=function(e){var t,r={processorOverride:{table:o.tablePreProcessor}},i=null!==(t=e.defaultDomToModelOptions)&&void 0!==t?t:{};return{builtIn:r,customized:i,calculated:(0,n.createDomToModelConfig)([r,i])}},t.createModelToDomSettings=function(e){var t,r={metadataAppliers:{listItem:i.listItemMetadataApplier,listLevel:i.listLevelMetadataApplier}},o=null!==(t=e.defaultModelToDomOptions)&&void 0!==t?t:{};return{builtIn:r,customized:o,calculated:(0,n.createModelToDomConfig)([r,o])}}},3025:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.paste=t.redo=t.undo=t.exportContent=t.createModelFromHtml=t.Editor=void 0;var n=r(3550);Object.defineProperty(t,"Editor",{enumerable:!0,get:function(){return n.Editor}});var o=r(1724);Object.defineProperty(t,"createModelFromHtml",{enumerable:!0,get:function(){return o.createModelFromHtml}});var i=r(3980);Object.defineProperty(t,"exportContent",{enumerable:!0,get:function(){return i.exportContent}});var a=r(674);Object.defineProperty(t,"undo",{enumerable:!0,get:function(){return a.undo}});var l=r(5942);Object.defineProperty(t,"redo",{enumerable:!0,get:function(){return l.redo}});var s=r(292);Object.defineProperty(t,"paste",{enumerable:!0,get:function(){return s.paste}})},4764:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.containerSizeFormatParser=void 0,t.containerSizeFormatParser=function(e,t){"DIV"!=t.tagName&&"P"!=t.tagName||(delete e.width,delete e.height)}},9946:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listLevelMetadataApplier=t.listItemMetadataApplier=void 0;var n=r(4990),o=/\$\{(\w+)\}/;function i(e,t,r){if("OL"==e){var i=(0,n.getOrderedListNumberStr)(t,null!=r?r:1),a=n.OrderedListStyleMap[t];return a?a.replace(o,i):void 0}return n.UnorderedListStyleMap[t]}function a(e,t){var r="OL"==t?n.OrderedListStyleMap[e]:n.UnorderedListStyleMap[e];return(null==r?void 0:r.indexOf('"'))>=0}t.listItemMetadataApplier={metadataDefinition:n.ListMetadataDefinition,applierFunction:function(e,t,r){var o,l=r.listFormat.nodeStack.length-2;if(l>=0){var s=null!==(o=r.listFormat.nodeStack[l+1].listType)&&void 0!==o?o:"OL",c=(0,n.getAutoListStyleType)(s,null!=e?e:{},l);void 0!==c&&(a(c,s)?t.listStyleType=i(s,c,r.listFormat.threadItemCounts[l]):delete t.listStyleType)}}},t.listLevelMetadataApplier={metadataDefinition:n.ListMetadataDefinition,applierFunction:function(e,t,r){var o,l=r.listFormat.nodeStack.length-2;if(l>=0){var s=null!==(o=r.listFormat.nodeStack[l+1].listType)&&void 0!==o?o:"OL",c=(0,n.getAutoListStyleType)(s,null!=e?e:{},l);if(void 0!==c)if(a(c,s))delete t.listStyleType;else{var d=i(s,c,r.listFormat.threadItemCounts[l]);d&&(t.listStyleType=d)}}}}},8219:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pasteBlockEntityParser=t.onCreateCopyEntityNode=void 0;var n=r(4990),o="_EBlock",i="100%",a="inline-block";t.onCreateCopyEntityNode=function(e,t){var r=e;r&&r.wrapper&&"Entity"==r.blockType&&(0,n.isNodeOfType)(t,"ELEMENT_NODE")&&(0,n.isElementOfType)(t,"div")&&!(0,n.isBlockElement)(r.wrapper)&&r.wrapper.style.display==a&&r.wrapper.style.width==i&&(t.classList.add(o),t.style.display="block",t.style.width="")},t.pasteBlockEntityParser=function(e,t){t.classList.contains(o)&&(t.classList.remove(o),t.style.display=a,t.style.width=i)}},8735:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pasteDisplayFormatParser=void 0,t.pasteDisplayFormatParser=function(e,t){var r=t.style.display;r&&"flex"!=r&&(e.display=r)}},3912:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPasteEntityProcessor=void 0;var n=r(6973),o={position:!1};t.createPasteEntityProcessor=function(e){var t=n.AllowedTags.concat(e.additionalAllowedTags),r=n.DisallowedTags.concat(e.additionalDisallowedTags),i=Object.assign({},o,e.styleSanitizers),a=e.attributeSanitizers;return function(e,o,l){var s=(0,n.sanitizeElement)(o,t,r,i,a);s&&l.defaultElementProcessors.entity(e,s,l)}}},7801:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPasteGeneralProcessor=t.removeDisplayFlex=void 0;var n=r(4990),o=r(6973);t.removeDisplayFlex=function(e){return"flex"==e?null:e};var i={position:!1,display:t.removeDisplayFlex};t.createPasteGeneralProcessor=function(e){var t=o.AllowedTags.concat(e.additionalAllowedTags),r=o.DisallowedTags.concat(e.additionalDisallowedTags),a=Object.assign({},i,e.styleSanitizers),l=e.attributeSanitizers;return function(e,i,s){var c=i.tagName.toLowerCase(),d=t.indexOf(c)>=0?function(e,t,r){var i,s,c=(0,o.createSanitizedElement)(t.ownerDocument,t.tagName,t.attributes,a,l);(0,n.moveChildNodes)(c,t),null===(s=(i=r.defaultElementProcessors)["*"])||void 0===s||s.call(i,e,c,r)}:r.indexOf(c)>=0?void 0:s.defaultElementProcessors.span;null==d||d(e,i,s)}}},9724:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pasteTextProcessor=void 0;var n=r(4990);t.pasteTextProcessor=function(e,t,r){var o,i,a=r.blockFormat.whiteSpace;(0,n.isWhiteSpacePreserved)(a)&&(t.nodeValue=null!==(i=null===(o=t.nodeValue)||void 0===o?void 0:o.replace(/\u0020\u0020/g,"  "))&&void 0!==i?i:""),r.defaultElementProcessors["#text"](e,t,r)}},377:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tablePreProcessor=void 0;var n=r(4990);t.tablePreProcessor=function(e,t,r){var o=function(e,t){var r=(0,n.getSelectionRootNode)(t.selection);return(0,n.hasMetadata)(e)||t.isInSelection||r&&e.contains(r)}(t,r)?n.tableProcessor:n.entityProcessor;o(e,t,r)}},1782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAriaLiveElement=void 0,t.createAriaLiveElement=function(e){var t=e.createElement("div");return t.style.clip="rect(0px, 0px, 0px, 0px)",t.style.clipPath="inset(100%)",t.style.height="1px",t.style.overflow="hidden",t.style.position="absolute",t.style.whiteSpace="nowrap",t.style.width="1px",t.ariaLive="assertive",e.body.appendChild(t),t}},2355:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultContentModelFormatMap=void 0,t.defaultContentModelFormatMap={a:{underline:!0,textColor:void 0},blockquote:{marginTop:"1em",marginBottom:"1em",marginLeft:"40px",marginRight:"40px"},code:{fontFamily:"monospace"},h1:{fontWeight:"bold",fontSize:"2em"},h2:{fontWeight:"bold",fontSize:"1.5em"},h3:{fontWeight:"bold",fontSize:"1.17em"},h4:{fontWeight:"bold",fontSize:"1em"},h5:{fontWeight:"bold",fontSize:"0.83em"},h6:{fontWeight:"bold",fontSize:"0.67em"},p:{marginTop:"1em",marginBottom:"1em"},pre:{fontFamily:"monospace",whiteSpace:"pre",marginTop:"1em",marginBottom:"1em"}}},7668:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultHTMLStyleMap=void 0;var n=r(1635),o={display:"block"};t.defaultHTMLStyleMap={address:o,article:o,aside:o,b:{fontWeight:"bold"},blockquote:{display:"block",marginTop:"1em",marginBottom:"1em",marginLeft:"40px",marginRight:"40px"},br:o,center:{display:"block",textAlign:"center"},dd:o,div:o,dl:o,dt:o,em:{fontStyle:"italic"},fieldset:o,figcaption:o,figure:o,footer:o,form:o,h1:{display:"block",fontWeight:"bold",fontSize:"2em"},h2:{display:"block",fontWeight:"bold",fontSize:"1.5em"},h3:{display:"block",fontWeight:"bold",fontSize:"1.17em"},h4:{display:"block",fontWeight:"bold"},h5:{display:"block",fontWeight:"bold",fontSize:"0.83em"},h6:{display:"block",fontWeight:"bold",fontSize:"0.67em"},header:o,hr:o,i:{fontStyle:"italic"},li:{display:"list-item"},main:o,nav:o,ol:(0,n.__assign)((0,n.__assign)({},o),{paddingInlineStart:"40px"}),p:{display:"block",marginTop:"1em",marginBottom:"1em"},pre:{display:"block",fontFamily:"monospace",whiteSpace:"pre",marginTop:"1em",marginBottom:"1em"},s:{textDecoration:"line-through"},section:o,strike:{textDecoration:"line-through"},strong:{fontWeight:"bold"},sub:{verticalAlign:"sub",fontSize:"smaller"},sup:{verticalAlign:"super",fontSize:"smaller"},table:{display:"table",boxSizing:"border-box"},td:{display:"table-cell"},th:{display:"table-cell"},u:{textDecoration:"underline"},ul:(0,n.__assign)((0,n.__assign)({},o),{paddingInlineStart:"40px"})}},602:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BulletListType=void 0,t.BulletListType={Min:1,Disc:1,Dash:2,Square:3,ShortArrow:4,LongArrow:5,UnfilledArrow:6,Hyphen:7,DoubleLongArrow:8,Circle:9,Max:9}},8187:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChangeSource=void 0,t.ChangeSource={AutoLink:"AutoLink",CreateLink:"CreateLink",Format:"Format",ImageResize:"ImageResize",Paste:"Paste",SetContent:"SetContent",Cut:"Cut",Drop:"Drop",InsertEntity:"InsertEntity",SwitchToDarkMode:"SwitchToDarkMode",SwitchToLightMode:"SwitchToLightMode",ListChain:"ListChain",Keyboard:"Keyboard",AutoFormat:"AutoFormat"}},5287:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmptySegmentFormat=void 0,t.EmptySegmentFormat={backgroundColor:"",fontFamily:"",fontSize:"",fontWeight:"",italic:!1,letterSpacing:"",lineHeight:"",strikethrough:!1,superOrSubScriptSequence:"",textColor:"",underline:!1}},5043:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NumberingListType=void 0,t.NumberingListType={Min:1,Decimal:1,DecimalDash:2,DecimalParenthesis:3,DecimalDoubleParenthesis:4,LowerAlpha:5,LowerAlphaParenthesis:6,LowerAlphaDoubleParenthesis:7,LowerAlphaDash:8,UpperAlpha:9,UpperAlphaParenthesis:10,UpperAlphaDoubleParenthesis:11,UpperAlphaDash:12,LowerRoman:13,LowerRomanParenthesis:14,LowerRomanDoubleParenthesis:15,LowerRomanDash:16,UpperRoman:17,UpperRomanParenthesis:18,UpperRomanDoubleParenthesis:19,UpperRomanDash:20,Max:20}},3180:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.OrderedListStyleMap=void 0;var o=r(5043);t.OrderedListStyleMap=((n={})[o.NumberingListType.Decimal]="decimal",n[o.NumberingListType.DecimalDash]='"${Number}- "',n[o.NumberingListType.DecimalParenthesis]='"${Number}) "',n[o.NumberingListType.DecimalDoubleParenthesis]='"(${Number}) "',n[o.NumberingListType.LowerAlpha]="lower-alpha",n[o.NumberingListType.LowerAlphaDash]='"${LowerAlpha}- "',n[o.NumberingListType.LowerAlphaParenthesis]='"${LowerAlpha}) "',n[o.NumberingListType.LowerAlphaDoubleParenthesis]='"(${LowerAlpha}) "',n[o.NumberingListType.UpperAlpha]="upper-alpha",n[o.NumberingListType.UpperAlphaDash]='"${UpperAlpha}- "',n[o.NumberingListType.UpperAlphaParenthesis]='"${UpperAlpha}) "',n[o.NumberingListType.UpperAlphaDoubleParenthesis]='"(${UpperAlpha}) "',n[o.NumberingListType.LowerRoman]="lower-roman",n[o.NumberingListType.LowerRomanDash]='"${LowerRoman}- "',n[o.NumberingListType.LowerRomanParenthesis]='"${LowerRoman}) "',n[o.NumberingListType.LowerRomanDoubleParenthesis]='"(${LowerRoman}) "',n[o.NumberingListType.UpperRoman]="upper-roman",n[o.NumberingListType.UpperRomanDash]='"${UpperRoman}- "',n[o.NumberingListType.UpperRomanParenthesis]='"${UpperRoman}) "',n[o.NumberingListType.UpperRomanDoubleParenthesis]='"(${UpperRoman}) "',n)},6705:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TableBorderFormat=void 0,t.TableBorderFormat={Min:0,Default:0,ListWithSideBorders:1,NoHeaderBorders:2,NoSideBorders:3,FirstColumnHeaderExternal:4,EspecialType1:5,EspecialType2:6,EspecialType3:7,Clear:8,Max:8}},2901:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.UnorderedListStyleMap=void 0;var o=r(602);t.UnorderedListStyleMap=((n={})[o.BulletListType.Disc]="disc",n[o.BulletListType.Square]='"∎ "',n[o.BulletListType.Circle]="circle",n[o.BulletListType.Dash]='"- "',n[o.BulletListType.LongArrow]='"➔ "',n[o.BulletListType.DoubleLongArrow]='"➔ "',n[o.BulletListType.ShortArrow]='"➢ "',n[o.BulletListType.UnfilledArrow]='"➪ "',n[o.BulletListType.Hyphen]='"— "',n)},7404:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildFormatParsers=t.createDomToModelConfig=t.createDomToModelContextWithConfig=t.createDomToModelContext=void 0;var n=r(1635),o=r(8953),i=r(1081),a=r(1506);function l(e,t){return Object.assign({},t,{isInSelection:!1},{blockFormat:(null==t?void 0:t.isRootRtl)?{direction:"rtl"}:{},segmentFormat:{},listFormat:{levels:[],threadItemCounts:[]}},{link:{format:{},dataset:{}},code:{format:{}},blockDecorator:{format:{},tagName:""}},e)}function s(e){return{elementProcessors:Object.assign.apply(Object,(0,n.__spreadArray)([{},o.defaultProcessorMap],(0,n.__read)(e.map((function(e){return null==e?void 0:e.processorOverride}))),!1)),formatParsers:c(e.map((function(e){return null==e?void 0:e.formatParserOverride})),e.map((function(e){return null==e?void 0:e.additionalFormatParsers}))),defaultElementProcessors:o.defaultProcessorMap,defaultFormatParsers:a.defaultFormatParsers}}function c(e,t){void 0===e&&(e=[]),void 0===t&&(t=[]);var r=Object.assign.apply(Object,(0,n.__spreadArray)([{}],(0,n.__read)(e),!1)),o=(0,i.getObjectKeys)(a.defaultFormatKeysPerCategory).reduce((function(e,o){var i,l=(i=a.defaultFormatKeysPerCategory[o].map((function(e){return void 0===r[e]?a.defaultFormatParsers[e]:r[e]}))).concat.apply(i,(0,n.__spreadArray)([],(0,n.__read)(t.map((function(e){var t;return null!==(t=null==e?void 0:e[o])&&void 0!==t?t:[]}))),!1));return e[o]=l,e}),{text:[]});return t.forEach((function(e){(null==e?void 0:e.text)&&(o.text=o.text.concat(e.text))})),o}t.createDomToModelContext=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return l(s(t),e)},t.createDomToModelContextWithConfig=l,t.createDomToModelConfig=s,t.buildFormatParsers=c},8953:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultProcessorMap=void 0;var n=r(9143),o=r(4225),i=r(852),a=r(5624),l=r(5771),s=r(2670),c=r(2960),d=r(8197),u=r(651),p=r(5973),f=r(7301),m=r(9108),g=r(9112),h=r(1963),v=r(3986),y=r(5263),b=r(4207),S=r(3815),C=r(8510),_=r(4378);t.defaultProcessorMap={a:h.linkProcessor,b:g.knownElementProcessor,blockquote:g.knownElementProcessor,br:n.brProcessor,code:i.codeProcessor,del:g.knownElementProcessor,div:g.knownElementProcessor,em:g.knownElementProcessor,font:c.fontProcessor,i:g.knownElementProcessor,img:m.imageProcessor,h1:p.headingProcessor,h2:p.headingProcessor,h3:p.headingProcessor,h4:p.headingProcessor,h5:p.headingProcessor,h6:p.headingProcessor,hr:f.hrProcessor,li:v.listItemProcessor,ol:y.listProcessor,p:b.pProcessor,pre:d.formatContainerProcessor,s:g.knownElementProcessor,section:g.knownElementProcessor,span:g.knownElementProcessor,strike:g.knownElementProcessor,strong:g.knownElementProcessor,sub:g.knownElementProcessor,sup:g.knownElementProcessor,table:S.tableProcessor,u:g.knownElementProcessor,ul:y.listProcessor,"*":u.generalProcessor,"#text":C.textProcessor,textWithSelection:_.textWithSelectionProcessor,element:l.elementProcessor,entity:s.entityProcessor,child:o.childProcessor,delimiter:a.delimiterProcessor}},4598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.domToContentModel=void 0;var n=r(7357),o=r(8941);t.domToContentModel=function(e,t){var r,i=(0,n.createContentModelDocument)(t.defaultFormat);return"range"==(null===(r=t.selection)||void 0===r?void 0:r.type)&&t.selection.isReverted&&(i.hasRevertedRangeSelection=!0),t.domIndexer&&t.allowCacheElement&&(i.persistCache=!0),t.elementProcessors.child(i,e,t),(0,o.normalizeContentModel)(i),i}},5180:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.blockProcessor=void 0;var n=r(1635),o=r(2394),i=r(8197),a=r(5450),l=r(1839),s=["A","CODE"];t.blockProcessor=function(e,t,r,c){var d=r.blockDecorator.tagName?r.blockDecorator:void 0,u=s.indexOf(t.tagName)>=0;(0,l.parseFormat)(t,r.formatParsers.block,r.blockFormat,r);var p=(0,n.__assign)({},r.blockFormat);if((0,l.parseFormat)(t,r.formatParsers.container,p,r),i.ContextStyles.forEach((function(e){p[e]&&(r.blockFormat[e]=p[e])})),!u){var f=(0,a.createParagraph)(!1,p,c,d);(0,o.addBlock)(e,f)}r.elementProcessors.child(e,t,r)}},9143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.brProcessor=void 0;var n=r(5142),o=r(4814);t.brProcessor=function(e,t,r){var i,a=(0,o.createBr)(r.segmentFormat);r.isInSelection&&(a.isSelected=!0);var l=(0,n.addSegment)(e,a,r.blockFormat);null===(i=r.domIndexer)||void 0===i||i.onSegment(t,l,[a])}},4225:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleRegularSelection=t.processChildNode=t.childProcessor=void 0;var n=r(1635),o=r(1246),i=r(7441),a=r(7057);function l(e,t,r){(0,a.isNodeOfType)(t,"ELEMENT_NODE")&&"none"!=t.style.display?r.elementProcessors.element(e,t,r):(0,a.isNodeOfType)(t,"TEXT_NODE")&&r.elementProcessors["#text"](e,t,r)}function s(e,t,r,n,i,a){var l;e==n&&(t.isInSelection=!0,(0,o.addSelectionMarker)(r,t,a,e)),e==i&&"range"==(null===(l=t.selection)||void 0===l?void 0:l.type)&&(t.selection.range.collapsed||(0,o.addSelectionMarker)(r,t,a,e),t.isInSelection=!1)}t.childProcessor=function(e,t,r){for(var o=(0,n.__read)((0,i.getRegularSelectionOffsets)(r,t),2),a=o[0],c=o[1],d=0,u=t.firstChild;u;u=u.nextSibling)s(d,r,e,a,c,t),l(e,u,r),d++;s(d,r,e,a,c,t)},t.processChildNode=l,t.handleRegularSelection=s},852:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.codeProcessor=void 0;var n=r(9112),o=r(1839),i=r(2764);t.codeProcessor=function(e,t,r){(0,i.stackFormat)(r,{code:"codeDefault"},(function(){(0,o.parseFormat)(t,r.formatParsers.code,r.code.format,r),(0,n.knownElementProcessor)(e,t,r)}))}},5624:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delimiterProcessor=void 0;var n=r(1246);t.delimiterProcessor=function(e,t,r){var o,i,a="range"==(null===(o=r.selection)||void 0===o?void 0:o.type)?r.selection.range:null;a&&(t.contains(a.startContainer)&&(r.isInSelection=!0,(0,n.addSelectionMarker)(e,r)),"range"==(null===(i=r.selection)||void 0===i?void 0:i.type)&&t.contains(a.endContainer)&&(r.selection.range.collapsed||(0,n.addSelectionMarker)(e,r),r.isInSelection=!1))}},5771:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.elementProcessor=void 0;var n=r(4134);t.elementProcessor=function(e,t,r){var o=t.tagName.toLowerCase(),i=function(e,t){return(0,n.isEntityElement)(e)||"false"==e.contentEditable?t.elementProcessors.entity:null}(t,r)||function(e,t){return(0,n.isEntityDelimiter)(e)?t.elementProcessors.delimiter:null}(t,r)||r.elementProcessors[o]||o.indexOf(":")>=0&&r.elementProcessors.child||r.elementProcessors["*"];i(e,t,r)}},2670:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.entityProcessor=void 0;var n=r(2394),o=r(5142),i=r(5681),a=r(7448),l=r(1839),s=r(2764);t.entityProcessor=function(e,t,r){var c=(0,a.isBlockElement)(t)||"inline-block"==t.style.display&&"100%"==t.style.width;(0,s.stackFormat)(r,{segment:c?"empty":void 0,paragraph:"empty"},(function(){var a,s=(0,i.createEntity)(t,!0,r.segmentFormat);if((0,l.parseFormat)(t,r.formatParsers.entity,s.entityFormat,r),r.isInSelection&&(s.isSelected=!0),c)(0,n.addBlock)(e,s);else{var d=(0,o.addSegment)(e,s);null===(a=r.domIndexer)||void 0===a||a.onSegment(t,d,[s])}}))}},2960:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fontProcessor=void 0;var n=r(7448),o=r(1839),i=r(2764),a=["10px","13px","16px","18px","24px","32px","48px"];t.fontProcessor=function(e,t,r){(0,i.stackFormat)(r,{segment:(0,n.isBlockElement)(t)?"shallowCloneForBlock":"shallowClone"},(function(){var n,i,l=t.getAttribute("face"),s=(n=t.getAttribute("size"),i=parseInt(n||""),Number.isNaN(i)?void 0:i<1?a[0]:i>a.length?a[a.length-1]:a[i-1]),c=t.getAttribute("color"),d=r.segmentFormat;l&&(d.fontFamily=l),s&&(d.fontSize=s),c&&(d.textColor=c),(0,o.parseFormat)(t,r.formatParsers.segment,r.segmentFormat,r),r.elementProcessors.child(e,t,r)}))}},8197:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatContainerProcessor=t.ContextStyles=void 0;var n=r(1635),o=r(2394),i=r(5470),a=r(5450),l=r(3825),s=r(1839),c=r(7958),d=r(2764);t.ContextStyles=["marginLeft","marginRight","paddingLeft","paddingRight"],t.formatContainerProcessor=function(e,r,u){(0,d.stackFormat)(u,{segment:"shallowCloneForBlock",paragraph:"shallowClone"},(function(){(0,s.parseFormat)(r,u.formatParsers.block,u.blockFormat,u),(0,s.parseFormat)(r,u.formatParsers.segmentOnBlock,u.segmentFormat,u);var a=(0,n.__assign)({},u.blockFormat);(0,s.parseFormat)(r,u.formatParsers.container,a,u);var d="block"==(0,l.getDefaultStyle)(r).display?r.tagName.toLowerCase():"div",p=(0,i.createFormatContainer)(d,a);if(t.ContextStyles.forEach((function(e){delete u.blockFormat[e]})),u.elementProcessors.child(p,r,u),r.style.fontSize&&0==parseInt(r.style.fontSize)&&(p.zeroFontSize=!0),function(e){var t=e.blocks[0];return"div"==e.tagName&&1==e.blocks.length&&"Paragraph"==t.blockType&&t.isImplicit}(p)){var f=p.blocks[0];p.zeroFontSize&&(f.segmentFormat=Object.assign({},f.segmentFormat,{fontSize:"0"})),Object.assign(f.format,p.format),(0,c.setParagraphNotImplicit)(f),(0,o.addBlock)(e,f)}else(0,o.addBlock)(e,p)})),(0,o.addBlock)(e,(0,a.createParagraph)(!0,u.blockFormat))}},651:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generalProcessor=void 0;var n=r(2394),o=r(9849),i=r(5142),a=r(5219),l=r(7431),s=r(7448),c=r(1839),d=r(2764),u=function(e,t,r){var o=(0,a.createGeneralBlock)(t),i=r.isInSelection;(0,d.stackFormat)(r,{segment:"empty",paragraph:"empty",link:"empty"},(function(){(0,n.addBlock)(e,o),(0,c.parseFormat)(t,r.formatParsers.general,o.format,r),r.elementProcessors.child(o,t,r)})),i&&r.isInSelection&&(o.isSelected=!0)},p=function(e,t,r){var n,a=(0,l.createGeneralSegment)(t,r.segmentFormat),s=r.isInSelection;(0,o.addDecorators)(a,r);var u=(0,i.addSegment)(e,a);null===(n=r.domIndexer)||void 0===n||n.onSegment(t,u,[a]),(0,d.stackFormat)(r,{segment:"empty"},(function(){(0,c.parseFormat)(t,r.formatParsers.general,a.format,r),r.elementProcessors.child(a,t,r)})),s&&r.isInSelection&&(a.isSelected=!0)};t.generalProcessor=function(e,t,r){((0,s.isBlockElement)(t)?u:p)(e,t,r)}},5973:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.headingProcessor=void 0;var n=r(2394),o=r(5180),i=r(5450),a=r(6357),l=r(1081),s=r(1839),c=r(2764);t.headingProcessor=function(e,t,r){(0,c.stackFormat)(r,{segment:"shallowCloneForBlock",paragraph:"shallowClone",blockDecorator:"empty"},(function(){var n={};(0,s.parseFormat)(t,r.formatParsers.segmentOnBlock,n,r),(0,l.getObjectKeys)(n).forEach((function(e){delete r.segmentFormat[e]})),r.blockDecorator=(0,a.createParagraphDecorator)(t.tagName,n),(0,o.blockProcessor)(e,t,r)})),(0,n.addBlock)(e,(0,i.createParagraph)(!0,r.blockFormat))}},7301:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hrProcessor=void 0;var n=r(2394),o=r(6133),i=r(1839),a=r(2764);t.hrProcessor=function(e,t,r){(0,a.stackFormat)(r,{paragraph:"shallowClone"},(function(){(0,i.parseFormat)(t,r.formatParsers.divider,r.blockFormat,r);var a=(0,o.createDivider)("hr",r.blockFormat);t.size&&(a.size=t.size),r.isInSelection&&(a.isSelected=!0),(0,n.addBlock)(e,a)}))}},9108:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.imageProcessor=void 0;var n=r(9849),o=r(5142),i=r(6349),a=r(1839),l=r(2764);t.imageProcessor=function(e,t,r){(0,l.stackFormat)(r,{segment:"shallowClone"},(function(){var l,s,c,d=r.segmentFormat,u=null!==(l=t.getAttribute("src"))&&void 0!==l?l:"";(0,a.parseFormat)(t,r.formatParsers.segment,d,r),(0,a.parseFormat)(t,r.formatParsers.image,d,r),(0,a.parseFormat)(t,r.formatParsers.block,r.blockFormat,r);var p=(0,i.createImage)(u,d),f=t.alt,m=t.title;(0,a.parseFormat)(t,r.formatParsers.dataset,p.dataset,r),(0,n.addDecorators)(p,r),f&&(p.alt=f),m&&(p.title=m),r.isInSelection&&(p.isSelected=!0),"image"==(null===(s=r.selection)||void 0===s?void 0:s.type)&&r.selection.image==t&&(p.isSelectedAsImageSelection=!0,p.isSelected=!0);var g=(0,o.addSegment)(e,p);null===(c=r.domIndexer)||void 0===c||c.onSegment(t,g,[p])}))}},9112:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.knownElementProcessor=void 0;var n=r(2394),o=r(5180),i=r(5450),a=r(8197),l=r(3825),s=r(7448),c=r(1839),d=r(2764),u=["marginBottom","marginTop","paddingBottom","paddingTop","paddingLeft","paddingRight","borderTopWidth","borderBottomWidth","borderLeftWidth","borderRightWidth","width","height","maxWidth","maxHeight","minWidth","minHeight"],p=["H1","H2","H3","H4","H5","H6","P","A"],f=["A","CODE"];t.knownElementProcessor=function(e,t,r){var m=(0,s.isBlockElement)(t);if((m||"inline-block"==t.style.display)&&function(e){if(p.indexOf(e.tagName)>=0)return!1;var t=e.style,r=(0,l.getDefaultStyle)(e),n=t.getPropertyValue("background-color");return!(!n||"transparent"==n)||(!!u.some((function(e){return parseInt(t[e]||r[e]||"")>0}))||("auto"==t.marginLeft||"auto"==t.marginRight||!!e.getAttribute("align")))}(t))(0,a.formatContainerProcessor)(e,t,r);else if(m){var g=r.blockDecorator.tagName?r.blockDecorator:void 0,h=f.indexOf(t.tagName)>=0;(0,d.stackFormat)(r,{segment:"shallowCloneForBlock",paragraph:"shallowClone"},(function(){var n={};(0,c.parseFormat)(t,r.formatParsers.segmentOnBlock,n,r),Object.assign(r.segmentFormat,n),(0,o.blockProcessor)(e,t,r,n)})),m&&!h&&(0,n.addBlock)(e,(0,i.createParagraph)(!0,r.blockFormat,void 0,g))}else(0,d.stackFormat)(r,{segment:"shallowClone",paragraph:"shallowClone",link:"cloneFormat"},(function(){(0,c.parseFormat)(t,r.formatParsers.segment,r.segmentFormat,r),r.link.format.href&&"A"!=t.tagName&&(0,c.parseFormat)(t,r.formatParsers.segmentUnderLink,r.link.format,r),r.elementProcessors.child(e,t,r)}))}},1963:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.linkProcessor=void 0;var n=r(9112),o=r(1839),i=r(2764);t.linkProcessor=function(e,t,r){t.hasAttribute("href")?(0,i.stackFormat)(r,{link:"linkDefault"},(function(){(0,o.parseFormat)(t,r.formatParsers.link,r.link.format,r),(0,o.parseFormat)(t,r.formatParsers.dataset,r.link.dataset,r),(0,n.knownElementProcessor)(e,t,r)})):(0,n.knownElementProcessor)(e,t,r)}},3986:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listItemProcessor=void 0;var n=r(6953),o=r(1839),i=r(2764);t.listItemProcessor=function(e,t,r){var a,l=r.listFormat;if(l.listParent&&l.levels.length>0)(0,i.stackFormat)(r,{segment:"shallowCloneForBlock"},(function(){(0,o.parseFormat)(t,r.formatParsers.segmentOnBlock,r.segmentFormat,r);var e=(0,n.createListItem)(l.levels,r.segmentFormat);(0,o.parseFormat)(t,r.formatParsers.listItemElement,e.format,r),l.listParent.blocks.push(e),(0,o.parseFormat)(t,r.formatParsers.listItemThread,e.levels[e.levels.length-1].format,r),r.elementProcessors.child(e,t,r);var i=e.blocks[0];1==e.blocks.length&&"Paragraph"==i.blockType&&i.isImplicit&&(Object.assign(e.format,i.format),i.format={})}));else{var s=null===(a=l.listParent)||void 0===a?void 0:a.blocks,c=null==s?void 0:s[(null==s?void 0:s.length)-1];r.elementProcessors["*"]("BlockGroup"==(null==c?void 0:c.blockType)?c:e,t,r)}}},5263:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listProcessor=void 0;var n=r(598),o=r(1839),i=r(2764);t.listProcessor=function(e,t,r){(0,i.stackFormat)(r,{segment:"shallowCloneForBlock",paragraph:"shallowCloneForGroup"},(function(){var i=(0,n.createListLevel)(t.tagName,r.blockFormat),a=r.listFormat;(0,o.parseFormat)(t,r.formatParsers.dataset,i.dataset,r),(0,o.parseFormat)(t,r.formatParsers.listLevelThread,i.format,r),(0,o.parseFormat)(t,r.formatParsers.listLevel,i.format,r),(0,o.parseFormat)(t,r.formatParsers.segment,r.segmentFormat,r);var l=a.listParent;a.listParent=a.listParent||e,a.levels.push(i);try{r.elementProcessors.child(e,t,r)}finally{a.levels.pop(),a.listParent=l}}))}},4207:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pProcessor=void 0;var n=r(2394),o=r(5180),i=r(5450),a=r(6357),l=r(1839),s=r(2764);t.pProcessor=function(e,t,r){(0,s.stackFormat)(r,{blockDecorator:"empty",segment:"shallowCloneForBlock",paragraph:"shallowClone"},(function(){r.blockDecorator=(0,a.createParagraphDecorator)(t.tagName);var n={};(0,l.parseFormat)(t,r.formatParsers.segmentOnBlock,n,r),Object.assign(r.segmentFormat,n),(0,o.blockProcessor)(e,t,r,n)})),(0,n.addBlock)(e,(0,i.createParagraph)(!0,r.blockFormat))}},3815:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tableProcessor=void 0;var n=r(1635),o=r(2394),i=r(1728),a=r(7720),l=r(7398),s=r(8907),c=r(7057),d=r(1839),u=r(861),p=r(2764);function f(e){for(var t=[],r=0,n=e.length-1;n>=0;n--)if("number"==typeof(o=e[n])){r=o;break}for(n=e.length-2;n>=0;n--){var o;void 0===(o=e[n])?t[n]=0:(t[n]=r-o,r=o)}return t}t.tableProcessor=function(e,t,r){(0,p.stackFormat)(r,{segment:"shallowCloneForBlock",paragraph:"shallowCloneForGroup"},(function(){var m,g;(0,d.parseFormat)(t,r.formatParsers.block,r.blockFormat,r);var h=(0,i.createTable)(t.rows.length,r.blockFormat),v="table"==(null===(m=r.selection)||void 0===m?void 0:m.type)?r.selection:null,y=(null==v?void 0:v.table)==t;r.allowCacheElement&&(h.cachedElement=t),null===(g=r.domIndexer)||void 0===g||g.onTable(t,h),(0,d.parseFormat)(t,r.formatParsers.table,h.format,r),(0,d.parseFormat)(t,r.formatParsers.tableBorder,h.format,r),(0,d.parseFormat)(t,r.formatParsers.segmentOnBlock,r.segmentFormat,r),(0,d.parseFormat)(t,r.formatParsers.dataset,h.dataset,r),(0,o.addBlock)(e,h);for(var b=[0],S=function(e,t,r){for(var n,o,i=0,a=!1,l=e.firstChild;l;l=l.nextSibling)if((0,c.isNodeOfType)(l,"ELEMENT_NODE")&&"COLGROUP"==l.tagName){a=!0;for(var s=l.firstChild;s;s=s.nextSibling)if((0,c.isNodeOfType)(s,"ELEMENT_NODE")&&"COL"==s.tagName){var p={};(0,d.parseFormat)(s,t.formatParsers.tableColumn,p,t);for(var f=0;f<parseInt(null!==(n=s.getAttribute("span"))&&void 0!==n?n:"1");f++)if(void 0===p.width)r.push(void 0);else{var m=(0,u.parseValueWithUnit)(null!==(o=p.width)&&void 0!==o?o:"",void 0,"px");r.push(m+i),i+=m}}}return a}(t,r,b),C=[0],_=r.zoomScale||1,E=function(e){var o=t.rows[e],i=h.rows[e],u=o.parentNode;(0,c.isNodeOfType)(u,"ELEMENT_NODE")&&((0,s.isElementOfType)(u,"tbody")||(0,s.isElementOfType)(u,"thead")||(0,s.isElementOfType)(u,"tfoot"))?(0,d.parseFormat)(u,r.formatParsers.tableRow,i.format,r):r.allowCacheElement&&(i.cachedElement=o),(0,d.parseFormat)(o,r.formatParsers.tableRow,i.format,r),(0,p.stackFormat)(r,{paragraph:"shallowClone",segment:"shallowClone"},(function(){var t=o.parentElement,s=null==t?void 0:t.tagName;!t||"TBODY"!=s&&"THEAD"!=s&&"TFOOT"!=s||((0,d.parseFormat)(t,r.formatParsers.block,r.blockFormat,r),(0,d.parseFormat)(t,r.formatParsers.segmentOnBlock,r.segmentFormat,r)),(0,d.parseFormat)(o,r.formatParsers.block,r.blockFormat,r),(0,d.parseFormat)(o,r.formatParsers.segmentOnBlock,r.segmentFormat,r);for(var c,u=function(t,s){for(;i.cells[s];s++);var u=o.cells[t],f=r.isInSelection,m=s+u.colSpan,g=e+u.rowSpan,E=void 0===b[m],T=void 0===C[g];if(E||T){var k=(0,l.getBoundingClientRect)(u);if(k.width>0||k.height>0){if(E){var M=b[s];b[m]=("number"==typeof M?M:0)+k.width/_}T&&(C[g]=C[e]+k.height/_)}}(0,p.stackFormat)(r,{paragraph:"shallowClone",segment:"shallowClone"},(function(){(0,d.parseFormat)(u,r.formatParsers.block,r.blockFormat,r),(0,d.parseFormat)(u,r.formatParsers.segmentOnTableCell,r.segmentFormat,r);var t=(0,n.__assign)({},r.blockFormat),o={};(0,d.parseFormat)(u,r.formatParsers.tableCell,t,r),(0,d.parseFormat)(u,r.formatParsers.tableBorder,t,r),(0,d.parseFormat)(u,r.formatParsers.dataset,o,r);for(var i=1;i<=u.colSpan;i++,s++)for(var l=1;l<=u.rowSpan;l++){var c=1==i&&1==l,p=(0,a.createTableCell)(i>1,l>1,"TH"==u.tagName,t);p.dataset=(0,n.__assign)({},o);var m=h.rows[e+l-1];if(m&&(m.cells[s]=p),c){r.allowCacheElement&&!S&&(p.cachedElement=u);var g=r.listFormat,b=g.listParent,C=g.levels;r.listFormat.listParent=void 0,r.listFormat.levels=[];try{r.elementProcessors.child(p,u,r)}finally{r.listFormat.listParent=b,r.listFormat.levels=C}}var _=r.isInSelection;(f&&_||y&&v&&e>=v.firstRow&&e<=v.lastRow&&s>=v.firstColumn&&s<=v.lastColumn)&&(p.isSelected=!0)}})),c=s},f=0,m=0;f<o.cells.length;f++)u(f,m),m=c}));for(var f=0;f<i.cells.length;f++)i.cells[f]||(i.cells[f]=(0,a.createTableCell)(!1,!1,!1,r.blockFormat))},T=0;T<t.rows.length;T++)E(T);h.widths=f(b);var k=f(C);h.rows.forEach((function(e,t){k[t]>0&&(e.height=k[t])}))}))}},8510:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textProcessor=void 0;var n=r(8276),o=r(2764);function i(e,t,r){var o,i=(0,n.ensureParagraph)(e,r.blockFormat),a=i.segments.length;r.elementProcessors.textWithSelection(e,t,r);var l=i.segments.slice(a);null===(o=r.domIndexer)||void 0===o||o.onSegment(t,i,l.filter((function(e){return"Text"==(null==e?void 0:e.segmentType)})))}t.textProcessor=function(e,t,r){r.formatParsers.text.length>0?(0,o.stackFormat)(r,{segment:"shallowClone"},(function(){r.formatParsers.text.forEach((function(n){n(r.segmentFormat,t,r),i(e,t,r)}))})):i(e,t,r)}},4378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textWithSelectionProcessor=void 0;var n=r(1246),o=r(7423),i=r(7441);t.textWithSelectionProcessor=function(e,t,r){var a=t.nodeValue||"",l=(0,i.getRegularSelectionOffsets)(r,t),s=l[0],c=l[1];if(s>=0){var d=a.substring(0,s);(0,o.addTextSegment)(e,d,r),r.isInSelection=!0,(0,n.addSelectionMarker)(e,r,t,s),a=a.substring(s),c-=s}c>=0&&(d=a.substring(0,c),(0,o.addTextSegment)(e,d,r),!r.selection||"range"==r.selection.type&&r.selection.range.collapsed||(0,n.addSelectionMarker)(e,r,t,l[1]),r.isInSelection=!1,a=a.substring(c)),(0,o.addTextSegment)(e,a,r)}},1246:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addSelectionMarker=void 0;var n=r(5142),o=r(8411);t.addSelectionMarker=function(e,t,r,i){var a=(0,o.buildSelectionMarker)(e,t,r,i);(0,n.addSegment)(e,a,t.blockFormat,a.format)}},9187:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.areSameFormats=void 0;var n=r(1081);t.areSameFormats=function(e,t){if(e==t)return!0;var r=(0,n.getObjectKeys)(e),o=(0,n.getObjectKeys)(t);return r.length==o.length&&r.every((function(r){return e[r]==t[r]}))}},8411:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildSelectionMarker=void 0;var n=r(9849),o=r(7192);t.buildSelectionMarker=function(e,t,r,i){var a=e.blocks[e.blocks.length-1],l=a&&"Paragraph"==a.blockType?a.decorator?{fontFamily:a.decorator.format.fontFamily,fontSize:a.decorator.format.fontSize}:a.segmentFormat?{fontFamily:a.segmentFormat.fontFamily,fontSize:a.segmentFormat.fontSize}:{}:{},s=t.pendingFormat&&t.pendingFormat.insertPoint.node===r&&t.pendingFormat.insertPoint.offset===i?t.pendingFormat.format:void 0,c=Object.assign({},t.defaultFormat,l,t.segmentFormat,s),d=(0,o.createSelectionMarker)(c);return(0,n.addDecorators)(d,t),d}},7398:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBoundingClientRect=void 0,t.getBoundingClientRect=function(e){return e.getBoundingClientRect()}},3825:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultStyle=void 0;var n=r(7668);t.getDefaultStyle=function(e){var t=e.tagName.toLowerCase();return n.defaultHTMLStyleMap[t]||{}}},7441:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRegularSelectionOffsets=void 0,t.getRegularSelectionOffsets=function(e,t){var r,n="range"==(null===(r=e.selection)||void 0===r?void 0:r.type)?e.selection.range:null;return[(null==n?void 0:n.startContainer)==t?n.startOffset:-1,(null==n?void 0:n.endContainer)==t?n.endOffset:-1]}},7448:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBlockElement=void 0;var n=r(3825),o=["block","list-item","table","table-cell","flex"];t.isBlockElement=function(e){var t=e.style.display||(0,n.getDefaultStyle)(e).display||"";return o.indexOf(t)>=0}},1839:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseFormat=void 0;var n=r(3825);t.parseFormat=function(e,t,r,o){var i=(0,n.getDefaultStyle)(e);t.forEach((function(t){null==t||t(r,e,o,i)}))}},2764:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stackFormat=void 0;var n=r(1635),o=r(1081),i=["backgroundColor"],a=["marginLeft","marginRight","paddingLeft","paddingRight"];function l(e,t){switch(t){case"empty":return{};case void 0:return e;default:var r=(0,n.__assign)({},e);if((0,o.getObjectKeys)(e).forEach((function(e){("shallowCloneForBlock"==t&&i.indexOf(e)>=0||"shallowCloneForGroup"==t&&a.indexOf(e)>=0)&&delete r[e]})),"shallowClone"==t||"shallowCloneForGroup"==t){var l=e;l.textIndent&&(delete r.isTextIndentApplied,l.isTextIndentApplied=!0)}return r}}t.stackFormat=function(e,t,r){var o,i=e.segmentFormat,a=e.blockFormat,s=e.link,c=e.code,d=e.blockDecorator,u=t.segment,p=t.paragraph,f=t.link,m=t.code,g=t.blockDecorator;try{e.segmentFormat=l(i,u),e.blockFormat=l(a,p),e.link=function(e,t){switch(t){case"linkDefault":return{format:{underline:!0},dataset:{}};case"empty":return{format:{},dataset:{}};default:return{dataset:e.dataset,format:(0,n.__assign)({},e.format)}}}(s,f),e.code=function(e,t){switch(t){case"codeDefault":return{format:{fontFamily:"monospace"}};case"empty":return{format:{}};default:return e}}(c,m),e.blockDecorator=(o=d,"empty"===g?{format:{},tagName:""}:o),r()}finally{e.segmentFormat=i,e.blockFormat=a,e.link=s,e.code=c,e.blockDecorator=d}}},4134:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addDelimiters=t.isBlockEntityContainer=t.isEntityDelimiter=t.generateEntityClassNames=t.parseEntityFormat=t.getAllEntityWrappers=t.findClosestBlockEntityContainer=t.findClosestEntityWrapper=t.isEntityElement=void 0;var n=r(1635),o=r(3494),i=r(8907),a=r(7057),l=r(872),s="_Entity",c="."+s,d="_EType_",u="_EId_",p="_EReadonly_",f="entityDelimiterBefore",m="entityDelimiterAfter",g="_E_EBlockEntityContainer",h="."+g;function v(e,t){return(null==e?void 0:e.classList.contains(t))&&"​"==e.textContent?e:void 0}function y(e,t,r){var n,o=e.createElement("span");return o.className=r?m:f,o.appendChild(e.createTextNode("​")),null===(n=t.parentNode)||void 0===n||n.insertBefore(o,r?t.nextSibling:t),o}t.isEntityElement=function(e){return(0,a.isNodeOfType)(e,"ELEMENT_NODE")&&e.classList.contains(s)},t.findClosestEntityWrapper=function(e,t){return t.findClosestElementAncestor(e,c)},t.findClosestBlockEntityContainer=function(e,t){return t.findClosestElementAncestor(e,h)},t.getAllEntityWrappers=function(e){return(0,l.toArray)(e.querySelectorAll("."+s))},t.parseEntityFormat=function(e){var t=!1,r={};return e.classList.forEach((function(e){t=function(e,t){if(e==s)return!0;0==e.indexOf(d)?t.entityType=e.substring(7):0==e.indexOf(u)?t.id=e.substring(5):0==e.indexOf(p)&&(t.isReadonly="1"==e.substring(11))}(e,r)||t})),t||(r.isFakeEntity=!0,r.isReadonly=!e.isContentEditable),r},t.generateEntityClassNames=function(e){var t;return e.isFakeEntity?"":s+" "+d+(null!==(t=e.entityType)&&void 0!==t?t:"")+" "+(e.id?""+u+e.id+" ":"")+p+(e.isReadonly?"1":"0")},t.isEntityDelimiter=function(e,t){var r=void 0===t||t,n=void 0===t||!t;return(0,i.isElementOfType)(e,"span")&&(n&&e.classList.contains(m)||r&&e.classList.contains(f))&&"​"===e.textContent},t.isBlockEntityContainer=function(e){return(0,i.isElementOfType)(e,"div")&&e.classList.contains(g)},t.addDelimiters=function(e,t,r,i){var a,l,s,c,d=(0,n.__read)((l=[],s=(a=t).nextElementSibling,c=a.previousElementSibling,l.push(v(s,m),v(c,f)),l),2),u=d[0],p=d[1];return u||(u=y(e,t,!0),i&&r&&(0,o.applyFormat)(u,i.formatAppliers.segment,r,i)),p||(p=y(e,t,!1),i&&r&&(0,o.applyFormat)(p,i.formatAppliers.segment,r,i)),[u,p]}},6819:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cacheGetEventData=void 0,t.cacheGetEventData=function(e,t,r){var n=e.eventDataCache&&e.eventDataCache.hasOwnProperty(t)?e.eventDataCache[t]:r(e);return e.eventDataCache=e.eventDataCache||{},e.eventDataCache[t]=n,n}},9076:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isCursorMovingKey=t.isCharacterValue=t.isModifierKey=void 0;var r=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"]);function n(e){var t=e.ctrlKey||"Control"===e.key,r=e.altKey||"Alt"===e.key,n=e.metaKey||"Meta"===e.key;return t||r||n}t.isModifierKey=n,t.isCharacterValue=function(e){return!n(e)&&!!e.key&&1==e.key.length},t.isCursorMovingKey=function(e){return r.has(e.key)}},9526:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.extractClipboardItems=void 0;var o=r(1074),i=((n={})["text/html"]=function(e,t){return e.rawHtml=t},n["text/plain"]=function(e,t){return e.text=t},n["text/*"]=function(e,t,r){return!!r&&(e.customValues[r]=t)},n["text/link-preview"]=function(e,t){try{e.customValues["link-preview"]=t,e.linkPreview=JSON.parse(t)}catch(e){}},n);t.extractClipboardItems=function(e,t){var r={types:[],text:"",image:null,files:[],rawHtml:null,customValues:{},pasteNativeEvent:!0};return Promise.all((e||[]).map((function(e){var n=e.type;if(0!=n.indexOf("image/")||r.image||"file"!=e.kind){if("file"==e.kind)return new Promise((function(t){var o=e.getAsFile();o&&(r.types.push(n),r.files.push(o)),t()}));var a=function(e,t){var r=0==e.indexOf("text/")?e.substring(5):null,n=t&&r?t.indexOf(r):-1;return r&&n>=0?r:void 0}(n,t),l=i[n]||(a?i["text/*"]:null);return new Promise((function(t){return l?e.getAsString((function(e){r.types.push(n),l(r,e,a),t()})):t()}))}return r.types.push(n),r.image=e.getAsFile(),new Promise((function(e){r.image?(0,o.readFile)(r.image,(function(t){r.imageDataUri=t,e()})):e()}))}))).then((function(){return r}))}},1081:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getObjectKeys=void 0,t.getObjectKeys=function(e){return Object.keys(e)}},6039:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSafeIdSelector=void 0;var r=/^[.|\-|_|\d]/;t.getSafeIdSelector=function(e){return e?e.match(r)?'[id="'+e+'"]':"#"+e:e}},8907:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isElementOfType=void 0,t.isElementOfType=function(e,t){var r;return(null===(r=null==e?void 0:e.tagName)||void 0===r?void 0:r.toLocaleLowerCase())==t}},7057:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNodeOfType=void 0,t.isNodeOfType=function(e,t){return!!e&&e.nodeType==Node[t]}},3869:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isWhiteSpacePreserved=void 0;var r=["pre","pre-wrap","break-spaces"];t.isWhiteSpacePreserved=function(e){return!!e&&r.indexOf(e)>=0}},4310:(e,t)=>{"use strict";function r(e,t,r){if(e){for(;!r&&e.firstChild;)e.removeChild(e.firstChild);for(;null==t?void 0:t.firstChild;)e.appendChild(t.firstChild)}}Object.defineProperty(t,"__esModule",{value:!0}),t.wrapAllChildNodes=t.moveChildNodes=void 0,t.moveChildNodes=r,t.wrapAllChildNodes=function(e,t){var n=e.ownerDocument.createElement(t);return r(n,e),e.appendChild(n),n}},107:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeRect=void 0,t.normalizeRect=function(e){var t=e||{left:0,right:0,top:0,bottom:0},r=t.left,n=t.right,o=t.top,i=t.bottom;return 0===r&&0===n&&0===o&&0===i?null:{left:Math.round(r),right:Math.round(n),top:Math.round(o),bottom:Math.round(i)}}},1074:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readFile=void 0,t.readFile=function(e,t){if(e){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=function(){t(null)},r.readAsDataURL(e)}}},9290:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeNode=t.reuseCachedElement=void 0;var n=r(4134);t.reuseCachedElement=function(e,t,r){var o;if(t.parentNode==e){for(var i=(0,n.isEntityElement)(t);r&&r!=t&&(i||!(0,n.isEntityElement)(r));){var a=r.nextSibling;null===(o=r.parentNode)||void 0===o||o.removeChild(r),r=a}r&&r==t?r=r.nextSibling:e.insertBefore(t,r)}else e.insertBefore(t,r);return r},t.removeNode=function(e){var t,r=e.nextSibling;return null===(t=e.parentNode)||void 0===t||t.removeChild(e),r}},3120:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDOMInsertPointRect=void 0;var n=r(7057),o=r(107);function i(e,t){var r=e.node,n=e.offset;t.setStart(r,n),t.setEnd(r,n);var i=(0,o.normalizeRect)(t.getBoundingClientRect());if(i)return i;var a=t.getClientRects&&t.getClientRects();return a&&1==a.length?(0,o.normalizeRect)(a[0]):null}t.getDOMInsertPointRect=function(e,t){var r,a,l,s=e.createRange();return null!==(a=null!==(r=i(t,s))&&void 0!==r?r:i(t=function(e){for(var t=e.node,r=e.offset;t.lastChild;)r==t.childNodes.length?r=(t=t.lastChild).childNodes.length:(t=t.childNodes[r],r=0);return{node:t,offset:r}}(t),s))&&void 0!==a?a:(l=t.node,(0,n.isNodeOfType)(l,"ELEMENT_NODE")&&l.getBoundingClientRect?(0,o.normalizeRect)(l.getBoundingClientRect()):null)}},8257:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSelectionRootNode=void 0,t.getSelectionRootNode=function(e){return e?"range"==e.type?e.range.commonAncestorContainer:"table"==e.type?e.table:"image"==e.type?e.image:void 0:void 0}},5245:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeText=t.isSpace=t.isPunctuation=void 0;var r=/[\u2000\u2009\u200a​\u200b​\u202f\u205f​\u3000\s\t\r\n]/gm;t.isPunctuation=function(e){return'.,?!:"()[]\\/'.indexOf(e)>=0},t.isSpace=function(e){var t,n=null!==(t=null==e?void 0:e.charCodeAt(0))&&void 0!==t?t:0;return 160==n||32==n||r.test(e)},t.normalizeText=function(e,t){return e.replace(t?/^\u0020+/:/\u0020+$/," ")}},9298:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineBorderValue=t.extractBorderValues=void 0;var r=["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset"],n=/^(thin|medium|thick|[\d\.]+\w*)$/;t.extractBorderValues=function(e){var t={};return(e||"").replace(/, /g,",").split(" ").forEach((function(e){r.indexOf(e)>=0&&!t.style?t.style=e:n.test(e)&&!t.width?t.width=e:e&&!t.color&&(t.color=e)})),t},t.combineBorderValue=function(e){return[e.width||"",e.style||"",e.color||""].join(" ").trim()||"none"}},9265:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBold=void 0,t.isBold=function(e){return!!e&&("bold"==e||"bolder"==e||parseInt(e)>=600)}},6537:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transformColor=void 0;var n=r(488);function o(e,t,r){r&&i(e)&&t(e);for(var n=e.firstChild;n;n=n.nextSibling)i(n)&&t(n),o(n,t)}function i(e){var t=e;return e.nodeType==Node.ELEMENT_NODE&&!!t.style}t.transformColor=function(e,t,r,i){var a="lightToDark"==r;o(e,(function(e){var t=(0,n.getColor)(e,!1,!a,i),r=(0,n.getColor)(e,!0,!a,i);(0,n.setColor)(e,t,!1,a,i),(0,n.setColor)(e,r,!0,a,i)}),t)}},7311:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseTableCells=void 0;var n=r(872);t.parseTableCells=function(e){var t=(0,n.toArray)(e.rows),r=t.map((function(e){return[]}));return t.forEach((function(e,t){for(var n=0,o=0;n<e.cells.length;n++){for(;void 0!==r[t][o];o++);for(var i=e.cells[n],a=0;a<i.colSpan;a++,o++)for(var l=0;l<i.rowSpan;l++)r[t+l]&&(r[t+l][o]=0==a?0==l?i:"spanTop":0==l?"spanLeft":"spanBoth")}for(var s=0;s<r[t].length;s++)r[t][s]=r[t][s]||null})),r}},872:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toArray=void 0,t.toArray=function(e){return[].slice.call(e)}},2463:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unwrap=void 0,t.unwrap=function(e){var t=e?e.parentNode:null;if(!t)return null;for(;e.firstChild;)t.insertBefore(e.firstChild,e);return t.removeChild(e),t}},7828:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wrap=void 0,t.wrap=function(e,t,r){var n,o=e.createElement(r);return null===(n=t.parentNode)||void 0===n||n.insertBefore(o,t),o.appendChild(t),o}},7917:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.directionFormatHandler=void 0,t.directionFormatHandler={parse:function(e,t,r,n){var o=t.style.direction||t.dir||n.direction;o&&(e.direction="rtl"==o?"rtl":"ltr")},apply:function(e,t){e.direction&&(t.style.direction=e.direction)}}},8116:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.displayFormatHandler=void 0,t.displayFormatHandler={parse:function(e,t){var r=t.style.display;r&&(e.display=r)},apply:function(e,t){e.display&&(t.style.display=e.display)}}},1400:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.htmlAlignFormatHandler=void 0;var n=r(7340),o=r(7917);t.htmlAlignFormatHandler={parse:function(e,t,r,i){o.directionFormatHandler.parse(e,t,r,i);var a=t.getAttribute("align");a&&(e.htmlAlign=(0,n.calcAlign)(a,e.direction),delete e.textAlign,delete r.blockFormat.textAlign)},apply:function(e,t){var r="rtl"==e.direction?"rtl":"ltr";e.htmlAlign&&t.setAttribute("align",n.ResultMap[e.htmlAlign][r])}}},6329:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lineHeightFormatHandler=void 0,t.lineHeightFormatHandler={parse:function(e,t,r,n){var o=t.style.lineHeight||n.lineHeight;o&&"inherit"!=o&&(e.lineHeight=o)},apply:function(e,t){e.lineHeight&&(t.style.lineHeight=e.lineHeight)}}},2568:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.marginFormatHandler=void 0;var n=r(861),o=["marginTop","marginRight","marginBottom","marginLeft"];t.marginFormatHandler={parse:function(e,t,r,i){o.forEach((function(r){var o=t.style[r]||i[r];if(o)switch(r){case"marginTop":case"marginBottom":e[r]=o;break;case"marginLeft":case"marginRight":e[r]=e[r]?(0,n.parseValueWithUnit)(e[r]||"",t)+(0,n.parseValueWithUnit)(o,t)+"px":o}}))},apply:function(e,t,r){o.forEach((function(n){var o=e[n];o!=r.implicitFormat[n]&&(t.style[n]=o||"0")}))}}},2214:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.paddingFormatHandler=void 0;var n=r(7917),o=["paddingTop","paddingRight","paddingBottom","paddingLeft"],i={paddingLeft:"paddingInlineStart"},a={paddingRight:"paddingInlineStart"};t.paddingFormatHandler={parse:function(e,t,r,l){n.directionFormatHandler.parse(e,t,r,l),o.forEach((function(r){var n,o,s=t.style[r],c=("rtl"==e.direction?a:i)[r],d=(null!==(o=null!==(n=l[r])&&void 0!==n?n:c?l[c]:void 0)&&void 0!==o?o:"0px")+"";s||(s=d),s&&"0"!=s||(s="0px"),s&&s!=d&&(e[r]=s)}))},apply:function(e,t,r){o.forEach((function(r){var n=e[r],o=void 0;"OL"!=t.tagName&&"UL"!=t.tagName||("rtl"==e.direction&&"paddingRight"==r||"rtl"!=e.direction&&"paddingLeft"==r)&&(o="40px"),n&&n!=o&&(t.style[r]=n)}))}}},1169:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textAlignFormatHandler=void 0;var n=r(7340),o=r(7917);t.textAlignFormatHandler={parse:function(e,t,r,i){var a;o.directionFormatHandler.parse(e,t,r,i);var l=t.style.textAlign||i.textAlign;"LI"==t.tagName&&"flex"===(null===(a=t.parentElement)||void 0===a?void 0:a.style.display)&&"column"===t.parentElement.style.flexDirection&&t.style.alignSelf&&(l=t.style.alignSelf),l&&(e.textAlign=(0,n.calcAlign)(l,e.direction))},apply:function(e,t){var r="rtl"==e.direction?"rtl":"ltr";if(e.textAlign){var o=t.parentElement,i=null==o?void 0:o.tagName;"LI"!=t.tagName||!o||"OL"!=i&&"UL"!=i?t.style.textAlign=n.ResultMap[e.textAlign][r]:(t.style.alignSelf=e.textAlign,t.parentElement.style.flexDirection="column",t.parentElement.style.display="flex")}}}},8429:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textIndentFormatHandler=void 0,t.textIndentFormatHandler={parse:function(e,t){var r=t.style.textIndent;r&&(e.textIndent=r)},apply:function(e,t){e.textIndent&&(t.style.textIndent=e.textIndent)}}},3833:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.whiteSpaceFormatHandler=void 0;var n=r(893);t.whiteSpaceFormatHandler={parse:function(e,t,r,o){var i=t.style.whiteSpace||o.whiteSpace;(0,n.shouldSetValue)(i,"normal",e.whiteSpace,o.whiteSpace)&&(e.whiteSpace=i)},apply:function(e,t,r){var n=r.implicitFormat.whiteSpace;e.whiteSpace!=n&&(t.style.whiteSpace=e.whiteSpace||"normal")}}},6187:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.backgroundColorFormatHandler=void 0;var n=r(488),o=r(893);t.backgroundColorFormatHandler={parse:function(e,t,r,i){var a=(0,n.getColor)(t,!0,!!r.isDarkMode,r.darkColorHandler)||i.backgroundColor;(0,o.shouldSetValue)(a,"transparent",void 0,i.backgroundColor)&&(e.backgroundColor=a)},apply:function(e,t,r){e.backgroundColor&&(0,n.setColor)(t,e.backgroundColor,!0,!!r.isDarkMode,r.darkColorHandler)}}},9804:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.borderBoxFormatHandler=void 0,t.borderBoxFormatHandler={parse:function(e,t){var r;"border-box"==(null===(r=t.style)||void 0===r?void 0:r.boxSizing)&&(e.useBorderBox=!0)},apply:function(e,t){e.useBorderBox&&(t.style.boxSizing="border-box")}}},2412:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.borderFormatHandler=t.BorderKeys=void 0,t.BorderKeys=["borderTop","borderRight","borderBottom","borderLeft"];var r=["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],n=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],o=t.BorderKeys.concat(n);t.borderFormatHandler={parse:function(e,o,i,a){t.BorderKeys.forEach((function(t,n){var i,l=o.style[t],s=null!==(i=a[r[n]])&&void 0!==i?i:"0px",c=o.style[r[n]];"0"==c&&(c="0px"),l&&c!=s&&(e[t]="none"==l?"":l)}));var l=o.style.borderRadius;l?e.borderRadius=l:n.forEach((function(t){var r=o.style[t];r&&(e[t]=r)}))},apply:function(e,t){o.forEach((function(r){var n=e[r];n&&(t.style[r]=n)})),e.borderRadius&&(t.style.borderRadius=e.borderRadius)}}},8005:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boxShadowFormatHandler=void 0,t.boxShadowFormatHandler={parse:function(e,t){var r;(null===(r=t.style)||void 0===r?void 0:r.boxShadow)&&(e.boxShadow=t.style.boxShadow)},apply:function(e,t){e.boxShadow&&(t.style.boxShadow=e.boxShadow)}}},7446:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.datasetFormatHandler=void 0;var n=r(1081);t.datasetFormatHandler={parse:function(e,t){var r=t.dataset;(0,n.getObjectKeys)(r).forEach((function(t){e[t]=r[t]||""}))},apply:function(e,t){(0,n.getObjectKeys)(e).forEach((function(r){t.dataset[r]=e[r]}))}}},756:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.floatFormatHandler=void 0,t.floatFormatHandler={parse:function(e,t){var r=t.style.float||t.getAttribute("align");r&&(e.float=r)},apply:function(e,t){e.float&&(t.style.float=e.float)}}},2925:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.idFormatHandler=void 0,t.idFormatHandler={parse:function(e,t){t.id&&(e.id=t.id)},apply:function(e,t){e.id&&(t.id=e.id)}}},4033:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sizeFormatHandler=void 0;var r=/[\d\.]+%/;function n(e,t){var n=e.getAttribute(t),o=parseInt(n||"");return n&&r.test(n)?n:Number.isNaN(o)||0==o?void 0:o+"px"}t.sizeFormatHandler={parse:function(e,t,r){var o=t.style.width||n(t,"width"),i=t.style.height||n(t,"height"),a=t.style.maxWidth,l=t.style.maxHeight,s=t.style.minWidth,c=t.style.minHeight;o&&(e.width=o),i&&(e.height=i),a&&(e.maxWidth=a),l&&(e.maxHeight=l),s&&(e.minWidth=s),c&&(e.minHeight=c)},apply:function(e,t){e.width&&(t.style.width=e.width),e.height&&(t.style.height=e.height),e.maxWidth&&(t.style.maxWidth=e.maxWidth),e.maxHeight&&(t.style.maxHeight=e.maxHeight),e.minWidth&&(t.style.minWidth=e.minWidth),e.minHeight&&(t.style.minHeight=e.minHeight)}}},5931:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verticalAlignFormatHandler=void 0,t.verticalAlignFormatHandler={parse:function(e,t){switch(t.style.verticalAlign||t.getAttribute("valign")){case"baseline":case"initial":case"super":case"sub":case"text-top":case"text-bottom":case"top":e.verticalAlign="top";break;case"bottom":e.verticalAlign="bottom";break;case"middle":e.verticalAlign="middle"}},apply:function(e,t){e.verticalAlign&&(t.style.verticalAlign=e.verticalAlign)}}},8419:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wordBreakFormatHandler=void 0,t.wordBreakFormatHandler={parse:function(e,t,r,n){var o=t.style.wordBreak||n.wordBreak;o&&(e.wordBreak=o)},apply:function(e,t){e.wordBreak&&(t.style.wordBreak=e.wordBreak)}}},1506:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultFormatAppliers=t.defaultFormatParsers=t.defaultFormatKeysPerCategory=void 0;var n=r(1635),o=r(6187),i=r(4163),a=r(9804),l=r(2412),s=r(8005),c=r(7446),d=r(7917),u=r(8116),p=r(9301),f=r(756),m=r(5249),g=r(1038),h=r(1081),v=r(1400),y=r(2925),b=r(6074),S=r(7761),C=r(6329),_=r(9542),E=r(682),T=r(5203),k=r(1958),M=r(2568),O=r(2214),P=r(4033),w=r(468),x=r(5639),D=r(8143),L=r(4068),I=r(1169),F=r(5936),R=r(9580),N=r(8429),A=r(4218),B=r(5931),j=r(3833),H=r(8419),z={backgroundColor:o.backgroundColorFormatHandler,bold:i.boldFormatHandler,border:l.borderFormatHandler,borderBox:a.borderBoxFormatHandler,boxShadow:s.boxShadowFormatHandler,dataset:c.datasetFormatHandler,direction:d.directionFormatHandler,display:u.displayFormatHandler,float:f.floatFormatHandler,fontFamily:m.fontFamilyFormatHandler,fontSize:g.fontSizeFormatHandler,entity:p.entityFormatHandler,htmlAlign:v.htmlAlignFormatHandler,id:y.idFormatHandler,italic:b.italicFormatHandler,letterSpacing:S.letterSpacingFormatHandler,lineHeight:C.lineHeightFormatHandler,link:_.linkFormatHandler,listItemThread:E.listItemThreadFormatHandler,listLevelThread:T.listLevelThreadFormatHandler,listStyle:k.listStyleFormatHandler,margin:M.marginFormatHandler,padding:O.paddingFormatHandler,size:P.sizeFormatHandler,strike:w.strikeFormatHandler,superOrSubScript:x.superOrSubScriptFormatHandler,tableLayout:D.tableLayoutFormatHandler,tableSpacing:L.tableSpacingFormatHandler,textAlign:I.textAlignFormatHandler,textColor:F.textColorFormatHandler,textColorOnTableCell:R.textColorOnTableCellFormatHandler,textIndent:N.textIndentFormatHandler,underline:A.underlineFormatHandler,verticalAlign:B.verticalAlignFormatHandler,whiteSpace:j.whiteSpaceFormatHandler,wordBreak:H.wordBreakFormatHandler},W=["letterSpacing","fontFamily","fontSize"],G=["strike","underline","superOrSubScript","italic","bold"],U=["direction","textAlign","textIndent","lineHeight","whiteSpace"],K=["backgroundColor","margin","padding","border"];t.defaultFormatKeysPerCategory={block:U,listItemThread:["listItemThread"],listLevelThread:["listLevelThread"],listItemElement:(0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(U),!1),["direction","textAlign","lineHeight","margin","listStyle"],!1),listLevel:["direction","textAlign","margin","padding","listStyle","backgroundColor"],styleBasedSegment:(0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(W),!1),["textColor","backgroundColor","lineHeight"],!1),elementBasedSegment:G,segment:(0,n.__spreadArray)((0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(W),!1),(0,n.__read)(G),!1),["textColor","backgroundColor","lineHeight"],!1),segmentOnBlock:(0,n.__spreadArray)((0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(W),!1),(0,n.__read)(G),!1),["textColor"],!1),segmentOnTableCell:(0,n.__spreadArray)((0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(W),!1),(0,n.__read)(G),!1),["textColorOnTableCell"],!1),tableCell:["border","backgroundColor","padding","verticalAlign","wordBreak","textColor","htmlAlign","size"],tableRow:["backgroundColor"],tableColumn:["size"],table:["id","border","backgroundColor","display","htmlAlign","margin","size","tableLayout","textColor"],tableBorder:["borderBox","tableSpacing"],tableCellBorder:["borderBox"],image:["id","size","margin","padding","borderBox","border","boxShadow","display","float","verticalAlign"],link:["link","textColor","underline","display","margin","padding","backgroundColor","border","size","textAlign"],segmentUnderLink:["textColor"],code:["fontFamily","display"],dataset:["dataset"],divider:(0,n.__spreadArray)((0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(U),!1),(0,n.__read)(K),!1),["display","size","htmlAlign"],!1),container:(0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(K),!1),["htmlAlign","size","display"],!1),entity:["entity"],general:["textColor","backgroundColor"]},t.defaultFormatParsers=(0,h.getObjectKeys)(z).reduce((function(e,t){return e[t]=z[t].parse,e}),{}),t.defaultFormatAppliers=(0,h.getObjectKeys)(z).reduce((function(e,t){return e[t]=z[t].apply,e}),{})},9301:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.entityFormatHandler=void 0;var n=r(4134);t.entityFormatHandler={parse:function(e,t){Object.assign(e,(0,n.parseEntityFormat)(t))},apply:function(e,t){e.isFakeEntity||(t.className=(0,n.generateEntityClassNames)(e)),e.isReadonly?t.contentEditable="false":t.removeAttribute("contenteditable")}}},682:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listItemThreadFormatHandler=void 0;var n=r(8907),o=r(7057);function i(e){return(0,n.isElementOfType)(e,"li")&&(0,o.isNodeOfType)(e.parentNode,"ELEMENT_NODE")&&(0,n.isElementOfType)(e.parentNode,"ol")}t.listItemThreadFormatHandler={parse:function(e,t,r,n){var o=r.listFormat,a=o.levels.length,l=t.style.display||n.display;l&&"list-item"!=l?e.displayForDummyItem=l:i(t)&&a>0&&(o.threadItemCounts[a-1]++,o.threadItemCounts.splice(a),o.levels.forEach((function(e){delete e.format.startNumberOverride})))},apply:function(e,t,r){var n;if(e.displayForDummyItem)t.style.display=e.displayForDummyItem;else if(i(t)){var o=r.listFormat,a=o.threadItemCounts,l=o.nodeStack.length-2;l>=0&&(a.splice(l+1),a[l]=(null!==(n=a[l])&&void 0!==n?n:0)+1)}}}},5203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listLevelThreadFormatHandler=void 0;var n=r(8907);t.listLevelThreadFormatHandler={parse:function(e,t,r){if((0,n.isElementOfType)(t,"ol")){var o=r.listFormat,i=o.threadItemCounts,a=o.levels.length;(1==t.start||"number"==typeof i[a]&&t.start!=i[a]+1)&&(e.startNumberOverride=t.start),i[a]=t.start-1}},apply:function(e,t,r){var o=r.listFormat,i=o.threadItemCounts,a=o.nodeStack.length-2;if(a>=0&&(0,n.isElementOfType)(t,"ol")){var l=e.startNumberOverride;"number"==typeof l?i[a]=l-1:"number"!=typeof i[a]&&(i[a]=0),i.splice(a+1),t.start=i[a]+1}}}},1958:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listStyleFormatHandler=void 0,t.listStyleFormatHandler={parse:function(e,t){var r=t.style.listStylePosition,n=t.style.listStyleType;r&&(e.listStylePosition=r),n&&(e.listStyleType=n)},apply:function(e,t){e.listStylePosition&&(t.style.listStylePosition=e.listStylePosition),e.listStyleType&&(t.style.listStyleType=e.listStyleType)}}},4163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boldFormatHandler=void 0;var n=r(893),o=r(4310);t.boldFormatHandler={parse:function(e,t,r,o){var i=t.style.fontWeight||o.fontWeight;(0,n.shouldSetValue)(i,"400",e.fontWeight,o.fontWeight)&&(e.fontWeight=i)},apply:function(e,t,r){if(void 0!==e.fontWeight){var n=r.implicitFormat.fontWeight;(n&&n!=e.fontWeight||!n&&e.fontWeight&&"normal"!=e.fontWeight)&&("bold"==e.fontWeight?(0,o.wrapAllChildNodes)(t,"b"):t.style.fontWeight=e.fontWeight||"normal")}}}},5249:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fontFamilyFormatHandler=void 0,t.fontFamilyFormatHandler={parse:function(e,t,r,n){var o=t.style.fontFamily||n.fontFamily;o&&"inherit"!=o&&(e.fontFamily=o)},apply:function(e,t,r){e.fontFamily&&e.fontFamily!=r.implicitFormat.fontFamily&&(t.style.fontFamily=e.fontFamily)}}},1038:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fontSizeFormatHandler=void 0;var n=r(5639),o=r(861);t.fontSizeFormatHandler={parse:function(e,t,r,a){var l=t.style.fontSize||a.fontSize,s=t.style.verticalAlign||a.verticalAlign;l&&!(0,n.isSuperOrSubScript)(l,s)&&"inherit"!=l&&(t.style.fontSize?e.fontSize=function(e,t,r){var n=i[e],a=e.endsWith("rem");if(n)return n;if(!("smaller"==e||"larger"==e||e.endsWith("em")||e.endsWith("%")||a))return"inherit"==e||"revert"==e||"unset"==e?void 0:e;if(t||a){var l=a?r.rootFontSize:(0,o.parseValueWithUnit)(t);if(l)switch(e){case"smaller":return Math.round(500*l/6)/100+"px";case"larger":return Math.round(600*l/5)/100+"px";default:return(0,o.parseValueWithUnit)(e,l,"px")+"px"}}}(l,r.segmentFormat.fontSize,r):a.fontSize&&(e.fontSize=l))},apply:function(e,t,r){e.fontSize&&e.fontSize!=r.implicitFormat.fontSize&&(t.style.fontSize=e.fontSize)}};var i={"xx-small":"6.75pt","x-small":"7.5pt",small:"9.75pt",medium:"12pt",large:"13.5pt","x-large":"18pt","xx-large":"24pt","xxx-large":"36pt"}},6074:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.italicFormatHandler=void 0;var n=r(4310);t.italicFormatHandler={parse:function(e,t,r,n){var o=t.style.fontStyle||n.fontStyle;"italic"==o||"oblique"==o?e.italic=!0:"initial"!=o&&"normal"!=o||(e.italic=!1)},apply:function(e,t,r){void 0!==e.italic&&!!r.implicitFormat.italic!=!!e.italic&&(e.italic?(0,n.wrapAllChildNodes)(t,"i"):t.style.fontStyle="normal")}}},7761:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.letterSpacingFormatHandler=void 0;var n=r(893);t.letterSpacingFormatHandler={parse:function(e,t,r,o){var i=t.style.letterSpacing||o.letterSpacing;(0,n.shouldSetValue)(i,"normal",e.letterSpacing,o.letterSpacing)&&(e.letterSpacing=i)},apply:function(e,t){e.letterSpacing&&(t.style.letterSpacing=e.letterSpacing)}}},9542:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.linkFormatHandler=void 0;var n=r(8907);t.linkFormatHandler={parse:function(e,t){if((0,n.isElementOfType)(t,"a")){var r=t.name,o=t.getAttribute("href"),i=t.target,a=t.rel,l=t.id,s=t.className,c=t.title;r&&(e.name=r),o&&(e.href=o),i&&(e.target=i),l&&(e.anchorId=l),a&&(e.relationship=a),c&&(e.anchorTitle=c),s&&(e.anchorClass=s)}},apply:function(e,t){(0,n.isElementOfType)(t,"a")&&e.href&&(t.href=e.href,e.name&&(t.name=e.name),e.target&&(t.target=e.target),e.anchorId&&(t.id=e.anchorId),e.anchorClass&&(t.className=e.anchorClass),e.anchorTitle&&(t.title=e.anchorTitle),e.relationship&&(t.rel=e.relationship))}}},468:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.strikeFormatHandler=void 0;var n=r(4310);t.strikeFormatHandler={parse:function(e,t,r,n){var o=t.style.textDecoration||n.textDecoration;(null==o?void 0:o.indexOf("line-through"))>=0&&(e.strikethrough=!0)},apply:function(e,t){e.strikethrough&&(0,n.wrapAllChildNodes)(t,"s")}}},5639:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSuperOrSubScript=t.superOrSubScriptFormatHandler=void 0;var n=r(4310);function o(e,t){return"smaller"==e&&("sub"==t||"super"==t)}t.superOrSubScriptFormatHandler={parse:function(e,t,r,n){var i=t.style.verticalAlign||n.verticalAlign;o(t.style.fontSize||n.fontSize,i)&&(e.superOrSubScriptSequence=(e.superOrSubScriptSequence||"").split(" ").concat(i).join(" ").trim())},apply:function(e,t){e.superOrSubScriptSequence&&e.superOrSubScriptSequence.split(" ").reverse().forEach((function(e){var r="super"==e?"sup":"sub"==e?"sub":null;r&&(0,n.wrapAllChildNodes)(t,r)}))}},t.isSuperOrSubScript=o},5936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textColorFormatHandler=void 0;var n=r(488);t.textColorFormatHandler={parse:function(e,t,r,o){var i=(0,n.getColor)(t,!1,!!r.isDarkMode,r.darkColorHandler)||o.color;i&&"inherit"!=i&&(e.textColor=i)},apply:function(e,t,r){var o=r.implicitFormat.textColor;e.textColor&&e.textColor!=o&&(0,n.setColor)(t,e.textColor,!1,!!r.isDarkMode,r.darkColorHandler)}}},4218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.underlineFormatHandler=void 0;var n=r(4310);t.underlineFormatHandler={parse:function(e,t,r,n){var o=t.style.textDecoration||n.textDecoration;(null==o?void 0:o.indexOf("underline"))>=0?e.underline=!0:"A"==t.tagName&&"none"==o&&(e.underline=!1)},apply:function(e,t,r){void 0!==e.underline&&!!r.implicitFormat.underline!=!!e.underline&&(e.underline?(0,n.wrapAllChildNodes)(t,"u"):t.style.textDecoration="none")}}},8143:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tableLayoutFormatHandler=void 0,t.tableLayoutFormatHandler={parse:function(e,t){var r=t.style.tableLayout;r&&"inherit"!=r&&(e.tableLayout=r)},apply:function(e,t){e.tableLayout&&(t.style.tableLayout=e.tableLayout)}}},4068:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tableSpacingFormatHandler=void 0;var r="collapse",n="separate";t.tableSpacingFormatHandler={parse:function(e,t){(t.style.borderCollapse==r||t.getAttribute("cellPadding"))&&(e.borderCollapse=!0),t.style.borderCollapse==n&&(e.borderSeparate=!0)},apply:function(e,t){e.borderCollapse?(t.style.borderCollapse=r,t.style.borderSpacing="0",t.style.boxSizing="border-box"):e.borderSeparate&&(t.style.borderCollapse=n,t.style.borderSpacing="0",t.style.boxSizing="border-box")}}},9580:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textColorOnTableCellFormatHandler=void 0,t.textColorOnTableCellFormatHandler={parse:function(e,t){t.style.color&&delete e.textColor},apply:function(){}}},488:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseColor=t.defaultGenerateColorKey=t.setColor=t.getColor=t.DeprecatedColors=void 0;var n=r(1635),o=r(1081);t.DeprecatedColors=["inactiveborder","activeborder","inactivecaptiontext","inactivecaption","activecaption","appworkspace","infobackground","background","buttonhighlight","buttonshadow","captiontext","infotext","menutext","menu","scrollbar","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedfhadow","windowtext","windowframe","window"];var i=/^#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])$/,a=/^#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/,l=/^rgb\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*\)$/,s=/^rgba\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*\)$/,c=/^\s*var\(\s*(\-\-[a-zA-Z0-9\-_]+)\s*(?:,\s*(.*))?\)\s*$/,d="var(";function u(e){var t;return(t=(e=(e||"").trim()).match(i))?[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]:(t=e.match(a))?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:(t=e.match(l)||e.match(s))?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}t.getColor=function(e,r,n,i){var a=(r?e.style.backgroundColor:e.style.color)||e.getAttribute(r?"bgcolor":"color")||void 0;if(a&&t.DeprecatedColors.indexOf(a)>-1)a=r?void 0:"rgb(0, 0, 0)";else if(i&&a){var l=a.startsWith(d)?c.exec(a):null;l?a=l[2]||"":n&&(a=function(e,t){var r=u(e);if(r&&t){var n=(0,o.getObjectKeys)(t).find((function(e){var n=u(t[e].darkModeColor);return n&&n[0]==r[0]&&n[1]==r[1]&&n[2]==r[2]}));if(n)return t[n].lightModeColor}return null}(a,i.knownColors)||"")}return a},t.setColor=function(e,t,r,o,i){var a,l,s=t&&t.startsWith(d)?c.exec(t):null,u=(0,n.__read)(null!=s?s:[],3),p=(u[0],u[1]),f=u[2];if(t=null!=f?f:t,i&&t){var m=r?"background":"text",g=p||i.generateColorKey(t,void 0,m,e),h=(null===(l=null===(a=i.knownColors)||void 0===a?void 0:a[g])||void 0===l?void 0:l.darkModeColor)||i.getDarkColor(t,void 0,m,e);i.updateKnownColor(o,g,{lightModeColor:t,darkModeColor:h}),t=o?""+d+g+", "+t+")":t}e.removeAttribute(r?"bgcolor":"color"),e.style.setProperty(r?"background-color":"color",t||null)},t.defaultGenerateColorKey=function(e){return"--darkColor_"+e.replace(/[^\d\w]/g,"_")},t.parseColor=u},7340:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcAlign=t.ResultMap=void 0,t.ResultMap={start:{ltr:"left",rtl:"right"},center:{ltr:"center",rtl:"center"},end:{ltr:"right",rtl:"left"},initial:{ltr:"initial",rtl:"initial"},justify:{ltr:"justify",rtl:"justify"}},t.calcAlign=function(e,t){switch(e){case"center":return"center";case"left":return"rtl"==t?"end":"start";case"right":return"rtl"==t?"start":"end";case"start":case"end":case"justify":case"initial":return e;default:return}}},861:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseValueWithUnit=void 0;var n=r(1635),o=/(-?\d+(\.\d+)?)([a-z]+|%)/;function i(e){var t,r;if(void 0===e)return 0;if("number"==typeof e)return e;var n=null!==(r=null===(t=e.ownerDocument.defaultView)||void 0===t?void 0:t.getComputedStyle(e).fontSize)&&void 0!==r?r:"";return a(parseFloat(n))}function a(e){return Math.round(4e3*e/3)/1e3}t.parseValueWithUnit=function(e,t,r){void 0===e&&(e=""),void 0===r&&(r="px");var l,s=o.exec(e),c=0;if(s){var d=(0,n.__read)(s,4),u=(d[0],d[1]),p=(d[2],d[3]),f=parseFloat(u);switch(p){case"px":c=f;break;case"pt":c=a(f);break;case"em":c=i(t)*f;break;case"ex":c=i(t)*f/2;break;case"%":c=i(t)*f/100;break;case"in":c=96*f;break;case"rem":c=(i(t)||16)*f}}return c>0&&"pt"==r&&(l=c,c=Math.round(3e3*l/4)/1e3),c}},893:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldSetValue=void 0,t.shouldSetValue=function(e,t,r,n){return!!e&&"inherit"!=e&&!!(e!=t||r||n&&e!=n)}},4990:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGeneralBlock=t.createGeneralSegment=t.createParagraphDecorator=t.createContentModelDocument=t.createImage=t.createText=t.createTableCell=t.createTable=t.createSelectionMarker=t.createParagraph=t.createFormatContainer=t.createListItem=t.createBr=t.normalizeRect=t.isWhiteSpacePreserved=t.reuseCachedElement=t.findClosestBlockEntityContainer=t.isBlockEntityContainer=t.isEntityDelimiter=t.addDelimiters=t.generateEntityClassNames=t.parseEntityFormat=t.getAllEntityWrappers=t.findClosestEntityWrapper=t.isEntityElement=t.unwrap=t.wrap=t.wrapAllChildNodes=t.moveChildNodes=t.toArray=t.getSafeIdSelector=t.getObjectKeys=t.isElementOfType=t.isNodeOfType=t.hasMetadata=t.getMetadata=t.updateMetadata=t.buildSelectionMarker=t.isBlockElement=t.areSameFormats=t.parseFormat=t.getRegularSelectionOffsets=t.tableProcessor=t.entityProcessor=t.processChildNode=t.handleRegularSelection=t.childProcessor=t.contentModelToText=t.contentModelToDom=t.domToContentModel=void 0,t.extractClipboardItems=t.transformColor=t.readFile=t.parseTableCells=t.normalizeText=t.isSpace=t.isPunctuation=t.extractBorderValues=t.combineBorderValue=t.isCursorMovingKey=t.isModifierKey=t.isCharacterValue=t.getDOMInsertPointRect=t.getSelectionRootNode=t.isBold=t.createModelToDomConfig=t.createModelToDomContextWithConfig=t.createModelToDomContext=t.createDomToModelConfig=t.createDomToModelContextWithConfig=t.createDomToModelContext=t.defaultGenerateColorKey=t.parseColor=t.setColor=t.getColor=t.DeprecatedColors=t.BorderKeys=t.parseValueWithUnit=t.getAutoListStyleType=t.getOrderedListNumberStr=t.setParagraphNotImplicit=t.normalizeSingleSegment=t.isEmpty=t.addSegment=t.unwrapBlock=t.isGeneralSegment=t.normalizeContentModel=t.normalizeParagraph=t.addTextSegment=t.addLink=t.addCode=t.addBlock=t.mutateSegment=t.mutateSegments=t.mutateBlock=t.createTableRow=t.createEmptyModel=t.createListLevel=t.createDivider=t.createEntity=void 0,t.EmptySegmentFormat=t.UnorderedListStyleMap=t.OrderedListStyleMap=t.TableBorderFormat=t.NumberingListType=t.BulletListType=t.ChangeSource=t.ListMetadataDefinition=t.getListMetadata=t.updateListMetadata=t.getTableMetadata=t.updateTableMetadata=t.getTableCellMetadata=t.updateTableCellMetadata=t.getImageMetadata=t.updateImageMetadata=t.runEditSteps=t.getClosestAncestorBlockGroupIndex=t.getSegmentTextFormat=t.getListStyleTypeFromString=t.retrieveModelFormatState=t.setTableCellBackgroundColor=t.MIN_ALLOWED_TABLE_CELL_HEIGHT=t.MIN_ALLOWED_TABLE_CELL_WIDTH=t.normalizeTable=t.setFirstColumnFormatBorders=t.applyTableFormat=t.deleteBlock=t.deleteSegment=t.deleteSelection=t.mergeModel=t.cloneModel=t.setSelection=t.hasSelectionInBlockGroup=t.hasSelectionInSegment=t.hasSelectionInBlock=t.getSelectedCells=t.getSelectedSegmentsAndParagraphs=t.getSelectedSegments=t.getSelectedParagraphs=t.getOperationalBlocks=t.getFirstSelectedTable=t.getFirstSelectedListItem=t.iterateSelections=t.isBlockGroupOfType=t.cacheGetEventData=void 0;var n=r(4598);Object.defineProperty(t,"domToContentModel",{enumerable:!0,get:function(){return n.domToContentModel}});var o=r(2038);Object.defineProperty(t,"contentModelToDom",{enumerable:!0,get:function(){return o.contentModelToDom}});var i=r(5132);Object.defineProperty(t,"contentModelToText",{enumerable:!0,get:function(){return i.contentModelToText}});var a=r(4225);Object.defineProperty(t,"childProcessor",{enumerable:!0,get:function(){return a.childProcessor}}),Object.defineProperty(t,"handleRegularSelection",{enumerable:!0,get:function(){return a.handleRegularSelection}}),Object.defineProperty(t,"processChildNode",{enumerable:!0,get:function(){return a.processChildNode}});var l=r(2670);Object.defineProperty(t,"entityProcessor",{enumerable:!0,get:function(){return l.entityProcessor}});var s=r(3815);Object.defineProperty(t,"tableProcessor",{enumerable:!0,get:function(){return s.tableProcessor}});var c=r(7441);Object.defineProperty(t,"getRegularSelectionOffsets",{enumerable:!0,get:function(){return c.getRegularSelectionOffsets}});var d=r(1839);Object.defineProperty(t,"parseFormat",{enumerable:!0,get:function(){return d.parseFormat}});var u=r(9187);Object.defineProperty(t,"areSameFormats",{enumerable:!0,get:function(){return u.areSameFormats}});var p=r(7448);Object.defineProperty(t,"isBlockElement",{enumerable:!0,get:function(){return p.isBlockElement}});var f=r(8411);Object.defineProperty(t,"buildSelectionMarker",{enumerable:!0,get:function(){return f.buildSelectionMarker}});var m=r(5442);Object.defineProperty(t,"updateMetadata",{enumerable:!0,get:function(){return m.updateMetadata}}),Object.defineProperty(t,"getMetadata",{enumerable:!0,get:function(){return m.getMetadata}}),Object.defineProperty(t,"hasMetadata",{enumerable:!0,get:function(){return m.hasMetadata}});var g=r(7057);Object.defineProperty(t,"isNodeOfType",{enumerable:!0,get:function(){return g.isNodeOfType}});var h=r(8907);Object.defineProperty(t,"isElementOfType",{enumerable:!0,get:function(){return h.isElementOfType}});var v=r(1081);Object.defineProperty(t,"getObjectKeys",{enumerable:!0,get:function(){return v.getObjectKeys}});var y=r(6039);Object.defineProperty(t,"getSafeIdSelector",{enumerable:!0,get:function(){return y.getSafeIdSelector}});var b=r(872);Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return b.toArray}});var S=r(4310);Object.defineProperty(t,"moveChildNodes",{enumerable:!0,get:function(){return S.moveChildNodes}}),Object.defineProperty(t,"wrapAllChildNodes",{enumerable:!0,get:function(){return S.wrapAllChildNodes}});var C=r(7828);Object.defineProperty(t,"wrap",{enumerable:!0,get:function(){return C.wrap}});var _=r(2463);Object.defineProperty(t,"unwrap",{enumerable:!0,get:function(){return _.unwrap}});var E=r(4134);Object.defineProperty(t,"isEntityElement",{enumerable:!0,get:function(){return E.isEntityElement}}),Object.defineProperty(t,"findClosestEntityWrapper",{enumerable:!0,get:function(){return E.findClosestEntityWrapper}}),Object.defineProperty(t,"getAllEntityWrappers",{enumerable:!0,get:function(){return E.getAllEntityWrappers}}),Object.defineProperty(t,"parseEntityFormat",{enumerable:!0,get:function(){return E.parseEntityFormat}}),Object.defineProperty(t,"generateEntityClassNames",{enumerable:!0,get:function(){return E.generateEntityClassNames}}),Object.defineProperty(t,"addDelimiters",{enumerable:!0,get:function(){return E.addDelimiters}}),Object.defineProperty(t,"isEntityDelimiter",{enumerable:!0,get:function(){return E.isEntityDelimiter}}),Object.defineProperty(t,"isBlockEntityContainer",{enumerable:!0,get:function(){return E.isBlockEntityContainer}}),Object.defineProperty(t,"findClosestBlockEntityContainer",{enumerable:!0,get:function(){return E.findClosestBlockEntityContainer}});var T=r(9290);Object.defineProperty(t,"reuseCachedElement",{enumerable:!0,get:function(){return T.reuseCachedElement}});var k=r(3869);Object.defineProperty(t,"isWhiteSpacePreserved",{enumerable:!0,get:function(){return k.isWhiteSpacePreserved}});var M=r(107);Object.defineProperty(t,"normalizeRect",{enumerable:!0,get:function(){return M.normalizeRect}});var O=r(4814);Object.defineProperty(t,"createBr",{enumerable:!0,get:function(){return O.createBr}});var P=r(6953);Object.defineProperty(t,"createListItem",{enumerable:!0,get:function(){return P.createListItem}});var w=r(5470);Object.defineProperty(t,"createFormatContainer",{enumerable:!0,get:function(){return w.createFormatContainer}});var x=r(5450);Object.defineProperty(t,"createParagraph",{enumerable:!0,get:function(){return x.createParagraph}});var D=r(7192);Object.defineProperty(t,"createSelectionMarker",{enumerable:!0,get:function(){return D.createSelectionMarker}});var L=r(1728);Object.defineProperty(t,"createTable",{enumerable:!0,get:function(){return L.createTable}});var I=r(7720);Object.defineProperty(t,"createTableCell",{enumerable:!0,get:function(){return I.createTableCell}});var F=r(8465);Object.defineProperty(t,"createText",{enumerable:!0,get:function(){return F.createText}});var R=r(6349);Object.defineProperty(t,"createImage",{enumerable:!0,get:function(){return R.createImage}});var N=r(7357);Object.defineProperty(t,"createContentModelDocument",{enumerable:!0,get:function(){return N.createContentModelDocument}});var A=r(6357);Object.defineProperty(t,"createParagraphDecorator",{enumerable:!0,get:function(){return A.createParagraphDecorator}});var B=r(7431);Object.defineProperty(t,"createGeneralSegment",{enumerable:!0,get:function(){return B.createGeneralSegment}});var j=r(5219);Object.defineProperty(t,"createGeneralBlock",{enumerable:!0,get:function(){return j.createGeneralBlock}});var H=r(5681);Object.defineProperty(t,"createEntity",{enumerable:!0,get:function(){return H.createEntity}});var z=r(6133);Object.defineProperty(t,"createDivider",{enumerable:!0,get:function(){return z.createDivider}});var W=r(598);Object.defineProperty(t,"createListLevel",{enumerable:!0,get:function(){return W.createListLevel}});var G=r(3992);Object.defineProperty(t,"createEmptyModel",{enumerable:!0,get:function(){return G.createEmptyModel}});var U=r(3262);Object.defineProperty(t,"createTableRow",{enumerable:!0,get:function(){return U.createTableRow}});var K=r(376);Object.defineProperty(t,"mutateBlock",{enumerable:!0,get:function(){return K.mutateBlock}}),Object.defineProperty(t,"mutateSegments",{enumerable:!0,get:function(){return K.mutateSegments}}),Object.defineProperty(t,"mutateSegment",{enumerable:!0,get:function(){return K.mutateSegment}});var V=r(2394);Object.defineProperty(t,"addBlock",{enumerable:!0,get:function(){return V.addBlock}});var q=r(9849);Object.defineProperty(t,"addCode",{enumerable:!0,get:function(){return q.addCode}});var Z=r(9849);Object.defineProperty(t,"addLink",{enumerable:!0,get:function(){return Z.addLink}});var X=r(7423);Object.defineProperty(t,"addTextSegment",{enumerable:!0,get:function(){return X.addTextSegment}});var Y=r(9981);Object.defineProperty(t,"normalizeParagraph",{enumerable:!0,get:function(){return Y.normalizeParagraph}});var $=r(8941);Object.defineProperty(t,"normalizeContentModel",{enumerable:!0,get:function(){return $.normalizeContentModel}});var Q=r(4182);Object.defineProperty(t,"isGeneralSegment",{enumerable:!0,get:function(){return Q.isGeneralSegment}});var J=r(8840);Object.defineProperty(t,"unwrapBlock",{enumerable:!0,get:function(){return J.unwrapBlock}});var ee=r(5142);Object.defineProperty(t,"addSegment",{enumerable:!0,get:function(){return ee.addSegment}});var te=r(5061);Object.defineProperty(t,"isEmpty",{enumerable:!0,get:function(){return te.isEmpty}});var re=r(1966);Object.defineProperty(t,"normalizeSingleSegment",{enumerable:!0,get:function(){return re.normalizeSingleSegment}});var ne=r(7958);Object.defineProperty(t,"setParagraphNotImplicit",{enumerable:!0,get:function(){return ne.setParagraphNotImplicit}});var oe=r(4402);Object.defineProperty(t,"getOrderedListNumberStr",{enumerable:!0,get:function(){return oe.getOrderedListNumberStr}});var ie=r(2061);Object.defineProperty(t,"getAutoListStyleType",{enumerable:!0,get:function(){return ie.getAutoListStyleType}});var ae=r(861);Object.defineProperty(t,"parseValueWithUnit",{enumerable:!0,get:function(){return ae.parseValueWithUnit}});var le=r(2412);Object.defineProperty(t,"BorderKeys",{enumerable:!0,get:function(){return le.BorderKeys}});var se=r(488);Object.defineProperty(t,"DeprecatedColors",{enumerable:!0,get:function(){return se.DeprecatedColors}}),Object.defineProperty(t,"getColor",{enumerable:!0,get:function(){return se.getColor}}),Object.defineProperty(t,"setColor",{enumerable:!0,get:function(){return se.setColor}}),Object.defineProperty(t,"parseColor",{enumerable:!0,get:function(){return se.parseColor}}),Object.defineProperty(t,"defaultGenerateColorKey",{enumerable:!0,get:function(){return se.defaultGenerateColorKey}});var ce=r(7404);Object.defineProperty(t,"createDomToModelContext",{enumerable:!0,get:function(){return ce.createDomToModelContext}}),Object.defineProperty(t,"createDomToModelContextWithConfig",{enumerable:!0,get:function(){return ce.createDomToModelContextWithConfig}}),Object.defineProperty(t,"createDomToModelConfig",{enumerable:!0,get:function(){return ce.createDomToModelConfig}});var de=r(4768);Object.defineProperty(t,"createModelToDomContext",{enumerable:!0,get:function(){return de.createModelToDomContext}}),Object.defineProperty(t,"createModelToDomContextWithConfig",{enumerable:!0,get:function(){return de.createModelToDomContextWithConfig}}),Object.defineProperty(t,"createModelToDomConfig",{enumerable:!0,get:function(){return de.createModelToDomConfig}});var ue=r(9265);Object.defineProperty(t,"isBold",{enumerable:!0,get:function(){return ue.isBold}});var pe=r(8257);Object.defineProperty(t,"getSelectionRootNode",{enumerable:!0,get:function(){return pe.getSelectionRootNode}});var fe=r(3120);Object.defineProperty(t,"getDOMInsertPointRect",{enumerable:!0,get:function(){return fe.getDOMInsertPointRect}});var me=r(9076);Object.defineProperty(t,"isCharacterValue",{enumerable:!0,get:function(){return me.isCharacterValue}}),Object.defineProperty(t,"isModifierKey",{enumerable:!0,get:function(){return me.isModifierKey}}),Object.defineProperty(t,"isCursorMovingKey",{enumerable:!0,get:function(){return me.isCursorMovingKey}});var ge=r(9298);Object.defineProperty(t,"combineBorderValue",{enumerable:!0,get:function(){return ge.combineBorderValue}}),Object.defineProperty(t,"extractBorderValues",{enumerable:!0,get:function(){return ge.extractBorderValues}});var he=r(5245);Object.defineProperty(t,"isPunctuation",{enumerable:!0,get:function(){return he.isPunctuation}}),Object.defineProperty(t,"isSpace",{enumerable:!0,get:function(){return he.isSpace}}),Object.defineProperty(t,"normalizeText",{enumerable:!0,get:function(){return he.normalizeText}});var ve=r(7311);Object.defineProperty(t,"parseTableCells",{enumerable:!0,get:function(){return ve.parseTableCells}});var ye=r(1074);Object.defineProperty(t,"readFile",{enumerable:!0,get:function(){return ye.readFile}});var be=r(6537);Object.defineProperty(t,"transformColor",{enumerable:!0,get:function(){return be.transformColor}});var Se=r(9526);Object.defineProperty(t,"extractClipboardItems",{enumerable:!0,get:function(){return Se.extractClipboardItems}});var Ce=r(6819);Object.defineProperty(t,"cacheGetEventData",{enumerable:!0,get:function(){return Ce.cacheGetEventData}});var _e=r(1186);Object.defineProperty(t,"isBlockGroupOfType",{enumerable:!0,get:function(){return _e.isBlockGroupOfType}});var Ee=r(3136);Object.defineProperty(t,"iterateSelections",{enumerable:!0,get:function(){return Ee.iterateSelections}});var Te=r(2144);Object.defineProperty(t,"getFirstSelectedListItem",{enumerable:!0,get:function(){return Te.getFirstSelectedListItem}}),Object.defineProperty(t,"getFirstSelectedTable",{enumerable:!0,get:function(){return Te.getFirstSelectedTable}}),Object.defineProperty(t,"getOperationalBlocks",{enumerable:!0,get:function(){return Te.getOperationalBlocks}}),Object.defineProperty(t,"getSelectedParagraphs",{enumerable:!0,get:function(){return Te.getSelectedParagraphs}}),Object.defineProperty(t,"getSelectedSegments",{enumerable:!0,get:function(){return Te.getSelectedSegments}}),Object.defineProperty(t,"getSelectedSegmentsAndParagraphs",{enumerable:!0,get:function(){return Te.getSelectedSegmentsAndParagraphs}});var ke=r(6303);Object.defineProperty(t,"getSelectedCells",{enumerable:!0,get:function(){return ke.getSelectedCells}});var Me=r(7691);Object.defineProperty(t,"hasSelectionInBlock",{enumerable:!0,get:function(){return Me.hasSelectionInBlock}});var Oe=r(3407);Object.defineProperty(t,"hasSelectionInSegment",{enumerable:!0,get:function(){return Oe.hasSelectionInSegment}});var Pe=r(9404);Object.defineProperty(t,"hasSelectionInBlockGroup",{enumerable:!0,get:function(){return Pe.hasSelectionInBlockGroup}});var we=r(7595);Object.defineProperty(t,"setSelection",{enumerable:!0,get:function(){return we.setSelection}});var xe=r(7457);Object.defineProperty(t,"cloneModel",{enumerable:!0,get:function(){return xe.cloneModel}});var De=r(8458);Object.defineProperty(t,"mergeModel",{enumerable:!0,get:function(){return De.mergeModel}});var Le=r(9584);Object.defineProperty(t,"deleteSelection",{enumerable:!0,get:function(){return Le.deleteSelection}});var Ie=r(7987);Object.defineProperty(t,"deleteSegment",{enumerable:!0,get:function(){return Ie.deleteSegment}});var Fe=r(9039);Object.defineProperty(t,"deleteBlock",{enumerable:!0,get:function(){return Fe.deleteBlock}});var Re=r(7784);Object.defineProperty(t,"applyTableFormat",{enumerable:!0,get:function(){return Re.applyTableFormat}}),Object.defineProperty(t,"setFirstColumnFormatBorders",{enumerable:!0,get:function(){return Re.setFirstColumnFormatBorders}});var Ne=r(1166);Object.defineProperty(t,"normalizeTable",{enumerable:!0,get:function(){return Ne.normalizeTable}}),Object.defineProperty(t,"MIN_ALLOWED_TABLE_CELL_WIDTH",{enumerable:!0,get:function(){return Ne.MIN_ALLOWED_TABLE_CELL_WIDTH}}),Object.defineProperty(t,"MIN_ALLOWED_TABLE_CELL_HEIGHT",{enumerable:!0,get:function(){return Ne.MIN_ALLOWED_TABLE_CELL_HEIGHT}});var Ae=r(636);Object.defineProperty(t,"setTableCellBackgroundColor",{enumerable:!0,get:function(){return Ae.setTableCellBackgroundColor}});var Be=r(2504);Object.defineProperty(t,"retrieveModelFormatState",{enumerable:!0,get:function(){return Be.retrieveModelFormatState}});var je=r(8955);Object.defineProperty(t,"getListStyleTypeFromString",{enumerable:!0,get:function(){return je.getListStyleTypeFromString}});var He=r(654);Object.defineProperty(t,"getSegmentTextFormat",{enumerable:!0,get:function(){return He.getSegmentTextFormat}});var ze=r(7921);Object.defineProperty(t,"getClosestAncestorBlockGroupIndex",{enumerable:!0,get:function(){return ze.getClosestAncestorBlockGroupIndex}});var We=r(5471);Object.defineProperty(t,"runEditSteps",{enumerable:!0,get:function(){return We.runEditSteps}});var Ge=r(9655);Object.defineProperty(t,"updateImageMetadata",{enumerable:!0,get:function(){return Ge.updateImageMetadata}}),Object.defineProperty(t,"getImageMetadata",{enumerable:!0,get:function(){return Ge.getImageMetadata}});var Ue=r(318);Object.defineProperty(t,"updateTableCellMetadata",{enumerable:!0,get:function(){return Ue.updateTableCellMetadata}}),Object.defineProperty(t,"getTableCellMetadata",{enumerable:!0,get:function(){return Ue.getTableCellMetadata}});var Ke=r(9966);Object.defineProperty(t,"updateTableMetadata",{enumerable:!0,get:function(){return Ke.updateTableMetadata}}),Object.defineProperty(t,"getTableMetadata",{enumerable:!0,get:function(){return Ke.getTableMetadata}});var Ve=r(8294);Object.defineProperty(t,"updateListMetadata",{enumerable:!0,get:function(){return Ve.updateListMetadata}}),Object.defineProperty(t,"getListMetadata",{enumerable:!0,get:function(){return Ve.getListMetadata}}),Object.defineProperty(t,"ListMetadataDefinition",{enumerable:!0,get:function(){return Ve.ListMetadataDefinition}});var qe=r(8187);Object.defineProperty(t,"ChangeSource",{enumerable:!0,get:function(){return qe.ChangeSource}});var Ze=r(602);Object.defineProperty(t,"BulletListType",{enumerable:!0,get:function(){return Ze.BulletListType}});var Xe=r(5043);Object.defineProperty(t,"NumberingListType",{enumerable:!0,get:function(){return Xe.NumberingListType}});var Ye=r(6705);Object.defineProperty(t,"TableBorderFormat",{enumerable:!0,get:function(){return Ye.TableBorderFormat}});var $e=r(3180);Object.defineProperty(t,"OrderedListStyleMap",{enumerable:!0,get:function(){return $e.OrderedListStyleMap}});var Qe=r(2901);Object.defineProperty(t,"UnorderedListStyleMap",{enumerable:!0,get:function(){return Qe.UnorderedListStyleMap}});var Je=r(5287);Object.defineProperty(t,"EmptySegmentFormat",{enumerable:!0,get:function(){return Je.EmptySegmentFormat}})},7958:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setParagraphNotImplicit=void 0;var n=r(376);t.setParagraphNotImplicit=function(e){"Paragraph"==e.blockType&&e.isImplicit&&((0,n.mutateBlock)(e).isImplicit=!1)}},2394:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addBlock=void 0,t.addBlock=function(e,t){e.blocks.push(t)}},9849:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addDecorators=t.addCode=t.addLink=void 0;var n=r(1635);function o(e,t){t.format.href&&(e.link={format:(0,n.__assign)({},t.format),dataset:(0,n.__assign)({},t.dataset)})}function i(e,t){t.format.fontFamily&&(e.code={format:(0,n.__assign)({},t.format)})}t.addLink=o,t.addCode=i,t.addDecorators=function(e,t){o(e,t.link),i(e,t.code)}},5142:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addSegment=void 0;var n=r(8276);t.addSegment=function(e,t,r,o){var i=(0,n.ensureParagraph)(e,r,o),a=i.segments[i.segments.length-1];return(null==r?void 0:r.textIndent)&&(r.isTextIndentApplied&&0==i.segments.length?delete i.format.textIndent:r.isTextIndentApplied=!0,delete i.format.isTextIndentApplied),"SelectionMarker"==t.segmentType?a&&a.isSelected&&t.isSelected||i.segments.push(t):(t.isSelected&&"SelectionMarker"==(null==a?void 0:a.segmentType)&&a.isSelected&&i.segments.pop(),i.segments.push(t)),i}},7423:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addTextSegment=void 0;var n=r(9849),o=r(5142),i=r(8465),a=r(8276),l=r(9833),s=r(3869);t.addTextSegment=function(e,t,r){var c,d;if(t){var u=(0,a.ensureParagraph)(e,r.blockFormat);(!(0,l.hasSpacesOnly)(t)||(null!==(c=null==u?void 0:u.segments.length)&&void 0!==c?c:0)>0||(0,s.isWhiteSpacePreserved)(null==u?void 0:u.format.whiteSpace))&&(d=(0,i.createText)(t,r.segmentFormat),r.isInSelection&&(d.isSelected=!0),(0,n.addDecorators)(d,r),(0,o.addSegment)(e,d,r.blockFormat))}return d}},8276:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ensureParagraph=void 0;var n=r(2394),o=r(5450),i=r(376);t.ensureParagraph=function(e,t,r){var a=e.blocks[e.blocks.length-1];if("Paragraph"==(null==a?void 0:a.blockType))return(0,i.mutateBlock)(a);var l=(0,o.createParagraph)(!0,t,r);return(0,n.addBlock)(e,l),l}},9833:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasSpacesOnly=void 0;var r=/^[\r\n\t ]*$/;t.hasSpacesOnly=function(e){return r.test(e)}},5061:(e,t)=>{"use strict";function r(e){switch(e.blockType){case"Paragraph":return 0==e.segments.length;case"Table":return e.rows.every((function(e){return 0==e.cells.length}));case"BlockGroup":return n(e);default:return!1}}function n(e){switch(e.blockGroupType){case"FormatContainer":return"div"!=e.tagName&&e.blocks.every(r);case"ListItem":return e.blocks.every(r);case"Document":case"General":case"TableCell":return!1;default:return!0}}function o(e){switch(e.segmentType){case"Text":return!e.text;case"Image":return!e.src;default:return!1}}Object.defineProperty(t,"__esModule",{value:!0}),t.isEmpty=t.isSegmentEmpty=t.isBlockGroupEmpty=t.isBlockEmpty=void 0,t.isBlockEmpty=r,t.isBlockGroupEmpty=n,t.isSegmentEmpty=o,t.isEmpty=function(e){return function(e){return"string"==typeof e.blockGroupType}(e)?n(e):function(e){return"string"==typeof e.blockType}(e)?r(e):!!function(e){return"string"==typeof e.segmentType}(e)&&o(e)}},376:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mutateSegment=t.mutateSegments=t.mutateBlock=void 0;var n=r(1635);function o(e){return e.cachedElement&&delete e.cachedElement,"Table"==e.blockType?e.rows.forEach((function(e){delete e.cachedElement})):"ListItem"==e.blockGroupType&&e.levels.forEach((function(e){return delete e.cachedElement})),e}function i(e,t){var r=o(e),n=[r,[],[]];return t&&t.forEach((function(t){var o=e.segments.indexOf(t);o>=0&&(n[1].push(r.segments[o]),n[2].push(o))})),n}t.mutateBlock=o,t.mutateSegments=i,t.mutateSegment=function(e,t,r){var o,a=(0,n.__read)(i(e,[t]),3),l=a[0],s=a[1],c=a[2],d=s[0]==t?s[0]:null;return r&&d&&r(s[0],l,c[0]),[l,d,null!==(o=c[0])&&void 0!==o?o:-1]}},8941:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeContentModel=void 0;var n=r(5061),o=r(376),i=r(9981),a=r(8840);t.normalizeContentModel=function e(t){for(var r=t.blocks.length-1;r>=0;r--){var l=t.blocks[r];switch(l.blockType){case"BlockGroup":"ListItem"==l.blockGroupType&&0==l.levels.length?(r+=l.blocks.length,(0,a.unwrapBlock)(t,l)):e(l);break;case"Paragraph":(0,i.normalizeParagraph)(l);break;case"Table":for(var s=0;s<l.rows.length;s++)for(var c=0;c<l.rows[s].cells.length;c++)l.rows[s].cells[c]&&e(l.rows[s].cells[c])}(0,n.isBlockEmpty)(l)&&(0,o.mutateBlock)(t).blocks.splice(r,1)}}},9981:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeParagraph=void 0;var n=r(9187),o=r(4814),i=r(5061),a=r(3869),l=r(376),s=r(1966);t.normalizeParagraph=function(e){var t=e.segments;if(!e.isImplicit&&t.length>0){var r=t[t.length-1],d=t[t.length-2];if("SelectionMarker"!=r.segmentType||d&&"Br"!=d.segmentType){if(t.length>1&&"Br"==t[t.length-1].segmentType){var u=t.filter((function(e){return"SelectionMarker"!=e.segmentType}));u.length>1&&"Br"!=u[u.length-2].segmentType&&(0,l.mutateBlock)(e).segments.pop()}}else(0,l.mutateBlock)(e).segments.push((0,o.createBr)(r.format))}(0,a.isWhiteSpacePreserved)(e.format.whiteSpace)||(0,s.normalizeAllSegments)(e),function(e){var t=e.segments.find((function(e){return"SelectionMarker"==e.segmentType}));if(t){var r=e.segments.indexOf(t),o=e.segments[r-1],i=e.segments[r+1];(o&&!o.link&&(0,n.areSameFormats)(o.format,t.format)&&(!i||!i.link&&(0,n.areSameFormats)(i.format,t.format))&&t.link||!o&&t.link&&i&&!i.link&&(0,n.areSameFormats)(i.format,t.format))&&(0,l.mutateSegment)(e,t,(function(e){delete e.link}))}}(e),function(e){for(var t=e.segments.length-1;t>=0;t--)(0,i.isSegmentEmpty)(e.segments[t])&&(0,l.mutateBlock)(e).segments.splice(t,1)}(e),function(e){if(!e.decorator){var t=e.segments.filter((function(e){return"SelectionMarker"!=e.segmentType})),r=e.segmentFormat||{},n=!1;c.forEach((function(e){n=function(e,t,r){var n,o=null===(n=e[0])||void 0===n?void 0:n.format;return!(!(null==o?void 0:o[r])||!e.every((function(e){return e.format[r]==o[r]}))||t[r]==o[r]||(t[r]=o[r],0))}(t,r,e)||n})),n&&((0,l.mutateBlock)(e).segmentFormat=r)}}(e)};var c=["fontFamily","fontSize","textColor"]},1966:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeSegment=t.createNormalizeSegmentContext=t.normalizeSingleSegment=t.normalizeAllSegments=void 0;var n=r(9833),o=r(376),i=" ",a=" ",l=/^\u0020+/,s=/\u0020+$/;function c(e){return Object.assign(null!=e?e:{},{textSegments:[],ignoreLeadingSpaces:!0,ignoreTrailingSpaces:!0,lastInlineSegment:void 0,lastTextSegment:void 0})}function d(e,t,r){switch(t.segmentType){case"Br":u(e,r.textSegments,r.lastInlineSegment),p(e,r.lastTextSegment,r.lastInlineSegment),c(r);break;case"Entity":case"General":case"Image":r.lastInlineSegment=t,r.ignoreLeadingSpaces=!1;break;case"Text":r.textSegments.push(t),r.lastInlineSegment=t,r.lastTextSegment=t;var d=t.text.substring(0,1),f=t.text.substr(-1);(0,n.hasSpacesOnly)(t.text)||(d==i&&(0,o.mutateSegment)(e,t,(function(e){e.text=e.text.replace(l,r.ignoreLeadingSpaces?"":a)})),f==i&&(0,o.mutateSegment)(e,t,(function(e){e.text=e.text.replace(s,r.ignoreTrailingSpaces?i:a)}))),r.ignoreLeadingSpaces=f==i}}function u(e,t,r){t.forEach((function(t){if(t!=r){var n=t.text;n.substr(-1)==a&&n.length>1&&n.substr(-2,1)!=i&&(0,o.mutateSegment)(e,t,(function(e){e.text=n.substring(0,n.length-1)+i}))}}))}function p(e,t,r){t&&t==r&&(null==t?void 0:t.text.substr(-1))==i&&(0,o.mutateSegment)(e,t,(function(e){e.text=e.text.replace(s,"")}))}t.normalizeAllSegments=function(e){var t=c();e.segments.forEach((function(r){d(e,r,t)})),u(e,t.textSegments,t.lastInlineSegment),p(e,t.lastTextSegment,t.lastInlineSegment)},t.normalizeSingleSegment=function(e,t,r){void 0===r&&(r=!1);var n=c();n.ignoreTrailingSpaces=r,d(e,t,n)},t.createNormalizeSegmentContext=function(){return c()},t.normalizeSegment=d},8840:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unwrapBlock=void 0;var n=r(1635),o=r(376),i=r(7958);t.unwrapBlock=function(e,t){var r,a,l,s=null!==(a=null==e?void 0:e.blocks.indexOf(t))&&void 0!==a?a:-1;s>=0&&(t.blocks.forEach(i.setParagraphNotImplicit),e&&(null===(l=(0,o.mutateBlock)(e))||void 0===l||(r=l.blocks).splice.apply(r,(0,n.__spreadArray)([s,1],(0,n.__read)(t.blocks.map(o.mutateBlock)),!1))))}},4814:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBr=void 0;var n=r(1635);t.createBr=function(e){return{segmentType:"Br",format:(0,n.__assign)({},e)}}},7357:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createContentModelDocument=void 0,t.createContentModelDocument=function(e){var t={blockGroupType:"Document",blocks:[]};return e&&(t.format=e),t}},6133:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDivider=void 0;var n=r(1635);t.createDivider=function(e,t){return{blockType:"Divider",tagName:e,format:(0,n.__assign)({},t)}}},3992:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEmptyModel=void 0;var n=r(4814),o=r(7357),i=r(5450),a=r(7192);t.createEmptyModel=function(e){var t=(0,o.createContentModelDocument)(e),r=(0,i.createParagraph)(!1,void 0,e);return r.segments.push((0,a.createSelectionMarker)(e),(0,n.createBr)(e)),t.blocks.push(r),t}},5681:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEntity=void 0;var n=r(1635);t.createEntity=function(e,t,r,o,i){return void 0===t&&(t=!0),{segmentType:"Entity",blockType:"Entity",format:(0,n.__assign)({},r),entityFormat:{id:i,entityType:o,isReadonly:t},wrapper:e}}},5470:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFormatContainer=void 0;var n=r(1635);t.createFormatContainer=function(e,t){return{blockType:"BlockGroup",blockGroupType:"FormatContainer",tagName:e,blocks:[],format:(0,n.__assign)({},t)}}},5219:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGeneralBlock=void 0,t.createGeneralBlock=function(e){return{blockType:"BlockGroup",blockGroupType:"General",element:e,blocks:[],format:{}}}},7431:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGeneralSegment=void 0;var n=r(1635);t.createGeneralSegment=function(e,t){return{blockType:"BlockGroup",blockGroupType:"General",segmentType:"General",format:(0,n.__assign)({},t),blocks:[],element:e}}},6349:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createImage=void 0;var n=r(1635);t.createImage=function(e,t){return{segmentType:"Image",src:e,format:(0,n.__assign)({},t),dataset:{}}}},6953:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createListItem=void 0;var n=r(598),o=r(7192);t.createListItem=function(e,t){var r=(0,o.createSelectionMarker)(t);return r.isSelected=!1,{blockType:"BlockGroup",blockGroupType:"ListItem",blocks:[],levels:e?e.map((function(e){return(0,n.createListLevel)(e.listType,e.format,e.dataset)})):[],formatHolder:r,format:{}}}},598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createListLevel=void 0;var n=r(1635);t.createListLevel=function(e,t,r){return{listType:e,format:(0,n.__assign)({},t),dataset:(0,n.__assign)({},r)}}},5450:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createParagraph=void 0;var n=r(1635);t.createParagraph=function(e,t,r,o){var i={blockType:"Paragraph",segments:[],format:(0,n.__assign)({},t)};return r&&Object.keys(r).length>0&&(i.segmentFormat=(0,n.__assign)({},r)),e&&(i.isImplicit=!0),o&&(i.decorator={tagName:o.tagName,format:(0,n.__assign)({},o.format)}),i}},6357:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createParagraphDecorator=void 0;var n=r(1635);t.createParagraphDecorator=function(e,t){return{tagName:e.toLocaleLowerCase(),format:(0,n.__assign)({},t)}}},7192:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionMarker=void 0;var n=r(1635);t.createSelectionMarker=function(e){return{segmentType:"SelectionMarker",isSelected:!0,format:(0,n.__assign)({},e)}}},1728:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTable=void 0;var n=r(1635),o=r(3262);t.createTable=function(e,t){for(var r=[],i=0;i<e;i++)r.push((0,o.createTableRow)());return{blockType:"Table",rows:r,format:(0,n.__assign)({},t),widths:[],dataset:{}}}},7720:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTableCell=void 0;var n=r(1635);t.createTableCell=function(e,t,r,o,i){var a="number"==typeof e?e>1:!!e,l="number"==typeof t?t>1:!!t;return{blockGroupType:"TableCell",blocks:[],format:(0,n.__assign)({},o),spanLeft:a,spanAbove:l,isHeader:!!r,dataset:(0,n.__assign)({},i)}}},3262:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTableRow=void 0;var n=r(1635);t.createTableRow=function(e,t){return void 0===t&&(t=0),{height:t,format:(0,n.__assign)({},e),cells:[]}}},8465:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createText=void 0;var n=r(1635),o=r(9849);t.createText=function(e,t,r,i){var a={segmentType:"Text",text:e,format:(0,n.__assign)({},t)};return r&&(0,o.addLink)(a,r),i&&(0,o.addCode)(a,i),a}},7784:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.setFirstColumnFormatBorders=t.applyTableFormat=void 0;var o=r(1635),i=r(2412),a=r(9298),l=r(376),s=r(636),c=r(6705),d=r(318),u=r(9966),p={topBorderColor:"#ABABAB",bottomBorderColor:"#ABABAB",verticalBorderColor:"#ABABAB",hasHeaderRow:!1,hasFirstColumn:!1,hasBandedRows:!1,hasBandedColumns:!1,bgColorEven:null,bgColorOdd:"#ABABAB20",headerRowColor:"#ABABAB",tableBorderFormat:c.TableBorderFormat.Default,verticalAlign:null};t.applyTableFormat=function(e,t,r){var n=(0,l.mutateBlock)(e),c=n.rows;(0,u.updateTableMetadata)(n,(function(e){var n=(0,o.__assign)((0,o.__assign)((0,o.__assign)({},p),e),t),u=function(e,t){var r={bgColorOverrides:[],vAlignOverrides:[],borderOverrides:[]};return e.forEach((function(e){var n=[],o=[],i=[];r.bgColorOverrides.push(n),r.vAlignOverrides.push(o),r.borderOverrides.push(i),e.cells.forEach((function(e){(0,d.updateTableCellMetadata)((0,l.mutateBlock)(e),(function(e){return e&&t?(n.push(!1),delete e.bgColorOverride):n.push(!!(null==e?void 0:e.bgColorOverride)),o.push(!!(null==e?void 0:e.vAlignOverride)),i.push(!!(null==e?void 0:e.borderOverride)),e}))}))})),r}(c,!r);return function(e,t,r){var n=t.hasBandedRows,o=t.hasBandedColumns,c=t.bgColorOdd,d=t.bgColorEven,u=t.hasFirstColumn;e.forEach((function(p,m){p.cells.forEach((function(g,v){var y,b=(0,l.mutateBlock)(g);if(!r.borderOverrides[m][v]&&"number"==typeof t.tableBorderFormat){var S=null===(y=f[t.tableBorderFormat])||void 0===y?void 0:y.call(f,{firstRow:0===m,lastRow:m===e.length-1,firstColumn:0===v,lastColumn:v===p.cells.length-1}),C=[t.topBorderColor,t.verticalBorderColor,t.bottomBorderColor,t.verticalBorderColor];null==S||S.forEach((function(e,t){var r=!e&&C[t]||"";b.format[i.BorderKeys[t]]=(0,a.combineBorderValue)({style:h(r),width:"1px",color:r})}))}if(!r.bgColorOverrides[m][v]){var _;_=u&&0==v&&m>0?null:(n||o)&&(o&&v%2!=0||n&&m%2!=0)?c:d,(0,s.setTableCellBackgroundColor)(b,_,!1,!0)}t.verticalAlign&&!r.vAlignOverrides[m][v]&&(b.format.verticalAlign=t.verticalAlign),b.isHeader=!1}))}))}(c,n,u),m(c,n),function(e,t,r){var n;if(t.hasHeaderRow){null===(n=e[0])||void 0===n||n.cells.forEach((function(e,n){var o=(0,l.mutateBlock)(e);o.isHeader=!0,t.headerRowColor&&(r.bgColorOverrides[0][n]||(0,s.setTableCellBackgroundColor)(o,t.headerRowColor,!1,!0),g(o.format,"borderTop",t.headerRowColor),g(o.format,"borderRight",t.headerRowColor),g(o.format,"borderLeft",t.headerRowColor))}))}}(c,n,u),n}))};var f=((n={})[c.TableBorderFormat.Default]=function(e){return[!1,!1,!1,!1]},n[c.TableBorderFormat.ListWithSideBorders]=function(e){return[!1,!e.lastColumn,!1,!e.firstColumn]},n[c.TableBorderFormat.FirstColumnHeaderExternal]=function(e){var t=e.firstColumn,r=e.firstRow;return[!r,!e.lastColumn&&!t||t&&r,!e.lastRow&&!r,!t]},n[c.TableBorderFormat.NoHeaderBorders]=function(e){var t=e.firstRow,r=e.firstColumn,n=e.lastColumn;return[t,t||n,!1,t||r]},n[c.TableBorderFormat.NoSideBorders]=function(e){var t=e.firstColumn;return[!1,e.lastColumn,!1,t]},n[c.TableBorderFormat.EspecialType1]=function(e){var t=e.firstRow,r=e.firstColumn;return[r&&!t,t,r&&!t,t&&!r]},n[c.TableBorderFormat.EspecialType2]=function(e){var t=e.firstRow,r=e.firstColumn;return[!t,t||!r,!t,!r]},n[c.TableBorderFormat.EspecialType3]=function(e){var t=e.firstColumn,r=e.firstRow;return[!0,r||!t,!r,!0]},n[c.TableBorderFormat.Clear]=function(){return[!0,!0,!0,!0]},n);function m(e,t){t.hasFirstColumn&&e.forEach((function(r,n){r.cells.forEach((function(r,o){var i=(0,l.mutateBlock)(r);if(0===o)switch(i.isHeader=!0,n){case 0:i.isHeader=!!t.hasHeaderRow;break;case e.length-1:g(i.format,"borderTop");break;case 1:g(i.format,"borderBottom");break;default:g(i.format,"borderTop"),g(i.format,"borderBottom")}}))}))}function g(e,t,r){var n=(0,a.extractBorderValues)(e[t]);n.color=r||"",n.style=h(n.color),e[t]=(0,a.combineBorderValue)(n)}function h(e){return e&&"transparent"!=e?"solid":"none"}t.setFirstColumnFormatBorders=m},7457:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cloneModel=void 0;var n=r(1635);function o(e){return{format:Object.assign({},e.format)}}function i(e){return{dataset:Object.assign({},e.dataset)}}function a(e){var t=e.blockType;return Object.assign({blockType:t},o(e))}function l(e,t){return{blockGroupType:e.blockGroupType,blocks:e.blocks.map((function(e){return function(e,t){switch(e.blockType){case"BlockGroup":switch(e.blockGroupType){case"FormatContainer":return function(e,t){var r=e.tagName,n=e.cachedElement,o=Object.assign({tagName:r,cachedElement:f(n,"cache",t)},a(e),l(e,t));return e.zeroFontSize&&(o.zeroFontSize=!0),o}(e,t);case"General":return u(e,t);case"ListItem":return function(e,t){var r=e.formatHolder,n=e.levels,o=e.cachedElement;return Object.assign({formatHolder:p(r),levels:n.map(d),cachedElement:f(o,"cache",t)},a(e),l(e,t))}(e,t)}break;case"Divider":return function(e,t){var r=e.tagName,n=e.isSelected,o=e.cachedElement;return Object.assign({isSelected:n,tagName:r,cachedElement:f(o,"cache",t)},a(e))}(e,t);case"Entity":return c(e,t);case"Paragraph":return function(e,t){var r=e.cachedElement,l=e.segments,d=e.isImplicit,m=e.decorator,g=e.segmentFormat,h=Object.assign({cachedElement:f(r,"cache",t),isImplicit:d,segments:l.map((function(e){return function(e,t){switch(e.segmentType){case"Br":return s(e);case"Entity":return c(e,t);case"General":return function(e,t){return Object.assign(u(e,t),s(e))}(e,t);case"Image":return a=(o=e).src,l=o.alt,d=o.title,f=o.isSelectedAsImageSelection,Object.assign({src:a,alt:l,title:d,isSelectedAsImageSelection:f},s(o),i(o));case"SelectionMarker":return p(e);case"Text":return n=(r=e).text,Object.assign({text:n},s(r))}var r,n,o,a,l,d,f}(e,t)})),segmentFormat:g?(0,n.__assign)({},g):void 0},a(e),o(e));return m&&(h.decorator=Object.assign({tagName:m.tagName},o(m))),h}(e,t);case"Table":return function(e,t){var r=e.cachedElement,n=e.widths,s=e.rows;return Object.assign({cachedElement:f(r,"cache",t),widths:Array.from(n),rows:s.map((function(e){return function(e,t){var r=e.height,n=e.cells,a=e.cachedElement;return Object.assign({height:r,cachedElement:f(a,"cache",t),cells:n.map((function(e){return function(e,t){var r=e.cachedElement,n=e.isSelected,a=e.spanAbove,s=e.spanLeft,c=e.isHeader;return Object.assign({cachedElement:f(r,"cache",t),isSelected:n,spanAbove:a,spanLeft:s,isHeader:c},l(e,t),o(e),i(e))}(e,t)}))},o(e))}(e,t)}))},a(e),i(e))}(e,t)}}(e,t)}))}}function s(e){var t=e.segmentType,r=e.isSelected,n=e.code,a=e.link,l=Object.assign({segmentType:t,isSelected:r},o(e));return n&&(l.code=o(n)),a&&(l.link=Object.assign(o(a),i(a))),l}function c(e,t){var r=e.wrapper,o=e.entityFormat;return Object.assign({wrapper:f(r,"entity",t),entityFormat:(0,n.__assign)({},o)},a(e),s(e))}function d(e){var t=e.listType;return Object.assign({listType:t},o(e),i(e))}function u(e,t){var r=e.element;return Object.assign({element:f(r,"general",t)},a(e),l(e,t))}function p(e){return Object.assign({isSelected:e.isSelected},s(e))}function f(e,t,r){var n=r.includeCachedElement;if(e){if(n){if(!0===n)return e;var o=n(e,t);if(("general"==t||"entity"==t)&&!o)throw new Error("Entity and General Model must has wrapper element");return o}return"cache"==t?void 0:e.cloneNode(!0)}}t.cloneModel=function(e,t){var r=l(e,t||{});return e.format&&(r.format=Object.assign({},e.format)),r}},9039:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteBlock=void 0,t.deleteBlock=function(e,t,r,n,o){var i=e.indexOf(t);switch(t.blockType){case"Table":case"Divider":return r?e.splice(i,1,r):e.splice(i,1),!0;case"Entity":var a=t.isSelected?"overwrite":"forward"==o?"removeFromStart":"backward"==o?"removeFromEnd":void 0;return void 0!==a&&(r?e.splice(i,1,r):e.splice(i,1),null==n||n.deletedEntities.push({entity:t,operation:a})),!0;case"BlockGroup":switch(t.blockGroupType){case"General":return!!r&&(e.splice(i,1,r),!0);case"ListItem":case"FormatContainer":return e.splice(i,1),!0}}return!1}},2795:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteExpandedSelection=void 0;var n=r(1635),o=r(4814),i=r(5450),a=r(7192),l=r(9039),s=r(7987),c=r(654),d=r(3136),u=r(376),p=r(7958),f={contentUnderSelectedTableCell:"ignoreForTableOrCell",contentUnderSelectedGeneralElement:"generalElementOnly",includeListFormatHolder:"never"};function m(e,t,r,n){return{marker:e,paragraph:t,path:r,tableContext:n}}t.deleteExpandedSelection=function(e,t){var r={deleteResult:"notDeleted",insertPoint:null,formatContext:t};return(0,d.iterateSelections)(e,(function(t,d,f,g){var h=(0,i.createParagraph)(!0,void 0,e.format),v=e.format,y=0;if(g&&"Paragraph"==(null==f?void 0:f.blockType)){var b=(0,n.__read)((0,u.mutateSegments)(f,g),3),S=b[0],C=b[1],_=b[2];C[0]&&(h=S,y=_[0],v=(0,c.getSegmentTextFormat)(C[0]),r.lastParagraph=h,r.lastTableContext=d,C.forEach((function(e,n){0!=n||r.insertPoint||"SelectionMarker"!=e.segmentType?(0,s.deleteSegment)(S,e,r.formatContext)&&(r.deleteResult="range"):r.insertPoint=m(e,S,t,d)})),"range"==r.deleteResult&&(0,p.setParagraphNotImplicit)(S))}else if(f){var E=(0,u.mutateBlock)(t[0]).blocks;(0,l.deleteBlock)(E,f,h,r.formatContext)&&(r.deleteResult="range")}else if(d){var T=d.table,k=d.colIndex,M=d.rowIndex,O=(0,u.mutateBlock)(T).rows[M],P=(0,u.mutateBlock)(O.cells[k]);t=(0,n.__spreadArray)([P],(0,n.__read)(t),!1),h.segments.push((0,o.createBr)(e.format)),P.blocks=[h],r.deleteResult="range"}if(!r.insertPoint){var w=(0,a.createSelectionMarker)(v);(0,p.setParagraphNotImplicit)(h),h.segments.splice(y,0,w),r.insertPoint=m(w,h,t,d)}}),f),r}},7987:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteSegment=void 0;var n=r(1635),o=r(6644),i=r(3869),a=r(376),l=r(1966),s=r(5245);t.deleteSegment=function(e,t,r,c){var d=(0,n.__read)((0,a.mutateSegment)(e,t),3),u=d[0],p=d[1],f=d[2],m=u.segments,g=(0,i.isWhiteSpacePreserved)(u.format.whiteSpace),h="forward"==c,v="backward"==c;switch(g||function(e,t,r){for(var n,o=r-1;"SelectionMarker"==(null===(n=t[o])||void 0===n?void 0:n.segmentType);)o--;var i=t[o];i&&(0,l.normalizeSingleSegment)(e,i)}(u,m,f),null==p?void 0:p.segmentType){case"Br":case"Image":case"SelectionMarker":return m.splice(f,1),!0;case"Entity":var y=p.isSelected?"overwrite":h?"removeFromStart":v?"removeFromEnd":void 0;return void 0!==y&&(m.splice(f,1),null==r||r.deletedEntities.push({entity:p,operation:y})),!0;case"Text":var b=p.text;return 0==b.length||p.isSelected?m.splice(f,1):c&&(b=(0,o.deleteSingleChar)(b,h),g||(b=(0,s.normalizeText)(b,h)),""==b?m.splice(f,1):p.text=b),!0;case"General":return!!p.isSelected&&(m.splice(f,1),!0);default:return!1}}},9584:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteSelection=void 0;var n=r(1635),o=r(2795),i=r(376),a=r(5471);t.deleteSelection=function(e,t,r){void 0===t&&(t=[]);var l=(0,o.deleteExpandedSelection)(e,r),s=t.filter((function(e){return!!e}));return(0,a.runEditSteps)(s,l),function(e){var t,r=e.insertPoint,o=e.deleteResult,a=e.lastParagraph,l=e.lastTableContext;if(r&&"notDeleted"!=o&&"nothingToDelete"!=o&&a&&a!=r.paragraph&&l==r.tableContext){var s=(0,i.mutateBlock)(a);(t=(0,i.mutateBlock)(r.paragraph).segments).push.apply(t,(0,n.__spreadArray)([],(0,n.__read)(s.segments),!1)),s.segments=[]}}(l),l}},6644:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteSingleChar=void 0;var n=r(1635);t.deleteSingleChar=function(e,t){for(var r=(0,n.__spreadArray)([],(0,n.__read)(e),!1),o=0,i=t?0:r.length-1,a="notDeleted";i>=0&&i<r.length&&"done"!=a;i+=t?1:-1)switch(r[i]){case"‍":case"⃣":case"︎":case"️":a="notDeleted",o++;break;default:"notDeleted"==a?(a="waiting",o++):"waiting"==a&&(a="done")}return r.splice(t?0:r.length-o,o),r.join("")}},7921:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getClosestAncestorBlockGroupIndex=void 0,t.getClosestAncestorBlockGroupIndex=function(e,t,r){void 0===r&&(r=[]);for(var n=0;n<e.length;n++){var o=e[n];if(t.indexOf(o.blockGroupType)>=0)return n;if(r.indexOf(o.blockGroupType)>=0)return-1}return-1}},8955:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getListStyleTypeFromString=void 0;var n=r(1081),o=r(3180),i=r(2901);t.getListStyleTypeFromString=function(e,t){var r="OL"==e?o.OrderedListStyleMap:i.UnorderedListStyleMap,a=(0,n.getObjectKeys)(r).find((function(e){return r[e]==t}));return a&&"string"==typeof a?parseInt(a):a}},654:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSegmentTextFormat=void 0,t.getSegmentTextFormat=function(e){var t,n=null!==(t=null==e?void 0:e.format)&&void 0!==t?t:{},o=n.fontFamily,i=n.fontSize,a=n.textColor,l=n.backgroundColor,s=n.letterSpacing,c=n.lineHeight;return r({fontFamily:o,fontSize:i,textColor:a,backgroundColor:l,letterSpacing:s,lineHeight:c})};var r=function(e){var t={};return Object.keys(e).filter((function(r){var n=e[r];void 0!==n&&(t[r]=n)})),t}},8458:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeModel=void 0;var n=r(1635),o=r(2394),i=r(5142),a=r(7784),l=r(6953),s=r(5450),c=r(7192),d=r(7720),u=r(9584),p=r(5287),f=r(7921),m=r(1081),g=r(376),h=r(8941),v=r(1166),y=["h1","h2","h3","h4","h5","h6"],b=(0,m.getObjectKeys)(p.EmptySegmentFormat);function S(e,t,r,o,i){var a=e.paragraph,l=e.marker,s=r?a:E(e,t.format),c=s.segments.indexOf(l);if("none"==(null==i?void 0:i.mergeFormat)&&r&&(s.segments.forEach((function(e){e.format=(0,n.__assign)((0,n.__assign)({},s.segmentFormat||{}),e.format)})),delete s.segmentFormat),c>=0)for(var d=0;d<t.segments.length;d++){var u=t.segments[d];s.segments.splice(c+d,0,u),o&&("Entity"==u.segmentType&&o.newEntities.push(u),"Image"==u.segmentType&&o.newImages.push(u))}if(t.decorator&&(s.decorator=(0,n.__assign)({},t.decorator),y.indexOf(s.decorator.tagName)>-1)){var p=(0,m.getObjectKeys)(s.decorator.format),f=(0,m.getObjectKeys)(s.segmentFormat||{});p.forEach((function(e){var t;f.indexOf(e)>-1&&(null===(t=s.segmentFormat)||void 0===t||delete t[e])}))}s.format=r?(0,n.__assign)((0,n.__assign)({},s.format),t.format):t.format}function C(e,t,r){var n,o,l=e.tableContext,s=e.marker;if(l&&1==r.blocks.length&&r.blocks[0]==t){for(var u=l.table,p=l.colIndex,f=l.rowIndex,m=(0,g.mutateBlock)(u),h=0;h<t.rows.length;h++)for(var y=0;y<t.rows[h].cells.length;y++){var b=t.rows[h].cells[y];if(0==h&&p+y>=m.rows[0].cells.length)for(var S=0;S<m.rows.length;S++){var C=null===(n=m.rows[S])||void 0===n?void 0:n.cells[p+y-1];m.rows[S].cells[p+y]=(0,d.createTableCell)(!1,!1,null==C?void 0:C.isHeader,null==C?void 0:C.format)}if(0==y&&f+h>=m.rows.length)for(m.rows[f+h]||(m.rows[f+h]={cells:[],format:{},height:0}),S=0;S<m.rows[f].cells.length;S++){var _=null===(o=m.rows[f+h-1])||void 0===o?void 0:o.cells[S];m.rows[f+h].cells[S]=(0,d.createTableCell)(!1,!1,!1,null==_?void 0:_.format)}var E=m.rows[f+h].cells[p+y];if(m.rows[f+h].cells[p+y]=b,0==h&&0==y){var k=(0,c.createSelectionMarker)(s.format),M=(0,i.addSegment)(b,k);e.path[0]==E&&(e.path[0]=b,e.marker=k,e.paragraph=M)}}(0,v.normalizeTable)(m,e.marker.format),(0,a.applyTableFormat)(m,void 0,!0)}else T(e,t)}function _(e,t){E(e,t.format);var r=e.path,o=e.paragraph,i=(0,f.getClosestAncestorBlockGroupIndex)(r,["ListItem"]),a=r[i],l=r[i+1],s=l.blocks.indexOf(a||o);s>=0&&(0,g.mutateBlock)(l).blocks.splice(s,0,t),a&&(null==a||a.levels.forEach((function(e,r){t.levels[r]=(0,n.__assign)({},e)})))}function E(e,t){var r=e.paragraph,o=e.marker,i=e.path,a=r.segments.indexOf(o),c=i[0].blocks.indexOf(r),d=(0,s.createParagraph)(!1,(0,n.__assign)((0,n.__assign)({},r.format),t),r.segmentFormat);a>=0&&(d.segments=r.segments.splice(a)),c>=0&&(0,g.mutateBlock)(i[0]).blocks.splice(c+1,0,d);var u=(0,f.getClosestAncestorBlockGroupIndex)(i,["ListItem"],["FormatContainer","TableCell"]),p=i[u];if(p){var m=u>=0?i[u+1]:null,h=m?m.blocks.indexOf(p):-1;if(h>=0&&m){var v=(0,l.createListItem)(p.levels,p.formatHolder.format);c>=0&&(v.blocks=p.blocks.splice(c+1)),h>=0&&(0,g.mutateBlock)(m).blocks.splice(h+1,0,v),i[u]=v}}return e.paragraph=d,d}function T(e,t){var r=e.path,n=E(e,"Paragraph"!==t.blockType?{}:t.format),o=r[0].blocks.indexOf(n);o>=0&&(0,g.mutateBlock)(r[0]).blocks.splice(o,0,t)}function k(e,t,r){e.blocks.forEach((function(e){var o;switch(function(e,t){"keepSourceEmphasisFormat"==e&&t.format.backgroundColor&&delete(0,g.mutateBlock)(t).format.backgroundColor}(r,e),e.blockType){case"BlockGroup":"ListItem"==e.blockGroupType&&((0,g.mutateBlock)(e).formatHolder.format=O(r,t,e.formatHolder.format)),k(e,t,r);break;case"Table":e.rows.forEach((function(e){return e.cells.forEach((function(e){k(e,t,r)}))}));break;case"Paragraph":var i=(null===(o=e.decorator)||void 0===o?void 0:o.format)||{},a=(0,g.mutateBlock)(e);a.segments.forEach((function(e){"General"==e.segmentType&&k(e,t,r),e.format=O(r,t,(0,n.__assign)((0,n.__assign)({},i),e.format)),e.link&&(e.link.format=function(e,t,r){return"mergeAll"==e?(0,n.__assign)((0,n.__assign)({},M(t)),r):(0,n.__assign)((0,n.__assign)((0,n.__assign)((0,n.__assign)({},w(r)),M(t)),P(r)),function(e){var t={};return e.textColor&&(t.textColor=e.textColor),t}(r))}(r,t,e.link.format))})),"keepSourceEmphasisFormat"===r&&delete a.decorator}}))}function M(e){var t={};return e.backgroundColor&&(t.backgroundColor=e.backgroundColor),e.underline&&(t.underline=e.underline),t}function O(e,t,r){return"mergeAll"==e?(0,n.__assign)((0,n.__assign)({},t),r):(0,n.__assign)((0,n.__assign)((0,n.__assign)({},w(r)),t),P(r))}function P(e){var t={},r=e.fontWeight,n=e.italic,o=e.underline;return r&&"normal"!=r&&(t.fontWeight=r),n&&(t.italic=n),o&&(t.underline=o),t}function w(e){var t=(0,n.__assign)({},e);return b.forEach((function(e){return delete t[e]})),t}t.mergeModel=function(e,t,r,i){var a,l=null!==(a=null==i?void 0:i.insertPosition)&&void 0!==a?a:(0,u.deleteSelection)(e,[],r).insertPoint;if(null==i?void 0:i.addParagraphAfterMergedContent){var c=l||{},d=c.paragraph,p=c.marker,f=(0,s.createParagraph)(!1,null==d?void 0:d.format,null==p?void 0:p.format);(0,o.addBlock)(t,f)}if(l){(null==i?void 0:i.mergeFormat)&&"none"!=i.mergeFormat&&k(t,(0,n.__assign)((0,n.__assign)({},e.format||{}),l.marker.format),null==i?void 0:i.mergeFormat);for(var m=0;m<t.blocks.length;m++){var g=t.blocks[m];switch(g.blockType){case"Paragraph":S(l,g,0==m,r,i);break;case"Divider":T(l,g);break;case"Entity":T(l,g),null==r||r.newEntities.push(g);break;case"Table":1==t.blocks.length&&(null==i?void 0:i.mergeTable)?C(l,g,t):T(l,g);break;case"BlockGroup":switch(g.blockGroupType){case"General":case"FormatContainer":T(l,g);break;case"ListItem":_(l,g)}}}}return(0,h.normalizeContentModel)(e),l}},1166:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeTable=t.MIN_ALLOWED_TABLE_CELL_HEIGHT=t.MIN_ALLOWED_TABLE_CELL_WIDTH=void 0;var n=r(1635),o=r(2394),i=r(5142),a=r(4814),l=r(5450),s=r(376);function c(e){return e<=4?120:e<=6?100:70}function d(e,t){var r;t.blocks.every((function(e){return"Paragraph"==e.blockType&&(0==(t=(t=e.segments).filter((function(e){return"SelectionMarker"!=e.segmentType}))).length||1==t.length&&"Br"==t[0].segmentType);var t}))||((r=(0,s.mutateBlock)(e).blocks).push.apply(r,(0,n.__spreadArray)([],(0,n.__read)(t.blocks),!1)),(0,s.mutateBlock)(t).blocks=[])}t.MIN_ALLOWED_TABLE_CELL_WIDTH=30,t.MIN_ALLOWED_TABLE_CELL_HEIGHT=22,t.normalizeTable=function(e,r){var u,p=(0,s.mutateBlock)(e),f=p.format;f.borderCollapse&&f.useBorderBox||(f.borderCollapse=!0,f.useBorderBox=!0),p.rows.forEach((function(e,c){e.cells.forEach((function(e,t){var d=(0,s.mutateBlock)(e);if(0==d.blocks.length){var u=d.format.textColor?(0,n.__assign)((0,n.__assign)({},r),{textColor:d.format.textColor}):r;(0,o.addBlock)(d,(0,l.createParagraph)(void 0,void 0,u)),(0,i.addSegment)(d,(0,a.createBr)(u))}0==c?d.spanAbove=!1:c>0&&t>0&&d.isHeader&&(d.isHeader=!1),0==t&&(d.spanLeft=!1),d.format.useBorderBox=!0})),e.height<t.MIN_ALLOWED_TABLE_CELL_HEIGHT&&(e.height=t.MIN_ALLOWED_TABLE_CELL_HEIGHT)}));for(var m=Math.max.apply(Math,(0,n.__spreadArray)([],(0,n.__read)(p.rows.map((function(e){return e.cells.length}))),!1)),g=0;g<m;g++)void 0===p.widths[g]?p.widths[g]=c(m):p.widths[g]<t.MIN_ALLOWED_TABLE_CELL_WIDTH&&(p.widths[g]=t.MIN_ALLOWED_TABLE_CELL_WIDTH);for(var h=function(e){p.rows.forEach((function(t){var r=t.cells[e],n=t.cells[e-1];r&&n&&r.spanLeft&&d(n,r)})),p.rows.every((function(t){var r;return null===(r=t.cells[e])||void 0===r?void 0:r.spanLeft}))&&(p.rows.forEach((function(t){return t.cells.splice(e,1)})),p.widths.splice(e-1,2,p.widths[e-1]+p.widths[e]))},v=((null===(u=p.rows[0])||void 0===u?void 0:u.cells.length)||0)-1;v>0;v--)h(v);for(var y=function(e){var t=p.rows[e];t.cells.forEach((function(t,r){var n,o=null===(n=p.rows[e-1])||void 0===n?void 0:n.cells[r];o&&t.spanAbove&&d(o,t)})),t.cells.every((function(e){return e.spanAbove}))&&(p.rows[e-1].height+=t.height,p.rows.splice(e,1))},b=p.rows.length-1;b>0;b--)y(b)}},2504:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retrieveModelFormatState=void 0;var n=r(1635),o=r(9298),i=r(7921),a=r(9966),l=r(9265),s=r(3136),c=r(861);function d(e,t,r,n,o){void 0===o&&(o=function(e){return e}),n?void 0!==r&&(e[t]=r):o(r)!==o(e[t])&&delete e[t]}t.retrieveModelFormatState=function(e,t,r){var u,p,f,m=!0,g=!0,h=!0;(0,s.iterateSelections)(e,(function(s,f,v,y){if(function(e,t,r){var n,o,a=(0,i.getClosestAncestorBlockGroupIndex)(t,["ListItem"],[]),l=(0,i.getClosestAncestorBlockGroupIndex)(t,["FormatContainer"],[]);if(a>=0){var s=t[a],c=null===(n=null==s?void 0:s.levels[s.levels.length-1])||void 0===n?void 0:n.listType;d(e,"isBullet","UL"==c,r),d(e,"isNumbering","OL"==c,r)}d(e,"isBlockQuote",l>=0&&"blockquote"==(null===(o=t[l])||void 0===o?void 0:o.tagName),r)}(r,s,m),v&&(p?r.isMultilineSelection=!0:p=v),"Paragraph"==(null==v?void 0:v.blockType)&&(function(e,t,r){var n,o=parseInt(((null===(n=t.decorator)||void 0===n?void 0:n.tagName)||"").substring(1)),i=o>=1&&o<=6?o:void 0;d(e,"marginBottom",t.format.marginBottom,r),d(e,"marginTop",t.format.marginTop,r),d(e,"headingLevel",i,r),d(e,"textAlign",t.format.textAlign,r),d(e,"direction",t.format.direction,r)}(r,v,m),null==y||y.forEach((function(i){var a,s,u,p,f,b,S,C,_;if(h||"SelectionMarker"!=i.segmentType){var E=(0,n.__assign)({},e.format);delete E.italic,delete E.underline,delete E.fontWeight,function(e,t,r){var n,o,i=null===(o=null===(n=r.superOrSubScriptSequence)||void 0===n?void 0:n.split(" "))||void 0===o?void 0:o.pop();d(e,"isBold",(0,l.isBold)(r.fontWeight),t),d(e,"isItalic",r.italic,t),d(e,"isUnderline",r.underline,t),d(e,"isStrikeThrough",r.strikethrough,t),d(e,"isSuperscript","super"==i,t),d(e,"isSubscript","sub"==i,t),d(e,"letterSpacing",r.letterSpacing,t),d(e,"fontName",r.fontFamily,t),d(e,"fontSize",r.fontSize,t,(function(e){return(0,c.parseValueWithUnit)(e,void 0,"pt")+"pt"})),d(e,"backgroundColor",r.backgroundColor,t),d(e,"textColor",r.textColor,t),d(e,"fontWeight",r.fontWeight,t),d(e,"lineHeight",r.lineHeight,t)}(r,m,Object.assign({},E,v.format,null===(a=v.decorator)||void 0===a?void 0:a.format,i.format,null===(s=i.code)||void 0===s?void 0:s.format,null===(u=i.link)||void 0===u?void 0:u.format,t)),d(r,"isCodeInline",!!(null==i?void 0:i.code),m)}h=!1,r.canUnlink=r.canUnlink||!!i.link,r.canAddImageAltText=r.canAddImageAltText||y.some((function(e){return"Image"==e.segmentType})),m=!1,"Image"===i.segmentType&&(g?(p=r,f=i.format,S=(b=(0,o.extractBorderValues)(f.borderTop)).color,C=b.width,_=b.style,p.imageFormat={borderColor:S,borderWidth:C,borderStyle:_,boxShadow:f.boxShadow,borderRadius:f.borderRadius},g=!1):r.imageFormat=void 0)})),m=!1),f)if(u){var b=u.table,S=u.colIndex,C=u.rowIndex;f.table!=b||f.colIndex==S&&f.rowIndex==C||(r.canMergeTableCell=!0,r.isMultilineSelection=!0)}else!function(e,t){var r=(0,a.getTableMetadata)(e.table);t.isInTable=!0,t.tableHasHeader=e.table.rows.some((function(e){return e.cells.some((function(e){return e.isHeader}))})),r&&(t.tableFormat=r)}(f,r),u=f}),{includeListFormatHolder:"never"}),r.fontSize&&(r.fontSize=(f=r.fontSize)&&f.indexOf("px")==f.length-2?Math.round(75*parseFloat(f)+.05)/100+"pt":f)}},5471:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.runEditSteps=void 0,t.runEditSteps=function(e,t){e.forEach((function(e){e&&function(e){return!!e.insertPoint}(t)&&e(t)}))}},636:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setTableCellBackgroundColor=void 0;var n=r(1635),o=r(376),i=r(488),a=r(318),l="#ffffff",s="#000000";function c(e,t){var r=d(t);return[l,"rgb(255,255,255)"].indexOf(e)>-1&&(r>80||""==t)||[s,"rgb(0,0,0)"].indexOf(e)>-1&&(r<20||""==t)}function d(e){var t=(0,i.parseColor)(e);if(t){var r=t[0]/255,n=t[1]/255,o=t[2]/255;return 50*(Math.max(r,n,o)+Math.min(r,n,o))}return 255}t.setTableCellBackgroundColor=function(e,t,r,i){if(t){e.format.backgroundColor=t,r&&(0,a.updateTableCellMetadata)(e,(function(e){return(e=e||{}).bgColorOverride=!0,e}));var u=d(t);u<20?e.format.textColor=l:u>80?e.format.textColor=s:delete e.format.textColor,i&&function(e){e.format.textColor&&e.blocks.forEach((function(t){var r;if("Paragraph"==t.blockType){var i=(0,o.mutateBlock)(t);(null===(r=i.segmentFormat)||void 0===r?void 0:r.textColor)||(i.segmentFormat=(0,n.__assign)((0,n.__assign)({},i.segmentFormat),{textColor:e.format.textColor})),i.segments.forEach((function(t){var r;(null===(r=t.format)||void 0===r?void 0:r.textColor)||(t.format=(0,n.__assign)((0,n.__assign)({},t.format),{textColor:e.format.textColor}))}))}}))}(e)}else delete e.format.backgroundColor,delete e.format.textColor,i&&function(e){e.blocks.forEach((function(t){var r,n;if("Paragraph"==t.blockType){var i=(0,o.mutateBlock)(t);(null===(r=i.segmentFormat)||void 0===r?void 0:r.textColor)&&c(null===(n=i.segmentFormat)||void 0===n?void 0:n.textColor,e.format.backgroundColor||"")&&delete i.segmentFormat.textColor,i.segments.forEach((function(t){t.format.textColor&&c(t.format.textColor,e.format.backgroundColor||"")&&delete t.format.textColor}))}}))}(e)}},2061:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAutoListStyleType=void 0;var n=r(602),o=r(5043),i=[o.NumberingListType.Decimal,o.NumberingListType.LowerAlpha,o.NumberingListType.LowerRoman],a=[n.BulletListType.Disc,n.BulletListType.Circle,n.BulletListType.Square],l={"lower-alpha":o.NumberingListType.LowerAlpha,"lower-latin":o.NumberingListType.LowerAlpha,"upper-alpha":o.NumberingListType.UpperAlpha,"upper-latin":o.NumberingListType.UpperAlpha,"lower-roman":o.NumberingListType.LowerRoman,"upper-roman":o.NumberingListType.UpperRoman},s={disc:n.BulletListType.Disc,circle:n.BulletListType.Circle,square:n.BulletListType.Square};t.getAutoListStyleType=function(e,t,r,n){var o=t.orderedStyleType,c=t.unorderedStyleType,d=t.applyListStyleFromLevel;return"OL"==e?"number"==typeof o?o:d?i[r%i.length]:n?l[n]:void 0:"number"==typeof c?c:d?a[r%a.length]:n?s[n]:void 0}},4402:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getOrderedListNumberStr=void 0;var n=r(1635),o=r(1081),i=r(5043),a={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1};function l(e,t){var r="";for(e--;e>=0;)r=String.fromCharCode(e%26+65)+r,e=Math.floor(e/26)-1;return t?r.toLowerCase():r}function s(e,t){var r,i,l="";try{for(var s=(0,n.__values)((0,o.getObjectKeys)(a)),c=s.next();!c.done;c=s.next()){var d=c.value,u=Math.floor(e/a[d]);e-=u*a[d],l+=d.repeat(u)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return t?l.toLocaleLowerCase():l}t.getOrderedListNumberStr=function(e,t){switch(e){case i.NumberingListType.LowerAlpha:case i.NumberingListType.LowerAlphaDash:case i.NumberingListType.LowerAlphaDoubleParenthesis:case i.NumberingListType.LowerAlphaParenthesis:return l(t,!0);case i.NumberingListType.UpperAlpha:case i.NumberingListType.UpperAlphaDash:case i.NumberingListType.UpperAlphaDoubleParenthesis:case i.NumberingListType.UpperAlphaParenthesis:return l(t,!1);case i.NumberingListType.LowerRoman:case i.NumberingListType.LowerRomanDash:case i.NumberingListType.LowerRomanDoubleParenthesis:case i.NumberingListType.LowerRomanParenthesis:return s(t,!0);case i.NumberingListType.UpperRoman:case i.NumberingListType.UpperRomanDash:case i.NumberingListType.UpperRomanDoubleParenthesis:case i.NumberingListType.UpperRomanParenthesis:return s(t,!1);default:return t+""}}},5566:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createObjectDefinition=t.createArrayDefinition=t.createStringDefinition=t.createBooleanDefinition=t.createNumberDefinition=void 0,t.createNumberDefinition=function(e,t,r,n,o){return{type:"number",isOptional:e,value:t,maxValue:n,minValue:r,allowNull:o}},t.createBooleanDefinition=function(e,t,r){return{type:"boolean",isOptional:e,value:t,allowNull:r}},t.createStringDefinition=function(e,t,r){return{type:"string",isOptional:e,value:t,allowNull:r}},t.createArrayDefinition=function(e,t,r,n,o){return{type:"array",isOptional:t,itemDef:e,minLength:r,maxLength:n,allowNull:o}},t.createObjectDefinition=function(e,t,r){return{type:"object",isOptional:t,propertyDef:e,allowNull:r}}},9655:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateImageMetadata=t.getImageMetadata=void 0;var n=r(5442),o=r(5566),i=(0,o.createNumberDefinition)(!0),a=(0,o.createBooleanDefinition)(!0),l=(0,o.createObjectDefinition)({widthPx:i,heightPx:i,leftPercent:i,rightPercent:i,topPercent:i,bottomPercent:i,angleRad:i,src:(0,o.createStringDefinition)(),naturalHeight:i,naturalWidth:i,flippedHorizontal:a,flippedVertical:a});t.getImageMetadata=function(e){return(0,n.getMetadata)(e,l)},t.updateImageMetadata=function(e,t){return(0,n.updateMetadata)(e,t,l)}},8294:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateListMetadata=t.getListMetadata=t.ListMetadataDefinition=void 0;var n=r(602),o=r(5442),i=r(5043),a=r(5566);t.ListMetadataDefinition=(0,a.createObjectDefinition)({orderedStyleType:(0,a.createNumberDefinition)(!0,void 0,i.NumberingListType.Min,i.NumberingListType.Max),unorderedStyleType:(0,a.createNumberDefinition)(!0,void 0,n.BulletListType.Min,n.BulletListType.Max),applyListStyleFromLevel:(0,a.createBooleanDefinition)(!0)},!0,!0),t.getListMetadata=function(e){return(0,o.getMetadata)(e,t.ListMetadataDefinition)},t.updateListMetadata=function(e,r){return(0,o.updateMetadata)(e,r,t.ListMetadataDefinition)}},5442:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasMetadata=t.updateMetadata=t.getMetadata=void 0;var n=r(216),o="editingInfo";function i(e,t){var r=e.dataset[o],i=null;try{i=JSON.parse(r)}catch(e){}return!t||(0,n.validate)(i,t)?i:null}t.getMetadata=i,t.updateMetadata=function(e,t,r){var a=i(e,r);return t&&((a=t(a))?r&&!(0,n.validate)(a,r)||(e.dataset[o]=JSON.stringify(a)):delete e.dataset[o]),a},t.hasMetadata=function(e){return!!e.dataset[o]}},318:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateTableCellMetadata=t.getTableCellMetadata=void 0;var n=r(5566),o=r(5442),i=(0,n.createObjectDefinition)({bgColorOverride:(0,n.createBooleanDefinition)(!0),vAlignOverride:(0,n.createBooleanDefinition)(!0),borderOverride:(0,n.createBooleanDefinition)(!0)},!1,!0);t.getTableCellMetadata=function(e){return(0,o.getMetadata)(e,i)},t.updateTableCellMetadata=function(e,t){return(0,o.updateMetadata)(e,t,i)}},9966:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateTableMetadata=t.getTableMetadata=void 0;var n=r(5442),o=r(6705),i=r(5566),a=(0,i.createStringDefinition)(!1,void 0,!0),l=(0,i.createBooleanDefinition)(!1),s=(0,i.createObjectDefinition)({topBorderColor:a,bottomBorderColor:a,verticalBorderColor:a,hasHeaderRow:l,headerRowColor:a,hasFirstColumn:l,hasBandedColumns:l,hasBandedRows:l,bgColorEven:a,bgColorOdd:a,tableBorderFormat:(0,i.createNumberDefinition)(!1,void 0,o.TableBorderFormat.Min,o.TableBorderFormat.Max),verticalAlign:a},!1,!0);t.getTableMetadata=function(e){return(0,n.getMetadata)(e,s)},t.updateTableMetadata=function(e,t){return(0,n.updateMetadata)(e,t,s)}},216:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validate=void 0;var n=r(1081);t.validate=function e(t,r){var o,i,a=!1;if(r.isOptional&&void 0===t||r.allowNull&&null===t)a=!0;else{if(!r.isOptional&&void 0===t||!r.allowNull&&null===t)return!1;switch(r.type){case"string":a="string"==typeof t&&(void 0===r.value||t===r.value);break;case"number":a="number"==typeof t&&(void 0===r.value||(o=r.value,i=t,Math.abs(o-i)<.001))&&(void 0===r.minValue||t>=r.minValue)&&(void 0===r.maxValue||t<=r.maxValue);break;case"boolean":a="boolean"==typeof t&&(void 0===r.value||t===r.value);break;case"array":a=Array.isArray(t)&&(void 0===r.minLength||t.length>=r.minLength)&&(void 0===r.maxLength||t.length<=r.maxLength)&&t.every((function(t){return e(t,r.itemDef)}));break;case"object":a="object"==typeof t&&(0,n.getObjectKeys)(r.propertyDef).every((function(n){return e(t[n],r.propertyDef[n])}))}}return a}},2144:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFirstSelectedListItem=t.getFirstSelectedTable=t.getOperationalBlocks=t.getSelectedParagraphs=t.getSelectedSegments=t.getSelectedSegmentsAndParagraphs=void 0;var n=r(1635),o=r(7921),i=r(1186),a=r(3136),l=r(376);function s(e,t,r,n){var o=d(e,{includeListFormatHolder:t?"allSegments":"never"}),i=[];return o.forEach((function(e){var o=e.segments,a=e.block,s=e.path;if(o)if(t&&!a&&1==o.length&&"ListItem"==s[0].blockGroupType&&o[0]==s[0].formatHolder){var c=s[0];n&&(0,l.mutateBlock)(c),i.push([c.formatHolder,null,s])}else"Paragraph"==(null==a?void 0:a.blockType)&&(n&&(0,l.mutateBlock)(a),o.forEach((function(e){!r&&"Entity"==e.segmentType&&e.entityFormat.isReadonly||i.push([e,a,s])})))})),i}function c(e,t,r,n){var i=[],a=n?t.map((function(e){return[e]})):[t],l=d(e,{includeListFormatHolder:"never",contentUnderSelectedTableCell:"ignoreForTable"});return u(l),l.forEach((function(e){for(var t=e.path,n=e.block,l=function(e){var l=(0,o.getClosestAncestorBlockGroupIndex)(t,a[e],r);return l>=0?(i.filter((function(e){return e.block==t[l]})).length<=0&&i.push({parent:t[l+1],block:t[l],path:t.slice(l+1)}),"break"):e==a.length-1&&n?(i.push({parent:t[0],block:n,path:t}),"break"):void 0},s=0;s<a.length&&"break"!==l(s);s++);})),i}function d(e,t){var r=[];return(0,a.iterateSelections)(e,(function(e,t,n,o){r.push({path:e,tableContext:t,block:n,segments:o})}),t),r}function u(e){e.length>1&&p(e,!1)&&e.pop(),e.length>1&&p(e,!0)&&e.shift()}function p(e,t){var r,n=e[t?0:e.length-1];if("Paragraph"==(null===(r=n.block)||void 0===r?void 0:r.blockType)&&n.segments&&n.segments.length>0){var o=n.block.segments,i=n.segments[0];return 1==n.segments.length&&"SelectionMarker"==i.segmentType&&i==o[t?o.length-1:0]}return!1}t.getSelectedSegmentsAndParagraphs=s,t.getSelectedSegments=function(e,t,r){return(r?s(e,t,!1,!0):s(e,t)).map((function(e){return e[0]}))},t.getSelectedParagraphs=function(e,t){var r=d(e,{includeListFormatHolder:"never"}),n=[];return u(r),r.forEach((function(e){var r=e.block;"Paragraph"==(null==r?void 0:r.blockType)&&n.push(t?(0,l.mutateBlock)(r):r)})),n},t.getOperationalBlocks=c,t.getFirstSelectedTable=function(e){var t,r=d(e,{includeListFormatHolder:"never"}),o=[];return u(r),r.forEach((function(e){var r=e.block,i=e.tableContext,a=e.path;if(!t)if("Table"==(null==r?void 0:r.blockType))t=r,o=(0,n.__spreadArray)([],(0,n.__read)(a),!1);else if(null==i?void 0:i.table){t=i.table;var l=a.filter((function(e){return e.blocks.indexOf(i.table)>=0}))[0],s=a.indexOf(l);o=s>=0?a.slice(s):[]}})),[t,o]},t.getFirstSelectedListItem=function(e){var t;return c(e,["ListItem"],["TableCell"]).forEach((function(e){!t&&(0,i.isBlockGroupOfType)(e.block,"ListItem")&&(t=e.block)})),t}},6303:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSelectedCells=void 0;var n=r(9404);t.getSelectedCells=function(e){var t=-1,r=-1,o=-1,i=-1,a=!1;return e.rows.forEach((function(e,l){return e.cells.forEach((function(e,s){(0,n.hasSelectionInBlockGroup)(e)&&(a=!0,t<0&&(t=l),r<0&&(r=s),o=Math.max(o,l),i=Math.max(i,s))}))})),a?{firstRow:t,firstColumn:r,lastRow:o,lastColumn:i}:null}},7691:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasSelectionInBlock=void 0;var n=r(9404),o=r(3407);t.hasSelectionInBlock=function(e){switch(e.blockType){case"Paragraph":return e.segments.some(o.hasSelectionInSegment);case"Table":return e.rows.some((function(e){return e.cells.some(n.hasSelectionInBlockGroup)}));case"BlockGroup":return(0,n.hasSelectionInBlockGroup)(e);case"Divider":case"Entity":return!!e.isSelected;default:return!1}}},9404:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasSelectionInBlockGroup=void 0;var n=r(7691);t.hasSelectionInBlockGroup=function(e){return!("TableCell"!=e.blockGroupType||!e.isSelected)||!!e.blocks.some(n.hasSelectionInBlock)}},3407:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasSelectionInSegment=void 0;var n=r(7691);t.hasSelectionInSegment=function(e){return e.isSelected||"General"==e.segmentType&&e.blocks.some(n.hasSelectionInBlock)}},3136:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iterateSelections=void 0;var n=r(1635);function o(e,t,r,i,a){for(var l=e[0],s=(null==r?void 0:r.includeListFormatHolder)||"allSegments",c=(null==r?void 0:r.contentUnderSelectedTableCell)||"include",d=(null==r?void 0:r.contentUnderSelectedGeneralElement)||"contentOnly",u=!1,p=!1,f=0;f<l.blocks.length;f++){var m=l.blocks[f];switch(m.blockType){case"BlockGroup":var g=(0,n.__spreadArray)([m],(0,n.__read)(e),!1);if("General"==m.blockGroupType){var h=!(P=a||m.isSelected)||"both"==d||"contentOnly"==d,v=P&&("both"==d||"generalElementOnly"==d||0==m.blocks.length);if(h&&o(g,t,r,i,P)||v&&t(e,i,m))return!0}else if(o(g,t,r,i,a))return!0;break;case"Table":var y=m.rows,b=y.every((function(e){return e.cells.every((function(e){return e.isSelected}))}));if("include"!=c&&b){if(t(e,i,m))return!0}else for(var S=0;S<y.length;S++)for(var C=y[S],_=0;_<C.cells.length;_++){var E=C.cells[_];if(E){var T={table:m,rowIndex:S,colIndex:_,isWholeTableSelected:b};if(E.isSelected&&t(e,T))return!0;if((!E.isSelected||"ignoreForTableOrCell"!=c)&&o((0,n.__spreadArray)([E],(0,n.__read)(e),!1),t,r,T,P=a||E.isSelected))return!0}}break;case"Paragraph":for(var k=[],M=0;M<m.segments.length;M++){var O=m.segments[M],P=a||O.isSelected;if("General"==O.segmentType){if(h=!P||"both"==d||"contentOnly"==d,v=P&&("both"==d||"generalElementOnly"==d||0==O.blocks.length),h&&o((0,n.__spreadArray)([O],(0,n.__read)(e),!1),t,r,i,P))return!0;v&&k.push(O)}else P&&k.push(O);P?u=!0:p=!0}if(k.length>0&&t(e,i,m,k))return!0;break;case"Divider":case"Entity":if((a||m.isSelected)&&t(e,i,m))return!0}}return!("never"==s||"ListItem"!=l.blockGroupType||!u||p&&"anySegment"!=s||!t(e,i,void 0,[l.formatHolder]))}t.iterateSelections=function(e,t,r){o([e],"Document"==e.blockGroupType&&e.persistCache?t:function(e,r,n,o){var i;return(null===(i=n)||void 0===i?void 0:i.cachedElement)&&delete n.cachedElement,t(e,r,n,o)},r)}},7595:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setSelection=void 0;var n=r(4182),o=r(376);function i(e,t,r,u){return d(t,e,r,u,(function(t){(0,n.isGeneralSegment)(e)&&s(e,t)&&c((0,o.mutateBlock)(e),t);var p,f=[];if(e.blocks.forEach((function(e,n){t=function(e,t,r,n){switch(e.blockType){case"BlockGroup":return i(e,t,r,n);case"Table":return function(e,t,r,n){var l=a(e,r),d=n?a(e,n):l;if(t)e.rows.forEach((function(e){return e.cells.forEach((function(e){var a=t;t=i(e,t,r,n),a&&t&&((0,o.mutateBlock)(e).isSelected=!0)}))}));else for(var u=0;u<e.rows.length;u++)for(var p=e.rows[u],f=0;f<p.cells.length;f++){var m=e.rows[u].cells[f],g=u>=l.row&&u<=d.row&&f>=l.col&&f<=d.col;s(m,g)&&c((0,o.mutateBlock)(m),g),g||i(m,!1,r,n)}return t}(e,t,r,n);case"Divider":case"Entity":return d(t,e,r,n,(function(t){if(s(e,t)){var r=(0,o.mutateBlock)(e);t?r.isSelected=!0:delete r.isSelected}return t}));case"Paragraph":var u=[];if(e.segments.forEach((function(o,a){t=d(t,o,r,n,(function(t){return function(e,t,r,n,o,a,s){switch(t.segmentType){case"SelectionMarker":return(!r||t!=o&&t!=a)&&n.push(s),r;case"General":return l(e,t,r),t!=o&&t!=a?i(t,r,o,a):r;case"Image":var c=o==t&&(!a||a==t);return l(e,t,r,!t.isSelectedAsImageSelection!=!c?function(e){return e.isSelectedAsImageSelection=c}:void 0),r;default:return l(e,t,r),r}}(e,o,t,u,r,n,a)}))})),u.length>0)for(var p=(0,o.mutateBlock)(e),f=void 0;void 0!==(f=u.pop());)f>=0&&p.segments.splice(f,1);return t;default:return t}}(e,t,r,u),"Paragraph"==e.blockType&&0==e.segments.length&&e.isImplicit&&f.push(n)})),f.length>0)for(var m=(0,o.mutateBlock)(e);void 0!==(p=f.pop());)p>=0&&m.blocks.splice(p,1);return t}))}function a(e,t){var r=-1;return{row:t?e.rows.findIndex((function(e){return(r=e.cells.indexOf(t))>=0})):-1,col:r}}function l(e,t,r,n){(n||s(t,r))&&(0,o.mutateSegment)(e,t,(function(e){c(e,r),null==n||n(e)}))}function s(e,t){return!e.isSelected!=!t}function c(e,t){return t?e.isSelected=!0:delete e.isSelected,t}function d(e,t,r,n,o){return(e=o(e=e||t==r))&&!!n&&t!=n}t.setSelection=function(e,t,r){i(e,!1,t||null,r||null)}},1186:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBlockGroupOfType=void 0,t.isBlockGroupOfType=function(e,t){return(null==e?void 0:e.blockGroupType)==t}},4182:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isGeneralSegment=void 0,t.isGeneralSegment=function(e){return"General"==e.blockGroupType&&"General"==e.segmentType}},2038:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentModelToDom=void 0;var n=r(7057),o=r(872);function i(e){var t,r,i,a;if(e.block&&(e.segment?(0,n.isNodeOfType)(e.segment,"TEXT_NODE")?a={container:e.segment,offset:(null===(t=e.segment.nodeValue)||void 0===t?void 0:t.length)||0}:e.segment.parentNode&&(a={container:e.segment.parentNode,offset:(0,o.toArray)(e.segment.parentNode.childNodes).indexOf(e.segment)+1}):a={container:e.block,offset:0}),a&&(0,n.isNodeOfType)(a.container,"DOCUMENT_FRAGMENT_NODE")){var l=a.container.childNodes;if(l.length>a.offset)a={container:l[a.offset],offset:0};else if(a.container.lastChild){var s=a.container.lastChild;a={container:s,offset:(0,n.isNodeOfType)(s,"TEXT_NODE")?null!==(i=null===(r=s.nodeValue)||void 0===r?void 0:r.length)&&void 0!==i?i:0:s.childNodes.length}}else a=void 0}return a}t.contentModelToDom=function(e,t,r,n){n.modelHandlers.blockGroupChildren(e,t,r,n);var o=function(e,t){var r,n,o=t.regularSelection,a=o.start,l=o.end,s=t.tableSelection,c=t.imageSelection;if(c)return c;if((r=a&&i(a))&&(n=l&&i(l))){var d=e.createRange();return d.setStart(r.container,r.offset),d.setEnd(n.container,n.offset),{type:"range",range:d,isReverted:!1}}return s||null}(e,n);return r.hasRevertedRangeSelection&&"range"==(null==o?void 0:o.type)&&(o.isReverted=!0),n.domIndexer&&n.allowCacheElement&&(r.persistCache=!0),t.normalize(),o}},4768:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildFormatAppliers=t.createModelToDomConfig=t.createModelToDomContextWithConfig=t.createModelToDomContext=void 0;var n=r(1635),o=r(9853),i=r(1081),a=r(1506);function l(e,t){return Object.assign({},t,{regularSelection:{current:{block:null,segment:null}}},{listFormat:{threadItemCounts:[],nodeStack:[]},implicitFormat:{}},e)}function s(e){return{modelHandlers:Object.assign.apply(Object,(0,n.__spreadArray)([{},o.defaultContentModelHandlers],(0,n.__read)(e.map((function(e){return null==e?void 0:e.modelHandlerOverride}))),!1)),formatAppliers:c(e.map((function(e){return null==e?void 0:e.formatApplierOverride})),e.map((function(e){return null==e?void 0:e.additionalFormatAppliers}))),defaultModelHandlers:o.defaultContentModelHandlers,defaultFormatAppliers:a.defaultFormatAppliers,metadataAppliers:Object.assign.apply(Object,(0,n.__spreadArray)([{}],(0,n.__read)(e.map((function(e){return null==e?void 0:e.metadataAppliers}))),!1))}}function c(e,t){void 0===e&&(e=[]),void 0===t&&(t=[]);var r=Object.assign.apply(Object,(0,n.__spreadArray)([{}],(0,n.__read)(e),!1)),o=(0,i.getObjectKeys)(a.defaultFormatKeysPerCategory).reduce((function(e,o){var i,l=(i=a.defaultFormatKeysPerCategory[o].map((function(e){return void 0===r[e]?a.defaultFormatAppliers[e]:r[e]}))).concat.apply(i,(0,n.__spreadArray)([],(0,n.__read)(t.map((function(e){var t;return null!==(t=null==e?void 0:e[o])&&void 0!==t?t:[]}))),!1));return e[o]=l,e}),{text:[]});return t.forEach((function(e){(null==e?void 0:e.text)&&(o.text=o.text.concat(e.text))})),o}t.createModelToDomContext=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return l(s(t),e)},t.createModelToDomContextWithConfig=l,t.createModelToDomConfig=s,t.buildFormatAppliers=c},9853:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultContentModelHandlers=void 0;var n=r(2678),o=r(2632),i=r(6807),a=r(1113),l=r(5056),s=r(4733),c=r(1590),d=r(5590),u=r(7359),p=r(1100),f=r(3897),m=r(1602),g=r(3837),h=r(3303),v=r(4347);t.defaultContentModelHandlers={block:n.handleBlock,blockGroupChildren:o.handleBlockGroupChildren,br:i.handleBr,entityBlock:l.handleEntityBlock,entitySegment:l.handleEntitySegment,generalBlock:c.handleGeneralBlock,generalSegment:c.handleGeneralSegment,divider:a.handleDivider,image:d.handleImage,list:u.handleList,listItem:p.handleListItem,paragraph:f.handleParagraph,formatContainer:s.handleFormatContainer,segment:m.handleSegment,segmentDecorator:g.handleSegmentDecorator,table:h.handleTable,text:v.handleText}},2678:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleBlock=void 0,t.handleBlock=function(e,t,r,n,o){var i=n.modelHandlers;switch(r.blockType){case"Table":o=i.table(e,t,r,n,o);break;case"Paragraph":o=i.paragraph(e,t,r,n,o);break;case"Entity":o=i.entityBlock(e,t,r,n,o);break;case"Divider":o=i.divider(e,t,r,n,o);break;case"BlockGroup":switch(r.blockGroupType){case"General":o=i.generalBlock(e,t,r,n,o);break;case"FormatContainer":o=i.formatContainer(e,t,r,n,o);break;case"ListItem":o=i.listItem(e,t,r,n,o)}}return o}},2632:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleBlockGroupChildren=void 0,t.handleBlockGroupChildren=function(e,t,r,n){var o,i=n.listFormat,a=i.nodeStack,l=t.firstChild;try{for(r.blocks.forEach((function(o,a){var s;0!=a&&"BlockGroup"==o.blockType&&"ListItem"==o.blockGroupType||(i.nodeStack=[]),l=n.modelHandlers.block(e,t,o,n,l),"Entity"==o.blockType&&(null===(s=n.domIndexer)||void 0===s||s.onBlockEntity(o,r))}));l;){var s=l.nextSibling;null===(o=l.parentNode)||void 0===o||o.removeChild(l),l=s}}finally{i.nodeStack=a}}},6807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleBr=void 0;var n=r(8535);t.handleBr=function(e,t,r,o,i){var a=e.createElement("br"),l=e.createElement("span");l.appendChild(a),t.appendChild(l),(0,n.handleSegmentCommon)(e,a,l,r,o,i)}},1113:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleDivider=void 0;var n=r(3494),o=r(9290);t.handleDivider=function(e,t,r,i,a){var l,s=i.allowCacheElement?r.cachedElement:void 0;return s&&!r.isSelected?a=(0,o.reuseCachedElement)(t,s,a):(s=e.createElement(r.tagName),i.allowCacheElement&&(r.cachedElement=s),t.insertBefore(s,a),(0,n.applyFormat)(s,i.formatAppliers.divider,r.format,i),r.size&&s.setAttribute("size",r.size)),null===(l=i.onNodeCreated)||void 0===l||l.call(i,r,s),a}},5056:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleEntitySegment=t.handleEntityBlock=void 0;var n=r(1635),o=r(4134),i=r(3494),a=r(1081),l=r(9290),s=r(7828),c="_E_EBlockEntityContainer";function d(e){var t;return(0,n.__assign)((0,n.__assign)({},null===(t=e.pendingFormat)||void 0===t?void 0:t.format),e.defaultFormat)}t.handleEntityBlock=function(e,t,r,n,a){var u,p,f=r.entityFormat,m=r.wrapper;(0,i.applyFormat)(m,n.formatAppliers.entity,f,n);var g=n.addDelimiterForEntity&&"inline-block"==m.style.display&&"100%"==m.style.width,h=null===(u=m.parentElement)||void 0===u?void 0:u.classList.contains(c),v=h&&g?m.parentElement:m;return a=(0,l.reuseCachedElement)(t,v,a),g&&(h||(0,s.wrap)(e,m,"div").classList.add(c),(0,o.addDelimiters)(e,m,d(n),n)),null===(p=n.onNodeCreated)||void 0===p||p.call(n,r,m),a},t.handleEntitySegment=function(e,t,r,l,c){var u,p=r.entityFormat,f=r.wrapper,m=r.format;if(t.appendChild(f),null==c||c.push(f),(0,a.getObjectKeys)(m).length>0){var g=(0,s.wrap)(e,f,"span");(0,i.applyFormat)(g,l.formatAppliers.segment,m,l)}if((0,i.applyFormat)(f,l.formatAppliers.entity,p,l),l.addDelimiterForEntity&&p.isReadonly){var h=(0,n.__read)((0,o.addDelimiters)(e,f,d(l),l),2),v=h[0],y=h[1];c&&(c.push(v,y),v.firstChild&&c.push(v.firstChild),y.firstChild&&c.push(y.firstChild)),l.regularSelection.current.segment=v}else l.regularSelection.current.segment=f;null===(u=l.onNodeCreated)||void 0===u||u.call(l,r,f)}},4733:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleFormatContainer=void 0;var n=r(3494),o=r(5061),i=r(9290),a=r(8490),l={fontFamily:"monospace",whiteSpace:"pre"};t.handleFormatContainer=function(e,t,r,s,c){var d,u=s.allowCacheElement?r.cachedElement:void 0;if(u)c=(0,i.reuseCachedElement)(t,u,c),s.modelHandlers.blockGroupChildren(e,u,r,s);else if(!(0,o.isBlockGroupEmpty)(r)){var p=e.createElement(r.tagName);s.allowCacheElement&&(r.cachedElement=p),t.insertBefore(p,c),(0,a.stackFormat)(s,r.tagName,(function(){(0,n.applyFormat)(p,s.formatAppliers.container,r.format,s),(0,n.applyFormat)(p,s.formatAppliers.segmentOnBlock,r.format,s),(0,n.applyFormat)(p,s.formatAppliers.container,r.format,s)})),"pre"==r.tagName?(0,a.stackFormat)(s,l,(function(){s.modelHandlers.blockGroupChildren(e,p,r,s)})):s.modelHandlers.blockGroupChildren(e,p,r,s),u=p}return u&&(null===(d=s.onNodeCreated)||void 0===d||d.call(s,r,u)),c}},1590:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleGeneralSegment=t.handleGeneralBlock=void 0;var n=r(3494),o=r(8535),i=r(7057),a=r(9290),l=r(7828);t.handleGeneralBlock=function(e,t,r,o,i){var l,s=r.element;return i&&s.parentNode==t?i=(0,a.reuseCachedElement)(t,s,i):(s=s.cloneNode(),r.element=s,(0,n.applyFormat)(s,o.formatAppliers.general,r.format,o),t.insertBefore(s,i)),null===(l=o.onNodeCreated)||void 0===l||l.call(o,r,s),o.modelHandlers.blockGroupChildren(e,s,r,o),i},t.handleGeneralSegment=function(e,t,r,a,s){var c,d=r.element.cloneNode();if(r.element=d,t.appendChild(d),(0,i.isNodeOfType)(d,"ELEMENT_NODE")){var u=(0,l.wrap)(e,d,"span");(0,o.handleSegmentCommon)(e,d,u,r,a,s),(0,n.applyFormat)(d,a.formatAppliers.general,r.format,a),null===(c=a.onNodeCreated)||void 0===c||c.call(a,r,d)}a.modelHandlers.blockGroupChildren(e,d,r,a)}},5590:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleImage=void 0;var n=r(3494),o=r(8535),i=r(861);t.handleImage=function(e,t,r,a,l){var s=e.createElement("img"),c=document.createElement("span");t.appendChild(c),c.appendChild(s),s.src=r.src,r.alt&&(s.alt=r.alt),r.title&&(s.title=r.title),(0,n.applyFormat)(s,a.formatAppliers.image,r.format,a),(0,n.applyFormat)(s,a.formatAppliers.dataset,r.dataset,a);var d=r.format,u=d.width,p=d.height,f=u?(0,i.parseValueWithUnit)(u):0,m=p?(0,i.parseValueWithUnit)(p):0;f>0&&(s.width=f),m>0&&(s.height=m),r.isSelectedAsImageSelection&&(a.imageSelection={type:"image",image:s}),(0,o.handleSegmentCommon)(e,s,c,r,a,l)}},7359:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleList=void 0;var n=r(1635),o=r(3494),i=r(2656);t.handleList=function(e,t,r,a,l){var s,c,d=0,u=a.listFormat.nodeStack;for(0==u.length&&u.push({node:t});d<r.levels.length&&d+1<u.length;d++){var p=u[d+1],f=r.levels[d];if(p.listType!=f.listType||(null===(s=p.dataset)||void 0===s?void 0:s.editingInfo)!=f.dataset.editingInfo||"OL"==f.listType&&"number"==typeof f.format.startNumberOverride)break}for(u.splice(d+1);d<r.levels.length;d++){var m=r.levels[d],g=e.createElement(m.listType||"UL");u[u.length-1].node.insertBefore(g,0==d?l:null),u.push((0,n.__assign)({node:g},m)),(0,o.applyFormat)(g,a.formatAppliers.listLevelThread,m.format,a),(0,i.applyMetadata)(m,a.metadataAppliers.listLevel,m.format,a),(0,o.applyFormat)(g,a.formatAppliers.listLevel,m.format,a),(0,o.applyFormat)(g,a.formatAppliers.dataset,m.dataset,a),null===(c=a.onNodeCreated)||void 0===c||c.call(a,m,g)}return l}},1100:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleListItem=void 0;var n=r(3494),o=r(2656),i=r(7958),a=r(8490),l=r(2463);t.handleListItem=function(e,t,r,s,c){var d,u;c=s.modelHandlers.list(e,t,r,s,c);var p=s.listFormat.nodeStack,f=(null===(d=null==p?void 0:p[(null==p?void 0:p.length)-1])||void 0===d?void 0:d.node)||t,m=e.createElement("li"),g=r.levels[r.levels.length-1];return f.insertBefore(m,(null==c?void 0:c.parentNode)==f?c:null),g?((0,n.applyFormat)(m,s.formatAppliers.segment,r.formatHolder.format,s),(0,n.applyFormat)(m,s.formatAppliers.listItemThread,g.format,s),(0,o.applyMetadata)(g,s.metadataAppliers.listItem,r.format,s),(0,n.applyFormat)(m,s.formatAppliers.listItemElement,r.format,s),(0,a.stackFormat)(s,r.formatHolder.format,(function(){s.modelHandlers.blockGroupChildren(e,m,r,s)}))):(r.blocks.forEach(i.setParagraphNotImplicit),s.modelHandlers.blockGroupChildren(e,m,r,s),(0,l.unwrap)(m)),null===(u=s.onNodeCreated)||void 0===u||u.call(s,r,m),c}},3897:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleParagraph=void 0;var n=r(1635),o=r(3494),i=r(1081),a=r(4637),l=r(9290),s=r(8490),c=r(2463);t.handleParagraph=function(e,t,r,d,u){var p,f=d.allowCacheElement?r.cachedElement:void 0;return f&&r.segments.every((function(e){return"General"!=e.segmentType&&!e.isSelected}))?u=(0,l.reuseCachedElement)(t,f,u):(0,s.stackFormat)(d,(null===(p=r.decorator)||void 0===p?void 0:p.tagName)||null,(function(){var l,p,m,g,h=!r.isImplicit||!!r.decorator||(0,i.getObjectKeys)(r.format).length>0&&r.segments.some((function(e){return"SelectionMarker"!=e.segmentType})),v=h?(0,n.__assign)((0,n.__assign)({},(null===(l=r.decorator)||void 0===l?void 0:l.format)||{}),r.segmentFormat):{};f=e.createElement((null===(p=r.decorator)||void 0===p?void 0:p.tagName)||"div"),t.insertBefore(f,u),d.regularSelection.current={block:h?f:f.parentNode,segment:null};var y=function(){var t=f;if(t){var o=r.segments[0];"SelectionMarker"==(null==o?void 0:o.segmentType)&&d.modelHandlers.text(e,t,(0,n.__assign)((0,n.__assign)({},o),{segmentType:"Text",text:""}),d,[]),r.segments.forEach((function(n){var o=[];d.modelHandlers.segment(e,t,n,d,o),o.forEach((function(e){var t;null===(t=d.domIndexer)||void 0===t||t.onSegment(e,r,[n])}))}))}};h?((0,s.stackFormat)(d,v,y),(0,o.applyFormat)(f,d.formatAppliers.block,r.format,d),(0,o.applyFormat)(f,d.formatAppliers.container,r.format,d),(0,o.applyFormat)(f,d.formatAppliers.segmentOnBlock,v,d)):y(),(0,a.optimize)(f),u=f.nextSibling,f&&(null===(m=d.onNodeCreated)||void 0===m||m.call(d,r,f),null===(g=d.domIndexer)||void 0===g||g.onParagraph(f)),h?d.allowCacheElement&&(r.cachedElement=f):((0,c.unwrap)(f),f=void 0)})),u}},1602:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleSegment=void 0;var n=r(1635);t.handleSegment=function(e,t,r,o,i){var a=o.regularSelection;switch(r.isSelected&&!a.start&&(a.start=(0,n.__assign)({},a.current)),r.segmentType){case"Text":o.modelHandlers.text(e,t,r,o,i);break;case"Br":o.modelHandlers.br(e,t,r,o,i);break;case"Image":o.modelHandlers.image(e,t,r,o,i);break;case"General":o.modelHandlers.generalSegment(e,t,r,o,i);break;case"Entity":o.modelHandlers.entitySegment(e,t,r,o,i)}r.isSelected&&a.start&&(a.end=(0,n.__assign)({},a.current))}},3837:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleSegmentDecorator=void 0;var n=r(3494),o=r(7057),i=r(8490),a=r(4310);t.handleSegmentDecorator=function(e,t,r,l,s){var c=r.code,d=r.link;(0,o.isNodeOfType)(t,"ELEMENT_NODE")&&(d&&(0,i.stackFormat)(l,"a",(function(){var e,r=(0,a.wrapAllChildNodes)(t,"a");(0,n.applyFormat)(r,l.formatAppliers.link,d.format,l),(0,n.applyFormat)(r,l.formatAppliers.dataset,d.dataset,l),null==s||s.push(r),null===(e=l.onNodeCreated)||void 0===e||e.call(l,d,r)})),c&&(0,i.stackFormat)(l,"code",(function(){var e,r=(0,a.wrapAllChildNodes)(t,"code");(0,n.applyFormat)(r,l.formatAppliers.code,c.format,l),null==s||s.push(r),null===(e=l.onNodeCreated)||void 0===e||e.call(l,c,r)})))}},3303:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleTable=void 0;var n=r(3494),o=r(5442),i=r(5061),a=r(4310),l=r(9290);t.handleTable=function(e,t,r,s,c){var d,u,p,f,m,g,h;if((0,i.isBlockEmpty)(r))return c;var v=s.allowCacheElement?r.cachedElement:void 0;v?(c=(0,l.reuseCachedElement)(t,v,c),(0,a.moveChildNodes)(v)):(v=e.createElement("table"),s.allowCacheElement&&(r.cachedElement=v),t.insertBefore(v,c),(0,n.applyFormat)(v,s.formatAppliers.block,r.format,s),(0,n.applyFormat)(v,s.formatAppliers.table,r.format,s),(0,n.applyFormat)(v,s.formatAppliers.tableBorder,r.format,s),(0,n.applyFormat)(v,s.formatAppliers.dataset,r.dataset,s)),null===(d=s.onNodeCreated)||void 0===d||d.call(s,r,v);var y=e.createElement("tbody");v.appendChild(y);for(var b=0;b<r.rows.length;b++){var S=r.rows[b];if(0!=S.cells.length){var C=s.allowCacheElement&&S.cachedElement||e.createElement("tr");y.appendChild(C),(0,a.moveChildNodes)(C),S.cachedElement||(s.allowCacheElement&&(S.cachedElement=C),(0,n.applyFormat)(C,s.formatAppliers.tableRow,S.format,s)),null===(u=s.onNodeCreated)||void 0===u||u.call(s,S,C);for(var _=0;_<S.cells.length;_++){var E=S.cells[_];if(E.isSelected){var T=s.tableSelection||{type:"table",table:v,firstColumn:_,lastColumn:_,firstRow:b,lastRow:b};T.table==v&&(T.lastColumn=Math.max(T.lastColumn,_),T.lastRow=Math.max(T.lastRow,b)),s.tableSelection=T}if(!E.spanAbove&&!E.spanLeft){var k=s.allowCacheElement&&E.cachedElement||e.createElement(E.isHeader?"th":"td");C.appendChild(k);for(var M=1,O=1,P=r.widths[_],w=S.height;null===(f=null===(p=r.rows[b+M])||void 0===p?void 0:p.cells[_])||void 0===f?void 0:f.spanAbove;M++)w+=r.rows[b+M].height;for(;null===(m=S.cells[_+O])||void 0===m?void 0:m.spanLeft;O++)P+=r.widths[_+O];M>1&&(k.rowSpan=M),O>1&&(k.colSpan=O),(!E.cachedElement||E.format.useBorderBox&&(0,o.hasMetadata)(r))&&(P>0&&!k.style.width&&(k.style.width=P+"px"),w>0&&!k.style.height&&(k.style.height=w+"px")),E.cachedElement||(s.allowCacheElement&&(E.cachedElement=k),(0,n.applyFormat)(k,s.formatAppliers.block,E.format,s),(0,n.applyFormat)(k,s.formatAppliers.tableCell,E.format,s),(0,n.applyFormat)(k,s.formatAppliers.tableCellBorder,E.format,s),(0,n.applyFormat)(k,s.formatAppliers.dataset,E.dataset,s)),s.modelHandlers.blockGroupChildren(e,k,E,s),null===(g=s.onNodeCreated)||void 0===g||g.call(s,E,k)}}}}return null===(h=s.domIndexer)||void 0===h||h.onTable(v,r),c}},4347:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleText=void 0;var n=r(8535);t.handleText=function(e,t,r,o,i){var a=e.createTextNode(r.text),l=e.createElement("span");t.appendChild(l),l.appendChild(a),o.formatAppliers.text.forEach((function(e){return e(r.format,a,o)})),(0,n.handleSegmentCommon)(e,a,l,r,o,i)}},6040:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeNode=void 0;var n=r(7057),o=["SPAN","B","EM","I","U","SUB","SUP","STRIKE","S","A","CODE"];function i(e,t){var r=e.attributes,n=t.attributes;if(r.length!=n.length)return!1;for(var o=0;o<r.length;o++)if(r[o].name!=n[o].name||r[o].value!=n[o].value)return!1;return!0}t.mergeNode=function(e){for(var t=e.firstChild;t;){var r=t.nextSibling;if(r&&(0,n.isNodeOfType)(t,"ELEMENT_NODE")&&(0,n.isNodeOfType)(r,"ELEMENT_NODE")&&t.tagName==r.tagName&&o.indexOf(t.tagName)>=0&&i(t,r)){for(;r.firstChild;)t.appendChild(r.firstChild);r.parentNode.removeChild(r)}else t=r}}},4637:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.optimize=void 0;var n=r(4134),o=r(6040),i=r(4818);t.optimize=function e(t){if(!(0,n.isEntityElement)(t)){(0,i.removeUnnecessarySpan)(t),(0,o.mergeNode)(t);for(var r=t.firstChild;r;r=r.nextSibling)e(r)}}},4818:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeUnnecessarySpan=void 0;var n=r(7057);t.removeUnnecessarySpan=function(e){for(var t=e.firstChild;t;)if((0,n.isNodeOfType)(t,"ELEMENT_NODE")&&"SPAN"==t.tagName&&0==t.attributes.length){var r=t,o=t.nextSibling;for(t=t.nextSibling;r.lastChild;){var i=r.lastChild;e.insertBefore(i,o),o=i}e.removeChild(r)}else t=t.nextSibling}},3494:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyFormat=void 0,t.applyFormat=function(e,t,r,n){t.forEach((function(t){null==t||t(r,e,n)}))}},2656:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyMetadata=void 0;var n=r(5442);t.applyMetadata=function(e,t,r,o){t&&(0,n.updateMetadata)(e,(function(e){return t.applierFunction(e,r,o),e}),t.metadataDefinition)}},8535:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleSegmentCommon=void 0;var n=r(3494);t.handleSegmentCommon=function(e,t,r,o,i,a){var l;t.firstChild||(i.regularSelection.current.segment=t),(0,n.applyFormat)(r,i.formatAppliers.styleBasedSegment,o.format,i),null==a||a.push(t),i.modelHandlers.segmentDecorator(e,r,o,i,a),(0,n.applyFormat)(r,i.formatAppliers.elementBasedSegment,o.format,i),null===(l=i.onNodeCreated)||void 0===l||l.call(i,o,t)}},8490:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stackFormat=void 0;var n=r(1635),o=r(2355);t.stackFormat=function(e,t,r){var i="string"==typeof t?o.defaultContentModelFormatMap[t]:t;if(i){var a=e.implicitFormat;try{e.implicitFormat=(0,n.__assign)((0,n.__assign)({},a),i),r()}finally{e.implicitFormat=a}}else r()}},5132:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentModelToText=void 0;var r={onDivider:function(e){return"hr"==e.tagName?"________________________________________":""},onEntityBlock:function(){return""},onEntitySegment:function(e){var t;return null!==(t=e.wrapper.textContent)&&void 0!==t?t:""},onGeneralSegment:function(e){var t;return null!==(t=e.element.textContent)&&void 0!==t?t:""},onImage:function(){return" "},onText:function(e){return e.text},onParagraph:function(){return!0},onTable:function(){return!0},onBlockGroup:function(){return!0}};function n(e,t,r){r.onBlockGroup(e)&&e.blocks.forEach((function(e){switch(e.blockType){case"Paragraph":if(r.onParagraph(e)){var o="";e.segments.forEach((function(e){switch(e.segmentType){case"Br":t.push(o),o="";break;case"Entity":o+=r.onEntitySegment(e);break;case"General":o+=r.onGeneralSegment(e);break;case"Text":o+=r.onText(e);break;case"Image":o+=r.onImage(e)}})),o&&t.push(o)}break;case"Divider":t.push(r.onDivider(e));break;case"Entity":t.push(r.onEntityBlock(e));break;case"Table":r.onTable(e)&&e.rows.forEach((function(e){return e.cells.forEach((function(e){n(e,t,r)}))}));break;case"BlockGroup":n(e,t,r)}}))}t.contentModelToText=function(e,t,o){void 0===t&&(t="\r\n");var i=[];return n(e,i,Object.assign({},r,o)),i.join(t)}},3528:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AutoFormatPlugin=void 0;var n=r(4990),o=r(7662),i=r(1698),a=r(5978),l=r(4939),s=r(212),c=r(4504),d=r(7864),u=r(7957),p={autoBullet:!1,autoNumbering:!1,autoUnlink:!1,autoLink:!1,autoHyphen:!1,autoFraction:!1,autoOrdinals:!1},f=function(){function e(e){void 0===e&&(e=p),this.options=e,this.editor=null}return e.prototype.getName=function(){return"AutoFormat"},e.prototype.initialize=function(e){this.editor=e},e.prototype.dispose=function(){this.editor=null},e.prototype.onPluginEvent=function(e){if(this.editor)switch(e.eventType){case"input":this.handleEditorInputEvent(this.editor,e);break;case"keyDown":this.handleKeyDownEvent(this.editor,e);break;case"contentChanged":this.handleContentChangedEvent(this.editor,e)}},e.prototype.handleEditorInputEvent=function(e,t){var r=this,n=t.rawEvent,o=e.getDOMSelection();if("insertText"===n.inputType&&o&&"range"===o.type&&o.range.collapsed&&" "===n.data){var u={changeSource:"",apiName:""};(0,a.formatTextSegmentBeforeSelectionMarker)(e,(function(e,t,n,o,a){var p=r.options,f=p.autoBullet,h=p.autoNumbering,v=p.autoLink,y=p.autoHyphen,b=p.autoFraction,S=p.autoOrdinals,C=!1,_=!1,E=!1,T=!1,k=!1;return(f||h)&&(E=(0,l.keyboardListTrigger)(e,n,a,f,h)),v&&(_=(0,i.createLinkAfterSpace)(t,n,a)),y&&(C=(0,c.transformHyphen)(t,n,a)),b&&(T=(0,s.transformFraction)(t,n,a)),S&&(k=(0,d.transformOrdinals)(t,n,a)),u.apiName=m(E,C),u.changeSource=g(E,C,_),E||C||_||T||k}),u)}},e.prototype.handleKeyDownEvent=function(e,t){var r=t.rawEvent;r.defaultPrevented||t.handledByEditFeature||"Backspace"!==r.key||this.options.autoUnlink&&(0,u.unlink)(e,r)},e.prototype.handleContentChangedEvent=function(e,t){var r=this.options.autoLink;"Paste"==t.source&&r&&(0,o.createLink)(e)},e}();t.AutoFormatPlugin=f;var m=function(e,t){return e?"autoToggleList":t?"autoHyphen":""},g=function(e,t,r){return e||t?n.ChangeSource.AutoFormat:r?n.ChangeSource.AutoLink:""}},4504:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transformHyphen=void 0;var n=r(5978);t.transformHyphen=function(e,t,r){var o=e.text.split(" ");if("--"===o[o.length-2]){var i=e.text.lastIndexOf("--");return(l=(0,n.splitTextSegment)(e,t,i,i+2)).text=l.text.replace("--","—"),r.canUndoByBackspace=!0,!0}var a=o.pop();if(a&&(null==a?void 0:a.indexOf("--"))>-1&&"--"!==a.trim()){i=e.text.indexOf(a);var l,s=(l=(0,n.splitTextSegment)(e,t,i,i+a.length-1)).text.length;if("-"!==l.text[0]&&"-"!==l.text[s-1])return l.text=l.text.replace("--","—"),r.canUndoByBackspace=!0,!0}return!1}},7662:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLink=void 0;var n=r(4990),o=r(5978);t.createLink=function(e){var t=null,r=[];(0,o.formatTextSegmentBeforeSelectionMarker)(e,(function(e,t,i){if(t.link)return r.push(t.link),!0;var a=null;return!(t.link||!(a=(0,o.matchLink)(t.text))||((0,n.addLink)(t,{format:{href:a.normalizedUrl,underline:!0},dataset:{}}),t.link&&r.push(t.link),0))}),{changeSource:n.ChangeSource.AutoLink,onNodeCreated:function(e,n){!t&&r.indexOf(e)>=0&&(t=n)},getChangeData:function(){return t}})}},1698:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLinkAfterSpace=void 0;var n=r(5978);t.createLinkAfterSpace=function(e,t,r){var o=e.text.split(" ").pop(),i=null==o?void 0:o.trim(),a=null;return!!(i&&o&&(a=(0,n.matchLink)(i)))&&((0,n.splitTextSegment)(e,t,e.text.length-o.trimLeft().length,e.text.trimRight().length).link={format:{href:a.normalizedUrl,underline:!0},dataset:{}},r.canUndoByBackspace=!0,!0)}},7957:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unlink=void 0;var n=r(5978);t.unlink=function(e,t){(0,n.formatTextSegmentBeforeSelectionMarker)(e,(function(e,r,n){return!!(null==r?void 0:r.link)&&(r.link=void 0,t.preventDefault(),!0)}))}},9886:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertAlphaToDecimals=void 0,t.convertAlphaToDecimals=function(e){var t=e.toUpperCase();if(t){for(var r=0,n=0;n<t.length;n++)r=26*r+(t.charCodeAt(n)-65+1);return r}}},8030:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getIndex=void 0;var n=r(9886);t.getIndex=function(e){var t=e.replace(/[^a-zA-Z0-9 ]/g,""),r=parseInt(t);return isNaN(r)?(0,n.convertAlphaToDecimals)(t):r}},5919:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getListTypeStyle=void 0;var n=r(5978),o=r(3728),i=r(4990);t.getListTypeStyle=function(e,t,r){void 0===t&&(t=!0),void 0===r&&(r=!0);var n=(0,i.getSelectedSegmentsAndParagraphs)(e,!0);if(n[0]){var u=n[0][0],p=n[0][1],f=null==p?void 0:p.segments[0];if(u&&"SelectionMarker"==u.segmentType&&f&&"Text"==f.segmentType){var m=f.text.trim(),g=c.get(m);if(g&&t)return{listType:"UL",styleType:g};if(r){var h=l(e,p),v=a(e,h),y=s(h),b=(0,o.getNumberingListStyle)(m,v,y);if(b)return{listType:"OL",styleType:b,index:!d(m)&&y===b&&v?v+1:void 0}}}}};var a=function(e,t){return t?(0,n.findListItemsInSameThread)(e,t).length:void 0},l=function(e,t){var r=(0,i.getOperationalBlocks)(e,["ListItem"],["TableCell"])[0],n=void 0;if(r){var o=r.parent.blocks.indexOf(t);if(o>-1)for(var a=o-1;a>-1;a--){var l=r.parent.blocks[a];if((0,i.isBlockGroupOfType)(l,"ListItem")){n=l;break}}}return n},s=function(e){var t;if(null==e?void 0:e.levels[0].dataset)return null===(t=(0,i.updateListMetadata)(e.levels[0]))||void 0===t?void 0:t.orderedStyleType},c=new Map([["*",i.BulletListType.Disc],["-",i.BulletListType.Dash],["--",i.BulletListType.Square],["->",i.BulletListType.LongArrow],["--\x3e",i.BulletListType.DoubleLongArrow],["=>",i.BulletListType.UnfilledArrow],[">",i.BulletListType.ShortArrow],["—",i.BulletListType.Hyphen]]),d=function(e){var t=e.replace(/[^\w\s]/g,"");return/^[1aAiI]$/.test(t)}},3728:(e,t,r)=>{"use strict";var n,o,i,a,l,s;Object.defineProperty(t,"__esModule",{value:!0}),t.getNumberingListStyle=void 0;var c,d,u=r(8030),p=r(4990);!function(e){e[e.Decimal=1]="Decimal",e[e.LowerAlpha=2]="LowerAlpha",e[e.UpperAlpha=3]="UpperAlpha",e[e.LowerRoman=4]="LowerRoman",e[e.UpperRoman=5]="UpperRoman"}(c||(c={})),function(e){e[e.Dot=1]="Dot",e[e.Dash=2]="Dash",e[e.Parenthesis=3]="Parenthesis",e[e.DoubleParenthesis=4]="DoubleParenthesis"}(d||(d={}));var f={".":1,"-":2,")":3},m=[p.NumberingListType.LowerRoman,p.NumberingListType.LowerRomanDash,p.NumberingListType.LowerRomanDoubleParenthesis,p.NumberingListType.LowerRomanParenthesis],g=[p.NumberingListType.UpperRoman,p.NumberingListType.UpperRomanDash,p.NumberingListType.UpperRomanDoubleParenthesis,p.NumberingListType.UpperRomanParenthesis],h=["1","a","A","I","i"],v=["i","v","x","l","c","d","m"],y=["I","V","X","L","C","D","M"],b=((n={})[1]=function(e){return T[e]||void 0},n[2]=function(e){return E[e]||void 0},n[3]=function(e){return _[e]||void 0},n[4]=function(e){return C[e]||void 0},n[5]=function(e){return S[e]||void 0},n),S=((o={})[1]=p.NumberingListType.UpperRoman,o[2]=p.NumberingListType.UpperRomanDash,o[3]=p.NumberingListType.UpperRomanParenthesis,o[4]=p.NumberingListType.UpperRomanDoubleParenthesis,o),C=((i={})[1]=p.NumberingListType.LowerRoman,i[2]=p.NumberingListType.LowerRomanDash,i[3]=p.NumberingListType.LowerRomanParenthesis,i[4]=p.NumberingListType.LowerRomanDoubleParenthesis,i),_=((a={})[1]=p.NumberingListType.UpperAlpha,a[2]=p.NumberingListType.UpperAlphaDash,a[3]=p.NumberingListType.UpperAlphaParenthesis,a[4]=p.NumberingListType.UpperAlphaDoubleParenthesis,a),E=((l={})[1]=p.NumberingListType.LowerAlpha,l[2]=p.NumberingListType.LowerAlphaDash,l[3]=p.NumberingListType.LowerAlphaParenthesis,l[4]=p.NumberingListType.LowerAlphaDoubleParenthesis,l),T=((s={})[1]=p.NumberingListType.Decimal,s[2]=p.NumberingListType.DecimalDash,s[3]=p.NumberingListType.DecimalParenthesis,s[4]=p.NumberingListType.DecimalDoubleParenthesis,s);t.getNumberingListStyle=function(e,t,r){var n=e.trim(),o="("===n[0]&&")"===n[n.length-1],i=o?n.slice(1,-1):n.slice(0,-1),a=(0,u.getIndex)(i),l=h.indexOf(i)<0;if(!(!a||a<1||!t&&l||t&&l&&!function(e,t){return t&&e&&t+1===e}(a,t))){var s=function(e){return Number(e)||/^[A-Za-z\s]*$/.test(e)}(i)?function(e,t,r){var n=t?4:f[e[e.length-1]];if(n){var o=function(e,t){if(!isNaN(parseInt(e)))return 1;if(/[a-z]+/g.test(e)){if(4===t&&m.indexOf(t)>-1&&v.indexOf(e[0])>-1||!t&&"i"===e)return 4;if(2===t||!t&&"a"===e)return 2}else if(/[A-Z]+/g.test(e)){if(5==t&&g.indexOf(t)>-1&&y.indexOf(e[0])>-1||!t&&"I"===e)return 5;if(3==t||!t&&"A"===e)return 3}}(t?e.slice(1,-1):e.slice(0,-1),r);return o?b[o](n):void 0}}(n,o,l?r:void 0):void 0;return s}}},4939:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keyboardListTrigger=void 0;var n=r(1635),o=r(5919),i=r(4990),a=r(5978);t.keyboardListTrigger=function(e,t,r,s,c){void 0===s&&(s=!0),void 0===c&&(c=!0);var d=(0,o.getListTypeStyle)(e,s,c);if(d){t.segments.splice(0,1);var u=d.listType,p=d.styleType,f=d.index;return l(e,u,p,f),r.canUndoByBackspace=!0,function(e,t){var r=(0,n.__read)((0,i.getOperationalBlocks)(e,["ListItem"],[]),1)[0];if(r&&(0,i.isBlockGroupOfType)(r.block,"ListItem")){var o=r.path,l=r.block;t.announceData=(0,a.getListAnnounceData)((0,n.__spreadArray)([l],(0,n.__read)(o),!1))}}(e,r),!0}return!1};var l=function(e,t,r,n){(0,a.setListType)(e,t);var o="OL"==t;n&&n>1&&o&&(0,a.setModelListStartNumber)(e,n),(0,a.setModelListStyle)(e,o?{orderedStyleType:r,applyListStyleFromLevel:!1}:{unorderedStyleType:r,applyListStyleFromLevel:!1})}},212:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transformFraction=void 0;var n=r(5978),o=new Map([["1/2","½"],["1/4","¼"],["3/4","¾"]]);t.transformFraction=function(e,t,r){var i,a=null===(i=e.text.split(" ").pop())||void 0===i?void 0:i.trim(),l=a?o.get(a):void 0;if(a&&l){var s=e.text.length-1,c=s-a.length;return(0,n.splitTextSegment)(e,t,c,s).text=l,r.canUndoByBackspace=!0,!0}return!1}},7864:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transformOrdinals=void 0;var n=r(5978);t.transformOrdinals=function(e,t,r){var o,i,a,l=null===(o=e.text.split(" ").pop())||void 0===o?void 0:o.trim();if(l){var s=l.substring(l.length-2),c=(a=(i=l).substring(0,i.length-2),/^-?\d+$/.test(a)?parseInt(i):null);if(c&&function(e){return{1:"st",2:"nd",3:"rd"}[e]||"th"}(c)===s)return(0,n.splitTextSegment)(e,t,e.text.length-3,e.text.length-1).format.superOrSubScriptSequence="super",r.canUndoByBackspace=!0,!0}return!1}},9390:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContextMenuPluginBase=void 0;var r=function(){function e(e){var t=this;this.options=e,this.container=null,this.editor=null,this.isMenuShowing=!1,this.onDismiss=function(){var e,r;t.container&&t.isMenuShowing&&(null===(r=(e=t.options).dismiss)||void 0===r||r.call(e,t.container),t.isMenuShowing=!1)}}return e.prototype.getName=function(){return"ContextMenu"},e.prototype.initialize=function(e){this.editor=e},e.prototype.dispose=function(){var e;this.onDismiss(),(null===(e=this.container)||void 0===e?void 0:e.parentNode)&&(this.container.parentNode.removeChild(this.container),this.container=null),this.editor=null},e.prototype.onPluginEvent=function(e){if("contextMenu"==e.eventType&&e.items.length>0){var t=e.rawEvent,r=e.items;this.onDismiss(),this.options.allowDefaultMenu||t.preventDefault(),this.initContainer(t.pageX,t.pageY)&&(this.options.render(this.container,r,this.onDismiss),this.isMenuShowing=!0)}},e.prototype.initContainer=function(e,t){var r,n;return!this.container&&this.editor&&(this.container=this.editor.getDocument().createElement("div"),this.container.style.position="fixed",this.container.style.width="0",this.container.style.height="0",this.editor.getDocument().body.appendChild(this.container)),null===(r=this.container)||void 0===r||r.style.setProperty("left",e+"px"),null===(n=this.container)||void 0===n||n.style.setProperty("top",t+"px"),!!this.container},e}();t.ContextMenuPluginBase=r},1862:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CustomReplacePlugin=void 0;var n=r(5978),o=function(){function e(e){this.customReplacements=e,this.editor=null,this.triggerKeys=[]}return e.prototype.getName=function(){return"CustomReplace"},e.prototype.initialize=function(e){this.editor=e,this.triggerKeys=this.customReplacements.map((function(e){return e.stringToReplace.slice(-1)}))},e.prototype.dispose=function(){this.editor=null},e.prototype.onPluginEvent=function(e){this.editor&&"input"===e.eventType&&this.handleEditorInputEvent(this.editor,e)},e.prototype.handleEditorInputEvent=function(e,t){var r=this,o=t.rawEvent,i=e.getDOMSelection(),a=o.data;this.customReplacements.length>0&&"insertText"===o.inputType&&i&&"range"===i.type&&i.range.collapsed&&a&&this.triggerKeys.indexOf(a)>-1&&(0,n.formatTextSegmentBeforeSelectionMarker)(e,(function(e,t,n,o,i){return!!r.customReplacements.some((function(e){var r=e.stringToReplace,o=e.replacementString;return(0,e.replacementHandler)(t,r,o,n)}))&&(i.canUndoByBackspace=!0,!0)}))},e}();t.CustomReplacePlugin=o},9952:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditPlugin=void 0;var n=r(7909),o=r(9322),i=r(7500),a=r(8327),l=r(4990),s={handleTabKey:!0},c=function(){function e(e){void 0===e&&(e=s),this.options=e,this.editor=null,this.disposer=null,this.shouldHandleNextInputEvent=!1,this.selectionAfterDelete=null,this.handleNormalEnter=!1}return e.prototype.getName=function(){return"Edit"},e.prototype.initialize=function(e){var t=this;this.editor=e,this.handleNormalEnter=this.editor.isExperimentalFeatureEnabled("PersistCache"),e.getEnvironment().isAndroid&&(this.disposer=this.editor.attachDomEvent({beforeinput:{beforeDispatch:function(r){return t.handleBeforeInputEvent(e,r)}}}))},e.prototype.dispose=function(){var e;this.editor=null,null===(e=this.disposer)||void 0===e||e.call(this),this.disposer=null},e.prototype.onPluginEvent=function(e){if(this.editor)switch(e.eventType){case"keyDown":this.handleKeyDownEvent(this.editor,e);break;case"keyUp":this.selectionAfterDelete&&(this.editor.setDOMSelection(this.selectionAfterDelete),this.selectionAfterDelete=null)}},e.prototype.willHandleEventExclusively=function(e){if(this.editor&&this.options.handleTabKey&&"keyDown"==e.eventType&&"Tab"==e.rawEvent.key&&!e.rawEvent.shiftKey){var t=this.editor.getDOMSelection(),r="range"==(null==t?void 0:t.type)&&t.range.collapsed?t.range.startContainer:null,n=r?this.editor.getDOMHelper().findClosestElementAncestor(r,"table"):null,o=n&&(0,l.parseTableCells)(n);if(o){var i=o[o.length-1],a=i&&i[i.length-1];if("object"==typeof a&&a.contains(r))return!0}}return!1},e.prototype.handleKeyDownEvent=function(e,t){var r=t.rawEvent;if(!r.defaultPrevented&&!t.handledByEditFeature)switch(r.key){case"Backspace":(0,n.keyboardDelete)(e,r);break;case"Delete":t.rawEvent.shiftKey||(0,n.keyboardDelete)(e,r);break;case"Tab":this.options.handleTabKey&&(0,a.keyboardTab)(e,r);break;case"Unidentified":e.getEnvironment().isAndroid&&(this.shouldHandleNextInputEvent=!0);break;case"Enter":(0,o.keyboardEnter)(e,r,this.handleNormalEnter);break;default:(0,i.keyboardInput)(e,r)}},e.prototype.handleBeforeInputEvent=function(e,t){if(this.shouldHandleNextInputEvent&&t instanceof InputEvent&&!t.defaultPrevented){this.shouldHandleNextInputEvent=!1;var r=!1;switch(t.inputType){case"deleteContentBackward":r=(0,n.keyboardDelete)(e,new KeyboardEvent("keydown",{key:"Backspace",keyCode:8,which:8}));break;case"deleteContentForward":r=(0,n.keyboardDelete)(e,new KeyboardEvent("keydown",{key:"Delete",keyCode:46,which:46}))}r&&(t.preventDefault(),this.selectionAfterDelete=e.getDOMSelection())}},e}();t.EditPlugin=c},7184:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteAllSegmentBefore=void 0;var n=r(4990);t.deleteAllSegmentBefore=function(e){if("notDeleted"==e.deleteResult)for(var t=e.insertPoint,r=t.paragraph,o=t.marker,i=r.segments.indexOf(o),a=(0,n.mutateBlock)(r),l=i-1;l>=0;l--){var s=a.segments[l];s.isSelected=!0,(0,n.deleteSegment)(r,s,e.formatContext)&&(e.deleteResult="range")}}},9234:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.backwardDeleteCollapsedSelection=t.forwardDeleteCollapsedSelection=void 0;var n=r(6746),o=r(5978),i=r(4990);function a(e){return function(t){var r;if("notDeleted"==t.deleteResult){var a="forward"==e,l=t.insertPoint,s=l.paragraph,c=l.marker,d=l.path,u=l.tableContext,p=s.segments;!function(e){var t,r,n=e.segments;if("Br"==(null===(t=n[n.length-1])||void 0===t?void 0:t.segmentType)){var o=n.filter((function(e){return"SelectionMarker"!=e.segmentType}));"Br"!=(null===(r=o[o.length-2])||void 0===r?void 0:r.segmentType)&&(0,i.mutateBlock)(e).segments.pop()}}(s);var f,m,g=p.indexOf(c)+(a?1:-1),h=p[g];if(h)(0,i.deleteSegment)(s,h,t.formatContext,e)&&(t.deleteResult="singleChar",(0,i.setParagraphNotImplicit)(s));else if(function(e,t,r,n){return!e&&1==t.length&&"SelectionMarker"==t[0].segmentType&&r.format.marginLeft&&parseInt(r.format.marginLeft)&&(0,i.getClosestAncestorBlockGroupIndex)(n,["Document","TableCell"],["ListItem"])>-1}(a,p,s,d)&&(m=function(e){var t=e[e.length-1];return"Document"==t.blockGroupType?t:null}(d)))(0,o.setModelIndentation)(m,"outdent"),t.deleteResult="range";else if(f=(0,n.getLeafSiblingBlock)(d,s,a)){var v=f.block,y=f.path,b=f.siblingSegment;if("Paragraph"==v.blockType){var S=(0,i.mutateBlock)(v);b?(0,i.deleteSegment)(S,b,t.formatContext,e)&&(t.deleteResult="range"):(a?t.lastParagraph=S:("Br"==(null===(r=S.segments[S.segments.length-1])||void 0===r?void 0:r.segmentType)&&(0,i.mutateBlock)(S).segments.pop(),t.insertPoint={marker:c,paragraph:S,path:y,tableContext:u},t.lastParagraph=s),t.deleteResult="range"),t.lastTableContext=u}else(0,i.deleteBlock)((0,i.mutateBlock)(y[0]).blocks,v,void 0,t.formatContext,e)&&(t.deleteResult="range")}else t.deleteResult="nothingToDelete"}}}t.forwardDeleteCollapsedSelection=a("forward"),t.backwardDeleteCollapsedSelection=a("backward")},5068:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteEmptyQuote=void 0;var n=r(1635),o=r(4990);t.deleteEmptyQuote=function(e){var t=e.deleteResult;if("nothingToDelete"==t||"notDeleted"==t||"range"==t){var r=e.insertPoint,n=e.formatContext,s=r.path,c=r.paragraph,d=null==n?void 0:n.rawEvent,u=(0,o.getClosestAncestorBlockGroupIndex)(s,["FormatContainer"],["TableCell","ListItem"]),p=s[u];if(p&&"FormatContainer"===p.blockGroupType&&"blockquote"==p.tagName){var f=s[u+1],m=f.blocks.indexOf(p);i(p)?((0,o.unwrapBlock)(f,p),null==d||d.preventDefault(),e.deleteResult="range"):"Enter"===(null==d?void 0:d.key)&&p.blocks.indexOf(c)>=0&&a(c)&&(l((0,o.mutateBlock)(p),f,m,c),null==d||d.preventDefault(),e.deleteResult="range")}}};var i=function(e){return 1===e.blocks.length&&"Paragraph"===e.blocks[0].blockType&&a(e.blocks[0])},a=function(e){return e.segments.every((function(e){return"SelectionMarker"===e.segmentType||"Br"===e.segmentType}))},l=function(e,t,r,i){var a,l=e.blocks.indexOf(i);if(l>=0){var s=(0,o.mutateBlock)(t);if(l<e.blocks.length-1){var c=(0,o.createFormatContainer)(e.tagName,e.format);(a=c.blocks).push.apply(a,(0,n.__spreadArray)([],(0,n.__read)(e.blocks.splice(l+1,e.blocks.length-l-1)),!1)),s.blocks.splice(r+1,0,c)}s.blocks.splice(r+1,0,i),e.blocks.splice(l,1),0==e.blocks.length&&s.blocks.splice(r,0)}}},9200:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteList=void 0;var n=r(4990);t.deleteList=function(e){if("notDeleted"==e.deleteResult){var t=e.insertPoint,r=t.paragraph,o=t.marker,i=t.path;if(r.segments[0]==o){var a=i[(0,n.getClosestAncestorBlockGroupIndex)(i,["ListItem"],["TableCell","FormatContainer"])],l=null==a?void 0:a.levels[a.levels.length-1];l&&(null==a?void 0:a.blocks[0])==r&&("block"==l.format.displayForDummyItem?a.levels.pop():l.format.displayForDummyItem="block",e.deleteResult="range")}}}},2285:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.backwardDeleteWordSelection=t.forwardDeleteWordSelection=void 0;var n,o=r(1635),i=r(4990);function a(e){return function(t){if("notDeleted"==t.deleteResult)for(var r=t.insertPoint,n=r.marker,a=r.paragraph,l=a.segments.indexOf(n),s="forward"==e,c=function(e,t,r,n){var a,l,s,c,d,u,p,f,m,g;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:a=r?1:-1,l=e.segments,s=(0,i.isWhiteSpacePreserved)(e.format.whiteSpace),c=t+a,o.label=1;case 1:if(!(c>=0&&c<l.length))return[3,12];switch((d=l[c]).segmentType){case"Text":return[3,2];case"Image":return[3,7];case"SelectionMarker":return[3,9]}return[3,10];case 2:u=r?0:d.text.length-1,o.label=3;case 3:return u>=0&&u<d.text.length?(p=d.text[u],f=(0,i.isPunctuation)(p),m=(0,i.isSpace)(p),[4,{punctuation:f,space:m,text:!f&&!m}]):[3,6];case 4:if(o.sent()){if(g=(g=d.text).substring(0,u)+g.substring(u+1),s||(g=(0,i.normalizeText)(g,r)),n.deleteResult="range",!g)return l.splice(c,1),a>0&&(c-=a),[3,6];d.text=g,a>0&&(u-=a)}o.label=5;case 5:return u+=a,[3,3];case 6:return[3,11];case 7:return[4,{punctuation:!0,space:!1,text:!1}];case 8:return o.sent()&&(l.splice(c,1),a>0&&(c-=a),n.deleteResult="range"),[3,11];case 9:return[3,11];case 10:return[2,null];case 11:return c+=a,[3,1];case 12:return[2,null]}}))}((0,i.mutateBlock)(a),l,s,t),d=c.next(),u=0;5!=u&&!d.done;){var p=d.value,f=p.punctuation,m=p.space,g=p.text;switch(u){case 0:u=m?4:f?1:2,d=c.next(!0);break;case 1:s&&m?(u=3,d=c.next(!0)):f?d=c.next(!0):u=5;break;case 2:s&&m?(u=3,d=c.next(!0)):g?d=c.next(!0):u=5;break;case 3:f||!m?u=5:d=c.next(!0);break;case 4:m?d=c.next(!0):f?(u=s?3:1,d=c.next(!0)):u=s?5:2}}}}!function(e){e[e.Start=0]="Start",e[e.Punctuation=1]="Punctuation",e[e.Text=2]="Text",e[e.NonText=3]="NonText",e[e.Space=4]="Space",e[e.End=5]="End"}(n||(n={})),t.forwardDeleteWordSelection=a("forward"),t.backwardDeleteWordSelection=a("backward")},1939:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldDeleteAllSegmentsBefore=t.shouldDeleteWord=t.handleKeyboardEventResult=void 0;var n=r(4990);t.handleKeyboardEventResult=function(e,t,r,o,i){switch(i.skipUndoSnapshot=!0,i.clearModelCache=!1,o){case"notDeleted":return i.clearModelCache=!0,!1;case"nothingToDelete":return r.preventDefault(),!1;case"range":case"singleChar":return r.preventDefault(),(0,n.normalizeContentModel)(t),"range"==o&&(i.skipUndoSnapshot=!1),e.triggerEvent("beforeKeyboardEditing",{rawEvent:r}),!0}},t.shouldDeleteWord=function(e,t){return t&&e.altKey&&!e.metaKey||!t&&e.ctrlKey&&!e.altKey},t.shouldDeleteAllSegmentsBefore=function(e){return e.metaKey&&!e.altKey}},950:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleEnterOnList=void 0;var n=r(1635),o=r(5978),i=r(9399),a=r(4990);t.handleEnterOnList=function(e){var t=e.deleteResult,r=e.insertPoint;if("notDeleted"==t||"nothingToDelete"==t){var i=r.path,c=(0,a.getClosestAncestorBlockGroupIndex)(i,["ListItem"],["TableCell","FormatContainer"]),d=i[c],u=i[c+1];if("ListItem"===(null==d?void 0:d.blockGroupType)&&u){var p=(0,a.mutateBlock)(d);l(p)?p.levels.pop():(p=s(e,p,u),e.formatContext&&(e.formatContext.announceData=(0,o.getListAnnounceData)((0,n.__spreadArray)([p],(0,n.__read)(i.slice(c+1)),!1))));var f=u.blocks.indexOf(p);if(u.blocks[f+1]){var m=u.blocks[f+1];(0,a.isBlockGroupOfType)(m,"ListItem")&&m.levels[0]&&m.levels.forEach((function(e){1!==e.format.startNumberOverride&&(e.format.startNumberOverride=void 0)}))}e.deleteResult="range"}}};var l=function(e){return 1===e.blocks.length&&"Paragraph"===e.blocks[0].blockType&&2===e.blocks[0].segments.length&&"SelectionMarker"===e.blocks[0].segments[0].segmentType&&"Br"===e.blocks[0].segments[1].segmentType},s=function(e,t,r){var o,l=e.insertPoint,s=r.blocks.indexOf(t),d=l.paragraph,u=t.blocks.indexOf(d),p=(0,i.splitParagraph)(l),f=c(t),m=(0,a.createListItem)(f,l.marker.format);m.blocks.push(p);var g=t.blocks.length-u-1;return u>=0&&g>0&&(o=m.blocks).push.apply(o,(0,n.__spreadArray)([],(0,n.__read)((0,a.mutateBlock)(t).blocks.splice(u+1,g)),!1)),l.paragraph=p,(0,a.mutateBlock)(r).blocks.splice(s+1,0,m),e.lastParagraph==d&&(e.lastParagraph=p),m},c=function(e){return e.levels.map((function(e){return(0,a.createListLevel)(e.listType,(0,n.__assign)((0,n.__assign)({},e.format),{startNumberOverride:void 0,displayForDummyItem:void 0}),e.dataset)}))}},685:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleEnterOnParagraph=void 0;var n=r(4990),o=r(9399);t.handleEnterOnParagraph=function(e){var t,r,i=e.insertPoint,a=i.paragraph,l=i.path,s=null!==(r=null===(t=l[0])||void 0===t?void 0:t.blocks.indexOf(a))&&void 0!==r?r:-1;if("notDeleted"==e.deleteResult&&s>=0){var c=(0,o.splitParagraph)(e.insertPoint);(0,n.mutateBlock)(l[0]).blocks.splice(s+1,0,c),e.deleteResult="range",e.lastParagraph=c,e.insertPoint.paragraph=c}}},7909:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keyboardDelete=void 0;var n=r(7184),o=r(5068),i=r(9200),a=r(4990),l=r(1939),s=r(2285),c=r(9234);t.keyboardDelete=function(e,t){var r=!1;return function(e,t){if(e){if("range"==e.type&&e.range.collapsed){var r=e.range;return!((0,a.isNodeOfType)(r.startContainer,"TEXT_NODE")&&!(0,a.isModifierKey)(t)&&(function(e,t){return"Backspace"==e.key&&t.startOffset>1}(t,r)||function(e,t){var r,n;return"Delete"==e.key&&t.startOffset<(null!==(n=null===(r=t.startContainer.nodeValue)||void 0===r?void 0:r.length)&&void 0!==n?n:0)-1}(t,r)))}return!0}return!1}(e.getDOMSelection(),t)&&e.formatContentModel((function(d,u){var p=(0,a.deleteSelection)(d,function(e,t){var r="Delete"==e.key,a=(0,l.shouldDeleteAllSegmentsBefore)(e)&&!r?n.deleteAllSegmentBefore:null,d=(0,l.shouldDeleteWord)(e,t)?r?s.forwardDeleteWordSelection:s.backwardDeleteWordSelection:null,u=r?c.forwardDeleteCollapsedSelection:c.backwardDeleteCollapsedSelection,p=r?null:o.deleteEmptyQuote;return[a,d,r?null:i.deleteList,u,p]}(t,!!e.getEnvironment().isMac),u).deleteResult;return r=(0,l.handleKeyboardEventResult)(e,d,t,p,u)}),{rawEvent:t,changeSource:a.ChangeSource.Keyboard,getChangeData:function(){return t.which},scrollCaretIntoView:!0,apiName:"Delete"==t.key?"handleDeleteKey":"handleBackspaceKey"}),r}},9322:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keyboardEnter=void 0;var n=r(5068),o=r(4990),i=r(950),a=r(685);t.keyboardEnter=function(e,t,r){var l=e.getDOMSelection();e.formatContentModel((function(e,s){var c,d=(0,o.deleteSelection)(e,[],s);if(l&&"table"!=l.type){d.deleteResult="notDeleted";var u=t.shiftKey?[]:[i.handleEnterOnList,n.deleteEmptyQuote];r&&u.push(a.handleEnterOnParagraph),(0,o.runEditSteps)(u,d)}return"range"==d.deleteResult&&(s.newPendingFormat=null===(c=d.insertPoint)||void 0===c?void 0:c.marker.format,(0,o.normalizeContentModel)(e),t.preventDefault(),!0)}),{rawEvent:t,scrollCaretIntoView:!0})}},7500:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keyboardInput=void 0;var n=r(4990);t.keyboardInput=function(e,t){if(function(e,t){return!(!e||(0,n.isModifierKey)(t)||"Space"!=t.key&&1!=t.key.length||"range"==e.type&&e.range.collapsed)}(e.getDOMSelection(),t))return e.takeSnapshot(),e.formatContentModel((function(e,t){var r,o=(0,n.deleteSelection)(e,[],t);return t.skipUndoSnapshot=!0,"range"==o.deleteResult&&(t.newPendingFormat=null===(r=o.insertPoint)||void 0===r?void 0:r.marker.format,(0,n.normalizeContentModel)(e),!0)}),{scrollCaretIntoView:!0,rawEvent:t}),!0}},8327:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keyboardTab=void 0;var n=r(4990),o=r(8580),i=r(2172),a=r(4642),l=r(9889),s=r(5978);t.keyboardTab=function(e,t){var r=e.getDOMSelection();switch(null==r?void 0:r.type){case"range":return e.formatContentModel((function(e,r){return function(e,t,r){var a=(0,n.getOperationalBlocks)(e,["ListItem","TableCell"],[]),c=a.length>0?a[0].block:void 0;return a.length>1?((0,s.setModelIndentation)(e,t.shiftKey?"outdent":"indent"),t.preventDefault(),!0):(0,n.isBlockGroupOfType)(c,"TableCell")?(0,l.handleTabOnTableCell)(e,c,t):"Paragraph"===(null==c?void 0:c.blockType)?(0,i.handleTabOnParagraph)(e,c,t,r):!!(0,n.isBlockGroupOfType)(c,"ListItem")&&(0,o.handleTabOnList)(e,c,t,r)}(e,t,r)}),{apiName:"handleTabKey"}),!0;case"table":return e.formatContentModel((function(e){return(0,a.handleTabOnTable)(e,t)}),{apiName:"handleTabKey"}),!0}}},8580:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleTabOnList=void 0;var n=r(2172),o=r(5978);t.handleTabOnList=function(e,t,r,i){var a=function(e){return e.blocks.filter((function(e){return"Paragraph"==e.blockType&&e.segments.some((function(e){return e.isSelected}))}))}(t);return function(e){return"Paragraph"==e.blocks[0].blockType&&"SelectionMarker"==e.blocks[0].segments[0].segmentType}(t)||1!=a.length||"Paragraph"!==a[0].blockType?((0,o.setModelIndentation)(e,r.shiftKey?"outdent":"indent",void 0,i),r.preventDefault(),!0):(0,n.handleTabOnParagraph)(e,a[0],r,i)}},2172:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleTabOnParagraph=void 0;var n=r(5978),o=r(4990),i="    ";t.handleTabOnParagraph=function(e,t,r,a){var l=t.segments.filter((function(e){return e.isSelected})),s=1===l.length&&"SelectionMarker"===l[0].segmentType,c=t.segments.every((function(e){return e.isSelected}));if("SelectionMarker"===t.segments[0].segmentType&&s||c){var d=t.format,u=d.marginLeft,p=d.marginRight,f="rtl"===d.direction;if(r.shiftKey&&(!f&&(!u||"0px"==u)||f&&(!p||"0px"==p)))return!1;(0,n.setModelIndentation)(e,r.shiftKey?"outdent":"indent",void 0,a)}else if(s){var m=t.segments.findIndex((function(e){return"SelectionMarker"===e.segmentType}));if(r.shiftKey){if("Text"==(v=t.segments[m-1]).segmentType){var g=v.text.length-4;if(v.text===i)(0,o.mutateBlock)(t).segments.splice(m-1,1);else{if(v.text.substring(g)!==i)return!1;(0,o.mutateSegment)(t,v,(function(e){e.text=e.text.substring(0,g)}))}}}else{var h=t.segments[m].format,v=(0,o.createText)(i,h);(0,o.mutateBlock)(t).segments.splice(m,0,v)}}else{var y=void 0,b=void 0;if(t.segments.forEach((function(e,t){e.isSelected&&(y||(y=t),b=t)})),!y||!b)return!1;var S=t.segments[y],C=(0,o.createText)(r.shiftKey?i:" ",S.format),_=(0,o.createSelectionMarker)(S.format);(0,o.mutateBlock)(t).segments.splice(y,b-y+1,C,_)}return r.preventDefault(),!0}},4642:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleTabOnTable=void 0;var n=r(4990),o=r(5978);t.handleTabOnTable=function(e,t){var r=(0,n.getFirstSelectedTable)(e)[0];return!(!r||!function(e){var t,r,n,o;return(null===(r=null===(t=e.rows[0])||void 0===t?void 0:t.cells[0])||void 0===r?void 0:r.isSelected)&&(null===(o=null===(n=e.rows[e.rows.length-1])||void 0===n?void 0:n.cells[e.widths.length-1])||void 0===o?void 0:o.isSelected)}(r)||((0,o.setModelIndentation)(e,t.shiftKey?"outdent":"indent"),t.preventDefault(),0))}},9889:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleTabOnTableCell=void 0;var n=r(5978),o=r(4990);t.handleTabOnTableCell=function(e,t,r){var i,a,l,s=(0,o.getFirstSelectedTable)(e)[0];if(!r.shiftKey&&s&&(null===(i=s.rows[s.rows.length-1])||void 0===i?void 0:i.cells[s.widths.length-1])===t){var c=(0,o.mutateBlock)(s);(0,n.insertTableRow)(c,"insertBelow"),(0,n.clearSelectedCells)(c,{firstRow:c.rows.length-1,firstColumn:0,lastRow:c.rows.length-1,lastColumn:c.widths.length-1}),(0,o.normalizeTable)(c,e.format);var d=null===(l=null===(a=c.rows[c.rows.length-1])||void 0===a?void 0:a.cells[0])||void 0===l?void 0:l.blocks[0];if("Paragraph"==d.blockType){var u=(0,o.createSelectionMarker)(e.format);(0,o.mutateBlock)(d).segments.unshift(u),(0,o.setParagraphNotImplicit)(d),(0,o.setSelection)(c.rows[c.rows.length-1].cells[0],u)}return r.preventDefault(),!0}return!1}},6746:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLeafSiblingBlock=void 0;var n=r(1635),o=r(4990);t.getLeafSiblingBlock=function(e,t,r){for(var i,a=(0,n.__spreadArray)([],(0,n.__read)(e),!1),l=function(){var e=a[0],n=e.blocks.indexOf(t);if(n<0)return"break";var l=e.blocks[n+(r?1:-1)];if(l){for(;"BlockGroup"==l.blockType;){var s=l.blocks[r?0:l.blocks.length-1];if(!s)return{value:{block:l,path:a}};if("BlockGroup"!=s.blockType)return a.unshift(l),{value:{block:s,path:a}};a.unshift(l),l=s}return{value:{block:l,path:a}}}if((0,o.isGeneralSegment)(e)){a.shift();var c=-1,d=e,u=null===(i=a[0])||void 0===i?void 0:i.blocks.find((function(e){return"Paragraph"==e.blockType&&(c=e.segments.indexOf(d))>=0}));if(!u)return"break";var p=u.segments[c+(r?1:-1)];if(p)return{value:{block:u,path:a,siblingSegment:p}};t=u}else{if("Document"==e.blockGroupType||"TableCell"==e.blockGroupType)return"break";a.shift(),t=e}};a.length>0;){var s=l();if("object"==typeof s)return s.value;if("break"===s)break}return null}},9399:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitParagraph=void 0;var n=r(1635),o=r(4990);t.splitParagraph=function(e){var t,r=e.paragraph,i=e.marker,a=(0,o.createParagraph)(!1,r.format,r.segmentFormat),l=r.segments.indexOf(i),s=r.segments.splice(l,r.segments.length-l);return 0==r.segments.length&&r.segments.push((0,o.createBr)(i.format)),(t=a.segments).push.apply(t,(0,n.__spreadArray)([],(0,n.__read)(s),!1)),(0,o.setParagraphNotImplicit)(r),e.paragraph=a,(0,o.normalizeParagraph)(r),a}},634:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HyperlinkPlugin=void 0;var n=r(5978),o=function(e){return e},i=function(){function e(e,t,r){var n=this;void 0===e&&(e=o),this.tooltip=e,this.target=t,this.onLinkClick=r,this.editor=null,this.domHelper=null,this.isMac=!1,this.disposer=null,this.currentNode=null,this.currentLink=null,this.onMouse=function(e){n.runWithHyperlink(e.target,(function(t,r){var o,i="mouseover"==e.type?"function"==typeof n.tooltip?n.tooltip(t,r):n.tooltip:null;null===(o=n.domHelper)||void 0===o||o.setDomAttribute("title",i)}))}}return e.prototype.getName=function(){return"Hyperlink"},e.prototype.initialize=function(e){this.editor=e,this.domHelper=e.getDOMHelper(),this.isMac=!!e.getEnvironment().isMac,this.disposer=e.attachDomEvent({mouseover:{beforeDispatch:this.onMouse},mouseout:{beforeDispatch:this.onMouse}})},e.prototype.dispose=function(){this.disposer&&(this.disposer(),this.disposer=null),this.currentNode=null,this.currentLink=null,this.editor=null},e.prototype.onPluginEvent=function(e){var t,r,o,i,a=this;if("keyDown"==e.eventType){var l="range"==(null==(s=null===(t=this.editor)||void 0===t?void 0:t.getDOMSelection())?void 0:s.type)?s.range.commonAncestorContainer:null;l&&l!=this.currentNode&&(this.currentNode=l,this.currentLink=null,this.runWithHyperlink(l,(function(e,t){l.textContent&&(i=(0,n.matchLink)(l.textContent))&&i.normalizedUrl==e&&(a.currentLink=t)})))}else if("keyUp"==e.eventType){var s,c="range"==(null==(s=null===(r=this.editor)||void 0===r?void 0:r.getDOMSelection())?void 0:s.type)?s.range.commonAncestorContainer:null;c&&c==this.currentNode&&this.currentLink&&this.currentLink.contains(c)&&c.textContent&&(i=(0,n.matchLink)(c.textContent))&&this.currentLink.setAttribute("href",i.normalizedUrl)}else"mouseUp"==e.eventType&&e.isClicking?this.runWithHyperlink(e.rawEvent.target,(function(t,r){var n,o;if(!(null===(n=a.onLinkClick)||void 0===n?void 0:n.call(a,r,e.rawEvent))&&a.isCtrlOrMetaPressed(e.rawEvent)&&0===e.rawEvent.button){e.rawEvent.preventDefault();var i=a.target||"_blank",l=null===(o=a.editor)||void 0===o?void 0:o.getDocument().defaultView;try{null==l||l.open(t,i)}catch(e){}}})):"contentChanged"==e.eventType&&(null===(o=this.domHelper)||void 0===o||o.setDomAttribute("title",null))},e.prototype.runWithHyperlink=function(e,t){var r,n=null===(r=this.domHelper)||void 0===r?void 0:r.findClosestElementAncestor(e,"a[href]"),o=null==n?void 0:n.getAttribute("href");o&&n&&t(o,n)},e.prototype.isCtrlOrMetaPressed=function(e){return this.isMac?e.metaKey:e.ctrlKey},e}();t.HyperlinkPlugin=i},3378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCropHTML=t.createImageCropper=void 0;var n=r(3890),o=r(823),i=r(4990),a=r(6639);function l(){var e={tag:"div",style:"position:absolute;background-color:rgb(0,0,0,0.5);pointer-events:none",className:o.ImageEditElementClass.CropOverlay},t={tag:"div",style:"position:absolute;overflow:hidden;inset:0px;",className:o.ImageEditElementClass.CropContainer,children:[]};return t&&a.XS_CROP.forEach((function(e){return a.YS_CROP.forEach((function(r){var n;return null===(n=t.children)||void 0===n?void 0:n.push(function(e,t){var r,n="w"==e?"left":"right",i="n"==t?"top":"bottom",l=a.ROTATION[t+e];return{tag:"div",className:o.ImageEditElementClass.CropHandle,style:"position:absolute;pointer-events:auto;cursor:"+t+e+"-resize;"+n+":0;"+i+":0;width:"+a.CROP_HANDLE_SIZE+"px;height:"+a.CROP_HANDLE_SIZE+"px;transform:rotate("+l+"deg)",dataset:{x:e,y:t},children:(r=[],[0,1].forEach((function(e){return[0,1].forEach((function(t){r.push(function(e,t){var r=0==t?"right:"+e+"px;height:"+(a.CROP_HANDLE_WIDTH-2*e)+"px;":"top:"+e+"px;width:"+(a.CROP_HANDLE_WIDTH-2*e)+"px;",n=0==e?"white":"black";return{tag:"div",style:"position:absolute;left:"+e+"px;bottom:"+e+"px;"+r+";background-color:"+n}}(e,t))}))})),r)}}(e,r))}))})),[t,e,e,e,e]}t.createImageCropper=function(e){return l().map((function(t){var r=(0,n.createElement)(t,e);if(r&&(0,i.isNodeOfType)(r,"ELEMENT_NODE")&&(0,i.isElementOfType)(r,"div"))return r})).filter((function(e){return!!e}))},t.getCropHTML=l},1088:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Cropper=void 0;var n=r(1635),o=r(1030);function i(e,t,r,n,o){var i=r*(1-n)-o,a=r*e+t;return Math.max(Math.min(a,i),0)/r}t.Cropper={onDragStart:function(e){var t=e.editInfo;return(0,n.__assign)({},t)},onDragging:function(e,t,r,a,l){var s,c,d=e.editInfo,u=e.x,p=e.y,f=e.options;a=(s=(0,n.__read)((0,o.rotateCoordinate)(a,l,null!==(c=d.angleRad)&&void 0!==c?c:0),2))[0],l=s[1];var m=d.widthPx,g=d.heightPx,h=d.leftPercent,v=d.rightPercent,y=d.topPercent,b=d.bottomPercent;if(void 0===h||void 0===v||void 0===y||void 0===b||void 0===r.leftPercent||void 0===r.rightPercent||void 0===r.topPercent||void 0===r.bottomPercent||void 0===m||void 0===g)return!1;var S=f.minWidth,C=f.minHeight,_=1-h-v,E=1-y-b;if(_>0&&E>0&&void 0!==S&&void 0!==C){var T=m/_,k=g/E,M="e"!=u?i(r.leftPercent,a,T,v,S):h,O="w"!=u?i(r.rightPercent,-a,T,h,S):v,P="s"!=p?i(r.topPercent,l,k,b,C):y,w="n"!=p?i(r.bottomPercent,-l,k,y,C):b;return d.leftPercent=M,d.rightPercent=O,d.topPercent=P,d.bottomPercent=w,d.widthPx=T*(1-M-O),d.heightPx=k*(1-P-w),!0}return!1}}},214:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImageEditPlugin=void 0;var n=r(1635),o=r(2338),i=r(1953),a=r(1030),l=r(7808),s=r(1088),c=r(3314),d=r(5599),u=r(4550),p=r(7302),f=r(4064),m=r(823),g=r(4116),h=r(4340),v=r(8707),y=r(2760),b=r(810),S=r(4990),C={borderColor:"#DB626C",minWidth:10,minHeight:10,preserveRatio:!0,disableRotate:!1,disableSideResize:!1,onSelectState:["resize","rotate"]},_="_dragging",E=function(){function e(e){void 0===e&&(e=C),this.options=e,this.editor=null,this.shadowSpan=null,this.selectedImage=null,this.wrapper=null,this.imageEditInfo=null,this.imageHTMLOptions=null,this.dndHelpers=[],this.clonedImage=null,this.lastSrc=null,this.wasImageResized=!1,this.isCropMode=!1,this.resizers=[],this.rotators=[],this.croppers=[],this.zoomScale=1,this.disposer=null,this.isEditing=!1}return e.prototype.getName=function(){return"ImageEdit"},e.prototype.initialize=function(e){var t=this;this.editor=e,this.disposer=e.attachDomEvent({blur:{beforeDispatch:function(){t.editor&&t.applyFormatWithContentModel(t.editor,t.isCropMode,!0)}},dragstart:{beforeDispatch:function(e){if(t.editor){var r=e.target;t.isImageSelection(r)&&(r.id=r.id+_)}}}})},e.prototype.dispose=function(){this.editor=null,this.isEditing=!1,this.cleanInfo(),this.disposer&&(this.disposer(),this.disposer=null)},e.prototype.onPluginEvent=function(e){if(this.editor)switch(e.eventType){case"mouseDown":this.mouseDownHandler(this.editor,e);break;case"mouseUp":this.mouseUpHandler(this.editor,e);break;case"keyDown":this.keyDownHandler(this.editor,e);break;case"contentChanged":e.source==S.ChangeSource.Drop&&this.onDropHandler(this.editor)}},e.prototype.isImageSelection=function(e){return(0,S.isNodeOfType)(e,"ELEMENT_NODE")&&((0,S.isElementOfType)(e,"img")||!!((0,S.isElementOfType)(e,"span")&&e.firstElementChild&&(0,S.isNodeOfType)(e.firstElementChild,"ELEMENT_NODE")&&(0,S.isElementOfType)(e.firstElementChild,"img")))},e.prototype.mouseUpHandler=function(e,t){var r=e.getDOMSelection();if(r&&"image"==r.type||this.isEditing){var n=this.isImageSelection(t.rawEvent.target)&&2===t.rawEvent.button;this.applyFormatWithContentModel(e,this.isCropMode,n)}},e.prototype.mouseDownHandler=function(e,t){this.isEditing&&this.isImageSelection(t.rawEvent.target)&&2!==t.rawEvent.button&&this.applyFormatWithContentModel(e,this.isCropMode,this.shadowSpan===t.rawEvent.target)},e.prototype.onDropHandler=function(e){var t=e.getDOMSelection();"image"==(null==t?void 0:t.type)&&e.formatContentModel((function(e){var r=(0,c.findEditingImage)(e,t.image.id),n=(0,c.findEditingImage)(e,t.image.id.replace(_,"").trim());if(r&&n){var o=r.paragraph.segments.indexOf(r.image);(0,S.mutateBlock)(r.paragraph).segments.splice(o,1);var i=n.image,a=n.paragraph;return(0,S.mutateSegment)(a,i,(function(e){e.isSelected=!0,e.isSelectedAsImageSelection=!0})),!0}return!1}))},e.prototype.keyDownHandler=function(e,t){this.isEditing&&("Escape"===t.rawEvent.key?this.removeImageWrapper():this.applyFormatWithContentModel(e,this.isCropMode,!0,!1))},e.prototype.applyFormatWithContentModel=function(e,t,r,n){var i,a=this,l=e.getDOMSelection();e.formatContentModel((function(s){var d=(0,p.getSelectedImage)(s),u=n?d:(0,c.findEditingImage)(s),m=!1;if(r||(null==u?void 0:u.image)!=(null==d?void 0:d.image)||(null==u?void 0:u.image.dataset.isEditing)||n){var h=a,v=h.lastSrc,y=h.selectedImage,b=h.imageEditInfo,C=h.clonedImage;(a.isEditing||n)&&u&&v&&y&&b&&C&&((0,S.mutateSegment)(u.paragraph,u.image,(function(t){(0,o.applyChange)(e,y,t,b,v,a.wasImageResized||a.isCropMode,C),t.isSelected=r,t.isSelectedAsImageSelection=r,delete t.dataset.isEditing})),r&&(0,g.normalizeImageSelection)(u),a.cleanInfo(),m=!0),a.isEditing=!1,a.isCropMode=!1,!d||"image"!=(null==l?void 0:l.type)||r||n||(a.isEditing=!0,a.isCropMode=t,(0,S.mutateSegment)(d.paragraph,d.image,(function(e){i=e,a.imageEditInfo=(0,f.updateImageEditInfo)(e,l.image),e.dataset.isEditing="true"})),m=!0)}return m}),{onNodeCreated:function(r,o){!n&&i&&i==r&&i.dataset.isEditing&&(0,S.isNodeOfType)(o,"ELEMENT_NODE")&&(0,S.isElementOfType)(o,"img")&&(t?a.startCropMode(e,o):a.startRotateAndResize(e,o))}},{tryGetFromCache:!0})},e.prototype.startEditing=function(e,t,r){this.imageEditInfo||(this.imageEditInfo=(0,f.getSelectedImageMetadata)(e,t)),this.lastSrc=t.getAttribute("src"),this.imageHTMLOptions=(0,u.getHTMLImageOptions)(e,this.options,this.imageEditInfo);var n=(0,l.createImageWrapper)(e,t,this.options,this.imageEditInfo,this.imageHTMLOptions,r),o=n.resizers,i=n.rotators,s=n.wrapper,c=n.shadowSpan,d=n.imageClone,p=n.croppers;this.shadowSpan=c,this.selectedImage=t,this.wrapper=s,this.clonedImage=d,this.wasImageResized=(0,a.checkIfImageWasResized)(t),this.resizers=o,this.rotators=i,this.croppers=p,this.zoomScale=e.getDOMHelper().calculateZoomScale(),e.setEditorStyle("imageEdit","outline-style:none!important;",["span:has(>img"+(0,S.getSafeIdSelector)(this.selectedImage.id)+")"])},e.prototype.startRotateAndResize=function(e,t){var r,o=this;this.imageEditInfo&&(this.startEditing(e,t,["resize","rotate"]),this.selectedImage&&this.imageEditInfo&&this.wrapper&&this.clonedImage&&(this.dndHelpers=(0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)((0,d.getDropAndDragHelpers)(this.wrapper,this.imageEditInfo,this.options,m.ImageEditElementClass.ResizeHandle,h.Resizer,(function(){o.imageEditInfo&&o.selectedImage&&o.wrapper&&o.clonedImage&&((0,b.updateWrapper)(o.imageEditInfo,o.options,o.selectedImage,o.clonedImage,o.wrapper,o.resizers),o.wasImageResized=!0)}),this.zoomScale)),!1),(0,n.__read)((0,d.getDropAndDragHelpers)(this.wrapper,this.imageEditInfo,this.options,m.ImageEditElementClass.RotateHandle,v.Rotator,(function(){var t;o.imageEditInfo&&o.selectedImage&&o.wrapper&&o.clonedImage&&((0,b.updateWrapper)(o.imageEditInfo,o.options,o.selectedImage,o.clonedImage,o.wrapper),o.updateRotateHandleState(e,o.selectedImage,o.wrapper,o.rotators,null===(t=o.imageEditInfo)||void 0===t?void 0:t.angleRad))}),this.zoomScale)),!1),(0,b.updateWrapper)(this.imageEditInfo,this.options,this.selectedImage,this.clonedImage,this.wrapper,this.resizers),this.updateRotateHandleState(e,this.selectedImage,this.wrapper,this.rotators,null===(r=this.imageEditInfo)||void 0===r?void 0:r.angleRad)))},e.prototype.updateRotateHandleState=function(e,t,r,n,o){var i=e.getVisibleViewport(),l=(0,a.isASmallImage)(t.width,t.height);if(i&&n&&n.length>0){var s=n[0],c=s.firstElementChild;(0,S.isNodeOfType)(c,"ELEMENT_NODE")&&(0,S.isElementOfType)(c,"div")&&(0,y.updateRotateHandle)(i,null!=o?o:0,r,s,c,l)}},e.prototype.isOperationAllowed=function(e){return"resize"===e||"rotate"===e||"flip"===e||"crop"===e},e.prototype.canRegenerateImage=function(e){return(0,i.canRegenerateImage)(e)},e.prototype.startCropMode=function(e,t){var r=this;this.imageEditInfo&&(this.startEditing(e,t,["crop"]),this.imageEditInfo&&this.selectedImage&&this.wrapper&&this.clonedImage&&(this.dndHelpers=(0,n.__spreadArray)([],(0,n.__read)((0,d.getDropAndDragHelpers)(this.wrapper,this.imageEditInfo,this.options,m.ImageEditElementClass.CropHandle,s.Cropper,(function(){r.imageEditInfo&&r.selectedImage&&r.wrapper&&r.clonedImage&&((0,b.updateWrapper)(r.imageEditInfo,r.options,r.selectedImage,r.clonedImage,r.wrapper,void 0,r.croppers),r.isCropMode=!0)}),this.zoomScale)),!1),(0,b.updateWrapper)(this.imageEditInfo,this.options,this.selectedImage,this.clonedImage,this.wrapper,void 0,this.croppers)))},e.prototype.cropImage=function(){if(this.editor){this.editor.getEnvironment().isSafari||this.editor.focus();var e=this.editor.getDOMSelection();"image"==(null==e?void 0:e.type)&&this.applyFormatWithContentModel(this.editor,!0,!1)}},e.prototype.editImage=function(e,t,r,n){this.startEditing(e,t,r),this.selectedImage&&this.imageEditInfo&&this.wrapper&&this.clonedImage&&(n(this.imageEditInfo),(0,b.updateWrapper)(this.imageEditInfo,this.options,this.selectedImage,this.clonedImage,this.wrapper),this.applyFormatWithContentModel(e,!1,!0,!0))},e.prototype.cleanInfo=function(){var e;null===(e=this.editor)||void 0===e||e.setEditorStyle("imageEdit",null),this.selectedImage=null,this.shadowSpan=null,this.wrapper=null,this.imageEditInfo=null,this.imageHTMLOptions=null,this.dndHelpers.forEach((function(e){return e.dispose()})),this.dndHelpers=[],this.clonedImage=null,this.lastSrc=null,this.wasImageResized=!1,this.isCropMode=!1,this.resizers=[],this.rotators=[],this.croppers=[]},e.prototype.removeImageWrapper=function(){var e=null;return this.shadowSpan&&this.shadowSpan.parentElement&&(this.shadowSpan.firstElementChild&&(0,S.isNodeOfType)(this.shadowSpan.firstElementChild,"ELEMENT_NODE")&&(0,S.isElementOfType)(this.shadowSpan.firstElementChild,"img")&&(e=this.shadowSpan.firstElementChild),(0,S.unwrap)(this.shadowSpan),this.shadowSpan=null,this.wrapper=null),e},e.prototype.flipImage=function(e){var t,r=null===(t=this.editor)||void 0===t?void 0:t.getDOMSelection();if(this.editor&&r&&"image"===r.type){var n=r.image;this.editor&&this.editImage(this.editor,n,["flip"],(function(t){var r=t.angleRad||0;r>=Math.PI/2&&r<3*Math.PI/4||r<=-Math.PI/2&&r>-3*Math.PI/4?"horizontal"===e?t.flippedVertical=!t.flippedVertical:t.flippedHorizontal=!t.flippedHorizontal:"vertical"===e?t.flippedVertical=!t.flippedVertical:t.flippedHorizontal=!t.flippedHorizontal}))}},e.prototype.rotateImage=function(e){var t,r=null===(t=this.editor)||void 0===t?void 0:t.getDOMSelection();if(this.editor&&r&&"image"===r.type){var n=r.image;this.editor&&this.editImage(this.editor,n,[],(function(t){t.angleRad=(t.angleRad||0)+e}))}},e}();t.ImageEditPlugin=E},8864:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createImageResizer=void 0;var n=r(1635),o=r(3890),i=r(823),a=r(4990),l=r(6639);t.createImageResizer=function(e,t){var r=function(e){var t=[];return l.Xs.forEach((function(r){return l.Ys.forEach((function(n){var o=""==r==(""==n)?c(r,n):null;e&&o&&e(o,r,n),o&&t.push(o)}))})),t}(t),i=function(e){var t=[];return l.Xs.forEach((function(r){return l.Ys.forEach((function(n){var o=""==r!=(""==n)?c(r,n):null;e&&o&&e(o,r,n),o&&t.push(o)}))})),t}(t);return(0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(r),!1),(0,n.__read)(i),!1).map((function(t){var r=(0,o.createElement)(t,e);if((0,a.isNodeOfType)(r,"ELEMENT_NODE")&&(0,a.isElementOfType)(r,"div"))return r})).filter((function(e){return!!e}))};var s=function(e,t,r){return"position:relative;width:10px;height:10px;background-color: #FFFFFF;cursor:"+e+"-resize;"+t+":-6px;"+r+":-6px;border-radius:100%;border: 2px solid #bfbfbf;box-shadow: 0px 0.36316px 1.36185px rgba(100, 100, 100, 0.25);"};function c(e,t){var r="w"==e?"left":"right",n="n"==t?"top":"bottom";return""==e&&""==t?null:{tag:"div",style:"position:absolute;"+r+":"+(""==e?"50%":"0px")+";"+n+":"+(""==t?"50%":"0px"),children:[{tag:"div",style:s(t+e,n,r),className:i.ImageEditElementClass.ResizeHandle,dataset:{x:e,y:t}}]}}},4340:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Resizer=void 0;var n=r(1635),o=r(1030);t.Resizer={onDragStart:function(e){var t=e.editInfo;return(0,n.__assign)({},t)},onDragging:function(e,t,r,i,a){var l,s,c=e.x,d=e.y,u=e.editInfo,p=e.options;if(r.heightPx&&r.widthPx&&void 0!==p.minWidth&&void 0!==p.minHeight){var f=r.widthPx>0&&r.heightPx>0?1*r.widthPx/r.heightPx:0;i=(l=(0,n.__read)((0,o.rotateCoordinate)(i,a,null!==(s=u.angleRad)&&void 0!==s?s:0),2))[0],a=l[1];var m=""==c,g=""==d,h=!(m||g)&&(p.preserveRatio||t.shiftKey),v=m?r.widthPx:Math.max(r.widthPx+i*("w"==c?-1:1),p.minWidth),y=g?r.heightPx:Math.max(r.heightPx+a*("n"==d?-1:1),p.minHeight);return h&&f>0&&(f>1?(v=y*f)<p.minWidth&&(y=(v=p.minWidth)/f):(y=v/f)<p.minHeight&&(v=(y=p.minHeight)*f)),u.widthPx=v,u.heightPx=y,!0}return!1}}},4632:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateSideHandlesVisibility=void 0,t.updateSideHandlesVisibility=function(e,t){e.forEach((function(e){var r=e.dataset,n=r.y,o=r.x,i=["n","s","e","w"].indexOf((null!=n?n:"")+(null!=o?o:""))>-1;e.style.display=i&&t?"none":""}))}},7046:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createImageRotator=void 0;var n=r(3890),o=r(823),i=r(4990),a=r(6639);function l(e){var t;return{tag:"svg",namespace:"http://www.w3.org/2000/svg",style:"width:16px;height:16px;margin: "+a.ROTATE_ICON_MARGIN+"px "+a.ROTATE_ICON_MARGIN+"px",children:[{tag:"path",namespace:"http://www.w3.org/2000/svg",attributes:(t={d:"M 10.5,10.0 A 3.8,3.8 0 1 1 6.7,6.3",transform:"matrix(1.1 1.1 -1.1 1.1 11.6 -10.8)"},t["fill-opacity"]="0",t.stroke=e,t)},{tag:"path",namespace:"http://www.w3.org/2000/svg",attributes:{d:"M12.0 3.648l.884-.884.53 2.298-2.298-.53z",stroke:e}}]}}t.createImageRotator=function(e,t){return(r=t,s=r.borderColor,c=r.rotateHandleBackColor,d=a.ROTATE_SIZE/2,[{tag:"div",className:o.ImageEditElementClass.RotateCenter,style:"position:absolute;left:50%;width:1px;background-color:"+s+";top:"+-a.ROTATE_HANDLE_TOP+"px;height:"+a.ROTATE_GAP+"px;margin-left:"+-a.ROTATE_WIDTH+"px;",children:[{tag:"div",className:o.ImageEditElementClass.RotateHandle,style:"position:absolute;background-color:"+c+";border:solid 1px "+s+";border-radius:50%;width:"+a.ROTATE_SIZE+"px;height:"+a.ROTATE_SIZE+"px;left:-"+(d+a.ROTATE_WIDTH)+"px;cursor:move;top:"+-a.ROTATE_SIZE+"px;line-height: 0px;",children:[l(s)]}]}]).map((function(t){var r=(0,n.createElement)(t,e);if((0,i.isNodeOfType)(r,"ELEMENT_NODE")&&(0,i.isElementOfType)(r,"div"))return r})).filter((function(e){return!!e}));var r,s,c,d}},8707:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Rotator=void 0;var n=r(1635),o=r(6639);t.Rotator={onDragStart:function(e){var t=e.editInfo;return(0,n.__assign)({},t)},onDragging:function(e,t,r,n,i){var a,l,s=e.editInfo,c=e.options;if(s.heightPx){var d=s.heightPx/2+o.DEFAULT_ROTATE_HANDLE_HEIGHT,u=d*Math.sin(null!==(a=r.angleRad)&&void 0!==a?a:0)+n,p=d*Math.cos(null!==(l=r.angleRad)&&void 0!==l?l:0)-i,f=Math.atan2(u,p);if(!t.altKey&&c&&void 0!==c.minRotateDeg){var m=f*o.DEG_PER_RAD;f=Math.round(m/c.minRotateDeg)*c.minRotateDeg/o.DEG_PER_RAD}if(s.angleRad!=f)return s.angleRad=f,!0}return!1}}},2760:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateRotateHandle=void 0;var n=r(6639);t.updateRotateHandle=function(e,t,r,o,i,a){if(a)return o.style.display="none",void(i.style.display="none");o.style.display="",i.style.display="";var l=o.getBoundingClientRect(),s=r.getBoundingClientRect(),c=n.ROTATE_SIZE+n.ROTATE_GAP+n.RESIZE_HANDLE_MARGIN;if(l&&s){var d=Number.MAX_SAFE_INTEGER,u=t*n.DEG_PER_RAD;if(u<45&&u>-45&&s.top-e.top<c)d=l.top-e.top;else if(u<=-80&&u>=-100&&s.left-e.left<c)d=l.left-e.left;else if(u>=80&&u<=100&&e.right-s.right<c){var p=l.right-e.right;d=Math.min(e.right-s.right,p)}else if((u<=-160||u>=160)&&e.bottom-s.bottom<c){var f=l.bottom-e.bottom;d=Math.min(e.bottom-s.bottom,f)}var m=Math.max(Math.min(n.ROTATE_GAP,d),0),g=Math.max(Math.min(n.ROTATE_SIZE,d-m),0);o.style.top=-m-n.RESIZE_HANDLE_MARGIN+"px",o.style.height=m+"px",i.style.top=-g+"px"}}},6639:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RESIZE_IMAGE=t.MIN_HEIGHT_WIDTH=t.YS_CROP=t.XS_CROP=t.CROP_HANDLE_WIDTH=t.CROP_HANDLE_SIZE=t.ROTATE_HANDLE_TOP=t.ROTATE_WIDTH=t.Ys=t.Xs=t.ROTATION=t.ROTATE_ICON_MARGIN=t.DEFAULT_ROTATE_HANDLE_HEIGHT=t.DEG_PER_RAD=t.ROTATE_GAP=t.ROTATE_SIZE=t.RESIZE_HANDLE_MARGIN=t.RESIZE_HANDLE_SIZE=void 0,t.RESIZE_HANDLE_SIZE=10,t.RESIZE_HANDLE_MARGIN=6,t.ROTATE_SIZE=32,t.ROTATE_GAP=15,t.DEG_PER_RAD=180/Math.PI,t.DEFAULT_ROTATE_HANDLE_HEIGHT=t.ROTATE_SIZE/2+t.ROTATE_GAP,t.ROTATE_ICON_MARGIN=8,t.ROTATION={sw:0,nw:90,ne:180,se:270},t.Xs=["w","","e"],t.Ys=["s","","n"],t.ROTATE_WIDTH=1,t.ROTATE_HANDLE_TOP=t.ROTATE_GAP+t.RESIZE_HANDLE_MARGIN,t.CROP_HANDLE_SIZE=22,t.CROP_HANDLE_WIDTH=7,t.XS_CROP=["w","e"],t.YS_CROP=["s","n"],t.MIN_HEIGHT_WIDTH=3*t.RESIZE_HANDLE_SIZE+2*t.RESIZE_HANDLE_MARGIN,t.RESIZE_IMAGE="resizeImage"},823:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ImageEditElementClass=void 0,(r=t.ImageEditElementClass||(t.ImageEditElementClass={})).ResizeHandle="r_resizeH",r.RotateHandle="r_rotateH",r.RotateCenter="r_rotateC",r.CropOverlay="r_cropO",r.CropContainer="r_cropC",r.CropHandle="r_cropH"},2338:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyChange=void 0;var n=r(5157),o=r(8782),i=r(675),a=r(4064);t.applyChange=function(e,t,r,l,s,c,d){var u,p="",f=null!=d?d:t,m=null!==(u=(0,a.updateImageEditInfo)(r,f))&&void 0!==u?u:void 0,g=(0,n.checkEditInfoState)(l,m);switch(g){case"ResizeOnly":p=l.src||"";break;case"SameWithLast":p=s;break;case"FullyChanged":p=(0,o.generateDataURL)(null!=d?d:t,l)}p!=s&&(p=e.triggerEvent("editImage",{image:t,originalSrc:l.src||t.src,previousSrc:s,newSrc:p}).newSrc),p==l.src?(0,a.updateImageEditInfo)(r,f,null):(0,a.updateImageEditInfo)(r,f,l);var h=(0,i.getGeneratedImageSize)(l);h&&(r.src=p,(c||"FullyChanged"==g)&&(r.format.width=h.targetWidth+"px",r.format.height=h.targetHeight+"px"))}},1953:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canRegenerateImage=void 0,t.canRegenerateImage=function(e){if(!e)return!1;try{var t=e.ownerDocument.createElement("canvas");t.width=10,t.height=10;var r=t.getContext("2d");return!!r&&(r.drawImage(e,0,0),r.getImageData(0,0,1,1),!0)}catch(e){return!1}}},5157:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkEditInfoState=void 0;var n=r(1635),o=["angleRad"],i=["leftPercent","rightPercent","topPercent","bottomPercent"],a=(0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(o),!1),(0,n.__read)(i),!1),l=(0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(a),!1),(0,n.__read)(["widthPx","heightPx"]),!1);function s(e,t){return null!=e&&null!=t&&Math.abs(e-t)<.001}t.checkEditInfoState=function(e,t){return e&&e.src&&!l.some((function(t){return!("number"==typeof e[t])}))?!a.every((function(t){return s(e[t],0)}))||e.flippedHorizontal||e.flippedVertical||t&&(!t||e.angleRad!==t.angleRad)?t&&o.every((function(t){return s(e[t],0)}))&&o.every((function(e){return s(t[e],0)}))&&i.every((function(r){return s(e[r],t[r])}))&&t.flippedHorizontal===e.flippedHorizontal&&t.flippedVertical===e.flippedVertical?"SameWithLast":"FullyChanged":"ResizeOnly":"Invalid"}},7808:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createImageWrapper=void 0;var n=r(3378),o=r(8864),i=r(7046),a=r(4990);t.createImageWrapper=function(e,t,r,c,u,p){var f=d(t,c),m=e.getDocument(),g=[];!r.disableRotate&&p.indexOf("rotate")>-1&&(g=(0,i.createImageRotator)(m,u));var h=[];p.indexOf("resize")>-1&&(h=(0,o.createImageResizer)(m));var v=[];p.indexOf("crop")>-1&&(v=(0,n.createImageCropper)(m));var y=s(e,f,r,c,h,g,v),b=(0,a.wrap)(m,t,"span");return{wrapper:y,shadowSpan:l(y,b),imageClone:f,resizers:h,rotators:g,croppers:v}};var l=function(e,t){var r=t.attachShadow({mode:"open"});return t.style.verticalAlign="bottom",r.appendChild(e),t},s=function(e,t,r,n,o,i,a){var l,s=e.getDocument(),d=s.createElement("span"),u=s.createElement("div");u.setAttribute("style","position:relative;width:100%;height:100%;overflow:hidden;transform:scale(1);"),u.appendChild(t),d.setAttribute("style","font-size: 24px; margin: 0px; transform: rotate("+(null!==(l=n.angleRad)&&void 0!==l?l:0)+"rad);"),d.style.display=e.getEnvironment().isSafari?"-webkit-inline-flex":"inline-flex";var p=c(e,r.borderColor);return d.appendChild(u),d.appendChild(p),d.style.userSelect="none",o&&(null==o?void 0:o.length)>0&&o.forEach((function(e){d.appendChild(e)})),i&&i.length>0&&i.forEach((function(e){d.appendChild(e)})),a&&a.length>0&&a.forEach((function(e){d.appendChild(e)})),d},c=function(e,t){var r=e.getDocument().createElement("div");return r.setAttribute("style","position:absolute;left:0;right:0;top:0;bottom:0;border:solid 2px "+t+";pointer-events:none;"),r},d=function(e,t){var r=e.cloneNode(!0);return r.style.removeProperty("transform"),t.src&&(r.src=t.src,r.removeAttribute("id"),r.style.removeProperty("max-width"),r.style.removeProperty("max-height"),r.style.width=t.widthPx+"px",r.style.height=t.heightPx+"px"),r}},2981:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.doubleCheckResize=void 0,t.doubleCheckResize=function(e,t,r,n){var o=e.widthPx,i=e.heightPx;if(null!=o&&null!=i){var a=i>0?o/i:0;r=Math.floor(r),n=Math.floor(n),o=Math.floor(o),i=Math.floor(i),e.widthPx=r,e.heightPx=n,t&&a>0&&(o!==r||i!==n)&&(r<o?e.heightPx=r/a:e.widthPx=n*a)}}},3314:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findEditingImage=void 0;var n=r(1635);function o(e,t){for(var r=0;r<e.blocks.length;r++){var n=e.blocks[r];switch(n.blockType){case"BlockGroup":var a=o(n,t);if(a)return a;break;case"Paragraph":for(var l=0;l<n.segments.length;l++){var s=n.segments[l];switch(s.segmentType){case"Image":if(s.dataset.isEditing&&!t||s.format.id==t)return{paragraph:n,image:s};break;case"General":var c=o(s,t);if(c)return c}}break;case"Table":var d=i(n,t);if(d)return d}}return null}t.findEditingImage=o;var i=function(e,t){var r,i,a,l;try{for(var s=(0,n.__values)(e.rows),c=s.next();!c.done;c=s.next()){var d=c.value;try{for(var u=(a=void 0,(0,n.__values)(d.cells)),p=u.next();!p.done;p=u.next()){var f=o(p.value,t);if(f)return f}}catch(e){a={error:e}}finally{try{p&&!p.done&&(l=u.return)&&l.call(u)}finally{if(a)throw a.error}}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return null}},8782:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateDataURL=void 0;var n=r(675);t.generateDataURL=function(e,t){var r=(0,n.getGeneratedImageSize)(t);if(!r)return"";var o=t.angleRad,i=t.widthPx,a=t.heightPx,l=t.bottomPercent,s=t.leftPercent,c=t.rightPercent,d=t.topPercent,u=t.naturalWidth,p=o||0,f=s||0,m=c||0,g=d||0,h=l||0,v=t.naturalHeight||e.naturalHeight,y=u||e.naturalHeight,b=i||e.clientWidth,S=a||e.clientHeight,C=y*(1-f-m),_=v*(1-g-h),E=window.devicePixelRatio||1,T=document.createElement("canvas"),k=r.targetWidth,M=r.targetHeight;T.width=k*E,T.height=M*E;var O=T.getContext("2d");return O&&(O.scale(E,E),O.translate(k/2,M/2),O.rotate(p),O.scale(t.flippedHorizontal?-1:1,t.flippedVertical?-1:1),O.drawImage(e,y*f,v*g,C,_,-b/2,-S/2,b,S)),T.toDataURL("image/png",1)}},675:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getGeneratedImageSize=void 0,t.getGeneratedImageSize=function(e,t){var r=e.widthPx,n=e.heightPx,o=e.angleRad,i=e.leftPercent,a=e.rightPercent,l=e.topPercent,s=e.bottomPercent;if(null!=n&&null!=r&&null!=i&&null!=a&&null!=l&&null!=s){var c=null!=o?o:0,d=r/(1-i-a),u=n/(1-l-s),p=t?d:r,f=t?u:n;return{targetWidth:Math.abs(p*Math.cos(c))+Math.abs(f*Math.sin(c)),targetHeight:Math.abs(p*Math.sin(c))+Math.abs(f*Math.cos(c)),originalWidth:d,originalHeight:u,visibleWidth:p,visibleHeight:f}}}},5599:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDropAndDragHelpers=void 0;var n=r(6782),o=r(4990);t.getDropAndDragHelpers=function(e,t,r,i,a,l,s){return function(e,t){return(0,o.toArray)(e.querySelectorAll("."+t))}(e,i).map((function(e){return new n.DragAndDropHelper(e,{editInfo:t,options:r,elementClass:i,x:e.dataset.x,y:e.dataset.y},l,a,s)}))}},4550:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getHTMLImageOptions=void 0;var n=r(1030),o="white",i="#333";t.getHTMLImageOptions=function(e,t,r){var a,l;return{borderColor:t.borderColor||(e.isDarkMode()?i:o),rotateHandleBackColor:e.isDarkMode()?i:o,isSmallImage:(0,n.isASmallImage)(null!==(a=r.widthPx)&&void 0!==a?a:0,null!==(l=r.heightPx)&&void 0!==l?l:0)}}},7302:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSelectedImage=void 0;var n=r(4990);t.getSelectedImage=function(e){var t=(0,n.getSelectedSegmentsAndParagraphs)(e,!1);return 1==t.length&&"Image"==t[0][0].segmentType&&t[0][1]?{image:t[0][0],paragraph:t[0][1]}:null}},1030:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isRTL=t.checkIfImageWasResized=t.setSize=t.setWrapperSizeDimensions=t.setFlipped=t.rotateCoordinate=t.isASmallImage=t.getPx=void 0;var n=r(6639);function o(e){return e+"px"}function i(e){var t="string"==typeof e?parseInt(e):e;return!isNaN(t)}t.getPx=o,t.isASmallImage=function(e,t){return!!(e&&t&&(e<n.MIN_HEIGHT_WIDTH||t<n.MIN_HEIGHT_WIDTH))},t.rotateCoordinate=function(e,t,r){if(0==e&&0==t)return[0,0];var n=Math.sqrt(e*e+t*t);return r=Math.atan2(t,e)-r,[n*Math.cos(r),n*Math.sin(r)]},t.setFlipped=function(e,t,r){e&&(e.style.transform="scale("+(t?-1:1)+", "+(r?-1:1)+")")},t.setWrapperSizeDimensions=function(e,t,r,n){if(t.style.borderStyle){var i=t.style.borderWidth?2*parseInt(t.style.borderWidth):2;return e.style.width=o(r+i),void(e.style.height=o(n+i))}e.style.width=o(r),e.style.height=o(n)},t.setSize=function(e,t,r,n,i,a,l){e.style.left=void 0!==t?o(t):e.style.left,e.style.top=void 0!==r?o(r):e.style.top,e.style.right=void 0!==n?o(n):e.style.right,e.style.bottom=void 0!==i?o(i):e.style.bottom,e.style.width=void 0!==a?o(a):e.style.width,e.style.height=void 0!==l?o(l):e.style.height},t.checkIfImageWasResized=function(e){var t=e.style;return!(""!==t.maxWidth&&"initial"!==t.maxWidth&&"auto"!==t.maxWidth||!i(t.height)&&!i(t.width))},t.isRTL=function(e){return"rtl"===window.getComputedStyle(e).direction}},4116:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeImageSelection=void 0;var n=r(4990);t.normalizeImageSelection=function(e){var t=e.paragraph,r=t.segments.indexOf(e.image);if(r>0){var o=t.segments[r-1],i=t.segments[r+1];if(o&&i&&"SelectionMarker"==i.segmentType&&"SelectionMarker"==o.segmentType&&i.isSelected&&o.isSelected){var a=(0,n.mutateBlock)(t);a.segments.splice(r-1,1),a.segments.splice(r,1)}return e}}},669:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateHandleCursor=void 0;var r=Math.PI,n=2*r/8,o=["nw","n","ne","e","se","s","sw","w"];t.updateHandleCursor=function(e,t){e.forEach((function(e){var r=e.dataset,i=r.y,a=r.x;e.style.cursor=function(e,t,r){void 0===t&&(t=""),void 0===r&&(r="");var i=function(e){var t=Math.round(e/n)%8;return t<0?t+8:t}(e),a=t+r,l=o.indexOf(a),s=l>=0&&l+i;return s?o[s%8]:""}(t,i,a)+"-resize"}))}},4064:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSelectedImageMetadata=t.updateImageEditInfo=void 0;var n=r(1635),o=r(7302),i=r(4990);function a(e,t,r){var o=(0,i.updateImageMetadata)(e,void 0!==r?function(e){return r}:void 0);return(0,n.__assign)((0,n.__assign)({},l(t)),o)}function l(e){return{src:e.getAttribute("src")||"",widthPx:e.clientWidth,heightPx:e.clientHeight,naturalWidth:e.naturalWidth,naturalHeight:e.naturalHeight,leftPercent:0,rightPercent:0,topPercent:0,bottomPercent:0,angleRad:0}}t.updateImageEditInfo=a,t.getSelectedImageMetadata=function(e,t){var r=l(t);return e.formatContentModel((function(e){var n=(0,o.getSelectedImage)(e);return!!(null==n?void 0:n.image)&&((0,i.mutateSegment)(n.paragraph,null==n?void 0:n.image,(function(e){r=a(e,t)})),!0)})),r}},810:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateWrapper=void 0;var n=r(2981),o=r(675),i=r(823),a=r(4990),l=r(669),s=r(4632),c=r(1030);t.updateWrapper=function(e,t,r,d,u,p,f){var m=e.angleRad,g=e.bottomPercent,h=e.leftPercent,v=e.rightPercent,y=e.topPercent,b=e.flippedHorizontal,S=e.flippedVertical,C=(0,o.getGeneratedImageSize)(e,f&&(null==f?void 0:f.length)>0);if(C){var _=C.targetWidth,E=C.targetHeight,T=C.originalWidth,k=C.originalHeight,M=C.visibleWidth,O=C.visibleHeight,P=(_-M)/2,w=(E-O)/2,x=T*(h||0),D=T*(v||0),L=k*(y||0),I=k*(g||0);u.style.margin=w+"px "+P+"px",u.style.transform="rotate("+m+"rad)",(0,c.setWrapperSizeDimensions)(u,r,M,O),(0,c.isRTL)(d)?(u.style.textAlign="right",f||(d.style.left=(0,c.getPx)(x),d.style.right=(0,c.getPx)(-D))):u.style.textAlign="left",d.style.width=(0,c.getPx)(T),d.style.height=(0,c.getPx)(k),d.style.verticalAlign="bottom",d.style.position="absolute",(0,c.setFlipped)(d.parentElement,b,S);var F=(0,c.isASmallImage)(M,M);if(f||(d.style.margin=-L+"px 0 0 "+-x+"px"),f&&f.length>0){var R=f[0],N=f.filter((function(e){return e.className===i.ImageEditElementClass.CropOverlay}));(0,c.setSize)(R,x,L,D,I,void 0,void 0),(0,c.setSize)(N[0],0,0,D,void 0,void 0,L),(0,c.setSize)(N[1],void 0,0,0,I,D,void 0),(0,c.setSize)(N[2],x,void 0,0,0,void 0,I),(0,c.setSize)(N[3],0,L,void 0,0,x,void 0),void 0!==m&&(0,l.updateHandleCursor)(f,m)}if(p){var A=u.clientWidth,B=u.clientHeight;(0,n.doubleCheckResize)(e,t.preserveRatio||!1,A,B);var j=p.map((function(e){var t=e.firstElementChild;if((0,a.isNodeOfType)(t,"ELEMENT_NODE")&&(0,a.isElementOfType)(t,"div"))return t})).filter((function(e){return!!e}));void 0!==m&&(0,l.updateHandleCursor)(j,m),(0,s.updateSideHandlesVisibility)(j,F)}}}},6109:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImageEditPlugin=t.CustomReplacePlugin=t.PickerPlugin=t.HyperlinkPlugin=t.MarkdownPlugin=t.WatermarkPlugin=t.ContextMenuPluginBase=t.ShortcutPlugin=t.ShortcutOutdentList=t.ShortcutIndentList=t.ShortcutDecreaseFont=t.ShortcutIncreaseFont=t.ShortcutNumbering=t.ShortcutBullet=t.ShortcutRedoMacOS=t.ShortcutRedoAlt=t.ShortcutRedo=t.ShortcutUndo2=t.ShortcutUndo=t.ShortcutClearFormat=t.ShortcutUnderline=t.ShortcutItalic=t.ShortcutBold=t.AutoFormatPlugin=t.EditPlugin=t.DefaultSanitizers=t.PastePlugin=t.TableEditPlugin=void 0;var n=r(289);Object.defineProperty(t,"TableEditPlugin",{enumerable:!0,get:function(){return n.TableEditPlugin}});var o=r(5898);Object.defineProperty(t,"PastePlugin",{enumerable:!0,get:function(){return o.PastePlugin}});var i=r(2751);Object.defineProperty(t,"DefaultSanitizers",{enumerable:!0,get:function(){return i.DefaultSanitizers}});var a=r(9952);Object.defineProperty(t,"EditPlugin",{enumerable:!0,get:function(){return a.EditPlugin}});var l=r(3528);Object.defineProperty(t,"AutoFormatPlugin",{enumerable:!0,get:function(){return l.AutoFormatPlugin}});var s=r(8062);Object.defineProperty(t,"ShortcutBold",{enumerable:!0,get:function(){return s.ShortcutBold}}),Object.defineProperty(t,"ShortcutItalic",{enumerable:!0,get:function(){return s.ShortcutItalic}}),Object.defineProperty(t,"ShortcutUnderline",{enumerable:!0,get:function(){return s.ShortcutUnderline}}),Object.defineProperty(t,"ShortcutClearFormat",{enumerable:!0,get:function(){return s.ShortcutClearFormat}}),Object.defineProperty(t,"ShortcutUndo",{enumerable:!0,get:function(){return s.ShortcutUndo}}),Object.defineProperty(t,"ShortcutUndo2",{enumerable:!0,get:function(){return s.ShortcutUndo2}}),Object.defineProperty(t,"ShortcutRedo",{enumerable:!0,get:function(){return s.ShortcutRedo}}),Object.defineProperty(t,"ShortcutRedoAlt",{enumerable:!0,get:function(){return s.ShortcutRedoAlt}}),Object.defineProperty(t,"ShortcutRedoMacOS",{enumerable:!0,get:function(){return s.ShortcutRedoMacOS}}),Object.defineProperty(t,"ShortcutBullet",{enumerable:!0,get:function(){return s.ShortcutBullet}}),Object.defineProperty(t,"ShortcutNumbering",{enumerable:!0,get:function(){return s.ShortcutNumbering}}),Object.defineProperty(t,"ShortcutIncreaseFont",{enumerable:!0,get:function(){return s.ShortcutIncreaseFont}}),Object.defineProperty(t,"ShortcutDecreaseFont",{enumerable:!0,get:function(){return s.ShortcutDecreaseFont}}),Object.defineProperty(t,"ShortcutIndentList",{enumerable:!0,get:function(){return s.ShortcutIndentList}}),Object.defineProperty(t,"ShortcutOutdentList",{enumerable:!0,get:function(){return s.ShortcutOutdentList}});var c=r(6560);Object.defineProperty(t,"ShortcutPlugin",{enumerable:!0,get:function(){return c.ShortcutPlugin}});var d=r(9390);Object.defineProperty(t,"ContextMenuPluginBase",{enumerable:!0,get:function(){return d.ContextMenuPluginBase}});var u=r(4898);Object.defineProperty(t,"WatermarkPlugin",{enumerable:!0,get:function(){return u.WatermarkPlugin}});var p=r(1978);Object.defineProperty(t,"MarkdownPlugin",{enumerable:!0,get:function(){return p.MarkdownPlugin}});var f=r(634);Object.defineProperty(t,"HyperlinkPlugin",{enumerable:!0,get:function(){return f.HyperlinkPlugin}});var m=r(5532);Object.defineProperty(t,"PickerPlugin",{enumerable:!0,get:function(){return m.PickerPlugin}});var g=r(1862);Object.defineProperty(t,"CustomReplacePlugin",{enumerable:!0,get:function(){return g.CustomReplacePlugin}});var h=r(214);Object.defineProperty(t,"ImageEditPlugin",{enumerable:!0,get:function(){return h.ImageEditPlugin}})},1978:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MarkdownPlugin=void 0;var n=r(4363),o={strikethrough:!1,bold:!1,italic:!1},i=function(){function e(e){void 0===e&&(e=o),this.options=e,this.editor=null,this.shouldBold=!1,this.shouldItalic=!1,this.shouldStrikethrough=!1,this.shouldCode=!1,this.lastKeyTyped=null}return e.prototype.getName=function(){return"Markdown"},e.prototype.initialize=function(e){this.editor=e},e.prototype.dispose=function(){this.editor=null,this.disableAllFeatures(),this.lastKeyTyped=null},e.prototype.onPluginEvent=function(e){if(this.editor)switch(e.eventType){case"input":this.handleEditorInputEvent(this.editor,e);break;case"keyDown":this.handleBackspaceEvent(e),this.handleKeyDownEvent(e);break;case"contentChanged":this.handleContentChangedEvent(e)}},e.prototype.handleEditorInputEvent=function(e,t){var r=t.rawEvent,o=e.getDOMSelection();if(o&&"range"==o.type&&o.range.collapsed&&"insertText"==r.inputType)switch(r.data){case"*":this.options.bold&&(this.shouldBold?((0,n.setFormat)(e,"*",{fontWeight:"bold"}),this.shouldBold=!1):this.shouldBold=!0);break;case"~":this.options.strikethrough&&(this.shouldStrikethrough?((0,n.setFormat)(e,"~",{strikethrough:!0}),this.shouldStrikethrough=!1):this.shouldStrikethrough=!0);break;case"_":this.options.italic&&(this.shouldItalic?((0,n.setFormat)(e,"_",{italic:!0}),this.shouldItalic=!1):this.shouldItalic=!0);break;case"`":this.options.codeFormat&&(this.shouldCode?((0,n.setFormat)(e,"`",{},this.options.codeFormat),this.shouldCode=!1):this.shouldCode=!0)}},e.prototype.handleKeyDownEvent=function(e){var t=e.rawEvent;if(!e.handledByEditFeature&&!t.defaultPrevented)switch(t.key){case"Enter":this.disableAllFeatures(),this.lastKeyTyped=null;break;case" ":"*"===this.lastKeyTyped&&this.shouldBold?this.shouldBold=!1:"~"===this.lastKeyTyped&&this.shouldStrikethrough?this.shouldStrikethrough=!1:"_"===this.lastKeyTyped&&this.shouldItalic?this.shouldItalic=!1:"`"===this.lastKeyTyped&&this.shouldCode&&(this.shouldCode=!1),this.lastKeyTyped=null;break;default:this.lastKeyTyped=t.key}},e.prototype.handleBackspaceEvent=function(e){e.handledByEditFeature||"Backspace"!==e.rawEvent.key||("*"===this.lastKeyTyped&&this.shouldBold?this.shouldBold=!1:"~"===this.lastKeyTyped&&this.shouldStrikethrough?this.shouldStrikethrough=!1:"_"===this.lastKeyTyped&&this.shouldItalic?this.shouldItalic=!1:"`"===this.lastKeyTyped&&this.shouldCode&&(this.shouldCode=!1),this.lastKeyTyped=null)},e.prototype.handleContentChangedEvent=function(e){"Format"==e.source&&this.disableAllFeatures()},e.prototype.disableAllFeatures=function(){this.shouldBold=!1,this.shouldItalic=!1,this.shouldStrikethrough=!1,this.shouldCode=!1},e}();t.MarkdownPlugin=i},4363:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setFormat=void 0;var n=r(1635),o=r(5978);t.setFormat=function(e,t,r,i){(0,o.formatTextSegmentBeforeSelectionMarker)(e,(function(e,a,l,s,c){if(a.text[a.text.length-1]==t){var d=a.text,u=d.slice(0,-1);if(c.newPendingFormat=(0,n.__assign)((0,n.__assign)({},s),{strikethrough:!!s.strikethrough,italic:!!s.italic,fontWeight:(null==s?void 0:s.fontWeight)?"bold":void 0}),u.indexOf(t)>-1){var p=d.length,f=d.substring(0,p-1).lastIndexOf(t);if((!(g=d)[(h=f)-1]||0==g[h-1].trim().length)&&p-f>2){var m=(0,o.splitTextSegment)(a,l,f,p);return m.text=m.text.replace(t,"").slice(0,-1),m.format=(0,n.__assign)((0,n.__assign)({},m.format),r),i&&(m.code={format:i}),c.canUndoByBackspace=!0,!0}}}var g,h;return!1}))}},2751:(e,t)=>{"use strict";function r(e,t){var r=t.toLowerCase();return"div"==r||"p"==r?null:e}Object.defineProperty(t,"__esModule",{value:!0}),t.divParagraphSanitizer=t.DefaultSanitizers=void 0,t.DefaultSanitizers={width:r,height:r,"inline-size":r,"block-size":r},t.divParagraphSanitizer=r},1254:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.excelHandler=t.childProcessor=t.processPastedContentFromExcel=void 0;var n=r(1635),o=r(8080),i=r(4990),a=r(7506),l=/<\/\s*td\s*>((?!<\/\s*tr\s*>)[\s\S])*$/i,s=/<\/\s*tr\s*>((?!<\/\s*table\s*>)[\s\S])*$/i,c=/<tr[^>]*>[^<]*/i,d=/<table[^>]*>[^<]*/i,u="solid 1px #d4d4d4";function p(e,t){if(e.match(l)){var r=t.match(c);e=(r?r[0]:"<TR>")+e+"</TR>"}if(e.match(s)){var n=t.match(d);e=(n?n[0]:"<TABLE>")+e+"</TABLE>"}return e}t.processPastedContentFromExcel=function(e,r,n){var l=e.fragment,s=e.htmlBefore,c=e.clipboardData,d=c.html?p(c.html,s):void 0;if(d&&c.html!=d){var f=(new DOMParser).parseFromString(r(d),"text/html");(0,i.moveChildNodes)(l,null==f?void 0:f.body)}var m=l.firstChild;(0,i.isNodeOfType)(m,"ELEMENT_NODE")&&"div"==m.tagName&&m.firstChild&&Array.from(m.childNodes).every((function(e){var t=(0,i.isNodeOfType)(e,"ELEMENT_NODE")&&e.tagName;return"META"==t||"TABLE"==t&&e==m.lastChild}))&&m.lastChild&&e.fragment.replaceChildren(m.lastChild),(0,o.addParser)(e.domToModelOption,"tableCell",(function(e,t){n||"none"!==t.style.borderStyle||(e.borderBottom=u,e.borderLeft=u,e.borderRight=u,e.borderTop=u)})),(0,a.setProcessor)(e.domToModelOption,"child",t.childProcessor)},t.childProcessor=function(e,t,r){var o=(0,n.__assign)({},r.segmentFormat);"TableCell"===e.blockGroupType&&e.format.textColor&&!r.segmentFormat.textColor&&(r.segmentFormat.textColor=e.format.textColor),r.defaultElementProcessors.child(e,t,r),"TableCell"===e.blockGroupType&&e.format.textColor&&(r.segmentFormat=o,delete e.format.textColor)},t.excelHandler=p},5898:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PastePlugin=void 0;var n=r(1635),o=r(8080),i=r(4990),a=r(5769),l=r(2751),s=r(8003),c=r(1340),d=r(1281),u=r(3400),p=r(1254),f=r(4840),m=r(9138),g=r(6662),h=function(){function e(e,t){void 0===t&&(t={styleSanitizers:l.DefaultSanitizers,additionalAllowedTags:[],additionalDisallowedTags:[],attributeSanitizers:{}}),this.allowExcelNoBorderTable=e,this.domToModelForSanitizing=t,this.editor=null}return e.prototype.getName=function(){return"Paste"},e.prototype.initialize=function(e){this.editor=e},e.prototype.dispose=function(){this.editor=null},e.prototype.onPluginEvent=function(e){if(this.editor&&"beforePaste"==e.eventType&&e.domToModelOption){var t=(0,c.getPasteSource)(e,!1),r=e.pasteType;switch(t){case"wordDesktop":(0,m.processPastedContentFromWordDesktop)(e,this.editor.getTrustedHTMLHandler());break;case"wacComponents":(0,g.processPastedContentWacComponents)(e);break;case"excelOnline":case"excelDesktop":"normal"!==r&&"mergeFormat"!==r||(0,p.processPastedContentFromExcel)(e,this.editor.getTrustedHTMLHandler(),this.allowExcelNoBorderTable);break;case"googleSheets":e.domToModelOption.additionalAllowedTags.push(u.PastePropertyNames.GOOGLE_SHEET_NODE_NAME);break;case"powerPointDesktop":(0,f.processPastedContentFromPowerPoint)(e,this.editor.getTrustedHTMLHandler())}(0,o.addParser)(e.domToModelOption,"link",d.parseLink),(0,o.addParser)(e.domToModelOption,"tableCell",s.deprecatedBorderColorParser),(0,o.addParser)(e.domToModelOption,"tableCell",b),(0,o.addParser)(e.domToModelOption,"table",s.deprecatedBorderColorParser),"mergeFormat"===r&&((0,o.addParser)(e.domToModelOption,"block",v),(0,o.addParser)(e.domToModelOption,"listLevel",v)),this.setEventSanitizers(e)}},e.prototype.setEventSanitizers=function(e){var t,r;if(this.domToModelForSanitizing){var o=this.domToModelForSanitizing,l=o.styleSanitizers,s=o.attributeSanitizers,c=o.additionalAllowedTags,d=o.additionalDisallowedTags;(0,i.getObjectKeys)(l).forEach((function(t){return(0,a.chainSanitizerCallback)(e.domToModelOption.styleSanitizers,t,l[t])})),(0,i.getObjectKeys)(s).forEach((function(t){return(0,a.chainSanitizerCallback)(e.domToModelOption.attributeSanitizers,t,s[t])})),(t=e.domToModelOption.additionalAllowedTags).push.apply(t,(0,n.__spreadArray)([],(0,n.__read)(c),!1)),(r=e.domToModelOption.additionalDisallowedTags).push.apply(r,(0,n.__spreadArray)([],(0,n.__read)(d),!1))}},e}();t.PastePlugin=h;var v=function(e,t){t.style.backgroundColor&&delete e.backgroundColor},y=new Map([["borderTop",{w:"borderTopWidth",s:"borderTopStyle",c:"borderTopColor"}],["borderRight",{w:"borderRightWidth",s:"borderRightStyle",c:"borderRightColor"}],["borderBottom",{w:"borderBottomWidth",s:"borderBottomStyle",c:"borderBottomColor"}],["borderLeft",{w:"borderLeftWidth",s:"borderLeftStyle",c:"borderLeftColor"}]]);function b(e,t){i.BorderKeys.forEach((function(r){if(!e[r]){var n=y.get(r);n&&t.style[n.w]&&t.style[n.s]&&!t.style[n.c]&&(e[r]=t.style[n.w]+" "+t.style[n.s])}}))}},4840:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.processPastedContentFromPowerPoint=void 0;var n=r(4990);t.processPastedContentFromPowerPoint=function(e,t){var r=e.fragment,o=e.clipboardData;if(o.html&&!o.text&&o.image){var i=(new DOMParser).parseFromString(t(o.html),"text/html");(0,n.moveChildNodes)(r,null==i?void 0:i.body)}}},5853:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WAC_IDENTIFY_SELECTOR=t.REMOVE_MARGIN_ELEMENTS=t.TEMP_ELEMENTS_CLASSES=t.COMMENT_HIGHLIGHT_CLICKED_CLASS=t.COMMENT_HIGHLIGHT_CLASS=t.LIST_CONTAINER_ELEMENT_CLASS_NAME=t.PARAGRAPH=t.OUTLINE_ELEMENT=t.IMAGE_CONTAINER=t.IMAGE_BORDER=t.NUMBER_LIST_STYLE=t.BULLET_LIST_STYLE=t.WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES=void 0;var n=r(1635);t.WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES=["TableInsertRowGapBlank","TableColumnResizeHandle","TableCellTopBorderHandle","TableCellLeftBorderHandle","TableHoverColumnHandle","TableHoverRowHandle"],t.BULLET_LIST_STYLE="BulletListStyle",t.NUMBER_LIST_STYLE="NumberListStyle",t.IMAGE_BORDER="WACImageBorder",t.IMAGE_CONTAINER="WACImageContainer",t.OUTLINE_ELEMENT="OutlineElement",t.PARAGRAPH="Paragraph",t.LIST_CONTAINER_ELEMENT_CLASS_NAME="ListContainerWrapper",t.COMMENT_HIGHLIGHT_CLASS="CommentHighlightRest",t.COMMENT_HIGHLIGHT_CLICKED_CLASS="CommentHighlightClicked",t.TEMP_ELEMENTS_CLASSES=(0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(t.WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES),!1),["ListMarkerWrappingSpan"],!1),t.REMOVE_MARGIN_ELEMENTS="span."+t.IMAGE_CONTAINER+",span."+t.IMAGE_BORDER+",."+t.COMMENT_HIGHLIGHT_CLASS+",."+t.COMMENT_HIGHLIGHT_CLICKED_CLASS+","+t.WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES.map((function(e){return'table div[class^="'+e+'"]'})).join(","),t.WAC_IDENTIFY_SELECTOR='ul[class^="'+t.BULLET_LIST_STYLE+'"]>.'+t.OUTLINE_ELEMENT+',ol[class^="'+t.NUMBER_LIST_STYLE+'"]>.'+t.OUTLINE_ELEMENT+","+t.REMOVE_MARGIN_ELEMENTS},6662:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.processPastedContentWacComponents=void 0;var n=r(1635),o=r(8080),i=r(4990),a=r(7506),l=r(5853),s=["UL","OL","LI"],c=s.join(","),d=function(e,t){var r=t.style.verticalAlign;"super"===r&&(e.superOrSubScriptSequence="super"),"sub"===r&&(e.superOrSubScriptSequence="sub")},u=function(e,t,r){var n=t.tagName;if(t.matches(l.REMOVE_MARGIN_ELEMENTS)&&(t.style.removeProperty("display"),t.style.removeProperty("margin")),t.classList.contains(l.LIST_CONTAINER_ELEMENT_CLASS_NAME))r.elementProcessors.child(e,t,r);else if(!l.TEMP_ELEMENTS_CLASSES.some((function(e){return t.classList.contains(e)}))){if(function(e,t,r){return r.listFormat.levels.length>0&&s.every((function(t){return t!=e}))&&!t.closest(c)}(n,t,r)){var o=r.listFormat;o.levels=[],o.listParent=void 0}r.defaultElementProcessors.element(e,t,r)}},p=function(e,t,r){var o,a,l,s,c,d=parseInt(null!==(o=t.getAttribute("data-aria-level"))&&void 0!==o?o:""),u=r.listFormat,p=(null===(a=u.levels[r.listFormat.levels.length-1])||void 0===a?void 0:a.listType)||(null===(l=t.closest("ol,ul"))||void 0===l?void 0:l.tagName.toUpperCase()),f=(0,i.createListLevel)(p,r.blockFormat);if((0,i.parseFormat)(t,r.formatParsers.listLevelThread,f.format,r),(0,i.parseFormat)(t,r.formatParsers.listLevel,f.format,r),r.listFormat.levels=u.currentListLevels||r.listFormat.levels,d>0)if(d>r.listFormat.levels.length)for(;d!=r.listFormat.levels.length;)r.listFormat.levels.push(f);else r.listFormat.levels.splice(d,r.listFormat.levels.length-1),r.listFormat.levels[d-1]=f;null===(c=(s=r.defaultElementProcessors).li)||void 0===c||c.call(s,e,t,r);var m=u.listParent;if(m){var g=m.blocks[m.blocks.length-1];"BlockGroup"==g.blockType&&"ListItem"==g.blockGroupType&&function(e,t,r){if(e&&"UL"!=e.listType){var o=t.closest("ol"),i=r.listFormat,a=(0,n.__read)(function(e,t){var r=t&&Array.from((null==e?void 0:e.querySelectorAll("li"))||[]).indexOf(t);return[parseInt((null==e?void 0:e.getAttribute("start"))||"1")+(r&&r>0?r:0),parseInt((null==t?void 0:t.getAttribute("data-aria-level"))||"")]}(o,t),2),l=a[0],s=a[1];i.listItemThread||(i.listItemThread=[]);var c=i.listItemThread[s];c&&l-c!=1&&(e.format.startNumberOverride=l),i.listItemThread[s]=l}}(g.levels[g.levels.length-1],t,r)}var h=[];u.levels.forEach((function(e){var t={dataset:(0,n.__assign)({},e.dataset),format:(0,n.__assign)({},e.format),listType:e.listType};h.push(t)})),u.currentListLevels=h,u.levels=[]},f=function(e,t){"block"===t.style.display&&(e.displayForDummyItem=void 0),e.marginLeft=void 0,e.marginRight=void 0},m=function(e){e.marginLeft=void 0,e.paddingLeft=void 0},g=function(e,t){(t.className.includes(l.COMMENT_HIGHLIGHT_CLASS)||t.className.includes(l.COMMENT_HIGHLIGHT_CLICKED_CLASS))&&delete e.backgroundColor};t.processPastedContentWacComponents=function(e){(0,o.addParser)(e.domToModelOption,"segment",d),(0,o.addParser)(e.domToModelOption,"listItemThread",f),(0,o.addParser)(e.domToModelOption,"listItemElement",f),(0,o.addParser)(e.domToModelOption,"listLevel",m),(0,o.addParser)(e.domToModelOption,"container",h),(0,o.addParser)(e.domToModelOption,"table",h),(0,o.addParser)(e.domToModelOption,"segment",g),(0,a.setProcessor)(e.domToModelOption,"element",u),(0,a.setProcessor)(e.domToModelOption,"li",p)};var h=function(e,t){t.style.marginLeft.startsWith("-")&&delete e.marginLeft}},7985:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getStyleMetadata=void 0;var n=r(1635),o=r(4990),i=/[\n\t'{}"]+/g;t.getStyleMetadata=function(e,t){var r=new Map;return(new DOMParser).parseFromString(t(e.htmlBefore),"text/html").querySelectorAll("style").forEach((function(e){for(var t=(null==e?void 0:e.innerHTML.trim())||"",a=0,l=function(){var e=t.indexOf("@",a+1),l=t.indexOf("}",e),s=t.indexOf("{",e);a=e;var c=t.substring(e+1,s).replace(i,"").replace("list","").trimRight().trimLeft(),d=t.substring(s,l+1).trimLeft().trimRight(),u={};d.split(";").forEach((function(e){var t=(0,n.__read)(e.split(":"),2),r=t[0],o=t[1];if(r&&o){var a=r.replace(i,"").trimRight().trimLeft(),l=o.replace(i,"").trimRight().trimLeft();u[a]=l}}));var p={"mso-level-number-format":u["mso-level-number-format"],"mso-level-start-at":u["mso-level-start-at"]||"1","mso-level-text":u["mso-level-text"]};(0,o.getObjectKeys)(p).some((function(e){return!!p[e]}))&&r.set(c,p)};a>=0;)l()})),r}},9138:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.processPastedContentFromWordDesktop=void 0;var n=r(8080),o=r(7985),i=r(5414),a=r(1570),l=r(5176),s=r(9388),c=r(7506),d=/%/;t.processPastedContentFromWordDesktop=function(e,t){var r=(0,o.getStyleMetadata)(e,t);(0,c.setProcessor)(e.domToModelOption,"element",u(r)),(0,n.addParser)(e.domToModelOption,"block",p),(0,n.addParser)(e.domToModelOption,"block",s.removeNegativeTextIndentParser),(0,n.addParser)(e.domToModelOption,"listLevel",f),(0,n.addParser)(e.domToModelOption,"container",m),(0,n.addParser)(e.domToModelOption,"table",m)};var u=function(e){return function(t,r,n){var o=(0,i.getStyles)(r);(0,l.processWordList)(o,t,r,n,e)||(0,a.processWordComments)(o,r)||n.defaultElementProcessors.element(t,r,n)}};function p(e,t){var r;d.test(t.style.lineHeight)&&!isNaN(r=parseInt(t.style.lineHeight))&&(e.lineHeight=(r/100*1.2).toString())}function f(e,t,r,n){""!=t.style.marginLeft&&(e.marginLeft=n.marginLeft),e.marginBottom=void 0}var m=function(e){var t;(null===(t=e.marginLeft)||void 0===t?void 0:t.startsWith("-"))&&delete e.marginLeft}},1570:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.processWordComments=void 0;var n=r(4990),o=/#_msocom_/;t.processWordComments=function(e,t){return"comment"==e["mso-special-character"]||(0,n.isElementOfType)(t,"a")&&o.test(t.href)||"comment-list"==e["mso-element"]}},5176:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.processWordList=void 0;var n=r(1635),o=r(9388),i=r(4990),a=/%[0-9a-zA-Z]+/g;function l(e,t){t.style.marginLeft&&"0in"!=t.style.marginLeft&&(e.paddingLeft="0px"),t.style.marginRight&&"0in"!=t.style.marginRight&&(e.paddingRight="0px")}t.processWordList=function(e,t,r,s,c){var d,u=s.listFormat;u.wordKnownLevels||(u.wordKnownLevels=new Map);var p=e["mso-list"]||"";if("ignore"===p.toLowerCase())return!0;var f=(0,n.__read)(p.split(" "),2),m=f[0],g=f[1];if(u.wordLevel=g&&parseInt(g.substr(5)),u.wordList=m||"l0",0==u.levels.length&&(u.levels=u.wordList&&u.wordKnownLevels.get(u.wordList)||[]),p&&t&&"number"==typeof u.wordLevel){var h=u.wordLevel,v=u.wordList,y=c.get(m+":"+g),b="bullet"!=(null===(d=null==y?void 0:y["mso-level-number-format"])||void 0===d?void 0:d.toLowerCase())?"OL":"UL",S=(0,i.createListLevel)(b);if((0,i.parseFormat)(r,(0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(s.formatParsers.listLevel),!1),[l],!1),S.format,s),h>u.levels.length)for(;h!=u.levels.length;)u.levels.push(S);else u.levels.splice(h,u.levels.length-1),u.levels[h-1]=S;return u.levels[u.levels.length-1].format.wordList=v,u.listParent=t,function(e,t,r,n,l){var s=e.levels[e.levels.length-1].listType,c=function(e,t){var r,n=(null==e?void 0:e["mso-level-number-format"])||"decimal";if(null==e?void 0:e["mso-level-text"]){var o="";switch(n){case"alpha-upper":o="UpperAlpha";break;case"alpha-lower":o="LowerAlpha";break;case"roman-lower":o="LowerRoman";break;case"roman-upper":o="UpperRoman";break;default:o="Number"}r='"'+(e["mso-level-text"]||"").replace("\\","").replace('"',"").replace(a,"${"+o+"}")+' "'}else switch(n){case"alpha-lower":r="lower-alpha";break;case"roman-lower":r="lower-roman";break;case"roman-upper":r="upper-roman";break;default:r="decimal"}return(0,i.getListStyleTypeFromString)(t,r)}(l,s);c&&(0,i.updateListMetadata)(e.levels[e.levels.length-1],(function(e){return Object.assign({},e,{unorderedStyleType:"UL"==s?c:void 0,orderedStyleType:"OL"==s?c:void 0})}));var d=(0,i.createListItem)(e.levels,t.segmentFormat);(0,i.parseFormat)(r,t.formatParsers.segmentOnBlock,t.segmentFormat,t),(0,i.parseFormat)(r,t.formatParsers.listItemElement,d.format,t),(0,i.parseFormat)(r,[o.removeNegativeTextIndentParser],d.format,t),"OL"==s&&function(e,t,r){var n,o,a=t.listFormat,l=a.listParent,s=a.wordList,c=a.wordKnownLevels,d=a.wordLevel,u=a.levels,p=function(e){for(var t=((null==e?void 0:e.blocks.length)||0)-1;t>0;t--){var r=null==e?void 0:e.blocks[t];if(r&&!(0,i.isEmpty)(r))return r}}(l);if(("BlockGroup"!=(null==p?void 0:p.blockType)||"ListItem"!=p.blockGroupType||d&&(null===(o=null===(n=p.levels[d])||void 0===n?void 0:n.format)||void 0===o?void 0:o.wordList)!=s)&&s){var f=(null==r?void 0:r["mso-level-start-at"])?parseInt(r["mso-level-start-at"]):NaN,m=(null==c?void 0:c.get(s))||[];null==f||isNaN(f)||m.length==u.length||(e.levels[e.levels.length-1].format.startNumberOverride=f)}}(d,t,l),t.elementProcessors.child(d,r,t),(0,i.addBlock)(n,d)}(u,s,r,t,y),u.levels.length>0&&u.wordKnownLevels.get(v)!=u.levels&&u.wordKnownLevels.set(v,(0,n.__spreadArray)([],(0,n.__read)(u.levels),!1)),!0}return!1}},9388:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeNegativeTextIndentParser=void 0,t.removeNegativeTextIndentParser=function(e,t){var r;(null===(r=e.textIndent)||void 0===r?void 0:r.startsWith("-"))&&delete e.textIndent}},3400:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PastePropertyNames=void 0,t.PastePropertyNames={GOOGLE_SHEET_NODE_NAME:"google-sheets-html-origin",PROG_ID_NAME:"ProgId",EXCEL_DESKTOP_ATTRIBUTE_NAME:"xmlns:x"}},9628:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.documentContainWacElements=void 0;var n=r(5853);t.documentContainWacElements=function(e){return!!e.fragment.querySelector(n.WAC_IDENTIFY_SELECTOR)}},1340:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPasteSource=void 0;var n=r(9628),o=r(5218),i=r(3323),a=r(3218),l=r(8131),s=r(4740),c=r(8037),d=new Map([["wordDesktop",s.isWordDesktopDocument],["excelDesktop",o.isExcelDesktopDocument],["excelOnline",i.isExcelOnlineDocument],["powerPointDesktop",l.isPowerPointDesktopDocument],["wacComponents",n.documentContainWacElements],["googleSheets",a.isGoogleSheetDocument],["singleImage",c.shouldConvertToSingleImage]]);t.getPasteSource=function(e,t){var r=e.htmlAttributes,n=e.clipboardData,o=e.fragment,i=null,a={htmlAttributes:r,fragment:o,shouldConvertSingleImage:t,clipboardData:n};return d.forEach((function(e,t){!i&&e(a)&&(i=t)})),null!=i?i:"default"}},5218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isExcelDesktopDocument=void 0;var n=r(3400);t.isExcelDesktopDocument=function(e){return"urn:schemas-microsoft-com:office:excel"==e.htmlAttributes[n.PastePropertyNames.EXCEL_DESKTOP_ATTRIBUTE_NAME]}},3323:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isExcelOnlineDocument=void 0;var n=r(3400);t.isExcelOnlineDocument=function(e){var t=e.htmlAttributes;return"Excel.Sheet"==t[n.PastePropertyNames.PROG_ID_NAME]&&null==t[n.PastePropertyNames.EXCEL_DESKTOP_ATTRIBUTE_NAME]}},3218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isGoogleSheetDocument=void 0;var n=r(3400);t.isGoogleSheetDocument=function(e){return!!e.fragment.querySelector(n.PastePropertyNames.GOOGLE_SHEET_NODE_NAME)}},8131:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPowerPointDesktopDocument=void 0;var n=r(3400);t.isPowerPointDesktopDocument=function(e){return"PowerPoint.Slide"==e.htmlAttributes[n.PastePropertyNames.PROG_ID_NAME]}},4740:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isWordDesktopDocument=void 0;var n=r(3400);t.isWordDesktopDocument=function(e){var t=e.htmlAttributes;return"urn:schemas-microsoft-com:office:word"==t["xmlns:w"]||"Word.Document"==t[n.PastePropertyNames.PROG_ID_NAME]}},8037:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldConvertToSingleImage=void 0,t.shouldConvertToSingleImage=function(e){var t,r=e.shouldConvertSingleImage,n=e.clipboardData;return r&&1==(null===(t=n.htmlFirstLevelChildTags)||void 0===t?void 0:t.length)&&"IMG"==n.htmlFirstLevelChildTags[0]}},8080:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addParser=void 0,t.addParser=function(e,t,r){var n;e.additionalFormatParsers||(e.additionalFormatParsers={}),e.additionalFormatParsers[t]||(e.additionalFormatParsers[t]=[]),null===(n=e.additionalFormatParsers[t])||void 0===n||n.push(r)}},5769:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.chainSanitizerCallback=void 0,t.chainSanitizerCallback=function(e,t,r){var n="function"==typeof r?r:function(e){return r?e:null};if(e[t]){var o=e[t];e[t]=function(e,t){var r="function"==typeof o?o(e,t):!!o&&e;return r?n(r,t):null}}else e[t]=n}},8003:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deprecatedBorderColorParser=void 0;var n=r(4990);t.deprecatedBorderColorParser=function(e){n.BorderKeys.forEach((function(t){var r=e[t],o="";if(r&&n.DeprecatedColors.some((function(e){return r.indexOf(e)>-1&&(o=e)}))){var i=r.replace(o,"").trimRight();e[t]=i}}))}},5414:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getStyles=void 0,t.getStyles=function(e){var t={};return((null==e?void 0:e.getAttribute("style"))||"").split(";").forEach((function(e){var r=e.indexOf(":"),n=e.slice(0,r),o=e.slice(r+1);n&&o&&(t[n.trim()]=o.trim())})),t}},1281:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseLink=void 0;var n=r(4990),o=["http:","https:","notes:","mailto:","onenote:"],i=/^file:\/\/\/[a-zA-Z\/]/i;t.parseLink=function(e,t){if((0,n.isElementOfType)(t,"a")){var r;try{r=new URL(t.href)}catch(e){r=void 0}(r&&-1===o.indexOf(r.protocol)||i.test(t.href))&&(t.removeAttribute("href"),e.href="")}}},7506:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setProcessor=void 0,t.setProcessor=function(e,t,r){e.processorOverride||(e.processorOverride={}),e.processorOverride[t]=r}},4269:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PickerHelperImpl=void 0;var n=r(5978),o=r(7168),i=r(4990),a=function(){function e(e,t,r){this.editor=e,this.handler=t,this.triggerCharacter=r,this.direction=null}return e.prototype.replaceQueryString=function(e,t,r){var a=this;this.editor.focus(),(0,n.formatTextSegmentBeforeSelectionMarker)(this.editor,(function(t,n,l,s,c){var d=[];return!!(0,o.getQueryString)(a.triggerCharacter,l,n,d)&&(d.forEach((function(e){return e.isSelected=!0})),(0,i.mergeModel)(t,e,c),c.canUndoByBackspace=r,!0)}),t)},e.prototype.closePicker=function(){var e,t;this.direction&&(this.direction=null,null===(t=(e=this.handler).onClosePicker)||void 0===t||t.call(e))},e}();t.PickerHelperImpl=a},5532:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PickerPlugin=void 0;var n=r(4990),o=r(5978),i=r(7168),a=r(4269),l=function(){function e(e,t){this.triggerCharacter=e,this.handler=t,this.isMac=!1,this.lastQueryString="",this.helper=null}return e.prototype.getName=function(){return"Picker"},e.prototype.initialize=function(e){this.isMac=!!e.getEnvironment().isMac,this.helper=new a.PickerHelperImpl(e,this.handler,this.triggerCharacter),this.handler.onInitialize(this.helper)},e.prototype.dispose=function(){this.handler.onDispose(),this.helper=null},e.prototype.willHandleEventExclusively=function(e){var t;return!!(null===(t=this.helper)||void 0===t?void 0:t.direction)&&"keyDown"==e.eventType&&((0,n.isCursorMovingKey)(e.rawEvent)||"Enter"==e.rawEvent.key||"Tab"==e.rawEvent.key||"Escape"==e.rawEvent.key)},e.prototype.onPluginEvent=function(e){if(this.helper)switch(e.eventType){case"contentChanged":this.helper.direction&&(e.source==n.ChangeSource.SetContent?this.helper.closePicker():this.onSuggestingInput(this.helper));break;case"keyDown":this.helper.direction&&this.onSuggestingKeyDown(this.helper,e.rawEvent);break;case"input":this.helper.direction?this.onSuggestingInput(this.helper):this.onInput(this.helper,e.rawEvent);break;case"mouseUp":this.helper.direction&&this.helper.closePicker()}},e.prototype.onSuggestingKeyDown=function(e,t){var r,n,o,i,a,l,s,c,d,u;switch(t.key){case"ArrowLeft":case"ArrowRight":if("horizontal"==e.direction||"both"==e.direction){var p="ArrowRight"==t.key;e.editor.getDOMHelper().isRightToLeft()&&(p=!p),null===(n=(r=this.handler).onSelectionChanged)||void 0===n||n.call(r,p?"next":"previous")}t.preventDefault();break;case"ArrowUp":case"ArrowDown":p="ArrowDown"==t.key,"horizontal"!=e.direction&&(null===(i=(o=this.handler).onSelectionChanged)||void 0===i||i.call(o,"both"==e.direction?p?"nextRow":"previousRow":p?"next":"previous")),t.preventDefault();break;case"PageUp":case"PageDown":null===(l=(a=this.handler).onSelectionChanged)||void 0===l||l.call(a,"PageDown"==t.key?"nextPage":"previousPage"),t.preventDefault();break;case"Home":case"End":var f=this.isMac?t.metaKey:t.ctrlKey;null===(c=(s=this.handler).onSelectionChanged)||void 0===c||c.call(s,"Home"==t.key?f?"first":"firstInRow":f?"last":"lastInRow"),t.preventDefault();break;case"Escape":e.closePicker(),t.preventDefault();break;case"Enter":case"Tab":null===(u=(d=this.handler).onSelect)||void 0===u||u.call(d),t.preventDefault()}},e.prototype.onSuggestingInput=function(e){var t=this;(0,o.formatTextSegmentBeforeSelectionMarker)(e.editor,(function(r,n,o){var a,l,s=(0,i.getQueryString)(t.triggerCharacter,o,n).replace(/[\u0020\u00A0]/g," "),c=t.lastQueryString;return s&&(s.length>=c.length&&0==s.indexOf(c)||s.length<c.length&&0==c.indexOf(s))?(t.lastQueryString=s,null===(l=(a=t.handler).onQueryStringChanged)||void 0===l||l.call(a,s)):e.closePicker(),!1}))||e.closePicker()},e.prototype.onInput=function(e,t){var r=this;"insertText"==t.inputType&&t.data==this.triggerCharacter&&(0,o.formatTextSegmentBeforeSelectionMarker)(e.editor,(function(t,o){if(o.text.endsWith(r.triggerCharacter)){var i=o.text[o.text.length-2];if(!i||!i.trim()||(0,n.isPunctuation)(i)){var a=e.editor.getDOMSelection(),l="range"==(null==a?void 0:a.type)&&a.range.collapsed?{node:a.range.startContainer,offset:a.range.startOffset}:null;l&&(r.lastQueryString=r.triggerCharacter,e.direction=r.handler.onTrigger(r.lastQueryString,l))}}return!1}))},e}();t.PickerPlugin=l},7168:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getQueryString=void 0;var n=r(5978);t.getQueryString=function(e,t,r,o){for(var i="",a=t.segments.indexOf(r);a>=0;a--){var l=t.segments[a];if("Text"!=l.segmentType){i="";break}var s=l.text.lastIndexOf(e);if(s>=0){i=l.text.substring(s)+i,null==o||o.unshift(s>0?(0,n.splitTextSegment)(l,t,s,l.text.length):l);break}i=l.text+i,null==o||o.unshift(l)}return a<0&&(i=""),i}},3890:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createElement=void 0;var n=r(4990);t.createElement=function e(t,r){if(!t||!t.tag)return null;var o=t.tag,i=t.namespace,a=t.className,l=t.style,s=t.dataset,c=t.attributes,d=t.children,u=i?r.createElementNS(i,o):r.createElement(o);return l&&u.setAttribute("style",l),a&&(u.className=a),s&&(0,n.isNodeOfType)(u,"ELEMENT_NODE")&&(0,n.getObjectKeys)(s).forEach((function(e){u.dataset[e]=s[e]})),c&&(0,n.getObjectKeys)(c).forEach((function(e){u.setAttribute(e,c[e])})),d&&d.forEach((function(t){if("string"==typeof t)u.appendChild(r.createTextNode(t));else if(t){var n=e(t,r);n&&u.appendChild(n)}})),u}},6782:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DragAndDropHelper=void 0;var n=r(1635),o={MOUSEDOWN:"mousedown",MOUSEMOVE:"mousemove",MOUSEUP:"mouseup",getPageXY:function(e){return[e.pageX,e.pageY]}},i={MOUSEDOWN:"touchstart",MOUSEMOVE:"touchmove",MOUSEUP:"touchend",getPageXY:function(e){var t=0,r=0;if(e.targetTouches&&e.targetTouches.length>0){var n=e.targetTouches[0];t=n.pageX,r=n.pageY}return[t,r]}};var a=function(){function e(e,t,r,a,l,s){var c=this;this.trigger=e,this.context=t,this.onSubmit=r,this.handler=a,this.zoomScale=l,this.initX=0,this.initY=0,this.initValue=void 0,this.onMouseDown=function(e){var t,r,o;e.preventDefault(),e.stopPropagation(),c.addDocumentEvents(),t=(0,n.__read)(c.dndMouse.getPageXY(e),2),c.initX=t[0],c.initY=t[1],c.initValue=null===(o=(r=c.handler).onDragStart)||void 0===o?void 0:o.call(r,c.context,e)},this.onMouseMove=function(e){var t,r,o;e.preventDefault();var i=(0,n.__read)(c.dndMouse.getPageXY(e),2),a=i[0],l=i[1],s=(a-c.initX)/c.zoomScale,d=(l-c.initY)/c.zoomScale;c.initValue&&(null===(r=(t=c.handler).onDragging)||void 0===r?void 0:r.call(t,c.context,e,c.initValue,s,d))&&(null===(o=c.onSubmit)||void 0===o||o.call(c,c.context,c.trigger))},this.onMouseUp=function(e){var t,r,n;e.preventDefault(),c.removeDocumentEvents(),(null===(r=(t=c.handler).onDragEnd)||void 0===r?void 0:r.call(t,c.context,e,c.initValue))&&(null===(n=c.onSubmit)||void 0===n||n.call(c,c.context,c.trigger))},this.dndMouse=s?i:o,e.addEventListener(this.dndMouse.MOUSEDOWN,this.onMouseDown)}return e.prototype.dispose=function(){this.trigger.removeEventListener(this.dndMouse.MOUSEDOWN,this.onMouseDown),this.removeDocumentEvents()},Object.defineProperty(e.prototype,"mouseType",{get:function(){return this.dndMouse==i?"touch":"mouse"},enumerable:!1,configurable:!0}),e.prototype.addDocumentEvents=function(){var e=this.trigger.ownerDocument;e.addEventListener(this.dndMouse.MOUSEMOVE,this.onMouseMove,!0),e.addEventListener(this.dndMouse.MOUSEUP,this.onMouseUp,!0)},e.prototype.removeDocumentEvents=function(){var e=this.trigger.ownerDocument;e.removeEventListener(this.dndMouse.MOUSEMOVE,this.onMouseMove,!0),e.removeEventListener(this.dndMouse.MOUSEUP,this.onMouseUp,!0)},e}();t.DragAndDropHelper=a},9560:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getIntersectedRect=void 0;var n=r(1635),o=r(4990);t.getIntersectedRect=function(e,t){void 0===t&&(t=[]);var r=e.map((function(e){return(0,o.normalizeRect)(e.getBoundingClientRect())})).concat(t).filter((function(e){return!!e})),i={top:Math.max.apply(Math,(0,n.__spreadArray)([],(0,n.__read)(r.map((function(e){return e.top}))),!1)),bottom:Math.min.apply(Math,(0,n.__spreadArray)([],(0,n.__read)(r.map((function(e){return e.bottom}))),!1)),left:Math.max.apply(Math,(0,n.__spreadArray)([],(0,n.__read)(r.map((function(e){return e.left}))),!1)),right:Math.min.apply(Math,(0,n.__spreadArray)([],(0,n.__read)(r.map((function(e){return e.right}))),!1))};return i.top<i.bottom&&i.left<i.right?i:null}},6560:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShortcutPlugin=void 0;var n=r(4990),o=r(8062),i=[o.ShortcutBold,o.ShortcutItalic,o.ShortcutUnderline,o.ShortcutClearFormat,o.ShortcutUndo,o.ShortcutUndo2,o.ShortcutRedo,o.ShortcutRedoAlt,o.ShortcutRedoMacOS,o.ShortcutBullet,o.ShortcutNumbering,o.ShortcutIncreaseFont,o.ShortcutDecreaseFont,o.ShortcutIndentList,o.ShortcutOutdentList],a=function(){function e(e){void 0===e&&(e=i),this.shortcuts=e,this.editor=null,this.isMac=!1}return e.prototype.getName=function(){return"Shortcut"},e.prototype.initialize=function(e){this.editor=e,this.isMac=!!this.editor.getEnvironment().isMac},e.prototype.dispose=function(){this.editor=null},e.prototype.willHandleEventExclusively=function(e){return"keyDown"==e.eventType&&(e.rawEvent.ctrlKey||e.rawEvent.altKey||e.rawEvent.metaKey)&&!!this.cacheGetCommand(e)},e.prototype.onPluginEvent=function(e){if(this.editor&&"keyDown"==e.eventType){var t=this.cacheGetCommand(e);t&&(t.onClick(this.editor),e.rawEvent.preventDefault())}},e.prototype.cacheGetCommand=function(e){var t=this;return(0,n.cacheGetEventData)(e,"__ShortcutCommandCache",(function(e){return t.editor&&t.shortcuts.filter((function(r){return t.matchOS(r.environment)&&t.matchShortcut(r.shortcutKey,e.rawEvent)}))[0]}))},e.prototype.matchOS=function(e){switch(e){case"mac":return this.isMac;case"nonMac":return!this.isMac;default:return!0}},e.prototype.matchShortcut=function(e,t){var r=t.ctrlKey,n=t.altKey,o=t.shiftKey,i=t.which,a=t.metaKey,l=this.isMac?a:r;return("ctrl"==e.modifierKey&&l&&!n||"alt"==e.modifierKey&&n&&!l)&&o==e.shiftKey&&e.which==i},e}();t.ShortcutPlugin=a},8062:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShortcutOutdentList=t.ShortcutIndentList=t.ShortcutDecreaseFont=t.ShortcutIncreaseFont=t.ShortcutNumbering=t.ShortcutBullet=t.ShortcutRedoAlt=t.ShortcutRedoMacOS=t.ShortcutRedo=t.ShortcutUndo2=t.ShortcutUndo=t.ShortcutClearFormat=t.ShortcutUnderline=t.ShortcutItalic=t.ShortcutBold=void 0;var n,o=r(3025),i=r(3945),a=r(5978);!function(e){e[e.BACKSPACE=8]="BACKSPACE",e[e.SPACE=32]="SPACE",e[e.B=66]="B",e[e.I=73]="I",e[e.U=85]="U",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.COMMA=188]="COMMA",e[e.PERIOD=190]="PERIOD",e[e.FORWARD_SLASH=191]="FORWARD_SLASH",e[e.ArrowRight=39]="ArrowRight",e[e.ArrowLeft=37]="ArrowLeft"}(n||(n={})),t.ShortcutBold={shortcutKey:{modifierKey:"ctrl",shiftKey:!1,which:66},onClick:function(e){return(0,a.toggleBold)(e)}},t.ShortcutItalic={shortcutKey:{modifierKey:"ctrl",shiftKey:!1,which:73},onClick:function(e){return(0,a.toggleItalic)(e)}},t.ShortcutUnderline={shortcutKey:{modifierKey:"ctrl",shiftKey:!1,which:85},onClick:function(e){return(0,a.toggleUnderline)(e)}},t.ShortcutClearFormat={shortcutKey:{modifierKey:"ctrl",shiftKey:!1,which:32},onClick:function(e){return(0,a.clearFormat)(e)},environment:"nonMac"},t.ShortcutUndo={shortcutKey:{modifierKey:"ctrl",shiftKey:!1,which:90},onClick:function(e){return(0,o.undo)(e)}},t.ShortcutUndo2={shortcutKey:{modifierKey:"alt",shiftKey:!1,which:8},onClick:function(e){return(0,o.undo)(e)},environment:"nonMac"},t.ShortcutRedo={shortcutKey:{modifierKey:"ctrl",shiftKey:!1,which:89},onClick:function(e){return(0,o.redo)(e)},environment:"nonMac"},t.ShortcutRedoMacOS={shortcutKey:{modifierKey:"ctrl",shiftKey:!0,which:90},onClick:function(e){return(0,o.redo)(e)},environment:"mac"},t.ShortcutRedoAlt={shortcutKey:{modifierKey:"ctrl",shiftKey:!0,which:90},onClick:function(e){return(0,o.redo)(e)}},t.ShortcutBullet={shortcutKey:{modifierKey:"ctrl",shiftKey:!1,which:190},onClick:function(e){return(0,a.toggleBullet)(e)}},t.ShortcutNumbering={shortcutKey:{modifierKey:"ctrl",shiftKey:!1,which:191},onClick:function(e){return(0,a.toggleNumbering)(e)}},t.ShortcutIncreaseFont={shortcutKey:{modifierKey:"ctrl",shiftKey:!0,which:190},onClick:function(e){return(0,a.changeFontSize)(e,"increase")}},t.ShortcutDecreaseFont={shortcutKey:{modifierKey:"ctrl",shiftKey:!0,which:188},onClick:function(e){return(0,a.changeFontSize)(e,"decrease")}},t.ShortcutIndentList={shortcutKey:{modifierKey:"alt",shiftKey:!0,which:39},onClick:function(e){(0,i.setShortcutIndentationCommand)(e,"indent")},environment:"nonMac"},t.ShortcutOutdentList={shortcutKey:{modifierKey:"alt",shiftKey:!0,which:37},onClick:function(e){(0,i.setShortcutIndentationCommand)(e,"outdent")},environment:"nonMac"}},3945:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setShortcutIndentationCommand=void 0;var n=r(4990),o=r(5978);t.setShortcutIndentationCommand=function(e,t){e.formatContentModel((function(e,r){var i=(0,n.getFirstSelectedListItem)(e);return!(!i||"Paragraph"!=i.blocks[0].blockType||"SelectionMarker"!=i.blocks[0].segments[0].segmentType||((0,o.setModelIndentation)(e,t,void 0,r),0))}))}},289:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TableEditPlugin=void 0;var n=r(4990),o=r(4045),i=function(){function e(e,t,r){var o=this;this.anchorContainerSelector=e,this.onTableEditorCreated=t,this.disableFeatures=r,this.editor=null,this.onMouseMoveDisposer=null,this.tableRectMap=null,this.tableEditor=null,this.onMouseOut=function(e){var t=e.relatedTarget,r=e.currentTarget;(0,n.isNodeOfType)(t,"ELEMENT_NODE")&&(0,n.isNodeOfType)(r,"ELEMENT_NODE")&&o.tableEditor&&!o.tableEditor.isOwnedElement(t)&&!r.contains(t)&&o.setTableEditor(null)},this.onMouseMove=function(e){var t,r=e;if(!(r.buttons>0)&&o.editor){o.ensureTableRects();var n=o.editor.getDocument().defaultView||window,i=r.pageX-n.scrollX,a=r.pageY-n.scrollY,l=null;if(o.tableRectMap)for(var s=o.tableRectMap.length-1;s>=0;s--){var c=o.tableRectMap[s],d=c.table,u=c.rect;if(i>=u.left-12&&i<=u.right+12&&a>=u.top-12&&a<=u.bottom+12){l=d;break}}o.setTableEditor(l,r),null===(t=o.tableEditor)||void 0===t||t.onMouseMove(i,a)}},this.invalidateTableRects=function(){o.tableRectMap=null}}return e.prototype.getName=function(){return"TableEdit"},e.prototype.initialize=function(e){this.editor=e,this.onMouseMoveDisposer=this.editor.attachDomEvent({mousemove:{beforeDispatch:this.onMouseMove}}),this.editor.getScrollContainer().addEventListener("mouseout",this.onMouseOut)},e.prototype.dispose=function(){var e,t,r=null===(e=this.editor)||void 0===e?void 0:e.getScrollContainer();null==r||r.removeEventListener("mouseout",this.onMouseOut),null===(t=this.onMouseMoveDisposer)||void 0===t||t.call(this),this.invalidateTableRects(),this.disposeTableEditor(),this.editor=null,this.onMouseMoveDisposer=null,this.onTableEditorCreated=void 0},e.prototype.onPluginEvent=function(e){switch(e.eventType){case"input":case"contentChanged":case"scroll":case"zoomChanged":this.setTableEditor(null),this.invalidateTableRects()}},e.prototype.setTableEditor=function(e,t){if(this.tableEditor&&!this.tableEditor.isEditing()&&e!=this.tableEditor.table&&this.disposeTableEditor(),!this.tableEditor&&e&&this.editor&&e.rows.length>0){var r=this.anchorContainerSelector?this.editor.getDocument().querySelector(this.anchorContainerSelector):void 0;this.tableEditor=new o.TableEditor(this.editor,e,this.invalidateTableRects,(0,n.isNodeOfType)(r,"ELEMENT_NODE")?r:void 0,null==t?void 0:t.currentTarget,this.onTableEditorCreated,this.disableFeatures)}},e.prototype.disposeTableEditor=function(){var e;null===(e=this.tableEditor)||void 0===e||e.dispose(),this.tableEditor=null},e.prototype.ensureTableRects=function(){var e=this;!this.tableRectMap&&this.editor&&(this.tableRectMap=[],this.editor.getDOMHelper().queryElements("table").forEach((function(t){if(t.isContentEditable){var r=(0,n.normalizeRect)(t.getBoundingClientRect());r&&e.tableRectMap&&e.tableRectMap.push({table:t,rect:r})}})))},e}();t.TableEditPlugin=i},4045:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TableEditor=void 0;var n,o=r(8928),i=r(6936),a=r(1149),l=r(1942),s=r(6014),c=r(4990);!function(e){e[e.top=0]="top",e[e.side=1]="side"}(n||(n={}));var d=function(){function e(e,t,r,n,o,i,a){var l,s=this;this.editor=e,this.table=t,this.onChanged=r,this.anchorContainer=n,this.contentDiv=o,this.onTableEditorCreated=i,this.disableFeatures=a,this.horizontalInserter=null,this.verticalInserter=null,this.horizontalResizer=null,this.verticalResizer=null,this.tableResizer=null,this.tableMover=null,this.range=null,this.onEditorCreated=function(e,t){var r,n=null===(r=s.onTableEditorCreated)||void 0===r?void 0:r.call(s,e,t),o=t&&s.getOnMouseOut(t);return o&&t.addEventListener("mouseout",o),function(){null==n||n(),o&&t.removeEventListener("mouseout",o)}},this.onFinishEditing=function(){return s.editor.focus(),s.range&&(s.editor.setDOMSelection({type:"range",range:s.range,isReverted:!1}),s.range=null),s.editor.takeSnapshot(),s.onChanged(),s.isCurrentlyEditing=!1,!1},this.onStartTableResize=function(){s.isCurrentlyEditing=!0,s.onStartResize()},this.onStartCellResize=function(){s.isCurrentlyEditing=!0,s.disposeTableResizer(),s.onStartResize()},this.onStartTableMove=function(){s.isCurrentlyEditing=!0,s.disposeTableResizer(),s.disposeTableInserter(),s.disposeCellResizers()},this.onEndTableMove=function(e){return e&&s.disposeTableMover(),s.onFinishEditing()},this.onInserted=function(){s.disposeTableResizer(),s.onFinishEditing()},this.onSelect=function(e){var t,r;if(s.editor.focus(),e){var n=(0,c.parseTableCells)(e),o={table:e,firstRow:0,firstColumn:0,lastRow:n.length-1,lastColumn:(null!==(r=null===(t=n[0])||void 0===t?void 0:t.length)&&void 0!==r?r:0)-1,type:"table"};s.editor.setDOMSelection(o)}},this.getOnMouseOut=function(e){return function(t){e&&t.relatedTarget!=e&&(0,c.isNodeOfType)(s.contentDiv,"ELEMENT_NODE")&&(0,c.isNodeOfType)(t.relatedTarget,"ELEMENT_NODE")&&s.contentDiv!=t.relatedTarget&&!s.isEditing()&&s.dispose()}},this.isRTL="rtl"==(null===(l=e.getDocument().defaultView)||void 0===l?void 0:l.getComputedStyle(t).direction),this.setEditorFeatures(),this.isCurrentlyEditing=!1}return e.prototype.dispose=function(){this.disposeTableResizer(),this.disposeCellResizers(),this.disposeTableInserter(),this.disposeTableMover()},e.prototype.isEditing=function(){return this.isCurrentlyEditing},e.prototype.isOwnedElement=function(e){return[this.tableResizer,this.tableMover,this.horizontalInserter,this.verticalInserter,this.horizontalResizer,this.verticalResizer].filter((function(e){return!!(null==e?void 0:e.div)})).some((function(t){return(null==t?void 0:t.div)==e}))},e.prototype.onMouseMove=function(e,t){var r,n=(0,c.normalizeRect)(this.table.getBoundingClientRect());if(n){for(var o=t<=n.top+6?0:this.isRTL?e>=n.right-6?1:void 0:e<=n.left+6?1:void 0,i=o?1:0,a=0;a<this.table.rows.length;a++){for(var l=this.table.rows[a],s=0;s<l.cells.length;s++){var d=l.cells[s],u=(0,c.normalizeRect)(d.getBoundingClientRect());if(u&&n){var p=t<=u.bottom,f=this.isRTL?e<=u.right+6*i:e<=u.right,m=this.isRTL?e>=u.left:e>=u.left-6*i;if(p&&f&&m){if(0===a&&0==o){var g=(u.left+u.right)/2,h=this.isRTL?e<g:e>g;!this.isFeatureDisabled("VerticalTableInserter")&&this.setInserterTd(h?d:l.cells[s-1],!1)}else if(0===s&&1==o){var v=null===(r=this.table.rows[a-1])||void 0===r?void 0:r.cells[0],y=v?(0,c.normalizeRect)(v.getBoundingClientRect()):null,b=y?this.isRTL?y.right===u.right:y.left===u.left:null;!this.isFeatureDisabled("HorizontalTableInserter")&&this.setInserterTd(t<(u.top+u.bottom)/2&&b?v:d,!0)}else this.setInserterTd(null);!this.isFeatureDisabled("CellResizer")&&this.setResizingTd(d);break}}}if(s<l.cells.length)break}this.setEditorFeatures()}},e.prototype.setEditorFeatures=function(){var e=this.isFeatureDisabled("TableSelector"),t=this.isFeatureDisabled("TableMover");this.tableMover||e&&t||(this.tableMover=(0,a.createTableMover)(this.table,this.editor,this.isRTL,e?function(){}:this.onSelect,this.onStartTableMove,this.onEndTableMove,this.contentDiv,this.anchorContainer,this.onEditorCreated,t)),this.tableResizer||this.isFeatureDisabled("TableResizer")||(this.tableResizer=(0,l.createTableResizer)(this.table,this.editor,this.isRTL,this.onStartTableResize,this.onFinishEditing,this.contentDiv,this.anchorContainer,this.onTableEditorCreated))},e.prototype.setResizingTd=function(e){this.horizontalResizer&&this.horizontalResizer.node!=e&&this.disposeCellResizers(),!this.horizontalResizer&&e&&(this.horizontalResizer=(0,o.createCellResizer)(this.editor,e,this.table,this.isRTL,!0,this.onStartCellResize,this.onFinishEditing,this.anchorContainer),this.verticalResizer=(0,o.createCellResizer)(this.editor,e,this.table,this.isRTL,!1,this.onStartCellResize,this.onFinishEditing,this.anchorContainer))},e.prototype.setInserterTd=function(e,t){var r=t?this.horizontalInserter:this.verticalInserter;if((null===e||r&&r.node!=e)&&this.disposeTableInserter(),!this.horizontalInserter&&!this.verticalInserter&&e){var n=(0,i.createTableInserter)(this.editor,e,this.table,this.isRTL,!!t,this.onInserted,this.anchorContainer,this.onEditorCreated);t?this.horizontalInserter=n:this.verticalInserter=n}},e.prototype.disposeTableResizer=function(){this.tableResizer&&((0,s.disposeTableEditFeature)(this.tableResizer),this.tableResizer=null)},e.prototype.disposeTableInserter=function(){this.horizontalInserter&&((0,s.disposeTableEditFeature)(this.horizontalInserter),this.horizontalInserter=null),this.verticalInserter&&((0,s.disposeTableEditFeature)(this.verticalInserter),this.verticalInserter=null)},e.prototype.disposeCellResizers=function(){this.horizontalResizer&&((0,s.disposeTableEditFeature)(this.horizontalResizer),this.horizontalResizer=null),this.verticalResizer&&((0,s.disposeTableEditFeature)(this.verticalResizer),this.verticalResizer=null)},e.prototype.disposeTableMover=function(){this.tableMover&&((0,s.disposeTableEditFeature)(this.tableMover),this.tableMover=null)},e.prototype.onStartResize=function(){this.isCurrentlyEditing=!0;var e=this.editor.getDOMSelection();e&&"range"==e.type&&(this.range=e.range),this.editor.takeSnapshot()},e.prototype.isFeatureDisabled=function(e){var t;return null===(t=this.disableFeatures)||void 0===t?void 0:t.includes(e)},e}();t.TableEditor=d},8928:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onDraggingVertical=t.onDraggingHorizontal=t.onDragStart=t.createCellResizer=t.VERTICAL_RESIZER_ID=t.HORIZONTAL_RESIZER_ID=void 0;var n=r(1635),o=r(3890),i=r(6782),a=r(6482),l=r(4990);function s(e,t){var r=e.td,o=e.onStart,i=(0,l.normalizeRect)(r.getBoundingClientRect()),s=r.cellIndex,c=r.parentElement&&(0,l.isElementOfType)(r.parentElement,"tr")?r.parentElement:void 0,d=null==c?void 0:c.rowIndex;if(null==d)return{cmTable:void 0,anchorColumn:void 0,anchorRow:void 0,anchorRowHeight:-1,allWidths:[]};var u=e.editor,p=e.table,f=(0,a.getCMTableFromTable)(u,p);return i&&f?(o(),{cmTable:f,anchorColumn:s,anchorRow:d,anchorRowHeight:f.rows[d].height,allWidths:(0,n.__spreadArray)([],(0,n.__read)(f.widths),!1)}):{cmTable:f,anchorColumn:void 0,anchorRow:void 0,anchorRowHeight:-1,allWidths:[]}}function c(e,t,r,n,o){var i=e.table,a=r.cmTable,s=r.anchorRow,c=r.anchorRowHeight;if(a&&null!=s&&null!=a.rows[s]){(0,l.mutateBlock)(a).rows[s].height=(null!=c?c:0)+o;for(var d=Math.max(a.rows[s].height,l.MIN_ALLOWED_TABLE_CELL_HEIGHT),u=i.rows[s],p=0;p<u.cells.length;p++)u.cells[p].style.height=d+"px";return!0}return!1}function d(e,t,r,n){var o=e.table,i=e.isRTL,a=r.cmTable,s=r.anchorColumn,c=r.allWidths;if(a&&null!=s){var d=(0,l.mutateBlock)(a),u=n*(i?-1:1);if(s==a.widths.length-1){var p=Math.max(c[s]+u,l.MIN_ALLOWED_TABLE_CELL_WIDTH);d.widths[s]=p}else{var f=c[s]+u,m=c[s+1]-u;if(f<l.MIN_ALLOWED_TABLE_CELL_WIDTH||m<l.MIN_ALLOWED_TABLE_CELL_WIDTH)return!1;d.widths[s]=f,d.widths[s+1]=m}for(var g=0;g<o.rows.length;g++)for(var h=o.rows[g],v=0;v<h.cells.length;v++)h.cells[v].style.width=a.widths[v]+"px";return!0}return!1}function u(e,r){var n=e.td,o=(0,l.normalizeRect)(n.getBoundingClientRect());o&&(r.id=t.HORIZONTAL_RESIZER_ID,r.style.top=o.bottom-4+"px",r.style.left=o.left+"px",r.style.width=o.right-o.left+"px",r.style.height="4px")}function p(e,r){var n=e.td,o=e.isRTL,i=(0,l.normalizeRect)(n.getBoundingClientRect());i&&(r.id=t.VERTICAL_RESIZER_ID,r.style.top=i.top+"px",r.style.left=(o?i.left:i.right)-4+1+"px",r.style.width="4px",r.style.height=i.bottom-i.top+"px")}t.HORIZONTAL_RESIZER_ID="horizontalResizer",t.VERTICAL_RESIZER_ID="verticalResizer",t.createCellResizer=function(e,t,r,n,a,l,f,m){var g=t.ownerDocument,h={tag:"div",style:"position: fixed; cursor: "+(a?"row":"col")+"-resize; user-select: none"},v=e.getDOMHelper().calculateZoomScale(),y=(0,o.createElement)(h,g);(m||g.body).appendChild(y);var b={editor:e,td:t,table:r,isRTL:n,zoomScale:v,onStart:l},S=a?u:p;S(b,y);var C={onDragStart:s,onDragging:a?c:d,onDragEnd:f};return{node:t,div:y,featureHandler:new i.DragAndDropHelper(y,b,S,C,v,e.getEnvironment().isMobileOrTablet)}},t.onDragStart=s,t.onDraggingHorizontal=c,t.onDraggingVertical=d},6014:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.disposeTableEditFeature=void 0,t.disposeTableEditFeature=function(e){var t,r,n;e&&(null===(t=e.featureHandler)||void 0===t||t.dispose(),e.featureHandler=null,null===(n=null===(r=e.div)||void 0===r?void 0:r.parentNode)||void 0===n||n.removeChild(e.div),e.div=null)}},6936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TableInsertHandler=t.createTableInserter=t.VERTICAL_INSERTER_ID=t.HORIZONTAL_INSERTER_ID=void 0;var n=r(3890),o=r(9560),i=r(4990),a=r(5978);t.HORIZONTAL_INSERTER_ID="horizontalInserter",t.VERTICAL_INSERTER_ID="verticalInserter",t.createTableInserter=function(e,r,a,s,c,d,u,p){var f=(0,i.normalizeRect)(r.getBoundingClientRect()),m=e.getVisibleViewport(),g=a&&m?(0,o.getIntersectedRect)([a],[m]):null;if(f&&g){var h=r.ownerDocument,v=function(e,t,r,n){var o=t?"white":"#4A4A4A";return{tag:"div",style:"position: fixed; width: 12px; height: 12px; font-size: 16px; color: black; line-height: 8px; vertical-align: middle; text-align: center; cursor: pointer; border: solid 1px "+o+"; border-radius: 50%; background-color: "+n,children:[{tag:"div",style:"position: absolute; box-sizing: border-box; background-color: "+n+";"+(e?(r?"right":"left")+": 12px; top: 5px; height: 3px; border-top: 1px solid "+o+"; border-bottom: 1px solid "+o+"; border-right: 1px solid "+o+"; border-left: 0px;":"left: 5px; top: 12px; width: 3px; border-left: 1px solid "+o+"; border-right: 1px solid "+o+"; border-bottom: 1px solid "+o+"; border-top: 0px;")},"+"]}}(c,e.isDarkMode(),s,e.getDOMHelper().getDomStyle("backgroundColor")||"white"),y=(0,n.createElement)(v,h);return c?(y.id=t.HORIZONTAL_INSERTER_ID,y.style.left=(s?g.right:g.left-13)+"px",y.style.top=f.bottom-8+"px",y.firstChild.style.width=g.right-g.left+"px"):(y.id=t.VERTICAL_INSERTER_ID,y.style.left=(s?f.left-8:f.right-8)+"px",y.style.top=g.top-13+"px",y.firstChild.style.height=g.bottom-g.top+"px"),(u||h.body).appendChild(y),{div:y,featureHandler:new l(y,r,a,c,e,d,p),node:r}}return null};var l=function(){function e(e,t,r,n,o,l,s){var c=this;this.div=e,this.td=t,this.table=r,this.isHorizontal=n,this.editor=o,this.onInsert=l,this.insertTd=function(){var e=c.td.cellIndex,t=c.td.parentElement&&(0,i.isElementOfType)(c.td.parentElement,"tr")?c.td.parentElement:void 0,r=t&&t.rowIndex;null!=(null==t?void 0:t.cells)&&null!=r&&((0,a.formatTableWithContentModel)(c.editor,"editTablePlugin",(function(e){c.isHorizontal?(0,a.insertTableRow)(e,"insertBelow"):(0,a.insertTableColumn)(e,"insertRight")}),{type:"table",firstColumn:e,firstRow:r,lastColumn:e,lastRow:r,table:c.table}),c.onInsert())},this.div.addEventListener("click",this.insertTd),this.disposer=null==s?void 0:s(n?"HorizontalTableInserter":"VerticalTableInserter",e)}return e.prototype.dispose=function(){var e;this.div.removeEventListener("click",this.insertTd),null===(e=this.disposer)||void 0===e||e.call(this),this.disposer=void 0},e}();t.TableInsertHandler=l},1149:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onDragEnd=t.onDragging=t.onDragStart=t.createTableMover=t.TABLE_MOVER_ID=void 0;var n=r(1635),o=r(3890),i=r(6782),a=r(5978),l=r(6482),s=r(4990),c=12;t.TABLE_MOVER_ID="_Table_Mover";var d="_TableMoverCursorStyle";t.createTableMover=function(e,r,n,i,a,l,d,p,f,v){var y=(0,s.normalizeRect)(e.getBoundingClientRect());if(!function(e,t,r){var n=e.getVisibleViewport();if((0,s.isNodeOfType)(r,"ELEMENT_NODE")&&n&&t){var o=(0,s.normalizeRect)(r.getBoundingClientRect());return!!o&&o.top<=t.top&&n.top<=t.top}return!0}(r,y,d))return null;var b=r.getDOMHelper().calculateZoomScale(),S=e.ownerDocument,C=(0,o.createElement)({tag:"div",style:"position: fixed; cursor: move; user-select: none; border: 1px solid #808080"},S);C.id=t.TABLE_MOVER_ID,C.style.width="12px",C.style.height="12px",(p||S.body).appendChild(C);var _={table:e,zoomScale:b,rect:y,isRTL:n,editor:r,div:C,onFinishDragging:i,onStart:a,onEnd:l,disableMovement:v};return function(e,t){var r=e.rect;r&&(t.style.top=r.top-c+"px",t.style.left=r.left-c-2+"px")}(_,C),{node:e,div:C,featureHandler:new u(C,_,(function(){}),v?{onDragEnd:h}:{onDragStart:m,onDragging:g,onDragEnd:h},_.zoomScale,f,r.getEnvironment().isMobileOrTablet)}};var u=function(e){function t(t,r,n,o,i,a,l){var s=e.call(this,t,r,n,o,i,l)||this;return s.disposer=null==a?void 0:a("TableMover",t),s}return(0,n.__extends)(t,e),t.prototype.dispose=function(){var t;null===(t=this.disposer)||void 0===t||t.call(this),this.disposer=void 0,e.prototype.dispose.call(this)},t}(i.DragAndDropHelper);function p(e,t,r){var n;null==e||e.setEditorStyle(d,t?null!==(n="cursor: "+r)&&void 0!==n?n:"move":null)}function f(e,t,r){var n=e.getDocument(),o=e.getDOMHelper();if(n.caretRangeFromPoint){var i=n.caretRangeFromPoint(t,r);if(i&&o.isNodeInEditor(i.startContainer))return{node:i.startContainer,offset:i.startOffset}}if("caretPositionFromPoint"in n){var a=n.caretPositionFromPoint(t,r);if(a&&o.isNodeInEditor(a.offsetNode))return{node:a.offsetNode,offset:a.offset}}if(n.elementFromPoint){var l=n.elementFromPoint(t,r);if(l&&o.isNodeInEditor(l))return{node:l,offset:0}}return null}function m(e){var t;e.onStart();var r=e.editor,n=e.table,i=e.div;p(r,!0,"move");var a=n.getBoundingClientRect(),s=(0,o.createElement)({tag:"div",style:"position: fixed; user-select: none; border: 1px solid #808080"},document);s.style.width=a.width+"px",s.style.height=a.height+"px",s.style.top=a.top+"px",s.style.left=a.left+"px",null===(t=i.parentNode)||void 0===t||t.appendChild(s);var c=r.getDOMSelection();return{cmTable:(0,l.getCMTableFromTable)(r,n),initialSelection:c,tableRect:s}}function g(e,t,r){var n=r.tableRect,o=e.editor;n.style.top=t.clientY+c+"px",n.style.left=t.clientX+c+"px";var i=f(o,t.clientX,t.clientY);if(i){var a=o.getDocument().createRange();return a.setStart(i.node,i.offset),a.collapse(!0),o.setDOMSelection({type:"range",range:a,isReverted:!1}),!0}return!1}function h(e,t,r){var o,i,l=e.editor,c=e.table,d=e.onFinishDragging,u=e.disableMovement,m=t.target;if(null==r||r.tableRect.remove(),p(l,!1),m==e.div)return d(c),e.onEnd(!1),!0;if(c.contains(m)||!l.getDOMHelper().isNodeInEditor(m)||u)return l.setDOMSelection(null!==(o=null==r?void 0:r.initialSelection)&&void 0!==o?o:null),e.onEnd(!0),!1;var g=!1,h=f(l,t.clientX,t.clientY);return h?(0,a.formatInsertPointWithContentModel)(l,h,(function(e,t,o){var i,a=(0,n.__read)((0,s.getFirstSelectedTable)(e),2),l=a[0],c=a[1];if(l){var d=c[0].blocks.indexOf(l);(0,s.mutateBlock)(c[0]).blocks.splice(d,1)}if(o&&(null==r?void 0:r.cmTable)){var u=(0,s.createContentModelDocument)();if(u.blocks.push((0,s.mutateBlock)(r.cmTable)),g=!!(0,s.mergeModel)(e,(0,s.cloneModel)(u),t,{mergeFormat:"none",insertPosition:o})){var p=null!==(i=(0,s.getFirstSelectedTable)(e)[0])&&void 0!==i?i:r.cmTable;if(p){var f=p.rows[0].cells[0],m=null==f?void 0:f.blocks[0];if("Paragraph"==(null==m?void 0:m.blockType)){var h=(0,s.createSelectionMarker)(e.format);(0,s.mutateBlock)(m).segments.unshift(h),(0,s.setParagraphNotImplicit)(m),(0,s.setSelection)(f,h)}}}return g}}),{selectionOverride:{type:"table",firstColumn:0,firstRow:0,lastColumn:0,lastRow:0,table:c},apiName:"TableMover"}):l.setDOMSelection(null!==(i=null==r?void 0:r.initialSelection)&&void 0!==i?i:null),e.onEnd(!0),g}t.onDragStart=m,t.onDragging=g,t.onDragEnd=h},1942:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onDragEnd=t.onDragging=t.onDragStart=t.createTableResizer=t.TABLE_RESIZER_ID=void 0;var n=r(1635),o=r(3890),i=r(6782),a=r(6482),l=r(4990),s=12;t.TABLE_RESIZER_ID="_Table_Resizer",t.createTableResizer=function(e,r,n,i,a,h,v,y){if(!g(r,(0,l.normalizeRect)(e.getBoundingClientRect()),h))return null;var b=e.ownerDocument,S=r.getDOMHelper().calculateZoomScale(),C={tag:"div",style:"position: fixed; cursor: "+(n?"ne":"nw")+"-resize; user-select: none; border: 1px solid #808080"},_=(0,o.createElement)(C,b);_.id=t.TABLE_RESIZER_ID,_.style.width=s+"px",_.style.height=s+"px",(v||b.body).appendChild(_);var E={isRTL:n,table:e,zoomScale:S,onStart:i,onEnd:a,div:_,editor:r,contentDiv:h};return f(E,_),{node:e,div:_,featureHandler:new c(_,E,m,{onDragStart:d,onDragging:u,onDragEnd:p},S,r.getEnvironment().isMobileOrTablet,y)}};var c=function(e){function t(t,r,n,o,i,a,l){var s=e.call(this,t,r,n,o,i,a)||this;return s.disposer=null==l?void 0:l("TableResizer",t),s}return(0,n.__extends)(t,e),t.prototype.dispose=function(){var t;null===(t=this.disposer)||void 0===t||t.call(this),this.disposer=void 0,e.prototype.dispose.call(this)},t}(i.DragAndDropHelper);function d(e,t){e.onStart();var r=e.editor,n=e.table,o=(0,a.getCMTableFromTable)(r,n),i=[];null==o||o.rows.forEach((function(e){i.push(e.height)}));var l=[];return null==o||o.widths.forEach((function(e){l.push(e)})),{originalRect:n.getBoundingClientRect(),cmTable:o,originalHeights:null!=i?i:[],originalWidths:null!=l?l:[]}}function u(e,t,r,n,o){var i,a,s=e.isRTL,c=e.zoomScale,d=e.table,u=r.originalRect,p=r.originalHeights,f=r.originalWidths,m=r.cmTable,g=1+n/u.width*c*(s?-1:1),h=1+o/u.height*c,v=Math.abs(g-1)>.001,y=Math.abs(h-1)>.001;if(d.style.setProperty("width",null),d.style.setProperty("height",null),m&&m.rows&&(v||y)){for(var b=(0,l.mutateBlock)(m),S=0;S<m.rows.length;S++)for(var C=0;C<m.rows[S].cells.length;C++)m.rows[S].cells[C]&&(v&&0==S&&(b.widths[C]=(null!==(i=f[C])&&void 0!==i?i:0)*g),y&&0==C&&(b.rows[S].height=(null!==(a=p[S])&&void 0!==a?a:0)*h));for(var _=0;_<d.rows.length;_++){var E=d.rows[_];if(0!=E.cells.length)for(var T=Math.max(m.rows[_].height,l.MIN_ALLOWED_TABLE_CELL_HEIGHT),k=0;k<E.cells.length;k++){var M=E.cells[k],O=Math.max(m.widths[k],l.MIN_ALLOWED_TABLE_CELL_HEIGHT);M.style.width=O+"px",M.style.height=T+"px"}}return!0}return!1}function p(e,t,r){return e.editor.isDisposed()||(g(e.editor,(0,l.normalizeRect)(e.table.getBoundingClientRect()),e.contentDiv)&&(e.div.style.visibility="visible",f(e,e.div)),e.onEnd()),!1}function f(e,t){var r=e.table,n=e.isRTL,o=(0,l.normalizeRect)(r.getBoundingClientRect());o&&(t.style.top=o.bottom+"px",t.style.left=n?o.left-s-2+"px":o.right+"px")}function m(e,t){t.style.visibility="hidden"}function g(e,t,r){var n=e.getVisibleViewport();if((0,l.isNodeOfType)(r,"ELEMENT_NODE")&&n&&t){var o=(0,l.normalizeRect)(r.getBoundingClientRect());return!!o&&o.bottom>=t.bottom&&n.bottom>=t.bottom}return!0}t.onDragStart=d,t.onDragging=u,t.onDragEnd=p},6482:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCMTableFromTable=void 0;var n=r(1635),o=r(4990);t.getCMTableFromTable=function(e,t){var r;return e.formatContentModel((function(e){var t;return t=(0,n.__read)((0,o.getFirstSelectedTable)(e),1),r=t[0],!1}),{selectionOverride:{type:"table",firstColumn:0,firstRow:0,lastColumn:0,lastRow:0,table:t}}),r}},4898:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WatermarkPlugin=void 0;var n=r(1635),o=r(4990),i=r(6343),a="_WatermarkContent",l={fontFamily:"font-family",fontSize:"font-size",textColor:"color"},s=function(){function e(e,t){this.watermark=e,this.editor=null,this.isShowing=!1,this.darkTextColor=null,this.format=t||{fontSize:"14px",textColor:"#AAAAAA"}}return e.prototype.getName=function(){return"Watermark"},e.prototype.initialize=function(e){this.editor=e},e.prototype.dispose=function(){this.editor=null},e.prototype.onPluginEvent=function(e){var t=this,r=this.editor;r&&("input"==e.eventType&&"insertText"==e.rawEvent.inputType||"compositionEnd"==e.eventType?this.showHide(r,!1):"contentChanged"!=e.eventType||e.source!=o.ChangeSource.SwitchToDarkMode&&e.source!=o.ChangeSource.SwitchToLightMode||!this.isShowing?"editorReady"!=e.eventType&&"contentChanged"!=e.eventType&&"input"!=e.eventType&&"beforeDispose"!=e.eventType||r.formatContentModel((function(e){var n=(0,i.isModelEmptyFast)(e);return t.showHide(r,n),!1})):(e.source==o.ChangeSource.SwitchToDarkMode&&!this.darkTextColor&&this.format.textColor&&(this.darkTextColor=r.getColorManager().getDarkColor(this.format.textColor,void 0,"text")),this.applyWatermarkStyle(r)))},e.prototype.showHide=function(e,t){this.isShowing&&!t?this.hide(e):!this.isShowing&&t&&this.show(e)},e.prototype.show=function(e){this.applyWatermarkStyle(e),this.isShowing=!0},e.prototype.applyWatermarkStyle=function(e){var t='position: absolute; pointer-events: none; content: "'+this.watermark+'";',r=(0,n.__assign)((0,n.__assign)({},this.format),{textColor:e.isDarkMode()?this.darkTextColor:this.format.textColor});(0,o.getObjectKeys)(l).forEach((function(e){r[e]&&(t+=l[e]+": "+r[e]+"!important;")})),e.setEditorStyle(a,t,"before")},e.prototype.hide=function(e){e.setEditorStyle(a,null),this.isShowing=!1},e}();t.WatermarkPlugin=s},6343:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isModelEmptyFast=void 0,t.isModelEmptyFast=function(e){var t=e.blocks[0];return!(e.blocks.length>1)&&(!t||"Paragraph"==t.blockType&&(0==t.segments.length||!t.segments.some((function(e){return"Entity"==e.segmentType||"Image"==e.segmentType||"General"==e.segmentType||"Text"==e.segmentType&&e.text}))&&!(t.format.marginRight&&parseFloat(t.format.marginRight)>0||t.format.marginLeft&&parseFloat(t.format.marginLeft)>0)&&t.segments.filter((function(e){return"Br"==e.segmentType})).length<=1))}},3995:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6894:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEditor=void 0;var n=r(1635),o=r(3025),i=r(6109);t.createEditor=function(e,t,r){var a={plugins:(0,n.__spreadArray)([new i.PastePlugin,new i.EditPlugin,new i.ShortcutPlugin],(0,n.__read)(null!=t?t:[]),!1),initialModel:r,defaultSegmentFormat:{fontFamily:"Calibri,Arial,Helvetica,sans-serif",fontSize:"11pt",textColor:"#000000"}};return new o.Editor(e,a)}},1055:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEditor=void 0;var n=r(1635),o=r(6894);Object.defineProperty(t,"createEditor",{enumerable:!0,get:function(){return o.createEditor}}),(0,n.__exportStar)(r(3995),t),(0,n.__exportStar)(r(4990),t),(0,n.__exportStar)(r(3025),t),(0,n.__exportStar)(r(5978),t),(0,n.__exportStar)(r(6109),t),(0,n.__exportStar)(r(285),t)},1635:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__assign:()=>i,__asyncDelegator:()=>k,__asyncGenerator:()=>T,__asyncValues:()=>M,__await:()=>E,__awaiter:()=>m,__classPrivateFieldGet:()=>D,__classPrivateFieldIn:()=>I,__classPrivateFieldSet:()=>L,__createBinding:()=>h,__decorate:()=>l,__esDecorate:()=>c,__exportStar:()=>v,__extends:()=>o,__generator:()=>g,__importDefault:()=>x,__importStar:()=>w,__makeTemplateObject:()=>O,__metadata:()=>f,__param:()=>s,__propKey:()=>u,__read:()=>b,__rest:()=>a,__runInitializers:()=>d,__setFunctionName:()=>p,__spread:()=>S,__spreadArray:()=>_,__spreadArrays:()=>C,__values:()=>y,default:()=>F});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var i=function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};function a(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function l(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}function s(e,t){return function(r,n){t(r,n,e)}}function c(e,t,r,n,o,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var l,s=n.kind,c="getter"===s?"get":"setter"===s?"set":"value",d=!t&&e?n.static?e:e.prototype:null,u=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),p=!1,f=r.length-1;f>=0;f--){var m={};for(var g in n)m[g]="access"===g?{}:n[g];for(var g in n.access)m.access[g]=n.access[g];m.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var h=(0,r[f])("accessor"===s?{get:u.get,set:u.set}:u[c],m);if("accessor"===s){if(void 0===h)continue;if(null===h||"object"!=typeof h)throw new TypeError("Object expected");(l=a(h.get))&&(u.get=l),(l=a(h.set))&&(u.set=l),(l=a(h.init))&&o.unshift(l)}else(l=a(h))&&("field"===s?o.unshift(l):u[c]=l)}d&&Object.defineProperty(d,n.name,u),p=!0}function d(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0}function u(e){return"symbol"==typeof e?e:"".concat(e)}function p(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function f(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function m(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function l(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,l)}s((n=n.apply(e,t||[])).next())}))}function g(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,n=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}var h=Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function v(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||h(t,e,r)}function y(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function S(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(b(arguments[t]));return e}function C(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,l=i.length;a<l;a++,o++)n[o]=i[a];return n}function _(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function E(e){return this instanceof E?(this.v=e,this):new E(e)}function T(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),i=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){i.push([e,t,r,n])>1||l(e,t)}))})}function l(e,t){try{(r=o[e](t)).value instanceof E?Promise.resolve(r.value.v).then(s,c):d(i[0][2],r)}catch(e){d(i[0][3],e)}var r}function s(e){l("next",e)}function c(e){l("throw",e)}function d(e,t){e(t),i.shift(),i.length&&l(i[0][0],i[0][1])}}function k(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:E(e[n](t)),done:!1}:o?o(t):t}:o}}function M(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=y(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,o,(t=e[r](t)).done,t.value)}))}}}function O(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var P=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function w(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&h(t,e,r);return P(t,e),t}function x(e){return e&&e.__esModule?e:{default:e}}function D(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function L(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r}function I(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}const F={__extends:o,__assign:i,__rest:a,__decorate:l,__param:s,__metadata:f,__awaiter:m,__generator:g,__createBinding:h,__exportStar:v,__values:y,__read:b,__spread:S,__spreadArrays:C,__spreadArray:_,__await:E,__asyncGenerator:T,__asyncDelegator:k,__asyncValues:M,__makeTemplateObject:O,__importStar:w,__importDefault:x,__classPrivateFieldGet:D,__classPrivateFieldSet:L,__classPrivateFieldIn:I}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}return r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(1055)})()));
1
+ define((()=>(()=>{var e={5659:(e,t,r)=>{var n=r(8156),o={};for(var i in n)n.hasOwnProperty(i)&&(o[n[i]]=i);var a=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var l in a)if(a.hasOwnProperty(l)){if(!("channels"in a[l]))throw new Error("missing channels property: "+l);if(!("labels"in a[l]))throw new Error("missing channel labels property: "+l);if(a[l].labels.length!==a[l].channels)throw new Error("channel and label counts mismatch: "+l);var s=a[l].channels,c=a[l].labels;delete a[l].channels,delete a[l].labels,Object.defineProperty(a[l],"channels",{value:s}),Object.defineProperty(a[l],"labels",{value:c})}a.rgb.hsl=function(e){var t,r,n=e[0]/255,o=e[1]/255,i=e[2]/255,a=Math.min(n,o,i),l=Math.max(n,o,i),s=l-a;return l===a?t=0:n===l?t=(o-i)/s:o===l?t=2+(i-n)/s:i===l&&(t=4+(n-o)/s),(t=Math.min(60*t,360))<0&&(t+=360),r=(a+l)/2,[t,100*(l===a?0:r<=.5?s/(l+a):s/(2-l-a)),100*r]},a.rgb.hsv=function(e){var t,r,n,o,i,a=e[0]/255,l=e[1]/255,s=e[2]/255,c=Math.max(a,l,s),d=c-Math.min(a,l,s),u=function(e){return(c-e)/6/d+.5};return 0===d?o=i=0:(i=d/c,t=u(a),r=u(l),n=u(s),a===c?o=n-r:l===c?o=1/3+t-n:s===c&&(o=2/3+r-t),o<0?o+=1:o>1&&(o-=1)),[360*o,100*i,100*c]},a.rgb.hwb=function(e){var t=e[0],r=e[1],n=e[2];return[a.rgb.hsl(e)[0],1/255*Math.min(t,Math.min(r,n))*100,100*(n=1-1/255*Math.max(t,Math.max(r,n)))]},a.rgb.cmyk=function(e){var t,r=e[0]/255,n=e[1]/255,o=e[2]/255;return[100*((1-r-(t=Math.min(1-r,1-n,1-o)))/(1-t)||0),100*((1-n-t)/(1-t)||0),100*((1-o-t)/(1-t)||0),100*t]},a.rgb.keyword=function(e){var t=o[e];if(t)return t;var r,i,a,l=1/0;for(var s in n)if(n.hasOwnProperty(s)){var c=(i=e,a=n[s],Math.pow(i[0]-a[0],2)+Math.pow(i[1]-a[1],2)+Math.pow(i[2]-a[2],2));c<l&&(l=c,r=s)}return r},a.keyword.rgb=function(e){return n[e]},a.rgb.xyz=function(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255;return[100*(.4124*(t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*t+.7152*r+.0722*n),100*(.0193*t+.1192*r+.9505*n)]},a.rgb.lab=function(e){var t=a.rgb.xyz(e),r=t[0],n=t[1],o=t[2];return n/=100,o/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]},a.hsl.rgb=function(e){var t,r,n,o,i,a=e[0]/360,l=e[1]/100,s=e[2]/100;if(0===l)return[i=255*s,i,i];t=2*s-(r=s<.5?s*(1+l):s+l-s*l),o=[0,0,0];for(var c=0;c<3;c++)(n=a+1/3*-(c-1))<0&&n++,n>1&&n--,i=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,o[c]=255*i;return o},a.hsl.hsv=function(e){var t=e[0],r=e[1]/100,n=e[2]/100,o=r,i=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,o*=i<=1?i:2-i,[t,100*(0===n?2*o/(i+o):2*r/(n+r)),(n+r)/2*100]},a.hsv.rgb=function(e){var t=e[0]/60,r=e[1]/100,n=e[2]/100,o=Math.floor(t)%6,i=t-Math.floor(t),a=255*n*(1-r),l=255*n*(1-r*i),s=255*n*(1-r*(1-i));switch(n*=255,o){case 0:return[n,s,a];case 1:return[l,n,a];case 2:return[a,n,s];case 3:return[a,l,n];case 4:return[s,a,n];case 5:return[n,a,l]}},a.hsv.hsl=function(e){var t,r,n,o=e[0],i=e[1]/100,a=e[2]/100,l=Math.max(a,.01);return n=(2-i)*a,r=i*l,[o,100*(r=(r/=(t=(2-i)*l)<=1?t:2-t)||0),100*(n/=2)]},a.hwb.rgb=function(e){var t,r,n,o,i,a,l,s=e[0]/360,c=e[1]/100,d=e[2]/100,u=c+d;switch(u>1&&(c/=u,d/=u),n=6*s-(t=Math.floor(6*s)),1&t&&(n=1-n),o=c+n*((r=1-d)-c),t){default:case 6:case 0:i=r,a=o,l=c;break;case 1:i=o,a=r,l=c;break;case 2:i=c,a=r,l=o;break;case 3:i=c,a=o,l=r;break;case 4:i=o,a=c,l=r;break;case 5:i=r,a=c,l=o}return[255*i,255*a,255*l]},a.cmyk.rgb=function(e){var t=e[0]/100,r=e[1]/100,n=e[2]/100,o=e[3]/100;return[255*(1-Math.min(1,t*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o))]},a.xyz.rgb=function(e){var t,r,n,o=e[0]/100,i=e[1]/100,a=e[2]/100;return r=-.9689*o+1.8758*i+.0415*a,n=.0557*o+-.204*i+1.057*a,t=(t=3.2406*o+-1.5372*i+-.4986*a)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(t=Math.min(Math.max(0,t),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},a.xyz.lab=function(e){var t=e[0],r=e[1],n=e[2];return r/=100,n/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(t-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},a.lab.xyz=function(e){var t,r,n,o=e[0];t=e[1]/500+(r=(o+16)/116),n=r-e[2]/200;var i=Math.pow(r,3),a=Math.pow(t,3),l=Math.pow(n,3);return r=i>.008856?i:(r-16/116)/7.787,t=a>.008856?a:(t-16/116)/7.787,n=l>.008856?l:(n-16/116)/7.787,[t*=95.047,r*=100,n*=108.883]},a.lab.lch=function(e){var t,r=e[0],n=e[1],o=e[2];return(t=360*Math.atan2(o,n)/2/Math.PI)<0&&(t+=360),[r,Math.sqrt(n*n+o*o),t]},a.lch.lab=function(e){var t,r=e[0],n=e[1];return t=e[2]/360*2*Math.PI,[r,n*Math.cos(t),n*Math.sin(t)]},a.rgb.ansi16=function(e){var t=e[0],r=e[1],n=e[2],o=1 in arguments?arguments[1]:a.rgb.hsv(e)[2];if(0===(o=Math.round(o/50)))return 30;var i=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(t/255));return 2===o&&(i+=60),i},a.hsv.ansi16=function(e){return a.rgb.ansi16(a.hsv.rgb(e),e[2])},a.rgb.ansi256=function(e){var t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},a.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var r=.5*(1+~~(e>50));return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},a.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var r;return e-=16,[Math.floor(e/36)/5*255,Math.floor((r=e%36)/6)/5*255,r%6/5*255]},a.rgb.hex=function(e){var t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},a.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var r=t[0];3===t[0].length&&(r=r.split("").map((function(e){return e+e})).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},a.rgb.hcg=function(e){var t,r=e[0]/255,n=e[1]/255,o=e[2]/255,i=Math.max(Math.max(r,n),o),a=Math.min(Math.min(r,n),o),l=i-a;return t=l<=0?0:i===r?(n-o)/l%6:i===n?2+(o-r)/l:4+(r-n)/l+4,t/=6,[360*(t%=1),100*l,100*(l<1?a/(1-l):0)]},a.hsl.hcg=function(e){var t,r=e[1]/100,n=e[2]/100,o=0;return(t=n<.5?2*r*n:2*r*(1-n))<1&&(o=(n-.5*t)/(1-t)),[e[0],100*t,100*o]},a.hsv.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=t*r,o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],100*n,100*o]},a.hcg.rgb=function(e){var t=e[0]/360,r=e[1]/100,n=e[2]/100;if(0===r)return[255*n,255*n,255*n];var o,i=[0,0,0],a=t%1*6,l=a%1,s=1-l;switch(Math.floor(a)){case 0:i[0]=1,i[1]=l,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=l;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=l,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return o=(1-r)*n,[255*(r*i[0]+o),255*(r*i[1]+o),255*(r*i[2]+o)]},a.hcg.hsv=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t),n=0;return r>0&&(n=t/r),[e[0],100*n,100*r]},a.hcg.hsl=function(e){var t=e[1]/100,r=e[2]/100*(1-t)+.5*t,n=0;return r>0&&r<.5?n=t/(2*r):r>=.5&&r<1&&(n=t/(2*(1-r))),[e[0],100*n,100*r]},a.hcg.hwb=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],100*(r-t),100*(1-r)]},a.hwb.hcg=function(e){var t=e[1]/100,r=1-e[2]/100,n=r-t,o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],100*n,100*o]},a.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},a.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},a.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},a.gray.hsl=a.gray.hsv=function(e){return[0,0,e[0]]},a.gray.hwb=function(e){return[0,100,e[0]]},a.gray.cmyk=function(e){return[0,0,0,e[0]]},a.gray.lab=function(e){return[e[0],0,0]},a.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},a.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},734:(e,t,r)=>{var n=r(5659),o=r(8507),i={};Object.keys(n).forEach((function(e){i[e]={},Object.defineProperty(i[e],"channels",{value:n[e].channels}),Object.defineProperty(i[e],"labels",{value:n[e].labels});var t=o(e);Object.keys(t).forEach((function(r){var n=t[r];i[e][r]=function(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var r=e(t);if("object"==typeof r)for(var n=r.length,o=0;o<n;o++)r[o]=Math.round(r[o]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}(n),i[e][r].raw=function(e){var t=function(t){return null==t?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(n)}))})),e.exports=i},8507:(e,t,r)=>{var n=r(5659);function o(e,t){return function(r){return t(e(r))}}function i(e,t){for(var r=[t[e].parent,e],i=n[t[e].parent][e],a=t[e].parent;t[a].parent;)r.unshift(t[a].parent),i=o(n[t[a].parent][a],i),a=t[a].parent;return i.conversion=r,i}e.exports=function(e){for(var t=function(e){var t=function(){for(var e={},t=Object.keys(n),r=t.length,o=0;o<r;o++)e[t[o]]={distance:-1,parent:null};return e}(),r=[e];for(t[e].distance=0;r.length;)for(var o=r.pop(),i=Object.keys(n[o]),a=i.length,l=0;l<a;l++){var s=i[l],c=t[s];-1===c.distance&&(c.distance=t[o].distance+1,c.parent=o,r.unshift(s))}return t}(e),r={},o=Object.keys(t),a=o.length,l=0;l<a;l++){var s=o[l];null!==t[s].parent&&(r[s]=i(s,t))}return r}},8156:e=>{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},8854:(e,t,r)=>{var n=r(8156),o=r(9872),i={};for(var a in n)n.hasOwnProperty(a)&&(i[n[a]]=a);var l=e.exports={to:{},get:{}};function s(e,t,r){return Math.min(Math.max(t,e),r)}function c(e){var t=e.toString(16).toUpperCase();return t.length<2?"0"+t:t}l.get=function(e){var t,r;switch(e.substring(0,3).toLowerCase()){case"hsl":t=l.get.hsl(e),r="hsl";break;case"hwb":t=l.get.hwb(e),r="hwb";break;default:t=l.get.rgb(e),r="rgb"}return t?{model:r,value:t}:null},l.get.rgb=function(e){if(!e)return null;var t,r,o,i=[0,0,0,1];if(t=e.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=t[2],t=t[1],r=0;r<3;r++){var a=2*r;i[r]=parseInt(t.slice(a,a+2),16)}o&&(i[3]=parseInt(o,16)/255)}else if(t=e.match(/^#([a-f0-9]{3,4})$/i)){for(o=(t=t[1])[3],r=0;r<3;r++)i[r]=parseInt(t[r]+t[r],16);o&&(i[3]=parseInt(o+o,16)/255)}else if(t=e.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/)){for(r=0;r<3;r++)i[r]=parseInt(t[r+1],0);t[4]&&(i[3]=parseFloat(t[4]))}else{if(!(t=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/)))return(t=e.match(/(\D+)/))?"transparent"===t[1]?[0,0,0,0]:(i=n[t[1]])?(i[3]=1,i):null:null;for(r=0;r<3;r++)i[r]=Math.round(2.55*parseFloat(t[r+1]));t[4]&&(i[3]=parseFloat(t[4]))}for(r=0;r<3;r++)i[r]=s(i[r],0,255);return i[3]=s(i[3],0,1),i},l.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/);if(t){var r=parseFloat(t[4]);return[(parseFloat(t[1])+360)%360,s(parseFloat(t[2]),0,100),s(parseFloat(t[3]),0,100),s(isNaN(r)?1:r,0,1)]}return null},l.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/);if(t){var r=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,s(parseFloat(t[2]),0,100),s(parseFloat(t[3]),0,100),s(isNaN(r)?1:r,0,1)]}return null},l.to.hex=function(){var e=o(arguments);return"#"+c(e[0])+c(e[1])+c(e[2])+(e[3]<1?c(Math.round(255*e[3])):"")},l.to.rgb=function(){var e=o(arguments);return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},l.to.rgb.percent=function(){var e=o(arguments),t=Math.round(e[0]/255*100),r=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+t+"%, "+r+"%, "+n+"%)":"rgba("+t+"%, "+r+"%, "+n+"%, "+e[3]+")"},l.to.hsl=function(){var e=o(arguments);return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},l.to.hwb=function(){var e=o(arguments),t="";return e.length>=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},l.to.keyword=function(e){return i[e.slice(0,3)]}},2520:(e,t,r)=>{"use strict";var n=r(8854),o=r(734),i=[].slice,a=["keyword","gray","hex"],l={};Object.keys(o).forEach((function(e){l[i.call(o[e].labels).sort().join("")]=e}));var s={};function c(e,t){if(!(this instanceof c))return new c(e,t);if(t&&t in a&&(t=null),t&&!(t in o))throw new Error("Unknown model: "+t);var r,d;if(null==e)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof c)this.model=e.model,this.color=e.color.slice(),this.valpha=e.valpha;else if("string"==typeof e){var u=n.get(e);if(null===u)throw new Error("Unable to parse color from string: "+e);this.model=u.model,d=o[this.model].channels,this.color=u.value.slice(0,d),this.valpha="number"==typeof u.value[d]?u.value[d]:1}else if(e.length){this.model=t||"rgb",d=o[this.model].channels;var f=i.call(e,0,d);this.color=p(f,d),this.valpha="number"==typeof e[d]?e[d]:1}else if("number"==typeof e)e&=16777215,this.model="rgb",this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;var m=Object.keys(e);"alpha"in e&&(m.splice(m.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);var g=m.sort().join("");if(!(g in l))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=l[g];var h=o[this.model].labels,v=[];for(r=0;r<h.length;r++)v.push(e[h[r]]);this.color=p(v)}if(s[this.model])for(d=o[this.model].channels,r=0;r<d;r++){var y=s[this.model][r];y&&(this.color[r]=y(this.color[r]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function d(e,t,r){return(e=Array.isArray(e)?e:[e]).forEach((function(e){(s[e]||(s[e]=[]))[t]=r})),e=e[0],function(n){var o;return arguments.length?(r&&(n=r(n)),(o=this[e]()).color[t]=n,o):(o=this[e]().color[t],r&&(o=r(o)),o)}}function u(e){return function(t){return Math.max(0,Math.min(e,t))}}function p(e,t){for(var r=0;r<t;r++)"number"!=typeof e[r]&&(e[r]=0);return e}c.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(e){var t=this.model in n.to?this:this.rgb(),r=1===(t=t.round("number"==typeof e?e:1)).valpha?t.color:t.color.concat(this.valpha);return n.to[t.model](r)},percentString:function(e){var t=this.rgb().round("number"==typeof e?e:1),r=1===t.valpha?t.color:t.color.concat(this.valpha);return n.to.rgb.percent(r)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var e={},t=o[this.model].channels,r=o[this.model].labels,n=0;n<t;n++)e[r[n]]=this.color[n];return 1!==this.valpha&&(e.alpha=this.valpha),e},unitArray:function(){var e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,1!==this.valpha&&e.push(this.valpha),e},unitObject:function(){var e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,1!==this.valpha&&(e.alpha=this.valpha),e},round:function(e){return e=Math.max(e||0,0),new c(this.color.map(function(e){return function(t){return function(e,t){return Number(e.toFixed(t))}(t,e)}}(e)).concat(this.valpha),this.model)},alpha:function(e){return arguments.length?new c(this.color.concat(Math.max(0,Math.min(1,e))),this.model):this.valpha},red:d("rgb",0,u(255)),green:d("rgb",1,u(255)),blue:d("rgb",2,u(255)),hue:d(["hsl","hsv","hsl","hwb","hcg"],0,(function(e){return(e%360+360)%360})),saturationl:d("hsl",1,u(100)),lightness:d("hsl",2,u(100)),saturationv:d("hsv",1,u(100)),value:d("hsv",2,u(100)),chroma:d("hcg",1,u(100)),gray:d("hcg",2,u(100)),white:d("hwb",1,u(100)),wblack:d("hwb",2,u(100)),cyan:d("cmyk",0,u(100)),magenta:d("cmyk",1,u(100)),yellow:d("cmyk",2,u(100)),black:d("cmyk",3,u(100)),x:d("xyz",0,u(100)),y:d("xyz",1,u(100)),z:d("xyz",2,u(100)),l:d("lab",0,u(100)),a:d("lab",1),b:d("lab",2),keyword:function(e){return arguments.length?new c(e):o[this.model].keyword(this.color)},hex:function(e){return arguments.length?new c(e):n.to.hex(this.rgb().round().color)},rgbNumber:function(){var e=this.rgb().color;return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},luminosity:function(){for(var e=this.rgb().color,t=[],r=0;r<e.length;r++){var n=e[r]/255;t[r]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast:function(e){var t=this.luminosity(),r=e.luminosity();return t>r?(t+.05)/(r+.05):(r+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},isDark:function(){var e=this.rgb().color;return(299*e[0]+587*e[1]+114*e[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var e=this.rgb(),t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten:function(e){var t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken:function(e){var t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate:function(e){var t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate:function(e){var t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten:function(e){var t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken:function(e){var t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale:function(){var e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return c.rgb(t,t,t)},fade:function(e){return this.alpha(this.valpha-this.valpha*e)},opaquer:function(e){return this.alpha(this.valpha+this.valpha*e)},rotate:function(e){var t=this.hsl(),r=t.color[0];return r=(r=(r+e)%360)<0?360+r:r,t.color[0]=r,t},mix:function(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);var r=e.rgb(),n=this.rgb(),o=void 0===t?.5:t,i=2*o-1,a=r.alpha()-n.alpha(),l=((i*a==-1?i:(i+a)/(1+i*a))+1)/2,s=1-l;return c.rgb(l*r.red()+s*n.red(),l*r.green()+s*n.green(),l*r.blue()+s*n.blue(),r.alpha()*o+n.alpha()*(1-o))}},Object.keys(o).forEach((function(e){if(-1===a.indexOf(e)){var t=o[e].channels;c.prototype[e]=function(){if(this.model===e)return new c(this);if(arguments.length)return new c(arguments,e);var r,n="number"==typeof arguments[t]?t:this.valpha;return new c((r=o[this.model][e].raw(this.color),Array.isArray(r)?r:[r]).concat(n),e)},c[e]=function(r){return"number"==typeof r&&(r=p(i.call(arguments),t)),new c(r,e)}}})),e.exports=c},6195:e=>{e.exports=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))}},9872:(e,t,r)=>{"use strict";var n=r(6195),o=Array.prototype.concat,i=Array.prototype.slice,a=e.exports=function(e){for(var t=[],r=0,a=e.length;r<a;r++){var l=e[r];n(l)?t=o.call(t,i.call(l)):t.push(l)}return t};a.wrap=function(e){return function(){return e(a(arguments))}}},285:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDarkColor=void 0;var n=r(1816);Object.defineProperty(t,"getDarkColor",{enumerable:!0,get:function(){return n.default}})},1816:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2520);t.default=function(e,t){void 0===t&&(t=21.247);try{var r=n(e||void 0),o=r.lab().array(),i=(100-o[0])*((100-t)/100)+t;e=n.lab(i,o[1],o[2]).rgb().alpha(r.alpha()).toString()}catch(e){}return e}},5978:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatSegmentWithContentModel=t.formatParagraphWithContentModel=t.formatImageWithContentModel=t.formatTableWithContentModel=t.clearSelectedCells=t.insertTableColumn=t.insertTableRow=t.insertEntity=t.toggleCode=t.setParagraphMargin=t.adjustImageSelection=t.setImageAltText=t.adjustLinkSelection=t.removeLink=t.insertLink=t.clearFormat=t.getFormatState=t.changeImage=t.setImageBoxShadow=t.setImageBorder=t.setSpacing=t.toggleBlockQuote=t.setHeadingLevel=t.setDirection=t.setAlignment=t.setIndentation=t.setListStartNumber=t.setListStyle=t.insertImage=t.splitTextSegment=t.changeCapitalization=t.applySegmentFormat=t.changeFontSize=t.setTextColor=t.setFontSize=t.setFontName=t.setBackgroundColor=t.toggleSuperscript=t.toggleSubscript=t.toggleStrikethrough=t.toggleUnderline=t.toggleItalic=t.toggleBold=t.toggleNumbering=t.toggleBullet=t.applyTableBorderFormat=t.editTable=t.setTableCellShade=t.formatTable=t.insertTable=void 0,t.getListAnnounceData=t.matchLink=t.setModelIndentation=t.findListItemsInSameThread=t.setModelListStartNumber=t.setModelListStyle=t.setListType=t.formatInsertPointWithContentModel=t.formatTextSegmentBeforeSelectionMarker=void 0;var n=r(6598);Object.defineProperty(t,"insertTable",{enumerable:!0,get:function(){return n.insertTable}});var o=r(5308);Object.defineProperty(t,"formatTable",{enumerable:!0,get:function(){return o.formatTable}});var i=r(8632);Object.defineProperty(t,"setTableCellShade",{enumerable:!0,get:function(){return i.setTableCellShade}});var a=r(8649);Object.defineProperty(t,"editTable",{enumerable:!0,get:function(){return a.editTable}});var l=r(9276);Object.defineProperty(t,"applyTableBorderFormat",{enumerable:!0,get:function(){return l.applyTableBorderFormat}});var s=r(2903);Object.defineProperty(t,"toggleBullet",{enumerable:!0,get:function(){return s.toggleBullet}});var c=r(275);Object.defineProperty(t,"toggleNumbering",{enumerable:!0,get:function(){return c.toggleNumbering}});var d=r(6985);Object.defineProperty(t,"toggleBold",{enumerable:!0,get:function(){return d.toggleBold}});var u=r(6634);Object.defineProperty(t,"toggleItalic",{enumerable:!0,get:function(){return u.toggleItalic}});var p=r(1384);Object.defineProperty(t,"toggleUnderline",{enumerable:!0,get:function(){return p.toggleUnderline}});var f=r(8227);Object.defineProperty(t,"toggleStrikethrough",{enumerable:!0,get:function(){return f.toggleStrikethrough}});var m=r(8741);Object.defineProperty(t,"toggleSubscript",{enumerable:!0,get:function(){return m.toggleSubscript}});var g=r(3312);Object.defineProperty(t,"toggleSuperscript",{enumerable:!0,get:function(){return g.toggleSuperscript}});var h=r(8573);Object.defineProperty(t,"setBackgroundColor",{enumerable:!0,get:function(){return h.setBackgroundColor}});var v=r(2886);Object.defineProperty(t,"setFontName",{enumerable:!0,get:function(){return v.setFontName}});var y=r(1444);Object.defineProperty(t,"setFontSize",{enumerable:!0,get:function(){return y.setFontSize}});var b=r(2452);Object.defineProperty(t,"setTextColor",{enumerable:!0,get:function(){return b.setTextColor}});var S=r(9150);Object.defineProperty(t,"changeFontSize",{enumerable:!0,get:function(){return S.changeFontSize}});var C=r(5028);Object.defineProperty(t,"applySegmentFormat",{enumerable:!0,get:function(){return C.applySegmentFormat}});var _=r(786);Object.defineProperty(t,"changeCapitalization",{enumerable:!0,get:function(){return _.changeCapitalization}});var E=r(3066);Object.defineProperty(t,"splitTextSegment",{enumerable:!0,get:function(){return E.splitTextSegment}});var T=r(18);Object.defineProperty(t,"insertImage",{enumerable:!0,get:function(){return T.insertImage}});var k=r(5170);Object.defineProperty(t,"setListStyle",{enumerable:!0,get:function(){return k.setListStyle}});var M=r(2042);Object.defineProperty(t,"setListStartNumber",{enumerable:!0,get:function(){return M.setListStartNumber}});var O=r(5875);Object.defineProperty(t,"setIndentation",{enumerable:!0,get:function(){return O.setIndentation}});var P=r(7391);Object.defineProperty(t,"setAlignment",{enumerable:!0,get:function(){return P.setAlignment}});var w=r(635);Object.defineProperty(t,"setDirection",{enumerable:!0,get:function(){return w.setDirection}});var x=r(9036);Object.defineProperty(t,"setHeadingLevel",{enumerable:!0,get:function(){return x.setHeadingLevel}});var D=r(5793);Object.defineProperty(t,"toggleBlockQuote",{enumerable:!0,get:function(){return D.toggleBlockQuote}});var L=r(1807);Object.defineProperty(t,"setSpacing",{enumerable:!0,get:function(){return L.setSpacing}});var I=r(5313);Object.defineProperty(t,"setImageBorder",{enumerable:!0,get:function(){return I.setImageBorder}});var F=r(6694);Object.defineProperty(t,"setImageBoxShadow",{enumerable:!0,get:function(){return F.setImageBoxShadow}});var R=r(1185);Object.defineProperty(t,"changeImage",{enumerable:!0,get:function(){return R.changeImage}});var N=r(2522);Object.defineProperty(t,"getFormatState",{enumerable:!0,get:function(){return N.getFormatState}});var A=r(5810);Object.defineProperty(t,"clearFormat",{enumerable:!0,get:function(){return A.clearFormat}});var B=r(5318);Object.defineProperty(t,"insertLink",{enumerable:!0,get:function(){return B.insertLink}});var j=r(9463);Object.defineProperty(t,"removeLink",{enumerable:!0,get:function(){return j.removeLink}});var H=r(8652);Object.defineProperty(t,"adjustLinkSelection",{enumerable:!0,get:function(){return H.adjustLinkSelection}});var z=r(1699);Object.defineProperty(t,"setImageAltText",{enumerable:!0,get:function(){return z.setImageAltText}});var W=r(9828);Object.defineProperty(t,"adjustImageSelection",{enumerable:!0,get:function(){return W.adjustImageSelection}});var G=r(2934);Object.defineProperty(t,"setParagraphMargin",{enumerable:!0,get:function(){return G.setParagraphMargin}});var U=r(9719);Object.defineProperty(t,"toggleCode",{enumerable:!0,get:function(){return U.toggleCode}});var K=r(5052);Object.defineProperty(t,"insertEntity",{enumerable:!0,get:function(){return K.insertEntity}});var V=r(1470);Object.defineProperty(t,"insertTableRow",{enumerable:!0,get:function(){return V.insertTableRow}});var q=r(6682);Object.defineProperty(t,"insertTableColumn",{enumerable:!0,get:function(){return q.insertTableColumn}});var Z=r(878);Object.defineProperty(t,"clearSelectedCells",{enumerable:!0,get:function(){return Z.clearSelectedCells}});var X=r(7307);Object.defineProperty(t,"formatTableWithContentModel",{enumerable:!0,get:function(){return X.formatTableWithContentModel}});var Y=r(2270);Object.defineProperty(t,"formatImageWithContentModel",{enumerable:!0,get:function(){return Y.formatImageWithContentModel}});var $=r(8213);Object.defineProperty(t,"formatParagraphWithContentModel",{enumerable:!0,get:function(){return $.formatParagraphWithContentModel}});var Q=r(8578);Object.defineProperty(t,"formatSegmentWithContentModel",{enumerable:!0,get:function(){return Q.formatSegmentWithContentModel}});var J=r(1328);Object.defineProperty(t,"formatTextSegmentBeforeSelectionMarker",{enumerable:!0,get:function(){return J.formatTextSegmentBeforeSelectionMarker}});var ee=r(8210);Object.defineProperty(t,"formatInsertPointWithContentModel",{enumerable:!0,get:function(){return ee.formatInsertPointWithContentModel}});var te=r(4877);Object.defineProperty(t,"setListType",{enumerable:!0,get:function(){return te.setListType}});var re=r(7023);Object.defineProperty(t,"setModelListStyle",{enumerable:!0,get:function(){return re.setModelListStyle}});var ne=r(2439);Object.defineProperty(t,"setModelListStartNumber",{enumerable:!0,get:function(){return ne.setModelListStartNumber}});var oe=r(9221);Object.defineProperty(t,"findListItemsInSameThread",{enumerable:!0,get:function(){return oe.findListItemsInSameThread}});var ie=r(9786);Object.defineProperty(t,"setModelIndentation",{enumerable:!0,get:function(){return ie.setModelIndentation}});var ae=r(7276);Object.defineProperty(t,"matchLink",{enumerable:!0,get:function(){return ae.matchLink}});var le=r(2778);Object.defineProperty(t,"getListAnnounceData",{enumerable:!0,get:function(){return le.getListAnnounceData}})},4544:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setModelAlignment=void 0;var n=r(3824),o=r(4990),i={left:{ltr:"start",rtl:"end"},center:{ltr:"center",rtl:"center"},right:{ltr:"end",rtl:"start"},justify:{ltr:"justify",rtl:"justify"}},a={left:{ltr:"alignLeft",rtl:"alignRight"},center:{ltr:"alignCenter",rtl:"alignCenter"},right:{ltr:"alignRight",rtl:"alignLeft"}};t.setModelAlignment=function(e,t){var r=(0,o.getOperationalBlocks)(e,["ListItem"],["TableCell"]);return r.forEach((function(e){var r=e.block,l=(0,o.mutateBlock)(r),s=i[t]["rtl"==l.format.direction?"rtl":"ltr"];"Table"===l.blockType&&"justify"!==t?(0,n.alignTable)(l,a[t]["rtl"==l.format.direction?"rtl":"ltr"]):l&&("BlockGroup"===l.blockType&&"ListItem"===l.blockGroupType&&l.blocks.forEach((function(e){(0,o.mutateBlock)(e).format.textAlign=s})),l.format.textAlign=s)})),r.length>0}},7484:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setModelDirection=void 0;var n=r(9221),o=r(4990);function i(e,t){if("rtl"==e.format.direction!=("rtl"==t)){var r=(0,o.mutateBlock)(e).format;r.direction=t;var n=r.marginLeft,i=r.paddingLeft;a(r,"marginLeft",r.marginRight),a(r,"marginRight",n),a(r,"paddingLeft",r.paddingRight),a(r,"paddingRight",i),e&&"Table"==e.blockType&&(e.rows.forEach((function(e){e.cells.forEach((function(e){(0,o.updateTableCellMetadata)((0,o.mutateBlock)(e),(function(t){if(null==t?void 0:t.borderOverride){var r=e.format.borderLeft;a(e.format,"borderLeft",e.format.borderRight),a(e.format,"borderRight",r)}return t}))}))})),(0,o.applyTableFormat)(e,void 0,!0))}}function a(e,t,r){r?e[t]=r:delete e[t]}t.setModelDirection=function(e,t){var r=(0,o.getOperationalBlocks)(e,["ListItem"],["TableCell"]);return r.forEach((function(r){var a=r.block;(0,o.isBlockGroupOfType)(a,"ListItem")?(0,n.findListItemsInSameThread)(e,a).forEach((function(e){var r=(0,o.mutateBlock)(e);r.levels.forEach((function(e){e.format.direction=t})),r.blocks.forEach((function(e){return i(e,t)}))})):a&&i(a,t)})),r.length>0}},9786:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setModelIndentation=void 0;var n=r(1635),o=r(9221),i=r(2778),a=r(4990);function l(e){return e.blocks.some((function(e){if("Paragraph"==e.blockType)return e.segments.some((function(e){return e.isSelected}))}))}function s(e,t,r){void 0===r&&(r=40);var n=e.marginLeft,o=e.marginRight,i="rtl"==e.direction,l=(0,a.parseValueWithUnit)(i?o:n),s=(t?Math.ceil:Math.floor)(l/r)*r;return s==l&&(s=Math.max(s+r*(t?1:-1),0)),s==l?null:s}t.setModelIndentation=function(e,t,r,c){void 0===r&&(r=40);var d=(0,a.getOperationalBlocks)(e,["ListItem"],["TableCell"]),u="indent"==t,p=[];return d.forEach((function(t){var d=t.block,f=t.parent,m=t.path;if((0,a.isBlockGroupOfType)(d,"ListItem")){var g=(0,o.findListItemsInSameThread)(e,d),h=g[0];if(l(h)&&1==h.levels.length){var v=d.levels[0],y=(D=v.format).marginLeft,b=D.marginRight,S=s(D,u,r),C="rtl"==D.direction,_=(0,a.parseValueWithUnit)(C?b:y);u||0!=_?null!==S&&(C?v.format.marginRight=S+"px":v.format.marginLeft=S+"px"):d.levels.pop()}else if(1==d.levels.length||!function(e,t,r){for(var n=r.blocks.indexOf(t)-1;n>=0;n--){var i=r.blocks[n];if((0,a.isBlockGroupOfType)(i,"ListItem")&&1==i.levels.length&&l(i))return l((0,o.findListItemsInSameThread)(e,i)[0]);if(!(0,a.isBlockGroupOfType)(i,"ListItem"))return!1}return!1}(e,d,f)){if(u){var E=g.indexOf(d),T=g[E-1],k=g[E+1],M=d.levels.length,O=d.levels[M-1],P=(0,a.createListLevel)((null==O?void 0:O.listType)||"UL",null==O?void 0:O.format,T&&T.levels.length>M?T.levels[M].dataset:k&&k.levels.length>M?k.levels[M].dataset:void 0);(0,a.updateListMetadata)(P,(function(e){return(e=e||{}).applyListStyleFromLevel=!0,e})),delete P.format.startNumberOverride,d.levels.push(P)}else d.levels.pop();d.levels.length>0&&c&&(c.announceData=(0,i.getListAnnounceData)((0,n.__spreadArray)([d],(0,n.__read)(m),!1)))}}else if(d)for(var w=d,x=f;x&&p.indexOf(w)<0;){var D,L=m.indexOf(x);if(null!==(S=s(D=(0,a.mutateBlock)(w).format,u,r))){(C="rtl"==D.direction)?D.marginRight=S+"px":D.marginLeft=S+"px",p.push(w);break}if(!("FormatContainer"==x.blockGroupType&&L>=0))break;(0,a.mutateBlock)(x),w=x,x=m[L+1]}})),d.length>0}},6428:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleModelBlockQuote=void 0;var n=r(7545),o=r(4990);function i(e){return(0,o.isBlockGroupOfType)(e,"FormatContainer")&&"blockquote"==e.tagName}t.toggleModelBlockQuote=function(e,t,r){var a=(0,o.getOperationalBlocks)(e,["FormatContainer","ListItem"],["TableCell"],!0);if(a.every((function(e){return i(e.block)})))a.forEach((function(e){var t=e.block,r=e.parent;(0,o.unwrapBlock)(r,t)}));else{var l=[],s=function(e){return(0,o.createFormatContainer)("blockquote",e?r:t)},c=function(e,n,a){return function(e,t){return i(e)&&(0,o.areSameFormats)(t,e.format)}(n,(null==a?void 0:a.format)||(e?r:t))};a.forEach((function(e){var t=e.block,r=e.parent;i(t)||(0,n.wrapBlockStep1)(l,r,t,s,c)})),(0,n.wrapBlockStep2)(l,c)}return a.length>0}},291:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearModelFormat=void 0;var n=r(1635),o=r(1486),i=r(4990);function a(e,t){var r=(0,i.getClosestAncestorBlockGroupIndex)(e,["FormatContainer"],["TableCell"]);if(r>=0&&r<e.length-1){var n=(0,i.mutateBlock)(e[r]),o=e[r+1].blocks.indexOf(n),a=n.blocks.indexOf(t);if(a>=0&&o>=0){var l=(0,i.createFormatContainer)(n.tagName,n.format);n.blocks.splice(a,1),l.blocks=n.blocks.splice(a),(0,i.mutateBlock)(e[r+1]).blocks.splice(o+1,0,t,l)}}}function l(e){var t=e[(0,i.getClosestAncestorBlockGroupIndex)(e,["ListItem"],["TableCell"])];return!!t&&((0,i.mutateBlock)(t).levels=[],!0)}function s(e,t){if("Divider"==t.blockType){var r=e[0].blocks.indexOf(t);r>=0&&(0,i.mutateBlock)(e[0]).blocks.splice(r,1)}else"Paragraph"==t.blockType&&(t.format={},delete t.decorator)}t.clearModelFormat=function(e,t,r,c){var d=!1;(0,i.iterateSelections)(e,(function(e,o,a,l){if(l)if("Paragraph"==(null==a?void 0:a.blockType)){var s=(0,n.__read)((0,i.mutateSegments)(a,l),2)[1];r.push.apply(r,(0,n.__spreadArray)([],(0,n.__read)(s),!1))}else"ListItem"==e[0].blockGroupType&&1==l.length&&e[0].formatHolder==l[0]&&r.push((0,i.mutateBlock)(e[0]).formatHolder);a?t.push([e,(0,i.mutateBlock)(a)]):o&&function(e,t){if(e){var r=e.table,n=e.colIndex,o=e.rowIndex,a=e.isWholeTableSelected,l=r.rows[o].cells[n];if(l.isSelected){var s=(0,i.mutateBlock)(l);(0,i.updateTableCellMetadata)(s,(function(){return null})),s.isHeader=!1,s.format={useBorderBox:l.format.useBorderBox}}t.find((function(e){return e[0]==r}))||t.push([(0,i.mutateBlock)(r),a])}}(o,c)}),{includeListFormatHolder:e.format?"never":"anySegment"});var u=r[0];if(1==t.length&&function(e){var t="Paragraph"==e.blockType?e.segments.filter((function(e){return e.isSelected})):[];return 1==t.length&&"SelectionMarker"==t[0].segmentType}(t[0][1])&&1==t.length)r.splice.apply(r,(0,n.__spreadArray)([0,r.length],(0,n.__read)((0,o.adjustWordSelection)(e,u)),!1)),d=l(t[0][0])||d;else if(t.length>1||t.some((function(e){return function(e){return e.isSelected||"Paragraph"==e.blockType&&e.segments.every((function(e){return e.isSelected}))}(e[1])})))for(var p=t.length-1;p>=0;p--){var f=(0,n.__read)(t[p],2),m=f[0],g=f[1];s(m,g),d=l(m)||d,a(m,g)}return function(e,t){e.forEach((function(e){e.format=(0,n.__assign)({},t||{}),e.link&&delete e.link.format.textColor,delete e.code}))}(r,e.format),function(e){e.forEach((function(e){var t=(0,n.__read)(e,2),r=t[0];t[1]&&(r.format={useBorderBox:r.format.useBorderBox,borderCollapse:r.format.borderCollapse},(0,i.updateTableMetadata)(r,(function(){return null}))),(0,i.applyTableFormat)(r,void 0,!0)}))}(c),d}},8839:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reducedModelChildProcessor=void 0;var n=r(1635),o=r(4990);t.reducedModelChildProcessor=function(e,t,r){if(!r.nodeStack){var i=(0,o.getSelectionRootNode)(r.selection);r.nodeStack=i?function(e,t){for(var r=[],n=t;n&&e!=n&&e.contains(n);)(0,o.isNodeOfType)(n,"ELEMENT_NODE")&&"TABLE"==n.tagName?r.splice(0,r.length,n):r.push(n),n=n.parentNode;return r}(t,i):[]}var a=r.nodeStack.pop();if(a){var l=(0,n.__read)((0,o.getRegularSelectionOffsets)(r,t),2),s=l[0],c=l[1],d=s>=0||c>=0?function(e,t){for(var r=0,n=e.firstChild;n&&n!=t;)r++,n=n.nextSibling;return r}(t,a):-1;d>=0&&(0,o.handleRegularSelection)(d,r,e,s,c),(0,o.processChildNode)(e,a,r),d>=0&&(0,o.handleRegularSelection)(d+1,r,e,s,c)}else r.defaultElementProcessors.child(e,t,r)}},7545:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wrapBlockStep2=t.wrapBlockStep1=void 0;var n=r(1635),o=r(4990);t.wrapBlockStep1=function(e,t,r,n,i){var a,l=t?(0,o.mutateBlock)(t):null,s=(0,o.mutateBlock)(r),c=null!==(a=null==l?void 0:l.blocks.indexOf(s))&&void 0!==a?a:-1;if(l&&c>=0){l.blocks.splice(c,1);var d=l.blocks[c-1],u=d?(0,o.mutateBlock)(d):null,p="rtl"==s.format.direction,f=u&&i(p,u)?u:function(e,t,r,n){var i=r(n);return(0,o.mutateBlock)(e).blocks.splice(t,0,i),i}(l,c,n,p);(0,o.setParagraphNotImplicit)(s),(0,o.addBlock)(f,s),e.unshift({parent:l,wrapper:f})}},t.wrapBlockStep2=function(e,t){e.forEach((function(e){var r,i=e.parent,a=e.wrapper,l=i.blocks.indexOf(a),s=i.blocks[l+1],c=s?(0,o.mutateBlock)(s):null,d="rtl"==a.format.direction;l>=0&&c&&t(d,c,a)&&(a.blocks.forEach(o.setParagraphNotImplicit),(r=a.blocks).push.apply(r,(0,n.__spreadArray)([],(0,n.__read)(c.blocks),!1)),(0,o.mutateBlock)(i).blocks.splice(l+1,1))}))}},2837:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertEntityModel=void 0;var n=r(1635),o=r(4990);t.insertEntityModel=function(e,t,r,i,a,l,s){var c,d,u,p,f=-1;if("begin"==r||"end"==r)u=e,f="begin"==r?0:e.blocks.length,i||Object.assign(t.format,e.format);else if(p=function(e,t,r){if(t){var n=t.paragraph,i=t.marker,a=t.tableContext,l=t.path,s=n.segments.indexOf(i),c=s>0?n.segments[s-1]:null;return"SelectionMarker"==(null==c?void 0:c.segmentType)&&c.isSelected?{marker:c,paragraph:n,tableContext:a,path:l}:t}var d=(0,o.deleteSelection)(e,[],r),u=d.insertPoint;return"range"==d.deleteResult&&(0,o.normalizeContentModel)(e),u}(e,s,l)){var m=p.marker,g=p.paragraph,h=p.path;if(i){var v="root"==r?(0,o.getClosestAncestorBlockGroupIndex)(h,["TableCell","Document"]):0;u=(0,o.mutateBlock)(h[v]);var y=h[v-1],b="FormatContainer"==(null==y?void 0:y.blockGroupType)||"General"==(null==y?void 0:y.blockGroupType)||"ListItem"==(null==y?void 0:y.blockGroupType)?y:g,S=u.blocks.indexOf(b);f=S>=0?S+1:-1}else{var C=g.segments.indexOf(m);Object.assign(t.format,m.format),C>=0&&g.segments.splice(a?C:C+1,0,t)}}if(f>=0&&u){var _=[],E=void 0;if(i){var T=u.blocks[f];_.push(t),"Paragraph"==(null==T?void 0:T.blockType)?E=(0,o.mutateBlock)(T):T&&"Entity"!=T.blockType&&!a||((E=(0,o.createParagraph)(!1,{},e.format)).segments.push((0,o.createBr)(e.format)),_.push(E))}else(E=(0,o.createParagraph)(!1,void 0,e.format)).segments.push(t),_.push(E);if((c=(0,o.mutateBlock)(u).blocks).splice.apply(c,(0,n.__spreadArray)([f,0],(0,n.__read)(_),!1)),a&&E){m=(0,o.createSelectionMarker)((null===(d=E.segments[0])||void 0===d?void 0:d.format)||e.format);var k=E.segments;i?k.unshift(m):k.push(m),(0,o.setSelection)(e,m,m)}}}},4604:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyImageBorderFormat=void 0;var n=r(4990);t.applyImageBorderFormat=function(e,t,r){if(t){var o=e.format,i=t.width,a=t.style,l=t.color,s=(0,n.extractBorderValues)(o.borderTop),c=s.color,d=s.width,u=s.style,p="";p=i?(0,n.parseValueWithUnit)(i)+"px":d||"1px",a?p=p+" "+a:u?p=p+" "+u:p+=" solid",l?p=p+" "+l:c&&(p=p+" "+c),e.format.borderLeft=p,e.format.borderTop=p,e.format.borderBottom=p,e.format.borderRight=p}else delete e.format.borderLeft,delete e.format.borderTop,delete e.format.borderBottom,delete e.format.borderRight;r&&(e.format.borderRadius=r)}},7276:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matchLink=void 0;var n=r(1635),o=r(4990),i=/^[^?]+%[^0-9a-f]+|^[^?]+%[0-9a-f][^0-9a-f]+|^[^?]+%00|^[^?]+%$|^https?:\/\/[^?\/]+@|^www\.[^?\/]+@/i,a="[a-z0-9](?:[a-z0-9-]*[a-z0-9])?",l="(?:"+a+"\\.)*"+a+"(?:\\:[0-9]+)?(?:[\\/\\?]\\S*)?",s={http:{match:new RegExp("^(?:microsoft-edge:)?http:\\/\\/"+l+"|www\\."+l,"i"),except:i,normalizeUrl:function(e){return new RegExp("^(?:microsoft-edge:)?http:\\/\\/","i").test(e)?e:"http://"+e}},https:{match:new RegExp("^(?:microsoft-edge:)?https:\\/\\/"+l,"i"),except:i},mailto:{match:new RegExp("^mailto:\\S+@\\S+\\.\\S+","i")},notes:{match:new RegExp("^notes:\\/\\/\\S+","i")},file:{match:new RegExp("^file:\\/\\/\\/?\\S+","i")},unc:{match:new RegExp("^\\\\\\\\\\S+","i")},ftp:{match:new RegExp("^ftp:\\/\\/"+l+"|ftp\\."+l,"i"),normalizeUrl:function(e){return new RegExp("^ftp:\\/\\/","i").test(e)?e:"ftp://"+e}},news:{match:new RegExp("^news:(\\/\\/)?"+l,"i")},telnet:{match:new RegExp("^telnet:(\\/\\/)?"+l,"i")},gopher:{match:new RegExp("^gopher:\\/\\/"+l,"i")},wais:{match:new RegExp("^wais:(\\/\\/)?"+l,"i")}};t.matchLink=function(e){var t,r;if(e)try{for(var i=(0,n.__values)((0,o.getObjectKeys)(s)),a=i.next();!a.done;a=i.next()){var l=a.value,c=s[l],d=e.match(c.match);if(d&&d[0]==e&&(!c.except||!c.except.test(e)))return{scheme:l,originalUrl:e,normalizedUrl:c.normalizeUrl?c.normalizeUrl(e):e}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return null}},9221:(e,t)=>{"use strict";function r(e,t){e.blocks.forEach((function(e){switch(e.blockType){case"BlockGroup":"ListItem"==e.blockGroupType?t.push(e):(n(t),r(e,t),n(t));break;case"Paragraph":n(t),e.segments.forEach((function(e){"General"==e.segmentType&&r(e,t)})),n(t);break;case"Table":n(t),e.rows.forEach((function(e){return e.cells.forEach((function(e){r(e,t)}))})),n(t)}}))}function n(e){var t=e[e.length-1];t&&null===t||e.push(null)}function o(e,t,r){var n=e[t].levels,o=e[r].levels;return n.length<=o.length&&n.every((function(e,t){return e.listType==o[t].listType}))}function i(e,t){return e.levels.slice(0,t).some((function(e){return void 0!==e.format.startNumberOverride}))}Object.defineProperty(t,"__esModule",{value:!0}),t.findListItemsInSameThread=void 0,t.findListItemsInSameThread=function(e,t){var n=[];return r(e,n),function(e,t){var r,n=[],a=e.indexOf(t),l=t.levels.length,s="OL"==(null===(r=t.levels[l-1])||void 0===r?void 0:r.listType);if(a>=0){for(var c=a;c>=0;c--){if(!(u=e[c])){if(s)continue;break}var d=i(u,l);if(o(e,a,c)){if(n.unshift(u),s&&d)break}else if(!s||d||u.levels.length<t.levels.length)break}for(c=a+1;c<e.length;c++){var u;if(!(u=e[c])){if(s)continue;break}if(d=i(u,l),o(e,a,c)&&!d)n.push(u);else if(!s||d||u.levels.length<t.levels.length)break}}return n}(n,t)}},2778:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getListAnnounceData=void 0;var n=r(9221),o=r(4990);t.getListAnnounceData=function(e){var t=(0,o.getClosestAncestorBlockGroupIndex)(e,["ListItem"],["TableCell"]);if(t>=0){var r=e[t],i=r.levels[r.levels.length-1];if(i.format.displayForDummyItem)return null;if("OL"==i.listType){var a=function(e,t){for(var r,o,i=(0,n.findListItemsInSameThread)(e[e.length-1],t),a=0,l=0;l<i.length;l++){var s=i[l];if(0==a&&s.levels.length==t.levels.length&&(a=null!==(o=null===(r=s.levels[s.levels.length-1])||void 0===r?void 0:r.format.startNumberOverride)&&void 0!==o?o:1),s==t)break;if(s.levels.length<t.levels.length)a=0;else{if(s.levels.length>t.levels.length)continue;s.levels[s.levels.length-1].format.displayForDummyItem||a++}}return a}(e,r),l=(0,o.getListMetadata)(i),s=(0,o.getAutoListStyleType)("OL",null!=l?l:{},r.levels.length-1,i.format.listStyleType);return void 0===s?null:{defaultStrings:"announceListItemNumbering",formatStrings:[(0,o.getOrderedListNumberStr)(s,a)]}}return{defaultStrings:"announceListItemBullet"}}return null}},4877:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setListType=void 0;var n=r(4990);function o(e){switch(e.blockType){case"Table":return!1;case"Paragraph":return e.segments.every((function(e){return"Br"==e.segmentType||"SelectionMarker"==e.segmentType}));default:return!0}}t.setListType=function(e,t,r){void 0===r&&(r=!1);var i=(0,n.getOperationalBlocks)(e,["ListItem"],[]),a=i.every((function(e){var r,i=e.block;return(0,n.isBlockGroupOfType)(i,"ListItem")?(null===(r=i.levels[i.levels.length-1])||void 0===r?void 0:r.listType)==t:o(i)})),l=[];return i.forEach((function(e,s){var c,d,u=e.block,p=e.parent;if((0,n.isBlockGroupOfType)(u,"ListItem")){var f=u.levels.pop();!a&&f?(f.listType=t,u.levels.push(f)):1==u.blocks.length&&(0,n.setParagraphNotImplicit)(u.blocks[0]),a&&u.blocks.forEach((function(e){u.format.marginLeft&&(e.format.marginLeft=u.format.marginLeft),u.format.marginRight&&(e.format.marginRight=u.format.marginRight),u.format.textAlign&&(e.format.textAlign=u.format.textAlign)}))}else{var m=p.blocks.indexOf(u);if(m>=0)if(1!=i.length&&o(u))l.forEach((function(e){return(0,n.mutateBlock)(e).levels[0].format.marginBottom="0px"})),l=[];else{var g=p.blocks[m-1],h="Paragraph"==u.blockType&&(null===(c=u.segments[0])||void 0===c?void 0:c.format)||{},v=(0,n.createListItem)([(0,n.createListLevel)(t,{startNumberOverride:s>0||"BlockGroup"==(null==g?void 0:g.blockType)&&"ListItem"==g.blockGroupType&&"OL"==(null===(d=g.levels[0])||void 0===d?void 0:d.listType)?void 0:1,direction:u.format.direction,textAlign:u.format.textAlign,marginBottom:r?"0px":void 0,marginTop:r?"0px":void 0})],{fontFamily:h.fontFamily,fontSize:h.fontSize,textColor:h.textColor});"Paragraph"==u.blockType&&(0,n.setParagraphNotImplicit)(u);var y=(0,n.mutateBlock)(u);v.blocks.push(y),y.format.marginRight&&(v.format.marginRight=y.format.marginRight,y.format.marginRight=void 0),y.format.marginLeft&&(v.format.marginLeft=y.format.marginLeft,y.format.marginLeft=void 0),y.format.textAlign&&(v.format.textAlign=y.format.textAlign),(0,n.mutateBlock)(p).blocks.splice(m,1,v),l.push(v);var b=v.levels.length-1;(f=(0,n.mutateBlock)(v).levels[b])&&(0,n.updateListMetadata)(f,(function(e){return Object.assign({},e,{applyListStyleFromLevel:!0})}))}}})),(0,n.normalizeContentModel)(e),i.length>0}},2439:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setModelListStartNumber=void 0;var n=r(4990);t.setModelListStartNumber=function(e,t){var r=(0,n.getFirstSelectedListItem)(e),o=r?(0,n.mutateBlock)(r).levels[(null==r?void 0:r.levels.length)-1]:null;return!!o&&(o.format.startNumberOverride=t,!0)}},7023:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setModelListStyle=void 0;var n=r(9221),o=r(4990);t.setModelListStyle=function(e,t){var r=(0,o.getFirstSelectedListItem)(e);if(r){var i=(0,n.findListItemsInSameThread)(e,r),a=r.levels.length-1;i.forEach((function(e){var r=(0,o.mutateBlock)(e).levels[a];r&&(0,o.updateListMetadata)(r,(function(e){return Object.assign({},e,t)}))}))}return!!r}},4135:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.adjustSegmentSelection=void 0;var n=r(4990);t.adjustSegmentSelection=function(e,t,r){var o,i,a=(0,n.getSelectedParagraphs)(e),l=!1;return a.forEach((function(e){var n=o?0:e.segments.findIndex((function(r){return t(r,e)})),a=e.segments;if(!o){o=a[n];for(var s=n;s>0;s--){if(!r(a[s-1],o,e)){l=l||!!a[s-1].isSelected;break}o=a[s-1],l=l||!a[s-1].isSelected}}if(o)for(s=n;s<e.segments.length;s++){if(s!=n&&!r(a[s],i||a[n],e)){l=l||!!a[s].isSelected;break}i=a[s],l=l||!a[s].isSelected}})),o&&i&&(0,n.setSelection)(e,o,i),l}},210:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.adjustTrailingSpaceSelection=void 0;var n=r(1635),o=r(4990);function i(e){return e.isSelected&&(t=e.text).trimRight()!==t&&!function(e){return 0==e.trimRight().length}(e.text);var t}function a(e,t){(0,o.mutateSegment)(e,t,(function(e,t){var r,i=e.text.trimRight(),a=e.text.substring(i.length),l=(0,o.createText)(i,e.format,e.link,e.code);l.isSelected=!0;var s=e.link?(0,n.__assign)((0,n.__assign)({},e.link),{format:(0,n.__assign)((0,n.__assign)({},null===(r=e.link)||void 0===r?void 0:r.format),{underline:!1})}):void 0,c=(0,o.createText)(a,void 0,s,e.code);c.isSelected=!0;var d=t.segments.indexOf(e);t.segments.splice(d,1,l,c)}))}t.adjustTrailingSpaceSelection=function(e){(0,o.iterateSelections)(e,(function(e,t,r,n){if("Paragraph"===(null==r?void 0:r.blockType)&&n&&n.length>0)if(1===n.length&&"Text"===n[0].segmentType&&i(n[0]))a(r,n[0]);else{var o="SelectionMarker"===n[n.length-1].segmentType?n[n.length-2]:n[n.length-1];o&&"Text"===o.segmentType&&i(o)&&a(r,o)}return!1}))}},1486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.adjustWordSelection=void 0;var n=r(1635),o=r(4990);function i(e,t){var r=e.text,n=-1;if(t)for(var i=0;i<r.length;i++){var a=r[i];if((0,o.isPunctuation)(a)||(0,o.isSpace)(a)){n=i;break}}else for(i=r.length-1;i>=0;i--)if(a=r[i],(0,o.isPunctuation)(a)||(0,o.isSpace)(a)){n=i+1;break}return n}function a(e,t,r,n){var i=t.text,a=(0,o.createText)(i.substring(0,n),t.format,t.link,t.code),l=(0,o.createText)(i.substring(n,i.length),t.format,t.link,t.code);e.splice(r,1,a,l)}t.adjustWordSelection=function(e,t){var r;(0,o.iterateSelections)(e,(function(e,n,i,a){return"Paragraph"==(null==i?void 0:i.blockType)&&1==(null==a?void 0:a.length)&&a[0]==t&&(r=(0,o.mutateBlock)(i)),!0}));var l=r?(0,n.__spreadArray)([],(0,n.__read)(r.segments),!1):void 0;if(l&&r){for(var s=[],c=l.indexOf(t),d=c-1;d>=0&&"Text"==(u=l[d]).segmentType;d--){if((p=i(u,!1))>-1){if(p==u.text.length)break;a(l,u,d,p),s.push(l[d+1]);break}s.push(l[d])}if(c=l.indexOf(t),s.push(t),s.length<=1)return s;for(d=c+1;d<l.length;d++){var u,p;if("Text"!=(u=l[d]).segmentType)break;if((p=i(u,!0))>-1){if(0==p)break;a(l,u,d,p),s.push(l[d]);break}s.push(l[d])}return s[s.length-1]==t?[t]:(r.segments=l,s)}return[t]}},5496:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.collapseTableSelection=void 0;var n=r(4990);t.collapseTableSelection=function(e,t){var r,o=t.firstColumn,i=null===(r=e[t.firstRow])||void 0===r?void 0:r.cells[o];i&&(0,n.addSegment)((0,n.mutateBlock)(i),(0,n.createSelectionMarker)())}},3824:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.alignTable=void 0,t.alignTable=function(e,t){e.format.marginLeft="alignLeft"==t?"":"auto",e.format.marginRight="alignRight"==t?"":"auto"}},2920:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.alignTableCellVertically=t.alignTableCellHorizontally=void 0;var n=r(4990),o={alignCellLeft:"start",alignCellCenter:"center",alignCellRight:"end"},i={alignCellTop:"top",alignCellMiddle:"middle",alignCellBottom:"bottom"};function a(e,t){var r,o=(0,n.getSelectedCells)(e);if(o)for(var i=o.firstRow;i<=o.lastRow;i++)for(var a=o.firstColumn;a<=o.lastColumn;a++){var l=null===(r=e.rows[i])||void 0===r?void 0:r.cells[a];(null==l?void 0:l.format)&&(t((0,n.mutateBlock)(l)),l.blocks.forEach((function(e){"Paragraph"===e.blockType&&e.format.textAlign&&delete(0,n.mutateBlock)(e).format.textAlign})))}}t.alignTableCellHorizontally=function(e,t){a(e,(function(e){e.format.textAlign=o[t]}))},t.alignTableCellVertically=function(e,t){a(e,(function(e){e.format.verticalAlign=i[t],(0,n.updateTableCellMetadata)(e,(function(e){return(e=e||{}).vAlignOverride=!0,e}))}))}},9044:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canMergeCells=void 0,t.canMergeCells=function(e,t,r,n,o){var i=r==o||e[t].cells.every((function(e,t){return t<r||t>o||!e.spanAbove})),a=t==n||e.every((function(e,o){return o<t||o>n||!e.cells[r].spanLeft})),l=e[n].cells.map((function(t,i){return i>=r&&i<=o?function(e,t,r){for(var n,o,i=0,a=t+1;a<e.length&&(null===(o=null===(n=e[a])||void 0===n?void 0:n.cells[r])||void 0===o?void 0:o.spanAbove);a++)i++;return i}(e,n,i):-1})).every((function(e,t,n){return e<0||e==n[r]})),s=e.map((function(r,i){return i>=t&&i<=n?function(e,t,r){for(var n,o,i,a=0,l=r+1;l<(null===(n=e[t])||void 0===n?void 0:n.cells.length)&&(null===(i=null===(o=e[t])||void 0===o?void 0:o.cells[l])||void 0===i?void 0:i.spanLeft);l++)a++;return a}(e,i,o):-1})).every((function(e,r,n){return e<0||e==n[t]}));return i&&a&&l&&s}},878:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearSelectedCells=void 0;var n=r(4990);t.clearSelectedCells=function(e,t){if(t.firstColumn>=0&&t.firstRow>=0&&t.lastColumn<e.widths.length&&t.lastRow<e.rows.length)for(var r=t.firstRow;r<=t.lastRow;r++)for(var o=e.rows[r],i=t.firstColumn;i<=t.lastColumn;i++){var a=o.cells[i];a.isSelected&&((0,n.mutateBlock)(a).isSelected=!1),(0,n.setSelection)(a)}}},9414:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTableStructure=void 0;var n=r(4990);t.createTableStructure=function(e,t,r){var o=(0,n.createTable)(r);return(0,n.addBlock)(e,o),o.rows.forEach((function(e){for(var r=0;r<t;r++){var o=(0,n.createTableCell)();e.cells.push(o)}})),o}},9842:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteTable=void 0,t.deleteTable=function(e){e.rows=[]}},4776:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteTableColumn=void 0;var n=r(5496),o=r(4990);t.deleteTableColumn=function(e){var t=(0,o.getSelectedCells)(e);if(t){for(var r=0;r<e.rows.length;r++){var i=e.rows[r].cells[t.lastColumn+1];i&&((0,o.mutateBlock)(i).spanLeft=i.spanLeft&&e.rows[r].cells[t.firstColumn].spanLeft),e.rows[r].cells.splice(t.firstColumn,t.lastColumn-t.firstColumn+1)}e.widths.splice(t.firstColumn,t.lastColumn-t.firstColumn+1),(0,n.collapseTableSelection)(e.rows,t)}}},9256:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteTableRow=void 0;var n=r(5496),o=r(4990);t.deleteTableRow=function(e){var t=(0,o.getSelectedCells)(e);t&&(e.rows[t.firstRow].cells.forEach((function(r,n){var i,a=null===(i=e.rows[t.lastRow+1])||void 0===i?void 0:i.cells[n];a&&((0,o.mutateBlock)(a).spanAbove=a.spanAbove&&r.spanAbove)})),e.rows.splice(t.firstRow,t.lastRow-t.firstRow+1),(0,n.collapseTableSelection)(e.rows,t))}},1190:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ensureFocusableParagraphForTable=void 0;var n=r(4990);function o(e){var t=(0,n.createParagraph)(!1,void 0,e.format),r=(0,n.createBr)(e.format);return t.segments.push(r),t}t.ensureFocusableParagraphForTable=function(e,t,r){var i,a,l,s=null===(i=r.rows.filter((function(e){return e.cells.length>0}))[0])||void 0===i?void 0:i.cells[0];if(s)(l=s.blocks.filter((function(e){return"Paragraph"==e.blockType}))[0])||(l=o(e),(0,n.mutateBlock)(s).blocks.push(l));else{var c,d=r;for(l=o(e);c=t.shift();){var u=null!==(a=c.blocks.indexOf(d))&&void 0!==a?a:-1;if(c&&u>=0&&(0,n.mutateBlock)(c).blocks.splice(u,1,l),"FormatContainer"!=c.blockGroupType||1!=c.blocks.length||c.blocks[0]!=l)break;d=c}}return l}},6682:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertTableColumn=void 0;var n=r(878),o=r(4990);t.insertTableColumn=function(e,t){var r=(0,o.getSelectedCells)(e),i="insertLeft"==t;if(r){(0,n.clearSelectedCells)(e,r);for(var a=null==r?void 0:r.firstColumn;a<=r.lastColumn;a++)e.rows.forEach((function(e){var t=e.cells[i?r.firstColumn:r.lastColumn],n=(0,o.createTableCell)(t.spanLeft,t.spanAbove,t.isHeader,t.format,t.dataset);n.isSelected=!0,e.cells.splice(i?r.firstColumn:r.lastColumn+1,0,n)})),e.widths.splice(i?r.firstColumn:r.lastColumn+1,0,e.widths[i?r.firstColumn:r.lastColumn])}}},1470:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertTableRow=void 0;var n=r(1635),o=r(878),i=r(4990);t.insertTableRow=function(e,t){var r=(0,i.getSelectedCells)(e),a="insertAbove"==t;if(r){(0,o.clearSelectedCells)(e,r);for(var l=r.firstRow;l<=r.lastRow;l++){var s=e.rows[a?r.firstRow:r.lastRow];e.rows.splice(a?r.firstRow:r.lastRow+1,0,{format:(0,n.__assign)({},s.format),cells:s.cells.map((function(e){var t=(0,i.createTableCell)(e.spanLeft,e.spanAbove,e.isHeader,e.format,e.dataset);return t.isSelected=!0,t})),height:s.height})}}}},7378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeTableCells=void 0;var n=r(9044),o=r(4990);t.mergeTableCells=function(e){var t=(0,o.getSelectedCells)(e);if(t&&(0,n.canMergeCells)(e.rows,t.firstRow,t.firstColumn,t.lastRow,t.lastColumn))for(var r=t.firstRow;r<=t.lastRow;r++)for(var i=t.firstColumn;i<=t.lastColumn;i++){var a=e.rows[r].cells[i];if(a){var l=(0,o.mutateBlock)(a);l.spanLeft=i>t.firstColumn,l.spanAbove=r>t.firstRow}}}},6553:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeTableColumn=void 0;var n=r(9044),o=r(4990);t.mergeTableColumn=function(e,t){var r,i,a,l,s=(0,o.getSelectedCells)(e);if(s){var c="mergeLeft"==t?s.firstColumn:s.lastColumn+1;if(c>0&&c<e.rows[0].cells.length)for(var d=s.firstRow;d<=s.lastRow;d++){var u=null===(r=e.rows[d])||void 0===r?void 0:r.cells[c];if(u&&(0,n.canMergeCells)(e.rows,d,c-1,d,c)){(0,o.mutateBlock)(u).spanLeft=!0;for(var p=c;null===(a=null===(i=e.rows[d])||void 0===i?void 0:i.cells[p])||void 0===a?void 0:a.spanLeft;)(0,o.mutateBlock)(e.rows[d].cells[p]),p--;var f=null===(l=e.rows[d])||void 0===l?void 0:l.cells[p];f&&((0,o.mutateBlock)(f).isSelected=!0)}}}}},863:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeTableRow=void 0;var n=r(9044),o=r(4990);t.mergeTableRow=function(e,t){var r,i,a,l=(0,o.getSelectedCells)(e);if(l){var s="mergeAbove"==t?l.firstRow:l.lastRow+1;if(s>0&&s<e.rows.length)for(var c=l.firstColumn;c<=l.lastColumn;c++){var d=e.rows[s].cells[c];if(d&&(0,n.canMergeCells)(e.rows,s-1,c,s,c)){(0,o.mutateBlock)(d).spanAbove=!0;for(var u=s;null===(i=null===(r=e.rows[u])||void 0===r?void 0:r.cells[c])||void 0===i?void 0:i.spanAbove;)(0,o.mutateBlock)(e.rows[u].cells[c]),u--;var p=null===(a=e.rows[u])||void 0===a?void 0:a.cells[c];p&&((0,o.mutateBlock)(p).isSelected=!0)}}}}},36:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitTableCellHorizontally=void 0;var n=r(1635),o=r(4990);t.splitTableCellHorizontally=function(e){var t=(0,o.getSelectedCells)(e);if(t)for(var r=function(r){if(e.rows.every((function(e,n){var o;return n<t.firstRow||n>t.lastRow||(null===(o=e.cells[r+1])||void 0===o?void 0:o.spanLeft)})))e.rows.forEach((function(e,n){(0,o.mutateBlock)(e.cells[r]),n>=t.firstRow&&n<=t.lastRow&&((0,o.mutateBlock)(e.cells[r+1]).spanLeft=!1)}));else{e.rows.forEach((function(e,i){var a=e.cells[r];if(a){var l=(0,o.createTableCell)(a.spanLeft,a.spanAbove,a.isHeader,a.format);l.dataset=(0,n.__assign)({},a.dataset),i<t.firstRow||i>t.lastRow?l.spanLeft=!0:l.isSelected=a.isSelected,e.cells.splice(r+1,0,l),(0,o.mutateBlock)(e.cells[r])}}));var i=Math.max(e.widths[r]/2,30);e.widths.splice(r,1,i,i)}},i=t.lastColumn;i>=t.firstColumn;i--)r(i)}},7062:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitTableCellVertically=void 0;var n=r(1635),o=r(4990);t.splitTableCellVertically=function(e){var t=(0,o.getSelectedCells)(e);if(t)for(var r=t.lastRow;r>=t.firstRow;r--){var i=e.rows[r],a=e.rows[r+1];if(i.cells.forEach(o.mutateBlock),null==a?void 0:a.cells.every((function(e,r){return r<t.firstColumn||r>t.lastColumn||e.spanAbove})))a.cells.forEach((function(e,r){r>=t.firstColumn&&r<=t.lastColumn&&((0,o.mutateBlock)(e).spanAbove=!1)}));else{var l=Math.max(i.height/=2,22),s={format:(0,n.__assign)({},i.format),height:l,cells:i.cells.map((function(e,r){var i=(0,o.createTableCell)(e.spanLeft,e.spanAbove,e.isHeader,e.format);return i.dataset=(0,n.__assign)({},e.dataset),r<t.firstColumn||r>t.lastColumn?i.spanAbove=!0:i.isSelected=e.isSelected,i}))};i.height=l,e.rows.splice(r+1,0,s)}}}},7391:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setAlignment=void 0;var n=r(4544);t.setAlignment=function(e,t){e.focus(),e.formatContentModel((function(e){return(0,n.setModelAlignment)(e,t)}),{apiName:"setAlignment"})}},635:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setDirection=void 0;var n=r(7484);t.setDirection=function(e,t){e.focus(),e.formatContentModel((function(e){return(0,n.setModelDirection)(e,t)}),{apiName:"setDirection"})}},9036:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setHeadingLevel=void 0;var n=r(8213),o={h1:"2em",h2:"1.5em",h3:"1.17em",h4:"1em",h5:"0.83em",h6:"0.67em"};t.setHeadingLevel=function(e,t){e.focus(),(0,n.formatParagraphWithContentModel)(e,"setHeadingLevel",(function(e){var r,n,i,a=t>0?"h"+t:(n=(null==(r=e.decorator)?void 0:r.tagName)||"",(i=parseInt(n.substring(1)))>=1&&i<=6?n:null);t>0?(e.decorator={tagName:a,format:a?{fontWeight:"bold",fontSize:o[a]}:{}},e.segments.forEach((function(e){delete e.format.fontSize,delete e.format.fontWeight}))):a&&delete e.decorator}))}},5875:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setIndentation=void 0;var n=r(4990),o=r(9786);t.setIndentation=function(e,t,r){e.focus(),e.formatContentModel((function(e,i){var a=(0,o.setModelIndentation)(e,t,r);return a&&(0,n.normalizeContentModel)(e),i.newPendingFormat="preserve",a}),{apiName:"setIndentation"})}},2934:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setParagraphMargin=void 0;var n=r(4990),o=r(8213);t.setParagraphMargin=function(e,t,r){e.focus(),(0,o.formatParagraphWithContentModel)(e,"setParagraphMargin",(function(e){e.decorator||(e.decorator=(0,n.createParagraphDecorator)("p")),t?e.format.marginTop=t:null===t&&delete e.format.marginTop,r?e.format.marginBottom=r:null===r&&delete e.format.marginBottom}))}},1807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setSpacing=void 0;var n=r(8213);t.setSpacing=function(e,t){e.focus(),(0,n.formatParagraphWithContentModel)(e,"setSpacing",(function(e){e.format.lineHeight=t.toString(),e.segments.forEach((function(e){e.format.lineHeight&&delete e.format.lineHeight}))}))}},5793:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleBlockQuote=void 0;var n=r(1635),o=r(6428),i={borderLeft:"3px solid rgb(200, 200, 200)",textColor:"rgb(102, 102, 102)"},a={borderRight:"3px solid rgb(200, 200, 200)",textColor:"rgb(102, 102, 102)"},l={marginTop:"1em",marginBottom:"1em",marginLeft:"40px",marginRight:"40px"};t.toggleBlockQuote=function(e,t,r){var s,c=(0,n.__assign)((0,n.__assign)((0,n.__assign)({},l),{paddingLeft:"10px"}),null!=t?t:i),d=(0,n.__assign)((0,n.__assign)((0,n.__assign)({},l),{paddingRight:"10px",direction:"rtl"}),null!==(s=null!=r?r:t)&&void 0!==s?s:a);e.focus(),e.formatContentModel((function(e,t){return t.newPendingFormat="preserve",(0,o.toggleModelBlockQuote)(e,c,d)}),{apiName:"toggleBlockQuote"})}},5052:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertEntity=void 0;var n=r(8210),o=r(2837),i=r(4990);t.insertEntity=function(e,t,r,a,l){var s=l||{},c=s.contentNode,d=s.focusAfterEntity,u=s.wrapperDisplay,p=s.skipUndoSnapshot,f=s.initialEntityState,m=e.getDocument().createElement(r?"div":"span"),g=null!=u?u:r?void 0:"inline-block";m.style.setProperty("display",g||null),null==g&&r&&(m.style.setProperty("width","100%"),m.style.setProperty("display","inline-block")),c&&m.appendChild(c);var h=(0,i.createEntity)(m,!0,void 0,t);p||e.takeSnapshot();var v={changeSource:i.ChangeSource.InsertEntity,getChangeData:function(){return{wrapper:m,type:t,id:"",isReadonly:!0}},apiName:"insertEntity"},y=function(e,t,n){return(0,o.insertEntityModel)(e,h,"string"==typeof a?a:"focus",r,d,t,n),(0,i.normalizeContentModel)(e),t.skipUndoSnapshot=!0,t.newEntities.push(h),!0};if("object"==typeof a?(0,n.formatInsertPointWithContentModel)(e,a,y,v):e.formatContentModel(y,v),!p){var b=void 0;if(f){var S=(0,i.parseEntityFormat)(m),C=S.id,_=S.entityType;b=C&&_?{id:C,type:_,state:f}:void 0}e.takeSnapshot(b)}return h}},5810:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearFormat=void 0;var n=r(291),o=r(4990);t.clearFormat=function(e){e.focus(),e.formatContentModel((function(e){for(var t=!1,r=!0,i=0;r&&i++<3;){var a=[],l=[],s=[];r=(0,n.clearModelFormat)(e,a,l,s),(0,o.normalizeContentModel)(e),t=t||a.length>0||l.length>0||s.length>0}return t}),{apiName:"clearFormat"})}},2522:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFormatState=void 0;var n=r(8839),o=r(4990);t.getFormatState=function(e){var t=e.getPendingFormat(),r=e.getSnapshotsManager(),i={canUndo:r.hasNewContent||r.canMove(-1),canRedo:r.canMove(1),isDarkMode:e.isDarkMode()};return e.formatContentModel((function(e){return(0,o.retrieveModelFormatState)(e,t,i),!1}),void 0,{processorOverride:{child:n.reducedModelChildProcessor},tryGetFromCache:!0}),i}},9828:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.adjustImageSelection=void 0;var n=r(4135),o=r(4990);t.adjustImageSelection=function(e){var t=null;return e.formatContentModel((function(e){return(0,n.adjustSegmentSelection)(e,(function(e,r){return!(!e.isSelected||"Image"!=e.segmentType||((0,o.mutateSegment)(r,e,(function(e){t=e})),0))}),(function(e,t){return e==t}))}),{apiName:"adjustImageSelection"}),t}},1185:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.changeImage=void 0;var n=r(2270),o=r(4990);t.changeImage=function(e,t){e.focus();var r=e.getDOMSelection();(0,o.readFile)(t,(function(t){t&&!e.isDisposed()&&"image"===(null==r?void 0:r.type)&&(0,n.formatImageWithContentModel)(e,"changeImage",(function(n){var i,a,l=null!==(a=null===(i=(0,o.getImageMetadata)(n))||void 0===i?void 0:i.src)&&void 0!==a?a:"",s=n.src;n.src=t,n.dataset={},n.format.width="",n.format.height="",n.alt="",e.triggerEvent("editImage",{image:r.image,previousSrc:s,newSrc:t,originalSrc:l})}))}))}},18:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertImage=void 0;var n=r(4990);function o(e,t){e.formatContentModel((function(e,r){var o=(0,n.createImage)(t,{backgroundColor:""}),i=(0,n.createContentModelDocument)();return(0,n.addSegment)(i,o),(0,n.mergeModel)(e,i,r,{mergeFormat:"mergeAll"}),o.isSelected=!0,(0,n.setSelection)(e,o),!0}),{apiName:"insertImage"})}t.insertImage=function(e,t){e.focus(),"string"==typeof t?o(e,t):(0,n.readFile)(t,(function(t){t&&!e.isDisposed()&&o(e,t)}))}},1699:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setImageAltText=void 0;var n=r(2270);t.setImageAltText=function(e,t){e.focus(),(0,n.formatImageWithContentModel)(e,"setImageAltText",(function(e){e.alt=t}))}},5313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setImageBorder=void 0;var n=r(4604),o=r(2270);t.setImageBorder=function(e,t,r){e.focus(),(0,o.formatImageWithContentModel)(e,"setImageBorder",(function(e){(0,n.applyImageBorderFormat)(e,t,r)}))}},6694:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setImageBoxShadow=void 0;var n=r(2270);t.setImageBoxShadow=function(e,t,r){e.focus(),(0,n.formatImageWithContentModel)(e,"setImageBoxShadow",(function(e){e.format.boxShadow=t,r?(e.format.marginBottom=r,e.format.marginLeft=r,e.format.marginRight=r,e.format.marginTop=r):null===r&&(delete e.format.marginBottom,delete e.format.marginLeft,delete e.format.marginRight,delete e.format.marginTop)}))}},8652:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.adjustLinkSelection=void 0;var n=r(4135),o=r(1486),i=r(4990);t.adjustLinkSelection=function(e){var t="",r=null;return e.formatContentModel((function(e){var a,l,s=(0,n.adjustSegmentSelection)(e,(function(e){return!!e.isSelected&&!!e.link}),(function(e,t){return!!e.link&&e.link.format.href==t.link.format.href})),c=(0,i.getSelectedSegments)(e,!1,!0),d=c[0];return 1==c.length&&"SelectionMarker"==d.segmentType&&(c=(0,o.adjustWordSelection)(e,d)).length>1&&(s=!0,(0,i.setSelection)(e,c[0],c[c.length-1])),t=c.map((function(e){return"Text"==e.segmentType?e.text:""})).join(""),r=(null===(l=null===(a=c[0])||void 0===a?void 0:a.link)||void 0===l?void 0:l.format.href)||null,s}),{apiName:"adjustLinkSelection"}),[t,r]}},5318:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertLink=void 0;var n=r(1635),o=r(210),i=r(7276),a=r(4990),l=/^[a-zA-Z]+:/i,s=/^[\w.%+-]+@/i,c=/^ftp\./i;t.insertLink=function(e,t,r,u,p){e.focus();var f=(function(e){return e.match(/s\n*c\n*r\n*i\n*p\n*t\n*:/i)?"":e}(t)||"").trim();if(f){var m,g=(0,i.matchLink)(f),h=g?g.normalizedUrl:function(e){if(!e)return e;var t="";return e.search(l)<0&&(t=0==e.search(s)?"mailto:":0==e.search(c)?"ftp://":"http://"),t+e}(f),v=[];e.formatContentModel((function(t,i){var l,s=(0,a.getSelectedSegments)(t,!1,!0),c=s.map((function(e){return"Text"==e.segmentType?e.text:""})).join(""),m=u||c||"";if(s.some((function(e){return"SelectionMarker"!=e.segmentType}))&&c==m)s.forEach((function(e){var t=d(h,r,p,"Text"==e.segmentType);(0,a.addLink)(e,t),e.link&&v.push(e.link)}));else if(s.every((function(e){return"SelectionMarker"==e.segmentType}))||m&&m!=c){var y=(0,a.createText)(m||(g?g.originalUrl:f),(0,n.__assign)((0,n.__assign)({},null===(l=s[0])||void 0===l?void 0:l.format),e.getPendingFormat())),b=(0,a.createContentModelDocument)(),S=d(h,r,p);(0,a.addLink)(y,S),(0,a.addSegment)(b,y),y.link&&v.push(y.link),(0,a.mergeModel)(t,b,i,{mergeFormat:"mergeAll"})}return(0,o.adjustTrailingSpaceSelection)(t),s.length>0}),{changeSource:a.ChangeSource.CreateLink,onNodeCreated:function(e,t){!m&&v.indexOf(e)>=0&&(m=t)},getChangeData:function(){return m},apiName:"insertLink"})}};var d=function(e,t,r,n){return void 0===n&&(n=!0),{dataset:{},format:{href:e,anchorTitle:t,target:r,underline:n}}}},9463:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeLink=void 0;var n=r(4135),o=r(4990);t.removeLink=function(e){e.focus(),e.formatContentModel((function(e){(0,n.adjustSegmentSelection)(e,(function(e){return!!e.isSelected&&!!e.link}),(function(e,t){return e.isSelected||!!e.link&&e.link.format.href==t.link.format.href}));var t=(0,o.getSelectedSegments)(e,!1,!0),r=!1;return t.forEach((function(e){e.link&&(r=!0,delete e.link)})),r}),{apiName:"removeLink"})}},2042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setListStartNumber=void 0;var n=r(2439);t.setListStartNumber=function(e,t){e.focus(),e.formatContentModel((function(e){return(0,n.setModelListStartNumber)(e,t)}),{apiName:"setListStartNumber"})}},5170:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setListStyle=void 0;var n=r(7023);t.setListStyle=function(e,t){e.focus(),e.formatContentModel((function(e){return(0,n.setModelListStyle)(e,t)}),{apiName:"setListStyle"})}},2903:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleBullet=void 0;var n=r(4877);t.toggleBullet=function(e,t){void 0===t&&(t=!1),e.focus(),e.formatContentModel((function(e,r){return r.newPendingFormat="preserve",(0,n.setListType)(e,"UL",t)}),{apiName:"toggleBullet"})}},275:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleNumbering=void 0;var n=r(4877);t.toggleNumbering=function(e,t){void 0===t&&(t=!1),e.focus(),e.formatContentModel((function(e,r){return r.newPendingFormat="preserve",(0,n.setListType)(e,"OL",t)}),{apiName:"toggleNumbering"})}},5028:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applySegmentFormat=void 0;var n=r(8578);t.applySegmentFormat=function(e,t){(0,n.formatSegmentWithContentModel)(e,"applySegmentFormat",(function(e){e.backgroundColor=t.backgroundColor,e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontWeight=t.fontWeight,e.italic=t.italic,e.strikethrough=t.strikethrough,e.superOrSubScriptSequence=t.superOrSubScriptSequence,e.textColor=t.textColor,e.underline=t.underline}),void 0,!0)}},786:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.changeCapitalization=void 0;var n=r(8578);t.changeCapitalization=function(e,t,r){e.focus(),(0,n.formatSegmentWithContentModel)(e,"changeCapitalization",(function(e,n,o){if("Text"==(null==o?void 0:o.segmentType))switch(t){case"lowerCase":o.text=o.text.toLocaleLowerCase(r);break;case"upperCase":o.text=o.text.toLocaleUpperCase(r);break;case"capitalize":for(var i=o.text.toLocaleLowerCase(r).split(" "),a=0;a<i.length;a++)i[a]=i[a].charAt(0).toLocaleUpperCase(r)+i[a].slice(1);o.text=i.join(" ");break;case"sentence":var l=new RegExp("^\\s*\\w|[\\.\\!\\?]\\s+\\w","g");o.text=o.text.toLocaleLowerCase(r).replace(l,(function(e){return e.toLocaleUpperCase(r)}))}}))}},9150:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.changeFontSize=void 0;var n=r(8578),o=r(4990),i=r(1444),a=[8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72];t.changeFontSize=function(e,t){e.focus(),(0,n.formatSegmentWithContentModel)(e,"changeFontSize",(function(e,r,n,l){return function(e,t,r){if(t.fontSize){var n=(0,o.parseValueWithUnit)(t.fontSize,void 0,"pt");if(n>0){var l=function(e,t,r){e=1==t?Math.floor(e):Math.ceil(e);var n=r[r.length-1];if(e<=r[0])e=Math.max(e+t,1);else if(e>n||e==n&&1==t)e/=10,e=1==t?Math.floor(e):Math.ceil(e),e=Math.min(Math.max(10*(e+t),n),1e3);else if(1==t){for(var o=0;o<r.length;o++)if(e<r[o]){e=r[o];break}}else for(o=r.length-1;o>=0;o--)if(e>r[o]){e=r[o];break}return e}(n,"increase"==e?1:-1,a);(0,i.setFontSizeInternal)(l+"pt",t,r)}}}(t,e,l)}),void 0,!0)}},8573:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setBackgroundColor=void 0;var n=r(4990),o=r(8578);t.setBackgroundColor=function(e,t){e.focus();var r=null,i=-1;(0,o.formatSegmentWithContentModel)(e,"setBackgroundColor",(function(e,n,o,a){null===t?delete e.backgroundColor:e.backgroundColor=t,o&&a&&"SelectionMarker"!=o.segmentType&&(i=(r=a).segments.indexOf(o))}),void 0,void 0,(function(e){var t;if(r&&i>=0){var o=(0,n.createSelectionMarker)(null===(t=r.segments[i])||void 0===t?void 0:t.format);r.segments.splice(i+1,0,o),(0,n.setSelection)(e,o,o)}}))}},2886:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setFontName=void 0;var n=r(8578);t.setFontName=function(e,t){e.focus(),(0,n.formatSegmentWithContentModel)(e,"setFontName",(function(e,r,n){e.fontFamily=t,(null==n?void 0:n.code)&&(n.code.format.fontFamily=t)}),void 0,!0)}},1444:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setFontSizeInternal=t.setFontSize=void 0;var n=r(8578);function o(e,t,r){var n;if(t.fontSize=e,null===(n=null==r?void 0:r.segmentFormat)||void 0===n?void 0:n.fontSize){var o=r.segmentFormat.fontSize;r.segments.forEach((function(e){e.format.fontSize||(e.format.fontSize=o)})),delete r.segmentFormat.fontSize}}t.setFontSize=function(e,t){e.focus(),(0,n.formatSegmentWithContentModel)(e,"setFontSize",(function(e,r,n,i){return o(t,e,i)}),void 0,!0)},t.setFontSizeInternal=o},2452:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setTextColor=void 0;var n=r(8578);t.setTextColor=function(e,t){e.focus(),(0,n.formatSegmentWithContentModel)(e,"setTextColor",null===t?function(e,t,r){delete e.textColor,(null==r?void 0:r.link)&&delete r.link.format.textColor}:function(e,r,n){e.textColor=t,(null==n?void 0:n.link)&&(n.link.format.textColor=t)},void 0,!0)}},3066:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitTextSegment=void 0;var n=r(1635),o=r(4990);t.splitTextSegment=function(e,t,r,i){var a,l=e.text,s=t.segments.indexOf(e),c=(0,o.createText)(l.substring(r,i),e.format,e.link,e.code),d=[c];return r>0&&d.unshift((0,o.createText)(l.substring(0,r),e.format,e.link,e.code)),i<l.length&&d.push((0,o.createText)(l.substring(i),e.format,e.link,e.code)),d.forEach((function(t){return t.isSelected=e.isSelected})),(a=t.segments).splice.apply(a,(0,n.__spreadArray)([s,1],(0,n.__read)(d),!1)),c}},6985:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleBold=void 0;var n=r(8578),o=r(4990);t.toggleBold=function(e){e.focus(),(0,n.formatSegmentWithContentModel)(e,"toggleBold",(function(e,t){e.fontWeight=t?"bold":"normal"}),(function(e,t,r){var n;return(0,o.isBold)(void 0===e.fontWeight?null===(n=null==r?void 0:r.decorator)||void 0===n?void 0:n.format.fontWeight:e.fontWeight)}))}},9719:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleCode=void 0;var n=r(4990),o=r(8578),i={format:{fontFamily:"monospace"}};t.toggleCode=function(e){e.focus(),(0,o.formatSegmentWithContentModel)(e,"toggleCode",(function(e,t,r){r&&(t?(0,n.addCode)(r,i):delete r.code)}),(function(e,t){return!!(null==t?void 0:t.code)}))}},6634:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleItalic=void 0;var n=r(8578);t.toggleItalic=function(e){e.focus(),(0,n.formatSegmentWithContentModel)(e,"toggleItalic",(function(e,t){e.italic=!!t}),(function(e){return!!e.italic}))}},8227:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleStrikethrough=void 0;var n=r(8578);t.toggleStrikethrough=function(e){e.focus(),(0,n.formatSegmentWithContentModel)(e,"toggleStrikethrough",(function(e,t){e.strikethrough=!!t}),(function(e){return!!e.strikethrough}))}},8741:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleSubscript=void 0;var n=r(8578);t.toggleSubscript=function(e){e.focus(),(0,n.formatSegmentWithContentModel)(e,"toggleSubscript",(function(e,t){e.superOrSubScriptSequence=t?"sub":""}),(function(e){var t;return"sub"==(null===(t=e.superOrSubScriptSequence)||void 0===t?void 0:t.split(" ").pop())}))}},3312:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleSuperscript=void 0;var n=r(8578);t.toggleSuperscript=function(e){e.focus(),(0,n.formatSegmentWithContentModel)(e,"toggleSuperscript",(function(e,t){e.superOrSubScriptSequence=t?"super":""}),(function(e){var t;return"super"==(null===(t=e.superOrSubScriptSequence)||void 0===t?void 0:t.split(" ").pop())}))}},1384:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleUnderline=void 0;var n=r(210),o=r(8578);t.toggleUnderline=function(e){e.focus(),(0,o.formatSegmentWithContentModel)(e,"toggleUnderline",(function(e,t,r){e.underline=!!t,(null==r?void 0:r.link)&&(r.link.format.underline=!!t)}),(function(e,t){var r,n;return!!e.underline||!!(null===(n=null===(r=null==t?void 0:t.link)||void 0===r?void 0:r.format)||void 0===n?void 0:n.underline)}),!1,n.adjustTrailingSpaceSelection)}},9276:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyTableBorderFormat=void 0;var n=r(1635),o=r(4990);function i(e,t,r){var n=(0,o.mutateBlock)(e);r.forEach((function(e){n.format[e]=t})),(0,o.updateTableCellMetadata)(n,(function(e){return(e=e||{}).borderOverride=!0,e}))}t.applyTableBorderFormat=function(e,t,r){e.formatContentModel((function(e){var a=(0,n.__read)((0,o.getFirstSelectedTable)(e),1)[0];if(a){var l=(0,o.getSelectedCells)(a),s={Top:!1,Bottom:!1,Left:!1,Right:!1},c="",d=a.format,u=t.width,p=t.style,f=t.color,m=(0,o.extractBorderValues)(d.borderTop),g=m.color,h=m.width,v=m.style;c=u?(0,o.parseValueWithUnit)(u)+"px":h||"1px",p?c=c+" "+p:v?c=c+" "+v:c+=" solid",f?c=c+" "+f:g&&(c=c+" "+g);var y="rtl"==a.format.direction;if(l){for(var b=[r];b.length;)switch(b.pop()){case"noBorders":c="",b.push("allBorders");break;case"allBorders":for(var S=["borderTop","borderBottom","borderLeft","borderRight"],C=l.firstRow;C<=l.lastRow;C++)for(var _=l.firstColumn;_<=l.lastColumn;_++)i(a.rows[C].cells[_],c,S);s.Top=!0,s.Bottom=!0,s.Left=!0,s.Right=!0;break;case"leftBorders":var E=["borderLeft"];for(C=l.firstRow;C<=l.lastRow;C++)i(a.rows[C].cells[y?l.lastColumn:l.firstColumn],c,E);y?s.Right=!0:s.Left=!0;break;case"rightBorders":var T=["borderRight"];for(C=l.firstRow;C<=l.lastRow;C++)i(a.rows[C].cells[y?l.firstColumn:l.lastColumn],c,T);y?s.Left=!0:s.Right=!0;break;case"topBorders":var k=["borderTop"];for(_=l.firstColumn;_<=l.lastColumn;_++)i(a.rows[l.firstRow].cells[_],c,k);s.Top=!0;break;case"bottomBorders":var M=["borderBottom"];for(_=l.firstColumn;_<=l.lastColumn;_++)i(a.rows[l.lastRow].cells[_],c,M);s.Bottom=!0;break;case"insideBorders":var O=l.lastColumn==l.firstColumn,P=l.lastRow==l.firstRow;if(O&&P)break;if(O){for(i(a.rows[l.firstRow].cells[l.firstColumn],c,["borderBottom"]),C=l.firstRow+1;C<=l.lastRow-1;C++)i(a.rows[C].cells[l.firstColumn],c,["borderTop","borderBottom"]);i(a.rows[l.lastRow].cells[l.firstColumn],c,["borderTop"]);break}if(P){for(i(a.rows[l.firstRow].cells[y?l.lastColumn:l.firstColumn],c,["borderRight"]),_=l.firstColumn+1;_<=l.lastColumn-1;_++)i(a.rows[l.firstRow].cells[_],c,["borderLeft","borderRight"]);i(a.rows[l.firstRow].cells[y?l.firstColumn:l.lastColumn],c,["borderLeft"]);break}for(i(a.rows[l.firstRow].cells[y?l.lastColumn:l.firstColumn],c,["borderBottom","borderRight"]),i(a.rows[l.firstRow].cells[y?l.firstColumn:l.lastColumn],c,["borderBottom","borderLeft"]),i(a.rows[l.lastRow].cells[y?l.lastColumn:l.firstColumn],c,["borderTop","borderRight"]),i(a.rows[l.lastRow].cells[y?l.firstColumn:l.lastColumn],c,["borderTop","borderLeft"]),_=l.firstColumn+1;_<l.lastColumn;_++)i(a.rows[l.firstRow].cells[_],c,["borderBottom","borderLeft","borderRight"]);for(_=l.firstColumn+1;_<l.lastColumn;_++)i(a.rows[l.lastRow].cells[_],c,["borderTop","borderLeft","borderRight"]);for(C=l.firstRow+1;C<l.lastRow;C++)i(a.rows[C].cells[l.firstColumn],c,["borderTop","borderBottom",y?"borderLeft":"borderRight"]);for(C=l.firstRow+1;C<l.lastRow;C++)i(a.rows[C].cells[l.lastColumn],c,["borderTop","borderBottom",y?"borderRight":"borderLeft"]);l.firstColumn++,l.firstRow++,l.lastColumn--,l.lastRow--,b.push("allBorders");break;case"outsideBorders":b.push("topBorders"),b.push("bottomBorders"),b.push("leftBorders"),b.push("rightBorders")}!function(e,t,r,n,o){if(n.Top&&t.firstRow-1>=0)for(var a=t.firstColumn;a<=t.lastColumn;a++)i(e.rows[t.firstRow-1].cells[a],r,["borderBottom"]);if(n.Bottom&&t.lastRow+1<e.rows.length)for(a=t.firstColumn;a<=t.lastColumn;a++)i(e.rows[t.lastRow+1].cells[a],r,["borderTop"]);if(n.Left&&t.firstColumn-1>=0)for(var l=t.firstRow;l<=t.lastRow;l++)i(e.rows[l].cells[t.firstColumn-1],r,[o?"borderLeft":"borderRight"]);if(n.Right&&t.lastColumn+1<e.rows[0].cells.length)for(l=t.firstRow;l<=t.lastRow;l++)i(e.rows[l].cells[t.lastColumn+1],r,[o?"borderRight":"borderLeft"])}(a,l,c,s,y)}var w=(0,o.getTableMetadata)(a);return w&&(0,o.setFirstColumnFormatBorders)((0,o.mutateBlock)(a).rows,w),!0}return!1}),{apiName:"tableBorder"})}},8649:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.editTable=void 0;var n=r(3824),o=r(9842),i=r(4776),a=r(9256),l=r(7307),s=r(6682),c=r(1470),d=r(7378),u=r(6553),p=r(863),f=r(36),m=r(7062),g=r(2920);t.editTable=function(e,t){e.focus(),function(e){if(e.getEnvironment().isSafari){var t=e.getDOMSelection();"range"!=(null==t?void 0:t.type)||t.range.collapsed||(t.range.collapse(!0),e.setDOMSelection({type:"range",range:t.range,isReverted:!1}))}}(e),(0,l.formatTableWithContentModel)(e,"editTable",(function(e){switch(t){case"alignCellLeft":case"alignCellCenter":case"alignCellRight":(0,g.alignTableCellHorizontally)(e,t);break;case"alignCellTop":case"alignCellMiddle":case"alignCellBottom":(0,g.alignTableCellVertically)(e,t);break;case"alignCenter":case"alignLeft":case"alignRight":(0,n.alignTable)(e,t);break;case"deleteColumn":(0,i.deleteTableColumn)(e);break;case"deleteRow":(0,a.deleteTableRow)(e);break;case"deleteTable":(0,o.deleteTable)(e);break;case"insertAbove":case"insertBelow":(0,c.insertTableRow)(e,t);break;case"insertLeft":case"insertRight":(0,s.insertTableColumn)(e,t);break;case"mergeAbove":case"mergeBelow":(0,p.mergeTableRow)(e,t);break;case"mergeCells":(0,d.mergeTableCells)(e);break;case"mergeLeft":case"mergeRight":(0,u.mergeTableColumn)(e,t);break;case"splitHorizontally":(0,f.splitTableCellHorizontally)(e);break;case"splitVertically":(0,m.splitTableCellVertically)(e)}}))}},5308:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatTable=void 0;var n=r(1635),o=r(4990);t.formatTable=function(e,t,r){e.focus(),e.formatContentModel((function(e){var i=(0,n.__read)((0,o.getFirstSelectedTable)(e),1)[0];return!!i&&(i.rows.forEach((function(e){e.cells.forEach((function(e){(0,o.updateTableCellMetadata)((0,o.mutateBlock)(e),(function(e){return e&&delete e.borderOverride,e}))}))})),(0,o.applyTableFormat)(i,t,r),!0)}),{apiName:"formatTable"})}},6598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertTable=void 0;var n=r(9414),o=r(4990);t.insertTable=function(e,t,r,i){e.focus(),e.formatContentModel((function(a,l){var s,c,d,u=(0,o.deleteSelection)(a,[],l).insertPoint;if(u){var p=(0,o.createContentModelDocument)(),f=(0,n.createTableStructure)(p,t,r);(0,o.normalizeTable)(f,e.getPendingFormat()||u.marker.format),i=i||{verticalAlign:"top"},(0,o.applyTableFormat)(f,i),(0,o.mergeModel)(a,p,l,{insertPosition:u,mergeFormat:"mergeAll"});var m=null===(c=null===(s=f.rows[0])||void 0===s?void 0:s.cells[0])||void 0===c?void 0:c.blocks[0];if("Paragraph"==(null==m?void 0:m.blockType)){var g=(0,o.createSelectionMarker)(null===(d=m.segments[0])||void 0===d?void 0:d.format);m.segments.unshift(g),(0,o.setSelection)(a,g)}return!0}return!1}),{apiName:"insertTable"})}},8632:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setTableCellShade=void 0;var n=r(1635),o=r(4990);t.setTableCellShade=function(e,t){e.focus(),e.formatContentModel((function(e){var r=(0,n.__read)((0,o.getFirstSelectedTable)(e),1)[0];return!!r&&(r.rows.forEach((function(e){return e.cells.forEach((function(e){(0,o.hasSelectionInBlockGroup)(e)&&(0,o.setTableCellBackgroundColor)((0,o.mutateBlock)(e),t,!0)}))})),!0)}),{apiName:"setTableCellShade"})}},2270:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatImageWithContentModel=void 0;var n=r(8578);t.formatImageWithContentModel=function(e,t,r){(0,n.formatSegmentWithContentModel)(e,t,(function(e,t,n){"Image"==(null==n?void 0:n.segmentType)&&r(n)}),void 0,void 0)}},8210:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatInsertPointWithContentModel=void 0;var n=r(1635),o=r(4990);function i(e){return function(t,r,n){var i=n;i.path=i.path||[];var l=!1;i.path[0]!=t&&(i.path.unshift(t),l=!0);for(var s=c(n,e,r),d=0,u=r.firstChild;u;u=u.nextSibling)a(e,d,n,t,s,r),(0,o.processChildNode)(t,u,n),d++;a(e,d,n,t,s,r),l&&i.path.shift()}}function a(e,t,r,n,o,i){t==o[2]&&(t<=o[0]||o[0]<0)&&(t<o[1]||o[1]<0)&&(s(n,r,i,t,e),o[2]=-1),t==o[0]&&(r.isInSelection=!0,s(n,r,i,t)),t==o[2]&&(t<o[1]||o[1]<0)&&(s(n,r,i,t,e),o[2]=-1),t==o[1]&&(s(n,r,i,t),r.isInSelection=!1),t==o[2]&&s(n,r,i,t,e)}t.formatInsertPointWithContentModel=function(e,t,r,n){var a={input:t};e.formatContentModel((function(e,t){if(r(e,t,a.result),null==a?void 0:a.result){var n=a.result,i=n.paragraph,l=n.marker,s=i.segments.indexOf(l);s>=0&&(0,o.mutateBlock)(i).segments.splice(s,1)}return!0}),n,{processorOverride:{child:i(a),textWithSelection:l(a)},tryGetFromCache:!1})};var l=function(e){return function(t,r,i){var a=r.nodeValue||"",l=c(i,e,r),d=(0,n.__read)(l,3),u=d[0],p=d[1],f=d[2],m=function(e,n,c){(0,o.addTextSegment)(t,a.substring(0,e),i),s(t,i,r,n,c),l[0]-=e,l[1]-=e,l[2]=c?-1:l[2]-e,a=a.substring(e)};l[2]>=0&&(l[2]<=l[0]||l[0]<0)&&(l[2]<l[1]||l[1]<0)&&m(l[2],f,e),l[0]>=0&&(m(l[0],u),i.isInSelection=!0),l[2]>=0&&l[2]>l[0]&&(l[2]<l[1]||l[1]<0)&&m(l[2],f,e),l[1]>=0&&(m(l[1],p),i.isInSelection=!1),l[2]>=0&&l[2]>=l[1]&&m(l[2],f,e),(0,o.addTextSegment)(t,a,i)}};function s(e,t,r,i,a){var l=(0,o.buildSelectionMarker)(e,t,r,i);l.isSelected=!a;var s=(0,o.addSegment)(e,l,t.blockFormat,l.format);a&&t.path&&(a.result={path:(0,n.__spreadArray)([],(0,n.__read)(t.path),!1),paragraph:s,marker:l})}function c(e,t,r){var i=(0,n.__read)((0,o.getRegularSelectionOffsets)(e,r),2);return[i[0],i[1],t.input.node==r?t.input.offset:-1]}},8213:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatParagraphWithContentModel=void 0;var n=r(4990);t.formatParagraphWithContentModel=function(e,t,r){e.formatContentModel((function(e,t){var o=(0,n.getSelectedParagraphs)(e,!0);return o.forEach(r),t.newPendingFormat="preserve",o.length>0}),{apiName:t})}},8578:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatSegmentWithContentModel=void 0;var n=r(1635),o=r(1486),i=r(4990);t.formatSegmentWithContentModel=function(e,t,r,a,l,s){e.formatContentModel((function(t,c){var d=(0,i.getSelectedSegmentsAndParagraphs)(t,!!l,!1,!0),u=d.length>=1&&d.every((function(e){return"SelectionMarker"==e[0].segmentType}));if(u){var p=d[0][1],f=d[0][2];(d=(0,o.adjustWordSelection)(t,d[0][0]).map((function(e){return[e,p,f]}))).length>1&&(u=!1)}var m=d.map((function(e){return[e[0].format,e[0],e[1]]})),g=!!a&&m.every((function(e){var t=(0,n.__read)(e,3),r=t[0],o=t[1],i=t[2];return a(r,o,i)}));return m.forEach((function(e){var t=(0,n.__read)(e,3),o=t[0],i=t[1],a=t[2];return r(o,!g,i,a)})),null==s||s(t),u?(c.newPendingFormat=d[0][0].format,e.focus(),!1):m.length>0}),{apiName:t})}},7307:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatTableWithContentModel=void 0;var n=r(1635),o=r(1190),i=r(4990);t.formatTableWithContentModel=function(e,t,r,a){e.formatContentModel((function(e){var t=(0,n.__read)((0,i.getFirstSelectedTable)(e),2),a=t[0],l=t[1];if(a){var s=(0,i.mutateBlock)(a);if(r(s),!(0,i.hasSelectionInBlock)(s)){var c=(0,o.ensureFocusableParagraphForTable)(e,l,s);if(c){var d=(0,i.createSelectionMarker)(e.format);c.segments.unshift(d),(0,i.setParagraphNotImplicit)(c),(0,i.setSelection)(e,d)}}return(0,i.normalizeTable)(s,e.format),(0,i.hasMetadata)(s)&&(0,i.applyTableFormat)(s,void 0,!0),!0}return!1}),{apiName:t,selectionOverride:a})}},1328:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatTextSegmentBeforeSelectionMarker=void 0;var n=r(4990);t.formatTextSegmentBeforeSelectionMarker=function(e,t,r){var o=!1;return e.formatContentModel((function(e,r){var i=(0,n.getSelectedSegmentsAndParagraphs)(e,!1),a=!1;return i.length>0&&"SelectionMarker"==i[0][0].segmentType&&i[0][1]&&(0,n.mutateSegment)(i[0][1],i[0][0],(function(n,i,l){var s=i.segments[l-1];s&&"Text"===s.segmentType&&(o=!0,a=t(e,s,i,n.format,r))})),a}),r),o}},8959:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertInlineCss=t.retrieveCssRules=void 0;var n=r(1635),o=r(4990);t.retrieveCssRules=function(e){var t=(0,o.toArray)(e.querySelectorAll("style")),r=[];return t.forEach((function(e){var t,n,o=e.sheet;if(o)for(var i=0;i<o.cssRules.length;i++){var a=o.cssRules[i];a.type==CSSRule.STYLE_RULE&&a.selectorText&&r.push({selectors:(n=a.selectorText,n.split(/(?![^(]*\)),/).map((function(e){return e.trim()}))),text:a.style.cssText})}null===(t=e.parentNode)||void 0===t||t.removeChild(e)})),r},t.convertInlineCss=function(e,t){for(var r=function(r){var i,a,l=t[r],s=l.selectors,c=l.text;try{for(var d=(i=void 0,(0,n.__values)(s)),u=d.next();!u.done;u=d.next()){var p=u.value;p&&p.trim()&&(0,o.toArray)(e.querySelectorAll(p)).forEach((function(e){return e.setAttribute("style",c+(e.getAttribute("style")||""))}))}}catch(e){i={error:e}}finally{try{u&&!u.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}},i=t.length-1;i>=0;i--)r(i)}},558:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDomToModelContextForSanitizing=void 0;var n=r(1635),o=r(4764),i=r(4990),a=r(3912),l=r(7801),s=r(332),c=r(8219),d=r(8735),u=r(9724),p={processorOverride:{},formatParserOverride:{},additionalFormatParsers:{},additionalAllowedTags:[],additionalDisallowedTags:[],styleSanitizers:{},attributeSanitizers:{}};t.createDomToModelContextForSanitizing=function(e,t,r,f){var m=(0,n.__assign)((0,n.__assign)({},p),f);return(0,i.createDomToModelContext)((0,n.__assign)((0,n.__assign)({defaultFormat:t},(0,s.getRootComputedStyleForContext)(e)),{experimentalFeatures:[]}),r,{processorOverride:{"#text":u.pasteTextProcessor,entity:(0,a.createPasteEntityProcessor)(m),"*":(0,l.createPasteGeneralProcessor)(m)},formatParserOverride:{display:d.pasteDisplayFormatParser},additionalFormatParsers:{container:[o.containerSizeFormatParser],entity:[c.pasteBlockEntityParser]}},m)}},1724:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createModelFromHtml=void 0;var n=r(8959),o=r(558),i=r(4990);t.createModelFromHtml=function(e,t,r,a){var l,s=e?(new DOMParser).parseFromString(null!==(l=null==r?void 0:r(e))&&void 0!==l?l:e,"text/html"):null;if(null==s?void 0:s.body){var c=(0,o.createDomToModelContextForSanitizing)(s,a,void 0,t),d=s?(0,n.retrieveCssRules)(s):[];return(0,n.convertInlineCss)(s,d),(0,i.parseFormat)(s.body,c.formatParsers.segmentOnBlock,c.segmentFormat,c),(0,i.domToContentModel)(s.body,c)}return(0,i.createEmptyModel)(a)}},6973:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSanitizedElement=t.sanitizeElement=t.DisallowedTags=t.AllowedTags=void 0;var n=r(4990);t.AllowedTags=["a","abbr","address","area","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","em","fieldset","figcaption","figure","font","footer","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","menu","menuitem","meter","nav","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","small","span","strike","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","tt","u","ul","var","wbr","xmp"],t.DisallowedTags=["applet","audio","base","basefont","embed","frame","frameset","iframe","link","meta","noscript","object","param","script","slot","source","style","template","title","track","video"];var o=/^\s*var\(\s*[a-zA-Z0-9-_]+\s*(,\s*(.*))?\)\s*$/,i="var(",a=["accept","align","alt","checked","cite","class","color","cols","colspan","contextmenu","coords","datetime","default","dir","dirname","disabled","download","face","headers","height","hidden","high","href","hreflang","ismap","kind","label","lang","list","low","max","maxlength","media","min","multiple","open","optimum","pattern","placeholder","readonly","rel","required","reversed","rows","rowspan","scope","selected","shape","size","sizes","span","spellcheck","src","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","valign","value","width","wrap","bgColor"],l={"background-color":"transparent","border-bottom-color":"rgb(0, 0, 0)","border-bottom-style":"none","border-bottom-width":"0px","border-image-outset":"0","border-image-repeat":"stretch","border-image-slice":"100%","border-image-source":"none","border-image-width":"1","border-left-color":"rgb(0, 0, 0)","border-left-style":"none","border-left-width":"0px","border-right-color":"rgb(0, 0, 0)","border-right-style":"none","border-right-width":"0px","border-top-color":"rgb(0, 0, 0)","border-top-style":"none","border-top-width":"0px","outline-color":"transparent","outline-style":"none","outline-width":"0px",overflow:"visible","-webkit-text-stroke-width":"0px","word-wrap":"break-word","margin-left":"0px","margin-right":"0px",padding:"0px","padding-top":"0px","padding-left":"0px","padding-right":"0px","padding-bottom":"0px",border:"0px","border-top":"0px","border-left":"0px","border-right":"0px","border-bottom":"0px","vertical-align":"baseline",float:"none","font-style":"normal","font-variant-ligatures":"normal","font-variant-caps":"normal","font-weight":"400","letter-spacing":"normal",orphans:"2","text-align":"start","text-indent":"0px","text-transform":"none",widows:"2","word-spacing":"0px","white-space":"normal"};function s(e,t,r,n,o){for(var i=e.createElement(t),l=0;l<r.length;l++){var s=r[l],d=s.name.toLowerCase().trim(),u=s.value,p=null==o?void 0:o[d],f="style"==d?c(t,u,n):"function"==typeof p?p(u,t):"boolean"==typeof p?p?u:null:a.indexOf(d)>=0||0==d.indexOf("data-")?u:null;null==f||f.match(/s\n*c\n*r\n*i\n*p\n*t\n*:/i)||i.setAttribute(d,f)}return i}function c(e,t,r){var n=t.split(";"),a=[];return n.forEach((function(t){var n=t.indexOf(":"),s=t.slice(0,n).trim(),c=t.slice(n+1).trim();if(s&&c){(function(e){return 0==e.indexOf(i)})(c)&&(c=function(e){var t=o.exec(e);return(null==t?void 0:t[2])||""}(c));var d=null==r?void 0:r[s],u="function"==typeof d?d(c,e):!1===d?null:c;u&&"inherit"!=u&&"initial"!=u&&u.indexOf("expression")<0&&!s.startsWith("-")&&l[s]!=u&&a.push(s+":"+u)}})),a.join(";")}t.sanitizeElement=function e(t,r,o,i,a){var l=t.tagName.toLowerCase(),c=o.indexOf(l)>=0?null:s(t.ownerDocument,r.indexOf(l)>=0?l:"span",t.attributes,i,a);if(c)for(var d=t.firstChild;d;d=d.nextSibling){var u=(0,n.isNodeOfType)(d,"ELEMENT_NODE")?e(d,r,o,i,a):(0,n.isNodeOfType)(d,"TEXT_NODE")?d.cloneNode():null;u&&(null==c||c.appendChild(u))}return c},t.createSanitizedElement=s},3980:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exportContent=void 0;var n=r(4990);t.exportContent=function(e,t,r){if(void 0===t&&(t="HTML"),"PlainTextFast"==t)return e.getDOMHelper().getTextContent();var o=e.getContentModelCopy("clean");if("PlainText"==t)return(0,n.contentModelToText)(o,void 0,r);var i=e.getDocument(),a=i.createElement("div");return(0,n.contentModelToDom)(i,a,o,(0,n.createModelToDomContext)(void 0,r)),e.triggerEvent("extractContentWithDom",{clonedRoot:a},!0),a.innerHTML}},6584:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPasteFragment=void 0;var n=r(4990);t.createPasteFragment=function(e,t,r,o){var i=t.imageDataUri,a=t.text,l=e.createDocumentFragment();if("asImage"==r&&i||"asPlainText"!=r&&!a&&i){var s=e.createElement("img");s.style.maxWidth="100%",s.src=i,l.appendChild(s)}else"asPlainText"!=r&&o?(0,n.moveChildNodes)(l,o):a&&a.split("\n").forEach((function(t,r,o){(t=t.replace(/^ /g," ").replace(/ $/g," ").replace(/\r/g,"").replace(/ {2}/g,"  ")).includes("\t")&&(t=function(e,t){void 0===t&&(t=0);for(var r,n=e;-1!=(r=n.indexOf("\t"));){var o=n.slice(0,r),i=n.slice(r+1),a=6-(o.length+t)%6;n=o+Array(a).fill(" ").join("")+i}return n}(t));var i=e.createTextNode(t);2==o.length&&0==r?(l.appendChild(i),l.appendChild(e.createElement("br"))):r>0&&r<o.length-1?l.appendChild((0,n.wrap)(e,""==t?e.createElement("br"):i,"div")):l.appendChild(i)}));return l}},5158:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generatePasteOptionFromPlugins=void 0,t.generatePasteOptionFromPlugins=function(e,t,r,n,o){var i,a,l={eventType:"beforePaste",clipboardData:t,fragment:r,htmlBefore:null!==(i=n.htmlBefore)&&void 0!==i?i:"",htmlAfter:null!==(a=n.htmlAfter)&&void 0!==a?a:"",htmlAttributes:n.metadata,pasteType:o,domToModelOption:{additionalAllowedTags:[],additionalDisallowedTags:[],additionalFormatParsers:{},formatParserOverride:{},processorOverride:{},styleSanitizers:{},attributeSanitizers:{}},containsBlockElements:!!n.containsBlockElements};return"asPlainText"==o?l:e.triggerEvent("beforePaste",l,!0)}},9499:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergePasteContent=t.cloneModelForPaste=void 0;var n=r(1635),o=r(558),i=r(4990),a={includeCachedElement:function(e,t){return"cache"==t?void 0:e}};function l(e){return(0,i.cloneModel)(e,a)}function s(e){return 2==e.blocks.length&&"Table"===e.blocks[0].blockType&&"Paragraph"===e.blocks[1].blockType&&1===e.blocks[1].segments.length&&"Br"===e.blocks[1].segments[0].segmentType&&e.blocks.splice(1),1===e.blocks.length&&"Table"===e.blocks[0].blockType}t.cloneModelForPaste=l,t.mergePasteContent=function(e,t){var r=t.fragment,a=t.domToModelOption,c=t.customizedMerge,d=t.pasteType,u=t.clipboardData,p=t.containsBlockElements;e.formatContentModel((function(t,f){if(u.modelBeforePaste){var m=l(u.modelBeforePaste);t.blocks=m.blocks}var g=(0,o.createDomToModelContextForSanitizing)(e.getDocument(),void 0,e.getEnvironment().domToModelSettings.customized,a);g.segmentFormat=function(e,t){var r=(0,i.getSelectedSegments)(e,!0)[0];if(r){var n=(0,i.getSegmentTextFormat)(r);return"normal"==t&&(n.textColor="rgb(0,0,0)"),n}return{}}(t,d);var h=(0,i.domToContentModel)(r,g),v={mergeFormat:"mergeFormat"==d?"keepSourceEmphasisFormat":"none",mergeTable:s(h),addParagraphAfterMergedContent:p},y=c?c(t,h):(0,i.mergeModel)(t,h,f,v);return y&&(f.newPendingFormat=(0,n.__assign)((0,n.__assign)((0,n.__assign)({},i.EmptySegmentFormat),t.format),"normal"!=d||p?y.marker.format:function(e){if(1==e.blocks.length){var t=(0,n.__read)(e.blocks,1)[0];if("Paragraph"==t.blockType){var r=t.segments[t.segments.length-1];return(0,n.__assign)({},r.format)}}return{}}(h))),!0}),{changeSource:i.ChangeSource.Paste,getChangeData:function(){return u},scrollCaretIntoView:!0,apiName:"paste"})}},292:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.paste=void 0;var n=r(9499),o=r(8959),i=r(6584),a=r(5158),l=r(1810);function s(e,t){return e?(new DOMParser).parseFromString(t(e),"text/html"):null}t.paste=function(e,t,r){var c;void 0===r&&(r="normal"),e.focus();var d=e.getTrustedHTMLHandler();t.modelBeforePaste||e.formatContentModel((function(e){return t.modelBeforePaste=(0,n.cloneModelForPaste)(e),!1}));var u=s(t.rawHtml,d),p="function"==typeof r?r(u,t):r,f=(0,l.retrieveHtmlInfo)(u,t),m=(0,i.createPasteFragment)(e.getDocument(),t,p,null===(c=t.rawHtml==t.html?u:s(t.html,d))||void 0===c?void 0:c.body),g=(0,a.generatePasteOptionFromPlugins)(e,t,m,f,p);(0,o.convertInlineCss)(g.fragment,f.globalCssRules),(0,n.mergePasteContent)(e,g)}},1810:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retrieveHtmlInfo=void 0;var n=r(1635),o=r(4990),i=r(8959),a="\x3c!--StartFragment--\x3e",l="\x3c!--EndFragment--\x3e";function s(e){var t,r={},n=null===(t=e.querySelector("html"))||void 0===t?void 0:t.attributes;return(n?(0,o.toArray)(n):[]).forEach((function(e){r[e.name]=e.value})),(0,o.toArray)(e.querySelectorAll("meta")).forEach((function(e){r[e.name]=e.content})),r}function c(e){return(0,o.toArray)(e.body.querySelectorAll("*")).some((function(e){return(0,o.isNodeOfType)(e,"ELEMENT_NODE")&&(0,o.isBlockElement)(e)}))}t.retrieveHtmlInfo=function(e,t){var r={metadata:{},globalCssRules:[]};return e&&(r=(0,n.__assign)((0,n.__assign)({},function(e){var t,r=null!==(t=e.rawHtml)&&void 0!==t?t:"",n=r.indexOf(a),o=r.lastIndexOf(l),i="",s="";return n>=0&&o>=n+20?(i=r.substring(0,n),s=r.substring(o+18),e.html=r.substring(n+20,o)):e.html=r,{htmlBefore:i,htmlAfter:s}}(t)),{globalCssRules:(0,i.retrieveCssRules)(e),metadata:s(e),containsBlockElements:c(e)}),t.htmlFirstLevelChildTags=function(e){for(var t,r=[],n=e.body.firstChild;n;n=n.nextSibling)(0,o.isNodeOfType)(n,"TEXT_NODE")?(null===(t=n.nodeValue)||void 0===t?void 0:t.replace(/(\r\n|\r|\n)/gm,"").trim())&&r.push(""):(0,o.isNodeOfType)(n,"ELEMENT_NODE")&&r.push(n.tagName);return r}(e)),r}},5942:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.redo=void 0,t.redo=function(e){e.focus();var t=e.getSnapshotsManager().move(1);t&&e.restoreSnapshot(t)}},674:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.undo=void 0,t.undo=function(e){e.focus();var t=e.getSnapshotsManager();t.hasNewContent&&e.takeSnapshot();var r=t.move(-1);r&&e.restoreSnapshot(r)}},1064:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addUndoSnapshot=void 0;var n=r(4990),o=r(5339),i=r(2998);t.addUndoSnapshot=function(e,t,r){var a=e.lifecycle,l=e.physicalRoot,s=e.logicalRoot,c=e.undo,d=null;if(!a.shadowEditFragment){var u=(0,o.createSnapshotSelection)(e),p=l.innerHTML;if(s!==l){var f=(0,n.findClosestEntityWrapper)(s,e.domHelper);if(!r&&f){var m=(0,n.parseEntityFormat)(f);if(m.entityType&&m.id){var g={eventType:"entityOperation",operation:"snapshotEntityState",entity:{type:m.entityType,id:m.id,wrapper:f,isReadonly:m.isReadonly},state:void 0};e.api.triggerEvent(e,g,!1),g.state&&(r=[{type:m.entityType,id:m.id,state:g.state}])}}}d={html:p,entityStates:r,isDarkMode:!!a.isDarkMode,selection:u},s!==l&&(d.logicalRootPath=(0,i.getPath)(s,0,l)),c.snapshotsManager.addSnapshot(d,!!t),c.snapshotsManager.hasNewContent=!1}return d}},5339:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSnapshotSelection=void 0;var n=r(4990),o=r(2998);function i(e,t){for(var r=e,o=!1;r&&t.contains(r);)(0,n.isNodeOfType)(r,"ELEMENT_NODE")&&(0,n.isElementOfType)(r,"table")&&(o=a(r)||o),r=r.parentNode;return o}function a(e){for(var t,r=!1,o=null,i=e.firstChild;i;i=i.nextSibling)switch((0,n.isNodeOfType)(i,"ELEMENT_NODE")?i.tagName:null){case"TR":o||(o=e.ownerDocument.createElement("tbody"),e.insertBefore(o,i)),o.appendChild(i),i=o,r=!0;break;case"TBODY":o?((0,n.moveChildNodes)(o,i,!0),null===(t=i.parentNode)||void 0===t||t.removeChild(i),i=o,r=!0):o=i;break;default:o=null}var a=e.querySelectorAll("colgroup"),l=e.querySelector("thead");return l&&a.forEach((function(e){l.contains(e)||l.appendChild(e)})),r}t.createSnapshotSelection=function(e){var t=e.physicalRoot,r=e.api,n=r.getDOMSelection(e);if("range"==(null==n?void 0:n.type)){var a=n.range,l=a.startContainer,s=a.startOffset,c=a.endContainer,d=a.endOffset,u=i(l,t);if(c!=l&&(u=i(c,t)||u),u){var p=t.ownerDocument.createRange();p.setStart(l,s),p.setEnd(c,d),r.setDOMSelection(e,{type:"range",range:p,isReverted:!!n.isReverted},!0)}}switch(null==n?void 0:n.type){case"image":return{type:"image",imageId:n.image.id};case"table":return{type:"table",tableId:n.table.id,firstColumn:n.firstColumn,lastColumn:n.lastColumn,firstRow:n.firstRow,lastRow:n.lastRow};case"range":var f=n.range;return{type:"range",start:(0,o.getPath)(f.startContainer,f.startOffset,t),end:(0,o.getPath)(f.endContainer,f.endOffset,t),isReverted:!!n.isReverted};default:return{type:"range",start:[],end:[],isReverted:!1}}}},2998:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPath=void 0;var n=r(4990);t.getPath=function(e,t,r){var o,i,a,l=[];if(!e||!r.contains(e))return l;if((0,n.isNodeOfType)(e,"TEXT_NODE")){for(a=e.parentNode;e.previousSibling&&(0,n.isNodeOfType)(e.previousSibling,"TEXT_NODE");)t+=(null===(o=e.previousSibling.nodeValue)||void 0===o?void 0:o.length)||0,e=e.previousSibling;l.unshift(t)}else a=e,e=e.childNodes[t];do{t=0;for(var s=!1,c=(null==a?void 0:a.firstChild)||null;c&&c!=e;c=c.nextSibling){if((0,n.isNodeOfType)(c,"TEXT_NODE")){if(0===(null===(i=c.nodeValue)||void 0===i?void 0:i.length)||s)continue;s=!0}else s=!1;t++}l.unshift(t),e=a,a=(null==a?void 0:a.parentNode)||null}while(e&&e!=r);return l}},3784:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.announce=void 0;var n=r(1782);t.announce=function(e,t){var r=t.text,o=t.defaultStrings,i=t.formatStrings,a=void 0===i?[]:i,l=t.ariaLiveMode,s=void 0===l?"assertive":l,c=e.lifecycle.announcerStringGetter,d=function(e,t){return null==e||(e=e.replace(/\{(\d+)\}/g,(function(e,r){var n=parseInt(r),o=t[n];return null!=o?o:""}))),e}(o&&(null==c?void 0:c(o))||r,a);if(e.lifecycle.announceContainer||(e.lifecycle.announceContainer=(0,n.createAriaLiveElement)(e.physicalRoot.ownerDocument)),d&&e.lifecycle.announceContainer){var u=e.lifecycle.announceContainer;u.ariaLive!=s&&(u.ariaLive=s),d==u.textContent&&(d+="."),u&&(u.textContent=d)}}},1268:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.attachDomEvent=void 0;var n=r(4990);t.attachDomEvent=function(e,t){var r=(0,n.getObjectKeys)(t||{}).map((function(r){var n=t[r],o=n.pluginEventType,i=n.beforeDispatch,a=r,l=function(t){i&&i(t),null!=o&&e.api.triggerEvent(e,{eventType:o,rawEvent:t},!1)};return e.logicalRoot.addEventListener(a,l),function(){e.logicalRoot.removeEventListener(a,l)}}));return function(){return r.forEach((function(e){return e()}))}}},4694:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.coreApiMap=void 0;var n=r(1064),o=r(3784),i=r(1268),a=r(9538),l=r(1984),s=r(60),c=r(8060),d=r(5704),u=r(3834),p=r(7488),f=r(3472),m=r(1616),g=r(2830),h=r(7832),v=r(6558),y=r(4486);t.coreApiMap={createContentModel:a.createContentModel,createEditorContext:l.createEditorContext,formatContentModel:c.formatContentModel,setContentModel:f.setContentModel,setLogicalRoot:h.setLogicalRoot,getDOMSelection:d.getDOMSelection,setDOMSelection:m.setDOMSelection,focus:s.focus,addUndoSnapshot:n.addUndoSnapshot,restoreUndoSnapshot:p.restoreUndoSnapshot,attachDomEvent:i.attachDomEvent,triggerEvent:y.triggerEvent,switchShadowEdit:v.switchShadowEdit,getVisibleViewport:u.getVisibleViewport,setEditorStyle:g.setEditorStyle,announce:o.announce}},9538:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createContentModel=void 0;var n=r(2994),o=r(4990);t.createContentModel=function(e,t,r){var i;if(null===(i=e.cache.textMutationObserver)||void 0===i||i.flushMutations(),!r&&(!t||t.tryGetFromCache)){var a=e.cache.cachedModel;if(a)return e.lifecycle.shadowEditFragment?(0,o.cloneModel)(a,{includeCachedElement:!0}):a}var l="none"==r?void 0:r||e.api.getDOMSelection(e)||void 0,s=!t&&!r,c=e.api.createEditorContext(e,s),d=e.environment.domToModelSettings,u=t?(0,o.createDomToModelContext)(c,d.builtIn,d.customized,t):(0,o.createDomToModelContextWithConfig)(d.calculated,c);l&&(u.selection=l);var p=(0,o.domToContentModel)(e.logicalRoot,u);return s&&(0,n.updateCache)(e.cache,p,l),p}},1984:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEditorContext=void 0;var n=r(1635),o=r(332);t.createEditorContext=function(e,t){var r,i,a=e.lifecycle,l=e.format,s=e.darkColorHandler,c=e.logicalRoot,d=e.cache,u=e.domHelper;t=t&&!e.lifecycle.shadowEditFragment;var p=(0,n.__assign)({isDarkMode:a.isDarkMode,defaultFormat:l.defaultFormat,pendingFormat:null!==(r=l.pendingFormat)&&void 0!==r?r:void 0,darkColorHandler:s,addDelimiterForEntity:!0,allowCacheElement:!0,domIndexer:t?d.domIndexer:void 0,zoomScale:u.calculateZoomScale(),experimentalFeatures:null!==(i=e.experimentalFeatures)&&void 0!==i?i:[]},(0,o.getRootComputedStyleForContext)(c.ownerDocument));return e.domHelper.isRightToLeft()&&(p.isRootRtl=!0),p}},332:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRootComputedStyleForContext=void 0;var n=r(4990);t.getRootComputedStyleForContext=function(e){var t,r=null===(t=e.defaultView)||void 0===t?void 0:t.getComputedStyle(e.documentElement);return{rootFontSize:(0,n.parseValueWithUnit)(null==r?void 0:r.fontSize)||16}}},60:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.focus=void 0,t.focus=function(e){var t;if(!e.lifecycle.shadowEditFragment){var r=e.api,n=e.domHelper,o=e.selection;n.hasFocus()||"range"!=(null===(t=o.selection)||void 0===t?void 0:t.type)||r.setDOMSelection(e,o.selection,!0),n.hasFocus()||e.logicalRoot.focus()}}},8060:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatContentModel=void 0;var n=r(1635),o=r(4990),i=r(2066);function a(e,t,r){var o,i="preserve"==t.newPendingFormat?null===(o=e.format.pendingFormat)||void 0===o?void 0:o.format:t.newPendingFormat;i&&"range"==(null==r?void 0:r.type)&&r.range.collapsed&&(e.format.pendingFormat={format:(0,n.__assign)({},i),insertPoint:{node:r.range.startContainer,offset:r.range.startOffset}})}function l(e,t){return e.newEntities.map((function(e){return{entity:e,operation:"newEntity",rawEvent:t}})).concat(e.deletedEntities.map((function(e){return{entity:e.entity,operation:e.operation,rawEvent:t}})))}t.formatContentModel=function(e,t,r,n){var s,c=r||{},d=c.onNodeCreated,u=c.getChangeData,p=c.rawEvent,f=c.selectionOverride,m=c.scrollCaretIntoView,g=e.api.createContentModel(e,n,f),h={newEntities:[],deletedEntities:[],rawEvent:p,newImages:[]},v=e.domHelper.hasFocus(),y=t(g,h),b=h.skipUndoSnapshot,S=h.clearModelCache,C=h.entityStates,_=h.canUndoByBackspace;if(y){var E=e.undo.isNested,T=!b&&!E,k=void 0;T&&(e.undo.isNested=!0,e.api.addUndoSnapshot(e,!!_,C));try{!function(e,t){if(t.newImages.length>0){var r=e.domHelper.getClientWidth(),n=Math.max(r,10);t.newImages.forEach((function(e){e.format.maxWidth=n+"px"}))}}(e,h),k=null!==(s=e.api.setContentModel(e,g,v?void 0:{ignoreSelection:!0},d))&&void 0!==s?s:void 0,a(e,h,k),!m||"range"!=(null==k?void 0:k.type)&&"image"!=(null==k?void 0:k.type)||(0,i.scrollCaretIntoView)(e,k);var M={eventType:"contentChanged",contentModel:S?void 0:g,selection:S?void 0:k,source:(null==r?void 0:r.changeSource)||o.ChangeSource.Format,data:null==u?void 0:u(),formatApiName:null==r?void 0:r.apiName,changedEntities:l(h,p)};e.api.triggerEvent(e,M,!0),_&&"range"==(null==k?void 0:k.type)&&(e.undo.autoCompleteInsertPoint={node:k.range.startContainer,offset:k.range.startOffset}),T?e.api.addUndoSnapshot(e,!1,C):e.undo.snapshotsManager.hasNewContent=!0}finally{E||(e.undo.isNested=!1)}}else S&&(e.cache.cachedModel=void 0,e.cache.cachedSelection=void 0),a(e,h,e.api.getDOMSelection(e));h.announceData&&e.api.announce(e,h.announceData)}},2066:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scrollCaretIntoView=void 0;var n=r(4990);t.scrollCaretIntoView=function(e,t){var r=(0,n.getDOMInsertPointRect)(e.physicalRoot.ownerDocument,"image"==t.type?{node:t.image,offset:0}:t.isReverted?{node:t.range.startContainer,offset:t.range.startOffset}:{node:t.range.endContainer,offset:t.range.endOffset}),o=e.api.getVisibleViewport(e),i=e.domEvent.scrollContainer;if(r&&o)if(r.bottom>o.bottom){var a=e.domHelper.calculateZoomScale();i.scrollTop+=(r.bottom-o.bottom)/a}else r.top<o.top&&(a=e.domHelper.calculateZoomScale(),i.scrollTop+=(r.top-o.top)/a)}},5704:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDOMSelection=void 0,t.getDOMSelection=function(e){if(e.lifecycle.shadowEditFragment)return null;var t=e.selection.selection;return!t||"range"==t.type&&e.domHelper.hasFocus()?function(e){var t,r=null===(t=e.logicalRoot.ownerDocument.defaultView)||void 0===t?void 0:t.getSelection(),n=r&&r.rangeCount>0?r.getRangeAt(0):null;return r&&n&&e.logicalRoot.contains(n.commonAncestorContainer)?{type:"range",range:n,isReverted:r.focusNode!=n.endContainer||r.focusOffset!=n.endOffset}:null}(e):t}},3834:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVisibleViewport=void 0;var n=r(1635),o=r(4990);t.getVisibleViewport=function(e){var t=e.domEvent.scrollContainer;return function(e,t){void 0===t&&(t=[]);var r=e.map((function(e){return(0,o.normalizeRect)(e.getBoundingClientRect())})).concat(t).filter((function(e){return!!e})),i={top:Math.max.apply(Math,(0,n.__spreadArray)([],(0,n.__read)(r.map((function(e){return e.top}))),!1)),bottom:Math.min.apply(Math,(0,n.__spreadArray)([],(0,n.__read)(r.map((function(e){return e.bottom}))),!1)),left:Math.max.apply(Math,(0,n.__spreadArray)([],(0,n.__read)(r.map((function(e){return e.left}))),!1)),right:Math.min.apply(Math,(0,n.__spreadArray)([],(0,n.__read)(r.map((function(e){return e.right}))),!1))};return i.top<i.bottom&&i.left<i.right?i:null}(t==e.physicalRoot?[t]:[t,e.physicalRoot])}},3976:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPositionFromPath=void 0;var n=r(4990);t.getPositionFromPath=function(e,t){for(var r=0,o=0;o<t.length&&(r=t[o],o<t.length-1&&e&&(0,n.isNodeOfType)(e,"ELEMENT_NODE")&&e.childNodes.length>r);o++)e=e.childNodes[r];return{node:e,offset:r}}},9830:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.restoreSnapshotColors=void 0;var n=r(4990);t.restoreSnapshotColors=function(e,t){var r=e.lifecycle.isDarkMode;e.darkColorHandler.updateKnownColor(r),!!t.isDarkMode!=!!r&&(0,n.transformColor)(e.physicalRoot,!1,r?"lightToDark":"darkToLight",e.darkColorHandler)}},6691:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.restoreSnapshotHTML=void 0;var n=r(4990);function o(e,t){var r=null;return(0,n.isNodeOfType)(t,"ELEMENT_NODE")&&((0,n.isEntityElement)(t)?r=i(e,(0,n.parseEntityFormat)(t).id):(0,n.isBlockEntityContainer)(t)&&(r=function(e,t){for(var r,o=e.firstChild;o;o=o.nextSibling)if((0,n.isEntityElement)(o)&&(0,n.isNodeOfType)(o,"ELEMENT_NODE")){var a=null===(r=i(t,(0,n.parseEntityFormat)(o).id))||void 0===r?void 0:r.parentElement;return(0,n.isNodeOfType)(a,"ELEMENT_NODE")&&(0,n.isBlockEntityContainer)(a)?a:null}return null}(t,e))),r}function i(e,t){var r=t?e[t]:void 0;return(null==r?void 0:r.canPersist)?r.element:null}t.restoreSnapshotHTML=function(e,t){for(var r,i,a,l=e.physicalRoot,s=e.entity.entityMap,c=l.firstChild,d=(new DOMParser).parseFromString(null!==(i=null===(r=e.trustedHTMLHandler)||void 0===r?void 0:r.call(e,t.html))&&void 0!==i?i:t.html,"text/html").body.firstChild;d;){var u=d.nextSibling,p=o(s,d);p?c=(0,n.reuseCachedElement)(l,p,c):(l.insertBefore(d,c),(0,n.isNodeOfType)(d,"ELEMENT_NODE")&&(0,n.getAllEntityWrappers)(d).forEach((function(e){var t,r=o(s,e);if(r){if(r==c){var n=r.cloneNode();l.insertBefore(n,c),c=n}null===(t=e.parentNode)||void 0===t||t.replaceChild(r,e)}}))),d=u}for(;c;)u=c.nextSibling,null===(a=c.parentNode)||void 0===a||a.removeChild(c),c=u}},7419:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.restoreSnapshotLogicalRoot=void 0;var n=r(3976);t.restoreSnapshotLogicalRoot=function(e,t){if(t.logicalRootPath&&t.logicalRootPath.length>0){var r=(0,n.getPositionFromPath)(e.physicalRoot,t.logicalRootPath).node;r!==e.logicalRoot&&e.api.setLogicalRoot(e,r)}else e.api.setLogicalRoot(e,null)}},3466:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.restoreSnapshotSelection=void 0;var n=r(3976),o=r(4990);t.restoreSnapshotSelection=function(e,t){var r=t.selection,i=e.physicalRoot,a=null;try{if(r)switch(r.type){case"range":var l=(0,n.getPositionFromPath)(i,r.start),s=(0,n.getPositionFromPath)(i,r.end),c=i.ownerDocument.createRange();c.setStart(l.node,l.offset),c.setEnd(s.node,s.offset),a={type:"range",range:c,isReverted:r.isReverted};break;case"table":var d=i.querySelector((0,o.getSafeIdSelector)(r.tableId));d&&(a={type:"table",table:d,firstColumn:r.firstColumn,firstRow:r.firstRow,lastColumn:r.lastColumn,lastRow:r.lastRow});break;case"image":var u=i.querySelector((0,o.getSafeIdSelector)(r.imageId));u&&(a={type:"image",image:u})}a&&e.api.setDOMSelection(e,a)}catch(e){}}},7488:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.restoreUndoSnapshot=void 0;var n=r(4990),o=r(9830),i=r(6691),a=r(7419),l=r(3466);t.restoreUndoSnapshot=function(e,t){e.api.triggerEvent(e,{eventType:"beforeSetContent",newContent:t.html},!0);try{e.undo.isRestoring=!0,(0,i.restoreSnapshotHTML)(e,t),(0,a.restoreSnapshotLogicalRoot)(e,t),(0,l.restoreSnapshotSelection)(e,t),(0,o.restoreSnapshotColors)(e,t);var r={eventType:"contentChanged",entityStates:t.entityStates,source:n.ChangeSource.SetContent};e.api.triggerEvent(e,r,!1)}finally{e.undo.isRestoring=!1}}},3472:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setContentModel=void 0;var n=r(2994),o=r(4990);t.setContentModel=function(e,t,r,i){var a,l=e.api.createEditorContext(e,!0),s=r?(0,o.createModelToDomContext)(l,e.environment.modelToDomSettings.builtIn,e.environment.modelToDomSettings.customized,r):(0,o.createModelToDomContextWithConfig)(e.environment.modelToDomSettings.calculated,l);s.onNodeCreated=i;var c=(0,o.contentModelToDom)(e.logicalRoot.ownerDocument,e.logicalRoot,t,s);return e.lifecycle.shadowEditFragment||(null===(a=e.cache.textMutationObserver)||void 0===a||a.flushMutations(!0),(0,n.updateCache)(e.cache,t,c),!(null==r?void 0:r.ignoreSelection)&&c?e.api.setDOMSelection(e,c):e.selection.selection=c),c}},2407:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addRangeToSelection=void 0;var n=r(480);t.addRangeToSelection=function(e,t,r){var o;void 0===r&&(r=!1);var i=null===(o=e.defaultView)||void 0===o?void 0:o.getSelection();if(i){var a=i.rangeCount>0&&i.getRangeAt(0);if(a&&(0,n.areSameRanges)(a,t))return;i.removeAllRanges(),r?i.setBaseAndExtent(t.endContainer,t.endOffset,t.startContainer,t.startOffset):i.addRange(t)}}},3211:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findLastedCoInMergedCell=void 0,t.findLastedCoInMergedCell=function(e,t){for(var r,n,o,i,a=t.row,l=t.col;a>=0&&l>=0&&a<e.length&&l<(null!==(n=null===(r=e[a])||void 0===r?void 0:r.length)&&void 0!==n?n:0);){var s=null===(o=e[a])||void 0===o?void 0:o[l+1],c=null===(i=e[a+1])||void 0===i?void 0:i[l];if("spanLeft"==s||"spanBoth"==s)l++;else{if("spanTop"!=c&&"spanBoth"!=c)return{row:a,col:l};a++}}return null}},8079:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findTableCellElement=void 0,t.findTableCellElement=function(e,t){for(var r,n,o,i=t.row,a=t.col;i>=0&&a>=0&&i<e.length&&a<(null!==(n=null===(r=e[i])||void 0===r?void 0:r.length)&&void 0!==n?n:0);){var l=null===(o=e[i])||void 0===o?void 0:o[a];if(!l)break;if("object"==typeof l)return{cell:l,row:i,col:a};"spanLeft"==l||"spanBoth"==l?a--:i--}return null}},1616:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setDOMSelection=void 0;var n=r(2407),o=r(480),i=r(9212),a=r(3211),l=r(8079),s=r(4990),c="_DOMSelection",d="_DOMSelectionHideCursor",u="_DOMSelectionHideSelection";function p(e,t,r){var o;if(t&&e.contains(t)){var i=e.createRange(),a=void 0;if(i.selectNode(t),r)i.collapse();else{var l=null===(o=e.defaultView)||void 0===o?void 0:o.getSelection(),s=l&&l.rangeCount>0&&l.getRangeAt(0);l&&s&&(a=l.focusNode!=s.endContainer||l.focusOffset!=s.endOffset)}(0,n.addRangeToSelection)(e,i,a)}}t.setDOMSelection=function(e,t,r){var f,m,g,h=e.api.getDOMSelection(e);if(!(h&&t&&(0,o.areSameSelections)(h,t))){var v=e.selection.skipReselectOnFocus,y=e.physicalRoot.ownerDocument,b=e.lifecycle.isDarkMode;e.selection.skipReselectOnFocus=!0,e.api.setEditorStyle(e,c,null),e.api.setEditorStyle(e,d,null),e.api.setEditorStyle(e,u,null);try{switch(null==t?void 0:t.type){case"image":var S=t.image;e.selection.selection=t;var C=b?e.selection.imageSelectionBorderColorDark:e.selection.imageSelectionBorderColor;e.api.setEditorStyle(e,c,"outline-style:solid!important; outline-color:"+(C||"#DB626C")+"!important;",[(0,s.getSafeIdSelector)((0,i.ensureUniqueId)(S,"image"))]),e.api.setEditorStyle(e,u,"background-color: transparent !important;",["*::selection"]),p(y,S,!1);break;case"table":var _=t.table,E=t.firstColumn,T=t.firstRow,k=t.lastColumn,M=t.lastRow,O=(0,s.parseTableCells)(t.table),P={row:Math.min(T,M),col:Math.min(E,k),cell:null},w={row:Math.max(T,M),col:Math.max(E,k)};if(P=(0,l.findTableCellElement)(O,P)||P,w=(0,a.findLastedCoInMergedCell)(O,w)||w,isNaN(P.row)||isNaN(P.col)||isNaN(w.row)||isNaN(w.col))return;t={type:"table",table:_,firstRow:P.row,firstColumn:P.col,lastRow:w.row,lastColumn:w.col};var x=(0,i.ensureUniqueId)(_,"table"),D=(0,s.getSafeIdSelector)(x),L=0==P.row&&0==P.col&&w.row==O.length-1&&w.col==(null!==(m=null===(f=O[w.row])||void 0===f?void 0:f.length)&&void 0!==m?m:0)-1?[D,D+" *"]:function(e,t,r,n,o){var i=[],a=0,l=(0,s.toArray)(r.childNodes).filter((function(e){return["THEAD","TBODY","TFOOT"].indexOf((0,s.isNodeOfType)(e,"ELEMENT_NODE")?e.tagName:"")>-1})).map((function(e){var t={el:e.tagName,start:a,end:e.childNodes.length+a};return a=t.end,t}));return e.forEach((function(e,r){for(var a=0,s=l.filter((function(e){return e.start<=r&&e.end>r}))[0],c=s?">"+s.el+">":">",d=s&&r+1>=s.start?r+1-s.start:r+1,u=0;u<e.length;u++){var p=e[u];if("object"==typeof p&&(a++,r>=n.row&&r<=o.row&&u>=n.col&&u<=o.col)){var f=""+t+c+" tr:nth-child("+d+")>"+p.tagName+":nth-child("+a+")";i.push(f,f+" *")}}})),i}(O,D,_,P,w);e.selection.selection=t;var I=b?e.selection.tableCellSelectionBackgroundColorDark:e.selection.tableCellSelectionBackgroundColor;e.api.setEditorStyle(e,c,"background-color:"+I+"!important;",L),e.api.setEditorStyle(e,d,"caret-color: transparent");var F=(null===(g=P.cell)||void 0===g?void 0:g.firstElementChild)||P.cell;F&&p(y,F||void 0,!0);break;case"range":(0,n.addRangeToSelection)(y,t.range,t.isReverted),e.selection.selection=e.domHelper.hasFocus()?null:t;break;default:e.selection.selection=null}}finally{e.selection.skipReselectOnFocus=v}if(!r){var R={eventType:"selectionChanged",newSelection:t};e.api.triggerEvent(e,R,!0)}}}},9212:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ensureUniqueId=void 0;var n=r(4990);t.ensureUniqueId=function(e,t){t=e.id||t;for(var r=e.ownerDocument,o=0;!e.id||r.querySelectorAll((0,n.getSafeIdSelector)(e.id)).length>1;)e.id=t+"_"+o++;return e.id}},2830:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setEditorStyle=void 0;var n=r(9212),o=r(4990);t.setEditorStyle=function(e,t,r,i,a){void 0===a&&(a=9e3);var l=e.lifecycle.styleElements[t];if(!l&&r){var s=e.physicalRoot.ownerDocument;l=s.createElement("style"),s.head.appendChild(l),l.dataset.roosterjsStyleKey=t,e.lifecycle.styleElements[t]=l}var c=null==l?void 0:l.sheet;if(c){for(var d=c.cssRules.length-1;d>=0;d--)c.deleteRule(d);if(r){var u=(0,o.getSafeIdSelector)((0,n.ensureUniqueId)(e.physicalRoot,"contentDiv")),p=i?"string"==typeof i?[u+"::"+i]:function(e,t,r){var n=[],o=[],i=0;return t.forEach((function(t){i>=r&&(n.push(o.join(",")),o=[],i=0);var a=e+" "+t;i+=a.length+1,o.push(a)})),n.push(o.join(",")),n}(u,i,a-r.length-3):[u];p.forEach((function(e){c.insertRule(e+" {"+r+"}")}))}}}},7832:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setLogicalRoot=void 0,t.setLogicalRoot=function(e,t){if(t&&!e.physicalRoot.contains(t))return null;if(t||(t=e.physicalRoot),t!==e.logicalRoot){e.logicalRoot.contentEditable="false",t.contentEditable="true",e.logicalRoot=t,e.selection.selection=null,e.cache.cachedModel=void 0,e.cache.cachedSelection=void 0;var r={eventType:"logicalRootChanged",logicalRoot:t};e.api.triggerEvent(e,r,!1)}}},6558:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchShadowEdit=void 0;var n=r(4990);t.switchShadowEdit=function(e,t){var r=e;if(t!=!!r.lifecycle.shadowEditFragment)if(t){var o=r.cache.cachedModel?null:r.api.createContentModel(r),i=r.logicalRoot.ownerDocument.createDocumentFragment(),a=r.logicalRoot.cloneNode(!0);(0,n.moveChildNodes)(i,a),r.api.triggerEvent(r,{eventType:"enteredShadowEdit"},!1),!r.cache.cachedModel&&o&&(r.cache.cachedModel=o),r.lifecycle.shadowEditFragment=i}else r.lifecycle.shadowEditFragment=null,r.api.triggerEvent(r,{eventType:"leavingShadowEdit"},!1),r.cache.cachedModel&&((0,n.iterateSelections)(r.cache.cachedModel,(function(){})),r.api.setContentModel(r,r.cache.cachedModel,{ignoreSelection:!0}))}},4486:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.triggerEvent=void 0;var r=["editorReady","beforeDispose","extractContentWithDom","zoomChanged"];t.triggerEvent=function(e,t,n){e.lifecycle.shadowEditFragment&&!(r.indexOf(t.eventType)>=0)||!n&&e.plugins.some((function(e){return function(e,t){var r;return!(!t.onPluginEvent||!(null===(r=t.willHandleEventExclusively)||void 0===r?void 0:r.call(t,e)))&&(t.onPluginEvent(e),!0)}(t,e)}))||e.plugins.forEach((function(e){e.onPluginEvent&&e.onPluginEvent(t)}))}},7014:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCachePlugin=void 0;var n=r(480),o=r(9213),i=r(9826),a=r(2994),l=function(){function e(e,t){var r=this;this.editor=null,this.onMutation=function(e){var t,n;if(r.editor)switch(e.type){case"childList":(null===(t=r.state.domIndexer)||void 0===t?void 0:t.reconcileChildList(e.addedNodes,e.removedNodes))||r.invalidateCache();break;case"text":r.updateCachedModel(r.editor,!0);break;case"elementId":var o=e.element;(null===(n=r.state.domIndexer)||void 0===n?void 0:n.reconcileElementId(o))||r.invalidateCache();break;case"unknown":r.invalidateCache()}},this.onNativeSelectionChange=function(){var e;(null===(e=r.editor)||void 0===e?void 0:e.hasFocus())&&r.updateCachedModel(r.editor)},this.state=e.disableCache?{}:{domIndexer:new i.DomIndexerImpl(e.experimentalFeatures&&e.experimentalFeatures.indexOf("PersistCache")>=0),textMutationObserver:(0,o.createTextMutationObserver)(t,this.onMutation)}}return e.prototype.getName=function(){return"Cache"},e.prototype.initialize=function(e){var t;this.editor=e,this.editor.getDocument().addEventListener("selectionchange",this.onNativeSelectionChange),null===(t=this.state.textMutationObserver)||void 0===t||t.startObserving()},e.prototype.dispose=function(){var e;null===(e=this.state.textMutationObserver)||void 0===e||e.stopObserving(),this.editor&&(this.editor.getDocument().removeEventListener("selectionchange",this.onNativeSelectionChange),this.editor=null)},e.prototype.getState=function(){return this.state},e.prototype.onPluginEvent=function(e){if(this.editor)switch(e.eventType){case"logicalRootChanged":this.invalidateCache(),this.state.textMutationObserver&&(this.state.textMutationObserver.stopObserving(),this.state.textMutationObserver=(0,o.createTextMutationObserver)(e.logicalRoot,this.onMutation),this.state.textMutationObserver.startObserving());break;case"keyDown":case"input":this.state.textMutationObserver||this.invalidateCache();break;case"selectionChanged":this.updateCachedModel(this.editor);break;case"contentChanged":var t=e.contentModel,r=e.selection;t&&this.state.domIndexer?(0,a.updateCache)(this.state,t,r):this.invalidateCache()}},e.prototype.invalidateCache=function(){var e;(null===(e=this.editor)||void 0===e?void 0:e.isInShadowEdit())||(this.state.cachedModel=void 0,this.state.cachedSelection=void 0)},e.prototype.updateCachedModel=function(e,t){var r;if(!e.isInShadowEdit()){var o=this.state.cachedSelection;this.state.cachedSelection=void 0;var i=e.getDOMSelection()||void 0,l=this.state.cachedModel;!t&&o&&i&&(0,n.areSameSelections)(i,o)?this.state.cachedSelection=o:l&&i&&(null===(r=this.state.domIndexer)||void 0===r?void 0:r.reconcileSelection(l,i,o))?(0,a.updateCache)(this.state,l,i):this.invalidateCache()}},e}();t.createCachePlugin=function(e,t){return new l(e,t)}},480:(e,t)=>{"use strict";function r(e,t,r){return r.every((function(r){return e[r]==t[r]}))}Object.defineProperty(t,"__esModule",{value:!0}),t.areSameRanges=t.areSameTableSelections=t.areSameSelections=void 0,t.areSameSelections=function(e,t){if(e==t)return!0;switch(e.type){case"image":return"image"==t.type&&t.image==e.image;case"table":return"table"==t.type&&i(e,t);default:if("range"==t.type){var r=e.range;if(t.start){var n=t.start,o=t.end;return r.startContainer==n.node&&r.endContainer==o.node&&r.startOffset==n.offset&&r.endOffset==o.offset}return a(r,t.range)}return!1}};var n=["table","firstColumn","lastColumn","firstRow","lastRow"],o=["startContainer","endContainer","startOffset","endOffset"];function i(e,t){return r(e,t,n)}function a(e,t){return r(e,t,o)}t.areSameTableSelections=i,t.areSameRanges=a},9826:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DomIndexerImpl=void 0;var n=r(1635),o=r(4990);function i(e){var t,r=null!==(t=e.__roosterjsContentModel)&&void 0!==t?t:{},n=r.paragraph,o=r.segments;return n&&"Paragraph"==n.blockType&&Array.isArray(n.segments)&&Array.isArray(o)}function a(e){return e&&i(e)?e.__roosterjsContentModel:null}function l(e){var t=e.__roosterjsContentModel,r=null==t?void 0:t.table;return"Table"==(null==r?void 0:r.blockType)&&Array.isArray(r.rows)&&r.rows.every((function(e){return Array.isArray(null==e?void 0:e.cells)&&e.cells.every((function(e){return"TableCell"==(null==e?void 0:e.blockGroupType)}))}))?t:null}var s=function(){function e(e){this.persistCache=e}return e.prototype.onSegment=function(e,t,r){e.__roosterjsContentModel={paragraph:t,segments:r}},e.prototype.onParagraph=function(e){for(var t=null,r=e.firstChild;r;r=r.nextSibling)if((0,o.isNodeOfType)(r,"TEXT_NODE"))if(t){var n=a(t);n&&i(r)&&(n.segments=n.segments.concat(r.__roosterjsContentModel.segments),r.__roosterjsContentModel.segments=[])}else t=r;else(0,o.isNodeOfType)(r,"ELEMENT_NODE")?(t=null,this.onParagraph(r)):t=null},e.prototype.onTable=function(e,t){e.__roosterjsContentModel={table:t}},e.prototype.onBlockEntity=function(e,t){this.onBlockEntityDelimiter(e.wrapper.previousSibling,e,t),this.onBlockEntityDelimiter(e.wrapper.nextSibling,e,t)},e.prototype.reconcileSelection=function(e,t,r){var n,s;switch(r&&("range"==r.type&&this.isCollapsed(r)&&(0,o.isNodeOfType)(r.start.node,"TEXT_NODE")&&i(r.start.node)?this.reconcileTextSelection(r.start.node):(0,o.setSelection)(e)),t.type){case"image":var c=a(t.image),d=null==c?void 0:c.segments[0];return!!d&&(d.isSelected=!0,(0,o.setSelection)(e,d),!0);case"table":var u=l(t.table);if(u){var p=null===(n=u.table.rows[t.firstRow])||void 0===n?void 0:n.cells[t.firstColumn],f=null===(s=u.table.rows[t.lastRow])||void 0===s?void 0:s.cells[t.lastColumn];if(p&&f)return(0,o.setSelection)(e,p,f),!0}return!1;case"range":var m=t.range;if(m){var g=m.startContainer,h=m.startOffset,v=m.endContainer,y=m.endOffset,b=m.collapsed;if(delete e.hasRevertedRangeSelection,b)return!!this.reconcileNodeSelection(g,h,e.format);if(g==v&&(0,o.isNodeOfType)(g,"TEXT_NODE"))return t.isReverted&&(e.hasRevertedRangeSelection=!0),i(g)&&!!this.reconcileTextSelection(g,h,y);var S=this.reconcileNodeSelection(g,h),C=this.reconcileNodeSelection(v,y);return!(!S||!C||(t.isReverted&&(e.hasRevertedRangeSelection=!0),(0,o.setSelection)(e,S,C),0))}}return!1},e.prototype.reconcileChildList=function(e,t){if(!this.persistCache)return!1;var r=!0,n={segIndex:-1},i=e[0];1==e.length&&(0,o.isNodeOfType)(i,"TEXT_NODE")?r=this.reconcileAddedNode(i,n):e.length>0&&(r=!1);var a=t[0];return r&&1==t.length?r=this.reconcileRemovedNode(a,n):t.length>0&&(r=!1),r&&!n.pendingTextNode},e.prototype.reconcileElementId=function(e){var t;if((0,o.isElementOfType)(e,"img")){var r=a(e);return"Image"==(null===(t=null==r?void 0:r.segments[0])||void 0===t?void 0:t.segmentType)&&(r.segments[0].format.id=e.id,!0)}if((0,o.isElementOfType)(e,"table")){var n=l(e);return!!n&&(n.table.format.id=e.id,!0)}return!1},e.prototype.onBlockEntityDelimiter=function(e,t,r){(0,o.isNodeOfType)(e,"ELEMENT_NODE")&&(0,o.isEntityDelimiter)(e)&&e.firstChild&&(e.firstChild.__roosterjsContentModel={entity:t,parent:r})},e.prototype.isCollapsed=function(e){var t=e.start,r=e.end;return t.node==r.node&&t.offset==r.offset},e.prototype.reconcileNodeSelection=function(e,t,r){return(0,o.isNodeOfType)(e,"TEXT_NODE")?i(e)?this.reconcileTextSelection(e,t):function(e){var t,r=null!==(t=e.__roosterjsContentModel)&&void 0!==t?t:{},n=r.entity,o=r.parent;return"Entity"==(null==n?void 0:n.blockType)&&n.wrapper&&(null==o?void 0:o.blockGroupType)&&Array.isArray(o.blocks)}(e)?this.reconcileDelimiterSelection(e,r):void 0:t>=e.childNodes.length?this.insertMarker(e.lastChild,!0):this.insertMarker(e.childNodes[t],!1)},e.prototype.insertMarker=function(e,t){var r,n=e&&a(e);if(n){var i=n.paragraph,l=n.segments,s=i.segments.indexOf(l[0]);if(s>=0){var c=!t&&i.segments[s-1]||i.segments[s];r=(0,o.createSelectionMarker)(c.format),i.segments.splice(t?s+1:s,0,r)}}return r},e.prototype.reconcileTextSelection=function(e,t,r){var i,a,l,s,c=e.__roosterjsContentModel,d=c.paragraph,u=c.segments,p=u[0],f=u[u.length-1];if("Text"==(null==p?void 0:p.segmentType)&&"Text"==(null==f?void 0:f.segmentType)){var m=[],g=e.nodeValue||"",h=[];if(void 0===t)p.text=g,m.push(p),h.push(p);else{if(t>0&&(p.text=g.substring(0,t),m.push(p),h.push(p)),void 0===r){var v=(0,o.createSelectionMarker)(p.format);m.push(v),t<(null!==(a=e.nodeValue)&&void 0!==a?a:"").length&&(p.link&&(0,o.addLink)(v,p.link),p.code&&(0,o.addCode)(v,p.code)),s=v,r=t}else if(r>t){var y=(0,o.createText)(g.substring(t,r),p.format,p.link,p.code);y.isSelected=!0,m.push(y),h.push(y),s=y}if(r<g.length){var b=(0,o.createText)(g.substring(r),p.format,p.link,p.code);m.push(b),h.push(b)}}var S=d.segments.indexOf(p),C=d.segments.indexOf(f);if(S>=0&&C>=0){for(;S>0&&"SelectionMarker"==d.segments[S-1].segmentType;)S--;for(;C<d.segments.length-1&&"SelectionMarker"==d.segments[C+1].segmentType;)C++;(i=d.segments).splice.apply(i,(0,n.__spreadArray)([S,C-S+1],(0,n.__read)(m),!1))}this.onSegment(e,d,h),this.persistCache||delete d.cachedElement}else if("Entity"==(null==p?void 0:p.segmentType)&&p==f){var _=p.wrapper,E=d.segments.indexOf(p),T=e.parentElement,k=_.previousSibling==T,M=_.nextSibling==T;E>=0&&T&&(0,o.isEntityDelimiter)(T)&&(k||M)&&(v=(0,o.createSelectionMarker)((null!==(l=d.segments[M?E+1:E-1])&&void 0!==l?l:p).format),d.segments.splice(M?E+1:E,0,v),s=v)}return s},e.prototype.reconcileDelimiterSelection=function(e,t){var r,n=e.__roosterjsContentModel,i=n.entity,a=n.parent,l=a.blocks.indexOf(i),s=e.parentElement,c=i.wrapper,d=c.previousSibling==s,u=c.nextSibling==s;if(l>=0&&s&&(0,o.isEntityDelimiter)(s)&&(d||u)){r=(0,o.createSelectionMarker)(t);var p=(0,o.createParagraph)(!0,void 0,t);p.segments.push(r),a.blocks.splice(d?l:l+1,0,p)}return r},e.prototype.reconcileAddedNode=function(e,t){var r,n=null,o=-1,i=e.previousSibling,l=e.nextSibling;if((n=a(i))&&(r=n.segments[n.segments.length-1])&&(o=n.paragraph.segments.indexOf(r))>=0)this.indexNode(n.paragraph,o+1,e,r.format);else if((n=a(l))&&(r=n.segments[0])&&(o=n.paragraph.segments.indexOf(r))>=0)this.indexNode(n.paragraph,o,e,r.format);else if(t.paragraph&&t.segIndex>=0)this.indexNode(t.paragraph,t.segIndex,e,t.format);else{if(void 0!==t.pendingTextNode)return!1;t.pendingTextNode=e}return!0},e.prototype.reconcileRemovedNode=function(e,t){var r,n=null;if(t.segIndex<0&&!t.paragraph&&(n=a(e))&&(r=n.segments[0])){if(t.format=r.format,t.paragraph=n.paragraph,t.segIndex=n.paragraph.segments.indexOf(n.segments[0]),t.segIndex<0)return!1;for(var o=0;o<n.segments.length;o++){var i=n.paragraph.segments.indexOf(n.segments[o]);i>=0&&n.paragraph.segments.splice(i,1)}return t.pendingTextNode&&(this.indexNode(t.paragraph,t.segIndex,t.pendingTextNode,n.segments[0].format),t.pendingTextNode=null),!0}return!1},e.prototype.indexNode=function(e,t,r,i){var a,l=i?(0,n.__assign)({},i):void 0;l&&(0,o.getObjectKeys)(l).forEach((function(e){void 0===o.EmptySegmentFormat[e]&&delete l[e]}));var s=(0,o.createText)(null!==(a=r.textContent)&&void 0!==a?a:"",l);e.segments.splice(t,0,s),this.onSegment(r,e,[s])},e}();t.DomIndexerImpl=s},9213:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTextMutationObserver=void 0;var n=r(2233),o=r(4990),i=function(){function e(e,t){var r=this;this.contentDiv=e,this.onMutation=t,this.onMutationInternal=function(e){for(var t=!0,n=null,i=null,a=[],l=[],s=!1,c=new Set,d=new Set,u=0;u<e.length&&t;u++){var p=e[u],f=p.target;if(!c.has(f)){if(!d.has(f)){if((0,o.findClosestEntityWrapper)(f,r.domHelper)||(0,o.findClosestBlockEntityContainer)(f,r.domHelper)){c.add(f);continue}d.add(f)}switch(p.type){case"attributes":r.domHelper.isNodeInEditor(f,!0)&&("id"==p.attributeName&&(0,o.isNodeOfType)(f,"ELEMENT_NODE")?r.onMutation({type:"elementId",element:f}):t=!1);break;case"characterData":i&&i!=p.target?t=!1:(i=p.target,s=!0);break;case"childList":n?n!=p.target&&(t=!1):n=p.target,t&&(a=a.concat(Array.from(p.addedNodes)),l=l.concat(Array.from(p.removedNodes)))}}}t?((a.length>0||l.length>0)&&r.onMutation({type:"childList",addedNodes:a,removedNodes:l}),s&&r.onMutation({type:"text"})):r.onMutation({type:"unknown"})},this.observer=new MutationObserver(this.onMutationInternal),this.domHelper=(0,n.createDOMHelper)(e)}return e.prototype.startObserving=function(){this.observer.observe(this.contentDiv,{subtree:!0,childList:!0,attributes:!0,characterData:!0})},e.prototype.stopObserving=function(){this.observer.disconnect()},e.prototype.flushMutations=function(e){var t=this.observer.takeRecords();e||this.onMutationInternal(t)},e}();t.createTextMutationObserver=function(e,t){return new i(e,t)}},2994:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateCache=void 0,t.updateCache=function(e,t,r){if(e.cachedModel=t,"range"==(null==r?void 0:r.type)){var n=r.range,o=n.startContainer,i=n.startOffset,a=n.endContainer,l=n.endOffset,s=r.isReverted;e.cachedSelection={type:"range",isReverted:s,start:{node:o,offset:i},end:{node:a,offset:l}}}else e.cachedSelection=null!=r?r:void 0}},1330:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createContextMenuPlugin=void 0;var n=r(1635),o=r(4990),i=function(){function e(e){var t,r=this;this.editor=null,this.disposer=null,this.onContextMenuEvent=function(e){var t;if(r.editor){var o=[],i=e,a=2==i.button?i.target:r.getFocusedNode(r.editor);a&&r.state.contextMenuProviders.forEach((function(e){var t,r=null!==(t=e.getContextMenuItems(a))&&void 0!==t?t:[];(null==r?void 0:r.length)>0&&(o.length>0&&o.push(null),o.push.apply(o,(0,n.__spreadArray)([],(0,n.__read)(r),!1)))})),null===(t=r.editor)||void 0===t||t.triggerEvent("contextMenu",{rawEvent:i,items:o})}},this.state={contextMenuProviders:(null===(t=e.plugins)||void 0===t?void 0:t.filter(a))||[]}}return e.prototype.getName=function(){return"ContextMenu"},e.prototype.initialize=function(e){this.editor=e,this.disposer=this.editor.attachDomEvent({contextmenu:{beforeDispatch:this.onContextMenuEvent}})},e.prototype.dispose=function(){var e;null===(e=this.disposer)||void 0===e||e.call(this),this.disposer=null,this.editor=null},e.prototype.getState=function(){return this.state},e.prototype.getFocusedNode=function(e){var t=e.getDOMSelection();return t?("range"==t.type&&t.range.collapse(!0),(0,o.getSelectionRootNode)(t)||null):null},e}();function a(e){var t;return!!(null===(t=e)||void 0===t?void 0:t.getContextMenuItems)}t.createContextMenuPlugin=function(e){return new i(e)}},6818:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCopyPastePlugin=t.preprocessTable=t.onNodeCreated=t.adjustSelectionForCopyCut=void 0;var n=r(1635),o=r(2407),i=r(3800),a=r(5831),l=r(8219),s=r(292),c=r(4990),d=function(){function e(e){var t=this;this.editor=null,this.disposer=null,this.onPaste=function(e){if(t.editor&&function(e){return!!e.clipboardData}(e)){var r=t.editor,n=e.clipboardData;(null==n?void 0:n.items)&&(e.preventDefault(),(0,c.extractClipboardItems)((0,c.toArray)(n.items),t.state.allowedCustomPasteType).then((function(e){r.isDisposed()||(0,s.paste)(r,e,t.state.defaultPasteType)})))}},this.state={allowedCustomPasteType:e.allowedCustomPasteType||[],tempDiv:null,defaultPasteType:e.defaultPasteType}}return e.prototype.getName=function(){return"CopyPaste"},e.prototype.initialize=function(e){var t=this;this.editor=e,this.disposer=this.editor.attachDomEvent({paste:{beforeDispatch:function(e){return t.onPaste(e)}},copy:{beforeDispatch:function(e){return t.onCutCopy(e,!1)}},cut:{beforeDispatch:function(e){return t.onCutCopy(e,!0)}}})},e.prototype.dispose=function(){var e;this.state.tempDiv&&(null===(e=this.state.tempDiv.parentNode)||void 0===e||e.removeChild(this.state.tempDiv),this.state.tempDiv=null),this.disposer&&this.disposer(),this.disposer=null,this.editor=null},e.prototype.getState=function(){return this.state},e.prototype.onCutCopy=function(e,r){var n,l=this;if(this.editor){var s=this.editor.getDocument(),d=this.editor.getDOMSelection();if((0,i.adjustImageSelectionOnSafari)(this.editor,d),d&&("range"!=d.type||!d.range.collapsed)){var m=this.editor.getContentModelCopy("disconnected");"table"===d.type?(0,c.iterateSelections)(m,(function(e,t){return!!(null==t?void 0:t.table)&&(f(t.table),!0)})):"range"===d.type&&u(m);var g=this.getTempDiv(this.editor.getDocument()),h=(0,c.createModelToDomContext)();h.onNodeCreated=t.onNodeCreated;var v=(0,c.contentModelToDom)(g.ownerDocument,g,m,h),y=v?function(e,t){var r,n=null;if("table"===t.type){var o=t.table,i=1==(null===(r=o.parentElement)||void 0===r?void 0:r.childElementCount)?o.parentElement:o;(n=e.createRange()).selectNode(i)}else"image"===t.type?(n=e.createRange()).selectNode(t.image):n=t.range;return n}(s,v):null;y?((y=this.editor.triggerEvent("beforeCutCopy",{clonedRoot:g,range:y,rawEvent:e,isCut:r}).range)&&(0,o.addRangeToSelection)(s,y),null===(n=s.defaultView)||void 0===n||n.requestAnimationFrame((function(){l.editor&&(p(g),l.editor.setDOMSelection(d),l.editor.focus(),r&&l.editor.formatContentModel((function(e,t){return"range"==(0,c.deleteSelection)(e,[a.deleteEmptyList],t).deleteResult&&(0,c.normalizeContentModel)(e),!0}),{apiName:"cut",changeSource:c.ChangeSource.Cut}))}))):p(g)}}},e.prototype.getTempDiv=function(e){if(!this.state.tempDiv){var t=e.createElement("div");t.style.width="600px",t.style.height="1px",t.style.overflow="hidden",t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.userSelect="text",t.contentEditable="true",e.body.appendChild(t),this.state.tempDiv=t}var r=this.state.tempDiv;return r.style.backgroundColor="white",r.style.color="black",r.childNodes.forEach((function(e){return r.removeChild(e)})),r.style.display="",r.id="roosterJS_copyCutTempDiv",r.focus(),r},e}();function u(e){var t,r,n;(0,c.iterateSelections)(e,(function(e,o,i,a){if(t)return o!=n&&(null==r?void 0:r.segments.includes(t))&&r.segments.splice(r.segments.indexOf(t),1),!0;var l=null==a?void 0:a.find((function(e){return"SelectionMarker"==e.segmentType}));return!t&&l&&(n=o,r="Paragraph"==(null==i?void 0:i.blockType)?i:void 0,t=l),!1}))}function p(e){e.style.backgroundColor="",e.style.color="",e.style.display="none",(0,c.moveChildNodes)(e)}function f(e){var t=(0,c.getSelectedCells)(e);e.rows=e.rows.map((function(e){return(0,n.__assign)((0,n.__assign)({},e),{cells:e.cells.filter((function(e){return e.isSelected}))})})).filter((function(e){return e.cells.length>0})),delete e.format.width,e.widths=t?e.widths.filter((function(e,r){return r>=(null==t?void 0:t.firstColumn)&&r<=(null==t?void 0:t.lastColumn)})):[]}t.adjustSelectionForCopyCut=u,t.onNodeCreated=function(e,t){(0,c.isNodeOfType)(t,"ELEMENT_NODE")&&(0,c.isElementOfType)(t,"table")&&(0,c.wrap)(t.ownerDocument,t,"div"),(0,c.isNodeOfType)(t,"ELEMENT_NODE")&&!t.isContentEditable&&t.removeAttribute("contenteditable"),(0,l.onCreateCopyEntityNode)(e,t)},t.preprocessTable=f,t.createCopyPastePlugin=function(e){return new d(e)}},3800:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.adjustImageSelectionOnSafari=void 0,t.adjustImageSelectionOnSafari=function(e,t){if(e.getEnvironment().isSafari&&"image"==(null==t?void 0:t.type)){var r=new Range;r.setStartBefore(t.image),r.setEndAfter(t.image),e.setDOMSelection({range:r,type:"range",isReverted:!1})}}},5831:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteEmptyList=void 0;var n=r(4990);function o(e){return e&&"Paragraph"==e.blockType?e.segments.every((function(e){return"SelectionMarker"!==e.segmentType&&"Br"==e.segmentType})):e&&"BlockGroup"==e.blockType?e.blocks.every(o):!!e}t.deleteEmptyList=function(e){var t=e.insertPoint;if("range"==e.deleteResult&&(null==t?void 0:t.path)){var r=(0,n.getClosestAncestorBlockGroupIndex)(t.path,["ListItem"],["TableCell"]),i=t.path[r];if(r>=0&&i&&"ListItem"==i.blockGroupType){var a=t.path[r+1].blocks.indexOf(i),l=a>-1?t.path[r+1].blocks[a-1]:void 0,s=a>-1?t.path[r+1].blocks[a+1]:void 0;(0,n.hasSelectionInBlockGroup)(i)&&(!l||(0,n.hasSelectionInBlock)(l))&&s&&o(s)&&((0,n.mutateBlock)(i).levels=[])}}}},4732:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEditorCorePlugins=void 0;var n=r(7014),o=r(1330),i=r(6818),a=r(4348),l=r(1858),s=r(6314),c=r(8118),d=r(8226),u=r(8656);t.createEditorCorePlugins=function(e,t){return{cache:(0,n.createCachePlugin)(e,t),format:(0,s.createFormatPlugin)(e),copyPaste:(0,i.createCopyPastePlugin)(e),domEvent:(0,a.createDOMEventPlugin)(e,t),lifecycle:(0,c.createLifecyclePlugin)(e,t),entity:(0,l.createEntityPlugin)(),selection:(0,d.createSelectionPlugin)(e),contextMenu:(0,o.createContextMenuPlugin)(e),undo:(0,u.createUndoPlugin)(e)}}},4348:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDOMEventPlugin=void 0;var n=r(4990),o={keydown:"keyDown",keyup:"keyUp",keypress:"keyPress"},i=function(){function e(e,t){var r=this;this.editor=null,this.disposer=null,this.onDragStart=function(e){var t=e,r=t.target,o=(0,n.isNodeOfType)(r,"ELEMENT_NODE")?r:r.parentElement;o&&!o.isContentEditable&&t.preventDefault()},this.onDrop=function(){var e,t,o=null===(e=r.editor)||void 0===e?void 0:e.getDocument();null===(t=null==o?void 0:o.defaultView)||void 0===t||t.requestAnimationFrame((function(){r.editor&&(r.editor.takeSnapshot(),r.editor.triggerEvent("contentChanged",{source:n.ChangeSource.Drop}))}))},this.onScroll=function(e){var t;null===(t=r.editor)||void 0===t||t.triggerEvent("scroll",{rawEvent:e,scrollContainer:r.state.scrollContainer})},this.keyboardEventHandler={beforeDispatch:function(e){var t=o[e.type];((0,n.isCharacterValue)(e)||(0,n.isCursorMovingKey)(e))&&e.stopPropagation(),r.editor&&t&&!e.isComposing&&!r.state.isInIME&&r.editor.triggerEvent(t,{rawEvent:e})}},this.inputEventHandler={beforeDispatch:function(e){e.stopPropagation(),!r.editor||e.isComposing||r.state.isInIME||r.editor.triggerEvent("input",{rawEvent:e})}},this.onMouseDown=function(e){r.editor&&(r.state.mouseUpEventListerAdded||(r.editor.getDocument().addEventListener("mouseup",r.onMouseUp,!0),r.state.mouseUpEventListerAdded=!0,r.state.mouseDownX=e.pageX,r.state.mouseDownY=e.pageY),r.editor.triggerEvent("mouseDown",{rawEvent:e}))},this.onMouseUp=function(e){r.editor&&(r.removeMouseUpEventListener(),r.editor.triggerEvent("mouseUp",{rawEvent:e,isClicking:r.state.mouseDownX==e.pageX&&r.state.mouseDownY==e.pageY}))},this.onCompositionStart=function(){r.state.isInIME=!0},this.onCompositionEnd=function(e){var t;r.state.isInIME=!1,null===(t=r.editor)||void 0===t||t.triggerEvent("compositionEnd",{rawEvent:e})},this.state={isInIME:!1,scrollContainer:e.scrollContainer||t,mouseDownX:null,mouseDownY:null,mouseUpEventListerAdded:!1}}return e.prototype.getName=function(){return"DOMEvent"},e.prototype.initialize=function(e){var t,r;this.editor=e;var n=this.editor.getDocument(),o={keypress:this.keyboardEventHandler,keydown:this.keyboardEventHandler,keyup:this.keyboardEventHandler,input:this.inputEventHandler,mousedown:{beforeDispatch:this.onMouseDown},compositionstart:{beforeDispatch:this.onCompositionStart},compositionend:{beforeDispatch:this.onCompositionEnd},dragstart:{beforeDispatch:this.onDragStart},drop:{beforeDispatch:this.onDrop}};this.disposer=this.editor.attachDomEvent(o),this.state.scrollContainer.addEventListener("scroll",this.onScroll),null===(t=n.defaultView)||void 0===t||t.addEventListener("scroll",this.onScroll),null===(r=n.defaultView)||void 0===r||r.addEventListener("resize",this.onScroll)},e.prototype.dispose=function(){var e,t,r,n;this.removeMouseUpEventListener();var o=null===(e=this.editor)||void 0===e?void 0:e.getDocument();null===(t=null==o?void 0:o.defaultView)||void 0===t||t.removeEventListener("resize",this.onScroll),null===(r=null==o?void 0:o.defaultView)||void 0===r||r.removeEventListener("scroll",this.onScroll),this.state.scrollContainer.removeEventListener("scroll",this.onScroll),null===(n=this.disposer)||void 0===n||n.call(this),this.disposer=null,this.editor=null},e.prototype.getState=function(){return this.state},e.prototype.removeMouseUpEventListener=function(){this.editor&&this.state.mouseUpEventListerAdded&&(this.state.mouseUpEventListerAdded=!1,this.editor.getDocument().removeEventListener("mouseup",this.onMouseUp,!0))},e}();t.createDOMEventPlugin=function(e,t){return new i(e,t)}},1858:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEntityPlugin=void 0;var n=r(9677),o=r(4990),i=r(9531),a=/_(\d{1,8})$/,l=function(){function e(){this.editor=null,this.state={entityMap:{}}}return e.prototype.getName=function(){return"Entity"},e.prototype.initialize=function(e){this.editor=e},e.prototype.dispose=function(){this.editor=null,this.state.entityMap={}},e.prototype.getState=function(){return this.state},e.prototype.onPluginEvent=function(e){if(this.editor)switch(e.eventType){case"mouseUp":this.handleMouseUpEvent(this.editor,e);break;case"contentChanged":this.handleContentChangedEvent(this.editor,e);break;case"keyDown":(0,i.handleDelimiterKeyDownEvent)(this.editor,e);break;case"compositionEnd":(0,i.handleCompositionEndEvent)(this.editor,e);break;case"editorReady":this.handleContentChangedEvent(this.editor);break;case"extractContentWithDom":this.handleExtractContentWithDomEvent(this.editor,e.clonedRoot)}},e.prototype.handleMouseUpEvent=function(e,t){var r=t.rawEvent,n=t.isClicking,i=r.target;if(n&&this.editor)for(;i&&this.editor.getDOMHelper().isNodeInEditor(i);){if((0,o.isEntityElement)(i)){this.triggerEvent(e,i,"click",r);break}i=i.parentNode}},e.prototype.handleContentChangedEvent=function(e,t){var r,n=this,a=null!==(r=null==t?void 0:t.changedEntities)&&void 0!==r?r:this.getChangedEntities(e),l=null==t?void 0:t.entityStates;a.forEach((function(t){var r=t.entity,i=t.operation,a=t.rawEvent,l=r.entityFormat,s=l.id,c=l.entityType,d=l.isFakeEntity,u=r.wrapper;if(c&&!d)if("newEntity"==i){r.entityFormat.id=n.ensureUniqueId(c,null!=s?s:"",u),u.className=(0,o.generateEntityClassNames)(r.entityFormat),r.entityFormat.isReadonly&&(u.contentEditable="false");var p=n.triggerEvent(e,u,i,a);n.state.entityMap[r.entityFormat.id]={element:u,canPersist:null==p?void 0:p.shouldPersist},e.isDarkMode()&&(0,o.transformColor)(u,!0,"lightToDark",e.getColorManager())}else if(s){var f=n.state.entityMap[s];f&&(f.isDeleted=!0),n.triggerEvent(e,u,i,a)}})),null==l||l.forEach((function(t){var r,o=t.id,i=t.state,a=null===(r=n.state.entityMap[o])||void 0===r?void 0:r.element;a&&n.triggerEvent(e,a,"updateEntityState",void 0,i)})),(0,i.handleDelimiterContentChangedEvent)(e)},e.prototype.getChangedEntities=function(e){var t=this,r=[];return e.formatContentModel((function(e){return(0,n.findAllEntities)(e,r),!1})),(0,o.getObjectKeys)(this.state.entityMap).forEach((function(e){var n=t.state.entityMap[e];if(!n.isDeleted){var i=r.findIndex((function(t){return"newEntity"==t.operation&&t.entity.entityFormat.id==e&&t.entity.wrapper==n.element}));if(i>=0)r.splice(i,1);else{var a=(0,o.parseEntityFormat)(n.element);if(!a.isFakeEntity){var l=(0,o.createEntity)(n.element,a.isReadonly,{},a.entityType,a.id);r.push({entity:l,operation:"overwrite"})}}}})),r},e.prototype.handleExtractContentWithDomEvent=function(e,t){var r=this;(0,o.getAllEntityWrappers)(t).forEach((function(t){t.removeAttribute("contentEditable"),r.triggerEvent(e,t,"replaceTemporaryContent")}))},e.prototype.triggerEvent=function(e,t,r,n,i){var a=(0,o.parseEntityFormat)(t);return a.id&&a.entityType&&!a.isFakeEntity?e.triggerEvent("entityOperation",{operation:r,rawEvent:n,entity:{id:a.id,type:a.entityType,isReadonly:!!a.isReadonly,wrapper:t},state:"updateEntityState"==r?i:void 0,shouldPersist:"newEntity"==r||void 0}):null},e.prototype.ensureUniqueId=function(e,t,r){for(var n=a.exec(t),o=(n?t.substr(0,t.length-n[0].length):t)||e,i="",l=n&&parseInt(n[1])||0;;l++){i=l>0?o+"_"+l:o;var s=this.state.entityMap[i];if(!s||s.element==r)break}return i},e}();t.createEntityPlugin=function(){return new l}},6125:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.adjustSelectionAroundEntity=void 0;var n=r(1635),o=r(4990);t.adjustSelectionAroundEntity=function(e,t,r){var i,a=e.isDisposed()?null:e.getDOMSelection();if(a&&"range"==a.type){var l=a.range,s=a.isReverted,c=s?l.startContainer:l.endContainer,d=s?l.startOffset:l.endOffset,u=(0,o.isNodeOfType)(c,"ELEMENT_NODE")?c:c.parentElement,p="ArrowLeft"==t!=!(!u||"rtl"!=(null===(i=e.getDocument().defaultView)||void 0===i?void 0:i.getComputedStyle(u).direction));u&&((0,o.isEntityDelimiter)(u,!p)&&(p&&0==d||!p&&1==d)||(0,o.isBlockEntityContainer)(u))&&e.formatContentModel((function(t){var i,a,c=(0,o.getSelectedSegmentsAndParagraphs)(t,!1,!0),d=c[s?0:c.length-1],u=null!==(a=null===(i=null==d?void 0:d[1])||void 0===i?void 0:i.segments.indexOf(d[0]))&&void 0!==a?a:-1;if(d&&d[1]&&u>=0){var f=(0,n.__read)(d,3),m=f[0],g=f[1],h=f[2],v=r&&!l.collapsed&&p!=!!s,y=function(e,t,r,n){var i=null;if("Entity"==(null==e?void 0:e.segmentType))i=e;else{var a=t[0].blocks,l=a.indexOf(r),s=l>=0?a[n?l-1:l+1]:null;"Entity"==(null==s?void 0:s.blockType)&&(i=s)}var c=i?n?i.wrapper.previousElementSibling:i.wrapper.nextElementSibling:null;return(0,o.isNodeOfType)(c,"ELEMENT_NODE")&&(0,o.isEntityDelimiter)(c,n)?c:null}(v?m:g.segments[p?u-1:u+1],h,g,p);if(y){var b=function(e,t,r,n,o){var i=e.cloneRange();return t?r?i.setEndBefore(n):i.setStartAfter(n):(r?i.setStartBefore(n):i.setEndAfter(n),o||(r?i.setEndBefore(n):i.setStartAfter(n))),i}(l,v,p,y,r);e.setDOMSelection({type:"range",range:b,isReverted:!b.collapsed&&s})}}return!1}))}}},9531:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleEnterInlineEntity=t.handleKeyDownInBlockDelimiter=t.handleDelimiterKeyDownEvent=t.handleCompositionEndEvent=t.handleDelimiterContentChangedEvent=t.preventTypeInDelimiter=void 0;var n=r(1635),o=r(6125),i=r(7104),a=r(4990),l="entityDelimiterBefore",s="entityDelimiterAfter",c="."+s+",."+l,d="​";function u(e,t){var r=e.classList.contains(s)?e.previousElementSibling:e.nextElementSibling;r&&(0,a.isEntityElement)(r)&&(p([r.previousElementSibling,r.nextElementSibling].filter((function(e){return!!e}))),t.formatContentModel((function(e,t){return(0,a.iterateSelections)(e,(function(e,t,r,n){"Paragraph"==(null==r?void 0:r.blockType)&&r.segments.forEach((function(e){"Text"==e.segmentType&&e.text.indexOf(d)>=0&&(0,a.mutateSegment)(r,e,(function(e){e.text=e.text.replace(d,"")}))}))})),t.skipUndoSnapshot=!0,!0})))}function p(e){e.forEach((function(e){var t,r;if((0,a.isNodeOfType)(e,"ELEMENT_NODE"))if((0,a.isEntityDelimiter)(e)){var n=e.classList.contains(l)?e.nextElementSibling:e.previousElementSibling;(0,a.isNodeOfType)(n,"ELEMENT_NODE")&&(0,a.isEntityElement)(n)||null===(r=null==(t=e)?void 0:t.parentElement)||void 0===r||r.removeChild(t)}else!function(e,t){if(void 0===t&&(t=!0),e){var r=e.classList.contains(s)?e.previousElementSibling:e.nextElementSibling;t&&r&&(0,a.isEntityElement)(r)||(e.classList.remove(s,l),e.normalize(),e.childNodes.forEach((function(e){var t,r,n=null!==(r=null===(t=e.textContent)||void 0===t?void 0:t.indexOf(d))&&void 0!==r?r:-1;if(n>=0){var o=new Range;o.setStart(e,n),o.setEnd(e,n+1),o.deleteContents()}})))}}(e)}))}function f(e,t){var r,n,o,l,s,u=e.range,p=e.isReverted,f=p?u.startContainer:u.endContainer,m=p?u.startOffset:u.endOffset;if(f){var g=(0,i.normalizePos)(f,m);f=g.node,m=g.offset}if((0,a.isNodeOfType)(f,"ELEMENT_NODE"))f=f.childNodes.length==m?f:f.childNodes.item(m);else{var h=t?d+t:d;f=f.textContent!=h&&(f.textContent||"").length==m?null!==(o=null!==(r=f.nextSibling)&&void 0!==r?r:null===(n=f.parentElement)||void 0===n?void 0:n.closest(c))&&void 0!==o?o:null:null!==(s=null===(l=null==f?void 0:f.parentElement)||void 0===l?void 0:l.closest(c))&&void 0!==s?s:null}return f&&!f.hasChildNodes()&&(f=f.nextSibling),(0,a.isNodeOfType)(f,"ELEMENT_NODE")?f:null}function m(e,r,n,o){var i,l=e.getDOMHelper();if(n&&(0,a.isEntityDelimiter)(n)&&l.isNodeInEditor(n)){var c=(0,a.findClosestBlockEntityContainer)(n,l),d="Enter"===o.key;c&&l.isNodeInEditor(c)?(n.classList.contains(s)?r.setStartAfter(c):r.setStartBefore(c),r.collapse(!0),d&&o.preventDefault(),e.formatContentModel(t.handleKeyDownInBlockDelimiter,{selectionOverride:{type:"range",isReverted:!1,range:r}})):d?(o.preventDefault(),e.formatContentModel(t.handleEnterInlineEntity)):(e.takeSnapshot(),null===(i=e.getDocument().defaultView)||void 0===i||i.requestAnimationFrame((function(){return u(n,e)})))}}t.preventTypeInDelimiter=u,t.handleDelimiterContentChangedEvent=function(e){var t=e.getDOMHelper();p(t.queryElements(c)),function(e,t){if(e.length>0){var r=(0,a.createModelToDomContext)();e.forEach((function(e){(0,a.isNodeOfType)(e,"ELEMENT_NODE")&&(0,a.isEntityElement)(e)&&!e.isContentEditable&&(0,a.addDelimiters)(e.ownerDocument,e,t,r)}))}}(t.queryElements("span._Entity"),e.getPendingFormat())},t.handleCompositionEndEvent=function(e,t){var r=e.getDOMSelection();if("range"==(null==r?void 0:r.type)&&r.range.collapsed){var n=f(r,t.rawEvent.data);(null==n?void 0:n.firstChild)&&(0,a.isNodeOfType)(n.firstChild,"TEXT_NODE")&&n.matches(c)&&n.textContent==d+t.rawEvent.data&&u(n,e)}},t.handleDelimiterKeyDownEvent=function(e,t){var r,n=e.getDOMSelection();if(n&&"range"==n.type){var i=t.rawEvent,l=n.range,s=i.key;switch(s){case"Enter":if(l.collapsed)m(e,l,f(n),i);else{var c=e.getDOMHelper(),d=(0,a.findClosestEntityWrapper)(l.startContainer,c);d&&(0,a.isNodeOfType)(d,"ELEMENT_NODE")&&c.isNodeInEditor(d)&&g(e,d,i)}break;case"ArrowLeft":case"ArrowRight":i.altKey||i.ctrlKey||i.metaKey||null===(r=e.getDocument().defaultView)||void 0===r||r.requestAnimationFrame((function(){(0,o.adjustSelectionAroundEntity)(e,s,i.shiftKey)}));break;default:(0,a.isCharacterValue)(i)&&l.collapsed&&m(e,l,f(n),i)}}},t.handleKeyDownInBlockDelimiter=function(e,t){return(0,a.iterateSelections)(e,(function(e,r,o){if("Paragraph"==(null==o?void 0:o.blockType)){var i=(0,a.mutateBlock)(o);delete i.isImplicit;var l=i.segments.find((function(e){return"SelectionMarker"==e.segmentType}));"SelectionMarker"==(null==l?void 0:l.segmentType)&&(i.segmentFormat=(0,n.__assign)({},l.format),t.newPendingFormat=(0,n.__assign)({},l.format)),i.segments.unshift((0,a.createBr)())}})),!0},t.handleEnterInlineEntity=function(e){var t,r,o;if((0,a.iterateSelections)(e,(function(e,t,n){"Paragraph"==(null==n?void 0:n.blockType)&&(r=n,o=e[e.length-1])})),r&&o){var i=r.segments.findIndex((function(e){return"SelectionMarker"==e.segmentType}));if(i>=0){var l=(0,a.mutateBlock)(r),s=l.segments.splice(i),c=(0,a.createParagraph)(!1,l.format,l.segmentFormat,l.decorator);(l.segments.every((function(e){return"SelectionMarker"==e.segmentType||"Br"==e.segmentType}))||s.every((function(e){return"SelectionMarker"==e.segmentType})))&&c.segments.push((0,a.createBr)(l.format)),(t=c.segments).push.apply(t,(0,n.__spreadArray)([],(0,n.__read)(s),!1));var d=o.blocks.indexOf(l);d>=0&&(0,a.mutateBlock)(o).blocks.splice(d+1,0,c)}}return!0};var g=function(e,t,r){var n=(0,a.parseEntityFormat)(t);n.id&&n.entityType&&!n.isFakeEntity&&e.triggerEvent("entityOperation",{operation:"click",entity:{id:n.id,type:n.entityType,isReadonly:!!n.isReadonly,wrapper:t},rawEvent:r})}},9677:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findAllEntities=void 0,t.findAllEntities=function e(t,r){t.blocks.forEach((function(t){switch(t.blockType){case"BlockGroup":e(t,r);break;case"Entity":r.push({entity:t,operation:"newEntity"});break;case"Paragraph":t.segments.forEach((function(t){switch(t.segmentType){case"Entity":r.push({entity:t,operation:"newEntity"});break;case"General":e(t,r)}}));break;case"Table":t.rows.forEach((function(t){return t.cells.forEach((function(t){return e(t,r)}))}))}}))}},6314:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFormatPlugin=void 0;var n=r(1635),o=r(3104),i=r(3354),a=r(4990),l={backgroundColor:"backgroundColor",textColor:"color",fontFamily:"fontFamily",fontSize:"fontSize"},s=function(){function e(e){var t=this;this.editor=null,this.lastCheckedNode=null,this.state={defaultFormat:(0,n.__assign)({},e.defaultSegmentFormat),pendingFormat:null},this.defaultFormatKeys=new Set,(0,a.getObjectKeys)(l).forEach((function(e){t.state.defaultFormat[e]&&t.defaultFormatKeys.add(l[e])}))}return e.prototype.getName=function(){return"Format"},e.prototype.initialize=function(e){this.editor=e},e.prototype.dispose=function(){this.editor=null},e.prototype.getState=function(){return this.state},e.prototype.onPluginEvent=function(e){if(this.editor)switch(e.eventType){case"input":case"compositionEnd":this.checkAndApplyPendingFormat(e.rawEvent.data);break;case"keyDown":var t=this.editor.getEnvironment().isAndroid&&"Unidentified"==e.rawEvent.key;(0,a.isCursorMovingKey)(e.rawEvent)?(this.clearPendingFormat(),this.lastCheckedNode=null):this.defaultFormatKeys.size>0&&(t||(0,a.isCharacterValue)(e.rawEvent)||"Process"==e.rawEvent.key)&&this.shouldApplyDefaultFormat(this.editor)&&(0,o.applyDefaultFormat)(this.editor,this.state.defaultFormat);break;case"mouseUp":case"contentChanged":this.lastCheckedNode=null,this.canApplyPendingFormat()||this.clearPendingFormat()}},e.prototype.checkAndApplyPendingFormat=function(e){this.editor&&e&&this.state.pendingFormat&&((0,i.applyPendingFormat)(this.editor,e,this.state.pendingFormat.format),this.clearPendingFormat())},e.prototype.clearPendingFormat=function(){this.state.pendingFormat=null},e.prototype.canApplyPendingFormat=function(){var e=!1;if(this.state.pendingFormat&&this.editor){var t=this.editor.getDOMSelection(),r="range"==(null==t?void 0:t.type)&&t.range.collapsed?t.range:null,n=this.state.pendingFormat.insertPoint,o=n.node,i=n.offset;r&&r.startContainer==o&&r.startOffset==i&&(e=!0)}return e},e.prototype.shouldApplyDefaultFormat=function(e){var t,r,n=e.getDOMSelection(),o="range"==(null==n?void 0:n.type)?n.range:null,i=null!==(t=null==o?void 0:o.startContainer)&&void 0!==t?t:null;if(i&&i!=this.lastCheckedNode){this.lastCheckedNode=i;for(var l=e.getDOMHelper(),s=(0,a.isNodeOfType)(i,"ELEMENT_NODE")?i:i.parentElement,c=new Set,d=function(){if(null===(r=s.getAttribute)||void 0===r?void 0:r.call(s,"style")){var e=s.style;if(u.defaultFormatKeys.forEach((function(t){e[t]&&c.add(t)})),c.size==u.defaultFormatKeys.size)return{value:!1}}if((0,a.isBlockElement)(s))return"break";s=s.parentElement},u=this;(null==s?void 0:s.parentElement)&&l.isNodeInEditor(s.parentElement);){var p=d();if("object"==typeof p)return p.value;if("break"===p)break}return!0}return!1},e}();t.createFormatPlugin=function(e){return new s(e)}},3104:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyDefaultFormat=void 0;var n=r(1635),o=r(4990);function i(e,t,r){return(0,n.__assign)((0,n.__assign)((0,n.__assign)({},t),e.getPendingFormat()),r)}t.applyDefaultFormat=function(e,t){e.formatContentModel((function(r,n){var a=(0,o.deleteSelection)(r,[],n);if("range"==a.deleteResult)return(0,o.normalizeContentModel)(r),e.takeSnapshot(),!0;if("notDeleted"==a.deleteResult&&a.insertPoint){var l=a.insertPoint,s=l.paragraph,c=l.path,d=l.marker,u=c[0].blocks,p=u.length,f=u.indexOf(s);if(s.isImplicit&&1==s.segments.length&&s.segments[0]==d&&p>0&&f==p-1){var m=u[f-1];"Paragraph"!=(null==m?void 0:m.blockType)&&(n.newPendingFormat=i(e,t,d.format))}else s.segments.every((function(e){return"Text"!=e.segmentType}))&&(n.newPendingFormat=i(e,t,d.format))}return!1}))}},3354:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyPendingFormat=void 0;var n=r(1635),o=r(4990);t.applyPendingFormat=function(e,t,r){var i=!1;e.formatContentModel((function(e,a){return(0,o.iterateSelections)(e,(function(e,a,l,s){if("Paragraph"==(null==l?void 0:l.blockType)&&1==(null==s?void 0:s.length)&&"SelectionMarker"==s[0].segmentType){var c=s[0],d=l.segments.indexOf(c),u=l.segments[d-1];if("Text"==(null==u?void 0:u.segmentType)){var p=u.text,f=p.substr(-t.length,t.length);(f==t||" "==t&&" "==f)&&((0,o.mutateSegment)(l,u,(function(e){e.text=p.substring(0,p.length-t.length)})),(0,o.mutateSegment)(l,c,(function(e,i){e.format=(0,n.__assign)({},r);var a=(0,o.createText)(" "==t?" ":t,(0,n.__assign)((0,n.__assign)({},u.format),r));i.segments.splice(d,0,a),(0,o.setParagraphNotImplicit)(i)})),i=!0)}}return!0})),i&&((0,o.normalizeContentModel)(e),a.skipUndoSnapshot=!0),i}),{apiName:"applyPendingFormat"})}},8118:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLifecyclePlugin=void 0;var n=r(4990),o=r(1782),i="contenteditable",a=function(){function e(e,t){var r=this;this.editor=null,this.initializer=null,this.disposer=null,null===t.getAttribute(i)&&(this.initializer=function(){t.contentEditable="true",t.style.userSelect="text"},this.disposer=function(){t.style.userSelect="",t.removeAttribute(i)}),this.adjustColor=e.doNotAdjustEditorColor?function(){}:function(){r.adjustContainerColor(t)},this.state={isDarkMode:!!e.inDarkMode,shadowEditFragment:null,styleElements:{},announcerStringGetter:e.announcerStringGetter}}return e.prototype.getName=function(){return"Lifecycle"},e.prototype.initialize=function(e){var t;this.editor=e,null===(t=this.initializer)||void 0===t||t.call(this),this.adjustColor(),this.editor.triggerEvent("editorReady",{},!0),this.state.announceContainer=(0,o.createAriaLiveElement)(e.getDocument())},e.prototype.dispose=function(){var e,t,r=this;null===(e=this.editor)||void 0===e||e.triggerEvent("beforeDispose",{},!0),(0,n.getObjectKeys)(this.state.styleElements).forEach((function(e){var t,n=r.state.styleElements[e];null===(t=n.parentElement)||void 0===t||t.removeChild(n),delete r.state.styleElements[e]}));var o=this.state.announceContainer;o&&(null===(t=o.parentElement)||void 0===t||t.removeChild(o),delete this.state.announceContainer),this.disposer&&(this.disposer(),this.disposer=null,this.initializer=null),this.editor=null},e.prototype.getState=function(){return this.state},e.prototype.onPluginEvent=function(e){"contentChanged"!=e.eventType||e.source!=n.ChangeSource.SwitchToDarkMode&&e.source!=n.ChangeSource.SwitchToLightMode||this.adjustColor()},e.prototype.adjustContainerColor=function(e){if(this.editor){var t=this.state.isDarkMode,r=this.editor.getColorManager();(0,n.setColor)(e,"#000000",!1,t,r),(0,n.setColor)(e,"#ffffff",!0,t,r)}},e}();t.createLifecyclePlugin=function(e,t){return new a(e,t)}},8226:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionPlugin=t.DEFAULT_TABLE_CELL_SELECTION_BACKGROUND_COLOR=t.DEFAULT_SELECTION_BORDER_COLOR=void 0;var n=r(6630),o=r(8079),i=r(9219),a=r(7104),l=r(4990),s="ArrowUp",c="ArrowDown",d="ArrowLeft",u="ArrowRight";t.DEFAULT_SELECTION_BORDER_COLOR="#DB626C",t.DEFAULT_TABLE_CELL_SELECTION_BACKGROUND_COLOR="#C6C6C6";var p=function(){function e(e){var r,o,a=this;this.editor=null,this.disposer=null,this.isSafari=!1,this.isMac=!1,this.scrollTopCache=0,this.onMouseMove=function(e){var t,r,o;if(a.editor&&a.state.tableSelection){var i=!!a.state.tableSelection.lastCo,s=e.target,c=a.editor.getDOMHelper(),d=a.editor.getDocument().createRange(),u=a.state.tableSelection.startNode,p=s.compareDocumentPosition(u)==Node.DOCUMENT_POSITION_FOLLOWING;p?(d.setStart(s,0),d.setEnd(u,(0,l.isNodeOfType)(u,"TEXT_NODE")?null!==(r=null===(t=u.nodeValue)||void 0===t?void 0:t.length)&&void 0!==r?r:0:u.childNodes.length)):(d.setStart(u,0),d.setEnd(s,0));var f=d.commonAncestorContainer,m=a.parseTableSelection(f,u,c);if(m){var g=(0,n.findCoordinate)(m.parsedTable,s,c);m.table!=a.state.tableSelection.table&&(a.state.tableSelection=m,a.state.tableSelection.lastCo=null!=g?g:void 0);var h=g&&a.updateTableSelection(g);(i||h)&&e.preventDefault()}else"table"==(null===(o=a.editor.getDOMSelection())||void 0===o?void 0:o.type)&&a.setDOMSelection({type:"range",range:d,isReverted:p},a.state.tableSelection)}},this.onDrop=function(){a.detachMouseEvent()},this.getContainedTargetImage=function(e,t){if(!a.isMac||!t||"image"!==t.type)return null;var r=e.target;return(0,l.isNodeOfType)(r,"ELEMENT_NODE")&&(0,l.isElementOfType)(r,"span")&&r.firstChild===t.image?t.image:null},this.onFocus=function(){var e;!a.state.skipReselectOnFocus&&a.state.selection&&a.setDOMSelection(a.state.selection,a.state.tableSelection),"range"!=(null===(e=a.state.selection)||void 0===e?void 0:e.type)||a.isSafari||(a.state.selection=null),a.scrollTopCache&&a.editor&&(a.editor.getScrollContainer().scrollTop=a.scrollTopCache,a.scrollTopCache=0)},this.onBlur=function(){if(a.editor){a.state.selection||(a.state.selection=a.editor.getDOMSelection());var e=a.editor.getScrollContainer();a.scrollTopCache=e.scrollTop}},this.onSelectionChange=function(){var e;if((null===(e=a.editor)||void 0===e?void 0:e.hasFocus())&&!a.editor.isInShadowEdit()){var t=a.editor.getDOMSelection(),r=a.editor.getDocument().getSelection();if("image"==(null==t?void 0:t.type)&&r&&r.focusNode&&!(0,i.isSingleImageInSelection)(r)){var n=r.getRangeAt(0);a.editor.setDOMSelection({type:"range",range:n,isReverted:r.focusNode!=n.endContainer||r.focusOffset!=n.endOffset})}"range"==(null==t?void 0:t.type)&&a.isSafari&&(a.state.selection=t)}},this.state={selection:null,tableSelection:null,imageSelectionBorderColor:null!==(r=e.imageSelectionBorderColor)&&void 0!==r?r:t.DEFAULT_SELECTION_BORDER_COLOR,imageSelectionBorderColorDark:e.imageSelectionBorderColor?void 0:t.DEFAULT_SELECTION_BORDER_COLOR,tableCellSelectionBackgroundColor:null!==(o=e.tableCellSelectionBackgroundColor)&&void 0!==o?o:t.DEFAULT_TABLE_CELL_SELECTION_BACKGROUND_COLOR,tableCellSelectionBackgroundColorDark:e.tableCellSelectionBackgroundColor?void 0:t.DEFAULT_TABLE_CELL_SELECTION_BACKGROUND_COLOR}}return e.prototype.getName=function(){return"Selection"},e.prototype.initialize=function(e){this.editor=e,!this.state.imageSelectionBorderColorDark&&this.state.imageSelectionBorderColor&&(this.state.imageSelectionBorderColorDark=e.getColorManager().getDarkColor(this.state.imageSelectionBorderColor,void 0,"border")),!this.state.tableCellSelectionBackgroundColorDark&&this.state.tableCellSelectionBackgroundColor&&(this.state.tableCellSelectionBackgroundColorDark=e.getColorManager().getDarkColor(this.state.tableCellSelectionBackgroundColor,void 0,"background"));var t=this.editor.getEnvironment(),r=this.editor.getDocument();this.isSafari=!!t.isSafari,this.isMac=!!t.isMac,r.addEventListener("selectionchange",this.onSelectionChange),this.isSafari?this.disposer=this.editor.attachDomEvent({focus:{beforeDispatch:this.onFocus},drop:{beforeDispatch:this.onDrop}}):this.disposer=this.editor.attachDomEvent({focus:{beforeDispatch:this.onFocus},blur:{beforeDispatch:this.onBlur},drop:{beforeDispatch:this.onDrop}})},e.prototype.dispose=function(){var e;null===(e=this.editor)||void 0===e||e.getDocument().removeEventListener("selectionchange",this.onSelectionChange),this.disposer&&(this.disposer(),this.disposer=null),this.detachMouseEvent(),this.editor=null},e.prototype.getState=function(){return this.state},e.prototype.onPluginEvent=function(e){if(this.editor)switch(e.eventType){case"mouseDown":this.onMouseDown(this.editor,e.rawEvent);break;case"mouseUp":this.onMouseUp(this.editor,e);break;case"keyDown":this.onKeyDown(this.editor,e.rawEvent);break;case"contentChanged":this.state.tableSelection=null;break;case"scroll":this.editor.hasFocus()||(this.scrollTopCache=e.scrollContainer.scrollTop)}},e.prototype.onMouseDown=function(e,t){var r,o,i,a,l=e.getDOMSelection();if(e.isExperimentalFeatureEnabled("LegacyImageSelection")){if(2===t.button&&(i=null!==(r=this.getClickingImage(t))&&void 0!==r?r:this.getContainedTargetImage(t,l))&&i.isContentEditable)return void this.selectImageWithRange(i,t);if("image"==(null==l?void 0:l.type)&&l.image!==t.target)return void this.selectBeforeOrAfterElement(e,l.image)}else if("image"!=(null==l?void 0:l.type)||0!=t.button&&(2!=t.button||this.getClickingImage(t)||this.getContainedTargetImage(t,l))||this.setDOMSelection(null,null),(i=null!==(o=this.getClickingImage(t))&&void 0!==o?o:this.getContainedTargetImage(t,l))&&i.isContentEditable)return void this.setDOMSelection({type:"image",image:i},null);"table"==(null==l?void 0:l.type)&&0==t.button&&this.setDOMSelection(null,null);var s=t.target;if(s&&0==t.button&&(a=this.parseTableSelection(s,s,e.getDOMHelper()))){if(this.state.tableSelection=a,t.detail>=3){var c=(0,n.findCoordinate)(a.parsedTable,t.target,e.getDOMHelper());c&&(a.lastCo=c,this.updateTableSelection(c),t.preventDefault())}this.state.mouseDisposer=e.attachDomEvent({mousemove:{beforeDispatch:this.onMouseMove}})}},e.prototype.selectImageWithRange=function(e,t){var r,n=e.ownerDocument.createRange();n.selectNode(e);var o=null===(r=this.editor)||void 0===r?void 0:r.getDOMSelection();"image"==(null==o?void 0:o.type)&&e==o.image?t.preventDefault():this.setDOMSelection({type:"range",isReverted:!1,range:n},null)},e.prototype.onMouseUp=function(e,t){var r;e.isExperimentalFeatureEnabled("LegacyImageSelection")&&(r=this.getClickingImage(t.rawEvent))&&r.isContentEditable&&1!=t.rawEvent.button&&(2==t.rawEvent.button||t.isClicking)&&this.selectImageWithRange(r,t.rawEvent),this.detachMouseEvent()},e.prototype.onKeyDown=function(e,t){var r,n=this,o=t.key,i=e.getDOMSelection(),a=e.getDocument().defaultView;switch(null==i?void 0:i.type){case"image":if((0,l.isModifierKey)(t)||t.shiftKey||!i.image.parentNode||("Escape"===o?(this.selectBeforeOrAfterElement(e,i.image),t.stopPropagation()):"Delete"!==o&&"Backspace"!==o&&this.selectBeforeOrAfterElement(e,i.image)),((0,l.isModifierKey)(t)||t.shiftKey)&&i.image&&!this.isSafari){var p=i.image.ownerDocument.createRange();p.selectNode(i.image),this.setDOMSelection({type:"range",range:p,isReverted:!1},null)}break;case"range":if(o==s||o==c||o==d||o==u||"Tab"==o){var f=i.range.startContainer;this.state.tableSelection=this.parseTableSelection(f,f,e.getDOMHelper()),this.state.tableSelection&&!t.defaultPrevented&&("Tab"==o?(this.handleSelectionInTable(this.getTabKey(t)),t.preventDefault()):null==a||a.requestAnimationFrame((function(){return n.handleSelectionInTable(o)})))}break;case"table":if(null===(r=this.state.tableSelection)||void 0===r?void 0:r.lastCo){var m=t.shiftKey,g=t.key;if(!m||g!=d&&g!=u)!m||g!=s&&g!=c?"Shift"==g||(0,l.isCharacterValue)(t)||g!=s&&g!=c&&g!=d&&g!=u||(this.setDOMSelection(null,this.state.tableSelection),null==a||a.requestAnimationFrame((function(){return n.handleSelectionInTable(g)}))):(this.updateTableSelectionFromKeyboard(g==s?-1:1,0),t.preventDefault());else{var h="rtl"==(null==a?void 0:a.getComputedStyle(this.state.tableSelection.table).direction);this.updateTableSelectionFromKeyboard(0,(g==d?-1:1)*(h?-1:1)),t.preventDefault()}}}},e.prototype.getTabKey=function(e){return e.shiftKey?"TabLeft":"TabRight"},e.prototype.handleSelectionInTable=function(e){var t,r,i,a,l,d;if(this.editor&&this.state.tableSelection){var u=this.editor.getDOMSelection(),p=this.editor.getDOMHelper();if("range"==(null==u?void 0:u.type)){var f=u.range,m=f.collapsed,g=f.startContainer,h=f.endContainer,v=f.commonAncestorContainer,y=u.isReverted,b=y?h:g,S=y?g:h,C=this.parseTableSelection(v,b,p);if(!C)return;var _=(0,n.findCoordinate)(null==C?void 0:C.parsedTable,S,p),E=!1,T=this.state.tableSelection,k=T.parsedTable,M=T.firstCo,O=T.table;if(_&&C.table==O){if(_.col==M.col||e!=s&&e!=c)if("TabLeft"==e||"TabRight"==e)for(var P="TabLeft"==e,w=P?-1:1,x=null!==(i=_.row)&&void 0!==i?i:0,D=(null!==(a=_.col)&&void 0!==a?a:0)+w;;D+=w){if(D<0||D>=k[x].length){if((x+=w)<0){this.selectBeforeOrAfterElement(this.editor,C.table);break}if(x>=k.length){this.selectBeforeOrAfterElement(this.editor,C.table,!0);break}D=P?k[x].length-1:0}var L=k[x][D];if("string"!=typeof L){E=!0,this.setRangeSelectionInTable(L,0,this.editor,!0),_.row=x,_.col=D;break}}else this.state.tableSelection=null;else{var I=e==s?-1:1,F=null===(t=(0,o.findTableCellElement)(k,M))||void 0===t?void 0:t.cell,R=null;for(_={row:M.row+I,col:M.col};_.row>=0&&_.row<k.length&&(R=(null===(r=(0,o.findTableCellElement)(k,_))||void 0===r?void 0:r.cell)||null)==F;)_.row+=I;m&&R?this.setRangeSelectionInTable(R,e==s?R.childNodes.length:0,this.editor):!R&&(-1==_.row||_.row<=k.length)&&this.selectBeforeOrAfterElement(this.editor,O,1==I,1!=I)}m&&(_.col!=M.col||_.row!=M.row)&&_.row>=0&&_.row==k.length-1&&_.col==(null===(l=k[_.row])||void 0===l?void 0:l.length)-1&&(null===(d=this.editor)||void 0===d||d.announce({defaultStrings:"announceOnFocusLastCell"}))}m||!_||E||(this.state.tableSelection=C,this.updateTableSelection(_))}}},e.prototype.setRangeSelectionInTable=function(e,t,r,n){var o=r.getDocument().createRange();if(n&&e.firstChild&&e.lastChild){var i=e.firstChild,l=e.lastChild,s=(0,a.normalizePos)(i,0),c=(0,a.normalizePos)(l,l.childNodes.length);o.setStart(s.node,s.offset),o.setEnd(c.node,c.offset)}else{var d=(0,a.normalizePos)(e,t),u=d.node,p=d.offset;o.setStart(u,p),o.collapse(!0)}this.setDOMSelection({type:"range",range:o,isReverted:!1},null)},e.prototype.updateTableSelectionFromKeyboard=function(e,t){var r;if((null===(r=this.state.tableSelection)||void 0===r?void 0:r.lastCo)&&this.editor){var n=this.state.tableSelection,o=n.lastCo,i=n.parsedTable,a=o.row+e,l=o.col+t;a>=0&&a<i.length&&l>=0&&l<i[a].length&&this.updateTableSelection({row:a,col:l})}},e.prototype.selectBeforeOrAfterElement=function(e,t,r,n){var o,i=e.getDocument(),a=t.parentNode,s=a&&(0,l.toArray)(a.childNodes).indexOf(t);if(a&&null!==s&&s>=0){var c=i.createRange();n&&(o=r?t.nextElementSibling:t.previousElementSibling)&&(0,l.isNodeOfType)(o,"ELEMENT_NODE")?(c.selectNodeContents(o),c.collapse(!1)):(c.setStart(a,s+(r?1:0)),c.collapse()),this.setDOMSelection({type:"range",range:c,isReverted:!1},null)}},e.prototype.getClickingImage=function(e){var t=e.target;return(0,l.isNodeOfType)(t,"ELEMENT_NODE")&&(0,l.isElementOfType)(t,"img")?t:null},e.prototype.parseTableSelection=function(e,t,r){var o,i,a;return(o=r.findClosestElementAncestor(e,"table"))&&o.isContentEditable&&(i=(0,l.parseTableCells)(o))&&(a=(0,n.findCoordinate)(i,t,r))?{table:o,parsedTable:i,firstCo:a,startNode:t}:null},e.prototype.updateTableSelection=function(e){if(this.state.tableSelection&&this.editor){var t=this.state.tableSelection,r=t.table,n=t.firstCo,o=t.parsedTable,i=t.startNode;if(t.lastCo||n.row!=e.row||n.col!=e.col)return this.state.tableSelection.lastCo=e,this.setDOMSelection({type:"table",table:r,firstRow:n.row,firstColumn:n.col,lastRow:e.row,lastColumn:e.col},{table:r,firstCo:n,lastCo:e,parsedTable:o,startNode:i}),!0}return!1},e.prototype.setDOMSelection=function(e,t){var r;null===(r=this.editor)||void 0===r||r.setDOMSelection(e),this.state.tableSelection=t},e.prototype.detachMouseEvent=function(){this.state.mouseDisposer&&(this.state.mouseDisposer(),this.state.mouseDisposer=void 0)},e}();t.createSelectionPlugin=function(e){return new p(e)}},6630:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findCoordinate=void 0,t.findCoordinate=function(e,t,r){var n=r.findClosestElementAncestor(t,"TH,TD"),o=null;return n&&e.some((function(e,t){var r=n?e.indexOf(n):-1;return o=r>=0?{row:t,col:r}:null})),o||e.some((function(e,r){var n=e.findIndex((function(e){return"object"==typeof e&&e.contains(t)}));return o=n>=0?{row:r,col:n}:null})),o}},9219:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSingleImageInSelection=void 0;var n=r(4990);t.isSingleImageInSelection=function(e){var t=function(e){return function(e){return!!e.getRangeAt}(e)?{startNode:e.anchorNode,endNode:e.focusNode,startOffset:e.anchorOffset,endOffset:e.focusOffset}:{startNode:e.startContainer,endNode:e.endContainer,startOffset:e.startOffset,endOffset:e.endOffset}}(e),r=t.startNode,o=t.endNode,i=t.startOffset,a=t.endOffset,l=Math.max(i,a),s=Math.min(i,a);if(r&&o&&r==o&&l-s==1){var c=null==r?void 0:r.childNodes.item(s);if((0,n.isNodeOfType)(c,"ELEMENT_NODE")&&(0,n.isElementOfType)(c,"img"))return c}return null}},7104:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizePos=void 0;var n=r(4990),o=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];t.normalizePos=function(e,t){var r,i,a,l,s=(0,n.isNodeOfType)(e,"TEXT_NODE")?null!==(i=null===(r=e.nodeValue)||void 0===r?void 0:r.length)&&void 0!==i?i:0:e.childNodes.length;for(t=Math.max(Math.min(t,s),0);null==e?void 0:e.lastChild;)if(t>=e.childNodes.length)e=e.lastChild,t=(0,n.isNodeOfType)(e,"TEXT_NODE")?null!==(l=null===(a=e.nodeValue)||void 0===a?void 0:a.length)&&void 0!==l?l:0:e.childNodes.length;else{var c=e.childNodes[t];if((0,n.isNodeOfType)(c,"ELEMENT_NODE")&&o.indexOf(c.tagName)>=0)break;e=e.childNodes[t],t=0}return{node:e,offset:t}}},9299:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSnapshotsManager=void 0;var r=function(){function e(e){this.hasNewContentValue=!1,this.snapshots=null!=e?e:{snapshots:[],totalSize:0,currentIndex:-1,autoCompleteIndex:-1,maxSize:1e7}}return Object.defineProperty(e.prototype,"hasNewContent",{get:function(){return this.hasNewContentValue},set:function(e){this.hasNewContentValue=e},enumerable:!1,configurable:!0}),e.prototype.canMove=function(e){var t=this.snapshots.currentIndex+e;return t>=0&&t<this.snapshots.snapshots.length},e.prototype.move=function(e){var t,r,n=null;return this.canMove(e)&&(this.snapshots.currentIndex+=e,this.snapshots.autoCompleteIndex=-1,n=this.snapshots.snapshots[this.snapshots.currentIndex]),null===(r=(t=this.snapshots).onChanged)||void 0===r||r.call(t,"move"),n},e.prototype.addSnapshot=function(e,t){var r,n,o=this.snapshots.snapshots[this.snapshots.currentIndex],i=o&&o.html==e.html&&!o.entityStates&&!e.entityStates,a=!o||function(e,t){return e.html!==t.html||e.entityStates&&t.entityStates&&e.entityStates!==t.entityStates||!e.entityStates&&t.entityStates}(o,e);if(this.snapshots.currentIndex<0||a){this.clearRedo(),this.snapshots.snapshots.push(e),this.snapshots.currentIndex++,this.snapshots.totalSize+=this.getSnapshotLength(e);for(var l=0;l<this.snapshots.snapshots.length&&this.snapshots.totalSize>this.snapshots.maxSize;)this.snapshots.totalSize-=this.getSnapshotLength(this.snapshots.snapshots[l]),l++;l>0&&(this.snapshots.snapshots.splice(0,l),this.snapshots.currentIndex-=l,this.snapshots.autoCompleteIndex>=0&&(this.snapshots.autoCompleteIndex-=l)),t&&(this.snapshots.autoCompleteIndex=this.snapshots.currentIndex)}else i&&this.snapshots.snapshots.splice(this.snapshots.currentIndex,1,e);null===(n=(r=this.snapshots).onChanged)||void 0===n||n.call(r,"add")},e.prototype.clearRedo=function(){var e,t;if(this.canMove(1)){for(var r=0,n=this.snapshots.currentIndex+1;n<this.snapshots.snapshots.length;n++)r+=this.getSnapshotLength(this.snapshots.snapshots[n]);this.snapshots.snapshots.splice(this.snapshots.currentIndex+1),this.snapshots.totalSize-=r,this.snapshots.autoCompleteIndex=-1,null===(t=(e=this.snapshots).onChanged)||void 0===t||t.call(e,"clear")}},e.prototype.canUndoAutoComplete=function(){return this.snapshots.autoCompleteIndex>=0&&this.snapshots.currentIndex-this.snapshots.autoCompleteIndex==1},e.prototype.getSnapshotLength=function(e){var t,r;return null!==(r=null===(t=e.html)||void 0===t?void 0:t.length)&&void 0!==r?r:0},e}();t.createSnapshotsManager=function(e){return new r(e)}},8656:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUndoPlugin=void 0;var n=r(4990),o=r(9299),i=r(674),a="Backspace",l="Delete",s="Enter",c=function(){function e(e){this.editor=null,this.state={snapshotsManager:(0,o.createSnapshotsManager)(e.snapshots),isRestoring:!1,isNested:!1,autoCompleteInsertPoint:null,lastKeyPress:null}}return e.prototype.getName=function(){return"Undo"},e.prototype.initialize=function(e){this.editor=e},e.prototype.dispose=function(){this.editor=null},e.prototype.getState=function(){return this.state},e.prototype.willHandleEventExclusively=function(e){return!!this.editor&&"keyDown"==e.eventType&&e.rawEvent.key==a&&!e.rawEvent.ctrlKey&&this.canUndoAutoComplete(this.editor)},e.prototype.onPluginEvent=function(e){if(this.editor)switch(e.eventType){case"editorReady":var t=this.state.snapshotsManager,r=t.hasNewContent||t.canMove(-1),n=t.canMove(1);r||n||this.addUndoSnapshot();break;case"keyDown":this.onKeyDown(this.editor,e.rawEvent);break;case"keyPress":this.onKeyPress(this.editor,e.rawEvent);break;case"compositionEnd":this.clearRedoForInput(),this.addUndoSnapshot();break;case"contentChanged":this.onContentChanged(e);break;case"beforeKeyboardEditing":this.onBeforeKeyboardEditing(e.rawEvent);break;case"mouseDown":this.state.snapshotsManager.hasNewContent&&this.addUndoSnapshot()}},e.prototype.onKeyDown=function(e,t){var r=this.state.snapshotsManager;if(t.key==a&&!t.altKey||t.key==l){if(t.key==a&&!t.ctrlKey&&this.canUndoAutoComplete(e))t.preventDefault(),(0,i.undo)(e),this.state.autoCompleteInsertPoint=null,this.state.lastKeyPress=t.key;else if(!t.defaultPrevented){var o=e.getDOMSelection();!o||"range"==o.type&&o.range.collapsed&&this.state.lastKeyPress==t.key&&!this.isCtrlOrMetaPressed(e,t)||this.addUndoSnapshot(),r.hasNewContent=!0,this.state.lastKeyPress=t.key}}else(0,n.isCursorMovingKey)(t)?(r.hasNewContent&&this.addUndoSnapshot(),this.state.lastKeyPress=null):this.state.lastKeyPress!=a&&this.state.lastKeyPress!=l||r.hasNewContent&&this.addUndoSnapshot()},e.prototype.onKeyPress=function(e,t){if(!t.metaKey){var r=e.getDOMSelection();r&&("range"!=r.type||!r.range.collapsed)||" "==t.key&&" "!=this.state.lastKeyPress||t.key==s?(this.addUndoSnapshot(),t.key==s&&(this.state.snapshotsManager.hasNewContent=!0)):this.clearRedoForInput(),this.state.lastKeyPress=t.key}},e.prototype.onBeforeKeyboardEditing=function(e){e.key!=this.state.lastKeyPress&&this.addUndoSnapshot(),this.state.lastKeyPress=e.key,this.state.snapshotsManager.hasNewContent=!0},e.prototype.onContentChanged=function(e){this.state.isRestoring||e.source==n.ChangeSource.SwitchToDarkMode||e.source==n.ChangeSource.SwitchToLightMode||e.source==n.ChangeSource.Keyboard||this.clearRedoForInput()},e.prototype.clearRedoForInput=function(){this.state.snapshotsManager.clearRedo(),this.state.lastKeyPress=null,this.state.snapshotsManager.hasNewContent=!0},e.prototype.canUndoAutoComplete=function(e){var t,r=e.getDOMSelection();return this.state.snapshotsManager.canUndoAutoComplete()&&"range"==(null==r?void 0:r.type)&&r.range.collapsed&&r.range.startContainer==(null===(t=this.state.autoCompleteInsertPoint)||void 0===t?void 0:t.node)&&r.range.startOffset==this.state.autoCompleteInsertPoint.offset},e.prototype.addUndoSnapshot=function(){var e;null===(e=this.editor)||void 0===e||e.takeSnapshot(),this.state.autoCompleteInsertPoint=null},e.prototype.isCtrlOrMetaPressed=function(e,t){return e.getEnvironment().isMac?t.metaKey:t.ctrlKey},e}();t.createUndoPlugin=function(e){return new c(e)}},3550:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Editor=void 0;var n=r(1635),o=r(3901),i=r(4990),a=function(){function e(e,t){var r,n=this;void 0===t&&(t={}),this.core=null,this.cloneOptionCallback=function(e,t){if("cache"!=t){var r=e.cloneNode(!0);if(n.isDarkMode()){var o=n.getColorManager();(0,i.transformColor)(r,!0,"darkToLight",o),r.style.color=r.style.color||"inherit",r.style.backgroundColor=r.style.backgroundColor||"inherit"}return r}},this.core=(0,o.createEditorCore)(e,t);var a=null!==(r=t.initialModel)&&void 0!==r?r:(0,i.createEmptyModel)(t.defaultSegmentFormat);this.core.api.setContentModel(this.core,a,{ignoreSelection:!0}),this.core.plugins.forEach((function(e){return e.initialize(n)}))}return e.prototype.dispose=function(){for(var e,t=this.getCore(),r=t.plugins.length-1;r>=0;r--){var n=t.plugins[r];try{n.dispose()}catch(r){null===(e=t.disposeErrorHandler)||void 0===e||e.call(t,n,r)}}t.darkColorHandler.reset(),this.core=null},e.prototype.isDisposed=function(){return!this.core},e.prototype.getContentModelCopy=function(e){var t=this.getCore();switch(e){case"connected":case"disconnected":return(0,i.cloneModel)(t.api.createContentModel(t,{processorOverride:{table:i.tableProcessor},tryGetFromCache:!1}),{includeCachedElement:this.cloneOptionCallback});case"clean":var r=(0,i.createDomToModelContextWithConfig)(t.environment.domToModelSettings.calculated,t.api.createEditorContext(t,!1));return(0,i.cloneModel)((0,i.domToContentModel)(t.physicalRoot,r),{includeCachedElement:this.cloneOptionCallback})}},e.prototype.getEnvironment=function(){return this.getCore().environment},e.prototype.getDOMSelection=function(){var e=this.getCore();return e.api.getDOMSelection(e)},e.prototype.setDOMSelection=function(e){var t=this.getCore();t.api.setDOMSelection(t,e)},e.prototype.setLogicalRoot=function(e){var t=this.getCore();t.api.setLogicalRoot(t,e)},e.prototype.formatContentModel=function(e,t,r){var n=this.getCore();n.api.formatContentModel(n,e,t,r)},e.prototype.getPendingFormat=function(){var e,t;return null!==(t=null===(e=this.getCore().format.pendingFormat)||void 0===e?void 0:e.format)&&void 0!==t?t:null},e.prototype.getDOMHelper=function(){return this.getCore().domHelper},e.prototype.takeSnapshot=function(e){var t=this.getCore();return t.api.addUndoSnapshot(t,!1,e?[e]:void 0)},e.prototype.restoreSnapshot=function(e){var t=this.getCore();t.api.restoreUndoSnapshot(t,e)},e.prototype.getDocument=function(){return this.getCore().physicalRoot.ownerDocument},e.prototype.focus=function(){var e=this.getCore();e.api.focus(e)},e.prototype.hasFocus=function(){return this.getCore().domHelper.hasFocus()},e.prototype.triggerEvent=function(e,t,r){void 0===r&&(r=!1);var o=this.getCore(),i=(0,n.__assign)({eventType:e},t);return o.api.triggerEvent(o,i,r),i},e.prototype.attachDomEvent=function(e){var t=this.getCore();return t.api.attachDomEvent(t,e)},e.prototype.getSnapshotsManager=function(){return this.getCore().undo.snapshotsManager},e.prototype.isDarkMode=function(){return this.getCore().lifecycle.isDarkMode},e.prototype.setDarkModeState=function(e){var t=this.getCore();!!e!=t.lifecycle.isDarkMode&&((0,i.transformColor)(t.physicalRoot,!1,e?"lightToDark":"darkToLight",t.darkColorHandler),t.lifecycle.isDarkMode=!!e,t.api.triggerEvent(t,{eventType:"contentChanged",source:e?i.ChangeSource.SwitchToDarkMode:i.ChangeSource.SwitchToLightMode},!0))},e.prototype.isInShadowEdit=function(){return!!this.getCore().lifecycle.shadowEditFragment},e.prototype.startShadowEdit=function(){var e=this.getCore();e.api.switchShadowEdit(e,!0)},e.prototype.stopShadowEdit=function(){var e=this.getCore();e.api.switchShadowEdit(e,!1)},e.prototype.getColorManager=function(){return this.getCore().darkColorHandler},e.prototype.getTrustedHTMLHandler=function(){return this.getCore().trustedHTMLHandler},e.prototype.getScrollContainer=function(){return this.getCore().domEvent.scrollContainer},e.prototype.getVisibleViewport=function(){return this.getCore().api.getVisibleViewport(this.getCore())},e.prototype.setEditorStyle=function(e,t,r){var n=this.getCore();n.api.setEditorStyle(n,e,t,r)},e.prototype.announce=function(e){var t=this.getCore();t.api.announce(t,e)},e.prototype.isExperimentalFeatureEnabled=function(e){return this.getCore().experimentalFeatures.indexOf(e)>=0},e.prototype.getCore=function(){if(!this.core)throw new Error("Editor is already disposed");return this.core},e}();t.Editor=a},2233:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDOMHelper=void 0;var n=r(4990),o=function(){function e(e){this.contentDiv=e}return e.prototype.queryElements=function(e){return(0,n.toArray)(this.contentDiv.querySelectorAll(e))},e.prototype.getTextContent=function(){return this.contentDiv.textContent||""},e.prototype.isNodeInEditor=function(e,t){return(!t||e!=this.contentDiv)&&this.contentDiv.contains(e)},e.prototype.calculateZoomScale=function(){var e,t=(null===(e=this.contentDiv.getBoundingClientRect())||void 0===e?void 0:e.width)||0,r=this.contentDiv.offsetWidth;return r>0&&t>0?Math.round(t/r*100)/100:1},e.prototype.setDomAttribute=function(e,t){null===t?this.contentDiv.removeAttribute(e):this.contentDiv.setAttribute(e,t)},e.prototype.getDomAttribute=function(e){return this.contentDiv.getAttribute(e)},e.prototype.getDomStyle=function(e){return this.contentDiv.style[e]},e.prototype.findClosestElementAncestor=function(e,t){var r=(0,n.isNodeOfType)(e,"ELEMENT_NODE")?e:e.parentElement,o=t?null==r?void 0:r.closest(t):r;return o&&this.isNodeInEditor(o)&&o!=this.contentDiv?o:null},e.prototype.hasFocus=function(){var e=this.contentDiv.ownerDocument.activeElement;return!(!e||!this.contentDiv.contains(e))},e.prototype.isRightToLeft=function(){var e,t=this.contentDiv,r=null===(e=t.ownerDocument.defaultView)||void 0===e?void 0:e.getComputedStyle(t);return"rtl"==(null==r?void 0:r.direction)},e.prototype.getClientWidth=function(){var e,t=this.contentDiv,r=null===(e=t.ownerDocument.defaultView)||void 0===e?void 0:e.getComputedStyle(t),o=(0,n.parseValueWithUnit)(null==r?void 0:r.paddingLeft),i=(0,n.parseValueWithUnit)(null==r?void 0:r.paddingRight);return this.contentDiv.clientWidth-(o+i)},e.prototype.getClonedRoot=function(){return this.contentDiv.cloneNode(!0)},e}();t.createDOMHelper=function(e){return new o(e)}},4416:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDarkColorHandler=void 0;var n=r(4990),o=function(){function e(e,t,r,n){this.root=e,this.getDarkColor=t,this.knownColors=r,this.generateColorKey=n}return e.prototype.updateKnownColor=function(e,t,r){var n=this;t&&r?(this.knownColors[t]||(this.knownColors[t]=r),e&&this.root.style.setProperty(t,r.darkModeColor)):e&&Object.keys(this.knownColors).forEach((function(e){n.root.style.setProperty(e,n.knownColors[e].darkModeColor)}))},e.prototype.reset=function(){var e=this;Object.keys(this.knownColors).forEach((function(t){e.root.style.removeProperty(t)}))},e}();t.createDarkColorHandler=function(e,t,r,i){return void 0===r&&(r={}),void 0===i&&(i=n.defaultGenerateColorKey),new o(e,t,r,i)}},3901:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDarkColorFallback=t.defaultTrustHtmlHandler=t.createEditorCore=void 0;var n=r(1635),o=r(4694),i=r(4416),a=r(2233),l=r(9092),s=r(4732);function c(e,t){var r,n,o,i=null===(r=e.ownerDocument.defaultView)||void 0===r?void 0:r.navigator,a=null!==(n=null==i?void 0:i.userAgent)&&void 0!==n?n:"",s=null!==(o=null==i?void 0:i.appVersion)&&void 0!==o?o:"";return{domToModelSettings:(0,l.createDomToModelSettings)(t),modelToDomSettings:(0,l.createModelToDomSettings)(t),isMac:-1!=s.indexOf("Mac"),isAndroid:/android/i.test(a),isSafari:a.indexOf("Safari")>=0&&a.indexOf("Chrome")<0&&a.indexOf("Android")<0,isMobileOrTablet:d(a)}}function d(e){return!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substring(0,4)))}function u(e){return e}function p(e){return e}t.createEditorCore=function(e,t){var r,l,d=(0,s.createEditorCorePlugins)(t,e);return(0,n.__assign)((0,n.__assign)({physicalRoot:e,logicalRoot:e,api:(0,n.__assign)((0,n.__assign)({},o.coreApiMap),t.coreApiOverride),originalApi:(0,n.__assign)({},o.coreApiMap),plugins:(0,n.__spreadArray)((0,n.__spreadArray)([d.cache,d.format,d.copyPaste,d.domEvent,d.selection,d.entity],(0,n.__read)((null!==(r=t.plugins)&&void 0!==r?r:[]).filter((function(e){return!!e}))),!1),[d.undo,d.contextMenu,d.lifecycle],!1),environment:c(e,t),darkColorHandler:(0,i.createDarkColorHandler)(e,null!==(l=t.getDarkColor)&&void 0!==l?l:p,t.knownColors,t.generateColorKey),trustedHTMLHandler:t.trustedHTMLHandler||u,domHelper:(0,a.createDOMHelper)(e)},function(e){return{domEvent:e.domEvent.getState(),copyPaste:e.copyPaste.getState(),cache:e.cache.getState(),format:e.format.getState(),lifecycle:e.lifecycle.getState(),entity:e.entity.getState(),selection:e.selection.getState(),contextMenu:e.contextMenu.getState(),undo:e.undo.getState()}}(d)),{disposeErrorHandler:t.disposeErrorHandler,experimentalFeatures:t.experimentalFeatures?(0,n.__spreadArray)([],(0,n.__read)(t.experimentalFeatures),!1):[]})},t.defaultTrustHtmlHandler=u,t.getDarkColorFallback=p},9092:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createModelToDomSettings=t.createDomToModelSettings=void 0;var n=r(4990),o=r(377),i=r(9946);t.createDomToModelSettings=function(e){var t,r={processorOverride:{table:o.tablePreProcessor}},i=null!==(t=e.defaultDomToModelOptions)&&void 0!==t?t:{};return{builtIn:r,customized:i,calculated:(0,n.createDomToModelConfig)([r,i])}},t.createModelToDomSettings=function(e){var t,r={metadataAppliers:{listItem:i.listItemMetadataApplier,listLevel:i.listLevelMetadataApplier}},o=null!==(t=e.defaultModelToDomOptions)&&void 0!==t?t:{};return{builtIn:r,customized:o,calculated:(0,n.createModelToDomConfig)([r,o])}}},3025:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.paste=t.redo=t.undo=t.exportContent=t.createModelFromHtml=t.Editor=void 0;var n=r(3550);Object.defineProperty(t,"Editor",{enumerable:!0,get:function(){return n.Editor}});var o=r(1724);Object.defineProperty(t,"createModelFromHtml",{enumerable:!0,get:function(){return o.createModelFromHtml}});var i=r(3980);Object.defineProperty(t,"exportContent",{enumerable:!0,get:function(){return i.exportContent}});var a=r(674);Object.defineProperty(t,"undo",{enumerable:!0,get:function(){return a.undo}});var l=r(5942);Object.defineProperty(t,"redo",{enumerable:!0,get:function(){return l.redo}});var s=r(292);Object.defineProperty(t,"paste",{enumerable:!0,get:function(){return s.paste}})},4764:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.containerSizeFormatParser=void 0,t.containerSizeFormatParser=function(e,t){"DIV"!=t.tagName&&"P"!=t.tagName||(delete e.width,delete e.height)}},9946:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listLevelMetadataApplier=t.listItemMetadataApplier=void 0;var n=r(4990),o=/\$\{(\w+)\}/;function i(e,t,r){if("OL"==e){var i=(0,n.getOrderedListNumberStr)(t,null!=r?r:1),a=n.OrderedListStyleMap[t];return a?a.replace(o,i):void 0}return n.UnorderedListStyleMap[t]}function a(e,t){var r="OL"==t?n.OrderedListStyleMap[e]:n.UnorderedListStyleMap[e];return(null==r?void 0:r.indexOf('"'))>=0}t.listItemMetadataApplier={metadataDefinition:n.ListMetadataDefinition,applierFunction:function(e,t,r){var o,l=r.listFormat.nodeStack.length-2;if(l>=0){var s=null!==(o=r.listFormat.nodeStack[l+1].listType)&&void 0!==o?o:"OL",c=(0,n.getAutoListStyleType)(s,null!=e?e:{},l);void 0!==c&&(a(c,s)?t.listStyleType=i(s,c,r.listFormat.threadItemCounts[l]):delete t.listStyleType)}}},t.listLevelMetadataApplier={metadataDefinition:n.ListMetadataDefinition,applierFunction:function(e,t,r){var o,l=r.listFormat.nodeStack.length-2;if(l>=0){var s=null!==(o=r.listFormat.nodeStack[l+1].listType)&&void 0!==o?o:"OL",c=(0,n.getAutoListStyleType)(s,null!=e?e:{},l);if(void 0!==c)if(a(c,s))delete t.listStyleType;else{var d=i(s,c,r.listFormat.threadItemCounts[l]);d&&(t.listStyleType=d)}}}}},8219:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pasteBlockEntityParser=t.onCreateCopyEntityNode=void 0;var n=r(4990),o="_EBlock",i="100%",a="inline-block";t.onCreateCopyEntityNode=function(e,t){var r=e;r&&r.wrapper&&"Entity"==r.blockType&&(0,n.isNodeOfType)(t,"ELEMENT_NODE")&&(0,n.isElementOfType)(t,"div")&&!(0,n.isBlockElement)(r.wrapper)&&r.wrapper.style.display==a&&r.wrapper.style.width==i&&(t.classList.add(o),t.style.display="block",t.style.width="")},t.pasteBlockEntityParser=function(e,t){t.classList.contains(o)&&(t.classList.remove(o),t.style.display=a,t.style.width=i)}},8735:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pasteDisplayFormatParser=void 0,t.pasteDisplayFormatParser=function(e,t){var r=t.style.display;r&&"flex"!=r&&(e.display=r)}},3912:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPasteEntityProcessor=void 0;var n=r(6973),o={position:!1};t.createPasteEntityProcessor=function(e){var t=n.AllowedTags.concat(e.additionalAllowedTags),r=n.DisallowedTags.concat(e.additionalDisallowedTags),i=Object.assign({},o,e.styleSanitizers),a=e.attributeSanitizers;return function(e,o,l){var s=(0,n.sanitizeElement)(o,t,r,i,a);s&&l.defaultElementProcessors.entity(e,s,l)}}},7801:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPasteGeneralProcessor=t.removeDisplayFlex=void 0;var n=r(4990),o=r(6973);t.removeDisplayFlex=function(e){return"flex"==e?null:e};var i={position:!1,display:t.removeDisplayFlex};t.createPasteGeneralProcessor=function(e){var t=o.AllowedTags.concat(e.additionalAllowedTags),r=o.DisallowedTags.concat(e.additionalDisallowedTags),a=Object.assign({},i,e.styleSanitizers),l=e.attributeSanitizers;return function(e,i,s){var c=i.tagName.toLowerCase(),d=t.indexOf(c)>=0?function(e,t,r){var i,s,c=(0,o.createSanitizedElement)(t.ownerDocument,t.tagName,t.attributes,a,l);(0,n.moveChildNodes)(c,t),null===(s=(i=r.defaultElementProcessors)["*"])||void 0===s||s.call(i,e,c,r)}:r.indexOf(c)>=0?void 0:s.defaultElementProcessors.span;null==d||d(e,i,s)}}},9724:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pasteTextProcessor=void 0;var n=r(4990);t.pasteTextProcessor=function(e,t,r){var o,i,a=r.blockFormat.whiteSpace;(0,n.isWhiteSpacePreserved)(a)&&(t.nodeValue=null!==(i=null===(o=t.nodeValue)||void 0===o?void 0:o.replace(/\u0020\u0020/g,"  "))&&void 0!==i?i:""),r.defaultElementProcessors["#text"](e,t,r)}},377:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tablePreProcessor=void 0;var n=r(4990);t.tablePreProcessor=function(e,t,r){var o=function(e,t){var r=(0,n.getSelectionRootNode)(t.selection);return(0,n.hasMetadata)(e)||t.isInSelection||r&&e.contains(r)}(t,r)?n.tableProcessor:n.entityProcessor;o(e,t,r)}},1782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAriaLiveElement=void 0,t.createAriaLiveElement=function(e){var t=e.createElement("div");return t.style.clip="rect(0px, 0px, 0px, 0px)",t.style.clipPath="inset(100%)",t.style.height="1px",t.style.overflow="hidden",t.style.position="absolute",t.style.whiteSpace="nowrap",t.style.width="1px",t.ariaLive="assertive",e.body.appendChild(t),t}},2355:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultContentModelFormatMap=void 0,t.defaultContentModelFormatMap={a:{underline:!0,textColor:void 0},blockquote:{marginTop:"1em",marginBottom:"1em",marginLeft:"40px",marginRight:"40px"},code:{fontFamily:"monospace"},h1:{fontWeight:"bold",fontSize:"2em"},h2:{fontWeight:"bold",fontSize:"1.5em"},h3:{fontWeight:"bold",fontSize:"1.17em"},h4:{fontWeight:"bold",fontSize:"1em"},h5:{fontWeight:"bold",fontSize:"0.83em"},h6:{fontWeight:"bold",fontSize:"0.67em"},p:{marginTop:"1em",marginBottom:"1em"},pre:{fontFamily:"monospace",whiteSpace:"pre",marginTop:"1em",marginBottom:"1em"}}},7668:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultHTMLStyleMap=void 0;var n=r(1635),o={display:"block"};t.defaultHTMLStyleMap={address:o,article:o,aside:o,b:{fontWeight:"bold"},blockquote:{display:"block",marginTop:"1em",marginBottom:"1em",marginLeft:"40px",marginRight:"40px"},br:o,center:{display:"block",textAlign:"center"},dd:o,div:o,dl:o,dt:o,em:{fontStyle:"italic"},fieldset:o,figcaption:o,figure:o,footer:o,form:o,h1:{display:"block",fontWeight:"bold",fontSize:"2em"},h2:{display:"block",fontWeight:"bold",fontSize:"1.5em"},h3:{display:"block",fontWeight:"bold",fontSize:"1.17em"},h4:{display:"block",fontWeight:"bold"},h5:{display:"block",fontWeight:"bold",fontSize:"0.83em"},h6:{display:"block",fontWeight:"bold",fontSize:"0.67em"},header:o,hr:o,i:{fontStyle:"italic"},li:{display:"list-item"},main:o,nav:o,ol:(0,n.__assign)((0,n.__assign)({},o),{paddingInlineStart:"40px"}),p:{display:"block",marginTop:"1em",marginBottom:"1em"},pre:{display:"block",fontFamily:"monospace",whiteSpace:"pre",marginTop:"1em",marginBottom:"1em"},s:{textDecoration:"line-through"},section:o,strike:{textDecoration:"line-through"},strong:{fontWeight:"bold"},sub:{verticalAlign:"sub",fontSize:"smaller"},sup:{verticalAlign:"super",fontSize:"smaller"},table:{display:"table",boxSizing:"border-box"},td:{display:"table-cell"},th:{display:"table-cell"},u:{textDecoration:"underline"},ul:(0,n.__assign)((0,n.__assign)({},o),{paddingInlineStart:"40px"})}},602:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BulletListType=void 0,t.BulletListType={Min:1,Disc:1,Dash:2,Square:3,ShortArrow:4,LongArrow:5,UnfilledArrow:6,Hyphen:7,DoubleLongArrow:8,Circle:9,Max:9}},8187:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChangeSource=void 0,t.ChangeSource={AutoLink:"AutoLink",CreateLink:"CreateLink",Format:"Format",ImageResize:"ImageResize",Paste:"Paste",SetContent:"SetContent",Cut:"Cut",Drop:"Drop",InsertEntity:"InsertEntity",SwitchToDarkMode:"SwitchToDarkMode",SwitchToLightMode:"SwitchToLightMode",ListChain:"ListChain",Keyboard:"Keyboard",AutoFormat:"AutoFormat"}},5287:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmptySegmentFormat=void 0,t.EmptySegmentFormat={backgroundColor:"",fontFamily:"",fontSize:"",fontWeight:"",italic:!1,letterSpacing:"",lineHeight:"",strikethrough:!1,superOrSubScriptSequence:"",textColor:"",underline:!1}},5043:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NumberingListType=void 0,t.NumberingListType={Min:1,Decimal:1,DecimalDash:2,DecimalParenthesis:3,DecimalDoubleParenthesis:4,LowerAlpha:5,LowerAlphaParenthesis:6,LowerAlphaDoubleParenthesis:7,LowerAlphaDash:8,UpperAlpha:9,UpperAlphaParenthesis:10,UpperAlphaDoubleParenthesis:11,UpperAlphaDash:12,LowerRoman:13,LowerRomanParenthesis:14,LowerRomanDoubleParenthesis:15,LowerRomanDash:16,UpperRoman:17,UpperRomanParenthesis:18,UpperRomanDoubleParenthesis:19,UpperRomanDash:20,Max:20}},3180:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.OrderedListStyleMap=void 0;var o=r(5043);t.OrderedListStyleMap=((n={})[o.NumberingListType.Decimal]="decimal",n[o.NumberingListType.DecimalDash]='"${Number}- "',n[o.NumberingListType.DecimalParenthesis]='"${Number}) "',n[o.NumberingListType.DecimalDoubleParenthesis]='"(${Number}) "',n[o.NumberingListType.LowerAlpha]="lower-alpha",n[o.NumberingListType.LowerAlphaDash]='"${LowerAlpha}- "',n[o.NumberingListType.LowerAlphaParenthesis]='"${LowerAlpha}) "',n[o.NumberingListType.LowerAlphaDoubleParenthesis]='"(${LowerAlpha}) "',n[o.NumberingListType.UpperAlpha]="upper-alpha",n[o.NumberingListType.UpperAlphaDash]='"${UpperAlpha}- "',n[o.NumberingListType.UpperAlphaParenthesis]='"${UpperAlpha}) "',n[o.NumberingListType.UpperAlphaDoubleParenthesis]='"(${UpperAlpha}) "',n[o.NumberingListType.LowerRoman]="lower-roman",n[o.NumberingListType.LowerRomanDash]='"${LowerRoman}- "',n[o.NumberingListType.LowerRomanParenthesis]='"${LowerRoman}) "',n[o.NumberingListType.LowerRomanDoubleParenthesis]='"(${LowerRoman}) "',n[o.NumberingListType.UpperRoman]="upper-roman",n[o.NumberingListType.UpperRomanDash]='"${UpperRoman}- "',n[o.NumberingListType.UpperRomanParenthesis]='"${UpperRoman}) "',n[o.NumberingListType.UpperRomanDoubleParenthesis]='"(${UpperRoman}) "',n)},6705:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TableBorderFormat=void 0,t.TableBorderFormat={Min:0,Default:0,ListWithSideBorders:1,NoHeaderBorders:2,NoSideBorders:3,FirstColumnHeaderExternal:4,EspecialType1:5,EspecialType2:6,EspecialType3:7,Clear:8,Max:8}},2901:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.UnorderedListStyleMap=void 0;var o=r(602);t.UnorderedListStyleMap=((n={})[o.BulletListType.Disc]="disc",n[o.BulletListType.Square]='"∎ "',n[o.BulletListType.Circle]="circle",n[o.BulletListType.Dash]='"- "',n[o.BulletListType.LongArrow]='"➔ "',n[o.BulletListType.DoubleLongArrow]='"➔ "',n[o.BulletListType.ShortArrow]='"➢ "',n[o.BulletListType.UnfilledArrow]='"➪ "',n[o.BulletListType.Hyphen]='"— "',n)},7404:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildFormatParsers=t.createDomToModelConfig=t.createDomToModelContextWithConfig=t.createDomToModelContext=void 0;var n=r(1635),o=r(8953),i=r(1081),a=r(1506);function l(e,t){return Object.assign({},t,{isInSelection:!1},{blockFormat:(null==t?void 0:t.isRootRtl)?{direction:"rtl"}:{},segmentFormat:{},listFormat:{levels:[],threadItemCounts:[]}},{link:{format:{},dataset:{}},code:{format:{}},blockDecorator:{format:{},tagName:""}},e)}function s(e){return{elementProcessors:Object.assign.apply(Object,(0,n.__spreadArray)([{},o.defaultProcessorMap],(0,n.__read)(e.map((function(e){return null==e?void 0:e.processorOverride}))),!1)),formatParsers:c(e.map((function(e){return null==e?void 0:e.formatParserOverride})),e.map((function(e){return null==e?void 0:e.additionalFormatParsers}))),defaultElementProcessors:o.defaultProcessorMap,defaultFormatParsers:a.defaultFormatParsers}}function c(e,t){void 0===e&&(e=[]),void 0===t&&(t=[]);var r=Object.assign.apply(Object,(0,n.__spreadArray)([{}],(0,n.__read)(e),!1)),o=(0,i.getObjectKeys)(a.defaultFormatKeysPerCategory).reduce((function(e,o){var i,l=(i=a.defaultFormatKeysPerCategory[o].map((function(e){return void 0===r[e]?a.defaultFormatParsers[e]:r[e]}))).concat.apply(i,(0,n.__spreadArray)([],(0,n.__read)(t.map((function(e){var t;return null!==(t=null==e?void 0:e[o])&&void 0!==t?t:[]}))),!1));return e[o]=l,e}),{text:[]});return t.forEach((function(e){(null==e?void 0:e.text)&&(o.text=o.text.concat(e.text))})),o}t.createDomToModelContext=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return l(s(t),e)},t.createDomToModelContextWithConfig=l,t.createDomToModelConfig=s,t.buildFormatParsers=c},8953:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultProcessorMap=void 0;var n=r(9143),o=r(4225),i=r(852),a=r(5624),l=r(5771),s=r(2670),c=r(2960),d=r(8197),u=r(651),p=r(5973),f=r(7301),m=r(9108),g=r(9112),h=r(1963),v=r(3986),y=r(5263),b=r(4207),S=r(3815),C=r(8510),_=r(4378);t.defaultProcessorMap={a:h.linkProcessor,b:g.knownElementProcessor,blockquote:g.knownElementProcessor,br:n.brProcessor,code:i.codeProcessor,del:g.knownElementProcessor,div:g.knownElementProcessor,em:g.knownElementProcessor,font:c.fontProcessor,i:g.knownElementProcessor,img:m.imageProcessor,h1:p.headingProcessor,h2:p.headingProcessor,h3:p.headingProcessor,h4:p.headingProcessor,h5:p.headingProcessor,h6:p.headingProcessor,hr:f.hrProcessor,li:v.listItemProcessor,ol:y.listProcessor,p:b.pProcessor,pre:d.formatContainerProcessor,s:g.knownElementProcessor,section:g.knownElementProcessor,span:g.knownElementProcessor,strike:g.knownElementProcessor,strong:g.knownElementProcessor,sub:g.knownElementProcessor,sup:g.knownElementProcessor,table:S.tableProcessor,u:g.knownElementProcessor,ul:y.listProcessor,"*":u.generalProcessor,"#text":C.textProcessor,textWithSelection:_.textWithSelectionProcessor,element:l.elementProcessor,entity:s.entityProcessor,child:o.childProcessor,delimiter:a.delimiterProcessor}},4598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.domToContentModel=void 0;var n=r(7357),o=r(8941);t.domToContentModel=function(e,t){var r,i=(0,n.createContentModelDocument)(t.defaultFormat);return"range"==(null===(r=t.selection)||void 0===r?void 0:r.type)&&t.selection.isReverted&&(i.hasRevertedRangeSelection=!0),t.domIndexer&&t.allowCacheElement&&(i.persistCache=!0),t.elementProcessors.child(i,e,t),(0,o.normalizeContentModel)(i),i}},5180:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.blockProcessor=void 0;var n=r(1635),o=r(2394),i=r(8197),a=r(5450),l=r(1839),s=["A","CODE"];t.blockProcessor=function(e,t,r,c){var d=r.blockDecorator.tagName?r.blockDecorator:void 0,u=s.indexOf(t.tagName)>=0;(0,l.parseFormat)(t,r.formatParsers.block,r.blockFormat,r);var p=(0,n.__assign)({},r.blockFormat);if((0,l.parseFormat)(t,r.formatParsers.container,p,r),i.ContextStyles.forEach((function(e){p[e]&&(r.blockFormat[e]=p[e])})),!u){var f=(0,a.createParagraph)(!1,p,c,d);(0,o.addBlock)(e,f)}r.elementProcessors.child(e,t,r)}},9143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.brProcessor=void 0;var n=r(1635),o=r(5142),i=r(4814),a=r(7441);t.brProcessor=function(e,t,r){var l,s=(0,i.createBr)(r.segmentFormat),c=(0,n.__read)((0,a.getRegularSelectionOffsets)(r,t),2),d=c[0],u=c[1];d>=0&&(r.isInSelection=!0),r.isInSelection&&(s.isSelected=!0);var p=(0,o.addSegment)(e,s,r.blockFormat);u>=0&&(r.isInSelection=!1),null===(l=r.domIndexer)||void 0===l||l.onSegment(t,p,[s])}},4225:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleRegularSelection=t.processChildNode=t.childProcessor=void 0;var n=r(1635),o=r(1246),i=r(7441),a=r(7057);function l(e,t,r){(0,a.isNodeOfType)(t,"ELEMENT_NODE")&&"none"!=t.style.display?r.elementProcessors.element(e,t,r):(0,a.isNodeOfType)(t,"TEXT_NODE")&&r.elementProcessors["#text"](e,t,r)}function s(e,t,r,n,i,a){var l;e==n&&(t.isInSelection=!0,(0,o.addSelectionMarker)(r,t,a,e)),e==i&&"range"==(null===(l=t.selection)||void 0===l?void 0:l.type)&&(t.selection.range.collapsed||(0,o.addSelectionMarker)(r,t,a,e),t.isInSelection=!1)}t.childProcessor=function(e,t,r){for(var o=(0,n.__read)((0,i.getRegularSelectionOffsets)(r,t),2),a=o[0],c=o[1],d=0,u=t.firstChild;u;u=u.nextSibling)s(d,r,e,a,c,t),l(e,u,r),d++;s(d,r,e,a,c,t)},t.processChildNode=l,t.handleRegularSelection=s},852:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.codeProcessor=void 0;var n=r(9112),o=r(1839),i=r(2764);t.codeProcessor=function(e,t,r){(0,i.stackFormat)(r,{code:"codeDefault"},(function(){(0,o.parseFormat)(t,r.formatParsers.code,r.code.format,r),(0,n.knownElementProcessor)(e,t,r)}))}},5624:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delimiterProcessor=void 0;var n=r(1246);t.delimiterProcessor=function(e,t,r){var o,i,a="range"==(null===(o=r.selection)||void 0===o?void 0:o.type)?r.selection.range:null;a&&(t.contains(a.startContainer)&&(r.isInSelection=!0,(0,n.addSelectionMarker)(e,r)),"range"==(null===(i=r.selection)||void 0===i?void 0:i.type)&&t.contains(a.endContainer)&&(r.selection.range.collapsed||(0,n.addSelectionMarker)(e,r),r.isInSelection=!1))}},5771:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.elementProcessor=void 0;var n=r(4134);t.elementProcessor=function(e,t,r){var o=t.tagName.toLowerCase(),i=function(e,t){return(0,n.isEntityElement)(e)||"false"==e.contentEditable?t.elementProcessors.entity:null}(t,r)||function(e,t){return(0,n.isEntityDelimiter)(e)?t.elementProcessors.delimiter:null}(t,r)||r.elementProcessors[o]||o.indexOf(":")>=0&&r.elementProcessors.child||r.elementProcessors["*"];i(e,t,r)}},2670:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.entityProcessor=void 0;var n=r(2394),o=r(5142),i=r(5681),a=r(7448),l=r(1839),s=r(2764);t.entityProcessor=function(e,t,r){var c=(0,a.isBlockElement)(t)||"inline-block"==t.style.display&&"100%"==t.style.width;(0,s.stackFormat)(r,{segment:c?"empty":void 0,paragraph:"empty"},(function(){var a,s=(0,i.createEntity)(t,!0,r.segmentFormat);if((0,l.parseFormat)(t,r.formatParsers.entity,s.entityFormat,r),r.isInSelection&&(s.isSelected=!0),c)(0,n.addBlock)(e,s);else{var d=(0,o.addSegment)(e,s);null===(a=r.domIndexer)||void 0===a||a.onSegment(t,d,[s])}}))}},2960:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fontProcessor=void 0;var n=r(7448),o=r(1839),i=r(2764),a=["10px","13px","16px","18px","24px","32px","48px"];t.fontProcessor=function(e,t,r){(0,i.stackFormat)(r,{segment:(0,n.isBlockElement)(t)?"shallowCloneForBlock":"shallowClone"},(function(){var n,i,l=t.getAttribute("face"),s=(n=t.getAttribute("size"),i=parseInt(n||""),Number.isNaN(i)?void 0:i<1?a[0]:i>a.length?a[a.length-1]:a[i-1]),c=t.getAttribute("color"),d=r.segmentFormat;l&&(d.fontFamily=l),s&&(d.fontSize=s),c&&(d.textColor=c),(0,o.parseFormat)(t,r.formatParsers.segment,r.segmentFormat,r),r.elementProcessors.child(e,t,r)}))}},8197:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatContainerProcessor=t.ContextStyles=void 0;var n=r(1635),o=r(2394),i=r(5470),a=r(5450),l=r(3825),s=r(1839),c=r(7958),d=r(2764);t.ContextStyles=["marginLeft","marginRight","paddingLeft","paddingRight"],t.formatContainerProcessor=function(e,r,u){(0,d.stackFormat)(u,{segment:"shallowCloneForBlock",paragraph:"shallowClone"},(function(){(0,s.parseFormat)(r,u.formatParsers.block,u.blockFormat,u),(0,s.parseFormat)(r,u.formatParsers.segmentOnBlock,u.segmentFormat,u);var a=(0,n.__assign)({},u.blockFormat);(0,s.parseFormat)(r,u.formatParsers.container,a,u);var d="block"==(0,l.getDefaultStyle)(r).display?r.tagName.toLowerCase():"div",p=(0,i.createFormatContainer)(d,a);if(t.ContextStyles.forEach((function(e){delete u.blockFormat[e]})),u.elementProcessors.child(p,r,u),r.style.fontSize&&0==parseInt(r.style.fontSize)&&(p.zeroFontSize=!0),function(e){var t=e.blocks[0];return"div"==e.tagName&&1==e.blocks.length&&"Paragraph"==t.blockType&&t.isImplicit}(p)){var f=p.blocks[0];p.zeroFontSize&&(f.segmentFormat=Object.assign({},f.segmentFormat,{fontSize:"0"})),Object.assign(f.format,p.format),(0,c.setParagraphNotImplicit)(f),(0,o.addBlock)(e,f)}else(0,o.addBlock)(e,p)})),(0,o.addBlock)(e,(0,a.createParagraph)(!0,u.blockFormat))}},651:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generalProcessor=void 0;var n=r(2394),o=r(9849),i=r(5142),a=r(5219),l=r(7431),s=r(7448),c=r(1839),d=r(2764),u=function(e,t,r){var o=(0,a.createGeneralBlock)(t),i=r.isInSelection;(0,d.stackFormat)(r,{segment:"empty",paragraph:"empty",link:"empty"},(function(){(0,n.addBlock)(e,o),(0,c.parseFormat)(t,r.formatParsers.general,o.format,r),r.elementProcessors.child(o,t,r)})),i&&r.isInSelection&&(o.isSelected=!0)},p=function(e,t,r){var n,a=(0,l.createGeneralSegment)(t,r.segmentFormat),s=r.isInSelection;(0,o.addDecorators)(a,r);var u=(0,i.addSegment)(e,a);null===(n=r.domIndexer)||void 0===n||n.onSegment(t,u,[a]),(0,d.stackFormat)(r,{segment:"empty"},(function(){(0,c.parseFormat)(t,r.formatParsers.general,a.format,r),r.elementProcessors.child(a,t,r)})),s&&r.isInSelection&&(a.isSelected=!0)};t.generalProcessor=function(e,t,r){((0,s.isBlockElement)(t)?u:p)(e,t,r)}},5973:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.headingProcessor=void 0;var n=r(2394),o=r(5180),i=r(5450),a=r(6357),l=r(1081),s=r(1839),c=r(2764);t.headingProcessor=function(e,t,r){(0,c.stackFormat)(r,{segment:"shallowCloneForBlock",paragraph:"shallowClone",blockDecorator:"empty"},(function(){var n={};(0,s.parseFormat)(t,r.formatParsers.segmentOnBlock,n,r),(0,l.getObjectKeys)(n).forEach((function(e){delete r.segmentFormat[e]})),r.blockDecorator=(0,a.createParagraphDecorator)(t.tagName,n),(0,o.blockProcessor)(e,t,r)})),(0,n.addBlock)(e,(0,i.createParagraph)(!0,r.blockFormat))}},7301:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hrProcessor=void 0;var n=r(2394),o=r(6133),i=r(1839),a=r(2764);t.hrProcessor=function(e,t,r){(0,a.stackFormat)(r,{paragraph:"shallowClone"},(function(){(0,i.parseFormat)(t,r.formatParsers.divider,r.blockFormat,r);var a=(0,o.createDivider)("hr",r.blockFormat);t.size&&(a.size=t.size),r.isInSelection&&(a.isSelected=!0),(0,n.addBlock)(e,a)}))}},9108:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.imageProcessor=void 0;var n=r(9849),o=r(5142),i=r(6349),a=r(1839),l=r(2764);t.imageProcessor=function(e,t,r){(0,l.stackFormat)(r,{segment:"shallowClone"},(function(){var l,s,c,d=r.segmentFormat,u=null!==(l=t.getAttribute("src"))&&void 0!==l?l:"";(0,a.parseFormat)(t,r.formatParsers.segment,d,r),(0,a.parseFormat)(t,r.formatParsers.image,d,r),(0,a.parseFormat)(t,r.formatParsers.block,r.blockFormat,r);var p=(0,i.createImage)(u,d),f=t.alt,m=t.title;(0,a.parseFormat)(t,r.formatParsers.dataset,p.dataset,r),(0,n.addDecorators)(p,r),f&&(p.alt=f),m&&(p.title=m),r.isInSelection&&(p.isSelected=!0),"image"==(null===(s=r.selection)||void 0===s?void 0:s.type)&&r.selection.image==t&&(p.isSelectedAsImageSelection=!0,p.isSelected=!0);var g=(0,o.addSegment)(e,p);null===(c=r.domIndexer)||void 0===c||c.onSegment(t,g,[p])}))}},9112:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.knownElementProcessor=void 0;var n=r(2394),o=r(5180),i=r(5450),a=r(8197),l=r(3825),s=r(7448),c=r(1839),d=r(2764),u=["marginBottom","marginTop","paddingBottom","paddingTop","paddingLeft","paddingRight","borderTopWidth","borderBottomWidth","borderLeftWidth","borderRightWidth","width","height","maxWidth","maxHeight","minWidth","minHeight"],p=["H1","H2","H3","H4","H5","H6","P","A"],f=["A","CODE"];t.knownElementProcessor=function(e,t,r){var m=(0,s.isBlockElement)(t);if((m||"inline-block"==t.style.display)&&function(e){if(p.indexOf(e.tagName)>=0)return!1;var t=e.style,r=(0,l.getDefaultStyle)(e),n=t.getPropertyValue("background-color");return!(!n||"transparent"==n)||(!!u.some((function(e){return parseInt(t[e]||r[e]||"")>0}))||("auto"==t.marginLeft||"auto"==t.marginRight||!!e.getAttribute("align")))}(t))(0,a.formatContainerProcessor)(e,t,r);else if(m){var g=r.blockDecorator.tagName?r.blockDecorator:void 0,h=f.indexOf(t.tagName)>=0;(0,d.stackFormat)(r,{segment:"shallowCloneForBlock",paragraph:"shallowClone"},(function(){var n={};(0,c.parseFormat)(t,r.formatParsers.segmentOnBlock,n,r),Object.assign(r.segmentFormat,n),(0,o.blockProcessor)(e,t,r,n)})),m&&!h&&(0,n.addBlock)(e,(0,i.createParagraph)(!0,r.blockFormat,void 0,g))}else(0,d.stackFormat)(r,{segment:"shallowClone",paragraph:"shallowClone",link:"cloneFormat"},(function(){(0,c.parseFormat)(t,r.formatParsers.segment,r.segmentFormat,r),r.link.format.href&&"A"!=t.tagName&&(0,c.parseFormat)(t,r.formatParsers.segmentUnderLink,r.link.format,r),r.elementProcessors.child(e,t,r)}))}},1963:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.linkProcessor=void 0;var n=r(9112),o=r(1839),i=r(2764);t.linkProcessor=function(e,t,r){t.hasAttribute("href")?(0,i.stackFormat)(r,{link:"linkDefault"},(function(){(0,o.parseFormat)(t,r.formatParsers.link,r.link.format,r),(0,o.parseFormat)(t,r.formatParsers.dataset,r.link.dataset,r),(0,n.knownElementProcessor)(e,t,r)})):(0,n.knownElementProcessor)(e,t,r)}},3986:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listItemProcessor=void 0;var n=r(6953),o=r(1839),i=r(2764);t.listItemProcessor=function(e,t,r){var a,l=r.listFormat;if(l.listParent&&l.levels.length>0)(0,i.stackFormat)(r,{segment:"shallowCloneForBlock"},(function(){(0,o.parseFormat)(t,r.formatParsers.segmentOnBlock,r.segmentFormat,r);var e=(0,n.createListItem)(l.levels,r.segmentFormat);(0,o.parseFormat)(t,r.formatParsers.listItemElement,e.format,r),l.listParent.blocks.push(e),(0,o.parseFormat)(t,r.formatParsers.listItemThread,e.levels[e.levels.length-1].format,r),r.elementProcessors.child(e,t,r);var i=e.blocks[0];1==e.blocks.length&&"Paragraph"==i.blockType&&i.isImplicit&&(Object.assign(e.format,i.format),i.format={})}));else{var s=null===(a=l.listParent)||void 0===a?void 0:a.blocks,c=null==s?void 0:s[(null==s?void 0:s.length)-1];r.elementProcessors["*"]("BlockGroup"==(null==c?void 0:c.blockType)?c:e,t,r)}}},5263:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listProcessor=void 0;var n=r(598),o=r(1839),i=r(2764);t.listProcessor=function(e,t,r){(0,i.stackFormat)(r,{segment:"shallowCloneForBlock",paragraph:"shallowCloneForGroup"},(function(){var i=(0,n.createListLevel)(t.tagName,r.blockFormat),a=r.listFormat;(0,o.parseFormat)(t,r.formatParsers.dataset,i.dataset,r),(0,o.parseFormat)(t,r.formatParsers.listLevelThread,i.format,r),(0,o.parseFormat)(t,r.formatParsers.listLevel,i.format,r),(0,o.parseFormat)(t,r.formatParsers.segment,r.segmentFormat,r);var l=a.listParent;a.listParent=a.listParent||e,a.levels.push(i);try{r.elementProcessors.child(e,t,r)}finally{a.levels.pop(),a.listParent=l}}))}},4207:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pProcessor=void 0;var n=r(2394),o=r(5180),i=r(5450),a=r(6357),l=r(1839),s=r(2764);t.pProcessor=function(e,t,r){(0,s.stackFormat)(r,{blockDecorator:"empty",segment:"shallowCloneForBlock",paragraph:"shallowClone"},(function(){r.blockDecorator=(0,a.createParagraphDecorator)(t.tagName);var n={};(0,l.parseFormat)(t,r.formatParsers.segmentOnBlock,n,r),Object.assign(r.segmentFormat,n),(0,o.blockProcessor)(e,t,r,n)})),(0,n.addBlock)(e,(0,i.createParagraph)(!0,r.blockFormat))}},3815:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tableProcessor=void 0;var n=r(1635),o=r(2394),i=r(1728),a=r(7720),l=r(7398),s=r(8907),c=r(7057),d=r(1839),u=r(861),p=r(2764);function f(e){for(var t=[],r=0,n=e.length-1;n>=0;n--)if("number"==typeof(o=e[n])){r=o;break}for(n=e.length-2;n>=0;n--){var o;void 0===(o=e[n])?t[n]=0:(t[n]=r-o,r=o)}return t}t.tableProcessor=function(e,t,r){(0,p.stackFormat)(r,{segment:"shallowCloneForBlock",paragraph:"shallowCloneForGroup"},(function(){var m,g;(0,d.parseFormat)(t,r.formatParsers.block,r.blockFormat,r);var h=(0,i.createTable)(t.rows.length,r.blockFormat),v="table"==(null===(m=r.selection)||void 0===m?void 0:m.type)?r.selection:null,y=(null==v?void 0:v.table)==t;r.allowCacheElement&&(h.cachedElement=t),null===(g=r.domIndexer)||void 0===g||g.onTable(t,h),(0,d.parseFormat)(t,r.formatParsers.table,h.format,r),(0,d.parseFormat)(t,r.formatParsers.tableBorder,h.format,r),(0,d.parseFormat)(t,r.formatParsers.segmentOnBlock,r.segmentFormat,r),(0,d.parseFormat)(t,r.formatParsers.dataset,h.dataset,r),(0,o.addBlock)(e,h);for(var b=[0],S=function(e,t,r){for(var n,o,i=0,a=!1,l=e.firstChild;l;l=l.nextSibling)if((0,c.isNodeOfType)(l,"ELEMENT_NODE")&&"COLGROUP"==l.tagName){a=!0;for(var s=l.firstChild;s;s=s.nextSibling)if((0,c.isNodeOfType)(s,"ELEMENT_NODE")&&"COL"==s.tagName){var p={};(0,d.parseFormat)(s,t.formatParsers.tableColumn,p,t);for(var f=0;f<parseInt(null!==(n=s.getAttribute("span"))&&void 0!==n?n:"1");f++)if(void 0===p.width)r.push(void 0);else{var m=(0,u.parseValueWithUnit)(null!==(o=p.width)&&void 0!==o?o:"",void 0,"px");r.push(m+i),i+=m}}}return a}(t,r,b),C=[0],_=r.zoomScale||1,E=function(e){var o=t.rows[e],i=h.rows[e],u=o.parentNode;(0,c.isNodeOfType)(u,"ELEMENT_NODE")&&((0,s.isElementOfType)(u,"tbody")||(0,s.isElementOfType)(u,"thead")||(0,s.isElementOfType)(u,"tfoot"))?(0,d.parseFormat)(u,r.formatParsers.tableRow,i.format,r):r.allowCacheElement&&(i.cachedElement=o),(0,d.parseFormat)(o,r.formatParsers.tableRow,i.format,r),(0,p.stackFormat)(r,{paragraph:"shallowClone",segment:"shallowClone"},(function(){var t=o.parentElement,s=null==t?void 0:t.tagName;!t||"TBODY"!=s&&"THEAD"!=s&&"TFOOT"!=s||((0,d.parseFormat)(t,r.formatParsers.block,r.blockFormat,r),(0,d.parseFormat)(t,r.formatParsers.segmentOnBlock,r.segmentFormat,r)),(0,d.parseFormat)(o,r.formatParsers.block,r.blockFormat,r),(0,d.parseFormat)(o,r.formatParsers.segmentOnBlock,r.segmentFormat,r);for(var c,u=function(t,s){for(;i.cells[s];s++);var u=o.cells[t],f=r.isInSelection,m=s+u.colSpan,g=e+u.rowSpan,E=void 0===b[m],T=void 0===C[g];if(E||T){var k=(0,l.getBoundingClientRect)(u);if(k.width>0||k.height>0){if(E){var M=b[s];b[m]=("number"==typeof M?M:0)+k.width/_}T&&(C[g]=C[e]+k.height/_)}}(0,p.stackFormat)(r,{paragraph:"shallowClone",segment:"shallowClone"},(function(){(0,d.parseFormat)(u,r.formatParsers.block,r.blockFormat,r),(0,d.parseFormat)(u,r.formatParsers.segmentOnTableCell,r.segmentFormat,r);var t=(0,n.__assign)({},r.blockFormat),o={};(0,d.parseFormat)(u,r.formatParsers.tableCell,t,r),(0,d.parseFormat)(u,r.formatParsers.tableBorder,t,r),(0,d.parseFormat)(u,r.formatParsers.dataset,o,r);for(var i=1;i<=u.colSpan;i++,s++)for(var l=1;l<=u.rowSpan;l++){var c=1==i&&1==l,p=(0,a.createTableCell)(i>1,l>1,"TH"==u.tagName,t);p.dataset=(0,n.__assign)({},o);var m=h.rows[e+l-1];if(m&&(m.cells[s]=p),c){r.allowCacheElement&&!S&&(p.cachedElement=u);var g=r.listFormat,b=g.listParent,C=g.levels;r.listFormat.listParent=void 0,r.listFormat.levels=[];try{r.elementProcessors.child(p,u,r)}finally{r.listFormat.listParent=b,r.listFormat.levels=C}}var _=r.isInSelection;(f&&_||y&&v&&e>=v.firstRow&&e<=v.lastRow&&s>=v.firstColumn&&s<=v.lastColumn)&&(p.isSelected=!0)}})),c=s},f=0,m=0;f<o.cells.length;f++)u(f,m),m=c}));for(var f=0;f<i.cells.length;f++)i.cells[f]||(i.cells[f]=(0,a.createTableCell)(!1,!1,!1,r.blockFormat))},T=0;T<t.rows.length;T++)E(T);h.widths=f(b);var k=f(C);h.rows.forEach((function(e,t){k[t]>0&&(e.height=k[t])}))}))}},8510:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textProcessor=void 0;var n=r(8276),o=r(2764);function i(e,t,r){var o,i=(0,n.ensureParagraph)(e,r.blockFormat),a=i.segments.length;r.elementProcessors.textWithSelection(e,t,r);var l=i.segments.slice(a);null===(o=r.domIndexer)||void 0===o||o.onSegment(t,i,l.filter((function(e){return"Text"==(null==e?void 0:e.segmentType)})))}t.textProcessor=function(e,t,r){r.formatParsers.text.length>0?(0,o.stackFormat)(r,{segment:"shallowClone"},(function(){r.formatParsers.text.forEach((function(n){n(r.segmentFormat,t,r),i(e,t,r)}))})):i(e,t,r)}},4378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textWithSelectionProcessor=void 0;var n=r(1246),o=r(7423),i=r(7441);t.textWithSelectionProcessor=function(e,t,r){var a=t.nodeValue||"",l=(0,i.getRegularSelectionOffsets)(r,t),s=l[0],c=l[1];if(s>=0){var d=a.substring(0,s);(0,o.addTextSegment)(e,d,r),r.isInSelection=!0,(0,n.addSelectionMarker)(e,r,t,s),a=a.substring(s),c-=s}c>=0&&(d=a.substring(0,c),(0,o.addTextSegment)(e,d,r),!r.selection||"range"==r.selection.type&&r.selection.range.collapsed||(0,n.addSelectionMarker)(e,r,t,l[1]),r.isInSelection=!1,a=a.substring(c)),(0,o.addTextSegment)(e,a,r)}},1246:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addSelectionMarker=void 0;var n=r(5142),o=r(8411);t.addSelectionMarker=function(e,t,r,i){var a=(0,o.buildSelectionMarker)(e,t,r,i);(0,n.addSegment)(e,a,t.blockFormat,a.format)}},9187:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.areSameFormats=void 0;var n=r(1081);t.areSameFormats=function(e,t){if(e==t)return!0;var r=(0,n.getObjectKeys)(e),o=(0,n.getObjectKeys)(t);return r.length==o.length&&r.every((function(r){return e[r]==t[r]}))}},8411:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildSelectionMarker=void 0;var n=r(9849),o=r(7192);t.buildSelectionMarker=function(e,t,r,i){var a=e.blocks[e.blocks.length-1],l=a&&"Paragraph"==a.blockType?a.decorator?{fontFamily:a.decorator.format.fontFamily,fontSize:a.decorator.format.fontSize}:a.segmentFormat?{fontFamily:a.segmentFormat.fontFamily,fontSize:a.segmentFormat.fontSize}:{}:{},s=t.pendingFormat&&t.pendingFormat.insertPoint.node===r&&t.pendingFormat.insertPoint.offset===i?t.pendingFormat.format:void 0,c=Object.assign({},t.defaultFormat,l,t.segmentFormat,s),d=(0,o.createSelectionMarker)(c);return(0,n.addDecorators)(d,t),d}},7398:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBoundingClientRect=void 0,t.getBoundingClientRect=function(e){return e.getBoundingClientRect()}},3825:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultStyle=void 0;var n=r(7668);t.getDefaultStyle=function(e){var t=e.tagName.toLowerCase();return n.defaultHTMLStyleMap[t]||{}}},7441:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRegularSelectionOffsets=void 0,t.getRegularSelectionOffsets=function(e,t){var r,n="range"==(null===(r=e.selection)||void 0===r?void 0:r.type)?e.selection.range:null;return[(null==n?void 0:n.startContainer)==t?n.startOffset:-1,(null==n?void 0:n.endContainer)==t?n.endOffset:-1]}},7448:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBlockElement=void 0;var n=r(3825),o=["block","list-item","table","table-cell","flex"];t.isBlockElement=function(e){var t=e.style.display||(0,n.getDefaultStyle)(e).display||"";return o.indexOf(t)>=0}},1839:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseFormat=void 0;var n=r(3825);t.parseFormat=function(e,t,r,o){var i=(0,n.getDefaultStyle)(e);t.forEach((function(t){null==t||t(r,e,o,i)}))}},2764:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stackFormat=void 0;var n=r(1635),o=r(1081),i=["backgroundColor"],a=["marginLeft","marginRight","paddingLeft","paddingRight"];function l(e,t){switch(t){case"empty":return{};case void 0:return e;default:var r=(0,n.__assign)({},e);if((0,o.getObjectKeys)(e).forEach((function(e){("shallowCloneForBlock"==t&&i.indexOf(e)>=0||"shallowCloneForGroup"==t&&a.indexOf(e)>=0)&&delete r[e]})),"shallowClone"==t||"shallowCloneForGroup"==t){var l=e;l.textIndent&&(delete r.isTextIndentApplied,l.isTextIndentApplied=!0)}return r}}t.stackFormat=function(e,t,r){var o,i=e.segmentFormat,a=e.blockFormat,s=e.link,c=e.code,d=e.blockDecorator,u=t.segment,p=t.paragraph,f=t.link,m=t.code,g=t.blockDecorator;try{e.segmentFormat=l(i,u),e.blockFormat=l(a,p),e.link=function(e,t){switch(t){case"linkDefault":return{format:{underline:!0},dataset:{}};case"empty":return{format:{},dataset:{}};default:return{dataset:e.dataset,format:(0,n.__assign)({},e.format)}}}(s,f),e.code=function(e,t){switch(t){case"codeDefault":return{format:{fontFamily:"monospace"}};case"empty":return{format:{}};default:return e}}(c,m),e.blockDecorator=(o=d,"empty"===g?{format:{},tagName:""}:o),r()}finally{e.segmentFormat=i,e.blockFormat=a,e.link=s,e.code=c,e.blockDecorator=d}}},4134:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addDelimiters=t.isBlockEntityContainer=t.isEntityDelimiter=t.generateEntityClassNames=t.parseEntityFormat=t.getAllEntityWrappers=t.findClosestBlockEntityContainer=t.findClosestEntityWrapper=t.isEntityElement=void 0;var n=r(1635),o=r(3494),i=r(8907),a=r(7057),l=r(872),s="_Entity",c="."+s,d="_EType_",u="_EId_",p="_EReadonly_",f="entityDelimiterBefore",m="entityDelimiterAfter",g="_E_EBlockEntityContainer",h="."+g;function v(e,t){return(null==e?void 0:e.classList.contains(t))&&"​"==e.textContent?e:void 0}function y(e,t,r){var n,o=e.createElement("span");return o.className=r?m:f,o.appendChild(e.createTextNode("​")),null===(n=t.parentNode)||void 0===n||n.insertBefore(o,r?t.nextSibling:t),o}t.isEntityElement=function(e){return(0,a.isNodeOfType)(e,"ELEMENT_NODE")&&e.classList.contains(s)},t.findClosestEntityWrapper=function(e,t){return t.findClosestElementAncestor(e,c)},t.findClosestBlockEntityContainer=function(e,t){return t.findClosestElementAncestor(e,h)},t.getAllEntityWrappers=function(e){return(0,l.toArray)(e.querySelectorAll("."+s))},t.parseEntityFormat=function(e){var t=!1,r={};return e.classList.forEach((function(e){t=function(e,t){if(e==s)return!0;0==e.indexOf(d)?t.entityType=e.substring(7):0==e.indexOf(u)?t.id=e.substring(5):0==e.indexOf(p)&&(t.isReadonly="1"==e.substring(11))}(e,r)||t})),t||(r.isFakeEntity=!0,r.isReadonly=!e.isContentEditable),r},t.generateEntityClassNames=function(e){var t;return e.isFakeEntity?"":s+" "+d+(null!==(t=e.entityType)&&void 0!==t?t:"")+" "+(e.id?""+u+e.id+" ":"")+p+(e.isReadonly?"1":"0")},t.isEntityDelimiter=function(e,t){var r=void 0===t||t,n=void 0===t||!t;return(0,i.isElementOfType)(e,"span")&&(n&&e.classList.contains(m)||r&&e.classList.contains(f))&&"​"===e.textContent},t.isBlockEntityContainer=function(e){return(0,i.isElementOfType)(e,"div")&&e.classList.contains(g)},t.addDelimiters=function(e,t,r,i){var a,l,s,c,d=(0,n.__read)((l=[],s=(a=t).nextElementSibling,c=a.previousElementSibling,l.push(v(s,m),v(c,f)),l),2),u=d[0],p=d[1];return u||(u=y(e,t,!0),i&&r&&(0,o.applyFormat)(u,i.formatAppliers.segment,r,i)),p||(p=y(e,t,!1),i&&r&&(0,o.applyFormat)(p,i.formatAppliers.segment,r,i)),[u,p]}},6819:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cacheGetEventData=void 0,t.cacheGetEventData=function(e,t,r){var n=e.eventDataCache&&e.eventDataCache.hasOwnProperty(t)?e.eventDataCache[t]:r(e);return e.eventDataCache=e.eventDataCache||{},e.eventDataCache[t]=n,n}},9076:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isCursorMovingKey=t.isCharacterValue=t.isModifierKey=void 0;var r=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"]);function n(e){var t=e.ctrlKey||"Control"===e.key,r=e.altKey||"Alt"===e.key,n=e.metaKey||"Meta"===e.key;return t||r||n}t.isModifierKey=n,t.isCharacterValue=function(e){return!n(e)&&!!e.key&&1==e.key.length},t.isCursorMovingKey=function(e){return r.has(e.key)}},9526:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.extractClipboardItems=void 0;var o=r(1074),i=((n={})["text/html"]=function(e,t){return e.rawHtml=t},n["text/plain"]=function(e,t){return e.text=t},n["text/*"]=function(e,t,r){return!!r&&(e.customValues[r]=t)},n["text/link-preview"]=function(e,t){try{e.customValues["link-preview"]=t,e.linkPreview=JSON.parse(t)}catch(e){}},n);t.extractClipboardItems=function(e,t){var r={types:[],text:"",image:null,files:[],rawHtml:null,customValues:{},pasteNativeEvent:!0};return Promise.all((e||[]).map((function(e){var n=e.type;if(0!=n.indexOf("image/")||r.image||"file"!=e.kind){if("file"==e.kind)return new Promise((function(t){var o=e.getAsFile();o&&(r.types.push(n),r.files.push(o)),t()}));var a=function(e,t){var r=0==e.indexOf("text/")?e.substring(5):null,n=t&&r?t.indexOf(r):-1;return r&&n>=0?r:void 0}(n,t),l=i[n]||(a?i["text/*"]:null);return new Promise((function(t){return l?e.getAsString((function(e){r.types.push(n),l(r,e,a),t()})):t()}))}return r.types.push(n),r.image=e.getAsFile(),new Promise((function(e){r.image?(0,o.readFile)(r.image,(function(t){r.imageDataUri=t,e()})):e()}))}))).then((function(){return r}))}},1081:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getObjectKeys=void 0,t.getObjectKeys=function(e){return Object.keys(e)}},6039:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSafeIdSelector=void 0;var r=/^[.|\-|_|\d]/;t.getSafeIdSelector=function(e){return e?e.match(r)?'[id="'+e+'"]':"#"+e:e}},8907:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isElementOfType=void 0,t.isElementOfType=function(e,t){var r;return(null===(r=null==e?void 0:e.tagName)||void 0===r?void 0:r.toLocaleLowerCase())==t}},7057:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNodeOfType=void 0,t.isNodeOfType=function(e,t){return!!e&&e.nodeType==Node[t]}},3869:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isWhiteSpacePreserved=void 0;var r=["pre","pre-wrap","break-spaces"];t.isWhiteSpacePreserved=function(e){return!!e&&r.indexOf(e)>=0}},4310:(e,t)=>{"use strict";function r(e,t,r){if(e){for(;!r&&e.firstChild;)e.removeChild(e.firstChild);for(;null==t?void 0:t.firstChild;)e.appendChild(t.firstChild)}}Object.defineProperty(t,"__esModule",{value:!0}),t.wrapAllChildNodes=t.moveChildNodes=void 0,t.moveChildNodes=r,t.wrapAllChildNodes=function(e,t){var n=e.ownerDocument.createElement(t);return r(n,e),e.appendChild(n),n}},107:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeRect=void 0,t.normalizeRect=function(e){var t=e||{left:0,right:0,top:0,bottom:0},r=t.left,n=t.right,o=t.top,i=t.bottom;return 0===r&&0===n&&0===o&&0===i?null:{left:Math.round(r),right:Math.round(n),top:Math.round(o),bottom:Math.round(i)}}},1074:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readFile=void 0,t.readFile=function(e,t){if(e){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=function(){t(null)},r.readAsDataURL(e)}}},9290:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeNode=t.reuseCachedElement=void 0;var n=r(4134);t.reuseCachedElement=function(e,t,r){var o;if(t.parentNode==e){for(var i=(0,n.isEntityElement)(t);r&&r!=t&&(i||!(0,n.isEntityElement)(r));){var a=r.nextSibling;null===(o=r.parentNode)||void 0===o||o.removeChild(r),r=a}r&&r==t?r=r.nextSibling:e.insertBefore(t,r)}else e.insertBefore(t,r);return r},t.removeNode=function(e){var t,r=e.nextSibling;return null===(t=e.parentNode)||void 0===t||t.removeChild(e),r}},3120:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDOMInsertPointRect=void 0;var n=r(7057),o=r(107);function i(e,t){var r=e.node,n=e.offset;t.setStart(r,n),t.setEnd(r,n);var i=(0,o.normalizeRect)(t.getBoundingClientRect());if(i)return i;var a=t.getClientRects&&t.getClientRects();return a&&1==a.length?(0,o.normalizeRect)(a[0]):null}t.getDOMInsertPointRect=function(e,t){var r,a,l,s=e.createRange();return null!==(a=null!==(r=i(t,s))&&void 0!==r?r:i(t=function(e){for(var t=e.node,r=e.offset;t.lastChild;)r==t.childNodes.length?r=(t=t.lastChild).childNodes.length:(t=t.childNodes[r],r=0);return{node:t,offset:r}}(t),s))&&void 0!==a?a:(l=t.node,(0,n.isNodeOfType)(l,"ELEMENT_NODE")&&l.getBoundingClientRect?(0,o.normalizeRect)(l.getBoundingClientRect()):null)}},8257:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSelectionRootNode=void 0,t.getSelectionRootNode=function(e){return e?"range"==e.type?e.range.commonAncestorContainer:"table"==e.type?e.table:"image"==e.type?e.image:void 0:void 0}},5245:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeText=t.isSpace=t.isPunctuation=void 0;var r=/[\u2000\u2009\u200a​\u200b​\u202f\u205f​\u3000\s\t\r\n]/gm;t.isPunctuation=function(e){return'.,?!:"()[]\\/'.indexOf(e)>=0},t.isSpace=function(e){var t,n=null!==(t=null==e?void 0:e.charCodeAt(0))&&void 0!==t?t:0;return 160==n||32==n||r.test(e)},t.normalizeText=function(e,t){return e.replace(t?/^\u0020+/:/\u0020+$/," ")}},9298:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineBorderValue=t.extractBorderValues=void 0;var r=["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset"],n=/^(thin|medium|thick|[\d\.]+\w*)$/;t.extractBorderValues=function(e){var t={};return(e||"").replace(/, /g,",").split(" ").forEach((function(e){r.indexOf(e)>=0&&!t.style?t.style=e:n.test(e)&&!t.width?t.width=e:e&&!t.color&&(t.color=e)})),t},t.combineBorderValue=function(e){return[e.width||"",e.style||"",e.color||""].join(" ").trim()||"none"}},9265:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBold=void 0,t.isBold=function(e){return!!e&&("bold"==e||"bolder"==e||parseInt(e)>=600)}},6537:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transformColor=void 0;var n=r(488);function o(e,t,r){r&&i(e)&&t(e);for(var n=e.firstChild;n;n=n.nextSibling)i(n)&&t(n),o(n,t)}function i(e){var t=e;return e.nodeType==Node.ELEMENT_NODE&&!!t.style}t.transformColor=function(e,t,r,i){var a="lightToDark"==r;o(e,(function(e){var t=(0,n.getColor)(e,!1,!a,i),r=(0,n.getColor)(e,!0,!a,i);(0,n.setColor)(e,t,!1,a,i),(0,n.setColor)(e,r,!0,a,i)}),t)}},7311:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseTableCells=void 0;var n=r(872);t.parseTableCells=function(e){var t=(0,n.toArray)(e.rows),r=t.map((function(e){return[]}));return t.forEach((function(e,t){for(var n=0,o=0;n<e.cells.length;n++){for(;void 0!==r[t][o];o++);for(var i=e.cells[n],a=0;a<i.colSpan;a++,o++)for(var l=0;l<i.rowSpan;l++)r[t+l]&&(r[t+l][o]=0==a?0==l?i:"spanTop":0==l?"spanLeft":"spanBoth")}for(var s=0;s<r[t].length;s++)r[t][s]=r[t][s]||null})),r}},872:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toArray=void 0,t.toArray=function(e){return[].slice.call(e)}},2463:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unwrap=void 0,t.unwrap=function(e){var t=e?e.parentNode:null;if(!t)return null;for(;e.firstChild;)t.insertBefore(e.firstChild,e);return t.removeChild(e),t}},7828:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wrap=void 0,t.wrap=function(e,t,r){var n,o=e.createElement(r);return null===(n=t.parentNode)||void 0===n||n.insertBefore(o,t),o.appendChild(t),o}},7917:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.directionFormatHandler=void 0,t.directionFormatHandler={parse:function(e,t,r,n){var o=t.style.direction||t.dir||n.direction;o&&(e.direction="rtl"==o?"rtl":"ltr")},apply:function(e,t){e.direction&&(t.style.direction=e.direction)}}},8116:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.displayFormatHandler=void 0,t.displayFormatHandler={parse:function(e,t){var r=t.style.display;r&&(e.display=r)},apply:function(e,t){e.display&&(t.style.display=e.display)}}},1400:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.htmlAlignFormatHandler=void 0;var n=r(7340),o=r(7917);t.htmlAlignFormatHandler={parse:function(e,t,r,i){o.directionFormatHandler.parse(e,t,r,i);var a=t.getAttribute("align");a&&(e.htmlAlign=(0,n.calcAlign)(a,e.direction),delete e.textAlign,delete r.blockFormat.textAlign)},apply:function(e,t){var r="rtl"==e.direction?"rtl":"ltr";e.htmlAlign&&t.setAttribute("align",n.ResultMap[e.htmlAlign][r])}}},6329:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lineHeightFormatHandler=void 0,t.lineHeightFormatHandler={parse:function(e,t,r,n){var o=t.style.lineHeight||n.lineHeight;o&&"inherit"!=o&&(e.lineHeight=o)},apply:function(e,t){e.lineHeight&&(t.style.lineHeight=e.lineHeight)}}},2568:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.marginFormatHandler=void 0;var n=r(861),o=["marginTop","marginRight","marginBottom","marginLeft"];t.marginFormatHandler={parse:function(e,t,r,i){o.forEach((function(r){var o=t.style[r]||i[r];if(o)switch(r){case"marginTop":case"marginBottom":e[r]=o;break;case"marginLeft":case"marginRight":e[r]=e[r]?(0,n.parseValueWithUnit)(e[r]||"",t)+(0,n.parseValueWithUnit)(o,t)+"px":o}}))},apply:function(e,t,r){o.forEach((function(n){var o=e[n];o!=r.implicitFormat[n]&&(t.style[n]=o||"0")}))}}},2214:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.paddingFormatHandler=void 0;var n=r(7917),o=["paddingTop","paddingRight","paddingBottom","paddingLeft"],i={paddingLeft:"paddingInlineStart"},a={paddingRight:"paddingInlineStart"};t.paddingFormatHandler={parse:function(e,t,r,l){n.directionFormatHandler.parse(e,t,r,l),o.forEach((function(r){var n,o,s=t.style[r],c=("rtl"==e.direction?a:i)[r],d=(null!==(o=null!==(n=l[r])&&void 0!==n?n:c?l[c]:void 0)&&void 0!==o?o:"0px")+"";s||(s=d),s&&"0"!=s||(s="0px"),s&&s!=d&&(e[r]=s)}))},apply:function(e,t,r){o.forEach((function(r){var n=e[r],o=void 0;"OL"!=t.tagName&&"UL"!=t.tagName||("rtl"==e.direction&&"paddingRight"==r||"rtl"!=e.direction&&"paddingLeft"==r)&&(o="40px"),n&&n!=o&&(t.style[r]=n)}))}}},1169:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textAlignFormatHandler=void 0;var n=r(7340),o=r(7917);t.textAlignFormatHandler={parse:function(e,t,r,i){var a;o.directionFormatHandler.parse(e,t,r,i);var l=t.style.textAlign||i.textAlign;"LI"==t.tagName&&"flex"===(null===(a=t.parentElement)||void 0===a?void 0:a.style.display)&&"column"===t.parentElement.style.flexDirection&&t.style.alignSelf&&(l=t.style.alignSelf),l&&(e.textAlign=(0,n.calcAlign)(l,e.direction))},apply:function(e,t){var r="rtl"==e.direction?"rtl":"ltr";if(e.textAlign){var o=t.parentElement,i=null==o?void 0:o.tagName;"LI"!=t.tagName||!o||"OL"!=i&&"UL"!=i?t.style.textAlign=n.ResultMap[e.textAlign][r]:(t.style.alignSelf=e.textAlign,t.parentElement.style.flexDirection="column",t.parentElement.style.display="flex")}}}},8429:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textIndentFormatHandler=void 0,t.textIndentFormatHandler={parse:function(e,t){var r=t.style.textIndent;r&&(e.textIndent=r)},apply:function(e,t){e.textIndent&&(t.style.textIndent=e.textIndent)}}},3833:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.whiteSpaceFormatHandler=void 0;var n=r(893);t.whiteSpaceFormatHandler={parse:function(e,t,r,o){var i=t.style.whiteSpace||o.whiteSpace;(0,n.shouldSetValue)(i,"normal",e.whiteSpace,o.whiteSpace)&&(e.whiteSpace=i)},apply:function(e,t,r){var n=r.implicitFormat.whiteSpace;e.whiteSpace!=n&&(t.style.whiteSpace=e.whiteSpace||"normal")}}},6187:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.backgroundColorFormatHandler=void 0;var n=r(488),o=r(893);t.backgroundColorFormatHandler={parse:function(e,t,r,i){var a=(0,n.getColor)(t,!0,!!r.isDarkMode,r.darkColorHandler)||i.backgroundColor;(0,o.shouldSetValue)(a,"transparent",void 0,i.backgroundColor)&&(e.backgroundColor=a)},apply:function(e,t,r){e.backgroundColor&&(0,n.setColor)(t,e.backgroundColor,!0,!!r.isDarkMode,r.darkColorHandler)}}},9804:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.borderBoxFormatHandler=void 0,t.borderBoxFormatHandler={parse:function(e,t){var r;"border-box"==(null===(r=t.style)||void 0===r?void 0:r.boxSizing)&&(e.useBorderBox=!0)},apply:function(e,t){e.useBorderBox&&(t.style.boxSizing="border-box")}}},2412:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.borderFormatHandler=t.BorderKeys=void 0,t.BorderKeys=["borderTop","borderRight","borderBottom","borderLeft"];var r=["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],n=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],o=t.BorderKeys.concat(n);t.borderFormatHandler={parse:function(e,o,i,a){t.BorderKeys.forEach((function(t,n){var i,l=o.style[t],s=null!==(i=a[r[n]])&&void 0!==i?i:"0px",c=o.style[r[n]];"0"==c&&(c="0px"),l&&c!=s&&(e[t]="none"==l?"":l)}));var l=o.style.borderRadius;l?e.borderRadius=l:n.forEach((function(t){var r=o.style[t];r&&(e[t]=r)}))},apply:function(e,t){o.forEach((function(r){var n=e[r];n&&(t.style[r]=n)})),e.borderRadius&&(t.style.borderRadius=e.borderRadius)}}},8005:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boxShadowFormatHandler=void 0,t.boxShadowFormatHandler={parse:function(e,t){var r;(null===(r=t.style)||void 0===r?void 0:r.boxShadow)&&(e.boxShadow=t.style.boxShadow)},apply:function(e,t){e.boxShadow&&(t.style.boxShadow=e.boxShadow)}}},7446:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.datasetFormatHandler=void 0;var n=r(1081);t.datasetFormatHandler={parse:function(e,t){var r=t.dataset;(0,n.getObjectKeys)(r).forEach((function(t){e[t]=r[t]||""}))},apply:function(e,t){(0,n.getObjectKeys)(e).forEach((function(r){t.dataset[r]=e[r]}))}}},756:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.floatFormatHandler=void 0,t.floatFormatHandler={parse:function(e,t){var r=t.style.float||t.getAttribute("align");r&&(e.float=r)},apply:function(e,t){e.float&&(t.style.float=e.float)}}},2925:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.idFormatHandler=void 0,t.idFormatHandler={parse:function(e,t){t.id&&(e.id=t.id)},apply:function(e,t){e.id&&(t.id=e.id)}}},4033:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sizeFormatHandler=void 0;var r=/[\d\.]+%/;function n(e,t){var n=e.getAttribute(t),o=parseInt(n||"");return n&&r.test(n)?n:Number.isNaN(o)||0==o?void 0:o+"px"}t.sizeFormatHandler={parse:function(e,t,r){var o=t.style.width||n(t,"width"),i=t.style.height||n(t,"height"),a=t.style.maxWidth,l=t.style.maxHeight,s=t.style.minWidth,c=t.style.minHeight;o&&(e.width=o),i&&(e.height=i),a&&(e.maxWidth=a),l&&(e.maxHeight=l),s&&(e.minWidth=s),c&&(e.minHeight=c)},apply:function(e,t){e.width&&(t.style.width=e.width),e.height&&(t.style.height=e.height),e.maxWidth&&(t.style.maxWidth=e.maxWidth),e.maxHeight&&(t.style.maxHeight=e.maxHeight),e.minWidth&&(t.style.minWidth=e.minWidth),e.minHeight&&(t.style.minHeight=e.minHeight)}}},5931:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verticalAlignFormatHandler=void 0,t.verticalAlignFormatHandler={parse:function(e,t){switch(t.style.verticalAlign||t.getAttribute("valign")){case"baseline":case"initial":case"super":case"sub":case"text-top":case"text-bottom":case"top":e.verticalAlign="top";break;case"bottom":e.verticalAlign="bottom";break;case"middle":e.verticalAlign="middle"}},apply:function(e,t){e.verticalAlign&&(t.style.verticalAlign=e.verticalAlign)}}},8419:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wordBreakFormatHandler=void 0,t.wordBreakFormatHandler={parse:function(e,t,r,n){var o=t.style.wordBreak||n.wordBreak;o&&(e.wordBreak=o)},apply:function(e,t){e.wordBreak&&(t.style.wordBreak=e.wordBreak)}}},1506:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultFormatAppliers=t.defaultFormatParsers=t.defaultFormatKeysPerCategory=void 0;var n=r(1635),o=r(6187),i=r(4163),a=r(9804),l=r(2412),s=r(8005),c=r(7446),d=r(7917),u=r(8116),p=r(9301),f=r(756),m=r(5249),g=r(1038),h=r(1081),v=r(1400),y=r(2925),b=r(6074),S=r(7761),C=r(6329),_=r(9542),E=r(682),T=r(5203),k=r(1958),M=r(2568),O=r(2214),P=r(4033),w=r(468),x=r(5639),D=r(8143),L=r(4068),I=r(1169),F=r(5936),R=r(9580),N=r(8429),A=r(4218),B=r(5931),j=r(3833),H=r(8419),z={backgroundColor:o.backgroundColorFormatHandler,bold:i.boldFormatHandler,border:l.borderFormatHandler,borderBox:a.borderBoxFormatHandler,boxShadow:s.boxShadowFormatHandler,dataset:c.datasetFormatHandler,direction:d.directionFormatHandler,display:u.displayFormatHandler,float:f.floatFormatHandler,fontFamily:m.fontFamilyFormatHandler,fontSize:g.fontSizeFormatHandler,entity:p.entityFormatHandler,htmlAlign:v.htmlAlignFormatHandler,id:y.idFormatHandler,italic:b.italicFormatHandler,letterSpacing:S.letterSpacingFormatHandler,lineHeight:C.lineHeightFormatHandler,link:_.linkFormatHandler,listItemThread:E.listItemThreadFormatHandler,listLevelThread:T.listLevelThreadFormatHandler,listStyle:k.listStyleFormatHandler,margin:M.marginFormatHandler,padding:O.paddingFormatHandler,size:P.sizeFormatHandler,strike:w.strikeFormatHandler,superOrSubScript:x.superOrSubScriptFormatHandler,tableLayout:D.tableLayoutFormatHandler,tableSpacing:L.tableSpacingFormatHandler,textAlign:I.textAlignFormatHandler,textColor:F.textColorFormatHandler,textColorOnTableCell:R.textColorOnTableCellFormatHandler,textIndent:N.textIndentFormatHandler,underline:A.underlineFormatHandler,verticalAlign:B.verticalAlignFormatHandler,whiteSpace:j.whiteSpaceFormatHandler,wordBreak:H.wordBreakFormatHandler},W=["letterSpacing","fontFamily","fontSize"],G=["strike","underline","superOrSubScript","italic","bold"],U=["direction","textAlign","textIndent","lineHeight","whiteSpace"],K=["backgroundColor","margin","padding","border"];t.defaultFormatKeysPerCategory={block:U,listItemThread:["listItemThread"],listLevelThread:["listLevelThread"],listItemElement:(0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(U),!1),["direction","textAlign","lineHeight","margin","listStyle"],!1),listLevel:["direction","textAlign","margin","padding","listStyle","backgroundColor"],styleBasedSegment:(0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(W),!1),["textColor","backgroundColor","lineHeight"],!1),elementBasedSegment:G,segment:(0,n.__spreadArray)((0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(W),!1),(0,n.__read)(G),!1),["textColor","backgroundColor","lineHeight"],!1),segmentOnBlock:(0,n.__spreadArray)((0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(W),!1),(0,n.__read)(G),!1),["textColor"],!1),segmentOnTableCell:(0,n.__spreadArray)((0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(W),!1),(0,n.__read)(G),!1),["textColorOnTableCell"],!1),tableCell:["border","backgroundColor","padding","verticalAlign","wordBreak","textColor","htmlAlign","size"],tableRow:["backgroundColor"],tableColumn:["size"],table:["id","border","backgroundColor","display","htmlAlign","margin","size","tableLayout","textColor"],tableBorder:["borderBox","tableSpacing"],tableCellBorder:["borderBox"],image:["id","size","margin","padding","borderBox","border","boxShadow","display","float","verticalAlign"],link:["link","textColor","underline","display","margin","padding","backgroundColor","border","size","textAlign"],segmentUnderLink:["textColor"],code:["fontFamily","display"],dataset:["dataset"],divider:(0,n.__spreadArray)((0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(U),!1),(0,n.__read)(K),!1),["display","size","htmlAlign"],!1),container:(0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(K),!1),["htmlAlign","size","display"],!1),entity:["entity"],general:["textColor","backgroundColor"]},t.defaultFormatParsers=(0,h.getObjectKeys)(z).reduce((function(e,t){return e[t]=z[t].parse,e}),{}),t.defaultFormatAppliers=(0,h.getObjectKeys)(z).reduce((function(e,t){return e[t]=z[t].apply,e}),{})},9301:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.entityFormatHandler=void 0;var n=r(4134);t.entityFormatHandler={parse:function(e,t){Object.assign(e,(0,n.parseEntityFormat)(t))},apply:function(e,t){e.isFakeEntity||(t.className=(0,n.generateEntityClassNames)(e)),e.isReadonly?t.contentEditable="false":t.removeAttribute("contenteditable")}}},682:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listItemThreadFormatHandler=void 0;var n=r(8907),o=r(7057);function i(e){return(0,n.isElementOfType)(e,"li")&&(0,o.isNodeOfType)(e.parentNode,"ELEMENT_NODE")&&(0,n.isElementOfType)(e.parentNode,"ol")}t.listItemThreadFormatHandler={parse:function(e,t,r,n){var o=r.listFormat,a=o.levels.length,l=t.style.display||n.display;l&&"list-item"!=l?e.displayForDummyItem=l:i(t)&&a>0&&(o.threadItemCounts[a-1]++,o.threadItemCounts.splice(a),o.levels.forEach((function(e){delete e.format.startNumberOverride})))},apply:function(e,t,r){var n;if(e.displayForDummyItem)t.style.display=e.displayForDummyItem;else if(i(t)){var o=r.listFormat,a=o.threadItemCounts,l=o.nodeStack.length-2;l>=0&&(a.splice(l+1),a[l]=(null!==(n=a[l])&&void 0!==n?n:0)+1)}}}},5203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listLevelThreadFormatHandler=void 0;var n=r(8907);t.listLevelThreadFormatHandler={parse:function(e,t,r){if((0,n.isElementOfType)(t,"ol")){var o=r.listFormat,i=o.threadItemCounts,a=o.levels.length;(1==t.start||"number"==typeof i[a]&&t.start!=i[a]+1)&&(e.startNumberOverride=t.start),i[a]=t.start-1}},apply:function(e,t,r){var o=r.listFormat,i=o.threadItemCounts,a=o.nodeStack.length-2;if(a>=0&&(0,n.isElementOfType)(t,"ol")){var l=e.startNumberOverride;"number"==typeof l?i[a]=l-1:"number"!=typeof i[a]&&(i[a]=0),i.splice(a+1),t.start=i[a]+1}}}},1958:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listStyleFormatHandler=void 0,t.listStyleFormatHandler={parse:function(e,t){var r=t.style.listStylePosition,n=t.style.listStyleType;r&&(e.listStylePosition=r),n&&(e.listStyleType=n)},apply:function(e,t){e.listStylePosition&&(t.style.listStylePosition=e.listStylePosition),e.listStyleType&&(t.style.listStyleType=e.listStyleType)}}},4163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boldFormatHandler=void 0;var n=r(893),o=r(4310);t.boldFormatHandler={parse:function(e,t,r,o){var i=t.style.fontWeight||o.fontWeight;(0,n.shouldSetValue)(i,"400",e.fontWeight,o.fontWeight)&&(e.fontWeight=i)},apply:function(e,t,r){if(void 0!==e.fontWeight){var n=r.implicitFormat.fontWeight;(n&&n!=e.fontWeight||!n&&e.fontWeight&&"normal"!=e.fontWeight)&&("bold"==e.fontWeight?(0,o.wrapAllChildNodes)(t,"b"):t.style.fontWeight=e.fontWeight||"normal")}}}},5249:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fontFamilyFormatHandler=void 0,t.fontFamilyFormatHandler={parse:function(e,t,r,n){var o=t.style.fontFamily||n.fontFamily;o&&"inherit"!=o&&(e.fontFamily=o)},apply:function(e,t,r){e.fontFamily&&e.fontFamily!=r.implicitFormat.fontFamily&&(t.style.fontFamily=e.fontFamily)}}},1038:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fontSizeFormatHandler=void 0;var n=r(5639),o=r(861);t.fontSizeFormatHandler={parse:function(e,t,r,a){var l=t.style.fontSize||a.fontSize,s=t.style.verticalAlign||a.verticalAlign;l&&!(0,n.isSuperOrSubScript)(l,s)&&"inherit"!=l&&(t.style.fontSize?e.fontSize=function(e,t,r){var n=i[e],a=e.endsWith("rem");if(n)return n;if(!("smaller"==e||"larger"==e||e.endsWith("em")||e.endsWith("%")||a))return"inherit"==e||"revert"==e||"unset"==e?void 0:e;if(t||a){var l=a?r.rootFontSize:(0,o.parseValueWithUnit)(t);if(l)switch(e){case"smaller":return Math.round(500*l/6)/100+"px";case"larger":return Math.round(600*l/5)/100+"px";default:return(0,o.parseValueWithUnit)(e,l,"px")+"px"}}}(l,r.segmentFormat.fontSize,r):a.fontSize&&(e.fontSize=l))},apply:function(e,t,r){e.fontSize&&e.fontSize!=r.implicitFormat.fontSize&&(t.style.fontSize=e.fontSize)}};var i={"xx-small":"6.75pt","x-small":"7.5pt",small:"9.75pt",medium:"12pt",large:"13.5pt","x-large":"18pt","xx-large":"24pt","xxx-large":"36pt"}},6074:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.italicFormatHandler=void 0;var n=r(4310);t.italicFormatHandler={parse:function(e,t,r,n){var o=t.style.fontStyle||n.fontStyle;"italic"==o||"oblique"==o?e.italic=!0:"initial"!=o&&"normal"!=o||(e.italic=!1)},apply:function(e,t,r){void 0!==e.italic&&!!r.implicitFormat.italic!=!!e.italic&&(e.italic?(0,n.wrapAllChildNodes)(t,"i"):t.style.fontStyle="normal")}}},7761:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.letterSpacingFormatHandler=void 0;var n=r(893);t.letterSpacingFormatHandler={parse:function(e,t,r,o){var i=t.style.letterSpacing||o.letterSpacing;(0,n.shouldSetValue)(i,"normal",e.letterSpacing,o.letterSpacing)&&(e.letterSpacing=i)},apply:function(e,t){e.letterSpacing&&(t.style.letterSpacing=e.letterSpacing)}}},9542:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.linkFormatHandler=void 0;var n=r(8907);t.linkFormatHandler={parse:function(e,t){if((0,n.isElementOfType)(t,"a")){var r=t.name,o=t.getAttribute("href"),i=t.target,a=t.rel,l=t.id,s=t.className,c=t.title;r&&(e.name=r),o&&(e.href=o),i&&(e.target=i),l&&(e.anchorId=l),a&&(e.relationship=a),c&&(e.anchorTitle=c),s&&(e.anchorClass=s)}},apply:function(e,t){(0,n.isElementOfType)(t,"a")&&e.href&&(t.href=e.href,e.name&&(t.name=e.name),e.target&&(t.target=e.target),e.anchorId&&(t.id=e.anchorId),e.anchorClass&&(t.className=e.anchorClass),e.anchorTitle&&(t.title=e.anchorTitle),e.relationship&&(t.rel=e.relationship))}}},468:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.strikeFormatHandler=void 0;var n=r(4310);t.strikeFormatHandler={parse:function(e,t,r,n){var o=t.style.textDecoration||n.textDecoration;(null==o?void 0:o.indexOf("line-through"))>=0&&(e.strikethrough=!0)},apply:function(e,t){e.strikethrough&&(0,n.wrapAllChildNodes)(t,"s")}}},5639:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSuperOrSubScript=t.superOrSubScriptFormatHandler=void 0;var n=r(4310);function o(e,t){return"smaller"==e&&("sub"==t||"super"==t)}t.superOrSubScriptFormatHandler={parse:function(e,t,r,n){var i=t.style.verticalAlign||n.verticalAlign;o(t.style.fontSize||n.fontSize,i)&&(e.superOrSubScriptSequence=(e.superOrSubScriptSequence||"").split(" ").concat(i).join(" ").trim())},apply:function(e,t){e.superOrSubScriptSequence&&e.superOrSubScriptSequence.split(" ").reverse().forEach((function(e){var r="super"==e?"sup":"sub"==e?"sub":null;r&&(0,n.wrapAllChildNodes)(t,r)}))}},t.isSuperOrSubScript=o},5936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textColorFormatHandler=void 0;var n=r(488);t.textColorFormatHandler={parse:function(e,t,r,o){var i=(0,n.getColor)(t,!1,!!r.isDarkMode,r.darkColorHandler)||o.color;i&&"inherit"!=i&&(e.textColor=i)},apply:function(e,t,r){var o=r.implicitFormat.textColor;e.textColor&&e.textColor!=o&&(0,n.setColor)(t,e.textColor,!1,!!r.isDarkMode,r.darkColorHandler)}}},4218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.underlineFormatHandler=void 0;var n=r(4310);t.underlineFormatHandler={parse:function(e,t,r,n){var o=t.style.textDecoration||n.textDecoration;(null==o?void 0:o.indexOf("underline"))>=0?e.underline=!0:"A"==t.tagName&&"none"==o&&(e.underline=!1)},apply:function(e,t,r){void 0!==e.underline&&!!r.implicitFormat.underline!=!!e.underline&&(e.underline?(0,n.wrapAllChildNodes)(t,"u"):t.style.textDecoration="none")}}},8143:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tableLayoutFormatHandler=void 0,t.tableLayoutFormatHandler={parse:function(e,t){var r=t.style.tableLayout;r&&"inherit"!=r&&(e.tableLayout=r)},apply:function(e,t){e.tableLayout&&(t.style.tableLayout=e.tableLayout)}}},4068:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tableSpacingFormatHandler=void 0;var r="collapse",n="separate";t.tableSpacingFormatHandler={parse:function(e,t){(t.style.borderCollapse==r||t.getAttribute("cellPadding"))&&(e.borderCollapse=!0),t.style.borderCollapse==n&&(e.borderSeparate=!0)},apply:function(e,t){e.borderCollapse?(t.style.borderCollapse=r,t.style.borderSpacing="0",t.style.boxSizing="border-box"):e.borderSeparate&&(t.style.borderCollapse=n,t.style.borderSpacing="0",t.style.boxSizing="border-box")}}},9580:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textColorOnTableCellFormatHandler=void 0,t.textColorOnTableCellFormatHandler={parse:function(e,t){t.style.color&&delete e.textColor},apply:function(){}}},488:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseColor=t.defaultGenerateColorKey=t.setColor=t.getColor=t.DeprecatedColors=void 0;var n=r(1635),o=r(1081);t.DeprecatedColors=["inactiveborder","activeborder","inactivecaptiontext","inactivecaption","activecaption","appworkspace","infobackground","background","buttonhighlight","buttonshadow","captiontext","infotext","menutext","menu","scrollbar","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedfhadow","windowtext","windowframe","window"];var i=/^#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])$/,a=/^#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/,l=/^rgb\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*\)$/,s=/^rgba\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*\)$/,c=/^\s*var\(\s*(\-\-[a-zA-Z0-9\-_]+)\s*(?:,\s*(.*))?\)\s*$/,d="var(";function u(e){var t;return(t=(e=(e||"").trim()).match(i))?[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]:(t=e.match(a))?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:(t=e.match(l)||e.match(s))?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}t.getColor=function(e,r,n,i){var a=(r?e.style.backgroundColor:e.style.color)||e.getAttribute(r?"bgcolor":"color")||void 0;if(a&&t.DeprecatedColors.indexOf(a)>-1)a=r?void 0:"rgb(0, 0, 0)";else if(i&&a){var l=a.startsWith(d)?c.exec(a):null;l?a=l[2]||"":n&&(a=function(e,t){var r=u(e);if(r&&t){var n=(0,o.getObjectKeys)(t).find((function(e){var n=u(t[e].darkModeColor);return n&&n[0]==r[0]&&n[1]==r[1]&&n[2]==r[2]}));if(n)return t[n].lightModeColor}return null}(a,i.knownColors)||"")}return a},t.setColor=function(e,t,r,o,i){var a,l,s=t&&t.startsWith(d)?c.exec(t):null,u=(0,n.__read)(null!=s?s:[],3),p=(u[0],u[1]),f=u[2];if(t=null!=f?f:t,i&&t){var m=r?"background":"text",g=p||i.generateColorKey(t,void 0,m,e),h=(null===(l=null===(a=i.knownColors)||void 0===a?void 0:a[g])||void 0===l?void 0:l.darkModeColor)||i.getDarkColor(t,void 0,m,e);i.updateKnownColor(o,g,{lightModeColor:t,darkModeColor:h}),t=o?""+d+g+", "+t+")":t}e.removeAttribute(r?"bgcolor":"color"),e.style.setProperty(r?"background-color":"color",t||null)},t.defaultGenerateColorKey=function(e){return"--darkColor_"+e.replace(/[^\d\w]/g,"_")},t.parseColor=u},7340:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcAlign=t.ResultMap=void 0,t.ResultMap={start:{ltr:"left",rtl:"right"},center:{ltr:"center",rtl:"center"},end:{ltr:"right",rtl:"left"},initial:{ltr:"initial",rtl:"initial"},justify:{ltr:"justify",rtl:"justify"}},t.calcAlign=function(e,t){switch(e){case"center":return"center";case"left":return"rtl"==t?"end":"start";case"right":return"rtl"==t?"start":"end";case"start":case"end":case"justify":case"initial":return e;default:return}}},861:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseValueWithUnit=void 0;var n=r(1635),o=/(-?\d+(\.\d+)?)([a-z]+|%)/;function i(e){var t,r;if(void 0===e)return 0;if("number"==typeof e)return e;var n=null!==(r=null===(t=e.ownerDocument.defaultView)||void 0===t?void 0:t.getComputedStyle(e).fontSize)&&void 0!==r?r:"";return a(parseFloat(n))}function a(e){return Math.round(4e3*e/3)/1e3}t.parseValueWithUnit=function(e,t,r){void 0===e&&(e=""),void 0===r&&(r="px");var l,s=o.exec(e),c=0;if(s){var d=(0,n.__read)(s,4),u=(d[0],d[1]),p=(d[2],d[3]),f=parseFloat(u);switch(p){case"px":c=f;break;case"pt":c=a(f);break;case"em":c=i(t)*f;break;case"ex":c=i(t)*f/2;break;case"%":c=i(t)*f/100;break;case"in":c=96*f;break;case"rem":c=(i(t)||16)*f}}return c>0&&"pt"==r&&(l=c,c=Math.round(3e3*l/4)/1e3),c}},893:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldSetValue=void 0,t.shouldSetValue=function(e,t,r,n){return!!e&&"inherit"!=e&&!!(e!=t||r||n&&e!=n)}},4990:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGeneralBlock=t.createGeneralSegment=t.createParagraphDecorator=t.createContentModelDocument=t.createImage=t.createText=t.createTableCell=t.createTable=t.createSelectionMarker=t.createParagraph=t.createFormatContainer=t.createListItem=t.createBr=t.normalizeRect=t.isWhiteSpacePreserved=t.reuseCachedElement=t.findClosestBlockEntityContainer=t.isBlockEntityContainer=t.isEntityDelimiter=t.addDelimiters=t.generateEntityClassNames=t.parseEntityFormat=t.getAllEntityWrappers=t.findClosestEntityWrapper=t.isEntityElement=t.unwrap=t.wrap=t.wrapAllChildNodes=t.moveChildNodes=t.toArray=t.getSafeIdSelector=t.getObjectKeys=t.isElementOfType=t.isNodeOfType=t.hasMetadata=t.getMetadata=t.updateMetadata=t.buildSelectionMarker=t.isBlockElement=t.areSameFormats=t.parseFormat=t.getRegularSelectionOffsets=t.tableProcessor=t.entityProcessor=t.processChildNode=t.handleRegularSelection=t.childProcessor=t.contentModelToText=t.contentModelToDom=t.domToContentModel=void 0,t.extractClipboardItems=t.transformColor=t.readFile=t.parseTableCells=t.normalizeText=t.isSpace=t.isPunctuation=t.extractBorderValues=t.combineBorderValue=t.isCursorMovingKey=t.isModifierKey=t.isCharacterValue=t.getDOMInsertPointRect=t.getSelectionRootNode=t.isBold=t.createModelToDomConfig=t.createModelToDomContextWithConfig=t.createModelToDomContext=t.createDomToModelConfig=t.createDomToModelContextWithConfig=t.createDomToModelContext=t.defaultGenerateColorKey=t.parseColor=t.setColor=t.getColor=t.DeprecatedColors=t.BorderKeys=t.parseValueWithUnit=t.getAutoListStyleType=t.getOrderedListNumberStr=t.setParagraphNotImplicit=t.normalizeSingleSegment=t.isEmpty=t.addSegment=t.unwrapBlock=t.isGeneralSegment=t.normalizeContentModel=t.normalizeParagraph=t.addTextSegment=t.addLink=t.addCode=t.addBlock=t.mutateSegment=t.mutateSegments=t.mutateBlock=t.createTableRow=t.createEmptyModel=t.createListLevel=t.createDivider=t.createEntity=void 0,t.EmptySegmentFormat=t.UnorderedListStyleMap=t.OrderedListStyleMap=t.TableBorderFormat=t.NumberingListType=t.BulletListType=t.ChangeSource=t.ListMetadataDefinition=t.getListMetadata=t.updateListMetadata=t.getTableMetadata=t.updateTableMetadata=t.getTableCellMetadata=t.updateTableCellMetadata=t.getImageMetadata=t.updateImageMetadata=t.runEditSteps=t.getClosestAncestorBlockGroupIndex=t.getSegmentTextFormat=t.getListStyleTypeFromString=t.retrieveModelFormatState=t.setTableCellBackgroundColor=t.MIN_ALLOWED_TABLE_CELL_HEIGHT=t.MIN_ALLOWED_TABLE_CELL_WIDTH=t.normalizeTable=t.setFirstColumnFormatBorders=t.applyTableFormat=t.deleteBlock=t.deleteSegment=t.deleteSelection=t.mergeModel=t.cloneModel=t.setSelection=t.hasSelectionInBlockGroup=t.hasSelectionInSegment=t.hasSelectionInBlock=t.getSelectedCells=t.getSelectedSegmentsAndParagraphs=t.getSelectedSegments=t.getSelectedParagraphs=t.getOperationalBlocks=t.getFirstSelectedTable=t.getFirstSelectedListItem=t.iterateSelections=t.isBlockGroupOfType=t.cacheGetEventData=void 0;var n=r(4598);Object.defineProperty(t,"domToContentModel",{enumerable:!0,get:function(){return n.domToContentModel}});var o=r(2038);Object.defineProperty(t,"contentModelToDom",{enumerable:!0,get:function(){return o.contentModelToDom}});var i=r(5132);Object.defineProperty(t,"contentModelToText",{enumerable:!0,get:function(){return i.contentModelToText}});var a=r(4225);Object.defineProperty(t,"childProcessor",{enumerable:!0,get:function(){return a.childProcessor}}),Object.defineProperty(t,"handleRegularSelection",{enumerable:!0,get:function(){return a.handleRegularSelection}}),Object.defineProperty(t,"processChildNode",{enumerable:!0,get:function(){return a.processChildNode}});var l=r(2670);Object.defineProperty(t,"entityProcessor",{enumerable:!0,get:function(){return l.entityProcessor}});var s=r(3815);Object.defineProperty(t,"tableProcessor",{enumerable:!0,get:function(){return s.tableProcessor}});var c=r(7441);Object.defineProperty(t,"getRegularSelectionOffsets",{enumerable:!0,get:function(){return c.getRegularSelectionOffsets}});var d=r(1839);Object.defineProperty(t,"parseFormat",{enumerable:!0,get:function(){return d.parseFormat}});var u=r(9187);Object.defineProperty(t,"areSameFormats",{enumerable:!0,get:function(){return u.areSameFormats}});var p=r(7448);Object.defineProperty(t,"isBlockElement",{enumerable:!0,get:function(){return p.isBlockElement}});var f=r(8411);Object.defineProperty(t,"buildSelectionMarker",{enumerable:!0,get:function(){return f.buildSelectionMarker}});var m=r(5442);Object.defineProperty(t,"updateMetadata",{enumerable:!0,get:function(){return m.updateMetadata}}),Object.defineProperty(t,"getMetadata",{enumerable:!0,get:function(){return m.getMetadata}}),Object.defineProperty(t,"hasMetadata",{enumerable:!0,get:function(){return m.hasMetadata}});var g=r(7057);Object.defineProperty(t,"isNodeOfType",{enumerable:!0,get:function(){return g.isNodeOfType}});var h=r(8907);Object.defineProperty(t,"isElementOfType",{enumerable:!0,get:function(){return h.isElementOfType}});var v=r(1081);Object.defineProperty(t,"getObjectKeys",{enumerable:!0,get:function(){return v.getObjectKeys}});var y=r(6039);Object.defineProperty(t,"getSafeIdSelector",{enumerable:!0,get:function(){return y.getSafeIdSelector}});var b=r(872);Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return b.toArray}});var S=r(4310);Object.defineProperty(t,"moveChildNodes",{enumerable:!0,get:function(){return S.moveChildNodes}}),Object.defineProperty(t,"wrapAllChildNodes",{enumerable:!0,get:function(){return S.wrapAllChildNodes}});var C=r(7828);Object.defineProperty(t,"wrap",{enumerable:!0,get:function(){return C.wrap}});var _=r(2463);Object.defineProperty(t,"unwrap",{enumerable:!0,get:function(){return _.unwrap}});var E=r(4134);Object.defineProperty(t,"isEntityElement",{enumerable:!0,get:function(){return E.isEntityElement}}),Object.defineProperty(t,"findClosestEntityWrapper",{enumerable:!0,get:function(){return E.findClosestEntityWrapper}}),Object.defineProperty(t,"getAllEntityWrappers",{enumerable:!0,get:function(){return E.getAllEntityWrappers}}),Object.defineProperty(t,"parseEntityFormat",{enumerable:!0,get:function(){return E.parseEntityFormat}}),Object.defineProperty(t,"generateEntityClassNames",{enumerable:!0,get:function(){return E.generateEntityClassNames}}),Object.defineProperty(t,"addDelimiters",{enumerable:!0,get:function(){return E.addDelimiters}}),Object.defineProperty(t,"isEntityDelimiter",{enumerable:!0,get:function(){return E.isEntityDelimiter}}),Object.defineProperty(t,"isBlockEntityContainer",{enumerable:!0,get:function(){return E.isBlockEntityContainer}}),Object.defineProperty(t,"findClosestBlockEntityContainer",{enumerable:!0,get:function(){return E.findClosestBlockEntityContainer}});var T=r(9290);Object.defineProperty(t,"reuseCachedElement",{enumerable:!0,get:function(){return T.reuseCachedElement}});var k=r(3869);Object.defineProperty(t,"isWhiteSpacePreserved",{enumerable:!0,get:function(){return k.isWhiteSpacePreserved}});var M=r(107);Object.defineProperty(t,"normalizeRect",{enumerable:!0,get:function(){return M.normalizeRect}});var O=r(4814);Object.defineProperty(t,"createBr",{enumerable:!0,get:function(){return O.createBr}});var P=r(6953);Object.defineProperty(t,"createListItem",{enumerable:!0,get:function(){return P.createListItem}});var w=r(5470);Object.defineProperty(t,"createFormatContainer",{enumerable:!0,get:function(){return w.createFormatContainer}});var x=r(5450);Object.defineProperty(t,"createParagraph",{enumerable:!0,get:function(){return x.createParagraph}});var D=r(7192);Object.defineProperty(t,"createSelectionMarker",{enumerable:!0,get:function(){return D.createSelectionMarker}});var L=r(1728);Object.defineProperty(t,"createTable",{enumerable:!0,get:function(){return L.createTable}});var I=r(7720);Object.defineProperty(t,"createTableCell",{enumerable:!0,get:function(){return I.createTableCell}});var F=r(8465);Object.defineProperty(t,"createText",{enumerable:!0,get:function(){return F.createText}});var R=r(6349);Object.defineProperty(t,"createImage",{enumerable:!0,get:function(){return R.createImage}});var N=r(7357);Object.defineProperty(t,"createContentModelDocument",{enumerable:!0,get:function(){return N.createContentModelDocument}});var A=r(6357);Object.defineProperty(t,"createParagraphDecorator",{enumerable:!0,get:function(){return A.createParagraphDecorator}});var B=r(7431);Object.defineProperty(t,"createGeneralSegment",{enumerable:!0,get:function(){return B.createGeneralSegment}});var j=r(5219);Object.defineProperty(t,"createGeneralBlock",{enumerable:!0,get:function(){return j.createGeneralBlock}});var H=r(5681);Object.defineProperty(t,"createEntity",{enumerable:!0,get:function(){return H.createEntity}});var z=r(6133);Object.defineProperty(t,"createDivider",{enumerable:!0,get:function(){return z.createDivider}});var W=r(598);Object.defineProperty(t,"createListLevel",{enumerable:!0,get:function(){return W.createListLevel}});var G=r(3992);Object.defineProperty(t,"createEmptyModel",{enumerable:!0,get:function(){return G.createEmptyModel}});var U=r(3262);Object.defineProperty(t,"createTableRow",{enumerable:!0,get:function(){return U.createTableRow}});var K=r(376);Object.defineProperty(t,"mutateBlock",{enumerable:!0,get:function(){return K.mutateBlock}}),Object.defineProperty(t,"mutateSegments",{enumerable:!0,get:function(){return K.mutateSegments}}),Object.defineProperty(t,"mutateSegment",{enumerable:!0,get:function(){return K.mutateSegment}});var V=r(2394);Object.defineProperty(t,"addBlock",{enumerable:!0,get:function(){return V.addBlock}});var q=r(9849);Object.defineProperty(t,"addCode",{enumerable:!0,get:function(){return q.addCode}});var Z=r(9849);Object.defineProperty(t,"addLink",{enumerable:!0,get:function(){return Z.addLink}});var X=r(7423);Object.defineProperty(t,"addTextSegment",{enumerable:!0,get:function(){return X.addTextSegment}});var Y=r(9981);Object.defineProperty(t,"normalizeParagraph",{enumerable:!0,get:function(){return Y.normalizeParagraph}});var $=r(8941);Object.defineProperty(t,"normalizeContentModel",{enumerable:!0,get:function(){return $.normalizeContentModel}});var Q=r(4182);Object.defineProperty(t,"isGeneralSegment",{enumerable:!0,get:function(){return Q.isGeneralSegment}});var J=r(8840);Object.defineProperty(t,"unwrapBlock",{enumerable:!0,get:function(){return J.unwrapBlock}});var ee=r(5142);Object.defineProperty(t,"addSegment",{enumerable:!0,get:function(){return ee.addSegment}});var te=r(5061);Object.defineProperty(t,"isEmpty",{enumerable:!0,get:function(){return te.isEmpty}});var re=r(1966);Object.defineProperty(t,"normalizeSingleSegment",{enumerable:!0,get:function(){return re.normalizeSingleSegment}});var ne=r(7958);Object.defineProperty(t,"setParagraphNotImplicit",{enumerable:!0,get:function(){return ne.setParagraphNotImplicit}});var oe=r(4402);Object.defineProperty(t,"getOrderedListNumberStr",{enumerable:!0,get:function(){return oe.getOrderedListNumberStr}});var ie=r(2061);Object.defineProperty(t,"getAutoListStyleType",{enumerable:!0,get:function(){return ie.getAutoListStyleType}});var ae=r(861);Object.defineProperty(t,"parseValueWithUnit",{enumerable:!0,get:function(){return ae.parseValueWithUnit}});var le=r(2412);Object.defineProperty(t,"BorderKeys",{enumerable:!0,get:function(){return le.BorderKeys}});var se=r(488);Object.defineProperty(t,"DeprecatedColors",{enumerable:!0,get:function(){return se.DeprecatedColors}}),Object.defineProperty(t,"getColor",{enumerable:!0,get:function(){return se.getColor}}),Object.defineProperty(t,"setColor",{enumerable:!0,get:function(){return se.setColor}}),Object.defineProperty(t,"parseColor",{enumerable:!0,get:function(){return se.parseColor}}),Object.defineProperty(t,"defaultGenerateColorKey",{enumerable:!0,get:function(){return se.defaultGenerateColorKey}});var ce=r(7404);Object.defineProperty(t,"createDomToModelContext",{enumerable:!0,get:function(){return ce.createDomToModelContext}}),Object.defineProperty(t,"createDomToModelContextWithConfig",{enumerable:!0,get:function(){return ce.createDomToModelContextWithConfig}}),Object.defineProperty(t,"createDomToModelConfig",{enumerable:!0,get:function(){return ce.createDomToModelConfig}});var de=r(4768);Object.defineProperty(t,"createModelToDomContext",{enumerable:!0,get:function(){return de.createModelToDomContext}}),Object.defineProperty(t,"createModelToDomContextWithConfig",{enumerable:!0,get:function(){return de.createModelToDomContextWithConfig}}),Object.defineProperty(t,"createModelToDomConfig",{enumerable:!0,get:function(){return de.createModelToDomConfig}});var ue=r(9265);Object.defineProperty(t,"isBold",{enumerable:!0,get:function(){return ue.isBold}});var pe=r(8257);Object.defineProperty(t,"getSelectionRootNode",{enumerable:!0,get:function(){return pe.getSelectionRootNode}});var fe=r(3120);Object.defineProperty(t,"getDOMInsertPointRect",{enumerable:!0,get:function(){return fe.getDOMInsertPointRect}});var me=r(9076);Object.defineProperty(t,"isCharacterValue",{enumerable:!0,get:function(){return me.isCharacterValue}}),Object.defineProperty(t,"isModifierKey",{enumerable:!0,get:function(){return me.isModifierKey}}),Object.defineProperty(t,"isCursorMovingKey",{enumerable:!0,get:function(){return me.isCursorMovingKey}});var ge=r(9298);Object.defineProperty(t,"combineBorderValue",{enumerable:!0,get:function(){return ge.combineBorderValue}}),Object.defineProperty(t,"extractBorderValues",{enumerable:!0,get:function(){return ge.extractBorderValues}});var he=r(5245);Object.defineProperty(t,"isPunctuation",{enumerable:!0,get:function(){return he.isPunctuation}}),Object.defineProperty(t,"isSpace",{enumerable:!0,get:function(){return he.isSpace}}),Object.defineProperty(t,"normalizeText",{enumerable:!0,get:function(){return he.normalizeText}});var ve=r(7311);Object.defineProperty(t,"parseTableCells",{enumerable:!0,get:function(){return ve.parseTableCells}});var ye=r(1074);Object.defineProperty(t,"readFile",{enumerable:!0,get:function(){return ye.readFile}});var be=r(6537);Object.defineProperty(t,"transformColor",{enumerable:!0,get:function(){return be.transformColor}});var Se=r(9526);Object.defineProperty(t,"extractClipboardItems",{enumerable:!0,get:function(){return Se.extractClipboardItems}});var Ce=r(6819);Object.defineProperty(t,"cacheGetEventData",{enumerable:!0,get:function(){return Ce.cacheGetEventData}});var _e=r(1186);Object.defineProperty(t,"isBlockGroupOfType",{enumerable:!0,get:function(){return _e.isBlockGroupOfType}});var Ee=r(3136);Object.defineProperty(t,"iterateSelections",{enumerable:!0,get:function(){return Ee.iterateSelections}});var Te=r(2144);Object.defineProperty(t,"getFirstSelectedListItem",{enumerable:!0,get:function(){return Te.getFirstSelectedListItem}}),Object.defineProperty(t,"getFirstSelectedTable",{enumerable:!0,get:function(){return Te.getFirstSelectedTable}}),Object.defineProperty(t,"getOperationalBlocks",{enumerable:!0,get:function(){return Te.getOperationalBlocks}}),Object.defineProperty(t,"getSelectedParagraphs",{enumerable:!0,get:function(){return Te.getSelectedParagraphs}}),Object.defineProperty(t,"getSelectedSegments",{enumerable:!0,get:function(){return Te.getSelectedSegments}}),Object.defineProperty(t,"getSelectedSegmentsAndParagraphs",{enumerable:!0,get:function(){return Te.getSelectedSegmentsAndParagraphs}});var ke=r(6303);Object.defineProperty(t,"getSelectedCells",{enumerable:!0,get:function(){return ke.getSelectedCells}});var Me=r(7691);Object.defineProperty(t,"hasSelectionInBlock",{enumerable:!0,get:function(){return Me.hasSelectionInBlock}});var Oe=r(3407);Object.defineProperty(t,"hasSelectionInSegment",{enumerable:!0,get:function(){return Oe.hasSelectionInSegment}});var Pe=r(9404);Object.defineProperty(t,"hasSelectionInBlockGroup",{enumerable:!0,get:function(){return Pe.hasSelectionInBlockGroup}});var we=r(7595);Object.defineProperty(t,"setSelection",{enumerable:!0,get:function(){return we.setSelection}});var xe=r(7457);Object.defineProperty(t,"cloneModel",{enumerable:!0,get:function(){return xe.cloneModel}});var De=r(8458);Object.defineProperty(t,"mergeModel",{enumerable:!0,get:function(){return De.mergeModel}});var Le=r(9584);Object.defineProperty(t,"deleteSelection",{enumerable:!0,get:function(){return Le.deleteSelection}});var Ie=r(7987);Object.defineProperty(t,"deleteSegment",{enumerable:!0,get:function(){return Ie.deleteSegment}});var Fe=r(9039);Object.defineProperty(t,"deleteBlock",{enumerable:!0,get:function(){return Fe.deleteBlock}});var Re=r(7784);Object.defineProperty(t,"applyTableFormat",{enumerable:!0,get:function(){return Re.applyTableFormat}}),Object.defineProperty(t,"setFirstColumnFormatBorders",{enumerable:!0,get:function(){return Re.setFirstColumnFormatBorders}});var Ne=r(1166);Object.defineProperty(t,"normalizeTable",{enumerable:!0,get:function(){return Ne.normalizeTable}}),Object.defineProperty(t,"MIN_ALLOWED_TABLE_CELL_WIDTH",{enumerable:!0,get:function(){return Ne.MIN_ALLOWED_TABLE_CELL_WIDTH}}),Object.defineProperty(t,"MIN_ALLOWED_TABLE_CELL_HEIGHT",{enumerable:!0,get:function(){return Ne.MIN_ALLOWED_TABLE_CELL_HEIGHT}});var Ae=r(636);Object.defineProperty(t,"setTableCellBackgroundColor",{enumerable:!0,get:function(){return Ae.setTableCellBackgroundColor}});var Be=r(2504);Object.defineProperty(t,"retrieveModelFormatState",{enumerable:!0,get:function(){return Be.retrieveModelFormatState}});var je=r(8955);Object.defineProperty(t,"getListStyleTypeFromString",{enumerable:!0,get:function(){return je.getListStyleTypeFromString}});var He=r(654);Object.defineProperty(t,"getSegmentTextFormat",{enumerable:!0,get:function(){return He.getSegmentTextFormat}});var ze=r(7921);Object.defineProperty(t,"getClosestAncestorBlockGroupIndex",{enumerable:!0,get:function(){return ze.getClosestAncestorBlockGroupIndex}});var We=r(5471);Object.defineProperty(t,"runEditSteps",{enumerable:!0,get:function(){return We.runEditSteps}});var Ge=r(9655);Object.defineProperty(t,"updateImageMetadata",{enumerable:!0,get:function(){return Ge.updateImageMetadata}}),Object.defineProperty(t,"getImageMetadata",{enumerable:!0,get:function(){return Ge.getImageMetadata}});var Ue=r(318);Object.defineProperty(t,"updateTableCellMetadata",{enumerable:!0,get:function(){return Ue.updateTableCellMetadata}}),Object.defineProperty(t,"getTableCellMetadata",{enumerable:!0,get:function(){return Ue.getTableCellMetadata}});var Ke=r(9966);Object.defineProperty(t,"updateTableMetadata",{enumerable:!0,get:function(){return Ke.updateTableMetadata}}),Object.defineProperty(t,"getTableMetadata",{enumerable:!0,get:function(){return Ke.getTableMetadata}});var Ve=r(8294);Object.defineProperty(t,"updateListMetadata",{enumerable:!0,get:function(){return Ve.updateListMetadata}}),Object.defineProperty(t,"getListMetadata",{enumerable:!0,get:function(){return Ve.getListMetadata}}),Object.defineProperty(t,"ListMetadataDefinition",{enumerable:!0,get:function(){return Ve.ListMetadataDefinition}});var qe=r(8187);Object.defineProperty(t,"ChangeSource",{enumerable:!0,get:function(){return qe.ChangeSource}});var Ze=r(602);Object.defineProperty(t,"BulletListType",{enumerable:!0,get:function(){return Ze.BulletListType}});var Xe=r(5043);Object.defineProperty(t,"NumberingListType",{enumerable:!0,get:function(){return Xe.NumberingListType}});var Ye=r(6705);Object.defineProperty(t,"TableBorderFormat",{enumerable:!0,get:function(){return Ye.TableBorderFormat}});var $e=r(3180);Object.defineProperty(t,"OrderedListStyleMap",{enumerable:!0,get:function(){return $e.OrderedListStyleMap}});var Qe=r(2901);Object.defineProperty(t,"UnorderedListStyleMap",{enumerable:!0,get:function(){return Qe.UnorderedListStyleMap}});var Je=r(5287);Object.defineProperty(t,"EmptySegmentFormat",{enumerable:!0,get:function(){return Je.EmptySegmentFormat}})},7958:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setParagraphNotImplicit=void 0;var n=r(376);t.setParagraphNotImplicit=function(e){"Paragraph"==e.blockType&&e.isImplicit&&((0,n.mutateBlock)(e).isImplicit=!1)}},2394:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addBlock=void 0,t.addBlock=function(e,t){e.blocks.push(t)}},9849:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addDecorators=t.addCode=t.addLink=void 0;var n=r(1635);function o(e,t){t.format.href&&(e.link={format:(0,n.__assign)({},t.format),dataset:(0,n.__assign)({},t.dataset)})}function i(e,t){t.format.fontFamily&&(e.code={format:(0,n.__assign)({},t.format)})}t.addLink=o,t.addCode=i,t.addDecorators=function(e,t){o(e,t.link),i(e,t.code)}},5142:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addSegment=void 0;var n=r(8276);t.addSegment=function(e,t,r,o){var i=(0,n.ensureParagraph)(e,r,o),a=i.segments[i.segments.length-1];return(null==r?void 0:r.textIndent)&&(r.isTextIndentApplied&&0==i.segments.length?delete i.format.textIndent:r.isTextIndentApplied=!0,delete i.format.isTextIndentApplied),"SelectionMarker"==t.segmentType?a&&a.isSelected&&t.isSelected||i.segments.push(t):(t.isSelected&&"SelectionMarker"==(null==a?void 0:a.segmentType)&&a.isSelected&&i.segments.pop(),i.segments.push(t)),i}},7423:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addTextSegment=void 0;var n=r(9849),o=r(5142),i=r(8465),a=r(8276),l=r(9833),s=r(3869);t.addTextSegment=function(e,t,r){var c,d;if(t){var u=(0,a.ensureParagraph)(e,r.blockFormat);(!(0,l.hasSpacesOnly)(t)||(null!==(c=null==u?void 0:u.segments.length)&&void 0!==c?c:0)>0||(0,s.isWhiteSpacePreserved)(null==u?void 0:u.format.whiteSpace))&&(d=(0,i.createText)(t,r.segmentFormat),r.isInSelection&&(d.isSelected=!0),(0,n.addDecorators)(d,r),(0,o.addSegment)(e,d,r.blockFormat))}return d}},8276:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ensureParagraph=void 0;var n=r(2394),o=r(5450),i=r(376);t.ensureParagraph=function(e,t,r){var a=e.blocks[e.blocks.length-1];if("Paragraph"==(null==a?void 0:a.blockType))return(0,i.mutateBlock)(a);var l=(0,o.createParagraph)(!0,t,r);return(0,n.addBlock)(e,l),l}},9833:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasSpacesOnly=void 0;var r=/^[\r\n\t ]*$/;t.hasSpacesOnly=function(e){return r.test(e)}},5061:(e,t)=>{"use strict";function r(e){switch(e.blockType){case"Paragraph":return 0==e.segments.length;case"Table":return e.rows.every((function(e){return 0==e.cells.length}));case"BlockGroup":return n(e);default:return!1}}function n(e){switch(e.blockGroupType){case"FormatContainer":return"div"!=e.tagName&&e.blocks.every(r);case"ListItem":return e.blocks.every(r);case"Document":case"General":case"TableCell":return!1;default:return!0}}function o(e){return"Text"===e.segmentType&&!e.text}Object.defineProperty(t,"__esModule",{value:!0}),t.isEmpty=t.isSegmentEmpty=t.isBlockGroupEmpty=t.isBlockEmpty=void 0,t.isBlockEmpty=r,t.isBlockGroupEmpty=n,t.isSegmentEmpty=o,t.isEmpty=function(e){return function(e){return"string"==typeof e.blockGroupType}(e)?n(e):function(e){return"string"==typeof e.blockType}(e)?r(e):!!function(e){return"string"==typeof e.segmentType}(e)&&o(e)}},376:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mutateSegment=t.mutateSegments=t.mutateBlock=void 0;var n=r(1635);function o(e){return e.cachedElement&&delete e.cachedElement,"Table"==e.blockType?e.rows.forEach((function(e){delete e.cachedElement})):"ListItem"==e.blockGroupType&&e.levels.forEach((function(e){return delete e.cachedElement})),e}function i(e,t){var r=o(e),n=[r,[],[]];return t&&t.forEach((function(t){var o=e.segments.indexOf(t);o>=0&&(n[1].push(r.segments[o]),n[2].push(o))})),n}t.mutateBlock=o,t.mutateSegments=i,t.mutateSegment=function(e,t,r){var o,a=(0,n.__read)(i(e,[t]),3),l=a[0],s=a[1],c=a[2],d=s[0]==t?s[0]:null;return r&&d&&r(s[0],l,c[0]),[l,d,null!==(o=c[0])&&void 0!==o?o:-1]}},8941:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeContentModel=void 0;var n=r(5061),o=r(376),i=r(9981),a=r(8840);t.normalizeContentModel=function e(t){for(var r=t.blocks.length-1;r>=0;r--){var l=t.blocks[r];switch(l.blockType){case"BlockGroup":"ListItem"==l.blockGroupType&&0==l.levels.length?(r+=l.blocks.length,(0,a.unwrapBlock)(t,l)):e(l);break;case"Paragraph":(0,i.normalizeParagraph)(l);break;case"Table":for(var s=0;s<l.rows.length;s++)for(var c=0;c<l.rows[s].cells.length;c++)l.rows[s].cells[c]&&e(l.rows[s].cells[c])}(0,n.isBlockEmpty)(l)&&(0,o.mutateBlock)(t).blocks.splice(r,1)}}},9981:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeParagraph=void 0;var n=r(9187),o=r(4814),i=r(5061),a=r(3869),l=r(376),s=r(1966);t.normalizeParagraph=function(e){var t=e.segments;if(!e.isImplicit&&t.length>0){var r=t[t.length-1],d=t[t.length-2];if("SelectionMarker"!=r.segmentType||d&&"Br"!=d.segmentType){if(t.length>1&&"Br"==t[t.length-1].segmentType){var u=t.filter((function(e){return"SelectionMarker"!=e.segmentType}));u.length>1&&"Br"!=u[u.length-2].segmentType&&(0,l.mutateBlock)(e).segments.pop()}}else(0,l.mutateBlock)(e).segments.push((0,o.createBr)(r.format));!function(e){e.format.whiteSpace&&e.segments.every((function(e){return"Br"==e.segmentType||"SelectionMarker"==e.segmentType}))&&delete(0,l.mutateBlock)(e).format.whiteSpace}(e)}(0,a.isWhiteSpacePreserved)(e.format.whiteSpace)||(0,s.normalizeAllSegments)(e),function(e){var t=e.segments.find((function(e){return"SelectionMarker"==e.segmentType}));if(t){var r=e.segments.indexOf(t),o=e.segments[r-1],i=e.segments[r+1];(o&&!o.link&&(0,n.areSameFormats)(o.format,t.format)&&(!i||!i.link&&(0,n.areSameFormats)(i.format,t.format))&&t.link||!o&&t.link&&i&&!i.link&&(0,n.areSameFormats)(i.format,t.format))&&(0,l.mutateSegment)(e,t,(function(e){delete e.link}))}}(e),function(e){for(var t=e.segments.length-1;t>=0;t--)(0,i.isSegmentEmpty)(e.segments[t])&&(0,l.mutateBlock)(e).segments.splice(t,1)}(e),function(e){if(!e.decorator){var t=e.segments.filter((function(e){return"SelectionMarker"!=e.segmentType})),r=e.segmentFormat||{},n=!1;c.forEach((function(e){n=function(e,t,r){var n,o=null===(n=e[0])||void 0===n?void 0:n.format;return!(!(null==o?void 0:o[r])||!e.every((function(e){return e.format[r]==o[r]}))||t[r]==o[r]||(t[r]=o[r],0))}(t,r,e)||n})),n&&((0,l.mutateBlock)(e).segmentFormat=r)}}(e)};var c=["fontFamily","fontSize","textColor"]},1966:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeSegment=t.createNormalizeSegmentContext=t.normalizeSingleSegment=t.normalizeAllSegments=void 0;var n=r(9833),o=r(376),i=" ",a=" ",l=/^\u0020+/,s=/\u0020+$/;function c(e){return Object.assign(null!=e?e:{},{textSegments:[],ignoreLeadingSpaces:!0,ignoreTrailingSpaces:!0,lastInlineSegment:void 0,lastTextSegment:void 0})}function d(e,t,r){switch(t.segmentType){case"Br":u(e,r.textSegments,r.lastInlineSegment),p(e,r.lastTextSegment,r.lastInlineSegment),c(r);break;case"Entity":case"General":case"Image":r.lastInlineSegment=t,r.ignoreLeadingSpaces=!1;break;case"Text":r.textSegments.push(t),r.lastInlineSegment=t,r.lastTextSegment=t;var d=t.text.substring(0,1),f=t.text.substr(-1);(0,n.hasSpacesOnly)(t.text)||(d==i&&(0,o.mutateSegment)(e,t,(function(e){e.text=e.text.replace(l,r.ignoreLeadingSpaces?"":a)})),f==i&&(0,o.mutateSegment)(e,t,(function(e){e.text=e.text.replace(s,r.ignoreTrailingSpaces?i:a)}))),r.ignoreLeadingSpaces=f==i}}function u(e,t,r){t.forEach((function(t){if(t!=r){var n=t.text;n.substr(-1)==a&&n.length>1&&n.substr(-2,1)!=i&&(0,o.mutateSegment)(e,t,(function(e){e.text=n.substring(0,n.length-1)+i}))}}))}function p(e,t,r){t&&t==r&&(null==t?void 0:t.text.substr(-1))==i&&(0,o.mutateSegment)(e,t,(function(e){e.text=e.text.replace(s,"")}))}t.normalizeAllSegments=function(e){var t=c();e.segments.forEach((function(r){d(e,r,t)})),u(e,t.textSegments,t.lastInlineSegment),p(e,t.lastTextSegment,t.lastInlineSegment)},t.normalizeSingleSegment=function(e,t,r){void 0===r&&(r=!1);var n=c();n.ignoreTrailingSpaces=r,d(e,t,n)},t.createNormalizeSegmentContext=function(){return c()},t.normalizeSegment=d},8840:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unwrapBlock=void 0;var n=r(1635),o=r(376),i=r(7958);t.unwrapBlock=function(e,t){var r,a,l,s=null!==(a=null==e?void 0:e.blocks.indexOf(t))&&void 0!==a?a:-1;s>=0&&(t.blocks.forEach(i.setParagraphNotImplicit),e&&(null===(l=(0,o.mutateBlock)(e))||void 0===l||(r=l.blocks).splice.apply(r,(0,n.__spreadArray)([s,1],(0,n.__read)(t.blocks.map(o.mutateBlock)),!1))))}},4814:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBr=void 0;var n=r(1635);t.createBr=function(e){return{segmentType:"Br",format:(0,n.__assign)({},e)}}},7357:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createContentModelDocument=void 0,t.createContentModelDocument=function(e){var t={blockGroupType:"Document",blocks:[]};return e&&(t.format=e),t}},6133:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDivider=void 0;var n=r(1635);t.createDivider=function(e,t){return{blockType:"Divider",tagName:e,format:(0,n.__assign)({},t)}}},3992:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEmptyModel=void 0;var n=r(4814),o=r(7357),i=r(5450),a=r(7192);t.createEmptyModel=function(e){var t=(0,o.createContentModelDocument)(e),r=(0,i.createParagraph)(!1,void 0,e);return r.segments.push((0,a.createSelectionMarker)(e),(0,n.createBr)(e)),t.blocks.push(r),t}},5681:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEntity=void 0;var n=r(1635);t.createEntity=function(e,t,r,o,i){return void 0===t&&(t=!0),{segmentType:"Entity",blockType:"Entity",format:(0,n.__assign)({},r),entityFormat:{id:i,entityType:o,isReadonly:t},wrapper:e}}},5470:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFormatContainer=void 0;var n=r(1635);t.createFormatContainer=function(e,t){return{blockType:"BlockGroup",blockGroupType:"FormatContainer",tagName:e,blocks:[],format:(0,n.__assign)({},t)}}},5219:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGeneralBlock=void 0,t.createGeneralBlock=function(e){return{blockType:"BlockGroup",blockGroupType:"General",element:e,blocks:[],format:{}}}},7431:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGeneralSegment=void 0;var n=r(1635);t.createGeneralSegment=function(e,t){return{blockType:"BlockGroup",blockGroupType:"General",segmentType:"General",format:(0,n.__assign)({},t),blocks:[],element:e}}},6349:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createImage=void 0;var n=r(1635);t.createImage=function(e,t){return{segmentType:"Image",src:e,format:(0,n.__assign)({},t),dataset:{}}}},6953:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createListItem=void 0;var n=r(598),o=r(7192);t.createListItem=function(e,t){var r=(0,o.createSelectionMarker)(t);return r.isSelected=!1,{blockType:"BlockGroup",blockGroupType:"ListItem",blocks:[],levels:e?e.map((function(e){return(0,n.createListLevel)(e.listType,e.format,e.dataset)})):[],formatHolder:r,format:{}}}},598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createListLevel=void 0;var n=r(1635);t.createListLevel=function(e,t,r){return{listType:e,format:(0,n.__assign)({},t),dataset:(0,n.__assign)({},r)}}},5450:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createParagraph=void 0;var n=r(1635);t.createParagraph=function(e,t,r,o){var i={blockType:"Paragraph",segments:[],format:(0,n.__assign)({},t)};return r&&Object.keys(r).length>0&&(i.segmentFormat=(0,n.__assign)({},r)),e&&(i.isImplicit=!0),o&&(i.decorator={tagName:o.tagName,format:(0,n.__assign)({},o.format)}),i}},6357:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createParagraphDecorator=void 0;var n=r(1635);t.createParagraphDecorator=function(e,t){return{tagName:e.toLocaleLowerCase(),format:(0,n.__assign)({},t)}}},7192:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionMarker=void 0;var n=r(1635);t.createSelectionMarker=function(e){return{segmentType:"SelectionMarker",isSelected:!0,format:(0,n.__assign)({},e)}}},1728:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTable=void 0;var n=r(1635),o=r(3262);t.createTable=function(e,t){for(var r=[],i=0;i<e;i++)r.push((0,o.createTableRow)());return{blockType:"Table",rows:r,format:(0,n.__assign)({},t),widths:[],dataset:{}}}},7720:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTableCell=void 0;var n=r(1635);t.createTableCell=function(e,t,r,o,i){var a="number"==typeof e?e>1:!!e,l="number"==typeof t?t>1:!!t;return{blockGroupType:"TableCell",blocks:[],format:(0,n.__assign)({},o),spanLeft:a,spanAbove:l,isHeader:!!r,dataset:(0,n.__assign)({},i)}}},3262:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTableRow=void 0;var n=r(1635);t.createTableRow=function(e,t){return void 0===t&&(t=0),{height:t,format:(0,n.__assign)({},e),cells:[]}}},8465:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createText=void 0;var n=r(1635),o=r(9849);t.createText=function(e,t,r,i){var a={segmentType:"Text",text:e,format:(0,n.__assign)({},t)};return r&&(0,o.addLink)(a,r),i&&(0,o.addCode)(a,i),a}},7784:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.setFirstColumnFormatBorders=t.applyTableFormat=void 0;var o=r(1635),i=r(2412),a=r(9298),l=r(376),s=r(636),c=r(6705),d=r(318),u=r(9966),p={topBorderColor:"#ABABAB",bottomBorderColor:"#ABABAB",verticalBorderColor:"#ABABAB",hasHeaderRow:!1,hasFirstColumn:!1,hasBandedRows:!1,hasBandedColumns:!1,bgColorEven:null,bgColorOdd:"#ABABAB20",headerRowColor:"#ABABAB",tableBorderFormat:c.TableBorderFormat.Default,verticalAlign:null};t.applyTableFormat=function(e,t,r){var n=(0,l.mutateBlock)(e),c=n.rows;(0,u.updateTableMetadata)(n,(function(e){var n=(0,o.__assign)((0,o.__assign)((0,o.__assign)({},p),e),t),u=function(e,t){var r={bgColorOverrides:[],vAlignOverrides:[],borderOverrides:[]};return e.forEach((function(e){var n=[],o=[],i=[];r.bgColorOverrides.push(n),r.vAlignOverrides.push(o),r.borderOverrides.push(i),e.cells.forEach((function(e){(0,d.updateTableCellMetadata)((0,l.mutateBlock)(e),(function(e){return e&&t?(n.push(!1),delete e.bgColorOverride):n.push(!!(null==e?void 0:e.bgColorOverride)),o.push(!!(null==e?void 0:e.vAlignOverride)),i.push(!!(null==e?void 0:e.borderOverride)),e}))}))})),r}(c,!r);return function(e,t,r){var n=t.hasBandedRows,o=t.hasBandedColumns,c=t.bgColorOdd,d=t.bgColorEven,u=t.hasFirstColumn;e.forEach((function(p,m){p.cells.forEach((function(g,v){var y,b=(0,l.mutateBlock)(g);if(!r.borderOverrides[m][v]&&"number"==typeof t.tableBorderFormat){var S=null===(y=f[t.tableBorderFormat])||void 0===y?void 0:y.call(f,{firstRow:0===m,lastRow:m===e.length-1,firstColumn:0===v,lastColumn:v===p.cells.length-1}),C=[t.topBorderColor,t.verticalBorderColor,t.bottomBorderColor,t.verticalBorderColor];null==S||S.forEach((function(e,t){var r=!e&&C[t]||"";b.format[i.BorderKeys[t]]=(0,a.combineBorderValue)({style:h(r),width:"1px",color:r})}))}if(!r.bgColorOverrides[m][v]){var _;_=u&&0==v&&m>0?null:(n||o)&&(o&&v%2!=0||n&&m%2!=0)?c:d,(0,s.setTableCellBackgroundColor)(b,_,!1,!0)}t.verticalAlign&&!r.vAlignOverrides[m][v]&&(b.format.verticalAlign=t.verticalAlign),b.isHeader=!1}))}))}(c,n,u),m(c,n),function(e,t,r){var n;if(t.hasHeaderRow){null===(n=e[0])||void 0===n||n.cells.forEach((function(e,n){var o=(0,l.mutateBlock)(e);o.isHeader=!0,t.headerRowColor&&(r.bgColorOverrides[0][n]||(0,s.setTableCellBackgroundColor)(o,t.headerRowColor,!1,!0),g(o.format,"borderTop",t.headerRowColor),g(o.format,"borderRight",t.headerRowColor),g(o.format,"borderLeft",t.headerRowColor))}))}}(c,n,u),n}))};var f=((n={})[c.TableBorderFormat.Default]=function(e){return[!1,!1,!1,!1]},n[c.TableBorderFormat.ListWithSideBorders]=function(e){return[!1,!e.lastColumn,!1,!e.firstColumn]},n[c.TableBorderFormat.FirstColumnHeaderExternal]=function(e){var t=e.firstColumn,r=e.firstRow;return[!r,!e.lastColumn&&!t||t&&r,!e.lastRow&&!r,!t]},n[c.TableBorderFormat.NoHeaderBorders]=function(e){var t=e.firstRow,r=e.firstColumn,n=e.lastColumn;return[t,t||n,!1,t||r]},n[c.TableBorderFormat.NoSideBorders]=function(e){var t=e.firstColumn;return[!1,e.lastColumn,!1,t]},n[c.TableBorderFormat.EspecialType1]=function(e){var t=e.firstRow,r=e.firstColumn;return[r&&!t,t,r&&!t,t&&!r]},n[c.TableBorderFormat.EspecialType2]=function(e){var t=e.firstRow,r=e.firstColumn;return[!t,t||!r,!t,!r]},n[c.TableBorderFormat.EspecialType3]=function(e){var t=e.firstColumn,r=e.firstRow;return[!0,r||!t,!r,!0]},n[c.TableBorderFormat.Clear]=function(){return[!0,!0,!0,!0]},n);function m(e,t){t.hasFirstColumn&&e.forEach((function(r,n){r.cells.forEach((function(r,o){var i=(0,l.mutateBlock)(r);if(0===o)switch(i.isHeader=!0,n){case 0:i.isHeader=!!t.hasHeaderRow;break;case e.length-1:g(i.format,"borderTop");break;case 1:g(i.format,"borderBottom");break;default:g(i.format,"borderTop"),g(i.format,"borderBottom")}}))}))}function g(e,t,r){var n=(0,a.extractBorderValues)(e[t]);n.color=r||"",n.style=h(n.color),e[t]=(0,a.combineBorderValue)(n)}function h(e){return e&&"transparent"!=e?"solid":"none"}t.setFirstColumnFormatBorders=m},7457:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cloneModel=void 0;var n=r(1635);function o(e){return{format:Object.assign({},e.format)}}function i(e){return{dataset:Object.assign({},e.dataset)}}function a(e){var t=e.blockType;return Object.assign({blockType:t},o(e))}function l(e,t){return{blockGroupType:e.blockGroupType,blocks:e.blocks.map((function(e){return function(e,t){switch(e.blockType){case"BlockGroup":switch(e.blockGroupType){case"FormatContainer":return function(e,t){var r=e.tagName,n=e.cachedElement,o=Object.assign({tagName:r,cachedElement:f(n,"cache",t)},a(e),l(e,t));return e.zeroFontSize&&(o.zeroFontSize=!0),o}(e,t);case"General":return u(e,t);case"ListItem":return function(e,t){var r=e.formatHolder,n=e.levels,o=e.cachedElement;return Object.assign({formatHolder:p(r),levels:n.map(d),cachedElement:f(o,"cache",t)},a(e),l(e,t))}(e,t)}break;case"Divider":return function(e,t){var r=e.tagName,n=e.isSelected,o=e.cachedElement;return Object.assign({isSelected:n,tagName:r,cachedElement:f(o,"cache",t)},a(e))}(e,t);case"Entity":return c(e,t);case"Paragraph":return function(e,t){var r=e.cachedElement,l=e.segments,d=e.isImplicit,m=e.decorator,g=e.segmentFormat,h=Object.assign({cachedElement:f(r,"cache",t),isImplicit:d,segments:l.map((function(e){return function(e,t){switch(e.segmentType){case"Br":return s(e);case"Entity":return c(e,t);case"General":return function(e,t){return Object.assign(u(e,t),s(e))}(e,t);case"Image":return a=(o=e).src,l=o.alt,d=o.title,f=o.isSelectedAsImageSelection,Object.assign({src:a,alt:l,title:d,isSelectedAsImageSelection:f},s(o),i(o));case"SelectionMarker":return p(e);case"Text":return n=(r=e).text,Object.assign({text:n},s(r))}var r,n,o,a,l,d,f}(e,t)})),segmentFormat:g?(0,n.__assign)({},g):void 0},a(e),o(e));return m&&(h.decorator=Object.assign({tagName:m.tagName},o(m))),h}(e,t);case"Table":return function(e,t){var r=e.cachedElement,n=e.widths,s=e.rows;return Object.assign({cachedElement:f(r,"cache",t),widths:Array.from(n),rows:s.map((function(e){return function(e,t){var r=e.height,n=e.cells,a=e.cachedElement;return Object.assign({height:r,cachedElement:f(a,"cache",t),cells:n.map((function(e){return function(e,t){var r=e.cachedElement,n=e.isSelected,a=e.spanAbove,s=e.spanLeft,c=e.isHeader;return Object.assign({cachedElement:f(r,"cache",t),isSelected:n,spanAbove:a,spanLeft:s,isHeader:c},l(e,t),o(e),i(e))}(e,t)}))},o(e))}(e,t)}))},a(e),i(e))}(e,t)}}(e,t)}))}}function s(e){var t=e.segmentType,r=e.isSelected,n=e.code,a=e.link,l=Object.assign({segmentType:t,isSelected:r},o(e));return n&&(l.code=o(n)),a&&(l.link=Object.assign(o(a),i(a))),l}function c(e,t){var r=e.wrapper,o=e.entityFormat;return Object.assign({wrapper:f(r,"entity",t),entityFormat:(0,n.__assign)({},o)},a(e),s(e))}function d(e){var t=e.listType;return Object.assign({listType:t},o(e),i(e))}function u(e,t){var r=e.element;return Object.assign({element:f(r,"general",t)},a(e),l(e,t))}function p(e){return Object.assign({isSelected:e.isSelected},s(e))}function f(e,t,r){var n=r.includeCachedElement;if(e){if(n){if(!0===n)return e;var o=n(e,t);if(("general"==t||"entity"==t)&&!o)throw new Error("Entity and General Model must has wrapper element");return o}return"cache"==t?void 0:e.cloneNode(!0)}}t.cloneModel=function(e,t){var r=l(e,t||{});return e.format&&(r.format=Object.assign({},e.format)),r}},9039:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteBlock=void 0,t.deleteBlock=function(e,t,r,n,o){var i=e.indexOf(t);switch(t.blockType){case"Table":case"Divider":return r?e.splice(i,1,r):e.splice(i,1),!0;case"Entity":var a=t.isSelected?"overwrite":"forward"==o?"removeFromStart":"backward"==o?"removeFromEnd":void 0;return void 0!==a&&(r?e.splice(i,1,r):e.splice(i,1),null==n||n.deletedEntities.push({entity:t,operation:a})),!0;case"BlockGroup":switch(t.blockGroupType){case"General":return!!r&&(e.splice(i,1,r),!0);case"ListItem":case"FormatContainer":return e.splice(i,1),!0}}return!1}},2795:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteExpandedSelection=void 0;var n=r(1635),o=r(4814),i=r(5450),a=r(7192),l=r(9039),s=r(7987),c=r(654),d=r(3136),u=r(376),p=r(7958),f={contentUnderSelectedTableCell:"ignoreForTableOrCell",contentUnderSelectedGeneralElement:"generalElementOnly",includeListFormatHolder:"never"};function m(e,t,r,n){return{marker:e,paragraph:t,path:r,tableContext:n}}t.deleteExpandedSelection=function(e,t){var r={deleteResult:"notDeleted",insertPoint:null,formatContext:t};return(0,d.iterateSelections)(e,(function(t,d,f,g){var h=(0,i.createParagraph)(!0,void 0,e.format),v=e.format,y=0;if(g&&"Paragraph"==(null==f?void 0:f.blockType)){var b=(0,n.__read)((0,u.mutateSegments)(f,g),3),S=b[0],C=b[1],_=b[2];C[0]&&(h=S,y=_[0],v=(0,c.getSegmentTextFormat)(C[0]),r.lastParagraph=h,r.lastTableContext=d,C.forEach((function(e,n){0!=n||r.insertPoint||"SelectionMarker"!=e.segmentType?(0,s.deleteSegment)(S,e,r.formatContext)&&(r.deleteResult="range"):r.insertPoint=m(e,S,t,d)})),"range"==r.deleteResult&&(0,p.setParagraphNotImplicit)(S))}else if(f){var E=(0,u.mutateBlock)(t[0]).blocks;(0,l.deleteBlock)(E,f,h,r.formatContext)&&(r.deleteResult="range")}else if(d){var T=d.table,k=d.colIndex,M=d.rowIndex,O=(0,u.mutateBlock)(T).rows[M],P=(0,u.mutateBlock)(O.cells[k]);t=(0,n.__spreadArray)([P],(0,n.__read)(t),!1),h.segments.push((0,o.createBr)(e.format)),P.blocks=[h],r.deleteResult="range"}if(!r.insertPoint){var w=(0,a.createSelectionMarker)(v);(0,p.setParagraphNotImplicit)(h),h.segments.splice(y,0,w),r.insertPoint=m(w,h,t,d)}}),f),r}},7987:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteSegment=void 0;var n=r(1635),o=r(6644),i=r(3869),a=r(376),l=r(1966),s=r(5245);t.deleteSegment=function(e,t,r,c){var d=(0,n.__read)((0,a.mutateSegment)(e,t),3),u=d[0],p=d[1],f=d[2],m=u.segments,g=(0,i.isWhiteSpacePreserved)(u.format.whiteSpace),h="forward"==c,v="backward"==c;switch(g||function(e,t,r){for(var n,o=r-1;"SelectionMarker"==(null===(n=t[o])||void 0===n?void 0:n.segmentType);)o--;var i=t[o];i&&(0,l.normalizeSingleSegment)(e,i)}(u,m,f),null==p?void 0:p.segmentType){case"Br":case"Image":case"SelectionMarker":return m.splice(f,1),!0;case"Entity":var y=p.isSelected?"overwrite":h?"removeFromStart":v?"removeFromEnd":void 0;return void 0!==y&&(m.splice(f,1),null==r||r.deletedEntities.push({entity:p,operation:y})),!0;case"Text":var b=p.text;return 0==b.length||p.isSelected?m.splice(f,1):c&&(b=(0,o.deleteSingleChar)(b,h),g||(b=(0,s.normalizeText)(b,h)),""==b?m.splice(f,1):p.text=b),!0;case"General":return!!p.isSelected&&(m.splice(f,1),!0);default:return!1}}},9584:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteSelection=void 0;var n=r(1635),o=r(2795),i=r(376),a=r(5471);t.deleteSelection=function(e,t,r){void 0===t&&(t=[]);var l=(0,o.deleteExpandedSelection)(e,r),s=t.filter((function(e){return!!e}));return(0,a.runEditSteps)(s,l),function(e){var t,r=e.insertPoint,o=e.deleteResult,a=e.lastParagraph,l=e.lastTableContext;if(r&&"notDeleted"!=o&&"nothingToDelete"!=o&&a&&a!=r.paragraph&&l==r.tableContext){var s=(0,i.mutateBlock)(a);(t=(0,i.mutateBlock)(r.paragraph).segments).push.apply(t,(0,n.__spreadArray)([],(0,n.__read)(s.segments),!1)),s.segments=[]}}(l),l}},6644:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteSingleChar=void 0;var n=r(1635);t.deleteSingleChar=function(e,t){for(var r=(0,n.__spreadArray)([],(0,n.__read)(e),!1),o=0,i=t?0:r.length-1,a="notDeleted";i>=0&&i<r.length&&"done"!=a;i+=t?1:-1)switch(r[i]){case"‍":case"⃣":case"︎":case"️":a="notDeleted",o++;break;default:"notDeleted"==a?(a="waiting",o++):"waiting"==a&&(a="done")}return r.splice(t?0:r.length-o,o),r.join("")}},7921:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getClosestAncestorBlockGroupIndex=void 0,t.getClosestAncestorBlockGroupIndex=function(e,t,r){void 0===r&&(r=[]);for(var n=0;n<e.length;n++){var o=e[n];if(t.indexOf(o.blockGroupType)>=0)return n;if(r.indexOf(o.blockGroupType)>=0)return-1}return-1}},8955:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getListStyleTypeFromString=void 0;var n=r(1081),o=r(3180),i=r(2901);t.getListStyleTypeFromString=function(e,t){var r="OL"==e?o.OrderedListStyleMap:i.UnorderedListStyleMap,a=(0,n.getObjectKeys)(r).find((function(e){return r[e]==t}));return a&&"string"==typeof a?parseInt(a):a}},654:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSegmentTextFormat=void 0,t.getSegmentTextFormat=function(e){var t,n=null!==(t=null==e?void 0:e.format)&&void 0!==t?t:{},o=n.fontFamily,i=n.fontSize,a=n.textColor,l=n.backgroundColor,s=n.letterSpacing,c=n.lineHeight;return r({fontFamily:o,fontSize:i,textColor:a,backgroundColor:l,letterSpacing:s,lineHeight:c})};var r=function(e){var t={};return Object.keys(e).filter((function(r){var n=e[r];void 0!==n&&(t[r]=n)})),t}},8458:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeModel=void 0;var n=r(1635),o=r(2394),i=r(5142),a=r(7784),l=r(6953),s=r(5450),c=r(7192),d=r(7720),u=r(9584),p=r(5287),f=r(7921),m=r(1081),g=r(376),h=r(8941),v=r(1166),y=["h1","h2","h3","h4","h5","h6"],b=(0,m.getObjectKeys)(p.EmptySegmentFormat);function S(e,t,r,o,i){var a=e.paragraph,l=e.marker,s=r?a:E(e,t.format),c=s.segments.indexOf(l);if("none"==(null==i?void 0:i.mergeFormat)&&r&&(s.segments.forEach((function(e){e.format=(0,n.__assign)((0,n.__assign)({},s.segmentFormat||{}),e.format)})),delete s.segmentFormat),c>=0)for(var d=0;d<t.segments.length;d++){var u=t.segments[d];s.segments.splice(c+d,0,u),o&&("Entity"==u.segmentType&&o.newEntities.push(u),"Image"==u.segmentType&&o.newImages.push(u))}if(t.decorator&&(s.decorator=(0,n.__assign)({},t.decorator),y.indexOf(s.decorator.tagName)>-1)){var p=(0,m.getObjectKeys)(s.decorator.format),f=(0,m.getObjectKeys)(s.segmentFormat||{});p.forEach((function(e){var t;f.indexOf(e)>-1&&(null===(t=s.segmentFormat)||void 0===t||delete t[e])}))}s.format=r?(0,n.__assign)((0,n.__assign)({},s.format),t.format):t.format}function C(e,t,r){var n,o,l=e.tableContext,s=e.marker;if(l&&1==r.blocks.length&&r.blocks[0]==t){for(var u=l.table,p=l.colIndex,f=l.rowIndex,m=(0,g.mutateBlock)(u),h=0;h<t.rows.length;h++)for(var y=0;y<t.rows[h].cells.length;y++){var b=t.rows[h].cells[y];if(0==h&&p+y>=m.rows[0].cells.length)for(var S=0;S<m.rows.length;S++){var C=null===(n=m.rows[S])||void 0===n?void 0:n.cells[p+y-1];m.rows[S].cells[p+y]=(0,d.createTableCell)(!1,!1,null==C?void 0:C.isHeader,null==C?void 0:C.format)}if(0==y&&f+h>=m.rows.length)for(m.rows[f+h]||(m.rows[f+h]={cells:[],format:{},height:0}),S=0;S<m.rows[f].cells.length;S++){var _=null===(o=m.rows[f+h-1])||void 0===o?void 0:o.cells[S];m.rows[f+h].cells[S]=(0,d.createTableCell)(!1,!1,!1,null==_?void 0:_.format)}var E=m.rows[f+h].cells[p+y];if(m.rows[f+h].cells[p+y]=b,0==h&&0==y){var k=(0,c.createSelectionMarker)(s.format),M=(0,i.addSegment)(b,k);e.path[0]==E&&(e.path[0]=b,e.marker=k,e.paragraph=M)}}(0,v.normalizeTable)(m,e.marker.format),(0,a.applyTableFormat)(m,void 0,!0)}else T(e,t)}function _(e,t){E(e,t.format);var r=e.path,o=e.paragraph,i=(0,f.getClosestAncestorBlockGroupIndex)(r,["ListItem"]),a=r[i],l=r[i+1],s=l.blocks.indexOf(a||o);s>=0&&(0,g.mutateBlock)(l).blocks.splice(s,0,t),a&&(null==a||a.levels.forEach((function(e,r){t.levels[r]=(0,n.__assign)({},e)})))}function E(e,t){var r=e.paragraph,o=e.marker,i=e.path,a=r.segments.indexOf(o),c=i[0].blocks.indexOf(r),d=(0,s.createParagraph)(!1,(0,n.__assign)((0,n.__assign)({},r.format),t),r.segmentFormat);a>=0&&(d.segments=r.segments.splice(a)),c>=0&&(0,g.mutateBlock)(i[0]).blocks.splice(c+1,0,d);var u=(0,f.getClosestAncestorBlockGroupIndex)(i,["ListItem"],["FormatContainer","TableCell"]),p=i[u];if(p){var m=u>=0?i[u+1]:null,h=m?m.blocks.indexOf(p):-1;if(h>=0&&m){var v=(0,l.createListItem)(p.levels,p.formatHolder.format);c>=0&&(v.blocks=p.blocks.splice(c+1)),h>=0&&(0,g.mutateBlock)(m).blocks.splice(h+1,0,v),i[u]=v}}return e.paragraph=d,d}function T(e,t){var r=e.path,n=E(e,"Paragraph"!==t.blockType?{}:t.format),o=r[0].blocks.indexOf(n);o>=0&&(0,g.mutateBlock)(r[0]).blocks.splice(o,0,t)}function k(e,t,r){e.blocks.forEach((function(e){var o;switch(function(e,t){"keepSourceEmphasisFormat"==e&&t.format.backgroundColor&&delete(0,g.mutateBlock)(t).format.backgroundColor}(r,e),e.blockType){case"BlockGroup":"ListItem"==e.blockGroupType&&((0,g.mutateBlock)(e).formatHolder.format=O(r,t,e.formatHolder.format)),k(e,t,r);break;case"Table":e.rows.forEach((function(e){return e.cells.forEach((function(e){k(e,t,r)}))}));break;case"Paragraph":var i=(null===(o=e.decorator)||void 0===o?void 0:o.format)||{},a=(0,g.mutateBlock)(e);a.segments.forEach((function(e){"General"==e.segmentType&&k(e,t,r),e.format=O(r,t,(0,n.__assign)((0,n.__assign)({},i),e.format)),e.link&&(e.link.format=function(e,t,r){return"mergeAll"==e?(0,n.__assign)((0,n.__assign)({},M(t)),r):(0,n.__assign)((0,n.__assign)((0,n.__assign)((0,n.__assign)({},w(r)),M(t)),P(r)),function(e){var t={};return e.textColor&&(t.textColor=e.textColor),t}(r))}(r,t,e.link.format))})),"keepSourceEmphasisFormat"===r&&delete a.decorator}}))}function M(e){var t={};return e.backgroundColor&&(t.backgroundColor=e.backgroundColor),e.underline&&(t.underline=e.underline),t}function O(e,t,r){return"mergeAll"==e?(0,n.__assign)((0,n.__assign)({},t),r):(0,n.__assign)((0,n.__assign)((0,n.__assign)({},w(r)),t),P(r))}function P(e){var t={},r=e.fontWeight,n=e.italic,o=e.underline;return r&&"normal"!=r&&(t.fontWeight=r),n&&(t.italic=n),o&&(t.underline=o),t}function w(e){var t=(0,n.__assign)({},e);return b.forEach((function(e){return delete t[e]})),t}t.mergeModel=function(e,t,r,i){var a,l=null!==(a=null==i?void 0:i.insertPosition)&&void 0!==a?a:(0,u.deleteSelection)(e,[],r).insertPoint,c=i||{},d=c.addParagraphAfterMergedContent,p=c.mergeFormat,f=c.mergeTable;if(d&&!f){var m=l||{},g=m.paragraph,v=m.marker,y=(0,s.createParagraph)(!1,null==g?void 0:g.format,null==v?void 0:v.format);(0,o.addBlock)(t,y)}if(l){p&&"none"!=p&&k(t,(0,n.__assign)((0,n.__assign)({},e.format||{}),l.marker.format),p);for(var b=0;b<t.blocks.length;b++){var E=t.blocks[b];switch(E.blockType){case"Paragraph":S(l,E,0==b,r,i);break;case"Divider":T(l,E);break;case"Entity":T(l,E),null==r||r.newEntities.push(E);break;case"Table":1==t.blocks.length&&f?C(l,E,t):T(l,E);break;case"BlockGroup":switch(E.blockGroupType){case"General":case"FormatContainer":T(l,E);break;case"ListItem":_(l,E)}}}}return(0,h.normalizeContentModel)(e),l}},1166:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeTable=t.MIN_ALLOWED_TABLE_CELL_HEIGHT=t.MIN_ALLOWED_TABLE_CELL_WIDTH=void 0;var n=r(1635),o=r(2394),i=r(5142),a=r(4814),l=r(5450),s=r(376);function c(e){return e<=4?120:e<=6?100:70}function d(e,t){var r;t.blocks.every((function(e){return"Paragraph"==e.blockType&&(0==(t=(t=e.segments).filter((function(e){return"SelectionMarker"!=e.segmentType}))).length||1==t.length&&"Br"==t[0].segmentType);var t}))||((r=(0,s.mutateBlock)(e).blocks).push.apply(r,(0,n.__spreadArray)([],(0,n.__read)(t.blocks),!1)),(0,s.mutateBlock)(t).blocks=[])}t.MIN_ALLOWED_TABLE_CELL_WIDTH=30,t.MIN_ALLOWED_TABLE_CELL_HEIGHT=22,t.normalizeTable=function(e,r){var u,p=(0,s.mutateBlock)(e),f=p.format;f.borderCollapse&&f.useBorderBox||(f.borderCollapse=!0,f.useBorderBox=!0),p.rows.forEach((function(e,c){e.cells.forEach((function(e,t){var d=(0,s.mutateBlock)(e);if(0==d.blocks.length){var u=d.format.textColor?(0,n.__assign)((0,n.__assign)({},r),{textColor:d.format.textColor}):r;(0,o.addBlock)(d,(0,l.createParagraph)(void 0,void 0,u)),(0,i.addSegment)(d,(0,a.createBr)(u))}0==c?d.spanAbove=!1:c>0&&t>0&&d.isHeader&&(d.isHeader=!1),0==t&&(d.spanLeft=!1),d.format.useBorderBox=!0})),e.height<t.MIN_ALLOWED_TABLE_CELL_HEIGHT&&(e.height=t.MIN_ALLOWED_TABLE_CELL_HEIGHT)}));for(var m=Math.max.apply(Math,(0,n.__spreadArray)([],(0,n.__read)(p.rows.map((function(e){return e.cells.length}))),!1)),g=0;g<m;g++)void 0===p.widths[g]?p.widths[g]=c(m):p.widths[g]<t.MIN_ALLOWED_TABLE_CELL_WIDTH&&(p.widths[g]=t.MIN_ALLOWED_TABLE_CELL_WIDTH);for(var h=function(e){p.rows.forEach((function(t){var r=t.cells[e],n=t.cells[e-1];r&&n&&r.spanLeft&&d(n,r)})),p.rows.every((function(t){var r;return null===(r=t.cells[e])||void 0===r?void 0:r.spanLeft}))&&(p.rows.forEach((function(t){return t.cells.splice(e,1)})),p.widths.splice(e-1,2,p.widths[e-1]+p.widths[e]))},v=((null===(u=p.rows[0])||void 0===u?void 0:u.cells.length)||0)-1;v>0;v--)h(v);for(var y=function(e){var t=p.rows[e];t.cells.forEach((function(t,r){var n,o=null===(n=p.rows[e-1])||void 0===n?void 0:n.cells[r];o&&t.spanAbove&&d(o,t)})),t.cells.every((function(e){return e.spanAbove}))&&(p.rows[e-1].height+=t.height,p.rows.splice(e,1))},b=p.rows.length-1;b>0;b--)y(b)}},2504:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retrieveModelFormatState=void 0;var n=r(1635),o=r(9298),i=r(7921),a=r(9966),l=r(9265),s=r(3136),c=r(861);function d(e,t,r,n,o){void 0===o&&(o=function(e){return e}),n?void 0!==r&&(e[t]=r):o(r)!==o(e[t])&&delete e[t]}t.retrieveModelFormatState=function(e,t,r){var u,p,f,m=!0,g=!0,h=!0;(0,s.iterateSelections)(e,(function(s,f,v,y){if(function(e,t,r){var n,o,a=(0,i.getClosestAncestorBlockGroupIndex)(t,["ListItem"],[]),l=(0,i.getClosestAncestorBlockGroupIndex)(t,["FormatContainer"],[]);if(a>=0){var s=t[a],c=null===(n=null==s?void 0:s.levels[s.levels.length-1])||void 0===n?void 0:n.listType;d(e,"isBullet","UL"==c,r),d(e,"isNumbering","OL"==c,r)}d(e,"isBlockQuote",l>=0&&"blockquote"==(null===(o=t[l])||void 0===o?void 0:o.tagName),r)}(r,s,m),v&&(p?r.isMultilineSelection=!0:p=v),"Paragraph"==(null==v?void 0:v.blockType)&&(function(e,t,r){var n,o=parseInt(((null===(n=t.decorator)||void 0===n?void 0:n.tagName)||"").substring(1)),i=o>=1&&o<=6?o:void 0;d(e,"marginBottom",t.format.marginBottom,r),d(e,"marginTop",t.format.marginTop,r),d(e,"headingLevel",i,r),d(e,"textAlign",t.format.textAlign,r),d(e,"direction",t.format.direction,r)}(r,v,m),null==y||y.forEach((function(i){var a,s,u,p,f,b,S,C,_;if(h||"SelectionMarker"!=i.segmentType){var E=(0,n.__assign)({},e.format);delete E.italic,delete E.underline,delete E.fontWeight,function(e,t,r){var n,o,i=null===(o=null===(n=r.superOrSubScriptSequence)||void 0===n?void 0:n.split(" "))||void 0===o?void 0:o.pop();d(e,"isBold",(0,l.isBold)(r.fontWeight),t),d(e,"isItalic",r.italic,t),d(e,"isUnderline",r.underline,t),d(e,"isStrikeThrough",r.strikethrough,t),d(e,"isSuperscript","super"==i,t),d(e,"isSubscript","sub"==i,t),d(e,"letterSpacing",r.letterSpacing,t),d(e,"fontName",r.fontFamily,t),d(e,"fontSize",r.fontSize,t,(function(e){return(0,c.parseValueWithUnit)(e,void 0,"pt")+"pt"})),d(e,"backgroundColor",r.backgroundColor,t),d(e,"textColor",r.textColor,t),d(e,"fontWeight",r.fontWeight,t),d(e,"lineHeight",r.lineHeight,t)}(r,m,Object.assign({},E,v.format,null===(a=v.decorator)||void 0===a?void 0:a.format,i.format,null===(s=i.code)||void 0===s?void 0:s.format,null===(u=i.link)||void 0===u?void 0:u.format,t)),d(r,"isCodeInline",!!(null==i?void 0:i.code),m)}h=!1,r.canUnlink=r.canUnlink||!!i.link,r.canAddImageAltText=r.canAddImageAltText||y.some((function(e){return"Image"==e.segmentType})),m=!1,"Image"===i.segmentType&&(g?(p=r,f=i.format,S=(b=(0,o.extractBorderValues)(f.borderTop)).color,C=b.width,_=b.style,p.imageFormat={borderColor:S,borderWidth:C,borderStyle:_,boxShadow:f.boxShadow,borderRadius:f.borderRadius},g=!1):r.imageFormat=void 0)})),m=!1),f)if(u){var b=u.table,S=u.colIndex,C=u.rowIndex;f.table!=b||f.colIndex==S&&f.rowIndex==C||(r.canMergeTableCell=!0,r.isMultilineSelection=!0)}else!function(e,t){var r=(0,a.getTableMetadata)(e.table);t.isInTable=!0,t.tableHasHeader=e.table.rows.some((function(e){return e.cells.some((function(e){return e.isHeader}))})),r&&(t.tableFormat=r)}(f,r),u=f}),{includeListFormatHolder:"never"}),r.fontSize&&(r.fontSize=(f=r.fontSize)&&f.indexOf("px")==f.length-2?Math.round(75*parseFloat(f)+.05)/100+"pt":f)}},5471:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.runEditSteps=void 0,t.runEditSteps=function(e,t){e.forEach((function(e){e&&function(e){return!!e.insertPoint}(t)&&e(t)}))}},636:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setTableCellBackgroundColor=void 0;var n=r(1635),o=r(376),i=r(488),a=r(318),l="#ffffff",s="#000000";function c(e,t){var r=d(t);return[l,"rgb(255,255,255)"].indexOf(e)>-1&&(r>80||""==t)||[s,"rgb(0,0,0)"].indexOf(e)>-1&&(r<20||""==t)}function d(e){var t=(0,i.parseColor)(e);if(t){var r=t[0]/255,n=t[1]/255,o=t[2]/255;return 50*(Math.max(r,n,o)+Math.min(r,n,o))}return 255}t.setTableCellBackgroundColor=function(e,t,r,i){if(t){e.format.backgroundColor=t,r&&(0,a.updateTableCellMetadata)(e,(function(e){return(e=e||{}).bgColorOverride=!0,e}));var u=d(t);u<20?e.format.textColor=l:u>80?e.format.textColor=s:delete e.format.textColor,i&&function(e){e.format.textColor&&e.blocks.forEach((function(t){var r;if("Paragraph"==t.blockType){var i=(0,o.mutateBlock)(t);(null===(r=i.segmentFormat)||void 0===r?void 0:r.textColor)||(i.segmentFormat=(0,n.__assign)((0,n.__assign)({},i.segmentFormat),{textColor:e.format.textColor})),i.segments.forEach((function(t){var r;(null===(r=t.format)||void 0===r?void 0:r.textColor)||(t.format=(0,n.__assign)((0,n.__assign)({},t.format),{textColor:e.format.textColor}))}))}}))}(e)}else delete e.format.backgroundColor,delete e.format.textColor,i&&function(e){e.blocks.forEach((function(t){var r,n;if("Paragraph"==t.blockType){var i=(0,o.mutateBlock)(t);(null===(r=i.segmentFormat)||void 0===r?void 0:r.textColor)&&c(null===(n=i.segmentFormat)||void 0===n?void 0:n.textColor,e.format.backgroundColor||"")&&delete i.segmentFormat.textColor,i.segments.forEach((function(t){t.format.textColor&&c(t.format.textColor,e.format.backgroundColor||"")&&delete t.format.textColor}))}}))}(e)}},2061:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAutoListStyleType=void 0;var n=r(602),o=r(5043),i=[o.NumberingListType.Decimal,o.NumberingListType.LowerAlpha,o.NumberingListType.LowerRoman],a=[n.BulletListType.Disc,n.BulletListType.Circle,n.BulletListType.Square],l={"lower-alpha":o.NumberingListType.LowerAlpha,"lower-latin":o.NumberingListType.LowerAlpha,"upper-alpha":o.NumberingListType.UpperAlpha,"upper-latin":o.NumberingListType.UpperAlpha,"lower-roman":o.NumberingListType.LowerRoman,"upper-roman":o.NumberingListType.UpperRoman},s={disc:n.BulletListType.Disc,circle:n.BulletListType.Circle,square:n.BulletListType.Square};t.getAutoListStyleType=function(e,t,r,n){var o=t.orderedStyleType,c=t.unorderedStyleType,d=t.applyListStyleFromLevel;return"OL"==e?"number"==typeof o?o:d?i[r%i.length]:n?l[n]:void 0:"number"==typeof c?c:d?a[r%a.length]:n?s[n]:void 0}},4402:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getOrderedListNumberStr=void 0;var n=r(1635),o=r(1081),i=r(5043),a={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1};function l(e,t){var r="";for(e--;e>=0;)r=String.fromCharCode(e%26+65)+r,e=Math.floor(e/26)-1;return t?r.toLowerCase():r}function s(e,t){var r,i,l="";try{for(var s=(0,n.__values)((0,o.getObjectKeys)(a)),c=s.next();!c.done;c=s.next()){var d=c.value,u=Math.floor(e/a[d]);e-=u*a[d],l+=d.repeat(u)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return t?l.toLocaleLowerCase():l}t.getOrderedListNumberStr=function(e,t){switch(e){case i.NumberingListType.LowerAlpha:case i.NumberingListType.LowerAlphaDash:case i.NumberingListType.LowerAlphaDoubleParenthesis:case i.NumberingListType.LowerAlphaParenthesis:return l(t,!0);case i.NumberingListType.UpperAlpha:case i.NumberingListType.UpperAlphaDash:case i.NumberingListType.UpperAlphaDoubleParenthesis:case i.NumberingListType.UpperAlphaParenthesis:return l(t,!1);case i.NumberingListType.LowerRoman:case i.NumberingListType.LowerRomanDash:case i.NumberingListType.LowerRomanDoubleParenthesis:case i.NumberingListType.LowerRomanParenthesis:return s(t,!0);case i.NumberingListType.UpperRoman:case i.NumberingListType.UpperRomanDash:case i.NumberingListType.UpperRomanDoubleParenthesis:case i.NumberingListType.UpperRomanParenthesis:return s(t,!1);default:return t+""}}},5566:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createObjectDefinition=t.createArrayDefinition=t.createStringDefinition=t.createBooleanDefinition=t.createNumberDefinition=void 0,t.createNumberDefinition=function(e,t,r,n,o){return{type:"number",isOptional:e,value:t,maxValue:n,minValue:r,allowNull:o}},t.createBooleanDefinition=function(e,t,r){return{type:"boolean",isOptional:e,value:t,allowNull:r}},t.createStringDefinition=function(e,t,r){return{type:"string",isOptional:e,value:t,allowNull:r}},t.createArrayDefinition=function(e,t,r,n,o){return{type:"array",isOptional:t,itemDef:e,minLength:r,maxLength:n,allowNull:o}},t.createObjectDefinition=function(e,t,r){return{type:"object",isOptional:t,propertyDef:e,allowNull:r}}},9655:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateImageMetadata=t.getImageMetadata=void 0;var n=r(5442),o=r(5566),i=(0,o.createNumberDefinition)(!0),a=(0,o.createBooleanDefinition)(!0),l=(0,o.createObjectDefinition)({widthPx:i,heightPx:i,leftPercent:i,rightPercent:i,topPercent:i,bottomPercent:i,angleRad:i,src:(0,o.createStringDefinition)(),naturalHeight:i,naturalWidth:i,flippedHorizontal:a,flippedVertical:a});t.getImageMetadata=function(e){return(0,n.getMetadata)(e,l)},t.updateImageMetadata=function(e,t){return(0,n.updateMetadata)(e,t,l)}},8294:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateListMetadata=t.getListMetadata=t.ListMetadataDefinition=void 0;var n=r(602),o=r(5442),i=r(5043),a=r(5566);t.ListMetadataDefinition=(0,a.createObjectDefinition)({orderedStyleType:(0,a.createNumberDefinition)(!0,void 0,i.NumberingListType.Min,i.NumberingListType.Max),unorderedStyleType:(0,a.createNumberDefinition)(!0,void 0,n.BulletListType.Min,n.BulletListType.Max),applyListStyleFromLevel:(0,a.createBooleanDefinition)(!0)},!0,!0),t.getListMetadata=function(e){return(0,o.getMetadata)(e,t.ListMetadataDefinition)},t.updateListMetadata=function(e,r){return(0,o.updateMetadata)(e,r,t.ListMetadataDefinition)}},5442:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasMetadata=t.updateMetadata=t.getMetadata=void 0;var n=r(216),o="editingInfo";function i(e,t){var r=e.dataset[o],i=null;try{i=JSON.parse(r)}catch(e){}return!t||(0,n.validate)(i,t)?i:null}t.getMetadata=i,t.updateMetadata=function(e,t,r){var a=i(e,r);return t&&((a=t(a))?r&&!(0,n.validate)(a,r)||(e.dataset[o]=JSON.stringify(a)):delete e.dataset[o]),a},t.hasMetadata=function(e){return!!e.dataset[o]}},318:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateTableCellMetadata=t.getTableCellMetadata=void 0;var n=r(5566),o=r(5442),i=(0,n.createObjectDefinition)({bgColorOverride:(0,n.createBooleanDefinition)(!0),vAlignOverride:(0,n.createBooleanDefinition)(!0),borderOverride:(0,n.createBooleanDefinition)(!0)},!1,!0);t.getTableCellMetadata=function(e){return(0,o.getMetadata)(e,i)},t.updateTableCellMetadata=function(e,t){return(0,o.updateMetadata)(e,t,i)}},9966:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateTableMetadata=t.getTableMetadata=void 0;var n=r(5442),o=r(6705),i=r(5566),a=(0,i.createStringDefinition)(!1,void 0,!0),l=(0,i.createBooleanDefinition)(!1),s=(0,i.createObjectDefinition)({topBorderColor:a,bottomBorderColor:a,verticalBorderColor:a,hasHeaderRow:l,headerRowColor:a,hasFirstColumn:l,hasBandedColumns:l,hasBandedRows:l,bgColorEven:a,bgColorOdd:a,tableBorderFormat:(0,i.createNumberDefinition)(!1,void 0,o.TableBorderFormat.Min,o.TableBorderFormat.Max),verticalAlign:a},!1,!0);t.getTableMetadata=function(e){return(0,n.getMetadata)(e,s)},t.updateTableMetadata=function(e,t){return(0,n.updateMetadata)(e,t,s)}},216:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validate=void 0;var n=r(1081);t.validate=function e(t,r){var o,i,a=!1;if(r.isOptional&&void 0===t||r.allowNull&&null===t)a=!0;else{if(!r.isOptional&&void 0===t||!r.allowNull&&null===t)return!1;switch(r.type){case"string":a="string"==typeof t&&(void 0===r.value||t===r.value);break;case"number":a="number"==typeof t&&(void 0===r.value||(o=r.value,i=t,Math.abs(o-i)<.001))&&(void 0===r.minValue||t>=r.minValue)&&(void 0===r.maxValue||t<=r.maxValue);break;case"boolean":a="boolean"==typeof t&&(void 0===r.value||t===r.value);break;case"array":a=Array.isArray(t)&&(void 0===r.minLength||t.length>=r.minLength)&&(void 0===r.maxLength||t.length<=r.maxLength)&&t.every((function(t){return e(t,r.itemDef)}));break;case"object":a="object"==typeof t&&(0,n.getObjectKeys)(r.propertyDef).every((function(n){return e(t[n],r.propertyDef[n])}))}}return a}},2144:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFirstSelectedListItem=t.getFirstSelectedTable=t.getOperationalBlocks=t.getSelectedParagraphs=t.getSelectedSegments=t.getSelectedSegmentsAndParagraphs=void 0;var n=r(1635),o=r(7921),i=r(1186),a=r(3136),l=r(376);function s(e,t,r,n){var o=d(e,{includeListFormatHolder:t?"allSegments":"never"}),i=[];return o.forEach((function(e){var o=e.segments,a=e.block,s=e.path;if(o)if(t&&!a&&1==o.length&&"ListItem"==s[0].blockGroupType&&o[0]==s[0].formatHolder){var c=s[0];n&&(0,l.mutateBlock)(c),i.push([c.formatHolder,null,s])}else"Paragraph"==(null==a?void 0:a.blockType)&&(n&&(0,l.mutateBlock)(a),o.forEach((function(e){!r&&"Entity"==e.segmentType&&e.entityFormat.isReadonly||i.push([e,a,s])})))})),i}function c(e,t,r,n){var i=[],a=n?t.map((function(e){return[e]})):[t],l=d(e,{includeListFormatHolder:"never",contentUnderSelectedTableCell:"ignoreForTable"});return u(l),l.forEach((function(e){for(var t=e.path,n=e.block,l=function(e){var l=(0,o.getClosestAncestorBlockGroupIndex)(t,a[e],r);return l>=0?(i.filter((function(e){return e.block==t[l]})).length<=0&&i.push({parent:t[l+1],block:t[l],path:t.slice(l+1)}),"break"):e==a.length-1&&n?(i.push({parent:t[0],block:n,path:t}),"break"):void 0},s=0;s<a.length&&"break"!==l(s);s++);})),i}function d(e,t){var r=[];return(0,a.iterateSelections)(e,(function(e,t,n,o){r.push({path:e,tableContext:t,block:n,segments:o})}),t),r}function u(e){e.length>1&&p(e,!1)&&e.pop(),e.length>1&&p(e,!0)&&e.shift()}function p(e,t){var r,n=e[t?0:e.length-1];if("Paragraph"==(null===(r=n.block)||void 0===r?void 0:r.blockType)&&n.segments&&n.segments.length>0){var o=n.block.segments,i=n.segments[0];return 1==n.segments.length&&"SelectionMarker"==i.segmentType&&i==o[t?o.length-1:0]}return!1}t.getSelectedSegmentsAndParagraphs=s,t.getSelectedSegments=function(e,t,r){return(r?s(e,t,!1,!0):s(e,t)).map((function(e){return e[0]}))},t.getSelectedParagraphs=function(e,t){var r=d(e,{includeListFormatHolder:"never"}),n=[];return u(r),r.forEach((function(e){var r=e.block;"Paragraph"==(null==r?void 0:r.blockType)&&n.push(t?(0,l.mutateBlock)(r):r)})),n},t.getOperationalBlocks=c,t.getFirstSelectedTable=function(e){var t,r=d(e,{includeListFormatHolder:"never"}),o=[];return u(r),r.forEach((function(e){var r=e.block,i=e.tableContext,a=e.path;if(!t)if("Table"==(null==r?void 0:r.blockType))t=r,o=(0,n.__spreadArray)([],(0,n.__read)(a),!1);else if(null==i?void 0:i.table){t=i.table;var l=a.filter((function(e){return e.blocks.indexOf(i.table)>=0}))[0],s=a.indexOf(l);o=s>=0?a.slice(s):[]}})),[t,o]},t.getFirstSelectedListItem=function(e){var t;return c(e,["ListItem"],["TableCell"]).forEach((function(e){!t&&(0,i.isBlockGroupOfType)(e.block,"ListItem")&&(t=e.block)})),t}},6303:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSelectedCells=void 0;var n=r(9404);t.getSelectedCells=function(e){var t=-1,r=-1,o=-1,i=-1,a=!1;return e.rows.forEach((function(e,l){return e.cells.forEach((function(e,s){(0,n.hasSelectionInBlockGroup)(e)&&(a=!0,t<0&&(t=l),r<0&&(r=s),o=Math.max(o,l),i=Math.max(i,s))}))})),a?{firstRow:t,firstColumn:r,lastRow:o,lastColumn:i}:null}},7691:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasSelectionInBlock=void 0;var n=r(9404),o=r(3407);t.hasSelectionInBlock=function(e){switch(e.blockType){case"Paragraph":return e.segments.some(o.hasSelectionInSegment);case"Table":return e.rows.some((function(e){return e.cells.some(n.hasSelectionInBlockGroup)}));case"BlockGroup":return(0,n.hasSelectionInBlockGroup)(e);case"Divider":case"Entity":return!!e.isSelected;default:return!1}}},9404:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasSelectionInBlockGroup=void 0;var n=r(7691);t.hasSelectionInBlockGroup=function(e){return!("TableCell"!=e.blockGroupType||!e.isSelected)||!!e.blocks.some(n.hasSelectionInBlock)}},3407:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasSelectionInSegment=void 0;var n=r(7691);t.hasSelectionInSegment=function(e){return e.isSelected||"General"==e.segmentType&&e.blocks.some(n.hasSelectionInBlock)}},3136:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iterateSelections=void 0;var n=r(1635);function o(e,t,r,i,a){for(var l=e[0],s=(null==r?void 0:r.includeListFormatHolder)||"allSegments",c=(null==r?void 0:r.contentUnderSelectedTableCell)||"include",d=(null==r?void 0:r.contentUnderSelectedGeneralElement)||"contentOnly",u=!1,p=!1,f=0;f<l.blocks.length;f++){var m=l.blocks[f];switch(m.blockType){case"BlockGroup":var g=(0,n.__spreadArray)([m],(0,n.__read)(e),!1);if("General"==m.blockGroupType){var h=!(P=a||m.isSelected)||"both"==d||"contentOnly"==d,v=P&&("both"==d||"generalElementOnly"==d||0==m.blocks.length);if(h&&o(g,t,r,i,P)||v&&t(e,i,m))return!0}else if(o(g,t,r,i,a))return!0;break;case"Table":var y=m.rows,b=y.every((function(e){return e.cells.every((function(e){return e.isSelected}))}));if("include"!=c&&b){if(t(e,i,m))return!0}else for(var S=0;S<y.length;S++)for(var C=y[S],_=0;_<C.cells.length;_++){var E=C.cells[_];if(E){var T={table:m,rowIndex:S,colIndex:_,isWholeTableSelected:b};if(E.isSelected&&t(e,T))return!0;if((!E.isSelected||"ignoreForTableOrCell"!=c)&&o((0,n.__spreadArray)([E],(0,n.__read)(e),!1),t,r,T,P=a||E.isSelected))return!0}}break;case"Paragraph":for(var k=[],M=0;M<m.segments.length;M++){var O=m.segments[M],P=a||O.isSelected;if("General"==O.segmentType){if(h=!P||"both"==d||"contentOnly"==d,v=P&&("both"==d||"generalElementOnly"==d||0==O.blocks.length),h&&o((0,n.__spreadArray)([O],(0,n.__read)(e),!1),t,r,i,P))return!0;v&&k.push(O)}else P&&k.push(O);P?u=!0:p=!0}if(k.length>0&&t(e,i,m,k))return!0;break;case"Divider":case"Entity":if((a||m.isSelected)&&t(e,i,m))return!0}}return!("never"==s||"ListItem"!=l.blockGroupType||!u||p&&"anySegment"!=s||!t(e,i,void 0,[l.formatHolder]))}t.iterateSelections=function(e,t,r){o([e],"Document"==e.blockGroupType&&e.persistCache?t:function(e,r,n,o){var i;return(null===(i=n)||void 0===i?void 0:i.cachedElement)&&delete n.cachedElement,t(e,r,n,o)},r)}},7595:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setSelection=void 0;var n=r(4182),o=r(376);function i(e,t,r,u){return d(t,e,r,u,(function(t){(0,n.isGeneralSegment)(e)&&s(e,t)&&c((0,o.mutateBlock)(e),t);var p,f=[];if(e.blocks.forEach((function(e,n){t=function(e,t,r,n){switch(e.blockType){case"BlockGroup":return i(e,t,r,n);case"Table":return function(e,t,r,n){var l=a(e,r),d=n?a(e,n):l;if(t)e.rows.forEach((function(e){return e.cells.forEach((function(e){var a=t;t=i(e,t,r,n),a&&t&&((0,o.mutateBlock)(e).isSelected=!0)}))}));else for(var u=0;u<e.rows.length;u++)for(var p=e.rows[u],f=0;f<p.cells.length;f++){var m=e.rows[u].cells[f],g=u>=l.row&&u<=d.row&&f>=l.col&&f<=d.col;s(m,g)&&c((0,o.mutateBlock)(m),g),g||i(m,!1,r,n)}return t}(e,t,r,n);case"Divider":case"Entity":return d(t,e,r,n,(function(t){if(s(e,t)){var r=(0,o.mutateBlock)(e);t?r.isSelected=!0:delete r.isSelected}return t}));case"Paragraph":var u=[];if(e.segments.forEach((function(o,a){t=d(t,o,r,n,(function(t){return function(e,t,r,n,o,a,s){switch(t.segmentType){case"SelectionMarker":return(!r||t!=o&&t!=a)&&n.push(s),r;case"General":return l(e,t,r),t!=o&&t!=a?i(t,r,o,a):r;case"Image":var c=o==t&&(!a||a==t);return l(e,t,r,!t.isSelectedAsImageSelection!=!c?function(e){return e.isSelectedAsImageSelection=c}:void 0),r;default:return l(e,t,r),r}}(e,o,t,u,r,n,a)}))})),u.length>0)for(var p=(0,o.mutateBlock)(e),f=void 0;void 0!==(f=u.pop());)f>=0&&p.segments.splice(f,1);return t;default:return t}}(e,t,r,u),"Paragraph"==e.blockType&&0==e.segments.length&&e.isImplicit&&f.push(n)})),f.length>0)for(var m=(0,o.mutateBlock)(e);void 0!==(p=f.pop());)p>=0&&m.blocks.splice(p,1);return t}))}function a(e,t){var r=-1;return{row:t?e.rows.findIndex((function(e){return(r=e.cells.indexOf(t))>=0})):-1,col:r}}function l(e,t,r,n){(n||s(t,r))&&(0,o.mutateSegment)(e,t,(function(e){c(e,r),null==n||n(e)}))}function s(e,t){return!e.isSelected!=!t}function c(e,t){return t?e.isSelected=!0:delete e.isSelected,t}function d(e,t,r,n,o){return(e=o(e=e||t==r))&&!!n&&t!=n}t.setSelection=function(e,t,r){i(e,!1,t||null,r||null)}},1186:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBlockGroupOfType=void 0,t.isBlockGroupOfType=function(e,t){return(null==e?void 0:e.blockGroupType)==t}},4182:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isGeneralSegment=void 0,t.isGeneralSegment=function(e){return"General"==e.blockGroupType&&"General"==e.segmentType}},2038:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentModelToDom=void 0;var n=r(7057),o=r(872);function i(e){var t,r,i,a;if(e.block&&(e.segment?(0,n.isNodeOfType)(e.segment,"TEXT_NODE")?a={container:e.segment,offset:(null===(t=e.segment.nodeValue)||void 0===t?void 0:t.length)||0}:e.segment.parentNode&&(a={container:e.segment.parentNode,offset:(0,o.toArray)(e.segment.parentNode.childNodes).indexOf(e.segment)+1}):a={container:e.block,offset:0}),a&&(0,n.isNodeOfType)(a.container,"DOCUMENT_FRAGMENT_NODE")){var l=a.container.childNodes;if(l.length>a.offset)a={container:l[a.offset],offset:0};else if(a.container.lastChild){var s=a.container.lastChild;a={container:s,offset:(0,n.isNodeOfType)(s,"TEXT_NODE")?null!==(i=null===(r=s.nodeValue)||void 0===r?void 0:r.length)&&void 0!==i?i:0:s.childNodes.length}}else a=void 0}return a}t.contentModelToDom=function(e,t,r,n){n.modelHandlers.blockGroupChildren(e,t,r,n);var o=function(e,t){var r,n,o=t.regularSelection,a=o.start,l=o.end,s=t.tableSelection,c=t.imageSelection;if(c)return c;if((r=a&&i(a))&&(n=l&&i(l))){var d=e.createRange();return d.setStart(r.container,r.offset),d.setEnd(n.container,n.offset),{type:"range",range:d,isReverted:!1}}return s||null}(e,n);return r.hasRevertedRangeSelection&&"range"==(null==o?void 0:o.type)&&(o.isReverted=!0),n.domIndexer&&n.allowCacheElement&&(r.persistCache=!0),t.normalize(),o}},4768:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildFormatAppliers=t.createModelToDomConfig=t.createModelToDomContextWithConfig=t.createModelToDomContext=void 0;var n=r(1635),o=r(9853),i=r(1081),a=r(1506);function l(e,t){return Object.assign({},t,{regularSelection:{current:{block:null,segment:null}}},{listFormat:{threadItemCounts:[],nodeStack:[]},implicitFormat:{}},e)}function s(e){return{modelHandlers:Object.assign.apply(Object,(0,n.__spreadArray)([{},o.defaultContentModelHandlers],(0,n.__read)(e.map((function(e){return null==e?void 0:e.modelHandlerOverride}))),!1)),formatAppliers:c(e.map((function(e){return null==e?void 0:e.formatApplierOverride})),e.map((function(e){return null==e?void 0:e.additionalFormatAppliers}))),defaultModelHandlers:o.defaultContentModelHandlers,defaultFormatAppliers:a.defaultFormatAppliers,metadataAppliers:Object.assign.apply(Object,(0,n.__spreadArray)([{}],(0,n.__read)(e.map((function(e){return null==e?void 0:e.metadataAppliers}))),!1))}}function c(e,t){void 0===e&&(e=[]),void 0===t&&(t=[]);var r=Object.assign.apply(Object,(0,n.__spreadArray)([{}],(0,n.__read)(e),!1)),o=(0,i.getObjectKeys)(a.defaultFormatKeysPerCategory).reduce((function(e,o){var i,l=(i=a.defaultFormatKeysPerCategory[o].map((function(e){return void 0===r[e]?a.defaultFormatAppliers[e]:r[e]}))).concat.apply(i,(0,n.__spreadArray)([],(0,n.__read)(t.map((function(e){var t;return null!==(t=null==e?void 0:e[o])&&void 0!==t?t:[]}))),!1));return e[o]=l,e}),{text:[]});return t.forEach((function(e){(null==e?void 0:e.text)&&(o.text=o.text.concat(e.text))})),o}t.createModelToDomContext=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return l(s(t),e)},t.createModelToDomContextWithConfig=l,t.createModelToDomConfig=s,t.buildFormatAppliers=c},9853:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultContentModelHandlers=void 0;var n=r(2678),o=r(2632),i=r(6807),a=r(1113),l=r(5056),s=r(4733),c=r(1590),d=r(5590),u=r(7359),p=r(1100),f=r(3897),m=r(1602),g=r(3837),h=r(3303),v=r(4347);t.defaultContentModelHandlers={block:n.handleBlock,blockGroupChildren:o.handleBlockGroupChildren,br:i.handleBr,entityBlock:l.handleEntityBlock,entitySegment:l.handleEntitySegment,generalBlock:c.handleGeneralBlock,generalSegment:c.handleGeneralSegment,divider:a.handleDivider,image:d.handleImage,list:u.handleList,listItem:p.handleListItem,paragraph:f.handleParagraph,formatContainer:s.handleFormatContainer,segment:m.handleSegment,segmentDecorator:g.handleSegmentDecorator,table:h.handleTable,text:v.handleText}},2678:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleBlock=void 0,t.handleBlock=function(e,t,r,n,o){var i=n.modelHandlers;switch(r.blockType){case"Table":o=i.table(e,t,r,n,o);break;case"Paragraph":o=i.paragraph(e,t,r,n,o);break;case"Entity":o=i.entityBlock(e,t,r,n,o);break;case"Divider":o=i.divider(e,t,r,n,o);break;case"BlockGroup":switch(r.blockGroupType){case"General":o=i.generalBlock(e,t,r,n,o);break;case"FormatContainer":o=i.formatContainer(e,t,r,n,o);break;case"ListItem":o=i.listItem(e,t,r,n,o)}}return o}},2632:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleBlockGroupChildren=void 0,t.handleBlockGroupChildren=function(e,t,r,n){var o,i=n.listFormat,a=i.nodeStack,l=t.firstChild;try{for(r.blocks.forEach((function(o,a){var s;0!=a&&"BlockGroup"==o.blockType&&"ListItem"==o.blockGroupType||(i.nodeStack=[]),l=n.modelHandlers.block(e,t,o,n,l),"Entity"==o.blockType&&(null===(s=n.domIndexer)||void 0===s||s.onBlockEntity(o,r))}));l;){var s=l.nextSibling;null===(o=l.parentNode)||void 0===o||o.removeChild(l),l=s}}finally{i.nodeStack=a}}},6807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleBr=void 0;var n=r(8535);t.handleBr=function(e,t,r,o,i){var a=e.createElement("br"),l=e.createElement("span");l.appendChild(a),t.appendChild(l),(0,n.handleSegmentCommon)(e,a,l,r,o,i)}},1113:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleDivider=void 0;var n=r(3494),o=r(9290);t.handleDivider=function(e,t,r,i,a){var l,s=i.allowCacheElement?r.cachedElement:void 0;return s&&!r.isSelected?a=(0,o.reuseCachedElement)(t,s,a):(s=e.createElement(r.tagName),i.allowCacheElement&&(r.cachedElement=s),t.insertBefore(s,a),(0,n.applyFormat)(s,i.formatAppliers.divider,r.format,i),r.size&&s.setAttribute("size",r.size)),null===(l=i.onNodeCreated)||void 0===l||l.call(i,r,s),a}},5056:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleEntitySegment=t.handleEntityBlock=void 0;var n=r(1635),o=r(4134),i=r(3494),a=r(1081),l=r(9290),s=r(7828),c="_E_EBlockEntityContainer";function d(e){var t;return(0,n.__assign)((0,n.__assign)({},null===(t=e.pendingFormat)||void 0===t?void 0:t.format),e.defaultFormat)}t.handleEntityBlock=function(e,t,r,n,a){var u,p,f=r.entityFormat,m=r.wrapper;(0,i.applyFormat)(m,n.formatAppliers.entity,f,n);var g=n.addDelimiterForEntity&&"inline-block"==m.style.display&&"100%"==m.style.width,h=null===(u=m.parentElement)||void 0===u?void 0:u.classList.contains(c),v=h&&g?m.parentElement:m;return a=(0,l.reuseCachedElement)(t,v,a),g&&(h||(0,s.wrap)(e,m,"div").classList.add(c),(0,o.addDelimiters)(e,m,d(n),n)),null===(p=n.onNodeCreated)||void 0===p||p.call(n,r,m),a},t.handleEntitySegment=function(e,t,r,l,c){var u,p=r.entityFormat,f=r.wrapper,m=r.format;if(t.appendChild(f),null==c||c.push(f),(0,a.getObjectKeys)(m).length>0){var g=(0,s.wrap)(e,f,"span");(0,i.applyFormat)(g,l.formatAppliers.segment,m,l)}if((0,i.applyFormat)(f,l.formatAppliers.entity,p,l),l.addDelimiterForEntity&&p.isReadonly){var h=(0,n.__read)((0,o.addDelimiters)(e,f,d(l),l),2),v=h[0],y=h[1];c&&(c.push(v,y),v.firstChild&&c.push(v.firstChild),y.firstChild&&c.push(y.firstChild)),l.regularSelection.current.segment=v}else l.regularSelection.current.segment=f;null===(u=l.onNodeCreated)||void 0===u||u.call(l,r,f)}},4733:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleFormatContainer=void 0;var n=r(3494),o=r(5061),i=r(9290),a=r(8490),l={fontFamily:"monospace",whiteSpace:"pre"};t.handleFormatContainer=function(e,t,r,s,c){var d,u=s.allowCacheElement?r.cachedElement:void 0;if(u)c=(0,i.reuseCachedElement)(t,u,c),s.modelHandlers.blockGroupChildren(e,u,r,s);else if(!(0,o.isBlockGroupEmpty)(r)){var p=e.createElement(r.tagName);s.allowCacheElement&&(r.cachedElement=p),t.insertBefore(p,c),(0,a.stackFormat)(s,r.tagName,(function(){(0,n.applyFormat)(p,s.formatAppliers.container,r.format,s),(0,n.applyFormat)(p,s.formatAppliers.segmentOnBlock,r.format,s),(0,n.applyFormat)(p,s.formatAppliers.container,r.format,s)})),"pre"==r.tagName?(0,a.stackFormat)(s,l,(function(){s.modelHandlers.blockGroupChildren(e,p,r,s)})):s.modelHandlers.blockGroupChildren(e,p,r,s),u=p}return u&&(null===(d=s.onNodeCreated)||void 0===d||d.call(s,r,u)),c}},1590:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleGeneralSegment=t.handleGeneralBlock=void 0;var n=r(3494),o=r(8535),i=r(7057),a=r(9290),l=r(7828);t.handleGeneralBlock=function(e,t,r,o,i){var l,s=r.element;return i&&s.parentNode==t?i=(0,a.reuseCachedElement)(t,s,i):(s=s.cloneNode(),r.element=s,(0,n.applyFormat)(s,o.formatAppliers.general,r.format,o),t.insertBefore(s,i)),null===(l=o.onNodeCreated)||void 0===l||l.call(o,r,s),o.modelHandlers.blockGroupChildren(e,s,r,o),i},t.handleGeneralSegment=function(e,t,r,a,s){var c,d=r.element.cloneNode();if(r.element=d,t.appendChild(d),(0,i.isNodeOfType)(d,"ELEMENT_NODE")){var u=(0,l.wrap)(e,d,"span");(0,o.handleSegmentCommon)(e,d,u,r,a,s),(0,n.applyFormat)(d,a.formatAppliers.general,r.format,a),null===(c=a.onNodeCreated)||void 0===c||c.call(a,r,d)}a.modelHandlers.blockGroupChildren(e,d,r,a)}},5590:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleImage=void 0;var n=r(3494),o=r(8535),i=r(861);t.handleImage=function(e,t,r,a,l){var s=e.createElement("img"),c=document.createElement("span");t.appendChild(c),c.appendChild(s),s.src=r.src,r.alt&&(s.alt=r.alt),r.title&&(s.title=r.title),(0,n.applyFormat)(s,a.formatAppliers.image,r.format,a),(0,n.applyFormat)(s,a.formatAppliers.dataset,r.dataset,a);var d=r.format,u=d.width,p=d.height,f=u?(0,i.parseValueWithUnit)(u):0,m=p?(0,i.parseValueWithUnit)(p):0;f>0&&(s.width=f),m>0&&(s.height=m),r.isSelectedAsImageSelection&&(a.imageSelection={type:"image",image:s}),(0,o.handleSegmentCommon)(e,s,c,r,a,l)}},7359:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleList=void 0;var n=r(1635),o=r(3494),i=r(2656);t.handleList=function(e,t,r,a,l){var s,c,d=0,u=a.listFormat.nodeStack;for(0==u.length&&u.push({node:t});d<r.levels.length&&d+1<u.length;d++){var p=u[d+1],f=r.levels[d];if(p.listType!=f.listType||(null===(s=p.dataset)||void 0===s?void 0:s.editingInfo)!=f.dataset.editingInfo||"OL"==f.listType&&"number"==typeof f.format.startNumberOverride)break}for(u.splice(d+1);d<r.levels.length;d++){var m=r.levels[d],g=e.createElement(m.listType||"UL");u[u.length-1].node.insertBefore(g,0==d?l:null),u.push((0,n.__assign)({node:g},m)),(0,o.applyFormat)(g,a.formatAppliers.listLevelThread,m.format,a),(0,i.applyMetadata)(m,a.metadataAppliers.listLevel,m.format,a),(0,o.applyFormat)(g,a.formatAppliers.listLevel,m.format,a),(0,o.applyFormat)(g,a.formatAppliers.dataset,m.dataset,a),null===(c=a.onNodeCreated)||void 0===c||c.call(a,m,g)}return l}},1100:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleListItem=void 0;var n=r(3494),o=r(2656),i=r(7958),a=r(8490),l=r(2463);t.handleListItem=function(e,t,r,s,c){var d,u;c=s.modelHandlers.list(e,t,r,s,c);var p=s.listFormat.nodeStack,f=(null===(d=null==p?void 0:p[(null==p?void 0:p.length)-1])||void 0===d?void 0:d.node)||t,m=e.createElement("li"),g=r.levels[r.levels.length-1];return f.insertBefore(m,(null==c?void 0:c.parentNode)==f?c:null),g?((0,n.applyFormat)(m,s.formatAppliers.segment,r.formatHolder.format,s),(0,n.applyFormat)(m,s.formatAppliers.listItemThread,g.format,s),(0,o.applyMetadata)(g,s.metadataAppliers.listItem,r.format,s),(0,n.applyFormat)(m,s.formatAppliers.listItemElement,r.format,s),(0,a.stackFormat)(s,r.formatHolder.format,(function(){s.modelHandlers.blockGroupChildren(e,m,r,s)}))):(r.blocks.forEach(i.setParagraphNotImplicit),s.modelHandlers.blockGroupChildren(e,m,r,s),(0,l.unwrap)(m)),null===(u=s.onNodeCreated)||void 0===u||u.call(s,r,m),c}},3897:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleParagraph=void 0;var n=r(1635),o=r(3494),i=r(1081),a=r(4637),l=r(9290),s=r(8490),c=r(2463);t.handleParagraph=function(e,t,r,d,u){var p,f=d.allowCacheElement?r.cachedElement:void 0;return f&&r.segments.every((function(e){return"General"!=e.segmentType&&!e.isSelected}))?u=(0,l.reuseCachedElement)(t,f,u):(0,s.stackFormat)(d,(null===(p=r.decorator)||void 0===p?void 0:p.tagName)||null,(function(){var l,p,m,g,h=!r.isImplicit||!!r.decorator||(0,i.getObjectKeys)(r.format).length>0&&r.segments.some((function(e){return"SelectionMarker"!=e.segmentType})),v=h?(0,n.__assign)((0,n.__assign)({},(null===(l=r.decorator)||void 0===l?void 0:l.format)||{}),r.segmentFormat):{};f=e.createElement((null===(p=r.decorator)||void 0===p?void 0:p.tagName)||"div"),t.insertBefore(f,u),d.regularSelection.current={block:h?f:f.parentNode,segment:null};var y=function(){var t=f;if(t){var o=r.segments[0];"SelectionMarker"==(null==o?void 0:o.segmentType)&&d.modelHandlers.text(e,t,(0,n.__assign)((0,n.__assign)({},o),{segmentType:"Text",text:""}),d,[]),r.segments.forEach((function(n){var o=[];d.modelHandlers.segment(e,t,n,d,o),o.forEach((function(e){var t;null===(t=d.domIndexer)||void 0===t||t.onSegment(e,r,[n])}))}))}};h?((0,s.stackFormat)(d,v,y),(0,o.applyFormat)(f,d.formatAppliers.block,r.format,d),(0,o.applyFormat)(f,d.formatAppliers.container,r.format,d),(0,o.applyFormat)(f,d.formatAppliers.segmentOnBlock,v,d)):y(),(0,a.optimize)(f),u=f.nextSibling,f&&(null===(m=d.onNodeCreated)||void 0===m||m.call(d,r,f),null===(g=d.domIndexer)||void 0===g||g.onParagraph(f)),h?d.allowCacheElement&&(r.cachedElement=f):((0,c.unwrap)(f),f=void 0)})),u}},1602:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleSegment=void 0;var n=r(1635);t.handleSegment=function(e,t,r,o,i){var a=o.regularSelection;switch(r.isSelected&&!a.start&&(a.start=(0,n.__assign)({},a.current)),r.segmentType){case"Text":o.modelHandlers.text(e,t,r,o,i);break;case"Br":o.modelHandlers.br(e,t,r,o,i);break;case"Image":o.modelHandlers.image(e,t,r,o,i);break;case"General":o.modelHandlers.generalSegment(e,t,r,o,i);break;case"Entity":o.modelHandlers.entitySegment(e,t,r,o,i)}r.isSelected&&a.start&&(a.end=(0,n.__assign)({},a.current))}},3837:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleSegmentDecorator=void 0;var n=r(3494),o=r(7057),i=r(8490),a=r(4310);t.handleSegmentDecorator=function(e,t,r,l,s){var c=r.code,d=r.link;(0,o.isNodeOfType)(t,"ELEMENT_NODE")&&(d&&(0,i.stackFormat)(l,"a",(function(){var e,r=(0,a.wrapAllChildNodes)(t,"a");(0,n.applyFormat)(r,l.formatAppliers.link,d.format,l),(0,n.applyFormat)(r,l.formatAppliers.dataset,d.dataset,l),null==s||s.push(r),null===(e=l.onNodeCreated)||void 0===e||e.call(l,d,r)})),c&&(0,i.stackFormat)(l,"code",(function(){var e,r=(0,a.wrapAllChildNodes)(t,"code");(0,n.applyFormat)(r,l.formatAppliers.code,c.format,l),null==s||s.push(r),null===(e=l.onNodeCreated)||void 0===e||e.call(l,c,r)})))}},3303:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleTable=void 0;var n=r(3494),o=r(5442),i=r(5061),a=r(4310),l=r(9290);t.handleTable=function(e,t,r,s,c){var d,u,p,f,m,g,h;if((0,i.isBlockEmpty)(r))return c;var v=s.allowCacheElement?r.cachedElement:void 0;v?(c=(0,l.reuseCachedElement)(t,v,c),(0,a.moveChildNodes)(v)):(v=e.createElement("table"),s.allowCacheElement&&(r.cachedElement=v),t.insertBefore(v,c),(0,n.applyFormat)(v,s.formatAppliers.block,r.format,s),(0,n.applyFormat)(v,s.formatAppliers.table,r.format,s),(0,n.applyFormat)(v,s.formatAppliers.tableBorder,r.format,s),(0,n.applyFormat)(v,s.formatAppliers.dataset,r.dataset,s)),null===(d=s.onNodeCreated)||void 0===d||d.call(s,r,v);var y=e.createElement("tbody");v.appendChild(y);for(var b=0;b<r.rows.length;b++){var S=r.rows[b];if(0!=S.cells.length){var C=s.allowCacheElement&&S.cachedElement||e.createElement("tr");y.appendChild(C),(0,a.moveChildNodes)(C),S.cachedElement||(s.allowCacheElement&&(S.cachedElement=C),(0,n.applyFormat)(C,s.formatAppliers.tableRow,S.format,s)),null===(u=s.onNodeCreated)||void 0===u||u.call(s,S,C);for(var _=0;_<S.cells.length;_++){var E=S.cells[_];if(E.isSelected){var T=s.tableSelection||{type:"table",table:v,firstColumn:_,lastColumn:_,firstRow:b,lastRow:b};T.table==v&&(T.lastColumn=Math.max(T.lastColumn,_),T.lastRow=Math.max(T.lastRow,b)),s.tableSelection=T}if(!E.spanAbove&&!E.spanLeft){var k=s.allowCacheElement&&E.cachedElement||e.createElement(E.isHeader?"th":"td");C.appendChild(k);for(var M=1,O=1,P=r.widths[_],w=S.height;null===(f=null===(p=r.rows[b+M])||void 0===p?void 0:p.cells[_])||void 0===f?void 0:f.spanAbove;M++)w+=r.rows[b+M].height;for(;null===(m=S.cells[_+O])||void 0===m?void 0:m.spanLeft;O++)P+=r.widths[_+O];M>1&&(k.rowSpan=M),O>1&&(k.colSpan=O),(!E.cachedElement||E.format.useBorderBox&&(0,o.hasMetadata)(r))&&(P>0&&!k.style.width&&(k.style.width=P+"px"),w>0&&!k.style.height&&(k.style.height=w+"px")),E.cachedElement||(s.allowCacheElement&&(E.cachedElement=k),(0,n.applyFormat)(k,s.formatAppliers.block,E.format,s),(0,n.applyFormat)(k,s.formatAppliers.tableCell,E.format,s),(0,n.applyFormat)(k,s.formatAppliers.tableCellBorder,E.format,s),(0,n.applyFormat)(k,s.formatAppliers.dataset,E.dataset,s)),s.modelHandlers.blockGroupChildren(e,k,E,s),null===(g=s.onNodeCreated)||void 0===g||g.call(s,E,k)}}}}return null===(h=s.domIndexer)||void 0===h||h.onTable(v,r),c}},4347:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleText=void 0;var n=r(8535);t.handleText=function(e,t,r,o,i){var a=e.createTextNode(r.text),l=e.createElement("span");t.appendChild(l),l.appendChild(a),o.formatAppliers.text.forEach((function(e){return e(r.format,a,o)})),(0,n.handleSegmentCommon)(e,a,l,r,o,i)}},6040:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeNode=void 0;var n=r(7057),o=["SPAN","B","EM","I","U","SUB","SUP","STRIKE","S","A","CODE"];function i(e,t){var r=e.attributes,n=t.attributes;if(r.length!=n.length)return!1;for(var o=0;o<r.length;o++)if(r[o].name!=n[o].name||r[o].value!=n[o].value)return!1;return!0}t.mergeNode=function(e){for(var t=e.firstChild;t;){var r=t.nextSibling;if(r&&(0,n.isNodeOfType)(t,"ELEMENT_NODE")&&(0,n.isNodeOfType)(r,"ELEMENT_NODE")&&t.tagName==r.tagName&&o.indexOf(t.tagName)>=0&&i(t,r)){for(;r.firstChild;)t.appendChild(r.firstChild);r.parentNode.removeChild(r)}else t=r}}},4637:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.optimize=void 0;var n=r(4134),o=r(6040),i=r(4818);t.optimize=function e(t){if(!(0,n.isEntityElement)(t)){(0,i.removeUnnecessarySpan)(t),(0,o.mergeNode)(t);for(var r=t.firstChild;r;r=r.nextSibling)e(r)}}},4818:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeUnnecessarySpan=void 0;var n=r(7057);t.removeUnnecessarySpan=function(e){for(var t=e.firstChild;t;)if((0,n.isNodeOfType)(t,"ELEMENT_NODE")&&"SPAN"==t.tagName&&0==t.attributes.length){var r=t,o=t.nextSibling;for(t=t.nextSibling;r.lastChild;){var i=r.lastChild;e.insertBefore(i,o),o=i}e.removeChild(r)}else t=t.nextSibling}},3494:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyFormat=void 0,t.applyFormat=function(e,t,r,n){t.forEach((function(t){null==t||t(r,e,n)}))}},2656:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyMetadata=void 0;var n=r(5442);t.applyMetadata=function(e,t,r,o){t&&(0,n.updateMetadata)(e,(function(e){return t.applierFunction(e,r,o),e}),t.metadataDefinition)}},8535:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleSegmentCommon=void 0;var n=r(3494);t.handleSegmentCommon=function(e,t,r,o,i,a){var l;t.firstChild||(i.regularSelection.current.segment=t),(0,n.applyFormat)(r,i.formatAppliers.styleBasedSegment,o.format,i),null==a||a.push(t),i.modelHandlers.segmentDecorator(e,r,o,i,a),(0,n.applyFormat)(r,i.formatAppliers.elementBasedSegment,o.format,i),null===(l=i.onNodeCreated)||void 0===l||l.call(i,o,t)}},8490:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stackFormat=void 0;var n=r(1635),o=r(2355);t.stackFormat=function(e,t,r){var i="string"==typeof t?o.defaultContentModelFormatMap[t]:t;if(i){var a=e.implicitFormat;try{e.implicitFormat=(0,n.__assign)((0,n.__assign)({},a),i),r()}finally{e.implicitFormat=a}}else r()}},5132:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentModelToText=void 0;var r={onDivider:function(e){return"hr"==e.tagName?"________________________________________":""},onEntityBlock:function(){return""},onEntitySegment:function(e){var t;return null!==(t=e.wrapper.textContent)&&void 0!==t?t:""},onGeneralSegment:function(e){var t;return null!==(t=e.element.textContent)&&void 0!==t?t:""},onImage:function(){return" "},onText:function(e){return e.text},onParagraph:function(){return!0},onTable:function(){return!0},onBlockGroup:function(){return!0}};function n(e,t,r){r.onBlockGroup(e)&&e.blocks.forEach((function(e){switch(e.blockType){case"Paragraph":if(r.onParagraph(e)){var o="";e.segments.forEach((function(e){switch(e.segmentType){case"Br":t.push(o),o="";break;case"Entity":o+=r.onEntitySegment(e);break;case"General":o+=r.onGeneralSegment(e);break;case"Text":o+=r.onText(e);break;case"Image":o+=r.onImage(e)}})),o&&t.push(o)}break;case"Divider":t.push(r.onDivider(e));break;case"Entity":t.push(r.onEntityBlock(e));break;case"Table":r.onTable(e)&&e.rows.forEach((function(e){return e.cells.forEach((function(e){n(e,t,r)}))}));break;case"BlockGroup":n(e,t,r)}}))}t.contentModelToText=function(e,t,o){void 0===t&&(t="\r\n");var i=[];return n(e,i,Object.assign({},r,o)),i.join(t)}},3528:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AutoFormatPlugin=void 0;var n=r(4990),o=r(7662),i=r(1698),a=r(5978),l=r(4939),s=r(212),c=r(4504),d=r(7864),u=r(7957),p={autoBullet:!1,autoNumbering:!1,autoUnlink:!1,autoLink:!1,autoHyphen:!1,autoFraction:!1,autoOrdinals:!1},f=function(){function e(e){void 0===e&&(e=p),this.options=e,this.editor=null}return e.prototype.getName=function(){return"AutoFormat"},e.prototype.initialize=function(e){this.editor=e},e.prototype.dispose=function(){this.editor=null},e.prototype.onPluginEvent=function(e){if(this.editor)switch(e.eventType){case"input":this.handleEditorInputEvent(this.editor,e);break;case"keyDown":this.handleKeyDownEvent(this.editor,e);break;case"contentChanged":this.handleContentChangedEvent(this.editor,e)}},e.prototype.handleEditorInputEvent=function(e,t){var r=this,n=t.rawEvent,o=e.getDOMSelection();if("insertText"===n.inputType&&o&&"range"===o.type&&o.range.collapsed&&" "===n.data){var u={changeSource:"",apiName:""};(0,a.formatTextSegmentBeforeSelectionMarker)(e,(function(e,t,n,o,a){var p=r.options,f=p.autoBullet,h=p.autoNumbering,v=p.autoLink,y=p.autoHyphen,b=p.autoFraction,S=p.autoOrdinals,C=p.autoMailto,_=p.autoTel,E=!1,T=!1,k=!1,M=!1,O=!1;return(f||h)&&(k=(0,l.keyboardListTrigger)(e,n,a,f,h)),(v||_||C)&&(T=(0,i.createLinkAfterSpace)(t,n,a,{autoLink:v,autoTel:_,autoMailto:C})),y&&(E=(0,c.transformHyphen)(t,n,a)),b&&(M=(0,s.transformFraction)(t,n,a)),S&&(O=(0,d.transformOrdinals)(t,n,a)),u.apiName=m(k,E),u.changeSource=g(k,E,T),k||E||T||M||O}),u)}},e.prototype.handleKeyDownEvent=function(e,t){var r=t.rawEvent;r.defaultPrevented||t.handledByEditFeature||"Backspace"!==r.key||this.options.autoUnlink&&(0,u.unlink)(e,r)},e.prototype.handleContentChangedEvent=function(e,t){var r=this.options,n=r.autoLink,i=r.autoTel,a=r.autoMailto;"Paste"==t.source&&(n||i||a)&&(0,o.createLink)(e,{autoLink:n,autoTel:i,autoMailto:a})},e}();t.AutoFormatPlugin=f;var m=function(e,t){return e?"autoToggleList":t?"autoHyphen":""},g=function(e,t,r){return e||t?n.ChangeSource.AutoFormat:r?n.ChangeSource.AutoLink:""}},4504:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transformHyphen=void 0;var n=r(5978);t.transformHyphen=function(e,t,r){var o=e.text.split(" ");if("--"===o[o.length-2]){var i=e.text.lastIndexOf("--");return(l=(0,n.splitTextSegment)(e,t,i,i+2)).text=l.text.replace("--","—"),r.canUndoByBackspace=!0,!0}var a=o.pop();if(a&&(null==a?void 0:a.indexOf("--"))>-1&&"--"!==a.trim()){i=e.text.indexOf(a);var l,s=(l=(0,n.splitTextSegment)(e,t,i,i+a.length-1)).text.length;if("-"!==l.text[0]&&"-"!==l.text[s-1])return l.text=l.text.replace("--","—"),r.canUndoByBackspace=!0,!0}return!1}},7662:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLink=void 0;var n=r(4990),o=r(5978),i=r(6619);t.createLink=function(e,t){var r=null,a=[];(0,o.formatTextSegmentBeforeSelectionMarker)(e,(function(e,r,o){if(r.link)return a.push(r.link),!0;var l=void 0;return!(r.link||!(l=(0,i.getLinkUrl)(r.text,t))||((0,n.addLink)(r,{format:{href:l,underline:!0},dataset:{}}),r.link&&a.push(r.link),0))}),{changeSource:n.ChangeSource.AutoLink,onNodeCreated:function(e,t){!r&&a.indexOf(e)>=0&&(r=t)},getChangeData:function(){return r}})}},1698:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLinkAfterSpace=void 0;var n=r(6619),o=r(5978);t.createLinkAfterSpace=function(e,t,r,i){var a=e.text.split(" ").pop(),l=null==a?void 0:a.trim(),s=void 0;return!!(l&&a&&(s=(0,n.getLinkUrl)(l,i)))&&((0,o.splitTextSegment)(e,t,e.text.length-a.trimLeft().length,e.text.trimRight().length).link={format:{href:s,underline:!0},dataset:{}},r.canUndoByBackspace=!0,!0)}},6619:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLinkUrl=void 0;var n=r(5978),o="[s]*[a-zA-Z0-9+][s]*",i="(T|t)el:"+o,a="(M|m)ailto:"+o;t.getLinkUrl=function(e,t){var r,o=t.autoLink,l=t.autoMailto,s=t.autoTel,c=o?null===(r=(0,n.matchLink)(e))||void 0===r?void 0:r.normalizedUrl:void 0,d=s?function(e){return e.match(i)?e.toLocaleLowerCase():void 0}(e):void 0,u=l?function(e){return e.match(a)?e.toLocaleLowerCase():void 0}(e):void 0;return c||d||u}},7957:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unlink=void 0;var n=r(5978);t.unlink=function(e,t){(0,n.formatTextSegmentBeforeSelectionMarker)(e,(function(e,r,n){return!!(null==r?void 0:r.link)&&(r.link=void 0,t.preventDefault(),!0)}))}},9886:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertAlphaToDecimals=void 0,t.convertAlphaToDecimals=function(e){var t=e.toUpperCase();if(t){for(var r=0,n=0;n<t.length;n++)r=26*r+(t.charCodeAt(n)-65+1);return r}}},8030:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getIndex=void 0;var n=r(9886);t.getIndex=function(e){var t=e.replace(/[^a-zA-Z0-9 ]/g,""),r=parseInt(t);return isNaN(r)?(0,n.convertAlphaToDecimals)(t):r}},5919:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getListTypeStyle=void 0;var n=r(5978),o=r(3728),i=r(4990);t.getListTypeStyle=function(e,t,r){void 0===t&&(t=!0),void 0===r&&(r=!0);var n=(0,i.getSelectedSegmentsAndParagraphs)(e,!0);if(n[0]){var u=n[0][0],p=n[0][1],f=null==p?void 0:p.segments[0];if(u&&"SelectionMarker"==u.segmentType&&f&&"Text"==f.segmentType){var m=f.text.trim(),g=c.get(m);if(g&&t)return{listType:"UL",styleType:g};if(r){var h=l(e,p),v=a(e,h),y=s(h),b=(0,o.getNumberingListStyle)(m,v,y);if(b)return{listType:"OL",styleType:b,index:!d(m)&&y===b&&v?v+1:void 0}}}}};var a=function(e,t){return t?(0,n.findListItemsInSameThread)(e,t).length:void 0},l=function(e,t){var r=(0,i.getOperationalBlocks)(e,["ListItem"],["TableCell"])[0],n=void 0;if(r){var o=r.parent.blocks.indexOf(t);if(o>-1)for(var a=o-1;a>-1;a--){var l=r.parent.blocks[a];if((0,i.isBlockGroupOfType)(l,"ListItem")){n=l;break}}}return n},s=function(e){var t;if(null==e?void 0:e.levels[0].dataset)return null===(t=(0,i.updateListMetadata)(e.levels[0]))||void 0===t?void 0:t.orderedStyleType},c=new Map([["*",i.BulletListType.Disc],["-",i.BulletListType.Dash],["--",i.BulletListType.Square],["->",i.BulletListType.LongArrow],["--\x3e",i.BulletListType.DoubleLongArrow],["=>",i.BulletListType.UnfilledArrow],[">",i.BulletListType.ShortArrow],["—",i.BulletListType.Hyphen]]),d=function(e){var t=e.replace(/[^\w\s]/g,"");return/^[1aAiI]$/.test(t)}},3728:(e,t,r)=>{"use strict";var n,o,i,a,l,s;Object.defineProperty(t,"__esModule",{value:!0}),t.getNumberingListStyle=void 0;var c,d,u=r(8030),p=r(4990);!function(e){e[e.Decimal=1]="Decimal",e[e.LowerAlpha=2]="LowerAlpha",e[e.UpperAlpha=3]="UpperAlpha",e[e.LowerRoman=4]="LowerRoman",e[e.UpperRoman=5]="UpperRoman"}(c||(c={})),function(e){e[e.Dot=1]="Dot",e[e.Dash=2]="Dash",e[e.Parenthesis=3]="Parenthesis",e[e.DoubleParenthesis=4]="DoubleParenthesis"}(d||(d={}));var f={".":1,"-":2,")":3},m=[p.NumberingListType.LowerRoman,p.NumberingListType.LowerRomanDash,p.NumberingListType.LowerRomanDoubleParenthesis,p.NumberingListType.LowerRomanParenthesis],g=[p.NumberingListType.UpperRoman,p.NumberingListType.UpperRomanDash,p.NumberingListType.UpperRomanDoubleParenthesis,p.NumberingListType.UpperRomanParenthesis],h=["1","a","A","I","i"],v=["i","v","x","l","c","d","m"],y=["I","V","X","L","C","D","M"],b=((n={})[1]=function(e){return T[e]||void 0},n[2]=function(e){return E[e]||void 0},n[3]=function(e){return _[e]||void 0},n[4]=function(e){return C[e]||void 0},n[5]=function(e){return S[e]||void 0},n),S=((o={})[1]=p.NumberingListType.UpperRoman,o[2]=p.NumberingListType.UpperRomanDash,o[3]=p.NumberingListType.UpperRomanParenthesis,o[4]=p.NumberingListType.UpperRomanDoubleParenthesis,o),C=((i={})[1]=p.NumberingListType.LowerRoman,i[2]=p.NumberingListType.LowerRomanDash,i[3]=p.NumberingListType.LowerRomanParenthesis,i[4]=p.NumberingListType.LowerRomanDoubleParenthesis,i),_=((a={})[1]=p.NumberingListType.UpperAlpha,a[2]=p.NumberingListType.UpperAlphaDash,a[3]=p.NumberingListType.UpperAlphaParenthesis,a[4]=p.NumberingListType.UpperAlphaDoubleParenthesis,a),E=((l={})[1]=p.NumberingListType.LowerAlpha,l[2]=p.NumberingListType.LowerAlphaDash,l[3]=p.NumberingListType.LowerAlphaParenthesis,l[4]=p.NumberingListType.LowerAlphaDoubleParenthesis,l),T=((s={})[1]=p.NumberingListType.Decimal,s[2]=p.NumberingListType.DecimalDash,s[3]=p.NumberingListType.DecimalParenthesis,s[4]=p.NumberingListType.DecimalDoubleParenthesis,s);t.getNumberingListStyle=function(e,t,r){var n=e.trim(),o="("===n[0]&&")"===n[n.length-1],i=o?n.slice(1,-1):n.slice(0,-1),a=(0,u.getIndex)(i),l=h.indexOf(i)<0;if(!(!a||a<1||!t&&l||t&&l&&!function(e,t){return t&&e&&t+1===e}(a,t))){var s=function(e){return Number(e)||/^[A-Za-z\s]*$/.test(e)}(i)?function(e,t,r){var n=t?4:f[e[e.length-1]];if(n){var o=function(e,t){if(!isNaN(parseInt(e)))return 1;if(/[a-z]+/g.test(e)){if(4===t&&m.indexOf(t)>-1&&v.indexOf(e[0])>-1||!t&&"i"===e)return 4;if(2===t||!t&&"a"===e)return 2}else if(/[A-Z]+/g.test(e)){if(5==t&&g.indexOf(t)>-1&&y.indexOf(e[0])>-1||!t&&"I"===e)return 5;if(3==t||!t&&"A"===e)return 3}}(t?e.slice(1,-1):e.slice(0,-1),r);return o?b[o](n):void 0}}(n,o,l?r:void 0):void 0;return s}}},4939:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keyboardListTrigger=void 0;var n=r(1635),o=r(5919),i=r(4990),a=r(5978);t.keyboardListTrigger=function(e,t,r,s,c){void 0===s&&(s=!0),void 0===c&&(c=!0);var d=(0,o.getListTypeStyle)(e,s,c);if(d){t.segments.splice(0,1);var u=d.listType,p=d.styleType,f=d.index;return l(e,u,p,f),r.canUndoByBackspace=!0,function(e,t){var r=(0,n.__read)((0,i.getOperationalBlocks)(e,["ListItem"],[]),1)[0];if(r&&(0,i.isBlockGroupOfType)(r.block,"ListItem")){var o=r.path,l=r.block;t.announceData=(0,a.getListAnnounceData)((0,n.__spreadArray)([l],(0,n.__read)(o),!1))}}(e,r),!0}return!1};var l=function(e,t,r,n){(0,a.setListType)(e,t);var o="OL"==t;n&&n>1&&o&&(0,a.setModelListStartNumber)(e,n),(0,a.setModelListStyle)(e,o?{orderedStyleType:r,applyListStyleFromLevel:!1}:{unorderedStyleType:r,applyListStyleFromLevel:!1})}},212:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transformFraction=void 0;var n=r(5978),o=new Map([["1/2","½"],["1/4","¼"],["3/4","¾"]]);t.transformFraction=function(e,t,r){var i,a=null===(i=e.text.split(" ").pop())||void 0===i?void 0:i.trim(),l=a?o.get(a):void 0;if(a&&l){var s=e.text.length-1,c=s-a.length;return(0,n.splitTextSegment)(e,t,c,s).text=l,r.canUndoByBackspace=!0,!0}return!1}},7864:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transformOrdinals=void 0;var n=r(5978);t.transformOrdinals=function(e,t,r){var o,i,a,l=null===(o=e.text.split(" ").pop())||void 0===o?void 0:o.trim();if(l){var s=l.substring(l.length-2),c=(a=(i=l).substring(0,i.length-2),/^-?\d+$/.test(a)?parseInt(i):null);if(c&&function(e){return{1:"st",2:"nd",3:"rd"}[e]||"th"}(c)===s)return(0,n.splitTextSegment)(e,t,e.text.length-3,e.text.length-1).format.superOrSubScriptSequence="super",r.canUndoByBackspace=!0,!0}return!1}},9390:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContextMenuPluginBase=void 0;var r=function(){function e(e){var t=this;this.options=e,this.container=null,this.editor=null,this.isMenuShowing=!1,this.onDismiss=function(){var e,r;t.container&&t.isMenuShowing&&(null===(r=(e=t.options).dismiss)||void 0===r||r.call(e,t.container),t.isMenuShowing=!1)}}return e.prototype.getName=function(){return"ContextMenu"},e.prototype.initialize=function(e){this.editor=e},e.prototype.dispose=function(){var e;this.onDismiss(),(null===(e=this.container)||void 0===e?void 0:e.parentNode)&&(this.container.parentNode.removeChild(this.container),this.container=null),this.editor=null},e.prototype.onPluginEvent=function(e){if("contextMenu"==e.eventType&&e.items.length>0){var t=e.rawEvent,r=e.items;this.onDismiss(),this.options.allowDefaultMenu||t.preventDefault(),this.initContainer(t.pageX,t.pageY)&&(this.options.render(this.container,r,this.onDismiss),this.isMenuShowing=!0)}},e.prototype.initContainer=function(e,t){var r,n;return!this.container&&this.editor&&(this.container=this.editor.getDocument().createElement("div"),this.container.style.position="fixed",this.container.style.width="0",this.container.style.height="0",this.editor.getDocument().body.appendChild(this.container)),null===(r=this.container)||void 0===r||r.style.setProperty("left",e+"px"),null===(n=this.container)||void 0===n||n.style.setProperty("top",t+"px"),!!this.container},e}();t.ContextMenuPluginBase=r},1862:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CustomReplacePlugin=void 0;var n=r(5978),o=function(){function e(e){this.customReplacements=e,this.editor=null,this.triggerKeys=[]}return e.prototype.getName=function(){return"CustomReplace"},e.prototype.initialize=function(e){this.editor=e,this.triggerKeys=this.customReplacements.map((function(e){return e.stringToReplace.slice(-1)}))},e.prototype.dispose=function(){this.editor=null},e.prototype.onPluginEvent=function(e){this.editor&&"input"===e.eventType&&this.handleEditorInputEvent(this.editor,e)},e.prototype.handleEditorInputEvent=function(e,t){var r=this,o=t.rawEvent,i=e.getDOMSelection(),a=o.data;this.customReplacements.length>0&&"insertText"===o.inputType&&i&&"range"===i.type&&i.range.collapsed&&a&&this.triggerKeys.indexOf(a)>-1&&(0,n.formatTextSegmentBeforeSelectionMarker)(e,(function(e,t,n,o,i){return!!r.customReplacements.some((function(e){var r=e.stringToReplace,o=e.replacementString;return(0,e.replacementHandler)(t,r,o,n)}))&&(i.canUndoByBackspace=!0,!0)}))},e}();t.CustomReplacePlugin=o},9952:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditPlugin=void 0;var n=r(7909),o=r(9322),i=r(7500),a=r(8327),l=r(4990),s={handleTabKey:!0},c=function(){function e(e){void 0===e&&(e=s),this.options=e,this.editor=null,this.disposer=null,this.shouldHandleNextInputEvent=!1,this.selectionAfterDelete=null,this.handleNormalEnter=!1}return e.prototype.getName=function(){return"Edit"},e.prototype.initialize=function(e){var t=this;this.editor=e,this.handleNormalEnter=this.editor.isExperimentalFeatureEnabled("HandleEnterKey"),e.getEnvironment().isAndroid&&(this.disposer=this.editor.attachDomEvent({beforeinput:{beforeDispatch:function(r){return t.handleBeforeInputEvent(e,r)}}}))},e.prototype.dispose=function(){var e;this.editor=null,null===(e=this.disposer)||void 0===e||e.call(this),this.disposer=null},e.prototype.onPluginEvent=function(e){if(this.editor)switch(e.eventType){case"keyDown":this.handleKeyDownEvent(this.editor,e);break;case"keyUp":this.selectionAfterDelete&&(this.editor.setDOMSelection(this.selectionAfterDelete),this.selectionAfterDelete=null)}},e.prototype.willHandleEventExclusively=function(e){if(this.editor&&this.options.handleTabKey&&"keyDown"==e.eventType&&"Tab"==e.rawEvent.key&&!e.rawEvent.shiftKey){var t=this.editor.getDOMSelection(),r="range"==(null==t?void 0:t.type)&&t.range.collapsed?t.range.startContainer:null,n=r?this.editor.getDOMHelper().findClosestElementAncestor(r,"table"):null,o=n&&(0,l.parseTableCells)(n);if(o){var i=o[o.length-1],a=i&&i[i.length-1];if("object"==typeof a&&a.contains(r))return!0}}return!1},e.prototype.handleKeyDownEvent=function(e,t){var r=t.rawEvent;if(!r.defaultPrevented&&!t.handledByEditFeature)switch(r.key){case"Backspace":(0,n.keyboardDelete)(e,r);break;case"Delete":t.rawEvent.shiftKey||(0,n.keyboardDelete)(e,r);break;case"Tab":this.options.handleTabKey&&(0,a.keyboardTab)(e,r);break;case"Unidentified":e.getEnvironment().isAndroid&&(this.shouldHandleNextInputEvent=!0);break;case"Enter":(0,o.keyboardEnter)(e,r,this.handleNormalEnter);break;default:(0,i.keyboardInput)(e,r)}},e.prototype.handleBeforeInputEvent=function(e,t){if(this.shouldHandleNextInputEvent&&t instanceof InputEvent&&!t.defaultPrevented){this.shouldHandleNextInputEvent=!1;var r=!1;switch(t.inputType){case"deleteContentBackward":r=(0,n.keyboardDelete)(e,new KeyboardEvent("keydown",{key:"Backspace",keyCode:8,which:8}));break;case"deleteContentForward":r=(0,n.keyboardDelete)(e,new KeyboardEvent("keydown",{key:"Delete",keyCode:46,which:46}))}r&&(t.preventDefault(),this.selectionAfterDelete=e.getDOMSelection())}},e}();t.EditPlugin=c},7184:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteAllSegmentBefore=void 0;var n=r(4990);t.deleteAllSegmentBefore=function(e){if("notDeleted"==e.deleteResult)for(var t=e.insertPoint,r=t.paragraph,o=t.marker,i=r.segments.indexOf(o),a=(0,n.mutateBlock)(r),l=i-1;l>=0;l--){var s=a.segments[l];s.isSelected=!0,(0,n.deleteSegment)(r,s,e.formatContext)&&(e.deleteResult="range")}}},9234:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.backwardDeleteCollapsedSelection=t.forwardDeleteCollapsedSelection=void 0;var n=r(6746),o=r(5978),i=r(4990);function a(e){return function(t){var r;if("notDeleted"==t.deleteResult){var a="forward"==e,l=t.insertPoint,s=l.paragraph,c=l.marker,d=l.path,u=l.tableContext,p=s.segments;!function(e){var t,r,n=e.segments;if("Br"==(null===(t=n[n.length-1])||void 0===t?void 0:t.segmentType)){var o=n.filter((function(e){return"SelectionMarker"!=e.segmentType}));"Br"!=(null===(r=o[o.length-2])||void 0===r?void 0:r.segmentType)&&(0,i.mutateBlock)(e).segments.pop()}}(s);var f,m,g=p.indexOf(c)+(a?1:-1),h=p[g];if(h)(0,i.deleteSegment)(s,h,t.formatContext,e)&&(t.deleteResult="singleChar",(0,i.setParagraphNotImplicit)(s));else if(function(e,t,r,n){return!e&&1==t.length&&"SelectionMarker"==t[0].segmentType&&r.format.marginLeft&&parseInt(r.format.marginLeft)&&(0,i.getClosestAncestorBlockGroupIndex)(n,["Document","TableCell"],["ListItem"])>-1}(a,p,s,d)&&(m=function(e){var t=e[e.length-1];return"Document"==t.blockGroupType?t:null}(d)))(0,o.setModelIndentation)(m,"outdent"),t.deleteResult="range";else if(f=(0,n.getLeafSiblingBlock)(d,s,a)){var v=f.block,y=f.path,b=f.siblingSegment;if("Paragraph"==v.blockType){var S=(0,i.mutateBlock)(v);b?(0,i.deleteSegment)(S,b,t.formatContext,e)&&(t.deleteResult="range"):(a?t.lastParagraph=S:("Br"==(null===(r=S.segments[S.segments.length-1])||void 0===r?void 0:r.segmentType)&&(0,i.mutateBlock)(S).segments.pop(),t.insertPoint={marker:c,paragraph:S,path:y,tableContext:u},t.lastParagraph=s),t.deleteResult="range"),t.lastTableContext=u}else(0,i.deleteBlock)((0,i.mutateBlock)(y[0]).blocks,v,void 0,t.formatContext,e)&&(t.deleteResult="range")}else t.deleteResult="nothingToDelete"}}}t.forwardDeleteCollapsedSelection=a("forward"),t.backwardDeleteCollapsedSelection=a("backward")},5068:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteEmptyQuote=void 0;var n=r(1635),o=r(4990);t.deleteEmptyQuote=function(e){var t=e.deleteResult;if("nothingToDelete"==t||"notDeleted"==t||"range"==t){var r=e.insertPoint,n=e.formatContext,s=r.path,c=r.paragraph,d=null==n?void 0:n.rawEvent,u=(0,o.getClosestAncestorBlockGroupIndex)(s,["FormatContainer"],["TableCell","ListItem"]),p=s[u];if(p&&"FormatContainer"===p.blockGroupType&&"blockquote"==p.tagName){var f=s[u+1],m=f.blocks.indexOf(p);i(p)?((0,o.unwrapBlock)(f,p),null==d||d.preventDefault(),e.deleteResult="range"):"Enter"===(null==d?void 0:d.key)&&p.blocks.indexOf(c)>=0&&a(c)&&(l((0,o.mutateBlock)(p),f,m,c),null==d||d.preventDefault(),e.deleteResult="range")}}};var i=function(e){return 1===e.blocks.length&&"Paragraph"===e.blocks[0].blockType&&a(e.blocks[0])},a=function(e){return e.segments.every((function(e){return"SelectionMarker"===e.segmentType||"Br"===e.segmentType}))},l=function(e,t,r,i){var a,l=e.blocks.indexOf(i);if(l>=0){var s=(0,o.mutateBlock)(t);if(l<e.blocks.length-1){var c=(0,o.createFormatContainer)(e.tagName,e.format);(a=c.blocks).push.apply(a,(0,n.__spreadArray)([],(0,n.__read)(e.blocks.splice(l+1,e.blocks.length-l-1)),!1)),s.blocks.splice(r+1,0,c)}s.blocks.splice(r+1,0,i),e.blocks.splice(l,1),0==e.blocks.length&&s.blocks.splice(r,0)}}},9200:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteList=void 0;var n=r(4990);t.deleteList=function(e){if("notDeleted"==e.deleteResult){var t=e.insertPoint,r=t.paragraph,o=t.marker,i=t.path;if(r.segments[0]==o){var a=i[(0,n.getClosestAncestorBlockGroupIndex)(i,["ListItem"],["TableCell","FormatContainer"])],l=null==a?void 0:a.levels[a.levels.length-1];l&&(null==a?void 0:a.blocks[0])==r&&("block"==l.format.displayForDummyItem?a.levels.pop():l.format.displayForDummyItem="block",e.deleteResult="range")}}}},2285:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.backwardDeleteWordSelection=t.forwardDeleteWordSelection=void 0;var n,o=r(1635),i=r(4990);function a(e){return function(t){if("notDeleted"==t.deleteResult)for(var r=t.insertPoint,n=r.marker,a=r.paragraph,l=a.segments.indexOf(n),s="forward"==e,c=function(e,t,r,n){var a,l,s,c,d,u,p,f,m,g;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:a=r?1:-1,l=e.segments,s=(0,i.isWhiteSpacePreserved)(e.format.whiteSpace),c=t+a,o.label=1;case 1:if(!(c>=0&&c<l.length))return[3,12];switch((d=l[c]).segmentType){case"Text":return[3,2];case"Image":return[3,7];case"SelectionMarker":return[3,9]}return[3,10];case 2:u=r?0:d.text.length-1,o.label=3;case 3:return u>=0&&u<d.text.length?(p=d.text[u],f=(0,i.isPunctuation)(p),m=(0,i.isSpace)(p),[4,{punctuation:f,space:m,text:!f&&!m}]):[3,6];case 4:if(o.sent()){if(g=(g=d.text).substring(0,u)+g.substring(u+1),s||(g=(0,i.normalizeText)(g,r)),n.deleteResult="range",!g)return l.splice(c,1),a>0&&(c-=a),[3,6];d.text=g,a>0&&(u-=a)}o.label=5;case 5:return u+=a,[3,3];case 6:return[3,11];case 7:return[4,{punctuation:!0,space:!1,text:!1}];case 8:return o.sent()&&(l.splice(c,1),a>0&&(c-=a),n.deleteResult="range"),[3,11];case 9:return[3,11];case 10:return[2,null];case 11:return c+=a,[3,1];case 12:return[2,null]}}))}((0,i.mutateBlock)(a),l,s,t),d=c.next(),u=0;5!=u&&!d.done;){var p=d.value,f=p.punctuation,m=p.space,g=p.text;switch(u){case 0:u=m?4:f?1:2,d=c.next(!0);break;case 1:s&&m?(u=3,d=c.next(!0)):f?d=c.next(!0):u=5;break;case 2:s&&m?(u=3,d=c.next(!0)):g?d=c.next(!0):u=5;break;case 3:f||!m?u=5:d=c.next(!0);break;case 4:m?d=c.next(!0):f?(u=s?3:1,d=c.next(!0)):u=s?5:2}}}}!function(e){e[e.Start=0]="Start",e[e.Punctuation=1]="Punctuation",e[e.Text=2]="Text",e[e.NonText=3]="NonText",e[e.Space=4]="Space",e[e.End=5]="End"}(n||(n={})),t.forwardDeleteWordSelection=a("forward"),t.backwardDeleteWordSelection=a("backward")},1939:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldDeleteAllSegmentsBefore=t.shouldDeleteWord=t.handleKeyboardEventResult=void 0;var n=r(4990);t.handleKeyboardEventResult=function(e,t,r,o,i){switch(i.skipUndoSnapshot=!0,i.clearModelCache=!1,o){case"notDeleted":return i.clearModelCache=!0,!1;case"nothingToDelete":return r.preventDefault(),!1;case"range":case"singleChar":return r.preventDefault(),(0,n.normalizeContentModel)(t),"range"==o&&(i.skipUndoSnapshot=!1),e.triggerEvent("beforeKeyboardEditing",{rawEvent:r}),!0}},t.shouldDeleteWord=function(e,t){return t&&e.altKey&&!e.metaKey||!t&&e.ctrlKey&&!e.altKey},t.shouldDeleteAllSegmentsBefore=function(e){return e.metaKey&&!e.altKey}},950:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleEnterOnList=void 0;var n=r(1635),o=r(5978),i=r(9399),a=r(4990);t.handleEnterOnList=function(e){var t=e.deleteResult,r=e.insertPoint;if("notDeleted"==t||"nothingToDelete"==t){var i=r.path,c=(0,a.getClosestAncestorBlockGroupIndex)(i,["ListItem"],["TableCell","FormatContainer"]),d=i[c],u=i[c+1];if("ListItem"===(null==d?void 0:d.blockGroupType)&&u){var p=(0,a.mutateBlock)(d);l(p)?p.levels.pop():(p=s(e,p,u),e.formatContext&&(e.formatContext.announceData=(0,o.getListAnnounceData)((0,n.__spreadArray)([p],(0,n.__read)(i.slice(c+1)),!1))));var f=u.blocks.indexOf(p);if(u.blocks[f+1]){var m=u.blocks[f+1];(0,a.isBlockGroupOfType)(m,"ListItem")&&m.levels[0]&&m.levels.forEach((function(e){1!==e.format.startNumberOverride&&(e.format.startNumberOverride=void 0)}))}e.deleteResult="range"}}};var l=function(e){return 1===e.blocks.length&&"Paragraph"===e.blocks[0].blockType&&2===e.blocks[0].segments.length&&"SelectionMarker"===e.blocks[0].segments[0].segmentType&&"Br"===e.blocks[0].segments[1].segmentType},s=function(e,t,r){var o,l=e.insertPoint,s=r.blocks.indexOf(t),d=l.paragraph,u=t.blocks.indexOf(d),p=(0,i.splitParagraph)(l),f=c(t),m=(0,a.createListItem)(f,l.marker.format);m.blocks.push(p);var g=t.blocks.length-u-1;return u>=0&&g>0&&(o=m.blocks).push.apply(o,(0,n.__spreadArray)([],(0,n.__read)((0,a.mutateBlock)(t).blocks.splice(u+1,g)),!1)),l.paragraph=p,(0,a.mutateBlock)(r).blocks.splice(s+1,0,m),e.lastParagraph==d&&(e.lastParagraph=p),m},c=function(e){return e.levels.map((function(e){return(0,a.createListLevel)(e.listType,(0,n.__assign)((0,n.__assign)({},e.format),{startNumberOverride:void 0,displayForDummyItem:void 0}),e.dataset)}))}},685:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleEnterOnParagraph=void 0;var n=r(4990),o=r(9399);t.handleEnterOnParagraph=function(e){var t,r,i=e.insertPoint,a=i.paragraph,l=i.path,s=null!==(r=null===(t=l[0])||void 0===t?void 0:t.blocks.indexOf(a))&&void 0!==r?r:-1;if("notDeleted"==e.deleteResult&&s>=0){var c=(0,o.splitParagraph)(e.insertPoint);(0,n.mutateBlock)(l[0]).blocks.splice(s+1,0,c),e.deleteResult="range",e.lastParagraph=c,e.insertPoint.paragraph=c}}},7909:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keyboardDelete=void 0;var n=r(7184),o=r(5068),i=r(9200),a=r(4990),l=r(1939),s=r(2285),c=r(9234);t.keyboardDelete=function(e,t){var r=!1;return function(e,t){if(e){if("range"==e.type&&e.range.collapsed){var r=e.range;return!((0,a.isNodeOfType)(r.startContainer,"TEXT_NODE")&&!(0,a.isModifierKey)(t)&&(function(e,t){return"Backspace"==e.key&&t.startOffset>1}(t,r)||function(e,t){var r,n;return"Delete"==e.key&&t.startOffset<(null!==(n=null===(r=t.startContainer.nodeValue)||void 0===r?void 0:r.length)&&void 0!==n?n:0)-1}(t,r)))}return!0}return!1}(e.getDOMSelection(),t)&&e.formatContentModel((function(d,u){var p=(0,a.deleteSelection)(d,function(e,t){var r="Delete"==e.key,a=(0,l.shouldDeleteAllSegmentsBefore)(e)&&!r?n.deleteAllSegmentBefore:null,d=(0,l.shouldDeleteWord)(e,t)?r?s.forwardDeleteWordSelection:s.backwardDeleteWordSelection:null,u=r?c.forwardDeleteCollapsedSelection:c.backwardDeleteCollapsedSelection,p=r?null:o.deleteEmptyQuote;return[a,d,r?null:i.deleteList,u,p]}(t,!!e.getEnvironment().isMac),u).deleteResult;return r=(0,l.handleKeyboardEventResult)(e,d,t,p,u)}),{rawEvent:t,changeSource:a.ChangeSource.Keyboard,getChangeData:function(){return t.which},scrollCaretIntoView:!0,apiName:"Delete"==t.key?"handleDeleteKey":"handleBackspaceKey"}),r}},9322:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keyboardEnter=void 0;var n=r(5068),o=r(950),i=r(685),a=r(4990);t.keyboardEnter=function(e,t,r){var l=e.getDOMSelection();e.formatContentModel((function(e,s){var c,d=(0,a.deleteSelection)(e,[],s);if(l&&"table"!=l.type){d.deleteResult="notDeleted";var u=t.shiftKey?[]:[o.handleEnterOnList,n.deleteEmptyQuote];r&&u.push(i.handleEnterOnParagraph),(0,a.runEditSteps)(u,d)}return"range"==d.deleteResult&&(s.newPendingFormat=null===(c=d.insertPoint)||void 0===c?void 0:c.marker.format,(0,a.normalizeContentModel)(e),t.preventDefault(),!0)}),{rawEvent:t,scrollCaretIntoView:!0,changeSource:a.ChangeSource.Keyboard})}},7500:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keyboardInput=void 0;var n=r(4990);t.keyboardInput=function(e,t){if(function(e,t){return!(!e||(0,n.isModifierKey)(t)||"Space"!=t.key&&1!=t.key.length||"range"==e.type&&e.range.collapsed)}(e.getDOMSelection(),t))return e.takeSnapshot(),e.formatContentModel((function(e,t){var r,o=(0,n.deleteSelection)(e,[],t);return t.skipUndoSnapshot=!0,"range"==o.deleteResult&&(t.newPendingFormat=null===(r=o.insertPoint)||void 0===r?void 0:r.marker.format,(0,n.normalizeContentModel)(e),!0)}),{scrollCaretIntoView:!0,rawEvent:t,changeSource:n.ChangeSource.Keyboard}),!0}},8327:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keyboardTab=void 0;var n=r(8580),o=r(2172),i=r(4642),a=r(9889),l=r(5978),s=r(4990);t.keyboardTab=function(e,t){var r=e.getDOMSelection();switch(null==r?void 0:r.type){case"range":return e.formatContentModel((function(e,r){return function(e,t,r){var i=(0,s.getOperationalBlocks)(e,["ListItem","TableCell"],[]),c=i.length>0?i[0].block:void 0;return i.length>1?((0,l.setModelIndentation)(e,t.shiftKey?"outdent":"indent"),t.preventDefault(),!0):(0,s.isBlockGroupOfType)(c,"TableCell")?(0,a.handleTabOnTableCell)(e,c,t):"Paragraph"===(null==c?void 0:c.blockType)?(0,o.handleTabOnParagraph)(e,c,t,r):!!(0,s.isBlockGroupOfType)(c,"ListItem")&&(0,n.handleTabOnList)(e,c,t,r)}(e,t,r)}),{apiName:"handleTabKey"}),!0;case"table":return e.formatContentModel((function(e){return(0,i.handleTabOnTable)(e,t)}),{apiName:"handleTabKey",changeSource:s.ChangeSource.Keyboard}),!0}}},8580:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleTabOnList=void 0;var n=r(2172),o=r(5978);t.handleTabOnList=function(e,t,r,i){var a=function(e){return e.blocks.filter((function(e){return"Paragraph"==e.blockType&&e.segments.some((function(e){return e.isSelected}))}))}(t);return function(e){return"Paragraph"==e.blocks[0].blockType&&"SelectionMarker"==e.blocks[0].segments[0].segmentType}(t)||1!=a.length||"Paragraph"!==a[0].blockType?((0,o.setModelIndentation)(e,r.shiftKey?"outdent":"indent",void 0,i),r.preventDefault(),!0):(0,n.handleTabOnParagraph)(e,a[0],r,i)}},2172:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleTabOnParagraph=void 0;var n=r(5978),o=r(4990),i="    ";t.handleTabOnParagraph=function(e,t,r,a){var l=t.segments.filter((function(e){return e.isSelected})),s=1===l.length&&"SelectionMarker"===l[0].segmentType,c=t.segments.every((function(e){return e.isSelected}));if("SelectionMarker"===t.segments[0].segmentType&&s||c){var d=t.format,u=d.marginLeft,p=d.marginRight,f="rtl"===d.direction;if(r.shiftKey&&(!f&&(!u||"0px"==u)||f&&(!p||"0px"==p)))return!1;(0,n.setModelIndentation)(e,r.shiftKey?"outdent":"indent",void 0,a)}else if(s){var m=t.segments.findIndex((function(e){return"SelectionMarker"===e.segmentType}));if(r.shiftKey){if("Text"==(v=t.segments[m-1]).segmentType){var g=v.text.length-4;if(v.text===i)(0,o.mutateBlock)(t).segments.splice(m-1,1);else{if(v.text.substring(g)!==i)return!1;(0,o.mutateSegment)(t,v,(function(e){e.text=e.text.substring(0,g)}))}}}else{var h=t.segments[m].format,v=(0,o.createText)(i,h);(0,o.mutateBlock)(t).segments.splice(m,0,v)}}else{var y=void 0,b=void 0;if(t.segments.forEach((function(e,t){e.isSelected&&(y||(y=t),b=t)})),!y||!b)return!1;var S=t.segments[y],C=(0,o.createText)(r.shiftKey?i:" ",S.format),_=(0,o.createSelectionMarker)(S.format);(0,o.mutateBlock)(t).segments.splice(y,b-y+1,C,_)}return r.preventDefault(),!0}},4642:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleTabOnTable=void 0;var n=r(4990),o=r(5978);t.handleTabOnTable=function(e,t){var r=(0,n.getFirstSelectedTable)(e)[0];return!(!r||!function(e){var t,r,n,o;return(null===(r=null===(t=e.rows[0])||void 0===t?void 0:t.cells[0])||void 0===r?void 0:r.isSelected)&&(null===(o=null===(n=e.rows[e.rows.length-1])||void 0===n?void 0:n.cells[e.widths.length-1])||void 0===o?void 0:o.isSelected)}(r)||((0,o.setModelIndentation)(e,t.shiftKey?"outdent":"indent"),t.preventDefault(),0))}},9889:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleTabOnTableCell=void 0;var n=r(5978),o=r(4990);t.handleTabOnTableCell=function(e,t,r){var i,a,l,s=(0,o.getFirstSelectedTable)(e)[0];if(!r.shiftKey&&s&&(null===(i=s.rows[s.rows.length-1])||void 0===i?void 0:i.cells[s.widths.length-1])===t){var c=(0,o.mutateBlock)(s);(0,n.insertTableRow)(c,"insertBelow"),(0,n.clearSelectedCells)(c,{firstRow:c.rows.length-1,firstColumn:0,lastRow:c.rows.length-1,lastColumn:c.widths.length-1}),(0,o.normalizeTable)(c,e.format);var d=null===(l=null===(a=c.rows[c.rows.length-1])||void 0===a?void 0:a.cells[0])||void 0===l?void 0:l.blocks[0];if("Paragraph"==d.blockType){var u=(0,o.createSelectionMarker)(e.format);(0,o.mutateBlock)(d).segments.unshift(u),(0,o.setParagraphNotImplicit)(d),(0,o.setSelection)(c.rows[c.rows.length-1].cells[0],u)}return r.preventDefault(),!0}return!1}},6746:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLeafSiblingBlock=void 0;var n=r(1635),o=r(4990);t.getLeafSiblingBlock=function(e,t,r){for(var i,a=(0,n.__spreadArray)([],(0,n.__read)(e),!1),l=function(){var e=a[0],n=e.blocks.indexOf(t);if(n<0)return"break";var l=e.blocks[n+(r?1:-1)];if(l){for(;"BlockGroup"==l.blockType;){var s=l.blocks[r?0:l.blocks.length-1];if(!s)return{value:{block:l,path:a}};if("BlockGroup"!=s.blockType)return a.unshift(l),{value:{block:s,path:a}};a.unshift(l),l=s}return{value:{block:l,path:a}}}if((0,o.isGeneralSegment)(e)){a.shift();var c=-1,d=e,u=null===(i=a[0])||void 0===i?void 0:i.blocks.find((function(e){return"Paragraph"==e.blockType&&(c=e.segments.indexOf(d))>=0}));if(!u)return"break";var p=u.segments[c+(r?1:-1)];if(p)return{value:{block:u,path:a,siblingSegment:p}};t=u}else{if("Document"==e.blockGroupType||"TableCell"==e.blockGroupType)return"break";a.shift(),t=e}};a.length>0;){var s=l();if("object"==typeof s)return s.value;if("break"===s)break}return null}},9399:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitParagraph=void 0;var n=r(1635),o=r(4990);t.splitParagraph=function(e){var t,r=e.paragraph,i=e.marker,a=(0,o.createParagraph)(!1,r.format,r.segmentFormat),l=r.segments.indexOf(i),s=r.segments.splice(l,r.segments.length-l);return 0==r.segments.length&&r.segments.push((0,o.createBr)(i.format)),(t=a.segments).push.apply(t,(0,n.__spreadArray)([],(0,n.__read)(s),!1)),(0,o.setParagraphNotImplicit)(r),e.paragraph=a,(0,o.normalizeParagraph)(r),a}},634:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HyperlinkPlugin=void 0;var n=r(5978),o=function(e){return e},i=function(){function e(e,t,r){var n=this;void 0===e&&(e=o),this.tooltip=e,this.target=t,this.onLinkClick=r,this.editor=null,this.domHelper=null,this.isMac=!1,this.disposer=null,this.currentNode=null,this.currentLink=null,this.onMouse=function(e){n.runWithHyperlink(e.target,(function(t,r){var o,i="mouseover"==e.type?"function"==typeof n.tooltip?n.tooltip(t,r):n.tooltip:null;null===(o=n.domHelper)||void 0===o||o.setDomAttribute("title",i)}))}}return e.prototype.getName=function(){return"Hyperlink"},e.prototype.initialize=function(e){this.editor=e,this.domHelper=e.getDOMHelper(),this.isMac=!!e.getEnvironment().isMac,this.disposer=e.attachDomEvent({mouseover:{beforeDispatch:this.onMouse},mouseout:{beforeDispatch:this.onMouse}})},e.prototype.dispose=function(){this.disposer&&(this.disposer(),this.disposer=null),this.currentNode=null,this.currentLink=null,this.editor=null},e.prototype.onPluginEvent=function(e){var t,r,o,i,a=this;if("keyDown"==e.eventType){var l="range"==(null==(s=null===(t=this.editor)||void 0===t?void 0:t.getDOMSelection())?void 0:s.type)?s.range.commonAncestorContainer:null;l&&l!=this.currentNode&&(this.currentNode=l,this.currentLink=null,this.runWithHyperlink(l,(function(e,t){l.textContent&&(i=(0,n.matchLink)(l.textContent))&&i.normalizedUrl==e&&(a.currentLink=t)})))}else if("keyUp"==e.eventType){var s,c="range"==(null==(s=null===(r=this.editor)||void 0===r?void 0:r.getDOMSelection())?void 0:s.type)?s.range.commonAncestorContainer:null;c&&c==this.currentNode&&this.currentLink&&this.currentLink.contains(c)&&c.textContent&&(i=(0,n.matchLink)(c.textContent))&&this.currentLink.setAttribute("href",i.normalizedUrl)}else"mouseUp"==e.eventType&&e.isClicking?this.runWithHyperlink(e.rawEvent.target,(function(t,r){var n,o;if(!(null===(n=a.onLinkClick)||void 0===n?void 0:n.call(a,r,e.rawEvent))&&a.isCtrlOrMetaPressed(e.rawEvent)&&0===e.rawEvent.button){e.rawEvent.preventDefault();var i=a.target||"_blank",l=null===(o=a.editor)||void 0===o?void 0:o.getDocument().defaultView;try{null==l||l.open(t,i)}catch(e){}}})):"contentChanged"==e.eventType&&(null===(o=this.domHelper)||void 0===o||o.setDomAttribute("title",null))},e.prototype.runWithHyperlink=function(e,t){var r,n=null===(r=this.domHelper)||void 0===r?void 0:r.findClosestElementAncestor(e,"a[href]"),o=null==n?void 0:n.getAttribute("href");o&&n&&t(o,n)},e.prototype.isCtrlOrMetaPressed=function(e){return this.isMac?e.metaKey:e.ctrlKey},e}();t.HyperlinkPlugin=i},3378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCropHTML=t.createImageCropper=void 0;var n=r(3890),o=r(823),i=r(4990),a=r(6639);function l(){var e={tag:"div",style:"position:absolute;background-color:rgb(0,0,0,0.5);pointer-events:none",className:o.ImageEditElementClass.CropOverlay},t={tag:"div",style:"position:absolute;overflow:hidden;inset:0px;",className:o.ImageEditElementClass.CropContainer,children:[]};return t&&a.XS_CROP.forEach((function(e){return a.YS_CROP.forEach((function(r){var n;return null===(n=t.children)||void 0===n?void 0:n.push(function(e,t){var r,n="w"==e?"left":"right",i="n"==t?"top":"bottom",l=a.ROTATION[t+e];return{tag:"div",className:o.ImageEditElementClass.CropHandle,style:"position:absolute;pointer-events:auto;cursor:"+t+e+"-resize;"+n+":0;"+i+":0;width:"+a.CROP_HANDLE_SIZE+"px;height:"+a.CROP_HANDLE_SIZE+"px;transform:rotate("+l+"deg)",dataset:{x:e,y:t},children:(r=[],[0,1].forEach((function(e){return[0,1].forEach((function(t){r.push(function(e,t){var r=0==t?"right:"+e+"px;height:"+(a.CROP_HANDLE_WIDTH-2*e)+"px;":"top:"+e+"px;width:"+(a.CROP_HANDLE_WIDTH-2*e)+"px;",n=0==e?"white":"black";return{tag:"div",style:"position:absolute;left:"+e+"px;bottom:"+e+"px;"+r+";background-color:"+n}}(e,t))}))})),r)}}(e,r))}))})),[t,e,e,e,e]}t.createImageCropper=function(e){return l().map((function(t){var r=(0,n.createElement)(t,e);if(r&&(0,i.isNodeOfType)(r,"ELEMENT_NODE")&&(0,i.isElementOfType)(r,"div"))return r})).filter((function(e){return!!e}))},t.getCropHTML=l},1088:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Cropper=void 0;var n=r(1635),o=r(1030);function i(e,t,r,n,o){var i=r*(1-n)-o,a=r*e+t;return Math.max(Math.min(a,i),0)/r}t.Cropper={onDragStart:function(e){var t=e.editInfo;return(0,n.__assign)({},t)},onDragging:function(e,t,r,a,l){var s,c,d=e.editInfo,u=e.x,p=e.y,f=e.options;a=(s=(0,n.__read)((0,o.rotateCoordinate)(a,l,null!==(c=d.angleRad)&&void 0!==c?c:0),2))[0],l=s[1];var m=d.widthPx,g=d.heightPx,h=d.leftPercent,v=d.rightPercent,y=d.topPercent,b=d.bottomPercent;if(void 0===h||void 0===v||void 0===y||void 0===b||void 0===r.leftPercent||void 0===r.rightPercent||void 0===r.topPercent||void 0===r.bottomPercent||void 0===m||void 0===g)return!1;var S=f.minWidth,C=f.minHeight,_=1-h-v,E=1-y-b;if(_>0&&E>0&&void 0!==S&&void 0!==C){var T=m/_,k=g/E,M="e"!=u?i(r.leftPercent,a,T,v,S):h,O="w"!=u?i(r.rightPercent,-a,T,h,S):v,P="s"!=p?i(r.topPercent,l,k,b,C):y,w="n"!=p?i(r.bottomPercent,-l,k,y,C):b;return d.leftPercent=M,d.rightPercent=O,d.topPercent=P,d.bottomPercent=w,d.widthPx=T*(1-M-O),d.heightPx=k*(1-P-w),!0}return!1}}},214:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImageEditPlugin=void 0;var n=r(1635),o=r(2338),i=r(1953),a=r(1030),l=r(7808),s=r(1088),c=r(3314),d=r(5599),u=r(4550),p=r(7302),f=r(4064),m=r(823),g=r(4116),h=r(4340),v=r(8707),y=r(2760),b=r(810),S=r(4990),C={borderColor:"#DB626C",minWidth:10,minHeight:10,preserveRatio:!0,disableRotate:!1,disableSideResize:!1,onSelectState:["resize","rotate"]},_="_dragging",E="imageEdit",T="imageEditCaretColor",k=function(){function e(e){void 0===e&&(e=C),this.options=e,this.editor=null,this.shadowSpan=null,this.selectedImage=null,this.wrapper=null,this.imageEditInfo=null,this.imageHTMLOptions=null,this.dndHelpers=[],this.clonedImage=null,this.lastSrc=null,this.wasImageResized=!1,this.isCropMode=!1,this.resizers=[],this.rotators=[],this.croppers=[],this.zoomScale=1,this.disposer=null,this.isEditing=!1}return e.prototype.getName=function(){return"ImageEdit"},e.prototype.initialize=function(e){var t=this;this.editor=e,this.disposer=e.attachDomEvent({blur:{beforeDispatch:function(){t.editor&&t.applyFormatWithContentModel(t.editor,t.isCropMode,!0)}},dragstart:{beforeDispatch:function(e){if(t.editor){var r=e.target;t.isImageSelection(r)&&(r.id=r.id+_)}}}})},e.prototype.dispose=function(){this.editor=null,this.isEditing=!1,this.cleanInfo(),this.disposer&&(this.disposer(),this.disposer=null)},e.prototype.onPluginEvent=function(e){if(this.editor)switch(e.eventType){case"mouseDown":this.mouseDownHandler(this.editor,e);break;case"mouseUp":this.mouseUpHandler(this.editor,e);break;case"keyDown":this.keyDownHandler(this.editor,e);break;case"contentChanged":e.source==S.ChangeSource.Drop&&this.onDropHandler(this.editor)}},e.prototype.isImageSelection=function(e){return(0,S.isNodeOfType)(e,"ELEMENT_NODE")&&((0,S.isElementOfType)(e,"img")||!!((0,S.isElementOfType)(e,"span")&&e.firstElementChild&&(0,S.isNodeOfType)(e.firstElementChild,"ELEMENT_NODE")&&(0,S.isElementOfType)(e.firstElementChild,"img")))},e.prototype.mouseUpHandler=function(e,t){var r=e.getDOMSelection();if(r&&"image"==r.type||this.isEditing){var n=this.isImageSelection(t.rawEvent.target)&&2===t.rawEvent.button;this.applyFormatWithContentModel(e,this.isCropMode,n)}},e.prototype.mouseDownHandler=function(e,t){this.isEditing&&this.isImageSelection(t.rawEvent.target)&&2!==t.rawEvent.button&&this.applyFormatWithContentModel(e,this.isCropMode,this.shadowSpan===t.rawEvent.target)},e.prototype.onDropHandler=function(e){var t=e.getDOMSelection();"image"==(null==t?void 0:t.type)&&e.formatContentModel((function(e){var r=(0,c.findEditingImage)(e,t.image.id),n=(0,c.findEditingImage)(e,t.image.id.replace(_,"").trim());if(r&&n){var o=r.paragraph.segments.indexOf(r.image);(0,S.mutateBlock)(r.paragraph).segments.splice(o,1);var i=n.image,a=n.paragraph;return(0,S.mutateSegment)(a,i,(function(e){e.isSelected=!0,e.isSelectedAsImageSelection=!0})),!0}return!1}))},e.prototype.keyDownHandler=function(e,t){this.isEditing&&("Escape"===t.rawEvent.key||"Delete"===t.rawEvent.key||"Backspace"===t.rawEvent.key?("Escape"===t.rawEvent.key&&this.removeImageWrapper(),this.cleanInfo()):this.applyFormatWithContentModel(e,this.isCropMode,!0,!1))},e.prototype.applyFormatWithContentModel=function(e,t,r,n){var i,a=this,l=e.getDOMSelection();e.formatContentModel((function(s){var d=(0,p.getSelectedImage)(s),u=n?d:(0,c.findEditingImage)(s),m=!1;if(r||(null==u?void 0:u.image)!=(null==d?void 0:d.image)||(null==u?void 0:u.image.dataset.isEditing)||n){var h=a,v=h.lastSrc,y=h.selectedImage,b=h.imageEditInfo,C=h.clonedImage;(a.isEditing||n)&&u&&v&&y&&b&&C&&((0,S.mutateSegment)(u.paragraph,u.image,(function(t){(0,o.applyChange)(e,y,t,b,v,a.wasImageResized||a.isCropMode,C),t.isSelected=r,t.isSelectedAsImageSelection=r,delete t.dataset.isEditing,"range"!=(null==l?void 0:l.type)||l.range.collapsed||(0,S.getSelectedParagraphs)(s,!0).some((function(e){return e.segments.includes(t)}))&&(t.isSelected=!0)})),r&&(0,g.normalizeImageSelection)(u),a.cleanInfo(),m=!0),a.isEditing=!1,a.isCropMode=!1,!d||"image"!=(null==l?void 0:l.type)||r||n||(a.isEditing=!0,a.isCropMode=t,(0,S.mutateSegment)(d.paragraph,d.image,(function(e){i=e,a.imageEditInfo=(0,f.updateImageEditInfo)(e,l.image),e.dataset.isEditing="true"})),m=!0)}return m}),{onNodeCreated:function(r,o){!n&&i&&i==r&&i.dataset.isEditing&&(0,S.isNodeOfType)(o,"ELEMENT_NODE")&&(0,S.isElementOfType)(o,"img")&&(t?a.startCropMode(e,o):a.startRotateAndResize(e,o))}},{tryGetFromCache:!0})},e.prototype.startEditing=function(e,t,r){this.imageEditInfo||(this.imageEditInfo=(0,f.getSelectedImageMetadata)(e,t)),this.lastSrc=t.getAttribute("src"),this.imageHTMLOptions=(0,u.getHTMLImageOptions)(e,this.options,this.imageEditInfo);var n=(0,l.createImageWrapper)(e,t,this.options,this.imageEditInfo,this.imageHTMLOptions,r),o=n.resizers,i=n.rotators,s=n.wrapper,c=n.shadowSpan,d=n.imageClone,p=n.croppers;this.shadowSpan=c,this.selectedImage=t,this.wrapper=s,this.clonedImage=d,this.wasImageResized=(0,a.checkIfImageWasResized)(t),this.resizers=o,this.rotators=i,this.croppers=p,this.zoomScale=e.getDOMHelper().calculateZoomScale(),e.setEditorStyle(E,"outline-style:none!important;",["span:has(>img"+(0,S.getSafeIdSelector)(this.selectedImage.id)+")"]),e.setEditorStyle(T,"caret-color: transparent;")},e.prototype.startRotateAndResize=function(e,t){var r,o=this;if(this.imageEditInfo&&(this.startEditing(e,t,["resize","rotate"]),this.selectedImage&&this.imageEditInfo&&this.wrapper&&this.clonedImage)){var i=!!e.getEnvironment().isMobileOrTablet;this.dndHelpers=(0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)((0,d.getDropAndDragHelpers)(this.wrapper,this.imageEditInfo,this.options,m.ImageEditElementClass.ResizeHandle,h.Resizer,(function(){o.imageEditInfo&&o.selectedImage&&o.wrapper&&o.clonedImage&&((0,b.updateWrapper)(o.imageEditInfo,o.options,o.selectedImage,o.clonedImage,o.wrapper,o.resizers),o.wasImageResized=!0)}),this.zoomScale,i)),!1),(0,n.__read)((0,d.getDropAndDragHelpers)(this.wrapper,this.imageEditInfo,this.options,m.ImageEditElementClass.RotateHandle,v.Rotator,(function(){var t;o.imageEditInfo&&o.selectedImage&&o.wrapper&&o.clonedImage&&((0,b.updateWrapper)(o.imageEditInfo,o.options,o.selectedImage,o.clonedImage,o.wrapper),o.updateRotateHandleState(e,o.selectedImage,o.wrapper,o.rotators,null===(t=o.imageEditInfo)||void 0===t?void 0:t.angleRad))}),this.zoomScale,i)),!1),(0,b.updateWrapper)(this.imageEditInfo,this.options,this.selectedImage,this.clonedImage,this.wrapper,this.resizers),this.updateRotateHandleState(e,this.selectedImage,this.wrapper,this.rotators,null===(r=this.imageEditInfo)||void 0===r?void 0:r.angleRad)}},e.prototype.updateRotateHandleState=function(e,t,r,n,o){var i=e.getVisibleViewport(),l=(0,a.isASmallImage)(t.width,t.height);if(i&&n&&n.length>0){var s=n[0],c=s.firstElementChild;(0,S.isNodeOfType)(c,"ELEMENT_NODE")&&(0,S.isElementOfType)(c,"div")&&(0,y.updateRotateHandle)(i,null!=o?o:0,r,s,c,l)}},e.prototype.isOperationAllowed=function(e){return"resize"===e||"rotate"===e||"flip"===e||"crop"===e},e.prototype.canRegenerateImage=function(e){return(0,i.canRegenerateImage)(e)},e.prototype.startCropMode=function(e,t){var r=this;this.imageEditInfo&&(this.startEditing(e,t,["crop"]),this.imageEditInfo&&this.selectedImage&&this.wrapper&&this.clonedImage&&(this.dndHelpers=(0,n.__spreadArray)([],(0,n.__read)((0,d.getDropAndDragHelpers)(this.wrapper,this.imageEditInfo,this.options,m.ImageEditElementClass.CropHandle,s.Cropper,(function(){r.imageEditInfo&&r.selectedImage&&r.wrapper&&r.clonedImage&&((0,b.updateWrapper)(r.imageEditInfo,r.options,r.selectedImage,r.clonedImage,r.wrapper,void 0,r.croppers),r.isCropMode=!0)}),this.zoomScale,!!e.getEnvironment().isMobileOrTablet)),!1),(0,b.updateWrapper)(this.imageEditInfo,this.options,this.selectedImage,this.clonedImage,this.wrapper,void 0,this.croppers)))},e.prototype.cropImage=function(){if(this.editor){this.editor.getEnvironment().isSafari||this.editor.focus();var e=this.editor.getDOMSelection();"image"==(null==e?void 0:e.type)&&this.applyFormatWithContentModel(this.editor,!0,!1)}},e.prototype.editImage=function(e,t,r,n){this.startEditing(e,t,r),this.selectedImage&&this.imageEditInfo&&this.wrapper&&this.clonedImage&&(n(this.imageEditInfo),(0,b.updateWrapper)(this.imageEditInfo,this.options,this.selectedImage,this.clonedImage,this.wrapper),this.applyFormatWithContentModel(e,!1,!0,!0))},e.prototype.cleanInfo=function(){var e,t;null===(e=this.editor)||void 0===e||e.setEditorStyle(E,null),null===(t=this.editor)||void 0===t||t.setEditorStyle(T,null),this.selectedImage=null,this.shadowSpan=null,this.wrapper=null,this.imageEditInfo=null,this.imageHTMLOptions=null,this.dndHelpers.forEach((function(e){return e.dispose()})),this.dndHelpers=[],this.clonedImage=null,this.lastSrc=null,this.wasImageResized=!1,this.isCropMode=!1,this.resizers=[],this.rotators=[],this.croppers=[]},e.prototype.removeImageWrapper=function(){var e=null;return this.shadowSpan&&this.shadowSpan.parentElement&&(this.shadowSpan.firstElementChild&&(0,S.isNodeOfType)(this.shadowSpan.firstElementChild,"ELEMENT_NODE")&&(0,S.isElementOfType)(this.shadowSpan.firstElementChild,"img")&&(e=this.shadowSpan.firstElementChild),(0,S.unwrap)(this.shadowSpan),this.shadowSpan=null,this.wrapper=null),e},e.prototype.flipImage=function(e){var t,r=null===(t=this.editor)||void 0===t?void 0:t.getDOMSelection();if(this.editor&&r&&"image"===r.type){var n=r.image;this.editor&&this.editImage(this.editor,n,["flip"],(function(t){var r=t.angleRad||0;r>=Math.PI/2&&r<3*Math.PI/4||r<=-Math.PI/2&&r>-3*Math.PI/4?"horizontal"===e?t.flippedVertical=!t.flippedVertical:t.flippedHorizontal=!t.flippedHorizontal:"vertical"===e?t.flippedVertical=!t.flippedVertical:t.flippedHorizontal=!t.flippedHorizontal}))}},e.prototype.rotateImage=function(e){var t,r=null===(t=this.editor)||void 0===t?void 0:t.getDOMSelection();if(this.editor&&r&&"image"===r.type){var n=r.image;this.editor&&this.editImage(this.editor,n,[],(function(t){t.angleRad=(t.angleRad||0)+e}))}},e}();t.ImageEditPlugin=k},8864:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createImageResizer=void 0;var n=r(1635),o=r(3890),i=r(823),a=r(4990),l=r(6639);t.createImageResizer=function(e,t){var r=function(e){var t=[];return l.Xs.forEach((function(r){return l.Ys.forEach((function(n){var o=""==r==(""==n)?c(r,n):null;e&&o&&e(o,r,n),o&&t.push(o)}))})),t}(t),i=function(e){var t=[];return l.Xs.forEach((function(r){return l.Ys.forEach((function(n){var o=""==r!=(""==n)?c(r,n):null;e&&o&&e(o,r,n),o&&t.push(o)}))})),t}(t);return(0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(r),!1),(0,n.__read)(i),!1).map((function(t){var r=(0,o.createElement)(t,e);if((0,a.isNodeOfType)(r,"ELEMENT_NODE")&&(0,a.isElementOfType)(r,"div"))return r})).filter((function(e){return!!e}))};var s=function(e,t,r){return"position:relative;width:10px;height:10px;background-color: #FFFFFF;cursor:"+e+"-resize;"+t+":-6px;"+r+":-6px;border-radius:100%;border: 2px solid #bfbfbf;box-shadow: 0px 0.36316px 1.36185px rgba(100, 100, 100, 0.25);"};function c(e,t){var r="w"==e?"left":"right",n="n"==t?"top":"bottom";return""==e&&""==t?null:{tag:"div",style:"position:absolute;"+r+":"+(""==e?"50%":"0px")+";"+n+":"+(""==t?"50%":"0px"),children:[{tag:"div",style:s(t+e,n,r),className:i.ImageEditElementClass.ResizeHandle,dataset:{x:e,y:t}}]}}},4340:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Resizer=void 0;var n=r(1635),o=r(1030);t.Resizer={onDragStart:function(e){var t=e.editInfo;return(0,n.__assign)({},t)},onDragging:function(e,t,r,i,a){var l,s,c=e.x,d=e.y,u=e.editInfo,p=e.options;if(r.heightPx&&r.widthPx&&void 0!==p.minWidth&&void 0!==p.minHeight){var f=r.widthPx>0&&r.heightPx>0?1*r.widthPx/r.heightPx:0;i=(l=(0,n.__read)((0,o.rotateCoordinate)(i,a,null!==(s=u.angleRad)&&void 0!==s?s:0),2))[0],a=l[1];var m=""==c,g=""==d,h=!(m||g)&&(p.preserveRatio||t.shiftKey),v=m?r.widthPx:Math.max(r.widthPx+i*("w"==c?-1:1),p.minWidth),y=g?r.heightPx:Math.max(r.heightPx+a*("n"==d?-1:1),p.minHeight);return h&&f>0&&(f>1?(v=y*f)<p.minWidth&&(y=(v=p.minWidth)/f):(y=v/f)<p.minHeight&&(v=(y=p.minHeight)*f)),u.widthPx=v,u.heightPx=y,!0}return!1}}},4632:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateSideHandlesVisibility=void 0,t.updateSideHandlesVisibility=function(e,t){e.forEach((function(e){var r=e.dataset,n=r.y,o=r.x,i=["n","s","e","w"].indexOf((null!=n?n:"")+(null!=o?o:""))>-1;e.style.display=i&&t?"none":""}))}},7046:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createImageRotator=void 0;var n=r(3890),o=r(823),i=r(4990),a=r(6639);function l(e){var t;return{tag:"svg",namespace:"http://www.w3.org/2000/svg",style:"width:16px;height:16px;margin: "+a.ROTATE_ICON_MARGIN+"px "+a.ROTATE_ICON_MARGIN+"px",children:[{tag:"path",namespace:"http://www.w3.org/2000/svg",attributes:(t={d:"M 10.5,10.0 A 3.8,3.8 0 1 1 6.7,6.3",transform:"matrix(1.1 1.1 -1.1 1.1 11.6 -10.8)"},t["fill-opacity"]="0",t.stroke=e,t)},{tag:"path",namespace:"http://www.w3.org/2000/svg",attributes:{d:"M12.0 3.648l.884-.884.53 2.298-2.298-.53z",stroke:e}}]}}t.createImageRotator=function(e,t){return(r=t,s=r.borderColor,c=r.rotateHandleBackColor,d=a.ROTATE_SIZE/2,[{tag:"div",className:o.ImageEditElementClass.RotateCenter,style:"position:absolute;left:50%;width:1px;background-color:"+s+";top:"+-a.ROTATE_HANDLE_TOP+"px;height:"+a.ROTATE_GAP+"px;margin-left:"+-a.ROTATE_WIDTH+"px;",children:[{tag:"div",className:o.ImageEditElementClass.RotateHandle,style:"position:absolute;background-color:"+c+";border:solid 1px "+s+";border-radius:50%;width:"+a.ROTATE_SIZE+"px;height:"+a.ROTATE_SIZE+"px;left:-"+(d+a.ROTATE_WIDTH)+"px;cursor:move;top:"+-a.ROTATE_SIZE+"px;line-height: 0px;",children:[l(s)]}]}]).map((function(t){var r=(0,n.createElement)(t,e);if((0,i.isNodeOfType)(r,"ELEMENT_NODE")&&(0,i.isElementOfType)(r,"div"))return r})).filter((function(e){return!!e}));var r,s,c,d}},8707:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Rotator=void 0;var n=r(1635),o=r(6639);t.Rotator={onDragStart:function(e){var t=e.editInfo;return(0,n.__assign)({},t)},onDragging:function(e,t,r,n,i){var a,l,s=e.editInfo,c=e.options;if(s.heightPx){var d=s.heightPx/2+o.DEFAULT_ROTATE_HANDLE_HEIGHT,u=d*Math.sin(null!==(a=r.angleRad)&&void 0!==a?a:0)+n,p=d*Math.cos(null!==(l=r.angleRad)&&void 0!==l?l:0)-i,f=Math.atan2(u,p);if(!t.altKey&&c&&void 0!==c.minRotateDeg){var m=f*o.DEG_PER_RAD;f=Math.round(m/c.minRotateDeg)*c.minRotateDeg/o.DEG_PER_RAD}if(s.angleRad!=f)return s.angleRad=f,!0}return!1}}},2760:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateRotateHandle=void 0;var n=r(6639);t.updateRotateHandle=function(e,t,r,o,i,a){if(a)return o.style.display="none",void(i.style.display="none");o.style.display="",i.style.display="";var l=o.getBoundingClientRect(),s=r.getBoundingClientRect(),c=n.ROTATE_SIZE+n.ROTATE_GAP+n.RESIZE_HANDLE_MARGIN;if(l&&s){var d=Number.MAX_SAFE_INTEGER,u=t*n.DEG_PER_RAD;if(u<45&&u>-45&&s.top-e.top<c)d=l.top-e.top;else if(u<=-80&&u>=-100&&s.left-e.left<c)d=l.left-e.left;else if(u>=80&&u<=100&&e.right-s.right<c){var p=l.right-e.right;d=Math.min(e.right-s.right,p)}else if((u<=-160||u>=160)&&e.bottom-s.bottom<c){var f=l.bottom-e.bottom;d=Math.min(e.bottom-s.bottom,f)}var m=Math.max(Math.min(n.ROTATE_GAP,d),0),g=Math.max(Math.min(n.ROTATE_SIZE,d-m),0);o.style.top=-m-n.RESIZE_HANDLE_MARGIN+"px",o.style.height=m+"px",i.style.top=-g+"px"}}},6639:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RESIZE_IMAGE=t.MIN_HEIGHT_WIDTH=t.YS_CROP=t.XS_CROP=t.CROP_HANDLE_WIDTH=t.CROP_HANDLE_SIZE=t.ROTATE_HANDLE_TOP=t.ROTATE_WIDTH=t.Ys=t.Xs=t.ROTATION=t.ROTATE_ICON_MARGIN=t.DEFAULT_ROTATE_HANDLE_HEIGHT=t.DEG_PER_RAD=t.ROTATE_GAP=t.ROTATE_SIZE=t.RESIZE_HANDLE_MARGIN=t.RESIZE_HANDLE_SIZE=void 0,t.RESIZE_HANDLE_SIZE=10,t.RESIZE_HANDLE_MARGIN=6,t.ROTATE_SIZE=32,t.ROTATE_GAP=15,t.DEG_PER_RAD=180/Math.PI,t.DEFAULT_ROTATE_HANDLE_HEIGHT=t.ROTATE_SIZE/2+t.ROTATE_GAP,t.ROTATE_ICON_MARGIN=8,t.ROTATION={sw:0,nw:90,ne:180,se:270},t.Xs=["w","","e"],t.Ys=["s","","n"],t.ROTATE_WIDTH=1,t.ROTATE_HANDLE_TOP=t.ROTATE_GAP+t.RESIZE_HANDLE_MARGIN,t.CROP_HANDLE_SIZE=22,t.CROP_HANDLE_WIDTH=7,t.XS_CROP=["w","e"],t.YS_CROP=["s","n"],t.MIN_HEIGHT_WIDTH=3*t.RESIZE_HANDLE_SIZE+2*t.RESIZE_HANDLE_MARGIN,t.RESIZE_IMAGE="resizeImage"},823:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ImageEditElementClass=void 0,(r=t.ImageEditElementClass||(t.ImageEditElementClass={})).ResizeHandle="r_resizeH",r.RotateHandle="r_rotateH",r.RotateCenter="r_rotateC",r.CropOverlay="r_cropO",r.CropContainer="r_cropC",r.CropHandle="r_cropH"},2338:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyChange=void 0;var n=r(5157),o=r(8782),i=r(675),a=r(4064);t.applyChange=function(e,t,r,l,s,c,d){var u,p="",f=null!=d?d:t,m=null!==(u=(0,a.updateImageEditInfo)(r,f))&&void 0!==u?u:void 0,g=(0,n.checkEditInfoState)(l,m);switch(g){case"ResizeOnly":p=l.src||"";break;case"SameWithLast":p=s;break;case"FullyChanged":p=(0,o.generateDataURL)(null!=d?d:t,l)}p!=s&&(p=e.triggerEvent("editImage",{image:t,originalSrc:l.src||t.src,previousSrc:s,newSrc:p}).newSrc),p==l.src?(0,a.updateImageEditInfo)(r,f,null):(0,a.updateImageEditInfo)(r,f,l);var h=(0,i.getGeneratedImageSize)(l);h&&(r.src=p,(c||"FullyChanged"==g)&&(r.format.width=h.targetWidth+"px",r.format.height=h.targetHeight+"px"))}},1953:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canRegenerateImage=void 0,t.canRegenerateImage=function(e){if(!e)return!1;try{var t=e.ownerDocument.createElement("canvas");t.width=10,t.height=10;var r=t.getContext("2d");return!!r&&(r.drawImage(e,0,0),r.getImageData(0,0,1,1),!0)}catch(e){return!1}}},5157:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkEditInfoState=void 0;var n=r(1635),o=["angleRad"],i=["leftPercent","rightPercent","topPercent","bottomPercent"],a=(0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(o),!1),(0,n.__read)(i),!1),l=(0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(a),!1),(0,n.__read)(["widthPx","heightPx"]),!1);function s(e,t){return null!=e&&null!=t&&Math.abs(e-t)<.001}t.checkEditInfoState=function(e,t){return e&&e.src&&!l.some((function(t){return!("number"==typeof e[t])}))?!a.every((function(t){return s(e[t],0)}))||e.flippedHorizontal||e.flippedVertical||t&&(!t||e.angleRad!==t.angleRad)?t&&o.every((function(t){return s(e[t],0)}))&&o.every((function(e){return s(t[e],0)}))&&i.every((function(r){return s(e[r],t[r])}))&&t.flippedHorizontal===e.flippedHorizontal&&t.flippedVertical===e.flippedVertical?"SameWithLast":"FullyChanged":"ResizeOnly":"Invalid"}},7808:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createImageWrapper=void 0;var n=r(3378),o=r(8864),i=r(7046),a=r(4990);t.createImageWrapper=function(e,t,r,c,u,p){var f=d(t,c),m=e.getDocument(),g=[];!r.disableRotate&&p.indexOf("rotate")>-1&&(g=(0,i.createImageRotator)(m,u));var h=[];p.indexOf("resize")>-1&&(h=(0,o.createImageResizer)(m));var v=[];p.indexOf("crop")>-1&&(v=(0,n.createImageCropper)(m));var y=s(e,f,r,c,h,g,v),b=(0,a.wrap)(m,t,"span");return{wrapper:y,shadowSpan:l(y,b),imageClone:f,resizers:h,rotators:g,croppers:v}};var l=function(e,t){var r=t.attachShadow({mode:"open"});return t.style.verticalAlign="bottom",r.appendChild(e),t},s=function(e,t,r,n,o,i,a){var l,s=e.getDocument(),d=s.createElement("span"),u=s.createElement("div");u.setAttribute("style","position:relative;width:100%;height:100%;overflow:hidden;transform:scale(1);"),u.appendChild(t),d.setAttribute("style","font-size: 24px; margin: 0px; transform: rotate("+(null!==(l=n.angleRad)&&void 0!==l?l:0)+"rad);"),d.style.display=e.getEnvironment().isSafari?"-webkit-inline-flex":"inline-flex";var p=c(e,r.borderColor);return d.appendChild(u),d.appendChild(p),d.style.userSelect="none",o&&(null==o?void 0:o.length)>0&&o.forEach((function(e){d.appendChild(e)})),i&&i.length>0&&i.forEach((function(e){d.appendChild(e)})),a&&a.length>0&&a.forEach((function(e){d.appendChild(e)})),d},c=function(e,t){var r=e.getDocument().createElement("div");return r.setAttribute("style","position:absolute;left:0;right:0;top:0;bottom:0;border:solid 2px "+t+";pointer-events:none;"),r},d=function(e,t){var r=e.cloneNode(!0);return r.style.removeProperty("transform"),t.src&&(r.src=t.src,r.removeAttribute("id"),r.style.removeProperty("max-width"),r.style.removeProperty("max-height"),r.style.width=t.widthPx+"px",r.style.height=t.heightPx+"px"),r}},2981:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.doubleCheckResize=void 0,t.doubleCheckResize=function(e,t,r,n){var o=e.widthPx,i=e.heightPx;if(null!=o&&null!=i){var a=i>0?o/i:0;r=Math.floor(r),n=Math.floor(n),o=Math.floor(o),i=Math.floor(i),e.widthPx=r,e.heightPx=n,t&&a>0&&(o!==r||i!==n)&&(r<o?e.heightPx=r/a:e.widthPx=n*a)}}},3314:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findEditingImage=void 0;var n=r(1635);function o(e,t){for(var r=0;r<e.blocks.length;r++){var n=e.blocks[r];switch(n.blockType){case"BlockGroup":var a=o(n,t);if(a)return a;break;case"Paragraph":for(var l=0;l<n.segments.length;l++){var s=n.segments[l];switch(s.segmentType){case"Image":if(t&&s.format.id==t||s.dataset.isEditing)return{paragraph:n,image:s};break;case"General":var c=o(s,t);if(c)return c}}break;case"Table":var d=i(n,t);if(d)return d}}return null}t.findEditingImage=o;var i=function(e,t){var r,i,a,l;try{for(var s=(0,n.__values)(e.rows),c=s.next();!c.done;c=s.next()){var d=c.value;try{for(var u=(a=void 0,(0,n.__values)(d.cells)),p=u.next();!p.done;p=u.next()){var f=o(p.value,t);if(f)return f}}catch(e){a={error:e}}finally{try{p&&!p.done&&(l=u.return)&&l.call(u)}finally{if(a)throw a.error}}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return null}},8782:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateDataURL=void 0;var n=r(675);t.generateDataURL=function(e,t){var r=(0,n.getGeneratedImageSize)(t);if(!r)return"";var o=t.angleRad,i=t.widthPx,a=t.heightPx,l=t.bottomPercent,s=t.leftPercent,c=t.rightPercent,d=t.topPercent,u=t.naturalWidth,p=o||0,f=s||0,m=c||0,g=d||0,h=l||0,v=t.naturalHeight||e.naturalHeight,y=u||e.naturalHeight,b=i||e.clientWidth,S=a||e.clientHeight,C=y*(1-f-m),_=v*(1-g-h),E=window.devicePixelRatio||1,T=document.createElement("canvas"),k=r.targetWidth,M=r.targetHeight;T.width=k*E,T.height=M*E;var O=T.getContext("2d");return O&&(O.scale(E,E),O.translate(k/2,M/2),O.rotate(p),O.scale(t.flippedHorizontal?-1:1,t.flippedVertical?-1:1),O.drawImage(e,y*f,v*g,C,_,-b/2,-S/2,b,S)),T.toDataURL("image/png",1)}},675:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getGeneratedImageSize=void 0,t.getGeneratedImageSize=function(e,t){var r=e.widthPx,n=e.heightPx,o=e.angleRad,i=e.leftPercent,a=e.rightPercent,l=e.topPercent,s=e.bottomPercent;if(null!=n&&null!=r&&null!=i&&null!=a&&null!=l&&null!=s){var c=null!=o?o:0,d=r/(1-i-a),u=n/(1-l-s),p=t?d:r,f=t?u:n;return{targetWidth:Math.abs(p*Math.cos(c))+Math.abs(f*Math.sin(c)),targetHeight:Math.abs(p*Math.sin(c))+Math.abs(f*Math.cos(c)),originalWidth:d,originalHeight:u,visibleWidth:p,visibleHeight:f}}}},5599:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDropAndDragHelpers=void 0;var n=r(6782),o=r(4990);t.getDropAndDragHelpers=function(e,t,r,i,a,l,s,c){return function(e,t){return(0,o.toArray)(e.querySelectorAll("."+t))}(e,i).map((function(e){return new n.DragAndDropHelper(e,{editInfo:t,options:r,elementClass:i,x:e.dataset.x,y:e.dataset.y},l,a,s,c)}))}},4550:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getHTMLImageOptions=void 0;var n=r(1030),o="white",i="#333";t.getHTMLImageOptions=function(e,t,r){var a,l;return{borderColor:t.borderColor||(e.isDarkMode()?i:o),rotateHandleBackColor:e.isDarkMode()?i:o,isSmallImage:(0,n.isASmallImage)(null!==(a=r.widthPx)&&void 0!==a?a:0,null!==(l=r.heightPx)&&void 0!==l?l:0)}}},7302:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSelectedImage=void 0;var n=r(4990);t.getSelectedImage=function(e){var t=(0,n.getSelectedSegmentsAndParagraphs)(e,!1);return 1==t.length&&"Image"==t[0][0].segmentType&&t[0][1]?{image:t[0][0],paragraph:t[0][1]}:null}},1030:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isRTL=t.checkIfImageWasResized=t.setSize=t.setWrapperSizeDimensions=t.setFlipped=t.rotateCoordinate=t.isASmallImage=t.getPx=void 0;var n=r(6639);function o(e){return e+"px"}function i(e){var t="string"==typeof e?parseInt(e):e;return!isNaN(t)}t.getPx=o,t.isASmallImage=function(e,t){return!!(e&&t&&(e<n.MIN_HEIGHT_WIDTH||t<n.MIN_HEIGHT_WIDTH))},t.rotateCoordinate=function(e,t,r){if(0==e&&0==t)return[0,0];var n=Math.sqrt(e*e+t*t);return r=Math.atan2(t,e)-r,[n*Math.cos(r),n*Math.sin(r)]},t.setFlipped=function(e,t,r){e&&(e.style.transform="scale("+(t?-1:1)+", "+(r?-1:1)+")")},t.setWrapperSizeDimensions=function(e,t,r,n){if(t.style.borderStyle){var i=t.style.borderWidth?2*parseInt(t.style.borderWidth):2;return e.style.width=o(r+i),void(e.style.height=o(n+i))}e.style.width=o(r),e.style.height=o(n)},t.setSize=function(e,t,r,n,i,a,l){e.style.left=void 0!==t?o(t):e.style.left,e.style.top=void 0!==r?o(r):e.style.top,e.style.right=void 0!==n?o(n):e.style.right,e.style.bottom=void 0!==i?o(i):e.style.bottom,e.style.width=void 0!==a?o(a):e.style.width,e.style.height=void 0!==l?o(l):e.style.height},t.checkIfImageWasResized=function(e){var t=e.style;return!(""!==t.maxWidth&&"initial"!==t.maxWidth&&"auto"!==t.maxWidth||!i(t.height)&&!i(t.width))},t.isRTL=function(e){return"rtl"===window.getComputedStyle(e).direction}},4116:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeImageSelection=void 0;var n=r(4990);t.normalizeImageSelection=function(e){var t=e.paragraph,r=t.segments.indexOf(e.image);if(r>0){var o=t.segments[r-1],i=t.segments[r+1];if(o&&i&&"SelectionMarker"==i.segmentType&&"SelectionMarker"==o.segmentType&&i.isSelected&&o.isSelected){var a=(0,n.mutateBlock)(t);a.segments.splice(r-1,1),a.segments.splice(r,1)}return e}}},669:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateHandleCursor=void 0;var r=Math.PI,n=2*r/8,o=["nw","n","ne","e","se","s","sw","w"];t.updateHandleCursor=function(e,t){e.forEach((function(e){var r=e.dataset,i=r.y,a=r.x;e.style.cursor=function(e,t,r){void 0===t&&(t=""),void 0===r&&(r="");var i=function(e){var t=Math.round(e/n)%8;return t<0?t+8:t}(e),a=t+r,l=o.indexOf(a),s=l>=0&&l+i;return s?o[s%8]:""}(t,i,a)+"-resize"}))}},4064:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSelectedImageMetadata=t.updateImageEditInfo=void 0;var n=r(1635),o=r(7302),i=r(4990);function a(e,t,r){var o=(0,i.updateImageMetadata)(e,void 0!==r?function(e){return r}:void 0);return(0,n.__assign)((0,n.__assign)({},l(t)),o)}function l(e){return{src:e.getAttribute("src")||"",widthPx:e.clientWidth,heightPx:e.clientHeight,naturalWidth:e.naturalWidth,naturalHeight:e.naturalHeight,leftPercent:0,rightPercent:0,topPercent:0,bottomPercent:0,angleRad:0}}t.updateImageEditInfo=a,t.getSelectedImageMetadata=function(e,t){var r=l(t);return e.formatContentModel((function(e){var n=(0,o.getSelectedImage)(e);return!!(null==n?void 0:n.image)&&((0,i.mutateSegment)(n.paragraph,null==n?void 0:n.image,(function(e){r=a(e,t)})),!0)})),r}},810:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateWrapper=void 0;var n=r(2981),o=r(675),i=r(823),a=r(4990),l=r(669),s=r(4632),c=r(1030);t.updateWrapper=function(e,t,r,d,u,p,f){var m=e.angleRad,g=e.bottomPercent,h=e.leftPercent,v=e.rightPercent,y=e.topPercent,b=e.flippedHorizontal,S=e.flippedVertical,C=(0,o.getGeneratedImageSize)(e,f&&(null==f?void 0:f.length)>0);if(C){var _=C.targetWidth,E=C.targetHeight,T=C.originalWidth,k=C.originalHeight,M=C.visibleWidth,O=C.visibleHeight,P=(_-M)/2,w=(E-O)/2,x=T*(h||0),D=T*(v||0),L=k*(y||0),I=k*(g||0);u.style.margin=w+"px "+P+"px",u.style.transform="rotate("+m+"rad)",(0,c.setWrapperSizeDimensions)(u,r,M,O),(0,c.isRTL)(d)?(u.style.textAlign="right",f||(d.style.left=(0,c.getPx)(x),d.style.right=(0,c.getPx)(-D))):u.style.textAlign="left",d.style.width=(0,c.getPx)(T),d.style.height=(0,c.getPx)(k),d.style.verticalAlign="bottom",d.style.position="absolute",(0,c.setFlipped)(d.parentElement,b,S);var F=(0,c.isASmallImage)(M,M);if(f||(d.style.margin=-L+"px 0 0 "+-x+"px"),f&&f.length>0){var R=f[0],N=f.filter((function(e){return e.className===i.ImageEditElementClass.CropOverlay}));(0,c.setSize)(R,x,L,D,I,void 0,void 0),(0,c.setSize)(N[0],0,0,D,void 0,void 0,L),(0,c.setSize)(N[1],void 0,0,0,I,D,void 0),(0,c.setSize)(N[2],x,void 0,0,0,void 0,I),(0,c.setSize)(N[3],0,L,void 0,0,x,void 0),void 0!==m&&(0,l.updateHandleCursor)(f,m)}if(p){var A=u.clientWidth,B=u.clientHeight;(0,n.doubleCheckResize)(e,t.preserveRatio||!1,A,B);var j=p.map((function(e){var t=e.firstElementChild;if((0,a.isNodeOfType)(t,"ELEMENT_NODE")&&(0,a.isElementOfType)(t,"div"))return t})).filter((function(e){return!!e}));void 0!==m&&(0,l.updateHandleCursor)(j,m),(0,s.updateSideHandlesVisibility)(j,F)}}}},6109:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImageEditPlugin=t.CustomReplacePlugin=t.PickerPlugin=t.HyperlinkPlugin=t.MarkdownPlugin=t.WatermarkPlugin=t.ContextMenuPluginBase=t.ShortcutPlugin=t.ShortcutOutdentList=t.ShortcutIndentList=t.ShortcutDecreaseFont=t.ShortcutIncreaseFont=t.ShortcutNumbering=t.ShortcutBullet=t.ShortcutRedoMacOS=t.ShortcutRedoAlt=t.ShortcutRedo=t.ShortcutUndo2=t.ShortcutUndo=t.ShortcutClearFormat=t.ShortcutUnderline=t.ShortcutItalic=t.ShortcutBold=t.AutoFormatPlugin=t.EditPlugin=t.DefaultSanitizers=t.PastePlugin=t.TableEditPlugin=void 0;var n=r(289);Object.defineProperty(t,"TableEditPlugin",{enumerable:!0,get:function(){return n.TableEditPlugin}});var o=r(5898);Object.defineProperty(t,"PastePlugin",{enumerable:!0,get:function(){return o.PastePlugin}});var i=r(2751);Object.defineProperty(t,"DefaultSanitizers",{enumerable:!0,get:function(){return i.DefaultSanitizers}});var a=r(9952);Object.defineProperty(t,"EditPlugin",{enumerable:!0,get:function(){return a.EditPlugin}});var l=r(3528);Object.defineProperty(t,"AutoFormatPlugin",{enumerable:!0,get:function(){return l.AutoFormatPlugin}});var s=r(8062);Object.defineProperty(t,"ShortcutBold",{enumerable:!0,get:function(){return s.ShortcutBold}}),Object.defineProperty(t,"ShortcutItalic",{enumerable:!0,get:function(){return s.ShortcutItalic}}),Object.defineProperty(t,"ShortcutUnderline",{enumerable:!0,get:function(){return s.ShortcutUnderline}}),Object.defineProperty(t,"ShortcutClearFormat",{enumerable:!0,get:function(){return s.ShortcutClearFormat}}),Object.defineProperty(t,"ShortcutUndo",{enumerable:!0,get:function(){return s.ShortcutUndo}}),Object.defineProperty(t,"ShortcutUndo2",{enumerable:!0,get:function(){return s.ShortcutUndo2}}),Object.defineProperty(t,"ShortcutRedo",{enumerable:!0,get:function(){return s.ShortcutRedo}}),Object.defineProperty(t,"ShortcutRedoAlt",{enumerable:!0,get:function(){return s.ShortcutRedoAlt}}),Object.defineProperty(t,"ShortcutRedoMacOS",{enumerable:!0,get:function(){return s.ShortcutRedoMacOS}}),Object.defineProperty(t,"ShortcutBullet",{enumerable:!0,get:function(){return s.ShortcutBullet}}),Object.defineProperty(t,"ShortcutNumbering",{enumerable:!0,get:function(){return s.ShortcutNumbering}}),Object.defineProperty(t,"ShortcutIncreaseFont",{enumerable:!0,get:function(){return s.ShortcutIncreaseFont}}),Object.defineProperty(t,"ShortcutDecreaseFont",{enumerable:!0,get:function(){return s.ShortcutDecreaseFont}}),Object.defineProperty(t,"ShortcutIndentList",{enumerable:!0,get:function(){return s.ShortcutIndentList}}),Object.defineProperty(t,"ShortcutOutdentList",{enumerable:!0,get:function(){return s.ShortcutOutdentList}});var c=r(6560);Object.defineProperty(t,"ShortcutPlugin",{enumerable:!0,get:function(){return c.ShortcutPlugin}});var d=r(9390);Object.defineProperty(t,"ContextMenuPluginBase",{enumerable:!0,get:function(){return d.ContextMenuPluginBase}});var u=r(4898);Object.defineProperty(t,"WatermarkPlugin",{enumerable:!0,get:function(){return u.WatermarkPlugin}});var p=r(1978);Object.defineProperty(t,"MarkdownPlugin",{enumerable:!0,get:function(){return p.MarkdownPlugin}});var f=r(634);Object.defineProperty(t,"HyperlinkPlugin",{enumerable:!0,get:function(){return f.HyperlinkPlugin}});var m=r(5532);Object.defineProperty(t,"PickerPlugin",{enumerable:!0,get:function(){return m.PickerPlugin}});var g=r(1862);Object.defineProperty(t,"CustomReplacePlugin",{enumerable:!0,get:function(){return g.CustomReplacePlugin}});var h=r(214);Object.defineProperty(t,"ImageEditPlugin",{enumerable:!0,get:function(){return h.ImageEditPlugin}})},1978:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MarkdownPlugin=void 0;var n=r(4363),o={strikethrough:!1,bold:!1,italic:!1},i=function(){function e(e){void 0===e&&(e=o),this.options=e,this.editor=null,this.shouldBold=!1,this.shouldItalic=!1,this.shouldStrikethrough=!1,this.shouldCode=!1,this.lastKeyTyped=null}return e.prototype.getName=function(){return"Markdown"},e.prototype.initialize=function(e){this.editor=e},e.prototype.dispose=function(){this.editor=null,this.disableAllFeatures(),this.lastKeyTyped=null},e.prototype.onPluginEvent=function(e){if(this.editor)switch(e.eventType){case"input":this.handleEditorInputEvent(this.editor,e);break;case"keyDown":this.handleBackspaceEvent(e),this.handleKeyDownEvent(e);break;case"contentChanged":this.handleContentChangedEvent(e)}},e.prototype.handleEditorInputEvent=function(e,t){var r=t.rawEvent,o=e.getDOMSelection();if(o&&"range"==o.type&&o.range.collapsed&&"insertText"==r.inputType)switch(r.data){case"*":this.options.bold&&(this.shouldBold?((0,n.setFormat)(e,"*",{fontWeight:"bold"}),this.shouldBold=!1):this.shouldBold=!0);break;case"~":this.options.strikethrough&&(this.shouldStrikethrough?((0,n.setFormat)(e,"~",{strikethrough:!0}),this.shouldStrikethrough=!1):this.shouldStrikethrough=!0);break;case"_":this.options.italic&&(this.shouldItalic?((0,n.setFormat)(e,"_",{italic:!0}),this.shouldItalic=!1):this.shouldItalic=!0);break;case"`":this.options.codeFormat&&(this.shouldCode?((0,n.setFormat)(e,"`",{},this.options.codeFormat),this.shouldCode=!1):this.shouldCode=!0)}},e.prototype.handleKeyDownEvent=function(e){var t=e.rawEvent;if(!e.handledByEditFeature&&!t.defaultPrevented)switch(t.key){case"Enter":this.disableAllFeatures(),this.lastKeyTyped=null;break;case" ":"*"===this.lastKeyTyped&&this.shouldBold?this.shouldBold=!1:"~"===this.lastKeyTyped&&this.shouldStrikethrough?this.shouldStrikethrough=!1:"_"===this.lastKeyTyped&&this.shouldItalic?this.shouldItalic=!1:"`"===this.lastKeyTyped&&this.shouldCode&&(this.shouldCode=!1),this.lastKeyTyped=null;break;default:this.lastKeyTyped=t.key}},e.prototype.handleBackspaceEvent=function(e){e.handledByEditFeature||"Backspace"!==e.rawEvent.key||("*"===this.lastKeyTyped&&this.shouldBold?this.shouldBold=!1:"~"===this.lastKeyTyped&&this.shouldStrikethrough?this.shouldStrikethrough=!1:"_"===this.lastKeyTyped&&this.shouldItalic?this.shouldItalic=!1:"`"===this.lastKeyTyped&&this.shouldCode&&(this.shouldCode=!1),this.lastKeyTyped=null)},e.prototype.handleContentChangedEvent=function(e){"Format"==e.source&&this.disableAllFeatures()},e.prototype.disableAllFeatures=function(){this.shouldBold=!1,this.shouldItalic=!1,this.shouldStrikethrough=!1,this.shouldCode=!1},e}();t.MarkdownPlugin=i},4363:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setFormat=void 0;var n=r(1635),o=r(5978);t.setFormat=function(e,t,r,i){(0,o.formatTextSegmentBeforeSelectionMarker)(e,(function(e,a,l,s,c){if(a.text[a.text.length-1]==t){var d=a.text,u=d.slice(0,-1);if(c.newPendingFormat=(0,n.__assign)((0,n.__assign)({},s),{strikethrough:!!s.strikethrough,italic:!!s.italic,fontWeight:(null==s?void 0:s.fontWeight)?"bold":void 0}),u.indexOf(t)>-1){var p=d.length,f=d.substring(0,p-1).lastIndexOf(t);if((!(g=d)[(h=f)-1]||0==g[h-1].trim().length)&&p-f>2){var m=(0,o.splitTextSegment)(a,l,f,p);return m.text=m.text.replace(t,"").slice(0,-1),m.format=(0,n.__assign)((0,n.__assign)({},m.format),r),i&&(m.code={format:i}),c.canUndoByBackspace=!0,!0}}}var g,h;return!1}))}},2751:(e,t)=>{"use strict";function r(e,t){var r=t.toLowerCase();return"div"==r||"p"==r?null:e}Object.defineProperty(t,"__esModule",{value:!0}),t.divParagraphSanitizer=t.DefaultSanitizers=void 0,t.DefaultSanitizers={width:r,height:r,"inline-size":r,"block-size":r},t.divParagraphSanitizer=r},1254:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.excelHandler=t.childProcessor=t.processPastedContentFromExcel=void 0;var n=r(1635),o=r(8080),i=r(4990),a=r(7506),l=/<\/\s*td\s*>((?!<\/\s*tr\s*>)[\s\S])*$/i,s=/<\/\s*tr\s*>((?!<\/\s*table\s*>)[\s\S])*$/i,c=/<tr[^>]*>[^<]*/i,d=/<table[^>]*>[^<]*/i,u="solid 1px #d4d4d4";function p(e,t){if(e.match(l)){var r=t.match(c);e=(r?r[0]:"<TR>")+e+"</TR>"}if(e.match(s)){var n=t.match(d);e=(n?n[0]:"<TABLE>")+e+"</TABLE>"}return e}t.processPastedContentFromExcel=function(e,r,n){var l=e.fragment,s=e.htmlBefore,c=e.clipboardData,d=c.html?p(c.html,s):void 0;if(d&&c.html!=d){var f=(new DOMParser).parseFromString(r(d),"text/html");(0,i.moveChildNodes)(l,null==f?void 0:f.body)}var m=l.firstChild;(0,i.isNodeOfType)(m,"ELEMENT_NODE")&&"div"==m.tagName&&m.firstChild&&Array.from(m.childNodes).every((function(e){var t=(0,i.isNodeOfType)(e,"ELEMENT_NODE")&&e.tagName;return"META"==t||"TABLE"==t&&e==m.lastChild}))&&m.lastChild&&e.fragment.replaceChildren(m.lastChild),(0,o.addParser)(e.domToModelOption,"tableCell",(function(e,t){n||"none"!==t.style.borderStyle||(e.borderBottom=u,e.borderLeft=u,e.borderRight=u,e.borderTop=u)})),(0,a.setProcessor)(e.domToModelOption,"child",t.childProcessor)},t.childProcessor=function(e,t,r){var o=(0,n.__assign)({},r.segmentFormat);"TableCell"===e.blockGroupType&&e.format.textColor&&!r.segmentFormat.textColor&&(r.segmentFormat.textColor=e.format.textColor),r.defaultElementProcessors.child(e,t,r),"TableCell"===e.blockGroupType&&e.format.textColor&&(r.segmentFormat=o,delete e.format.textColor)},t.excelHandler=p},5898:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PastePlugin=void 0;var n=r(1635),o=r(8080),i=r(4990),a=r(5769),l=r(2751),s=r(8003),c=r(1340),d=r(1281),u=r(3400),p=r(1254),f=r(4840),m=r(9138),g=r(6662),h=function(){function e(e,t){void 0===t&&(t={styleSanitizers:l.DefaultSanitizers,additionalAllowedTags:[],additionalDisallowedTags:[],attributeSanitizers:{}}),this.allowExcelNoBorderTable=e,this.domToModelForSanitizing=t,this.editor=null}return e.prototype.getName=function(){return"Paste"},e.prototype.initialize=function(e){this.editor=e},e.prototype.dispose=function(){this.editor=null},e.prototype.onPluginEvent=function(e){if(this.editor&&"beforePaste"==e.eventType&&e.domToModelOption){var t=(0,c.getPasteSource)(e,!1),r=e.pasteType;switch(t){case"wordDesktop":(0,m.processPastedContentFromWordDesktop)(e,this.editor.getTrustedHTMLHandler());break;case"wacComponents":(0,g.processPastedContentWacComponents)(e);break;case"excelOnline":case"excelDesktop":"normal"!==r&&"mergeFormat"!==r||(0,p.processPastedContentFromExcel)(e,this.editor.getTrustedHTMLHandler(),this.allowExcelNoBorderTable);break;case"googleSheets":e.domToModelOption.additionalAllowedTags.push(u.PastePropertyNames.GOOGLE_SHEET_NODE_NAME);break;case"powerPointDesktop":(0,f.processPastedContentFromPowerPoint)(e,this.editor.getTrustedHTMLHandler())}(0,o.addParser)(e.domToModelOption,"link",d.parseLink),(0,o.addParser)(e.domToModelOption,"tableCell",s.deprecatedBorderColorParser),(0,o.addParser)(e.domToModelOption,"tableCell",b),(0,o.addParser)(e.domToModelOption,"table",s.deprecatedBorderColorParser),"mergeFormat"===r&&((0,o.addParser)(e.domToModelOption,"block",v),(0,o.addParser)(e.domToModelOption,"listLevel",v)),this.setEventSanitizers(e)}},e.prototype.setEventSanitizers=function(e){var t,r;if(this.domToModelForSanitizing){var o=this.domToModelForSanitizing,l=o.styleSanitizers,s=o.attributeSanitizers,c=o.additionalAllowedTags,d=o.additionalDisallowedTags;(0,i.getObjectKeys)(l).forEach((function(t){return(0,a.chainSanitizerCallback)(e.domToModelOption.styleSanitizers,t,l[t])})),(0,i.getObjectKeys)(s).forEach((function(t){return(0,a.chainSanitizerCallback)(e.domToModelOption.attributeSanitizers,t,s[t])})),(t=e.domToModelOption.additionalAllowedTags).push.apply(t,(0,n.__spreadArray)([],(0,n.__read)(c),!1)),(r=e.domToModelOption.additionalDisallowedTags).push.apply(r,(0,n.__spreadArray)([],(0,n.__read)(d),!1))}},e}();t.PastePlugin=h;var v=function(e,t){t.style.backgroundColor&&delete e.backgroundColor},y=new Map([["borderTop",{w:"borderTopWidth",s:"borderTopStyle",c:"borderTopColor"}],["borderRight",{w:"borderRightWidth",s:"borderRightStyle",c:"borderRightColor"}],["borderBottom",{w:"borderBottomWidth",s:"borderBottomStyle",c:"borderBottomColor"}],["borderLeft",{w:"borderLeftWidth",s:"borderLeftStyle",c:"borderLeftColor"}]]);function b(e,t){i.BorderKeys.forEach((function(r){if(!e[r]){var n=y.get(r);n&&t.style[n.w]&&t.style[n.s]&&!t.style[n.c]&&(e[r]=t.style[n.w]+" "+t.style[n.s])}}))}},4840:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.processPastedContentFromPowerPoint=void 0;var n=r(4990);t.processPastedContentFromPowerPoint=function(e,t){var r=e.fragment,o=e.clipboardData;if(o.html&&!o.text&&o.image){var i=(new DOMParser).parseFromString(t(o.html),"text/html");(0,n.moveChildNodes)(r,null==i?void 0:i.body)}}},5853:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WAC_IDENTIFY_SELECTOR=t.REMOVE_MARGIN_ELEMENTS=t.TEMP_ELEMENTS_CLASSES=t.COMMENT_HIGHLIGHT_CLICKED_CLASS=t.COMMENT_HIGHLIGHT_CLASS=t.LIST_CONTAINER_ELEMENT_CLASS_NAME=t.PARAGRAPH=t.OUTLINE_ELEMENT=t.IMAGE_CONTAINER=t.IMAGE_BORDER=t.NUMBER_LIST_STYLE=t.BULLET_LIST_STYLE=t.WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES=void 0;var n=r(1635);t.WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES=["TableInsertRowGapBlank","TableColumnResizeHandle","TableCellTopBorderHandle","TableCellLeftBorderHandle","TableHoverColumnHandle","TableHoverRowHandle"],t.BULLET_LIST_STYLE="BulletListStyle",t.NUMBER_LIST_STYLE="NumberListStyle",t.IMAGE_BORDER="WACImageBorder",t.IMAGE_CONTAINER="WACImageContainer",t.OUTLINE_ELEMENT="OutlineElement",t.PARAGRAPH="Paragraph",t.LIST_CONTAINER_ELEMENT_CLASS_NAME="ListContainerWrapper",t.COMMENT_HIGHLIGHT_CLASS="CommentHighlightRest",t.COMMENT_HIGHLIGHT_CLICKED_CLASS="CommentHighlightClicked",t.TEMP_ELEMENTS_CLASSES=(0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(t.WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES),!1),["ListMarkerWrappingSpan"],!1),t.REMOVE_MARGIN_ELEMENTS="span."+t.IMAGE_CONTAINER+",span."+t.IMAGE_BORDER+",."+t.COMMENT_HIGHLIGHT_CLASS+",."+t.COMMENT_HIGHLIGHT_CLICKED_CLASS+","+t.WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES.map((function(e){return'table div[class^="'+e+'"]'})).join(","),t.WAC_IDENTIFY_SELECTOR='ul[class^="'+t.BULLET_LIST_STYLE+'"]>.'+t.OUTLINE_ELEMENT+',ol[class^="'+t.NUMBER_LIST_STYLE+'"]>.'+t.OUTLINE_ELEMENT+","+t.REMOVE_MARGIN_ELEMENTS},6662:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.processPastedContentWacComponents=void 0;var n=r(1635),o=r(8080),i=r(4990),a=r(7506),l=r(5853),s=["UL","OL","LI"],c=s.join(","),d=function(e,t){var r=t.style.verticalAlign;"super"===r&&(e.superOrSubScriptSequence="super"),"sub"===r&&(e.superOrSubScriptSequence="sub")},u=function(e,t,r){var n=t.tagName;if(t.matches(l.REMOVE_MARGIN_ELEMENTS)&&(t.style.removeProperty("display"),t.style.removeProperty("margin")),t.classList.contains(l.LIST_CONTAINER_ELEMENT_CLASS_NAME))r.elementProcessors.child(e,t,r);else if(!l.TEMP_ELEMENTS_CLASSES.some((function(e){return t.classList.contains(e)}))){if(function(e,t,r){return r.listFormat.levels.length>0&&s.every((function(t){return t!=e}))&&!t.closest(c)}(n,t,r)){var o=r.listFormat;o.levels=[],o.listParent=void 0}r.defaultElementProcessors.element(e,t,r)}},p=function(e,t,r){var o,a,l,s,c,d=parseInt(null!==(o=t.getAttribute("data-aria-level"))&&void 0!==o?o:""),u=r.listFormat,p=(null===(a=u.levels[r.listFormat.levels.length-1])||void 0===a?void 0:a.listType)||(null===(l=t.closest("ol,ul"))||void 0===l?void 0:l.tagName.toUpperCase()),f=(0,i.createListLevel)(p,r.blockFormat);if((0,i.parseFormat)(t,r.formatParsers.listLevelThread,f.format,r),(0,i.parseFormat)(t,r.formatParsers.listLevel,f.format,r),r.listFormat.levels=u.currentListLevels||r.listFormat.levels,d>0)if(d>r.listFormat.levels.length)for(;d!=r.listFormat.levels.length;)r.listFormat.levels.push(f);else r.listFormat.levels.splice(d,r.listFormat.levels.length-1),r.listFormat.levels[d-1]=f;null===(c=(s=r.defaultElementProcessors).li)||void 0===c||c.call(s,e,t,r);var m=u.listParent;if(m){var g=m.blocks[m.blocks.length-1];"BlockGroup"==g.blockType&&"ListItem"==g.blockGroupType&&function(e,t,r){if(e&&"UL"!=e.listType){var o=t.closest("ol"),i=r.listFormat,a=(0,n.__read)(function(e,t){var r=t&&Array.from((null==e?void 0:e.querySelectorAll("li"))||[]).indexOf(t);return[parseInt((null==e?void 0:e.getAttribute("start"))||"1")+(r&&r>0?r:0),parseInt((null==t?void 0:t.getAttribute("data-aria-level"))||"")]}(o,t),2),l=a[0],s=a[1];i.listItemThread||(i.listItemThread=[]);var c=i.listItemThread[s];c&&l-c!=1&&(e.format.startNumberOverride=l),i.listItemThread[s]=l}}(g.levels[g.levels.length-1],t,r)}var h=[];u.levels.forEach((function(e){var t={dataset:(0,n.__assign)({},e.dataset),format:(0,n.__assign)({},e.format),listType:e.listType};h.push(t)})),u.currentListLevels=h,u.levels=[]},f=function(e,t){"block"===t.style.display&&(e.displayForDummyItem=void 0),e.marginLeft=void 0,e.marginRight=void 0},m=function(e){e.marginLeft=void 0,e.paddingLeft=void 0},g=function(e,t){(t.className.includes(l.COMMENT_HIGHLIGHT_CLASS)||t.className.includes(l.COMMENT_HIGHLIGHT_CLICKED_CLASS))&&delete e.backgroundColor};t.processPastedContentWacComponents=function(e){(0,o.addParser)(e.domToModelOption,"segment",d),(0,o.addParser)(e.domToModelOption,"listItemThread",f),(0,o.addParser)(e.domToModelOption,"listItemElement",f),(0,o.addParser)(e.domToModelOption,"listLevel",m),(0,o.addParser)(e.domToModelOption,"container",h),(0,o.addParser)(e.domToModelOption,"table",h),(0,o.addParser)(e.domToModelOption,"segment",g),(0,a.setProcessor)(e.domToModelOption,"element",u),(0,a.setProcessor)(e.domToModelOption,"li",p)};var h=function(e,t){t.style.marginLeft.startsWith("-")&&delete e.marginLeft}},7985:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getStyleMetadata=void 0;var n=r(1635),o=r(4990),i=/[\n\t'{}"]+/g;t.getStyleMetadata=function(e,t){var r=new Map;return(new DOMParser).parseFromString(t(e.htmlBefore),"text/html").querySelectorAll("style").forEach((function(e){for(var t=(null==e?void 0:e.innerHTML.trim())||"",a=0,l=function(){var e=t.indexOf("@",a+1),l=t.indexOf("}",e),s=t.indexOf("{",e);a=e;var c=t.substring(e+1,s).replace(i,"").replace("list","").trimRight().trimLeft(),d=t.substring(s,l+1).trimLeft().trimRight(),u={};d.split(";").forEach((function(e){var t=(0,n.__read)(e.split(":"),2),r=t[0],o=t[1];if(r&&o){var a=r.replace(i,"").trimRight().trimLeft(),l=o.replace(i,"").trimRight().trimLeft();u[a]=l}}));var p={"mso-level-number-format":u["mso-level-number-format"],"mso-level-start-at":u["mso-level-start-at"]||"1","mso-level-text":u["mso-level-text"]};(0,o.getObjectKeys)(p).some((function(e){return!!p[e]}))&&r.set(c,p)};a>=0;)l()})),r}},9138:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.processPastedContentFromWordDesktop=void 0;var n=r(8080),o=r(7985),i=r(5414),a=r(1570),l=r(5176),s=r(9388),c=r(7506),d=/%/;t.processPastedContentFromWordDesktop=function(e,t){var r=(0,o.getStyleMetadata)(e,t);(0,c.setProcessor)(e.domToModelOption,"element",u(r)),(0,n.addParser)(e.domToModelOption,"block",p),(0,n.addParser)(e.domToModelOption,"block",s.removeNegativeTextIndentParser),(0,n.addParser)(e.domToModelOption,"listLevel",f),(0,n.addParser)(e.domToModelOption,"container",m),(0,n.addParser)(e.domToModelOption,"table",m)};var u=function(e){return function(t,r,n){var o=(0,i.getStyles)(r);(0,l.processWordList)(o,t,r,n,e)||(0,a.processWordComments)(o,r)||n.defaultElementProcessors.element(t,r,n)}};function p(e,t){var r;d.test(t.style.lineHeight)&&!isNaN(r=parseInt(t.style.lineHeight))&&(e.lineHeight=(r/100*1.2).toString())}function f(e,t,r,n){""!=t.style.marginLeft&&(e.marginLeft=n.marginLeft),e.marginBottom=void 0}var m=function(e){var t;(null===(t=e.marginLeft)||void 0===t?void 0:t.startsWith("-"))&&delete e.marginLeft}},1570:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.processWordComments=void 0;var n=r(4990),o=/#_msocom_/;t.processWordComments=function(e,t){return"comment"==e["mso-special-character"]||(0,n.isElementOfType)(t,"a")&&o.test(t.href)||"comment-list"==e["mso-element"]}},5176:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.processWordList=void 0;var n=r(1635),o=r(9388),i=r(4990),a=/%[0-9a-zA-Z]+/g;function l(e,t){t.style.marginLeft&&"0in"!=t.style.marginLeft&&(e.paddingLeft="0px"),t.style.marginRight&&"0in"!=t.style.marginRight&&(e.paddingRight="0px")}t.processWordList=function(e,t,r,s,c){var d,u=s.listFormat;u.wordKnownLevels||(u.wordKnownLevels=new Map);var p=e["mso-list"]||"";if("ignore"===p.toLowerCase())return!0;var f=(0,n.__read)(p.split(" "),2),m=f[0],g=f[1];if(u.wordLevel=g&&parseInt(g.substr(5)),u.wordList=m||"l0",0==u.levels.length&&(u.levels=u.wordList&&u.wordKnownLevels.get(u.wordList)||[]),p&&t&&"number"==typeof u.wordLevel){var h=u.wordLevel,v=u.wordList,y=c.get(m+":"+g),b="bullet"!=(null===(d=null==y?void 0:y["mso-level-number-format"])||void 0===d?void 0:d.toLowerCase())?"OL":"UL",S=(0,i.createListLevel)(b);if((0,i.parseFormat)(r,(0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(s.formatParsers.listLevel),!1),[l],!1),S.format,s),h>u.levels.length)for(;h!=u.levels.length;)u.levels.push(S);else u.levels.splice(h,u.levels.length-1),u.levels[h-1]=S;return u.levels[u.levels.length-1].format.wordList=v,u.listParent=t,function(e,t,r,n,l){var s=e.levels[e.levels.length-1].listType,c=function(e,t){var r,n=(null==e?void 0:e["mso-level-number-format"])||"decimal";if(null==e?void 0:e["mso-level-text"]){var o="";switch(n){case"alpha-upper":o="UpperAlpha";break;case"alpha-lower":o="LowerAlpha";break;case"roman-lower":o="LowerRoman";break;case"roman-upper":o="UpperRoman";break;default:o="Number"}r='"'+(e["mso-level-text"]||"").replace("\\","").replace('"',"").replace(a,"${"+o+"}")+' "'}else switch(n){case"alpha-lower":r="lower-alpha";break;case"roman-lower":r="lower-roman";break;case"roman-upper":r="upper-roman";break;default:r="decimal"}return(0,i.getListStyleTypeFromString)(t,r)}(l,s);c&&(0,i.updateListMetadata)(e.levels[e.levels.length-1],(function(e){return Object.assign({},e,{unorderedStyleType:"UL"==s?c:void 0,orderedStyleType:"OL"==s?c:void 0})}));var d=(0,i.createListItem)(e.levels,t.segmentFormat);(0,i.parseFormat)(r,t.formatParsers.segmentOnBlock,t.segmentFormat,t),(0,i.parseFormat)(r,t.formatParsers.listItemElement,d.format,t),(0,i.parseFormat)(r,[o.removeNegativeTextIndentParser],d.format,t),"OL"==s&&function(e,t,r){var n,o,a=t.listFormat,l=a.listParent,s=a.wordList,c=a.wordKnownLevels,d=a.wordLevel,u=a.levels,p=function(e){for(var t=((null==e?void 0:e.blocks.length)||0)-1;t>0;t--){var r=null==e?void 0:e.blocks[t];if(r&&!(0,i.isEmpty)(r))return r}}(l);if(("BlockGroup"!=(null==p?void 0:p.blockType)||"ListItem"!=p.blockGroupType||d&&(null===(o=null===(n=p.levels[d])||void 0===n?void 0:n.format)||void 0===o?void 0:o.wordList)!=s)&&s){var f=(null==r?void 0:r["mso-level-start-at"])?parseInt(r["mso-level-start-at"]):NaN,m=(null==c?void 0:c.get(s))||[];null==f||isNaN(f)||m.length==u.length||(e.levels[e.levels.length-1].format.startNumberOverride=f)}}(d,t,l),t.elementProcessors.child(d,r,t),(0,i.addBlock)(n,d)}(u,s,r,t,y),u.levels.length>0&&u.wordKnownLevels.get(v)!=u.levels&&u.wordKnownLevels.set(v,(0,n.__spreadArray)([],(0,n.__read)(u.levels),!1)),!0}return!1}},9388:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeNegativeTextIndentParser=void 0,t.removeNegativeTextIndentParser=function(e,t){var r;(null===(r=e.textIndent)||void 0===r?void 0:r.startsWith("-"))&&delete e.textIndent}},3400:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PastePropertyNames=void 0,t.PastePropertyNames={GOOGLE_SHEET_NODE_NAME:"google-sheets-html-origin",PROG_ID_NAME:"ProgId",EXCEL_DESKTOP_ATTRIBUTE_NAME:"xmlns:x"}},9628:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.documentContainWacElements=void 0;var n=r(5853);t.documentContainWacElements=function(e){return!!e.fragment.querySelector(n.WAC_IDENTIFY_SELECTOR)}},1340:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPasteSource=void 0;var n=r(9628),o=r(5218),i=r(3323),a=r(3218),l=r(8131),s=r(4740),c=r(8037),d=new Map([["wordDesktop",s.isWordDesktopDocument],["excelDesktop",o.isExcelDesktopDocument],["excelOnline",i.isExcelOnlineDocument],["powerPointDesktop",l.isPowerPointDesktopDocument],["wacComponents",n.documentContainWacElements],["googleSheets",a.isGoogleSheetDocument],["singleImage",c.shouldConvertToSingleImage]]);t.getPasteSource=function(e,t){var r=e.htmlAttributes,n=e.clipboardData,o=e.fragment,i=null,a={htmlAttributes:r,fragment:o,shouldConvertSingleImage:t,clipboardData:n};return d.forEach((function(e,t){!i&&e(a)&&(i=t)})),null!=i?i:"default"}},5218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isExcelDesktopDocument=void 0;var n=r(3400);t.isExcelDesktopDocument=function(e){return"urn:schemas-microsoft-com:office:excel"==e.htmlAttributes[n.PastePropertyNames.EXCEL_DESKTOP_ATTRIBUTE_NAME]}},3323:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isExcelOnlineDocument=void 0;var n=r(3400);t.isExcelOnlineDocument=function(e){var t=e.htmlAttributes;return"Excel.Sheet"==t[n.PastePropertyNames.PROG_ID_NAME]&&null==t[n.PastePropertyNames.EXCEL_DESKTOP_ATTRIBUTE_NAME]}},3218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isGoogleSheetDocument=void 0;var n=r(3400);t.isGoogleSheetDocument=function(e){return!!e.fragment.querySelector(n.PastePropertyNames.GOOGLE_SHEET_NODE_NAME)}},8131:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPowerPointDesktopDocument=void 0;var n=r(3400);t.isPowerPointDesktopDocument=function(e){return"PowerPoint.Slide"==e.htmlAttributes[n.PastePropertyNames.PROG_ID_NAME]}},4740:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isWordDesktopDocument=void 0;var n=r(3400);t.isWordDesktopDocument=function(e){var t=e.htmlAttributes;return"urn:schemas-microsoft-com:office:word"==t["xmlns:w"]||"Word.Document"==t[n.PastePropertyNames.PROG_ID_NAME]}},8037:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldConvertToSingleImage=void 0,t.shouldConvertToSingleImage=function(e){var t,r=e.shouldConvertSingleImage,n=e.clipboardData;return r&&1==(null===(t=n.htmlFirstLevelChildTags)||void 0===t?void 0:t.length)&&"IMG"==n.htmlFirstLevelChildTags[0]}},8080:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addParser=void 0,t.addParser=function(e,t,r){var n;e.additionalFormatParsers||(e.additionalFormatParsers={}),e.additionalFormatParsers[t]||(e.additionalFormatParsers[t]=[]),null===(n=e.additionalFormatParsers[t])||void 0===n||n.push(r)}},5769:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.chainSanitizerCallback=void 0,t.chainSanitizerCallback=function(e,t,r){var n="function"==typeof r?r:function(e){return r?e:null};if(e[t]){var o=e[t];e[t]=function(e,t){var r="function"==typeof o?o(e,t):!!o&&e;return r?n(r,t):null}}else e[t]=n}},8003:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deprecatedBorderColorParser=void 0;var n=r(4990);t.deprecatedBorderColorParser=function(e){n.BorderKeys.forEach((function(t){var r=e[t],o="";if(r&&n.DeprecatedColors.some((function(e){return r.indexOf(e)>-1&&(o=e)}))){var i=r.replace(o,"").trimRight();e[t]=i}}))}},5414:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getStyles=void 0,t.getStyles=function(e){var t={};return((null==e?void 0:e.getAttribute("style"))||"").split(";").forEach((function(e){var r=e.indexOf(":"),n=e.slice(0,r),o=e.slice(r+1);n&&o&&(t[n.trim()]=o.trim())})),t}},1281:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseLink=void 0;var n=r(4990),o=["http:","https:","notes:","mailto:","onenote:"],i=/^file:\/\/\/[a-zA-Z\/]/i;t.parseLink=function(e,t){if((0,n.isElementOfType)(t,"a")){var r;try{r=new URL(t.href)}catch(e){r=void 0}(r&&-1===o.indexOf(r.protocol)||i.test(t.href))&&(t.removeAttribute("href"),e.href="")}}},7506:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setProcessor=void 0,t.setProcessor=function(e,t,r){e.processorOverride||(e.processorOverride={}),e.processorOverride[t]=r}},4269:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PickerHelperImpl=void 0;var n=r(5978),o=r(7168),i=r(4990),a=function(){function e(e,t,r){this.editor=e,this.handler=t,this.triggerCharacter=r,this.direction=null}return e.prototype.replaceQueryString=function(e,t,r){var a=this;this.editor.focus(),(0,n.formatTextSegmentBeforeSelectionMarker)(this.editor,(function(t,n,l,s,c){var d=[];return!!(0,o.getQueryString)(a.triggerCharacter,l,n,d)&&(d.forEach((function(e){return e.isSelected=!0})),(0,i.mergeModel)(t,e,c),c.canUndoByBackspace=r,!0)}),t)},e.prototype.closePicker=function(){var e,t;this.direction&&(this.direction=null,null===(t=(e=this.handler).onClosePicker)||void 0===t||t.call(e))},e}();t.PickerHelperImpl=a},5532:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PickerPlugin=void 0;var n=r(4990),o=r(5978),i=r(7168),a=r(4269),l=function(){function e(e,t){this.triggerCharacter=e,this.handler=t,this.isMac=!1,this.lastQueryString="",this.helper=null}return e.prototype.getName=function(){return"Picker"},e.prototype.initialize=function(e){this.isMac=!!e.getEnvironment().isMac,this.helper=new a.PickerHelperImpl(e,this.handler,this.triggerCharacter),this.handler.onInitialize(this.helper)},e.prototype.dispose=function(){this.handler.onDispose(),this.helper=null},e.prototype.willHandleEventExclusively=function(e){var t;return!!(null===(t=this.helper)||void 0===t?void 0:t.direction)&&"keyDown"==e.eventType&&((0,n.isCursorMovingKey)(e.rawEvent)||"Enter"==e.rawEvent.key||"Tab"==e.rawEvent.key||"Escape"==e.rawEvent.key)},e.prototype.onPluginEvent=function(e){if(this.helper)switch(e.eventType){case"contentChanged":this.helper.direction&&(e.source==n.ChangeSource.SetContent?this.helper.closePicker():this.onSuggestingInput(this.helper));break;case"keyDown":this.helper.direction&&this.onSuggestingKeyDown(this.helper,e.rawEvent);break;case"input":this.helper.direction?this.onSuggestingInput(this.helper):this.onInput(this.helper,e.rawEvent);break;case"mouseUp":this.helper.direction&&this.helper.closePicker()}},e.prototype.onSuggestingKeyDown=function(e,t){var r,n,o,i,a,l,s,c,d,u;switch(t.key){case"ArrowLeft":case"ArrowRight":if("horizontal"==e.direction||"both"==e.direction){var p="ArrowRight"==t.key;e.editor.getDOMHelper().isRightToLeft()&&(p=!p),null===(n=(r=this.handler).onSelectionChanged)||void 0===n||n.call(r,p?"next":"previous")}t.preventDefault();break;case"ArrowUp":case"ArrowDown":p="ArrowDown"==t.key,"horizontal"!=e.direction&&(null===(i=(o=this.handler).onSelectionChanged)||void 0===i||i.call(o,"both"==e.direction?p?"nextRow":"previousRow":p?"next":"previous")),t.preventDefault();break;case"PageUp":case"PageDown":null===(l=(a=this.handler).onSelectionChanged)||void 0===l||l.call(a,"PageDown"==t.key?"nextPage":"previousPage"),t.preventDefault();break;case"Home":case"End":var f=this.isMac?t.metaKey:t.ctrlKey;null===(c=(s=this.handler).onSelectionChanged)||void 0===c||c.call(s,"Home"==t.key?f?"first":"firstInRow":f?"last":"lastInRow"),t.preventDefault();break;case"Escape":e.closePicker(),t.preventDefault();break;case"Enter":case"Tab":null===(u=(d=this.handler).onSelect)||void 0===u||u.call(d),t.preventDefault()}},e.prototype.onSuggestingInput=function(e){var t=this;(0,o.formatTextSegmentBeforeSelectionMarker)(e.editor,(function(r,n,o){var a,l,s=(0,i.getQueryString)(t.triggerCharacter,o,n).replace(/[\u0020\u00A0]/g," "),c=t.lastQueryString;return s&&(s.length>=c.length&&0==s.indexOf(c)||s.length<c.length&&0==c.indexOf(s))?(t.lastQueryString=s,null===(l=(a=t.handler).onQueryStringChanged)||void 0===l||l.call(a,s)):e.closePicker(),!1}))||e.closePicker()},e.prototype.onInput=function(e,t){var r=this;"insertText"==t.inputType&&t.data==this.triggerCharacter&&(0,o.formatTextSegmentBeforeSelectionMarker)(e.editor,(function(t,o){if(o.text.endsWith(r.triggerCharacter)){var i=o.text[o.text.length-2];if(!i||!i.trim()||(0,n.isPunctuation)(i)){var a=e.editor.getDOMSelection(),l="range"==(null==a?void 0:a.type)&&a.range.collapsed?{node:a.range.startContainer,offset:a.range.startOffset}:null;l&&(r.lastQueryString=r.triggerCharacter,e.direction=r.handler.onTrigger(r.lastQueryString,l))}}return!1}))},e}();t.PickerPlugin=l},7168:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getQueryString=void 0;var n=r(5978);t.getQueryString=function(e,t,r,o){for(var i="",a=t.segments.indexOf(r);a>=0;a--){var l=t.segments[a];if("Text"!=l.segmentType){i="";break}var s=l.text.lastIndexOf(e);if(s>=0){i=l.text.substring(s)+i,null==o||o.unshift(s>0?(0,n.splitTextSegment)(l,t,s,l.text.length):l);break}i=l.text+i,null==o||o.unshift(l)}return a<0&&(i=""),i}},3890:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createElement=void 0;var n=r(4990);t.createElement=function e(t,r){if(!t||!t.tag)return null;var o=t.tag,i=t.namespace,a=t.className,l=t.style,s=t.dataset,c=t.attributes,d=t.children,u=i?r.createElementNS(i,o):r.createElement(o);return l&&u.setAttribute("style",l),a&&(u.className=a),s&&(0,n.isNodeOfType)(u,"ELEMENT_NODE")&&(0,n.getObjectKeys)(s).forEach((function(e){u.dataset[e]=s[e]})),c&&(0,n.getObjectKeys)(c).forEach((function(e){u.setAttribute(e,c[e])})),d&&d.forEach((function(t){if("string"==typeof t)u.appendChild(r.createTextNode(t));else if(t){var n=e(t,r);n&&u.appendChild(n)}})),u}},6782:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DragAndDropHelper=void 0;var n=r(1635),o={MOUSEDOWN:"mousedown",MOUSEMOVE:"mousemove",MOUSEUP:"mouseup",getPageXY:function(e){return[e.pageX,e.pageY]}},i={MOUSEDOWN:"touchstart",MOUSEMOVE:"touchmove",MOUSEUP:"touchend",getPageXY:function(e){var t=0,r=0;if(e.targetTouches&&e.targetTouches.length>0){var n=e.targetTouches[0];t=n.pageX,r=n.pageY}return[t,r]}};var a=function(){function e(e,t,r,a,l,s){var c=this;this.trigger=e,this.context=t,this.onSubmit=r,this.handler=a,this.zoomScale=l,this.initX=0,this.initY=0,this.initValue=void 0,this.onMouseDown=function(e){var t,r,o;e.preventDefault(),e.stopPropagation(),c.addDocumentEvents(),t=(0,n.__read)(c.dndMouse.getPageXY(e),2),c.initX=t[0],c.initY=t[1],c.initValue=null===(o=(r=c.handler).onDragStart)||void 0===o?void 0:o.call(r,c.context,e)},this.onMouseMove=function(e){var t,r,o;e.preventDefault();var i=(0,n.__read)(c.dndMouse.getPageXY(e),2),a=i[0],l=i[1],s=(a-c.initX)/c.zoomScale,d=(l-c.initY)/c.zoomScale;c.initValue&&(null===(r=(t=c.handler).onDragging)||void 0===r?void 0:r.call(t,c.context,e,c.initValue,s,d))&&(null===(o=c.onSubmit)||void 0===o||o.call(c,c.context,c.trigger))},this.onMouseUp=function(e){var t,r,n;e.preventDefault(),c.removeDocumentEvents(),(null===(r=(t=c.handler).onDragEnd)||void 0===r?void 0:r.call(t,c.context,e,c.initValue))&&(null===(n=c.onSubmit)||void 0===n||n.call(c,c.context,c.trigger))},this.dndMouse=s?i:o,e.addEventListener(this.dndMouse.MOUSEDOWN,this.onMouseDown)}return e.prototype.dispose=function(){this.trigger.removeEventListener(this.dndMouse.MOUSEDOWN,this.onMouseDown),this.removeDocumentEvents()},Object.defineProperty(e.prototype,"mouseType",{get:function(){return this.dndMouse==i?"touch":"mouse"},enumerable:!1,configurable:!0}),e.prototype.addDocumentEvents=function(){var e=this.trigger.ownerDocument;e.addEventListener(this.dndMouse.MOUSEMOVE,this.onMouseMove,!0),e.addEventListener(this.dndMouse.MOUSEUP,this.onMouseUp,!0)},e.prototype.removeDocumentEvents=function(){var e=this.trigger.ownerDocument;e.removeEventListener(this.dndMouse.MOUSEMOVE,this.onMouseMove,!0),e.removeEventListener(this.dndMouse.MOUSEUP,this.onMouseUp,!0)},e}();t.DragAndDropHelper=a},9560:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getIntersectedRect=void 0;var n=r(1635),o=r(4990);t.getIntersectedRect=function(e,t){void 0===t&&(t=[]);var r=e.map((function(e){return(0,o.normalizeRect)(e.getBoundingClientRect())})).concat(t).filter((function(e){return!!e})),i={top:Math.max.apply(Math,(0,n.__spreadArray)([],(0,n.__read)(r.map((function(e){return e.top}))),!1)),bottom:Math.min.apply(Math,(0,n.__spreadArray)([],(0,n.__read)(r.map((function(e){return e.bottom}))),!1)),left:Math.max.apply(Math,(0,n.__spreadArray)([],(0,n.__read)(r.map((function(e){return e.left}))),!1)),right:Math.min.apply(Math,(0,n.__spreadArray)([],(0,n.__read)(r.map((function(e){return e.right}))),!1))};return i.top<i.bottom&&i.left<i.right?i:null}},6560:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShortcutPlugin=void 0;var n=r(4990),o=r(8062),i=[o.ShortcutBold,o.ShortcutItalic,o.ShortcutUnderline,o.ShortcutClearFormat,o.ShortcutUndo,o.ShortcutUndo2,o.ShortcutRedo,o.ShortcutRedoAlt,o.ShortcutRedoMacOS,o.ShortcutBullet,o.ShortcutNumbering,o.ShortcutIncreaseFont,o.ShortcutDecreaseFont,o.ShortcutIndentList,o.ShortcutOutdentList],a=function(){function e(e){void 0===e&&(e=i),this.shortcuts=e,this.editor=null,this.isMac=!1}return e.prototype.getName=function(){return"Shortcut"},e.prototype.initialize=function(e){this.editor=e,this.isMac=!!this.editor.getEnvironment().isMac},e.prototype.dispose=function(){this.editor=null},e.prototype.willHandleEventExclusively=function(e){return"keyDown"==e.eventType&&(e.rawEvent.ctrlKey||e.rawEvent.altKey||e.rawEvent.metaKey)&&!!this.cacheGetCommand(e)},e.prototype.onPluginEvent=function(e){if(this.editor&&"keyDown"==e.eventType){var t=this.cacheGetCommand(e);t&&(t.onClick(this.editor),e.rawEvent.preventDefault())}},e.prototype.cacheGetCommand=function(e){var t=this;return(0,n.cacheGetEventData)(e,"__ShortcutCommandCache",(function(e){return t.editor&&t.shortcuts.filter((function(r){return t.matchOS(r.environment)&&t.matchShortcut(r.shortcutKey,e.rawEvent)}))[0]}))},e.prototype.matchOS=function(e){switch(e){case"mac":return this.isMac;case"nonMac":return!this.isMac;default:return!0}},e.prototype.matchShortcut=function(e,t){var r=t.ctrlKey,n=t.altKey,o=t.shiftKey,i=t.which,a=t.metaKey,l=this.isMac?a:r;return("ctrl"==e.modifierKey&&l&&!n||"alt"==e.modifierKey&&n&&!l)&&o==e.shiftKey&&e.which==i},e}();t.ShortcutPlugin=a},8062:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShortcutOutdentList=t.ShortcutIndentList=t.ShortcutDecreaseFont=t.ShortcutIncreaseFont=t.ShortcutNumbering=t.ShortcutBullet=t.ShortcutRedoAlt=t.ShortcutRedoMacOS=t.ShortcutRedo=t.ShortcutUndo2=t.ShortcutUndo=t.ShortcutClearFormat=t.ShortcutUnderline=t.ShortcutItalic=t.ShortcutBold=void 0;var n,o=r(3025),i=r(3945),a=r(5978);!function(e){e[e.BACKSPACE=8]="BACKSPACE",e[e.SPACE=32]="SPACE",e[e.B=66]="B",e[e.I=73]="I",e[e.U=85]="U",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.COMMA=188]="COMMA",e[e.PERIOD=190]="PERIOD",e[e.FORWARD_SLASH=191]="FORWARD_SLASH",e[e.ArrowRight=39]="ArrowRight",e[e.ArrowLeft=37]="ArrowLeft"}(n||(n={})),t.ShortcutBold={shortcutKey:{modifierKey:"ctrl",shiftKey:!1,which:66},onClick:function(e){return(0,a.toggleBold)(e)}},t.ShortcutItalic={shortcutKey:{modifierKey:"ctrl",shiftKey:!1,which:73},onClick:function(e){return(0,a.toggleItalic)(e)}},t.ShortcutUnderline={shortcutKey:{modifierKey:"ctrl",shiftKey:!1,which:85},onClick:function(e){return(0,a.toggleUnderline)(e)}},t.ShortcutClearFormat={shortcutKey:{modifierKey:"ctrl",shiftKey:!1,which:32},onClick:function(e){return(0,a.clearFormat)(e)},environment:"nonMac"},t.ShortcutUndo={shortcutKey:{modifierKey:"ctrl",shiftKey:!1,which:90},onClick:function(e){return(0,o.undo)(e)}},t.ShortcutUndo2={shortcutKey:{modifierKey:"alt",shiftKey:!1,which:8},onClick:function(e){return(0,o.undo)(e)},environment:"nonMac"},t.ShortcutRedo={shortcutKey:{modifierKey:"ctrl",shiftKey:!1,which:89},onClick:function(e){return(0,o.redo)(e)},environment:"nonMac"},t.ShortcutRedoMacOS={shortcutKey:{modifierKey:"ctrl",shiftKey:!0,which:90},onClick:function(e){return(0,o.redo)(e)},environment:"mac"},t.ShortcutRedoAlt={shortcutKey:{modifierKey:"ctrl",shiftKey:!0,which:90},onClick:function(e){return(0,o.redo)(e)}},t.ShortcutBullet={shortcutKey:{modifierKey:"ctrl",shiftKey:!1,which:190},onClick:function(e){return(0,a.toggleBullet)(e)}},t.ShortcutNumbering={shortcutKey:{modifierKey:"ctrl",shiftKey:!1,which:191},onClick:function(e){return(0,a.toggleNumbering)(e)}},t.ShortcutIncreaseFont={shortcutKey:{modifierKey:"ctrl",shiftKey:!0,which:190},onClick:function(e){return(0,a.changeFontSize)(e,"increase")}},t.ShortcutDecreaseFont={shortcutKey:{modifierKey:"ctrl",shiftKey:!0,which:188},onClick:function(e){return(0,a.changeFontSize)(e,"decrease")}},t.ShortcutIndentList={shortcutKey:{modifierKey:"alt",shiftKey:!0,which:39},onClick:function(e){(0,i.setShortcutIndentationCommand)(e,"indent")},environment:"nonMac"},t.ShortcutOutdentList={shortcutKey:{modifierKey:"alt",shiftKey:!0,which:37},onClick:function(e){(0,i.setShortcutIndentationCommand)(e,"outdent")},environment:"nonMac"}},3945:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setShortcutIndentationCommand=void 0;var n=r(4990),o=r(5978);t.setShortcutIndentationCommand=function(e,t){e.formatContentModel((function(e,r){var i=(0,n.getFirstSelectedListItem)(e);return!(!i||"Paragraph"!=i.blocks[0].blockType||"SelectionMarker"!=i.blocks[0].segments[0].segmentType||((0,o.setModelIndentation)(e,t,void 0,r),0))}))}},289:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TableEditPlugin=void 0;var n=r(4990),o=r(4045),i=function(){function e(e,t,r){var o=this;this.anchorContainerSelector=e,this.onTableEditorCreated=t,this.disableFeatures=r,this.editor=null,this.onMouseMoveDisposer=null,this.tableRectMap=null,this.tableEditor=null,this.onMouseOut=function(e){var t=e.relatedTarget,r=e.currentTarget;(0,n.isNodeOfType)(t,"ELEMENT_NODE")&&(0,n.isNodeOfType)(r,"ELEMENT_NODE")&&o.tableEditor&&!o.tableEditor.isOwnedElement(t)&&!r.contains(t)&&o.setTableEditor(null)},this.onMouseMove=function(e){var t,r=e;if(!(r.buttons>0)&&o.editor){o.ensureTableRects();var n=o.editor.getDocument().defaultView||window,i=r.pageX-n.scrollX,a=r.pageY-n.scrollY,l=null;if(o.tableRectMap)for(var s=o.tableRectMap.length-1;s>=0;s--){var c=o.tableRectMap[s],d=c.table,u=c.rect;if(i>=u.left-12&&i<=u.right+12&&a>=u.top-12&&a<=u.bottom+12){l=d;break}}o.setTableEditor(l,r),null===(t=o.tableEditor)||void 0===t||t.onMouseMove(i,a)}},this.invalidateTableRects=function(){o.tableRectMap=null}}return e.prototype.getName=function(){return"TableEdit"},e.prototype.initialize=function(e){this.editor=e,this.onMouseMoveDisposer=this.editor.attachDomEvent({mousemove:{beforeDispatch:this.onMouseMove}}),this.editor.getScrollContainer().addEventListener("mouseout",this.onMouseOut)},e.prototype.dispose=function(){var e,t,r=null===(e=this.editor)||void 0===e?void 0:e.getScrollContainer();null==r||r.removeEventListener("mouseout",this.onMouseOut),null===(t=this.onMouseMoveDisposer)||void 0===t||t.call(this),this.invalidateTableRects(),this.disposeTableEditor(),this.editor=null,this.onMouseMoveDisposer=null,this.onTableEditorCreated=void 0},e.prototype.onPluginEvent=function(e){switch(e.eventType){case"input":case"contentChanged":case"scroll":case"zoomChanged":this.setTableEditor(null),this.invalidateTableRects()}},e.prototype.setTableEditor=function(e,t){if(this.tableEditor&&!this.tableEditor.isEditing()&&e!=this.tableEditor.table&&this.disposeTableEditor(),!this.tableEditor&&e&&this.editor&&e.rows.length>0){var r=this.anchorContainerSelector?this.editor.getDocument().querySelector(this.anchorContainerSelector):void 0;this.tableEditor=new o.TableEditor(this.editor,e,this.invalidateTableRects,(0,n.isNodeOfType)(r,"ELEMENT_NODE")?r:void 0,null==t?void 0:t.currentTarget,this.onTableEditorCreated,this.disableFeatures)}},e.prototype.disposeTableEditor=function(){var e;null===(e=this.tableEditor)||void 0===e||e.dispose(),this.tableEditor=null},e.prototype.ensureTableRects=function(){var e=this;!this.tableRectMap&&this.editor&&(this.tableRectMap=[],this.editor.getDOMHelper().queryElements("table").forEach((function(t){if(t.isContentEditable){var r=(0,n.normalizeRect)(t.getBoundingClientRect());r&&e.tableRectMap&&e.tableRectMap.push({table:t,rect:r})}})))},e}();t.TableEditPlugin=i},4045:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TableEditor=void 0;var n,o=r(8928),i=r(6936),a=r(1149),l=r(1942),s=r(6014),c=r(4990);!function(e){e[e.top=0]="top",e[e.side=1]="side"}(n||(n={}));var d=function(){function e(e,t,r,n,o,i,a){var l,s=this;this.editor=e,this.table=t,this.onChanged=r,this.anchorContainer=n,this.contentDiv=o,this.onTableEditorCreated=i,this.disableFeatures=a,this.horizontalInserter=null,this.verticalInserter=null,this.horizontalResizer=null,this.verticalResizer=null,this.tableResizer=null,this.tableMover=null,this.range=null,this.onEditorCreated=function(e,t){var r,n=null===(r=s.onTableEditorCreated)||void 0===r?void 0:r.call(s,e,t),o=t&&s.getOnMouseOut(t);return o&&t.addEventListener("mouseout",o),function(){null==n||n(),o&&t.removeEventListener("mouseout",o)}},this.onFinishEditing=function(){return s.editor.focus(),s.range&&(s.editor.setDOMSelection({type:"range",range:s.range,isReverted:!1}),s.range=null),s.editor.takeSnapshot(),s.onChanged(),s.isCurrentlyEditing=!1,!1},this.onStartTableResize=function(){s.isCurrentlyEditing=!0,s.onStartResize()},this.onStartCellResize=function(){s.isCurrentlyEditing=!0,s.disposeTableResizer(),s.onStartResize()},this.onStartTableMove=function(){s.isCurrentlyEditing=!0,s.disposeTableResizer(),s.disposeTableInserter(),s.disposeCellResizers()},this.onEndTableMove=function(e){return e&&s.disposeTableMover(),s.onFinishEditing()},this.onInserted=function(){s.disposeTableResizer(),s.onFinishEditing()},this.onSelect=function(e){var t,r;if(s.editor.focus(),e){var n=(0,c.parseTableCells)(e),o={table:e,firstRow:0,firstColumn:0,lastRow:n.length-1,lastColumn:(null!==(r=null===(t=n[0])||void 0===t?void 0:t.length)&&void 0!==r?r:0)-1,type:"table"};s.editor.setDOMSelection(o)}},this.getOnMouseOut=function(e){return function(t){e&&t.relatedTarget!=e&&(0,c.isNodeOfType)(s.contentDiv,"ELEMENT_NODE")&&(0,c.isNodeOfType)(t.relatedTarget,"ELEMENT_NODE")&&s.contentDiv!=t.relatedTarget&&!s.isEditing()&&s.dispose()}},this.isRTL="rtl"==(null===(l=e.getDocument().defaultView)||void 0===l?void 0:l.getComputedStyle(t).direction),this.setEditorFeatures(),this.isCurrentlyEditing=!1}return e.prototype.dispose=function(){this.disposeTableResizer(),this.disposeCellResizers(),this.disposeTableInserter(),this.disposeTableMover()},e.prototype.isEditing=function(){return this.isCurrentlyEditing},e.prototype.isOwnedElement=function(e){return[this.tableResizer,this.tableMover,this.horizontalInserter,this.verticalInserter,this.horizontalResizer,this.verticalResizer].filter((function(e){return!!(null==e?void 0:e.div)})).some((function(t){return(null==t?void 0:t.div)==e}))},e.prototype.onMouseMove=function(e,t){var r,n=(0,c.normalizeRect)(this.table.getBoundingClientRect());if(n){for(var o=t<=n.top+6?0:this.isRTL?e>=n.right-6?1:void 0:e<=n.left+6?1:void 0,i=o?1:0,a=0;a<this.table.rows.length;a++){for(var l=this.table.rows[a],s=0;s<l.cells.length;s++){var d=l.cells[s],u=(0,c.normalizeRect)(d.getBoundingClientRect());if(u&&n){var p=t<=u.bottom,f=this.isRTL?e<=u.right+6*i:e<=u.right,m=this.isRTL?e>=u.left:e>=u.left-6*i;if(p&&f&&m){if(0===a&&0==o){var g=(u.left+u.right)/2,h=this.isRTL?e<g:e>g;!this.isFeatureDisabled("VerticalTableInserter")&&this.setInserterTd(h?d:l.cells[s-1],!1)}else if(0===s&&1==o){var v=null===(r=this.table.rows[a-1])||void 0===r?void 0:r.cells[0],y=v?(0,c.normalizeRect)(v.getBoundingClientRect()):null,b=y?this.isRTL?y.right===u.right:y.left===u.left:null;!this.isFeatureDisabled("HorizontalTableInserter")&&this.setInserterTd(t<(u.top+u.bottom)/2&&b?v:d,!0)}else this.setInserterTd(null);!this.isFeatureDisabled("CellResizer")&&this.setResizingTd(d);break}}}if(s<l.cells.length)break}this.setEditorFeatures()}},e.prototype.setEditorFeatures=function(){var e=this.isFeatureDisabled("TableSelector"),t=this.isFeatureDisabled("TableMover");this.tableMover||e&&t||(this.tableMover=(0,a.createTableMover)(this.table,this.editor,this.isRTL,e?function(){}:this.onSelect,this.onStartTableMove,this.onEndTableMove,this.contentDiv,this.anchorContainer,this.onEditorCreated,t)),this.tableResizer||this.isFeatureDisabled("TableResizer")||(this.tableResizer=(0,l.createTableResizer)(this.table,this.editor,this.isRTL,this.onStartTableResize,this.onFinishEditing,this.contentDiv,this.anchorContainer,this.onTableEditorCreated))},e.prototype.setResizingTd=function(e){this.horizontalResizer&&this.horizontalResizer.node!=e&&this.disposeCellResizers(),!this.horizontalResizer&&e&&(this.horizontalResizer=(0,o.createCellResizer)(this.editor,e,this.table,this.isRTL,!0,this.onStartCellResize,this.onFinishEditing,this.anchorContainer),this.verticalResizer=(0,o.createCellResizer)(this.editor,e,this.table,this.isRTL,!1,this.onStartCellResize,this.onFinishEditing,this.anchorContainer))},e.prototype.setInserterTd=function(e,t){var r=t?this.horizontalInserter:this.verticalInserter;if((null===e||r&&r.node!=e)&&this.disposeTableInserter(),!this.horizontalInserter&&!this.verticalInserter&&e){var n=(0,i.createTableInserter)(this.editor,e,this.table,this.isRTL,!!t,this.onInserted,this.anchorContainer,this.onEditorCreated);t?this.horizontalInserter=n:this.verticalInserter=n}},e.prototype.disposeTableResizer=function(){this.tableResizer&&((0,s.disposeTableEditFeature)(this.tableResizer),this.tableResizer=null)},e.prototype.disposeTableInserter=function(){this.horizontalInserter&&((0,s.disposeTableEditFeature)(this.horizontalInserter),this.horizontalInserter=null),this.verticalInserter&&((0,s.disposeTableEditFeature)(this.verticalInserter),this.verticalInserter=null)},e.prototype.disposeCellResizers=function(){this.horizontalResizer&&((0,s.disposeTableEditFeature)(this.horizontalResizer),this.horizontalResizer=null),this.verticalResizer&&((0,s.disposeTableEditFeature)(this.verticalResizer),this.verticalResizer=null)},e.prototype.disposeTableMover=function(){this.tableMover&&((0,s.disposeTableEditFeature)(this.tableMover),this.tableMover=null)},e.prototype.onStartResize=function(){this.isCurrentlyEditing=!0;var e=this.editor.getDOMSelection();e&&"range"==e.type&&(this.range=e.range),this.editor.takeSnapshot()},e.prototype.isFeatureDisabled=function(e){var t;return null===(t=this.disableFeatures)||void 0===t?void 0:t.includes(e)},e}();t.TableEditor=d},8928:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onDraggingVertical=t.onDraggingHorizontal=t.onDragStart=t.createCellResizer=t.VERTICAL_RESIZER_ID=t.HORIZONTAL_RESIZER_ID=void 0;var n=r(1635),o=r(3890),i=r(6782),a=r(6482),l=r(4990);function s(e,t){var r=e.td,o=e.onStart,i=(0,l.normalizeRect)(r.getBoundingClientRect()),s=r.cellIndex,c=r.parentElement&&(0,l.isElementOfType)(r.parentElement,"tr")?r.parentElement:void 0,d=null==c?void 0:c.rowIndex;if(null==d)return{cmTable:void 0,anchorColumn:void 0,anchorRow:void 0,anchorRowHeight:-1,allWidths:[]};var u=e.editor,p=e.table,f=(0,a.getCMTableFromTable)(u,p);return i&&f?(o(),{cmTable:f,anchorColumn:s,anchorRow:d,anchorRowHeight:f.rows[d].height,allWidths:(0,n.__spreadArray)([],(0,n.__read)(f.widths),!1)}):{cmTable:f,anchorColumn:void 0,anchorRow:void 0,anchorRowHeight:-1,allWidths:[]}}function c(e,t,r,n,o){var i=e.table,a=r.cmTable,s=r.anchorRow,c=r.anchorRowHeight;if(a&&null!=s&&null!=a.rows[s]){(0,l.mutateBlock)(a).rows[s].height=(null!=c?c:0)+o;for(var d=Math.max(a.rows[s].height,l.MIN_ALLOWED_TABLE_CELL_HEIGHT),u=i.rows[s],p=0;p<u.cells.length;p++)u.cells[p].style.height=d+"px";return!0}return!1}function d(e,t,r,n){var o=e.table,i=e.isRTL,a=r.cmTable,s=r.anchorColumn,c=r.allWidths;if(a&&null!=s){var d=(0,l.mutateBlock)(a),u=n*(i?-1:1);if(s==a.widths.length-1){var p=Math.max(c[s]+u,l.MIN_ALLOWED_TABLE_CELL_WIDTH);d.widths[s]=p}else{var f=c[s]+u,m=c[s+1]-u;if(f<l.MIN_ALLOWED_TABLE_CELL_WIDTH||m<l.MIN_ALLOWED_TABLE_CELL_WIDTH)return!1;d.widths[s]=f,d.widths[s+1]=m}for(var g=0;g<o.rows.length;g++)for(var h=o.rows[g],v=0;v<h.cells.length;v++)h.cells[v].style.width=a.widths[v]+"px";return!0}return!1}function u(e,r){var n=e.td,o=(0,l.normalizeRect)(n.getBoundingClientRect());o&&(r.id=t.HORIZONTAL_RESIZER_ID,r.style.top=o.bottom-4+"px",r.style.left=o.left+"px",r.style.width=o.right-o.left+"px",r.style.height="4px")}function p(e,r){var n=e.td,o=e.isRTL,i=(0,l.normalizeRect)(n.getBoundingClientRect());i&&(r.id=t.VERTICAL_RESIZER_ID,r.style.top=i.top+"px",r.style.left=(o?i.left:i.right)-4+1+"px",r.style.width="4px",r.style.height=i.bottom-i.top+"px")}t.HORIZONTAL_RESIZER_ID="horizontalResizer",t.VERTICAL_RESIZER_ID="verticalResizer",t.createCellResizer=function(e,t,r,n,a,l,f,m){var g=t.ownerDocument,h={tag:"div",style:"position: fixed; cursor: "+(a?"row":"col")+"-resize; user-select: none"},v=e.getDOMHelper().calculateZoomScale(),y=(0,o.createElement)(h,g);(m||g.body).appendChild(y);var b={editor:e,td:t,table:r,isRTL:n,zoomScale:v,onStart:l},S=a?u:p;S(b,y);var C={onDragStart:s,onDragging:a?c:d,onDragEnd:f};return{node:t,div:y,featureHandler:new i.DragAndDropHelper(y,b,S,C,v,e.getEnvironment().isMobileOrTablet)}},t.onDragStart=s,t.onDraggingHorizontal=c,t.onDraggingVertical=d},6014:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.disposeTableEditFeature=void 0,t.disposeTableEditFeature=function(e){var t,r,n;e&&(null===(t=e.featureHandler)||void 0===t||t.dispose(),e.featureHandler=null,null===(n=null===(r=e.div)||void 0===r?void 0:r.parentNode)||void 0===n||n.removeChild(e.div),e.div=null)}},6936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TableInsertHandler=t.createTableInserter=t.VERTICAL_INSERTER_ID=t.HORIZONTAL_INSERTER_ID=void 0;var n=r(3890),o=r(9560),i=r(4990),a=r(5978);t.HORIZONTAL_INSERTER_ID="horizontalInserter",t.VERTICAL_INSERTER_ID="verticalInserter",t.createTableInserter=function(e,r,a,s,c,d,u,p){var f=(0,i.normalizeRect)(r.getBoundingClientRect()),m=e.getVisibleViewport(),g=a&&m?(0,o.getIntersectedRect)([a],[m]):null;if(f&&g){var h=r.ownerDocument,v=function(e,t,r,n){var o=t?"white":"#4A4A4A";return{tag:"div",style:"position: fixed; width: 12px; height: 12px; font-size: 16px; color: black; line-height: 8px; vertical-align: middle; text-align: center; cursor: pointer; border: solid 1px "+o+"; border-radius: 50%; background-color: "+n,children:[{tag:"div",style:"position: absolute; box-sizing: border-box; background-color: "+n+";"+(e?(r?"right":"left")+": 12px; top: 5px; height: 3px; border-top: 1px solid "+o+"; border-bottom: 1px solid "+o+"; border-right: 1px solid "+o+"; border-left: 0px;":"left: 5px; top: 12px; width: 3px; border-left: 1px solid "+o+"; border-right: 1px solid "+o+"; border-bottom: 1px solid "+o+"; border-top: 0px;")},"+"]}}(c,e.isDarkMode(),s,e.getDOMHelper().getDomStyle("backgroundColor")||"white"),y=(0,n.createElement)(v,h);return c?(y.id=t.HORIZONTAL_INSERTER_ID,y.style.left=(s?g.right:g.left-13)+"px",y.style.top=f.bottom-8+"px",y.firstChild.style.width=g.right-g.left+"px"):(y.id=t.VERTICAL_INSERTER_ID,y.style.left=(s?f.left-8:f.right-8)+"px",y.style.top=g.top-13+"px",y.firstChild.style.height=g.bottom-g.top+"px"),(u||h.body).appendChild(y),{div:y,featureHandler:new l(y,r,a,c,e,d,p),node:r}}return null};var l=function(){function e(e,t,r,n,o,l,s){var c=this;this.div=e,this.td=t,this.table=r,this.isHorizontal=n,this.editor=o,this.onInsert=l,this.insertTd=function(){var e=c.td.cellIndex,t=c.td.parentElement&&(0,i.isElementOfType)(c.td.parentElement,"tr")?c.td.parentElement:void 0,r=t&&t.rowIndex;null!=(null==t?void 0:t.cells)&&null!=r&&((0,a.formatTableWithContentModel)(c.editor,"editTablePlugin",(function(e){c.isHorizontal?(0,a.insertTableRow)(e,"insertBelow"):(0,a.insertTableColumn)(e,"insertRight")}),{type:"table",firstColumn:e,firstRow:r,lastColumn:e,lastRow:r,table:c.table}),c.onInsert())},this.div.addEventListener("click",this.insertTd),this.disposer=null==s?void 0:s(n?"HorizontalTableInserter":"VerticalTableInserter",e)}return e.prototype.dispose=function(){var e;this.div.removeEventListener("click",this.insertTd),null===(e=this.disposer)||void 0===e||e.call(this),this.disposer=void 0},e}();t.TableInsertHandler=l},1149:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onDragEnd=t.onDragging=t.onDragStart=t.createTableMover=t.TABLE_MOVER_ID=void 0;var n=r(1635),o=r(3890),i=r(6782),a=r(5978),l=r(6482),s=r(4990),c=12;t.TABLE_MOVER_ID="_Table_Mover";var d="_TableMoverCursorStyle";t.createTableMover=function(e,r,n,i,a,l,d,p,f,v){var y=(0,s.normalizeRect)(e.getBoundingClientRect());if(!function(e,t,r){var n=e.getVisibleViewport();if((0,s.isNodeOfType)(r,"ELEMENT_NODE")&&n&&t){var o=(0,s.normalizeRect)(r.getBoundingClientRect());return!!o&&o.top<=t.top&&n.top<=t.top}return!0}(r,y,d))return null;var b=r.getDOMHelper().calculateZoomScale(),S=e.ownerDocument,C=(0,o.createElement)({tag:"div",style:"position: fixed; cursor: move; user-select: none; border: 1px solid #808080"},S);C.id=t.TABLE_MOVER_ID,C.style.width="12px",C.style.height="12px",(p||S.body).appendChild(C);var _={table:e,zoomScale:b,rect:y,isRTL:n,editor:r,div:C,onFinishDragging:i,onStart:a,onEnd:l,disableMovement:v};return function(e,t){var r=e.rect;r&&(t.style.top=r.top-c+"px",t.style.left=r.left-c-2+"px")}(_,C),{node:e,div:C,featureHandler:new u(C,_,(function(){}),v?{onDragEnd:h}:{onDragStart:m,onDragging:g,onDragEnd:h},_.zoomScale,f,r.getEnvironment().isMobileOrTablet)}};var u=function(e){function t(t,r,n,o,i,a,l){var s=e.call(this,t,r,n,o,i,l)||this;return s.disposer=null==a?void 0:a("TableMover",t),s}return(0,n.__extends)(t,e),t.prototype.dispose=function(){var t;null===(t=this.disposer)||void 0===t||t.call(this),this.disposer=void 0,e.prototype.dispose.call(this)},t}(i.DragAndDropHelper);function p(e,t,r){var n;null==e||e.setEditorStyle(d,t?null!==(n="cursor: "+r)&&void 0!==n?n:"move":null)}function f(e,t,r){var n=e.getDocument(),o=e.getDOMHelper();if(n.caretRangeFromPoint){var i=n.caretRangeFromPoint(t,r);if(i&&o.isNodeInEditor(i.startContainer))return{node:i.startContainer,offset:i.startOffset}}if("caretPositionFromPoint"in n){var a=n.caretPositionFromPoint(t,r);if(a&&o.isNodeInEditor(a.offsetNode))return{node:a.offsetNode,offset:a.offset}}if(n.elementFromPoint){var l=n.elementFromPoint(t,r);if(l&&o.isNodeInEditor(l))return{node:l,offset:0}}return null}function m(e){var t;e.onStart();var r=e.editor,n=e.table,i=e.div;p(r,!0,"move");var a=n.getBoundingClientRect(),s=(0,o.createElement)({tag:"div",style:"position: fixed; user-select: none; border: 1px solid #808080"},document);s.style.width=a.width+"px",s.style.height=a.height+"px",s.style.top=a.top+"px",s.style.left=a.left+"px",null===(t=i.parentNode)||void 0===t||t.appendChild(s);var c=r.getDOMSelection();return{cmTable:(0,l.getCMTableFromTable)(r,n),initialSelection:c,tableRect:s}}function g(e,t,r){var n=r.tableRect,o=e.editor;n.style.top=t.clientY+c+"px",n.style.left=t.clientX+c+"px";var i=f(o,t.clientX,t.clientY);if(i){var a=o.getDocument().createRange();return a.setStart(i.node,i.offset),a.collapse(!0),o.setDOMSelection({type:"range",range:a,isReverted:!1}),!0}return!1}function h(e,t,r){var o,i,l=e.editor,c=e.table,d=e.onFinishDragging,u=e.disableMovement,m=t.target;if(null==r||r.tableRect.remove(),p(l,!1),m==e.div)return d(c),e.onEnd(!1),!0;if(c.contains(m)||!l.getDOMHelper().isNodeInEditor(m)||u)return l.setDOMSelection(null!==(o=null==r?void 0:r.initialSelection)&&void 0!==o?o:null),e.onEnd(!0),!1;var g=!1,h=f(l,t.clientX,t.clientY);return h?(0,a.formatInsertPointWithContentModel)(l,h,(function(e,t,o){var i,a=(0,n.__read)((0,s.getFirstSelectedTable)(e),2),l=a[0],c=a[1];if(l){var d=c[0].blocks.indexOf(l);(0,s.mutateBlock)(c[0]).blocks.splice(d,1)}if(o&&(null==r?void 0:r.cmTable)){var u=(0,s.createContentModelDocument)();if(u.blocks.push((0,s.mutateBlock)(r.cmTable)),g=!!(0,s.mergeModel)(e,(0,s.cloneModel)(u),t,{mergeFormat:"none",insertPosition:o})){var p=null!==(i=(0,s.getFirstSelectedTable)(e)[0])&&void 0!==i?i:r.cmTable;if(p){var f=p.rows[0].cells[0],m=null==f?void 0:f.blocks[0];if("Paragraph"==(null==m?void 0:m.blockType)){var h=(0,s.createSelectionMarker)(e.format);(0,s.mutateBlock)(m).segments.unshift(h),(0,s.setParagraphNotImplicit)(m),(0,s.setSelection)(f,h)}}}return g}}),{selectionOverride:{type:"table",firstColumn:0,firstRow:0,lastColumn:0,lastRow:0,table:c},apiName:"TableMover"}):l.setDOMSelection(null!==(i=null==r?void 0:r.initialSelection)&&void 0!==i?i:null),e.onEnd(!0),g}t.onDragStart=m,t.onDragging=g,t.onDragEnd=h},1942:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onDragEnd=t.onDragging=t.onDragStart=t.createTableResizer=t.TABLE_RESIZER_ID=void 0;var n=r(1635),o=r(3890),i=r(6782),a=r(6482),l=r(4990),s=12;t.TABLE_RESIZER_ID="_Table_Resizer",t.createTableResizer=function(e,r,n,i,a,h,v,y){if(!g(r,(0,l.normalizeRect)(e.getBoundingClientRect()),h))return null;var b=e.ownerDocument,S=r.getDOMHelper().calculateZoomScale(),C={tag:"div",style:"position: fixed; cursor: "+(n?"ne":"nw")+"-resize; user-select: none; border: 1px solid #808080"},_=(0,o.createElement)(C,b);_.id=t.TABLE_RESIZER_ID,_.style.width=s+"px",_.style.height=s+"px",(v||b.body).appendChild(_);var E={isRTL:n,table:e,zoomScale:S,onStart:i,onEnd:a,div:_,editor:r,contentDiv:h};return f(E,_),{node:e,div:_,featureHandler:new c(_,E,m,{onDragStart:d,onDragging:u,onDragEnd:p},S,r.getEnvironment().isMobileOrTablet,y)}};var c=function(e){function t(t,r,n,o,i,a,l){var s=e.call(this,t,r,n,o,i,a)||this;return s.disposer=null==l?void 0:l("TableResizer",t),s}return(0,n.__extends)(t,e),t.prototype.dispose=function(){var t;null===(t=this.disposer)||void 0===t||t.call(this),this.disposer=void 0,e.prototype.dispose.call(this)},t}(i.DragAndDropHelper);function d(e,t){e.onStart();var r=e.editor,n=e.table,o=(0,a.getCMTableFromTable)(r,n),i=[];null==o||o.rows.forEach((function(e){i.push(e.height)}));var l=[];return null==o||o.widths.forEach((function(e){l.push(e)})),{originalRect:n.getBoundingClientRect(),cmTable:o,originalHeights:null!=i?i:[],originalWidths:null!=l?l:[]}}function u(e,t,r,n,o){var i,a,s=e.isRTL,c=e.zoomScale,d=e.table,u=r.originalRect,p=r.originalHeights,f=r.originalWidths,m=r.cmTable,g=1+n/u.width*c*(s?-1:1),h=1+o/u.height*c,v=Math.abs(g-1)>.001,y=Math.abs(h-1)>.001;if(d.style.setProperty("width",null),d.style.setProperty("height",null),m&&m.rows&&(v||y)){for(var b=(0,l.mutateBlock)(m),S=0;S<m.rows.length;S++)for(var C=0;C<m.rows[S].cells.length;C++)m.rows[S].cells[C]&&(v&&0==S&&(b.widths[C]=(null!==(i=f[C])&&void 0!==i?i:0)*g),y&&0==C&&(b.rows[S].height=(null!==(a=p[S])&&void 0!==a?a:0)*h));for(var _=0;_<d.rows.length;_++){var E=d.rows[_];if(0!=E.cells.length)for(var T=Math.max(m.rows[_].height,l.MIN_ALLOWED_TABLE_CELL_HEIGHT),k=0;k<E.cells.length;k++){var M=E.cells[k],O=Math.max(m.widths[k],l.MIN_ALLOWED_TABLE_CELL_HEIGHT);M.style.width=O+"px",M.style.height=T+"px"}}return!0}return!1}function p(e,t,r){return e.editor.isDisposed()||(g(e.editor,(0,l.normalizeRect)(e.table.getBoundingClientRect()),e.contentDiv)&&(e.div.style.visibility="visible",f(e,e.div)),e.onEnd()),!1}function f(e,t){var r=e.table,n=e.isRTL,o=(0,l.normalizeRect)(r.getBoundingClientRect());o&&(t.style.top=o.bottom+"px",t.style.left=n?o.left-s-2+"px":o.right+"px")}function m(e,t){t.style.visibility="hidden"}function g(e,t,r){var n=e.getVisibleViewport();if((0,l.isNodeOfType)(r,"ELEMENT_NODE")&&n&&t){var o=(0,l.normalizeRect)(r.getBoundingClientRect());return!!o&&o.bottom>=t.bottom&&n.bottom>=t.bottom}return!0}t.onDragStart=d,t.onDragging=u,t.onDragEnd=p},6482:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCMTableFromTable=void 0;var n=r(1635),o=r(4990);t.getCMTableFromTable=function(e,t){var r;return e.formatContentModel((function(e){var t;return t=(0,n.__read)((0,o.getFirstSelectedTable)(e),1),r=t[0],!1}),{selectionOverride:{type:"table",firstColumn:0,firstRow:0,lastColumn:0,lastRow:0,table:t}}),r}},4898:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WatermarkPlugin=void 0;var n=r(1635),o=r(4990),i=r(6343),a="_WatermarkContent",l={fontFamily:"font-family",fontSize:"font-size",textColor:"color"},s=function(){function e(e,t){this.watermark=e,this.editor=null,this.isShowing=!1,this.darkTextColor=null,this.format=t||{fontSize:"14px",textColor:"#AAAAAA"}}return e.prototype.getName=function(){return"Watermark"},e.prototype.initialize=function(e){this.editor=e},e.prototype.dispose=function(){this.editor=null},e.prototype.onPluginEvent=function(e){var t=this,r=this.editor;r&&("input"==e.eventType&&"insertText"==e.rawEvent.inputType||"compositionEnd"==e.eventType?this.showHide(r,!1):"contentChanged"!=e.eventType||e.source!=o.ChangeSource.SwitchToDarkMode&&e.source!=o.ChangeSource.SwitchToLightMode||!this.isShowing?"editorReady"!=e.eventType&&"contentChanged"!=e.eventType&&"input"!=e.eventType&&"beforeDispose"!=e.eventType||r.formatContentModel((function(e){var n=(0,i.isModelEmptyFast)(e);return t.showHide(r,n),!1})):(e.source==o.ChangeSource.SwitchToDarkMode&&!this.darkTextColor&&this.format.textColor&&(this.darkTextColor=r.getColorManager().getDarkColor(this.format.textColor,void 0,"text")),this.applyWatermarkStyle(r)))},e.prototype.showHide=function(e,t){this.isShowing&&!t?this.hide(e):!this.isShowing&&t&&this.show(e)},e.prototype.show=function(e){this.applyWatermarkStyle(e),this.isShowing=!0},e.prototype.applyWatermarkStyle=function(e){var t='position: absolute; pointer-events: none; content: "'+this.watermark+'";',r=(0,n.__assign)((0,n.__assign)({},this.format),{textColor:e.isDarkMode()?this.darkTextColor:this.format.textColor});(0,o.getObjectKeys)(l).forEach((function(e){r[e]&&(t+=l[e]+": "+r[e]+"!important;")})),e.setEditorStyle(a,t,"before")},e.prototype.hide=function(e){e.setEditorStyle(a,null),this.isShowing=!1},e}();t.WatermarkPlugin=s},6343:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isModelEmptyFast=void 0,t.isModelEmptyFast=function(e){var t=e.blocks[0];return!(e.blocks.length>1)&&(!t||"Paragraph"==t.blockType&&(0==t.segments.length||!t.segments.some((function(e){return"Entity"==e.segmentType||"Image"==e.segmentType||"General"==e.segmentType||"Text"==e.segmentType&&e.text}))&&!(t.format.marginRight&&parseFloat(t.format.marginRight)>0||t.format.marginLeft&&parseFloat(t.format.marginLeft)>0)&&t.segments.filter((function(e){return"Br"==e.segmentType})).length<=1))}},3995:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6894:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEditor=void 0;var n=r(1635),o=r(3025),i=r(6109);t.createEditor=function(e,t,r){var a={plugins:(0,n.__spreadArray)([new i.PastePlugin,new i.EditPlugin,new i.ShortcutPlugin],(0,n.__read)(null!=t?t:[]),!1),initialModel:r,defaultSegmentFormat:{fontFamily:"Calibri,Arial,Helvetica,sans-serif",fontSize:"11pt",textColor:"#000000"}};return new o.Editor(e,a)}},1055:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEditor=void 0;var n=r(1635),o=r(6894);Object.defineProperty(t,"createEditor",{enumerable:!0,get:function(){return o.createEditor}}),(0,n.__exportStar)(r(3995),t),(0,n.__exportStar)(r(4990),t),(0,n.__exportStar)(r(3025),t),(0,n.__exportStar)(r(5978),t),(0,n.__exportStar)(r(6109),t),(0,n.__exportStar)(r(285),t)},1635:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__assign:()=>i,__asyncDelegator:()=>k,__asyncGenerator:()=>T,__asyncValues:()=>M,__await:()=>E,__awaiter:()=>m,__classPrivateFieldGet:()=>D,__classPrivateFieldIn:()=>I,__classPrivateFieldSet:()=>L,__createBinding:()=>h,__decorate:()=>l,__esDecorate:()=>c,__exportStar:()=>v,__extends:()=>o,__generator:()=>g,__importDefault:()=>x,__importStar:()=>w,__makeTemplateObject:()=>O,__metadata:()=>f,__param:()=>s,__propKey:()=>u,__read:()=>b,__rest:()=>a,__runInitializers:()=>d,__setFunctionName:()=>p,__spread:()=>S,__spreadArray:()=>_,__spreadArrays:()=>C,__values:()=>y,default:()=>F});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var i=function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};function a(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function l(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}function s(e,t){return function(r,n){t(r,n,e)}}function c(e,t,r,n,o,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var l,s=n.kind,c="getter"===s?"get":"setter"===s?"set":"value",d=!t&&e?n.static?e:e.prototype:null,u=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),p=!1,f=r.length-1;f>=0;f--){var m={};for(var g in n)m[g]="access"===g?{}:n[g];for(var g in n.access)m.access[g]=n.access[g];m.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var h=(0,r[f])("accessor"===s?{get:u.get,set:u.set}:u[c],m);if("accessor"===s){if(void 0===h)continue;if(null===h||"object"!=typeof h)throw new TypeError("Object expected");(l=a(h.get))&&(u.get=l),(l=a(h.set))&&(u.set=l),(l=a(h.init))&&o.unshift(l)}else(l=a(h))&&("field"===s?o.unshift(l):u[c]=l)}d&&Object.defineProperty(d,n.name,u),p=!0}function d(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0}function u(e){return"symbol"==typeof e?e:"".concat(e)}function p(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function f(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function m(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function l(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,l)}s((n=n.apply(e,t||[])).next())}))}function g(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,n=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}var h=Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function v(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||h(t,e,r)}function y(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function S(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(b(arguments[t]));return e}function C(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,l=i.length;a<l;a++,o++)n[o]=i[a];return n}function _(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function E(e){return this instanceof E?(this.v=e,this):new E(e)}function T(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),i=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){i.push([e,t,r,n])>1||l(e,t)}))})}function l(e,t){try{(r=o[e](t)).value instanceof E?Promise.resolve(r.value.v).then(s,c):d(i[0][2],r)}catch(e){d(i[0][3],e)}var r}function s(e){l("next",e)}function c(e){l("throw",e)}function d(e,t){e(t),i.shift(),i.length&&l(i[0][0],i[0][1])}}function k(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:E(e[n](t)),done:!1}:o?o(t):t}:o}}function M(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=y(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,o,(t=e[r](t)).done,t.value)}))}}}function O(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var P=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function w(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&h(t,e,r);return P(t,e),t}function x(e){return e&&e.__esModule?e:{default:e}}function D(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function L(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r}function I(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}const F={__extends:o,__assign:i,__rest:a,__decorate:l,__param:s,__metadata:f,__awaiter:m,__generator:g,__createBinding:h,__exportStar:v,__values:y,__read:b,__spread:S,__spreadArrays:C,__spreadArray:_,__await:E,__asyncGenerator:T,__asyncDelegator:k,__asyncValues:M,__makeTemplateObject:O,__importStar:w,__importDefault:x,__classPrivateFieldGet:D,__classPrivateFieldSet:L,__classPrivateFieldIn:I}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}return r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(1055)})()));
2
2
  //# sourceMappingURL=rooster-amd-min.js.map