PageSourceSearch

https://www.ilo.pl/global/pics/js/ckeditor5/ckeditor.multiroot.es6.js

js ilo.pl collected 2026-09-29 19:38:12 UTC 858,426 bytes, 6 lines download raw bytes

1/*!
2 * @license Copyright (c) 2003-2026, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see LICENSE.md.
4 */
5!function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 of %1","Align cell text to the bottom":"Align cell text to the bottom","Align cell text to the center":"Align cell text to the center","Align cell text to the left":"Align cell text to the left","Align cell text to the middle":"Align cell text to the middle","Align cell text to the right":"Align cell text to the right","Align cell text to the top":"Align cell text to the top","Align center":"Align center","Align left":"Align left","Align right":"Align right","Align table to the left":"Align table to the left","Align table to the right":"Align table to the right",Alignment:"Alignment",Aquamarine:"Aquamarine",Background:"Background",Big:"Big",Black:"Black","Block quote":"Block quote",Blue:"Blue","Blue marker":"Blue marker",Bold:"Bold",Border:"Border","Break text":"Break text","Bulleted List":"Bulleted List",Cancel:"Cancel","Cell properties":"Cell properties","Center table":"Center table","Centered image":"Centered image",Code:"Code",Color:"Color","Color picker":"Color picker",Column:"Column",Dashed:"Dashed","Decrease indent":"Decrease indent",Default:"Default","Delete column":"Delete column","Delete row":"Delete row","Dim grey":"Dim grey",Dimensions:"Dimensions","Document colors":"Document colors",Dotted:"Dotted",Double:"Double",Downloadable:"Downloadable","Dropdown toolbar":"Dropdown toolbar","Edit block":"Edit block","Edit link":"Edit link","Editor toolbar":"Editor toolbar","Enter image caption":"Enter image caption","Font Background Color":"Font Background Color","Font Color":"Font Color","Font Family":"Font Family","Font Size":"Font Size","Full size image":"Full size image",Green:"Green","Green marker":"Green marker","Green pen":"Green pen",Grey:"Grey",Groove:"Groove","Header column":"Header column","Header row":"Header row",Heading:"Heading","Heading 1":"Heading 1","Heading 2":"Heading 2","Heading 3":"Heading 3","Heading 4":"Heading 4","Heading 5":"Heading 5","Heading 6":"Heading 6",Height:"Height",Highlight:"Highlight","Horizontal text alignment toolbar":"Horizontal text alignment toolbar",Huge:"Huge","Change image text alternative":"Change image text alternative","Choose heading":"Choose heading","Image resize list":"Image resize list","Image toolbar":"Image toolbar","image widget":"image widget","In line":"In line","Increase indent":"Increase indent","Insert code block":"Insert code block","Insert column left":"Insert column left","Insert column right":"Insert column right","Insert paragraph after block":"Insert paragraph after block","Insert paragraph before block":"Insert paragraph before block","Insert row above":"Insert row above","Insert row below":"Insert row below","Insert table":"Insert table",Inset:"Inset",Italic:"Italic",Justify:"Justify","Justify cell text":"Justify cell text","Left aligned image":"Left aligned image","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey",Link:"Link","Link URL":"Link URL","Merge cell down":"Merge cell down","Merge cell left":"Merge cell left","Merge cell right":"Merge cell right","Merge cell up":"Merge cell up","Merge cells":"Merge cells",Next:"Next",None:"None","Numbered List":"Numbered List","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab",Orange:"Orange",Original:"Original",Outset:"Outset",Padding:"Padding",Paragraph:"Paragraph","Pink marker":"Pink marker","Plain text":"Plain text",Previous:"Previous",Purple:"Purple",Red:"Red","Red pen":"Red pen",Redo:"Redo","Remove color":"Remove color","Remove Format":"Remove Format","Remove highlight":"Remove highlight","Resize image":"Resize image","Resize image to %0":"Resize image to %0","Resize image to the original size":"Resize image to the original size","Restore default":"Restore default",Ridge:"Ridge","Right aligned image":"Right aligned image","Rich Text Editor":"Rich Text Editor","Rich Text Editor, %0":"Rich Text Editor, %0",Row:"Row",Save:"Save","Select all":"Select all","Select column":"Select column","Select row":"Select row","Show more items":"Show more items","Side image":"Side image",Small:"Small",Solid:"Solid","Split cell horizontally":"Split cell horizontally","Split cell vertically":"Split cell vertically",Strikethrough:"Strikethrough",Style:"Style",Subscript:"Subscript",Superscript:"Superscript","Table alignment toolbar":"Table alignment toolbar","Table cell text alignment":"Table cell text alignment","Table properties":"Table properties","Table toolbar":"Table toolbar","Text alignment":"Text alignment","Text alignment toolbar":"Text alignment toolbar","Text alternative":"Text alternative","Text highlight toolbar":"Text highlight toolbar",'The color is invali
5d. Try "#FF0000" or "rgb(255,0,0)" or "red".':'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".','The value is invalid. Try "10px" or "2em" or simply "2".':'The value is invalid. Try "10px" or "2em" or simply "2".',"This link has no URL":"This link has no URL",Tiny:"Tiny","Toggle caption off":"Toggle caption off","Toggle caption on":"Toggle caption on",Turquoise:"Turquoise",Underline:"Underline",Undo:"Undo",Unlink:"Unlink","Vertical text alignment toolbar":"Vertical text alignment toolbar",White:"White","Widget toolbar":"Widget toolbar",Width:"Width","Wrap text":"Wrap text",Yellow:"Yellow","Yellow marker":"Yellow marker"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.InlineEditor=t():e.InlineEditor=t()}(window,function(){return i=[function(e,t,i){"use strict";i.d(t,"a",function(){return n}),i.d(t,"b",function(){return r});const o="https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html";class n extends Error{constructor(e,t,i){super(`${e}${i?` ${JSON.stringify(i)}`:""}${s(e)}`),this.name="CKEditorError",this.context=t,this.data=i}is(e){return"CKEditorError"===e}static rethrowUnexpectedError(e,t){if(e.is&&e.is("CKEditorError"))throw e;const i=new n(e.message,t);throw i.stack=e.stack,i}}function r(e,t){console.warn(...a(e,t))}function s(e){return`\nRead more: ${o}#error-${e}`}function a(e,t){var i=s(e);return t?[e,t,i]:[e,i]}},function(e,t,n){"use strict";var i,o,a=function(){return i=void 0===i?Boolean(window&&document&&document.all&&!window.atob):i},r=(o={},function(e){if(void 0===o[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}o[e]=t}return o[e]}),c=[];function d(e){for(var t=-1,i=0;i<c.length;i++)if(c[i].identifier===e){t=i;break}return t}function l(e,t){for(var i={},o=[],n=0;n<e.length;n++){var r=e[n],s=t.base?r[0]+t.base:r[0],a=i[s]||0,l="".concat(s," ").concat(a);i[s]=a+1;a=d(l),r={css:r[1],media:r[2],sourceMap:r[3]};-1!==a?(c[a].references++,c[a].updater(r)):c.push({identifier:l,updater:function(t,e){var i,o,n;{var r;n=e.singleton?(r=f++,i=m=m||h(e),o=g.bind(null,i,r,!1),g.bind(null,i,r,!0)):(i=h(e),o=function(e,t,i){var o=i.css,n=i.media,i=i.sourceMap;n?e.setAttribute("media",n):e.removeAttribute("media");i&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */"));if(e.styleSheet)e.styleSheet.cssText=o;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(o))}}.bind(null,i,e),function(){!function(e){if(null===e.parentNode)return;e.parentNode.removeChild(e)}(i)})}return o(t),function(e){e?e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap||o(t=e):n()}}(r,t),references:1}),o.push(l)}return o}function h(e){var t,i=document.createElement("style"),o=e.attributes||{};if(void 0!==o.nonce||(t=n.nc)&&(o.nonce=t),Object.keys(o).forEach(function(e){i.setAttribute(e,o[e])}),"function"==typeof e.insert)e.insert(i);else{e=r(e.insert||"head");if(!e)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");e.appendChild(i)}return i}var s,u=(s=[],function(e,t){return s[e]=t,s.filter(Boolean).join("\n")});function g(e,t,i,o){i=i?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;e.styleSheet?e.styleSheet.cssText=u(t,i):(o=document.createTextNode(i),(i=e.childNodes)[t]&&e.removeChild(i[t]),i.length?e.insertBefore(o,i[t]):e.appendChild(o))}var m=null,f=0;e.exports=function(e,r){(r=r||{}).singleton||"boolean"==typeof r.singleton||(r.singleton=a());var s=l(e=e||[],r);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var t=0;t<s.length;t++){var i=d(s[t]);c[i].references--}for(var e=l(e,r),o=0;o<s.length;o++){var n=d(s[o]);0===c[n].references&&(c[n].updater(),c.splice(n,1))}s=e}}}},,function(e,t,i){"use strict";var o=i(7),i="object"==typeof self&&self&&self.Object===Object&&self,i=o.a||i||Function("return this")();t.a=i},function(e,n,r){"use strict";!function(e){var t=r(3),i=r(17),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,e=o&&"object"==typeof e&&e&&!e.nodeType&&e,t=e&&e.exports===o?t.a.Buffer:void 0,i=(t?t.isBuffer:void 0)||i.a;n.a=i}.call(this,r(9)(e))},function(e,r,s){"use strict";!function(e){var t=s(7),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,n=o&&o.exports===i&&t.a.process,t=function(){try{var e=o&&o.require&&o.require("util").t
5ypes;return e?e:n&&n.binding&&n.binding("util")}catch(e){}}();r.a=t}.call(this,s(9)(e))},function(e,t,o){"use strict";!function(e){var t=o(0);const i="object"==typeof window?window:e;if(i.CKEDITOR_VERSION)throw new t.a("ckeditor-duplicated-modules",null);i.CKEDITOR_VERSION="29.2.0"}.call(this,o(12))},function(e,t,i){"use strict";!function(e){e="object"==typeof e&&e&&e.Object===Object&&e;t.a=e}.call(this,i(12))},function(e,n,r){"use strict";!function(e){var t=r(3),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,e=i&&"object"==typeof e&&e&&!e.nodeType&&e,t=e&&e.exports===i?t.a.Buffer:void 0,o=t?t.allocUnsafe:void 0;n.a=function(e,t){return t?e.slice():(t=e.length,t=o?o(t):new e.constructor(t),e.copy(t),t)}}.call(this,r(9)(e))},function(e,t){e.exports=function(e){var t;return e.webpackPolyfill||((t=Object.create(e)).children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1),t}},function(e,t,i){var o=i(1),n=i(85),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t,i){var o=i(1),n=i(86),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){var i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t,i){var o=i(1),n=i(77),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t,i){var o=i(1),n=i(80),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t,i){var o=i(1),n=i(121),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t,i){var o=i(1),n=i(122),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t,i){"use strict";t.a=function(){return!1}},function(e,t,i){e.exports=i(127)},function(e,t,i){var o=i(1),n=i(20),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck.ck-placeholder,.ck .ck-placeholder{position:relative}.ck.ck-placeholder:before,.ck .ck-placeholder:before{position:absolute;left:0;right:0;content:attr(data-placeholder);pointer-events:none}.ck.ck-read-only .ck-placeholder:before{display:none}.ck.ck-placeholder:before,.ck .ck-placeholder:before{cursor:text;color:var(--ck-color-engine-placeholder-text)}"},function(e,t,i){var o=i(1),n=i(22),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck-hidden{display:none!important}.ck-reset,.ck-reset_all,.ck-reset_all *{box-sizing:border-box;width:auto;height:auto;position:static}:root{--ck-z-default:1;--ck-z-modal:calc(var(--ck-z-default) + 999)}.ck-transitions-disabled,.ck-transitions-disabled *{transition:none!important}:root{--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#c4c4c4;--ck-color-base-action:#61b045;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#198cf0;--ck-color-base-active-focus:#0e7fe1;--ck-color-base-error:#db3700;--ck-color-focus-border-coordinates:208,79%,51%;--ck-color-focus-border:hsl(var(--ck-color-focus-border-coordinates));--ck-color-focus-outer-shadow:#bcdefb;--ck-color-focus-disabled-shadow:rgba(119,186,248,0.3);--ck-color-focus-error-shadow:rgba(255,64,31,0.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,0.15);--ck-color-shadow-drop-active:rgba(0,0,0,0.2);--ck-color-shadow-inner:rgba(0,0,0,0.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#e6e6e6;--ck-color-button-default-active-background:#d9d9d9;--ck-color-button-default-active-shadow:#bfbfbf;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#dedede;--ck-color-button-on-hover-background:#c4c4c4;--ck-color-button-on-active-background:#bababa;--ck-color-button-on-active-shadow:#a1a1a1;--ck-color-button-on-disabled-background:#dedede;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#579e3d;--ck-color-button-action-active-background:#53973b;--ck-color-button-action-active-shadow:#498433;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#b0b0b0;--ck-color-switch-button-off-hover-background:#a3a3a3;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-on-hover-background:#579e3d;--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-switch-button-inner-shadow:rgba(0,0,0,0.1);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:#c7c7c7;--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:#c7c7c7;--ck-color-input-disabled-text:#757575;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-base-active);--ck-color-list-button-on-background-focus:var(--ck-color-base-active-focus);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-foreground);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,177,255,0.1);--ck-color-link-fake-selection:rgba(31,177,255,0.3);--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}
5.ck-reset,.ck-reset_all,.ck-reset_all *{margin:0;padding:0;border:0;background:transparent;text-decoration:none;vertical-align:middle;transition:none;word-wrap:break-word}.ck-reset_all,.ck-reset_all *{border-collapse:collapse;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);color:var(--ck-color-text);text-align:left;white-space:nowrap;cursor:auto;float:none}.ck-reset_all .ck-rtl *{text-align:right}.ck-reset_all iframe{vertical-align:inherit}.ck-reset_all textarea{white-space:pre-wrap}.ck-reset_all input[type=password],.ck-reset_all input[type=text],.ck-reset_all textarea{cursor:text}.ck-reset_all input[type=password][disabled],.ck-reset_all input[type=text][disabled],.ck-reset_all textarea[disabled]{cursor:default}.ck-reset_all fieldset{padding:10px;border:2px groove #dfdee3}.ck-reset_all button::-moz-focus-inner{padding:0;border:0}.ck[dir=rtl],.ck[dir=rtl] .ck{text-align:right}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}"},function(e,t,i){var o=i(1),n=i(24),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=":root{--ck-color-editable-blur-selection:#d9d9d9}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}"},function(e,t,i){var o=i(1),n=i(26),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=":root{--ck-dropdown-max-width:75vw}.ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on .ck-tooltip{display:none}.ck.ck-dropdown .ck-dropdown__panel{-webkit-backface-visibility:hidden;display:none;z-index:var(--ck-z-modal);max-width:var(--ck-dropdown-max-width);position:absolute}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{top:100%;bottom:auto}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left
5:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s{left:50%;transform:translateX(-50%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw{left:75%;transform:translateX(-75%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme{left:25%;transform:translateX(-25%)}.ck.ck-toolbar .ck-dropdown__panel{z-index:calc(var(--ck-z-modal) + 1)}:root{--ck-dropdown-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-dropdown .ck-dropdown__arrow{right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-dropdown .ck-dropdown__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{width:7em;overflow:hidden;text-overflow:ellipsis}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-dropdown__button_label-width_auto .ck-button__label{width:auto}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active{box-shadow:none}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active:focus,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-dropdown__panel{border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dropdown__panel{box-shadow:var(--ck-drop-shadow),0 0;background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;min-width:100%}.ck.ck-dropdown__panel.ck-dropdown__panel_se{border-top-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_sw{border-top-right-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_ne{border-bottom-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_nw{border-bottom-right-radius:0}"},function(e,t,i){var o=i(1),n=i(28),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{width:var(--ck-icon-size);height:var(--ck-icon-size);font-size:.8333350694em;will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon :not([fill]){fill:currentColor}"},function(e,t,i){var o=i(1),n=i(30),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports='.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck.ck-tooltip{visibility:hidden;opacity:0;display:none;z-index:var(--ck-z-modal)}.ck.ck-tooltip .ck-tooltip__text{display:inline-block}.ck.ck-tooltip .ck-tooltip__text:after{content:"";width:0;height:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%;top:0;transition:opacity .2s ease-in-out .2s}.ck.ck-tooltip .ck-tooltip__text{border-radius:0}.ck-rounded-corners .ck.ck-tooltip .ck-tooltip__text,.ck.ck-tooltip .ck-tooltip__text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-tooltip .ck-tooltip__text{font-size:.9em;line-height:1.5;color:var(--ck-color-tooltip-text);padding:var(--ck-spacing-small) var(--ck-spacing-medium);background:var(--ck-color-tooltip-background);position:relative;
5left:-50%}.ck.ck-tooltip .ck-tooltip__text:after{transition:opacity .2s ease-in-out .2s;border-style:solid;left:50%}.ck.ck-tooltip.ck-tooltip_s,.ck.ck-tooltip.ck-tooltip_se,.ck.ck-tooltip.ck-tooltip_sw{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{top:calc(var(--ck-tooltip-arrow-size)*-1 + 1px);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:var(--ck-color-tooltip-background);border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:0}.ck.ck-tooltip.ck-tooltip_sw{right:50%;left:auto}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text{left:auto;right:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{left:auto;right:0}.ck.ck-tooltip.ck-tooltip_se{left:50%;right:auto}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text{right:auto;left:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after{right:auto;left:0;transform:translateX(50%)}.ck.ck-tooltip.ck-tooltip_n{top:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;border-top-color:var(--ck-color-tooltip-background);border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:0;border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_e{left:calc(100% + var(--ck-tooltip-arrow-size));top:50%}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text:after{left:calc(var(--ck-tooltip-arrow-size)*-1);top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:transparent;border-bottom-color:transparent;border-right-color:var(--ck-color-tooltip-background);border-top-color:transparent;border-left-width:0;border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_w{right:calc(100% + var(--ck-tooltip-arrow-size));left:auto;top:50%}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text:after{left:100%;top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:var(--ck-color-tooltip-background);border-bottom-color:transparent;border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:0;border-top-width:var(--ck-tooltip-arrow-size)}'},function(e,t,i){var o=i(1),n=i(32),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck.ck-button,a.ck.ck-button{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:block}@media (hover:none){.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:none}}.ck.ck-button,a.ck.ck-button{position:relative;display:inline-flex;align-items:center;justify-content:left}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{display:none}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button:hover .ck-tooltip,a.ck.ck-button:hover .ck-tooltip{visibility:visible;opacity:1}.ck.ck-button:focus:not(:hover) .ck-tooltip,a.ck.ck-button:focus:not(:hover) .ck-tooltip{display:none}.ck.ck-button,a.ck.ck-button{background:var(--ck-color-button-default-background)}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-default-active-shadow)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck.ck-button,a.ck.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.
5ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button,a.ck.ck-button{white-space:nowrap;cursor:default;vertical-align:middle;padding:var(--ck-spacing-tiny);text-align:center;min-width:var(--ck-ui-component-min-height);min-height:var(--ck-ui-component-min-height);line-height:1;font-size:inherit;border:1px solid transparent;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;-webkit-appearance:none}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{font-size:inherit;font-weight:inherit;color:inherit;cursor:inherit;vertical-align:middle}[dir=ltr] .ck.ck-button .ck-button__label,[dir=ltr] a.ck.ck-button .ck-button__label{text-align:left}[dir=rtl] .ck.ck-button .ck-button__label,[dir=rtl] a.ck.ck-button .ck-button__label{text-align:right}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{color:inherit}[dir=ltr] .ck.ck-button .ck-button__keystroke,[dir=ltr] a.ck.ck-button .ck-button__keystroke{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-button .ck-button__keystroke,[dir=rtl] a.ck.ck-button .ck-button__keystroke{margin-right:var(--ck-spacing-large)}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{font-weight:700;opacity:.7}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__icon{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__keystroke,a.ck.ck-button.ck-disabled .ck-button__keystroke{opacity:.3}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}[dir=ltr] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=ltr] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=rtl] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-right:calc(var(--ck-spacing-small)*-1);margin-left:var(--ck-spacing-small)}.ck.ck-button.ck-button_with-keystroke .ck-button__label,a.ck.ck-button.ck-button_with-keystroke .ck-button__label{flex-grow:1}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-on-active-shadow)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-action-active-shadow)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-action,a.ck.ck-button-action{color:var(--ck-color-button-action-text)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}"},function(e,t,i){var o=i(1),n=i(34),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};
5o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck.ck-list{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:column}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{list-style-type:none;background:var(--ck-color-list-background)}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{min-height:unset;width:100%;text-align:left;border-radius:0;padding:calc(var(--ck-line-height-base)*0.2*var(--ck-font-size-base)) calc(var(--ck-line-height-base)*0.4*var(--ck-font-size-base))}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(var(--ck-line-height-base)*1.2*var(--ck-font-size-base))}.ck.ck-list__item .ck-button:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on{background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item .ck-button.ck-on:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item .ck-button.ck-on:focus:not(.ck-disabled){border-color:var(--ck-color-base-background)}.ck.ck-list__item .ck-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item .ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item .ck-switchbutton.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck.ck-list__separator{height:1px;width:100%;background:var(--ck-color-base-border)}"},function(e,t,i){var o=i(1),n=i(36),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:1.0769230769em;--ck-switch-button-toggle-spacing:1px;--ck-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - var(--ck-switch-button-toggle-spacing)*2)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(var(--ck-spacing-large)*2)}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(var(--ck-spacing-large)*2)}.ck.ck-button.ck-switchbutton .ck-button__toggle{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle.ck-rounded-corners{border-radius:var(--ck-border-radius)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-right:auto}.ck.ck-button.ck-switchbutton .ck-button__toggle{transition:background .4s ease;width:var(--ck-switch-button-toggle-width);background:var(--ck-color-switch-button-off-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:calc(var(--ck-border-radius)*0.5)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{margin:var(--ck-switch-button-toggle-spacing);width:var(--ck-switch-button-toggle-inner-size);height:var(--ck-switch-button-toggle-inner-size);background:var(--ck-color-switch-button-inner-background);transition:all .3s ease}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover{background:var(--ck-color-switch-button-off-hover-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover .ck-button__toggle__inner{box-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle{background:var(--ck-color-switch-button-on-background)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle:hover{background:var(--ck-color-switch-button-on-hover-background)}[dir=ltr] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(var(--ck-switch-button-translation))}[dir=rtl] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(calc(var(--ck-switch-button-translation)*-1))}"},function(e,t,i){var o=i(1),n=i(38),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};
5o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=":root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown>.ck-dropdown__panel{width:max-content;max-width:var(--ck-toolbar-dropdown-max-width)}.ck.ck-toolbar-dropdown>.ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}"},function(e,t,i){var o=i(1),n=i(40),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}"},function(e,t,i){var o=i(1),n=i(42),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck.ck-toolbar{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-flow:row nowrap;align-items:center}.ck.ck-toolbar>.ck-toolbar__items{display:flex;flex-flow:row wrap;align-items:center;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar .ck-toolbar__line-break{flex-basis:100%}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);padding:0 var(--ck-spacing-small);border:1px solid var(--ck-color-toolbar-border)}.ck.ck-toolbar .ck.ck-toolbar__separator{align-self:stretch;width:1px;min-width:1px;background:var(--ck-color-toolbar-border);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar .ck-toolbar__line-break{height:0}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break){margin-right:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items:empty+.ck.ck-toolbar__separator{display:none}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break),.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{width:100%;margin:0;border-radius:0;border:0}.ck.ck-toolbar.ck-toolbar_compact{padding:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>*{margin:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>:not(:first-child):not(:last-child){border-radius:0}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck{margin-right:0}.ck.ck-toolbar[dir=rtl]:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-left:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-right:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-right:var(--ck-spacing-small)}"},function(e,t,i){var o=i(1),n=i(44),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};
5o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#000}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{width:var(--ck-color-grid-tile-size);height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);padding:0;transition:box-shadow .2s ease;border:0}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile.ck-color-table__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.ck.ck-color-grid__tile .ck.ck-icon{display:none;color:var(--ck-color-color-grid-check-icon)}.ck.ck-color-grid__tile.ck-on{box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-base-text)}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__tile.ck-on,.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){border:0}.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}"},function(e,t,i){var o=i(1),n=i(46),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports='.ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button .ck-tooltip{display:none}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-top-right-radius:unset;border-bottom-right-radius:unset}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-top-left-radius:unset;border-bottom-left-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow{min-width:unset}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-top-left-radius:unset;border-bottom-left-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-top-right-radius:unset;border-bottom-right-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow svg{width:var(--ck-dropdown-arrow-size)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover),.ck.ck-splitbutton:hover>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover){background:var(--ck-color-split-button-hover-background)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{content:"";position:absolute;width:1px;height:100%;background-color:var(--ck-color-split-button-hover-border)}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{left:-1px}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{right:-1px}.ck.ck-splitbutton.ck-splitbutton_open{border-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__action{border-bottom-left-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__arrow{border-bottom-right-radius:0}'},function(e,t,i){var o=i(1),n=i(48),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};
5o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"},function(e,t,i){var o=i(1),n=i(50),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck.ck-form__header{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between}:root{--ck-form-header-height:38px}.ck.ck-form__header{padding:var(--ck-spacing-small) var(--ck-spacing-large);height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-form__header .ck-form__header__label{font-weight:700}"},function(e,t,i){var o=i(1),n=i(52),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=":root{--ck-input-text-width:18em}.ck.ck-input-text{border-radius:0}.ck-rounded-corners .ck.ck-input-text,.ck.ck-input-text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-text{background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);min-width:var(--ck-input-text-width);min-height:var(--ck-ui-component-min-height);transition:box-shadow .1s ease-in-out,border .1s ease-in-out}.ck.ck-input-text:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-input-text[readonly]{border:1px solid var(--ck-color-input-disabled-border);background:var(--ck-color-input-disabled-background);color:var(--ck-color-input-disabled-text)}.ck.ck-input-text[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-input-text.ck-error{border-color:var(--ck-color-input-error-border);animation:ck-text-input-shake .3s ease both}.ck.ck-input-text.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),0 0}@keyframes ck-text-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}"},function(e,t,i){var o=i(1),n=i(54),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}.ck.ck-labeled-field-view .ck.ck-label{display:block;position:absolute}:root{--ck-labeled-field-view-transition:.1s cubic-bezier(0,0,0.24,0.95);--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-spacing-medium);--ck-color-labeled-field-label-background:var(--ck-color-base-background)}.ck.ck-labeled-field-view{border-radius:0}.ck-rounded-corners .ck.ck-labeled-field-view,.ck.ck-labeled-field-view.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{width:100%}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{top:0}[dir=ltr] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{left:0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{pointer-events:none;transform-origin:0 0;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);background:var(--ck-color-labeled-field-label-background);padding:0 calc(var(--ck-font-size-tiny)*0.5);line-height:normal;font-weight:400;text-overflow:ellipsis;overflow:hidden;max-width:100%;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}.ck.ck-labeled-field-view.ck-error .ck-input:not([readonly])+.ck.ck-label,.ck.ck-labeled-field-view.ck-error>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status.ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>
5.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-input-disabled-text)}[dir=ltr] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=ltr] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(var(--ck-spacing-medium),calc(var(--ck-font-size-base)*0.6)) scale(1)}[dir=rtl] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=rtl] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(calc(var(--ck-spacing-medium)*-1),calc(var(--ck-font-size-base)*0.6)) scale(1)}.ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));background:transparent;padding:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck.ck-button{background:transparent}.ck.ck-labeled-field-view.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck-button>.ck-button__label{opacity:0}.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown+.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard))}"},function(e,t,i){var o=i(1),n=i(56),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=':root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:"";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px;--ck-balloon-arrow-drop-shadow:0 2px 2px var(--ck-color-shadow-drop)}.ck.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{width:0;height:0;border-style:solid}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:var(--ck-balloon-arrow-height);border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:0}.ck.ck-balloon-panel[class*=arrow_n]:before{border-bottom-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-color:transparent;border-right-color:transparent;border-top-color:transparent}.ck.ck-balloon-panel[class*=arrow_n]:after{border-bottom-color:var(--ck-color-panel-background);margin-top:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:0;border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-top-color:var(--ck-color-panel-border);filter:drop-shadow(var(--ck-balloon-arrow-drop-shadow))}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent}.ck.ck-balloon-panel[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background);margin-bottom:var(--ck-balloon-arrow-offset)}
5.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{right:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{right:25%;margin-right:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}
5.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{right:25%;margin-right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}'},function(e,t,i){var o=i(1),n=i(58),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck .ck-balloon-rotator__navigation{display:flex;align-items:center;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-small)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}"},function(e,t,i){var o=i(1),n=i(60),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-modal) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);width:100%;height:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}"},function(e,t,i){var o=i(1),n=i(62),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{z-index:var(--ck-z-modal);position:fixed;top:0}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{top:auto;position:absolute}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{box-shadow:var(--ck-drop-shadow),0 0;border-width:0 1px 1px;border-top-left-radius:0;border-top-right-radius:0}"},function(e,t,i){var o=i(1),n=i(64),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck.ck-block-toolbar-button{position:absolute;z-index:var(--ck-z-default)}:root{--ck-color-block-toolbar-button:var(--ck-color-text);--ck-block-toolbar-button-size:var(--ck-font-size-normal)}.ck.ck-block-toolbar-button{color:var(--ck-color-block-toolbar-button);font-size:var(--ck-block-toolbar-size)}"},function(e,t,i){var o=i(1),n=i(66),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports='.ck .ck-widget .ck-widget__type-around__button{display:block;position:absolute;overflow:hidden;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{position:absolute;top:50%;left:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{top:calc(var(--ck-widget-outline-thickness)*-0.5);left:min(10%,30px);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-0.5);right:min(10%,30px);transform:translateY(50%)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{content:"";display:block;position:absolute;top:1px;left:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;position:absolute;
5left:0;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{top:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none}:root{--ck-widget-type-around-button-size:20px;--ck-color-widget-type-around-button-active:var(--ck-color-focus-border);--ck-color-widget-type-around-button-hover:var(--ck-color-widget-hover-border);--ck-color-widget-type-around-button-blurred-editable:var(--ck-color-widget-blurred-border);--ck-color-widget-type-around-button-radar-start-alpha:0;--ck-color-widget-type-around-button-radar-end-alpha:.3;--ck-color-widget-type-around-button-icon:var(--ck-color-base-background)}.ck .ck-widget .ck-widget__type-around__button{width:var(--ck-widget-type-around-button-size);height:var(--ck-widget-type-around-button-size);background:var(--ck-color-widget-type-around-button);border-radius:100px;transition:opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);opacity:0;pointer-events:none}.ck .ck-widget .ck-widget__type-around__button svg{width:10px;height:8px;transform:translate(-50%,-50%);transition:transform .5s ease;margin-top:1px}.ck .ck-widget .ck-widget__type-around__button svg *{stroke-dasharray:10;stroke-dashoffset:0;fill:none;stroke:var(--ck-color-widget-type-around-button-icon);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.ck .ck-widget .ck-widget__type-around__button svg line{stroke-dasharray:7}.ck .ck-widget .ck-widget__type-around__button:hover{animation:ck-widget-type-around-button-sonar 1s ease infinite}.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:ck-widget-type-around-arrow-dash 2s linear}.ck .ck-widget .ck-widget__type-around__button:hover svg line{animation:ck-widget-type-around-arrow-tip-dash 2s linear}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:1;pointer-events:auto}.ck .ck-widget:not(.ck-widget_selected)>.ck-widget__type-around>.ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button-hover)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover{background:var(--ck-color-widget-type-around-button-active)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{width:calc(var(--ck-widget-type-around-button-size) - 2px);height:calc(var(--ck-widget-type-around-button-size) - 2px);border-radius:100px;background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3))}.ck .ck-widget.ck-widget_with-selection-handle>.ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:20px}.ck .ck-widget .ck-widget__type-around__fake-caret{pointer-events:none;height:1px;animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;outline:1px solid hsla(0,0%,100%,.5);background:var(--ck-color-base-text)}.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_after,.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_before{outline-color:transparent}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected:hover,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:0}
5.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer{opacity:0}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:0;margin-right:20px}.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover){background:var(--ck-color-widget-type-around-button-blurred-editable)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover) svg *{stroke:#999}@keyframes ck-widget-type-around-arrow-dash{0%{stroke-dashoffset:10}20%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-arrow-tip-dash{0%,20%{stroke-dashoffset:7}40%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-button-sonar{0%{box-shadow:0 0 0 0 hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}50%{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-end-alpha))}to{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}}@keyframes ck-widget-type-around-fake-caret-pulse{0%{opacity:1}49%{opacity:1}50%{opacity:0}99%{opacity:0}
5to{opacity:1}}'},function(e,t,i){var o=i(1),n=i(68),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2;--ck-resizer-border-radius:var(--ck-border-radius);--ck-resizer-tooltip-offset:10px;--ck-resizer-tooltip-height:calc(var(--ck-spacing-small)*2 + 10px)}.ck .ck-widget,.ck .ck-widget.ck-widget_with-selection-handle{position:relative}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{position:absolute}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{visibility:visible}.ck .ck-size-view{background:var(--ck-color-resizer-tooltip-background);color:var(--ck-color-resizer-tooltip-text);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);font-size:var(--ck-font-size-tiny);display:block;padding:0 var(--ck-spacing-small);height:var(--ck-resizer-tooltip-height);line-height:var(--ck-resizer-tooltip-height)}.ck .ck-size-view.ck-orientation-above-center,.ck .ck-size-view.ck-orientation-bottom-left,.ck .ck-size-view.ck-orientation-bottom-right,.ck .ck-size-view.ck-orientation-top-left,.ck .ck-size-view.ck-orientation-top-right{position:absolute}.ck .ck-size-view.ck-orientation-top-left{top:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{top:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-right{bottom:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-left{bottom:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-above-center{top:calc(var(--ck-resizer-tooltip-height)*-1);left:50%;transform:translate(-50%)}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{outline-width:var(--ck-widget-outline-thickness);outline-style:solid;outline-color:transparent;transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{box-shadow:var(--ck-inner-shadow),0 0;background-color:var(--ck-color-widget-editable-focus-background)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{padding:4px;box-sizing:border-box;background-color:transparent;opacity:0;transition:background-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),visibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;transform:translateY(-100%);left:calc(0px - var(--ck-widget-outline-thickness));top:0}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{width:var(--ck-widget-handler-icon-size);height:var(--ck-widget-handler-icon-size);color:var(--ck-color-widget-drag-handler-icon-color)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-focus-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:1}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck.ck-editor__editable.ck-read-only .ck-widget{transition:none}.ck.ck-editor__editable.ck-read-only .ck-widget:not(.ck-widget_selected){--ck-widget-outline-thickness:0px}.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}"},function(e,t,i){var o=i(1),n=i(70),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};
5o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports='.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position{display:inline;position:relative;pointer-events:none}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{position:absolute;width:0}.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__selection-handle,.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__type-around{display:none}:root{--ck-clipboard-drop-target-dot-width:12px;--ck-clipboard-drop-target-dot-height:8px;--ck-clipboard-drop-target-color:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{bottom:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);top:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);border:1px solid var(--ck-clipboard-drop-target-color);background:var(--ck-clipboard-drop-target-color);margin-left:-1px}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span:after{content:"";width:0;height:0;display:block;position:absolute;left:50%;top:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);transform:translateX(-50%);border-left:calc(var(--ck-clipboard-drop-target-dot-width)*0.5) solid transparent;border-bottom:0 solid transparent;border-right:calc(var(--ck-clipboard-drop-target-dot-width)*0.5) solid transparent;border-top:calc(var(--ck-clipboard-drop-target-dot-height)) solid var(--ck-clipboard-drop-target-color)}.ck.ck-editor__editable .ck-widget.ck-clipboard-drop-target-range{outline:var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color)!important}.ck.ck-editor__editable .ck-widget:-webkit-drag{zoom:.6;outline:none!important}'},function(e,t,i){var o=i(1),n=i(72),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck .ck-button.ck-color-table__remove-color{display:flex;align-items:center;width:100%}label.ck.ck-color-grid__label{font-weight:unset}.ck .ck-button.ck-color-table__remove-color{padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck .ck-button.ck-color-table__remove-color:not(:focus){border-bottom:1px solid var(--ck-color-base-border)}[dir=ltr] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-left:var(--ck-spacing-standard)}"},function(e,t,i){var o=i(1),n=i(74),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck-content .text-tiny{font-size:.7em}.ck-content .text-small{font-size:.85em}.ck-content .text-big{font-size:1.4em}.ck-content .text-huge{font-size:1.8em}"},function(e,t,i){var o=i(1),n=i(76),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=":root{--ck-highlight-marker-yellow:#fdfd77;--ck-highlight-marker-green:#62f962;--ck-highlight-marker-pink:#fc7899;--ck-highlight-marker-blue:#72ccfd;--ck-highlight-pen-red:#e71313;--ck-highlight-pen-green:#128a00}.ck-content .marker-yellow{background-color:var(--ck-highlight-marker-yellow)}.ck-content .marker-green{background-color:var(--ck-highlight-marker-green)}.ck-content .marker-pink{background-color:var(--ck-highlight-marker-pink)}.ck-content .marker-blue{background-color:var(--ck-highlight-marker-blue)}.ck-content .pen-red{color:var(--ck-highlight-pen-red);background-color:transparent}.ck-content .pen-green{color:var(--ck-highlight-pen-green);background-color:transparent}"},function(e,t){e.exports=".ck-content code{background-color:hsla(0,0%,78%,.3);padding:.15em;border-radius:2px}.ck.ck-editor__editable .ck-code_selected{background-color:hsla(0,0%,78%,.5)}"},function(e,t,i){var o=i(1),n=i(79),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};
5o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;margin-right:0;font-style:italic;border-left:5px solid #ccc}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}"},function(e,t){e.exports=".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}"},function(e,t,i){var o=i(1),n=i(82),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;position:absolute;pointer-events:none;left:0;top:0}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{position:absolute;pointer-events:all}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{cursor:nesw-resize}:root{--ck-resizer-size:10px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-border-width:1px}.ck .ck-widget__resizer{outline:1px solid var(--ck-color-resizer)}.ck .ck-widget__resizer__handle{width:var(--ck-resizer-size);height:var(--ck-resizer-size);background:var(--ck-color-focus-border);border:var(--ck-resizer-border-width) solid #fff;border-radius:var(--ck-resizer-border-radius)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{top:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{top:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}"},function(e,t,i){var o=i(1),n=i(84),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-field-view{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}"},function(e,t){e.exports='.ck-vertical-form .ck-button:after{content:"";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{content:"";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-text-width)*0.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-large);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after,[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}'},function(e,t){e.exports=".ck-content .image{display:table;clear:both;text-align:center;margin:.9em auto;min-width:50px}.ck-content .image img{display:block;margin:0 auto;max-width:100%;min-width:100%}.ck-content .image-inline{display:inline-flex;max-width:100%;align-items:flex-start}.ck-content .image-inline picture{display:flex}.ck-content .image-inline img,.ck-content .image-inline picture{flex-grow:1;flex-shrink:1;max-width:100%}.ck.ck-editor__editable .image>figcaption.ck-placeholder:before{padding-left:inherit;padding-right:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ck.ck-editor__editable .image-inline.ck-widget_selected,.ck.ck-editor__editable .image.ck-widget_selected{z-index:1}.ck.ck-editor__editable .image-inline.ck-widget_selected ::selection{dis
5play:none}.ck.ck-editor__editable td .image-inline img,.ck.ck-editor__editable th .image-inline img{max-width:none}"},function(e,t,i){var o=i(1),n=i(88),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=":root{--ck-color-image-caption-background:#f7f7f7;--ck-color-image-caption-text:#333;--ck-color-image-caption-highligted-background:#fd0}.ck-content .image>figcaption{display:table-caption;caption-side:bottom;word-break:break-word;color:var(--ck-color-image-caption-text);background-color:var(--ck-color-image-caption-background);padding:.6em;font-size:.75em;outline-offset:-1px}.ck.ck-editor__editable .image>figcaption.image__caption_highlighted{animation:ck-image-caption-highlight .6s ease-out}@keyframes ck-image-caption-highlight{0%{background-color:var(--ck-color-image-caption-highligted-background)}to{background-color:var(--ck-color-image-caption-background)}}"},function(e,t,i){var o=i(1),n=i(90),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=":root{--ck-image-style-spacing:1.5em;--ck-inline-image-style-spacing:calc(var(--ck-image-style-spacing)/2)}.ck-content .image-style-block-align-left,.ck-content .image-style-block-align-right{max-width:calc(100% - var(--ck-image-style-spacing))}.ck-content .image-style-align-left,.ck-content .image-style-align-right{clear:none}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing);max-width:50%}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}.ck-content .image-style-block-align-right{margin-right:0;margin-left:auto}.ck-content .image-style-block-align-left{margin-left:0;margin-right:auto}.ck-content p+.image-style-align-left,.ck-content p+.image-style-align-right,.ck-content p+.image-style-side{margin-top:0}.ck-content .image-inline.image-style-align-left,.ck-content .image-inline.image-style-align-right{margin-top:var(--ck-inline-image-style-spacing);margin-bottom:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-left{margin-right:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-right{margin-left:var(--ck-inline-image-style-spacing)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-background)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after{display:none}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-hover-background)}"},function(e,t,i){var o=i(1),n=i(92),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};
5o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck-content .image.image_resized{max-width:100%;display:block;box-sizing:border-box}.ck-content .image.image_resized img{width:100%}.ck-content .image.image_resized>figcaption{display:block}.ck.ck-editor__editable td .image-inline.image_resized img,.ck.ck-editor__editable th .image-inline.image_resized img{max-width:100%}[dir=ltr] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-left:var(--ck-spacing-standard)}.ck.ck-dropdown .ck-button.ck-resize-image-button .ck-button__label{width:4em}"},function(e,t,i){var o=i(1),n=i(94),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-link_selected span.image-inline{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{height:100%;border-right:1px solid var(--ck-color-base-text);margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}"},function(e,t,i){var o=i(1),n=i(96),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck.ck-link-form{display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form_layout-vertical .ck-button.ck-button-cancel,.ck.ck-link-form_layout-vertical .ck-button.ck-button-save{margin-top:var(--ck-spacing-medium)}.ck.ck-link-form_layout-vertical{padding:0;min-width:var(--ck-input-text-width)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical .ck-button{padding:var(--ck-spacing-standard);margin:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border);width:50%}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button,[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin:var(--ck-spacing-standard) var(--ck-spacing-large)}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{border:0;padding:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}"},function(e,t,i){var o=i(1),n=i(98),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{padding:0 var(--ck-spacing-medium);color:var(--ck-color-link-default);text-overflow:ellipsis;cursor:pointer;max-width:var(--ck-input-text-width);min-width:3em;text-align:center}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{min-width:0;max-width:100%}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview),[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}}"},function(e,t,i){var o=i(1),n=i(100),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};
5o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck-content pre{padding:1em;color:#353535;background:hsla(0,0%,78%,.3);border:1px solid #c4c4c4;border-radius:2px;text-align:left;direction:ltr;tab-size:4;white-space:pre-wrap;font-style:normal;min-width:200px}.ck-content pre code{background:unset;padding:0;border-radius:0}.ck.ck-editor__editable pre{position:relative}.ck.ck-editor__editable pre[data-language]:after{content:attr(data-language);position:absolute}:root{--ck-color-code-block-label-background:#757575}.ck.ck-editor__editable pre[data-language]:after{top:-1px;right:10px;background:var(--ck-color-code-block-label-background);font-size:10px;font-family:var(--ck-font-face);line-height:16px;padding:var(--ck-spacing-tiny) var(--ck-spacing-medium);color:#fff;white-space:nowrap}.ck.ck-code-block-dropdown .ck-dropdown__panel{max-height:250px;overflow-y:auto;overflow-x:hidden}"},function(e,t,i){var o=i(1),n=i(102),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck-hidden{display:none!important}.ck-reset,.ck-reset_all,.ck-reset_all *{box-sizing:border-box;width:auto;height:auto;position:static}:root{--ck-z-default:1;--ck-z-modal:calc(var(--ck-z-default) + 999);--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#c4c4c4;--ck-color-base-action:#61b045;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#198cf0;--ck-color-base-active-focus:#0e7fe1;--ck-color-base-error:#db3700;--ck-color-focus-border-coordinates:208,79%,51%;--ck-color-focus-border:hsl(var(--ck-color-focus-border-coordinates));--ck-color-focus-outer-shadow:#bcdefb;--ck-color-focus-disabled-shadow:rgba(119,186,248,0.3);--ck-color-focus-error-shadow:rgba(255,64,31,0.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,0.15);--ck-color-shadow-drop-active:rgba(0,0,0,0.2);--ck-color-shadow-inner:rgba(0,0,0,0.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#e6e6e6;--ck-color-button-default-active-background:#d9d9d9;--ck-color-button-default-active-shadow:#bfbfbf;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#dedede;--ck-color-button-on-hover-background:#c4c4c4;--ck-color-button-on-active-background:#bababa;--ck-color-button-on-active-shadow:#a1a1a1;--ck-color-button-on-disabled-background:#dedede;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#579e3d;--ck-color-button-action-active-background:#53973b;--ck-color-button-action-active-shadow:#498433;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#b0b0b0;--ck-color-switch-button-off-hover-background:#a3a3a3;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-on-hover-background:#579e3d;--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-switch-button-inner-shadow:rgba(0,0,0,0.1);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:#c7c7c7;--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:#c7c7c7;--ck-color-input-disabled-text:#757575;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-base-active);--ck-color-list-button-on-background-focus:var(--ck-color-base-active-focus);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-foreground);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,177,255,0.1);--ck-color-link-fake-selection:rgba(31,177,255,0.3);--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}
5.ck-reset,.ck-reset_all,.ck-reset_all *{margin:0;padding:0;border:0;background:transparent;text-decoration:none;vertical-align:middle;transition:none;word-wrap:break-word}.ck-reset_all,.ck-reset_all *{border-collapse:collapse;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);color:var(--ck-color-text);text-align:left;white-space:nowrap;cursor:auto;float:none}.ck-reset_all .ck-rtl *{text-align:right}.ck-reset_all iframe{vertical-align:inherit}.ck-reset_all textarea{white-space:pre-wrap}.ck-reset_all input[type=password],.ck-reset_all input[type=text],.ck-reset_all textarea{cursor:text}.ck-reset_all input[type=password][disabled],.ck-reset_all input[type=text][disabled],.ck-reset_all textarea[disabled]{cursor:default}.ck-reset_all fieldset{padding:10px;border:2px groove #dfdee3}.ck-reset_all button::-moz-focus-inner{padding:0;border:0}.ck[dir=rtl],.ck[dir=rtl] .ck{text-align:right}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}"},function(e,t,i){var o=i(1),n=i(104),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{width:var(--ck-icon-size);height:var(--ck-icon-size);font-size:.8333350694em;will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon :not([fill]){fill:currentColor}"},function(e,t,i){var o=i(1),n=i(106),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports='.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck-tooltip{visibility:hidden;opacity:0;display:none;z-index:var(--ck-z-modal)}.ck-tooltip .ck-tooltip__text{display:inline-block}.ck-tooltip .ck-tooltip__text:after{content:"";width:0;height:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%;top:0;transition:opacity .2s ease-in-out .2s}.ck.ck-tooltip .ck-tooltip__text{border-radius:0}.ck-rounded-corners .ck.ck-tooltip .ck-tooltip__text,.ck.ck-tooltip .ck-tooltip__text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-tooltip .ck-tooltip__text{font-size:.9em;line-height:1.5;color:var(--ck-color-tooltip-text);padding:var(--ck-spacing-small) var(--ck-spacing-medium);background:var(--ck-color-tooltip-background);position:relative;left:-50%}.ck.ck-tooltip .ck-tooltip__text:after{transition:opacity .2s ease-in-out .2s;border-style:solid;left:50%}.ck.ck-tooltip.ck-tooltip_s,.ck.ck-tooltip.ck-tooltip_se,.ck.ck-tooltip.ck-tooltip_sw{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{top:calc(var(--ck-tooltip-arrow-size)*-1 + 1px);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:var(--ck-color-tooltip-background);border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:0}.ck.ck-tooltip.ck-tooltip_sw{right:50%;left:auto}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text{left:auto;right:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{left:auto;right:0}.ck.ck-tooltip.ck-tooltip_se{left:50%;right:auto}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text{right:auto;left:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after{right:auto;left:0;transform:translateX(50%)}.ck.ck-tooltip.ck-tooltip_n{top:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;border-top-color:var(--ck-color-tooltip-background);border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:0;border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_e{left:calc(100% + var(--ck-tooltip-arrow-size));top:50%}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text:after{left:calc(var(--ck-tooltip-arrow-size)*-1);top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:transparent;border-bottom-color:transparent;border-right-color:var(--ck-color-tooltip-background);border-top-color:transparent;border-left-width:0;border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_w{right:calc(100% + var(--ck-tooltip-arrow-size));left:auto;top:50%}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text:after{left:100%;top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:var(--ck-color-tooltip-background);border-bottom-color:transparent;border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:0;border-top-width:var(--ck-tooltip-arrow-size)}'},function(e,t,i){var o=i(1),n=i(108),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};
5o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck.ck-button,a.ck.ck-button{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:block}@media (hover:none){.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:none}}.ck.ck-button,a.ck.ck-button{position:relative;display:inline-flex;align-items:center;justify-content:left}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button:hover .ck-tooltip,a.ck.ck-button:hover .ck-tooltip{visibility:visible;opacity:1}.ck.ck-button .ck-button__label,.ck.ck-button:focus:not(:hover) .ck-tooltip,a.ck.ck-button .ck-button__label,a.ck.ck-button:focus:not(:hover) .ck-tooltip{display:none}.ck.ck-button,a.ck.ck-button{background:var(--ck-color-button-default-background)}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-default-active-shadow)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck.ck-button,a.ck.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button,a.ck.ck-button{white-space:nowrap;cursor:default;vertical-align:middle;padding:var(--ck-spacing-tiny);text-align:center;min-width:var(--ck-ui-component-min-height);min-height:var(--ck-ui-component-min-height);line-height:1;font-size:inherit;border:1px solid transparent;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;-webkit-appearance:none}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{font-size:inherit;font-weight:inherit;color:inherit;cursor:inherit;vertical-align:middle}[dir=ltr] .ck.ck-button .ck-button__label,[dir=ltr] a.ck.ck-button .ck-button__label{text-align:left}[dir=rtl] .ck.ck-button .ck-button__label,[dir=rtl] a.ck.ck-button .ck-button__label{text-align:right}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{color:inherit}[dir=ltr] .ck.ck-button .ck-button__keystroke,[dir=ltr] a.ck.ck-button .ck-button__keystroke{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-button .ck-button__keystroke,[dir=rtl] a.ck.ck-button .ck-button__keystroke{margin-right:var(--ck-spacing-large)}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{font-weight:700;opacity:.7}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__icon{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__keystroke,a.ck.ck-button.ck-disabled .ck-button__keystroke{opacity:.3}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}[dir=ltr] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=ltr] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=rtl] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-right:calc(var(--ck-spacing-small)*-1);margin-left:var(--ck-spacing-small)}.ck.ck-button.ck-button_with-keystroke .ck-button__label,a.ck.ck-button.ck-button_with-keystroke .ck-button__label{flex-grow:1}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-on-active-shadow)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-action-active-shadow)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-action,a.ck.ck-button-action{color:var(--ck-color-button-action-text)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}"},function(e,t,i){var o=i(1),n=i(110),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};
5o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=":root{--ck-color-table-focused-cell-background:rgba(158,207,250,0.3)}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table td.ck-editor__nested-editable:focus,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable:focus{background:var(--ck-color-table-focused-cell-background);border-style:none;outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}"},function(e,t,i){var o=i(1),n=i(112),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}:root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px}.ck .ck-insert-table-dropdown__grid{width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2);padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0}.ck .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{width:var(--ck-insert-table-dropdown-box-width);height:var(--ck-insert-table-dropdown-box-height);margin:var(--ck-insert-table-dropdown-box-margin);border:1px solid var(--ck-color-base-border);border-radius:1px}.ck .ck-insert-table-dropdown-grid-box.ck-on{border-color:var(--ck-color-focus-border);background:var(--ck-color-focus-outer-shadow)}"},function(e,t,i){var o=i(1),n=i(114),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=':root{--ck-table-selected-cell-background:rgba(158,207,250,0.3)}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{position:relative;caret-color:transparent;outline:unset;box-shadow:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected:after,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:after{content:"";pointer-events:none;background-color:var(--ck-table-selected-cell-background);position:absolute;top:0;left:0;right:0;bottom:0}.ck.ck-editor__editable .table table td.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table td.ck-editor__editable_selected:focus,.ck.ck-editor__editable .table table th.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:focus{background-color:transparent}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget_selected{outline:unset}'},function(e,t,i){var o=i(1),n=i(116),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck-content .table{margin:.9em auto;display:table}.ck-content .table table{border-collapse:collapse;border-spacing:0;width:100%;height:100%;border:1px double #b3b3b3}.ck-content .table table td,.ck-content .table table th{min-width:2em;padding:.4em;border:1px solid #bfbfbf}.ck-content .table table th{font-weight:700;background:hsla(0,0%,0%,5%)}.ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}.ck-editor__editable .ck-table-bogus-paragraph{display:inline-block;width:100%}"},function(e,t,i){var o=i(1),n=i(118),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck.ck-input-color{width:100%;display:flex;flex-direction:row-reverse}.ck.ck-input-color>input.ck.ck-input-text{min-width:auto;flex-grow:1}.ck.ck-input-color>div.ck.ck-dropdown{min-width:auto}.ck.ck-input-color>div.ck.ck-dropdown>.ck-input-color__button .ck-dropdown__arrow{display:none}.ck.ck-input-color .ck.ck-input-color__button .ck.ck-input-color__button__preview{position:relative;overflow:hidden}.ck.ck-input-color .ck.ck-input-color__button .ck.ck-input-color__button__preview>.ck.ck-input-color__button__preview__no-color-indicator{position:absolute;display:block}[dir=ltr] .ck.ck-input-color>.ck.ck-input-text{border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .ck.ck-input-color>.ck.ck-input-text{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{padding:0}[dir=ltr] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{border-left-width:0;border-top-left-radius:0;border-bottom-left-radius:0}[dir=rtl] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{border-right-width:0;border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button.ck-disabled{background:var(--ck-color-input-disabled-background)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview{border-radius:0}.ck-rounded-corners .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview,.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview{width:20px;height:20px;border:1px solid var(--ck-color-input-border)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview>.ck.ck-input-color__button__preview__no-color-indicator{top:-30%;left:50%;height:150%;width:8%;background:red;border-radius:2px;transform:rotate(45deg);transform-origin:50%}.ck.ck-input-color .ck.ck-input-color__remove-color{width:100%;border-bottom:1px solid var(--ck-color-input-border);padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard);border-bottom-left-radius:0;border-bottom-right-radius:0}[dir=ltr] .ck.ck-input-color .ck.ck-input-color__remove-color{border-top-right-radius:0}[dir=rtl] .ck.ck-input-color .ck.ck-input-color__remove-color{border-top-left-radius:0}.ck.ck-input-color .ck.ck-input-color__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-input-color .ck.ck-input-color__remove-color .ck.ck-icon{margin-right:0;margin-left:var(--ck-spacing-standard)}"},function(e,t,i){var o=i(1),n=i(120),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};
5o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck.ck-form__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.ck.ck-form__row>:not(.ck-label){flex-grow:1}.ck.ck-form__row.ck-table-form__action-row .ck-button-cancel,.ck.ck-form__row.ck-table-form__action-row .ck-button-save{justify-content:center}.ck.ck-form__row{padding:var(--ck-spacing-standard) var(--ck-spacing-large) 0}[dir=ltr] .ck.ck-form__row>:not(.ck-label)+*{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-form__row>:not(.ck-label)+*{margin-right:var(--ck-spacing-large)}.ck.ck-form__row>.ck-label{width:100%;min-width:100%}.ck.ck-form__row.ck-table-form__action-row{margin-top:var(--ck-spacing-large)}.ck.ck-form__row.ck-table-form__action-row .ck-button .ck-button__label{color:var(--ck-color-text)}"},function(e,t){e.exports=".ck.ck-form{padding:0 0 var(--ck-spacing-large)}.ck.ck-form:focus{outline:none}.ck.ck-form .ck.ck-input-text{min-width:100%;width:0}.ck.ck-form .ck.ck-dropdown{min-width:100%}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button:not(:focus){border:1px solid var(--ck-color-base-border)}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button .ck-button__label{width:100%}"},function(e,t){e.exports='.ck.ck-table-form .ck-form__row.ck-table-form__background-row,.ck.ck-table-form .ck-form__row.ck-table-form__border-row{flex-wrap:wrap}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row{flex-wrap:wrap;align-items:center}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-field-view{display:flex;flex-direction:column-reverse;align-items:center}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-field-view .ck.ck-dropdown,.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimension-operator{flex-grow:0}.ck.ck-table-form .ck.ck-labeled-field-view{position:relative}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{position:absolute;left:50%;bottom:calc(var(--ck-table-properties-error-arrow-size)*-1);transform:translate(-50%,100%);z-index:1}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status:after{content:"";position:absolute;top:calc(var(--ck-table-properties-error-arrow-size)*-1);left:50%;transform:translateX(-50%)}:root{--ck-table-properties-error-arrow-size:6px;--ck-table-properties-min-error-width:150px}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-labeled-field-view>.ck-label{font-size:var(--ck-font-size-tiny);text-align:center}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-style,.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-width{width:80px;min-width:80px;max-width:80px}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row{padding:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimensions-row__height,.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimensions-row__width{margin:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimension-operator{align-self:flex-end;display:inline-block;height:var(--ck-ui-component-min-height);line-height:var(--ck-ui-component-min-height);margin:0 var(--ck-spacing-small)}.ck.ck-table-form .ck.ck-labeled-field-view{padding-top:var(--ck-spacing-standard)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{border-radius:0}.ck-rounded-corners .ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status,.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{background:var(--ck-color-base-error);color:var(--ck-color-base-background);padding:var(--ck-spacing-small) var(--ck-spacing-medium);min-width:var(--ck-table-properties-min-error-width);text-align:center}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status:after{border-left:var(--ck-table-properties-error-arrow-size) solid transparent;border-bottom:var(--ck-table-properties-error-arrow-size) solid var(--ck-color-base-error);border-right:var(--ck-table-properties-error-arrow-size) solid transparent;border-top:0 solid transparent}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{animation:ck-table-form-labeled-view-status-appear .15s ease both}.ck.ck-table-form .ck.ck-labeled-field-view .ck-input.ck-error:not(:focus)+.ck.ck-labeled-field-view__status{display:none}@keyframes ck-table-form-labeled-view-status-appear{0%{opacity:0}
5to{opacity:1}}'},function(e,t,i){var o=i(1),n=i(124),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row{flex-wrap:wrap;flex-basis:0;align-content:baseline}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar .ck-toolbar__items{flex-wrap:nowrap}.ck.ck-table-properties-form{width:320px}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row{align-self:flex-end;padding:0}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar{background:none;margin-top:var(--ck-spacing-standard)}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar .ck-toolbar__items>*{width:40px}"},function(e,t,i){var o=i(1),n=i(126),i={injectType:"singletonStyleTag",insert:"head",singleton:!0};o(n="string"==typeof(n=n.__esModule?n.default:n)?[[e.i,n,""]]:n,i);e.exports=n.locals||{}},function(e,t){e.exports=".ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row{flex-wrap:wrap}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar:first-of-type{flex-grow:0.57}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar:last-of-type{flex-grow:0.43}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar .ck-button{flex-grow:1}.ck.ck-table-cell-properties-form{width:320px}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__padding-row{align-self:flex-end;padding:0;width:25%}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar{background:none;margin-top:var(--ck-spacing-standard)}"},function(e,t,i){"use strict";i.r(t),i.d(t,"MultirootEditor",function(){return L_}),i.d(t,"default",function(){return H_});var o=i(3),n=o.a.Symbol,r=Object.prototype,s=r.hasOwnProperty,a=r.toString,l=n?n.toStringTag:void 0;var c=function(e){var t=s.call(e,l),i=e[l];try{var o=!(e[l]=void 0)}catch(e){}var n=a.call(e);return o&&(t?e[l]=i:delete e[l]),n},d=Object.prototype.toString;var h=function(e){return d.call(e)},u=n?n.toStringTag:void 0;var g=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":(u&&u in Object(e)?c:h)(e)};var m=function(t,i){return function(e){return t(i(e))}},f=m(Object.getPrototypeOf,Object);var p=function(e){return null!=e&&"object"==typeof e},b=Function.prototype,k=Object.prototype,w=b.toString,v=k.hasOwnProperty,_=w.call(Object);var y=function(e){return!(!p(e)||"[object Object]"!=g(e))&&(null===(e=f(e))||"function"==typeof(e=v.call(e,"constructor")&&e.constructor)&&e instanceof e&&w.call(e)==_)};var x=function(e,t){return e===t||e!=e&&t!=t};var C=function(e,t){for(var i=e.length;i--;)if(x(e[i][0],t))return i;return-1},A=Array.prototype.splice;var T=function(e){var t=this.__data__;return!((e=C(t,e))<0)&&(e==t.length-1?t.pop():A.call(t,e,1),--this.size,!0)};var E=function(e){var t=this.__data__;return(e=C(t,e))<0?void 0:t[e][1]};var P=function(e){return-1<C(this.__data__,e)};var S=function(e,t){var i=this.__data__,o=C(i,e);return o<0?(++this.size,i.push([e,t])):i[o][1]=t,this};function I(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var o=e[t];this.set(o[0],o[1])}}I.prototype.clear=function(){this.__data__=[],this.size=0},I.prototype.delete=T,I.prototype.get=E,I.prototype.has=P,I.prototype.set=S;var R=I;var O=function(){this.__data__=new R,this.size=0};t=function(e){var t=this.__data__,e=t.delete(e);return this.size=t.size,e};r=function(e){return this.__data__.get(e)};b=function(e){return this.__data__.has(e)};var V=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var M=function(e){return!!V(e)&&("[object Function]"==(e=g(e))||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e)},k=o.a["__core-js_shared__"],N=(T=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||""))?"Symbol(sr
5c)_1."+T:"";var z=function(e){return!!N&&N in e},B=Function.prototype.toString;var F=function(e){if(null!=e){try{return B.call(e)}catch(e){}try{return e+""}catch(e){}}return""},D=/^\[object .+?Constructor\]$/,E=Function.prototype,P=Object.prototype,S=E.toString,k=P.hasOwnProperty,L=RegExp("^"+S.call(k).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var H=function(e){return!(!V(e)||z(e))&&(M(e)?L:D).test(F(e))};var j=function(e,t){return null==e?void 0:e[t]};var W=function(e,t){return t=j(e,t),H(t)?t:void 0},q=W(o.a,"Map"),U=W(Object,"create");var T=function(e){return e=this.has(e)&&delete this.__data__[e],this.size-=e?1:0,e},K=Object.prototype.hasOwnProperty;var E=function(e){var t=this.__data__;if(U){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return K.call(t,e)?t[e]:void 0},G=Object.prototype.hasOwnProperty;P=function(e){var t=this.__data__;return U?void 0!==t[e]:G.call(t,e)};S=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=U&&void 0===t?"__lodash_hash_undefined__":t,this};function J(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var o=e[t];this.set(o[0],o[1])}}J.prototype.clear=function(){this.__data__=U?U(null):{},this.size=0},J.prototype.delete=T,J.prototype.get=E,J.prototype.has=P,J.prototype.set=S;var Y=J;k=function(){this.size=0,this.__data__={hash:new Y,map:new(q||R),string:new Y}};var X=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Q=function(e,t){return e=e.__data__,X(t)?e["string"==typeof t?"string":"hash"]:e.map};T=function(e){return e=Q(this,e).delete(e),this.size-=e?1:0,e};E=function(e){return Q(this,e).get(e)};P=function(e){return Q(this,e).has(e)};S=function(e,t){var i=Q(this,e),o=i.size;return i.set(e,t),this.size+=i.size==o?0:1,this};function Z(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var o=e[t];this.set(o[0],o[1])}}Z.prototype.clear=k,Z.prototype.delete=T,Z.prototype.get=E,Z.prototype.has=P,Z.prototype.set=S;var ee=Z;P=function(e,t){var i=this.__data__;if(i instanceof R){var o=i.__data__;if(!q||o.length<199)return o.push([e,t]),this.size=++i.size,this;i=this.__data__=new ee(o)}return i.set(e,t),this.size=i.size,this};function te(e){e=this.__data__=new R(e);this.size=e.size}te.prototype.clear=O,te.prototype.delete=t,te.prototype.get=r,te.prototype.has=b,te.prototype.set=P;var ie=te;var oe=function(e,t){for(var i=-1,o=null==e?0:e.length;++i<o&&!1!==t(e[i],i,e););return e},ne=function(){try{var e=W(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var re=function(e,t,i){"__proto__"==t&&ne?ne(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i},se=Object.prototype.hasOwnProperty;var ae=function(e,t,i){var o=e[t];se.call(e,t)&&x(o,i)&&(void 0!==i||t in e)||re(e,t,i)};var le=function(e,t,i,o){var n=!i;i=i||{};for(var r=-1,s=t.length;++r<s;){var a=t[r],l=o?o(i[a],e[a],a,i,e):void 0;void 0===l&&(l=e[a]),(n?re:ae)(i,a,l)}return i};var ce=function(e,t){for(var i=-1,o=Array(e);++i<e;)o[i]=t(i);return o};var S=function(e){return p(e)&&"[object Arguments]"==g(e)},O=Object.prototype,de=O.hasOwnProperty,he=O.propertyIsEnumerable,ue=S(function(){return arguments}())?S:function(e){return p(e)&&de.call(e,"callee")&&!he.call(e,"callee")},ge=Array.isArray,me=i(4),fe=/^(?:0|[1-9]\d*)$/;var pe=function(e,t){var i=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&fe.test(e))&&-1<e&&e%1==0&&e<t};var be=function(e){return"number"==typeof e&&-1<e&&e%1==0&&e<=9007199254740991},ke={};ke["[object Float32Array]"]=ke["[object Float64Array]"]=ke["[object Int8Array]"]=ke["[object Int16Array]"]=ke["[object Int32Array]"]=ke["[object Uint8Array]"]=ke["[object Uint8ClampedArray]"]=ke["[object Uint16Array]"]=ke["[object Uint32Array]"]=!0,ke["[object Arguments]"]=ke["[object Array]"]=ke["[object ArrayBuffer]"]=ke["[object Boolean]"]=ke["[object DataView]"]=ke["[object Date]"]=ke["[object Error]"]=ke["[object Function]"]=ke["[object Map]"]=ke["[object Number]"]=ke["[object Object]"]=ke["[object RegExp]"]=ke["[object Set]"]=ke["[object String]"]=ke["[object WeakMap]"]=!1;t=function(e){return p(e)&&be(e.length)&&!!ke[g(e)]};var r=function(t){return function(e){return t(e)}},b=i(5),P=b.a&&b.a.isTypedArray,we=P?r(P):t,ve=Object.prototype.hasOwnProperty;var _e=function(e,t){var i,o=ge(e),n=!o&&ue(e),r=!o&&!n&&Object(me.a)(e),s=!o&&
5!n&&!r&&we(e),a=o||n||r||s,l=a?ce(e.length,String):[],c=l.length;for(i in e)!t&&!ve.call(e,i)||a&&("length"==i||r&&("offset"==i||"parent"==i)||s&&("buffer"==i||"byteLength"==i||"byteOffset"==i)||pe(i,c))||l.push(i);return l},ye=Object.prototype;var xe=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ye)},Ce=m(Object.keys,Object),Ae=Object.prototype.hasOwnProperty;var Te=function(e){if(!xe(e))return Ce(e);var t,i=[];for(t in Object(e))Ae.call(e,t)&&"constructor"!=t&&i.push(t);return i};var Ee=function(e){return null!=e&&be(e.length)&&!M(e)};var Pe=function(e){return(Ee(e)?_e:Te)(e)};var Se=function(e,t){return e&&le(t,Pe(t),e)};var Ie=function(e){var t=[];if(null!=e)for(var i in Object(e))t.push(i);return t},Re=Object.prototype.hasOwnProperty;var Oe=function(e){if(!V(e))return Ie(e);var t,i=xe(e),o=[];for(t in e)("constructor"!=t||!i&&Re.call(e,t))&&o.push(t);return o};var Ve=function(e){return Ee(e)?_e(e,!0):Oe(e)};var Me=function(e,t){return e&&le(t,Ve(t),e)},Ne=i(8);var ze=function(e,t){var i=-1,o=e.length;for(t=t||Array(o);++i<o;)t[i]=e[i];return t};var Be=function(e,t){for(var i=-1,o=null==e?0:e.length,n=0,r=[];++i<o;){var s=e[i];t(s,i,e)&&(r[n++]=s)}return r};var O=function(){return[]},Fe=Object.prototype.propertyIsEnumerable,De=Object.getOwnPropertySymbols,Le=De?function(t){return null==t?[]:(t=Object(t),Be(De(t),function(e){return Fe.call(t,e)}))}:O;var He=function(e,t){return le(e,Le(e),t)};var je=function(e,t){for(var i=-1,o=t.length,n=e.length;++i<o;)e[n+i]=t[i];return e},We=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)je(t,Le(e)),e=f(e);return t}:O;var $e=function(e,t){return le(e,We(e),t)};var qe=function(e,t,i){return t=t(e),ge(e)?t:je(t,i(e))};var Ue=function(e){return qe(e,Pe,Le)};function Ke(e){return qe(e,Ve,We)}var S=W(o.a,"DataView"),P=W(o.a,"Promise"),t=W(o.a,"Set"),m=W(o.a,"WeakMap"),Ge="[object Map]",Je="[object Promise]",Ye="[object Set]",Xe="[object WeakMap]",Qe="[object DataView]",Ze=F(S),et=F(q),tt=F(P),it=F(t),ot=F(m),O=g,nt=O=S&&O(new S(new ArrayBuffer(1)))!=Qe||q&&O(new q)!=Ge||P&&O(P.resolve())!=Je||t&&O(new t)!=Ye||m&&O(new m)!=Xe?function(e){var t=g(e),e="[object Object]"==t?e.constructor:void 0,e=e?F(e):"";if(e)switch(e){case Ze:return Qe;case et:return Ge;case tt:return Je;case it:return Ye;case ot:return Xe}return t}:O,rt=Object.prototype.hasOwnProperty;var st=function(e){var t=e.length,i=new e.constructor(t);return t&&"string"==typeof e[0]&&rt.call(e,"index")&&(i.index=e.index,i.input=e.input),i},at=o.a.Uint8Array;var lt=function(e){var t=new e.constructor(e.byteLength);return new at(t).set(new at(e)),t};var ct=function(e,t){return t=t?lt(e.buffer):e.buffer,new e.constructor(t,e.byteOffset,e.byteLength)},dt=/\w*$/;var ht=function(e){var t=new e.constructor(e.source,dt.exec(e));return t.lastIndex=e.lastIndex,t},S=n?n.prototype:void 0,ut=S?S.valueOf:void 0;var gt=function(e){return ut?Object(ut.call(e)):{}};var mt=function(e,t){return t=t?lt(e.buffer):e.buffer,new e.constructor(t,e.byteOffset,e.length)};var ft=function(e,t,i){var o=e.constructor;switch(t){case"[object ArrayBuffer]":return lt(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return ct(e,i);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return mt(e,i);case"[object Map]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return ht(e);case"[object Set]":return new o;case"[object Symbol]":return gt(e)}},pt=Object.create;function bt(){}var kt=function(e){if(!V(e))return{};if(pt)return pt(e);bt.prototype=e;e=new bt;return bt.prototype=void 0,e};var wt=function(e){return"function"!=typeof e.constructor||xe(e)?{}:kt(f(e))};var P=function(e){return p(e)&&"[object Map]"==nt(e)},t=b.a&&b.a.isMap,vt=t?r(t):P;var m=function(e){return p(e)&&"[object Set]"==nt(e)},O=b.a&&b.a.isSet,_t=O?r(O):m,yt="[object Arguments]",xt="[object Function]",Ct="[object Object]",At={};At[yt]=At["[object Array]"]=At["[object ArrayBuffer]"]=At["[object DataView]"]=At["[object Boolean]"]=At["[object Date]"]=At["[object Float32Array]"]=At["[object Float64Array
5]"]=At["[object Int8Array]"]=At["[object Int16Array]"]=At["[object Int32Array]"]=At["[object Map]"]=At["[object Number]"]=At[Ct]=At["[object RegExp]"]=At["[object Set]"]=At["[object String]"]=At["[object Symbol]"]=At["[object Uint8Array]"]=At["[object Uint8ClampedArray]"]=At["[object Uint16Array]"]=At["[object Uint32Array]"]=!0,At["[object Error]"]=At[xt]=At["[object WeakMap]"]=!1;var Tt=function i(o,n,r,e,t,s){var a,l=1&n,c=2&n,d=4&n;if(void 0!==(a=r?t?r(o,e,t,s):r(o):a))return a;if(!V(o))return o;var h=ge(o);if(h){if(a=st(o),!l)return ze(o,a)}else{var u=nt(o),e=u==xt||"[object GeneratorFunction]"==u;if(Object(me.a)(o))return Object(Ne.a)(o,l);if(u==Ct||u==yt||e&&!t){if(a=c||e?{}:wt(o),!l)return c?$e(o,Me(a,o)):He(o,Se(a,o))}else{if(!At[u])return t?o:{};a=ft(o,u,l)}}l=(s=s||new ie).get(o);if(l)return l;s.set(o,a),_t(o)?o.forEach(function(e){a.add(i(e,n,r,e,o,s))}):vt(o)&&o.forEach(function(e,t){a.set(t,i(e,n,r,t,o,s))});var g=h?void 0:(d?c?Ke:Ue:c?Ve:Pe)(o);return oe(g||o,function(e,t){g&&(e=o[t=e]),ae(a,t,i(e,n,r,t,o,s))}),a};var Et=function(e,t){return Tt(e,5,t="function"==typeof t?t:void 0)};var Pt=function(e){return p(e)&&1===e.nodeType&&!y(e)};class St{constructor(e,t){this._config={},t&&this.define(It(t)),e&&this._setObjectToTarget(this._config,e)}set(e,t){this._setToTarget(this._config,e,t)}define(e,t){this._setToTarget(this._config,e,t,!0)}get(e){return this._getFromSource(this._config,e)}*names(){for(const e of Object.keys(this._config))yield e}_setToTarget(e,t,i,o=!1){if(y(t))this._setObjectToTarget(e,t,o);else{const n=t.split(".");t=n.pop();for(const r of n)y(e[r])||(e[r]={}),e=e[r];if(y(i))return y(e[t])||(e[t]={}),e=e[t],void this._setObjectToTarget(e,i,o);o&&void 0!==e[t]||(e[t]=i)}}_getFromSource(e,t){const i=t.split(".");t=i.pop();for(const o of i){if(!y(e[o])){e=null;break}e=e[o]}return e?It(e[t]):void 0}
5_setObjectToTarget(t,i,o){Object.keys(i).forEach(e=>{this._setToTarget(t,e,i[e],o)})}}function It(e){return Et(e,Rt)}function Rt(e){return Pt(e)?e:void 0}var Ot=function(){return function e(){e.called=!0}};class Vt{constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=Ot(),this.off=Ot()}}const Mt=new Array(256).fill().map((e,t)=>("0"+t.toString(16)).slice(-2));function Nt(){var e=4294967296*Math.random()>>>0,t=4294967296*Math.random()>>>0,i=4294967296*Math.random()>>>0,o=4294967296*Math.random()>>>0;return"e"+Mt[e>>0&255]+Mt[e>>8&255]+Mt[e>>16&255]+Mt[e>>24&255]+Mt[t>>0&255]+Mt[t>>8&255]+Mt[t>>16&255]+Mt[t>>24&255]+Mt[i>>0&255]+Mt[i>>8&255]+Mt[i>>16&255]+Mt[i>>24&255]+Mt[o>>0&255]+Mt[o>>8&255]+Mt[o>>16&255]+Mt[o>>24&255]}var zt={get(e){return"number"!=typeof e?this[e]||this.normal:e},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5},Bt=(i(6),i(0));const Ft=Symbol("listeningTo"),Dt=Symbol("emitterId");var Lt={on(e,t,i={}){this.listenTo(this,e,t,i)},once(e,i,t){let o=!1;this.listenTo(this,e,function(e,...t){o||(o=!0,e.off(),i.call(this,e,...t))},t)},off(e,t){this.stopListening(this,e,t)},listenTo(e,t,i,o={}){let n,r;this[Ft]||(this[Ft]={});const s=this[Ft];jt(e)||Ht(e);var a=jt(e);(n=s[a])||(n=s[a]={emitter:e,callbacks:{}}),(r=n.callbacks[t])||(r=n.callbacks[t]=[]),r.push(i),a=this,t=t,i=i,o=o,(e=e)._addEventListener?e._addEventListener(t,i,o):a._addEventListener.call(e,t,i,o)},stopListening(e,t,i){const o=this[Ft];let n=e&&jt(e);const r=o&&n&&o[n],s=r&&t&&r.callbacks[t];if(!(!o||e&&!r||t&&!s))if(i)Ut(this,e,t,i),-1!==s.indexOf(i)&&(1===s.length?delete r.callbacks[t]:Ut(this,e,t,i));else if(s){for(;i=s.pop();)Ut(this,e,t,i);delete r.callbacks[t]}else if(r){for(t in r.callbacks)this.stopListening(e,t);delete o[n]}else{for(n in o)this.stopListening(o[n].emitter);delete this[Ft]}},fire(e,...i){try{const a=e instanceof Vt?e:new Vt(this,e);var o,n,r=a.name;let t=function e(t,i){let o;if(!t._events||!(o=t._events[i])||!o.callbacks.length)return-1<i.indexOf(":")?e(t,i.substr(0,i.lastIndexOf(":"))):null;return o.callbacks}(this,r);if(a.path.push(this),t){var s=[a,...i];t=Array.from(t);for(let e=0;e<t.length&&(t[e].callback.apply(this,s),a.off.called&&(delete a.off.called,this._removeEventListener(r,t[e].callback)),!a.stop.called);e++);}return this._delegations&&(o=this._delegations.get(r),n=this._delegations.get("*"),o&&qt(o,a,i),n&&qt(n,a,i)),a.return}catch(e){Bt.a.rethrowUnexpectedError(e,this)}},delegate(...e){return{to:(i,o)=>{this._delegations||(this._delegations=new Map),e.forEach(e=>{const t=this._delegations.get(e);t?t.set(i,o):this._delegations.set(e,new Map([[i,o]]))})}}},stopDelegating(e,t){if(this._delegations)if(e)if(t){const i=this._delegations.get(e);i&&i.delete(t)}else this._delegations.delete(e);else this._delegations.clear()},_addEventListener(e,t,i){!function(e,i){const o=Wt(e);if(!o[i]){let e=i,t=null;const n=[];for(;""!==e&&!o[e];)o[e]={callbacks:[],childEvents:[]},n.push(o[e]),t&&o[e].childEvents.push(t),t=e,e=e.substr(0,e.lastIndexOf(":"));if(""!==e){for(const r of n)r.callbacks=o[e].callbacks.slice();o[e].childEvents.push(t)}}}(this,e);var e=$t(this,e),o=zt.get(i.priority),n={callback:t,priority:o};for(const r of e){let t=!1;for(let e=0;e<r.length;e++)if(r[e].priority<o){r.splice(e,0,n),t=!0;break}t||r.push(n)}},_removeEventListener(e,t){for(const i of $t(this,e))for(let e=0;e<i.length;e++)i[e].callback==t&&(i.splice(e,1),e--)}};function Ht(e,t){e[Dt]||(e[Dt]=t||Nt())}function jt(e){return e[Dt]}function Wt(e){return e._events||Object.defineProperty(e,"_events",{value:{}}),e._events}function $t(t,e){var i=Wt(t)[e];if(!i)return[];let o=[i.callbacks];for(let e=0;e<i.childEvents.length;e++){var n=$t(t,i.childEvents[e]);o=o.concat(n)}return o}function qt(e,t,i){for(var[o,n]of e){n?"function"==typeof n&&(n=n(t.name)):n=t.name;const r=new Vt(t.source,n);r.path=[...t.path],o.fire(r,...i)}}function Ut(e,t,i,o){t._removeEventListener?t._removeEventListener(i,o):e._removeEventListener.call(t,i,o)}function Kt(e){return!(!e||!e[Symbol.iterator])}function Gt(o,...e){e.forEach(i=>{Object.getOwnPropertyNames(i).concat(Object.getOwnPropertySymbols(i)).forEac
5h(e=>{if(!(e in o.prototype)){const t=Object.getOwnPropertyDescriptor(i,e);t.enumerable=!1,Object.defineProperty(o.prototype,e,t)}})})}class Jt{constructor(e={},t={}){var i=Kt(e);if(i||(t=e),this._items=[],this._itemMap=new Map,this._idProperty=t.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],i)for(const o of e)this._items.push(o),this._itemMap.set(this._getItemIdBeforeAdding(o),o)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(e,t){return this.addMany([e],t)}addMany(t,i){if(void 0===i)i=this._items.length;else if(i>this._items.length||i<0)throw new Bt.a("collection-add-item-invalid-index",this);for(let e=0;e<t.length;e++){var o=t[e],n=this._getItemIdBeforeAdding(o),r=i+e;this._items.splice(r,0,o),this._itemMap.set(n,o),this.fire("add",o,r)}return this.fire("change",{added:t,removed:[],index:i}),this}get(e){let t;if("string"==typeof e)t=this._itemMap.get(e);else{if("number"!=typeof e)throw new Bt.a("collection-get-invalid-arg",this);t=this._items[e]}return t||null}has(e){if("string"==typeof e)return this._itemMap.has(e);e=e[this._idProperty];return this._itemMap.has(e)}getIndex(e){let t;return t="string"==typeof e?this._itemMap.get(e):e,this._items.indexOf(t)}remove(e){var[t,e]=this._remove(e);return this.fire("change",{added:[],removed:[t],index:e}),t}map(e,t){return this._items.map(e,t)}find(e,t){return this._items.find(e,t)}filter(e,t){return this._items.filter(e,t)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);for(var e=Array.from(this._items);this.length;)this._remove(0);this.fire("change",{added:[],removed:e,index:0})}bindTo(e){if(this._bindToCollection)throw new Bt.a("collection-bind-to-rebind",this);return this._bindToCollection=e,{as:t=>{this._setUpBindToBinding(e=>new t(e))},using:t=>{"function"==typeof t?this._setUpBindToBinding(e=>t(e)):this._setUpBindToBinding(e=>e[t])}}}_setUpBindToBinding(a){const l=this._bindToCollection;var e=(e,i,o)=>{var t=l._bindToCollection==this,n=l._bindToInternalToExternalMap.get(i);if(t&&n)this._bindToExternalToInternalMap.set(i,n),this._bindToInternalToExternalMap.set(n,i);else{n=a(i);if(n){let t=o;for(const r of this._skippedIndexesFromExternal)o>r&&t--;for(const s of l._skippedIndexesFromExternal)t>=s&&t++;this._bindToExternalToInternalMap.set(i,n),this._bindToInternalToExternalMap.set(n,i),this.add(n,t);for(let e=0;e<l._skippedIndexesFromExternal.length;e++)t<=l._skippedIndexesFromExternal[e]&&l._skippedIndexesFromExternal[e]++}else this._skippedIndexesFromExternal.push(o)}};for(const t of l)e(0,t,l.getIndex(t));this.listenTo(l,"add",e),this.listenTo(l,"remove",(e,t,i)=>{t=this._bindToExternalToInternalMap.get(t);t&&this.remove(t),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((e,t)=>(i<t&&e.push(t-1),t<i&&e.push(t),e),[])})}_getItemIdBeforeAdding(e){var t=this._idProperty;let i;if(t in e){if(i=e[t],"string"!=typeof i)throw new Bt.a("collection-add-invalid-id",this);if(this.get(i))throw new Bt.a("collection-add-item-already-exists",this)}else e[t]=i=Nt();return i}_remove(e){let t,i,o,n=!1;var r=this._idProperty;if("string"==typeof e?(i=e,o=this._itemMap.get(i),n=!o,o&&(t=this._items.indexOf(o))):"number"==typeof e?(t=e,o=this._items[t],n=!o,o&&(i=o[r])):(o=e,i=o[r],t=this._items.indexOf(o),n=-1==t||!this._itemMap.get(i)),n)throw new Bt.a("collection-remove-404",this);this._items.splice(t,1),this._itemMap.delete(i);r=this._bindToInternalToExternalMap.get(o);return this._bindToInternalToExternalMap.delete(o),this._bindToExternalToInternalMap.delete(r),this.fire("remove",o,t),[o,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}Gt(Jt,Lt);class Yt{constructor(e,t=[],i=[]){this._context=e,this._plugins=new Map,this._availablePlugins=new Map;for(const r of t)r.pluginName&&this._availablePlugins.set(r.pluginName,r);this._contextPlugins=new Map;for(var[o,n]of i)this._contextPlugins.set(o,n),this._contextPlugins.set(n,o),o.pluginName&&this._availablePlugins.set(o.pluginName,o)}*[Symbol.iterator](){for(const e of this._plugins)"function"==typeof e[0]&&(yield e)}get(t){var e=this._plugins.get(t);if(e)return e;{let e=t;throw"function"==typeof t&&(e=t.pluginName||t.name),new Bt.a("plugincollection-
5plugin-not-loaded",this._context,{plugin:e})}}has(e){return this._plugins.has(e)}init(e,i=[],t=[]){const s=this,o=this._context;!function t(e,i=new Set){e.forEach(e=>{a(e)&&(i.has(e)||(i.add(e),e.pluginName&&!s._availablePlugins.has(e.pluginName)&&s._availablePlugins.set(e.pluginName,e),e.requires&&t(e.requires,i)))})}(e),h(e);var n=[...function i(e,o=new Set){return e.map(e=>a(e)?e:s._availablePlugins.get(e)).reduce((t,e)=>o.has(e)?t:(o.add(e),e.requires&&(h(e.requires,e),i(e.requires,o).forEach(e=>t.add(e))),t.add(e)),new Set)}(e.filter(e=>!c(e,i)))];!function(e,t){for(const r of t){if("function"!=typeof r)throw new Bt.a("plugincollection-replace-plugin-invalid-type",null,{pluginItem:r});var i=r.pluginName;if(!i)throw new Bt.a("plugincollection-replace-plugin-missing-name",null,{pluginItem:r});if(r.requires&&r.requires.length)throw new Bt.a("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:i});var o=s._availablePlugins.get(i);if(!o)throw new Bt.a("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:i});var n=e.indexOf(o);
5if(-1===n){if(s._contextPlugins.has(o))return;throw new Bt.a("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:i})}if(o.requires&&o.requires.length)throw new Bt.a("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:i});e.splice(n,1,r),s._availablePlugins.set(i,r)}}(n,t);const r=n.map(e=>{var t=s._contextPlugins.get(e)||new e(o);return s._add(e,t),t});return u(r,"init").then(()=>u(r,"afterInit")).then(()=>r);function a(e){return"function"==typeof e}function l(e){return a(e)&&e.isContextPlugin}function c(t,e){return e.some(e=>e===t||(d(t)===e||d(e)===t))}function d(e){return a(e)?e.pluginName||e.name:e}function h(e,t=null){e.map(e=>!a(e)&&s._availablePlugins.get(e)||e).forEach(e=>{!function(e,t){if(!a(e)){if(t)throw new Bt.a("plugincollection-soft-required",o,{missingPlugin:e,requiredBy:d(t)});throw new Bt.a("plugincollection-plugin-not-found",o,{plugin:e})}}(e,t),function(e,t){if(l(t)&&!l(e))throw new Bt.a("plugincollection-context-required",o,{plugin:d(e),requiredBy:d(t)})}(e,t),function(e,t){if(t&&c(e,i))throw new Bt.a("plugincollection-required",o,{plugin:d(e),requiredBy:d(t)})}(e,t)})}function u(e,i){return e.reduce((e,t)=>!t[i]||s._contextPlugins.has(t)?e:e.then(t[i].bind(t)),Promise.resolve())}}destroy(){const e=[];for(var[,t]of this)"function"!=typeof t.destroy||this._contextPlugins.has(t)||e.push(t.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);var i=e.pluginName;if(i){if(this._plugins.has(i))throw new Bt.a("plugincollection-plugin-name-conflict",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:e});this._plugins.set(i,t)}}}function Xt(e){return Array.isArray(e)?e:[e]}function Qt(e,t,i=1){if("number"!=typeof i)throw new Bt.a("translation-service-quantity-not-a-number",null,{quantity:i});var o=Object.keys(window.CKEDITOR_TRANSLATIONS).length;1===o&&(e=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]);var n,r=t.id||t.string;if(0===o||(n=e,o=r,!window.CKEDITOR_TRANSLATIONS[n]||!window.CKEDITOR_TRANSLATIONS[n].dictionary[o]))return 1!==i?t.plural:t.string;t=window.CKEDITOR_TRANSLATIONS[e].dictionary;const s=window.CKEDITOR_TRANSLATIONS[e].getPluralForm||(e=>1===e?0:1);if("string"==typeof t[r])return t[r];i=Number(s(i));return t[r][i]}Gt(Yt,Lt),window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={});const Zt=["ar","ara","fa","per","fas","he","heb","ku","kur","ug","uig"];function ei(e){return Zt.includes(e)?"rtl":"ltr"}class ti{constructor(e={}){this.uiLanguage=e.uiLanguage||"en",this.contentLanguage=e.contentLanguage||this.uiLanguage,this.uiLanguageDirection=ei(this.uiLanguage),this.contentLanguageDirection=ei(this.contentLanguage),this.t=(e,t)=>this._t(e,t)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(e,t=[]){t=Xt(t);var i,o=!!(e="string"==typeof e?{string:e}:e).plural?t[0]:1,o=Qt(this.uiLanguage,e,o);return i=t,o.replace(/%(\d+)/g,(e,t)=>t<i.length?i[t]:e)}}class ii{constructor(e){this.config=new St(e,this.constructor.defaultConfig);e=this.constructor.builtinPlugins;this.config.define("plugins",e),this.plugins=new Yt(this,e);e=this.config.get("language")||{};this.locale=new ti({uiLanguage:"string"==typeof e?e:e.ui,contentLanguage:this.config.get("language.content")}),this.t=this.locale.t,this.editors=new Jt,this._contextOwner=null}initPlugins(){const e=this.config.get("plugins")||[];var t=this.config.get("substitutePlugins")||[];for(const i of e.concat(t)){if("function"!=typeof i)throw new Bt.a("context-initplugins-constructor-only",null,{Plugin:i});if(!0!==i.isContextPlugin)throw new Bt.a("context-initplugins-invalid-plugin",null,{Plugin:i})}return this.plugins.init(e,[],t)}destroy(){return Promise.all(Array.from(this.editors,e=>e.destroy())).then(()=>this.plugins.destroy())}_addEditor(e,t){if(this._contextOwner)throw new Bt.a("context-addeditor-private-context");this.editors.add(e),t&&(this._contextOwner=e)}_removeEditor(e){return this.editors.has(e)&&this.editors.remove(e),this._contextOwner===e?this.destroy():Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names())["plugins","removePlugins","extraPlugins"].includes(t)||(e[t]=this.config.get(t));return e}static create(i){return new Promise(e=>{const t=new this(i);e(t.initPlugins().then(()=>t))})}}function oi(t,i){var o=Math.min(t.length,i.length);for(let e=0;e<o;e++)if(t[e]!=i[e])return e;return t.length==i.length?"same":t.length<i.length?"prefix":"extension"}var ni=function(e){return Tt(e,4)};class ri{constructor(e){this.document=e,this.parent=null}get index(){var e;if(!this.parent)return null;if(-1==(e=this.parent.getChildIndex(this)))throw new Bt.a("view-node-not-found-in-parent",this);return e}get nextSibling(){var e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){var e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.index),t=t.parent;return e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}getCommonAncestor(e,t={}){var i=this.getAncestors(t),o=e.getAncestors(t);let n=0;for(;i[n]==o[n]&&i[n];)n++;return 0===n?null:i[n-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;var t=this.getPath(),i=e.getPath(),o=oi(t,i);switch(o){case"prefix":return!0;case"extension":return!1;default:return t[o]<i[o]}}isAfter(e){return this!=e&&(this.root===e.root&&!this.isBefore(e))}_remove(){this.parent._removeChildren(this.index)}
5_fireChange(e,t){this.fire("change:"+e,t),this.parent&&this.parent._fireChange(e,t)}toJSON(){const e=ni(this);return delete e.parent,e}is(e){return"node"===e||"view:node"===e}}Gt(ri,Lt);class si extends ri{constructor(e,t){super(e),this._textData=t}is(e){return"$text"===e||"view:$text"===e||"text"===e||"view:text"===e||"node"===e||"view:node"===e}get data(){return this._textData}get _data(){return this.data}set _data(e){this._fireChange("text",this),this._textData=e}isSimilar(e){return e instanceof si&&(this===e||this.data===e.data)}_clone(){return new si(this.document,this.data)}}class ai{constructor(e,t,i){if(this.textNode=e,t<0||t>e.data.length)throw new Bt.a("view-textproxy-wrong-offsetintext",this);if(i<0||t+i>e.data.length)throw new Bt.a("view-textproxy-wrong-length",this);this.data=e.data.substring(t,t+i),this.offsetInText=t}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(e){return"$textProxy"===e||"view:$textProxy"===e||"textProxy"===e||"view:textProxy"===e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let i=e.includeSelf?this.textNode:this.parent;for(;null!==i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}}function li(e){return Kt(e)?new Map(e):function(e){const t=new Map;for(const i in e)t.set(i,e[i]);return t}(e)}class ci{constructor(...e){this._patterns=[],this.add(...e)}add(...e){for(var t of e)("string"==typeof t||t instanceof RegExp)&&(t={name:t}),this._patterns.push(t)}match(...e){for(const i of e)for(const o of this._patterns){var t=di(i,o);if(t)return{element:i,pattern:o,match:t}}return null}matchAll(...e){const t=[];for(const o of e)for(const n of this._patterns){var i=di(o,n);i&&t.push({element:o,pattern:n,match:i})}return 0<t.length?t:null}getElementName(){if(1!==this._patterns.length)return null;var e=this._patterns[0],t=e.name;return"function"==typeof e||!t||t instanceof RegExp?null:t}}function di(e,t){if("function"==typeof t)return t(e);const i={};return t.name&&(i.name=function(e,t){if(e instanceof RegExp)return e.test(t);return e===t}(t.name,e.name),!i.name)||t.attributes&&(i.attributes=function(e,t){const i=new Set(t.getAttributeKeys());y(e)?(void 0!==e.style&&Object(Bt.b)("matcher-pattern-deprecated-attributes-style-key",e),void 0!==e.class&&Object(Bt.b)("matcher-pattern-deprecated-attributes-class-key",e)):(i.delete("style"),i.delete("class"));return hi(e,i,e=>t.getAttribute(e))}(t.attributes,e),!i.attributes)?null:!(t.classes&&(i.classes=hi(t.classes,e.getClassNames()),!i.classes))&&(!(t.styles&&(i.styles=hi(t.styles,(o=e).getStyleNames(!0),e=>o.getStyle(e)),!i.styles))&&i);var o}function hi(e,t,r){const i=function(e){if(Array.isArray(e))return e.map(e=>
5y(e)?(void 0!==e.key&&void 0!==e.value||Object(Bt.b)("matcher-pattern-missing-key-or-value",e),[e.key,e.value]):[e,!0]);if(y(e))return Object.entries(e);return[[e,!0]]}(e),s=Array.from(t),a=[];return i.forEach(([o,n])=>{s.forEach(e=>{var t,i;i=e,(!0===(t=o)||t===i||t instanceof RegExp&&t.test(i))&&function(e,t,i){if(!0===e)return!0;t=i(t);return e===t||e instanceof RegExp&&e.test(t)}(n,e,r)&&a.push(e)})}),!i.length||a.length<i.length?null:a}var ui=function(e){return"symbol"==typeof e||p(e)&&"[object Symbol]"==g(e)},gi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,mi=/^\w*$/;var fi=function(e,t){if(ge(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!ui(e))||(mi.test(e)||!gi.test(e)||null!=t&&e in Object(t))};function pi(o,n){if("function"!=typeof o||null!=n&&"function"!=typeof n)throw new TypeError("Expected a function");function r(){var e=arguments,t=n?n.apply(this,e):e[0],i=r.cache;return i.has(t)?i.get(t):(e=o.apply(this,e),r.cache=i.set(t,e)||i,e)}return r.cache=new(pi.Cache||ee),r}pi.Cache=ee;var bi=pi;var ki=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,wi=/\\(\\)?/g,vi=function(e){var t=(e=bi(e,function(e){return 500===t.size&&t.clear(),e})).cache;return e}(function(e){var n=[];return 46===e.charCodeAt(0)&&n.push(""),e.replace(ki,function(e,t,i,o){n.push(i?o.replace(wi,"$1"):t||e)}),n});var _i=function(e,t){for(var i=-1,o=null==e?0:e.length,n=Array(o);++i<o;)n[i]=t(e[i],i,e);return n},S=n?n.prototype:void 0,yi=S?S.toString:void 0;var xi=function e(t){if("string"==typeof t)return t;if(ge(t))return _i(t,e)+"";if(ui(t))return yi?yi.call(t):"";var i=t+"";return"0"==i&&1/t==-1/0?"-0":i};var Ci=function(e){return null==e?"":xi(e)};var Ai=function(e,t){return ge(e)?e:fi(e,t)?[e]:vi(Ci(e))};var Ti=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};var Ei=function(e){if("string"==typeof e||ui(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t};var Pi=function(e,t){for(var i=0,o=(t=Ai(t,e)).length;null!=e&&i<o;)e=e[Ei(t[i++])];return i&&i==o?e:void 0};var Si=function(e,t,i){var o=-1,n=e.length;(i=n<i?n:i)<0&&(i+=n),n=i<(t=t<0?n<-t?0:n+t:t)?0:i-t>>>0,t>>>=0;for(var r=Array(n);++o<n;)r[o]=e[o+t];return r};var Ii=function(e,t){return t.length<2?e:Pi(e,Si(t,0,-1))};var Ri=function(e,t){return t=Ai(t,e),null==(e=Ii(e,t))||delete e[Ei(Ti(t))]};var Oi=function(e,t){return null==e||Ri(e,t)};var Vi=function(e,t,i){return void 0===(t=null==e?void 0:Pi(e,t))?i:t};var Mi=function(e,t,i){(void 0===i||x(e[t],i))&&(void 0!==i||t in e)||re(e,t,i)};var Ni=function(l){return function(e,t,i){for(var o=-1,n=Object(e),r=i(e),s=r.length;s--;){var a=r[l?s:++o];if(!1===t(n[a],a,n))break}return e}}();var zi=function(e){return p(e)&&Ee(e)};var Bi=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var Fi=function(e){return le(e,Ve(e))};var Di=function(e,t,i,o,n,r,s){var a,l,c,d=Bi(e,i),h=Bi(t,i),u=s.get(h);u?Mi(e,i,u):((a=void 0===(c=r?r(d,h,i+"",e,t,s):void 0))&&(u=!(l=ge(h))&&Object(me.a)(h),t=!l&&!u&&we(h),c=h,l||u||t?c=ge(d)?d:zi(d)?ze(d):u?(a=!1,Object(Ne.a)(h,!0)):t?mt(h,!(a=!1)):[]:y(h)||ue(h)?ue(c=d)?c=Fi(d):V(d)&&!M(d)||(c=wt(h)):a=!1),a&&(s.set(h,c),n(c,h,o,r,s),s.delete(h)),Mi(e,i,c))};var Li=function o(n,r,s,a,l){n!==r&&Ni(r,function(e,t){var i;l=l||new ie,V(e)?Di(n,r,t,s,o,a,l):(i=a?a(Bi(n,t),e,t+"",n,r,l):void 0,Mi(n,t,i=void 0===i?e:i))},Ve)};function Hi(e){return e}var ji=function(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)},Wi=Math.max;var $i=function(r,s,a){return s=Wi(void 0===s?r.length-1:s,0),function(){for(var e=arguments,t=-1,i=Wi(e.length-s,0),o=Array(i);++t<i;)o[t]=e[s+t];for(var t=-1,n=Array(s+1);++t<s;)n[t]=e[t];return n[s]=a(o),ji(r,this,n)}};var qi=function(e){return function(){return e}},Ui=Date.now;var Ki=function(i){var o=0,n=0;return function(){var e=Ui(),t=16-(e-n);if(n=e,0<t){if(800<=++o)return arguments[0]}else o=0;return i.apply(void 0,arguments)}}(ne?function(e,t){return ne(e,"toString",{configurable:!0,enumerable:!1,value:qi(t),writable:!0})}:Hi);
5var Gi=function(e,t){return Ki($i(e,t,Hi),e+"")};var Ji=function(e,t,i){if(!V(i))return!1;var o=typeof t;return!!("number"==o?Ee(i)&&pe(t,i.length):"string"==o&&t in i)&&x(i[t],e)};var t=function(a){return Gi(function(e,t){var i=-1,o=t.length,n=1<o?t[o-1]:void 0,r=2<o?t[2]:void 0,n=3<a.length&&"function"==typeof n?(o--,n):void 0;for(r&&Ji(t[0],t[1],r)&&(n=o<3?void 0:n,o=1),e=Object(e);++i<o;){var s=t[i];s&&a(e,s,i,n)}return e})},Yi=t(function(e,t,i){Li(e,t,i)});var Xi=function(e,t,i,o){if(!V(e))return e;for(var n=-1,r=(t=Ai(t,e)).length,s=r-1,a=e;null!=a&&++n<r;){var l,c=Ei(t[n]),d=i;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;n!=s&&(l=a[c],void 0===(d=o?o(l,c,a):void 0)&&(d=V(l)?l:pe(t[n+1])?[]:{})),ae(a,c,d),a=a[c]}return e};var Qi=function(e,t,i){return null==e?e:Xi(e,t,i)};class Zi{constructor(e){this._styles={},this._styleProcessor=e}get isEmpty(){var e=Object.entries(this._styles);return!Array.from(e).length}get size(){return this.isEmpty?0:this.getStyleNames().length}setTo(e){var t,i;this.clear();for([t,i]of Array.from(function(t){let i=null,o=0,n=0,r=null;const s=new Map;if(""===t)return s;";"!=t.charAt(t.length-1)&&(t+=";");for(let e=0;e<t.length;e++){var a=t.charAt(e);if(null===i)switch(a){case":":r||(r=t.substr(o,e-o),n=e+1);break;case'"':case"'":i=a;break;case";":{const l=t.substr(n,e-n);r&&s.set(r.trim(),l.trim()),r=null,o=e+1;break}}else a===i&&(i=null)}return s}(e).entries()))this._styleProcessor.toNormalizedForm(t,i,this._styles)}has(t){if(this.isEmpty)return!1;const e=this._styleProcessor.getReducedForm(t,this._styles);var i=e.find(([e])=>e===t);return Array.isArray(i)}set(e,t){if(V(e))for(var[i,o]of Object.entries(e))this._styleProcessor.toNormalizedForm(i,o,this._styles);else this._styleProcessor.toNormalizedForm(e,t,this._styles)}remove(e){var t=to(e);Oi(this._styles,t),delete this._styles[e],this._cleanEmptyObjectsOnPath(t)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){return this.isEmpty?"":this._getStylesEntries().map(e=>e.join(":")).sort().join(";")+";"}getAsString(t){if(!this.isEmpty){if(this._styles[t]&&!V(this._styles[t]))return this._styles[t];const i=this._styleProcessor.getReducedForm(t,this._styles);var e=i.find(([e])=>e===t);return Array.isArray(e)?e[1]:void 0}}getStyleNames(e=!1){if(this.isEmpty)return[];if(e)return this._styleProcessor.getStyleNames(this._styles);const t=this._getStylesEntries();return t.map(([e])=>e)}clear(){this._styles={}}_getStylesEntries(){const e=[];for(const t of Object.keys(this._styles))e.push(...this._styleProcessor.getReducedForm(t,this._styles));return e}_cleanEmptyObjectsOnPath(e){const t=e.split(".");var i;1<t.length&&(i=t.splice(0,t.length-1).join("."),(e=Vi(this._styles,i))&&!Array.from(Object.keys(e)).length&&this.remove(i))}}class eo{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(e,t,i){if(V(t))io(i,to(e),t);else if(this._normalizers.has(e)){const r=this._normalizers.get(e);var{path:o,value:n}=r(t);io(i,o,n)}else io(i,e,t)}getNormalized(e,t){if(!e)return Yi({},t);if(void 0!==t[e])return t[e];if(this._extractors.has(e)){const o=this._extractors.get(e);if("string"==typeof o)return Vi(t,o);var i=o(e,t);if(i)return i}return Vi(t,to(e))}getReducedForm(e,t){t=this.getNormalized(e,t);if(void 0===t)return[];if(this._reducers.has(e)){const i=this._reducers.get(e);return i(t)}return[[e,t]]}getStyleNames(t){var e=Array.from(this._consumables.keys()).filter(e=>{e=this.getNormalized(e,t);return e&&"object"==typeof e?Object.keys(e).length:e});const i=new Set([...e,...Object.keys(t)]);return Array.from(i.values())}getRelatedStyles(e){return this._consumables.get(e)||[]}setNormalizer(e,t){this._normalizers.set(e,t)}setExtractor(e,t){this._extractors.set(e,t)}setReducer(e,t){this._reducers.set(e,t)}setStyleRelation(e,t){this._mapStyleNames(e,t);for(const i of t)this._mapStyleNames(i,[e])}_mapStyleNames(e,t){this._consumables.has(e)||this._consumables.set(e,[]),this._consumables.get(e).push(...t)}}function to(e){return e.replace("-",".")}function io(e,t,i){let o=i;V(i)&&(o=Yi({},Vi(e,t),i)),Qi(e,t,o)}class oo extends ri{constructor(e,t,i,o){super(e),this.name=t,this._attrs=function(e){for(var[t,i]of e=li(e))null===i?e.delete(t):"string"!=typeof i&&e.set(t,String(i));return e}(i),this._children=[],o&&this._insertChild(0,o),this._classes=new Set,this._attrs.has("class")&&(o=this._attrs.get("class"),no(this._classes,o),this._attrs.delete("class")),this._styles=new Zi(this.document.stylesProcessor),this._attrs.has("style")&&(this._styles.setTo(this._attrs.get("style")),this._attrs.delete("style")),this._customProperties=new Map,this._isAllowedInsideAttributeElement=!1}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}get isAllowedInsideAttributeElement(){return this._isAllowedInsideAttributeElement}is(e,t=null){return t?t===this.name&&("element"===e||"view:element"===e):"element"===e||"view:element"===e||"node"===e||"view:node"===e}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){0<this._classes.size&&(yield"class"),this._styles.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),0<this._classes.size&&(yield["class",this.getAttribute("class")]
5),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(e){if("class"==e)return 0<this._classes.size?[...this._classes].join(" "):void 0;if("style"!=e)return this._attrs.get(e);e=this._styles.toString();return""==e?void 0:e}hasAttribute(e){return"class"==e?0<this._classes.size:"style"==e?!this._styles.isEmpty:this._attrs.has(e)}isSimilar(e){if(!(e instanceof oo))return!1;if(this===e)return!0;if(this.name!=e.name)return!1;if(this.isAllowedInsideAttributeElement!=e.isAllowedInsideAttributeElement)return!1;if(this._attrs.size!==e._attrs.size||this._classes.size!==e._classes.size||this._styles.size!==e._styles.size)return!1;for(var[t,i]of this._attrs)if(!e._attrs.has(t)||e._attrs.get(t)!==i)return!1;for(const o of this._classes)if(!e._classes.has(o))return!1;for(const n of this._styles.getStyleNames())if(!e._styles.has(n)||e._styles.getAsString(n)!==this._styles.getAsString(n))return!1;return!0}hasClass(...e){for(const t of e)if(!this._classes.has(t))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(e){return this._styles.getAsString(e)}getNormalizedStyle(e){return this._styles.getNormalized(e)}getStyleNames(e=!1){return this._styles.getStyleNames(e)}hasStyle(...e){for(const t of e)if(!this._styles.has(t))return!1;return!0}findAncestor(...e){const t=new ci(...e);let i=this.parent;for(;i;){if(t.match(i))return i;i=i.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){var e=Array.from(this._classes).sort().join(","),t=this._styles.toString(),i=Array.from(this._attrs).map(e=>`${e[0]}="${e[1]}"`).sort().join(" ");return this.name+(""==e?"":` class="${e}"`)+(t?` style="${t}"`:"")+(""==i?"":` ${i}`)}_clone(e=!1){const t=[];if(e)for(const o of this.getChildren())t.push(o._clone(e));const i=new this.constructor(this.document,this.name,this._attrs,t);return i._classes=new Set(this._classes),i._styles.set(this._styles.getNormalized()),i._customProperties=new Map(this._customProperties),i.getFillerOffset=this.getFillerOffset,i._isAllowedInsideAttributeElement=this.isAllowedInsideAttributeElement,i}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange("children",this);let i=0;for(const o of function(t,e){if("string"==typeof e)return[new si(t,e)];Kt(e)||(e=[e]);return Array.from(e).map(e=>"string"==typeof e?new si(t,e):e instanceof ai?new si(t,e.data):e)}(this.document,t))null!==o.parent&&o._remove(),o.parent=this,o.document=this.document,this._children.splice(e,0,o),e++,i++;return i}_removeChildren(t,i=1){this._fireChange("children",this);for(let e=t;e<t+i;e++)this._children[e].parent=null;return this._children.splice(t,i)}_setAttribute(e,t){t=String(t),this._fireChange("attributes",this),"class"==e?no(this._classes,t):"style"==e?this._styles.setTo(t):this._attrs.set(e,t)}_removeAttribute(e){return this._fireChange("attributes",this),"class"==e?0<this._classes.size&&(this._classes.clear(),!0):"style"==e?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(e)}_addClass(e){this._fireChange("attributes",this);for(const t of Xt(e))this._classes.add(t)}_removeClass(e){this._fireChange("attributes",this);for(const t of Xt(e))this._classes.delete(t)}_setStyle(e,t){this._fireChange("attributes",this),this._styles.set(e,t)}_removeStyle(e){this._fireChange("attributes",this);for(const t of Xt(e))this._styles.remove(t)}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}function no(t,e){const i=e.split(/\s+/);t.clear(),i.forEach(e=>t.add(e))}class ro extends oo{constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=so}is(e,t=null){return t?t===this.name&&("containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}}function so(){var e=[...this.getChildren()];const t=e[this.childCount-1];if(t&&t.is("element","br"))return this.childCount;for(const i of e)if(!i.is("uiElement"))return null;return this.childCount}var ao=t(function(e,t){le(t,Ve(t),e)});const lo=Symbol("observableProperties"),co=Symbol("boundObservables"),ho=Symbol("boundProperties"),uo=Symbol("decoratedMethods"),go=Symbol("decoratedOriginal"),mo={set(o,e){if(V(o))Object.keys(o).forEac
5h(e=>{this.set(e,o[e])},this);else{po(this);const n=this[lo];if(o in this&&!n.has(o))throw new Bt.a("observable-set-cannot-override",this);Object.defineProperty(this,o,{enumerable:!0,configurable:!0,get(){return n.get(o)},set(e){var t=n.get(o);let i=this.fire("set:"+o,o,e,t);void 0===i&&(i=e),t===i&&n.has(o)||(n.set(o,i),this.fire("change:"+o,o,i,t))}}),this[o]=e}},bind(...e){if(!e.length||!wo(e))throw new Bt.a("observable-bind-wrong-properties",this);if(new Set(e).size!==e.length)throw new Bt.a("observable-bind-duplicate-properties",this);po(this);const i=this[ho];e.forEach(e=>{if(i.has(e))throw new Bt.a("observable-bind-rebind",this)});const o=new Map;return e.forEach(e=>{var t={property:e,to:[]};i.set(e,t),o.set(e,t)}),{to:bo,toMany:ko,_observable:this,_bindProperties:e,_to:[],_bindings:o}},unbind(...e){if(this[lo]){const s=this[ho],a=this[co];if(e.length){if(!wo(e))throw new Bt.a("observable-unbind-wrong-properties",this);e.forEach(e=>{const r=s.get(e);if(r){let t,i,o,n;r.to.forEach(e=>{t=e[0],i=e[1],o=a.get(t),n=o[i],n.delete(r),n.size||delete o[i],Object.keys(o).length||(a.delete(t),this.stopListening(t,"change"))}),s.delete(e)}})}else a.forEach((e,t)=>{this.stopListening(t,"change")}),a.clear(),s.clear()}},decorate(t){const i=this[t];if(!i)throw new Bt.a("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:t});this.on(t,(e,t)=>{e.return=i.apply(this,t)}),this[t]=function(...e){return this.fire(t,e)},this[t][go]=i,this[uo]||(this[uo]=[]),this[uo].push(t)}};ao(mo,Lt),mo.stopListening=function(e,t,i){if(!e&&this[uo]){for(const o of this[uo])this[o]=this[o][go];delete this[uo]}Lt.stopListening.call(this,e,t,i)};var fo=mo;function po(e){e[lo]||(Object.defineProperty(e,lo,{value:new Map}),Object.defineProperty(e,co,{value:new Map}),Object.defineProperty(e,ho,{value:new Map}))}function bo(...e){const t=function(...e){if(!e.length)throw new Bt.a("observable-bind-to-parse-error",null);const t={to:[]};let i;"function"==typeof e[e.length-1]&&(t.callback=e.pop());return e.forEach(e=>{if("string"==typeof e)i.properties.push(e);else{if("object"!=typeof e)throw new Bt.a("observable-bind-to-parse-error",null);i={observable:e,properties:[]},t.to.push(i)}}),t}(...e);var r,e=Array.from(this._bindings.keys());const i=e.length;if(!t.callback&&1<t.to.length)throw new Bt.a("observable-bind-to-no-callback",this);if(1<i&&t.callback)throw new Bt.a("observable-bind-to-extra-callback",this);t.to.forEach(e=>{if(e.properties.length&&e.properties.length!==i)throw new Bt.a("observable-bind-to-properties-length",this);e.properties.length||(e.properties=this._bindProperties)}),this._to=t.to,t.callback&&(this._bindings.get(e[0]).callback=t.callback),r=this._observable,this._to.forEach(i=>{const o=r[co];let n;o.get(i.observable)||r.listenTo(i.observable,"change",(e,t)=>{n=o.get(i.observable)[t],n&&n.forEach(e=>{vo(r,e.property)})})}),function(o){let n;
5o._bindings.forEach((t,i)=>{o._to.forEach(e=>{n=e.properties[t.callback?0:o._bindProperties.indexOf(i)],t.to.push([e.observable,n]),function(e,t,i,o){const n=e[co],r=n.get(i),s=r||{};s[o]||(s[o]=new Set);s[o].add(t),r||n.set(i,s)}(o._observable,t,e.observable,n)})})}(this),this._bindProperties.forEach(e=>{vo(this._observable,e)})}function ko(e,t,i){if(1<this._bindings.size)throw new Bt.a("observable-bind-to-many-not-one-binding",this);this.to(...function(e,t){e=e.map(e=>[e,t]);return Array.prototype.concat.apply([],e)}(e,t),i)}function wo(e){return e.every(e=>"string"==typeof e)}function vo(e,t){const i=e[ho],o=i.get(t);let n;n=o.callback?o.callback.apply(e,o.to.map(e=>e[0][e[1]])):(n=o.to[0],n[0][n[1]]),Object.prototype.hasOwnProperty.call(e,t)?e[t]=n:e.set(t,n)}class _o extends ro{constructor(t,e,i,o){super(t,e,i,o),this.set("isReadOnly",!1),this.set("isFocused",!1),this.bind("isReadOnly").to(t),this.bind("isFocused").to(t,"isFocused",e=>e&&t.selection.editableElement==this),this.listenTo(t.selection,"change",()=>{this.isFocused=t.isFocused&&t.selection.editableElement==this})}is(e,t=null){return t?t===this.name&&("editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}destroy(){this.stopListening()}}Gt(_o,fo);const yo=Symbol("rootName");class xo extends _o{constructor(e,t){super(e,t),this.rootName="main"}is(e,t=null){return t?t===this.name&&("rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}get rootName(){return this.getCustomProperty(yo)}set rootName(e){this._setCustomProperty(yo,e)}set _name(e){this.name=e}}class Co{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new Bt.a("view-tree-walker-no-start-position",null);if(e.direction&&"forward"!=e.direction&&"backward"!=e.direction)throw new Bt.a("view-tree-walker-unknown-direction",e.startPosition,{direction:e.direction});this.boundaries=e.boundaries||null,e.startPosition?this.position=Ao._createAt(e.startPosition):this.position=Ao._createAt(e.boundaries["backward"==e.direction?"end":"start"]),this.direction=e.direction||"forward",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(e){let t,i,o;for(;o=this.position,{done:t,value:i}=this.next(),!t&&e(i););t||(this.position=o)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let i=this.position.clone();var o=this.position;const t=i.parent;if(null===t.parent&&i.offset===t.childCount)return{done:!0};if(t===this._boundaryEndParent&&i.offset==this.boundaries.end.offset)return{done:!0};let n;if(t instanceof si){if(i.isAtEnd)return this.position=Ao._createAfter(t),this._next();n=t.data[i.offset]}else n=t.getChild(i.offset);if(n instanceof oo)return this.shallow?i.offset++:i=new Ao(n,0),this.position=i,this._formatReturnValue("elementStart",n,o,i,1);if(n instanceof si){if(this.singleCharacters)return i=new Ao(n,0),this.position=i,this._next();{let e=n.data.length,t;return n==this._boundaryEndParent?(e=this.boundaries.end.offset,t=new ai(n,0,e),i=Ao._createAfter(t)):(t=new ai(n,0,n.data.length),i.offset++),this.position=i,this._formatReturnValue("text",t,o,i,e)}}if("string"!=typeof n)return i=Ao._createAfter(t),this.position=i,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",t,o,i);{let e;e=this.singleCharacters?1:(t===this._boundaryEndParent?this.boundaries.end.offset:t.data.length)-i.offset;var r=new ai(t,i.offset,e);return i.offset+=e,this.position=i,this._formatReturnValue("text",r,o,i,e)}}_previous(){let i=this.position.clone();var o,n=this.position;const t=i.parent;if(null===t.parent&&0===i.offset)return{done:!0};if(t==this._boundaryStartParent&&i.offset==this.boundaries.start.offset)return{done:!0};let r;if(t instanceof si){if(i.isAtStart)return this.position=Ao._createBefore(t),this._previous();r=t.data[i.offset-1]}else r=t.getChild(i.offset-1);if(r instanceof oo)return this.shallow?(i.offset--,this.position=i,this._formatReturnValue("elementStart",r,n,i,1)):(i=new Ao(r,r.childCount),this.position=i,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",r,n,i));if(r instanceof si){if(this.singleCharacters)return i=new Ao(r,r.data.length),this.position=i,this._previous();{let e=r.data.length,t;return r==this._boundaryStartParent?(o=this.boundaries.start.offset,t=new ai(r,o,r.data.length-o),e=t.data.length,i=Ao._createBefore(t)):(t=new ai(r,0,r.data.length),i.offset--),this.position=i,this._formatReturnValue("text",t,n,i,e)}}if("string"!=typeof r)return i=Ao._createBefore(t),this.position=i,this._formatReturnValue("elementStart",t,n,i,1);{let e;e=this.singleCharacters?1:(s=t===this._boundaryStartParent?this.boundaries.start.offset:0,i.offset-s),i.offset-=e;var s=new ai(t,i.offset,e);return this.position=i,this._formatReturnValue("text",s,n,i,e)}}_formatReturnValue(e,t,i,o,n){return t instanceof ai&&(t.offsetInText+t.data.length==t.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?i=Ao._createAfter(t.textNode):(o=Ao._createAfter(t.textNode),this.position=o)
5),0===t.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?i=Ao._createBefore(t.textNode):(o=Ao._createBefore(t.textNode),this.position=o))),{done:!1,value:{type:e,item:t,previousPosition:i,nextPosition:o,length:n}}}}class Ao{constructor(e,t){this.parent=e,this.offset=t}get nodeAfter(){return!this.parent.is("$text")&&this.parent.getChild(this.offset)||null}get nodeBefore(){return!this.parent.is("$text")&&this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){var e=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===e}get root(){return this.parent.root}get editableElement(){let e=this.parent;for(;!(e instanceof _o);){if(!e.parent)return null;e=e.parent}return e}getShiftedBy(e){const t=Ao._createAt(this);e=t.offset+e;return t.offset=e<0?0:e,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const i=new Co(t);return i.skip(e),i.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){var t=this.getAncestors(),i=e.getAncestors();let o=0;for(;t[o]==i[o]&&t[o];)o++;return 0===o?null:t[o-1]}is(e){return"position"===e||"view:position"===e}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return"before"==this.compareWith(e)}isAfter(e){return"after"==this.compareWith(e)}compareWith(e){if(this.root!==e.root)return"different";if(this.isEqual(e))return"same";const t=this.parent.is("node")?this.parent.getPath():[],i=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset),i.push(e.offset);var o=oi(t,i);switch(o){case"prefix":return"before";case"extension":return"after";default:return t[o]<i[o]?"before":"after"}}getWalker(e={}){return e.startPosition=this,new Co(e)}clone(){return new Ao(this.parent,this.offset)}static _createAt(e,t){if(e instanceof Ao)return new this(e.parent,e.offset);{const i=e;if("end"==t)t=i.is("$text")?i.data.length:i.childCount;else{if("before"==t)return this._createBefore(i);if("after"==t)return this._createAfter(i);if(0!==t&&!t)throw new Bt.a("view-createpositionat-offset-required",i)}return new Ao(i,t)}}static _createAfter(e){if(e.is("$textProxy"))return new Ao(e.textNode,e.offsetInText+e.data.length);if(!e.parent)throw new Bt.a("view-position-after-root",e,{root:e});return new Ao(e.parent,e.index+1)}static _createBefore(e){if(e.is("$textProxy"))return new Ao(e.textNode,e.offsetInText);if(!e.parent)throw new Bt.a("view-position-before-root",e,{root:e});return new Ao(e.parent,e.index)}}class To{constructor(e,t=null){this.start=e.clone(),this.end=(t||e).clone()}*[Symbol.iterator](){yield*new Co({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return this.start.parent===this.end.parent}get root(){return this.start.root}getEnlarged(){let e=this.start.getLastMatchingPosition(Eo,{direction:"backward"}),t=this.end.getLastMatchingPosition(Eo);return e.parent.is("$text")&&e.isAtStart&&(e=Ao._createBefore(e.parent)),t.parent.is("$text")&&t.isAtEnd&&(t=Ao._createAfter(t.parent)),new To(e,t)}getTrimmed(){let e=this.start.getLastMatchingPosition(Eo);if(e.isAfter(this.end)||e.isEqual(this.end))return new To(e,e);let t=this.end.getLastMatchingPosition(Eo,{direction:"backward"});const i=e.nodeAfter,o=t.nodeBefore;return i&&i.is("$text")&&(e=new Ao(i,0)),o&&o.is("$text")&&(t=new Ao(o,o.data.length)),new To(e,t)}isEqual(e){return this==e||this.start.isEqual(e.start)&&this.end.isEqual(e.end)}containsPosition(e){return e.isAfter(this.start)&&e.isBefore(this.end)}containsRange(e,t=!1){e.isCollapsed&&(t=!1);var i=this.containsPosition(e.start)||t&&this.start.isEqual(e.start),e=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return i&&e}getDifference(e){const t=[];return this.isIntersecting(e)?(this.containsPosition(e.start)&&t.push(new To(this.start,e.start)),this.containsPosition(e.end)&&t.push(new To(e.end,this.end))):t.push(this.clone()),t}getIntersection(i){if(this.isIntersecting(i)){let e=this.start,t=this.end;return this.containsPosition(i.start)&&(e=i.start),this.containsPosition(i.end)&&(t=i.end),new To(e,t)}return null}getWalker(e={}
5){return e.boundaries=this,new Co(e)}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}getContainedElement(){if(this.isCollapsed)return null;let e=this.start.nodeAfter,t=this.end.nodeBefore;return this.start.parent.is("$text")&&this.start.isAtEnd&&this.start.parent.nextSibling&&(e=this.start.parent.nextSibling),this.end.parent.is("$text")&&this.end.isAtStart&&this.end.parent.previousSibling&&(t=this.end.parent.previousSibling),e&&e.is("element")&&e===t?e:null}clone(){return new To(this.start,this.end)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;for(const t of new Co(e))yield t.item}*getPositions(e={}){e.boundaries=this;e=new Co(e);yield e.position;for(const t of e)yield t.nextPosition}is(e){return"range"===e||"view:range"===e}isIntersecting(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}static _createFromParentsAndOffsets(e,t,i,o){return new this(new Ao(e,t),new Ao(i,o))}static _createFromPositionAndShift(e,t){var i=e,e=e.getShiftedBy(t);return 0<t?new this(i,e):new this(e,i)}static _createIn(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}static _createOn(e){var t=e.is("$textProxy")?e.offsetSize:1;return this._createFromPositionAndShift(Ao._createBefore(e),t)}}function Eo(e){return!(!e.item.is("attributeElement")&&!e.item.is("uiElement"))}function Po(e){let t=0;for(const i of e)t++;return t}class So{constructor(e=null,t,i){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(e,t,i)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;var e=this._ranges[this._ranges.length-1];const t=this._lastRangeBackward?e.end:e.start;return t.clone()}get focus(){if(!this._ranges.length)return null;var e=this._ranges[this._ranges.length-1];const t=this._lastRangeBackward?e.start:e.end;return t.clone()}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const e of this._ranges)yield e.clone()}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?e.clone():null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}isEqual(t){if(this.isFake!=t.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=t.fakeSelectionLabel)return!1;if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const i of this._ranges){let e=!1;for(const o of t._ranges)if(i.isEqual(o)){e=!0;break}if(!e)return!1}return!0}isSimilar(t){if(this.isBackward!=t.isBackward)return!1;var i,e=Po(this.getRanges());if(e!=Po(t.getRanges()))return!1;if(0==e)return!0;for(i of this.getRanges()){i=i.getTrimmed();let e=!1;for(var o of t.getRanges())if(o=o.getTrimmed(),i.start.isEqual(o.start)&&i.end.isEqual(o.end)){e=!0;break}if(!e)return!1}return!0}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}setTo(t,i,o){if(null===t)this._setRanges([]),this._setFakeOptions(i);else if(t instanceof So||t instanceof Io)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof To)this._setRanges([t],i&&i.backward),this._setFakeOptions(i);else if(t instanceof Ao)this._setRanges([new To(t)]),this._setFakeOptions(i);else if(t instanceof ri){var n=!!o&&!!o.backward;let e;if(void 0===i)throw new Bt.a("view-selection-setto-required-second-parameter",this);e="in"==i?To._createIn(t):"on"==i?To._createOn(t):new To(Ao._createAt(t,i)),this._setRanges([e],n),this._setFakeOptions(o)}else{if(!Kt(t))throw new Bt.a("view-selection-setto-not-selectable",this);this._setRanges(t,i&&i.backward),this._setFakeOptions(i)}this.fire("change")}setFocus(e,t){if(null===this.anchor)throw new Bt.a("view-selection-setfocus-no-ranges",this);const i=Ao._createAt(e,t);
5"same"!=i.compareWith(this.focus)&&(t=this.anchor,this._ranges.pop(),"before"==i.compareWith(t)?this._addRange(new To(i,t),!0):this._addRange(new To(t,i)),this.fire("change"))}is(e){return"selection"===e||"view:selection"===e}_setRanges(e,t=!1){e=Array.from(e),this._ranges=[];for(const i of e)this._addRange(i);this._lastRangeBackward=!!t}_setFakeOptions(e={}){this._isFake=!!e.fake,this._fakeSelectionLabel=e.fake&&e.label||""}_addRange(e,t=!1){if(!(e instanceof To))throw new Bt.a("view-selection-add-range-not-range",this);this._pushRange(e),this._lastRangeBackward=!!t}_pushRange(e){for(const t of this._ranges)if(e.isIntersecting(t))throw new Bt.a("view-selection-range-intersects",this,{addedRange:e,intersectingRange:t});this._ranges.push(new To(e.start,e.end))}}Gt(So,Lt);class Io{constructor(e=null,t,i){this._selection=new So,this._selection.delegate("change").to(this),this._selection.setTo(e,t,i)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}is(e){return"selection"===e||"documentSelection"==e||"view:selection"==e||"view:documentSelection"==e}_setTo(e,t,i){this._selection.setTo(e,t,i)}_setFocus(e,t){this._selection.setFocus(e,t)}}Gt(Io,Lt);class Ro extends Vt{constructor(e,t,i){super(e,t),this.startRange=i,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const Oo=Symbol("bubbling contexts");function Vo(e,t,i){e instanceof Ro&&(e._eventPhase=t,e._currentTarget=i)}function Mo(e,t,i,...o){const n="string"==typeof t?e.get(t):No(e,t);return n&&(n.fire(i,...o),i.stop.called)}function No(e,t){for(var[i,o]of e)if("function"==typeof i&&i(t))return o;return null}function zo(e){return e[Oo]||(e[Oo]=new Map),e[Oo]}class Bo{constructor(e){this.selection=new Io,this.roots=new Jt({idProperty:"rootName"}),this.stylesProcessor=e,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isComposing",!1),this._postFixers=new Set}getRoot(e="main"){return this.roots.get(e)}registerPostFixer(e){this._postFixers.add(e)}destroy(){this.roots.map(e=>e.destroy()),this.stopListening()}_callPostFixers(e){let t=!1;do{for(const i of this._postFixers)if(t=i(e),t)break}while(t)}}Gt(Bo,{fire(t,...i){try{var o=t instanceof Vt?t:new Vt(this,t),n=zo(this);if(!n.size)return;if(Vo(o,"capturing",this),Mo(n,"$capture",o,...i))return o.return;const a=o.startRange||this.selection.getFirstRange();var r=a?a.getContainedElement():null,s=!!r&&Boolean(No(n,r));let e=r||function(e){if(!e)return null;const t=e.start.parent,i=e.end.parent,o=t.getPath(),n=i.getPath();return o.length>n.length?t:i}(a);if(Vo(o,"atTarget",e),!s){if(Mo(n,"$text",o,...i))return o.return;Vo(o,"bubbling",e)}for(;e;){if(e.is("rootElement")){if(Mo(n,"$root",o,...i))return o.return}else if(e.is("element")&&Mo(n,e.name,o,...i))return o.return;if(Mo(n,e,o,...i))return o.return;e=e.parent,Vo(o,"bubbling",e)}return Vo(o,"bubbling",this),Mo(n,"$document",o,...i),o.return}catch(e){Bt.a.rethrowUnexpectedError(e,this)}},_addEventListener(t,i,o){var e=Xt(o.context||"$document");const n=zo(this);for(const r of e){let e=n.get(r);e||(e=Object.create(Lt),n.set(r,e)),this.listenTo(e,t,i,o)}},_removeEventListener(e,t){const i=zo(this);for(const o of i.values())this.stopListening(o,e,t)}}),Gt(Bo,fo);class Fo extends oo{constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=Do,this._priority=10,this._id=null,this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new Bt.a("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}is(e,t=null){return t?t===this.name&&("attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e):"attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}isSimilar(e){return null!==this.id||null!==e.id?this.id===e.id:super.isSimilar(e)&&this.priority==e.priority}_clone(e){const t=super._clone(e);return t._priority=this._priority,t._id=this._id,t}}function Do(){if(Lo(this))return null;let e=this.parent;for(;e&&e.is("attributeElement");){if(1<Lo(e))return null;e=e.parent}return!e||1<Lo(e)?null:this.childCount}function Lo(e){return Array.from(e.getChildren()).filter(e=>!e.is("uiElement")).length}Fo.DEFAULT_PRIORITY=10;class Ho extends oo{constructor(e,t,i,o){super(e,t,i,o),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=jo}is(e,t=null){return t?t===this.name&&("emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e):"emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}_insertChild(e,t){if(t&&(t instanceof ri||0<Array.from(t).length))throw new Bt.a("view-emptyelement-cannot-add",[this,t])}}function jo(){return null}var Wo,$o,qo=navigator.userAgent.toLowerCase(),Uo={isMac:-1<qo.indexOf("macintosh"),isGecko:!!qo.match(/gecko\/\d+/),isSafari:-1<($o=qo).indexOf(" applewebkit/")&&-1===$o.indexOf("chrome"),isAndroid:-1<qo.indexOf("android"),isBlink:-1<(Wo=qo).indexOf("chrome/")&&Wo.indexOf("edge/")<0,features:{isRegExpUnicodePropertySupported:function(){let e=!1;try{e=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch(e){}return e}()}};const Ko={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},Go={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},Jo=function(){const t={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let e=65;e<=90;e++){const i=String.fromCharCode(e);t[i.toLowerCase()]=e}for(let e=48;e<=57;e++)t[e-48]=e;for(let e=112;e<=123;e++)t["f"+(e-111)]=e;return t}(),Yo=Object.fromEntries(Object.entries(Jo).map(([e,t])=>[t,e.charAt(0).toUpperCase()+e.slice(1)]));function Xo(e){let t;if("string"==typeof e){if(t=Jo[e.toLowerCase()],!t)throw new Bt.a("keyboard-unknown-key",null,{key:e})}else t=e.keyCode+(e.altKey?Jo.alt:0)+(e.ctrlKey?Jo.ctrl:0)+(e.shiftKey?Jo.shift:0)+(e.metaKey?Jo.cmd:0);return t}function Qo(e){return(e="string"==typeof e?e.split("+").map(e=>e.trim()):e).map(e=>"string"==typeof e?function(e){if(e.endsWith("!"))return Xo(e.slice(0,-1));e=Xo(e);return Uo.isMac&&e==Jo.ctrl?Jo.cmd:e}(e):e).reduce((e,t)=>
5t+e,0)}function Zo(e){let o=Qo(e);const t=Object.entries(Uo.isMac?Ko:Go);return t.reduce((e,[t,i])=>(0!=(o&Jo[t])&&(o&=~Jo[t],e+=i),e),"")+(o?Yo[o]:"")}function en(e,t){var i="ltr"===t;switch(e){case Jo.arrowleft:return i?"left":"right";case Jo.arrowright:return i?"right":"left";case Jo.arrowup:return"up";case Jo.arrowdown:return"down"}}function tn(e,t){t=en(e,t);return"down"===t||"right"===t}class on extends oo{constructor(e,t,i,o){super(e,t,i,o),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=rn}is(e,t=null){return t?t===this.name&&("uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e):"uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}_insertChild(e,t){if(t&&(t instanceof ri||0<Array.from(t).length))throw new Bt.a("view-uielement-cannot-add",this)}render(e){return this.toDomElement(e)}toDomElement(e){const t=e.createElement(this.name);for(const i of this.getAttributeKeys())t.setAttribute(i,this.getAttribute(i));return t}}function nn(i){i.document.on("arrowKey",(e,t)=>function(e,i){if(e.keyCode==Jo.arrowright){const n=e.domTarget.ownerDocument.defaultView.getSelection();var o=1==n.rangeCount&&n.getRangeAt(0).collapsed;if(o||e.shiftKey){var t=n.focusNode,e=n.focusOffset;const r=i.domPositionToView(t,e);if(null!==r){let t=!1;e=r.getLastMatchingPosition(e=>(e.item.is("uiElement")&&(t=!0),!(!e.item.is("uiElement")&&!e.item.is("attributeElement"))));t&&(e=i.viewPositionToDom(e),o?n.collapse(e.parent,e.offset):n.extend(e.parent,e.offset))}}}}(t,i.domConverter),{priority:"low"})}function rn(){return null}class sn extends oo{constructor(e,t,i,o){super(e,t,i,o),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=an}is(e,t=null){return t?t===this.name&&("rawElement"===e||"view:rawElement"===e||"element"===e||"view:element"===e):"rawElement"===e||"view:rawElement"===e||e===this.name||e==="view:"+this.name||"element"===e||"view:element"===e||"node"===e||"view:node"===e}_insertChild(e,t){if(t&&(t instanceof ri||0<Array.from(t).length))throw new Bt.a("view-rawelement-cannot-add",[this,t])}}function an(){return null}class ln{constructor(e,t){this.document=e,this._children=[],t&&this._insertChild(0,t)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(e){return"documentFragment"===e||"view:documentFragment"===e}_appendChild(e){return this._insertChild(this.childCount,e)}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(e,t){this._fireChange("children",this);let i=0;for(const o of function(t,e){if("string"==typeof e)return[new si(t,e)];Kt(e)||(e=[e]);return Array.from(e).map(e=>"string"==typeof e?new si(t,e):e instanceof ai?new si(t,e.data):e)}(this.document,t))null!==o.parent&&o._remove(),(o.parent=this)._children.splice(e,0,o),e++,i++;return i}_removeChildren(t,i=1){this._fireChange("children",this);for(let e=t;e<t+i;e++)this._children[e].parent=null;return this._children.splice(t,i)}_fireChange(e,t){this.fire("change:"+e,t)}}Gt(ln,Lt);class cn{constructor(e){this.document=e,this._cloneGroups=new Map}setSelection(e,t,i){this.document.selection._setTo(e,t,i)}setSelectionFocus(e,t){this.document.selection._setFocus(e,t)}createDocumentFragment(e){return new ln(this.document,e)}createText(e){return new si(this.document,e)}createAttributeElement(e,t,i={}){const o=new Fo(this.document,e,t);return"number"==typeof i.priority&&(o._priority=i.priority),i.id&&(o._id=i.id),o}createContainerElement(e,t,i={}){const o=new ro(this.document,e,t);return void 0!==i.isAllowedInsideAttributeElement&&(o._isAllowedInsideAttributeElement=i.isAllowedInsideAttributeElement),o}createEditableElement(e,t){const i=new _o(this.document,e,t);return i._document=this.document,i}createEmptyElement(e,t,i={}){const o=new Ho(this.document,e,t);return void 0!==i.isAllowedInsideAttributeElement&&(o._isAllowedInsideAttributeElement=i.isAllowedInsideAttributeElement),o}createUIElement(e,t,i,o={}){const n=new on(this.document,e,t);return i&&(n.render=i),void 0!==o.isAllowedInsideAttributeElement&&(n._isAllowedInsideAttributeElement=o.isAllowedInsideAttributeElement),n}createRawElement(e,t,i,o={}){const n=new sn(this.document,e,t);return n.render=i||(()=>{}),void 0!==o.isAllowedInsideAttributeElement&&(n._isAllowedInsideAttributeElement=o.isAllowedInsideAttributeElement),n}setAttribute(e,t,i){i._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,i){(i=y(e)&&void 0===i?t:i)._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,i){i._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}breakAttributes(e){return e instanceof Ao?this._breakAttributes(e):this._breakAttributesRange(e)}breakContainer(e){const t=e.parent;if(!t.is("containerElement"))throw new Bt.a("view-writer-break-non-container-element",this.document);if(!t.parent)throw new Bt.a("view-writer-break-root",this.document);return e.isAtStart?Ao._createBefore(t):(e.isAtEnd||(i=t._clone(!1),this.insert(Ao._createAfter(t),i),e=new To(e,Ao._createAt(t,"end")),i=new Ao(i,0),this.move(e,i)),Ao._createAfter(t));var i}mergeAttributes(e){var t=e.offset;const i=e.parent;if(i.is("$text"))return e;if(i.is("attributeElement")&&0===i.childCount){var o=i.parent,n=i.index;return i._remove(),this._removeFromClonedElementsGroup(i),this.mergeAttributes(new Ao(o,n))}const r=i.getChild(t-1),s=i.getChild(t);if(!r||!s)return e;if(r.is("$text")&&s.is("$text"))return gn(r,s);if(r.is("attributeElement")&&s.is("attributeElement")&&r.isSimilar(s)){t=r.childCount;return r._appendChild(s.getChildren()),s._remove(),this._removeFromClonedElementsGroup(s),this.mergeAttributes(new Ao(r,t))}return e}mergeContainers(e){const t=e.nodeBefore,i=e.nodeAfter;if(!(t&&i&&t.is("containerElement")&&i.is("containerElement")))throw new Bt.a("view-writer-merge-containers-invalid-position",this.document);e=t.getChild(t.childCount-1),e=e instanceof si?Ao._createAt(e,"end"):Ao._createAt(t,"end");return this.move(To._createIn(i),Ao._createAt(t,"end")),this.remove(To._createOn(i)),e}insert(e,t){(function e(t,i){for(const o of t){if(!mn.some(e=>o instanceof e))throw new Bt.a("view-writer-insert-invalid-node-type",i);o.is("$text")||e(o.getChildren(),i)}})(t=Kt(t)?[...t]:[t],this.document);t=t.reduce((e,t)=>
5{const i=e[e.length-1];var o=!(t.is("uiElement")&&t.isAllowedInsideAttributeElement);return i&&i.breakAttributes==o?i.nodes.push(t):e.push({breakAttributes:o,nodes:[t]}),e},[]);let i=null,o=e;for(const{nodes:r,breakAttributes:s}of t){var n=this._insertNodes(o,r,s);i=i||n.start,o=n.end}return i?new To(i,o):new To(e)}remove(e){const t=e instanceof To?e:To._createOn(e);if(pn(t,this.document),t.isCollapsed)return new ln(this.document);var{start:i,end:e}=this._breakAttributesRange(t,!0);const o=i.parent;e=e.offset-i.offset,e=o._removeChildren(i.offset,e);for(const r of e)this._removeFromClonedElementsGroup(r);const n=this.mergeAttributes(i);return t.start=n,t.end=n.clone(),new ln(this.document,e)}clear(t,i){var o;pn(t,this.document);for(const n of t.getWalker({direction:"backward",ignoreElementEnd:!0})){const r=n.item;let e;r.is("element")&&i.isSimilar(r)?e=To._createOn(r):n.nextPosition.isAfter(t.start)||!r.is("$textProxy")||(o=r.getAncestors().find(e=>e.is("element")&&i.isSimilar(e)))&&(e=To._createIn(o)),e&&(e.end.isAfter(t.end)&&(e.end=t.end),e.start.isBefore(t.start)&&(e.start=t.start),this.remove(e))}}move(e,t){let i;var o,n;return t.isAfter(e.end)?(n=(o=(t=this._breakAttributes(t,!0)).parent).childCount,e=this._breakAttributesRange(e,!0),i=this.remove(e),t.offset+=o.childCount-n):i=this.remove(e),this.insert(t,i)}wrap(t,i){if(!(i instanceof Fo))throw new Bt.a("view-writer-wrap-invalid-attribute",this.document);if(pn(t,this.document),t.isCollapsed){let e=t.start;e.parent.is("element")&&(o=e.parent,!Array.from(o.getChildren()).some(e=>!e.is("uiElement")))&&(e=e.getLastMatchingPosition(e=>e.item.is("uiElement"))),e=this._wrapPosition(e,i);const n=this.document.selection;return n.isCollapsed&&n.getFirstPosition().isEqual(t.start)&&this.setSelection(e),new To(e)}return this._wrapRange(t,i);var o}unwrap(e,t){if(!(t instanceof Fo))throw new Bt.a("view-writer-unwrap-invalid-attribute",this.document);if(pn(e,this.document),e.isCollapsed)return e;var{start:i,end:o}=this._breakAttributesRange(e,!0),e=i.parent;const n=this._unwrapChildren(e,i.offset,o.offset,t),r=this.mergeAttributes(n.start);r.isEqual(n.start)||n.end.offset--;t=this.mergeAttributes(n.end);return new To(r,t)}rename(e,t){e=new ro(this.document,e,t.getAttributes());return this.insert(Ao._createAfter(t),e),this.move(To._createIn(t),Ao._createAt(e,0)),this.remove(To._createOn(t)),e}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return Ao._createAt(e,t)}createPositionAfter(e){return Ao._createAfter(e)}createPositionBefore(e){return Ao._createBefore(e)}createRange(e,t){return new To(e,t)}createRangeOn(e){return To._createOn(e)}createRangeIn(e){return To._createIn(e)}createSelection(e,t,i){return new So(e,t,i)}_insertNodes(e,t,i){let o;if(o=i?dn(e):(e.parent.is("$text")?e.parent:e).parent,!o)throw new Bt.a("view-writer-invalid-position-container",this.document);let n;n=i?this._breakAttributes(e,!0):e.parent.is("$text")?un(e):e;e=o._insertChild(n.offset,t);for(const a of t)this._addToClonedElementsGroup(a);const r=n.getShiftedBy(e),s=this.mergeAttributes(n);s.isEqual(n)||r.offset--;e=this.mergeAttributes(r);return new To(s,e)}_wrapChildren(e,t,i,o){let n=t;const r=[];for(;n<i;){const d=e.getChild(n);var s=d.is("$text"),a=d.is("attributeElement"),l=d.isAllowedInsideAttributeElement;if(a&&this._wrapAttributeElement(o,d))r.push(new Ao(e,n));else if(s||l||a&&function(e,t){{if(e.priority<t.priority)return!0;if(e.priority>t.priority)return!1}return e.getIdentity()<t.getIdentity()}(o,d)){const h=o._clone();d._remove(),h._appendChild(d),e._insertChild(n,h),this._addToClonedElementsGroup(h),r.push(new Ao(e,n))}else a&&this._wrapChildren(d,0,d.childCount,o);n++}let c=0;for(const u of r)if(u.offset-=c,u.offset!=t){const g=this.mergeAttributes(u);g.isEqual(u)||(c++,i--)}return To._createFromParentsAndOffsets(e,t,e,i)}_unwrapChildren(e,t,i,o){let n=t;const r=[];for(;n<i;){const c=e.getChild(n);var s,a;c.is("attributeElement")?c.isSimilar(o)?(s=c.getChildren(),a=c.childCount,c._remove(),e._insertChild(n,s),this._removeFromClonedElementsGroup(c),r.push(new Ao(e,n),new Ao(e,n+a)),n+=a,i+=a-1):(this._unwrapAttributeElement(o,c)?r.push(new Ao(e,n),new Ao(e,n+1)):this._unwrapChildren(c,0,c.childCount,o),n++):n++}let l=0;for(const d of r)if(d.offset-=l,d.offset!=t&&d.offset!=i){const h=this.mergeAttributes(d);h.isEqual(d)||(l++,i--)}return To._createFromParentsAndOffsets(e,t,e,i)}_wrapRange(e,t){var{start:i,end:o}=this._breakAttributesRange(e,!0),e=i.parent;const n=this._wrapChildren(e,i.offset,o.offset,t),r=this.mergeAttributes(n.start);r.isEqual(n.start)||n.end.offset--;t=this.mergeAttributes(n.end);return new To(r,t)}_wrapPosition(e,t){if(t.isSimilar(e.parent))return hn(e.clone());e.parent.is("$text")&&(e=un(e));const i=this.createAttributeElement();
5i._priority=Number.POSITIVE_INFINITY,i.isSimilar=()=>!1,e.parent._insertChild(e.offset,i);var o=new To(e,e.getShiftedBy(1));this.wrap(o,t);e=new Ao(i.parent,i.index);i._remove();o=e.nodeBefore,t=e.nodeAfter;return o instanceof si&&t instanceof si?gn(o,t):hn(e)}_wrapAttributeElement(e,t){if(!bn(e,t))return!1;if(e.name!==t.name||e.priority!==t.priority)return!1;for(const i of e.getAttributeKeys())if("class"!==i&&"style"!==i&&t.hasAttribute(i)&&t.getAttribute(i)!==e.getAttribute(i))return!1;for(const o of e.getStyleNames())if(t.hasStyle(o)&&t.getStyle(o)!==e.getStyle(o))return!1;for(const n of e.getAttributeKeys())"class"!==n&&"style"!==n&&(t.hasAttribute(n)||this.setAttribute(n,e.getAttribute(n),t));for(const r of e.getStyleNames())t.hasStyle(r)||this.setStyle(r,e.getStyle(r),t);for(const s of e.getClassNames())t.hasClass(s)||this.addClass(s,t);return!0}_unwrapAttributeElement(e,t){if(!bn(e,t))return!1;if(e.name!==t.name||e.priority!==t.priority)return!1;for(const i of e.getAttributeKeys())if("class"!==i&&"style"!==i&&(!t.hasAttribute(i)||t.getAttribute(i)!==e.getAttribute(i)))return!1;if(!t.hasClass(...e.getClassNames()))return!1;for(const o of e.getStyleNames())if(!t.hasStyle(o)||t.getStyle(o)!==e.getStyle(o))return!1;for(const n of e.getAttributeKeys())"class"!==n&&"style"!==n&&this.removeAttribute(n,t);return this.removeClass(Array.from(e.getClassNames()),t),this.removeStyle(Array.from(e.getStyleNames()),t),!0}_breakAttributesRange(e,t=!1){var i=e.start,o=e.end;if(pn(e,this.document),e.isCollapsed){e=this._breakAttributes(e.start,t);return new To(e,e)}const n=this._breakAttributes(o,t);o=n.parent.childCount,t=this._breakAttributes(i,t);return n.offset+=n.parent.childCount-o,new To(t,n)}_breakAttributes(e,t=!1){var i=e.offset;const o=e.parent;if(e.parent.is("emptyElement"))throw new Bt.a("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new Bt.a("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new Bt.a("view-writer-cannot-break-raw-element",this.document);if(!t&&o.is("$text")&&fn(o.parent))return e.clone();if(fn(o))return e.clone();if(o.is("$text"))return this._breakAttributes(un(e),t);if(i==o.childCount){var n=new Ao(o.parent,o.index+1);return this._breakAttributes(n,t)}if(0===i){var r=new Ao(o.parent,o.index);return this._breakAttributes(r,t)}{n=o.index+1;const s=o._clone();o.parent._insertChild(n,s),this._addToClonedElementsGroup(s);r=o.childCount-i,r=o._removeChildren(i,r);s._appendChild(r);n=new Ao(o.parent,n);return this._breakAttributes(n,t)}}_addToClonedElementsGroup(t){if(t.root.is("rootElement")){if(t.is("element"))for(const e of t.getChildren())this._addToClonedElementsGroup(e);var i=t.id;if(i){let e=this._cloneGroups.get(i);e||(e=new Set,this._cloneGroups.set(i,e)),e.add(t),t._clonesGroup=e}}}_removeFromClonedElementsGroup(e){if(e.is("element"))for(const i of e.getChildren())this._removeFromClonedElementsGroup(i);var t=e.id;if(t){const o=this._cloneGroups.get(t);o&&o.delete(e)}}}function dn(e){let t=e.parent;for(;!fn(t);){if(!t)return;t=t.parent}return t}function hn(e){const t=e.nodeBefore;if(t&&t.is("$text"))return new Ao(t,t.data.length);const i=e.nodeAfter;return i&&i.is("$text")?new Ao(i,0):e}function un(e){if(e.offset==e.parent.data.length)return new Ao(e.parent.parent,e.parent.index+1);if(0===e.offset)return new Ao(e.parent.parent,e.parent.index);var t=e.parent.data.slice(e.offset);return e.parent._data=e.parent.data.slice(0,e.offset),e.parent.parent._insertChild(e.parent.index+1,new si(e.root.document,t)),new Ao(e.parent.parent,e.parent.index+1)}function gn(e,t){var i=e.data.length;return e._data+=t.data,t._remove(),new Ao(e,i)}const mn=[si,Fo,ro,Ho,sn,on];function fn(e){return e&&(e.is("containerElement")||e.is("documentFragment"))}function pn(e,t){var i=dn(e.start),e=dn(e.end);if(!i||!e||i!==e)throw new Bt.a("view-writer-invalid-range-container",t)}function bn(e,t){return null===e.id&&null===t.id}function kn(e){return"[object Text]"==Object.prototype.toString.call(e)}const wn=e=>e.createTextNode(" "),vn=e=>{const t=e.createElement("span");return t.dataset.ckeFiller=!0,t.innerHTML=" ",t},_n=e=>{const t=e.createElement("br");return t.dataset.ckeFiller=!0,t},yn=7,xn="⁠".repeat(yn);function Cn(e){return kn(e)&&e.data.substr(0,yn)===xn}function An(e){return e.data.length==yn&&Cn(e)}function Tn(e){return Cn(e)?e.data.slice(yn):e.data}function En(e,t){if(t.keyCode==Jo.arrowleft){const o=t.domTarget.ownerDocument.defaultView.getSelection();var i;1==o.rangeCount&&o.getRangeAt(0).collapsed&&(i=o.getRangeAt(0).startContainer,t=o.getRangeAt(0).startOffset,Cn(i)&&t<=yn&&o.collapse(i,0))}}function Pn(e,t,i,o=!1){i=i||function(e,t){return e===t};i=function(e,t,i){var o=Sn(e,t,i);if(-1===o)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};var n=In(e,o),r=In(t,o),i=Sn(n,r,i),e=e.length-i,i=t.length-i;return{firstIndex:o,lastIndexOld:e,lastIndexNew:i}}(e=!Array.isArray(e)?Array.prototype.slice.call(e):e,t=!Array.isArray(t)?Array.prototype.slice.call(t):t,i);return o?function(e,t){var{firstIndex:i,lastIndexOld:o,lastIndexNew:e}=e;if(-1===i)return Array(t).fill("equal");let n=[];0<i&&(n=n.concat(Array(i).fill("equal")));0<e-i&&(n=n.concat(Array(e-i).fill("insert")));0<o-i&&(n=n.concat(Array(o-i).fill("delete")));e<t&&(n=n.concat(Array(t-e).fill("equal")));return n}(i,t.length):function(e,t){const i=[],{firstIndex:o,lastIndexOld:n,lastIndexNew:r}=t;0<r-o&&i.push({index:o,type:"insert",values:e.slice(o,r)});
50<n-o&&i.push({index:o+(r-o),type:"delete",howMany:n-o});return i}(t,i)}function Sn(t,i,o){for(let e=0;e<Math.max(t.length,i.length);e++)if(void 0===t[e]||void 0===i[e]||!o(t[e],i[e]))return e;return-1}function In(e,t){return e.slice(t).reverse()}function Rn(s,a,l){l=l||function(e,t){return e===t};var e=s.length,t=a.length;if(200<e||200<t||300<e+t)return Rn.fastDiff(s,a,l,!0);let c,d;d=t<e?(e=s,s=a,a=e,c="delete","insert"):(c="insert","delete");const h=s.length,u=a.length;var i=u-h;const g={},m={};function o(e){var t=(void 0!==m[e-1]?m[e-1]:-1)+1,i=void 0!==m[e+1]?m[e+1]:-1,o=i<t?-1:1;g[e+o]&&(g[e]=g[e+o].slice(0)),g[e]||(g[e]=[]),g[e].push(i<t?c:d);let n=Math.max(t,i),r=n-e;for(;r<h&&n<u&&l(s[r],a[n]);)r++,n++,g[e].push("equal");return n}let n=0,r;do{for(r=-n;r<i;r++)m[r]=o(r);for(r=i+n;r>i;r--)m[r]=o(r)}while(m[i]=o(i),n++,m[i]!==u);return g[i].slice(1)}function On(e,t,i){e.insertBefore(i,e.childNodes[t]||null)}function Vn(e){const t=e.parentNode;t&&t.removeChild(e)}function Mn(e){if(e){if(e.defaultView)return e instanceof e.defaultView.Document;if(e.ownerDocument&&e.ownerDocument.defaultView)return e instanceof e.ownerDocument.defaultView.Node}return!1}Rn.fastDiff=Pn;class Nn{constructor(e,t){this.domDocuments=new Set,this.domConverter=e,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=t,this.isFocused=!1,this._inlineFiller=null,this._fakeSelectionContainer=null}markToSync(e,t){if("text"===e)this.domConverter.mapViewToDom(t.parent)&&this.markedTexts.add(t);else if(this.domConverter.mapViewToDom(t))if("attributes"===e)this.markedAttributes.add(t);else{if("children"!==e)throw new Bt.a("view-renderer-unknown-type",this);this.markedChildren.add(t)}}render(){let e;for(const o of this.markedChildren)this._updateChildrenMappings(o);this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?e=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(e=this.selection.getFirstPosition(),this.markedChildren.add(e.parent));for(const n of this.markedAttributes)this._updateAttrs(n);for(const r of this.markedChildren)this._updateChildren(r,{inlineFillerPosition:e});for(const s of this.markedTexts)!this.markedChildren.has(s.parent)&&this.domConverter.mapViewToDom(s.parent)&&this._updateText(s,{inlineFillerPosition:e});var t,i;e?(i=(t=this.domConverter.viewPositionToDom(e)).parent.ownerDocument,Cn(t.parent)?this._inlineFiller=t.parent:this._inlineFiller=zn(i,t.parent,t.offset)):this._inlineFiller=null,this._updateFocus(),this._updateSelection(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){var t=this.domConverter.mapViewToDom(e);if(t){var i=Array.from(this.domConverter.mapViewToDom(e).childNodes),o=Array.from(this.domConverter.viewChildrenToDom(e,t.ownerDocument,{withChildren:!1})),t=this._diffNodeLists(i,o);const s=this._findReplaceActions(t,i,o);if(-1!==s.indexOf("replace")){const a={equal:0,insert:0,delete:0};for(const l of s)if("replace"===l){var n=a.equal+a.insert,r=a.equal+a.delete;const c=e.getChild(n);!c||c.is("uiElement")||c.is("rawElement")||this._updateElementMappings(c,i[r]),Vn(o[n]),a.equal++}else a[l]++}}}_updateElementMappings(e,t){this.domConverter.unbindDomElement(t),this.domConverter.bindElements(t,e),this.markedChildren.add(e),this.markedAttributes.add(e)}_getInlineFillerPosition(){const e=this.selection.getFirstPosition();return e.parent.is("$text")?Ao._createBefore(this.selection.getFirstPosition().parent):e}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;var e=this.selection.getFirstPosition(),e=this.domConverter.viewPositionToDom(e);return!!(e&&kn(e.parent)&&Cn(e.parent))}_removeInlineFiller(){const e=this._inlineFiller;if(!Cn(e))throw new Bt.a("view-renderer-filler-was-lost",this);An(e)?e.parentNode.removeChild(e):e.data=e.data.substr(yn),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;var e=this.selection.getFirstPosition();const t=e.parent;var i=e.offset;if(!this.domConverter.mapViewToDom(t.root))return!1;if(!t.is("element"))return!1;if(!function(e){if("false"==e.getAttribute("contenteditable"))return!1;
5const t=e.findAncestor(e=>e.hasAttribute("contenteditable"));return!t||"true"==t.getAttribute("contenteditable")}(t))return!1;if(i===t.getFillerOffset())return!1;i=e.nodeBefore,e=e.nodeAfter;return!(i instanceof si||e instanceof si)}_updateText(e,t){const i=this.domConverter.findCorrespondingDomText(e);var o=this.domConverter.viewToDom(e,i.ownerDocument),n=i.data;let r=o.data;t=t.inlineFillerPosition;if(t&&t.parent==e.parent&&t.offset==e.index&&(r=xn+r),n!=r)for(const s of Pn(n,r))"insert"===s.type?i.insertData(s.index,s.values.join("")):i.deleteData(s.index,s.howMany)}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(t){var i=Array.from(t.attributes).map(e=>e.name);for(const o of e.getAttributeKeys())t.setAttribute(o,e.getAttribute(o));for(const n of i)e.hasAttribute(n)||t.removeAttribute(n)}}_updateChildren(t,i){var o=this.domConverter.mapViewToDom(t);if(o){var i=i.inlineFillerPosition,n=this.domConverter.mapViewToDom(t).childNodes,r=Array.from(this.domConverter.viewChildrenToDom(t,o.ownerDocument,{bind:!0,inlineFillerPosition:i}));i&&i.parent===t&&zn(o.ownerDocument,r,i.offset);i=this._diffNodeLists(n,r);let e=0;const s=new Set;for(const a of i)"delete"===a?(s.add(n[e]),Vn(n[e])):"equal"===a&&e++;e=0;for(const l of i)"insert"===l?(On(o,e,r[e]),e++):"equal"===l&&(this._markDescendantTextToSync(this.domConverter.domToView(r[e])),e++);for(const c of s)c.parentNode||this.domConverter.unbindDomElement(c)}}_diffNodeLists(e,t){return Rn(e=function(e,t){const i=Array.from(e);if(0==i.length||!t)return i;e=i[i.length-1];e==t&&i.pop();return i}(e,this._fakeSelectionContainer),t,function(e,t,i){{if(t===i)return!0;if(kn(t)&&kn(i))return t.data===i.data;if(e.isBlockFiller(t)&&e.isBlockFiller(i))return!0}return!1}.bind(null,this.domConverter))}_findReplaceActions(e,t,i){if(-1===e.indexOf("insert")||-1===e.indexOf("delete"))return e;let o=[],n=[],r=[];const s={equal:0,insert:0,delete:0};for(const a of e)"insert"===a?r.push(i[s.equal+s.insert]):"delete"===a?n.push(t[s.equal+s.delete]):(o=o.concat(Rn(n,r,Bn).map(e=>"equal"===e?"replace":e)),o.push("equal"),n=[],r=[]),s[a]++;return o.concat(Rn(n,r,Bn).map(e=>"equal"===e?"replace":e))}_markDescendantTextToSync(e){if(e)if(e.is("$text"))this.markedTexts.add(e);else if(e.is("element"))for(const t of e.getChildren())this._markDescendantTextToSync(t)}_updateSelection(){if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();var e=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&e&&(this.selection.isFake?this._updateFakeSelection(e):(this._removeFakeSelection(),this._updateDomSelection(e)))}_updateFakeSelection(e){const t=e.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(e){const t=e.createElement("div");return t.className="ck-fake-selection-container",Object.assign(t.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),t.textContent=" ",t}(t));const i=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(i,this.selection),this._fakeSelectionNeedsUpdate(e)){i.parentElement&&i.parentElement==e||e.appendChild(i),i.textContent=this.selection.fakeSelectionLabel||" ";const o=t.getSelection(),n=t.createRange();o.removeAllRanges(),n.selectNodeContents(i),o.addRange(n)}}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();var i,o;this._domSelectionNeedsUpdate(t)&&(i=this.domConverter.viewPositionToDom(this.selection.anchor),o=this.domConverter.viewPositionToDom(this.selection.focus),t.collapse(i.parent,i.offset),t.extend(o.parent,o.offset),Uo.isGecko&&(e=o,i=t,(o=e.parent).nodeType!=Node.ELEMENT_NODE||e.offset!=o.childNodes.length-1||(e=o.childNodes[e.offset])&&"BR"==e.tagName&&i.addRange(i.getRangeAt(0))))}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;e=e&&this.domConverter.domSelectionToView(e);return(!e||!this.selection.isEqual(e))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(e))}_fakeSelectionNeedsUpdate(e){const t=this._fakeSelectionContainer;var i=e.ownerDocument.getSelection();return!t||t.parentElement!==e||(i.anchorNode!==t&&!t.contains(i.anchorNode)||t.textContent!==this.selection.fakeSelectionLabel)}_removeDomSelection(){for(const i of this.domDocuments){var e,t;i.getSelection().rangeCount&&(e=i.activeElement,t=this.domConverter.mapDomToView(e),e&&t&&i.getSelection().removeAllRanges())}}_removeFakeSelection(){const e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){var e;!this.isFocused||(e=this.selection.editableElement)&&this.domConverter.focus(e)}}function zn(e,t,i){const o=t instanceof Array?t:t.childNodes,n=o[i];if(kn(n))return n.data=xn+n.data,n;e=e.createTextNode(xn);return Array.isArray(t)?o.splice(i,0,e):On(t,i,e),e}function Bn(e,t){return Mn(e)&&Mn(t)&&!kn(e)&&!kn(t)&&e.nodeType!==Node.COMMENT_NODE&&t.nodeType!==Node.COMMENT_NODE&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}Gt(Nn,fo);var Fn={window:window,document:document};function Dn(e){let t=0;for(;e.previousSibling;)e=e.previousSibling,t++;return t}function Ln(e){const t=[];for(;e&&e.nodeType!=Node.DOCUMENT_NODE;)t.unshift(e),e=e.parentNode;return t}const Hn=_n(document),jn=wn(document),Wn=vn(document);class $n{constructor(e,t={}){this.document=e,this.blockFillerMode=t.blockFillerMode||"br",this.preElements=["pre"],this.blockElements=["address","article","aside","blockquote","caption","center","dd","details","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","legend","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"],this.inlineObjectElements=["object","iframe","input","button","textarea","select","option","video","embed","audio","img","canvas"],this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap,this._rawContentElementMatcher=new ci,this._encounteredRawContentDomNodes=new WeakSet}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new So(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}unbindDomElement(e){var t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);for(const i of e.childNodes)this.unbindDomElement(i)}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}viewToDom(t,i,o={}){if(t.is("$text")){var e=this._processDataFromViewText(t);return i.createTextNode(e)}{if(this.mapViewToDom(t))return this.mapViewToDom(t);let e;if(t.is("documentFragment"))e=i.createDocumentFragment(),o.bind&&this.bindDocumentFragments(e,t);else{if(t.is("uiElement"))return e="$comment"===t.name?i.createComment(t.getCustomProperty("$rawContent")):t.render(i),o.bind&&this.bindElements(e,t),e;e=t.hasAttribute("xmlns")?i.createElementNS(t.getAttribute("xmlns"),t.name):i.createElement(t.name),t.is("rawElement")&&t.render(e),o.bind&&this.bindElements(e,t);for(const n of t.getAttributeKeys())e.setAttribute(n,t.getAttribute(n))}if(!1!==o.withChildren)for(const r of this.viewChildrenToDom(t,i,o))e.appendChild(r);return e}}*viewChildrenToDom(e,t,i={}){var o=e.getFillerOffset&&e.getFillerOffset();let n=0;for(const r of e.getChildren())o===n&&(yield this._getBlockFiller(t)),yield this.viewToDom(r,t,i),n++;o===n&&(yield this._getBlockFiller(t))}viewRangeToDom(e){var t=this.viewPositionToDom(e.start),e=this.viewPositionToDom(e.end);const i=document.createRange();return i.setStart(t.parent,t.offset),i.setEnd(e.parent,e.offset),i}viewPositionToDom(o){const n=o.parent;if(n.is("$text")){var t=this.findCorrespondingDomText(n);if(!t)return null;let e=o.offset;return Cn(t)&&(e+=yn),{parent:t,offset:e}}{let e,t,i;if(0===o.offset){if(e=this.mapViewToDom(n),!e)return null;i=e.childNodes[0]}else{const r=o.nodeBefore;if(t=r.is("$text")?this.findCorrespondingDomText(r):this.mapViewToDom(o.nodeBefore),!t)return null;e=t.parentNode,i=t.nextSibling}if(kn(i)&&Cn(i))return{parent:i,offset:yn};o=t?Dn(t)+1:0;return{parent:e,offset:o}}}domToView(e,i={}){if(this.isBlockFiller(e))return null;var t=this.getHostViewElement(e);
5if(t)return t;if(this.isComment(e)&&i.skipComments)return null;if(kn(e)){if(An(e))return null;var o=this._processDataFromDomText(e);return""===o?null:new si(this.document,o)}{if(this.mapDomToView(e))return this.mapDomToView(e);let t;if(this.isDocumentFragment(e))t=new ln(this.document),i.bind&&this.bindDocumentFragments(e,t);else{t=this._createViewElement(e,i),i.bind&&this.bindElements(e,t);var n=e.attributes;if(n)for(let e=n.length-1;0<=e;e--)t._setAttribute(n[e].name,n[e].value);if(this._isViewElementWithRawContent(t,i)||this.isComment(e)){o=this.isComment(e)?e.data:e.innerHTML;return t._setCustomProperty("$rawContent",o),this._encounteredRawContentDomNodes.add(e),t}}if(!1!==i.withChildren)for(const r of this.domChildrenToView(e,i))t._appendChild(r);return t}}*domChildrenToView(t,i={}){for(let e=0;e<t.childNodes.length;e++){var o=t.childNodes[e],o=this.domToView(o,i);null!==o&&(yield o)}}domSelectionToView(t){if(1===t.rangeCount){let e=t.getRangeAt(0).startContainer;kn(e)&&(e=e.parentNode);var i=this.fakeSelectionToView(e);if(i)return i}i=this.isDomSelectionBackward(t);const o=[];for(let e=0;e<t.rangeCount;e++){var n=t.getRangeAt(e),n=this.domRangeToView(n);n&&o.push(n)}return new So(o,{backward:i})}domRangeToView(e){var t=this.domPositionToView(e.startContainer,e.startOffset),e=this.domPositionToView(e.endContainer,e.endOffset);return t&&e?new To(t,e):null}domPositionToView(t,i){if(this.isBlockFiller(t))return this.domPositionToView(t.parentNode,Dn(t));const e=this.mapDomToView(t);if(e&&(e.is("uiElement")||e.is("rawElement")))return Ao._createBefore(e);if(kn(t)){if(An(t))return this.domPositionToView(t.parentNode,Dn(t));var o=this.findCorrespondingViewText(t);let e=i;return o?(Cn(t)&&(e-=yn,e=e<0?0:e),new Ao(o,e)):null}if(0===i){o=this.mapDomToView(t);if(o)return new Ao(o,0)}else{i=t.childNodes[i-1],i=kn(i)?this.findCorrespondingViewText(i):this.mapDomToView(i);if(i&&i.parent)return new Ao(i.parent,i.index+1)}return null}mapDomToView(e){return this.getHostViewElement(e)||this._domToViewMapping.get(e)}findCorrespondingViewText(e){if(An(e))return null;var t=this.getHostViewElement(e);if(t)return t;t=e.previousSibling;if(t){if(!this.isElement(t))return null;t=this.mapDomToView(t);if(t)return t.nextSibling instanceof si?t.nextSibling:null}else{const i=this.mapDomToView(e.parentNode);if(i){e=i.getChild(0);return e instanceof si?e:null}}return null}mapViewToDom(e){return this._viewToDomMapping.get(e)}findCorrespondingDomText(e){var t=e.previousSibling;return t&&this.mapViewToDom(t)?this.mapViewToDom(t).nextSibling:!t&&e.parent&&this.mapViewToDom(e.parent)?this.mapViewToDom(e.parent).childNodes[0]:null}focus(e){const t=this.mapViewToDom(e);if(t&&t.ownerDocument.activeElement!==t){var{scrollX:i,scrollY:e}=Fn.window;const o=[];qn(t,e=>{var{scrollLeft:t,scrollTop:e}=e;o.push([t,e])}),t.focus(),qn(t,e=>{var[t,i]=o.shift();e.scrollLeft=t,e.scrollTop=i}),Fn.window.scrollTo(i,e)}}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isComment(e){return e&&e.nodeType==Node.COMMENT_NODE}isBlockFiller(e){return"br"==this.blockFillerMode?e.isEqualNode(Hn):!("BR"!==e.tagName||!Un(e,this.blockElements)||1!==e.parentNode.childNodes.length)||(e.isEqualNode(Wn)||(t=e,e=this.blockElements,t.isEqualNode(jn)&&Un(t,e)&&1===t.parentNode.childNodes.length));var t}isDomSelectionBackward(e){if(e.isCollapsed)return!1;const t=document.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset);e=t.collapsed;return t.detach(),e}getHostViewElement(e){const t=Ln(e);for(t.pop();t.length;){const e=t.pop(),i=this._domToViewMapping.get(e);if(i&&(i.is("uiElement")||i.is("rawElement")))return i}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}registerRawContentMatcher(e){this._rawContentElementMatcher.add(e)}_getBlockFiller(e){switch(this.blockFillerMode){case"nbsp":return wn(e);case"markedNbsp":return vn(e);case"br":return _n(e)}}_isDomSelectionPositionCorrect(e,t){if(kn(e)&&Cn(e)&&t<yn)return!1;if(this.isElement(e)&&Cn(e.childNodes[t]))return!1;const i=this.mapDomToView(e);return!i||!i.is("uiElement")&&!i.is("rawElement")}_processDataFromViewText(e){let t=e.data;if(e.getAncestors().some(e=>this.preElements.includes(e.name)))return t;if(" "==t.charAt(0)){const i=this._getTouchingInlineViewNode(e,!1);!(i&&i.is("$textProxy")&&this._nodeEndsWithSpace(i))&&i||(t=" "+t.substr(1))}if(" "==t.charAt(t.length-1)){const o=this._getTouchingInlineViewNode(e,!0);e=o&&o.is("$textProxy")&&" "==o.data.charAt(0);" "!=t.charAt(t.length-2)&&o&&!e||(t=t.substr(0,t.length-1)+" ")}return t.replace(/ {2}/g,"  ")}_nodeEndsWithSpace(e){if(e.getAncestors().some(e=>this.preElements.includes(e.name)))return!1;const t=this._processDataFromViewText(e);return" "==t.charAt(t.length-1)}_processDataFromDomText(e){let t=e.data;if(function(e,t){const i=Ln(e);return i.some(e=>e.tagName&&t.includes(e.tagName.toLowerCase()))}(e,this.preElements))return Tn(e);
5t=t.replace(/[ \n\t\r]{1,}/g," ");var i=this._getTouchingInlineDomNode(e,!1);const o=this._getTouchingInlineDomNode(e,!0);var n=this._checkShouldLeftTrimDomText(e,i),r=this._checkShouldRightTrimDomText(e,o);n&&(t=t.replace(/^ /,"")),r&&(t=t.replace(/ $/,"")),t=Tn(new Text(t)),t=t.replace(/ \u00A0/g,"  ");e=o&&this.isElement(o)&&"BR"!=o.tagName,r=o&&kn(o)&&" "==o.data.charAt(0);return(/( |\u00A0)\u00A0$/.test(t)||!o||e||r)&&(t=t.replace(/\u00A0$/," ")),(n||i&&this.isElement(i)&&"BR"!=i.tagName)&&(t=t.replace(/^\u00A0/," ")),t}_checkShouldLeftTrimDomText(e,t){return!t||(this.isElement(t)?"BR"===t.tagName:!this._encounteredRawContentDomNodes.has(e.previousSibling)&&/[^\S\u00A0]/.test(t.data.charAt(t.data.length-1)))}_checkShouldRightTrimDomText(e,t){return!t&&!Cn(e)}_getTouchingInlineViewNode(e,t){for(const i of new Co({startPosition:t?Ao._createAfter(e):Ao._createBefore(e),direction:t?"forward":"backward"})){if(i.item.is("element")&&this.inlineObjectElements.includes(i.item.name))return i.item;if(i.item.is("containerElement"))return null;if(i.item.is("element","br"))return null;if(i.item.is("$textProxy"))return i.item}return null}_getTouchingInlineDomNode(e,t){if(!e.parentNode)return null;var i=t?"firstChild":"lastChild",o=t?"nextSibling":"previousSibling";let n=!0;do{if(!n&&e[i]?e=e[i]:n=e[o]?(e=e[o],!1):(e=e.parentNode,!0),!e||this._isBlockElement(e))return null}while(!kn(e)&&"BR"!=e.tagName&&!this._isInlineObjectElement(e));return e}_isBlockElement(e){return this.isElement(e)&&this.blockElements.includes(e.tagName.toLowerCase())}_isInlineObjectElement(e){return this.isElement(e)&&this.inlineObjectElements.includes(e.tagName.toLowerCase())}_createViewElement(e,t){if(this.isComment(e))return new on(this.document,"$comment");e=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();return new oo(this.document,e)}_isViewElementWithRawContent(e,t){return!1!==t.withChildren&&this._rawContentElementMatcher.match(e)}}function qn(e,t){for(;e&&e!=Fn.document;)t(e),e=e.parentNode}function Un(e,t){const i=e.parentNode;return i&&i.tagName&&t.includes(i.tagName.toLowerCase())}function Kn(e){e=Object.prototype.toString.apply(e);return"[object Window]"==e||"[object global]"==e}var Gn=ao({},Lt,{listenTo(e,...t){if(Mn(e)||Kn(e)){const i=this._getProxyEmitter(e)||new Jn(e);i.attach(...t),e=i}Lt.listenTo.call(this,e,...t)},stopListening(e,t,i){if(Mn(e)||Kn(e)){var o=this._getProxyEmitter(e);if(!o)return;e=o}Lt.stopListening.call(this,e,t,i),e instanceof Jn&&e.detach(t)},_getProxyEmitter(e){return t=this,e=Yn(e),t[Ft]&&t[Ft][e]?t[Ft][e].emitter:null;var t}});class Jn{constructor(e){Ht(this,Yn(e)),this._domNode=e}}function Yn(e){return e["data-ck-expando"]||(e["data-ck-expando"]=Nt())}ao(Jn.prototype,Lt,{attach(e,t,i={}){var o;this._domListeners&&this._domListeners[e]||(o={capture:!!i.useCapture,passive:!!i.usePassive},i=this._createDomListener(e,o),this._domNode.addEventListener(e,i,o),this._domListeners||(this._domListeners={}),this._domListeners[e]=i)},detach(e){var t;!this._domListeners[e]||(t=this._events[e])&&t.callbacks.length||this._domListeners[e].removeListener()},_createDomListener(t,e){const i=e=>{this.fire(t,e)};return i.removeListener=()=>{this._domNode.removeEventListener(t,i,e),delete this._domListeners[t]},i}});class Xn{constructor(e){this.view=e,this.document=e.document,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(e){return!(!(e=e&&3===e.nodeType?e.parentNode:e)||1!==e.nodeType)&&e.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}Gt(Xn,Gn);P=function(e){return this.__data__.has(e)};function Qn(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new ee;++t<i;)this.add(e[t])}Qn.prototype.add=Qn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Qn.prototype.has=P;var Zn=Qn;var er=function(e,t){for(var i=-1,o=null==e?0:e.length;++i<o;)if(t(e[i],i,e))return!0;return!1};var tr=function(e,t){return e.has(t)};var ir=function(e,t,i,o,n,r){var s=1&i,a=e.length,l=t.length;if(a!=l&&!(s&&a<l))return!1;var c=r.get(e),l=r.get(t);if(c&&l)return c==t&&l==e;var d=-1,h=!0,u=2&i?new Zn:void 0;for(r.set(e,t),r.set(t,e);++d<a;){var g,m=e[d],f=t[d];if(void 0!==(g=o?s?o(f,m,d,t,e,r):o(m,f,d,e,t,r):g)){if(g)continue;h=!1;break}if(u){if(!er(t,function(e,t){if(!tr(u,t)&&(m===e||n(m,e,i,o,r)))return u.push(t)})){h=!1;break}}else if(m!==f&&!n(m,f,i,o,r)){h=!1;break}}return r.delete(e),r.delete(t),h};function or(e){var i=-1,o=Array(e.size);return e.forEach(function(e,t){o[++i]=[t,e]}),o}function nr(e){var t=-1,i=Array(e.size);return e.forEach(function(e){i[++t]=e}),i}var b=n?n.prototype:void 0,rr=b?b.valueOf:void 0;var sr=function(e,t,i,o,n,r,s){switch(i){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return e.byteLength==t.byteLength&&r(new at(e),new at(t))?!0:!1;case"[object Boolean]":case"[object Date]":case"[object Number]":return x(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=or;case"[object Set]":a=a||nr;if(e.size!=t.size&&!(1&o))return!1;var l=s.get(e);if(l)return l==t;o|=2,s.set(e,t);a=ir(a(e),a(t),o,n,r,s);return s.delete(e),a;case"[object Symbol]":if(rr)return rr.call(e)==rr.call(t)}return!1},ar=Object.prototype.hasOwnProperty;var lr=function(e,t,i,o,n,r){var s=1&i,a=Ue(e),l=a.length;if(l!=Ue(t).length&&!s)return!1;for(var c=l;c--;){var d=a[c];if(!(s?d in t:ar.call(t,d)))return!1}var h=r.get(e),u=r.get(t);if(h&&u)return h==t&&u==e;var g=!0;r.set(e,t),r.set(t,e);for(var m=s;++c<l;
5){var f,p=e[d=a[c]],b=t[d];if(!(void 0===(f=o?s?o(b,p,d,t,e,r):o(p,b,d,e,t,r):f)?p===b||n(p,b,i,o,r):f)){g=!1;break}m=m||"constructor"==d}return!g||m||(h=e.constructor)!=(u=t.constructor)&&"constructor"in e&&"constructor"in t&&!("function"==typeof h&&h instanceof h&&"function"==typeof u&&u instanceof u)&&(g=!1),r.delete(e),r.delete(t),g},cr="[object Arguments]",dr="[object Array]",hr="[object Object]",ur=Object.prototype.hasOwnProperty;var gr=function(e,t,i,o,n,r){var s=ge(e),a=ge(t),l=s?dr:nt(e),c=a?dr:nt(t),d=(l=l==cr?hr:l)==hr,a=(c=c==cr?hr:c)==hr;if((c=l==c)&&Object(me.a)(e)){if(!Object(me.a)(t))return!1;d=!(s=!0)}if(c&&!d)return r=r||new ie,s||we(e)?ir(e,t,i,o,n,r):sr(e,t,l,i,o,n,r);if(!(1&i)){d=d&&ur.call(e,"__wrapped__"),a=a&&ur.call(t,"__wrapped__");if(d||a)return n(d?e.value():e,a?t.value():t,i,o,r=r||new ie)}return!!c&&(r=r||new ie,lr(e,t,i,o,n,r))};var mr=function e(t,i,o,n,r){return t===i||(null==t||null==i||!p(t)&&!p(i)?t!=t&&i!=i:gr(t,i,o,n,e,r))};var fr=function(e,t,i){var o=(i="function"==typeof i?i:void 0)?i(e,t):void 0;return void 0===o?mr(e,t,void 0,i):!!o};class pr extends Xn{constructor(e){super(e),this._config={childList:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},this.domConverter=e.domConverter,this.renderer=e._renderer,this._domElements=[],this._mutationObserver=new window.MutationObserver(this._onMutations.bind(this))}flush(){this._onMutations(this._mutationObserver.takeRecords())}observe(e){this._domElements.push(e),this.isEnabled&&this._mutationObserver.observe(e,this._config)}enable(){super.enable();for(const e of this._domElements)this._mutationObserver.observe(e,this._config)}disable(){super.disable(),this._mutationObserver.disconnect()}destroy(){super.destroy(),this._mutationObserver.disconnect()}_onMutations(t){if(0!==t.length){const a=this.domConverter,l=new Map,c=new Set;for(const h of t)if("childList"===h.type){const u=a.mapDomToView(h.target);u&&(u.is("uiElement")||u.is("rawElement"))||u&&!this._isBogusBrMutation(h)&&c.add(u)}for(const g of t){const m=a.mapDomToView(g.target);var i;m&&(m.is("uiElement")||m.is("rawElement"))||"characterData"===g.type&&((i=a.findCorrespondingViewText(g.target))&&!c.has(i.parent)?l.set(i,{type:"text",oldText:i.data,newText:Tn(g.target),node:i}):!i&&Cn(g.target)&&c.add(a.mapDomToView(g.target.parentNode)))}const d=[];for(const f of l.values())this.renderer.markToSync("text",f.node),d.push(f);for(const p of c){var o=a.mapViewToDom(p),n=Array.from(p.getChildren()),o=Array.from(a.domChildrenToView(o,{withChildren:!1}));fr(n,o,s)||(this.renderer.markToSync("children",p),d.push({type:"children",oldChildren:n,newChildren:o,node:p}))}var r=t[0].target.ownerDocument.getSelection();let e=null;function s(e,t){if(!Array.isArray(e))return e===t||!(!e.is("$text")||!t.is("$text"))&&e.data===t.data}r&&r.anchorNode&&(t=a.domPositionToView(r.anchorNode,r.anchorOffset),r=a.domPositionToView(r.focusNode,r.focusOffset),t&&r&&(e=new So(t),e.setFocus(r))),d.length&&(this.document.fire("mutations",d,e),this.view.forceRender())}}_isBogusBrMutation(e){let t=null;return null===e.nextSibling&&0===e.removedNodes.length&&1==e.addedNodes.length&&(t=this.domConverter.domToView(e.addedNodes[0],{withChildren:!1})),t&&t.is("element","br")}}class br{constructor(e,t,i){this.view=e,this.document=e.document,this.domEvent=t,this.domTarget=t.target,ao(this,i)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class kr extends Xn{constructor(e){super(e),this.useCapture=!1}observe(t){const e="string"==typeof this.domEventType?[this.domEventType]:this.domEventType;e.forEach(e=>{this.listenTo(t,e,(e,t)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(t.target)&&this.onDomEvent(t)},{useCapture:this.useCapture})})}fire(e,t,i){this.isEnabled&&this.document.fire(e,new br(this.view,t,i))}}class wr extends kr{constructor(e){super(e),this.domEventType=["keydown","keyup"]}onDomEvent(e){this.fire(e.type,e,{keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,metaKey:e.metaKey,get keystroke(){return Xo(this)}})}}var vr=function(){return o.a.Date.now()},_r=/\s/;var yr=function(e){for(var t=e.length;t--&&_r.test(e.charAt(t)););return t},xr=/^\s+/;
5var Cr=function(e){return e&&e.slice(0,yr(e)+1).replace(xr,"")},Ar=/^[-+]0x[0-9a-f]+$/i,Tr=/^0b[01]+$/i,Er=/^0o[0-7]+$/i,Pr=parseInt;var Sr=function(e){if("number"==typeof e)return e;if(ui(e))return NaN;if(V(e)&&(t="function"==typeof e.valueOf?e.valueOf():e,e=V(t)?t+"":t),"string"!=typeof e)return 0===e?e:+e;e=Cr(e);var t=Tr.test(e);return t||Er.test(e)?Pr(e.slice(2),t?2:8):Ar.test(e)?NaN:+e},Ir=Math.max,Rr=Math.min;var Or=function(o,i,e){var n,r,s,a,l,c,d=0,h=!1,u=!1,t=!0;if("function"!=typeof o)throw new TypeError("Expected a function");function g(e){var t=n,i=r;return n=r=void 0,d=e,a=o.apply(i,t)}function m(e){var t=e-c;return void 0===c||i<=t||t<0||u&&s<=e-d}function f(){var e,t=vr();if(m(t))return p(t);l=setTimeout(f,(t=i-((e=t)-c),u?Rr(t,s-(e-d)):t))}function p(e){return l=void 0,t&&n?g(e):(n=r=void 0,a)}function b(){var e=vr(),t=m(e);if(n=arguments,r=this,c=e,t){if(void 0===l)return d=t=c,l=setTimeout(f,i),h?g(t):a;if(u)return clearTimeout(l),l=setTimeout(f,i),g(c)}return void 0===l&&(l=setTimeout(f,i)),a}return i=Sr(i)||0,V(e)&&(h=!!e.leading,u="maxWait"in e,s=u?Ir(Sr(e.maxWait)||0,i):s,t="trailing"in e?!!e.trailing:t),b.cancel=function(){void 0!==l&&clearTimeout(l),n=c=r=l=void(d=0)},b.flush=function(){return void 0===l?a:p(vr())},b};class Vr extends Xn{constructor(e){super(e),this._fireSelectionChangeDoneDebounced=Or(e=>this.document.fire("selectionChangeDone",e),200)}observe(){const i=this.document;i.on("arrowKey",(e,t)=>{i.selection.isFake&&this.isEnabled&&t.preventDefault()},{context:"$capture"}),i.on("arrowKey",(e,t)=>{i.selection.isFake&&this.isEnabled&&this._handleSelectionMove(t.keyCode)},{priority:"lowest"})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection,i=new So(t.getRanges(),{backward:t.isBackward,fake:!1});e!=Jo.arrowleft&&e!=Jo.arrowup||i.setTo(i.getFirstPosition()),e!=Jo.arrowright&&e!=Jo.arrowdown||i.setTo(i.getLastPosition());e={oldSelection:t,newSelection:i,domSelection:null};this.document.fire("selectionChange",e),this._fireSelectionChangeDoneDebounced(e)}}class Mr extends Xn{constructor(e){super(e),this.mutationObserver=e.getObserver(pr),this.selection=this.document.selection,this.domConverter=e.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=Or(e=>this.document.fire("selectionChangeDone",e),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._loopbackCounter=0}observe(e){const i=e.ownerDocument;this._documents.has(i)||(this.listenTo(i,"selectionchange",(e,t)=>{this._handleSelectionChange(t,i)}),this._documents.add(i))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(e,t){var i;this.isEnabled&&(i=t.defaultView.getSelection(),this.checkShouldIgnoreEventFromTarget(i.anchorNode)||(this.mutationObserver.flush(),0!=(t=this.domConverter.domSelectionToView(i)).rangeCount?(this.view.hasDomSelection=!0,this.selection.isEqual(t)&&this.domConverter.isDomSelectionCorrect(i)||60<++this._loopbackCounter||(this.selection.isSimilar(t)?this.view.forceRender():(i={oldSelection:this.selection,newSelection:t,domSelection:i},this.document.fire("selectionChange",i),this._fireSelectionChangeDoneDebounced(i)))):this.view.hasDomSelection=!1))}_clearInfiniteLoop(){this._loopbackCounter=0}}class Nr extends kr{constructor(o){super(o),this.domEventType=["focus","blur"],this.useCapture=!0;const n=this.document;n.on("focus",()=>{n.isFocused=!0,this._renderTimeoutId=setTimeout(()=>o.change(()=>{}),50)}),n.on("blur",(e,t)=>{var i=n.selection.editableElement;null!==i&&i!==t.target||(n.isFocused=!1,o.change(()=>{}))})}onDomEvent(e){this.fire(e.type,e)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class zr extends kr{constructor(e){super(e),this.domEventType=["compositionstart","compositionupdate","compositionend"];const t=this.document;t.on("compositionstart",()=>{t.isComposing=!0}),t.on("compositionend",()=>{t.isComposing=!1})}onDomEvent(e){this.fire(e.type,e)}}class Br extends kr{constructor(e){super(e),this.domEventType=["beforeinput"]}onDomEvent(e){this.fire(e.type,e)}}var Fr=function(e){return"string"==typeof e||!ge(e)&&p(e)&&"[object String]"==g(e)};function Dr(e){return e instanceof HTMLTextAreaElement?e.value:e.innerHTML}function Lr(e){return"[object Range]"==Object.prototype.toString.apply(e)}function Hr(e){e=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(e.borderTopWidth,10),right:parseInt(e.borderRightWidth,10),bottom:parseInt(e.borderBottomWidth,10),left:parseInt(e.borderLeftWidth,10)}}const jr=["top","right","bottom","left","width","height"];
5class Wr{constructor(e){var t,i=Lr(e);Object.defineProperty(this,"_source",{value:e._source||e,writable:!0,enumerable:!1}),Pt(e)||i?i?(t=Wr.getDomRangeRects(e),$r(this,Wr.getBoundingRect(t))):$r(this,e.getBoundingClientRect()):Kn(e)?({innerWidth:i,innerHeight:t}=e,$r(this,{top:0,right:i,bottom:t,left:0,width:i,height:t})):$r(this,e)}clone(){return new Wr(this)}moveTo(e,t){return this.top=t,this.right=e+this.width,this.bottom=t+this.height,this.left=e,this}moveBy(e,t){return this.top+=t,this.right+=e,this.left+=e,this.bottom+=t,this}getIntersection(e){const t={top:Math.max(this.top,e.top),right:Math.min(this.right,e.right),bottom:Math.min(this.bottom,e.bottom),left:Math.max(this.left,e.left)};return t.width=t.right-t.left,t.height=t.bottom-t.top,t.width<0||t.height<0?null:new Wr(t)}getIntersectionArea(e){const t=this.getIntersection(e);return t?t.getArea():0}getArea(){return this.width*this.height}getVisible(){var t=this._source;let i=this.clone();if(!qr(t)){let e=t.parentNode||t.commonAncestorContainer;for(;e&&!qr(e);){var o=new Wr(e);const n=i.getIntersection(o);if(!n)return null;n.getArea()<i.getArea()&&(i=n),e=e.parentNode}}return i}isEqual(e){for(const t of jr)if(this[t]!==e[t])return!1;return!0}contains(e){const t=this.getIntersection(e);return!(!t||!t.isEqual(e))}excludeScrollbarsAndBorders(){const e=this._source;let t,i,o;var n;return Kn(e)?(t=e.innerWidth-e.document.documentElement.clientWidth,i=e.innerHeight-e.document.documentElement.clientHeight,o=e.getComputedStyle(e.document.documentElement).direction):(n=Hr(this._source),t=e.offsetWidth-e.clientWidth-n.left-n.r
5ight,i=e.offsetHeight-e.clientHeight-n.top-n.bottom,o=e.ownerDocument.defaultView.getComputedStyle(e).direction,this.left+=n.left,this.top+=n.top,this.right-=n.right,this.bottom-=n.bottom,this.width=this.right-this.left,this.height=this.bottom-this.top),this.width-=t,"ltr"===o?this.right-=t:this.left+=t,this.height-=i,this.bottom-=i,this}static getDomRangeRects(t){const i=[];var e=Array.from(t.getClientRects());if(e.length)for(const o of e)i.push(new Wr(o));else{let e=t.startContainer;kn(e)&&(e=e.parentNode);const n=new Wr(e.getBoundingClientRect());n.right=n.left,n.width=0,i.push(n)}return i}static getBoundingRect(e){const t={left:Number.POSITIVE_INFINITY,top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY};let i=0;for(const o of e)i++,t.left=Math.min(t.left,o.left),t.top=Math.min(t.top,o.top),t.right=Math.max(t.right,o.right),t.bottom=Math.max(t.bottom,o.bottom);return 0==i?null:(t.width=t.right-t.left,t.height=t.bottom-t.top,new Wr(t))}}function $r(e,t){for(const i of jr)e[i]=t[i]}function qr(e){return Pt(e)&&e===e.ownerDocument.body}class Ur{constructor(e,t){Ur._observerInstance||Ur._createObserver(),this._element=e,this._callback=t,Ur._addElementCallback(e,t),Ur._observerInstance.observe(e)}destroy(){Ur._deleteElementCallback(this._element,this._callback)}static _addElementCallback(e,t){Ur._elementCallbacks||(Ur._elementCallbacks=new Map);let i=Ur._elementCallbacks.get(e);i||(i=new Set,Ur._elementCallbacks.set(e,i)),i.add(t)}static _deleteElementCallback(e,t){const i=Ur._getElementCallbacks(e);i&&(i.delete(t),i.size||(Ur._elementCallbacks.delete(e),Ur._observerInstance.unobserve(e))),Ur._elementCallbacks&&!Ur._elementCallbacks.size&&(Ur._observerInstance=null,Ur._elementCallbacks=null)}static _getElementCallbacks(e){return Ur._elementCallbacks?Ur._elementCallbacks.get(e):null}static _createObserver(){let e;e="function"==typeof Fn.window.ResizeObserver?Fn.window.ResizeObserver:Kr,Ur._observerInstance=new e(e=>{for(const i of e){var t=Ur._getElementCallbacks(i.target);if(t)for(const o of t)o(i)}})}}Ur._observerInstance=null,Ur._elementCallbacks=null;class Kr{constructor(e){this._callback=e,this._elements=new Set,this._previousRects=new Map,this._periodicCheckTimeout=null}observe(e){this._elements.add(e),this._checkElementRectsAndExecuteCallback(),1===this._elements.size&&this._startPeriodicCheck()}unobserve(e){this._elements.delete(e),this._previousRects.delete(e),this._elements.size||this._stopPeriodicCheck()}_startPeriodicCheck(){const e=()=>{this._checkElementRectsAndExecuteCallback(),this._periodicCheckTimeout=setTimeout(e,100)};this.listenTo(Fn.window,"resize",()=>{this._checkElementRectsAndExecuteCallback()}),this._periodicCheckTimeout=setTimeout(e,100)}_stopPeriodicCheck(){clearTimeout(this._periodicCheckTimeout),this.stopListening(),this._previousRects.clear()}_checkElementRectsAndExecuteCallback(){const e=[];for(const t of this._elements)this._hasRectChanged(t)&&e.push({target:t,contentRect:this._previousRects.get(t)});e.length&&this._callback(e)}_hasRectChanged(e){if(!e.ownerDocument.body.contains(e))return!1;var t=new Wr(e);const i=this._previousRects.get(e);var o=!i||!i.isEqual(t);return this._previousRects.set(e,t),o}}function Gr(e,t){e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=t}function Jr(t){return e=>e+t}function Yr(e){e=e.next();return e.done?null:e.value}Gt(Kr,Gn);class Xr{constructor(){this.set("isFocused",!1),this.set("focusedElement",null),this._elements=new Set,this._nextEventLoopTimeout=null}add(e){if(this._elements.has(e))throw new Bt.a("focustracker-add-element-already-exist",this);this.listenTo(e,"focus",()=>this._focus(e),{useCapture:!0}),this.listenTo(e,"blur",()=>this._blur(),{useCapture:!0}),this._elements.add(e)}remove(e){e===this.focusedElement&&this._blur(e),this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e))}destroy(){this.stopListening()}_focus(e){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=e,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}Gt(Xr,Gn),Gt(Xr,fo);class Qr{constructor(){this._listener=Object.create(Gn)}listenTo(e){this._listener.listenTo(e,"keydown",(e,t)=>{this._listener.fire("_keydown:"+Xo(t),t)})}set(e,i,t={}){e=Qo(e),t=t.priority;this._listener.listenTo(this._listener,"_keydown:"+e,(e,t)=>{i(t,()=>{t.preventDefault(),t.stopPropagation(),e.stop()}),e.return=!0},{priority:t})}press(e){return!!this._listener.fire("_keydown:"+Xo(e),e)}destroy(){this._listener.stopListening()}}class Zr extends Xn{constructor(e){super(e),this.document.on("key
5down",(e,t)=>{var i;!this.isEnabled||(i=t.keyCode)!=Jo.arrowright&&i!=Jo.arrowleft&&i!=Jo.arrowup&&i!=Jo.arrowdown||(i=new Ro(this.document,"arrowKey",this.document.selection.getFirstRange()),this.document.fire(i,t),i.stop.called&&e.stop())})}observe(){}}function es({target:t,viewportOffset:i=0}){var o=ss(t);let n=o,r=null;for(;n;){let e;e=n==o?as(t):as(r),ts(e,()=>cs(t,n));var s=cs(t,n);if(!function(i,o,n){const r=o.clone().moveBy(0,n),s=o.clone().moveBy(0,-n),a=new Wr(i).excludeScrollbarsAndBorders(),e=[s,r];if(!e.every(e=>a.contains(e))){let{scrollX:e,scrollY:t}=i;os(s,a)?t-=a.top-o.top+n:is(r,a)&&(t+=o.bottom-a.bottom+n),ns(o,a)?e-=a.left-o.left+n:rs(o,a)&&(e+=o.right-a.right+n),i.scrollTo(e,t)}}(n,s,i),n.parent!=n){if(r=n.frameElement,n=n.parent,!r)return}else n=null}}function ts(e,t){var i=ss(e);let o,n;for(;e!=i.document.body;)n=t(),o=new Wr(e).excludeScrollbarsAndBorders(),o.contains(n)||(os(n,o)?e.scrollTop-=o.top-n.top:is(n,o)&&(e.scrollTop+=n.bottom-o.bottom),ns(n,o)?e.scrollLeft-=o.left-n.left:rs(n,o)&&(e.scrollLeft+=n.right-o.right)),e=e.parentNode}function is(e,t){return e.bottom>t.bottom}function os(e,t){return e.top<t.top}function ns(e,t){return e.left<t.left}function rs(e,t){return e.right>t.right}function ss(e){return(Lr(e)?e.startContainer:e).ownerDocument.defaultView}function as(t){if(Lr(t)){let e=t.commonAncestorContainer;return kn(e)&&(e=e.parentNode),e}return t.parentNode}function cs(e,t){var i=ss(e);const o=new Wr(e);if(i===t)return o;{let e=i;for(;e!=t;){var n=e.frameElement,n=new Wr(n).excludeScrollbarsAndBorders();o.moveBy(n.left,n.top),e=e.parent}}return o}Object.assign({},{scrollViewportToShowTarget:es,scrollAncestorsToShowTarget:function(e){ts(as(e),()=>new Wr(e))}});class ds{constructor(e){this.document=new Bo(e),this.domConverter=new $n(this.document),this.domRoots=new Map,this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new Nn(this.domConverter,this.document.selection),this._renderer.bind("isFocused").to(this.document),this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this._writer=new cn(this.document),this.addObserver(pr),this.addObserver(Mr),this.addObserver(Nr),this.addObserver(wr),this.addObserver(Vr),this.addObserver(zr),this.addObserver(Zr),Uo.isAndroid&&this.addObserver(Br),this.document.on("arrowKey",En,{priority:"low"}),nn(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0}),this.listenTo(this.document,"change:isFocused",()=>{this._hasChangedSinceTheLastRendering=!0})}attachDomRoot(e,t="main"){const i=this.document.getRoot(t);i._name=e.tagName.toLowerCase();const o={};for(const{name:t,value:r}of Array.from(e.attributes))o[t]=r,"class"===t?this._writer.addClass(r.split(" "),i):this._writer.setAttribute(t,r,i);this._initialDomRootAttributes.set(e,o);const n=()=>{this._writer.setAttribute("contenteditable",!i.isReadOnly,i),i.isReadOnly?this._writer.addClass("ck-read-only",i):this._writer.removeClass("ck-read-only",i)};n(),this.domRoots.set(t,e),this.domConverter.bindElements(e,i),this._renderer.markToSync("children",i),this._renderer.markToSync("attributes",i),this._renderer.domDocuments.add(e.ownerDocument),i.on("change:children",(e,t)=>this._renderer.markToSync("children",t)),i.on("change:attributes",(e,t)=>this._renderer.markToSync("attributes",t)),i.on("change:text",(e,t)=>this._renderer.markToSync("text",t)),i.on("change:isReadOnly",()=>this.change(n)),i.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const s of this._observers.values())s.observe(e,t)}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach(({name:e})=>t.removeAttribute(e));var i=this._initialDomRootAttributes.get(t);for(const o in i)t.setAttribute(o,i[o]);this.domRoots.delete(e),this.domConverter.unbindDomElement(t)}getDomRoot(e="main"){return this.domRoots.get(e)}addObserver(e){let t=this._observers.get(e);if(t)return t;t=new e(this),this._observers.set(e,t);for(var[i,o]of this.domRoots)t.observe(o,i);return t.enable(),t}getObserver(e){return this._observers.get(e)}disableObservers(){for(const e of this._observers.values())e.disable()}enableObservers(){for(const e of this._observers.values())e.enable()}scrollToTheSelection(){var e=this.document.selection.getFirstRange();e&&es({target:this.domConverter.viewRangeToDom(e),viewportOffset:20})}focus(){var e;this.document.isFocused||(e=this.document.selection.editableElement)&&(this.domConverter.focus(e),this.forceRender())}change(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new Bt.a("cannot-change-view-tree",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;var t=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),t}catch(e){Bt.a.rethrowUnexpectedError(e,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.change(()=>{})}destroy(){for(const e of this._observers.values())e.destroy();this.document.destroy(),this.stopListening()}createPositionAt(e,t){return Ao._createAt(e,t)}createPositionAfter(e){return Ao._createAfter(e)}createPositionBefore(e){return Ao._createBefore(e)}createRange(e,t){return new To(e,t)}createRangeOn(e){return To._createOn(e)}createRangeIn(e){return To._createIn(e)}createSelection(e,t,i){return new So(e,t,i)}_disableRendering(e){0==(this._renderingDisabled=e)&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}Gt(ds,fo);class hs{constructor(e){this.parent=null,this._attrs=li(e)}get index(){var e;if(!this.parent)return null;if(null===(e=this.parent.getChildIndex(this)))throw new Bt.a("model-node-not-found-in-parent",this);return e}get startOffset(){var e;if(!this.parent)return null;if(null===(e=this.parent.getChildStartOffset(this)))throw new Bt.a("model-node-not-found-in-parent",this);return e}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){var e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){var e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}getCommonAncestor(e,t={}){var i=this.getAncestors(t),o=e.getAncestors(t);let n=0;for(;i[n]==o[n]&&i[n];)n++;return 0===n?null:i[n-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;var t=this.getPath(),i=e.getPath(),o=oi(t,i);switch(o){case"prefix":return!0;case"extension":return!1;default:return t[o]<i[o]}}isAfter(e){return this!=e&&(this.root===e.root&&!this.isBefore(e))}hasAttribute(e){return this._attrs.has(e)}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}toJSON(){const e={};return this._attrs.size&&(e.attributes=Array.from(this._attrs).reduce((e,t)=>
5(e[t[0]]=t[1],e),{})),e}is(e){return"node"===e||"model:node"===e}_clone(){return new hs(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=li(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}class us extends hs{constructor(e,t){super(t),this._data=e||""}get offsetSize(){return this.data.length}get data(){return this._data}is(e){return"$text"===e||"model:$text"===e||"text"===e||"model:text"===e||"node"===e||"model:node"===e}toJSON(){const e=super.toJSON();return e.data=this.data,e}_clone(){return new us(this.data,this.getAttributes())}static fromJSON(e){return new us(e.data,e.attributes)}}class gs{constructor(e,t,i){if(this.textNode=e,t<0||t>e.offsetSize)throw new Bt.a("model-textproxy-wrong-offsetintext",this);if(i<0||t+i>e.offsetSize)throw new Bt.a("model-textproxy-wrong-length",this);this.data=e.data.substring(t,t+i),this.offsetInText=t}get startOffset(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}is(e){return"$textProxy"===e||"model:$textProxy"===e||"textProxy"===e||"model:textProxy"===e}getPath(){const e=this.textNode.getPath();return 0<e.length&&(e[e.length-1]+=this.offsetInText),e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}hasAttribute(e){return this.textNode.hasAttribute(e)}getAttribute(e){return this.textNode.getAttribute(e)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}class ms{constructor(e){this._nodes=[],e&&this._insertNodes(0,e)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((e,t)=>e+t.offsetSize,0)}getNode(e){return this._nodes[e]||null}getNodeIndex(e){e=this._nodes.indexOf(e);return-1==e?null:e}getNodeStartOffset(e){e=this.getNodeIndex(e);return null===e?null:this._nodes.slice(0,e).reduce((e,t)=>e+t.offsetSize,0)}indexToOffset(e){if(e==this._nodes.length)return this.maxOffset;e=this._nodes[e];if(!e)throw new Bt.a("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(e)}offsetToIndex(e){let t=0;for(const i of this._nodes){if(e>=t&&e<t+i.offsetSize)return this.getNodeIndex(i);t+=i.offsetSize}if(t!=e)throw new Bt.a("model-nodelist-offset-out-of-bounds",this,{offset:e,nodeList:this});return this.length}
5_insertNodes(e,t){for(const i of t)if(!(i instanceof hs))throw new Bt.a("model-nodelist-insertnodes-not-node",this);this._nodes.splice(e,0,...t)}_removeNodes(e,t=1){return this._nodes.splice(e,t)}toJSON(){return this._nodes.map(e=>e.toJSON())}}class fs extends hs{constructor(e,t,i){super(t),this.name=e,this._children=new ms,i&&this._insertChild(0,i)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}is(e,t=null){return t?t===this.name&&("element"===e||"model:element"===e):"element"===e||"model:element"===e||"node"===e||"model:node"===e}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}offsetToIndex(e){return this._children.offsetToIndex(e)}getNodeByPath(e){let t=this;for(const i of e)t=t.getChild(t.offsetToIndex(i));return t}findAncestor(e,t={includeSelf:!1}){let i=t.includeSelf?this:this.parent;for(;i;){if(i.name===e)return i;i=i.parent}return null}toJSON(){const e=super.toJSON();if(e.name=this.name,0<this._children.length){e.children=[];for(const t of this._children)e.children.push(t.toJSON())}return e}_clone(e=!1){e=e?Array.from(this._children).map(e=>e._clone(!0)):null;return new fs(this.name,this.getAttributes(),e)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){t=function(e){if("string"==typeof e)return[new us(e)];Kt(e)||(e=[e]);return Array.from(e).map(e=>"string"==typeof e?new us(e):e instanceof gs?new us(e.data,e.getAttributes()):e)}(t);for(const i of t)null!==i.parent&&i._remove(),i.parent=this;this._children._insertNodes(e,t)}_removeChildren(e,t=1){t=this._children._removeNodes(e,t);for(const i of t)i.parent=null;return t}static fromJSON(e){let t=null;if(e.children){t=[];for(const i of e.children)i.name?t.push(fs.fromJSON(i)):t.push(us.fromJSON(i))}return new fs(e.name,e.attributes,t)}}class ps{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new Bt.a("model-tree-walker-no-start-position",null);var t=e.direction||"forward";if("forward"!=t&&"backward"!=t)throw new Bt.a("model-tree-walker-unknown-direction",e,{direction:t});this.direction=t,this.boundaries=e.boundaries||null,e.startPosition?this.position=e.startPosition.clone():this.position=ks._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}skip(e){let t,i,o,n;for(;o=this.position,n=this._visitedParent,{done:t,value:i}=this.next(),!t&&e(i););t||(this.position=o,this._visitedParent=n)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){var e=this.position;const i=this.position.clone();var o=this._visitedParent;if(null===o.parent&&i.offset===o.maxOffset)return{done:!0};if(o===this._boundaryEndParent&&i.offset==this.boundaries.end.offset)return{done:!0};var n=i.parent,r=ws(i,n),n=r||vs(i,n,r);if(n instanceof fs)return this.shallow?i.offset++:(i.path.push(0),this._visitedParent=n),this.position=i,bs("elementStart",n,e,i,1);if(n instanceof us){let t;if(this.singleCharacters)t=1;else{let e=n.endOffset;this._boundaryEndParent==o&&this.boundaries.end.offset<e&&(e=this.boundaries.end.offset),t=e-i.offset}r=i.offset-n.startOffset,r=new gs(n,r,t);return i.offset+=t,this.position=i,bs("text",r,e,i,t)}return i.path.pop(),i.offset++,this.position=i,this._visitedParent=o.parent,this.ignoreElementEnd?this._next():bs("elementEnd",o,e,i)}_previous(){var e=this.position;const i=this.position.clone();var o=this._visitedParent;if(null===o.parent&&0===i.offset)return{done:!0};if(o==this._boundaryStartParent&&i.offset==this.boundaries.start.offset)return{done:!0};var n=i.parent,r=ws(i,n),n=r||_s(i,n,r);if(n instanceof fs)return i.offset--,this.shallow?(this.position=i,bs("elementStart",n,e,i,1)):(i.path.push(n.maxOffset),this.position=i,this._visitedParent=n,this.ignoreElementEnd?this._previous():bs("elementEnd",n,e,i));if(n instanceof us){let t;if(this.singleCharacters)t=1;else{let e=n.startOffset;this._boundaryStartParent==o&&this.boundaries.start.offset>e&&(e=this.boundaries.start.offset),t=i.offset-e}r=i.offset-n.startOffset,r=new gs(n,r-t,t);return i.offset-=t,this.position=i,bs("text",r,e,i,t)}return i.path.pop(),this.position=i,this._visitedParent=o.parent,bs("elementStart",o,e,i,1)}}function bs(e,t,i,o,n){return{done:!1,value:{type:e,item:t,previousPosition:i,nextPosition:o,length:n}}}class ks{constructor(e,t,i="toNone"){if(!e.is("element")&&!e.is("documentFragment"))throw new Bt.a("model-position-root-invalid",e);if(!(t instanceof Array)||0===t.length)throw new Bt.a("model-position-path-incorrect-format",e,{path:t});e.is("rootElement")?t=t.slice():(t=[...e.getPath(),...t],e=e.root),this.root=e,this.path=t,this.stickiness=i}get offset(){return this.path[this.path.length-1]}set offset(e){this.path[this.path.length-1]=e}get parent(){let t=this.root;for(let e=0;e<this.path.length-1;e++)if(t=t.getChild(t.offsetToIndex(this.path[e])),!t)throw new Bt.a("model-position-path-incorrect",this,{position:this});if(t.is("$text"))throw new Bt.a("model-position-path-incorrect",this,{position:this});return t}get index(){return this.parent.offsetToIndex(this.offset)}get textNode(){return ws(this,this.parent)}get nodeAfter(){var e=this.parent;return vs(this,e,ws(this,e))}get nodeBefore(){var e=this.parent;return _s(this,e,ws(this,e))}get isAtStart(){return 0===this.offset}get isAtEnd(){return this.offset==this.parent.maxOffset}compareWith(e){if(this.root!=e.root)return"different";var t=oi(this.path,e.path);switch(t){case"same":return"same";case"prefix":return"before";case"extension":return"after";default:return this.path[t]<e.path[t]?"before":"after"}}
5getLastMatchingPosition(e,t={}){t.startPosition=this;const i=new ps(t);return i.skip(e),i.position}getParentPath(){return this.path.slice(0,-1)}getAncestors(){const e=this.parent;return e.is("documentFragment")?[e]:e.getAncestors({includeSelf:!0})}findAncestor(e){const t=this.parent;return t.is("element")?t.findAncestor(e,{includeSelf:!0}):null}getCommonPath(e){if(this.root!=e.root)return[];var t=oi(this.path,e.path),t="string"==typeof t?Math.min(this.path.length,e.path.length):t;return this.path.slice(0,t)}getCommonAncestor(e){var t=this.getAncestors(),i=e.getAncestors();let o=0;for(;t[o]==i[o]&&t[o];)o++;return 0===o?null:t[o-1]}getShiftedBy(e){const t=this.clone();e=t.offset+e;return t.offset=e<0?0:e,t}isAfter(e){return"after"==this.compareWith(e)}isBefore(e){return"before"==this.compareWith(e)}isEqual(e){return"same"==this.compareWith(e)}isTouching(e){let t=null,i=null;switch(this.compareWith(e)){case"same":return!0;case"before":t=ks._createAt(this),i=ks._createAt(e);break;case"after":t=ks._createAt(e),i=ks._createAt(this);break;default:return!1}let o=t.parent;for(;t.path.length+i.path.length;){if(t.isEqual(i))return!0;if(t.path.length>i.path.length){if(t.offset!==o.maxOffset)return!1;t.path=t.path.slice(0,-1),o=o.parent,t.offset++}else{if(0!==i.offset)return!1;i.path=i.path.slice(0,-1)}}}is(e){return"position"===e||"model:position"===e}hasSameParentAs(e){return this.root===e.root&&"same"==oi(this.getParentPath(),e.getParentPath())}getTransformedByOperation(e){let t;switch(e.type){case"insert":t=this._getTransformedByInsertOperation(e);break;case"move":case"remove":case"reinsert":t=this._getTransformedByMoveOperation(e);break;case"split":t=this._getTransformedBySplitOperation(e);break;case"merge":t=this._getTransformedByMergeOperation(e);break;default:t=ks._createAt(this)}return t}_getTransformedByInsertOperation(e){return this._getTransformedByInsertion(e.position,e.howMany)}_getTransformedByMoveOperation(e){return this._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}_getTransformedBySplitOperation(e){const t=e.movedRange;return t.containsPosition(this)||t.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(e.splitPosition,e.moveTargetPosition):e.graveyardPosition?this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1):this._getTransformedByInsertion(e.insertionPosition,1)}_getTransformedByMergeOperation(e){const t=e.movedRange;let i;return t.containsPosition(this)||t.start.isEqual(this)?(i=this._getCombined(e.sourcePosition,e.targetPosition),e.sourcePosition.isBefore(e.targetPosition)&&(i=i._getTransformedByDeletion(e.deletionPosition,1))):i=this.isEqual(e.deletionPosition)?ks._createAt(e.deletionPosition):this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1),i}_getTransformedByDeletion(e,t){const i=ks._createAt(this);if(this.root!=e.root)return i;if("same"==oi(e.getParentPath(),this.getParentPath())){if(e.offset<this.offset){if(e.offset+t>this.offset)return null;i.offset-=t}}else if("prefix"==oi(e.getParentPath(),this.getParentPath())){var o=e.path.length-1;if(e.offset<=this.path[o]){if(e.offset+t>this.path[o])return null;i.path[o]-=t}}return i}_getTransformedByInsertion(e,t){const i=ks._createAt(this);return this.root!=e.root||("same"==oi(e.getParentPath(),this.getParentPath())?(e.offset<this.offset||e.offset==this.offset&&"toPrevious"!=this.stickiness)&&(i.offset+=t):"prefix"==oi(e.getParentPath(),this.getParentPath())&&(o=e.path.length-1,e.offset<=this.path[o]&&(i.path[o]+=t))),i;var o}_getTransformedByMove(e,t,i){if(t=t._getTransformedByDeletion(e,i),e.isEqual(t))return ks._createAt(this);const o=this._getTransformedByDeletion(e,i);return null===o||e.isEqual(this)&&"toNext"==this.stickiness||e.getShiftedBy(i).isEqual(this)&&"toPrevious"==this.stickiness?this._getCombined(e,t):o._getTransformedByInsertion(t,i)}_getCombined(e,t){var i=e.path.length-1;const o=ks._createAt(t);return o.stickiness=this.stickiness,o.offset=o.offset+this.path[i]-e.offset,o.path=[...o.path,...this.path.slice(1+i)],o}toJSON(){return{root:this.root.toJSON(),path:Array.from(this.path),stickiness:this.stickiness}}clone(){return new this.constructor(this.root,this.path,this.stickiness)}static _createAt(e,t,i="toNone"){if(e instanceof ks)return new ks(e.root,e.path,e.stickiness);{const o=e;if("end"==t)t=o.maxOffset;else{if("before"==t)return this._createBefore(o,i);if("after"==t)return this._createAfter(o,i);if(0!==t&&!t)throw new Bt.a("model-createpositionat-offset-required",[this,e])}if(!o.is("element")&&!o.is("documentFragment"))throw new Bt.a("model-position-parent-incorrect",[this,e]);const n=o.getPath();return n.push(t),new this(o.root,n,i)}}static _createAfter(e,t){if(!e.parent)throw new Bt.a("model-position-after-root",[this,e],{root:e});return this._createAt(e.parent,e.endOffset,t)}static _createBefore(e,t){if(!e.parent)throw new Bt.a("model-position-before-root",e,{root:e});return this._createAt(e.parent,e.startOffset,t)}static fromJSON(e,t){if("$graveyard"===e.root){const i=new ks(t.graveyard,e.path);return i.stickiness=e.stickiness,i}if(!t.getRoot(e.root))throw new Bt.a("model-position-fromjson-no-root",t,{rootName:e.root});return new ks(t.getRoot(e.root),e.path,e.stickiness)}}function ws(e,t){const i=t.getChild(t.offsetToIndex(e.offset));return i&&i.is("$text")&&i.startOffset<e.offset?i:null}function vs(e,t,i){return null!==i?null:t.getChild(t.offsetToIndex(e.offset))}function _s(e,t,i){return null!==i?null:t.getChild(t.offsetToIndex(e.offset)-1)}class ys{constructor(e,t=null){this.start=ks._createAt(e),this.end=t?ks._createAt(t):ks._createAt(e),this.start.stickiness=this.isCollapsed?"toNone":"toNext",this.end.stickiness=this.isCollapsed?"toNone":"toPrevious"}*[Symbol.iterator](){yield*new ps({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return"same"==oi(this.start.getParentPath(),this.end.getParentPath())}get root(){return this.start.root}containsPosition(e){return e.isAfter(this.start)&&e.isBefore(this.end)}containsRange(e,t=!1){e.isCollapsed&&(t=!1);var i=this.containsPosition(e.start)||t&&this.start.isEqual(e.start),e=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return i&&e}containsItem(e){e=ks._createBefore(e);return this.containsPosition(e)||this.start.isEqual(e)}is(e){return"range"===e||"model:range"===e}isEqual(e){return this.start.isEqual(e.start)&&this.end.isEqual(e.end)}isIntersecting(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}getDifference(e){const t=[];return this.isIntersecting(e)?(this.containsPosition(e.start)&&t.push(new ys(this.start,e.start)),this.containsPosition(e.end)&&t.pu
5sh(new ys(e.end,this.end))):t.push(new ys(this.start,this.end)),t}getIntersection(i){if(this.isIntersecting(i)){let e=this.start,t=this.end;return this.containsPosition(i.start)&&(e=i.start),this.containsPosition(i.end)&&(t=i.end),new ys(e,t)}return null}getJoined(e,t=!1){let i=this.isIntersecting(e);if(i=i||(this.start.isBefore(e.start)?t?this.end.isTouching(e.start):this.end.isEqual(e.start):t?e.end.isTouching(this.start):e.end.isEqual(this.start)),!i)return null;let o=this.start,n=this.end;return e.start.isBefore(o)&&(o=e.start),e.end.isAfter(n)&&(n=e.end),new ys(o,n)}getMinimalFlatRanges(){const e=[];var t=this.start.getCommonPath(this.end).length;const i=ks._createAt(this.start);let o=i.parent;for(;i.path.length>t+1;){var n=o.maxOffset-i.offset;0!=n&&e.push(new ys(i,i.getShiftedBy(n))),i.path=i.path.slice(0,-1),i.offset++,o=o.parent}for(;i.path.length<=this.end.path.length;){var r=this.end.path[i.path.length-1],s=r-i.offset;0!=s&&e.push(new ys(i,i.getShiftedBy(s))),i.offset=r,i.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new ps(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;for(const t of new ps(e))yield t.item}*getPositions(e={}){e.boundaries=this;e=new ps(e);yield e.position;for(const t of e)yield t.nextPosition}getTransformedByOperation(e){switch(e.type){case"insert":return this._getTransformedByInsertOperation(e);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(e);case"split":return[this._getTransformedBySplitOperation(e)];case"merge":return[this._getTransformedByMergeOperation(e)]}return[new ys(this.start,this.end)]}getTransformedByOperations(e){const i=[new ys(this.start,this.end)];for(const o of e)for(let e=0;e<i.length;e++){var t=i[e].getTransformedByOperation(o);i.splice(e,1,...t),e+=t.length-1}for(let t=0;t<i.length;t++){const n=i[t];for(let e=t+1;e<i.length;e++){const r=i[e];(n.containsRange(r)||r.containsRange(n)||n.isEqual(r))&&i.splice(e,1)}}return i}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}getContainedElement(){if(this.isCollapsed)return null;const e=this.start.nodeAfter;var t=this.end.nodeBefore;return e&&e.is("element")&&e===t?e:null}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}clone(){return new this.constructor(this.start,this.end)}_getTransformedByInsertOperation(e,t=!1){return this._getTransformedByInsertion(e.position,e.howMany,t)}_getTransformedByMoveOperation(e,t=!1){var i=e.sourcePosition,o=e.howMany,e=e.targetPosition;return this._getTransformedByMove(i,e,o,t)}_getTransformedBySplitOperation(e){var t=this.start._getTransformedBySplitOperation(e);let i=this.end._getTransformedBySplitOperation(e);return this.end.isEqual(e.insertionPosition)&&(i=this.end.getShiftedBy(1)),t.root!=i.root&&(i=this.end.getShiftedBy(-1)),new ys(t,i)}_getTransformedByMergeOperation(e){if(this.start.isEqual(e.targetPosition)&&this.end.isEqual(e.deletionPosition))return new ys(this.start);let t=this.start._getTransformedByMergeOperation(e),i=this.end._getTransformedByMergeOperation(e);return t.root!=i.root&&(i=this.end.getShiftedBy(-1)),t.isAfter(i)&&(e.sourcePosition.isBefore(e.targetPosition)?(t=ks._createAt(i),t.offset=0):(e.deletionPosition.isEqual(t)||(i=e.deletionPosition),t=e.targetPosition)),new ys(t,i)}_getTransformedByInsertion(e,t,i=!1){if(i&&this.containsPosition(e))return[new ys(this.start,e),new ys(e.getShiftedBy(t),this.end._getTransformedByInsertion(e,t))];{const o=new ys(this.start,this.end);return o.start=o.start._getTransformedByInsertion(e,t),o.end=o.end._getTransformedByInsertion(e,t),[o]}}_getTransformedByMove(e,t,i,o=!1){if(this.isCollapsed){var n=this.start._getTransformedByMove(e,t,i);return[new ys(n)]}const r=ys._createFromPositionAndShift(e,i);var s=t._getTransformedByDeletion(e,i);if(this.containsPosition(t)&&!o&&(r.containsPosition(this.start)||r.containsPosition(this.end))){n=this.start._getTransformedByMove(e,t,i),t=this.end._getTransformedByMove(e,t,i);return[new ys(n,t)]}let a;const l=this.getDifference(r);let c=null;const d=this.getIntersection(r);return 1==l.length?c=new ys(l[0].start._getTransformedByDeletion(e,i),l[0].end._getTransformedByDeletion(e,i)):2==l.length&&(c=new ys(this.start,this.end._getTransformedByDeletion(e,i))),a=c?c._getTransformedByInsertion(s,i,null!==d||o):[],d&&(s=new ys(d.start._getCombined(r.start,s),d.end._getCombined(r.start,s)),2==a.length?a.splice(1,0,s):a.push(s)),a}_getTransformedByDeletion(e,t){let i=this.start._getTransformedByDeletion(e,t),o=this.end._getTransformedByDeletion(e,t);return null==i&&null==o?null:(null==i&&(i=e),null==o&&(o=e),new ys(i,o))}static _createFromPositionAndShift(e,t){var i=e,e=e.getShiftedBy(t);return 0<t?new this(i,e):new this(e,i)}static _createIn(e){return new this(ks._createAt(e,0),ks._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(ks._createBefore(e),e.offsetSize)}static _createFromRanges(t){if(0===t.length)throw new Bt.a("range-create-from-ranges-empty-array",null);if(1==t.length)return t[0].clone();var e=t[0];t.sort((e,t)=>
5e.start.isAfter(t.start)?1:-1);var i=t.indexOf(e);const o=new this(e.start,e.end);if(0<i)for(let e=i-1;;e++){1;{if(!t[e].end.isEqual(o.start))break;o.start=ks._createAt(t[e].start)}}for(let e=i+1;e<t.length&&t[e].start.isEqual(o.end);e++)o.end=ks._createAt(t[e].end);return o}static fromJSON(e,t){return new this(ks.fromJSON(e.start,t),ks.fromJSON(e.end,t))}}class xs{constructor(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._viewToModelLengthCallbacks=new Map,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this.on("modelToViewPosition",(e,t)=>{var i;t.viewPosition||(i=this._modelToViewMapping.get(t.modelPosition.parent),t.viewPosition=this.findPositionIn(i,t.modelPosition.offset))},{priority:"low"}),this.on("viewToModelPosition",(e,t)=>{var i,o;t.modelPosition||(o=this.findMappedViewAncestor(t.viewPosition),i=this._viewToModelMapping.get(o),o=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,o),t.modelPosition=ks._createAt(i,o))},{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t),this._viewToModelMapping.set(t,e)}unbindViewElement(e){var t=this.toModelElement(e);if(this._viewToModelMapping.delete(e),this._elementToMarkerNames.has(e))for(const i of this._elementToMarkerNames.get(e))this._unboundMarkerNames.add(i);this._modelToViewMapping.get(t)==e&&this._modelToViewMapping.delete(t)}unbindModelElement(e){var t=this.toViewElement(e);this._modelToViewMapping.delete(e),this._viewToModelMapping.get(t)==e&&this._viewToModelMapping.delete(t)}bindElementToMarker(e,t){const i=this._markerNameToElements.get(t)||new Set;i.add(e);const o=this._elementToMarkerNames.get(e)||new Set;o.add(t),this._markerNameToElements.set(t,i),this._elementToMarkerNames.set(e,o)}unbindElementFromMarkerName(e,t){const i=this._markerNameToElements.get(t);i&&(i.delete(e),0==i.size&&this._markerNameToElements.delete(t));const o=this._elementToMarkerNames.get(e);o&&(o.delete(t),0==o.size&&this._elementToMarkerNames.delete(e))}flushUnboundMarkerNames(){var e=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),e}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new ys(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new To(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){e={viewPosition:e,mapper:this};return this.fire("viewToModelPosition",e),e.modelPosition}toViewPosition(e,t={isPhantom:!1}){t={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",t),t.viewPosition}markerNameToElements(e){e=this._markerNameToElements.get(e);if(!e)return null;const t=new Set;for(const i of e)if(i.is("attributeElement"))for(const o of i.getElementsWithSameId())t.add(o);else t.add(i);return t}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;for(;!this._viewToModelMapping.has(t);)t=t.parent;return t}_toModelOffset(t,i,e){if(e!=t)return this._toModelOffset(t.parent,t.index,e)+this._toModelOffset(t,i,t);if(t.is("$text"))return i;let o=0;for(let e=0;e<i;e++)o+=this.getModelLength(t.getChild(e));return o}getModelLength(t){if(this._viewToModelLengthCallbacks.get(t.name)){const e=this._viewToModelLengthCallbacks.get(t.name);return e(t)}if(this._viewToModelMapping.has(t))return 1;if(t.is("$text"))return t.data.length;if(t.is("uiElement"))return 0;{let e=0;for(const i of t.getChildren())e+=this.getModelLength(i);return e}}findPositionIn(e,t){let i,o=0,n=0,r=0;if(e.is("$text"))return new Ao(e,t);for(;n<t;)i=e.getChild(r),o=this.getModelLength(i),n+=o,r++;return n==t?this._moveViewPositionToTextNode(new Ao(e,r)):this.findPositionIn(i,t-(n-o))}_moveViewPositionToTextNode(e){var t=e.nodeBefore,i=e.nodeAfter;return t instanceof si?new Ao(t,t.data.length):i instanceof si?new Ao(i,0):e}}Gt(xs,Lt);class Cs{constructor(){this._consumable=new Map,this._textProxyRegistry=new Map}
5add(e,t){t=As(t),e instanceof gs&&(e=this._getSymbolForTextProxy(e)),this._consumable.has(e)||this._consumable.set(e,new Map),this._consumable.get(e).set(t,!0)}consume(e,t){return t=As(t),e instanceof gs&&(e=this._getSymbolForTextProxy(e)),!!this.test(e,t)&&(this._consumable.get(e).set(t,!1),!0)}test(e,t){t=As(t),e instanceof gs&&(e=this._getSymbolForTextProxy(e));const i=this._consumable.get(e);if(void 0===i)return null;t=i.get(t);return void 0===t?null:t}revert(e,t){t=As(t),e instanceof gs&&(e=this._getSymbolForTextProxy(e));var i=this.test(e,t);return!1===i?(this._consumable.get(e).set(t,!0),!0):!0!==i&&null}_getSymbolForTextProxy(e){let t=null;const i=this._textProxyRegistry.get(e.startOffset);if(i){const o=i.get(e.endOffset);o&&(t=o.get(e.parent))}return t=t||this._addSymbolForTextProxy(e.startOffset,e.endOffset,e.parent),t}_addSymbolForTextProxy(e,t,i){var o=Symbol("textProxySymbol");let n,r;return n=this._textProxyRegistry.get(e),n||(n=new Map,this._textProxyRegistry.set(e,n)),r=n.get(t),r||(r=new Map,n.set(t,r)),r.set(i,o),o}}function As(e){var t=e.split(":");return"addMarker"==t[0]||"removeMarker"==t[0]?e:1<t.length?t[0]+":"+t[1]:t[0]}class Ts{constructor(e){this.conversionApi=Object.assign({dispatcher:this},e),this._reconversionEventsMapping=new Map}convertChanges(e,t,i){for(const n of e.getMarkersToRemove())this.convertMarkerRemove(n.name,n.range,i);for(const r of this._mapChangesWithAutomaticReconversion(e))"insert"===r.type?this.convertInsert(ys._createFromPositionAndShift(r.position,r.length),i):"remove"===r.type?this.convertRemove(r.position,r.length,r.name,i):"reconvert"===r.type?this.reconvertElement(r.element,i):this.convertAttribute(r.range,r.attributeKey,r.attributeOldValue,r.attributeNewValue,i);for(const s of this.conversionApi.mapper.flushUnboundMarkerNames()){var o=t.get(s).getRange();this.convertMarkerRemove(s,o,i),this.convertMarkerAdd(s,o,i)}for(const a of e.getMarkersToAdd())this.convertMarkerAdd(a.name,a.range,i)}convertInsert(e,t){this.conversionApi.writer=t,this.conversionApi.consumable=this._createInsertConsumable(e);for(const i of Array.from(e).map(Es))this._convertInsertWithAttributes(i);this._clearConversionApi()}convertRemove(e,t,i,o){this.conversionApi.writer=o,this.fire("remove:"+i,{position:e,length:t},this.conversionApi),this._clearConversionApi()}convertAttribute(e,t,i,o,n){this.conversionApi.writer=n,this.conversionApi.consumable=this._createConsumableForRange(e,`attribute:${t}`);for(const a of e){var r=a.item,s=ys._createFromPositionAndShift(a.previousPosition,a.length);this._testAndFire(`attribute:${t}`,{item:r,range:s,attributeKey:t,attributeOldValue:i,attributeNewValue:o})}this._clearConversionApi()}reconvertElement(e,t){var i=ys._createOn(e);this.conversionApi.writer=t,this.conversionApi.consumable=this._createInsertConsumable(i);const o=this.conversionApi.mapper;var n=o.toViewElement(e);t.remove(n),this._convertInsertWithAttributes({item:e,range:i});var r=o.toViewElement(e);for(const l of ys._createIn(e)){var s=l["item"],a=function(e,t){if(e.is("textProxy")){const i=t.toViewPosition(ks._createBefore(e)).parent;return i.is("$text")?i:null}return t.toViewElement(e)}(s,o);a?a.root!==r.root&&t.move(t.createRangeOn(a),o.toViewPosition(ks._createBefore(s))):this._convertInsertWithAttributes(Es(l))}o.unbindViewElement(n),this._clearConversionApi()}convertSelection(e,t,i){t=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));if(this.conversionApi.writer=i,this.conversionApi.consumable=this._createSelectionConsumable(e,t),this.fire("selection",{selection:e},this.conversionApi),e.isCollapsed){for(const r of t){var o=r.getRange();!function(e,t,i){const o=t.getRange(),n=Array.from(e.getAncestors());n.shift(),n.reverse();e=n.some(e=>{if(o.containsItem(e)){const t=i.toViewElement(e);return!!t.getCustomProperty("addHighlight")}});return!e}(e.getFirstPosition(),r,this.conversionApi.mapper)||(o={item:e,markerName:r.name,markerRange:o},this.conversionApi.consumable.test(e,"addMarker:"+r.name)&&this.fire("addMarker:"+r.name,o,this.conversionApi))}for(const s of e.getAttributeKeys()){var n={item:e,range:e.getFirstRange(),attributeKey:s,attributeOldValue:null,attributeNewValue:e.getAttribute(s)};this.conversionApi.consumable.test(e,"attribute:"+n.attributeKey)&&this.fire("attribute:"+n.attributeKey+":$text",n,this.conversionApi)}this._clearConversionApi()}else this._clearConversionApi()}convertMarkerAdd(e,t,i){if("$graveyard"!=t.root.rootName){this.conversionApi.writer=i;var o,n="addMarker:"+e;const r=new Cs;if(r.add(t,n),this.conversionApi.consumable=r,this.fire(n,{markerName:e,markerRange:t},this.conversionApi),r.test(t,n)){this.conversionApi.consumable=this._createConsumableForRange(t,n);for(const s of t.getItems())this.conversionApi.consumable.test(s,n)&&(o={item:s,range:ys._createOn(s),markerName:e,markerRange:t},this.fire(n,o,this.conversionApi));this._clearConversionApi()}else this._clearConversionApi()}}convertMarkerRemove(e,t,i){"$graveyard"!=t.root.rootName&&(this.conversionApi.writer=i,this.fire("removeMarker:"+e,{markerName:e,markerRange:t},this.conversionApi),this._clearConversionApi())}_mapReconversionTriggerEvent(e,t){this._reconversionEventsMapping.set(t,e)}_createInsertConsumable(e){const t=new Cs;for(const i of e){const o=i.item;t.add(o,"insert");for(const n of o.getAttributeKeys())t.add(o,"attribute:"+n)}return t}_createConsumableForRange(e,t){const i=new Cs;for(const o of e.getItems())i.add(o,t);return i}_createSelectionConsumable(e,t){const i=new Cs;i.add(e,"selection");for(const o of t)i.add(e,"addMarker:"+o.name);for(const n of e.getAttributeKeys())i.add(e,"attribute:"+n);return i}_testAndFire(e,t){this.conversionApi.consumable.test(t.item,e)&&this.fire(function(e,t){t=t.item.name||"$text";return`${e}:${t}`}(e,t),t,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer,delete this.conversionApi.consumable}_convertInsertWithAttributes(e){this._testAndFire("insert",e);for(const t of e.item.getAttributeKeys())e.attributeKey=t,e.attributeOldValue=null,e.attributeNewValue=e.item.getAttribute(t),this._testAndFire(`attribute:${t}`,e)}_mapChangesWithAutomaticReconversion(e){const t=new Set,i=[];for(const r of e.getChanges()){var o=r.position||r.range.start,n=o.parent;if(ws(o,n))i.push(r);else{const s="attribute"===r.type?vs(o,n,null):n;if(s.is("$text"))i.push(r);else{let e;e="attribute"===r.type?`attribute:${r.attributeKey}:${s.name}`:`${r.type}:${r.name}`,this._isReconvertTriggerEvent(e,s.name)?t.has(s)||(t.add(s),i.push({type:"reconvert",element:s})):i.push(r)}}}return i}_isReconvertTriggerEvent(e,t){return this._reconversionEventsMapping.get(e)===t}}function Es(e){return{item:e.item,range:ys._createFromPositionAndShift(e.previousPosition,e.length)}}Gt(Ts,Lt);class Ps{constructor(e,t,i){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map,e&&this.setTo(e,t,i)}get anchor(){if(0<this._ranges.length){var e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}
5get focus(){if(0<this._ranges.length){var e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}get isCollapsed(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(t){if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const i of this._ranges){let e=!1;for(const o of t._ranges)if(i.isEqual(o)){e=!0;break}if(!e)return!1}return!0}*getRanges(){for(const e of this._ranges)yield new ys(e.start,e.end)}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?new ys(e.start,e.end):null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?new ys(e.start,e.end):null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}setTo(t,i,o){if(null===t)this._setRanges([]);else if(t instanceof Ps)this._setRanges(t.getRanges(),t.isBackward);else if(t&&"function"==typeof t.getRanges)this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof ys)this._setRanges([t],!!i&&!!i.backward);else if(t instanceof ks)this._setRanges([new ys(t)]);else if(t instanceof hs){o=!!o&&!!o.backward;let e;if("in"==i)e=ys._createIn(t);else if("on"==i)e=ys._createOn(t);else{if(void 0===i)throw new Bt.a("model-selection-setto-required-second-parameter",[this,t]);e=new ys(ks._createAt(t,i))}this._setRanges([e],o)}else{if(!Kt(t))throw new Bt.a("model-selection-setto-not-selectable",[this,t]);this._setRanges(t,i&&!!i.backward)}}_setRanges(e,t=!1){var i=(e=Array.from(e)).some(t=>{if(!(t instanceof ys))throw new Bt.a("model-selection-set-ranges-not-range",[this,e]);return this._ranges.every(e=>!e.isEqual(t))});if(e.length!==this._ranges.length||i){this._removeAllRanges();for(const o of e)this._pushRange(o);this._lastRangeBackward=!!t,this.fire("change:range",{directChange:!0})}}setFocus(e,t){if(null===this.anchor)throw new Bt.a("model-selection-setfocus-no-ranges",[this,e]);const i=ks._createAt(e,t);"same"!=i.compareWith(this.focus)&&(t=this.anchor,this._ranges.length&&this._popRange(),"before"==i.compareWith(t)?(this._pushRange(new ys(i,t)),this._lastRangeBackward=!0):(this._pushRange(new ys(t,i)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0}))}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(e){return this._attrs.has(e)}removeAttribute(e){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}setAttribute(e,t){this.getAttribute(e)!==t&&(this._attrs.set(e,t),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}is(e){return"selection"===e||"model:selection"===e}*getSelectedBlocks(){var e,t,i=new WeakSet;for(const r of this.getRanges()){var o=Is(r.start,i);o&&Rs(o,r)&&(yield o);for(const s of r.getWalker()){var n=s.item;"elementEnd"==s.type&&(e=n,t=r,Ss(e,i)&&Rs(e,t))&&(yield n)}o=Is(r.end,i);o&&!r.end.isTouching(ks._createAt(o,0))&&Rs(o,r)&&(yield o)}}containsEntireContent(e=this.anchor.root){const t=ks._createAt(e,0),i=ks._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&i.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e),this._ranges.push(new ys(e.start,e.end))}_checkRange(t){for(let e=0;e<this._ranges.length;e++)if(t.isIntersecting(this._ranges[e]))throw new Bt.a("model-selection-range-intersects",[this,t],{addedRange:t,intersectingRange:this._ranges[e]})}_removeAllRanges(){for(;0<this._ranges.length;)this._popRange()}_popRange(){this._ranges.pop()}}function Ss(e,t){return!t.has(e)&&(t.add(e),e.root.document.model.schema.isBlock(e)&&e.parent)}function Is(e,t){const i=e.parent.root.document.model.schema,o=e.parent.getAncestors({parentFirst:!0,includeSelf:!0});let n=!1;e=o.find(e=>!n&&(n=i.isLimit(e),!n&&Ss(e,t)));
5return o.forEach(e=>t.add(e)),e}function Rs(e,t){e=function(e){const t=e.root.document.model.schema;let i=e.parent;for(;i;){if(t.isBlock(i))return i;i=i.parent}}(e);return!e||!t.containsRange(ys._createOn(e),!0)}Gt(Ps,Lt);class Os extends ys{constructor(e,t){super(e,t),function(){this.listenTo(this.root.document.model,"applyOperation",(e,t)=>{t=t[0];t.isDocumentOperation&&!function(e){const t=this.getTransformedByOperation(e),i=ys._createFromRanges(t),o=!i.isEqual(this),n=function(e,t){switch(t.type){case"insert":return e.containsPosition(t.position);case"move":case"remove":case"reinsert":case"merge":return e.containsPosition(t.sourcePosition)||e.start.isEqual(t.sourcePosition)||e.containsPosition(t.targetPosition);case"split":return e.containsPosition(t.splitPosition)||e.containsPosition(t.insertionPosition)}return!1}(this,e);let r=null;o?("$graveyard"==i.root.rootName&&(r="remove"==e.type?e.sourcePosition:e.deletionPosition),e=this.toRange(),this.start=i.start,this.end=i.end,this.fire("change:range",e,{deletionPosition:r})):n&&this.fire("change:content",this.toRange(),{deletionPosition:r})}.call(this,t)},{priority:"low"})}.call(this)}detach(){this.stopListening()}is(e){return"liveRange"===e||"model:liveRange"===e||"range"==e||"model:range"===e}toRange(){return new ys(this.start,this.end)}static fromRange(e){return new Os(e.start,e.end)}}Gt(Os,Lt);const Vs="selection:";class Ms{constructor(e){this._selection=new Ns(e),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(e){return this._selection.containsEntireContent(e)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(e){return this._selection.getAttribute(e)}hasAttribute(e){return this._selection.hasAttribute(e)}refresh(){this._selection._updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(e){this._selection.observeMarkers(e)}is(e){return"selection"===e||"model:selection"==e||"documentSelection"==e||"model:documentSelection"==e}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(e,t,i){this._selection.setTo(e,t,i)}_setAttribute(e,t){this._selection.setAttribute(e,t)}_removeAttribute(e){this._selection.removeAttribute(e)}_getStoredAttributes(){return this._selection._getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(e){this._selection.restoreGravity(e)}static _getStoreAttributeKey(e){return Vs+e}static _isStoreAttributeKey(e){return e.startsWith(Vs)}}Gt(Ms,Lt);class Ns extends Ps{constructor(e){super(),this.markers=new Jt({idProperty:"name"}),this._model=e.model,this._document=e,this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this._observedMarkers=new Set,this.listenTo(this._model,"applyOperation",(e,t)=>{t=t[0];t.isDocumentOperation&&"marker"!=t.type&&"rename"!=t.type&&"noop"!=t.type&&(0==this._ranges.length&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))},{priority:"lowest"}),this.on("change:range",()=>{for(const e of this.getRanges())if(!this._document._validateSelectionRange(e))throw new Bt.a("document-selection-wrong-position",this,{range:e})}),this.listenTo(this._model.markers,"update",(e,t,i,o)=>{this._updateMarker(t,o)}),this.listenTo(this._document,"change",(e,t)=>{!function(e,t){const i=e.document.differ;for(const o of i.getChanges())if("insert"==o.type){const n=o.position.parent;o.length===n.maxOffset&&e.enqueueChange(t,e=>{for(const t of Array.from(n.getAttributeKeys()).filter(e=>e.startsWith(Vs)))e.removeAttribute(t,n)})}}(this._model,t)})}get isCollapsed(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length||1}get hasOwnRange(){return 0<this._ranges.length}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let e=0;e<this._ranges.length;e++)this._ranges[e].detach();this.stopListening()}*getRanges(){this._ranges.length?yield*super.getRanges():yield this._document._getDefaultRange()}getFirstRange(){return super.getFirstRange()||this._document._getDefaultRange()}getLastRange(){return super.getLastRange()||this._document._getDefaultRange()}setTo(e,t,i){super.setTo(e,t,i),this._updateAttributes(!0),this._updateMarkers()}setFocus(e,t){super.setFocus(e,t),this._updateAttributes(!0),this._updateMarkers()}setAttribute(e,t){this._setAttribute(e,t)&&this.fire("change:attribute",{attributeKeys:[e],directChange:!0})}removeAttribute(e){this._removeAttribute(e)&&this.fire("change:attribute",{attributeKeys:[e],directChange:!0})}overrideGravity(){var e=Nt();return this._overriddenGravityRegister.add(e),1===this._overriddenGravityRegister.size&&this._updateAttributes(!0),e}restoreGravity(e){if(!this._overriddenGravityRegister.has(e))throw new Bt.a("document-selection-gravity-wrong-restore",this,{uid:e});this._overriddenGravityRegister.delete(e),this.isGravityOverridden||this._updateAttributes(!0)}observeMarkers(e){this._observedMarkers.add(e),this._updateMarkers()}_popRange(){this._ranges.pop().detach()}_pushRange(e){e=this._prepareRange(e);e&&this._ranges.push(e)}_prepareRange(e){if(this._checkRange(e),e.root!=this._document.graveyard){const o=Os.fromRange(e);return o.on("change:range",(e,t,i)=>{this._hasChangedRange=!0,o.root==this._document.graveyard&&(this._selectionRestorePosition=i.deletionPosition,i=this._ranges.indexOf(o),this._ranges.splice(i,1),o.detach())}),o}}_updateMarkers(){if(this._observedMarkers.size){const o=[];let e=!1;for(const n of this._model.markers){var t=n.name.split(":",1)[0];if(this._observedMarkers.has(t)){const r=n.getRange();for(const s of this.getRanges())r.containsRange(s,!s.isCollapsed)&&o.push(n)}}var i=Array.from(this.markers);for(const a of o)this.markers.has(a)||(this.markers.add(a),e=!0);for(const l of Array.from(this.markers))o.includes(l)||(this.markers.remove(l),e=!0);e&&this.fire("change:marker",{oldMarkers:i,directChange:!1})}}_updateMarker(i,o){var n=i.name.split(":",1)[0];if(this._observedMarkers.has(n)){let t=!1;var e=Array.from(this.markers),n=this.markers.has(i);if(o){let e=!1;for(const r of this.getRanges())if(o.containsRange(r,!r.isCollapsed)){e=!0;break}e&&!n?(this.markers.add(i),t=!0):!e&&n&&(this.markers.remove(i),t=!0)}else n&&(this.markers.remove(i),t=!0);t&&this.fire("change:marker",{oldMarkers:e,directChange:!1})}}_updateAttributes(e){var t,i,o,n=li(this._getSurroundingAttributes());const r=li(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(var[s,a]of this._attributePriority)"low"==a&&(this._attrs.delete(s),this._attributePriority.delete(s));this._setAttributesTo(n);const l=[];for([t,i]of this.getAttributes())r.has(t)&&r.get(t)===i||l.push(t);for([o]of r)this.hasAttribute(o)||l.push(o);0<l.length&&this.fire("change:attribute",{attributeKeys:l,directChange:!1})}
5_setAttribute(e,t,i=!0){i=i?"normal":"low";return("low"!=i||"normal"!=this._attributePriority.get(e))&&(super.getAttribute(e)!==t&&(this._attrs.set(e,t),this._attributePriority.set(e,i),!0))}_removeAttribute(e,t=!0){t=t?"normal":"low";return("low"!=t||"normal"!=this._attributePriority.get(e))&&(this._attributePriority.set(e,t),!!super.hasAttribute(e)&&(this._attrs.delete(e),!0))}_setAttributesTo(e){const t=new Set;for(var[i,o]of this.getAttributes())e.get(i)!==o&&this._removeAttribute(i,!1);for(var[n,r]of e)this._setAttribute(n,r,!1)&&t.add(n);return t}*_getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(const t of e.getAttributeKeys())t.startsWith(Vs)&&(yield[t.substr(Vs.length),e.getAttribute(t)])}_getSurroundingAttributes(){var t=this.getFirstPosition();const i=this._model.schema;let o=null;if(this.isCollapsed){var n=t.textNode||t.nodeBefore,t=t.textNode||t.nodeAfter;if(this.isGravityOverridden||(o=zs(n)),o=o||zs(t),!this.isGravityOverridden&&!o){let e=n;for(;e&&!i.isInline(e)&&!o;)e=e.previousSibling,o=zs(e)}if(!o){let e=t;for(;e&&!i.isInline(e)&&!o;)e=e.nextSibling,o=zs(e)}o=o||this._getStoredAttributes()}else for(const e of this.getFirstRange()){if(e.item.is("element")&&i.isObject(e.item))break;if("text"==e.type){o=e.item.getAttributes();break}}return o}_fixGraveyardSelection(e){e=this._model.schema.getNearestSelectionRange(e);e&&this._pushRange(e)}}function zs(e){return e instanceof gs||e instanceof us?e.getAttributes():null}class Bs{constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers)e(t);return this}}var Fs=function(e){return Tt(e,5)};class Ds extends Bs{elementToElement(e){return this.add(((o=Fs(o=e)).view=Ws(o.view,"container"),e=>{var r;if(e.on("insert:"+o.model,(r=o.view,(e,t,i)=>{var o,n=r(t.item,i);n&&i.consumable.consume(t.item,"insert")&&(o=i.mapper.toViewPosition(t.range.start),i.mapper.bindElements(t.item,n),i.writer.insert(o,n))}),{priority:o.converterPriority||"normal"}),o.triggerBy){if(o.triggerBy.attributes)for(const t of o.triggerBy.attributes)e._mapReconversionTriggerEvent(o.model,`attribute:${t}:${o.model}`);if(o.triggerBy.children)for(const i of o.triggerBy.children)e._mapReconversionTriggerEvent(o.model,`insert:${i}`),e._mapReconversionTriggerEvent(o.model,`remove:${i}`)}}));var o}attributeToElement(e){return this.add(function(t){var e=(t=Fs(t)).model.key?t.model.key:t.model;let i="attribute:"+e;t.model.name&&(i+=":"+t.model.name);if(t.model.values)for(const n of t.model.values)t.view[n]=Ws(t.view[n],"attribute");else t.view=Ws(t.view,"attribute");const o=$s(t);return e=>{var a;e.on(i,(a=o,(e,t,i)=>{var o=a(t.attributeOldValue,i),n=a(t.attributeNewValue,i);if((o||n)&&i.consumable.consume(t.item,e.name)){const r=i.writer,s=r.document.selection;if(t.item instanceof Ps||t.item instanceof Ms)r.wrap(s.getFirstRange(),n);else{let e=i.mapper.toViewRange(t.range);null!==t.attributeOldValue&&o&&(e=r.unwrap(e,o)),null!==t.attributeNewValue&&n&&r.wrap(e,n)}}}),{priority:t.converterPriority||"normal"})}}(e))}attributeToAttribute(e){return this.add(function(t){var e=(t=Fs(t)).model.key?t.model.key:t.model;let i="attribute:"+e;t.model.name&&(i+=":"+t.model.name);if(t.model.values)for(const n of t.model.values)t.view[n]=qs(t.view[n]);else t.view=qs(t.view);const o=$s(t);return e=>{var h;e.on(i,(h=o,(e,t,i)=>{var o=h(t.attributeOldValue,i),n=h(t.attributeNewValue,i);if((o||n)&&i.consumable.consume(t.item,e.name)){var r=i.mapper.toViewElement(t.item);const s=i.writer;if(!r)throw new Bt.a("conversion-attribute-to-attribute-on-text",[t,i]);if(null!==t.attributeOldValue&&o)if("class"==o.key)for(const a of Xt(o.value))s.removeClass(a,r);else if("style"==o.key)for(const l of Object.keys(o.value))s.removeStyle(l,r);else s.removeAttribute(o.key,r);if(null!==t.attributeNewValue&&n)if("class"==n.key)for(const c of Xt(n.value))s.addClass(c,r);else if("style"==n.key)for(const d of Object.keys(n.value))s.setStyle(d,n.value[d],r);else s.setAttribute(n.key,n.value,r)}}),{priority:t.converterPriority||"normal"})}}(e))}markerToElement(e){return this.add(((t=Fs(t=e)).view=Ws(t.view,"ui"),e=>{var c;e.on("addMarker:"+t.model,(c=t.view,(e,t,i)=>{t.isOpening=!0;var o=c(t,i);t.isOpening=!1;var n=c(t,i);if(o&&n){var r=t.markerRange;if(!r.isCollapsed||i.consumable.consume(r,e.name)){for(const l of r)if(!i.consumable.consume(l.item,e.name))return;const s=i.mapper,a=i.writer;a.insert(s.toViewPosition(r.start),o),i.mapper.bindElementToMarker(o,t.markerName),r.isCollapsed||(a.insert(s.toViewPosition(r.end),n),i.mapper.bindElementToMarker(n,t.markerName)),e.stop()}}}),{priority:t.converterPriority||"normal"}),e.on("removeMarker:"+t.model,(t.view,(e,t,i)=>{var o=i.mapper.markerNameToElements(t.markerName);if(o){for(const n of o)i.mapper.unbindElementFromMarkerName(n,t.markerName),i.writer.clear(i.writer.createRangeOn(n),n);i.writer.clearClonedElementsGroup(t.markerName),e.stop()}}),{priority:t.converterPriority||"normal"})}));var t}markerToHighlight(e){return this.add((t=e,e=>{var c,s,a;e.on("addMarker:"+t.model,(c=t.view,(e,t,i)=>{if(t.item&&(t.item instanceof Ps||t.item instanceof Ms||t.item.is("$textProxy"))){var o=Us(c,t,i);if(o&&i.consumable.consume(t.item,e.name)){const r=i.writer;var n=Hs(r,o);const s=r.document.selection;if(t.item instanceof Ps||t.item instanceof Ms)r.wrap(s.getFirstRange(),n,s);else{o=i.mapper.toViewRange(t.range);const a=r.wrap(o,n);for(const l of a.getItems())if(l.is("attributeElement")&&l.isSimilar(n)){i.mapper.bindElementToMarker(l,t.markerName);break}}}}}),{priority:t.converterPriority||"normal"}),e.on("addMarker:"+t.model,(s=t.view,(e,t,i)=>{if(t.item&&t.item instanceof fs){var o=Us(s,t,i);if(o&&i.consumable.test(t.item,e.name)){const n=i.mapper.toViewElement(t.item);if(n&&n.getCustomProperty("addHighlight")){i.consumable.consume(t.item,e.name);for(const r of ys._createIn(t.item))i.consumable.consume(r.item,e.name);n.getCustomProperty("addHighlight")(n,o,i.writer),i.mapper.bindElementToMarker(n,t.markerName)}}}}),{priority:t.converterPriority||"normal"}),e.on("removeMarker:"+t.model,(a=t.view,(e,t,i)=>{if(!t.markerRange.isCollapsed){var o=Us(a,t,i);if(o){var n=Hs(i.writer,o),r=i.mapper.markerNameToElements(t.markerName);if(r){for(const s of r)i.mapper.unbindElementFromMarkerName(s,t.markerName),s.is("attributeElement")?i.writer.unwrap(i.writer.createRangeOn(s),n):s.getCustomProperty("removeHighlight")(s,o.id,i.writer);i.writer.clearClonedElementsGroup(t.markerName),e.stop()}}}}),{priority:t.converterPriority||"normal"})}));var t}markerToData(e){return this.add(function(t){const i=(t=Fs(t)).model;t.view||(t.view=e=>({group:i,name:e.substr(t.model.length+1)}));return e=>{var r,a;e.on("addMarker:"+i,(r=t.view,(e,t,i)=>{var o,n=r(t.markerName,i);n&&(o=t.markerRange,i.consumable.consume(o,e.name)&&(js(o,!1,i,t,n),js(o,!0,i,t,n),e.stop()))}),{priority:t.converterPriority||"normal"}),e.on("removeMarker:"+i,(a=t.view,(e,t,o)=>{const n=a(t.markerName,o);if(n){var i=o.mapper.markerNameToElements(t.markerName);if(i){for(const s of i)o.mapper.unbindElementFromMarkerName(s,t.markerName),s.is("containerElement")?(r(`data-${n.group}-start-before`,s),r(`data-${n.group}-start-after`,s),r(`data-${n.group}-end-before`,s),r(`data-${n.group}-end-after`,s)):o.writer.clear(o.writer.createRangeOn(s),s);o.writer.clearClonedElementsGroup(t.markerName),e.stop()}}function r(e,t){if(t.hasAttribute(e)){const i=new Set(t.getAttribute(e).split(","));i.delete(n.name),0==i.size?o.writer.removeAttribute(e,t):o.writer.setAttribute(e,Array.from(i).join(","),t)}}}),{priority:t.converterPriority||"normal"})}}(e))}}function Ls(){return(e,t,i)=>{if(i.consumable.consume(t.item,"insert")){const o=i.writer;i=i.mapper.toViewPosition(t.range.start),t=o.createText(t.item.data);o.insert(i,t)}}}function Hs(e,t){const i=e.createAttributeElement("span",t.attributes);return t.classes&&i._addClass(t.classes),"number"==typeof t.priority&&(i._priority=t.priority),i._id=t.id,i}function js(i,o,n,r,s){const e=o?i.start:i.end;
5var a=e.nodeAfter&&e.nodeAfter.is("element")?e.nodeAfter:null,i=e.nodeBefore&&e.nodeBefore.is("element")?e.nodeBefore:null;if(a||i){let e,t;t=o&&a||!o&&!i?(e=a,!0):(e=i,!1);i=n.mapper.toViewElement(e);if(i)return void function(e,t,i,o,n,r){const s=`data-${r.group}-${t?"start":"end"}-${i?"before":"after"}`,a=e.hasAttribute(s)?e.getAttribute(s).split(","):[];a.unshift(r.name),o.writer.setAttribute(s,a.join(","),e),o.mapper.bindElementToMarker(e,n.markerName)}(i,o,t,n,r,s)}!function(e,t,i,o,n){t=`${n.group}-${t?"start":"end"}`,n=n.name?{name:n.name}:null,n=i.writer.createUIElement(t,n);i.writer.insert(e,n),i.mapper.bindElementToMarker(n,o.markerName)}(n.mapper.toViewPosition(e),o,n,r,s)}function Ws(i,o){return"function"==typeof i?i:(e,t)=>function(e,t,i){"string"==typeof e&&(e={name:e});let o;const n=t.writer,r=Object.assign({},e.attributes);o="container"==i?n.createContainerElement(e.name,r):"attribute"==i?(s={priority:e.priority||Fo.DEFAULT_PRIORITY},n.createAttributeElement(e.name,r,s)):n.createUIElement(e.name,r);if(e.styles)for(const a of Object.keys(e.styles))n.setStyle(a,e.styles[a],o);if(e.classes){var s=e.classes;if("string"==typeof s)n.addClass(s,o);else for(const l of s)n.addClass(l,o)}return o}(i,t,o)}function $s(o){return o.model.values?(e,t)=>{const i=o.view[e];return i?i(e,t):null}:o.view}function qs(t){return"string"==typeof t?e=>({key:t,value:e}):"object"==typeof t?t.value?()=>t:e=>({key:t.key,value:e}):t}function Us(e,t,i){const o="function"==typeof e?e(t,i):e;return o?(o.priority||(o.priority=10),o.id||(o.id=t.markerName),o):null}function Ks(e){const{schema:t,document:i}=e.model;for(const n of i.getRootNames()){var o=i.getRoot(n);if(o.isEmpty&&!t.checkChild(o,"$text")&&t.checkChild(o,"paragraph"))return e.insertElement("paragraph",o),!0}return!1}function Gs(e,t,i){const o=i.createContext(e);return i.checkChild(o,"paragraph")&&!!i.checkChild(o.push("paragraph"),t)}function Js(e,t){var i=t.createElement("paragraph");return t.insert(i,e),t.createPositionAt(i,0)}class Ys extends Bs{elementToElement(e){return this.add(Qs(e))}elementToAttribute(e){return this.add(function(t){ta(t=Fs(t));const i=ia(t,!1),e=Zs(t.view),o=e?"element:"+e:"element";return e=>{e.on(o,i,{priority:t.converterPriority||"low"})}}(e))}attributeToAttribute(e){return this.add(function(t){t=Fs(t);let e=null;"string"!=typeof t.view&&!t.view.key||(e=function(e){"string"==typeof e.view&&(e.view={key:e.view});var t=e.view.key;let i;{var o;i="class"==t||"style"==t?(o="class"==t?"classes":"styles",{[o]:e.view.value}):(o=void 0===e.view.value?/[\s\S]*/:e.view.value,{attributes:{[t]:o}})}e.view.name&&(i.name=e.view.name);return e.view=i,t}(t));ta(t,e);const i=ia(t,!0);return e=>{e.on("element",i,{priority:t.converterPriority||"low"})}}(e))}elementToMarker(e){return this.add((function(e){const i=e.model;e.model=(e,t)=>{e="string"==typeof i?i:i(e,t);return t.writer.createElement("$marker",{"data-name":e})}}(e=Fs(e=e)),Qs(e)))}dataToMarker(e){return this.add(function(o){(o=Fs(o)).model||(o.model=e=>e?o.view+":"+e:o.view);const n=ea(oa(o,"start")),r=ea(oa(o,"end"));return e=>{e.on("element:"+o.view+"-start",n,{priority:o.converterPriority||"normal"}),e.on("element:"+o.view+"-end",r,{priority:o.converterPriority||"normal"});var s,t=zt.get("low"),i=zt.get("highest"),i=zt.get(o.converterPriority)/i;e.on("element",(s=o,(e,n,r)=>{var t=`data-${s.view}`;function i(e,t){for(const o of t){var i=s.model(o,r),i=r.writer.createElement("$marker",{"data-name":i});r.writer.insert(i,e),n.modelCursor.isEqual(e)?n.modelCursor=n.modelCursor.getShiftedBy(1):n.modelCursor=n.modelCursor._getTransformedByInsertion(e,1),n.modelRange=n.modelRange._getTransformedByInsertion(e,1)[0]}}(r.consumable.test(n.viewItem,{attributes:t+"-end-after"})||r.consumable.test(n.viewItem,{attributes:t+"-start-after"})||r.consumable.test(n.viewItem,{attributes:t+"-end-before"})||r.consumable.test(n.viewItem,{attributes:t+"-start-before"}))&&(n.modelRange||Object.assign(n,r.convertChildren(n.viewItem,n.modelCursor)),r.consumable.consume(n.viewItem,{attributes:t+"-end-after"})&&i(n.modelRange.end,n.viewItem.getAttribute(t+"-end-after").split(",")),r.consumable.consume(n.viewItem,{attributes:t+"-start-after"})&&i(n.modelRange.end,n.viewItem.getAttribute(t+"-start-after").split(",")),r.consumable.consume(n.viewItem,{attributes:t+"-end-before"})&&i(n.modelRange.start,n.viewItem.getAttribute(t+"-end-before").split(",")),r.consumable.consume(n.viewItem,{attributes:t+"-start-before"})&&i(n.modelRange.start,n.viewItem.getAttribute(t+"-start-before").split(",")))}),{priority:t+i})}}(e))}}function Xs(){return(e,t,i)=>{var o;!t.modelRange&&i.consumable.consume(t.viewItem,{name:!0})&&({modelRange:o,modelCursor:i}=i.convertChildren(t.viewItem,t.modelCursor),t.modelRange=o,t.modelCursor=i)}}function Qs(t){const i=ea(t=Fs(t));var e=Zs(t.view);const o=e?"element:"+e:"element";return e=>{e.on(o,i,{priority:t.converterPriority||"normal"})}}function Zs(e){return"string"==typeof e?e:"object"==typeof e&&"string"==typeof e.name?e.name:null}function ea(a){const l=new ci(a.view);return(e,t,i)=>{var o,n,r=l.match(t.viewItem);if(r){const s=r.match;
5s.name=!0,i.consumable.test(t.viewItem,s)&&(o=a.model,n=t.viewItem,r=i,(o=o instanceof Function?o(n,r):r.writer.createElement(o))&&i.safeInsert(o,t.modelCursor)&&(i.consumable.consume(t.viewItem,s),i.convertChildren(t.viewItem,o),i.updateConversionResult(o,t)))}}}function ta(e,t=null){var i="object"!=typeof e.model?e.model:e.model.key,o="object"!=typeof e.model||void 0===e.model.value?null===t||(e=>e.getAttribute(t)):e.model.value;e.model={key:i,value:o}}function ia(s,a){const l=new ci(s.view);return(e,t,i)=>{const o=l.match(t.viewItem);var n,r;o&&(!function(e,t){e="function"==typeof e?e(t):e;return!("object"==typeof e&&!Zs(e))&&(!e.classes&&!e.attributes&&!e.styles)}(s.view,t.viewItem)?delete o.match.name:o.match.name=!0,i.consumable.test(t.viewItem,o.match)&&(n=s.model.key,null!==(r="function"==typeof s.model.value?s.model.value(t.viewItem,i):s.model.value)&&(t.modelRange||Object.assign(t,i.convertChildren(t.viewItem,t.modelCursor)),function(e,t,i,o){let n=!1;for(const r of Array.from(e.getItems({shallow:i})))o.schema.checkAttribute(r,t.key)&&(n=!0,r.hasAttribute(t.key)||o.writer.setAttribute(t.key,t.value,r));return n}(t.modelRange,{key:n,value:r},a,i)&&i.consumable.consume(t.viewItem,o.match))))}}function oa(i,e){const t={};return t.view=i.view+"-"+e,t.model=(e,t)=>{e=e.getAttribute("name"),e=i.model(e,t);return t.writer.createElement("$marker",{"data-name":e})},t}class na{constructor(e,t){this.model=e,this.view=new ds(t),this.mapper=new xs,this.downcastDispatcher=new Ts({mapper:this.mapper,schema:e.schema});const i=this.model.document,o=i.selection,n=this.model.markers;var s,a;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(!0)},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(!1)},{priority:"lowest"}),this.listenTo(i,"change",()=>{this.view.change(e=>{this.downcastDispatcher.convertChanges(i.differ,n,e),this.downcastDispatcher.convertSelection(o,n,e)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",(s=this.model,a=this.mapper,(e,t)=>{const i=t.newSelection,o=[];for(const r of i.getRanges())o.push(a.toModelRange(r));const n=s.createSelection(o,{backward:i.isBackward});n.isEqual(s.document.selection)||s.change(e=>{e.setSelection(n)})})),this.downcastDispatcher.on("insert:$text",Ls(),{priority:"lowest"}),this.downcastDispatcher.on("remove",(e,t,i)=>{var o=i.mapper.toViewPosition(t.position),t=t.position.getShiftedBy(t.length),t=i.mapper.toViewPosition(t,{isPhantom:!0});const n=i.writer.createRange(o,t);t=i.writer.remove(n.getTrimmed());for(const r of i.writer.createRangeIn(t).getItems())i.mapper.unbindViewElement(r)},{priority:"low"}),this.downcastDispatcher.on("selection",(e,t,i)=>{const o=i.writer,n=o.document.selection;for(const r of n.getRanges())r.isCollapsed&&r.end.parent.isAttached()&&i.writer.mergeAttributes(r.start);o.setSelection(null)},{priority:"high"}),this.downcastDispatcher.on("selection",(e,t,i)=>{const o=t.selection;if(!o.isCollapsed&&i.consumable.consume(o,"selection")){const r=[];for(const s of o.getRanges()){var n=i.mapper.toViewRange(s);r.push(n)}i.writer.setSelection(r,{backward:o.isBackward})}},{priority:"low"}),this.downcastDispatcher.on("selection",(e,t,i)=>{const o=t.selection;if(o.isCollapsed&&i.consumable.consume(o,"selection")){const n=i.writer;t=o.getFirstPosition(),t=i.mapper.toViewPosition(t),t=n.breakAttributes(t);n.setSelection(t)}},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(e=>{if("$graveyard"==e.rootName)return null;const t=new xo(this.view.document,e.name);return t.rootName=e.rootName,this.mapper.bindElements(e,t),t})}destroy(){this.view.destroy(),this.stopListening()}}Gt(na,fo);class ra{constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const i=this.get(e);if(!i)throw new Bt.a("commandcollection-command-not-found",this,{commandName:e});return i.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands())e.destroy()}}class sa{constructor(){this._consumables=new Map}add(e,t){let i;e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):(this._consumables.has(e)?i=this._consumables.get(e):(i=new aa(e),this._consumables.set(e,i)),i.add(t))}test(e,t){const i=this._consumables.get(e);return void 0===i?null:e.is("$text")||e.is("documentFragment")?i:i.test(t)}consume(e,t){return!!this.test(e,t)&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!1):this._consumables.get(e).
5consume(t),!0)}revert(e,t){const i=this._consumables.get(e);void 0!==i&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):i.revert(t))}static consumablesFromElement(e){const t={element:e,name:!0,attributes:[],classes:[],styles:[]};for(const i of e.getAttributeKeys())"style"!=i&&"class"!=i&&t.attributes.push(i);for(const o of e.getClassNames())t.classes.push(o);for(const n of e.getStyleNames())t.styles.push(n);return t}static createFrom(e,t){if(t=t||new sa(e),e.is("$text"))return t.add(e),t;e.is("element")&&t.add(e,sa.consumablesFromElement(e)),e.is("documentFragment")&&t.add(e);for(const i of e.getChildren())t=sa.createFrom(i,t);return t}}class aa{constructor(e){this.element=e,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(e){e.name&&(this._canConsumeName=!0);for(const t in this._consumables)t in e&&this._add(t,e[t])}test(e){if(e.name&&!this._canConsumeName)return this._canConsumeName;for(const i in this._consumables)if(i in e){var t=this._test(i,e[i]);if(!0!==t)return t}return!0}consume(e){e.name&&(this._canConsumeName=!1);for(const t in this._consumables)t in e&&this._consume(t,e[t])}revert(e){e.name&&(this._canConsumeName=!0);for(const t in this._consumables)t in e&&this._revert(t,e[t])}_add(e,t){t=ge(t)?t:[t];const i=this._consumables[e];for(const o of t){if("attributes"===e&&("class"===o||"style"===o))throw new Bt.a("viewconsumable-invalid-attribute",this);if(i.set(o,!0),"styles"===e)for(const n of this.element.document.stylesProcessor.getRelatedStyles(o))i.set(n,!0)}}_test(e,t){t=ge(t)?t:[t];const i=this._consumables[e];for(const n of t)if("attributes"!==e||"class"!==n&&"style"!==n){var o=i.get(n);if(void 0===o)return null;if(!o)return!1}else{o="class"==n?"classes":"styles",o=this._test(o,[...this._consumables[o].keys()]);if(!0!==o)return o}return!0}_consume(e,t){t=ge(t)?t:[t];const i=this._consumables[e];for(const n of t)if("attributes"!==e||"class"!==n&&"style"!==n){if(i.set(n,!1),"styles"==e)for(const r of this.element.document.stylesProcessor.getRelatedStyles(n))i.set(r,!1)}else{var o="class"==n?"classes":"styles";this._consume(o,[...this._consumables[o].keys()])}}_revert(e,t){var i,t=ge(t)?t:[t];const o=this._consumables[e];for(const n of t)"attributes"!==e||"class"!==n&&"style"!==n?!1===o.get(n)&&o.set(n,!0):(i="class"==n?"classes":"styles",this._revert(i,[...this._consumables[i].keys()]))}}class la{constructor(){this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(e,t)=>{t[0]=new ca(t[0])},{priority:"highest"}),this.on("checkChild",(e,t)=>{t[0]=new ca(t[0]),t[1]=this.getDefinition(t[1])},{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e])throw new Bt.a("schema-cannot-register-item-twice",this,{itemName:e});this._sourceDefinitions[e]=[Object.assign({},t)],this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e])throw new Bt.a("schema-cannot-extend-missing-item",this,{itemName:e});this._sourceDefinitions[e].push(Object.assign({},t)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(e){let t;return t="string"==typeof e?e:e.is&&(e.is("$text")||e.is("$textProxy"))?"$text":e.name,this.getDefinitions()[t]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){e=this.getDefinition(e);return!(!e||!e.isBlock)}isLimit(e){e=this.getDefinition(e);return!!e&&!(!e.isLimit&&!e.isObject)}isObject(e){e=this.getDefinition(e);return!!e&&!!(e.isObject||e.isLimit&&e.isSelectable&&e.isContent)}isInline(e){e=this.getDefinition(e);return!(!e||!e.isInline)}isSelectable(e){e=this.getDefinition(e);return!!e&&!(!e.isSelectable&&!e.isObject)}isContent(e){e=this.getDefinition(e);return!!e&&!(!e.isContent&&!e.isObject)}checkChild(e,t){return!!t&&this._checkContextMatch(t,e)}checkAttribute(e,t){const i=this.getDefinition(e.last);return!!i&&i.allowAttributes.includes(t)}checkMerge(e,t=null){if(e instanceof ks){var i=e.nodeBefore,o=e.nodeAfter;if(!(i instanceof fs))throw new Bt.a("schema-check-merge-no-element-before",this);if(!(o instanceof fs))throw new Bt.a("schema-check-merge-no-element-after",this);return this.checkMerge(i,o)}for(const n of t.getChildren())if(!this.checkChild(e,n))return!1;return!0}addChildCheck(o){this.on("checkChild",(e,[t,i])=>{!i||"boolean"==typeof(i=o(t,i))&&(e.stop(),e.return=i)},{priority:"high"})}addAttributeCheck(o){this.on("checkAttribute",(e,[t,i])=>{i=o(t,i);"boolean"==typeof i&&(e.stop(),e.return=i)},{priority:"high"})}setAttributeProperties(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}getAttributeProperties(e){return this._attributeProperties[e]||{}}getLimitElement(e){let t;if(e instanceof ks)t=e.parent;else{const i=e instanceof ys?[e]:Array.from(e.getRanges());t=i.reduce((e,t)=>
5{t=t.getCommonAncestor();return e?e.getCommonAncestor(t,{includeSelf:!0}):t},null)}for(;!this.isLimit(t)&&t.parent;)t=t.parent;return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const o=e.getFirstPosition();var i=[...o.getAncestors(),new us("",e.getAttributes())];return this.checkAttribute(i,t)}for(const n of e.getRanges())for(const r of n)if(this.checkAttribute(r.item,t))return!0;return!1}*getValidRanges(e,t){for(const i of e=function*(e){for(const t of e)yield*t.getMinimalFlatRanges()}(e))yield*this._getValidRangesForRange(i,t)}getNearestSelectionRange(e,t="both"){if(this.checkChild(e,"$text"))return new ys(e);let i,o;var n=e.getAncestors().reverse().find(e=>this.isLimit(e))||e.root;"both"!=t&&"backward"!=t||(i=new ps({boundaries:ys._createIn(n),startPosition:e,direction:"backward"})),"both"!=t&&"forward"!=t||(o=new ps({boundaries:ys._createIn(n),startPosition:e}));for(const a of function*(e,t){let i=!1;for(;!i;){var o;i=!0,e&&((o=e.next()).done||(i=!1,yield{walker:e,value:o.value})),t&&((o=t.next()).done||(i=!1,yield{walker:t,value:o.value}))}}(i,o)){var r=a.walker==i?"elementEnd":"elementStart",s=a.value;if(s.type==r&&this.isObject(s.item))return ys._createOn(s.item);if(this.checkChild(s.nextPosition,"$text"))return new ys(s.nextPosition)}return null}findAllowedParent(e,t){let i=e.parent;for(;i;){if(this.checkChild(i,t))return i;if(this.isLimit(i))return null;i=i.parent}return null}removeDisallowedAttributes(e,t){for(const i of e)if(i.is("$text"))ua(this,i,t);else{const o=ys._createIn(i);for(const n of o.getPositions())ua(this,n.nodeBefore||n.parent,t)}}createContext(e){return new ca(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={};var t=this._sourceDefinitions,i=Object.keys(t);for(const o of i)e[o]=function(e,t){t={name:t,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],allowChildren:[],inheritTypesFrom:[]};return function(e,t){for(const i of e)for(const o of Object.keys(i).filter(e=>e.startsWith("is")))t[o]=i[o]}(e,t),da(e,t,"allowIn"),da(e,t,"allowContentOf"),da(e,t,"allowWhere"),da(e,t,"allowAttributes"),da(e,t,"allowAttributesOf"),da(e,t,"allowChildren"),da(e,t,"inheritTypesFrom"),function(e,t){for(const o of e){var i=o.inheritAllFrom;i&&(t.allowContentOf.push(i),t.allowWhere.push(i),t.allowAttributesOf.push(i),t.inheritTypesFrom.push(i))}}(e,t),t}(t[o],o);for(const n of i)!function(e,t){const i=e[t];for(const o of i.allowChildren){const n=e[o];n&&n.allowIn.push(t)}i.allowChildren.length=0}(e,n);for(const r of i)!function(e,t){for(const i of e[t].allowContentOf)if(e[i]){const o=function(e,t){const i=e[t];return function(t){return Object.keys(t).map(e=>t[e])}(e).filter(e=>e.allowIn.includes(i.name))}(e,i);o.forEach(e=>{e.allowIn.push(t)})}delete e[t].allowContentOf}(e,r);for(const s of i)!function(e,t){for(const o of e[t].allowWhere){var i=e[o];i&&(i=i.allowIn,e[t].allowIn.push(...i))}delete e[t].allowWhere}(e,s);for(const a of i)!function(e,t){for(const o of e[t].allowAttributesOf){var i=e[o];i&&(i=i.allowAttributes,e[t].allowAttributes.push(...i))}delete e[t].allowAttributesOf}(e,a),function(e,t){const i=e[t];for(const n of i.inheritTypesFrom){var o=e[n];if(o)for(const r of Object.keys(o).filter(e=>e.startsWith("is")))r in i||(i[r]=o[r])}delete i.inheritTypesFrom}(e,a);for(const l of i)!function(t,e){const i=t[e],o=i.allowIn.filter(e=>t[e]);i.allowIn=Array.from(new Set(o))}(e,l),function(e,t){var i=e[t];for(const o of i.allowIn){const n=e[o];n.allowChildren.push(t)}}(e,l),function(e,t){const i=e[t];i.allowAttributes=Array.from(new Set(i.allowAttributes))}(e,l);this._compiledDefinitions=e}_checkContextMatch(e,t,i=t.length-1){var o=t.getItem(i);if(e.allowIn.includes(o.name)){if(0==i)return!0;o=this.getDefinition(o);return this._checkContextMatch(o,t,i-1)}return!1}*_getValidRangesForRange(e,t){let i=e.start,o=e.start;for(const n of e.getItems({shallow:!0}))n.is("element")&&(yield*this._getValidRangesForRange(ys._createIn(n),t)),this.checkAttribute(n,t)||(i.isEqual(o)||(yield new ys(i,o)),i=ks._createAfter(n)),o=ks._createAfter(n);i.isEqual(o)||(yield new ys(i,o))}}Gt(la,fo);class ca{constructor(e){if(e instanceof ca)return e;"string"==typeof e?e=[e]:Array.isArray(e)||(e=e.getAncestors({includeSelf:!0})),this._items=e.map(ha)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(e){const t=new ca([e]);return t._items=[...this._items,...t._items],t}getItem(e){return this._items[e]}*getNames(){yield*this._items.map(e=>e.name)}
5endsWith(e){return Array.from(this.getNames()).join(" ").endsWith(e)}startsWith(e){return Array.from(this.getNames()).join(" ").startsWith(e)}}function da(e,t,i){for(const o of e)"string"==typeof o[i]?t[i].push(o[i]):Array.isArray(o[i])&&t[i].push(...o[i])}function ha(t){return"string"==typeof t||t.is("documentFragment")?{name:"string"==typeof t?t:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:t.is("element")?t.name:"$text",*getAttributeKeys(){yield*t.getAttributeKeys()},getAttribute(e){return t.getAttribute(e)}}}function ua(e,t,i){for(const o of t.getAttributeKeys())e.checkAttribute(t,o)||i.removeAttribute(o,t)}class ga{constructor(e={}){this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this.conversionApi=Object.assign({},e),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this),this.conversionApi.safeInsert=this._safeInsert.bind(this),this.conversionApi.updateConversionResult=this._updateConversionResult.bind(this),this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this),this.conversionApi.getSplitParts=this._getSplitParts.bind(this)}convert(e,t,i=["$root"]){this.fire("viewCleanup",e),this._modelCursor=function(e,t){let i;for(const n of new ca(e)){const r={};for(const s of n.getAttributeKeys())r[s]=n.getAttribute(s);var o=t.createElement(n.name,r);i&&t.append(o,i),i=ks._createAt(o,0)}return i}(i,t),this.conversionApi.writer=t,this.conversionApi.consumable=sa.createFrom(e),this.conversionApi.store={};var e=this._convertItem(e,this._modelCursor)["modelRange"];const o=t.createDocumentFragment();if(e){this._removeEmptyElements();for(const n of Array.from(this._modelCursor.parent.getChildren()))t.append(n,o);o.markers=function(e,t){const i=new Set,o=new Map,n=ys._createIn(e).getItems();for(const s of n)"$marker"==s.name&&i.add(s);for(const a of i){var r=a.getAttribute("data-name");const l=t.createPositionBefore(a);o.has(r)?o.get(r).end=l.clone():o.set(r,new ys(l.clone())),t.remove(a)}return o}(o,t)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,o}_convertItem(e,t){t=Object.assign({viewItem:e,modelCursor:t,modelRange:null});if(e.is("element")?this.fire("element:"+e.name,t,this.conversionApi):e.is("$text")?this.fire("text",t,this.conversionApi):this.fire("documentFragment",t,this.conversionApi),t.modelRange&&!(t.modelRange instanceof ys))throw new Bt.a("view-conversion-dispatcher-incorrect-result",this);return{modelRange:t.modelRange,modelCursor:t.modelCursor}}_convertChildren(e,t){let i=t.is("position")?t:ks._createAt(t,0);const o=new ys(i);for(const r of Array.from(e.getChildren())){var n=this._convertItem(r,i);n.modelRange instanceof ys&&(o.end=n.modelRange.end,i=n.modelCursor)}return{modelRange:o,modelCursor:i}}_safeInsert(e,t){t=this._splitToAllowedParent(e,t);return!!t&&(this.conversionApi.writer.insert(e,t.position),!0)}_updateConversionResult(e,t){var i=this._getSplitParts(e);const o=this.conversionApi.writer;t.modelRange||(t.modelRange=o.createRange(o.createPositionBefore(e),o.createPositionAfter(i[i.length-1])));e=this._cursorParents.get(e);t.modelCursor=e?o.createPositionAt(e,0):t.modelRange.end}_splitToAllowedParent(e,t){const{schema:i,writer:o}=this.conversionApi;let n=i.findAllowedParent(t,e);if(n){if(n===t.parent)return{position:t};this._modelCursor.parent.getAncestors().includes(n)&&(n=null)}if(!n)return Gs(t,e,i)?{position:Js(t,o)}:null;const r=this.conversionApi.writer.split(t,n),s=[];for(const c of r.range.getWalker()){var a,l;"elementEnd"==c.type?s.push(c.item):(a=s.pop(),l=c.item,this._registerSplitPair(a,l))}t=r.range.end.parent;return this._cursorParents.set(e,t),{position:r.position,cursorParent:t}}_registerSplitPair(e,t){this._splitParts.has(e)||this._splitParts.set(e,[e]);const i=this._splitParts.get(e);this._splitParts.set(t,i),i.push(t)}_getSplitParts(e){let t;return t=this._splitParts.has(e)?this._splitParts.get(e):[e],t}_removeEmptyElements(){let e=!1;
5for(const t of this._splitParts.keys())t.isEmpty&&(this.conversionApi.writer.remove(t),this._splitParts.delete(t),e=!0);e&&this._removeEmptyElements()}}Gt(ga,Lt);class ma{getHtml(e){const t=document.implementation.createHTMLDocument(""),i=t.createElement("div");return i.appendChild(e),i.innerHTML}}class fa{constructor(e){this._domParser=new DOMParser,this._domConverter=new $n(e,{blockFillerMode:"nbsp"}),this._htmlWriter=new ma}toData(e){e=this._domConverter.viewToDom(e,document);return this._htmlWriter.getHtml(e)}toView(e){e=this._toDom(e);return this._domConverter.domToView(e)}registerRawContentMatcher(e){this._domConverter.registerRawContentMatcher(e)}useFillerType(e){this._domConverter.blockFillerMode="marked"==e?"markedNbsp":"nbsp"}_toDom(e){const t=this._domParser.parseFromString(e,"text/html"),i=t.createDocumentFragment();let o=t.firstChild;for(;!o.isSameNode(t.documentElement);){var n=o;o=o.nextSibling,n.nodeType==Node.COMMENT_NODE&&i.appendChild(n)}for(var r=t.body.childNodes;0<r.length;)i.appendChild(r[0]);return i}}class pa{constructor(e,t){this.model=e,this.mapper=new xs,this.downcastDispatcher=new Ts({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",Ls(),{priority:"lowest"}),this.upcastDispatcher=new ga({schema:e.schema}),this.viewDocument=new Bo(t),this.stylesProcessor=t,this.htmlProcessor=new fa(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new cn(this.viewDocument),this.upcastDispatcher.on("text",(e,t,{schema:i,consumable:o,writer:n})=>{let r=t.modelCursor;if(o.test(t.viewItem)){if(!i.checkChild(r,"$text")){if(!Gs(r,"$text",i))return;r=Js(r,n)}o.consume(t.viewItem);o=n.createText(t.viewItem.data);n.insert(o,r),t.modelRange=n.createRange(r,r.getShiftedBy(o.offsetSize)),t.modelCursor=t.modelRange.end}},{priority:"lowest"}),this.upcastDispatcher.on("element",Xs(),{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",Xs(),{priority:"lowest"}),this.decorate("init"),this.decorate("set"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"}),this.on("ready",()=>{this.model.enqueueChange("transparent",Ks)},{priority:"lowest"})}get(e={}){var{rootName:t="main",trim:i="empty"}=e;if(!this._checkIfRootsExists([t]))throw new Bt.a("datacontroller-get-non-existent-root",this);t=this.model.document.getRoot(t);return"empty"!==i||this.model.hasContent(t,{ignoreWhitespaces:!0})?this.stringify(t,e):""}stringify(e,t={}){t=this.toView(e,t);return this.processor.toData(t)}toView(e,t={}){var i=this.viewDocument,o=this._viewWriter;this.mapper.clearBindings();var n,r,s=ys._createIn(e),i=new ln(i);this.mapper.bindElements(e,i),this.downcastDispatcher.conversionApi.options=t,this.downcastDispatcher.convertInsert(s,o);for([n,r]of e.is("documentFragment")?Array.from(e.markers):function(e){const t=[],i=e.root.document;if(!i)return[];const o=ys._createIn(e);for(const s of i.model.markers){const a=s.getRange();var n=a.isCollapsed,r=a.start.isEqual(o.start)||a.end.isEqual(o.end);n&&r?t.push([s.name,a]):(r=o.getIntersection(a))&&t.push([s.name,r])}return t}(e))this.downcastDispatcher.convertMarkerAdd(n,r,o);return delete this.downcastDispatcher.conversionApi.options,i}init(e){if(this.model.document.version)throw new Bt.a("datacontroller-init-document-not-empty",this);let o={};if("string"==typeof e?o.main=e:o=e,!this._checkIfRootsExists(Object.keys(o)))throw new Bt.a("datacontroller-init-non-existent-root",this);return this.model.enqueueChange("transparent",e=>{for(const i of Object.keys(o)){var t=this.model.document.getRoot(i);e.insert(this.parse(o[i],t),t,0)}}),Promise.resolve()}set(e,t={}){let o={};if("string"==typeof e?o.main=e:o=e,!this._checkIfRootsExists(Object.keys(o)))throw new Bt.a("datacontroller-set-non-existent-root",this);t=t.batchType||"default";this.model.enqueueChange(t,e=>{e.setSelection(null),e.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const i of Object.keys(o)){var t=this.model.document.getRoot(i);e.remove(e.createRangeIn(t)),e.insert(this.parse(o[i],t),t,0)}})}parse(e,t="$root"){e=this.processor.toView(e);return this.toModel(e,t)}toModel(t,i="$root"){return this.model.change(e=>this.upcastDispatcher.convert(t,e,i))}addStyleProcessorRules(e){e(this.stylesProcessor)}registerRawContentMatcher(e){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(e),this.htmlProcessor.registerRawContentMatcher(e)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e)if(!this.model.document.getRootNames().includes(t))return!1;return!0}}Gt(pa,fo);class ba{constructor(e,t){this._helpers=new Map,this._downcast=Xt(e),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Xt(t),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(e,t){var i=this._downcast.includes(t);if(!this._upcast.includes(t)&&!i)throw new Bt.a("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:i})}for(e){if(!this._helpers.has(e))throw new Bt.a("conversion-for-unknown-group",this);return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(var{model:t,view:i}of ka(e))this.for("upcast").elementToElement({model:t,view:i,converterPriority:e.converterPriority})}attributeToElement(e){this.for("downcast").attributeToElement(e);for(var{model:t,view:i}of ka(e))this.for("upcast").elementToAttribute({view:i,model:t,converterPriority:e.converterPriority})}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(var{model:t,view:i}of ka(e))this.for("upcast").attributeToAttribute({view:i,model:t})}_createConversionHelpers({name:e,dispatchers:t,isDowncast:i}){if(this._helpers.has(e))throw new Bt.a("conversion-group-exists",this);t=new(i?Ds:Ys)(t);this._helpers.set(e,t)}}function*ka(e){if(e.model.values)for(const t of e.model.values)yield*wa({key:e.model.key,value:t},e.view[t],e.upcastAlso?e.upcastAlso[t]:void 0);else yield*wa(e.model,e.view,e.upcastAlso)}function*wa(e,t,i){if(yield{model:e,view:t},i)for(const o of Xt(i))yield{model:e,view:o}}class va{constructor(e="default"){this.operations=[],this.type=e}get baseVersion(){for(const e of this.operations)if(null!==e.baseVersion)return e.baseVersion;return null}addOperation(e){return(e.batch=this).operations.push(e),e}}class _a{constructor(e){this.baseVersion=e,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const e=Object.assign({},this);return e.__className=this.constructor.className,delete e.batch,delete e.isDocumentOperation,e}static get className(){return"Operation"}static fromJSON(e){return new this(e.baseVersion)}}class ya{constructor(e){this.markers=new Map,this._children=new ms,e&&this._insertChild(0,e)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(e){return"documentFragment"===e||"model:documentFragment"===e}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}getPath(){return[]}getNodeByPath(e){let t=this;for(const i of e)t=t.getChild(t.offsetToIndex(i));return t}offsetToIndex(e){return this._children.offsetToIndex(e)}toJSON(){const e=[];for(const t of this._children)e.push(t.toJSON());return e}static fromJSON(e){const t=[];for(const i of e)i.name?t.push(fs.fromJSON(i)):t.push(us.fromJSON(i));return new ya(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){t=function(e){if("string"==typeof e)return[new us(e)];Kt(e)||(e=[e]);return Array.from(e).map(e=>"string"==typeof e?new us(e):e instanceof gs?new us(e.data,e.getAttributes()):e)}(t);for(const i of t)null!==i.parent&&i._remove(),i.parent=this;this._children._insertNodes(e,t)}_removeChildren(e,t=1){t=this._children._removeNodes(e,t);for(const i of t)i.parent=null;return t}}function xa(e,t){var i=(t=Ta(t)).reduce((e,t)=>
5e+t.offsetSize,0);const o=e.parent;Pa(e);var n=e.index;return o._insertChild(n,t),Ea(o,n+t.length),Ea(o,n),new ys(e,e.getShiftedBy(i))}function Ca(e){if(!e.isFlat)throw new Bt.a("operation-utils-remove-range-not-flat",this);const t=e.start.parent;Pa(e.start),Pa(e.end);var i=t._removeChildren(e.start.index,e.end.index-e.start.index);return Ea(t,e.start.index),i}function Aa(e,t){if(!e.isFlat)throw new Bt.a("operation-utils-move-range-not-flat",this);var i=Ca(e);return xa(t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset),i)}function Ta(t){const i=[];t instanceof Array||(t=[t]);for(let e=0;e<t.length;e++)if("string"==typeof t[e])i.push(new us(t[e]));else if(t[e]instanceof gs)i.push(new us(t[e].data,t[e].getAttributes()));else if(t[e]instanceof ya||t[e]instanceof ms)for(const n of t[e])i.push(n);else t[e]instanceof hs&&i.push(t[e]);for(let e=1;e<i.length;e++){var o=i[e];const r=i[e-1];o instanceof us&&r instanceof us&&Sa(o,r)&&(i.splice(e-1,2,new us(r.data+o.data,r.getAttributes())),e--)}return i}function Ea(e,t){const i=e.getChild(t-1),o=e.getChild(t);var n;i&&o&&i.is("$text")&&o.is("$text")&&Sa(i,o)&&(n=new us(i.data+o.data,i.getAttributes()),e._removeChildren(t-1,2),e._insertChild(t-1,n))}function Pa(e){const t=e.textNode,i=e.parent;var o,n;t&&(n=e.offset-t.startOffset,o=t.index,i._removeChildren(o,1),e=new us(t.data.substr(0,n),t.getAttributes()),n=new us(t.data.substr(n),t.getAttributes()),i._insertChild(o,[e,n]))}function Sa(e,t){e=e.getAttributes();const i=t.getAttributes();for(const o of e){if(o[1]!==t.getAttribute(o[0]))return;i.next()}return i.next().done}var Ia=function(e,t){return mr(e,t)};class Ra extends _a{constructor(e,t,i,o,n){super(n),this.range=e.clone(),this.key=t,this.oldValue=void 0===i?null:i,this.newValue=void 0===o?null:o}get type(){return null===this.oldValue?"addAttribute":null===this.newValue?"removeAttribute":"changeAttribute"}clone(){return new Ra(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Ra(this.range,this.key,this.newValue,this.oldValue,this.baseVersion+1)}toJSON(){const e=super.toJSON();return e.range=this.range.toJSON(),e}_validate(){if(!this.range.isFlat)throw new Bt.a("attribute-operation-range-not-flat",this);for(const e of this.range.getItems({shallow:!0})){if(null!==this.oldValue&&!Ia(e.getAttribute(this.key),this.oldValue))throw new Bt.a("attribute-operation-wrong-old-value",this,{item:e,key:this.key,value:this.oldValue});if(null===this.oldValue&&null!==this.newValue&&e.hasAttribute(this.key))throw new Bt.a("attribute-operation-attribute-exists",this,{node:e,key:this.key})}}_execute(){Ia(this.oldValue,this.newValue)||function(e,t,i){Pa(e.start),Pa(e.end);for(const o of e.getItems({shallow:!0})){const n=o.is("$textProxy")?o.textNode:o;null!==i?n._setAttribute(t,i):n._removeAttribute(t),Ea(n.parent,n.index)}Ea(e.end.parent,e.end.index)}(this.range,this.key,this.newValue)}static get className(){return"AttributeOperation"}static fromJSON(e,t){return new Ra(ys.fromJSON(e.range,t),e.key,e.oldValue,e.newValue,e.baseVersion)}}class Oa extends _a{constructor(e,t){super(null),this.sourcePosition=e.clone(),this.howMany=t}get type(){return"detach"}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e}_validate(){if(this.sourcePosition.root.document)throw new Bt.a("detach-operation-on-document-node",this)}_execute(){Ca(ys._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class Va extends _a{constructor(e,t,i,o){super(o),this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toNext",this.howMany=t,this.targetPosition=i.clone(),this.targetPosition.stickiness="toNone"}get type(){return"$graveyard"==this.targetPosition.root.rootName?"remove":"$graveyard"==this.sourcePosition.root.rootName?"reinsert":"move"}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.baseVersion)}getMovedRangeStart(){return this.targetPosition._getTransformedByDeletion(this.sourcePosition,this.howMany)}getReversed(){var e=this.sourcePosition._getTransformedByInsertion(this.targetPosition,this.howMany);return new this.constructor(this.getMovedRangeStart(),this.howMany,e,this.baseVersion+1)}_validate(){var e=this.sourcePosition.parent,t=this.targetPosition.parent,i=this.sourcePosition.offset,o=this.targetPosition.offset;if(i+this.howMany>e.maxOffset)throw new Bt.a("move-operation-nodes-do-not-exist",this);if(e===t&&i<o&&o<i+this.howMany)throw new Bt.a("move-operation-range-into-itself",this);if(this.sourcePosition.root==this.targetPosition.root&&"prefix"==oi(this.sourcePosition.getParentPath(),this.targetPosition.getParentPath())){o=this.sourcePosition.path.length-1;if(this.targetPosition.path[o]>=i&&this.targetPosition.path[o]<i+this.howMany)throw new Bt.a("move-operation-node-into-itself",this)}}_execute(){Aa(ys._createFromPositionAndShift(this.sourcePosition,this.howMany),this.targetPosition)}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e.targetPosition=this.targetPosition.toJSON(),e}static get className(){return"MoveOperation"}static fromJSON(e,t){var i=ks.fromJSON(e.sourcePosition,t),t=ks.fromJSON(e.targetPosition,t);return new this(i,e.howMany,t,e.baseVersion)}}class Ma extends _a{constructor(e,t,i){super(i),this.position=e.clone(),this.position.stickiness="toNone",this.nodes=new ms(Ta(t)),this.shouldReceiveAttributes=!1}get type(){return"insert"}get howMany(){return this.nodes.maxOffset}clone(){var e=new ms([...this.nodes].map(e=>e._clone(!0)));const t=new Ma(this.position,e,this.baseVersion);return t.shouldReceiveAttributes=this.shouldReceiveAttributes,t}getReversed(){var e=this.position.root.document.graveyard,e=new ks(e,[0]);return new Va(this.position,this.nodes.maxOffset,e,this.baseVersion+1)}_validate(){var e=this.position.parent;if(!e||e.maxOffset<this.position.offset)throw new Bt.a("insert-operation-position-invalid",this)}_execute(){var e=this.nodes;this.nodes=new ms([...e].map(e=>e._clone(!0))),xa(this.position,e)}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e.nodes=this.nodes.toJSON(),e}static get className(){return"InsertOperation"}static fromJSON(e,t){const i=[];for(const n of e.nodes)n.name?i.push(fs.fromJSON(n)):i.push(us.fromJSON(n));const o=new Ma(ks.fromJSON(e.position,t),i,e.baseVersion);return o.shouldReceiveAttributes=e.shouldReceiveAttributes,o}}class Na extends _a{constructor(e,t,i,o,n,r){super(r),this.name=e,this.oldRange=t?t.clone():null,this.newRange=i?i.clone():null,this.affectsData=n,this._markers=o}get type(){return"marker"}clone(){return new Na(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new Na(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){var e=this.newRange?"_set":"_remove";this._markers[e](this.name,this.newRange,!0,this.affectsData)}toJSON(){const e=super.toJSON();return this.oldRange&&(e.oldRange=this.oldRange.toJSON()),this.newRange&&(e.newRange=this.newRange.toJSON()),delete e._markers,e}static get className(){return"MarkerOperation"}static fromJSON(e,t){return new Na(e.name,e.oldRange?ys.fromJSON(e.oldRange,t):null,e.newRange?ys.fromJSON(e.newRange,t):null,t.model.markers,e.affectsData,e.baseVersion)}}class za extends _a{constructor(e,t,i,o){super(o),this.position=e,this.position.stickiness="toNext",this.oldName=t,this.newName=i}get type(){return"rename"}clone(){return new za(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new za(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){var e=this.position.nodeAfter;if(!(e instanceof fs))throw new Bt.a("rename-operation-wrong-position",this);if(e.name!==this.oldName)throw new Bt.a("rename-operation-wrong-name",this)}_execute(){const e=this.position.nodeAfter;e.name=this.newName}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e}static get className(){return"RenameOperation"}static fromJSON(e,t){return new za(ks.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class Ba extends _a{constructor(e,t,i,o,n){super(n),this.root=e,this.key=t,this.oldValue=i,this.newValue=o}get type(){return null===this.oldValue?"addRootAttribute":null===this.newValue?"removeRootAttribute":"changeRootAttribute"}clone(){return new Ba(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Ba(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new Bt.a("rootattribute-operation-not-a-root",this,{root:this.root,key:this.key});if(null!==this.oldValue&&this.root.getAttribute(this.key)!==this.oldValue)throw new Bt.a("rootattribute-operation-wrong-old-value",this,{root:this.root,key:this.key});if(null===this.oldValue&&null!==this.newValue&&this.root.hasAttribute(this.key))throw new Bt.a("rootattribute-operation-attribute-exists",this,{root:this.root,key:this.key})}_execute(){null!==this.newValue?this.root._setAttribute(this.key,this.newValue):this.root._removeAttribute(this.key)}toJSON(){const e=super.toJSON();return e.root=this.root.toJSON(),e}static get className(){return"RootAttributeOperation"}static fromJSON(e,t){if(!t.getRoot(e.root))throw new Bt.a("rootattribute-operation-fromjson-no-root",this,{rootName:e.root});return new Ba(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}class Fa extends _a{constructor(e,t,i,o,n){super(n),this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=t,this.targetPosition=i.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=o.clone()}get type(){return"merge"}get deletionPosition(){return new ks(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){var e=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new ys(this.sourcePosition,e)}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){var e=this.targetPosition._getTransformedByMergeOperation(this),t=this.sourcePosition.path.slice(0,-1),t=new ks(this.sourcePosition.root,t)._getTransformedByMergeOperation(this);return new Da(e,this.howMany,t,this.graveyardPosition,this.baseVersion+1)}_validate(){var e=this.sourcePosition.parent,t=this.targetPosition.parent;if(!e.parent)throw new Bt.a("merge-operation-source-position-invalid",this);if(!t.parent)throw new Bt.a("merge-operation-target-position-invalid",this);if(this.howMany!=e.maxOffset)throw new Bt.a("merge-operation-how-many-invalid",this)}_execute(){var e=this.sourcePosition.parent;Aa(ys._createIn(e),this.targetPosition),Aa(ys._createOn(e),this.graveyardPosition)}toJSON(){const e=super.toJSON();return e.sourcePosition=e.sourcePosition.toJSON(),e.targetPosition=e.targetPosition.toJSON(),e.graveyardPosition=e.graveyardPosition.toJSON(),e}static get className(){return"MergeOperation"}static fromJSON(e,t){var i=ks.fromJSON(e.sourcePosition,t),o=ks.fromJSON(e.targetPosition,t),t=ks.fromJSON(e.graveyardPosition,t);return new this(i,e.howMany,o,t,e.baseVersion)}}class Da extends _a{constructor(e,t,i,o,n){super(n),this.splitPosition=e.clone(),this.splitPosition.stickiness="toNext",this.howMany=t,this.insertionPosition=i,this.graveyardPosition=o?o.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();return e.push(0),new ks(this.insertionPosition.root,e)}get movedRange(){var e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new ys(this.splitPosition,e)}clone(){return new this.constructor(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){var e=this.splitPosition.root.document.graveyard,e=new ks(e,[0]);return new Fa(this.moveTargetPosition,this.howMany,this.splitPosition,e,this.baseVersion+1)}_validate(){var e=this.splitPosition.parent,t=this.splitPosition.offset;if(!e||e.maxOffset<t)throw new Bt.a("split-operation-position-invalid",this);if(!e.parent)throw new Bt.a("split-operation-split-in-root",this);if(this.howMany!=e.maxOffset-this.splitPosition.offset)throw new Bt.a("split-operation-how-many-invalid",this);if(this.graveyardPosition&&!this.graveyardPosition.nodeAfter)throw new Bt.a("split-operation-graveyard-position-invalid",this)}_execute(){const e=this.splitPosition.parent;var t;this.graveyardPosition?Aa(ys._createFromPositionAndShift(this.graveyardPosition,1),this.insertionPosition):(t=e._clone(),xa(this.insertionPosition,t)),Aa(new ys(ks._createAt(e,this.splitPosition.offset),ks._createAt(e,e.maxOffset)),this.moveTargetPosition)}toJSON(){const e=super.toJSON();return e.splitPosition=this.splitPosition.toJSON(),e.insertionPosition=this.insertionPosition.toJSON(),this.graveyardPosition&&(e.graveyardPosition=this.graveyardPosition.toJSON()),e}static get className(){return"SplitOperation"}static getInsertionPosition(e){const t=e.path.slice(0,-1);return t[t.length-1]++,new ks(e.root,t,"toPrevious")}static fromJSON(e,t){var i=ks.fromJSON(e.splitPosition,t),o=ks.fromJSON(e.insertionPosition,t),t=e.graveyardPosition?ks.fromJSON(e.graveyardPosition,t):null;return new this(i,e.howMany,o,t,e.baseVersion)}}class La extends fs{constructor(e,t,i="main"){super(t),this._document=e,this.rootName=i}get document(){return this._document}is(e,t){return t?t===this.name&&("rootElement"===e||"model:rootElement"===e||"element"===e||"model:element"===e):"rootElement"===e||"model:rootElement"===e||"element"===e||"model:element"===e||"node"===e||"model:node"===e}toJSON(){return this.rootName}}class Ha{constructor(e,t){this.model=e,this.batch=t}createText(e,t){return new us(e,t)}createElement(e,t){return new fs(e,t)}createDocumentFragment(){return new ya}
5cloneElement(e,t=!0){return e._clone(t)}insert(e,t,i=0){if(this._assertWriterUsedCorrectly(),!(e instanceof us&&""==e.data)){var o=ks._createAt(t,i);if(e.parent){if(qa(e.root,o.root))return void this.move(ys._createOn(e),o);if(e.root.document)throw new Bt.a("model-writer-insert-forbidden-move",this);this.remove(e)}i=o.root.document?o.root.document.version:null;const a=new Ma(o,e,i);if(e instanceof us&&(a.shouldReceiveAttributes=!0),this.batch.addOperation(a),this.model.applyOperation(a),e instanceof ya)for(var[n,r]of e.markers){var s=ks._createAt(r.root,0),s={range:new ys(r.start._getCombined(s,o),r.end._getCombined(s,o)),usingOperation:!0,affectsData:!0};this.model.markers.has(n)?this.updateMarker(n,s):this.addMarker(n,s)}}}insertText(e,t,i,o){t instanceof ya||t instanceof fs||t instanceof ks?this.insert(this.createText(e),t,i):this.insert(this.createText(e,t),i,o)}insertElement(e,t,i,o){t instanceof ya||t instanceof fs||t instanceof ks?this.insert(this.createElement(e),t,i):this.insert(this.createElement(e,t),i,o)}append(e,t){this.insert(e,t,"end")}appendText(e,t,i){t instanceof ya||t instanceof fs?this.insert(this.createText(e),t,"end"):this.insert(this.createText(e,t),i,"end")}appendElement(e,t,i){t instanceof ya||t instanceof fs?this.insert(this.createElement(e),t,"end"):this.insert(this.createElement(e,t),i,"end")}setAttribute(e,t,i){if(this._assertWriterUsedCorrectly(),i instanceof ys)for(const o of i.getMinimalFlatRanges())ja(this,e,t,o);else Wa(this,e,t,i)}setAttributes(e,t){for(var[i,o]of li(e))this.setAttribute(i,o,t)}removeAttribute(e,t){if(this._assertWriterUsedCorrectly(),t instanceof ys)for(const i of t.getMinimalFlatRanges())ja(this,e,null,i);else Wa(this,e,null,t)}clearAttributes(e){this._assertWriterUsedCorrectly();var t=e=>{for(const t of e.getAttributeKeys())this.removeAttribute(t,e)};if(e instanceof ys)for(const i of e.getItems())t(i);else t(e)}move(e,t,i){if(this._assertWriterUsedCorrectly(),!(e instanceof ys))throw new Bt.a("writer-move-invalid-range",this);if(!e.isFlat)throw new Bt.a("writer-move-range-not-flat",this);const o=ks._createAt(t,i);if(!o.isEqual(e.start)){if(this._addOperationForAffectedMarkers("move",e),!qa(e.root,o.root))throw new Bt.a("writer-move-different-document",this);i=e.root.document?e.root.document.version:null,i=new Va(e.start,e.end.offset-e.start.offset,o,i);this.batch.addOperation(i),this.model.applyOperation(i)}}remove(e){this._assertWriterUsedCorrectly();const t=e instanceof ys?e:ys._createOn(e);for(const i of t.getMinimalFlatRanges().reverse())this._addOperationForAffectedMarkers("move",i),function(e,t,i,o){let n;{var r,s;n=e.root.document?(r=o.document,s=new ks(r.graveyard,[0]),new Va(e,t,s,r.version)):new Oa(e,t)}i.addOperation(n),o.applyOperation(n)}(i.start,i.end.offset-i.start.offset,this.batch,this.model)}merge(e){this._assertWriterUsedCorrectly();var t=e.nodeBefore,i=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof fs))throw new Bt.a("writer-merge-no-element-before",this);if(!(i instanceof fs))throw new Bt.a("writer-merge-no-element-after",this);e.root.document?this._merge(e):this._mergeDetached(e)}createPositionFromPath(e,t,i){return this.model.createPositionFromPath(e,t,i)}createPositionAt(e,t){return this.model.createPositionAt(e,t)}createPositionAfter(e){return this.model.createPositionAfter(e)}createPositionBefore(e){return this.model.createPositionBefore(e)}createRange(e,t){return this.model.createRange(e,t)}createRangeIn(e){return this.model.createRangeIn(e)}createRangeOn(e){return this.model.createRangeOn(e)}createSelection(e,t,i){return this.model.createSelection(e,t,i)}_mergeDetached(e){var t=e.nodeBefore,e=e.nodeAfter;this.move(ys._createIn(e),ks._createAt(t,"end")),this.remove(e)}_merge(e){var t=ks._createAt(e.nodeBefore,"end"),i=ks._createAt(e.nodeAfter,0),o=e.root.document.graveyard,n=new ks(o,[0]),o=e.root.document.version,o=new Fa(i,e.nodeAfter.maxOffset,t,n,o);this.batch.addOperation(o),this.model.applyOperation(o)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof fs))throw new Bt.a("writer-rename-not-element-instance",this);var i=e.root.document?e.root.document.version:null,i=new za(ks._createBefore(e),e.name,t,i);this.batch.addOperation(i),this.model.applyOperation(i)}split(e,t){this._assertWriterUsedCorrectly();let i=e.parent;if(!i.parent)throw new Bt.a("writer-split-element-no-parent",this);if(t=t||i.parent,!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new Bt.a("writer-split-invalid-limit-element",this);let o,n;do{var r=i.root.document?i.root.document.version:null,s=i.maxOffset-e.offset,a=Da.getInsertionPosition(e),r=new Da(e,s,a,null,r);this.batch.addOperation(r),this.model.applyOperation(r),o||n||(o=i,n=e.parent.nextSibling),e=this.createPositionAfter(e.parent),i=e.parent}while(i!==t);return{position:e,range:new ys(ks._createAt(o,"end"),ks._createAt(n,0))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new Bt.a("writer-wrap-range-not-flat",this);t=t instanceof fs?t:new fs(t);if(0<t.childCount)throw new Bt.a("writer-wrap-element-not-empty",this);if(null!==t.parent)throw new Bt.a("writer-wrap-element-attached",this);this.insert(t,e.start);e=new ys(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(e,ks._createAt(t,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),null===e.parent)throw new Bt.a("writer-unwrap-element-no-parent",this);this.move(ys._createIn(e),this.createPositionAfter(e)),this.remove(e)}
5addMarker(e,t){if(this._assertWriterUsedCorrectly(),!t||"boolean"!=typeof t.usingOperation)throw new Bt.a("writer-addmarker-no-usingoperation",this);var i=t.usingOperation,o=t.range,t=void 0!==t.affectsData&&t.affectsData;if(this.model.markers.has(e))throw new Bt.a("writer-addmarker-marker-exists",this);if(!o)throw new Bt.a("writer-addmarker-no-range",this);return i?($a(this,e,null,o,t),this.model.markers.get(e)):this.model.markers._set(e,o,i,t)}updateMarker(e,t){this._assertWriterUsedCorrectly();var i="string"==typeof e?e:e.name;const o=this.model.markers.get(i);if(!o)throw new Bt.a("writer-updatemarker-marker-not-exists",this);if(t){var n="boolean"==typeof t.usingOperation,r="boolean"==typeof t.affectsData,s=(r?t:o).affectsData;if(!n&&!t.range&&!r)throw new Bt.a("writer-updatemarker-wrong-options",this);e=o.getRange(),r=t.range||e;n&&t.usingOperation!==o.managedUsingOperations?t.usingOperation?$a(this,i,null,r,s):($a(this,i,e,null,s),this.model.markers._set(i,r,void 0,s)):o.managedUsingOperations?$a(this,i,e,r,s):this.model.markers._set(i,r,void 0,s)}else this.model.markers._refresh(o)}removeMarker(e){this._assertWriterUsedCorrectly();e="string"==typeof e?e:e.name;if(!this.model.markers.has(e))throw new Bt.a("writer-removemarker-no-marker",this);const t=this.model.markers.get(e);t.managedUsingOperations?$a(this,e,t.getRange(),null,t.affectsData):this.model.markers._remove(e)}setSelection(e,t,i){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(e,t,i)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._setSelectionAttribute(e,t);else for(const[i,t]of li(e))this._setSelectionAttribute(i,t)}removeSelectionAttribute(e){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._removeSelectionAttribute(e);else for(const t of e)this._removeSelectionAttribute(t)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(e){this.model.document.selection._restoreGravity(e)}_setSelectionAttribute(e,t){const i=this.model.document.selection;var o;i.isCollapsed&&i.anchor.parent.isEmpty&&(o=Ms._getStoreAttributeKey(e),this.setAttribute(o,t,i.anchor.parent)),i._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;var i;t.isCollapsed&&t.anchor.parent.isEmpty&&(i=Ms._getStoreAttributeKey(e),this.removeAttribute(i,t.anchor.parent)),t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new Bt.a("writer-incorrect-use",this)}_addOperationForAffectedMarkers(t,i){for(const l of this.model.markers)if(l.managedUsingOperations){var o,n,r,s,a=l.getRange();let e=!1;e="move"===t?i.containsPosition(a.start)||i.start.isEqual(a.start)||i.containsPosition(a.end)||i.end.isEqual(a.end):(r=i.nodeBefore,s=i.nodeAfter,o=a.start.parent==r&&a.start.isAtEnd,n=a.end.parent==s&&0==a.end.offset,r=a.end.nodeAfter==s,s=a.start.nodeAfter==s,o||n||r||s),e&&this.updateMarker(l.name,{range:a})}}}function ja(i,o,n,e){const r=i.model,s=r.document;let a=e.start,l,c;var t;for(const h of e.getWalker({shallow:!0}))t=h.item.getAttribute(o),l&&c!=t&&(c!=n&&d(),a=l),l=h.nextPosition,c=t;function d(){var e=new ys(a,l),t=e.root.document?s.version:null,t=new Ra(e,o,c,n,t);i.batch.addOperation(t),r.applyOperation(t)}l instanceof ks&&l!=a&&c!=n&&d()}function Wa(e,t,i,o){const n=e.model;var r,s=n.document,a=o.getAttribute(t);let l,c;a!=i&&(r=o.root===o,c=r?(r=o.document?s.version:null,new Ba(o,t,a,i,r)):(s=(l=new ys(ks._createBefore(o),e.createPositionAfter(o))).root.document?s.version:null,new Ra(l,t,a,i,s)),e.batch.addOperation(c),n.applyOperation(c))}function $a(e,t,i,o,n){const r=e.model;var s=r.document,s=new Na(t,i,o,r.markers,n,s.version);e.batch.addOperation(s),r.applyOperation(s)}function qa(e,t){return e===t||e instanceof La&&t instanceof La}class Ua{constructor(e){this._markerCollection=e,this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null}get isEmpty(){return 0==this._changesInElement.size&&0==this._changedMarkers.size}refreshItem(e){if(!this._isInInsertedElement(e.parent)){this._markRemove(e.parent,e.startOffset,e.offsetSize),this._markInsert(e.parent,e.startOffset,e.offsetSize);e=ys._createOn(e);for(const i of this._markerCollection.getMarkersIntersectingRange(e)){var t=i.getRange();this.bufferMarkerChange(i.name,t,t,i.affectsData)}this._cachedChanges=null}}bufferOperation(e){switch(e.type){case"insert":if(this._isInInsertedElement(e.position.parent))return;this._markInsert(e.position.parent,e.position.offset,e.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const s of e.range.getItems({shallow:!0}))this._isInInsertedElement(s.parent)||this._markAttribute(s);break;case"remove":case"move":case"reinsert":if(e.sourcePosition.isEqual(e.targetPosition)||e.sourcePosition.getShiftedBy(e.howMany).isEqual(e.targetPosition))return;var t=this._isInInsertedElement(e.sourcePosition.parent),i=this._isInInsertedElement(e.targetPosition.parent);t||this._markRemove(e.sourcePosition.parent,e.sourcePosition.offset,e.howMany),i||this._markInsert(e.targetPosition.parent,e.getMovedRangeStart().offset,e.howMany);break;case"rename":if(this._isInInsertedElement(e.position.parent))return;this._markRemove(e.position.parent,e.position.offset,1),this._markInsert(e.position.parent,e.position.offset,1);var o=ys._createFromPositionAndShift(e.position,1);for(const a of this._markerCollection.getMarkersIntersectingRange(o)){var n=a.getRange();this.bufferMarkerChange(a.name,n,n,a.affectsData)}break;case"split":var r=e.splitPosition.parent;this._isInInsertedElement(r)||this._markRemove(r,e.splitPosition.offset,e.howMany),this._isInInsertedElement(e.insertionPosition.parent)||this._markInsert(e.insertionPosition.parent,e.insertionPosition.offset,1),e.graveyardPosition&&this._markRemove(e.graveyardPosition.parent,e.graveyardPosition.offset,1);break;case"merge":o=e.sourcePosition.parent;this._isInInsertedElement(o.parent)||this._markRemove(o.parent,o.startOffset,1);r=e.graveyardPosition.parent;this._markInsert(r,e.graveyardPosition.offset,1);r=e.targetPosition.parent;this._isInInsertedElement(r)||this._markInsert(r,e.targetPosition.offset,o.maxOffset)}this._cachedChanges=null}bufferMarkerChange(e,t,i,o){const n=this._changedMarkers.get(e);n?(n.newRange=i,n.affectsData=o,null==n.oldRange&&null==n.newRange&&this._changedMarkers.delete(e)):this._changedMarkers.set(e,{oldRange:t,newRange:i,affectsData:o})}getMarkersToRemove(){const e=[];for(var[t,i]of this._changedMarkers)null!=i.oldRange&&e.push({name:t,range:i.oldRange});return e}getMarkersToAdd(){const e=[];for(var[t,i]of this._changedMarkers)null!=i.newRange&&e.push({name:t,range:i.newRange});return e}getChangedMarkers(){return Array.from(this._changedMarkers).map(e=>({name:e[0],data:{oldRange:e[1].oldRange,newRange:e[1].newRange}}))}hasDataChanges(){for(var[,e]of this._changedMarkers)if(e.affectsData)return!0;return 0<this._changesInElement.size}getChanges(e={includeChangesInGraveyard:!1}){if(this._cachedChanges)return(e.includeChangesInGraveyard?this._cachedChangesWithGraveyard:this._cachedChanges).slice();let o=[];for(const u of this._changesInElement.keys()){var n=this._changesInElement.get(u).sort((e,t)=>
5e.offset===t.offset?e.type!=t.type?"remove"==e.type?-1:1:0:e.offset<t.offset?-1:1),r=this._elementSnapshots.get(u),s=Ka(u.getChildren());let t=0,i=0;for(const g of function(t,e){const i=[];let o=0,n=0;for(const r of e){if(r.offset>o){for(let e=0;e<r.offset-o;e++)i.push("e");n+=r.offset-o}if("insert"==r.type){for(let e=0;e<r.howMany;e++)i.push("i");o=r.offset+r.howMany}else if("remove"==r.type){for(let e=0;e<r.howMany;e++)i.push("r");o=r.offset,n+=r.howMany}else i.push(..."a".repeat(r.howMany).split("")),o=r.offset+r.howMany,n+=r.howMany}if(n<t)for(let e=0;e<t-n-o;e++)i.push("e");return i}(r.length,n))if("i"===g)o.push(this._getInsertDiff(u,t,s[t].name)),t++;else if("r"===g)o.push(this._getRemoveDiff(u,t,r[i].name)),i++;else if("a"===g){var a,l=s[t].attributes,c=r[i].attributes;let e;e="$text"==s[t].name?new ys(ks._createAt(u,t),ks._createAt(u,t+1)):(a=u.offsetToIndex(t),new ys(ks._createAt(u,t),ks._createAt(u.getChild(a),0))),o.push(...this._getAttributesDiff(e,c,l)),t++,i++}else t++,i++}o.sort((e,t)=>e.position.root!=t.position.root?e.position.root.rootName<t.position.root.rootName?-1:1:e.position.isEqual(t.position)?e.changeCount-t.changeCount:e.position.isBefore(t.position)?-1:1);for(let e=1,t=0;e<o.length;e++){const m=o[t];var i=o[e],d="remove"==m.type&&"remove"==i.type&&"$text"==m.name&&"$text"==i.name&&m.position.isEqual(i.position),h="insert"==m.type&&"insert"==i.type&&"$text"==m.name&&"$text"==i.name&&m.position.parent==i.position.parent&&m.position.offset+m.length==i.position.offset,i="attribute"==m.type&&"attribute"==i.type&&m.position.parent==i.position.parent&&m.range.isFlat&&i.range.isFlat&&m.position.offset+m.length==i.position.offset&&m.attributeKey==i.attributeKey&&m.attributeOldValue==i.attributeOldValue&&m.attributeNewValue==i.attributeNewValue;d||h||i?(m.length++,i&&(m.range.end=m.range.end.getShiftedBy(1)),o[e]=null):t=e}o=o.filter(e=>e);for(const t of o)delete t.changeCount,"attribute"==t.type&&(delete t.position,delete t.length);return this._changeCount=0,this._cachedChangesWithGraveyard=o.slice(),this._cachedChanges=o.filter(Ga),e.includeChangesInGraveyard?this._cachedChangesWithGraveyard:this._cachedChanges}reset(){this._changesInElement.clear(),this._elementSnapshots.clear(),this._changedMarkers.clear(),this._cachedChanges=null}_markInsert(e,t,i){i={type:"insert",offset:t,howMany:i,count:this._changeCount++};this._markChange(e,i)}_markRemove(e,t,i){var o={type:"remove",offset:t,howMany:i,count:this._changeCount++};this._markChange(e,o),this._removeAllNestedChanges(e,t,i)}_markAttribute(e){var t={type:"attribute",offset:e.startOffset,howMany:e.offsetSize,count:this._changeCount++};this._markChange(e.parent,t)}_markChange(e,t){this._makeSnapshot(e);const i=this._getChangesForElement(e);this._handleChange(t,i),i.push(t);for(let e=0;e<i.length;e++)i[e].howMany<1&&(i.splice(e,1),e--)}_getChangesForElement(e){let t;return this._changesInElement.has(e)?t=this._changesInElement.get(e):(t=[],this._changesInElement.set(e,t)),t}_makeSnapshot(e){this._elementSnapshots.has(e)||this._elementSnapshots.set(e,Ka(e.getChildren()))}_handleChange(e,t){e.nodesToHandle=e.howMany;for(const l of t){var i,o,n,r,s=e.offset+e.howMany,a=l.offset+l.howMany;"insert"==e.type&&("insert"==l.type&&(e.offset<=l.offset?l.offset+=e.howMany:e.offset<a&&(l.howMany+=e.nodesToHandle,e.nodesToHandle=0)),"remove"==l.type&&e.offset<l.offset&&(l.offset+=e.howMany),"attribute"==l.type&&(e.offset<=l.offset?l.offset+=e.howMany:e.offset<a&&(i=l.howMany,l.howMany=e.offset-l.offset,t.unshift({type:"attribute",offset:s,howMany:i-l.howMany,count:this._changeCount++})))),"remove"==e.type&&("insert"==l.type&&(s<=l.offset?l.offset-=e.howMany:s<=a?e.offset<l.offset?(o=s-l.offset,l.offset=e.offset,l.howMany-=o,e.nodesToHandle-=o):(l.howMany-=e.nodesToHandle,e.nodesToHandle=0):e.offset<=l.offset?(e.nodesToHandle-=l.howMany,l.howMany=0):e.offset<a&&(o=a-e.offset,l.howMany-=o,e.nodesToHandle-=o)),"remove"==l.type&&(s<=l.offset?l.offset-=e.howMany:e.offset<l.offset&&(e.nodesToHandle+=l.howMany,l.howMany=0)),"attribute"==l.type&&(s<=l.offset?l.offset-=e.howMany:e.offset<l.offset?(n=s-l.offset,l.offset=e.offset,l.howMany-=n):e.offset<a&&(s<=a?(n=l.howMany,l.howMany=e.offset-l.offset,n=n-l.howMany-e.n
5odesToHandle,t.unshift({type:"attribute",offset:e.offset,howMany:n,count:this._changeCount++})):l.howMany-=a-e.offset))),"attribute"==e.type&&("insert"==l.type&&(e.offset<l.offset&&s>l.offset?(a<s&&(r={type:"attribute",offset:a,howMany:s-a,count:this._changeCount++},this._handleChange(r,t),t.push(r)),e.nodesToHandle=l.offset-e.offset,e.howMany=e.nodesToHandle):e.offset>=l.offset&&e.offset<a&&(a<s?(e.nodesToHandle=s-a,e.offset=a):e.nodesToHandle=0)),"remove"==l.type&&e.offset<l.offset&&s>l.offset&&(r={type:"attribute",offset:l.offset,howMany:s-l.offset,count:this._changeCount++},this._handleChange(r,t),t.push(r),e.nodesToHandle=l.offset-e.offset,e.howMany=e.nodesToHandle),"attribute"==l.type&&(e.offset>=l.offset&&s<=a?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=l.offset&&a<=s&&(l.howMany=0)))}e.howMany=e.nodesToHandle,delete e.nodesToHandle}_getInsertDiff(e,t,i){return{type:"insert",position:ks._createAt(e,t),name:i,length:1,changeCount:this._changeCount++}}_getRemoveDiff(e,t,i){return{type:"remove",position:ks._createAt(e,t),name:i,length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,i){const o=[];i=new Map(i);for(var[n,r]of t){var s=i.has(n)?i.get(n):null;s!==r&&o.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:n,attributeOldValue:r,attributeNewValue:s,changeCount:this._changeCount++}),i.delete(n)}for(var[a,l]of i)o.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:a,attributeOldValue:null,attributeNewValue:l,changeCount:this._changeCount++});return o}_isInInsertedElement(e){var t=e.parent;if(!t)return!1;var i=this._changesInElement.get(t),o=e.startOffset;if(i)for(const n of i)if("insert"==n.type&&o>=n.offset&&o<n.offset+n.howMany)return!0;return this._isInInsertedElement(t)}_removeAllNestedChanges(e,t,i){const o=new ys(ks._createAt(e,t),ks._createAt(e,t+i));for(const n of o.getItems({shallow:!0}))n.is("element")&&(this._elementSnapshots.delete(n),this._changesInElement.delete(n),this._removeAllNestedChanges(n,0,n.maxOffset))}}function Ka(e){const t=[];for(const i of e)if(i.is("$text"))for(let e=0;e<i.data.length;e++)t.push({name:"$text",attributes:new Map(i.getAttributes())});else t.push({name:i.name,attributes:new Map(i.getAttributes())});return t}function Ga(e){var t=e.position&&"$graveyard"==e.position.root.rootName,e=e.range&&"$graveyard"==e.range.root.rootName;return!t&&!e}class Ja{constructor(){this._operations=[],this._undoPairs=new Map,this._undoneOperations=new Set}addOperation(e){this._operations.includes(e)||this._operations.push(e)}getOperations(e=Number.NEGATIVE_INFINITY,t=Number.POSITIVE_INFINITY){const i=[];for(const o of this._operations)o.baseVersion>=e&&o.baseVersion<t&&i.push(o);return i}getOperation(e){for(const t of this._operations)if(t.baseVersion==e)return t}setOperationAsUndone(e,t){this._undoPairs.set(t,e),this._undoneOperations.add(e)}isUndoingOperation(e){return this._undoPairs.has(e)}isUndoneOperation(e){return this._undoneOperations.has(e)}getUndoneOperation(e){return this._undoPairs.get(e)}}function Ya(e,t){return!!(i=e.charAt(t-1))&&1==i.length&&/[\ud800-\udbff]/.test(i)&&(!!(t=e.charAt(t))&&1==t.length&&/[\udc00-\udfff]/.test(t));var i}function Xa(e,t){return!!(t=e.charAt(t))&&1==t.length&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(t)}const Qa="$graveyard";class Za{constructor(e){this.model=e,this.version=0,this.history=new Ja(this),this.selection=new Ms(this),this.roots=new Jt({idProperty:"rootName"}),this.differ=new Ua(e.markers),this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root",Qa),this.listenTo(e,"applyOperation",(e,t)=>{t=t[0];if(t.isDocumentOperation&&t.baseVersion!==this.version)throw new Bt.a("model-document-applyoperation-wrong-version",this,{operation:t})},{priority:"highest"}),this.listenTo(e,"applyOperation",(e,t)=>{t=t[0];t.isDocumentOperation&&this.differ.bufferOperation(t)},{priority:"high"}),this.listenTo(e,"applyOperation",(e,t)=>{t=t[0];t.isDocumentOperation&&(this.version++,this.history.addOperation(t))},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(e.markers,"update",(e,i,t,o)=>{this.differ.bufferMarkerChange(i.name,t,o,i.affectsData),null===t&&i.on("change",(e,t)=>{this.differ.bufferMarkerChange(i.name,t,i.getRange(),i.affectsData)})})}get graveyard(){return this.getRoot(Qa)}
5createRoot(e="$root",t="main"){if(this.roots.get(t))throw new Bt.a("model-document-createroot-name-exists",this,{name:t});t=new La(this,e,t);return this.roots.add(t),t}destroy(){this.selection.destroy(),this.stopListening()}getRoot(e="main"){return this.roots.get(e)}getRootNames(){return Array.from(this.roots,e=>e.rootName).filter(e=>e!=Qa)}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=ni(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}_handleChangeBlock(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const e of this.roots)if(e!==this.graveyard)return e;return this.graveyard}_getDefaultRange(){var e=this._getDefaultRoot();const t=this.model,i=t.schema;e=t.createPositionFromPath(e,[0]);return i.getNearestSelectionRange(e)||t.createRange(e)}_validateSelectionRange(e){return el(e.start)&&el(e.end)}_callPostFixers(e){let t=!1;do{for(const i of this._postFixers)if(this.selection.refresh(),t=i(e),t)break}while(t)}}function el(e){var t=e.textNode;if(t){var i=t.data,t=e.offset-t.startOffset;return!Ya(i,t)&&!Xa(i,t)}return!0}Gt(Za,Lt);class tl{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(e){return this._markers.has(e)}get(e){return this._markers.get(e)||null}_set(e,t,i=!1,o=!1){const n=e instanceof il?e.name:e;if(n.includes(","))throw new Bt.a("markercollection-incorrect-marker-name",this);const r=this._markers.get(n);if(r){const s=r.getRange();let e=!1;return s.isEqual(t)||(r._attachLiveRange(Os.fromRange(t)),e=!0),i!=r.managedUsingOperations&&(r._managedUsingOperations=i,e=!0),"boolean"==typeof o&&o!=r.affectsData&&(r._affectsData=o,e=!0),e&&this.fire("update:"+n,r,s,t),r}e=Os.fromRange(t),o=new il(n,e,i,o);return this._markers.set(n,o),this.fire("update:"+n,o,null,t),o}_remove(e){e=e instanceof il?e.name:e;const t=this._markers.get(e);return!!t&&(this._markers.delete(e),this.fire("update:"+e,t,t.getRange(),null),this._destroyMarker(t),!0)}_refresh(e){var t=e instanceof il?e.name:e;const i=this._markers.get(t);if(!i)throw new Bt.a("markercollection-refresh-marker-not-exists",this);e=i.getRange();this.fire("update:"+t,i,e,e,i.managedUsingOperations,i.affectsData)}*getMarkersAtPosition(e){for(const t of this)t.getRange().containsPosition(e)&&(yield t)}*getMarkersIntersectingRange(e){for(const t of this)null!==t.getRange().getIntersection(e)&&(yield t)}destroy(){for(const e of this._markers.values())this._destroyMarker(e);this._markers=null,this.stopListening()}*getMarkersGroup(e){for(const t of this._markers.values())t.name.startsWith(e+":")&&(yield t)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}}Gt(tl,Lt);class il{constructor(e,t,i,o){this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=i,this._affectsData=o}get managedUsingOperations(){if(!this._liveRange)throw new Bt.a("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new Bt.a("marker-destroyed",this);return this._affectsData}getStart(){if(!this._liveRange)throw new Bt.a("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new Bt.a("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new Bt.a("marker-destroyed",this);return this._liveRange.toRange()}is(e){return"marker"===e||"model:marker"===e}_attachLiveRange(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}Gt(il,Lt);class ol extends _a{get type(){return"noop"}clone(){return new ol(this.baseVersion)}getReversed(){return new ol(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}const nl={};nl[Ra.className]=Ra,nl[Ma.className]=Ma,nl[Na.className]=Na,nl[Va.className]=Va,nl[ol.className]=ol,nl[_a.className]=_a,nl[za.className]=za,nl[Ba.className]=Ba,nl[Da.className]=Da,nl[Fa.className]=Fa;class rl extends ks{constructor(e,t,i="toNone"){if(super(e,t,i),!this.root.is("rootElement"))throw new Bt.a("model-liveposition-root-not-rootelement",e);!function(){this.listenTo(this.root.document.model,"applyOperation",(e,t)=>{t=t[0];t.isDocumentOperation&&!function(e){var t=this.getTransformedByOperation(e);this.isEqual(t)||(e=this.toPosition(),this.path=t.path,this.root=t.root,this.fire("change",e))}.call(this,t)},{priority:"low"})}.call(this)}detach(){this.stopListening()}is(e){return"livePosition"===e||"model:livePosition"===e||"position"==e||"model:position"===e}toPosition(){return new ks(this.root,this.path.slice(),this.stickiness)}static fromPosition(e,t){return new this(e.root,e.path.slice(),t||e.stickiness)}}Gt(rl,Lt);class sl{constructor(e,t,i){this.model=e,this.writer=t,this.position=i,this.canMergeWith=new Set([this.position.parent]),this.schema=e.schema,this._documentFragment=t.createDocumentFragment(),this._documentFragmentPosition=t.createPositionAt(this._documentFragment,0),this._firstNode=null,this._lastNode=null,this._lastAutoParagraph=null,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null}handleNodes(e){for(const t of Array.from(e))this._handleNode(t);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesOf,this.writer),this._filterAttributesOf=[]}_updateLastNodeFromAutoParagraph(e){var t=this.writer.createPositionAfter(this._lastNode);const i=this.writer.createPositionAfter(e);if(i.isAfter(t)){if(this._lastNode=e,this.position.parent!=e||!this.position.isAt
5End)throw new Bt.a("insertcontent-invalid-insertion-position",this);this.position=i,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this.nodeToSelect?ys._createOn(this.nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new ys(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(e){this.schema.isObject(e)?this._handleObject(e):this._checkAndAutoParagraphToAllowedPosition(e)||this._checkAndSplitToAllowedPosition(e)?(this._appendToFragment(e),this._firstNode||(this._firstNode=e),this._lastNode=e):this._handleDisallowedNode(e)}_insertPartialFragment(){if(!this._documentFragment.isEmpty){const e=rl.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=e.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=e.toPosition(),e.detach()}}_handleObject(e){this._checkAndSplitToAllowedPosition(e)?this._appendToFragment(e):this._tryAutoparagraphing(e)}_handleDisallowedNode(e){e.is("element")?this.handleNodes(e.getChildren()):this._tryAutoparagraphing(e)}_appendToFragment(e){if(!this.schema.checkChild(this.position,e))throw new Bt.a("insertcontent-wrong-position",this,{node:e,position:this.position});this.writer.insert(e,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(e.offsetSize),this.schema.isObject(e)&&!this.schema.checkChild(this.position,"$text")?this.nodeToSelect=e:this.nodeToSelect=null,this._filterAttributesOf.push(e)}_setAffectedBoundaries(e){this._affectedStart||(this._affectedStart=rl.fromPosition(e,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(e)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=rl.fromPosition(e,"toNext"))}_mergeOnLeft(){var e=this._firstNode;if(e instanceof fs&&this._canMergeLeft(e)){const t=rl._createBefore(e);t.stickiness="toNext";const i=rl.fromPosition(this.position,"toNext");this._affectedStart.isEqual(t)&&(this._affectedStart.detach(),this._affectedStart=rl._createAt(t.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=rl._createAt(t.nodeBefore,"end","toNext")),this.position=i.toPosition(),i.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}}_mergeOnRight(){var e=this._lastNode;if(e instanceof fs&&this._canMergeRight(e)){const t=rl._createAfter(e);if(t.stickiness="toNext",!this.position.isEqual(t))throw new Bt.a("insertcontent-invalid-insertion-position",this);this.position=ks._createAt(t.nodeBefore,"end");const i=rl.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(t)&&(this._affectedEnd.detach(),this._affectedEnd=rl._createAt(t.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=rl._createAt(t.nodeBefore,0,"toPrevious")),this.position=i.toPosition(),i.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}}_canMergeLeft(e){var t=e.previousSibling;return t instanceof fs&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(t,e)}_canMergeRight(e){var t=e.nextSibling;return t instanceof fs&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(e,t)}_tryAutoparagraphing(e){const t=this.writer.createElement("paragraph");this._getAllowedIn(this.position.parent,t)&&this.schema.checkChild(t,e)&&(t._appendChild(e),this._handleNode(t))}_checkAndAutoParagraphToAllowedPosition(e){if(this.schema.checkChild(this.position.parent,e))return!0;
5if(!this.schema.checkChild(this.position.parent,"paragraph")||!this.schema.checkChild("paragraph",e))return!1;this._insertPartialFragment();e=this.writer.createElement("paragraph");return this.writer.insert(e,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=e,this.position=this.writer.createPositionAt(e,0),!0}_checkAndSplitToAllowedPosition(e){var t,i=this._getAllowedIn(this.position.parent,e);if(!i)return!1;for(i!=this.position.parent&&this._insertPartialFragment();i!=this.position.parent;)this.position.isAtStart?(t=this.position.parent,this.position=this.writer.createPositionBefore(t),t.isEmpty&&t.parent===i&&this.writer.remove(t)):this.position.isAtEnd?this.position=this.writer.createPositionAfter(this.position.parent):(t=this.writer.createPositionAfter(this.position.parent),this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=t,this.canMergeWith.add(this.position.nodeAfter));return!0}_getAllowedIn(e,t){return this.schema.checkChild(e,t)?e:this.schema.isLimit(e)?null:this._getAllowedIn(e.parent,t)}}function al(e,s,a={}){if(!s.isCollapsed){const l=s.getFirstRange();if("$graveyard"!=l.root.rootName){const c=e.schema;e.change(e=>{if(!a.doNotResetEntireContent&&function(e,t){var i=e.getLimitElement(t);if(!t.containsEntireContent(i))return!1;t=t.getFirstRange();return t.start.parent!=t.end.parent&&e.checkChild(i,"paragraph")}(c,s))return t=e,o=s,c,i=t.model.schema.getLimitElement(o),t.remove(t.createRangeIn(i)),void dl(t,t.createPositionAt(i,0),o);var t,i,o;const[n,r]=function(e){const t=e.root.document.model,i=e.start;let o=e.end;if(t.hasContent(e,{ignoreMarkers:!0})){var n=function(e){const t=e.parent,i=t.root.document.model.schema,o=t.getAncestors({parentFirst:!0,includeSelf:!0});for(const t of o){if(i.isLimit(t))return null;if(i.isBlock(t))return t}}(o);if(n&&o.isTouching(t.createPositionAt(n,0))){const r=t.createSelection(e);t.modifySelection(r,{direction:"backward"});n=r.getLastPosition(),e=t.createRange(n,o);t.hasContent(e,{ignoreMarkers:!0})||(o=n)}}return[rl.fromPosition(i,"toPrevious"),rl.fromPosition(o,"toNext")]}(l);n.isTouching(r)||e.remove(e.createRange(n,r)),a.leaveUnmerged||(function(e,t,i){const o=e.model;var n,r;cl(e.model.schema,t,i)&&([n,r]=function(e,t){var i=e.getAncestors(),o=t.getAncestors();let n=0;for(;i[n]&&i[n]==o[n];)n++;return[i[n],o[n]]}(t,i),n&&r&&(!o.hasContent(n,{ignoreMarkers:!0})&&o.hasContent(r,{ignoreMarkers:!0})?function e(t,i,o,n){const r=i.parent;const s=o.parent;if(r==n||s==n)return;i=t.createPositionAfter(r);o=t.createPositionBefore(s);o.isEqual(i)||t.insert(r,o);for(;i.parent.isEmpty;){const a=i.parent;i=t.createPositionBefore(a),t.remove(a)}o=t.createPositionBefore(s);ll(t,o);if(!cl(t.model.schema,i,o))return;e(t,i,o,n)}:function e(t,i,o,n){const r=i.parent;const s=o.parent;if(r==n||s==n)return;i=t.createPositionAfter(r);o=t.createPositionBefore(s);o.isEqual(i)||t.insert(s,i);t.merge(i);for(;o.parent.isEmpty;){const a=o.parent;o=t.createPositionBefore(a),t.remove(a)}if(!cl(t.model.schema,i,o))return;e(t,i,o,n)})(e,t,i,n.parent))}(e,n,r),c.removeDisallowedAttributes(n.parent.getChildren(),e)),hl(e,s,n),a.doNotAutoparagraph||(t=c,i=n,o=t.checkChild(i,"$text"),i=t.checkChild(i,"paragraph"),o||!i)||dl(e,n,s),n.detach(),r.detach()})}}}function ll(e,t){var i=t.nodeBefore;const o=t.nodeAfter;i.name!=o.name&&e.rename(i,o.name),e.clearAttributes(i),e.setAttributes(Object.fromEntries(o.getAttributes()),i),e.merge(t)}function cl(e,t,i){var o=t.parent,n=i.parent;return o!=n&&(!e.isLimit(o)&&!e.isLimit(n)&&function(e,t,i){const o=new ys(e,t);for(const n of o.getWalker())if(i.isLimit(n.item))return!1;return!0}(t,i,e))}function dl(e,t,i){var o=e.createElement("paragraph");e.insert(o,t),hl(e,i,e.createPositionAt(o,0))}function hl(e,t,i){t instanceof Ms?e.setSelection(i):t.setTo(i)}const ul=' ,.?!:;"-()';function gl(e,t,i={}){var o,n=e.schema,r="backward"!=i.direction,s=i.unit||"character",a=t.focus;const l=new ps({boundaries:(o=r,a=(i=a).root,a=ks._createAt(a,o?"end":0),o?new ys(i,a):new ys(a,i)),singleCharacters:!0,direction:r?"forward":"backward"});for(var c,d={walker:l,schema:n,isForward:r,unit:s};c=l.next();){if(c.done)return;const h=function(e,t){const{isForward:i,walker:o,unit:n,schema:r}=e,{type:s,item:a,nextPosition:l}=t;if("text"==s)return"word"===e.unit?function(t,i){let o=t.position.textNode;if(o){let e=t.position.offset-o.startOffset;for(;!function(e,t,i){i=t+(i?0:-1);return ul.includes(e.charAt(i))}(o.data,e,i)&&!function(e,t,i){return t===(i?e.endOffset:0)}(o,e,i);){t.next();const r=i?t.position.nodeAfter:t.position.nodeBefore;var n;r&&r.is("$text")&&(n=r.data.charAt(i?0:r.data.length-1),ul.includes(n)||(t.next(),o=t.position.textNode)),e=t.position.offset-o.startOffset}}return t.position}(o,i):function(t,i){var o=t.position.textNode;if(o){var n=o.data;let e=t.position.offset-o.startOffset;for(;Ya(n,e)||"character"==i&&Xa(n,e);)t.next(),e=t.position.offset-o.startOffset}return t.position}(o,n);{if(s==(i?"elementStart":"elementEnd"))return r.isSelectable(a)?ks._createAt(a,i?"after":"before"):r.checkChild(l,"$text")?l:void 0;if(!r.isLimit(a))return r.checkChild(l,"$text")?l:void 0;o.skip(()=>!0)}}(d,c.value);if(h)return void(t instanceof Ms?e.change(e=>{e.setSelectionFocus(h)}
5):t.setFocus(h))}}function ml(t,o){const i=[];Array.from(t.getItems({direction:"backward"})).map(e=>o.createRangeOn(e)).filter(e=>{return(e.start.isAfter(t.start)||e.start.isEqual(t.start))&&(e.end.isBefore(t.end)||e.end.isEqual(t.end))}).forEach(e=>{i.push(e.start.parent),o.remove(e)}),i.forEach(e=>{let t=e;for(;t.parent&&t.isEmpty;){var i=o.createRangeOn(t);t=t.parent,o.remove(i)}})}function fl(t){t.document.registerPostFixer(e=>function(e,t){const i=t.document.selection,o=t.schema,n=[];let r=!1;for(const s of i.getRanges()){const a=function(e,t){if(e.isCollapsed)return function(e,t){const i=e.start,o=t.getNearestSelectionRange(i);if(!o)return null;if(!o.isCollapsed)return o;t=o.start;if(i.isEqual(t))return null;return new ys(t)}(e,t);return function(e,i){const{start:o,end:n}=e,t=i.checkChild(o,"$text"),r=i.checkChild(n,"$text"),s=i.getLimitElement(o),a=i.getLimitElement(n);if(s===a){if(t&&r)return null;if(function(e,t,i){e=e.nodeAfter&&!i.isLimit(e.nodeAfter)||i.checkChild(e,"$text"),t=t.nodeBefore&&!i.isLimit(t.nodeBefore)||i.checkChild(t,"$text");return e||t}(o,n,i)){var l=o.nodeAfter&&i.isSelectable(o.nodeAfter)?null:i.getNearestSelectionRange(o,"forward"),c=n.nodeBefore&&i.isSelectable(n.nodeBefore)?null:i.getNearestSelectionRange(n,"backward"),d=l?l.start:o,l=c?c.end:n;return new ys(d,l)}}c=s&&!s.is("rootElement"),d=a&&!a.is("rootElement");if(c||d){l=o.nodeAfter&&n.nodeBefore&&o.nodeAfter.parent===n.nodeBefore.parent,c=c&&(!l||!bl(o.nodeAfter,i)),l=d&&(!l||!bl(n.nodeBefore,i));let e=o,t=n;return c&&(e=ks._createBefore(pl(s,i))),l&&(t=ks._createAfter(pl(a,i))),new ys(e,t)}return null}(e,t)}(s,o);a&&!a.isEqual(s)?(n.push(a),r=!0):n.push(s)}r&&e.setSelection(function(e){const t=[];t.push(e.shift());for(const n of e){const r=t.pop();var i,o;n.isEqual(r)?t.push(r):n.isIntersecting(r)?(i=(r.start.isAfter(n.start)?n:r).start,o=(r.end.isAfter(n.end)?r:n).end,o=new ys(i,o),t.push(o)):(t.push(r),t.push(n))}return t}(n),{backward:i.isBackward})}(e,t))}function pl(e,t){let i=e,o=i;for(;t.isLimit(o)&&o.parent;)i=o,o=o.parent;return i}function bl(e,t){return e&&t.isSelectable(e)}class kl{constructor(){this.markers=new tl,this.document=new Za(this),this.schema=new la,this._pendingChanges=[],this._currentWriter=null,["insertContent","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(e=>this.decorate(e)),this.on("applyOperation",(e,t)=>{const i=t[0];i._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$block",{allowIn:"$root",isBlock:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck((e,t)=>{if("$marker"===t.name)return!0}),fl(this),this.document.registerPostFixer(Ks)}change(e){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new va,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(e){Bt.a.rethrowUnexpectedError(e,this)}}enqueueChange(e,t){try{"string"==typeof e?e=new va(e):"function"==typeof e&&(t=e,e=new va),this._pendingChanges.push({batch:e,callback:t}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(e){Bt.a.rethrowUnexpectedError(e,this)}}applyOperation(e){e._execute()}insertContent(e,t,i){return s=e,a=t,l=i,(r=this).change(e=>{let t;t=a?a instanceof Ps||a instanceof Ms?a:e.createSelection(a,l):r.document.selection,t.isCollapsed||r.deleteContent(t,{doNotAutoparagraph:!0});const i=new sl(r,e,t.anchor);let o;o=s.is("documentFragment")?s.getChildren():[s],i.handleNodes(o);var n=i.getSelectionRange();n&&(t instanceof Ms?e.setSelection(n):t.setTo(n));n=i.getAffectedRange()||r.createRange(t.anchor);return i.destroy(),n});var r,s,a,l}deleteContent(e,t){al(this,e,t)}modifySelection(e,t){gl(this,e,t)}getSelectedContent(e){return l=e,this.change(e=>{var t=e.createDocumentFragment();const i=l.getFirstRange();if(!i||i.isCollapsed)return t;const o=i.start.root;var n=i.start.getCommonPath(i.end),r=o.getNodeByPath(n);let s;s=i.start.parent==i.end.parent?i:e.createRange(e.createPositionAt(r,i.start.path[n.length]),e.createPositionAt(r,i.end.path[n.length]+1));r=s.end.offset-s.start.offset;for(const a of s.getItems({shallow:!0}))a.is("$textProxy")?e.appendText(a.data,a.getAttributes(),t):e.append(e.cloneElement(a,!0),t);return s!=i&&(n=i._getTransformedByMove(s.start,e.createPositionAt(t,0),r)[0],r=e.createRange(e.createPositionAt(t,0),n.start),ml(e.createRange(n.end,e.createPositionAt(t,"end")),e),ml(r,e)),t});var l}
5hasContent(e,t={}){const i=e instanceof fs?ys._createIn(e):e;if(i.isCollapsed)return!1;var{ignoreWhitespaces:o=!1,ignoreMarkers:t=!1}=t;if(!t)for(const n of this.markers.getMarkersIntersectingRange(i))if(n.affectsData)return!0;for(const r of i.getItems())if(this.schema.isContent(r)){if(!r.is("$textProxy"))return!0;if(!o)return!0;if(-1!==r.data.search(/\S/))return!0}return!1}createPositionFromPath(e,t,i){return new ks(e,t,i)}createPositionAt(e,t){return ks._createAt(e,t)}createPositionAfter(e){return ks._createAfter(e)}createPositionBefore(e){return ks._createBefore(e)}createRange(e,t){return new ys(e,t)}createRangeIn(e){return ys._createIn(e)}createRangeOn(e){return ys._createOn(e)}createSelection(e,t,i){return new Ps(e,t,i)}createBatch(e){return new va(e)}createOperationFromJSON(e){return class{static fromJSON(e,t){return nl[e.__className].fromJSON(e,t)}}.fromJSON(e,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const e=[];for(this.fire("_beforeChanges");this._pendingChanges.length;){var t=this._pendingChanges[0].batch;this._currentWriter=new Ha(this,t);t=this._pendingChanges[0].callback(this._currentWriter);e.push(t),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return this.fire("_afterChanges"),e}}Gt(kl,fo);class wl extends Qr{constructor(e){super(),this.editor=e}set(e,t,i={}){if("string"==typeof t){const o=t;t=(e,t)=>{this.editor.execute(o),t()}}super.set(e,t,i)}}class vl{constructor(e={}){this._context=e.context||new ii({language:e.language}),this._context._addEditor(this,!e.context);var t=Array.from(this.constructor.builtinPlugins||[]);this.config=new St(e,this.constructor.defaultConfig),this.config.define("plugins",t),this.config.define(this._context._getEditorConfig()),this.plugins=new Yt(this,t,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this.commands=new ra,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.set("isReadOnly",!1),this.model=new kl;t=new eo;this.data=new pa(this.model,t),this.editing=new na(this.model,t),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new ba([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new wl(this),this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const e=this.config,t=e.get("plugins");var i=e.get("removePlugins")||[],o=e.get("extraPlugins")||[],n=e.get("substitutePlugins")||[];return this.plugins.init(t.concat(o),i,n)}destroy(){let e=Promise.resolve();return"initializing"==this.state&&(e=new Promise(e=>this.once("ready",e))),e.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(...e){try{return this.commands.execute(...e)}catch(e){Bt.a.rethrowUnexpectedError(e,this)}}focus(){this.editing.view.focus()}}Gt(vl,fo);r={setData(e){this.data.set(e)},getData(e){return this.data.get(e)}};class _l{constructor(e){this.editor=e,this._components=new Map}*names(){for(const e of this._components.values())yield e.originalName}add(e,t){this._components.set(yl(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new Bt.a("componentfactory-item-missing",this,{name:e});return this._components.get(yl(e)).callback(this.editor.locale)}has(e){return this._components.has(yl(e))}}function yl(e){return String(e).toLowerCase()}class xl{constructor(e){this.editor=e,this.componentFactory=new _l(e),this.focusTracker=new Xr,this._editableElementsMap=new Map,this.listenTo(e.editing.view.document,"layoutChanged",()=>this.update())}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy();for(const e of this._editableElementsMap.values())e.ckeditorInstance=null;this._editableElementsMap=new Map}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}get _editableElements(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}}function Cl({origin:i,originKeystrokeHandler:e,originFocusTracker:o,toolbar:n,beforeFocus:r,afterBlur:s}){o.add(n.element),e.set("Alt+F10",(e,t)=>{o.isFocused&&!n.focusTracker.isFocused&&(r&&r(),n.focus(),t())}),n.keystrokes.set("Esc",(e,t)=>{n.focusTracker.isFocused&&(i.focus(),s&&s(),t())})}Gt(xl,Lt);i(19);const Al=new WeakMap;function Tl(e){const{view:t,element:i,text:o,isDirectHost:n=!0,keepOnFocus:r=!1}=e,s=t.document;Al.has(s)||(Al.set(s,new Map),s.registerPostFixer(e=>Pl(s,e))),Al.get(s).set(i,{text:o,isDirectHost:n,keepOnFocus:r,hostElement:n?i:null}),t.change(e=>Pl(s,e))}function El(e,t){return t.hasClass("ck-placeholder")&&(e.removeClass("ck-placeholder",t),1)}function Pl(e,t){var i,o,n,r,s,e=Al.get(e);const a=[];let l=!1;for([i,o]of e)o.isDirectHost&&(a.push(i),Sl(t,i,o)&&(l=!0));for([n,r]of e)r.isDirectHost||(s=function(e){if(e.childCount){const t=e.getChild(0);if(t.is("element")&&!t.is("uiElement"))return t}return null}(n))&&(a.includes(s)||(r.hostElement=s,Sl(t,n,r)&&(l=!0)));return l}function Sl(e,t,i){const{text:o,isDirectHost:n,hostElement:r}=i;let s=!1;return r.getAttribute("data-placeholder")!==o&&(e.setAttribute("data-placeholder",o,r),s=!0),(n||1==t.childCount)&&function(e,t){if(e.isAttached()&&!Array.from(e.getChildren()).some(e=>!e.is("uiElement"))){if(t)return 1;t=e.document;if(!t.isFocused)return 1;t=t.selection.anchor;return t&&t.parent!==e}}(r,i.keepOnFocus)?(t=e,!(i=r).hasClass("ck-placeholder")&&(t.addClass("ck-placeholder",i),1)&&(s=!0)):El(e,r)&&(s=!0),s}class Il extends xl{constructor(e,t){super(e),this.view=t,this._wasInited=!1,this._initedEditables={},this.lastFocusedEditableElement=null}init(){const e=this.view;const t=this.editor.editing.view;this._wasInited||(e.render(),this.focusTracker.on("change:focusedElement",(e,t,i)=>{for(const o of this.view.editables)o.element===i&&(this.lastFocusedEditableElement=o.element)}),this.focusTracker.on("change:isFocused",(e,t,i)=>{i||(this.lastFocusedEditableElement=null)}));for(const i of this.view.editables)if(!this._initedEditables[i.name]){this._initedEditables[i.name]=!0;const o=i.element;this.setEditableElement(i.name,o),this.focusTracker.add(o),i.bind("isFocused").to(this.focusTracker,"isFocused",this.focusTracker,"focusedElement",(e,t)=>!!e&&(t===o||this.lastFocusedEditableElement===o)),t.attachDomRoot(o,i.name);t.document.getRoot(i.name);const n=o;n.getAttribute("etestplaceholder");0}this._wasInited||(this._initPlaceholder(),this._initToolbar(),this._wasInited=!0,this.fire("ready"))}destroy(){const e=this.view,t=this.editor.editing.view;for(const i of this.view.editables)t.detachDomRoot(i.name);e.destroy(),super.destroy()}_initToolbar(){const e=this.editor;const t=this.view.toolbar;t.fillFromConfig(e.config.get("toolbar"),this.componentFactory),Cl({origin:e.editing.view,originFocusTracker:this.focusTracker,originKeystrokeHandler:e.keystrokes,toolbar:t})}_initPlaceholder(){}removeEditable(e){var t;(this.editor.editing.view.domRoots?this.editor.editing.view.domRoots.get(e.name):null)&&(this.editor.editing.view.detachDomRoot(e.name),e.unbind("isFocused"),(t=this._editableElementsMap.get(e.name))||(this._editableElementsMap.delete(e.name),this.editor.keystrokes._listener.stopListening(t),this.focusTracker.remove(t),t.ckeditorInstance=null))}}class Rl extends Jt{constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",(e,t,i)=>{this._renderViewIntoCollectionParent(t,i)}),this.on("remove",(e,t)=>{t.element&&this._parentElement&&t.element.remove()}),this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e;for(const t of this)this._renderViewIntoCollectionParent(t)}delegate(...n){if(!n.length||!n.every(e=>"string"==typeof e))throw new Bt.a("ui-viewcollection-delegate-wrong-events",this);return{to:o=>{for(const e of this)for(const t of n)e.delegate(t).to(o);this.on("add",(e,t)=>{for(const i of n)t.delegate(i).to(o)}),this.on("remove",(e,t)=>{for(const i of n)t.stopDelegating(i,o)})}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}}class Ol{constructor(e){Object.assign(this,Dl(Fl(e))),this._isRendered=!1,this._revertData=null}render(){var e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData=Kl(),this._renderNode({node:e,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new Bt.a("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){yield*function*e(t){if(t.children)for(const i of t.children)$l(i)?yield i:ql(i)&&(yield*e(i))}(this)}static bind(o,n){return{to(e,t){return new Ml({eventNameOrFunction:e,attribute:e,observable:o,emitter:n,callback:t})},if(e,t,i){return new Nl({observable:o,emitter:n,attribute:e,valueIfTrue:t,callback:i})}}}static extend(e,t){if(e._isRendered)throw new Bt.a("template-extend-render",[this,e]);!function t(i,o){o.attributes&&(i.attributes||(i.attributes={}),jl(i.attributes,o.attributes));o.eventListeners&&(i.eventListeners||(i.eventListeners={}),jl(i.eventListeners,o.eventListeners));o.text&&i.text.push(...o.text);if(o.children&&o.children.length){if(i.children.length!=o.children.length)throw new Bt.a("ui-template-extend-children-mismatch",i);let e=0;for(const n of o.children)t(i.children[e++],n)}}(e,Dl(Fl(t)))}_renderNode(e){let t;if(t=e.node?this.tag&&this.text:this.tag?this.text:!this.text,t)throw new Bt.a("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t=t||(e.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;var i;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),zl(this.text)?this._bindToObservable({schema:this.text,updater:(i=t,{set(e){i.textContent=e},remove(){i.textContent=""}}),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){let t,i,o,n;if(this.attributes){const r=e.node,s=e.revertData;for(t in this.attributes)if(o=r.getAttribute(t),i=this.attributes[t],s&&(s.attributes[t]=o),n=V(i[0])&&i[0].ns?i[0].ns:null,zl(i)){const a=n?i[0].value:i;s&&Gl(t)&&a.unshift(o),this._bindToObservable({schema:a,updater:function(t,i,o){return{set(e){t.setAttributeNS(o,i,e)},remove(){t.removeAttributeNS(o,i)}}}(r,t,n),data:e})}else"style"==t&&"string"!=typeof i[0]?this._renderStyleAttribute(i[0],e):(s&&o&&Gl(t)&&i.unshift(o),i=i.map(e=>e&&(e.value||e)).reduce((e,t)=>
5e.concat(t),[]).reduce(Hl,""),Wl(i)||r.setAttributeNS(n,t,i))}}_renderStyleAttribute(e,t){const i=t.node;for(const n in e){var o=e[n];zl(o)?this._bindToObservable({schema:[o],updater:function(t,i){return{set(e){t.style[i]=e},remove(){t.style[i]=null}}}(i,n),data:t}):i.style[n]=o}}_renderElementChildren(e){const t=e.node,i=e.intoFragment?document.createDocumentFragment():t;var o=e.isApplying;let n=0;for(const s of this.children)if(Ul(s)){if(!o){s.setParent(t);for(const a of s)i.appendChild(a.element)}}else if($l(s))o||(s.isRendered||s.render(),i.appendChild(s.element));else if(Mn(s))i.appendChild(s);else if(o){const l=e.revertData;var r=Kl();l.children.push(r),s._renderNode({node:i.childNodes[n++],isApplying:!0,revertData:r})}else i.appendChild(s.render());e.intoFragment&&t.appendChild(i)}_setUpListeners(o){if(this.eventListeners)for(const n in this.eventListeners){var e=this.eventListeners[n].map(e=>{var[t,i]=n.split("@");return e.activateDomEventListener(t,i,o)});o.revertData&&o.revertData.bindings.push(e)}}_bindToObservable({schema:t,updater:i,data:o}){const e=o.revertData;Bl(t,i,o);var n=t.filter(e=>!Wl(e)).filter(e=>e.observable).map(e=>e.activateAttributeListener(t,i,o));e&&e.bindings.push(n)}_revertTemplateFromNode(t,i){for(const o of i.bindings)for(const n of o)n();if(i.text)t.textContent=i.text;else{for(const r in i.attributes){var e=i.attributes[r];null===e?t.removeAttribute(r):t.setAttribute(r,e)}for(let e=0;e<i.children.length;++e)this._revertTemplateFromNode(t.childNodes[e],i.children[e])}}}Gt(Ol,Lt);class Vl{constructor(e){Object.assign(this,e)}getValue(e){var t=this.observable[this.attribute];return this.callback?this.callback(t,e):t}activateAttributeListener(e,t,i){const o=()=>Bl(e,t,i);return this.emitter.listenTo(this.observable,"change:"+this.attribute,o),()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,o)}}}class Ml extends Vl{activateDomEventListener(e,i,t){const o=(e,t)=>{i&&!t.target.matches(i)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(t):this.observable.fire(this.eventNameOrFunction,t))};return this.emitter.listenTo(t.node,e,o),()=>{this.emitter.stopListening(t.node,e,o)}}}class Nl extends Vl{getValue(e){return!Wl(super.getValue(e))&&(this.valueIfTrue||!0)}}function zl(e){return!!e&&(e.value&&(e=e.value),Array.isArray(e)?e.some(zl):e instanceof Vl)}function Bl(e,t,{node:i}){let o=(n=i,e.map(e=>e instanceof Vl?e.getValue(n):e));var n;o=1==e.length&&e[0]instanceof Nl?o[0]:o.reduce(Hl,""),Wl(o)?t.remove():t.set(o)}function Fl(e){return Et(e,e=>{if(e&&(e instanceof Vl||ql(e)||$l(e)||Ul(e)))return e})}function Dl(e){var t;if("string"==typeof e?e={text:[e]}:e.text&&((t=e).text=Xt(t.text)),e.on&&(e.eventListeners=function(e){for(const t in e)Ll(e,t);return e}(e.on),delete e.on),!e.text){e.attributes&&function(e){for(const t in e)e[t].value&&(e[t].value=Xt(e[t].value)),Ll(e,t)}(e.attributes);const i=[];if(e.children)if(Ul(e.children))i.push(e.children);
5else for(const o of e.children)ql(o)||$l(o)||Mn(o)?i.push(o):i.push(new Ol(o));e.children=i}return e}function Ll(e,t){e[t]=Xt(e[t])}function Hl(e,t){return Wl(t)?e:Wl(e)?t:`${e} ${t}`}function jl(e,t){for(const i in t)e[i]?e[i].push(...t[i]):e[i]=t[i]}function Wl(e){return!e&&0!==e}function $l(e){return e instanceof Jl}function ql(e){return e instanceof Ol}function Ul(e){return e instanceof Rl}function Kl(){return{children:[],bindings:[],attributes:{}}}function Gl(e){return"class"==e||"style"==e}i(21);class Jl{constructor(i){this.element=null,this.isRendered=!1,this.locale=i,this.t=i&&i.t,this._viewCollections=new Jt,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(e,t)=>{t.locale=i}),this.decorate("render")}get bindTemplate(){return this._bindTemplate||(this._bindTemplate=Ol.bind(this,this))}createCollection(e){e=new Rl(e);return this._viewCollections.add(e),e}registerChild(e){for(const t of e=!Kt(e)?[e]:e)this._unboundChildren.add(t)}deregisterChild(e){for(const t of e=!Kt(e)?[e]:e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new Ol(e)}extendTemplate(e){Ol.extend(this.template,e)}render(){if(this.isRendered)throw new Bt.a("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(e=>e.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}Gt(Jl,Gn),Gt(Jl,fo);class Yl extends Rl{constructor(e,t=[]){super(t),this.locale=e}attachToDom(){this._bodyCollectionContainer=new Ol({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();let e=document.querySelector(".ck-body-wrapper");e||(e=function(e,t,i,o=[]){var n,r=i&&i.xmlns;const s=r?e.createElementNS(r,t):e.createElement(t);for(const a in i)s.setAttribute(a,i[a]);for(n of o=Fr(o)||!Kt(o)?[o]:o)Fr(n)&&(n=e.createTextNode(n)),s.appendChild(n);return s}(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(e)),e.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const e=document.querySelector(".ck-body-wrapper");e&&0==e.childElementCount&&e.remove()}}i(23);class Xl extends Jl{constructor(e){super(e),this.body=new Yl(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}class Ql extends Jl{constructor(e,t,i){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.name=null,this.set("isFocused",!1),this._editableElement=i,this._hasExternalElement=!!this._editableElement,this._editingView=t}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}_updateIsFocusedClasses(){const r=this._editingView;function s(i){r.change(e=>{var t=r.document.getRoot(i.name);e.addClass(i.isFocused?"ck-focused":"ck-blurred",t),e.removeClass(i.isFocused?"ck-blurred":"ck-focused",t)})}(r.isRenderingInProgress?function o(n){r.once("change:isRenderingInProgress",(e,t,i)=>{(i?o:s)(n)})}:s)(this)}}class Zl extends Ql{constructor(e,t,i){super(e,t,i),this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const i=this._editingView,o=this.t;i.change(e=>{var t=i.document.getRoot(this.name);e.setAttribute("aria-label",o("Rich Text Editor, %0",this.name),t)})}}class ec{constructor(t){if(Object.assign(this,t),t.actions&&t.keystrokeHandler)for(const i in t.actions){let e=t.actions[i];"string"==typeof e&&(e=[e]);for(const o of e)t.keystrokeHandler.set(o,(e,t)=>{this[i](),t()})}}get first(){return this.focusables.find(tc)||null}get last(){return this.focusables.filter(tc).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let i=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((e,t)=>{e=e.element===this.focusTracker.focusedElement;return e&&(i=t),e}),i)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(e){e&&e.focus()}_getFocusableItem(e){var t=this.current,i=this.focusables.length;if(!i)return null;if(null===t)return this[1===e?"first":"last"];let o=(t+i+e)%i;do{var n=this.focusables.get(o);if(tc(n))return n}while(o=(o+i+e)%i,o!==t);return null}}function tc(e){return!(!e.focus||"none"==Fn.window.getComputedStyle(e.element).display)}class ic extends Jl{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class oc extends Jl{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}class nc extends Jl{constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",t.to("position",e=>`ck-dropdown__panel_${e}`),t.if("isVisible","ck-dropdown__panel-visible")]},children:this.children,on:{selectstart:t.to(e=>e.preventDefault())}})}focus(){this.children.length&&this.children.first.focus()}focusLast(){if(this.children.length){const e=this.children.last;"function"==typeof e.focusLast?e.focusLast():e.focus()}}}i(25);function rc({element:e,target:t,positions:i,limiter:o,fitInViewport:n}){M(t)&&(t=t()),M(o)&&(o=o());var r,s,s=!(s=e)||!s.parentNode||s.offsetParent===Fn.document.body?null:s.offsetParent,e=ne
5w Wr(e),t=new Wr(t);let a,l;o||n?(r=function(e,t){const{elementRect:i,viewportRect:o}=t,n=i.getArea(),r=function(e,{targetRect:t,elementRect:i,limiterRect:o,viewportRect:n}){const r=[],s=i.getArea();for(const c of e){var a=sc(c,t,i);if(a){var[l,a]=a;let e=0,t=0;if(o)if(n){const d=o.getIntersection(n);d&&(e=d.getIntersectionArea(a))}else e=o.getIntersectionArea(a);n&&(t=n.getIntersectionArea(a));a={positionName:l,positionRect:a,limiterIntersectArea:e,viewportIntersectArea:t};if(e===s)return[a];r.push(a)}}return r}(e,t);if(o){t=ac(r.filter(({viewportIntersectArea:e})=>e===n),n);if(t)return t}return ac(r,n)}(i,{targetRect:t,elementRect:e,limiterRect:o&&new Wr(o).getVisible(),viewportRect:n&&new Wr(Fn.window)}),[l,a]=r||sc(i[0],t,e)):[l,a]=sc(i[0],t,e);let c=lc(a);return s&&(c=([{left:r,top:i},t]=[c,s],e=lc(new Wr(t)),s=Hr(t),r-=e.left,i-=e.top,r+=t.scrollLeft,i+=t.scrollTop,r-=s.left,i-=s.top,{left:r,top:i})),{left:c.left,top:c.top,name:l}}function sc(e,t,i){var o=e(t,i);if(!o)return null;var{left:e,top:t,name:o}=o;return[o,i.clone().moveTo(e,t)]}function ac(e,t){let i=0,o,n;for(var{positionName:r,positionRect:s,limiterIntersectArea:a,viewportIntersectArea:l}of e){if(a===t)return[r,s];a=l**2+a**2;a>i&&(i=a,o=s,n=r)}return o?[n,o]:null}function lc({left:e,top:t}){var{scrollX:i,scrollY:o}=Fn.window;return{left:e+i,top:t+o}}class cc extends Jl{constructor(e,t,i){super(e);const o=this.bindTemplate;this.buttonView=t,this.panelView=i,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class"),this.set("id"),this.set("panelPosition","auto"),this.keystrokes=new Qr,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",o.to("class"),o.if("isEnabled","ck-disabled",e=>!e)],id:o.to("id"),"aria-describedby":o.to("ariaDescribedById")},children:[t,i]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"]}})}render(){super.render(),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.panelView.bind("isVisible").to(this,"isOpen"),this.on("change:isOpen",()=>{this.isOpen&&("auto"===this.panelPosition?this.panelView.position=cc._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions}).name:this.panelView.position=this.panelPosition)}),this.keystrokes.listenTo(this.element);var e=(e,t)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,t())};this.keystrokes.set("arrowdown",(e,t)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,t())}),this.keystrokes.set("arrowright",(e,t)=>{this.isOpen&&t()}),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){var{south:e,north:t,southEast:i,southWest:o,northEast:n,northWest:r,southMiddleEast:s,southMiddleWest:a,northMiddleEast:l,northMiddleWest:c}=cc.defaultPanelPositions;return"rtl"!==this.locale.uiLanguageDirection?[i,o,s,a,e,n,r,l,c,t]:[o,i,a,s,e,r,n,c,l,t]}}cc.defaultPanelPositions={south:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/2,name:"s"}),southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),southMiddleEast:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/4,name:"sme"}),southMiddleWest:(e,t)=>({top:e.bottom,left:e.left-3*(t.width-e.width)/4,name:"smw"}),north:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/2,name:"n"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),northMiddleEast:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/4,name:"nme"}),northMiddleWest:(e,t)=>({top:e.top-t.height,left:e.left-3*(t.width-e.width)/4,name:"nmw"})},cc._getOptimalPosition=rc;i(27);class dc extends Jl{constructor(){super();const e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon"],viewBox:e.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const t=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml"),i=t.querySelector("svg");var e=i.getAttribute("viewBox");for(e&&(this.viewBox=e),this.element.innerHTML="";0<i.childNodes.length;)this.element.appendChild(i.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(e
5=>{e.style.fill=this.fillColor})}}i(29);class hc extends Jl{constructor(e){super(e),this.set("text",""),this.set("position","s");const t=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip",t.to("position",e=>"ck-tooltip_"+e),t.if("text","ck-hidden",e=>!e.trim())]},children:[{tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:t.to("text")}]}]})}}i(31);class uc extends Jl{constructor(e){super(e);const t=this.bindTemplate;e=Nt();this.set("class"),this.set("labelStyle"),this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke"),this.set("label"),this.set("tabindex",-1),this.set("tooltip"),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.tooltipView=this._createTooltipView(),this.labelView=this._createLabelView(e),this.iconView=new dc,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this)),this.setTemplate({tag:"button",attributes:{class:["ck","ck-button",t.to("class"),t.if("isEnabled","ck-disabled",e=>!e),t.if("isVisible","ck-hidden",e=>!e),t.to("isOn",e=>e?"ck-on":"ck-off"),t.if("withText","ck-button_with-text"),t.if("withKeystroke","ck-button_with-keystroke")],type:t.to("type",e=>e||"button"),tabindex:t.to("tabindex"),"aria-labelledby":`ck-editor__aria-label_${e}`,"aria-disabled":t.if("isEnabled",!0,e=>!e),"aria-pressed":t.to("isOn",e=>!!this.isToggleable&&String(e))},children:this.children,on:{mousedown:t.to(e=>{e.preventDefault()}),click:t.to(e=>{this.isEnabled?this.fire("execute"):e.preventDefault()})}})}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.tooltipView),this.children.add(this.labelView),this.withKeystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}_createTooltipView(){const e=new hc;return e.bind("text").to(this,"_tooltipString"),e.bind("position").to(this,"tooltipPosition"),e}_createLabelView(e){const t=new Jl,i=this.bindTemplate;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:i.to("labelStyle"),id:`ck-editor__aria-label_${e}`},children:[{text:this.bindTemplate.to("label")}]}),t}_createKeystrokeView(){const e=new Jl;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",e=>Zo(e))}]}),e}_getTooltipString(e,t,i){return e?"string"==typeof e?e:(i=i&&Zo(i),e instanceof Function?e(t,i):`${t}${i?` (${i})`:""}`):""}}var gc='<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"><path d="M.941 4.523a.75.75 0 1 1 1.06-1.06l3.006 3.005 3.005-3.005a.75.75 0 1 1 1.06 1.06l-3.549 3.55a.75.75 0 0 1-1.168-.136L.941 4.523z"/></svg>';class mc extends uc{constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new dc;return e.content=gc,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}i(33);class fc extends Jl{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new Xr,this.keystrokes=new Qr,this._focusCycler=new ec({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"]},children:this.items})}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class pc extends Jl{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item"]},children:this.children})}focus(){this.children.first.focus()}}class bc extends Jl{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}i(35);class kc extends uc{constructor(e){super(e),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new Jl;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}function wc({emitter:e,activator:n,callback:r,contextElements:s}){e.listenTo(document,"mousedown",(e,t)=>{if(n()){const i="function"==typeof t.composedPath?t.composedPath():[];for(const o of s)if(o.contains(t.target)||i.includes(o))return;r()}})}i(37),i(39);function vc(e,t=mc){const i=new t(e);t=new nc(e),e=new cc(e,i,t);return i.bind("isEnabled").to(e),(i instanceof mc?i:i.arrowView).bind("isOn").to(e,"isOpen"),function(e){e.on("render",()=>{wc({emitter:e,activator:()=>e.isOpen,callback:()=>{e.isOpen=!1},contextElements:[e.element]})})}(t=e),function(t){t.on("execute",e=>{e.source instanceof kc||(t.isOpen=!1)})}(t),function(i){i.keystrokes.set("arrowdown",(e,t)=>{i.isOpen&&(i.panelView.focus(),t())}),i.keystrokes.set("arrowup",(e,t)=>{i.isOpen&&(i.panelView.focusLast(),t())})}(t),e}function _c(e,t){var i=e.locale;const o=i.t,n=e.toolbarView=new zc(i);n.set("ariaLabel",o("Dropdown toolbar")),e.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),t.map(e=>n.items.add(e)),e.panelView.children.add(n),n.items.delegate("execute").to(e)}function yc(e,t){const n=e.locale,i=e.listView=new fc(n);i.items.bindTo(t).using(({type:t,model:i})=>{if("separator"===t)return new bc(n);if("button"===t||"switchbutton"===t){const o=new pc(n);let e;return e=new("button"===t?uc:kc)(n),e.bind(...Object.keys(i)).to(i),e.delegate("execute").to(o),o.children.add(e),o}}),e.panelView.children.add(i),i.items.delegate("execute").to(e)}function xc(e){return Array.isArray(e)?{items:e,removeItems:[]}:e?Object.assign({items:[],removeItems:[]},e):{items:[],removeItems:[]}}var Cc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="9.5" cy="4.5" r="1.5"/><circle cx="9.5" cy="10.5" r="1.5"/><circle cx="9.5" cy="16.5" r="1.5"/></svg>';class Ac{constructor(e){this.editor=e,this.set("isEnabled",!0),this._disableStack=new Set}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",Tc,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",Tc),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}function Tc(e){e.return=!1,e.stop()}Gt(Ac,fo);class Ec{constructor(e){this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",e=>{this.isEnabled||e.stop()},{priority:"high"}),this.listenTo(e,"change:isReadOnly",(e,t,i)=>{i?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",Pc,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",Pc),this.refresh())}execute(){}destroy(){this.stopListening()}}function Pc(e){e.return=!1,e.stop()}Gt(Ec,fo);
5class Sc extends Ec{constructor(e){super(e),this._childCommands=[]}refresh(){}execute(...e){const t=this._getFirstEnabledCommand();return null!=t&&t.execute(e)}registerChildCommand(e){this._childCommands.push(e),e.on("change:isEnabled",()=>this._checkEnabled()),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){return this._childCommands.find(e=>e.isEnabled)}}class Ic{constructor(e){this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}Gt(Ic,fo);O={updateSourceElement(){if(!this.sourceElement)throw new Bt.a("editor-missing-sourceelement",this);Gr(this.sourceElement,this.data.get())}};Symbol.iterator;var Rc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.91 10.54c.26-.23.64-.21.88.03l3.36 3.14 2.23-2.06a.64.64 0 0 1 .87 0l2.52 2.97V4.5H3.2v10.12l3.71-4.08zm10.27-7.51c.6 0 1.09.47 1.09 1.05v11.84c0 .59-.49 1.06-1.09 1.06H2.79c-.6 0-1.09-.47-1.09-1.06V4.08c0-.58.49-1.05 1.1-1.05h14.38zm-5.22 5.56a1.96 1.96 0 1 1 3.4-1.96 1.96 1.96 0 0 1-3.4 1.96z"/></svg>',Oc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.999 2H15a1 1 0 0 1 0 2h-1.004v13a1 1 0 1 1-2 0V4H8.999v13a1 1 0 1 1-2 0v-7A4 4 0 0 1 3 6a4 4 0 0 1 3.999-4z"/></svg>';const Vc={cancel:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.591 10.177 4.243 4.242a1 1 0 0 1-1.415 1.415l-4.242-4.243-4.243 4.243a1 1 0 0 1-1.414-1.415l4.243-4.242L4.52 5.934A1 1 0 0 1 5.934 4.52l4.243 4.243 4.242-4.243a1 1 0 1 1 1.415 1.414l-4.243 4.243z"/></svg>',caption:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 16h9a1 1 0 0 1 0 2H2a1 1 0 0 1 0-2z"/><path d="M17 1a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h14zm0 1.5H3a.5.5 0 0 0-.492.41L2.5 3v9a.5.5 0 0 0 .41.492L3 12.5h14a.5.5 0 0 0 .492-.41L17.5 12V3a.5.5 0 0 0-.41-.492L17 2.5z" fill-opacity=".6"/></svg>',check:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.972 16.615a.997.997 0 0 1-.744-.292l-4.596-4.596a1 1 0 1 1 1.414-1.414l3.926 3.926 9.937-9.937a1 1 0 0 1 1.414 1.415L7.717 16.323a.997.997 0 0 1-.745.292z"/></svg>',cog:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.333 2 .19 2.263a5.899 5.899 0 0 1 1.458.604L14.714 3.4 16.6 5.286l-1.467 1.733c.263.452.468.942.605 1.46L18 8.666v2.666l-2.263.19a5.899 5.899 0 0 1-.604 1.458l1.467 1.733-1.886 1.886-1.733-1.467a5.899 5.899 0 0 1-1.46.605L11.334 18H8.667l-.19-2.263a5.899 5.899 0 0 1-1.458-.604L5.286 16.6 3.4 14.714l1.467-1.733a5.899 5.899 0 0 1-.604-1.458L2 11.333V8.667l2.262-.189a5.899 5.899 0 0 1 .605-1.459L3.4 5.286 5.286 3.4l1.733 1.467a5.899 5.899 0 0 1 1.46-.605L8.666 2h2.666zM10 6.267a3.733 3.733 0 1 0 0 7.466 3.733 3.733 0 0 0 0-7.466z"/></svg>',eraser:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m8.636 9.531-2.758 3.94a.5.5 0 0 0 .122.696l3.224 2.284h1.314l2.636-3.736L8.636 9.53zm.288 8.451L5.14 15.396a2 2 0 0 1-.491-2.786l6.673-9.53a2 2 0 0 1 2.785-.49l3.742 2.62a2 2 0 0 1 .491 2.785l-7.269 10.053-2.147-.066z"/><path d="M4 18h5.523v-1H4zm-2 0h1v-1H2z"/></svg>',lowVision:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5.085 6.22 2.943 4.078a.75.75 0 1 1 1.06-1.06l2.592 2.59A11.094 11.094 0 0 1 10 5.068c4.738 0 8.578 3.101 8.578 5.083 0 1.197-1.401 2.803-3.555 3.887l1.714 1.713a.75.75 0 0 1-.09 1.138.488.488 0 0 1-.15.084.75.75 0 0 1-.821-.16L6.17 7.304c-.258.11-.51.233-.757.365l6.239 6.24-.006.005.78.78c-.388.094-.78.166-1.174.215l-1.11-1.11h.011L4.55 8.197a7.2 7.2 0 0 0-.665.514l-.112.098 4.897 4.897-.005.006 1.276 1.276a10.164 10.164 0 0 1-1.477-.117l-.479-.479-.009.009-4.863-4.863-.022.031a2.563 2.563 0 0 0-.124.2c-.043.077-.08.158-.108.241a.534.534 0 0 0-.028.133.29.29 0 0 0 .008.072.927.927 0 0 0 .082.226c.067.133.145.26.234.379l3.242 3.365.025.01.59.623c-3.265-.918-5.59-3.155-5.59-4.668 0-1.194 1.448-2.838 3.663-3.93zm7.07.531a4.632 4.632 0 0 1 1.108 5.992l.345.344.046-.018a9.313 9.313 0 0 0 2-1.112c.256-.187.5-.392.727-.613.137-.134.27-.277.392-.431.072-.091.141-.185.203-.286.057-.093.107-.19.148-.292a.72.72 0 0 0 .036-.12.29.29 0 0 0 .008-.072.492.492 0 0 0-.028-.133.999.999 0 0 0-.036-.096 2.165 2.165 0 0 0-.071-.145 2.917 2.917 0 0 0-.125-.2 3.592 3.592 0 0 0-.263-.335 5.444 5.444 0 0 0-.53-.523 7.955 7.955 0 0 0-1.054-.768 9.766 9.766 0 0 0-1.879-.891c-.337-.118-.68-.219-1.027-.301zm-2.85.21-.069.002a.508.508 0 0 0-.254.097.496.496 0 0 0-.104.679.498.498 0 0 0 .326.199l.045.005c.091.003.181.003.272.012a2.45 2.45 0 0 1 2.017 1.513c.024.061.043.125.069.185a.494.494 0 0 0 .45.287h.008a.496.496 0 0 0 .35-.158.482.482 
50 0 0 .13-.335.638.638 0 0 0-.048-.219 3.379 3.379 0 0 0-.36-.723 3.438 3.438 0 0 0-2.791-1.543l-.028-.001h-.013z"/></svg>',image:Rc,alignBottom:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m9.239 13.938-2.88-1.663a.75.75 0 0 1 .75-1.3L9 12.067V4.75a.75.75 0 1 1 1.5 0v7.318l1.89-1.093a.75.75 0 0 1 .75 1.3l-2.879 1.663a.752.752 0 0 1-.511.187.752.752 0 0 1-.511-.187zM4.25 17a.75.75 0 1 1 0-1.5h10.5a.75.75 0 0 1 0 1.5H4.25z"/></svg>',alignMiddle:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9.75 11.875a.752.752 0 0 1 .508.184l2.883 1.666a.75.75 0 0 1-.659 1.344l-.091-.044-1.892-1.093.001 4.318a.75.75 0 1 1-1.5 0v-4.317l-1.89 1.092a.75.75 0 0 1-.75-1.3l2.879-1.663a.752.752 0 0 1 .51-.187zM15.25 9a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5h10.5zM9.75.375a.75.75 0 0 1 .75.75v4.318l1.89-1.093.092-.045a.75.75 0 0 1 .659 1.344l-2.883 1.667a.752.752 0 0 1-.508.184.752.752 0 0 1-.511-.187L6.359 5.65a.75.75 0 0 1 .75-1.299L9 5.442V1.125a.75.75 0 0 1 .75-.75z"/></svg>',alignTop:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m10.261 7.062 2.88 1.663a.75.75 0 0 1-.75 1.3L10.5 8.933v7.317a.75.75 0 1 1-1.5 0V8.932l-1.89 1.093a.75.75 0 0 1-.75-1.3l2.879-1.663a.752.752 0 0 1 .511-.187.752.752 0 0 1 .511.187zM15.25 4a.75.75 0 1 1 0 1.5H4.75a.75.75 0 0 1 0-1.5h10.5z"/></svg>',alignLeft:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z"/></svg>',alignCenter:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm2.286 4c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75z"/></svg>',alignRight:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M18 3.75a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 8a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 4a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75zm0-8a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75z"/></svg>',alignJustify:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z"/></svg>',objectLeft:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm11.5 9H18v1.5h-4.5zm0-3H18v1.5h-4.5zm0-3H18v1.5h-4.5zM2 15h16v1.5H2z"/><path d="M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z"/></svg>',objectCenter:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M15.003 7v5.5a1 1 0 0 1-1 1H5.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H6.5V12h6.997V7.5z"/></svg>',objectRight:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2zm0-9h5v1.5H2zm0 3h5v1.5H2zm0 3h5v1.5H2z"/><path d="M18.003 7v5.5a1 1 0 0 1-1 1H8.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H9.5V12h6.997V7.5z"/></svg>',objectFullWidth:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M18 7v5.5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1zm-1.505.5H3.504V12h12.991V7.5z"/></svg>',objectInline:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm11.5 9H18v1.5h-4.5zM2 15h16v1.5H2z"/><path d="M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z"/></svg>',objectBlockLeft:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z"/></svg>',objectBlockRight:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M18.003 7v5.5a1 1 0 0 1-1 1H8.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H9.5V12h6.997V7.5z"/></svg>',objectSizeFull:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1
5h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M18.095 2H1.905C.853 2 0 2.895 0 4v12c0 1.105.853 2 1.905 2h16.19C19.147 18 20 17.105 20 16V4c0-1.105-.853-2-1.905-2zm0 1.5c.263 0 .476.224.476.5v12c0 .276-.213.5-.476.5H1.905a.489.489 0 0 1-.476-.5V4c0-.276.213-.5.476-.5h16.19z"/></svg>',objectSizeLarge:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M13 6H2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5V8a.5.5 0 0 1 .5-.5h11z"/></svg>',objectSizeSmall:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M7 10H2a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5h5z"/></svg>',objectSizeMedium:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M10 8H2a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-6a.5.5 0 0 1 .5-.5h8z"/></svg>',pencil:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m7.3 17.37-.061.088a1.518 1.518 0 0 1-.934.535l-4.178.663-.806-4.153a1.495 1.495 0 0 1 .187-1.058l.056-.086L8.77 2.639c.958-1.351 2.803-1.076 4.296-.03 1.497 1.047 2.387 2.693 1.433 4.055L7.3 17.37zM9.14 4.728l-5.545 8.346 3.277 2.294 5.544-8.346L9.14 4.728zM6.07 16.512l-3.276-2.295.53 2.73 2.746-.435zM9.994 3.506 13.271 5.8c.316-.452-.16-1.333-1.065-1.966-.905-.634-1.895-.78-2.212-.328zM8 18.5 9.375 17H19v1.5H8z"/></svg>',pilcrow:Oc,quote:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 10.423a6.5 6.5 0 0 1 6.056-6.408l.038.67C6.448 5.423 5.354 7.663 5.22 10H9c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574zm8 0a6.5 6.5 0 0 1 6.056-6.408l.038.67c-2.646.739-3.74 2.979-3.873 5.315H17c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574z"/></svg>',threeVerticalDots:Cc};i(41);const Mc={alignLeft:Vc.alignLeft,bold:Vc.bold,importExport:Vc.importExport,paragraph:Vc.paragraph,plus:Vc.plus,text:Vc.text,threeVerticalDots:Vc.threeVerticalDots};function Nc(e){return"[object Object]"===Object.prototype.toString.call(e)}class zc extends Jl{constructor(e,t){super(e);const i=this.bindTemplate,o=this.t;this.options=t||{},this.set("ariaLabel",o("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new Xr,this.keystrokes=new Qr,this.set("class"),this.set("isCompact",!1),this.itemsView=new Bc(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();var n,e="rtl"===e.uiLanguageDirection;this._focusCycler=new ec({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[e?"arrowright":"arrowleft","arrowup"],focusNext:[e?"arrowleft":"arrowright","arrowdown"]}});const r=["ck","ck-toolbar",i.to("class"),i.if("isCompact","ck-toolbar_compact")];this.options.shouldGroupWhenFull&&this.options.isFloating&&r.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:r,role:"toolbar","aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")}},children:this.children,on:{mousedown:(n=this).bindTemplate.to(e=>{e.target===n.element&&e.preventDefault()})}}),this._behavior=new(this.options.shouldGroupWhenFull?Dc:Fc)(this)}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,o){const n=xc(e);e=n.items.filter((e,t,i)=>"|"===e||-1===n.removeItems.indexOf(e)&&("-"===e?!this.options.shouldGroupWhenFull||(Object(Bt.b)("toolbarview-line-break-ignored-when-grouping-items",i),!1):!!Nc(e)||(!!o.has(e)||(Object(Bt.b)("toolbarview-item-unavailable",{name:e}),!1)))),e=this._cleanSeparators(e).map(e=>Nc(e)?this._createNestedToolbarDropdown(e,o,[]):"|"===e?new ic:"-"===e?new oc:o.create(e));this.items.addMany(e)}_createNestedToolbarDropdown(e,t,i){var{label:o,icon:n,items:r,tooltip:s=!0,withText:a=!1}=e;if(!r)return null;if(!r.length)return null;const l=vc(this.locale);o||Object(Bt.b)("toolbarview-nested-toolbar-dropdown-missing-label",e),l.class="ck-toolbar__nested-toolbar-dropdown",l.buttonView.set({label:o,tooltip:s,withText:!!a}),!1!==n?l.buttonView.icon=Mc[n]||n||Cc:l.buttonView.withText=!0;i=this._buildItemsFromConfig(r,t,i);return _c(l,i),l}_buildItemsFromConfig(e,t,i){const o=xc(e);i||o.removeItems;return(o.items||[]).map(e=>Nc(e)?null:"|"===e?new ic:"-"===e?new oc:t.create(e)).filter(e=>!!e)}_cleanSeparators(e){const o=e=>"-"!==e&&"|"!==e;var t=e.length,i=e.findIndex(o),t=t-e.slice().reverse().findIndex(o);return e.slice(i,t).filter((e,t,i)=>{return!!o(e)||!(0<t&&i[t-1]===e)})}}class Bc extends Jl{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class Fc{constructor(e){const t=e.bindTemplate;e.set("isVertical",!1),e.itemsView.children.bindTo(e.items).using(e=>e),e.focusables.bindTo(e.items).using(e=>e),e.extendTemplate({attributes:{class:[t.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class Dc{constructor(e){this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,e.itemsView.children.bindTo(this.ungroupedItems).using(e=>e),this.ungroupedItems.on("add",this._updateFocusCycleableItems.bind(this)),this.ungroupedItems.on("remove",this._updateFocusCycleableItems.bind(this)),e.children.on("add",this._updateFocusCycleableItems.bind(this)),e.children.on("remove",this._updateFocusCycleableItems.bind(this)),e.items.on("change",(e,t)=>{var i=t.index;for(const n of t.removed)(i>=this.ungroupedItems.length?this.groupedItems:this.ungroupedItems).remove(n);for(let e=i;e<i+t.added.length;e++){var o=t.added[e-i];e>this.ungroupedItems.length?this.groupedItems.add(o,e-this.ungroupedItems.length):this.ungroupedItems.add(o,e)}this._updateGrouping()}),e.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}render(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}destroy(){this.groupedItemsDropdown.destroy(),this.resizeObserver.destroy()}_updateGrouping(){if(this.viewElement.ownerDocument.body.contains(this.viewElement))if(this.viewElement.offsetParent){var t=this.groupedItems.length;let e;for(;this._areItemsOverflowing;)this._groupLastItem(),e=!0;if(!e&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==t&&this.view.fire("groupedItemsUpdate")}else this.shouldUpdateGroupingOnNextResize=!0}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;var e=this.viewElement,t=this.viewLocale.uiLanguageDirection,i=new Wr(e.lastChild),o=new Wr(e);return this.cachedPadding||(e=Fn.window.getComputedStyle(e),this.cachedPadding=Number.parseInt(e["ltr"===t?"paddingRight":"paddingLeft"])),"ltr"===t?i.right>o.right-this.cachedPadding:i.left<o.left+this.cachedPadding}_enableGroupingOnResize(){let t;
5this.resizeObserver=new Ur(this.viewElement,e=>{t&&t===e.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),t=e.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new ic),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){var e=this.viewLocale;const t=e.t,i=vc(e);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition="ltr"===e.uiLanguageDirection?"sw":"se",_c(i,[]),i.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:"rtl"===e.uiLanguageDirection?"se":"sw",icon:Cc}),i.toolbarView.items.bindTo(this.groupedItems).using(e=>e),i}_updateFocusCycleableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(e=>{this.viewFocusables.add(e)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}class Lc extends Xl{constructor(e,t,i){super(e),this.toolbar=new zc(e),this.editables=[];for(const o of Object.keys(i)){const n=new Zl(e,t,i[o]);n.name=o,this.editables.push(n)}Ol.extend(this.toolbar.template,{attributes:{class:["ck-reset_all","ck-rounded-corners"],dir:e.uiLanguageDirection}})}render(){super.render(),this.registerChild(this.editables),this.registerChild([this.toolbar])}removeEditable(e){for(var t=0;t<this.editables.length;t++){var i=this.editables[t];if(i.name==e){this.isRendered&&this.deregisterChild(i),this.editables.splice(t,1),i.destroy();break}}}}class Hc extends vl{constructor(e,t){super(t);for(const i of Object.keys(e))this.model.document.createRoot("$root",i);this.ui=new Il(this,new Lc(this.locale,this.editing.view,e))}destroy(){const t={},i={},o=Array.from(this.ui.getEditableElementsNames());for(const e of o)t[e]=this.getData({rootName:e}),i[e]=this.ui.getEditableElement(e);return this.ui.destroy(),super.destroy().then(()=>{for(const e of o)Gr(i[e],t[e])})}addSourceElement(e,t){this.model.document.createRoot("$root",e);const i=new Zl(this.locale,this.editing.view,t);i.name=e,this.ui.view.editables.push(i),this.ui.view.registerChild([i]),this.ui.init();const o={};o[e]=Dr(t),this.model.enqueueChange("transparent",e=>{for(const i of Object.keys(o)){var t=this.model.document.getRoot(i);e.insert(this.data.parse(o[i],t),t,0)}})}removeSourceElement(e,t){var i=this.model.document.getRoot(e);if(i){i._isAttached=!1;for(const o of this.ui.view.editables)o.name==e&&(this.ui.removeEditable(o),this.ui.view.removeEditable(e))}}getAllRoots(){return Array.from(this.model.document.roots,e=>e).filter(e=>!1!==e._isAttached&&"$graveyard"!=e.rootName).map(e=>e.rootName)}static create(o,t){return new Promise(e=>{const i=new this(o,t);e(i.initPlugins().then(()=>i.ui.init()).then(()=>{const e={};for(const t of Object.keys(o))e[t]=Dr(o[t]);return i.data.init(e)}).then(()=>i.fire("ready")).then(()=>i))})}}function jc(e){e.set("_isCssTransitionsDisabled",!1),e.disableCssTransitions=()=>{e._isCssTransitionsDisabled=!0},e.enableCssTransitions=()=>{e._isCssTransitionsDisabled=!1},e.extendTemplate({attributes:{class:[e.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}function Wc({view:i}){i.listenTo(i.element,"submit",(e,t)=>{t.preventDefault(),i.fire("submit")},{useCapture:!0})}function $c(e,t){const i=e.t,o={Black:i("Black"),"Dim grey":i("Dim grey"),Grey:i("Grey"),"Light grey":i("Light grey"),White:i("White"),Red:i("Red"),Orange:i("Orange"),Yellow:i("Yellow"),"Light green":i("Light green"),Green:i("Green"),Aquamarine:i("Aquamarine"),Turquoise:i("Turquoise"),"Light blue":i("Light blue"),Blue:i("Blue"),Purple:i("Purple")};return t.map(e=>{var t=o[e.label];return t&&t!=e.label&&(e.label=t),e})}function qc(e){return e.map(Uc).filter(e=>!!e)}function Uc(e){return"string"==typeof e?{model:e,label:e,hasBorder:!1,view:{name:"span",styles:{color:e}}}:{model:e.color,label:e.label||e.color,hasBorder:void 0!==e.hasBorder&&e.hasBorder,view:{name:"span",styles:{color:`${e.color}`}}}}Gt(Hc,r);class Kc extends uc{constructor(e){super(e);const t=this.bindTemplate;this.set("color"),this.set("hasBorder"),this.icon='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path class="ck-icon__fill" d="M16.935 5.328a2 2 0 0 1 0 2.829l-7.778 7.778a2 2 0 0 1-2.829 0L3.5 13.107a1.999 1.999 0 1 1 2.828-2.829l.707.707a1 1 0 0 0 1.414 0l5.658-5.657a2 2 0 0 1 2.828 0z"/><path d="M14.814 6.035 8.448 12.4a1 1 0 0 1-1.414 0l-1.413-1.415A1 1 0 1 0 4.207 12.4l2.829 2.829a1 1 0 0 0 1.414 0l7.778-7.778a1 1 0 1 0-1.414-1.415z"/></svg>',this.extendTemplate({attributes:{style:{backgroundColor:t.to("color")},class:["ck","ck-color-grid__tile",t.if("hasBorder","ck-color-table__color-tile_bordered")]}})}render(){super.render(),this.iconView.fillColor="hsl(0, 0%, 100%)"}}i(43);class Gc extends Jl{constructor(e,t){super(e);const i=t&&t.colorDefinitions||[],o={};t&&t.columns&&(o.gridTemplateColumns=`repeat( ${t.columns}, 1fr)`),this.set("selectedColor"),this.items=this.createCollection(),this.focusTracker=new Xr,this.keystrokes=new Qr,this._focusCycler=new ec({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowleft",focu
5sNext:"arrowright"}}),this.items.on("add",(e,t)=>{t.isOn=t.color===this.selectedColor}),i.forEach(e=>{const t=new Kc;t.set({color:e.color,label:e.label,tooltip:!0,hasBorder:e.options.hasBorder}),t.on("execute",()=>{this.fire("execute",{value:e.color,hasBorder:e.options.hasBorder,label:e.label})}),this.items.add(t)}),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:o}}),this.on("change:selectedColor",(e,t,i)=>{for(const o of this.items)o.isOn=o.color===i})}focus(){this.items.length&&this.items.first.focus()}focusLast(){this.items.length&&this.items.last.focus()}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element)}}i(45);class Jc extends Jl{constructor(e){super(e);const t=this.bindTemplate;this.set("class"),this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke"),this.set("label"),this.set("tabindex",-1),this.set("tooltip"),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(),this.arrowView=this._createArrowView(),this.keystrokes=new Qr,this.focusTracker=new Xr,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",t.to("class"),t.if("isVisible","ck-hidden",e=>!e),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render(),this.children.add(this.actionView),this.children.add(this.arrowView),this.focusTracker.add(this.actionView.element),this.focusTracker.add(this.arrowView.element),this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",(e,t)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),t())}),this.keystrokes.set("arrowleft",(e,t)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),t())})}focus(){this.actionView.focus()}_createActionView(){const e=new uc;return e.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),e.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),e.delegate("execute").to(this),e}_createArrowView(){const e=new uc,t=e.bindTemplate;return e.icon=gc,e.extendTemplate({attributes:{class:"ck-splitbutton__arrow","aria-haspopup":!0,"aria-expanded":t.to("isOn",e=>String(e))}}),e.bind("isEnabled").to(this),e.delegate("execute").to(this,"open"),e}}i(47);class Yc extends Jl{constructor(e){super(e),this.set("text"),this.set("for"),this.id=`ck-editor__label_${Nt()}`;const t=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:t.to("for")},children:[{text:t.to("text")}]})}}i(49);class Xc extends Jl{constructor(e,t={}){super(e);const i=this.bindTemplate;this.set("label",t.label||""),this.set("class",t.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",i.to("class")]},children:this.children});const o=new Jl(e);o.setTemplate({tag:"span",attributes:{class:["ck","ck-form__header__label"]},children:[{text:i.to("label")}]}),this.children.add(o)}}i(51);class Qc extends Jl{constructor(e){super(e),this.set("value"),this.set("id"),this.set("placeholder"),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById"),this.focusTracker=new Xr,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{type:"text",class:["ck","ck-input","ck-input-text",t.if("isFocused","ck-input_focused"),t.if("isEmpty","ck-input-text_empty"),t.if("hasError","ck-error")],id:t.to("id"),placeholder:t.to("placeholder"),readonly:t.to("isReadOnly"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById")},on:{input:t.to("input"),change:t.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",(e,t,i)=>{this._setDomElementValue(i),this._updateIsEmpty()})}select(){this.element.select()}focus(){this.element.focus()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(e){this.element.value=e||0===e?e:""}}(class extends Jl{});i(53);class Zc extends Jl{constructor(e,t){super(e);var i=`ck-labeled-field-view-${Nt()}`,e=`ck-labeled-field-view-status-${Nt()}`;this.fieldView=t(this,i,e),this.set("label"),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class"),this.set("placeholder"),this.labelView=this._createLabelView(i),this.statusView=this._createStatusView(e),this.bind("_statusText").to(this,"errorText",this,"infoText",(e,t)=>e||t);const o=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",o.to("class"),o.if("isEnabled","ck-disabled",e=>!e),o.if("isEmpty","ck-labeled-field-view_empty"),o.if("isFocused","ck-labeled-field-view_focu
5sed"),o.if("placeholder","ck-labeled-field-view_placeholder"),o.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:[this.fieldView,this.labelView]},this.statusView]})}_createLabelView(e){const t=new Yc(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){const t=new Jl(this.locale),i=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",i.if("errorText","ck-labeled-field-view__status_error"),i.if("_statusText","ck-hidden",e=>!e)],id:e,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),t}focus(){this.fieldView.focus()}}function ed(e,t,i){const o=new Qc(e.locale);return o.set({id:t,ariaDescribedById:i}),o.bind("isReadOnly").to(e,"isEnabled",e=>!e),o.bind("hasError").to(e,"errorText",e=>!!e),o.on("input",()=>{e.errorText=null}),e.bind("isEmpty","isFocused","placeholder").to(o),o}function td(e,t,i){const o=vc(e.locale);return o.set({id:t,ariaDescribedById:i}),o.bind("isEnabled").to(e),o}class id{constructor(e,t){t&&ao(this,t),e&&this.set(e)}}Gt(id,fo);i(55);const od=Jr("px"),nd=Fn.document.body;class rd extends Jl{constructor(e){super(e);const t=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class"),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",t.to("position",e=>`ck-balloon-panel_${e}`),t.if("isVisible","ck-balloon-panel_visible"),t.if("withArrow","ck-balloon-panel_with-arrow"),t.to("class")],style:{top:t.to("top",od),left:t.to("left",od)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){this.show();var t=rd.defaultPositions,i=Object.assign({},{element:this.element,positions:[t.southArrowNorth,t.southArrowNorthMiddleWest,t.southArrowNorthMiddleEast,t.southArrowNorthWest,t.southArrowNorthEast,t.northArrowSouth,t.northArrowSouthMiddleWest,t.northArrowSouthMiddleEast,t.northArrowSouthWest,t.northArrowSouthEast],limiter:nd,fitInViewport:!0},e),t=rd._getOptimalPosition(i),e=parseInt(t.left),i=parseInt(t.top),t=t.name;Object.assign(this,{top:i,left:e,position:t})}pin(e){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},this._startPinning(e),this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(n){this.attachTo(n);const r=sd(n.target),s=n.limiter?sd(n.limiter):nd;this.listenTo(Fn.document,"scroll",(e,t)=>{const i=t.target;var o=r&&i.contains(r),t=s&&i.contains(s);!o&&!t&&r&&s||this.attachTo(n)},{useCapture:!0}),this.listenTo(Fn.window,"resize",()=>{this.attachTo(n)})}_stopPinning(){this.stopListening(Fn.document,"scroll"),this.stopListening(Fn.window,"resize")}}function sd(e){return Pt(e)?e:Lr(e)?e.commonAncestorContainer:"function"==typeof e?sd(e()):null}function ad(e,t){return e.top-t.height-rd.arrowVerticalOffset}function ld(e){return e.bottom+rd.arrowVerticalOffset}rd.arrowHorizontalOffset=25,rd.arrowVerticalOffset=10,rd._getOptimalPosition=rc,rd.defaultPositions={northWestArrowSouthWest:(e,t)=>({top:ad(e,t),left:e.left-rd.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouthMiddleWest:(e,t)=>({top:ad(e,t),left:e.left-.25*t.width-rd.arrowHorizontalOffset,name:"arrow_smw"}),northWestArrowSouth:(e,t)=>({top:ad(e,t),left:e.left-t.width/2,name:"arrow_s"}),northWestArrowSouthMiddleEast:(e,t)=>({top:ad(e,t),left:e.left-.75*t.width+rd.arrowHorizontalOffset,name:"arrow_sme"}),northWestArrowSouthEast:(e,t)=>({top:ad(e,t),left:e.left-t.width+rd.arrowHorizontalOffset,name:"arrow_se"}),northArrowSouthWest:(e,t)=>({top:ad(e,t),left:e.left+e.width/2-rd.arrowHorizontalOffset,name:"arrow_sw"}),northArrowSouthMiddleWest:(e,t)=>({top:ad(e,t),left:e.left+e.width/2-.25*t.width-rd.arrowHorizontalOffset,name:"arrow_smw"}),northArrowSouth:(e,t)=>({top:ad(e,t),left:e.left+e.width/2-t.width/2,name:"arrow_s"}),northArrowSouthMiddleEast:(e,t)=>
5({top:ad(e,t),left:e.left+e.width/2-.75*t.width+rd.arrowHorizontalOffset,name:"arrow_sme"}),northArrowSouthEast:(e,t)=>({top:ad(e,t),left:e.left+e.width/2-t.width+rd.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouthWest:(e,t)=>({top:ad(e,t),left:e.right-rd.arrowHorizontalOffset,name:"arrow_sw"}),northEastArrowSouthMiddleWest:(e,t)=>({top:ad(e,t),left:e.right-.25*t.width-rd.arrowHorizontalOffset,name:"arrow_smw"}),northEastArrowSouth:(e,t)=>({top:ad(e,t),left:e.right-t.width/2,name:"arrow_s"}),northEastArrowSouthMiddleEast:(e,t)=>({top:ad(e,t),left:e.right-.75*t.width+rd.arrowHorizontalOffset,name:"arrow_sme"}),northEastArrowSouthEast:(e,t)=>({top:ad(e,t),left:e.right-t.width+rd.arrowHorizontalOffset,name:"arrow_se"}),southWestArrowNorthWest:(e,t)=>({top:ld(e),left:e.left-rd.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorthMiddleWest:(e,t)=>({top:ld(e),left:e.left-.25*t.width-rd.arrowHorizontalOffset,name:"arrow_nmw"}),southWestArrowNorth:(e,t)=>({top:ld(e),left:e.left-t.width/2,name:"arrow_n"}),southWestArrowNorthMiddleEast:(e,t)=>({top:ld(e),left:e.left-.75*t.width+rd.arrowHorizontalOffset,name:"arrow_nme"}),southWestArrowNorthEast:(e,t)=>({top:ld(e),left:e.left-t.width+rd.arrowHorizontalOffset,name:"arrow_ne"}),southArrowNorthWest:(e,t)=>({top:ld(e),left:e.left+e.width/2-rd.arrowHorizontalOffset,name:"arrow_nw"}),southArrowNorthMiddleWest:(e,t)=>({top:ld(e),left:e.left+e.width/2-.25*t.width-rd.arrowHorizontalOffset,name:"arrow_nmw"}),southArrowNorth:(e,t)=>({top:ld(e),left:e.left+e.width/2-t.width/2,name:"arrow_n"}),southArrowNorthMiddleEast:(e,t)=>({top:ld(e),left:e.left+e.width/2-.75*t.width+rd.arrowHorizontalOffset,name:"arrow_nme"}),southArrowNorthEast:(e,t)=>({top:ld(e),left:e.left+e.width/2-t.width+rd.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorthWest:(e,t)=>({top:ld(e),left:e.right-rd.arrowHorizontalOffset,name:"arrow_nw"}),southEastArrowNorthMiddleWest:(e,t)=>({top:ld(e),left:e.right-.25*t.width-rd.arrowHorizontalOffset,name:"arrow_nmw"}),southEastArrowNorth:(e,t)=>({top:ld(e),left:e.right-t.width/2,name:"arrow_n"}),southEastArrowNorthMiddleEast:(e,t)=>({top:ld(e),left:e.right-.75*t.width+rd.arrowHorizontalOffset,name:"arrow_nme"}),southEastArrowNorthEast:(e,t)=>({top:ld(e),left:e.right-t.width+rd.arrowHorizontalOffset,name:"arrow_ne"})};i(57),i(59);const cd=Jr("px");class dd extends Ac{static get pluginName(){return"ContextualBalloon"}constructor(e){super(e),this.positionLimiter=()=>{const e=this.editor.editing.view;var t=e.document.selection.editableElement;return t?e.domConverter.mapViewToDom(t.root):null},this.set("visibleView",null),this.view=new rd(e.locale),e.ui.view.body.add(this.view),e.ui.focusTracker.add(this.view.element),this._viewToStack=new Map,this._idToStack=new Map,this.set("_numberOfStacks",0),this.set("_singleViewMode",!1),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this.hasView(e.view))throw new Bt.a("contextualballoon-add-view-exist",[this,e]);var t=e.stackId||"main";if(!this._idToStack.has(t))return this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!e.singleViewMode||this.showStack(t));const i=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),i.set(e.view,e),this._viewToStack.set(e.view,i),i===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new Bt.a("contextualballoon-remove-view-not-exist",[this,e]);const t=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(1===t.size?1<this._idToStack.size?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),1===t.size?(this._idToStack.delete(this._getStackId(t)),this._numberOfStacks=this._idToStack.size):t.delete(e),this._viewToStack.delete(e)}updatePosition(e){e&&(this._visibleStack.get(this.visibleView).position=e),this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition()}showStack(e){this.visibleStack=e;const t=this._idToStack.get(e);if(!t)throw new Bt.a("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(t){return Array.from(this._idToStack.entries()).find(e=>e[1]===t)[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}_showPrevStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new hd(this.editor.locale),o=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(e,t)=>!t&&1<e),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(e,t)=>{if(t<2)return"";var i=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return o("%0 of %1",[i,t])}),e.buttonNextView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),e.buttonPrevView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),e}_createFakePanelsView(){const e=new ud(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(e,t)=>{return!t&&2<=e?Math.min(e-1,2):0}),e.listenTo(this.view,"change:top",()=>e.updatePosition()),e.listenTo(this.view,"change:left",()=>e.updatePosition()),this.editor.ui.view.body.add(e),e}_showView({view:e,balloonClassName:t="",withArrow:i=!0,singleViewMode:o=!1}){this.view.class=t,this.view.withArrow=i,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),o&&(this._singleViewMode=!0)}_getBalloonPosition(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&!e.limiter&&(e=Object.assign({},e,{limiter:this.positionLimiter})),e}}class hd extends Jl{constructor(e){super(e);const t=e.t,i=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new Xr,this.buttonPrevView=this._createButtonView(t("Previous"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.463 5.187a.888.888 0 1 1 1.254 1.255L9.16 10l3.557 3.557a.888.888 0 1 1-1.254 1.255L7.26 10.61a.888.888 0 0 1 .16-1.382l4.043-4.042z"/>
5</svg>'),this.buttonNextView=this._createButtonView(t("Next"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8.537 14.813a.888.888 0 1 1-1.254-1.255L10.84 10 7.283 6.442a.888.888 0 1 1 1.254-1.255L12.74 9.39a.888.888 0 0 1-.16 1.382l-4.043 4.042z"/></svg>'),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",i.to("isNavigationVisible",e=>e?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const i=new uc(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i}}class ud extends Jl{constructor(e,t){super(e);const i=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=t,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",e=>e?"":"ck-hidden")],style:{top:i.to("top",cd),left:i.to("left",cd),width:i.to("width",cd),height:i.to("height",cd)}},children:this.content}),this.on("change:numberOfPanels",(e,t,i,o)=>{o<i?this._addPanels(i-o):this._removePanels(o-i),this.updatePosition()})}_addPanels(e){for(;e--;){const t=new Jl;t.setTemplate({tag:"div"}),this.content.add(t),this.registerChild(t)}}_removePanels(e){for(;e--;){const t=this.content.last;this.content.remove(t),this.deregisterChild(t),t.destroy()}}updatePosition(){var e,t,i,o;this.numberOfPanels&&({top:e,left:t}=this._balloonPanelView,{width:i,height:o}=new Wr(this._balloonPanelView.element),Object.assign(this,{top:e,left:t,width:i,height:o}))}}i(61);Jr("px");(class extends Jl{});Jr("px");(class extends Ac{});i(63);Jr("px");uc;Jr("px");(class extends Ac{});const gd=new Map;function md(e,t,i){let o=gd.get(e);o||(o=new Map,gd.set(e,o)),o.set(t,i)}function fd(e){return[e]}function pd(e,t,i={}){const o=function(e,t){const i=gd.get(e);return i&&i.has(t)?i.get(t):fd}(e.constructor,t.constructor);try{return e=e.clone(),o(e,t,i)}catch(e){throw e}}class bd{constructor(e,t,i=!1){this.originalOperations=new Map,this._history=e.history,this._useRelations=t,this._forceWeakRemove=!!i,this._relations=new Map}setOriginalOperations(e,t=null){var i=t?this.originalOperations.get(t):null;for(const o of e)this.originalOperations.set(o,i||o)}updateRelation(e,t){switch(e.constructor){case Va:switch(t.constructor){case Fa:e.targetPosition.isEqual(t.sourcePosition)||t.movedRange.containsPosition(e.targetPosition)?this._setRelation(e,t,"insertAtSource"):e.targetPosition.isEqual(t.deletionPosition)?this._setRelation(e,t,"insertBetween"):e.targetPosition.isAfter(t.sourcePosition)&&this._setRelation(e,t,"moveTargetAfter");break;case Va:e.targetPosition.isEqual(t.sourcePosition)||e.targetPosition.isBefore(t.sourcePosition)?this._setRelation(e,t,"insertBefore"):this._setRelation(e,t,"insertAfter")}break;case Da:switch(t.constructor){case Fa:e.splitPosition.isBefore(t.sourcePosition)&&this._setRelation(e,t,"splitBefore");break;case Va:if(e.splitPosition.isEqual(t.sourcePosition)||e.splitPosition.isBefore(t.sourcePosition))this._setRelation(e,t,"splitBefore");else{const l=ys._createFromPositionAndShift(t.sourcePosition,t.howMany);var i,o;e.splitPosition.hasSameParentAs(t.sourcePosition)&&l.containsPosition(e.splitPosition)&&(i=l.end.offset-e.splitPosition.offset,o=e.splitPosition.offset-l.start.offset,this._setRelation(e,t,{howMany:i,offset:o}))}}break;case Fa:switch(t.constructor){case Fa:e.targetPosition.isEqual(t.sourcePosition)||this._setRelation(e,t,"mergeTargetNotMoved"),e.sourcePosition.isEqual(t.targetPosition)&&this._setRelation(e,t,"mergeSourceNotMoved"),e.sourcePosition.isEqual(t.sourcePosition)&&this._setRelation(e,t,"mergeSameElement");break;case Da:e.sourcePosition.isEqual(t.splitPosition)&&this._setRelation(e,t,"splitAtSource")}break;case Na:{const c=e.newRange;if(!c)return;switch(t.constructor){case Va:{const d=ys._createFromPositionAndShift(t.sourcePosition,t.howMany);var n=d.containsPosition(c.start)||d.start.isEqual(c.start),r=d.containsPosition(c.end)||d.end.isEqual(c.end);!n&&!r||d.containsRange(c)||this._setRelation(e,t,{side:n?"left":"right",path:(n?c.start:c.end).path.slice()});break}case Fa:var s=c.start.isEqual(t.targetPosition),a=c.start.isEqual(t.deletionPosition),r=c.end.isEqual(t.deletionPosition),n=c.end.isEqual(t.sourcePosition);(s||a||r||n)&&this._setRelation(e,t,{wasInLeftElement:s,wasStartBeforeMergedElement:a,wasEndBeforeMergedElement:r,wasInRightElement:n})}break}}}getContext(e,t,i){return{aIsStrong:i,aWasUndone:this._wasUndone(e),bWasUndone:this._wasUndone(t),abRelation:this._useRelations?this._getRelation(e,t):null,baRelation:this._useRelations?this._getRelation(t,e):null,forceWeakRemove:this._forceWeakRemove}}_wasUndone(e){e=this.originalOperations.get(e);return e.wasUndone||this._history.isUndoneOperation(e)}_getRelation(e,t){t=this.originalOperations.get(t),t=this._history.getUndoneOperation(t);
5if(!t)return null;e=this.originalOperations.get(e);const i=this._relations.get(e);return i&&i.get(t)||null}_setRelation(e,t,i){e=this.originalOperations.get(e),t=this.originalOperations.get(t);let o=this._relations.get(e);o||(o=new Map,this._relations.set(e,o)),o.set(t,i)}}function kd(e,t){for(const i of e)i.baseVersion=t++}function wd(t,i){for(let e=0;e<i;e++)t.push(new ol(0))}function vd(e,t,i){const o=e.nodes;var n=o.getNode(0).getAttribute(t);if(n==i)return null;e=new ys(e.position,e.position.getShiftedBy(e.howMany));return new Ra(e,t,n,i,0)}function _d(e,t){return null===e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany)}function yd(i,e){const o=[];for(let t=0;t<i.length;t++){var n=i[t],r=new Va(n.start,n.end.offset-n.start.offset,e,0);o.push(r);for(let e=t+1;e<i.length;e++)i[e]=i[e]._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)[0];e=e._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)}return o}md(Ra,Ra,(t,e,i)=>{if(t.key===e.key&&t.range.start.hasSameParentAs(e.range.start)){const n=t.range.getDifference(e.range).map(e=>new Ra(e,t.key,t.oldValue,t.newValue,0));var o=t.range.getIntersection(e.range);return o&&i.aIsStrong&&n.push(new Ra(o,e.key,e.newValue,t.newValue,0)),0==n.length?[new ol(0)]:n}return[t]}),md(Ra,Ma,(t,e)=>{if(t.range.start.hasSameParentAs(e.position)&&t.range.containsPosition(e.position)){const o=t.range._getTransformedByInsertion(e.position,e.howMany,!e.shouldReceiveAttributes),n=o.map(e=>new Ra(e,t.key,t.oldValue,t.newValue,t.baseVersion));var i;return!e.shouldReceiveAttributes||(i=vd(e,t.key,t.oldValue))&&n.unshift(i),n}return t.range=t.range._getTransformedByInsertion(e.position,e.howMany,!1)[0],[t]}),md(Ra,Fa,(t,e)=>{const i=[];t.range.start.hasSameParentAs(e.deletionPosition)&&(t.range.containsPosition(e.deletionPosition)||t.range.start.isEqual(e.deletionPosition))&&i.push(ys._createFromPositionAndShift(e.graveyardPosition,1));e=t.range._getTransformedByMergeOperation(e);return e.isCollapsed||i.push(e),i.map(e=>new Ra(e,t.key,t.oldValue,t.newValue,t.baseVersion))}),md(Ra,Va,(t,e)=>{const i=function(e,t){const i=ys._createFromPositionAndShift(t.sourcePosition,t.howMany);let o=null,n=[];i.containsRange(e,!0)?o=e:e.start.hasSameParentAs(i.start)?(n=e.getDifference(i),o=e.getIntersection(i)):n=[e];const r=[];for(var s of n){s=s._getTransformedByDeletion(t.sourcePosition,t.howMany);var a=t.getMovedRangeStart(),l=s.start.hasSameParentAs(a);s=s._getTransformedByInsertion(a,t.howMany,l),r.push(...s)}o&&r.push(o._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,!1)[0]);return r}(t.range,e);return i.map(e=>new Ra(e,t.key,t.oldValue,t.newValue,t.baseVersion))}),md(Ra,Da,(e,t)=>{if(e.range.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.range.end.offset++,[e];if(e.range.start.hasSameParentAs(t.splitPosition)&&e.range.containsPosition(t.splitPosition)){const i=e.clone();return i.range=new ys(t.moveTargetPosition.clone(),e.range.end._getCombined(t.splitPosition,t.moveTargetPosition)),e.range.end=t.splitPosition.clone(),e.range.end.stickiness="toPrevious",[e,i]}return e.range=e.range._getTransformedBySplitOperation(t),[e]}),md(Ma,Ra,(e,t)=>{const i=[e];return e.shouldReceiveAttributes&&e.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(e.position)&&((t=vd(e,t.key,t.newValue))&&i.push(t)),i}),md(Ma,Ma,(e,t,i)=>(e.position.isEqual(t.position)&&i.aIsStrong||(e.position=e.position._getTransformedByInsertOperation(t)),[e])),md(Ma,Va,(e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e])),md(Ma,Da,(e,t)=>(e.position=e.position._getTransformedBySplitOperation(t),[e])),md(Ma,Fa,(e,t)=>(e.position=e.position._getTransformedByMergeOperation(t),[e])),md(Na,Ma,(e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByInsertOperation(t)[0]),e.newRange&&(e.newRange=e.newRange._getTransformedByInsertOperation(t)[0]),[e])),md(Na,Na,(e,t,i)=>{if(e.name==t.name){if(!i.aIsStrong)return[new ol(0)];e.oldRange=t.newRange?t.newRange.clone():null}return[e]}),md(Na,Fa,(e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByMergeOperation(t)),e.newRange&&(e.newRange=e.newRange._getTransformedByMergeOperation(t)),[e])),md(Na,Va,(e,t,i)=>{if(e.oldRange&&(e.oldRange=ys._createFromRanges(e.oldRange._getTransformedByMoveOperation(t))),e.newRange){if(i.abRelation){var o=ys._createFromRanges(e.newRange._getTransformedByMoveOperation(t));if("left"==i.abRelation.side&&t.targetPosition.isEqual(e.newRange.start))return e.newRange.start.path=i.abRelation.path,e.newRange.end=o.end,[e];if("right"==i.abRelation.side&&t.targetPosition.isEqual(e.newRange.end))return e.newRange.start=o.start,e.newRange.end.path=i.abRelation.path,[e]}e.newRange=ys._createFromRanges(e.newRange._getTransformedByMoveOperation(t))}return[e]}),md(Na,Da,(e,t,i)=>{if(e.oldRange&&(e.oldRange=e.oldRange._getTransformedBySplitOperation(t)),e.newRange){if(i.abRelation){var o=e.newRange._getTransformedBySplitOperation(t);return e.newRange.start.isEqual(t.splitPosition)&&i.abRelation.wasStartBeforeMergedElement?e.newRange.start=ks._createAt(t.insertionPosition):e.newRange.start.isEqual(t.splitPosition)&&!i.abRelation.wasInLeftElement&&(e.newRange.start=ks._createAt(t.moveTargetPosition)),e.newRange.end.isEqual(t.splitPosition)&&i.abRelation.wasInRightElement?e.newRange.end=ks._createAt(t.moveTargetPosition):e.newRange.end.isEqual(t.splitPosition)&&i.abRelation.wasEndBeforeMergedElement?e.newRange.end=ks._createAt(t.insertionPosition):e.newRange.end=o.end,[e]}e.newRange=e.newRange._getTransformedBySplitOperation(t)}return[e]}),md(Fa,Ma,(e,t)=>
5(e.sourcePosition.hasSameParentAs(t.position)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByInsertOperation(t),e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t),[e])),md(Fa,Fa,(e,t,i)=>{if(e.sourcePosition.isEqual(t.sourcePosition)&&e.targetPosition.isEqual(t.targetPosition)){if(i.bWasUndone){const r=t.graveyardPosition.path.slice();return r.push(0),e.sourcePosition=new ks(t.graveyardPosition.root,r),e.howMany=0,[e]}return[new ol(0)]}if(!e.sourcePosition.isEqual(t.sourcePosition)||e.targetPosition.isEqual(t.targetPosition)||i.bWasUndone||"splitAtSource"==i.abRelation)return e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMergeOperation(t),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),e.graveyardPosition.isEqual(t.graveyardPosition)&&i.aIsStrong||(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e];var o="$graveyard"==e.targetPosition.root.rootName,n="$graveyard"==t.targetPosition.root.rootName;if(n&&!o||!(o&&!n)&&i.aIsStrong){i=t.targetPosition._getTransformedByMergeOperation(t),t=e.targetPosition._getTransformedByMergeOperation(t);return[new Va(i,e.howMany,t,0)]}return[new ol(0)]}),md(Fa,Va,(e,t,i)=>{const o=ys._createFromPositionAndShift(t.sourcePosition,t.howMany);return"remove"==t.type&&!i.bWasUndone&&!i.forceWeakRemove&&e.deletionPosition.hasSameParentAs(t.sourcePosition)&&o.containsPosition(e.sourcePosition)?[new ol(0)]:(e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition.hasSameParentAs(t.sourcePosition)&&(e.howMany-=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMoveOperation(t),e.targetPosition=e.targetPosition._getTransformedByMoveOperation(t),e.graveyardPosition.isEqual(t.targetPosition)||(e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)),[e])}),md(Fa,Da,(e,t,i)=>{if(t.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1),e.deletionPosition.isEqual(t.graveyardPosition)&&(e.howMany=t.howMany)),e.targetPosition.isEqual(t.splitPosition)){var o=0!=t.howMany,n=t.graveyardPosition&&e.deletionPosition.isEqual(t.graveyardPosition);if(o||n||"mergeTargetNotMoved"==i.abRelation)return e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),[e]}if(e.sourcePosition.isEqual(t.splitPosition)){if("mergeSourceNotMoved"==i.abRelation)return e.howMany=0,e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e];if("mergeSameElement"==i.abRelation||0<e.sourcePosition.offset)return e.sourcePosition=t.moveTargetPosition.clone(),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}return e.sourcePosition.hasSameParentAs(t.splitPosition)&&(e.howMany=t.splitPosition.offset),e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}),md(Va,Ma,(e,t)=>{const i=ys._createFromPositionAndShift(e.sourcePosition,e.howMany);var o=i._getTransformedByInsertOperation(t,!1)[0];return e.sourcePosition=o.start,e.howMany=o.end.offset-o.start.offset,e.targetPosition.isEqual(t.position)||(e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)),[e]}),md(Va,Va,(e,t,i)=>{const o=ys._createFromPositionAndShift(e.sourcePosition,e.howMany),n=ys._createFromPositionAndShift(t.sourcePosition,t.howMany);let r=i.aIsStrong,s=!i.aIsStrong;"insertBefore"==i.abRelation||"insertAfter"==i.baRelation?s=!0:"insertAfter"!=i.abRelation&&"insertBefore"!=i.baRelation||(s=!1);let a;if(a=e.targetPosition.isEqual(t.targetPosition)&&s?e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany):e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),_d(e,t)&&_d(t,e))return[t.getReversed()];if(o.containsPosition(t.targetPosition)&&o.containsRange(n,!0))return o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),yd([o],a);if(n.containsPosition(e.targetPosition)&&n.containsRange(o,!0))return o.start=o.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),o.end=o.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),yd([o],a);var l=oi(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if("prefix"==l||"extension"==l)return o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),yd([o],a);"remove"!=e.type||"remove"==t.type||i.aWasUndone||i.forceWeakRemove?"remove"==e.type||"remove"!=t.type||i.bWasUndone||i.forceWeakRemove||(r=!1):r=!0;const c=[];for(const u of o.getDifference(n)){u.start=u.start._getTransformedByDeletion(t.sourcePosition,t.howMany),u.end=u.end._getTransformedByDeletion(t.sourcePosition,t.howMany);var d="same"==oi(u.start.getParentPath(),t.getMovedRangeStart().getParentPath()),d=u._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,d);c.push(...d)}const h=o.getIntersection(n);return null!==h&&r&&(h.start=h.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),h.end=h.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),0===c.length?c.push(h):1==c.length?n.start.isBefore(o.start)||n.start.isEqual(o.start)?c.unshift(h):c.push(h):c.splice(1,0,h)),0===c.length?[new ol(e.baseVersion)]:yd(c,a)}),md(Va,Da,(e,t,i)=>{let o=e.targetPosition.clone();e.targetPosition.isEqual(t.insertionPosition)&&t.graveyardPosition&&"moveTargetAfter"!=i.abRelation||(o=e.targetPosition._getTransformedBySplitOperation(t));const n=ys._createFromPositionAndShift(e.sourcePosition,e.howMany);if(n.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.howMany++,e.targetPosition=o,[e];if(n.start.hasSameParentAs(t.splitPosition)&&n.containsPosition(t.splitPosition)){let e=new ys(t.splitPosition,n.end);e=e._getTransformedBySplitOperation(t);const s=[new ys(n.start,t.splitPosition),e];return yd(s,o)}var r;e.targetPosition.isEqual(t.splitPosition)&&"insertAtSource"==i.abRelation&&(o=t.moveTargetPosition),e.targetPosition.isEqual(t.insertionPosition)&&"insertBetween"==i.abRelation&&(o=e.targetPosition);const s=[n._getTransformedBySplitOperation(t)];return t.graveyardPosition&&(r=n.start.isEqual(t.graveyardPosition)||n.containsPosition(t.graveyardPosition),1<e.howMany&&r&&!i.aWasUndone&&s.push(ys._createFromPositionAndShift(t.insertionPosition,1))),yd(s,o)}),md(Va,Fa,(i,o,n)=>{const e=ys._createFromPositionAndShift(i.sourcePosition,i.howMany);
5if(o.deletionPosition.hasSameParentAs(i.sourcePosition)&&e.containsPosition(o.sourcePosition))if("remove"!=i.type||n.forceWeakRemove){if(1==i.howMany)return n.bWasUndone?(i.sourcePosition=o.graveyardPosition.clone(),i.targetPosition=i.targetPosition._getTransformedByMergeOperation(o),[i]):[new ol(0)]}else if(!n.aWasUndone){const s=[];let e=o.graveyardPosition.clone(),t=o.targetPosition._getTransformedByMergeOperation(o);1<i.howMany&&(s.push(new Va(i.sourcePosition,i.howMany-1,i.targetPosition,0)),e=e._getTransformedByMove(i.sourcePosition,i.targetPosition,i.howMany-1),t=t._getTransformedByMove(i.sourcePosition,i.targetPosition,i.howMany-1));n=o.deletionPosition._getCombined(i.sourcePosition,i.targetPosition);const a=new Va(e,1,n,0),l=a.getMovedRangeStart().path.slice();l.push(0);var r=new ks(a.targetPosition.root,l);t=t._getTransformedByMove(e,n,1);r=new Va(t,o.howMany,r,0);return s.push(a),s.push(r),s}const t=ys._createFromPositionAndShift(i.sourcePosition,i.howMany);r=t._getTransformedByMergeOperation(o);return i.sourcePosition=r.start,i.howMany=r.end.offset-r.start.offset,i.targetPosition=i.targetPosition._getTransformedByMergeOperation(o),[i]}),md(za,Ma,(e,t)=>(e.position=e.position._getTransformedByInsertOperation(t),[e])),md(za,Fa,(e,t)=>(e.position.isEqual(t.deletionPosition)?(e.position=t.graveyardPosition.clone(),e.position.stickiness="toNext"):e.position=e.position._getTransformedByMergeOperation(t),[e])),md(za,Va,(e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e])),md(za,za,(e,t,i)=>{if(e.position.isEqual(t.position)){if(!i.aIsStrong)return[new ol(0)];e.oldName=t.newName}return[e]}),md(za,Da,(e,t)=>{if("same"!=oi(e.position.path,t.splitPosition.getParentPath())||t.graveyardPosition)return e.position=e.position._getTransformedBySplitOperation(t),[e];t=new za(e.position.getShiftedBy(1),e.oldName,e.newName,0);return[e,t]}),md(Ba,Ba,(e,t,i)=>{if(e.root===t.root&&e.key===t.key){if(!i.aIsStrong||e.newValue===t.newValue)return[new ol(0)];e.oldValue=t.newValue}return[e]}),md(Da,Ma,(e,t)=>(e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset<t.position.offset&&(e.howMany+=t.howMany),e.splitPosition=e.splitPosition._getTransformedByInsertOperation(t),e.insertionPosition=e.insertionPosition._getTransformedByInsertOperation(t),[e])),md(Da,Fa,(e,t,i)=>{if(e.graveyardPosition||i.bWasUndone||!e.splitPosition.hasSameParentAs(t.sourcePosition))return e.splitPosition.hasSameParentAs(t.deletionPosition)&&!e.splitPosition.isAfter(t.deletionPosition)&&e.howMany--,e.splitPosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=Da.getInsertionPosition(e.splitPosition),e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e];{const n=t.graveyardPosition.path.slice();n.push(0);var o=new ks(t.graveyardPosition.root,n),i=Da.getInsertionPosition(new ks(t.graveyardPosition.root,n));const r=new Da(o,0,i,null,0);return e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=Da.getInsertionPosition(e.splitPosition),e.graveyardPosition=r.insertionPosition.clone(),e.graveyardPosition.stickiness="toNext",[r,e]}}),md(Da,Va,(e,t,i)=>{const o=ys._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.graveyardPosition){var n=o.start.isEqual(e.graveyardPosition)||o.containsPosition(e.graveyardPosition);if(!i.bWasUndone&&n){n=e.splitPosition._getTransformedByMoveOperation(t);const a=e.graveyardPosition._getTransformedByMoveOperation(t),l=a.path.slice();l.push(0);var r=new ks(a.root,l);return[new Va(n,e.howMany,r,0)]}e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}r=e.splitPosition.isEqual(t.targetPosition);if(r&&("insertAtSource"==i.baRelation||"splitBefore"==i.abRelation))return e.howMany+=t.howMany,e.splitPosition=e.splitPosition._getTransformedByDeletion(t.sourcePosition,t.howMany),e.insertionPosition=Da.getInsertionPosition(e.splitPosition),[e];if(r&&i.abRelation&&i.abRelation.howMany){var{howMany:i,offset:s}=i.abRelation;return e.howMany+=i,e.splitPosition=e.splitPosition.getShiftedBy(s),[e]}if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&o.containsPosition(e.splitPosition)){s=t.howMany-(e.splitPosition.offset-t.sourcePosition.offset);return e.howMany-=s,e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset<t.targetPosition.offset&&(e.howMany+=t.howMany),e.splitPosition=t.sourcePosition.clone(),e.
5insertionPosition=Da.getInsertionPosition(e.splitPosition),[e]}return t.sourcePosition.isEqual(t.targetPosition)||(e.splitPosition.hasSameParentAs(t.sourcePosition)&&e.splitPosition.offset<=t.sourcePosition.offset&&(e.howMany-=t.howMany),e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset<t.targetPosition.offset&&(e.howMany+=t.howMany)),e.splitPosition.stickiness="toNone",e.splitPosition=e.splitPosition._getTransformedByMoveOperation(t),e.splitPosition.stickiness="toNext",e.graveyardPosition?e.insertionPosition=e.insertionPosition._getTransformedByMoveOperation(t):e.insertionPosition=Da.getInsertionPosition(e.splitPosition),[e]}),md(Da,Da,(e,t,i)=>{if(e.splitPosition.isEqual(t.splitPosition)){if(!e.graveyardPosition&&!t.graveyardPosition)return[new ol(0)];if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition))return[new ol(0)];if("splitBefore"==i.abRelation)return e.howMany=0,e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t),[e]}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){var o="$graveyard"==e.splitPosition.root.rootName,n="$graveyard"==t.splitPosition.root.rootName;if(n&&!o||!(o&&!n)&&i.aIsStrong){const r=[];return t.howMany&&r.push(new Va(t.moveTargetPosition,t.howMany,t.splitPosition,0)),e.howMany&&r.push(new Va(e.splitPosition,e.howMany,e.moveTargetPosition,0)),r}return[new ol(0)]}if(e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t)),e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==i.abRelation)return e.howMany++,[e];if(t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==i.baRelation){const s=t.insertionPosition.path.slice();s.push(0);i=new ks(t.insertionPosition.root,s);return[e,new Va(e.insertionPosition,1,i,0)]}return e.splitPosition.hasSameParentAs(t.splitPosition)&&e.splitPosition.offset<t.splitPosition.offset&&(e.howMany-=t.howMany),e.splitPosition=e.splitPosition._getTransformedBySplitOperation(t),e.insertionPosition=Da.getInsertionPosition(e.splitPosition),[e]});class xd extends kr{constructor(e){super(e),this.domEventType="click"}onDomEvent(e){this.fire(e.type,e)}}class Cd extends kr{constructor(e){super(e),this.domEventType=["mousedown","mouseup","mouseover","mouseout"]}onDomEvent(e){this.fire(e.type,e)}}class Ad{constructor(e){this.document=e}createDocumentFragment(e){return new ln(this.document,e)}createElement(e,t,i){return new oo(this.document,e,t,i)}createText(e){return new si(this.document,e)}clone(e,t=!1){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,i){return i._insertChild(e,t)}removeChildren(e,t,i){return i._removeChildren(e,t)}remove(e){const t=e.parent;return t?this.removeChildren(t.getChildIndex(e),1,t):[]}replace(e,t){const i=e.parent;if(i){e=i.getChildIndex(e);return this.removeChildren(e,1,i),this.insertChild(e,t,i),!0}return!1}unwrapElement(e){const t=e.parent;var i;t&&(i=t.getChildIndex(e),this.remove(e),this.insertChild(i,e.getChildren(),t))}rename(e,t){e=new oo(this.document,e,t.getAttributes(),t.getChildren());return this.replace(t,e)?e:null}setAttribute(e,t,i){i._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,i){(i=y(e)&&void 0===i?t:i)._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,i){i._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return Ao._createAt(e,t)}createPositionAfter(e){return Ao._createAfter(e)}createPositionBefore(e){return Ao._createBefore(e)}createRange(e,t){return new To(e,t)}createRangeOn(e){return To._createOn(e)}createRangeIn(e){return To._createIn(e)}createSelection(e,t,i){return new So(e,t,i)}}const Td=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,Ed=/^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i,Pd=/^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,Sd=/^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i,Id=/^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,Rd=new Set(["black","silver","gray","white","maroon","red","purple","fuchsia","green","lime","olive","yellow","navy","blue","teal","aqua","orange","aliceblue","antiquewhite","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","dar
5kviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","gainsboro","ghostwhite","gold","goldenrod","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","limegreen","linen","magenta","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","oldlace","olivedrab","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","thistle","tomato","turquoise","violet","wheat","whitesmoke","yellowgreen","rebeccapurple","currentcolor","transparent"]);function Od(e){return e.startsWith("#")?Td.test(e):e.startsWith("rgb")?Ed.test(e)||Pd.test(e):e.startsWith("hsl")?Sd.test(e)||Id.test(e):Rd.has(e.toLowerCase())}const Vd=["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset"];const Md=/^([+-]?[0-9]*([.][0-9]+)?(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;function Nd(e){return Md.test(e)}const zd=/^[+-]?[0-9]*([.][0-9]+)?%$/;function Bd(e){return zd.test(e)}const Fd=["repeat-x","repeat-y","repeat","space","round","no-repeat"];const Dd=["center","top","bottom","left","right"];const Ld=["fixed","scroll","local"];const Hd=/^url\(/;
5function jd(e=""){if(""===e)return{top:void 0,right:void 0,bottom:void 0,left:void 0};var t=qd(e),i=t[0],o=t[2]||i,e=t[1]||i;return{top:i,bottom:o,right:e,left:t[3]||e}}function Wd(s){return e=>{const{top:t,right:i,bottom:o,left:n}=e,r=[];return[t,i,n,o].every(e=>!!e)?r.push([s,function({top:e,right:t,bottom:i,left:o}){const n=[];o!==t?n.push(e,t,i,o):i!==e?n.push(e,t,i):t!==e?n.push(e,t):n.push(e);return n.join(" ")}(e)]):(t&&r.push([s+"-top",t]),i&&r.push([s+"-right",i]),o&&r.push([s+"-bottom",o]),n&&r.push([s+"-left",n])),r}}function $d(t){return e=>({path:t,value:jd(e)})}function qd(e){return e.replace(/, /g,",").split(" ").map(e=>e.replace(/,/g,", "))}function Ud(e){e.setNormalizer("background",Kd),e.setNormalizer("background-color",e=>({path:"background.color",value:e})),e.setReducer("background",e=>{const t=[];return t.push(["background-color",e.color]),t}),e.setStyleRelation("background",["background-color"])}function Kd(e){const t={};var i;for(const o of qd(e))i=o,Fd.includes(i)?(t.repeat=t.repeat||[],t.repeat.push(o)):(i=o,Dd.includes(i)?(t.position=t.position||[],t.position.push(o)):(i=o,Ld.includes(i)?t.attachment=o:Od(o)?t.color=o:(i=o,Hd.test(i)&&(t.image=o))));return{path:"background",value:t}}function Gd(e){function a(e,t){return e.map(e=>e[t]).reduce((e,t)=>e==t?e:null)}e.setNormalizer("border",Jd),e.setNormalizer("border-top",Yd("top")),e.setNormalizer("border-right",Yd("right")),e.setNormalizer("border-bottom",Yd("bottom")),e.setNormalizer("border-left",Yd("left")),e.setNormalizer("border-color",Xd("color")),e.setNormalizer("border-width",Xd("width")),e.setNormalizer("border-style",Xd("style")),e.setNormalizer("border-top-color",Qd("color","top")),e.setNormalizer("border-top-style",Qd("style","top")),e.setNormalizer("border-top-width",Qd("width","top")),e.setNormalizer("border-right-color",Qd("color","right")),e.setNormalizer("border-right-style",Qd("style","right")),e.setNormalizer("border-right-width",Qd("width","right")),e.setNormalizer("border-bottom-color",Qd("color","bottom")),e.setNormalizer("border-bottom-style",Qd("style","bottom")),e.setNormalizer("border-bottom-width",Qd("width","bottom")),e.setNormalizer("border-left-color",Qd("color","left")),e.setNormalizer("border-left-style",Qd("style","left")),e.setNormalizer("border-left-width",Qd("width","left")),e.setExtractor("border-top",Zd("top")),e.setExtractor("border-right",Zd("right")),e.setExtractor("border-bottom",Zd("bottom")),e.setExtractor("border-left",Zd("left")),e.setExtractor("border-top-color","border.color.top"),e.setExtractor("border-right-color","border.color.right"),e.setExtractor("border-bottom-color","border.color.bottom"),e.setExtractor("border-left-color","border.color.left"),e.setExtractor("border-top-width","border.width.top"),e.setExtractor("border-right-width","border.width.right"),e.setExtractor("border-bottom-width","border.width.bottom"),e.setExtractor("border-left-width","border.width.left"),e.setExtractor("border-top-style","border.style.top"),e.setExtractor("border-right-style","border.style.right"),e.setExtractor("border-bottom-style","border.style.bottom"),e.setExtractor("border-left-style","border.style.left"),e.setReducer("border-color",Wd("border-color")),e.setReducer("border-style",Wd("border-style")),e.setReducer("border-width",Wd("border-width")),e.setReducer("border-top",ih("top")),e.setReducer("border-right",ih("right")),e.setReducer("border-bottom",ih("bottom")),e.setReducer("border-left",ih("left")),e.setReducer("border",e=>{var t=eh(e,"top"),i=eh(e,"right"),o=eh(e,"bottom"),n=eh(e,"left");const r=[t,i,o,n];var s={width:a(r,"width"),style:a(r,"style"),color:a(r,"color")},e=oh(s,"all");return e.length?e:[...Object.entries(s).reduce((e,[t,i])=>(i&&(e.push([`border-${t}`,i]),r.forEach(e=>e[t]=null)),e),[]),...oh(t,"top"),...oh(i,"right"),...oh(o,"bottom"),...oh(n,"left")]}),e.setStyleRelation("border",["border-color","border-style","border-width","border-top","border-right","border-bottom","border-left","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-width","border-right-width","border-bottom-width","border-left-width"]),e.setStyleRelation("border-color",["border-top-color","border-right-color","border-bottom-color","border-left-color"]),e.setStyleRelation("border-style",["border-top-style","border-right-style","border-bottom-style","border-left-style"]),e.setStyleRelation("border-width",["border-top-width","border-right-width","border-bottom-width","border-left-width"]),e.setStyleRelation("border-top",["border-top-color","border-top-style","border-top-width"]),e.setStyleRelation("border-right",["border-right-color","border-right-style","border-right-width"]),e.setStyleRelation("border-bottom",["border-bottom-color","border-bottom-style","border-bottom-width"]),e.setStyleRelation("border-left",["border-left-color","border-left-style","border-left-width"])}function Jd(e){var{color:t,style:i,width:e}=th(e);return{path:"border",value:{color:jd(t),style:jd(i),width:jd(e)}}}function Yd(n){return e=>{var{color:t,style:i,width:e}=th(e);const o={};return void 0!==t&&(o.color={[n]:t}),void 0!==i&&(o.style={[n]:i}),void 0!==e&&(o.width={[n]:e}),{path:"border",value:o}}}function Xd(t){return e=>{return{path:"border",value:{[t]:jd(e)}}}}function Qd(t,i){return e=>({path:"border",value:{[t]:{[i]:e}}})}function Zd(i){return(e,t)=>{if(t.border)return eh(t.border,i)}}function eh(e,t){const i={};return e.width&&e.width[t]&&(i.width=e.width[t]),e.style&&e.style[t]&&(i.style=e.style[t]),e.color&&e.color[t]&&(i.color=e.color[t]),i}function th(e){const t={};var i;for(const o of qd(e))Nd(o)||/thin|medium|thick/.test(o)?t.width=o:(i=o,Vd.includes(i)?t.style=o:t.color=o);return t}function ih(t){return e=>oh(e,t)}function oh(t,i){const e=[];
5if(t&&t.width&&e.push("width"),t&&t.style&&e.push("style"),t&&t.color&&e.push("color"),3!=e.length)return"all"==i?[]:e.map(e=>[`border-${i}-${e}`,t[e]]);var o=e.map(e=>t[e]).join(" ");return["all"==i?["border",o]:[`border-${i}`,o]]}function nh(e){e.setNormalizer("margin",$d("margin")),e.setNormalizer("margin-top",e=>({path:"margin.top",value:e})),e.setNormalizer("margin-right",e=>({path:"margin.right",value:e})),e.setNormalizer("margin-bottom",e=>({path:"margin.bottom",value:e})),e.setNormalizer("margin-left",e=>({path:"margin.left",value:e})),e.setReducer("margin",Wd("margin")),e.setStyleRelation("margin",["margin-top","margin-right","margin-bottom","margin-left"])}function rh(e){e.setNormalizer("padding",$d("padding")),e.setNormalizer("padding-top",e=>({path:"padding.top",value:e})),e.setNormalizer("padding-right",e=>({path:"padding.right",value:e})),e.setNormalizer("padding-bottom",e=>({path:"padding.bottom",value:e})),e.setNormalizer("padding-left",e=>({path:"padding.left",value:e})),e.setReducer("padding",Wd("padding")),e.setStyleRelation("padding",["padding-top","padding-right","padding-bottom","padding-left"])}class sh extends xl{constructor(e,t){super(e),this.view=t,this._toolbarConfig=xc(e.config.get("toolbar"))}get element(){return this.view.editable.element}init(){var e=this.editor;const t=this.view,i=e.editing.view,o=t.editable;e=i.document.getRoot();o.name=e.rootName,t.render();e=o.element;this.setEditableElement(o.name,e),this.focusTracker.add(e),o.bind("isFocused").to(this.focusTracker),i.attachDomRoot(e),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const e=this.view,t=this.editor.editing.view;t.detachDomRoot(e.editable.name),e.destroy(),super.destroy()}_initToolbar(){var e=this.editor;const t=this.view,i=t.editable.element;var o=e.editing.view;const n=t.toolbar;t.panel.bind("isVisible").to(this.focusTracker,"isFocused"),this._toolbarConfig.viewportTopOffset&&(t.viewportTopOffset=this._toolbarConfig.viewportTopOffset),t.listenTo(e.ui,"update",()=>{t.panel.isVisible&&t.panel.pin({target:i,positions:t.panelPositions})}),n.fillFromConfig(this._toolbarConfig,this.componentFactory),Cl({origin:o,originFocusTracker:this.focusTracker,originKeystrokeHandler:e.keystrokes,toolbar:n})}_initPlaceholder(){const e=this.editor,t=e.editing.view;var i=t.document.getRoot();const o=e.sourceElement;var n=e.config.get("placeholder")||o&&"textarea"===o.tagName.toLowerCase()&&o.getAttribute("placeholder");n&&Tl({view:t,element:i,text:n,isDirectHost:!1,keepOnFocus:!0})}}const ah=Jr("px");class lh extends Xl{constructor(e,t,i,o={}){super(e),this.toolbar=new zc(e,{shouldGroupWhenFull:o.shouldToolbarGroupWhenFull,isFloating:!0}),this.set("viewportTopOffset",0),this.panel=new rd(e),this.panel.withArrow=!1,this.panelPositions=this._getPanelPositions(),this.panel.extendTemplate({attributes:{class:"ck-toolbar-container"}}),this.editable=new Zl(e,t,i),this._resizeObserver=null}render(){if(super.render(),this.body.add(this.panel),this.registerChild(this.editable),this.panel.content.add(this.toolbar),this.toolbar.options.shouldGroupWhenFull){const e=this.editable.element;this._resizeObserver=new Ur(e,()=>{this.toolbar.maxWidth=ah(new Wr(e).width)})}}destroy(){super.destroy(),this._resizeObserver&&this._resizeObserver.destroy()}_getPanelPositionTop(e,t){let i;return i=e.top>t.height+this.viewportTopOffset?e.top-t.height:e.bottom>t.height+this.viewportTopOffset+50?this.viewportTopOffset:e.bottom,i}_getPanelPositions(){const e=[(e,t)=>({top:this._getPanelPositionTop(e,t),left:e.left,name:"toolbar_west"}),(e,t)=>({top:this._getPanelPositionTop(e,t),left:e.left+e.width-t.width,name:"toolbar_east"})];return"ltr"===this.locale.uiLanguageDirection?e:e.reverse()}}class ch extends vl{constructor(e,t){super(t),this.model.document.createRoot(),Pt(e)&&(this.sourceElement=e,function(e){const t=e.sourceElement;if(t){if(t.ckeditorInstance)throw new Bt.a("editor-source-element-already-used",e);(t.ckeditorInstance=e).once("destroy",()=>{delete t.ckeditorInstance})}}(this));e=!this.config.get("toolbar.shouldNotGroupWhenFull"),e=new lh(this.locale,this.editing.view,this.sourceElement,{shouldToolbarGroupWhenFull:e});this.ui=new sh(this,e),function(t){if(!M(t.updateSourceElement))throw new Bt.a("attachtoform-missing-elementapi-interface",t);const i=t.sourceElement;if(i&&"textarea"===i.tagName.toLowerCase()&&i.form){let e;const o=i.form,n=()=>t.updateSourceElement();M(o.submit)&&(e=o.submit,o.submit=()=>{n(),e.apply(o)}),o.addEventListener("submit",n),t.on("destroy",()=>{o.removeEventListener("submit",n),e&&(o.submit=e)})}}(this)}destroy(){const e=this.getData();return this.ui.destroy(),super.destroy().then(()=>{this.sourceElement&&Gr(this.sourceElement,e)})}static create(o,n={}){return new Promise(e=>{const t=Pt(o);if(t&&"TEXTAREA"===o.tagName)throw new Bt.a("editor-wrong-element",null);const i=new this(o,n);e(i.initPlugins().then(()=>{i.ui.init()}).then(()=>
5{if(!t&&n.initialData)throw new Bt.a("editor-create-initial-data",null);var e,e=void 0!==n.initialData?n.initialData:Pt(e=o)?Dr(e):e;return i.data.init(e)}).then(()=>i.fire("ready")).then(()=>i))})}}Gt(ch,r),Gt(ch,O);class dh{constructor(e){this.files=function(e){const t=Array.from(e.files||[]),i=Array.from(e.items||[]);if(t.length)return t;return i.filter(e=>"file"===e.kind).map(e=>e.getAsFile())}(e),this._native=e}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,t){this._native.setData(e,t)}set effectAllowed(e){this._native.effectAllowed=e}get effectAllowed(){return this._native.effectAllowed}set dropEffect(e){this._native.dropEffect=e}get dropEffect(){return this._native.dropEffect}get isCanceled(){return"none"==this._native.dropEffect||!!this._native.mozUserCancelled}}class hh extends kr{constructor(e){super(e);const r=this.document;function t(n){return(e,t)=>{t.preventDefault();var i=t.dropRange?[t.dropRange]:null,o=new Vt(r,n);r.fire(o,{dataTransfer:t.dataTransfer,method:e.name,targetRanges:i,target:t.target}),o.stop.called&&t.stopPropagation()}}this.domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"],this.listenTo(r,"paste",t("clipboardInput"),{priority:"low"}),this.listenTo(r,"drop",t("clipboardInput"),{priority:"low"}),this.listenTo(r,"dragover",t("dragging"),{priority:"low"})}onDomEvent(e){const t={dataTransfer:new dh(e.clipboardData||e.dataTransfer)};"drop"!=e.type&&"dragover"!=e.type||(t.dropRange=function(e,t){const i=t.target.ownerDocument,o=t.clientX,n=t.clientY;let r;i.caretRangeFromPoint&&i.caretRangeFromPoint(o,n)?r=i.caretRangeFromPoint(o,n):t.rangeParent&&(r=i.createRange(),r.setStart(t.rangeParent,t.rangeOffset),r.collapse(!0));if(r)return e.domConverter.domRangeToView(r);return null}(this.view,e)),this.fire(e.type,e,t)}}const uh=["figcaption","li"];class gh extends Ac{static get pluginName(){return"ClipboardPipeline"}init(){const e=this.editor.editing.view;e.addObserver(hh),this._setupPasteDrop(),this._setupCopyCut()}_setupPasteDrop(){const t=this.editor,n=t.model,r=t.editing.view;var e=r.document;this.listenTo(e,"clipboardInput",e=>{t.isReadOnly&&e.stop()},{priority:"highest"}),this.listenTo(e,"clipboardInput",(e,t)=>{const i=t.dataTransfer;let o=t.content||"";o||(i.getData("text/html")?o=i.getData("text/html").replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(e,t)=>1==t.length?" ":t).replace(/<!--[\s\S]*?-->/g,""):i.getData("text/plain")&&(o=n=(n=(n=i.getData("text/plain")).replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br>").replace(/^\s/,"&nbsp;").replace(/\s$/,"&nbsp;").replace(/\s\s/g," &nbsp;")).includes("</p><p>")||n.includes("<br>")?`<p>${n}</p>`:n),o=this.editor.data.htmlProcessor.toView(o));var n=new Vt(this,"inputTransformation");this.fire(n,{content:o,dataTransfer:i,targetRanges:t.targetRanges,method:t.method}),n.stop.called&&e.stop(),r.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(e,t)=>{if(!t.content.isEmpty){const i=this.editor.data,o=i.toModel(t.content,"$clipboardHolder");0!=o.childCount&&(e.stop(),n.change(()=>{this.fire("contentInsertion",{content:o,method:t.method,dataTransfer:t.dataTransfer,targetRanges:t.targetRanges})}))}},{priority:"low"}),this.listenTo(this,"contentInsertion",(e,t)=>{t.resultRange=n.insertContent(t.content)},{priority:"low"})}_setupCopyCut(){const o=this.editor,n=o.model.document;const r=o.editing.view.document;function i(e,t){var i=t.dataTransfer;t.preventDefault();t=o.data.toView(o.model.getSelectedContent(n.selection));r.fire("clipboardOutput",{dataTransfer:i,content:t,method:e.name})}this.listenTo(r,"copy",i,{priority:"low"}),this.listenTo(r,"cut",(e,t)=>{o.isReadOnly?t.preventDefault():i(e,t)},{priority:"low"}),this.listenTo(r,"clipboardOutput",(e,t)=>{t.content.isEmpty||(t.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(t.content)),t.dataTransfer.setData("text/plain",function t(i){let o="";if(i.is("$text")||i.is("$textProxy"))o=i.data;else if(i.is("element","img")&&i.hasAttribute("alt"))o=i.getAttribute("alt");else if(i.is("element","br"))o="\n";else{let e=null;for(const r of i.getChildren()){var n=t(r);
5e&&(e.is("containerElement")||r.is("containerElement"))&&(uh.includes(e.name)||uh.includes(r.name)?o+="\n":o+="\n\n"),o+=n,e=r}}return o}(t.content))),"cut"==t.method&&o.model.deleteContent(n.selection)},{priority:"low"})}}function*mh(e,t){for(const i of t)i&&e.getAttributeProperties(i[0]).copyOnEnter&&(yield i)}class fh extends Ec{execute(){const c=this.editor.model,d=c.document;c.change(e=>{var t,i,o,n,r,s,a,l;t=this.editor.model,i=e,o=d.selection,n=c.schema,r=o.isCollapsed,s=o.getFirstRange(),a=s.start.parent,l=s.end.parent,n.isLimit(a)||n.isLimit(l)?r||a!=l||t.deleteContent(o):r?(r=mh(i.model.schema,o.getAttributes()),ph(i,s.start),i.setSelectionAttribute(r)):(s=!(s.start.isAtStart&&s.end.isAtEnd),a=a==l,t.deleteContent(o,{leaveUnmerged:s}),s&&(a?ph(i,o.focus):i.setSelection(l,0))),this.fire("afterExecute",{writer:e})})}}function ph(e,t){e.split(t),e.setSelection(t.parent.nextSibling,0)}class bh extends Xn{constructor(e){super(e);const o=this.document;o.on("keydown",(e,t)=>{var i;this.isEnabled&&t.keyCode==Jo.enter&&(i=new Ro(o,"enter",o.selection.getFirstRange()),o.fire(i,new br(o,t.domEvent,{isSoft:t.shiftKey})),i.stop.called&&e.stop())})}observe(){}}class kh extends Ac{static get pluginName(){return"Enter"}init(){const i=this.editor,o=i.editing.view;var e=o.document;o.addObserver(bh),i.commands.add("enter",new fh(i)),this.listenTo(e,"enter",(e,t)=>{t.preventDefault(),t.isSoft||(i.execute("enter"),o.scrollToTheSelection())},{priority:"low"})}}class wh{constructor(e,t=20){this.model=e,this.size=0,this.limit=t,this.isLocked=!1,this._changeCallback=(e,t)=>{"transparent"!=t.type&&t!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch()),this._batch}input(e){this.size+=e,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(e){this.isLocked&&!e||(this._batch=null,this.size=0)}}class vh extends Ec{constructor(e,t){super(e),this.direction=t,this._buffer=new wh(e.model,e.config.get("typing.undoStep"))}get buffer(){return this._buffer}execute(n={}){const r=this.editor.model,s=r.document;r.enqueueChange(this._buffer.batch,e=>{this._buffer.lock();const i=e.createSelection(n.selection||s.selection);var t=n.sequence||1,o=i.isCollapsed;if(i.isCollapsed&&r.modifySelection(i,{direction:this.direction,unit:n.unit}),this._shouldEntireContentBeReplacedWithParagraph(t))this._replaceEntireContentWithParagraph(e);else if(this._shouldReplaceFirstBlockWithParagraph(i,t))this.editor.execute("paragraph",{selection:i});else if(!i.isCollapsed){let t=0;
5i.getFirstRange().getMinimalFlatRanges().forEach(e=>{t+=Po(e.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),r.deleteContent(i,{doNotResetEntireContent:o,direction:this.direction}),this._buffer.input(t),e.setSelection(i),this._buffer.unlock()}})}_shouldEntireContentBeReplacedWithParagraph(e){if(1<e)return!1;const t=this.editor.model;const i=t.document.selection,o=t.schema.getLimitElement(i);if(!(i.isCollapsed&&i.containsEntireContent(o)))return!1;if(!t.schema.checkChild(o,"paragraph"))return!1;e=o.getChild(0);return!e||"paragraph"!==e.name}_replaceEntireContentWithParagraph(e){const t=this.editor.model;var i=t.document.selection,o=t.schema.getLimitElement(i),i=e.createElement("paragraph");e.remove(e.createRangeIn(o)),e.insert(i,o),e.setSelection(i,0)}_shouldReplaceFirstBlockWithParagraph(e,t){const i=this.editor.model;if(1<t||"backward"!=this.direction)return!1;if(!e.isCollapsed)return!1;var o=e.getFirstPosition();const n=i.schema.getLimitElement(o);t=n.getChild(0);return o.parent==t&&(!!e.containsEntireContent(t)&&(!!i.schema.checkChild(n,"paragraph")&&"paragraph"!=t.name))}}class _h extends Xn{constructor(n){super(n);const r=n.document;let s=0;function a(e,t,i){var o=new Ro(r,"delete",r.selection.getFirstRange());r.fire(o,new br(r,t,i)),o.stop.called&&e.stop()}r.on("keyup",(e,t)=>{t.keyCode!=Jo.delete&&t.keyCode!=Jo.backspace||(s=0)}),r.on("keydown",(e,t)=>{const i={};if(t.keyCode==Jo.delete)i.direction="forward",i.unit="character";else{if(t.keyCode!=Jo.backspace)return;i.direction="backward",i.unit="codePoint"}var o=Uo.isMac?t.altKey:t.ctrlKey;i.unit=o?"word":i.unit,i.sequence=++s,a(e,t.domEvent,i)}),Uo.isAndroid&&r.on("beforeinput",(e,t)=>{if("deleteContentBackward"==t.domEvent.inputType){const o={unit:"codepoint",direction:"backward",sequence:1};var i=t.domTarget.ownerDocument.defaultView.getSelection();i.anchorNode==i.focusNode&&i.anchorOffset+1!=i.focusOffset&&(o.selectionToRemove=n.domConverter.domSelectionToView(i)),a(e,t.domEvent,o)}})}observe(){}}class yh extends Ac{static get pluginName(){return"Delete"}init(){const s=this.editor,a=s.editing.view;var e=a.document;a.addObserver(_h);var t=new vh(s,"forward");if(s.commands.add("deleteForward",t),s.commands.add("forwardDelete",t),s.commands.add("delete",new vh(s,"backward")),this.listenTo(e,"delete",(e,t)=>{const i={unit:t.unit,sequence:t.sequence};if(t.selectionToRemove){const o=s.model.createSelection(),n=[];for(const r of t.selectionToRemove.getRanges())n.push(s.editing.mapper.toModelRange(r));o.setTo(n),i.selection=o}s.execute("forward"==t.direction?"deleteForward":"delete",i),t.preventDefault(),a.scrollToTheSelection()},{priority:"low"}),Uo.isAndroid){let o=null;this.listenTo(e,"delete",(e,t)=>{t=t.domTarget.ownerDocument.defaultView.getSelection();o={anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}},{priority:"lowest"}),this.listenTo(e,"keyup",(e,t)=>{if(o){const i=t.domTarget.ownerDocument.defaultView.getSelection();i.collapse(o.anchorNode,o.anchorOffset),i.extend(o.focusNode,o.focusOffset),o=null}})}}}class xh{constructor(){this._stack=[]}add(e,t){var i=this._stack,o=i[0];this._insertDescriptor(e);i=i[0];o===i||Ch(o,i)||this.fire("change:top",{oldDescriptor:o,newDescriptor:i,writer:t})}remove(e,t){var i=this._stack,o=i[0];this._removeDescriptor(e);i=i[0];o===i||Ch(o,i)||this.fire("change:top",{oldDescriptor:o,newDescriptor:i,writer:t})}_insertDescriptor(t){const i=this._stack;var o=i.findIndex(e=>e.id===t.id);if(!Ch(t,i[o])){-1<o&&i.splice(o,1);let e=0;for(;i[e]&&function(e,t){{if(e.priority>t.priority)return!0;if(e.priority<t.priority)return!1}return Ah(e.classes)>Ah(t.classes)}(i[e],t);)e++;i.splice(e,0,t)}}_removeDescriptor(t){const e=this._stack;var i=e.findIndex(e=>e.id===t);-1<i&&e.splice(i,1)}}function Ch(e,t){return e&&t&&e.priority==t.priority&&Ah(e.classes)==Ah(t.classes)}function Ah(e){return Array.isArray(e)?e.sort().join(","):e}Gt(xh,Lt);var Th='<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M4 0v1H1v3H0V.5A.5.5 0 0 1 .5 0H4zm8 0h3.5a.5.5 0 0 1 .5.5V4h-1V1h-3V0zM4 16H.5a.5.5 0 0 1-.5-.5V12h1v3h3v1zm8 0v-1h3v-3h1v3.5a.5.5 0 0 1-.5.5H12z"/><path fill-opacity=".256" d="M1 1h14v14H1z"/><g class="ck-icon__selected-indicator"><path d="M7 0h2v1H7V0zM0 7h1v2H0V7zm15 0h1v2h-1V7zm-8 8h2v1H7v-1z"/><path fill-opacity=".254" d="M1 1h14v14H1z"/></g></svg>';const Eh="ck-widget",Ph="ck-widget_selected";function Sh(e){return!!e.is("element")&&!!e.getCustomProperty("widget")}function Ih(e,t,i={}
5){if(!e.is("containerElement"))throw new Bt.a("widget-to-widget-wrong-element-type",null,{element:e});var o,n;return t.setAttribute("contenteditable","false",e),t.addClass(Eh,e),t.setCustomProperty("widget",!0,e),e.getFillerOffset=Bh,i.label&&(n=i.label,t.setCustomProperty("widgetLabel",n,e)),i.hasSelectionHandle&&(o=e,i=(n=t).createUIElement("div",{class:"ck ck-widget__selection-handle"},function(e){const t=this.toDomElement(e),i=new dc;return i.set("content",Th),i.render(),t.appendChild(i.element),t}),n.insert(n.createPositionAt(o,0),i),n.addClass(["ck-widget_with-selection-handle"],o)),Vh(e,t,Rh,Oh),e}function Rh(e,t,i){if(t.classes&&i.addClass(Xt(t.classes),e),t.attributes)for(const o in t.attributes)i.setAttribute(o,t.attributes[o],e)}function Oh(e,t,i){if(t.classes&&i.removeClass(Xt(t.classes),e),t.attributes)for(const o in t.attributes)i.removeAttribute(o,e)}function Vh(i,e,o,n){const r=new xh;r.on("change:top",(e,t)=>{t.oldDescriptor&&n(i,t.oldDescriptor,t.writer),t.newDescriptor&&o(i,t.newDescriptor,t.writer)}),e.setCustomProperty("addHighlight",(e,t,i)=>r.add(t,i),i),e.setCustomProperty("removeHighlight",(e,t,i)=>r.remove(t,i),i)}function Mh(o,n){return n.addClass(["ck-editor__editable","ck-editor__nested-editable"],o),n.setAttribute("contenteditable",o.isReadOnly?"false":"true",o),o.on("change:isReadOnly",(e,t,i)=>{n.setAttribute("contenteditable",i?"false":"true",o)}),o.on("change:isFocused",(e,t,i)=>{i?n.addClass("ck-editor__nested-editable_focused",o):n.removeClass("ck-editor__nested-editable_focused",o)}),o}function Nh(e,t){var i=e.getSelectedElement();if(i){var o=Lh(e);if(o)return t.createRange(t.createPositionAt(i,o));if(t.schema.isObject(i)&&!t.schema.isInline(i))return t.createRangeOn(i)}o=e.getSelectedBlocks().next().value;if(o){if(o.isEmpty)return t.createRange(t.createPositionAt(o,0));i=t.createPositionAfter(o);return e.focus.isTouching(i)?t.createRange(i):t.createRange(t.createPositionBefore(o))}return t.createRange(e.focus)}function zh(e,t){const i=new Wr(Fn.window);var o=i.getIntersection(e),n=t.height+rd.arrowVerticalOffset;if(e.top-n>i.top||e.bottom+n<i.bottom)return null;o=o||e,t=o.left+o.width/2-t.width/2;return{top:Math.max(e.top,0)+rd.arrowVerticalOffset,left:t,name:"arrow_n"}}function Bh(){return null}const Fh="widget-type-around";function Dh(e,t,i){return e&&Sh(e)&&!i.isInline(t)}function Lh(e){return e.getAttribute(Fh)}function Hh(e){let n=null;const r=e.model,s=e.editing.view,a=e.commands.get("input");function i(e){var t=r.document,i=s.document.isComposing,o=n&&n.isEqual(t.selection);n=null,a.isEnabled&&(Wh(e)||t.selection.isCollapsed||i&&229===e.keyCode||!i&&229===e.keyCode&&o||l())}function l(){const e=a.buffer;e.lock();var t=e.batch;a._batches.add(t),r.enqueueChange(t,()=>{r.deleteContent(r.document.selection)}),e.unlock()}Uo.isAndroid?s.document.on("beforeinput",(e,t)=>i(t),{priority:"lowest"}):s.document.on("keydown",(e,t)=>i(t),{priority:"lowest"}),s.document.on("compositionstart",function(){const e=r.document,t=1!==e.selection.rangeCount||e.selection.getFirstRange().isFlat;e.selection.isCollapsed||t||l()},{priority:"lowest"}),s.document.on("compositionend",()=>{n=r.createSelection(r.document.selection)},{priority:"lowest"})}const jh=[Xo("arrowUp"),Xo("arrowRight"),Xo("arrowDown"),Xo("arrowLeft"),9,16,17,18,19,20,27,33,34,35,36,45,91,93,144,145,173,174,175,176,177,178,179,255];for(let e=112;e<=135;e++)jh.push(e);function Wh(e){return e.ctrlKey||e.metaKey||jh.includes(e.keyCode)}i(65);const $h=["before","after"],qh=(new DOMParser).parseFromString('<svg viewBox="0 0 10 8" xmlns="http://www.w3.org/2000/svg"><path d="M9.055.263v3.972h-6.77M1 4.216l2-2.038m-2 2 2 2.038"/></svg>',"image/svg+xml").firstChild,Uh="ck-widget__type-around_disabled";class Kh extends Ac{static get pluginName(){return"WidgetTypeAround"}static get requires(){return[kh,yh]}constructor(e){super(e),this._currentFakeCaretModelElement=null}init(){const o=this.editor,n=o.editing.view;this.on("change:isEnabled",(e,t,i)=>{n.change(e=>{for(const t of n.document.roots)i?e.removeClass(Uh,t):e.addClass(Uh,t)}),i||o.model.change(e=>{e.removeSelectionAttribute(Fh)})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableDeleteContentIntegration()}destroy(){this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const i=this.editor,o=i.editing.view;i.execute("insertParagraph",{position:i.model.createPositionAt(e,t)}),o.focus(),o.scrollToTheSelection()}_listenToIfEnabled(e,t,i,o){this.listenTo(e,t,(...e)=>{this.isEnabled&&i(...e)},o)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor.model.document.selection;var t=Lh(e);if(!t)return!1;var i=e.getSelectedElement();return this._insertParagraph(i,t),!0}_enableTypeAroundUIInjection(){const e=this.editor,r=e.model.schema,t=e.locale.t,s={before:t("Insert paragraph before block"),after:t("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(e,t,i)=>{var o,n=i.mapper.toViewElement(t.item);Dh(n,t.item,r)&&(t=i.writer,o=s,i=n,n=t.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(e){e=this.toDomElement(e);return function(e,t){for(const i of $h){const o=new Ol({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${i}`],title:t[i]},children:[e.ownerDocument.importNode(qh,!0)]});e.appendChild(o.render())}}(e,o),function(e){const t=new Ol({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});e.appendChild(t.render())}(e),e}),t.insert(t.createPositionAt(i,"end"),n))},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const o=this.editor;var e=o.model;
5const t=e.document.selection,s=e.schema;var i=o.editing.view;function a(e){return`ck-widget_type-around_show-fake-caret_${e}`}this._listenToIfEnabled(i.document,"arrowKey",(e,t)=>{this._handleArrowKeyPress(e,t)},{context:[Sh,"$text"],priority:"high"}),this._listenToIfEnabled(t,"change:range",(e,t)=>{t.directChange&&o.model.change(e=>{e.removeSelectionAttribute(Fh)})}),this._listenToIfEnabled(e.document,"change:data",()=>{var e=t.getSelectedElement();if(e&&Dh(o.editing.mapper.toViewElement(e),e,s))return;o.model.change(e=>{e.removeSelectionAttribute(Fh)})}),this._listenToIfEnabled(o.editing.downcastDispatcher,"selection",(e,t,i)=>{const o=i.writer;if(this._currentFakeCaretModelElement){const r=i.mapper.toViewElement(this._currentFakeCaretModelElement);r&&(o.removeClass($h.map(a),r),this._currentFakeCaretModelElement=null)}var n=t.selection.getSelectedElement();if(n){const r=i.mapper.toViewElement(n);!Dh(r,n,s)||(t=Lh(t.selection))&&(o.addClass(a(t),r),this._currentFakeCaretModelElement=n)}}),this._listenToIfEnabled(o.ui.focusTracker,"change:isFocused",(e,t,i)=>{i||o.model.change(e=>{e.removeSelectionAttribute(Fh)})})}_handleArrowKeyPress(e,t){const i=this.editor;var o=i.model,n=o.document.selection,r=o.schema;const s=i.editing.view;var a=tn(t.keyCode,i.locale.contentLanguageDirection),o=s.document.selection.getSelectedElement();let l;Dh(o,i.editing.mapper.toModelElement(o),r)?l=this._handleArrowKeyPressOnSelectedWidget(a):n.isCollapsed&&(l=this._handleArrowKeyPressWhenSelectionNextToAWidget(a)),l&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(t){const e=this.editor.model,i=Lh(e.document.selection);return e.change(e=>{return i?i!==(t?"after":"before")&&(e.removeSelectionAttribute(Fh),!0):(e.setSelectionAttribute(Fh,t?"after":"before"),!0)})}_handleArrowKeyPressWhenSelectionNextToAWidget(t){const e=this.editor,i=e.model;var o=i.schema;const n=e.plugins.get("Widget"),r=n._getObjectElementNextToSelection(t);return!!Dh(e.editing.mapper.toViewElement(r),r,o)&&(i.change(e=>{n._setSelectionOverElement(r),e.setSelectionAttribute(Fh,t?"before":"after")}),!0)}_enableInsertingParagraphsOnButtonClick(){const r=this.editor,s=r.editing.view;this._listenToIfEnabled(s.document,"mousedown",(e,t)=>{var i,o,n=t.domTarget.closest(".ck-widget__type-around__button");n&&(i=n.classList.contains("ck-widget__type-around__button_before")?"before":"after",o=n,n=s.domConverter,o=o.closest(".ck-widget"),o=n.mapDomToView(o),o=r.editing.mapper.toModelElement(o),this._insertParagraph(o,i),t.preventDefault(),e.stop())})}_enableInsertingParagraphsOnEnterKeypress(){const s=this.editor,a=s.model.document.selection;var e=s.editing.view;this._listenToIfEnabled(e.document,"enter",(t,i)=>{if("atTarget"==t.eventPhase){var o=a.getSelectedElement(),n=s.editing.mapper.toViewElement(o),r=s.model.schema;let e;this._insertParagraphAccordingToFakeCaretPosition()?e=!0:Dh(n,o,r)&&(this._insertParagraph(o,i.isSoft?"before":"after"),e=!0),e&&(i.preventDefault(),t.stop())}},{context:Sh})}_enableInsertingParagraphsOnTypingKeystroke(){var e=this.editor.editing.view;const i=[Jo.enter,Jo.delete,Jo.backspace];this._listenToIfEnabled(e.document,"keydown",(e,t)=>{i.includes(t.keyCode)||Wh(t)||this._insertParagraphAccordingToFakeCaretPosition()},{priority:"high"})}_enableDeleteIntegration(){const l=this.editor;var e=l.editing.view;const c=l.model,d=c.schema;this._listenToIfEnabled(e.document,"delete",(e,t)=>{if("atTarget"==e.eventPhase){var i=Lh(c.document.selection);if(i){var o=t.direction,n=c.document.selection.getSelectedElement();const r="forward"==o;if("before"===i==r)l.execute("delete",{selection:c.createSelection(n,"on")});else{const s=d.getNearestSelectionRange(c.createPositionAt(n,i),o);if(s)if(s.isCollapsed){const a=c.createSelection(s.start);c.modifySelection(a,{direction:o}),a.focus.isEqual(s.start)?(o=function(e,t){let i=t;for(const o of t.getAncestors({parentFirst:!0})){if(1<o.childCount||e.isLimit(o))break;i=o}return i}(d,s.start.parent),c.deleteContent(c.createSelection(o,"on"),{doNotAutoparagraph:!0})):c.change(e=>{e.setSelection(s),l.execute(r?"deleteForward":"delete")})}else c.change(e=>{e.setSelection(s),l.execute(r?"deleteForward":"delete")})}t.preventDefault(),e.stop()}}},{context:Sh})}_enableInsertContentIntegration(){var e=this.editor;const r=this.editor.model,s=r.document.selection;this._listenToIfEnabled(e.model,"insertContent",(e,[o,t])=>
5{if(!t||t.is("documentSelection")){const n=Lh(s);if(n)return e.stop(),r.change(e=>{var t=s.getSelectedElement(),i=r.createPositionAt(t,n),t=e.createSelection(i),i=r.insertContent(o,t);return e.setSelection(t),i})}},{priority:"high"})}_enableDeleteContentIntegration(){var e=this.editor;const i=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",(e,[t])=>{t&&!t.is("documentSelection")||Lh(i)&&e.stop()},{priority:"high"})}}i(67);function Gh(l){const c=l.model;return(e,t)=>{var i=t.keyCode==Jo.arrowup,o=t.keyCode==Jo.arrowdown;const n=t.shiftKey,r=c.document.selection;if(i||o){const s=o;if(!n||(i=r,o=s,i.isCollapsed||i.isBackward!=o)){const a=function(e,t,i){const o=e.model;{if(i){const n=t.isCollapsed?t.focus:t.getLastPosition();i=Jh(o,n,"forward");if(!i)return null;i=o.createRange(n,i),i=Yh(o.schema,i,"backward");return i&&n.isBefore(i)?o.createRange(n,i):null}{const r=t.isCollapsed?t.focus:t.getFirstPosition();t=Jh(o,r,"backward");if(!t)return null;t=o.createRange(t,r),t=Yh(o.schema,t,"forward");return t&&r.isAfter(t)?o.createRange(t,r):null}}}(l,r,s);a&&!a.isCollapsed&&(!function(e,t,i){const o=e.model,n=e.view.domConverter;i&&(i=o.createSelection(t.start),o.modifySelection(i),i.focus.isAtEnd||t.start.isEqual(i.focus)||(t=o.createRange(i.focus,t.end)));t=e.mapper.toViewRange(t),t=n.viewRangeToDom(t),t=Wr.getDomRangeRects(t);let r;for(const s of t)if(void 0!==r){if(Math.round(s.top)>=r)return!1;r=Math.max(r,Math.round(s.bottom))}else r=Math.round(s.bottom);return!0}(l,a,s)||(c.change(e=>{var t=s?a.end:a.start;if(n){const i=c.createSelection(r.anchor);i.setFocus(t),e.setSelection(i)}else e.setSelection(t)}),e.stop(),t.preventDefault(),t.stopPropagation()))}}}}function Jh(e,t,i){const o=e.schema,n=e.createRangeIn(t.root);var r,s,a,l="forward"==i?"elementStart":"elementEnd";for({previousPosition:r,item:s,type:a}of n.getWalker({startPosition:t,direction:i})){if(o.isLimit(s)&&!o.isInline(s))return r;if(a==l&&o.isBlock(s))return null}return null}function Yh(e,t,i){var o,n="backward"==i?t.end:t.start;if(e.checkChild(n,"$text"))return n;for({nextPosition:o}of t.getWalker({direction:i}))if(e.checkChild(o,"$text"))return o}class Xh extends Ac{static get pluginName(){return"Widget"}static get requires(){return[Kh,yh]}init(){const r=this.editor,e=r.editing.view;var t=e.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",(e,t,i)=>{const o=i.writer,n=t.selection;n.isCollapsed||(!(t=n.getSelectedElement())||Sh(t=r.editing.mapper.toViewElement(t))&&i.consumable.consume(n,"selection")&&o.setSelection(o.createRangeOn(t),{fake:!0,label:function(e){const t=e.getCustomProperty("widgetLabel");return t?"function"==typeof t?t():t:""}(t)}))}),this.editor.editing.downcastDispatcher.on("selection",(e,t,i)=>{this._clearPreviouslySelectedWidgets(i.writer);const o=i.writer,n=o.document.selection;let r=null;for(const c of n.getRanges())for(const d of c){var s=d.item;!Sh(s)||(a=s,(l=r)&&Array.from(a.getAncestors()).includes(l))||(o.addClass(Ph,s),this._previouslySelected.add(s),r=s)}var a,l},{priority:"low"}),e.addObserver(Cd),this.listenTo(t,"mousedown",(...e)=>this._onMousedown(...e)),this.listenTo(t,"arrowKey",(...e)=>{this._handleSelectionChangeOnArrowKeyPress(...e)},{context:[Sh,"$text"]}),this.listenTo(t,"arrowKey",(...e)=>{this._preventDefaultOnArrowKeyPress(...e)},{context:"$root"}),this.listenTo(t,"arrowKey",Gh(this.editor.editing),{context:"$text"}),this.listenTo(t,"delete",(e,t)=>{this._handleDelete("forward"==t.direction)&&(t.preventDefault(),e.stop())},{context:"$root"})}_onMousedown(e,t){const i=this.editor,o=i.editing.view;var n=o.document;let r=t.target;if(function(e){for(;e;){if(e.is("editableElement")&&!e.is("rootElement"))return!0;if(Sh(e))return!1;e=e.parent}return!1}(r)){if((Uo.isSafari||Uo.isGecko)&&3<=t.domEvent.detail){const a=i.editing.mapper;var s=r.is("attributeElement")?r.findAncestor(e=>!e.is("attributeElement")):r;const l=a.toModelElement(s);t.preventDefault(),this.editor.model.change(e=>{e.setSelection(l,"in")})}}else if(Sh(r)||(r=r.findAncestor(Sh),r)){Uo.isAndroid&&t.preventDefault(),n.isFocused||o.focus();const l=i.editing.mapper.toModelElement(r);this._setSelectionOverElement(l)}}
5_handleSelectionChangeOnArrowKeyPress(e,t){var i=t.keyCode;const o=this.editor.model,n=o.schema,r=o.document.selection;var s=r.getSelectedElement(),i=tn(i,this.editor.locale.contentLanguageDirection);if(s&&n.isObject(s)){s=i?r.getLastPosition():r.getFirstPosition();const a=n.getNearestSelectionRange(s,i?"forward":"backward");a&&(o.change(e=>{e.setSelection(a)}),t.preventDefault(),e.stop())}else!r.isCollapsed||(i=this._getObjectElementNextToSelection(i))&&n.isObject(i)&&(this._setSelectionOverElement(i),t.preventDefault(),e.stop())}_preventDefaultOnArrowKeyPress(e,t){const i=this.editor.model,o=i.schema;var n=i.document.selection.getSelectedElement();n&&o.isObject(n)&&(t.preventDefault(),e.stop())}_handleDelete(e){if(!this.editor.isReadOnly){const o=this.editor.model.document.selection;if(o.isCollapsed){const n=this._getObjectElementNextToSelection(e);return n?(this.editor.model.change(e=>{let t=o.anchor.parent;for(;t.isEmpty;){var i=t;t=i.parent,e.remove(i)}this._setSelectionOverElement(n)}),!0):void 0}}}_setSelectionOverElement(t){this.editor.model.change(e=>{e.setSelection(e.createRangeOn(t))})}_getObjectElementNextToSelection(e){const t=this.editor.model,i=t.schema;var o=t.document.selection,o=t.createSelection(o);t.modifySelection(o,{direction:e?"forward":"backward"});o=e?o.focus.nodeBefore:o.focus.nodeAfter;return o&&i.isObject(o)?o:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass(Ph,t);this._previouslySelected.clear()}}var Qh=function(e,t,i){var o=!0,n=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return V(i)&&(o="leading"in i?!!i.leading:o,n="trailing"in i?!!i.trailing:n),Or(e,t,{leading:o,maxWait:t,trailing:n})};i(69);class Zh extends Ac{static get pluginName(){return"DragDrop"}static get requires(){return[gh,Xh]}init(){var e=this.editor;const t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,this._updateDropMarkerThrottled=Qh(e=>this._updateDropMarker(e),40),this._removeDropMarkerDelayed=iu(()=>this._removeDropMarker(),40),this._clearDraggableAttributesDelayed=iu(()=>this._clearDraggableAttributes(),40),t.addObserver(hh),t.addObserver(Cd),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDropMarker(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",(e,t,i)=>{i?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(e,t,i)=>{i||this._finalizeDragging(!1)}),Uo.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._updateDropMarkerThrottled.cancel(),this._removeDropMarkerDelayed.cancel(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const r=this.editor,s=r.model,a=s.document,e=r.editing.view,l=e.document;this.listenTo(l,"dragstart",(e,t)=>{const i=a.selection;var o,n;t.target&&t.target.is("editableElement")?t.preventDefault():((o=t.target?ou(t.target):null)?(o=r.editing.mapper.toModelElement(o),this._draggedRange=Os.fromRange(s.createRangeOn(o)),r.plugins.has("WidgetToolbarRepository")&&r.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop")):l.selection.isCollapsed||((n=l.selection.getSelectedElement())&&Sh(n)||(this._draggedRange=Os.fromRange(i.getFirstRange()))),this._draggedRange?(this._draggingUid=Nt(),t.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",t.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid),n=s.createSelection(this._draggedRange.toRange()),n=r.data.toView(s.getSelectedContent(n)),l.fire("clipboardOutput",{dataTransfer:t.dataTransfer,content:n,method:e.name}),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")):t.preventDefault())},{priority:"low"}),this.listenTo(l,"dragend",(e,t)=>{this._finalizeDragging(!t.dataTransfer.isCanceled&&"move"==t.dataTransfer.dropEffect)},{priority:"low"}),this.listenTo(l,"dragenter",()=>{this.isEnabled&&e.focus()}),this.listenTo(l,"dragleave",()=>{this._removeDropMarkerDelayed()}),this.listenTo(l,"dragging",(e,t)=>{var i;this.isEnabled?(this._removeDropMarkerDelayed.cancel(),i=eu(r,t.targetRanges,t.target),this._draggedRange||(t.dataTransfer.dropEffect="copy"),Uo.isGecko||("copy"==t.dataTransfer.effectAllowed?t.dataTransfer.dropEffect="copy":["all","copyMove"].includes(t.dataTransfer.effectAllowed)&&(t.dataTransfer.dropEffect="move")),i&&this._updateDropMarkerThrottled(i)):t.dataTransfer.dropEffect="none"},{priority:"low"})}_setupClipboardInputIntegration(){const o=this.editor;var e=o.editing.view.document;this.listenTo(e,"clipboardInput",(e,t)=>{if("drop"==t.method){var i=eu(o,t.targetRanges,t.target);return(this._removeDropMarker(),i)?(this._draggedRange&&this._draggingUid!=t.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),"move"==tu(t.dataTransfer)&&this._draggedRange&&this._draggedRange.containsRange(i,!0)?(this._finalizeDragging(!1),void e.stop()):void(t.targetRanges=[o.editing.mapper.toViewRange(i)])):(this._finalizeDragging(!1),void e.stop())}},{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(gh);e.on("contentInsertion",(e,t)=>{if(this.isEnabled&&"drop"===t.method){const i=t.targetRanges.map(e=>this.editor.editing.mapper.toModelRange(e));this.editor.model.change(e=>e.setSelection(i))}},{priority:"high"}),e.on("contentInsertion",(e,t)=>{var i;this.isEnabled&&"drop"===t.method&&(i="move"==tu(t.dataTransfer),t=!t.resultRange||!t.resultRange.isCollapsed,this._finalizeDragging(t&&i))},{priority:"lowest"})}_setupDraggableAttributeHandling(){const o=this.editor,n=o.editing.view,r=n.document;this.listenTo(r,"mousedown",(e,i)=>{if(!Uo.isAndroid&&i){this._clearDraggableAttributesDelayed.cancel();let t=ou(i.target);!Uo.isBlink||o.isReadOnly||t||r.selection.isCollapsed||((i=r.selection.getSelectedElement())&&Sh(i)||(t=r.selection.editableElement)),t&&(n.change(e=>{e.setAttribute("draggable","true",t)}),this._draggableElement=o.editing.mapper.toModelElement(t))}}),this.listenTo(r,"mouseup",()=>{Uo.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){const t=this.editor.editing;t.view.change(e=>{this._draggableElement&&"$graveyard"!=this._draggableElement.root.rootName&&e.removeAttribute("draggable",t.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_setupDropMarker(){const i=this.editor;i.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),i.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(e,{writer
5:t})=>{if(i.model.schema.checkChild(e.markerRange.start,"$text"))return t.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},function(e){const t=this.toDomElement(e);return t.innerHTML="&NoBreak;<span></span>&NoBreak;",t})}})}_updateDropMarker(t){const e=this.editor,i=e.model.markers;e.model.change(e=>{i.has("drop-target")?i.get("drop-target").getRange().isEqual(t)||e.updateMarker("drop-target",{range:t}):e.addMarker("drop-target",{range:t,usingOperation:!1,affectsData:!1})})}_removeDropMarker(){const e=this.editor.model;this._removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),e.markers.has("drop-target")&&e.change(e=>{e.removeMarker("drop-target")})}_finalizeDragging(e){const t=this.editor,i=t.model;this._removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._draggedRange&&(e&&this.isEnabled&&i.deleteContent(i.createSelection(this._draggedRange),{doNotAutoparagraph:!0}),this._draggedRange.detach(),this._draggedRange=null)}}function eu(e,t,i){const o=e.model,n=e.editing.mapper;let r=null;t=t?t[0].start:null;if(i.is("uiElement")&&(i=i.parent),r=function(e,t){const i=e.model,o=e.editing.mapper;if(Sh(t))return i.createRangeOn(o.toModelElement(t));if(!t.is("editableElement")){t=t.findAncestor(e=>Sh(e)||e.is("editableElement"));if(Sh(t))return i.createRangeOn(o.toModelElement(t))}return null}(e,i),r)return r;i=function(e,t){const i=e.editing.mapper,o=e.editing.view,n=i.toModelElement(t);if(n)return n;t=o.createPositionBefore(t),t=i.findMappedViewAncestor(t);return i.toModelElement(t)}(e,i),t=t?n.toModelPosition(t):null;return t?(r=function(e,t,i){const o=e.model;if(!o.schema.checkChild(i,"$block"))return null;i=o.createPositionAt(i,0),i=t.path.slice(0,i.path.length),i=o.createPositionFromPath(t.root,i),i=i.nodeAfter;if(i&&o.schema.isObject(i))return o.createRangeOn(i);return null}(e,t,i),r||(r=o.schema.getNearestSelectionRange(t,Uo.isGecko?"forward":"backward"),r||function(e,t){const i=e.model;for(;t;){if(i.schema.isObject(t))return i.createRangeOn(t);t=t.parent}}(e,t.parent))):function(e,t){const i=e.model,o=i.schema,n=i.createPositionAt(t,0);return o.getNearestSelectionRange(n,"forward")}(e,i)}function tu(e){return Uo.isGecko?e.dropEffect:["all","copyMove"].includes(e.effectAllowed)?"move":"copy"}function iu(t,i){let o;function n(...e){n.cancel(),o=setTimeout(()=>t(...e),i)}return n.cancel=()=>{clearTimeout(o)},n}function ou(e){if(e.is("editableElement"))return null;if(e.hasClass("ck-widget__selection-handle"))return e.findAncestor(Sh);if(Sh(e))return e;e=e.findAncestor(e=>Sh(e)||e.is("editableElement"));return Sh(e)?e:null}class nu extends Ac{static get pluginName(){return"PastePlainText"}static get requires(){return[gh]}init(){const e=this.editor,r=e.model,t=e.editing.view;var i=t.document;const s=r.document.selection;let o=!1;t.addObserver(hh),this.listenTo(i,"keydown",(e,t)=>{o=t.shiftKey}),e.plugins.get(gh).on("contentInsertion",(e,n)=>{(o||function(e,t){if(1<e.childCount)return!1;const i=e.getChild(0);if(t.isObject(i))return!1;return 0==[...i.getAttributeKeys()].length}(n.content,r.schema))&&r.change(e=>{const t=Array.from(s.getAttributes()).filter(([e])=>r.schema.getAttributeProperties(e).isFormatting);s.isCollapsed||r.deleteContent(s,{doNotAutoparagraph:!0}),t.push(...s.getAttributes());const i=e.createRangeIn(n.content);for(const o of i.getItems())o.is("$textProxy")&&e.setAttributes(t,o)})})}}class ru extends Ac{static get pluginName(){return"Clipboard"}static get requires(){return[gh,Zh,nu]}}class su extends Ec{execute(){const l=this.editor.model,c=l.document;l.change(e=>{var t,i,o,n,r,s,a;t=l,i=e,o=c.selection,n=o.isCollapsed,r=o.getFirstRange(),s=r.start.parent,a=r.end.parent,s=s==a,n?(n=mh(t.schema,o.getAttributes()),au(t,i,r.end),i.removeSelectionAttribute(o.getAttributeKeys()),i.setSelectionAttribute(n)):(r=!(r.start.isAtStart&&r.end.isAtEnd),t.deleteContent(o,{leaveUnmerged:r}),s?au(t,i,o.focus):r&&i.setSelection(a,0)),this.fire("afterExecute",{writer
5:e})})}refresh(){var e=this.editor.model,t=e.document;this.isEnabled=function(e,t){if(1<t.rangeCount)return!1;var i=t.anchor;if(!i||!e.checkChild(i,"softBreak"))return!1;i=t.getFirstRange(),t=i.start.parent,i=i.end.parent;return!lu(t,e)&&!lu(i,e)||t===i}(e.schema,t.selection)}}function au(e,t,i){var o=t.createElement("softBreak");e.insertContent(o,i),t.setSelection(o,"after")}function lu(e,t){return!e.is("rootElement")&&(t.isLimit(e)||lu(e.parent,t))}class cu extends Ac{static get pluginName(){return"ShiftEnter"}init(){const i=this.editor,e=i.model.schema,t=i.conversion,o=i.editing.view;var n=o.document;e.register("softBreak",{allowWhere:"$text",isInline:!0}),t.for("upcast").elementToElement({model:"softBreak",view:"br"}),t.for("downcast").elementToElement({model:"softBreak",view:(e,{writer:t})=>t.createEmptyElement("br")}),o.addObserver(bh),i.commands.add("shiftEnter",new su(i)),this.listenTo(n,"enter",(e,t)=>{t.preventDefault(),t.isSoft&&(i.execute("shiftEnter"),o.scrollToTheSelection())},{priority:"low"})}}class du extends Ec{execute(){const e=this.editor.model,t=e.document.selection;let i=e.schema.getLimitElement(t);if(t.containsEntireContent(i)||!hu(e.schema,i))do{if(i=i.parent,!i)return}while(!hu(e.schema,i));e.change(e=>{e.setSelection(i,"in")})}}function hu(e,t){return e.isLimit(t)&&(e.checkChild(t,"$text")||e.checkChild(t,"paragraph"))}const uu=Qo("Ctrl+A");class gu extends Ac{static get pluginName(){return"SelectAllEditing"}init(){const i=this.editor;var e=i.editing.view.document;i.commands.add("selectAll",new du(i)),this.listenTo(e,"keydown",(e,t)=>{Xo(t)===uu&&(i.execute("selectAll"),t.preventDefault())})}}class mu extends Ac{static get pluginName(){return"SelectAllUI"}init(){const n=this.editor;n.ui.componentFactory.add("selectAll",e=>{var t=n.commands.get("selectAll");const i=new uc(e),o=e.t;return i.set({label:o("Select all"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M.75 15.5a.75.75 0 0 1 .75.75V18l.008.09A.5.5 0 0 0 2 18.5h1.75a.75.75 0 1 1 0 1.5H1.5l-.144-.007a1.5 1.5 0 0 1-1.35-1.349L0 18.5v-2.25a.75.75 0 0 1 .75-.75zm18.5 0a.75.75 0 0 1 .75.75v2.25l-.007.144a1.5 1.5 0 0 1-1.349 1.35L18.5 20h-2.25a.75.75 0 1 1 0-1.5H18a.5.5 0 0 0 .492-.41L18.5 18v-1.75a.75.75 0 0 1 .75-.75zm-10.45 3c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm.45-5.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5h8.5zM1.3 11c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5h10.5zM1.3 7c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5h-2.5a.75.75 0 1 1 0-1.5h2.5zm-5 0a.75.75 0 1 1 0 1.5h-5.5a.75.75 0 0 1 0-1.5h5.5zm-6.5-5a.75.75 0 0 1 0 1.5H2a.5.5 0 0 0-.492.41L1.5 2v1.75a.75.75 0 0 1-1.5 0V1.5l.007-.144A1.5 1.5 0 0 1 1.356.006L1.5 0h2.25zM18.5 0l.144.007a1.5 1.5 0 0 1 1.35 1.349L20 1.5v2.25a.75.75 0 1 1-1.5 0V2l-.008-.09A.5.5 0 0 0 18 1.5h-1.75a.75.75 0 1 1 0-1.5h2.25zM8.8 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6z"/></svg>',keystroke:"Ctrl+A",tooltip:!0}),i.bind("isOn","isEnabled").to(t,"value","isEnabled"),this.listenTo(i,"execute",()=>{n.execute("selectAll"),n.editing.view.focus()}),i})}}class fu extends Ac{static get requires(){return[gu,mu]}static get pluginName(){return"SelectAll"}}class pu extends Ec{constructor(e,t){super(e),this._buffer=new wh(e.model,t),this._batches=new WeakSet}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,i=t.document,o=e.text||"",n=o.length,r=e.range?t.createSelection(e.range):i.selection,s=e.resultRange;t.enqueueChange(this._buffer.batch,e=>{this._buffer.lock(),this._batches.add(this._buffer.batch),t.deleteContent(r),o&&t.insertContent(e.createText(o,i.selection.getAttributes()),r),s?e.setSelection(s):r.is("documentSelection")||e.setSelection(r),this._buffer.unlock(),this._buffer.input(n)})}}function bu(e){if(e.newChildren.length-e.oldChildren.length==1){e=function(e,t){const i=[];let o=0,n;
5return e.forEach(e=>{"equal"==e?(r(),o++):"insert"==e?(s("insert")?n.values.push(t[o]):(r(),n={type:"insert",index:o,values:[t[o]]}),o++):s("delete")?n.howMany++:(r(),n={type:"delete",index:o,howMany:1})}),r(),i;function r(){n&&(i.push(n),n=null)}function s(e){return n&&n.type==e}}(Rn(e.oldChildren,e.newChildren,ku),e.newChildren);if(!(1<e.length)){const t=e[0];if(t.values[0]&&t.values[0].is("$text"))return t}}}function ku(e,t){return e&&e.is("$text")&&t&&t.is("$text")?e.data===t.data:e===t}class wu{constructor(e){this.editor=e,this.editing=this.editor.editing}handle(e,t){if(function(e){if(0!=e.length)for(const t of e)if("children"===t.type&&!bu(t))return 1}(e))this._handleContainerChildrenMutations(e,t);else for(const i of e)this._handleTextMutation(i,t),this._handleTextNodeInsertion(i)}_handleContainerChildrenMutations(t,i){var o=function(e){const t=e.map(e=>e.node).reduce((e,t)=>e.getCommonAncestor(t,{includeSelf:!0}));if(t)return t.getAncestors({includeSelf:!0,parentFirst:!0}).find(e=>e.is("containerElement")||e.is("rootElement"))}(t);if(o){const e=this.editor.editing.view.domConverter;var n=e.mapViewToDom(o);const r=new $n(this.editor.editing.view.document),s=this.editor.data.toModel(r.domToView(n)).getChild(0),a=this.editor.editing.mapper.toModelElement(o);if(a){const l=Array.from(s.getChildren()),c=Array.from(a.getChildren()),d=l[l.length-1],h=c[c.length-1];t=d&&d.is("element","softBreak"),n=h&&!h.is("element","softBreak");t&&n&&l.pop();o=this.editor.model.schema;if(vu(l,o)&&vu(c,o)){const u=l.map(e=>e.is("$text")?e.data:"@").join("").replace(/\u00A0/g," ");t=c.map(e=>e.is("$text")?e.data:"@").join("").replace(/\u00A0/g," ");if(t!==u){var{firstChangeAt:n,insertions:o,deletions:t}=_u(Rn(t,u));let e=null;i&&(e=this.editing.mapper.toModelRange(i.getFirstRange()));o=u.substr(n,o),t=this.editor.model.createRange(this.editor.model.createPositionAt(a,n),this.editor.model.createPositionAt(a,n+t));this.editor.execute("input",{text:o,range:t,resultRange:e})}}}}}_handleTextMutation(t,i){if("text"==t.type){const s=t.newText.replace(/\u00A0/g," ");var o=t.oldText.replace(/\u00A0/g," ");if(o!==s){var{firstChangeAt:n,insertions:r,deletions:o}=_u(Rn(o,s));let e=null;i&&(e=this.editing.mapper.toModelRange(i.getFirstRange()));t=this.editing.view.createPositionAt(t.node,n);const a=this.editing.mapper.toModelPosition(t);o=this.editor.model.createRange(a,a.getShiftedBy(o)),r=s.substr(n,r);this.editor.execute("input",{text:r,range:o,resultRange:e})}}}_handleTextNodeInsertion(e){if("children"==e.type){var t=bu(e),e=this.editing.view.createPositionAt(e.node,t.index),e=this.editing.mapper.toModelPosition(e);const i=t.values[0].data;this.editor.execute("input",{text:i.replace(/\u00A0/g," "),range:this.editor.model.createRange(e)})}}}function vu(e,t){return e.every(e=>t.isInline(e))}function _u(t){let i=null,o=null;for(let e=0;e<t.length;e++)"equal"!=t[e]&&(i=null===i?e:i,o=e);let n=0,r=0;for(let e=i;e<=o;e++)"insert"!=t[e]&&n++,"delete"!=t[e]&&r++;return{insertions:r,deletions:n,firstChangeAt:i}}class yu extends Ac{static get pluginName(){return"Input"}init(){const e=this.editor;var o,t=new pu(e,e.config.get("typing.undoStep")||20);e.commands.add("input",t),Hh(e),(o=e).editing.view.document.on("mutations",(e,t,i)=>{new wu(o).handle(t,i)})}isInput(e){const t=this.editor.commands.get("input");return t._batches.has(e)}}class xu extends Ac{static get requires(){return[yu,yh]}static get pluginName(){return"Typing"}}function Cu(e,i){let o=e.start;return{text:Array.from(e.getItems()).reduce((e,t)=>t.is("$text")||t.is("$textProxy")?e+t.data:(o=i.createPositionAfter(t),""),""),range:i.createRange(o,e.end)}}class Au{constructor(e,t){this.model=e,this.testCallback=t,this.hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))}),this._startListening()}_startListening(){const i=this.model.document;this.listenTo(i.selection,"change:range",(e,{directChange:t})=>{t&&(i.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this.hasMatch=!1))}),this.listenTo(i,"change:data",(e,t)=>{"transparent"!=t.type&&this._evaluateTextBeforeSelection("data",{batch:t})})}_evaluateTextBeforeSelection(e,t={}){const i=this.model;var o=i.document.selection,{text:n,range:r}=Cu(i.createRange(i.createPositionAt(o.focus.parent,0),o.focus),i),o=this.testCallback(n);!o&&this.hasMatch&&this.fire("unmatched"),this.hasMatch=!!o,o&&(r=Object.assign(t,{text:n,range:r}),"object"==typeof o&&Object.assign(r,o),this.fire(`matched:${e}`,r))}}Gt(Au,fo);class Tu extends Ac{static get pluginName(){return"TwoStepCaretMovement"}constructor(e){super(e),this.attributes=new Set,this._overrideUid=null}init(){var e=this.editor,t=e.model,i=e.editing.view;const s=e.locale,a=t.document.selection;this.listenTo(i.document,"arrowKey",(t,i)=>{if(a.isCollapsed&&!(i.shiftKey||i.altKey||i.ctrlKey)){var o=i.keyCode==Jo.arrowright,n=i.keyCode==Jo.arrowleft;if(o||n){var r=s.contentLanguageDirection;let e=!1;e="ltr"===r&&o||"rtl"===r&&n?this._handleForwardMovement(i):this._handleBackwardMovement(i),!0===e&&t.stop()}}},{context:"$text",priority:"highest"}),this._isNextGravityRestorationSkipped=!1,this.listenTo(a,"change:range",(e,t)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!t.directChange&&Iu(a.getFirstPosition(),this.attributes)||this._restoreGravity())})}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){var t=this.attributes;const i=this.editor.model.document.selection;var o=i.getFirstPosition();return!this._isGravityOverridden&&((!o.isAtStart||!Eu(i,t))&&(Iu(o,t)?(Su(e),this._overrideGravity(),!0):void 0))}_handleBackwardMovement(e){var t=this.attributes,i=this.editor.model;const o=i.document.selection;var n=o.getFirstPosition();return this._isGravityOverridden?(Su(e),this._restoreGravity(),Pu(i,t,n),!0):n.isAtStart?!!Eu(o,t)&&(Su(e),Pu(i,t,n),!0):function(e,t){e=e.getShiftedBy(-1);return Iu(e,t)}(n,t)?n.isAtEnd&&!Eu(o,t)&&Iu(n,t)?(Su(e),Pu(i,t,n),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1):void 0}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(e=>e.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function Eu(e,t){for(const i of t)if(e.hasAttribute(i))return 1}function Pu(e,t,i){const o=i.nodeBefore;e.change(e=>{o?e.setSelectionAttribute(o.getAttributes()):e.removeSelectionAttribute(t)})}function Su(e){e.preventDefault()}function Iu(e,t){const{nodeBefore:i,nodeAfter:o}=e;for(const r of t){var n=i?i.getAttribute(r):void 0;if((o?o.getAttribute(r):void 0)!==n)return!0}return!1}var Ru=/[\\^$.*+?()[\]{}|]/g;RegExp(Ru.source);Ou('"'),Ou("'"),Ou("'"),Ou('"'),Ou('"'),Ou("'");(class extends Ac{});function Ou(e){return new RegExp(`(^|\\s)(${e})([^${e}]*)(${e})$`)}function Vu(e,t,i,o){return o.createRange(Mu(e,t,i,!0,o),Mu(e,t,i,!1,o))}
5function Mu(e,t,i,o,n){let r=e.textNode||(o?e.nodeBefore:e.nodeAfter),s=null;for(;r&&r.getAttribute(t)==i;)s=r,r=o?r.previousSibling:r.nextSibling;return s?n.createPositionAt(s,o?"before":"after"):e}function Nu(s,a,l,c){const i=s.editing.view,d=new Set;i.document.registerPostFixer(e=>{const t=s.model.document.selection;let i=!1;if(t.hasAttribute(a)){var o=Vu(t.getFirstPosition(),a,t.getAttribute(a),s.model);const n=s.editing.mapper.toViewRange(o);for(const r of n.getItems())r.is("element",l)&&!r.hasClass(c)&&(e.addClass(c,r),d.add(r),i=!0)}return i}),s.conversion.for("editingDowncast").add(e=>{function t(){i.change(e=>{for(const t of d.values())e.removeClass(c,t),d.delete(t)})}e.on("insert",t,{priority:"highest"}),e.on("remove",t,{priority:"highest"}),e.on("attribute",t,{priority:"highest"}),e.on("selection",t,{priority:"highest"})})}class zu extends Ec{constructor(e){super(e),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this.listenTo(e.data,"set",(e,t)=>{t[1]={...t[1]};const i=t[1];i.batchType||(i.batchType="transparent")},{priority:"high"}),this.listenTo(e.data,"set",(e,t)=>{"transparent"===t[1].batchType&&this.clearStack()})}refresh(){this.isEnabled=0<this._stack.length}addBatch(e){const t=this.editor.model.document.selection;var i={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:i}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,i){const o=this.editor.model,n=o.document,r=[],s=e.map(e=>e.getTransformedByOperations(i)),a=s.flat();for(const c of s){var l=c.filter(e=>e.root!=n.graveyard).filter(e=>!function(t,e){return e.some(e=>e!==t&&e.containsRange(t,!0))}(e,a));l.length&&(function(t){t.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let e=1;e<t.length;e++){const o=t[e-1];var i=o.getJoined(t[e],!0);i&&(e--,t.splice(e,2,i))}}(l),r.push(l[0]))}r.length&&o.change(e=>{e.setSelection(r,{backward:t})})}_undo(e,t){const i=this.editor.model,o=i.document;this._createdBatches.add(t);const n=e.operations.slice().filter(e=>e.isDocumentOperation);n.reverse();for(const s of n){var r=s.baseVersion+1,r=Array.from(o.history.getOperations(r));for(const a of function(e,t,i){e=e.slice(),t=t.slice();const o=new bd(i.document,i.useRelations,i.forceWeakRemove);o.setOriginalOperations(e),o.setOriginalOperations(t);var n=o.originalOperations;if(0==e.length||0==t.length)return{operationsA:e,operationsB:t,originalOperations:n};const r=new WeakMap;for(const m of e)r.set(m,0);var s,a={nextBaseVersionA:e[e.length-1].baseVersion+1,nextBaseVersionB:t[t.length-1].baseVersion+1,originalOperationsACount:e.length,originalOperationsBCount:t.length};let l=0;for(;l<e.length;){var c=e[l],d=r.get(c);if(d!=t.length){var h=t[d],u=pd(c,h,o.getContext(c,h,!0)),g=pd(h,c,o.getContext(h,c,!1));o.updateRelation(c,h),o.setOriginalOperations(u,c),o.setOriginalOperations(g,h);for(const f of u)r.set(f,d+g.length);e.splice(l,1,...u),t.splice(d,1,...g)}else l++}return i.padWithNoOps&&(s=e.length-a.originalOperationsACount,wd(e,(i=t.length-a.originalOperationsBCount)-s),wd(t,s-i)),kd(e,a.nextBaseVersionB),kd(t,a.nextBaseVersionA),{operationsA:e,operationsB:t,originalOperations:n}}([s.getReversed()],r,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA)t.addOperation(a),i.applyOperation(a),o.history.setOperationAsUndone(s,a)}}}class Bu extends zu{execute(t=null){var e=t?this._stack.findIndex(e=>e.batch==t):this._stack.length-1;const i=this._stack.splice(e,1)[0],o=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(o,()=>{this._undo(i.batch,o);var e=this.editor.model.document.history.getOperations(i.batch.baseVersion);this._restoreSelection(i.selection.ranges,i.selection.isBackward,e),this.fire("revert",i.batch,o)}),this.refresh()}}class Fu extends zu{execute(){const t=this._stack.pop(),i=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(i,()=>{var e=t.batch.operations[t.batch.operations.length-1].baseVersion+1,e=this.editor.model.document.history.getOperations(e);this._restoreSelection(t.selection.ranges,t.selection.isBackward,e),this._und
5o(t.batch,i)}),this.refresh()}}class Du extends Ac{static get pluginName(){return"UndoEditing"}constructor(e){super(e),this._batchRegistry=new WeakSet}init(){const r=this.editor;this._undoCommand=new Bu(r),this._redoCommand=new Fu(r),r.commands.add("undo",this._undoCommand),r.commands.add("redo",this._redoCommand),this.listenTo(r.model,"applyOperation",(e,t)=>{var i,o,n=t[0];n.isDocumentOperation&&(i=n.batch,o=this._redoCommand._createdBatches.has(i),t=this._undoCommand._createdBatches.has(i),this._batchRegistry.has(i)||"transparent"==i.type&&!o&&!t||(o?this._undoCommand.addBatch(i):t||(this._undoCommand.addBatch(i),this._redoCommand.clearStack(),r.model.fire("ascUndoChanged",n)),this._batchRegistry.add(i)))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(e,t,i)=>{this._redoCommand.addBatch(i)}),r.keystrokes.set("CTRL+Z","undo"),r.keystrokes.set("CTRL+Y","redo"),r.keystrokes.set("CTRL+SHIFT+Z","redo")}}var Lu='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m5.042 9.367 2.189 1.837a.75.75 0 0 1-.965 1.149l-3.788-3.18a.747.747 0 0 1-.21-.284.75.75 0 0 1 .17-.945L6.23 4.762a.75.75 0 1 1 .964 1.15L4.863 7.866h8.917A.75.75 0 0 1 14 7.9a4 4 0 1 1-1.477 7.718l.344-1.489a2.5 2.5 0 1 0 1.094-4.73l.008-.032H5.042z"/></svg>',Hu='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m14.958 9.367-2.189 1.837a.75.75 0 0 0 .965 1.149l3.788-3.18a.747.747 0 0 0 .21-.284.75.75 0 0 0-.17-.945L13.77 4.762a.75.75 0 1 0-.964 1.15l2.331 1.955H6.22A.75.75 0 0 0 6 7.9a4 4 0 1 0 1.477 7.718l-.344-1.489A2.5 2.5 0 1 1 6.039 9.4l-.008-.032h8.927z"/></svg>';class ju extends Ac{static get pluginName(){return"UndoUI"}init(){var e=this.editor,t=e.locale;const i=e.t;e="ltr"==t.uiLanguageDirection?Lu:Hu,t="ltr"==t.uiLanguageDirection?Hu:Lu;this._addButton("undo",i("Undo"),"CTRL+Z",e),this._addButton("redo",i("Redo"),"CTRL+Y",t)}_addButton(o,n,r,s){const a=this.editor;a.ui.componentFactory.add(o,e=>{var t=a.commands.get(o);const i=new uc(e);return i.set({label:n,icon:s,keystroke:r,tooltip:!0}),i.bind("isEnabled").to(t,"isEnabled"),this.listenTo(i,"execute",()=>{a.execute(o),a.editing.view.focus()}),i})}}class Wu extends Ac{static get requires(){return[Du,ju]}static get pluginName(){return"Undo"}}class $u extends Ac{static get requires(){return[ru,kh,fu,cu,xu,Wu]}static get pluginName(){return"Essentials"}}const qu=["left","right","center","justify"];function Uu(e){return qu.includes(e)}function Ku(e,t){return"rtl"==t.contentLanguageDirection?"right"===e:"left"===e}function Gu(n){const e=n.map(e=>{let t;return t="string"==typeof e?{name:e}:e,t}).filter(e=>{var t=!!qu.includes(e.name);return t||Object(Bt.b)("alignment-config-name-not-recognized",{option:e}),t});var t=e.filter(e=>!!e.className).length;if(t&&t<e.length)throw new Bt.a("alignment-config-classnames-are-missing",{configuredOptions:n});return e.forEach((t,e,i)=>{const o=i.slice(e+1);if(o.some(e=>e.name==t.name))throw new Bt.a("alignment-config-name-already-defined",{option:t,configuredOptions:n});if(t.className&&o.some(e=>e.className==t.className))throw new Bt.a("alignment-config-classname-already-defined",{option:t,configuredOptions:n})}),e}const Ju="alignment";class Yu extends Ec{refresh(){var e=this.editor.locale;const t=Yr(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=!!t&&this._canBeAligned(t),this.isEnabled&&t.hasAttribute("alignment")?this.value=t.getAttribute("alignment"):this.value="rtl"===e.contentLanguageDirection?"right":"left"}execute(e={}){var t=this.editor;const o=t.locale,i=t.model,n=i.document,r=e.value;i.change(e=>{const t=Array.from(n.selection.getSelectedBlocks()).filter(e=>this._canBeAligned(e));var i=t[0].getAttribute("alignment");Ku(r,o)||i===r||!r?function(e,t){for(const i of e)t.removeAttribute(Ju,i)}(t,e):function(e,t,i){for(const o of e)t.setAttribute(Ju,i,o)}(t,e,r)})}_canBeAligned(e){return this.editor.model.schema.checkAttribute(e,Ju)}}class Xu extends Ac{static get pluginName(){return"AlignmentEditing"}constructor(e){super(e),e.config.define("alignment",{options:[...qu.map(e=>({name:e}))]})}init(){const e=this.editor,t=e.locale,i=e.model.schema,o=Gu(e.config.get("alignment.options")),n=o.filter(e=>Uu(e.name)&&!Ku(e.name,t));var r=n.some(e=>!!e.className);i.extend("$block",{allowAttributes:"alignment"}),e.model.schema.setAttributeProperties("alignment",{isFormatting:!0}),r?e.conversion.attributeToAttribute(function(e){const t={model:{key:"alignment",values:e.map(e=>e.name)}
5,view:{}};for(const i of e)t.view[i.name]={key:"class",value:i.className};return t}(n)):e.conversion.for("downcast").attributeToAttribute(function(e){const t={model:{key:"alignment",values:e.map(e=>e.name)},view:{}};for(var{name:i}of e)t.view[i]={key:"style",value:{"text-align":i}};return t}(n));for(const s of function(e){const t=[];for(var{name:i}of e)t.push({view:{key:"style",value:{"text-align":i}},model:{key:"alignment",value:i}});return t}(n))e.conversion.for("upcast").attributeToAttribute(s);for(const a of function(e){const t=[];for(var{name:i}of e)t.push({view:{key:"align",value:i},model:{key:"alignment",value:i}});return t}(n))e.conversion.for("upcast").attributeToAttribute(a);e.commands.add("alignment",new Yu(e))}}const Qu=new Map([["left",Vc.alignLeft],["right",Vc.alignRight],["center",Vc.alignCenter],["justify",Vc.alignJustify]]);class Zu extends Ac{get localizedOptionTitles(){const e=this.editor.t;return{left:e("Align left"),right:e("Align right"),center:e("Align center"),justify:e("Justify")}}static get pluginName(){return"AlignmentUI"}init(){const e=this.editor,n=e.ui.componentFactory,r=e.t,s=Gu(e.config.get("alignment.options"));s.map(e=>e.name).filter(Uu).forEach(e=>this._addButton(e)),n.add("alignment",e=>{const t=vc(e),i=s.map(e=>n.create(`alignment:${e.name}`));_c(t,i),t.buttonView.set({label:r("Text alignment"),tooltip:!0}),t.toolbarView.isVertical=!0,t.toolbarView.ariaLabel=r("Text alignment toolbar"),t.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const o="rtl"===e.contentLanguageDirection?Qu.get("right"):Qu.get("left");return t.buttonView.bind("icon").toMany(i,"isOn",(...e)=>{e=e.findIndex(e=>e);return e<0?o:i[e].icon}),t.bind("isEnabled").toMany(i,"isEnabled",(...e)=>e.some(e=>e)),t})}_addButton(o){const n=this.editor;n.ui.componentFactory.add(`alignment:${o}`,e=>{var t=n.commands.get("alignment");const i=new uc(e);return i.set({label:this.localizedOptionTitles[o],icon:Qu.get(o),tooltip:!0,isToggleable:!0}),i.bind("isEnabled").to(t),i.bind("isOn").to(t,"value",e=>e===o),this.listenTo(i,"execute",()=>{n.execute("alignment",{value:o}),n.editing.view.focus()}),i})}}class eg extends Ac{static get requires(){return[Xu,Zu]}static get pluginName(){return"Alignment"}}class tg extends Ec{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=t.selection.getAttribute(this.attributeKey),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const i=this.editor.model;const o=i.document.selection,n=e.value;i.change(e=>{if(o.isCollapsed)n?e.setSelectionAttribute(this.attributeKey,n):e.removeSelectionAttribute(this.attributeKey);else for(const t of i.schema.getValidRanges(o.getRanges(),this.attributeKey))n?e.setAttribute(this.attributeKey,n,t):e.removeAttribute(this.attributeKey,t)})}}class ig extends Jt{constructor(e){super(e),this.set("isEmpty",!0),this.on("change",()=>{this.set("isEmpty",0===this.length)})}add(t,e){this.find(e=>e.color===t.color)||super.add(t,e)}hasColor(t){return!!this.find(e=>e.color===t)}}Gt(ig,fo);i(71);class og extends Jl{constructor(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r}){super(e),this.items=this.createCollection(),this.colorDefinitions=t,this.focusTracker=new Xr,this.keystrokes=new Qr,this.set("selectedColor"),this.removeButtonLabel=o,this.columns=i,this.documentColors=new ig,this.documentColorsCount=r,this._focusCycler=new ec({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this._documentColorsLabel=n,this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-table"]},children:this.items}),this.items.add(this._removeColorButton())}updateDocumentColors(e,t){const i=e.document;var o=this.documentColorsCount;this.documentColors.clear();for(const r of i.getRootNames()){var n=i.getRoot(r);const s=e.createRangeIn(n);for(const a of s.getItems())if(a.is("$textProxy")&&a.hasAttribute(t)&&(this._addColorToDocumentColors(a.getAttribute(t)),this.documentColors.length>=o))return}}updateSelectedColors(){const e=this.documentColorsGrid,t=this.staticColorsGrid;var i=this.selectedColor;t.selectedColor=i,e&&(e.selectedColor=i)}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element)}appendGrids(){if(!this.staticColorsGrid&&(this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount)){const e=Ol.bind(this.documentColors,this.documentColors),t=new Yc(this.locale);t.text=this._documentColorsLabel,t.extendTemplate({attributes:{class:["ck","ck-color-grid__label",e.if("isEmpty","ck-hidden")]}}),this.items.add(t),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_removeColorButton(){const e=new uc;return e.set({withText:!0,icon:Vc.eraser,tooltip:!0,label:this.removeButtonLabel}),e.class="ck-color-table__remove-color",e.on("execute",()=>{this.fire("execute",{value:null})}),e}_createStaticColorsGrid(){const e=new Gc(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return e.delegate("execute").to(this),e}_createDocumentColorsGrid(){const e=Ol.bind(this.documentColors,this.documentColors),o=new Gc(this.locale,{columns:this.columns});return o.delegate("execute").to(this),o.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}}),o.items.bindTo(this.documentColors).using(e=>{const t=new Kc;return t.set({color:e.color,hasBorder:e.options&&e.options.hasBorder}),e.label&&t.set({label:e.label,tooltip:!0}),t.on("execute",()=>{this.fire("execute",{value:e.color})}),t}),this.documentColors.on("change:isEmpty",(e,t,i)=>{i&&(o.selectedColor=null)}),o}_addColorToDocumentColors(t){var e=this.colorDefinitions.find(e=>e.color===t);e?this.documentColors.add(Object.assign({},e)):this.documentColors.add({color:t,label:t,options:{hasBorder:!1}})}}const ng="fontSize",rg="fontFamily",sg="fontColor",ag="fontBackgroun
5dColor";function lg(e,t){const i={model:{key:e,values:[]},view:{},upcastAlso:{}};for(const o of t)i.model.values.push(o.model),i.view[o.model]=o.view,o.upcastAlso&&(i.upcastAlso[o.model]=o.upcastAlso);return i}function cg(t){return e=>e.getStyle(t).replace(/\s/g,"")}function dg(i){return(e,{writer:t})=>t.createAttributeElement("span",{style:`${i}:${e}`},{priority:7})}class hg extends tg{constructor(e){super(e,ng)}}function ug(e){return e.map(e=>function(e){if(function(e){return"object"==typeof e&&e.title&&e.model&&e.view}(e))return mg(e);var t=function(e){return gg[e]||gg[e.model]}(e);if(t)return mg(t);if("default"===e)return{model:void 0,title:"Default"};if(!function(e){let t;if("object"==typeof e){if(!e.model)throw new Bt.a("font-size-invalid-definition",null,e);t=parseFloat(e.model)}else t=parseFloat(e);return isNaN(t)}(e))return function(e){"number"!=typeof e&&"string"!=typeof e||(e={title:String(e),model:`${parseFloat(e)}px`});return e.view={name:"span",styles:{"font-size":e.model}},mg(e)}(e)}(e)).filter(e=>!!e)}const gg={get tiny(){return{title:"Tiny",model:"tiny",view:{name:"span",classes:"text-tiny",priority:7}}},get small(){return{title:"Small",model:"small",view:{name:"span",classes:"text-small",priority:7}}},get big(){return{title:"Big",model:"big",view:{name:"span",classes:"text-big",priority:7}}},get huge(){return{title:"Huge",model:"huge",view:{name:"span",classes:"text-huge",priority:7}}}};function mg(e){return e.view.priority||(e.view.priority=7),e}const fg=["x-small","x-small","small","medium","large","x-large","xx-large","xxx-large"];class pg extends Ac{static get pluginName(){return"FontSizeEditing"}constructor(e){super(e),e.config.define(ng,{options:["tiny","small","default","big","huge"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:ng}),e.model.schema.setAttributeProperties(ng,{isFormatting:!0,copyOnEnter:!0});var t=e.config.get("fontSize.supportAllValues"),i=ug(this.editor.config.get("fontSize.options")).filter(e=>e.model),i=lg(ng,i);t?(this._prepareAnyValueConverters(i),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(i),e.commands.add(ng,new hg(e))}_prepareAnyValueConverters(e){const t=this.editor;e=e.model.values.filter(e=>!Nd(String(e))&&!Bd(String(e)));if(e.length)throw new Bt.a("font-size-invalid-use-of-named-presets",null,{presets:e});t.conversion.for("downcast").attributeToElement({model:ng,view:(e,{writer:t})=>{if(e)return t.createAttributeElement("span",{style:"font-size:"+e},{priority:7})}}),t.conversion.for("upcast").elementToAttribute({model:{key:ng,value:e=>e.getStyle("font-size")},view:{name:"span",styles:{"font-size":/.*/}}})}_prepareCompatibilityConverter(){const e=this.editor;e.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{size:/^[+-]?\d{1,3}$/}},model:{key:ng,value:e=>{var t=e.getAttribute("size"),e="-"===t[0]||"+"===t[0];let i=parseInt(t,10);e&&(i=3+i);e=fg.length-1,e=Math.min(Math.max(i,0),e);return fg[e]}}})}}i(73);class bg extends Ac{static get pluginName(){return"FontSizeUI"}init(){const i=this.editor,o=i.t,n=this._getLocalizedOptions(),r=i.commands.get(ng);i.ui.componentFactory.add(ng,e=>{const t=vc(e);return yc(t,function(e,t){const i=new Jt;for(const o of e){const n={type:"button",model:new id({commandName:ng,commandParam:o.model,label:o.title,class:"ck-fontsize-option",withText:!0})};o.view&&o.view.styles&&n.model.set("labelStyle",`font-size:${o.view.styles["font-size"]}`),o.view&&o.view.classes&&n.model.set("class",`${n.model.class} ${o.view.classes}`),n.model.bind("isOn").to(t,"value",e=>e===o.model),i.add(n)}return i}(n,r)),t.buttonView.set({label:o("Font Size"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9.816 11.5 7.038 4.785 4.261 11.5h5.555zm.62 1.5H3.641l-1.666 4.028H.312l5.789-14h1.875l5.789 14h-1.663L10.436 13zm7.55 2.279.779-.779.707.707-2.265 2.265-2.193-2.265.707-.707.765.765V4.825c0-.042 0-.083.002-.123l-.77.77-.707-.707L17.207 2.5l2.265 2.265-.707.707-.782-.782c.002.043.003.089.003.135v10.454z"/></svg>',tooltip:!0}),t.extendTemplate({attributes:{class:["ck-font-size-dropdown"]}}),t.bind("isEnabled").to(r),this.listenTo(t,"execute",e=>{i.execute(e.source.commandName,{value:e.source.commandParam}),i.editing.view.focus()}),t})}_getLocalizedOptions(){const e=this.editor,t=e.t,i={Default:t("Default"),Tiny:t("Tiny"),Small:t("Small"),Big:t
5("Big"),Huge:t("Huge")},o=ug(e.config.get(ng).options);return o.map(e=>{var t=i[e.title];return e=t&&t!=e.title?Object.assign({},e,{title:t}):e})}}class kg extends Ac{static get requires(){return[pg,bg]}static get pluginName(){return"FontSize"}}class wg extends tg{constructor(e){super(e,sg)}}class vg extends Ac{static get pluginName(){return"FontColorEditing"}constructor(e){super(e),e.config.define(sg,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:sg,value:cg("color")}}),e.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{color:/^#?\w+$/}},model:{key:sg,value:e=>e.getAttribute("color")}}),e.conversion.for("downcast").attributeToElement({model:sg,view:dg("color")}),e.commands.add(sg,new wg(e)),e.model.schema.extend("$text",{allowAttributes:sg}),e.model.schema.setAttributeProperties(sg,{isFormatting:!0,copyOnEnter:!0})}}class _g extends Ac{constructor(e,{commandName:t,icon:i,componentName:o,dropdownLabel:n}){super(e),this.commandName=t,this.componentName=o,this.icon=i,this.dropdownLabel=n,this.columns=e.config.get(`${this.componentName}.columns`),this.colorTableView=void 0}init(){const n=this.editor;var e=n.locale;const t=e.t,i=n.commands.get(this.commandName),r=$c(e,qc(n.config.get(this.componentName).colors)),s=n.config.get(`${this.componentName}.documentColors`);n.ui.componentFactory.add(this.componentName,e=>{const o=vc(e);return this.colorTableView=function({dropdownView:e,colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r}){var s=e.locale;const a=new og(s,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r});return e.colorTableView=a,e.panelView.children.add(a),a.delegate("execute").to(e,"execute"),a}({dropdownView:o,colors:r.map(e=>({label:e.label,color:e.model,options:{hasBorder:e.hasBorder}})),columns:this.columns,removeButtonLabel:t("Remove color"),documentColorsLabel:0!==s?t("Document colors"):void 0,documentColorsCount:void 0===s?this.columns:s}),this.colorTableView.bind("selectedColor").to(i,"value"),o.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:!0}),o.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}}),o.bind("isEnabled").to(i),o.on("execute",(e,t)=>{n.execute(this.commandName,t),n.editing.view.focus()}),o.on("change:isOpen",(e,t,i)=>{o.colorTableView.appendGrids(),i&&(0!==s&&this.colorTableView.updateDocumentColors(n.model,this.componentName),this.colorTableView.updateSelectedColors())}),o})}}class yg extends _g{constructor(e){const t=e.locale.t;super(e,{commandName:sg,componentName:sg,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M12.4 10.3 10 4.5l-2.4 5.8h4.8zm.5 1.2H7.1L5.7 15H4.2l5-12h1.6l5 12h-1.5L13 11.5zm3.1 7H4a1 1 0 0 1 0-2h12a1 1 0 0 1 0 2z"/></svg>',dropdownLabel:t("Font Color")})}static get pluginName(){return"FontColorUI"}}class xg extends Ac{static get requires(){return[vg,yg]}static get pluginName(){return"FontColor"}}class Cg extends tg{constructor(e){super(e,ag)}}class Ag extends Ac{static get pluginName(){return"FontBackgroundColorEditing"}constructor(e){super(e),e.config.define(ag,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.data.addStyleProcessorRules(Ud),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:ag,value:cg("background-color")}}),e.conversion.for("downcast").attributeToElement({model:ag,view:dg("background-color")}),e.commands.add(ag,new Cg(e)),e.model.schema.extend("$text",{allowAttributes:ag}),e.model.schema.setAttributeProperties(ag,{isFormatting:!0,copyOnEnter:!0})}}class Tg extends _g{constructor(e){const t=e.locale.t;super(e,{commandName:ag,componentName:ag,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm8.38 9.262H7.62L10 5.506l2.38 5.756zm.532 1.285L14.34 16h1.426L10.804 4H9.196L4.234 16H5.66l1.428-3.453h5.824z"/></svg>
5',dropdownLabel:t("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class Eg extends Ac{static get requires(){return[Ag,Tg]}static get pluginName(){return"FontBackgroundColor"}}class Pg extends tg{constructor(e){super(e,rg)}}function Sg(e){return e.map(Ig).filter(e=>!!e)}function Ig(e){return"object"==typeof e?e:"default"===e?{title:"Default",model:void 0}:"string"==typeof e?function(e){const t=e.replace(/"|'/g,"").split(","),i=t[0],o=t.map(Rg).join(", ");return{title:i,model:o,view:{name:"span",styles:{"font-family":o},priority:7}}}(e):void 0}function Rg(e){return e=0<(e=e.trim()).indexOf(" ")?`'${e}'`:e}class Og extends Ac{static get pluginName(){return"FontFamilyEditing"}constructor(e){super(e),e.config.define(rg,{options:["default","Arial, Helvetica, sans-serif","Courier New, Courier, monospace","Georgia, serif","Lucida Sans Unicode, Lucida Grande, sans-serif","Tahoma, Geneva, sans-serif","Times New Roman, Times, serif","Trebuchet MS, Helvetica, sans-serif","Verdana, Geneva, sans-serif"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:rg}),e.model.schema.setAttributeProperties(rg,{isFormatting:!0,copyOnEnter:!0});var t=Sg(e.config.get("fontFamily.options")).filter(e=>e.model),t=lg(rg,t);e.config.get("fontFamily.supportAllValues")?(this._prepareAnyValueConverters(),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(t),e.commands.add(rg,new Pg(e))}_prepareAnyValueConverters(){const e=this.editor;e.conversion.for("downcast").attributeToElement({model:rg,view:(e,{writer:t})=>t.createAttributeElement("span",{style:"font-family:"+e},{priority:7})}),e.conversion.for("upcast").elementToAttribute({model:{key:rg,value:e=>e.getStyle("font-family")},view:{name:"span",styles:{"font-family":/.*/}}})}_prepareCompatibilityConverter(){const e=this.editor;e.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{face:/.*/}},model:{key:rg,value:e=>e.getAttribute("face")}})}}class Vg extends Ac{static get pluginName(){return"FontFamilyUI"}init(){const i=this.editor,o=i.t,n=this._getLocalizedOptions(),r=i.commands.get(rg);i.ui.componentFactory.add(rg,e=>{const t=vc(e);return yc(t,function(e,t){const i=new Jt;for(const o of e){const n={type:"button",model:new id({commandName:rg,commandParam:o.model,label:o.title,withText:!0})};n.model.bind("isOn").to(t,"value",e=>e===o.model||!(!e||!o.model)&&e.split(",")[0].replace(/'/g,"").toLowerCase()===o.model.toLowerCase()),o.view&&o.view.styles&&n.model.set("labelStyle",`font-family: ${o.view.styles["font-family"]}`),i.add(n)}return i}(n,r)),t.buttonView.set({label:o("Font Family"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.03 3h6.149a.75.75 0 1 1 0 1.5h-5.514L11.03 3zm1.27 3h4.879a.75.75 0 1 1 0 1.5h-4.244L12.3 6zm1.27 3h3.609a.75.75 0 1 1 0 1.5h-2.973L13.57 9zm-2.754 2.5L8.038 4.785 5.261 11.5h5.555zm.62 1.5H4.641l-1.666 4.028H1.312l5.789-14h1.875l5.789 14h-1.663L11.436 13z"/></svg>',tooltip:!0}),t.extendTemplate({attributes:{class:"ck-font-family-dropdown"}}),t.bind("isEnabled").to(r),this.listenTo(t,"execute",e=>{i.execute(e.source.commandName,{value:e.source.commandParam}),i.editing.view.focus()}),t})}_getLocalizedOptions(){const e=this.editor,t=e.t,i=Sg(e.config.get(rg).options);return i.map(e=>("Default"===e.title&&(e.title=t("Default")),e))}}class Mg extends Ac{static get requires(){return[Og,Vg]}static get pluginName(){return"FontFamily"}}(class extends Ac{});i(75);(class extends Ac{});(class extends Ac{});function Ng(l,c,d,h){let u,g=null;u="function"==typeof h?h:(g=l.commands.get(h),()=>{l.execute(h)}),l.model.document.on("change:data",(e,t)=>{if((!g||g.isEnabled)&&c.isEnabled){const o=Yr(l.model.document.selection.getRanges());if(o.isCollapsed&&"transparent"!=t.type){var i=Array.from(l.model.document.differ.getChanges()),t=i[0];if(1==i.length&&"insert"===t.type&&"$text"==t.name&&1==t.length){const r=t.position.parent;if(!r.is("element","codeBlock")&&(!r.is("element","listItem")||"function"==typeof h||["numberedList","bulletedList","todoList"].includes(h))&&(!g||!0!==g.value)){const n=r.getChild(0),s=l.model.createRangeOn(n);if(s.containsRange(o)||o.end.isEqual(s.end)){const a=d.exec(n.data.substr(0,o.end.offset));a&&l.model.enqueueChange(e=>{var t=e.createPositionAt(r,0),i=e.createPositionAt(r,a[0].length);const o=new Os(t,i);if(!1!==u({match:a})){e.remove(o);i=l.model.document.selection.getFirstRange();const n=e.createRangeIn(r);!r.isEmpty||n.isEqual(i)||n.containsRange(i,!0)||e.remove(r)}o.detach()})}}}}}})}function zg(a,l,e,c){let d,h;e instanceof RegExp?d=e:h=e,h=h||(e=>{const t=[],i=[];for(;null!==(a=d.exec(e))&&!(a&&a.length<4);){var{index:o,1:n,2:r,3:s}=a,a=[o+=a[0].length-(n+r+s).length,o+n.length],s=[o+n.length+r.length,o+n.length+r.length+s.length];t.push(a),t.push(s),i.push([o+n.length,o+n.length+r.length])}return{remove:t,format:i}}),a.model.document.on("change:data",(e,t)=>{if("transparent"!=t.type&&l.isEnabled){const n=a.model;var i=n.document.selection;if(i.isCollapsed){var o=Array.from(n.document.differ.getChanges()),t=o[0];if(1==o.length&&"insert"===t.type&&"$text"==t.name&&1==t.length){var t=i.focus,i=t.parent,{text:i,range:t}=function(e,i){let o=e.start;var t=Array.from(e.getItems()).reduce((e,t)=>
5!t.is("$text")&&!t.is("$textProxy")||t.getAttribute("code")?(o=i.createPositionAfter(t),""):e+t.data,"");return{text:t,range:i.createRange(o,e.end)}}(n.createRange(n.createPositionAt(i,0),t),n),i=h(i);const r=Bg(t.start,i.format,n),s=Bg(t.start,i.remove,n);r.length&&s.length&&n.enqueueChange(e=>{if(!1!==c(e,r))for(const t of s.reverse())e.remove(t)})}}}})}function Bg(t,e,i){return e.filter(e=>void 0!==e[0]&&void 0!==e[1]).map(e=>i.createRange(t.getShiftedBy(e[0]),t.getShiftedBy(e[1])))}class Fg extends Ac{static get pluginName(){return"Autoformat"}afterInit(){this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats(),this._addCodeBlockAutoformats(),this._addHorizontalLineAutoformats()}_addListAutoformats(){const e=this.editor.commands;e.get("bulletedList")&&Ng(this.editor,this,/^[*-]\s$/,"bulletedList"),e.get("numberedList")&&Ng(this.editor,this,/^1[.|)]\s$/,"numberedList"),e.get("todoList")&&Ng(this.editor,this,/^\[\s?\]\s$/,"todoList"),e.get("checkTodoList")&&Ng(this.editor,this,/^\[\s?x\s?\]\s$/,()=>{this.editor.execute("todoList"),this.editor.execute("checkTodoList")})}_addBasicStylesAutoformats(){const e=this.editor.commands;var t,i;e.get("bold")&&(t=Dg(this.editor,"bold"),zg(this.editor,this,/(?:^|\s)(\*\*)([^*]+)(\*\*)$/g,t),zg(this.editor,this,/(?:^|\s)(__)([^_]+)(__)$/g,t)),e.get("italic")&&(t=Dg(this.editor,"italic"),zg(this.editor,this,/(?:^|\s)(\*)([^*_]+)(\*)$/g,t),zg(this.editor,this,/(?:^|\s)(_)([^_]+)(_)$/g,t)),e.get("code")&&(i=Dg(this.editor,"code"),zg(this.editor,this,/(`)([^`]+)(`)$/g,i)),e.get("strikethrough")&&(i=Dg(this.editor,"strikethrough"),zg(this.editor,this,/(~~)([^~]+)(~~)$/g,i))}_addHeadingAutoformats(){const i=this.editor.commands.get("heading");i&&i.modelElements.filter(e=>e.match(/^heading[1-6]$/)).forEach(e=>{var t=e[7],t=new RegExp(`^(#{${t}})\\s$`);Ng(this.editor,this,t,()=>!(!i.isEnabled||i.value===e)&&void this.editor.execute("heading",{value:e}))})}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&Ng(this.editor,this,/^>\s$/,"blockQuote")}_addCodeBlockAutoformats(){const e=this.editor,t=e.model.document.selection;e.commands.get("codeBlock")&&Ng(e,this,/^```$/,()=>!t.getFirstPosition().parent.is("element","listItem")&&void this.editor.execute("codeBlock",{usePreviousLanguageChoice:!0}))}_addHorizontalLineAutoformats(){this.editor.commands.get("horizontalLine")&&Ng(this.editor,this,/^---$/,"horizontalLine")}}function Dg(o,n){return(e,t)=>{if(!o.commands.get(n).isEnabled)return!1;for(const i of o.model.schema.getValidRanges(t,n))e.setAttribute(n,!0,i);e.removeSelectionAttribute(n)}}class Lg extends Ec{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model;var t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const i=this.editor.model;const o=i.document.selection,n=void 0===e.forceValue?!this.value:e.forceValue;i.change(e=>{if(o.isCollapsed)n?e.setSelectionAttribute(this.attributeKey,!0):e.removeSelectionAttribute(this.attributeKey);else for(const t of i.schema.getValidRanges(o.getRanges(),this.attributeKey))n?e.setAttribute(this.attributeKey,n,t):e.removeAttribute(this.attributeKey,t)})}_getValueFromFirstAllowedNode(){var e=this.editor.model;const t=e.schema,i=e.document.selection;if(i.isCollapsed)return i.hasAttribute(this.attributeKey);for(const o of i.getRanges())for(const n of o.getItems())if(t.checkAttribute(n,this.attributeKey))return n.hasAttribute(this.attributeKey);return!1}}const Hg="bold";class jg extends Ac{static get pluginName(){return"BoldEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Hg}),e.model.schema.setAttributeProperties(Hg,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Hg,view:"strong",upcastAlso:["b",e=>{e=e.getStyle("font-weight");return e?"bold"==e||600<=Number(e)?{name:!0,styles:["font-weight"]}:void 0:null}]}),e.commands.add(Hg,new Lg(e,Hg)),e.keystrokes.set("CTRL+B",Hg)}}const Wg="bold";class $g extends Ac{static get pluginName(){return"BoldUI"}init(){const o=this.editor,n=o.t;o.ui.componentFactory.add(Wg,e=>{var t=o.commands.get(Wg);const i=new uc(e);return i.set({label:n("Bold"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.187 17H5.773c-.637 0-1.092-.138-1.364-.415-.273-.277-.409-.718-.409-1.323V4.738c0-.617.14-1.062.419-1.332.279-.27.73-.406 1.354-.406h4.68c.69 0 1.288.041 1.793.124.506.083.96.242 1.36.478.341.197.644.447.906.75a3.262 3.262 0 0 1 .808 2.162c0 1.401-.722 2.426-2.167 3.075C15.05 10.175 16 11.315 16 13.01a3.756 3.756 0 0 1-2.296 3.504 6.1 6.1 0 0 1-1.517.377c-.571.073-1.238.11-2 .11zm-.217-6.217H7v4.087h3.069c1.977 0 2.965-.69 2.965-2.072 0-.707-.256-1.22-.768-1.537-.512-.319-1.277-.478-2.296-.478zM7 5.13v3.619h2.606c.729 0 1.292-.067 1.69-.2a1.
56 1.6 0 0 0 .91-.765c.165-.267.247-.566.247-.897 0-.707-.26-1.176-.778-1.409-.519-.232-1.31-.348-2.375-.348H7z"/></svg>',keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(t,"value","isEnabled"),this.listenTo(i,"execute",()=>{o.execute(Wg),o.editing.view.focus()}),i})}}class qg extends Ac{static get requires(){return[jg,$g]}static get pluginName(){return"Bold"}}const Ug="italic";class Kg extends Ac{static get pluginName(){return"ItalicEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Ug}),e.model.schema.setAttributeProperties(Ug,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Ug,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add(Ug,new Lg(e,Ug)),e.keystrokes.set("CTRL+I",Ug)}}const Gg="italic";class Jg extends Ac{static get pluginName(){return"ItalicUI"}init(){const o=this.editor,n=o.t;o.ui.componentFactory.add(Gg,e=>{var t=o.commands.get(Gg);const i=new uc(e);return i.set({label:n("Italic"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m9.586 14.633.021.004c-.036.335.095.655.393.962.082.083.173.15.274.201h1.474a.6.6 0 1 1 0 1.2H5.304a.6.6 0 0 1 0-1.2h1.15c.474-.07.809-.182 1.005-.334.157-.122.291-.32.404-.597l2.416-9.55a1.053 1.053 0 0 0-.281-.823 1.12 1.12 0 0 0-.442-.296H8.15a.6.6 0 0 1 0-1.2h6.443a.6.6 0 1 1 0 1.2h-1.195c-.376.056-.65.155-.823.296-.215.175-.423.439-.623.79l-2.366 9.347z"/></svg>',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(t,"value","isEnabled"),this.listenTo(i,"execute",()=>{o.execute(Gg),o.editing.view.focus()}),i})}}class Yg extends Ac{static get requires(){return[Kg,Jg]}static get pluginName(){return"Italic"}}const Xg="strikethrough";class Qg extends Ac{static get pluginName(){return"StrikethroughEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Xg}),e.model.schema.setAttributeProperties(Xg,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Xg,view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),e.commands.add(Xg,new Lg(e,Xg)),e.keystrokes.set("CTRL+SHIFT+X","strikethrough")}}const Zg="strikethrough";class em extends Ac{static get pluginName(){return"StrikethroughUI"}init(){const o=this.editor,n=o.t;o.ui.componentFactory.add(Zg,e=>{var t=o.commands.get(Zg);const i=new uc(e);return i.set({label:n("Strikethrough"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 16.4c-.8-.4-1.5-.9-2.2-1.5a.6.6 0 0 1-.2-.5l.3-.6h1c1 1.2 2.1 1.7 3.7 1.7 1 0 1.8-.3 2.3-.6.6-.4.6-1.2.6-1.3.2-1.2-.9-2.1-.9-2.1h2.1c.3.7.4 1.2.4 1.7v.8l-.6 1.2c-.6.8-1.1 1-1.6 1.2a6 6 0 0 1-2.4.6c-1 0-1.8-.3-2.5-.6zM6.8 9 6 8.3c-.4-.5-.5-.8-.5-1.6 0-.7.1-1.3.5-1.8.4-.6 1-1 1.6-1.3a6.3 6.3 0 0 1 4.7 0 4 4 0 0 1 1.7 1l.3.7c0 .1.2.4-.2.7-.4.2-.9.1-1 0a3 3 0 0 0-1.2-1c-.4-.2-1-.3-2-.4-.7 0-1.4.2-2 .6-.8.6-1 .8-1 1.5 0 .8.5 1 1.2 1.5.6.4 1.1.7 1.9 1H6.8z"/><path d="M3 10.5V9h14v1.5z"/></svg>',keystroke:"CTRL+SHIFT+X",tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(t,"value","isEnabled"),this.listenTo(i,"execute",()=>{o.execute(Zg),o.editing.view.focus()}),i})}}class tm extends Ac{static get requires(){return[Qg,em]}static get pluginName(){return"Strikethrough"}}const im="underline";class om extends Ac{static get pluginName(){return"UnderlineEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:im}),e.model.schema.setAttributeProperties(im,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:im,view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),e.commands.add(im,new Lg(e,im)),e.keystrokes.set("CTRL+U","underline")}}const nm="underline";class rm extends Ac{static get pluginName(){return"UnderlineUI"}init(){const o=this.editor,n=o.t;o.ui.componentFactory.add(nm,e=>{var t=o.commands.get(nm);const i=new uc(e);return i.set({label:n("Underline"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 18v-1.5h14V18zm2.2-8V3.6c0-.4.4-.6.8-.6.3 0 .7.2.7.6v6.2c0 2 1.3 2.8 3.2 2.8 1.9 0 3.4-.9 3.4-2.9V3.6c0-.3.4-.5.8-.5.3 0 .7.2.7.5V10c0 2.7-2.2 4-4.9 4-2.6 0-4.7-1.2-4.7-4z"/></svg>',keystroke:"CTRL+U",tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(t,"value","isEnabled"),this.listenTo(i,"execute",()=>{o.execute(nm),o.editing.view.focus()}),i})}}class sm extends Ac{static get requires(){return[om,rm]}static get pluginName(){return"Underline"}}const am="subscript";class lm extends Ac{static get pluginName(){return"SubscriptEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:am}),e.model.schema.setAttributeProperties(am,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:am,view:"sub",upcastAlso:[{styles:{"vertical-align":"sub"}}]}),e.commands.add(am,new Lg(e,am))}}const cm="subscript";class dm extends Ac{static get pluginName(){return"SubscriptUI"}init(){const o=this.editor,n=o.t;o.ui.componentFactory.add(cm,e=>{var t=o.commands.get(cm);const i=new uc(e);return i.set({label:n("Subscript"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m7.03 10.349 3.818-3.819a.8.8 0 1 1 1.132 1.132L8.16 11.48l3.819 3.818a.8.8 0 1 1-1.132 1.132L7.03 12.61l-3.818 3.82a.8.8 0 1 1-1.132-1.132L5.9 11.48 2.08 7.662A.8.8 0 1 1 3.212 6.53l3.818 3.82zm8.147 7.829h2.549c.254 0 .447.05.58.152a.49.49 0 0 1 .201.413.54.54 0 0 1-.159.393c-.105.108-.266.162-.48.162h-3.594c-.245 0-.435-.066-.572-.197a.621.621 0 0 1-.205-.463c0-.114.044-.265.132-.453a1.62 1.62 0 0 1 .288-.444c.433-.436.824-.81 1.172-1.122.348-.312.597-.517.747-.615.267-.183.49-.368.667-.553.177-.185.312-.375.405-.57.093-.194.139-.384.139-.57a1.008 1.008 0 0 0-.554-.917 1.197 1.197 0 0 0-.56-.133c-.426 0-.761.182-1.005.546a2.332 2.332 0 0 0-.164.39 1.609 1.609 0 0 1-.258.488c-.096.114-.237.17-.423.17a.558.558 0 0 1-.405-.156.568.568 0 0 1-.161-.427c0-.218.05-.446.151-.683.101-.238.252-.453.452-.646s.454-.349.762-.467a2.998 2.998 0 0 1 1.081-.178c.498 0 .923.076 1.274.228a1.916 1.916 0 0 1 1.004 1.032 1.984 1.984 0 0 1-.156 1.794c-.2.32-.405.572-.613.754-.208.182-.558.468-1.048.857-.49.39-.826.691-1.008.906a2.703 2.703 0 0 0-.24.309z"/></svg>',tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(t,"value","isEnabled"),this.listenTo(i,"execute",()=>{o.execute(cm),o.editing.view.focus()}),i})}}class hm extends Ac{static get requires(){return[lm,dm]}static get pluginName(){return"Subscript"}}const um="superscript";class gm extends Ac{static get pluginName(){return"SuperscriptEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:um}),e.model.schema.setAttributeProperties(um,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:um,view:"sup",upcastAlso:[{styles:{"vertical-align":"super"}}]}),e.commands.add(um,new Lg(e,um))}}const mm="superscript";class fm extends Ac{static get pluginName(){return"SuperscriptUI"}init(){const o=this.editor,n=o.t;o.ui.componentFactory.add(mm,e=>{var t=o.commands.get(mm);const i=new uc(e);return i.set({label:n("Superscript"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M15.677 8.678h2.549c.254 0 .447.05.58.152a.49.49 0 0 1 .201.413.54.54 0 0 1-.159.393c-.105.108-.266.162-.48.162h-3.594c-.245 0-.435-.066-.572-.197a.621.621 0 0 1-.205-.463c0-.114.044-.265.132-.453a1.62 1.62 0 0 1 .288-.444c.433-.436.824-.81 1.172-1.122.348-.312.597-.517.747-.615.267-.183.49-.368.667-.553.177-.185.312-.375.405-.57.093-.194.139-.384.139-.57a1.008 1.008 0 0 0-.554-.917 1.197 1.197 0 0 0-.56-.133c-.426 0-.761.182-1.005.546a2.332 2.332 0 0 0-.164.39 1.609 1.609 0 0 1-.258.488c-.096.114-.237.17-.423.17a.558.558 0 0 1-.405-.156.568.568 0 0 1-.161-.427c0-.218.05-.446.151-.683.101-.238.252-.453.452-.646s.454-.349.762-.467a2.998 2.998 0 0 1 1.081-.178c.498 0 .923.076 1.274.228a1.916 1.916 0 0 1 1.004 1.032 1.984 1.984 0 0 1-.156 1.794c-.2.32-.405.572-.613.754-.208.182-.558.468-1.048.857-.49.39-.826.691-1.008.906a2.703 2.703 0 0 0-.24.309zM7.03 10.349l3.818-3.819a.8.8 0 1 1 1.132 1.132L8.16 11.48l3.819 3.818a.8.8 0 1 1-1.132 1.132L7.03 12.61l-3.818 3.82a.8.8 0 1 1-1.132-1.132L5.9 11.48 2.08 7.662A.8.8 0 1 1 3.212 6.53l3.818 3.82z"/></svg>',tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(t,"value","isEnabled"),this.listenTo(i,"execute",()=>{o.execute(mm),o.editing.view.focus()}),i})}}class pm extends Ac{static get requires(){return[gm,fm]}static get pluginName(){return"Superscript"}}const bm="code";class km extends Ac{static get pluginName(){return"CodeEditing"}static get requires(){return[Tu]}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:bm}),e.model.schema.setAttributeProperties(bm,{isFormatting:!0,copyOnEnter:!1}),e.conversion.attributeToElement({model:bm,view:"code",upcastAlso:{styles:{"word-wrap":"break-word"}}}),e.commands.add(bm,new Lg(e,bm)),e.plugins.get(Tu).registerAttribute(bm),Nu(e,bm,"code","ck-code_selected")}}i(13);const wm="code";class vm extends Ac{static get pluginName(){return"CodeUI"}init(){const o=this.editor,n=o.t;o.ui.componentFactory.add(wm,e=>{var t=o.commands.get(wm);const i=new uc(e);
5return i.set({label:n("Code"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m12.5 5.7 5.2 3.9v1.3l-5.6 4c-.1.2-.3.2-.5.2-.3-.1-.6-.7-.6-1l.3-.4 4.7-3.5L11.5 7l-.2-.2c-.1-.3-.1-.6 0-.8.2-.2.5-.4.8-.4a.8.8 0 0 1 .4.1zm-5.2 0L2 9.6v1.3l5.6 4c.1.2.3.2.5.2.3-.1.7-.7.6-1 0-.1 0-.3-.2-.4l-5-3.5L8.2 7l.2-.2c.1-.3.1-.6 0-.8-.2-.2-.5-.4-.8-.4a.8.8 0 0 0-.3.1z"/></svg>',tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(t,"value","isEnabled"),this.listenTo(i,"execute",()=>{o.execute(wm),o.editing.view.focus()}),i})}}class _m extends Ac{static get requires(){return[km,vm]}static get pluginName(){return"Code"}}class ym extends Ec{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,i=t.schema,o=t.document.selection,n=Array.from(o.getSelectedBlocks()),r=void 0===e.forceValue?!this.value:e.forceValue;t.change(e=>{var t;r?(t=n.filter(e=>xm(e)||Am(i,e)),this._applyQuote(e,t)):this._removeQuote(e,n.filter(xm))})}_getValue(){const e=this.editor.model.document.selection;var t=Yr(e.getSelectedBlocks());return!(!t||!xm(t))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection;var t=this.editor.model.schema,i=Yr(e.getSelectedBlocks());return!!i&&Am(t,i)}_removeQuote(i,e){Cm(i,e).reverse().forEach(e=>{var t;e.start.isAtStart&&e.end.isAtEnd?i.unwrap(e.start.parent):e.start.isAtStart?(t=i.createPositionBefore(e.start.parent),i.move(e,t)):(e.end.isAtEnd||i.split(e.end),t=i.createPositionAfter(e.end.parent),i.move(e,t))})}_applyQuote(i,e){const o=[];Cm(i,e).reverse().forEach(e=>{let t=xm(e.start);t||(t=i.createElement("blockQuote"),i.wrap(e,t)),o.push(t)}),o.reverse().reduce((e,t)=>e.nextSibling==t?(i.merge(i.createPositionAfter(e)),e):t)}}function xm(e){return"blockQuote"==e.parent.name?e.parent:null}function Cm(e,t){let i,o=0;const n=[];for(;o<t.length;){var r=t[o],s=t[o+1];i=i||e.createPositionBefore(r),s&&r.nextSibling==s||(n.push(e.createRange(i,e.createPositionAfter(r))),i=null),o++}return n}function Am(e,t){var i=e.checkChild(t.parent,"blockQuote"),t=e.checkChild(["$root","blockQuote"],t);return i&&t}class Tm extends Ac{static get pluginName(){return"BlockQuoteEditing"}static get requires(){return[kh,yh]}init(){const s=this.editor,a=s.model.schema;s.commands.add("blockQuote",new ym(s)),a.register("blockQuote",{allowWhere:"$block",allowContentOf:"$root"}),s.conversion.elementToElement({model:"blockQuote",view:"blockquote"}),s.model.document.registerPostFixer(e=>{for(const t of s.model.document.differ.getChanges())if("insert"==t.type){const i=t.position.nodeAfter;if(i){if(i.is("element","blockQuote")&&i.isEmpty)return e.remove(i),!0;if(i.is("element","blockQuote")&&!a.checkChild(t.position,i))return e.unwrap(i),!0;if(i.is("element")){const o=e.createRangeIn(i);for(const n of o.getItems())if(n.is("element","blockQuote")&&!a.checkChild(e.createPositionBefore(n),n))return e.unwrap(n),!0}}}else if("remove"==t.type){const r=t.position.parent;if(r.is("element","blockQuote")&&r.isEmpty)return e.remove(r),!0}return!1});var e=this.editor.editing.view.document;const o=s.model.document.selection,n=s.commands.get("blockQuote");this.listenTo(e,"enter",(e,t)=>{o.isCollapsed&&n.value&&o.getLastPosition().parent.isEmpty&&(s.execute("blockQuote"),s.editing.view.scrollToTheSelection(),t.preventDefault(),e.stop())},{context:"blockquote"}),this.listenTo(e,"delete",(e,t)=>{var i;"backward"==t.direction&&o.isCollapsed&&n.value&&((i=o.getLastPosition().parent).isEmpty&&!i.previousSibling&&(s.execute("blockQuote"),s.editing.view.scrollToTheSelection(),t.preventDefault(),e.stop()))},{context:"blockquote"})}}i(78);class Em extends Ac{static get pluginName(){return"BlockQuoteUI"}init(){const o=this.editor,n=o.t;o.ui.componentFactory.add("blockQuote",e=>{var t=o.commands.get("blockQuote");const i=new uc(e);return i.set({label:n("Block quote"),icon:Vc.quote,tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(t,"value","isEnabled"),this.listenTo(i,"execute",()=>{o.execute("blockQuote"),o.editing.view.focus()}),i})}}class Pm extends Ac{static get requires(){return[Tm,Em]}static get pluginName(){return"BlockQuote"}}
5class Sm extends Ec{refresh(){var e=this.editor.model;const t=e.document,i=Yr(t.selection.getSelectedBlocks());this.value=!!i&&i.is("element","paragraph"),this.isEnabled=!!i&&Im(i,e.schema)}execute(i={}){const o=this.editor.model,n=o.document;o.change(e=>{for(const t of(i.selection||n.selection).getSelectedBlocks())!t.is("element","paragraph")&&Im(t,o.schema)&&e.rename(t,"paragraph")})}}function Im(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}class Rm extends Ec{execute(e){const o=this.editor.model;let n=e.position;o.change(e=>{var t=e.createElement("paragraph");if(!o.schema.checkChild(n.parent,t)){var i=o.schema.findAllowedParent(n,t);if(!i)return;n=e.split(n,i).position}o.insertContent(t,n),e.setSelection(t,"in")})}}class Om extends Ac{static get pluginName(){return"Paragraph"}init(){const e=this.editor,t=e.model;e.commands.add("paragraph",new Sm(e)),e.commands.add("insertParagraph",new Rm(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"div"}),e.conversion.for("upcast").elementToElement({model:(e,{writer:t})=>!Om.paragraphLikeElements.has(e.name)||e.isEmpty?null:t.createElement("paragraph"),view:/.+/,converterPriority:"low"})}}Om.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);(class extends Ac{});class Vm extends Ec{constructor(e,t){super(e),this.modelElements=t}refresh(){const t=Yr(this.editor.model.document.selection.getSelectedBlocks());this.value=!!t&&this.modelElements.includes(t.name)&&t.name,this.isEnabled=!!t&&this.modelElements.some(e=>Mm(t,e,this.editor.model.schema))}execute(e){const i=this.editor.model,o=i.document,n=e.value;i.change(e=>{for(const t of Array.from(o.selection.getSelectedBlocks()).filter(e=>Mm(e,n,i.schema)))t.is("element",n)||e.rename(t,n)})}}function Mm(e,t,i){return i.checkChild(e.parent,t)&&!i.isObject(e)}const Nm="paragraph";class zm extends Ac{static get pluginName(){return"HeadingEditing"}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[Om]}init(){const e=this.editor;const t=[];for(const i of e.config.get("heading.options"))i.model!==Nm&&(e.model.schema.register(i.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(i),t.push(i.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new Vm(e,t))}afterInit(){const o=this.editor;var e=o.commands.get("enter");const n=o.config.get("heading.options");e&&this.listenTo(e,"afterExecute",(e,t)=>{const i=o.model.document.selection.getFirstPosition().parent;n.some(e=>i.is("element",e.model))&&!i.is("element",Nm)&&0===i.childCount&&t.writer.rename(i,Nm)})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:zt.get("low")+1})}}i(14);class Bm extends Ac{static get pluginName(){return"HeadingUI"}init(){const c=this.editor,e=c.t,d=function(e){const t=e.t,i={Paragraph:t("Paragraph"),"Heading 1":t("Heading 1"),"Heading 2":t("Heading 2"),"Heading 3":t("Heading 3"),"Heading 4":t("Heading 4"),"Heading 5":t("Heading 5"),"Heading 6":t("Heading 6")};return e.config.get("heading.options").map(e=>{var t=i[e.title];return t&&t!=e.title&&(e.title=t),e})}(c),h=e("Choose heading"),u=e("Heading");c.ui.componentFactory.add("heading",e=>{const i={},t=new Jt;var o=c.commands.get("heading"),n=c.commands.get("paragraph");const r=[o];for(const a of d){const l={type:"button",model:new id({label:a.title,class:a.class,withText:!0})};"paragraph"===a.model?(l.model.bind("isOn").to(n,"value"),l.model.set("commandName","paragraph"),r.push(n)):(l.model.bind("isOn").to(o,"value",e=>e===a.model),l.model.set({commandName:"heading",commandValue:a.model})),t.add(l),i[a.model]=a.title}const s=vc(e);return yc(s,t),s.buttonView.set({isOn:!1,withText:!0,tooltip:u}),s.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),s.bind("isEnabled").toMany(r,"isEnabled",(...e)=>e.some(e=>e)),s.buttonView.bind("label").to(o,"value",n,"value",(e,t)=>{t=e||t&&"paragraph";return i[t]||h}),this.listenTo(s,"execute",e=>{c.execute(e.source.commandName,e.source.commandValue?{value:e.source.commandValue}:void 0),c.editing.view.focus()}),s})}}class Fm extends Ac{static get requires(){return[zm,Bm]}static get pluginName(){return"Heading"}}class Dm extends Ac{static get requires(){return[dd]}static get pluginName(){return"WidgetToolbarRepository"}init(){const t=this.editor;var e;t.plugins.has("BalloonToolbar")&&(e=t.plugins.get("BalloonToolbar"),this.listenTo(e,"show",e=>{!function(e){e=e.getSelectedElement();return!(!e||!Sh(e))}(t.editing.view.document.selection)||e.stop()},{priority:"high"})),this._toolbarDefinitions=new Map,this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(t.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(t.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const e of this._toolbarDefinitions.values())e.view.destroy()}register(e,{ariaLabel:t,items:i,getRelatedElement:o,balloonClassName:n="ck-toolbar-container"}){if(i.length){var r=this.editor;const s=r.t,a=new zc(r.locale);if(a.ariaLabel=t||s("Widget toolbar"),this._toolbarDefinitions.has(e))throw new Bt.a("widget-toolbar-duplicated",this,{toolbarId:e});a.fillFromConfig(i,r.ui.componentFactory),this._toolbarDefinitions.set(e,{view:a,getRelatedElement:o,balloonClassName:n})}else Object(Bt.b)("widget-toolbar-no-items",{toolbarId:e})}_updateToolbarsVisibility(){let e=0,t=null,i=null;for(const n of this._toolbarDefinitions.values()){const r=n.getRelatedElement(this.editor.editing.view.document.selection);var o;this.isEnabled&&r?this.editor.ui.focusTracker.isFocused?(o=r.getAncestors().length)>e&&(e=o,t=r,i=n):this._isToolbarVisible(n)&&this._hideToolbar(n):this._isToolbarInBalloon(n)&&this._hideToolbar(n)}i&&this._showToolbar(i,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?Lm(this.editor,t):this._isToolbarInBalloon(e)||(this._balloon.add({view:e.view,position:Hm(this.editor,t),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const t of this._toolbarDefinitions.values()){var e;this._isToolbarVisible(t)&&(e=t.getRelatedElement(this.editor.editing.view.document.selection),Lm(this.editor,e))}}))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function Lm(e,t){const i=e.plugins.get("ContextualBalloon");t=Hm(e,t);i.updatePosition(t)}function Hm(e,t){const i=e.editing.view;e=rd.defaultPositions;return{target:i.domConverter.mapViewToDom(t),positions:[e.northArrowSouth,e.northArrowSouthWest,e.northArrowSouthEast,e.southArrowNorth,e.southArrowNorthWest,e.southArrowNorthEast,zh]}}class jm{constructor(e){this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=e,this._referenceCoordinates=null}begin(e,t,i){var o=new Wr(t);this.activeHandlePosition=function(e){for(const t of["top-left","top-right","bottom-right","bottom-left"])if(e.classList.contains(`ck-widget__resizer__handle-${t}`))return t}(e),this._referenceCoordinates=function(e,t){const i=new Wr(e),o=t.split("-"),n={x:"right"==o[1]?i.right:i.left,y:"bottom"==o[0]?i.bottom:i.top};return n.x+=e.ownerDocument.defaultView.scrollX,n.y+=e.ownerDocument.defaultView.scrollY,n}(t,(e=this.activeHandlePosition,t=e.split("-"),`${(e={top:"bottom",bottom:"top",left:"r
5ight",right:"left"})[t[0]]}-${e[t[1]]}`)),this.originalWidth=o.width,this.originalHeight=o.height,this.aspectRatio=o.width/o.height;const n=i.style.width;n&&n.match(/^\d+(\.\d*)?%$/)?this.originalWidthPercents=parseFloat(n):this.originalWidthPercents=function(e,t){const i=e.parentElement,o=parseFloat(i.ownerDocument.defaultView.getComputedStyle(i).width);return t.width/o*100}(i,o)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}}Gt(jm,fo);class Wm extends Jl{constructor(){super();const e=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",e.to("_viewPosition",e=>e?`ck-orientation-${e}`:"")],style:{display:e.if("_isVisible","none",e=>!e)}},children:[{text:e.to("_label")}]})}_bindToState(o,e){this.bind("_isVisible").to(e,"proposedWidth",e,"proposedHeight",(e,t)=>null!==e&&null!==t),this.bind("_label").to(e,"proposedHandleHostWidth",e,"proposedHandleHostHeight",e,"proposedWidthPercents",(e,t,i)=>"px"===o.unit?`${e}×${t}`:`${i}%`),this.bind("_viewPosition").to(e,"activeHandlePosition",e,"proposedHandleHostWidth",e,"proposedHandleHostHeight",(e,t,i)=>t<50||i<50?"above-center":e)}_dismiss(){this.unbind(),this._isVisible=!1}}class $m{constructor(e){this._options=e,this._viewResizerWrapper=null,this.set("isEnabled",!0),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",e=>{this.state.proposedWidth||this.state.proposedWidthPercents||(this._cleanup(),e.stop())},{priority:"high"}),this.on("change:isEnabled",()=>{this.isEnabled&&this.redraw()})}attach(){const i=this,o=this._options.viewElement,e=this._options.editor.editing.view;e.change(e=>{var t=e.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},function(e){const o=this.toDomElement(e);return i._appendHandles(o),i._appendSizeUI(o),i.on("change:isEnabled",(e,t,i)=>{o.style.display=i?"":"none"}),o.style.display=i.isEnabled?"":"none",o});e.insert(e.createPositionAt(o,"end"),t),e.addClass("ck-widget_with-resizer",o),this._viewResizerWrapper=t})}begin(e){this.state=new jm(this._options),this._sizeView._bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(e,this._getHandleHost(),this._getResizeHost())}updateSize(e){const i=this._proposeNewSize(e),t=this._options.editor.editing.view;t.change(e=>{var t=this._options.unit||"%",t=("%"===t?i.widthPercents:i.width)+t;e.setStyle("width",t,this._options.viewElement)});var o=this._getHandleHost(),e=new Wr(o);i.handleHostWidth=Math.round(e.width),i.handleHostHeight=Math.round(e.height);o=new Wr(o);i.width=Math.round(o.width),i.height=Math.round(o.height),this.redraw(e),this.state.update(i)}commit(){var e=this._options.unit||"%";const t=("%"===e?this.state.proposedWidthPercents:this.state.proposedWidth)+e;this._options.editor.editing.view.change(()=>{this._cleanup(),this._options.onCommit(t)})}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(e){var i=this._domResizerWrapper;if((o=i)&&o.ownerDocument&&o.ownerDocument.contains(o)){const n=i.parentElement;var o=this._getHandleHost();const r=this._viewResizerWrapper;i=[r.getStyle("width"),r.getStyle("height"),r.getStyle("left"),r.getStyle("top")];let t;t=n.isSameNode(o)?[(e=e||new Wr(o)).width+"px",e.height+"px",void 0,void 0]:[o.offsetWidth+"px",o.offsetHeight+"px",o.offsetLeft+"px",o.offsetTop+"px"],"same"!==oi(i,t)&&this._options.editor.editing.view.change(e=>{e.setStyle({width:t[0],height:t[1],left:t[2],top:t[3]},r)})}}containsHandle(e){return this._domResizerWrapper.contains(e)}static isResizeHandle(e){return e.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss();const e=this._options.editor.editing.view;e.change(e=>{e.setStyle("width",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(e){const t=this.state;var i={x:e.pageX,y:e.pageY},e=!this._options.isCentered||this._options.isCentered(this);const o={x:t._referenceCoordinates.x-(i.x+t.originalWidth),y:i.y-t.originalHeight-t._referenceCoordinates.y};e&&t.activeHandlePosition.endsWith("-right")&&(o.x=i.x-(t._referenceCoordinates.x+t.originalWidth)),e&&(o.x*=2);const n={width:Math.abs(t.originalWidth+o.x),height:Math.abs(t.originalHeight+o.y)};n.dominant=n.width/t.aspectRatio>n.height?"width":"height",n.max=n[n.dominant];const r={width:n.width,height:n.height};return"width"==n.dominant?r.height=r.width/t.aspectRatio:r.width=r.height*t.aspectRatio,{width:Math.round(r.width),height:Math.round(r.height),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*r.width*100)/100,100)}}_getResizeHost(){var e=this._domResizerWrapper.parentElement;return this._options.getResizeHost(e)}_getHandleHost(){var e=this._domResizerWrapper.parentElement;return this._options.getHandleHost(e)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(e){for(const t of["top-left","top-right","bottom-right","bottom-left"])e.appendChild(new Ol({tag:"div",attributes:{class:`ck-widget__resizer__handle ${`ck-widget__resizer__handle-${t}`}`}}).render())}_appendSizeUI(e){this._sizeView=new Wm,this._sizeView.render(),e.appendChild(this._sizeView.element)}}Gt($m,fo);i(81);class qm extends Ac{static get pluginName(){return"WidgetResize"}init(){const e=this.editor.editing;var t=Fn.window.document;this.set("visibleResizer",null),this.set("_activeResizer",null),this._resizers=new Map,e.view.addObserver(Cd),this._observer=Object.create(Gn),this.listenTo(e.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(t,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(t,"mouseup",this._mouseUpListener.bind(this));t=()=>{this.visibleResizer&&this.visibleResizer.redraw()};this._redrawFocusedResizerThrottled=Qh(t,200),this.on("change:visibleResizer",t),this.editor.ui.on("update",this._redrawFocusedResizerThrottled),this.editor.model.document.on("change",()=>{for(var[e,t]of this._resizers)e.isAttached()||(this._resizers.delete(e),t.destroy())},{priority:"lowest"}),this._observer.listenTo(Fn.window,"resize",this._redrawFocusedResizerThrottled);const i=this.editor.editing.view.document.selection;i.on("change",()=>{var e=i.getSelectedElement();this.visibleResizer=this.getResizerByViewElement(e)||null})}destroy(){this._observer.stopListening();for(const e of this._resizers.values())e.destroy();this._redrawFocusedResizerThrottled.cancel()}attachTo(e){const t=new $m(e),i=this.editor.plugins;if(t.attach(),i.has("WidgetToolbarRepository")){const n=i.get("WidgetToolbarRepository");t.on("begin",()=>{n.forceDisabled("resize")},{priority:"lowest"}),t.on("cancel",()=>{n.clearForceDisabled("resize")},{priority:"highest"}),t.on("commit",()=>{n.clearForceDisabled("resize")},{priority:"highest"})}this._resizers.set(e.viewElement,t);const o=this.editor.editing.view.document.selection;e=o.getSelectedElement();return this.getResizerByViewElement(e)==t&&(this.visibleResizer=t),t}getResizerByViewElement(e){return this._resizers.get(e)}_getResizerByHandle(e){for(const t of this._resizers.values())if(t.containsHandle(e))return t}_mouseDownListener(e,t){var i=t.domTarget;$m.isResizeHandle(i)&&(this._activeResizer=this._getResizerByHandle(i),this._activeResizer&&(this._activeResizer.begin(i),e.stop(),t.preventDefault()))}_mouseMoveListener(e,t){this._activeResizer&&this._activeResizer.updateSize(t)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}}Gt(qm,fo);
5class Um extends Ec{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils"),i=t.getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!i,this.isEnabled&&i.hasAttribute("alt")?this.value=i.getAttribute("alt"):this.value=!1}execute(t){const e=this.editor,i=e.plugins.get("ImageUtils"),o=e.model,n=i.getClosestSelectedImageElement(o.document.selection);o.change(e=>{e.setAttribute("alt",t.newValue,n)})}}function Km(e,t){var i=e.createEmptyElement("img"),t="imageBlock"===t?e.createContainerElement("figure",{class:"image"}):e.createContainerElement("span",{class:"image-inline"},{isAllowedInsideAttributeElement:!0});return e.insert(e.createPositionAt(t,0),i),t}function Gm(e,t){if(e.plugins.has("ImageInlineEditing")!==e.plugins.has("ImageBlockEditing"))return{name:"img",attributes:{src:!0}};const i=e.plugins.get("ImageUtils");return e=>{return!i.isInlineImageView(e)||!e.hasAttribute("src")||(e.findAncestor(i.isBlockImageView)?"imageBlock":"imageInline")!==t?null:{name:!0,attributes:["src"]}}}function Jm(e,t){t=Yr(t.getSelectedBlocks());return!t||e.isObject(t)||t.isEmpty&&"listItem"!=t.name?"imageBlock":"imageInline"}class Ym extends Ac{static get pluginName(){return"ImageUtils"}isImage(e){return this.isInlineImage(e)||this.isBlockImage(e)}isInlineImageView(e){return!!e&&e.is("element","img")}isBlockImageView(e){return!!e&&e.is("element","figure")&&e.hasClass("image")}insertImage(i={},o=null,n=null){var e=this.editor;const r=e.model,s=r.document.selection;n=Xm(e,o||s,n);for(const t in i={...Object.fromEntries(s.getAttributes()),...i})r.schema.checkAttribute(n,t)||delete i[t];return r.change(e=>{var t=e.createElement(n,i);return o||"imageInline"==n||(o=Nh(s,r)),r.insertContent(t,o),t.parent?(e.setSelection(t,"on"),t):null})}getClosestSelectedImageWidget(e){var t=e.getSelectedElement();if(t&&this.isImageWidget(t))return t;let i=e.getFirstPosition().parent;for(;i;){if(i.is("element")&&this.isImageWidget(i))return i;i=i.parent}return null}getClosestSelectedImageElement(e){var t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}isImageAllowed(){var e=this.editor.model.document.selection;return function(e,t){var i=Xm(e,t);if("imageBlock"==i){i=function(e,t){const i=Nh(e,t),o=i.start.parent;return!o.isEmpty||o.is("element","$root")?o:o.parent}(t,e.model);if(e.model.schema.checkChild(i,"imageBlock"))return!0}else if(e.model.schema.checkChild(t.focus,"imageInline"))return!0;return!1}(this.editor,e)&&[...e.focus.getAncestors()].every(e=>!e.is("element","imageBlock"))}toImageWidget(i,e,o){e.setCustomProperty("image",!0,i);return Ih(i,e,{label:()=>{const e=this.findViewImgElement(i);var t=e.getAttribute("alt");return t?`${t} ${o}`:o}})}isImageWidget(e){return!!e.getCustomProperty("image")&&Sh(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;const t=this.editor.editing.view;for(var{item:i}of t.createRangeIn(e))if(this.isInlineImageView(i))return i}}function Xm(e,t,i){const o=e.model.schema;var n=e.config.get("image.insert.type");return e.plugins.has("ImageBlockEditing")?e.plugins.has("ImageInlineEditing")?i||("inline"===n?"imageInline":"block"===n?"imageBlock":t.is("selection")?Jm(o,t):o.checkChild(t,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}class Qm extends Ac{static get requires(){return[Ym]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new Um(this.editor))}}i(83),i(10);class Zm extends Jl{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new Xr,this.keystrokes=new Qr,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(t("Save"),Vc.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("Cancel"),Vc.cancel,"ck-button-cancel","cancel"),this._focusables=new Rl,this._focusCycler=new ec({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]}),jc(this)}render(){super.render(),this.keystrokes.listenTo(this.element),Wc({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEac
5h(e=>{this._focusables.add(e),this.focusTracker.add(e.element)})}_createButton(e,t,i,o){const n=new uc(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n.extendTemplate({attributes:{class:i}}),o&&n.delegate("execute").to(this,o),n}_createLabeledInputView(){const e=this.locale.t,t=new Zc(this.locale,ed);return t.label=e("Text alternative"),t}}function ef(e){const t=e.editing.view;var i=rd.defaultPositions;const o=e.plugins.get("ImageUtils");return{target:t.domConverter.viewToDom(o.getClosestSelectedImageWidget(t.document.selection)),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast]}}class tf extends Ac{static get requires(){return[dd]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton(),this._createForm()}destroy(){super.destroy(),this._form.destroy()}_createButton(){const o=this.editor,n=o.t;o.ui.componentFactory.add("imageTextAlternative",e=>{var t=o.commands.get("imageTextAlternative");const i=new uc(e);return i.set({label:n("Change image text alternative"),icon:Vc.lowVision,tooltip:!0}),i.bind("isEnabled").to(t,"isEnabled"),this.listenTo(i,"execute",()=>{this._showForm()}),i})}_createForm(){const e=this.editor;const t=e.editing.view.document,i=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new Zm(e.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(e,t)=>{this._hideForm(!0),t()}),this.listenTo(e.ui,"update",()=>{i.getClosestSelectedImageWidget(t.selection)?this._isVisible&&function(e){const t=e.plugins.get("ContextualBalloon");e.plugins.get("ImageUtils").getClosestSelectedImageWidget(e.editing.view.document.selection)&&(e=ef(e),t.updatePosition(e))}(e):this._hideForm(!0)}),wc({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(!this._isVisible){const t=this.editor;var e=t.commands.get("imageTextAlternative");const i=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:ef(t)}),i.fieldView.value=i.fieldView.element.value=e.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}}_hideForm(e){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class of extends Ac{static get requires(){return[Qm,tf]}static get pluginName(){return"ImageTextAlternative"}}function nf(n,t){return e=>{e.on(`attribute:srcset:${t}`,i)};function i(e,t,i){if(i.consumable.consume(t.item,e.name)){const o=i.writer;e=i.mapper.toViewElement(t.item),i=n.findViewImgElement(e);null===t.attributeNewValue?(e=t.attributeOldValue).data&&(o.removeAttribute("srcset",i),o.removeAttribute("sizes",i),e.width&&o.removeAttribute("width",i)):(t=t.attributeNewValue).data&&(o.setAttribute("srcset",t.data,i),o.setAttribute("sizes","100vw",i),t.width&&o.setAttribute("width",t.width,i))}}}function rf(n,t,i){return e=>{e.on(`attribute:${i}:${t}`,o)};function o(e,t,i){if(i.consumable.consume(t.item,e.name)){const o=i.writer;i=i.mapper.toViewElement(t.item),i=n.findViewImgElement(i);o.setAttribute(t.attributeKey,t.attributeNewValue||"",i)}}}class sf extends Xn{observe(e){this.listenTo(e,"load",(e,t)=>{var i=t.target;this.checkShouldIgnoreEventFromTarget(i)||"IMG"==i.tagName&&this._fireEvents(t)},{useCapture:!0})}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}class af extends Ec{constructor(e){super(e);var t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||"block"===t&&Object(Bt.b)("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||"inline"===t&&Object(Bt.b)("image-inline-plugin-required")}refresh(){this.isEnabled=this.editor.plugins.get("ImageUtils").isImageAllowed()}execute(e){const t=Xt(e.source),o=this.editor.model.document.selection,n=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(o.getAttributes());t.forEach((e,t)=>{var i=o.getSelectedElement();"string"==typeof e&&(e={src:e}),t&&i&&n.isImage(i)?(i=this.editor.model.createPositionAfter(i),n.insertImage({...e,...r},i)):n.insertImage({...e,...r})})}}class lf extends Ac{static get requires(){return[Ym]}static get pluginName(){return"ImageEditing"}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(sf),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:e=>{const t={data:e.getAttribute("srcset")};return e.hasAttribute("width")&&(t.width=e.getAttribute("width")),t}}});var i=new af(e);e.commands.add("insertImage",i),e.commands.add("imageInsert",i)}}
5class cf extends Ec{constructor(e,t){super(e),this._modelElementName=t}refresh(){const e=this.editor,t=e.plugins.get("ImageUtils");var i=t.getClosestSelectedImageElement(this.editor.model.document.selection);"imageBlock"===this._modelElementName?this.isEnabled=t.isInlineImage(i):this.isEnabled=t.isBlockImage(i)}execute(){const e=this.editor,a=this.editor.model,l=e.plugins.get("ImageUtils"),c=l.getClosestSelectedImageElement(a.document.selection),d=Object.fromEntries(c.getAttributes());return d.src||d.uploadId?a.change(e=>{var t=Array.from(a.markers).filter(e=>e.getRange().containsItem(c)),i=l.insertImage(d,a.createSelection(c,"on"),this._modelElementName);if(!i)return null;var o=e.createRangeOn(i);for(const r of t){const s=r.getRange();var n="$graveyard"!=s.root.rootName?s.getJoined(o,!0):o;e.updateMarker(r,{range:n})}return{oldElement:c,newElement:i}}):null}}class df extends Ac{static get requires(){return[lf,Ym,gh]}static get pluginName(){return"ImageBlockEditing"}init(){const e=this.editor,t=e.model.schema;t.register("imageBlock",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),e.plugins.has("ImageInlineEditing")&&(e.commands.add("imageTypeBlock",new cf(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,i=e.t,t=e.conversion,o=e.plugins.get("ImageUtils");function n(e,t,i){if(i.consumable.test(t.viewItem,{name:!0,classes:"image"})){const n=s.findViewImgElement(t.viewItem);if(n&&n.hasAttribute("src")&&i.consumable.test(n,{name:!0})){const r=i.convertItem(n,t.modelCursor);var o=Yr(r.modelRange.getItems());o&&(i.convertChildren(t.viewItem,o),i.updateConversionResult(o,t))}}}var s;t.for("dataDowncast").elementToElement({model:"imageBlock",view:(e,{writer:t})=>Km(t,"imageBlock")}),t.for("editingDowncast").elementToElement({model:"imageBlock",view:(e,{writer:t})=>o.toImageWidget(Km(t,"imageBlock"),t,i("image widget"))}),t.for("downcast").add(rf(o,"imageBlock","src")).add(rf(o,"imageBlock","alt")).add(nf(o,"imageBlock")),t.for("upcast").elementToElement({view:Gm(e,"imageBlock"),model:(e,{writer:t})=>t.createElement("imageBlock",{src:e.getAttribute("src")})}).add((s=o,e=>{e.on("element:figure",n)}))}_setupClipboardIntegration(){const s=this.editor,a=s.model,l=s.editing.view,c=s.plugins.get("ImageUtils");this.listenTo(s.plugins.get("ClipboardPipeline"),"inputTransformation",(e,t)=>{const i=Array.from(t.content.getChildren());let o;if(i.every(c.isInlineImageView)){o=t.targetRanges?s.editing.mapper.toModelRange(t.targetRanges[0]):a.document.selection.getFirstRange();var n=a.createSelection(o);if("imageBlock"===Jm(a.schema,n)){const r=new Ad(l.document);n=i.map(e=>r.createElement("figure",{class:"image"},e));t.content=r.createDocumentFragment(n)}}})}}i(11);class hf extends Ac{static get requires(){return[df,Xh,of]}static get pluginName(){return"ImageBlock"}}class uf extends Ac{static get requires(){return[lf,Ym,gh]}static get pluginName(){return"ImageInlineEditing"}init(){const e=this.editor,t=e.model.schema;t.register("imageInline",{isObject:!0,isInline:!0,allowWhere:"$text",allowAttributes:["alt","src","srcset"]}),t.addChildCheck((e,t)=>{if(e.endsWith("caption")&&"imageInline"===t.name)return!1}),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new cf(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,i=e.t,t=e.conversion,o=e.plugins.get("ImageUtils");t.for("dataDowncast").elementToElement({model:"imageInline",view:(e,{writer:t})=>t.createEmptyElement("img")}),t.for("editingDowncast").elementToElement({model:"imageInline",view:(e,{writer:t})=>o.toImageWidget(Km(t,"imageInline"),t,i("image widget"))}),t.for("downcast").add(rf(o,"imageInline","src")).add(rf(o,"imageInline","alt")).add(nf(o,"imageInline")),t.for("upcast").elementToElement({view:Gm(e,"imageInline"),model:(e,{writer:t})=>t.createElement("imageInline",{src:e.getAttribute("src")})})}_setupClipboardIntegration(){const s=this.editor,a=s.model,l=s.editing.view,c=s.plugins.get("ImageUtils");this.listenTo(s.plugins.get("ClipboardPipeline"),"inputTransformation",(e,t)=>{const i=Array.from(t.content.getChildren());let o;if(i.every(c.isBlockImageView)){o=t.targetRanges?s.editing.mapper.toModelRange(t.targetRanges[0]):a.document.selection.getFirstRange();var n=a.createSelection(o);if("imageInline"===Jm(a.schema,n)){const r=new Ad(l.document);n=i.map(t=>
51===t.childCount?(Array.from(t.getAttributes()).forEach(e=>r.setAttribute(...e,c.findViewImgElement(t))),t.getChild(0)):t);t.content=r.createDocumentFragment(n)}}})}}class gf extends Ac{static get requires(){return[uf,Xh,of]}static get pluginName(){return"ImageInline"}}class mf extends Ac{static get requires(){return[hf,gf]}static get pluginName(){return"Image"}}function ff(e){for(const t of e.getChildren())if(t&&t.is("element","caption"))return t;return null}function pf(e,t){t=t.getFirstPosition().findAncestor("caption");return t&&e.isBlockImage(t.parent)?t:null}class bf extends Ec{refresh(){const e=this.editor;var t=e.plugins.get("ImageUtils");if(!e.plugins.has(df))return this.isEnabled=!1,void(this.value=!1);const i=e.model.document.selection;var o=i.getSelectedElement();if(!o){t=pf(t,i);return this.isEnabled=!!t,void(this.value=!!t)}this.isEnabled=this.editor.plugins.get("ImageUtils").isImage(o),this.isEnabled?this.value=!!ff(o):this.value=!1}execute(e={}){const t=e["focusCaptionOnShow"];this.editor.model.change(e=>{this.value?this._hideImageCaption(e):this._showImageCaption(e,t)})}_showImageCaption(e,t){const i=this.editor.model.document.selection,o=this.editor.plugins.get("ImageCaptionEditing");let n=i.getSelectedElement();var r=o._getSavedCaption(n);this.editor.plugins.get("ImageUtils").isInlineImage(n)&&(this.editor.execute("imageTypeBlock"),n=i.getSelectedElement());r=r||e.createElement("caption");e.append(r,n),t&&e.setSelection(r,"in")}_hideImageCaption(e){const t=this.editor,i=t.model.document.selection,o=t.plugins.get("ImageCaptionEditing");var n=t.plugins.get("ImageUtils");let r=i.getSelectedElement(),s;r?s=ff(r):(s=pf(n,i),r=s.parent),o._saveCaption(r,s),e.setSelection(r,"on"),e.remove(s)}}class kf extends Ac{static get requires(){return[Ym]}static get pluginName(){return"ImageCaptionEditing"}constructor(e){super(e),this._savedCaptionsMap=new WeakMap}init(){const e=this.editor,t=e.model.schema;t.isRegistered("caption")?t.extend("caption",{allowIn:"imageBlock"}):t.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),e.commands.add("toggleImageCaption",new bf(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration()}_setupConversion(){const e=this.editor,i=e.editing.view,o=e.plugins.get("ImageUtils"),n=e.t;e.conversion.for("upcast").elementToElement({view:e=>function(e,t){return"figcaption"==t.name&&e.isBlockImageView(t.parent)?{name:!0}:null}(o,e),model:"caption"}),e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(e,{writer:t})=>o.isBlockImage(e.parent)?t.createContainerElement("figcaption"):null}),e.conversion.for("editingDowncast").elementToElement({model:"caption",view:(e,{writer:t})=>{if(!o.isBlockImage(e.parent))return null;e=t.createEditableElement("figcaption");t.setCustomProperty("imageCaption",!0,e),Tl({view:i,element:e,text:n("Enter image caption"),keepOnFocus:!0});e=Mh(e,t);return Vh(e,t,(e,t,i)=>i.addClass(Xt(t.classes),e),(e,t,i)=>i.removeClass(Xt(t.classes),e)),e}}),e.editing.mapper.on("modelToViewPosition",wf(i)),e.data.mapper.on("modelToViewPosition",wf(i))}_setupImageTypeCommandsIntegration(){const e=this.editor,o=e.plugins.get("ImageUtils");var t=e.commands.get("imageTypeInline"),i=e.commands.get("imageTypeBlock"),n=e=>{if(e.return){var{oldElement:t,newElement:i}=e.return;if(t){if(o.isBlockImage(t)){e=ff(t);if(e)return void this._saveCaption(i,e)}t=this._getSavedCaption(t);t&&this._saveCaption(i,t)}}};t&&this.listenTo(t,"execute",n,{priority:"low"}),i&&this.listenTo(i,"execute",n,{priority:"low"})}_getSavedCaption(e){e=this._savedCaptionsMap.get(e);return e?fs.fromJSON(e):null}_saveCaption(e,t){this._savedCaptionsMap.set(e,t.toJSON())}}function wf(r){return(e,t)=>{var i,o=t.modelPosition;const n=o.parent;n.is("element","imageBlock")&&(i=t.mapper.toViewElement(n),t.viewPosition=r.createPositionAt(i,o.offset+1))}}class vf extends Ac{static get requires(){return[Ym]}static get pluginName(){return"ImageCaptionUI"}init(){const o=this.editor,n=o.editing.view,r=o.plugins.get("ImageUtils"),s=o.t;o.ui.componentFactory.add("toggleImageCaption",e=>{var t=o.commands.get("toggleImageCaption");const i=new uc(e);return i.set({icon:Vc.caption,tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(t,"value","isEnabled"),i.bind("label").to(t,"value",e=>e?s("Toggle caption off"):s("Toggle caption on")),this.listenTo(i,"execute",()=>{o.execute("toggleImageCaption",{focusCaptionOnShow:!0});var e=pf(r,o.model.document.selection);if(e){const t=o.editing.mapper.toViewElement(e);n.scrollToTheSelection(),n.change(e=>
5{e.addClass("image__caption_highlighted",t)})}}),i})}}i(87);class _f extends Ac{static get requires(){return[kf,vf]}static get pluginName(){return"ImageCaption"}}class yf extends Ec{constructor(e,t){super(e),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(t.map(e=>{if(e.isDefault)for(const t of e.modelElements)this._defaultStyles[t]=e.name;return[e.name,e]}))}refresh(){const e=this.editor,t=e.plugins.get("ImageUtils"),i=t.getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!i,this.isEnabled?i.hasAttribute("imageStyle")?this.value=i.getAttribute("imageStyle"):this.value=this._defaultStyles[i.name]:this.value=!1}execute(o={}){const e=this.editor,n=e.model,r=e.plugins.get("ImageUtils");n.change(e=>{var t=o.value;let i=r.getClosestSelectedImageElement(n.document.selection);t&&this.shouldConvertImageType(t,i)&&(this.editor.execute(r.isBlockImage(i)?"imageTypeInline":"imageTypeBlock"),i=r.getClosestSelectedImageElement(n.document.selection)),!t||this._styles.get(t).isDefault?e.removeAttribute("imageStyle",i):e.setAttribute("imageStyle",t,i)})}shouldConvertImageType(e,t){const i=this._styles.get(e).modelElements;return!i.includes(t.name)}}var{objectFullWidth:m,objectInline:S,objectLeft:t,objectRight:P,objectCenter:n,objectBlockLeft:b,objectBlockRight:r}=Vc;const xf={inline:{name:"inline",title:"In line",icon:S,modelElements:["imageInline"],isDefault:!0},alignLeft:{name:"alignLeft",title:"Left aligned image",icon:t,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"},alignBlockLeft:{name:"alignBlockLeft",title:"Left aligned image",icon:b,modelElements:["imageBlock"],className:"image-style-block-align-left"},alignCenter:{name:"alignCenter",title:"Centered image",icon:n,modelElements:["imageBlock"],className:"image-style-align-center"},alignRight:{name:"alignRight",title:"Right aligned image",icon:P,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"},alignBlockRight:{name:"alignBlockRight",title:"Right aligned image",icon:r,modelElements:["imageBlock"],className:"image-style-block-align-right"},block:{name:"block",title:"Centered image",icon:n,modelElements:["imageBlock"],isDefault:!0},side:{name:"side",title:"Side image",icon:P,modelElements:["imageBlock"],className:"image-style-side"}},Cf={full:m,left:b,right:r,center:n,inlineLeft:t,inlineRight:P,inline:S},Af=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function Tf(e){Object(Bt.b)("image-style-configuration-definition-invalid",e)}var Ef={normalizeStyles:function(t){const e=t.configuredStyles.options||[];return e.map(e=>function(e){e="string"==typeof e?xf[e]?{...xf[e]}:{name:e}:function(e,t){const i={...t};for(const o in e)Object.prototype.hasOwnProperty.call(t,o)||(i[o]=e[o]);return i}(xf[e.name],e);"string"==typeof e.icon&&(e.icon=Cf[e.icon]||e.icon);return e}(e)).filter(e=>function(e,{isBlockPluginLoaded:t,isInlinePluginLoaded:i}){const{modelElements:o,name:n}=e;{if(!(o&&o.length&&n))return Tf({style:e}),!1;{const r=[t?"imageBlock":null,i?"imageInline":null];if(!o.some(e=>r.includes(e)))return Object(Bt.b)("image-style-missing-dependency",{style:e,missingPlugins:o.map(e=>"imageBlock"===e?"ImageBlockEditing":"ImageInlineEditing")}),!1}}return!0}(e,t))},getDefaultStylesConfiguration:function(e,t){return e&&t?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:e?{options:["block","side"]}:t?{options:["inline","alignLeft","alignRight"]}:{}},getDefaultDropdownDefinitions:function(e){return e.has("ImageBlockEditing")&&e.has("ImageInlineEditing")?[...Af]:[]},warnInvalidStyle:Tf,DEFAULT_OPTIONS:xf,DEFAULT_ICONS:Cf,DEFAULT_DROPDOWN_DEFINITIONS:Af};function Pf(e,t){for(const i of t)if(i.name===e)return i}class Sf extends Ac{static get pluginName(){return"ImageStyleEditing"}static get requires(){return[Ym]}init(){const{normalizeStyles:e,getDefaultStylesConfiguration:t}=Ef,i=this.editor;var o=i.plugins.has("ImageBlockEditing"),n=i.plugins.has("ImageInlineEditing");i.config.define("image.styles",t(o,n)),this.normalizedStyles=e({configuredStyles:i.config.get("image.styles"),isBlockPluginLoaded:o,isInlinePluginLoaded:n}),this._setupConversion(o,n),this._setupPostFixer(),i.commands.add("imageStyle",new yf
5(i,this.normalizedStyles))}_setupConversion(e,t){const i=this.editor,o=i.model.schema;var r,n=(r=this.normalizedStyles,(e,t,i)=>{if(i.consumable.consume(t.item,e.name)){var o=Pf(t.attributeNewValue,r),e=Pf(t.attributeOldValue,r),t=i.mapper.toViewElement(t.item);const n=i.writer;e&&n.removeClass(e.className,t),o&&n.addClass(o.className,t)}}),s=function(e){const s={imageInline:e.filter(e=>!e.isDefault&&e.modelElements.includes("imageInline")),imageBlock:e.filter(e=>!e.isDefault&&e.modelElements.includes("imageBlock"))};return(e,t,i)=>{if(t.modelRange){var o=t.viewItem,n=Yr(t.modelRange.getItems());if(n&&i.schema.checkAttribute(n,"imageStyle"))for(const r of s[n.name])i.consumable.consume(o,{classes:r.className})&&i.writer.setAttribute("imageStyle",r.name,n)}}}(this.normalizedStyles);i.editing.downcastDispatcher.on("attribute:imageStyle",n),i.data.downcastDispatcher.on("attribute:imageStyle",n),e&&(o.extend("imageBlock",{allowAttributes:"imageStyle"}),i.data.upcastDispatcher.on("element:figure",s,{priority:"low"})),t&&(o.extend("imageInline",{allowAttributes:"imageStyle"}),i.data.upcastDispatcher.on("element:img",s,{priority:"low"}))}_setupPostFixer(){const e=this.editor,s=e.model.document,a=e.plugins.get(Ym),l=new Map(this.normalizedStyles.map(e=>[e.name,e]));s.registerPostFixer(t=>{let i=!1;for(const n of s.differ.getChanges())if("insert"==n.type||"attribute"==n.type&&"imageStyle"==n.attributeKey){let e=("insert"==n.type?n.position:n.range.start).nodeAfter;if(e&&e.is("element","paragraph")&&0<e.childCount&&(e=e.getChild(0)),a.isImage(e)){var o=e.getAttribute("imageStyle");if(o){const r=l.get(o);r&&r.modelElements.includes(e.name)||(t.removeAttribute("imageStyle",e),i=!0)}}}return i})}}i(89);class If extends Ac{static get requires(){return[Sf]}static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const e=this.editor.t;return{"Wrap text":e("Wrap text"),"Break text":e("Break text"),"In line":e("In line"),"Full size image":e("Full size image"),"Side image":e("Side image"),"Left aligned image":e("Left aligned image"),"Centered image":e("Centered image"),"Right aligned image":e("Right aligned image")}}init(){const e=this.editor.plugins,t=this.editor.config.get("image.toolbar")||[];var i=Rf(e.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const o of i)this._createButton(o);for(const n of Rf([...t.filter(V),...Ef.getDefaultDropdownDefinitions(e)],this.localizedDefaultStylesTitles))this._createDropdown(n,i)}_createDropdown(l,c){const d=this.editor.ui.componentFactory;d.add(l.name,e=>{let i;const{defaultItem:o,items:t,title:n}=l,r=t.filter(t=>c.find(({name:e})=>Of(e)===t)).map(e=>{var t=d.create(e);return e===o&&(i=t),t});t.length!==r.length&&Ef.warnInvalidStyle({dropdown:l});const s=vc(e,Jc),a=s.buttonView;return _c(s,r),a.set({label:Vf(n,i.label),class:null,tooltip:!0}),a.bind("icon").toMany(r,"isOn",(...e)=>{e=e.findIndex(Hi);return(e<0?i:r[e]).icon}),a.bind("label").toMany(r,"isOn",(...e)=>{e=e.findIndex(Hi);return Vf(n,(e<0?i:r[e]).label)}),a.bind("isOn").toMany(r,"isOn",(...e)=>e.some(Hi)),a.bind("class").toMany(r,"isOn",(...e)=>e.some(Hi)?"ck-splitbutton_flatten":null),a.on("execute",()=>{r.some(({isOn:e})=>e)?s.isOpen=!s.isOpen:i.fire("execute")}),s.bind("isEnabled").toMany(r,"isEnabled",(...e)=>e.some(Hi)),s})}_createButton(o){const n=o.name;this.editor.ui.componentFactory.add(Of(n),e=>{var t=this.editor.commands.get("imageStyle");const i=new uc(e);return i.set({label:o.title,icon:o.icon,tooltip:!0,isToggleable:!0}),i.bind("isEnabled").to(t,"isEnabled"),i.bind("isOn").to(t,"value",e=>e===n),i.on("execute",this._executeCommand.bind(this,n)),i})}_executeCommand(e){this.editor.execute("imageStyle",{value:e}),this.editor.editing.view.focus()}}function Rf(e,t){for(const i of e)t[i.title]&&(i.title=t[i.title]);return e}function Of(e){return`imageStyle:${e}`}function Vf(e,t){return(e?e+": ":"")+t}class Mf extends Ac{static get requires(){return[Sf,If]}static get pluginName(){return"ImageStyle"}}class Nf extends Ac{static get requires(){return[Dm,Ym]}static get pluginName(){return"ImageToolbar"}afterInit(){const e=this.editor,t=e.t,i=e.plugins.get(Dm),o=e.plugins.get("ImageUtils");i.register("image",{ariaLabel:t("Image toolbar"),items:(e.config.get("image.toolbar")||[]).map(e=>V(e)?e.name:e),getRelatedElement:e=>o.getClosestSelectedImageWidget(e)})}}
5class zf extends Ec{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils"),i=t.getClosestSelectedImageElement(e.model.document.selection);this.isEnabled=!!i,i&&i.hasAttribute("width")?this.value={width:i.getAttribute("width"),height:null}:this.value=null}execute(t){const e=this.editor,i=e.model,o=e.plugins.get("ImageUtils"),n=o.getClosestSelectedImageElement(i.document.selection);this.value={width:t.width,height:null},n&&i.change(e=>{e.setAttribute("width",t.width,n)})}}class Bf extends Ac{static get requires(){return[Ym]}static get pluginName(){return"ImageResizeEditing"}constructor(e){super(e),e.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]})}init(){const e=this.editor;var t=new zf(e);this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline"),e.commands.add("resizeImage",t),e.commands.add("imageResize",t)}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:"width"}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:"width"})}_registerConverters(t){const e=this.editor;e.conversion.for("downcast").add(e=>e.on(`attribute:width:${t}`,(e,t,i)=>{if(i.consumable.consume(t.item,e.name)){const o=i.writer;i=i.mapper.toViewElement(t.item);null!==t.attributeNewValue?(o.setStyle("width",t.attributeNewValue,i),o.addClass("image_resized",i)):(o.removeStyle("width",i),o.removeClass("image_resized",i))}})),e.conversion.for("upcast").attributeToAttribute({view:{name:"imageBlock"===t?"figure":"img",styles:{width:/.+/}},model:{key:"width",value:e=>e.getStyle("width")}})}}const Ff={small:Vc.objectSizeSmall,medium:Vc.objectSizeMedium,large:Vc.objectSizeLarge,original:Vc.objectSizeFull};class Df extends Ac{static get requires(){return[Bf]}static get pluginName(){return"ImageResizeButtons"}constructor(e){super(e),this._resizeUnit=e.config.get("image.resizeUnit")}init(){const e=this.editor;var t=e.config.get("image.resizeOptions"),i=e.commands.get("resizeImage");this.bind("isEnabled").to(i);for(const o of t)this._registerImageResizeButton(o);this._registerImageResizeDropdown(t)}_registerImageResizeButton(o){const n=this.editor,{name:e,value:t,icon:r}=o,s=t?t+this._resizeUnit:null;n.ui.componentFactory.add(e,e=>{const t=new uc(e);var i=n.commands.get("resizeImage"),e=this._getOptionLabelValue(o,!0);if(!Ff[r])throw new Bt.a("imageresizebuttons-missing-icon",n,o);return t.set({label:e,icon:Ff[r],tooltip:e,isToggleable:!0}),t.bind("isEnabled").to(this),t.bind("isOn").to(i,"value",Lf(s)),this.listenTo(t,"execute",()=>{n.execute("resizeImage",{width:s})}),t})}_registerImageResizeDropdown(n){const r=this.editor,s=r.t,a=n.find(e=>!e.value);var e=e=>{var t=r.commands.get("resizeImage");const i=vc(e,mc),o=i.buttonView;return o.set({tooltip:s("Resize image"),commandValue:a.value,icon:Ff.medium,isToggleable:!0,label:this._getOptionLabelValue(a),withText:!0,class:"ck-resize-image-button"}),o.bind("label").to(t,"value",e=>e&&e.width?e.width:this._getOptionLabelValue(a)),i.bind("isOn").to(t),i.bind("isEnabled").to(this),yc(i,this._getResizeDropdownListItemDefinitions(n,t)),i.listView.ariaLabel=s("Image resize list"),this.listenTo(i,"execute",e=>{r.execute(e.source.commandName,{width:e.source.commandValue}),r.editing.view.focus()}),i};r.ui.componentFactory.add("resizeImage",e),r.ui.componentFactory.add("imageResize",e)}_getOptionLabelValue(e,t){const i=this.editor.t;return e.label||(t?e.value?i("Resize image to %0",e.value+this._resizeUnit):i("Resize image to the original size"):e.value?e.value+this._resizeUnit:i("Original"))}_getResizeDropdownListItemDefinitions(e,o){const n=new Jt;return e.map(e=>{var t=e.value?e.value+this._resizeUnit:null;const i={type:"button",model:new id({commandName:"resizeImage",commandValue:t,label:this._getOptionLabelValue(e),withText:!0,icon:null})};i.model.bind("isOn").to(o,"value",Lf(t)),n.add(i)}),n}}function Lf(t){return e=>null===t&&e===t||e&&e.width===t}const Hf=/(image|image-inline)/,jf="image_resized";class Wf extends Ac{static get requires(){return[qm]}static get pluginName(){return"ImageResizeHandles"}init(){var e=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(e),this._setupResizerCreator()}_setupResizerCreator(){const a=this.editor,l=a.editing.view;l.addObserver(sf),this.listenTo(l.document,"imageLoaded",(e,t)=>{if(t.target.matches("figure.image.ck-widget > img,figure.image.ck-widget > picture > img,figure.image.ck-widget > a > img,figure.image.ck-widget > a > picture > img,span.image-inline.ck-widget > img,span.image-inline.ck-widget > picture > img")){const i=a.editing.view.domConverter,o=i.domToView(t.target),n=o.findAnce
5stor({classes:Hf});let e=this.editor.plugins.get(qm).getResizerByViewElement(n);if(e)e.redraw();else{const r=a.editing.mapper,s=r.toModelElement(n);e=a.plugins.get(qm).attachTo({unit:a.config.get("image.resizeUnit"),modelElement:s,viewElement:n,editor:a,getHandleHost(e){return e.querySelector("img")},getResizeHost(){return i.viewToDom(r.toViewElement(s.parent))},isCentered(){var e=s.getAttribute("imageStyle");return!e||"block"==e||"alignCenter"==e},onCommit(e){l.change(e=>{e.removeClass(jf,n)}),a.execute("resizeImage",{width:e})}}),e.on("updateSize",()=>{n.hasClass(jf)||l.change(e=>{e.addClass(jf,n)})}),e.bind("isEnabled").to(this)}}})}}i(91);class $f extends Ac{static get requires(){return[Bf,Wf,Df]}static get pluginName(){return"ImageResize"}}class qf{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(e){Array.isArray(e)?e.forEach(e=>this._definitions.add(e)):this._definitions.add(e)}getDispatcher(){return e=>{e.on("attribute:linkHref",(e,t,i)=>{if(i.consumable.test(t.item,"attribute:linkHref")){const n=i.writer,r=n.document.selection;for(const s of this._definitions){var o=n.createAttributeElement("a",s.attributes,{priority:5});s.classes&&n.addClass(s.classes,o);for(const a in s.styles)n.setStyle(a,s.styles[a],o);n.setCustomProperty("link",!0,o),s.callback(t.attributeNewValue)?t.item.is("selection")?n.wrap(r.getFirstRange(),o):n.wrap(i.mapper.toViewRange(t.range),o):n.unwrap(i.mapper.toViewRange(t.range),o)}}},{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:imageBlock",(e,t,{writer:i,mapper:o})=>{const n=o.toViewElement(t.item);var r=Array.from(n.getChildren()).find(e=>"a"===e.name);for(const h of this._definitions){var s=li(h.attributes);if(h.callback(t.attributeNewValue)){for(var[a,l]of s)"class"===a?i.addClass(l,r):i.setAttribute(a,l,r);h.classes&&i.addClass(h.classes,r);for(const u in h.styles)i.setStyle(u,h.styles[u],r)}else{for(var[c,d]of s)"class"===c?i.removeClass(d,r):i.removeAttribute(c,r);h.classes&&i.removeClass(h.classes,r);for(const g in h.styles)i.removeStyle(g,r)}}})}}}var Uf=function(e,t,i){var o=e.length;return i=void 0===i?o:i,!t&&o<=i?e:Si(e,t,i)},Kf=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var Gf=function(e){return Kf.test(e)};var Jf=function(e){return e.split("")},O="\\ud800-\\udfff",m="["+O+"]",b="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",n="[^"+O+"]",t="(?:\\ud83c[\\udde6-\\uddff]){2}",P="[\\ud800-\\udbff][\\udc00-\\udfff]",S="(?:"+b+"|"+r+")"+"?",O="[\\ufe0e\\ufe0f]?",S=O+S+("(?:\\u200d(?:"+[n,t,P].join("|")+")"+O+S+")*"),m="(?:"+[n+b+"?",b,t,P,m].join("|")+")",Yf=RegExp(r+"(?="+r+")|"+m+S,"g");var Xf=function(e){return e.match(Yf)||[]};var Qf=function(e){return(Gf(e)?Xf:Jf)(e)};var Zf=function(o){return function(e){e=Ci(e);var t=Gf(e)?Qf(e):void 0,i=t?t[0]:e.charAt(0),e=t?Uf(t,1).join(""):e.slice(1);return i[o]()+e}}("toUpperCase");const ep=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,tp=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i,ip=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,op=/^((\w+:(\/{2,})?)|(\W))/i,np="Ctrl+K";function rp(e,{writer:t}){e=t.createAttributeElement("a",{href:e},{priority:5});return t.setCustomProperty("link",!0,e),e}function sp(e){return function(e){const t=e.replace(ep,"");return t.match(tp)}(e=String(e))?e:"#"}function ap(e,t){return e&&t.checkAttribute(e.name,"linkHref")}function lp(e,t){var i,i=(i=e,ip.test(i)?"mailto:":t),t=!!i&&!op.test(e);return e&&t?i+e:e}class cp extends Ec{constructor(e){super(e),this.manualDecorators=new Jt,this.automaticDecorators=new qf}restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,t=e.document.selection,i=t.getSelectedElement()||Yr(t.getSelectedBlocks());ap(i,e.schema)?(this.value=i.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(i,"linkHref")):(this.value=t.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref"));for(const o of this.manualDecorators)o.value=this._getDecoratorStateFromModel(o.id)}execute(d,e={}){const h=this.editor.model,u=h.document.selection,g=[],m=[];for(const t in e)(e[t]?g:m).push(t);h.change(t=>{if(u.isCollapsed){var e=u.getFirstPosition();if(u.hasAttribute("linkHref")){const o=Vu(e,"linkHref",u.getAttribute("linkHref"),h);
5t.setAttribute("linkHref",d,o),g.forEach(e=>{t.setAttribute(e,!0,o)}),m.forEach(e=>{t.removeAttribute(e,o)}),t.setSelection(t.createPositionAfter(o.end.nodeBefore))}else if(""!==d){const n=li(u.getAttributes());n.set("linkHref",d),g.forEach(e=>{n.set(e,!0)});var i=h.insertContent(t.createText(d,n),e)["end"];t.setSelection(i)}["linkHref",...g,...m].forEach(e=>{t.removeSelectionAttribute(e)})}else{i=h.schema.getValidRanges(u.getRanges(),"linkHref");const r=[];for(const a of u.getSelectedBlocks())h.schema.checkAttribute(a,"linkHref")&&r.push(t.createRangeOn(a));const s=r.slice();for(const l of i)this._isRangeToUpdate(l,r)&&s.push(l);for(const c of s)t.setAttribute("linkHref",d,c),g.forEach(e=>{t.setAttribute(e,!0,c)}),m.forEach(e=>{t.removeAttribute(e,c)})}})}_getDecoratorStateFromModel(e){var t=this.editor.model;const i=t.document.selection,o=i.getSelectedElement();return(ap(o,t.schema)?o:i).getAttribute(e)}_isRangeToUpdate(e,t){for(const i of t)if(i.containsRange(e))return!1;return!0}}class dp extends Ec{refresh(){const e=this.editor.model,t=e.document.selection;var i=t.getSelectedElement();ap(i,e.schema)?this.isEnabled=e.schema.checkAttribute(i,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){const e=this.editor,o=this.editor.model,n=o.document.selection,r=e.commands.get("link");o.change(e=>{for(const t of n.isCollapsed?[Vu(n.getFirstPosition(),"linkHref",n.getAttribute("linkHref"),o)]:o.schema.getValidRanges(n.getRanges(),"linkHref"))if(e.removeAttribute("linkHref",t),r)for(const i of r.manualDecorators)e.removeAttribute(i.id,t)})}}class hp{constructor({id:e,label:t,attributes:i,classes:o,styles:n,defaultValue:r}){this.id=e,this.set("value"),this.defaultValue=r,this.label=t,this.attributes=i,this.classes=o,this.styles=n}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}Gt(hp,fo);i(93);const up="automatic",gp=/^(https?:)?\/\//;class mp extends Ac{static get pluginName(){return"LinkEditing"}static get requires(){return[Tu,yu,gh]}constructor(e){super(e),e.config.define("link",{addTargetToExternalLinks:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:rp}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(e,t)=>rp(sp(e),t)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:e=>e.getAttribute("href")}}),e.commands.add("link",new cp(e)),e.commands.add("unlink",new dp(e));const t=function(e,t){const i={"Open in a new tab":e("Open in a new tab"),Downloadable:e("Downloadable")};return t.forEach(e=>(e.label&&i[e.label]&&(e.label=i[e.label]),e)),t}(e.t,function(e){const t=[];if(e)for(var[i,o]of Object.entries(e)){i=Object.assign({},o,{id:`link${Zf(i)}`});t.push(i)}return t}(e.config.get("link.decorators")));this._enableAutomaticDecorators(t.filter(e=>e.mode===up)),this._enableManualDecorators(t.filter(e=>"manual"===e.mode));const i=e.plugins.get(Tu);i.registerAttribute("linkHref"),Nu(e,"linkHref","a","ck-link_selected"),this._enableInsertContentSelectionAttributesFixer(),this._enableClickingAfterLink(),this._enableTypingOverLink(),this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(e){const t=this.editor;const i=t.commands.get("link").automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&i.add({id:"linkIsExternal",mode:up,callback:e=>gp.test(e),attributes:{target:"_blank",rel:"noopener noreferrer"}}),i.add(e),i.length&&t.conversion.for("downcast").add(i.getDispatcher())}_enableManualDecorators(e){if(e.length){const t=this.editor;const i=t.commands.get("link").manualDecorators;e.forEach(n=>{t.model.schema.extend("$text",{allowAttributes:n.id}),n=new hp(n),i.add(n),t.conversion.for("downcast").attributeToElement({model:n.id,view:(e,{writer:t})=>{if(e){var i=t.createAttributeElement("a",n.attributes,{priority:5});n.classes&&t.addClass(n.classes,i);for(const o in n.styles)t.setStyle(o,n.styles[o],i);return t.setCustomProperty("link",!0,i),i}}}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",...n._createPattern()},model:{key:n.id}})})}}_enableInsertContentSelectionAttributesFixer(){const i=this.editor.model,o=i.document.selection;this.listenTo(i,"insertContent",()=>{const e=o.anchor.nodeBefore,t=o.anchor.nodeAfter;o.hasAttribute("linkHref")&&e&&e.hasAttribute("linkHref")&&(t&&t.hasAttribute("linkHref")||i.change(e=>{fp(e,bp(i.schema))}))},{priority:"low"})}_enableClickingAfterLink(){const e=this.editor,o=e.model;e.editing.view.addObserver(Cd);let n=!1;this.listenTo(e.editing.view.document,"mousedown",()=>{n=!0}),this.listenTo(e.editing.view.document,"selectionChange",()=>{if(n){n=!1;const t=o.document.selection;if(t.isCollapsed&&t.hasAttribute("linkHref")){const i=t.getFirstPosition();var e=Vu(i,"linkHref",t.getAttribute("linkHref"),o);(i.isTouching(e.start)||i.isTouching(e.end))&&o.change(e=>{fp(e,bp(o.schema))})}}})}_enableTypingOverLink(){const t=this.editor;var e=t.editing.view;let n,i;this.listenTo(e.document,"delete",()=>{i=!0},{priority:"high"}),this.listenTo(t.model,"deleteContent",()=>{const e=t.model.document.selection;e.isCollapsed||(i?i=!1:!pp(t)||function(e){const t=e.document.selection,i=t.getFirstPosition(),o=t.getLastPosition(),n=i.nodeAfter;if(!n)return!1;if(!n.is("$text"))return!1;if(!n.hasAttribute("linkHref"))return!1;var r=o.textNode||o.nodeBefore;if(n===r)return!0;const s=Vu(i,"linkHref",n.getAttribute("linkHref"),e);return s.containsRange(e.createRange(i,o),!0)}(t.model)&&(n=e.getAttributes()))},{priority:"high"}),this.listenTo(t.model,"insertContent",(e,[o])=>{i=!1,pp(t)&&n&&(t.model.change(e=>{for(var[t,i]of n)e.setAttribute(t,i,o)}),n=null)},{priority:"high"})}_handleDeleteContentAfterLink(){const e=this.editor,o=e.model,n=o.document.selection;var t=e.editing.view;let r=!1,i=!1;this.listenTo(t.document,"delete",(e,t)=>{i=t.domEvent.keyCode===Jo.backspace},{priority:"high"}),this.listenTo(o,"deleteContent",()=>{r=!1;var e=n.getFirstPosition(),t=n.getAttribute("linkHref");if(t){const i=Vu(e,"linkHref",t,o);r=i.containsPosition(e)||i.end.isEqual(e)}},{priority:"high"}),this.listenTo(o,"deleteContent",()=>{i&&(i=!1,r||e.model.enqueueChange(e=>{fp(e,bp(o.schema))}))},{priority:"low"})}}function fp(e,t){e.removeSelectionAttribute("linkHref");for(const i of t)e.removeSelectionAttribute(i)}function pp(e){const t=e.plugins.get("Input");return t.isInput(e.model.change(e=>e.batch))}function bp(e){const t=e.getDefinition("$text").allowAttributes;return t.filter(e=>e.startsWith("link"))}i(95);class kp extends Jl{constructor(e,t){super(e);const i=e.t;this.focusTracker=new Xr,this.keystrokes=new Qr,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(i("Save"),Vc.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(i("Cancel"),Vc.cancel,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t),this.children=this._createFormChildren(t.manualDecorators),this._focusables=new Rl,this._focusCycler=new ec({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const o=["ck","ck-link-form","ck-responsive-form"];t.manualDecorators.length&&o.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:o,tabindex:"-1"},children:this.children}),jc(this)}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((e,t)=>
5(e[t.name]=t.isOn,e),{})}render(){super.render(),Wc({view:this});const e=[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView];e.forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const e=this.locale.t,t=new Zc(this.locale,ed);return t.label=e("Link URL"),t}_createButton(e,t,i,o){const n=new uc(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n.extendTemplate({attributes:{class:i}}),o&&n.delegate("execute").to(this,o),n}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const i of e.manualDecorators){const o=new kc(this.locale);o.set({name:i.id,label:i.label,withText:!0}),o.bind("isOn").toMany([i,e],"value",(e,t)=>void 0===t&&void 0===e?i.defaultValue:e),o.on("execute",()=>{i.set("value",!o.isOn)}),t.add(o)}return t}_createFormChildren(e){const t=this.createCollection();if(t.add(this.urlInputView),e.length){const i=new Jl;i.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(e=>({tag:"li",children:[e],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),t.add(i)}return t.add(this.saveButtonView),t.add(this.cancelButtonView),t}}i(97);class wp extends Jl{constructor(e){super(e);const t=e.t;this.focusTracker=new Xr,this.keystrokes=new Qr,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(t("Unlink"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184zm4.919 10.562-1.414 1.414a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.061-1.06l1.414 1.414 1.414-1.415a.75.75 0 0 1 1.061 1.061l-1.414 1.414 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414z"/></svg>',"unlink"),this.editButtonView=this._createButton(t("Edit link"),Vc.pencil,"edit"),this.set("href"),this._focusables=new Rl,this._focusCycler=new ec({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render();const e=[this.previewButtonView,this.editButtonView,this.unlinkButtonView];e.forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createButton(e,t,i){const o=new uc(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.delegate("execute").to(this,i),o}_createPreviewButton(){const e=new uc(this.locale),t=this.bindTemplate,i=this.t;return e.set({withText:!0,tooltip:i("Open link in new tab")}),e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",e=>e&&sp(e)),target:"_blank",rel:"noopener noreferrer"}}),e.bind("label").to(this,"href",e=>e||i("This link has no URL")),e.bind("isEnabled").to(this,"href",e=>!!e),e.template.tag="a",e.template.eventListeners={},e}}const vp="link-ui";class _p extends Ac{static get requires(){return[dd]}static get pluginName(){return"LinkUI"}init(){const e=this.editor;e.editing.view.addObserver(xd),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=e.plugins.get(dd),this._createToolbarLinkButton(),this._enableUserBalloonInteractions(),e.conversion.for("editingDowncast").markerToHighlight({model:vp,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:vp,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy(),this.formView.destroy()}_createActionsView(){const e=this.editor,t=new wp(e.locale);var i=e.commands.get("link"),o=e.commands.get("unlink");return t.bind("href").to(i,"value"),t.editButtonView.bind("isEnabled").to(i),t.unlinkButtonView.bind("isEnabled").to(o),this.listenTo(t,"edit",()=>{this._addFormView()}),this.listenTo(t,"unlink",()=>{e.execute("unlink"),this._hideUI()}),t.keystrokes.set("Esc",(e,t)=>{this._hideUI(),t()}),t.keystrokes.set(np,(e,t)=>{this._addFormView(),t()}),t}_createFormView(){const t=this.editor;var e=t.commands.get("link");const i=t.config.get("link.defaultProtocol"),o=new kp(t.locale,e);return o.urlInputView.fieldView.bind("value").to(e,"value"),o.urlInputView.bind("isReadOnly").to(e,"isEnabled",e=>!e),o.saveButtonView.bind("isEnabled").to(e),this.listenTo(o,"submit",()=>{var e=o.urlInputView.fieldView.element["value"],e=lp(e,i);t.execute("link",e,o.getDecoratorSwitchesState()),this._closeFormView()}),this.listenTo(o,"cancel",()=>{this._closeFormView()}),o.keystrokes.set("Esc",(e,t)=>{this._closeFormView(),t()}),o}_createToolbarLinkButton(){const e=this.editor,i=e.commands.get("link"),o=e.t;e.keystrokes.set(np,(e,t)=>{t(),i.isEnabled&&this._showUI(!0)}),e.ui.componentFactory.add("link",e=>{const t=new uc(e);return t.isEnabled=!0,t.label=o("Link"),t.icon='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
5<path d="m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184z"/></svg>',t.keystroke=np,t.tooltip=!0,t.isToggleable=!0,t.bind("isEnabled").to(i,"isEnabled"),t.bind("isOn").to(i,"value",e=>!!e),this.listenTo(t,"execute",()=>this._showUI(!0)),t})}_enableUserBalloonInteractions(){var e=this.editor.editing.view.document;this.listenTo(e,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),this.editor.keystrokes.set("Tab",(e,t)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),t())},{priority:"high"}),this.editor.keystrokes.set("Esc",(e,t)=>{this._isUIVisible&&(this._hideUI(),t())}),wc({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(!this._isFormInPanel){const t=this.editor;var e=t.commands.get("link");this.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions(),this.formView.urlInputView.fieldView.element.value=e.value||""}}_closeFormView(){const e=this.editor.commands.get("link");e.restoreManualDecoratorStates(),void 0!==e.value?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(e=!1){this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(this._isUIInPanel){const e=this.editor;this.stopListening(e.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}}_startUpdatingUI(){var e=this.editor;const t=e.editing.view.document;let i=this._getSelectedLinkElement(),o=r();var n=()=>{var e=this._getSelectedLinkElement(),t=r();i&&!e||!i&&t!==o?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),i=e,o=t};function r(){return t.selection.focus.getAncestors().reverse().find(e=>e.is("element"))}this.listenTo(e.ui,"update",n),this.listenTo(this._balloon,"change:visibleView",n)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const t=this.editor.editing.view,e=this.editor.model,i=t.document;let o=null;var n;return o=e.markers.has(vp)?(n=Array.from(this.editor.editing.mapper.markerNameToElements(vp)),n=t.createRange(t.createPositionBefore(n[0]),t.createPositionAfter(n[n.length-1])),t.domConverter.viewRangeToDom(n)):()=>{var e=this._getSelectedLinkElement();return e?t.domConverter.mapViewToDom(e):t.domConverter.viewRangeToDom(i.selection.getFirstRange())},{target:o}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection;var i=t.getSelectedElement();if(t.isCollapsed||i&&Sh(i))return yp(t.getFirstPosition());var o=t.getFirstRange().getTrimmed(),n=yp(o.start),i=yp(o.end);return n&&n==i&&e.createRangeIn(n).getTrimmed().isEqual(o)?n:null}_showFakeVisualSelection(){const o=this.editor.model;o.change(e=>{const t=o.document.selection.getFirstRange();var i;o.markers.has(vp)?e.updateMarker(vp,{range:t}):t.start.isAtEnd?(i=t.start.getLastMatchingPosition(({item:e})=>!o.schema.isContent(e),{boundaries:t}),e.addMarker(vp,{usingOperation:!1,affectsData:!1,range:e.createRange(i,t.end)})):e.addMarker(vp,{usingOperation:!1,affectsData:!1,range:t})})}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(vp)&&e.change(e=>{e.removeMarker(vp)})}}function yp(e){return e.getAncestors().find(e=>function(e){return e.is("attributeElement")&&!!e.getCustomProperty("link")}(e))}const xp=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class Cp extends Ac{static get pluginName(){return"AutoLink"}init(){const e=this.editor.model.document.selection;e.on("change:range",()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling()}_enableTypingHandling(){const s=this.editor,e=new Au(s.model,e=>{if(4<(t=e).length&&" "===t[t.length-1]&&" "!==t[t.length-2]){var t,e=Ap(e.substr(0,e.length-1));return e?{url:e}:void 0}}),a=s.plugins.get("Input");e.on("matched:data",(e,t)=>{const{batch:i,range:o,url:n}=t;if(a.isInput(i)){const r=o.end.getShiftedBy(-1);t=r.getShiftedBy(-n.length),t=s.model.createRange(t,r);this._applyAutoLink(n,t)}}),e.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,t=e.model,i=e.commands.get("enter");i&&i.on("execute",()=>{var e=t.document.selection.getFirstPosition();e.parent.previousSibling&&(e=t.createRangeIn(e.parent.previousSibling),this._checkAndApplyAutoLinkOnRange(e))})}_enableShiftEnterHandling(){const e=this.editor,i=e.model,t=e.commands.get("shiftEnter");t&&t.on("execute",()=>{const e=i.document.selection.getFirstPosition();var t=i.createRange(i.createPositionAt(e.parent,0),e.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(t)}
5)}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:i,range:o}=Cu(e,t);var n=Ap(i);n&&(e=t.createRange(o.end.getShiftedBy(-n.length),o.end),this._applyAutoLink(n,e))}_applyAutoLink(i,o){const e=this.editor.model;var t;this.isEnabled&&(t=e).schema.checkAttributeInSelection(t.createSelection(o),"linkHref")&&e.enqueueChange(e=>{var t=this.editor.config.get("link.defaultProtocol"),t=lp(i,t);e.setAttribute("linkHref",t,o)})}}function Ap(e){e=xp.exec(e);return e?e[2]:null}class Tp extends Ac{static get requires(){return[mp,_p,Cp]}static get pluginName(){return"Link"}}class Ep extends Ec{constructor(e,t){super(e),this.type=t}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,i=t.document,s=Array.from(i.selection.getSelectedBlocks()).filter(e=>Sp(e,t.schema)),a=void 0!==e.forceValue?!e.forceValue:this.value;t.change(o=>{if(a){let e=s[s.length-1].nextSibling,t=Number.POSITIVE_INFINITY,i=[];for(;e&&"listItem"==e.name&&0!==e.getAttribute("listIndent");){var n=e.getAttribute("listIndent");n<t&&(t=n);n=n-t;i.push({element:e,listIndent:n}),e=e.nextSibling}i=i.reverse();for(const r of i)o.setAttribute("listIndent",r.listIndent,r.element)}if(!a){let e=Number.POSITIVE_INFINITY;for(const t of s)t.is("element","listItem")&&t.getAttribute("listIndent")<e&&(e=t.getAttribute("listIndent"));e=0===e?1:e,Pp(s,!0,e),Pp(s,!1,e)}for(const e of s.reverse())a&&"listItem"==e.name?o.rename(e,"paragraph"):a||"listItem"==e.name?a||"listItem"!=e.name||e.getAttribute("listType")==this.type||o.setAttribute("listType",this.type,e):(o.setAttributes({listType:this.type,listIndent:0},e),o.rename(e,"listItem"));this.fire("_executeCleanup",s)})}_getValue(){const e=Yr(this.editor.model.document.selection.getSelectedBlocks());return!!e&&e.is("element","listItem")&&e.getAttribute("listType")==this.type}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection;var t=this.editor.model.schema,i=Yr(e.getSelectedBlocks());return!!i&&Sp(i,t)}}function Pp(i,o,n){const r=o?i[0]:i[i.length-1];if(r.is("element","listItem")){let e=r[o?"previousSibling":"nextSibling"],t=r.getAttribute("listIndent");for(;e&&e.is("element","listItem")&&e.getAttribute("listIndent")>=n;)t>e.getAttribute("listIndent")&&(t=e.getAttribute("listIndent")),e.getAttribute("listIndent")==t&&i[o?"unshift":"push"](e),e=e[o?"previousSibling":"nextSibling"]}}function Sp(e,t){return t.checkChild(e.parent,"listItem")&&!t.isObject(e)}class Ip extends Ec{constructor(e,t){super(e),this._indentBy="forward"==t?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=e.document;let r=Array.from(t.selection.getSelectedBlocks());e.change(e=>{const t=r[r.length-1];let i=t.nextSibling;for(;i&&"listItem"==i.name&&i.getAttribute("listIndent")>t.getAttribute("listIndent");)r.push(i),i=i.nextSibling;this._indentBy<0&&(r=r.reverse());for(const n of r){var o=n.getAttribute("listIndent")+this._indentBy;o<0?e.rename(n,"paragraph"):e.setAttribute("listIndent",o,n)}this.fire("_executeCleanup",r)})}_checkEnabled(){const t=Yr(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is("element","listItem"))return!1;if(0<this._indentBy){var i=t.getAttribute("listIndent"),o=t.getAttribute("listType");let e=t.previousSibling;for(;e&&e.is("element","listItem")&&e.getAttribute("listIndent")>=i;){if(e.getAttribute("listIndent")==i)return e.getAttribute("listType")==o;e=e.previousSibling}return!1}return!0}}function Rp(e,t){const i=t.mapper,o=t.writer;var n="numbered"==e.getAttribute("listType")?"ol":"ul",t=function(e){const t=e.createContainerElement("li");return t.getFillerOffset=Bp,t}(o),n=o.createContainerElement(n,null);return o.insert(o.createPositionAt(n,0),t),i.bindElements(e,t),t}function Op(t,i,e,o){var n=i.parent;const r=e.mapper,s=e.writer;let a=r.toViewPosition(o.createPositionBefore(t));const l=Np(t.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:t.getAttribute("listIndent")});var c,d=t.previousSibling;if(a=l&&l.getAttribute("listIndent")==t.getAttribute("listIndent")?(c=r.toViewElement(l),s.breakContainer(s.createPositionAfter(c))):d&&"listItem"==d.name?(a=r.toViewPosition(o.createPositionAt(d,"end")),(c=function(e){for(const t of e.getChildren())if("ul"==t.name||"ol"==t.name)return t;return null}(e=r.findMappedViewAncestor(a)))?s.createPositionBefore(c):s.createPositionAt(e,"end")):r.toViewPosition(o.createPositionBefore(t)),a=Mp(a),s.insert(a,n),d&&"listItem"==d.name){var h,u,g,d=r.toViewElement(d);const m=s.createRange(s.createPositionAt(d,0),a),f=m.getWalker({ignoreElementEnd:!0});for(const p of f)p.item.is("element","li")&&(h=s.breakContainer(s.createPositionBefore(p.item)),u=p.item.parent,g=s.createPositionAt(i,"end"),Vp(s,g.nodeBefore,g.nodeAfter),s.move(s.createRangeOn(u),g),f.position=h)}else{const b=n.nextSibling;if(b&&(b.is("element","ul")||b.is("element","ol"))){let e=null;for(const k of b.getChildren()){const w=r.toModelElement(k);if(!(w&&w.getAttribute("listIndent")>t.getAttribute("listIndent")))break;e=k}e&&(s.breakContainer(s.createPositionAfter(e)),s.move(s.createRangeOn(e.parent),s.createPositionAt(i,"end")))}}Vp(s,n,n.nextSibling),Vp(s,n.previousSibling,n)}function Vp(e,t,i){return!t||!i||"ul"!=t.name&&"ol"!=t.name||t.name!=i.name||t.getAttribute("class")!==i.getAttribute("class")?null:e.mergeContainers(e.createPositionAfter(t))}function Mp(e){return e.getLastMatchingPosition(e=>e.item.is("uiElement"))}function Np(e,t){var i=!!t.sameIndent,o=!!t.smallerIndent,n=t.listIndent;let r=e;for(;r&&"listItem"==r.name;){var s=r.getAttribute("listIndent");if(i&&n==s||o&&s<n)return r;r="forward"===t.direction?r.nextSibling:r.previousSibling}return null}function zp(o,n,r,s){o.ui.componentFactory.add(n,e=>{var t=o.commands.get(n);const i=new uc(e);return i.set({label:r,icon:s,tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(t,"value","isEnabled"),i.on("execute",()=>{o.execute(n),o.editing.view.focus()}),i})}function Bp(){var e=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||e?0:so.call(this)}function Fp(n){return(e,t,i)=>{const o=i.consumable;o.test(t.item,"insert")&&o.test(t.item,"attribute:listType")&&o.test(t.item,"attribute:listIndent")&&(o.consume(t.item,"insert"),o.consume(t.item,"attribute:listType"),o.consume(t.item,"attribute:listIndent"),Op(t=t.item,Rp(t,i),i,n))}}function Dp(e,t,i){if(i.consumable.consume(t.item,"attribute:listType")){var o=i.mapper.toViewElement(t.item);const n=i.writer;n.breakContainer(n.createPositionBefore(o)),n.breakContainer(n.createPositionAfter(o
5));o=o.parent,t="numbered"==t.attributeNewValue?"ol":"ul";n.rename(t,o)}}function Lp(e,t,i){var o=i.mapper.toViewElement(t.item).parent,n=i.writer;Vp(n,o,o.nextSibling),Vp(n,o.previousSibling,o);for(const r of t.item.getChildren())i.consumable.consume(r,"insert")}function Hp(e,i,o){if("listItem"!=i.item.name){let t=o.mapper.toViewPosition(i.range.start);const a=o.writer,l=[];for(;("ul"==t.parent.name||"ol"==t.parent.name)&&(t=a.breakContainer(t),"li"==t.parent.name);){const c=t;var n=a.createPositionAt(t.parent,"end");c.isEqual(n)||(n=a.remove(a.createRange(c,n)),l.push(n)),t=a.createPositionAfter(t.parent)}if(0<l.length){for(let e=0;e<l.length;e++){var r=t.nodeBefore,s=a.insert(t,l[e]);t=s.end,0<e&&((s=Vp(a,r,r.nextSibling))&&s.parent==r&&t.offset--)}Vp(a,t.nodeBefore,t.nodeAfter)}}}function jp(e,t,i){var o=i.mapper.toViewPosition(t.position),t=o.nodeBefore,o=o.nodeAfter;Vp(i.writer,t,o)}function Wp(e,t,i){if(i.consumable.consume(t.viewItem,{name:!0})){const r=i.writer;var o=r.createElement("listItem"),n=function(e){let t=0,i=e.parent;for(;i;){if(i.is("element","li"))t++;else{const o=i.previousSibling;o&&o.is("element","li")&&t++}i=i.parent}return t}(t.viewItem);r.setAttribute("listIndent",n,o);n=t.viewItem.parent&&"ol"==t.viewItem.parent.name?"numbered":"bulleted";r.setAttribute("listType",n,o),i.safeInsert(o,t.modelCursor)&&(n=function(e,t,i){const{writer:o,schema:n}=i;let r=o.createPositionAfter(e);for(const s of t)if("ul"==s.name||"ol"==s.name)r=i.convertItem(s,r).modelCursor;else{const a=i.convertItem(s,o.createPositionAt(e,"end")),l=a.modelRange.start.nodeAfter;l&&l.is("element")&&!n.checkChild(e,l.name)&&(e=a.modelCursor.parent.is("element","listItem")?a.modelCursor.parent:function(e){const t=new ps({startPosition:e});let i;for(;i=t.next(),!i.value.item.is("element","listItem"););return i.value.item}(a.modelCursor),r=o.createPositionAfter(e))}return r}(o,t.viewItem.getChildren(),i),t.modelRange=r.createRange(t.modelCursor,n),i.updateConversionResult(o,t))}}function $p(e,t,i){if(i.consumable.test(t.viewItem,{name:!0}))for(const o of Array.from(t.viewItem.getChildren()))!(o.is("element","li")||Yp(o))&&o._remove()}function qp(e,i,t){if(t.consumable.test(i.viewItem,{name:!0})&&0!==i.viewItem.childCount){let e=!1,t=!0;for(const o of[...i.viewItem.getChildren()])e&&!Yp(o)&&o._remove(),o.is("$text")?(t&&(o._data=o.data.trimStart()),o.nextSibling&&!Yp(o.nextSibling)||(o._data=o.data.trimEnd())):Yp(o)&&(e=!0),t=!1}}function Up(s){return(e,t)=>{if(!t.isPhantom){const o=t.modelPosition.nodeBefore;if(o&&o.is("element","listItem")){const n=t.mapper.toViewElement(o);var i=n.getAncestors().find(Yp);for(const r of s.createPositionAt(n,0).getWalker()){if("elementStart"==r.type&&r.item.is("element","li")){t.viewPosition=r.previousPosition;break}if("elementEnd"==r.type&&r.item==i){t.viewPosition=r.nextPosition;break}}}}}}function Kp(e,r){var t=e.document.differ.getChanges();const o=new Map;let s=!1;for(const n of t)if("insert"==n.type&&"listItem"==n.name)i(n.position);else if("insert"==n.type&&"listItem"!=n.name){if("$text"!=n.name){const a=n.position.nodeAfter;a.hasAttribute("listIndent")&&(r.removeAttribute("listIndent",a),s=!0),a.hasAttribute("listType")&&(r.removeAttribute("listType",a),s=!0),a.hasAttribute("listStyle")&&(r.removeAttribute("listStyle",a),s=!0);for(const l of Array.from(e.createRangeIn(a)).filter(e=>e.item.is("element","listItem")))i(l.previousPosition)}i(n.position.getShiftedBy(n.length))}else"remove"==n.type&&"listItem"==n.name?i(n.position):("attribute"==n.type&&"listIndent"==n.attributeKey||"attribute"==n.type&&"listType"==n.attributeKey)&&i(n.range.start);for(const c of o.values())!function(t){let i=0,o=null;for(;t&&t.is("element","listItem");){var n=t.getAttribute("listIndent");if(n>i){let e;e=null===o?(o=n-i,i):(o>n&&(o=n),n-o),r.setAttribute("listIndent",e,t),s=!0}else o=null,i=t.getAttribute("listIndent")+1;t=t.nextSibling}}(c),function(e){let t=[],i=null;for(;e&&e.is("element","listItem");){var o,n=e.getAttribute("listIndent");i&&i.getAttribute("listIndent")>n&&(t=t.slice(0,n+1)),0!=n&&(t[n]?(o=t[n],e.getAttribute("listType")!=o&&(r.setAttribute("listType",o,e),s=!0)):t[n]=e.getAttribute("listType")),e=(i=e).nextSibling}}(c);return s;function i(e){const i=e.nodeBefore;if(i&&i.is("element","listItem")){let t=i;if(!o.has(t)){for(let e=t.previousSibling;e&&e.is("element","listItem");e=t.previousSibling)if(t=e,o.has(t))return;o.set(i,t)}}else{const t=e.nodeAfter;t&&t.is("element","listItem")&&o.set(t,t)}}}function Gp(e,[t,i]){let o=t.is("documentFragment")?t.getChild(0):t,n;if(n=i?this.createSelection(i):this.document.selection,o&&o.is("element","listItem")){const s=n.getFirstPosition();let e=null;if(s.parent.is("element","listItem")?e=s.parent:s.nodeBefore&&s.nodeBefore.is("element","listItem")&&(e=s.nodeBefore),e){var r=e.getAttribute("listIndent");if(0<r)for(;o&&o.is("element","listItem");)o._setAttribute("listIndent",o.getAttribute("listIndent")+r),o=o.nextSibling}}}function Jp(e,t,i,o,n,r){const s=Np(t.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:e,foo:"b"}),a=n.mapper,l=n.writer;n=s?s.getAttribute("listIndent"):null;
5let c;c=s?n==e?(e=a.toViewElement(s).parent,l.createPositionAfter(e)):(r=r.createPositionAt(s,"end"),a.toViewPosition(r)):i,c=Mp(c);for(const d of[...o.getChildren()])Yp(d)&&(c=l.move(l.createRangeOn(d),c).end,Vp(l,d,d.nextSibling),Vp(l,d.previousSibling,d))}function Yp(e){return e.is("element","ol")||e.is("element","ul")}class Xp extends Ac{static get pluginName(){return"ListEditing"}static get requires(){return[kh,yh]}init(){const t=this.editor;t.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const e=t.data,i=t.editing;var a;t.model.document.registerPostFixer(e=>Kp(t.model,e)),i.mapper.registerViewToModelLength("li",Qp),e.mapper.registerViewToModelLength("li",Qp),i.mapper.on("modelToViewPosition",Up(i.view)),i.mapper.on("viewToModelPosition",(a=t.model,(i,o)=>{var e,t,n=o.viewPosition,r=n.parent;const s=o.mapper;if("ul"==r.name||"ol"==r.name)n.isAtEnd?(e=s.toModelElement(n.nodeBefore),t=s.getModelLength(n.nodeBefore),o.modelPosition=a.createPositionBefore(e).getShiftedBy(t)):(t=s.toModelElement(n.nodeAfter),o.modelPosition=a.createPositionBefore(t)),i.stop();else if("li"==r.name&&n.nodeBefore&&("ul"==n.nodeBefore.name||"ol"==n.nodeBefore.name)){r=s.toModelElement(r);let e=1,t=n.nodeBefore;for(;t&&Yp(t);)e+=s.getModelLength(t),t=t.previousSibling;o.modelPosition=a.createPositionBefore(r).getShiftedBy(e),i.stop()}})),e.mapper.on("modelToViewPosition",Up(i.view)),t.conversion.for("editingDowncast").add(e=>{var l,h;e.on("insert",Hp,{priority:"high"}),e.on("insert:listItem",Fp(t.model)),e.on("attribute:listType:listItem",Dp,{priority:"high"}),e.on("attribute:listType:listItem",Lp,{priority:"low"}),e.on("attribute:listIndent:listItem",(l=t.model,(e,t,i)=>{if(i.consumable.consume(t.item,"attribute:listIndent")){var o=i.mapper.toViewElement(t.item);const s=i.writer;s.breakContainer(s.createPositionBefore(o)),s.breakContainer(s.createPositionAfter(o));var n=o.parent,r=n.previousSibling,n=s.createRangeOn(n);s.remove(n),r&&r.nextSibling&&Vp(s,r,r.nextSibling),Jp(t.attributeOldValue+1,t.range.start,n.start,o,i,l),Op(t.item,o,i,l);for(const a of t.item.getChildren())i.consumable.consume(a,"insert")}})),e.on("remove:listItem",(h=t.model,(e,t,i)=>{const o=i.mapper.toViewPosition(t.position);var n=o.getLastMatchingPosition(e=>!e.item.is("element","li")).nodeAfter;const r=i.writer;r.breakContainer(r.createPositionBefore(n)),r.breakContainer(r.createPositionAfter(n));var s=n.parent,a=s.previousSibling,l=r.createRangeOn(s),s=r.remove(l);a&&a.nextSibling&&Vp(r,a,a.nextSibling);const c=i.mapper.toModelElement(n);Jp(c.getAttribute("listIndent")+1,t.position,l.start,n,i,h);for(const d of r.createRangeIn(s).getItems())i.mapper.unbindViewElement(d);e.stop()})),e.on("remove",jp,{priority:"low"})}),t.conversion.for("dataDowncast").add(e=>{e.on("insert",Hp,{priority:"high"}),e.on("insert:listItem",Fp(t.model))}),t.conversion.for("upcast").add(e=>{e.on("element:ul",$p,{priority:"high"}),e.on("element:ol",$p,{priority:"high"}),e.on("element:li",qp,{priority:"high"}),e.on("element:li",Wp)}),t.model.on("insertContent",Gp,{priority:"high"}),t.commands.add("numberedList",new Ep(t,"numbered")),t.commands.add("bulletedList",new Ep(t,"bulleted")),t.commands.add("indentList",new Ip(t,"forward")),t.commands.add("outdentList",new Ip(t,"backward"));var o=i.view.document;this.listenTo(o,"enter",(e,t)=>{const i=this.editor.model.document;var o=i.selection.getLastPosition().parent;i.selection.isCollapsed&&"listItem"==o.name&&o.isEmpty&&(this.editor.execute("outdentList"),t.preventDefault(),e.stop())},{context:"li"}),this.listenTo(o,"delete",(e,t)=>{if("backward"===t.direction){const o=this.editor.model.document.selection;var i;o.isCollapsed&&(!(i=o.getFirstPosition()).isAtStart||"listItem"===(i=i.parent).name&&(i.previousSibling&&"listItem"===i.previousSibling.name||(this.editor.execute("outdentList"),t.preventDefault(),e.stop())))}},{context:"li"});o=i=>(e,t)=>{this.editor.commands.get(i).isEnabled&&(this.editor.execute(i),t())};t.keystrokes.set("Tab",o("indentList")),t.keystrokes.set("Shift+Tab",o("outdentList"))}afterInit(){const e=this.editor.commands,t=e.get("indent"),i=e.get("outdent");t&&t.registerChildCommand(e.get("indentList")),i&&i.registerChildCommand(e.get("outdentList"))}}function Qp(e){let t=1;for(const i of e.getChildren())if("ul"==i.name||"ol"==i.name)for(const o of i.getChildren())t+=Qp(o);return t}class Zp extends Ac{static get pluginName(){return"ListUI"}init(){const e=this.editor.t;zp(this.editor,"numberedList",e("Numbered List"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM3.5 3v5H2V3.7H1v-1h2.5V3zM.343 17.857l2.59-3.257H2.92a.6.6 0 1 0-1.04 0H.302a2 2 0 1 1 3.995 0h-.001c-.048.405-.16.734-.333.988-.175.254-.59.692-1.244 1.312H4.3v1h-4l.043-.043zM7 14.75a.75.75 0 0 1 .75-.75h9.5a.75.75 0 1 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75z"/></svg>'),zp(this.editor,"bulletedList",e("Bulleted List"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0C1 4.784 1.777 4 2.75 4c.9
566 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75C1.784 7.5 1 6.723 1 5.75zm6 9c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0c0-.966.777-1.75 1.75-1.75.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75-.966 0-1.75-.777-1.75-1.75z"/></svg>')}}class eb extends Ac{static get requires(){return[Xp,Zp]}static get pluginName(){return"List"}}function tb(e){const t=e.t;e=e.config.get("codeBlock.languages");for(const i of e)"Plain text"===i.label&&(i.label=t("Plain text")),void 0===i.class&&(i.class=`language-${i.language}`);return e}function ib(e,t,i){const o={};for(const n of e)"class"===t?o[n[t].split(" ").shift()]=n[i]:o[n[t]]=n[i];return o}function ob(e){return e.data.match(/^(\s*)/)[0]}function nb(e){const t=e.document.selection,i=[];var o,n,r,s;if(t.isCollapsed)i.push(t.anchor);else for({item:o}of t.getFirstRange().getWalker({ignoreElementEnd:!0,direction:"backward"}))o.is("$textProxy")&&o.parent.is("element","codeBlock")&&(s=ob(o.textNode),{parent:n,startOffset:r}=o.textNode,s=e.createPositionAt(n,r+s.length),i.push(s));return i}function rb(e){const t=Yr(e.getSelectedBlocks());return t&&t.is("element","codeBlock")}class sb extends Ec{constructor(e){super(e),this._lastLanguage=null}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){var t=this.editor;const i=t.model,o=i.document.selection;t=tb(t)[0];const n=Array.from(o.getSelectedBlocks()),r=void 0===e.forceValue?!this.value:e.forceValue,s=function(e,t,i){if(e.language)return e.language;if(e.usePreviousLanguageChoice&&t)return t;return i}(e,this._lastLanguage,t.language);i.change(e=>{r?this._applyCodeBlock(e,n,s):this._removeCodeBlock(e,n)})}_getValue(){const e=this.editor.model.document.selection,t=Yr(e.getSelectedBlocks());return!(!t||!t.is("element","codeBlock"))&&t.getAttribute("language")}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection;var t=this.editor.model.schema,i=Yr(e.getSelectedBlocks());return!!i&&ab(t,i)}_applyCodeBlock(i,e,t){this._lastLanguage=t;const o=this.editor.model.schema,n=e.filter(e=>ab(o,e));for(const r of n)i.rename(r,"codeBlock"),i.setAttribute("language",t,r),o.removeDisallowedAttributes([r],i),Array.from(r.getChildren()).filter(e=>!o.checkChild(r,e)).forEach(e=>i.remove(e));n.reverse().forEach((e,t)=>{t=n[t+1];e.previousSibling===t&&(i.appendElement("softBreak",t),i.merge(i.createPositionBefore(e)))})}_removeCodeBlock(e,t){var i;for(const o of t.filter(e=>e.is("element","codeBlock"))){const n=e.createRangeOn(o);for(const r of Array.from(n.getItems()).reverse())r.is("element","softBreak")&&r.parent.is("element","codeBlock")&&(i=e.split(e.createPositionBefore(r))["position"],e.rename(i.nodeAfter,"paragraph"),e.removeAttribute("language",i.nodeAfter),e.remove(r));e.rename(o,"paragraph"),e.removeAttribute("language",o)}}}function ab(e,t){return!t.is("rootElement")&&!e.isLimit(t)&&e.checkChild(t.parent,"codeBlock")}class lb extends Ec{constructor(e){super(e),this._indentSequence=e.config.get("codeBlock.indentSequence")}refresh(){this.isEnabled=this._checkEnabled()}execute(){const i=this.editor.model;i.change(e=>{for(const t of nb(i))e.insertText(this._indentSequence,t)})}_checkEnabled(){return!!this._indentSequence&&rb(this.editor.model.document.selection)}}class cb extends Ec{constructor(e){super(e),this._indentSequence=e.config.get("codeBlock.indentSequence")}refresh(){this.isEnabled=this._checkEnabled()}execute(){const o=this.editor.model;o.change(e=>{for(const i of nb(o)){var t=db(this.editor.model,i,this._indentSequence);t&&e.remove(t)}})}_checkEnabled(){if(!this._indentSequence)return!1;const t=this.editor.model;return!!rb(t.document.selection)&&nb(t).some(e=>db(t,e,this._indentSequence))}}function db(e,t,i){var o=function(e){let t=e.parent.getChild(e.index);t&&!t.is("element","softBreak")||(t=e.nodeBefore);return t&&!t.is("element","softBreak")?t:null}(t);if(!o)return null;const n=ob(o);var r=n.lastIndexOf(i);if(r+i.length!==n.length)return null;if(-1===r)return null;var{parent:t,startOffset:o}=o;return e.createRange(e.createPositionAt(t,o+r),e.createPositionAt(t,o+r+i.length))}function hb(c,e,d=!1){const h=ib(e,"language","class"),u=ib(e,"language","label");return(e,t,i)=>{const{writer:o,mapper:n,consumable:r}=i;if(r.consume(t.item,"insert")){var s=t.item.getAttribute("language"),a=n.toViewPosition(c.createPositionBefore(t.item));const l={};d&&(l["data-language"]=u[s],l.spellcheck="false");i=o.createContainerElement("pre",l),s=o.createContainerElement("code",{class:h[s]||null});o.insert(o.createPositionAt(i,0),s),o.insert(a,i),n.bindElements(t.item,s)}}}const ub="paragraph";class gb extends Ac{static get pluginName(){return"CodeBlockEditing"}static get requires(){return[cu]}constructor(e){super(e),e.config.define("codeBlock",{languages:[{language:"plaintext",label:"Plain text"},{language:"c",label:"C"},{language:"cs",label:"C#"},{language:"cpp",label:"C++"},{language:"css",label:"CSS"},{language:"diff",label:"Diff"},{language:"html",label:"HTML"},{language:"java",label:"Java"},{language:"javascript",label:"JavaScript"},{language:"php",label:"PHP"},{language:"python",label:"Python"},{language:"ruby",label:"Ruby"},{language:"typescript",label:"TypeScript"},{language:"xml",label:"XML"}],indentSequence:"\t"})}init(){const r=this.editor,a=r.model.schema,l=r.model;r.editing.view;var e=tb(r);r.commands.add("codeBlock",new sb(r)),r.commands.add("indentCodeBlock",new lb(r)),r.commands.add("outde
5ntCodeBlock",new cb(r));var s,t=i=>(e,t)=>{this.editor.commands.get(i).isEnabled&&(this.editor.execute(i),t())};r.keystrokes.set("Tab",t("indentCodeBlock")),r.keystrokes.set("Shift+Tab",t("outdentCodeBlock")),a.register("codeBlock",{allowWhere:"$block",allowChildren:"$text",isBlock:!0,allowAttributes:["language"]}),a.addAttributeCheck(e=>{if(e.endsWith("codeBlock $text"))return!1}),r.model.schema.addChildCheck((e,t)=>{if(e.endsWith("codeBlock")&&t.isObject)return!1}),r.editing.downcastDispatcher.on("insert:codeBlock",hb(l,e,!0)),r.data.downcastDispatcher.on("insert:codeBlock",hb(l,e)),r.data.downcastDispatcher.on("insert:softBreak",(s=l,(e,t,i)=>{if("codeBlock"===t.item.parent.name){const{writer:o,mapper:n,consumable:r}=i;r.consume(t.item,"insert")&&(t=n.toViewPosition(s.createPositionBefore(t.item)),o.insert(t,o.createText("\n")))}}),{priority:"high"}),r.data.upcastDispatcher.on("element:code",function(e){const h=ib(e,"class","language"),u=e[0].language;return(e,t,i)=>{const o=t.viewItem,n=o.parent;if(n&&n.is("element","pre")&&!t.modelCursor.findAncestor("codeBlock")){const{consumable:s,writer:a}=i;if(s.test(o,{name:!0})){const l=a.createElement("codeBlock"),c=[...o.getClassNames()];c.length||c.push("");for(const d of c){var r=h[d];if(r){a.setAttribute("language",r,l);break}}l.hasAttribute("language")||a.setAttribute("language",u,l),i.convertChildren(o,l),i.safeInsert(l,t.modelCursor)&&(s.consume(o,{name:!0}),i.updateConversionResult(l,t))}}}}(e)),r.data.upcastDispatcher.on("text",(e,t,{consumable:i,writer:o})=>{let n=t.modelCursor;if(i.test(t.viewItem)&&n.findAncestor("codeBlock")){i.consume(t.viewItem);const a=t.viewItem.data;var r,i=a.split("\n").map(e=>o.createText(e)),s=i[i.length-1];for(const l of i)o.insert(l,n),n=n.getShiftedBy(l.offsetSize),l!==s&&(r=o.createElement("softBreak"),o.insert(r,n),n=o.createPositionAfter(r));t.modelRange=o.createRange(t.modelCursor,n),t.modelCursor=n}}),this.listenTo(r.editing.view.document,"clipboardInput",(e,t)=>{let i=l.createRange(l.document.selection.anchor);var o,n;t.targetRanges&&(i=r.editing.mapper.toModelRange(t.targetRanges[0])),i.start.parent.is("element","codeBlock")&&(o=t.dataTransfer.getData("text/plain"),n=new Ad(r.editing.view.document),t.content=function(o,e){var t=o.createDocumentFragment();const n=e.split("\n");return e=n.reduce((e,t,i)=>(e.push(t),i<n.length-1&&e.push(o.createElement("br")),e),[]),o.appendChild(e,t),t}(n,o))}),this.listenTo(l,"getSelectedContent",(n,[r])=>{const s=r.anchor;!r.isCollapsed&&s.parent.is("element","codeBlock")&&s.hasSameParentAs(r.focus)&&l.change(e=>{const t=n.return;var i,o;1<t.childCount||r.containsEntireContent(s.parent)?(i=e.createElement("codeBlock",s.parent.getAttributes()),e.append(t,i),o=e.createDocumentFragment(),e.append(i,o),n.return=o):(o=t.getChild(0),a.checkAttribute(o,"code")&&e.setAttribute("code",!0,o))})})}afterInit(){const o=this.editor,e=o.commands,t=e.get("indent"),i=e.get("outdent");t&&t.registerChildCommand(e.get("indentCodeBlock")),i&&i.registerChildCommand(e.get("outdentCodeBlock")),this.listenTo(o.editing.view.document,"enter",(e,t)=>{const i=o.model.document.selection.getLastPosition().parent;i.is("element","codeBlock")&&(function(i,e){const t=i.model,o=t.document,n=i.editing.view,r=o.selection.getLastPosition(),s=r.nodeAfter;return!(e||!o.selection.isCollapsed||!r.isAtStart)&&(!(!s||!s.is("element","softBreak"))&&(i.model.change(e=>{i.execute("enter");var t=o.selection.anchor.parent.previousSibling;e.rename(t,ub),e.setSelection(t,"in"),i.model.schema.removeDisallowedAttributes([t],e),e.remove(s)}),n.scrollToTheSelection(),!0))}(o,t.isSoft)||function(i,e){const t=i.model,o=t.document,n=i.editing.view,r=o.selection.getLastPosition(),s=r.nodeBefore;let a;if(e||!o.selection.isCollapsed||!r.isAtEnd||!s)return!1;if(s.is("element","softBreak"))a=t.createRangeOn(s);else{if(!s.is("$text")||s.data.match(/\S/)||!s.previousSibling||!s.previousSibling.is("element","softBreak"))return!1;a=t.createRange(t.createPositionBefore(s.previousSibling),t.createPositionAfter(s))}return i.model.change(e=>{e.remove(a),i.execute("enter");var t=o.selection.anchor.parent;e.rename(t,ub),i.model.schema.removeDisallowedAttributes([t],e)}),n.scrollToTheSelection(),!0}(o,t.isSoft)||function(t){const e=t.model,i=e.document,o=i.selection.getLastPosition(),n=o.nodeBefore||o.textNode;let r;n&&n.is("$text")&&(r=ob(n));t.model.change(e=>{t.execute("shiftEnter"),r&&e.insertText(r,i.selection.anchor)})}(o),t.preventDefault(),e.stop())},{context:"pre"})}}i(99);class mb extends Ac{static get pluginName(){return"CodeBlockUI"}init(){const n=this.editor,r=n.t,e=n.ui.componentFactory,s=tb(n);e.add("codeBlock",e=>{var t=n.commands.get("codeBlock");const i=vc(e,Jc),o=i.buttonView;return o.set({label:r("Insert code block"),tooltip:!0,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M12.87 12.61a.75.75 0 0 1-.089.976l-.085.07-3.154 2.254 3.412 2.414a.75.75 0 0 1 .237.95l-.057.095a.75.75 0 0 1-.95.237l-.096-.058-4.272-3.022-.003-1.223 4.01-2.867a.75.75 0 0 1 1.047.174zm2.795-.231.095.057 4.011 2.867-.003 1.223-4.272 3.022-.095.058a.75.75 0 0 1-.88-.151l-.07-.086-.058-.095a.75.75 0 0 1 .15-.88l.087-.07 3.412-2.414-3.154-2.253-.085-.
5071a.75.75 0 0 1 .862-1.207zM16 0a2 2 0 0 1 2 2v9.354l-.663-.492-.837-.001V2a.5.5 0 0 0-.5-.5H2a.5.5 0 0 0-.5.5v15a.5.5 0 0 0 .5.5h3.118L7.156 19H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h14zM5.009 15l.003 1H3v-1h2.009zm2.188-2-1.471 1H5v-1h2.197zM10 11v.095L8.668 12H7v-1h3zm4-2v1H7V9h7zm0-2v1H7V7h7zm-4-2v1H5V5h5zM6 3v1H3V3h3z"/></svg>',isToggleable:!0}),o.bind("isOn").to(t,"value",e=>!!e),o.on("execute",()=>{n.execute("codeBlock",{usePreviousLanguageChoice:!0}),n.editing.view.focus()}),i.on("execute",e=>{n.execute("codeBlock",{language:e.source._codeBlockLanguage,forceValue:!0}),n.editing.view.focus()}),i.class="ck-code-block-dropdown",i.bind("isEnabled").to(t),yc(i,this._getLanguageListItemDefinitions(s)),i})}_getLanguageListItemDefinitions(e){const t=this.editor;var i=t.commands.get("codeBlock");const o=new Jt;for(const n of e){const r={type:"button",model:new id({_codeBlockLanguage:n.language,label:n.label,withText:!0})};r.model.bind("isOn").to(i,"value",e=>e===r.model._codeBlockLanguage),o.add(r)}return o}}class fb extends Ac{static get requires(){return[gb,mb]}static get pluginName(){return"CodeBlock"}}const pb="removeFormat";class bb extends Ac{static get pluginName(){return"RemoveFormatUI"}init(){const o=this.editor,n=o.t;o.ui.componentFactory.add(pb,e=>{var t=o.commands.get(pb);const i=new uc(e);return i.set({label:n("Remove Format"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8.69 14.915c.053.052.173.083.36.093a.366.366 0 0 1 .345.485l-.003.01a.738.738 0 0 1-.697.497h-2.67a.374.374 0 0 1-.353-.496l.013-.038a.681.681 0 0 1 .644-.458c.197-.012.325-.043.386-.093a.28.28 0 0 0 .072-.11L9.592 4.5H6.269c-.359-.017-.609.013-.75.09-.142.078-.289.265-.442.563-.192.29-.516.464-.864.464H4.17a.43.43 0 0 1-.407-.569L4.46 3h13.08l-.62 2.043a.81.81 0 0 1-.775.574h-.114a.486.486 0 0 1-.486-.486c.001-.284-.054-.464-.167-.54-.112-.076-.367-.106-.766-.091h-3.28l-2.68 10.257c-.006.074.007.127.038.158zM3 17h8a.5.5 0 1 1 0 1H3a.5.5 0 1 1 0-1zm11.299 1.17a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.06-1.06l1.415 1.414 1.414-1.415a.75.75 0 1 1 1.06 1.06l-1.413 1.415 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414-1.414 1.414z"/></svg>',tooltip:!0}),i.bind("isOn","isEnabled").to(t,"value","isEnabled"),this.listenTo(i,"execute",()=>{o.execute(pb),o.editing.view.focus()}),i})}}class kb extends Ec{refresh(){var e=this.editor.model;this.isEnabled=!!Yr(this._getFormattingItems(e.document.selection,e.schema))}execute(){const r=this.editor.model,s=r.schema;r.change(e=>{for(const i of this._getFormattingItems(r.document.selection,s))if(i.is("selection"))for(const o of this._getFormattingAttributes(i,s))e.removeSelectionAttribute(o);else{var t=e.createRangeOn(i);for(const n of this._getFormattingAttributes(i,s))e.removeAttribute(n,t)}})}*_getFormattingItems(e,t){var i=e=>!!Yr(this._getFormattingAttributes(e,t));for(const o of e.getRanges())for(const n of o.getItems())!t.isBlock(n)&&i(n)&&(yield n);for(const r of e.getSelectedBlocks())i(r)&&(yield r);i(e)&&(yield e)}*_getFormattingAttributes(e,t){for(var[i]of e.getAttributes()){var o=t.getAttributeProperties(i);o&&o.isFormatting&&(yield i)}}}class wb extends Ac{static get pluginName(){return"RemoveFormatEditing"}init(){const e=this.editor;e.commands.add("removeFormat",new kb(e))}}class vb extends Ac{static get requires(){return[wb,bb]}static get pluginName(){return"RemoveFormat"}}class _b extends Ac{static get pluginName(){return"IndentEditing"}init(){const e=this.editor;e.commands.add("indent",new Sc(e)),e.commands.add("outdent",new Sc(e))}}var yb='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zM1.632 6.95 5.02 9.358a.4.4 0 0 1-.013.661l-3.39 2.207A.4.4 0 0 1 1 11.892V7.275a.4.4 0 0 1 .632-.326z"/></svg>',xb='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zm1.618-9.55L.98 9.358a.4.4 0 0 0 .013.661l3.39 2.207A.4.4 0 0 0 5 11.892V7.275a.4.4 0 0 0-.632-.326z"/></svg>';class Cb extends Ac{static get pluginName(){return"IndentUI"}init(){var e=this.editor,t=e.locale;const i=e.t;e="ltr"==t.uiLanguageDirection?yb:xb,t="ltr"==t.uiLanguageDirection?xb:yb;this._defineButton("indent",i("Increase indent"),e),this._defineButton("outdent",i("Decrease indent"),t)}_defineButton(o,n,r){const s=this.editor;s.ui.componentFactory.add(o,e=>{var t=s.commands.get(o);const i=new uc(e);return i.set({label:n,icon:r,tooltip:!0}),i.bind("isOn","isEnabled").to(t,"value","isEnabled"),this.listenTo(i,"execute",()=>{s.execute(o),s.editing.view.focus()}),i})}}class Ab extends Ac{static get pluginName(){return"Indent"}static get requires(){return[_b,Cb]}}
5class Tb extends Ec{constructor(e,t){super(e),this._indentBehavior=t}refresh(){const e=this.editor.model,t=Yr(e.document.selection.getSelectedBlocks());t&&e.schema.checkAttribute(t,"blockIndent")?this.isEnabled=this._indentBehavior.checkEnabled(t.getAttribute("blockIndent")):this.isEnabled=!1}execute(){const e=this.editor.model,o=function(e){const t=e.document.selection,i=e.schema,o=Array.from(t.getSelectedBlocks());return o.filter(e=>i.checkAttribute(e,"blockIndent"))}(e);e.change(e=>{for(const i of o){var t=i.getAttribute("blockIndent"),t=this._indentBehavior.getNextIndent(t);t?e.setAttribute("blockIndent",t,i):e.removeAttribute("blockIndent",i)}})}}class Eb{constructor(e){this.isForward="forward"===e.direction,this.offset=e.offset,this.unit=e.unit}checkEnabled(e){e=parseFloat(e||0);return this.isForward||0<e}getNextIndent(e){var t=parseFloat(e||0);if(!(!e||e.endsWith(this.unit)))return this.isForward?this.offset+this.unit:void 0;t+=this.isForward?this.offset:-this.offset;return 0<t?t+this.unit:void 0}}class Pb{constructor(e){this.isForward="forward"===e.direction,this.classes=e.classes}checkEnabled(e){e=this.classes.indexOf(e);return this.isForward?e<this.classes.length-1:0<=e}getNextIndent(e){var t=this.classes.indexOf(e),e=this.isForward?1:-1;return this.classes[t+e]}}const Sb=["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"];class Ib extends Ac{constructor(e){super(e),e.config.define("indentBlock",{offset:40,unit:"px"})}static get pluginName(){return"IndentBlock"}init(){const e=this.editor;var t=e.config.get("indentBlock"),i=!t.classes||!t.classes.length,o=Object.assign({direction:"forward"},t),n=Object.assign({direction:"backward"},t);i?(e.data.addStyleProcessorRules(nh),this._setupConversionUsingOffset(e.conversion),e.commands.add("indentBlock",new Tb(e,new Eb(o))),e.commands.add("outdentBlock",new Tb(e,new Eb(n)))):(this._setupConversionUsingClasses(t.classes),e.commands.add("indentBlock",new Tb(e,new Pb(o))),e.commands.add("outdentBlock",new Tb(e,new Pb(n))))}afterInit(){const e=this.editor,t=e.model.schema,i=e.commands.get("indent"),o=e.commands.get("outdent"),n=e.config.get("heading.options");const r=n&&n.map(e=>e.model)||Sb;r.forEach(e=>{t.isRegistered(e)&&t.extend(e,{allowAttributes:"blockIndent"})}),t.setAttributeProperties("blockIndent",{isFormatting:!0}),i.registerChildCommand(e.commands.get("indentBlock")),o.registerChildCommand(e.commands.get("outdentBlock"))}_setupConversionUsingOffset(){const e=this.editor.conversion;const t="rtl"===this.editor.locale.contentLanguageDirection?"margin-right":"margin-left";e.for("upcast").attributeToAttribute({view:{styles:{[t]:/[\s\S]+/}},model:{key:"blockIndent",value:e=>e.getStyle(t)}}),e.for("downcast").attributeToAttribute({model:"blockIndent",view:e=>({key:"style",value:{[t]:e}})})}_setupConversionUsingClasses(e){const t={model:{key:"blockIndent",values:[]},view:{}};for(const i of e)t.model.values.push(i),t.view[i]={key:"class",value:[i]};this.editor.conversion.attributeToAttribute(t)}}var Rb=function(){return function e(){e.called=!0}};class Ob{constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=Rb(),this.off=Rb()}}function Vb(){let t="e";for(let e=0;e<8;e++)t+=Math.floor(65536*(1+Math.random())).toString(16).substring(1);return t}var Mb={get(e){return"number"!=typeof e?this[e]||this.normal:e},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};const Nb=Symbol("listeningTo"),zb=Symbol("emitterId");var Bb={on(e,t,i={}){this.listenTo(this,e,t,i)},once(e,i,t){this.listenTo(this,e,function(e,...t){e.off(),i.call(this,e,...t)},t)},off(e,t){this.stopListening(this,e,t)},listenTo(e,t,i,o={}){let n,r;this[Nb]||(this[Nb]={});const s=this[Nb];Db(e)||Fb(e);var a=Db(e);(n=s[a])||(n=s[a]={emitter:e,callbacks:{}}),(r=n.callbacks[t])||(r=n.callbacks[t]=[]),r.push(i),function(e,i){const o=Lb(e);if(!o[i]){let e=i,t=null;const n=[];for(;""!==e&&!o[e];)o[e]={callbacks:[],childEvents:[]},n.push(o[e]),t&&o[e].childEvents.push(t),t=e,e=e.substr(0,e.lastIndexOf(":"));if(""!==e){for(const r of n)r.callbacks=o[e].callbacks.slice();o[e].childEvents.push(t)}}}(e,t);var t=Hb(e,t),l=Mb.get(o.priority),c={callback:i,priority:l};for(const d of t){let t=!1;for(let e=0;e<d.length;e++)if(d[e].priority<l){d.splice(e,0,c),t=!0;break}t||d.push(c)}},stopListening(e,t,i){const o=this[Nb];let n=e&&Db(e);const r=o&&n&&o[n],s=r&&t&&r.callbacks[t];if(!(!o||e&&!r||t&&!s))if(i)Wb(e,t,i);else if(s){for(;i=s.pop();)Wb(e,t,i);delete r.callbacks[t]}else if(r){for(t in r.callbacks)this.stopListening(e,t);delete o[n]}else{for(n in o)this.stopListening(o[n].emitter);delete this[Nb]}},fire(e,...t){const i=e instanceof Ob?e:new Ob(this,e);var o,n=i.name;let r=function e(t,i){let o;if(!t._events||!(o=t._events[i])||!o.callbacks.length)return-1<i.indexOf(":")?e(t,i.substr(0,i.lastIndexOf(":"))):null;return o.callbacks}(this,n);if(i.path.push(this),r){var s=[i,...t];r=Array.from(r);for(let e=0;
5e<r.length&&(r[e].callback.apply(this,s),i.off.called&&(delete i.off.called,Wb(this,n,r[e].callback)),!i.stop.called);e++);}return this._delegations&&(o=this._delegations.get(n),e=this._delegations.get("*"),o&&jb(o,i,t),e&&jb(e,i,t)),i.return},delegate(...n){return{to:(e,t)=>{this._delegations||(this._delegations=new Map);for(const i of n){const o=this._delegations.get(i);o?o.set(e,t):this._delegations.set(i,new Map([[e,t]]))}}}},stopDelegating(e,t){if(this._delegations)if(e)if(t){const i=this._delegations.get(e);i&&i.delete(t)}else this._delegations.delete(e);else this._delegations.clear()}};function Fb(e,t){e[zb]||(e[zb]=t||Vb())}function Db(e){return e[zb]}function Lb(e){return e._events||Object.defineProperty(e,"_events",{value:{}}),e._events}function Hb(t,e){var i=Lb(t)[e];if(!i)return[];let o=[i.callbacks];for(let e=0;e<i.childEvents.length;e++){var n=Hb(t,i.childEvents[e]);o=o.concat(n)}return o}function jb(e,t,i){for(var[o,n]of e){n?"function"==typeof n&&(n=n(t.name)):n=t.name;const r=new Ob(t.source,n);r.path=[...t.path],o.fire(r,...i)}}function Wb(e,t,i){for(const o of Hb(e,t))for(let e=0;e<o.length;e++)o[e].callback==i&&(o.splice(e,1),e--)}class $b extends Error{constructor(e,t){e=qb(e),t&&(e+=" "+JSON.stringify(t)),super(e),this.name="CKEditorError",this.data=t}static isCKEditorError(e){return e instanceof $b}}function qb(e){var t=e.match(/^([^:]+):/);return t?e+` Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-${t[1]}\n`:e}const Ub=Symbol("observableProperties"),Kb=Symbol("boundObservables"),Gb=Symbol("boundProperties");m={set(o,e){if(V(o))Object.keys(o).forEach(e=>{this.set(e,o[e])},this);else{Jb(this);const n=this[Ub];if(o in this&&!n.has(o))throw new $b("observable-set-cannot-override: Cannot override an existing property.");Object.defineProperty(this,o,{enumerable:!0,configurable:!0,get(){return n.get(o)},set(e){var t=n.get(o);let i=this.fire("set:"+o,o,e,t);void 0===i&&(i=e),t===i&&n.has(o)||(n.set(o,i),this.fire("change:"+o,o,i,t))}}),this[o]=e}},bind(...e){if(!e.length||!Qb(e))throw new $b("observable-bind-wrong-properties: All properties must be strings.");if(new Set(e).size!==e.length)throw new $b("observable-bind-duplicate-properties: Properties must be unique.");Jb(this);const i=this[Gb];e.forEach(e=>{if(i.has(e))throw new $b("observable-bind-rebind: Cannot bind the same property more that once.")});const o=new Map;return e.forEach(e=>{var t={property:e,to:[]};i.set(e,t),o.set(e,t)}),{to:Yb,toMany:Xb,_observable:this,_bindProperties:e,_to:[],_bindings:o}},unbind(...e){if(Ub in this){const s=this[Gb],a=this[Kb];if(e.length){if(!Qb(e))throw new $b("observable-unbind-wrong-properties: Properties must be strings.");e.forEach(e=>{const r=s.get(e);if(r){let t,i,o,n;r.to.forEach(e=>{t=e[0],i=e[1],o=a.get(t),n=o[i],n.delete(r),n.size||delete o[i],Object.keys(o).length||(a.delete(t),this.stopListening(t,"change"))}),s.delete(e)}})}else a.forEach((e,t)=>{this.stopListening(t,"change")}),a.clear(),s.clear()}},decorate(t){const i=this[t];if(!i)throw new $b("observablemixin-cannot-decorate-undefined: Cannot decorate an undefined method.",{object:this,methodName:t});this.on(t,(e,t)=>{e.return=i.apply(this,t)}),this[t]=function(...e){return this.fire(t,e)}}};ao(m,Bb);S=m;function Jb(e){Ub in e||(Object.defineProperty(e,Ub,{value:new Map}),Object.defineProperty(e,Kb,{value:new Map}),Object.defineProperty(e,Gb,{value:new Map}))}function Yb(...e){const t=function(...e){if(!e.length)throw new $b("observable-bind-to-parse-error: Invalid argument syntax in `to()`.");const t={to:[]};let i;"function"==typeof e[e.length-1]&&(t.callback=e.pop());return e.forEach(e=>{if("string"==typeof e)i.properties.push(e);else{if("object"!=typeof e)throw new $b("observable-bind-to-parse-error: Invalid argument syntax in `to()`.");i={observable:e,properties:[]},t.to.push(i)}}),t}(...e);var r,e=Array.from(this._bindings.keys());const i=e.length;if(!t.callback&&1<t.to.length)throw new $b("observable-bind-to-no-callback: Binding multiple observables only possible with callback.");if(1<i&&t.callback)throw new $b("observable-bind-to-extra-callback: Cannot bind multiple properties and use a callback in one binding.");
5t.to.forEach(e=>{if(e.properties.length&&e.properties.length!==i)throw new $b("observable-bind-to-properties-length: The number of properties must match.");e.properties.length||(e.properties=this._bindProperties)}),this._to=t.to,t.callback&&(this._bindings.get(e[0]).callback=t.callback),r=this._observable,this._to.forEach(i=>{const o=r[Kb];let n;o.get(i.observable)||r.listenTo(i.observable,"change",(e,t)=>{n=o.get(i.observable)[t],n&&n.forEach(e=>{Zb(r,e.property)})})}),function(o){let n;o._bindings.forEach((t,i)=>{o._to.forEach(e=>{n=e.properties[t.callback?0:o._bindProperties.indexOf(i)],t.to.push([e.observable,n]),function(e,t,i,o){const n=e[Kb],r=n.get(i),s=r||{};s[o]||(s[o]=new Set);s[o].add(t),r||n.set(i,s)}(o._observable,t,e.observable,n)})})}(this),this._bindProperties.forEach(e=>{Zb(this._observable,e)})}function Xb(e,t,i){if(1<this._bindings.size)throw new $b("observable-bind-to-many-not-one-binding: Cannot bind multiple properties with toMany().");this.to(...function(e,t){e=e.map(e=>[e,t]);return Array.prototype.concat.apply([],e)}(e,t),i)}function Qb(e){return e.every(e=>"string"==typeof e)}function Zb(e,t){const i=e[Gb],o=i.get(t);let n;n=o.callback?o.callback.apply(e,o.to.map(e=>e[0][e[1]])):(n=o.to[0],n[0][n[1]]),e.hasOwnProperty(t)?e[t]=n:e.set(t,n)}function ek(o,...e){e.forEach(i=>{Object.getOwnPropertyNames(i).concat(Object.getOwnPropertySymbols(i)).forEach(e=>{if(!(e in o.prototype)){const t=Object.getOwnPropertyDescriptor(i,e);t.enumerable=!1,Object.defineProperty(o.prototype,e,t)}})})}class tk{constructor(e){this.editor=e}destroy(){this.stopListening()}}ek(tk,S);class ik{constructor(e){this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",e=>{this.isEnabled||e.stop()},{priority:"high"}),this.listenTo(e,"change:isReadOnly",(e,t,i)=>{i?(this.on("set:isEnabled",ok,{priority:"highest"}),this.isEnabled=!1):(this.off("set:isEnabled",ok),this.refresh())})}refresh(){this.isEnabled=!0}execute(){}destroy(){this.stopListening()}}function ok(e){e.return=!1,e.stop()}ek(ik,S);
5class nk extends ik{refresh(){this.value=this._getValue(),this.isEnabled=!0}execute(e={}){const t=this.editor.model,i=t.schema,o=t.document.selection,n=Array.from(o.getSelectedBlocks()),r=void 0===e.forceValue?!this.value:e.forceValue;t.change(e=>{var t;r?(t=n.filter(e=>rk(e)||ak(i,e)),this._applyPre(e,t)):this._removePre(e,n.filter(rk))})}_getValue(){const e=this.editor.model.document.selection;var t=lk(e.getSelectedBlocks());return!(!t||!rk(t))}_checkEnabled(){if(this.value)return!0;console.log("tuosm");const e=this.editor.model.document.selection;var t=this.editor.model.schema,i=lk(e.getSelectedBlocks());return!!i&&ak(t,i)}_removePre(i,e){sk(i,e).reverse().forEach(e=>{var t;e.start.isAtStart&&e.end.isAtEnd?i.unwrap(e.start.parent):e.start.isAtStart?(t=i.createPositionBefore(e.start.parent),i.move(e,t)):(e.end.isAtEnd||i.split(e.end),t=i.createPositionAfter(e.end.parent),i.move(e,t))})}_applyPre(i,e){const o=[];sk(i,e).reverse().forEach(e=>{let t=rk(e.start);t||(t=i.createElement("pre"),i.wrap(e,t)),o.push(t)}),o.reverse().reduce((e,t)=>e.nextSibling==t?(i.merge(i.createPositionAfter(e)),e):t)}}function rk(e){return"pre"==e.parent.name?e.parent:null}function sk(e,t){let i,o=0;const n=[];for(;o<t.length;){var r=t[o],s=t[o+1];i=i||e.createPositionBefore(r),s&&r.nextSibling==s||(n.push(e.createRange(i,e.createPositionAfter(r))),i=null),o++}return n}function ak(e,t){var i=e.checkChild(t.parent,"pre"),t=e.checkChild(["$root","pre"],t);return i&&t}function lk(e){e=e.next();return e.done?null:e.value}class ck extends tk{static get pluginName(){return"PreEditing"}init(){const s=this.editor,a=s.model.schema,e=s.conversion;s.commands.add("pre",new nk(s)),a.register("pre",{allowWhere:"$block",allowContentOf:"$root"}),e.elementToElement({model:"pre",view:{name:"pre",classes:"etest-pre"}}),s.model.document.registerPostFixer(e=>{for(const t of s.model.document.differ.getChanges())if("insert"==t.type){const i=t.position.nodeAfter;if(i){if(i.is("element","pre")&&i.isEmpty)return e.remove(i),!0;if(i.is("element","pre")&&!a.checkChild(t.position,i))return e.unwrap(i),!0;if(i.is("element")){const o=e.createRangeIn(i);for(const n of o.getItems())if(n.is("element","pre")&&!a.checkChild(e.createPositionBefore(n),n))return e.unwrap(n),!0}}}else if("remove"==t.type){const r=t.position.parent;if(r.is("element","pre")&&r.isEmpty)return e.remove(r),!0}return!1});var t=this.editor.editing.view.document;const o=s.model.document.selection,n=s.commands.get("pre");this.listenTo(t,"enter",(e,t)=>{o.isCollapsed&&n.value&&o.getLastPosition().parent.isEmpty&&(s.execute("pre"),s.editing.view.scrollToTheSelection(),t.preventDefault(),e.stop())},{context:"pre"}),this.listenTo(t,"delete",(e,t)=>{var i;"backward"==t.direction&&o.isCollapsed&&n.value&&((i=o.getLastPosition().parent).isEmpty&&!i.previousSibling&&(s.execute("pre"),s.editing.view.scrollToTheSelection(),t.preventDefault(),e.stop()))},{context:"pre"})}}class dk{constructor(e={}){this._items=[],this._itemMap=new Map,this._idProperty=e.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[]}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(e,t){let i;var o=this._idProperty;if(o in e){if(i=e[o],"string"!=typeof i)throw new $b("collection-add-invalid-id");if(this.get(i))throw new $b("collection-add-item-already-exists")}else e[o]=i=Vb();if(void 0===t)t=this._items.length;else if(t>this._items.length||t<0)throw new $b("collection-add-item-invalid-index");return this._items.splice(t,0,e),this._itemMap.set(i,e),this.fire("add",e,t),this}get(e){let t;if("string"==typeof e)t=this._itemMap.get(e);else{if("number"!=typeof e)throw new $b("collection-get-invalid-arg: Index or id must be given.");t=this._items[e]}return t||null}getIndex(e){let t;return t="string"==typeof e?this._itemMap.get(e):e,this._items.indexOf(t)}remove(e){let t,i,o,n=!1;var r=this._idProperty;if("string"==typeof e?(i=e,o=this._itemMap.get(i),n=!o,o&&(t=this._items.indexOf(o))):"number"==typeof e?(t=e,o=this._items[t],n=!o,o&&(i=o[r])):(o=e,i=o[r],t=this._items.indexOf(o),n=-1==t||!this._itemMap.get(i)),n)throw new $b("collection-remove-404: Item not found.");this._items.splice(t,1),this._itemMap.delete(i);r=this._bindToInternalToExternalMap.get(o);return this._bindToInternalToExternalMap.delete(o),this._bindToExternalToInternalMap.delete(r),this.fire("remove",o,t),o}map(e,t){return this._items.map(e,t)}find(e,t){return this._items.find(e,t)}filter(e,t){return this._items.filter(e,t)}clear(){for(this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);this.length;)this.remove(0)}bindTo(e){if(this._bindToCollection)throw new $b("collection-bind-to-rebind: The collection cannot be bound more than once.");return this._bindToCollection=e,{as:t=>{this._setUpBindToBinding(e=>new t(e))},using:t=>{"function"==typeof t?this._setUpBindToBinding(e=>t(e)):this._setUpBindToBinding(e=>e[t])}}}_setUpBindToBinding(a){const l=this._bindToCollection;var e=(e,i,o)=>{var t=l._bindToCollection==this,n=l._bindToInternalToExternalMap.get(i);if(t&&n)this._bindToExternalToInternalMap.set(i,n),this._bindToInternalToExternalMap.set(n,i);else{n=a(i);
5if(n){let t=o;for(const r of this._skippedIndexesFromExternal)o>r&&t--;for(const s of l._skippedIndexesFromExternal)t>=s&&t++;this._bindToExternalToInternalMap.set(i,n),this._bindToInternalToExternalMap.set(n,i),this.add(n,t);for(let e=0;e<l._skippedIndexesFromExternal.length;e++)t<=l._skippedIndexesFromExternal[e]&&l._skippedIndexesFromExternal[e]++}else this._skippedIndexesFromExternal.push(o)}};for(const t of l)e(0,t,l.getIndex(t));this.listenTo(l,"add",e),this.listenTo(l,"remove",(e,t,i)=>{t=this._bindToExternalToInternalMap.get(t);t&&this.remove(t),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((e,t)=>(i<t&&e.push(t-1),t<i&&e.push(t),e),[])})}[Symbol.iterator](){return this._items[Symbol.iterator]()}}ek(dk,Bb);class hk extends dk{constructor(e){super({idProperty:"viewUid"}),this.on("add",(e,t,i)=>{t.isRendered||t.render(),t.element&&this._parentElement&&this._parentElement.insertBefore(t.element,this._parentElement.children[i])}),this.on("remove",(e,t)=>{t.element&&this._parentElement&&t.element.remove()}),this.locale=e,this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e}delegate(...n){if(!n.length||!n.every(e=>"string"==typeof e))throw new $b("ui-viewcollection-delegate-wrong-events: All event names must be strings.");return{to:o=>{for(const e of this)for(const t of n)e.delegate(t).to(o);this.on("add",(e,t)=>{for(const i of n)t.delegate(i).to(o)}),this.on("remove",(e,t)=>{for(const i of n)t.stopDelegating(i,o)})}}}}function uk(e){if(e){if(e.defaultView)return e instanceof e.defaultView.Document;if(e.ownerDocument&&e.ownerDocument.defaultView)return e instanceof e.ownerDocument.defaultView.Node}}ek(dk,S);var gk={error(e,t){console.error(qb(e),t)},warn(e,t){console.warn(qb(e),t)}};class mk{constructor(e){Object.assign(this,_k(vk(e))),this._isRendered=!1,this._revertData=null}render(){var e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData=Sk(),this._renderNode({node:e,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new $b("ui-template-revert-not-applied: Attempting to revert a template which has not been applied yet.");this._revertTemplateFromNode(e,this._revertData)}*getViews(){yield*function*e(t){if(t.children)for(const i of t.children)Tk(i)?yield i:Ek(i)&&(yield*e(i))}(this)}static bind(o,n){return{to(e,t){return new pk({eventNameOrFunction:e,attribute:e,observable:o,emitter:n,callback:t})},if(e,t,i){return new bk({observable:o,emitter:n,attribute:e,valueIfTrue:t,callback:i})}}}static extend(e,t){e._isRendered&&gk.warn("template-extend-render: Attempting to extend a template which has already been rendered."),function t(i,o){o.attributes&&(i.attributes||(i.attributes={}),Ck(i.attributes,o.attributes));o.eventListeners&&(i.eventListeners||(i.eventListeners={}),Ck(i.eventListeners,o.eventListeners));o.text&&i.text.push(...o.text);if(o.children&&o.children.length){if(i.children.length!=o.children.length)throw new $b("ui-template-extend-children-mismatch: The number of children in extended definition does not match.");let e=0;for(const n of o.children)t(i.children[e++],n)}}(e,_k(vk(t)))}_renderNode(e){let t;if(t=e.node?this.tag&&this.text:this.tag?this.text:!this.text,t)throw new $b('ui-template-wrong-syntax: Node definition must have either "tag" or "text" when rendering a new Node.');return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t=t||(e.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;var i;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),kk(this.text)?this._bindToObservable({schema:this.text,updater:(i=t,{set(e){i.textContent=e},remove(){i.textContent=""}}),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){let t,i,o,n;if(this.attributes){const r=e.node,s=e.revertData;for(t in this.attributes)if(o=r.getAttribute(t),i=this.attributes[t],s&&(s.attributes[t]=o),n=V(i[0])&&i[0].ns?i[0].ns:null,kk(i)){const a=n?i[0].value:i;s&&Ik(t)&&a.unshift(o),this._bindToObservable({schema:a,updater:function(t,i,o){return{set(e){t.setAttributeNS(o,i,e)},remove(){t.removeAttributeNS(o,i)}}}(r,t,n),data:e})}else"style"==t&&"string"!=typeof i[0]?this._renderStyleAttribute(i[0],e):(s&&o&&Ik(t)&&i.unshift(o),i=i.map(e=>e&&(e.value||e)).reduce((e,t)=>
5e.concat(t),[]).reduce(xk,""),Ak(i)||r.setAttributeNS(n,t,i))}}_renderStyleAttribute(e,t){const i=t.node;for(const n in e){var o=e[n];kk(o)?this._bindToObservable({schema:[o],updater:function(t,i){return{set(e){t.style[i]=e},remove(){t.style[i]=null}}}(i,n),data:t}):i.style[n]=o}}_renderElementChildren(e){const t=e.node,i=e.intoFragment?document.createDocumentFragment():t;var o=e.isApplying;let n=0;for(const s of this.children)if(Pk(s)){if(!o){s.setParent(t);for(const a of s)i.appendChild(a.element)}}else if(Tk(s))o||(s.isRendered||s.render(),i.appendChild(s.element));else if(uk(s))i.appendChild(s);else if(o){const l=e.revertData;var r=Sk();l.children.push(r),s._renderNode({node:i.childNodes[n++],isApplying:!0,revertData:r})}else i.appendChild(s.render());e.intoFragment&&t.appendChild(i)}_setUpListeners(o){if(this.eventListeners)for(const n in this.eventListeners){var e=this.eventListeners[n].map(e=>{var[t,i]=n.split("@");return e.activateDomEventListener(t,i,o)});o.revertData&&o.revertData.bindings.push(e)}}_bindToObservable({schema:t,updater:i,data:o}){const e=o.revertData;wk(t,i,o);var n=t.filter(e=>!Ak(e)).filter(e=>e.observable).map(e=>e.activateAttributeListener(t,i,o));e&&e.bindings.push(n)}_revertTemplateFromNode(t,i){for(const o of i.bindings)for(const n of o)n();if(i.text)t.textContent=i.text;else{for(const r in i.attributes){var e=i.attributes[r];null===e?t.removeAttribute(r):t.setAttribute(r,e)}for(let e=0;e<i.children.length;++e)this._revertTemplateFromNode(t.childNodes[e],i.children[e])}}}ek(mk,Bb);class fk{constructor(e){Object.assign(this,e)}getValue(e){var t=this.observable[this.attribute];return this.callback?this.callback(t,e):t}activateAttributeListener(e,t,i){const o=()=>wk(e,t,i);return this.emitter.listenTo(this.observable,"change:"+this.attribute,o),()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,o)}}}class pk extends fk{activateDomEventListener(e,i,t){const o=(e,t)=>{i&&!t.target.matches(i)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(t):this.observable.fire(this.eventNameOrFunction,t))};return this.emitter.listenTo(t.node,e,o),()=>{this.emitter.stopListening(t.node,e,o)}}}class bk extends fk{getValue(e){return!Ak(super.getValue(e))&&(this.valueIfTrue||!0)}}function kk(e){return!!e&&(e.value&&(e=e.value),Array.isArray(e)?e.some(kk):e instanceof fk)}function wk(e,t,{node:i}){let o=(n=i,e.map(e=>e instanceof fk?e.getValue(n):e));var n;o=1==e.length&&e[0]instanceof bk?o[0]:o.reduce(xk,""),Ak(o)?t.remove():t.set(o)}function vk(e){return Et(e,e=>{if(e&&(e instanceof fk||Ek(e)||Tk(e)||Pk(e)))return e})}function _k(e){var t;if("string"==typeof e?e={text:[e]}:e.text&&(t=e,Array.isArray(t.text)||(t.text=[t.text])),e.on&&(e.eventListeners=function(e){for(const t in e)yk(e,t);return e}(e.on),delete e.on),!e.text){e.attributes&&function(e){for(const t in e)e[t].value&&(e[t].value=[].concat(e[t].value)),yk(e,t)}(e.attributes);const i=[];if(e.children)if(Pk(e.children))i.push(e.children);else for(const o of e.children)Ek(o)||Tk(o)||uk(o)?i.push(o):i.push(new mk(o));e.children=i}return e}function yk(e,t){Array.isArray(e[t])||(e[t]=[e[t]])}function xk(e,t){return Ak(t)?e:Ak(e)?t:`${e} ${t}`}function Ck(e,t){for(const i in t)e[i]?e[i].push(...t[i]):e[i]=t[i]}function Ak(e){return!e&&0!==e}function Tk(e){return e instanceof Nk}function Ek(e){return e instanceof mk}function Pk(e){return e instanceof hk}function Sk(){return{children:[],bindings:[],attributes:{}}}function Ik(e){return"class"==e||"style"==e}function Rk(e){e=Object.prototype.toString.apply(e);return"[object Window]"==e||"[object global]"==e}m=ao({},Bb,{listenTo(e,...t){if(uk(e)||Rk(e)){const i=this._getProxyEmitter(e)||new Ok(e);i.attach(...t),e=i}Bb.listenTo.call(this,e,...t)},stopListening(e,t,i){if(uk(e)||Rk(e)){var o=this._getProxyEmitter(e);if(!o)return;e=o}Bb.stopListening.call(this,e,t,i),e instanceof Ok&&e.detach(t)},_getProxyEmitter(e){return t=this,e=Vk(e),t[Nb]&&t[Nb][e]?t[Nb][e].emitter:null;var t}});class Ok{constructor(e){Fb(this,Vk(e)),this._domNode=e}}function Vk(e){return e["data-ck-expando"]||(e["data-ck-expando"]=Vb())}function Mk(e){return e&&e[Symbol.iterator]}ao(Ok.prototype,Bb,{attach(e,t,i={}){var o;this._domListeners&&this._domListeners[e]||(o=this._createDomListener(e,!!i.useCapture),this._domNo
5de.addEventListener(e,o,!!i.useCapture),this._domListeners||(this._domListeners={}),this._domListeners[e]=o)},detach(e){var t;!this._domListeners[e]||(t=this._events[e])&&t.callbacks.length||this._domListeners[e].removeListener()},_createDomListener(t,e){const i=e=>{this.fire(t,e)};return i.removeListener=()=>{this._domNode.removeEventListener(t,i,e),delete this._domListeners[t]},i}});i(101);class Nk{constructor(i){this.element=null,this.isRendered=!1,this.locale=i,this.t=i&&i.t,this._viewCollections=new dk,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(e,t)=>{t.locale=i}),this.decorate("render")}get bindTemplate(){return this._bindTemplate||(this._bindTemplate=mk.bind(this,this))}createCollection(){var e=new hk;return this._viewCollections.add(e),e}registerChild(e){for(const t of e=!Mk(e)?[e]:e)this._unboundChildren.add(t)}deregisterChild(e){for(const t of e=!Mk(e)?[e]:e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new mk(e)}extendTemplate(e){mk.extend(this.template,e)}render(){if(this.isRendered)throw new $b("ui-view-render-already-rendered: This View has already been rendered.");this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(e=>e.destroy())}}ek(Nk,m),ek(Nk,S);i(103);class zk extends Nk{constructor(){super();const e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon"],viewBox:e.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const t=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml"),i=t.querySelector("svg");var e=i.getAttribute("viewBox");for(e&&(this.viewBox=e),this.element.innerHTML="";0<i.childNodes.length;)this.element.appendChild(i.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(e=>{e.style.fill=this.fillColor})}}i(105);class Bk extends Nk{constructor(e){super(e),this.set("text",""),this.set("position","s");const t=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip",t.to("position",e=>"ck-tooltip_"+e),t.if("text","ck-hidden",e=>!e.trim())]},children:[{tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:t.to("text")}]}]})}}var S=navigator.userAgent.toLowerCase(),Fk={isMac:-1<S.indexOf("macintosh"),isEdge:!!S.match(/edge\/(\d+.?\d*)/),isGecko:!!S.match(/gecko\/\d+/)};const Dk={"⌘":"ctrl","⇧":"shift","⌥":"alt"},Lk={ctrl:"⌘",shift:"⇧",alt:"⌥"};!function(){const t={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,cmd:1114112,shift:2228224,alt:4456448};for(let e=65;e<=90;e++){const i=String.fromCharCode(e);t[i.toLowerCase()]=e}for(let e=48;e<=57;e++)t[e-48]=e;for(let e=112;e<=123;e++)t["f"+(e-111)]=e;t}();function Hk(e){return e.split(/\s*\+\s*/)}i(107);class jk extends Nk{constructor(e){super(e);const t=this.bindTemplate;e=Vb();this.set("class"),this.set("labelStyle"),this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("keystroke"),this.set("label"),this.set("tabindex",-1),this.set("tooltip"),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.tooltipView=this._createTooltipView(),this.labelView=this._createLabelView(e),this.iconView=new zk,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this)),this.setTemplate({tag:"button",attributes:{class:["ck","ck-button",t.to("class"),t.if("isEnabled","ck-disabled",e=>!e),t.if("isVisible","ck-hidden",e=>!e),t.to("isOn",e=>e?"ck-on":"ck-off"),t.if("withText","ck-button_with-text")],type:t.to("type",e=>e||"button"),tabindex:t.to("tabindex"),"aria-labelledby":`ck-editor__aria-label_${e}`,"aria-disabled":t.if("isEnabled",!0,e=>!e),"aria-pressed":t.if("isOn",!0)},children:this.children,on:{mousedown:t.to(e=>{e.preventDefault()}),click:t.to(e=>{this.isEnabled?this.fire("execute"):e.preventDefault()})}})}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.tooltipView),this.children.add(this.labelView)}focus(){this.element.focus()}_createTooltipView(){const e=new Bk;return e.bind("text").to(this,"_tooltipString"),e.bind("position").to(this,"tooltipPosition"),e}_createLabelView(e){const t=new Nk,i=this.bindTemplate;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:i.to("labelStyle"),id:`ck-editor__aria-label_${e}`},children:[{text:this.bindTemplate.to("label")}]}),t}_getTooltipString(e,t,i){return e?"string"==typeof e?e:(i&&(o=i,i=Fk.isMac?Hk(o).map(e=>Lk[e.toLowerCase()]||e).reduce((e,t)=>
5e.slice(-1)in Dk?e+t:e+"+"+t):o),e instanceof Function?e(t,i):`${t}${i?` (${i})`:""}`):"";var o}}class Wk extends tk{init(){const o=this.editor,n=o.t;o.ui.componentFactory.add("pre",e=>{var t=o.commands.get("pre");const i=new jk(e);return i.set({isEnabled:!0,label:n("Preformatted text block"),icon:'<svg xmlns="http://www.w3.org/2000/svg"\n     width="50" height="50"\n     viewBox="0 0 50 50"\n     style="fill:#000000;"><g id="surface1"><path style=" " d="M 29.125 7.34375 L 17.125 41.34375 L 20.875 42.65625 L 32.875 8.65625 Z M 9.9375 13.375 L 1.25 23.71875 L 0.1875 25 L 1.25 26.28125 L 9.9375 36.65625 L 13.03125 34.09375 L 5.40625 25 L 13 15.9375 Z M 40.0625 13.375 L 37 15.9375 L 44.59375 25 L 37 34.0625 L 40.09375 36.625 L 48.71875 26.28125 L 49.78125 25 L 48.71875 23.71875 Z "></path></g>\n</svg>',tooltip:!0}),i.bind("isOn","isEnabled").to(t,"value","isEnabled"),this.listenTo(i,"execute",()=>{o.execute("pre",o),o.editing.view.focus()}),i})}}class $k extends tk{static get requires(){return[ck,Wk]}static get pluginName(){return"PreElement"}}function qk(e,t,i,o,n=1){n<t?o.setAttribute(e,t,i):o.removeAttribute(e,i)}function Uk(e,t,i={}){i=e.createElement("tableCell",i);return e.insertElement("paragraph",i),e.insert(i,t),i}function Kk(e,t){const i=t.parent.parent;var o=parseInt(i.getAttribute("headingColumns")||0),t=e.getCellLocation(t)["column"];return!!o&&t<o}function Gk(){return e=>{e.on("element:figure",(e,t,i)=>{if(i.consumable.test(t.viewItem,{name:!0,classes:"table"})){var o=function(e){for(const t of e.getChildren())if(t.is("element","table"))return t}(t.viewItem);if(o&&i.consumable.test(o,{name:!0})){const n=i.convertItem(o,t.modelCursor);o=Yr(n.modelRange.getItems());o&&(i.convertChildren(t.viewItem,i.writer.createPositionAt(o,"end")),i.updateConversionResult(o,t))}}})}}function Jk(){return e=>{e.on("element:table",(e,t,i)=>{var o=t.viewItem;if(i.consumable.test(o,{name:!0})){const{rows:n,headingRows:r,headingColumns:s}=function(e){const t={headingRows:0,headingColumns:0},i=[],o=[];let n;for(const s of Array.from(e.getChildren()))if("tbody"===s.name||"thead"===s.name||"tfoot"===s.name){var r;"thead"!==s.name||n||(n=s);for(const a of Array.from(s.getChildren()).filter(e=>e.is("element","tr")))"thead"===a.parent.name&&a.parent===n?(t.headingRows++,i.push(a)):(o.push(a),(r=function(e){let t=0,i=0;var o=Array.from(e.getChildren()).filter(e=>"th"===e.name||"td"===e.name);for(;i<o.length&&"th"===o[i].name;){const r=o[i];var n=parseInt(r.getAttribute("colspan")||1);t+=n,i++}return t}(a,(t,n)))>t.headingColumns&&(t.headingColumns=r))}return t.rows=[...i,...o],t}(o),a={};s&&(a.headingColumns=s),r&&(a.headingRows=r);const l=i.writer.createElement("table",a);i.safeInsert(l,t.modelCursor)&&(i.consumable.consume(o,{name:!0}),n.forEach(e=>i.convertItem(e,i.writer.createPositionAt(l,"end"))),i.convertChildren(o,i.writer.createPositionAt(l,"end")),l.isEmpty&&(o=i.writer.createElement("tableRow"),i.writer.insert(o,i.writer.createPositionAt(l,"end")),Uk(i.writer,i.writer.createPositionAt(o,"end"))),i.updateConversionResult(l,t))}})}}function Yk(t){return e=>{e.on(`element:${t}`,(e,t,i)=>{t.modelRange&&t.viewItem.isEmpty&&(t=t.modelRange.start.nodeAfter,t=i.writer.createPositionAt(t,0),i.writer.insertElement("paragraph",t))},{priority:"low"})}}class Xk{constructor(e,t={}){this._table=e,this._startRow=void 0!==t.row?t.row:t.startRow||0,this._endRow=void 0!==t.row?t.row:t.endRow,this._startColumn=void 0!==t.column?t.column:t.startColumn||0,this._endColumn=void 0!==t.column?t.column:t.endColumn,this._includeAllSlots=!!t.includeAllSlots,this._skipRows=new Set,this._row=0,this._rowIndex=0,this._column=0,this._cellIndex=0,this._spannedCells=new Map,this._nextCellAtColumn=-1}[Symbol.iterator](){return this}next(){const e=this._table.getChild(this._rowIndex);if(!e||this._isOverEndRow())return{done:!0};if(!e.is("element","tableRow"))return this._rowIndex++,this.next();if(this._isOverEndColumn())return this._advanceToNextRow();let t=null;var i=this._getSpanned();if(i)this._includeAllSlots&&!this._shouldSkipSlot()&&(t=this._formatOutValue(i.cell,i.row,i.column));else{const n=e.getChild(this._cellIndex);if(!n)return this._advanceToNextRow();var o=parseInt(n.getAttribute("colspan")||1),i=parseInt(n.getAttribute("rowspan")||1);(1<o||1<i)&&this._recordSpans(n,i,o),this._shouldSkipSlot()||(t=this._formatOutValue(n)),this._nextCellAtColumn=this._column+o}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,t||this.next()}
5skipRow(e){this._skipRows.add(e)}_advanceToNextRow(){return this._row++,this._rowIndex++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}_isOverEndRow(){return void 0!==this._endRow&&this._row>this._endRow}_isOverEndColumn(){return void 0!==this._endColumn&&this._column>this._endColumn}_formatOutValue(e,t=this._row,i=this._column){return{done:!1,value:new Qk(this,e,t,i)}}_shouldSkipSlot(){var e=this._skipRows.has(this._row),t=this._row<this._startRow,i=this._column<this._startColumn,o=void 0!==this._endColumn&&this._column>this._endColumn;return e||t||i||o}_getSpanned(){const e=this._spannedCells.get(this._row);return e&&e.get(this._column)||null}_recordSpans(e,i,o){var n={cell:e,row:this._row,column:this._column};for(let t=this._row;t<this._row+i;t++)for(let e=this._column;e<this._column+o;e++)t==this._row&&e==this._column||this._markSpannedCell(t,e,n)}_markSpannedCell(e,t,i){this._spannedCells.has(e)||this._spannedCells.set(e,new Map);const o=this._spannedCells.get(e);o.set(t,i)}}class Qk{constructor(e,t,i,o){this.cell=t,this.row=e._row,this.column=e._column,this.cellAnchorRow=i,this.cellAnchorColumn=o,this._cellIndex=e._cellIndex,this._rowIndex=e._rowIndex,this._table=e._table}get isAnchor(){return this.row===this.cellAnchorRow&&this.column===this.cellAnchorColumn}get cellWidth(){return parseInt(this.cell.getAttribute("colspan")||1)}get cellHeight(){return parseInt(this.cell.getAttribute("rowspan")||1)}get rowIndex(){return this._rowIndex}getPositionBefore(){const e=this._table.root.document.model;return e.createPositionAt(this._table.getChild(this.row),this._cellIndex)}}function Zk(b={}){return e=>e.on("insert:table",(e,t,i)=>{const o=t.item;if(i.consumable.consume(o,"insert")){i.consumable.consume(o,"attribute:headingRows:table"),i.consumable.consume(o,"attribute:headingColumns:table");var n,r=b&&b.asWidget,s=i.writer.createContainerElement("figure",{class:"table"}),a=i.writer.createContainerElement("table");i.writer.insert(i.writer.createPositionAt(s,0),a);let e;r&&(e=(n=s,(l=i.writer).setCustomProperty("table",!0,n),Ih(n,l,{hasSelectionHandle:!0})));var l=new Xk(o),c={headingRows:o.getAttribute("headingRows")||0,headingColumns:o.getAttribute("headingColumns")||0};const m=new Map;for(const f of l){var{row:d,cell:h}=f,u=o.getChild(d),u=m.get(d)||rw(a,u,d,c,i);m.set(d,u),i.consumable.consume(h,"insert");u=i.writer.createPositionAt(u,"end");nw(f,c,u,i,b)}for(const p of o.getChildren()){var g=p.index;p.is("element","tableRow")&&!m.has(g)&&m.set(g,rw(a,p,g,c,i))}t=i.mapper.toViewPosition(t.range.start);i.mapper.bindElements(o,r?e:s),i.writer.insert(t,r?e:s)}})}function ew(){return e=>e.on("insert:tableRow",(e,t,i)=>{var o=t.item;if(i.consumable.consume(o,"insert")){const l=o.parent;var n=function(e){for(const t of e.getChildren())if("table"===t.name)return t}(i.mapper.toViewElement(l)),r=l.getChildIndex(o),t=new Xk(l,{row:r}),s={headingRows:l.getAttribute("headingRows")||0,headingColumns:l.getAttribute("headingColumns")||0};const c=new Map;for(const d of t){var a=c.get(r)||rw(n,o,r,s,i);c.set(r,a),i.consumable.consume(d.cell,"insert");a=i.writer.createPositionAt(a,"end");nw(d,s,a,i,{asWidget:!0})}}})}function tw(){return e=>e.on("attribute:headingColumns:table",(e,t,i)=>{const o=t.item;if(i.consumable.consume(t.item,e.name)){var n,r,s,a,l={headingRows:o.getAttribute("headingRows")||0,headingColumns:o.getAttribute("headingColumns")||0},e=t.attributeOldValue,t=t.attributeNewValue,t=(t<e?e:t)-1;for(const c of new Xk(o,{endColumn:t}))n=c,r=l,s=i,a=void 0,a=n.cell,n=sw(n,r),(r=s.mapper.toViewElement(a))&&r.name!==n&&function(e,t,i){const o=i.writer,n=i.mapper.toViewElement(e),r=o.createEditableElement(t,n.getAttributes()),s=Mh(r,o);Vh(s,o,(e,t,i)=>i.addClass(Xt(t.classes),e),(e,t,i)=>i.removeClass(Xt(t.classes),e)),o.insert(o.createPositionAfter(n),s),o.move(o.createRangeIn(n),o.createPositionAt(s,0)),o.remove(o.createRangeOn(n)),i.mapper.unbindViewElement(n),i.mapper.bindElements(e,s)}(a,n,s)}})}function iw(e,t){const i=t["writer"];if(e.parent.is("element","tableCell"))return ow(e)?i.createContainerElement("span",{class:"ck-table-bogus-paragraph"}):i.createContainerElement("p")}function ow(e){return 1===e.parent.childCount&&!cw(e)}function nw(e,t,i,o,n){var r=n&&n.asWidget,n=sw(e,t),t=r?Mh(o.writer.createEditableElement(n),o.writer):o.writer.createContainerElement(n);r&&Vh(t,o.writer,(e,t,i)=>i.addClass(Xt(t.classes),e),(e,t,i)=>i.removeClass(Xt(t.classes),e));const s=e.cell;n=s.getChild(0),e=1===s.childCount&&"paragraph"===n.name;o.writer.insert(i,t),o.mapper.bindElements(s,t),r||!e||cw(n)||(n=s.getChild(0),o.consumable.consume(n,"insert"),o.mapper.bindElements(n,t))}function rw(e,t,i,o,n){n.consumable.consume(t,"insert");var r=t.isEmpty?n.writer.createEmptyElement("tr"):n.writer.createContainerElement("tr");
5n.mapper.bindElements(t,r);var s=o.headingRows,o=(t=i<o.headingRows?"thead":"tbody",o=n,aw(t,e=e)||function(e,t,i){var o=i.writer.createContainerElement(e),e=i.writer.createPositionAt(t,"tbody"==e?"end":0);return i.writer.insert(e,o),o}(t,e,o)),i=n.writer.createPositionAt(o,0<s&&s<=i?i-s:i);return n.writer.insert(i,r),r}function sw(e,t){var{row:i,column:o}=e,{headingColumns:e,headingRows:t}=t;return t&&i<t||e&&o<e?"th":"td"}function aw(e,t){for(const i of t.getChildren())if(i.name==e)return i}function lw(e,t,i){t=aw(e,t);t&&0===t.childCount&&i.writer.remove(i.writer.createRangeOn(t))}function cw(e){return[...e.getAttributeKeys()].length}class dw extends Ec{refresh(){var e=this.editor.model,t=e.document.selection,e=e.schema;this.isEnabled=function(e,t){e=e.getFirstPosition().parent,e=e===e.root?e:e.parent;return t.checkChild(e,"table")}(t,e)}execute(i={}){const o=this.editor.model;var e=o.document.selection;const n=this.editor.plugins.get("TableUtils");var t=this.editor.config.get("table");const r=Nh(e,o);e=t.defaultHeadings.rows,t=t.defaultHeadings.columns;void 0===i.headingRows&&e&&(i.headingRows=e),void 0===i.headingColumns&&t&&(i.headingColumns=t),o.change(e=>{const t=n.createTable(e,i);o.insertContent(t,r),e.setSelection(e.createPositionAt(t.getNodeByPath([0,0,0]),0))})}}function hw(e){const t=[];for(const i of bw(e.getRanges())){const o=i.getContainedElement();o&&o.is("element","tableCell")&&t.push(o)}return t}function uw(e){const t=[];for(const o of e.getRanges()){var i=o.start.findAncestor("tableCell");
5i&&t.push(i)}return t}function gw(e){var t=hw(e);return t.length?t:uw(e)}function mw(e){return kw(e.map(e=>e.parent.index))}function fw(t){var e=t[0].findAncestor("table");const i=[...new Xk(e)];return kw(i.filter(e=>t.includes(e.cell)).map(e=>e.column))}function pw(e,t){if(e.length<2||!function(e){const t=e[0].findAncestor("table"),i=mw(e),o=parseInt(t.getAttribute("headingRows")||0);if(!vw(i,o))return!1;var n=parseInt(t.getAttribute("headingColumns")||0),e=fw(e);return vw(e,n)}(e))return!1;const i=new Set,o=new Set;let n=0;for(const u of e){var{row:r,column:s}=t.getCellLocation(u),a=parseInt(u.getAttribute("rowspan")||1),l=parseInt(u.getAttribute("colspan")||1);i.add(r),o.add(s),1<a&&i.add(r+a-1),1<l&&o.add(s+l-1),n+=a*l}var c,d,h;return(c=i,d=o,h=Array.from(c.values()),e=Array.from(d.values()),c=Math.max(...h),d=Math.min(...h),h=Math.max(...e),e=Math.min(...e),(c-d+1)*(h-e+1))==n}function bw(e){return Array.from(e).sort(ww)}function kw(e){e=e.sort((e,t)=>e-t);return{first:e[0],last:e[e.length-1]}}function ww(e,t){const i=e.start;t=t.start;return i.isBefore(t)?-1:1}function vw({first:e,last:t},i){return e<i==t<i}class _w extends Ec{constructor(e,t={}){super(e),this.order=t.order||"below"}refresh(){var e=!!gw(this.editor.model.document.selection).length;this.isEnabled=e}execute(){const e=this.editor;var t=e.model.document.selection;const i=e.plugins.get("TableUtils");var o="above"===this.order;const n=gw(t);var r=mw(n),t=o?r.first:r.last,r=n[0].findAncestor("table");i.insertRows(r,{at:o?t:t+1,copyStructureFromAbove:!o})}}
5class yw extends Ec{constructor(e,t={}){super(e),this.order=t.order||"right"}refresh(){var e=!!gw(this.editor.model.document.selection).length;this.isEnabled=e}execute(){const e=this.editor;var t=e.model.document.selection;const i=e.plugins.get("TableUtils");var o="left"===this.order;const n=gw(t);var r=fw(n),t=o?r.first:r.last,r=n[0].findAncestor("table");i.insertColumns(r,{columns:1,at:o?t:t+1})}}class xw extends Ec{constructor(e,t={}){super(e),this.direction=t.direction||"horizontally"}refresh(){var e=gw(this.editor.model.document.selection);this.isEnabled=1===e.length}execute(){var e=gw(this.editor.model.document.selection)[0],t="horizontally"===this.direction;const i=this.editor.plugins.get("TableUtils");t?i.splitCellHorizontally(e,2):i.splitCellVertically(e,2)}}function Cw(e,t,i){var{startRow:o,startColumn:n,endRow:r,endColumn:s}=t;const a=i.createElement("table");var l,c,d,h,u,g,m=r-o+1;for(let e=0;e<m;e++)i.insertElement("tableRow",a,"end");for({row:l,column:c,cell:d,isAnchor:h,cellAnchorRow:u,cellAnchorColumn:g}of[...new Xk(e,{startRow:o,endRow:r,startColumn:n,endColumn:s,includeAllSlots:!0})]){var f=l-o,p=a.getChild(f);h?(f=i.cloneElement(d),i.append(f,p),Sw(f,l,c,r,s,i)):(u<o||g<n)&&Uk(i,i.createPositionAt(p,"end"))}return function(e,t,i,o,n){var r=parseInt(t.getAttribute("headingRows")||0);0<r&&qk("headingRows",r-i,e,n,0);t=parseInt(t.getAttribute("headingColumns")||0);0<t&&qk("headingColumns",t-o,e,n,0)}(a,e,o,n,i),a}function Aw(e,t,i=0){const o=[];for(const s of new Xk(e,{startRow:i,endRow:t-1})){var{row:n,cellHeight:r}=s;
5n<t&&t<=n+r-1&&o.push(s)}return o}function Tw(e,t,i){var o=e.parent,n=o.parent,r=o.index,o=t-r;const s={};t=parseInt(e.getAttribute("rowspan"))-o;1<t&&(s.rowspan=t);t=parseInt(e.getAttribute("colspan")||1);1<t&&(s.colspan=t);var r=r,a=r+o;let l=null,c;for(const g of[...new Xk(n,{startRow:r,endRow:a,includeAllSlots:!0})]){var{row:d,column:h,cell:u}=g;u===e&&void 0===c&&(c=h),void 0!==c&&c===h&&d===a&&(l=Uk(i,g.getPositionBefore(),s))}return qk("rowspan",o,e,i),l}function Ew(e,t){const i=[];for(const r of new Xk(e)){var{column:o,cellWidth:n}=r;o<t&&t<=o+n-1&&i.push(r)}return i}function Pw(e,t,i,o){i-=t;const n={};t=parseInt(e.getAttribute("colspan"))-i;1<t&&(n.colspan=t);t=parseInt(e.getAttribute("rowspan")||1);1<t&&(n.rowspan=t);t=Uk(o,o.createPositionAfter(e),n);return qk("colspan",i,e,o),t}function Sw(e,t,i,o,n,r){var s=parseInt(e.getAttribute("colspan")||1),a=parseInt(e.getAttribute("rowspan")||1);n<i+s-1&&qk("colspan",n-i+1,e,r,1),o<t+a-1&&qk("rowspan",o-t+1,e,r,1)}function Iw(e,t){var i,o=t.getColumns(e);const n=new Array(o).fill(0);for({column:i}of new Xk(e))n[i]++;o=n.reduce((e,t,i)=>t?e:[...e,i],[]);if(0<o.length){o=o[o.length-1];return t.removeColumns(e,{at:o}),!0}return!1}function Rw(t,e){const i=[];var o=e.getRows(t);for(let e=0;e<o;e++)t.getChild(e).isEmpty&&i.push(e);if(0<i.length){var n=i[i.length-1];return e.removeRows(t,{at:n}),1}}function Ow(e,t){Iw(e,t)||Rw(e,t)}function Vw(e,t){const i=Array.from(new Xk(e,{startColumn:t.firstColumn,endColumn:t.lastColumn,row:t.lastRow}));if(i.every(({cellHeight:e})=>1===e))return t.lastRow;e=i[0].cellHeight-1;return t.lastRow+e}function Mw(e,t){const i=Array.from(new Xk(e,{startRow:t.firstRow,endRow:t.lastRow,column:t.lastColumn}));if(i.every(({cellWidth:e})=>1===e))return t.lastColumn;e=i[0].cellWidth-1;return t.lastColumn+e}
5class Nw extends Ec{constructor(e,t){super(e),this.direction=t.direction,this.isHorizontal="right"==this.direction||"left"==this.direction}refresh(){var e=this._getMergeableCell();this.value=e,this.isEnabled=!!e}execute(){const e=this.editor.model;const s=uw(e.document.selection)[0],a=this.value,l=this.direction;e.change(e=>{var t="right"==l||"down"==l,i=t?s:a,o=t?a:s;const n=o.parent;!function(e,t,i){zw(e)||(zw(t)&&i.remove(i.createRangeIn(t)),i.move(i.createRangeIn(e),i.createPositionAt(t,"end")));i.remove(e)}(o,i,e);var r=this.isHorizontal?"colspan":"rowspan",t=parseInt(s.getAttribute(r)||1),o=parseInt(a.getAttribute(r)||1);e.setAttribute(r,t+o,i),e.setSelection(e.createRangeIn(i));i=this.editor.plugins.get("TableUtils");Ow(n.findAncestor("table"),i)})}_getMergeableCell(){const e=uw(this.editor.model.document.selection)[0];if(e){var t=this.editor.plugins.get("TableUtils");const o=(this.isHorizontal?function(e,t,i){const o=e.parent,n=o.parent,r="right"==t?e.nextSibling:e.previousSibling,s=0<(n.getAttribute("headingColumns")||0);if(r){const d="right"==t?e:r;var a="right"==t?r:e,l=i.getCellLocation(d)["column"],c=i.getCellLocation(a)["column"],t=parseInt(d.getAttribute("colspan")||1),e=Kk(i,d,n),a=Kk(i,a,n);if(!s||e==a)return l+t===c?r:void 0}}:function(t,o,e){const i=t.parent,n=i.parent,r=n.getChildIndex(i);if(!("down"==o&&r===e.getRows(n)-1||"up"==o&&0===r)){var s=parseInt(t.getAttribute("rowspan")||1),a=n.getAttribute("headingRows")||0,e="down"==o&&r+s===a,s="up"==o&&r===a;if(!a||!e&&!s){s=parseInt(t.getAttribute("rowspan")||1);const l="down"==o?r+s:r,c=[...new Xk(n,{endRow:l})],d=c.find(e=>e.cell===t).column;s=c.find(({row:e,cellHeight:t,column:i})=>i===d&&("down"==o?e===l:l===e+t));return s&&s.cell}}})(e,this.direction,t);if(o){var i=this.isHorizontal?"rowspan":"colspan",t=parseInt(e.getAttribute(i)||1);return parseInt(o.getAttribute(i)||1)===t?o:void 0}}}}function zw(e){return 1==e.childCount&&e.getChild(0).is("element","paragraph")&&e.getChild(0).isEmpty}class Bw extends Ec{refresh(){var e,t=gw(this.editor.model.document.selection);const i=t[0];i?(e=i.findAncestor("table"),e=this.editor.plugins.get("TableUtils").getRows(e)-1,e=0===(t=mw(t)).first&&t.last===e,this.isEnabled=!e):this.isEnabled=!1}execute(){const e=this.editor.model,i=this.editor.plugins.get("TableUtils");var t=gw(e.document.selection);const o=mw(t),n=t[0],r=n.findAncestor("table"),s=i.getCellLocation(n).column;e.change(e=>{var t=o.last-o.first+1;i.removeRows(r,{at:o.first,rows:t});t=function(e,t,i,o){const n=e.getChild(Math.min(t,o-1));let r=n.getChild(0),s=0;for(const a of n.getChildren()){if(s>i)return r;r=a,s+=parseInt(a.getAttribute("colspan")||1)}return r}(r,o.first,s,i.getRows(r));e.setSelection(e.createPositionAt(t,0))})}}class Fw extends Ec{refresh(){var e,t,i=gw(this.editor.model.document.selection);const o=i[0];o?(t=o.findAncestor("table"),e=this.editor.plugins.get("TableUtils").getColumns(t),{first:t,last:i}=fw(i),this.isEnabled=i-t<e-1):this.isEnabled=!1}execute(){const[t,i]=function(e){const t=gw(e),i=t[0],o=t.pop(),n=[i,o];return i.isBefore(o)?n:n.reverse()}(this.editor.model.document.selection),o=t.parent.parent,e=[...new Xk(o)],n={first:e.find(e=>e.cell===t).column,last:e.find(e=>e.cell===i).column},r=(s=e,a=t,l=i,c=n,1<parseInt(l.getAttribute("colspan")||1)?l:a.previousSibling||l.nextSibling?l.nextSibling||a.previousSibling:(c.first?s.reverse().find(({column:e})=>e<c.first):s.reverse().find(({column:e})=>e>c.last)).cell);var s,a,l,c;this.editor.model.change(e=>{var t=n.last-n.first+1;this.editor.plugins.get("TableUtils").removeColumns(o,{at:n.first,columns:t}),e.setSelection(e.createPositionAt(r,0))})}}class Dw extends Ec{refresh(){const e=gw(this.editor.model.document.selection);var t=0<e.length;this.isEnabled=t,this.value=t&&e.every(e=>this._isInHeading(e,e.parent.parent))}execute(e={}){if(e.forceValue!==this.value){const i=this.editor.model,o=gw(i.document.selection),n=o[0].findAncestor("table");var{first:t,last:e}=mw(o);const r=this.value?t:e+1,s=n.getAttribute("headingRows")||0;i.change(e=>{if(r){var t,i=r>s?s:0;for({cell:t}of Aw(n,r,i))Tw(t,r,e)}qk("headingRows",r,n,e,0)})}}_isInHeading(e,t){t=parseInt(t.getAttribute("headingRows")||0);return!!t&&e.parent.index<t}}
5class Lw extends Ec{refresh(){const e=gw(this.editor.model.document.selection),t=this.editor.plugins.get("TableUtils");var i=0<e.length;this.isEnabled=i,this.value=i&&e.every(e=>Kk(t,e))}execute(e={}){if(e.forceValue!==this.value){const i=this.editor.model,o=gw(i.document.selection),n=o[0].findAncestor("table");var{first:t,last:e}=fw(o);const r=this.value?t:e+1;i.change(e=>{var t,i;if(r)for({cell:t,column:i}of Ew(n,r))Pw(t,i,r,e);qk("headingColumns",r,n,e,0)})}}}class Hw extends Ac{static get pluginName(){return"TableUtils"}init(){this.decorate("insertColumns"),this.decorate("insertRows")}getCellLocation(e){var t=e.parent;const i=t.parent;var o,n,r,t=i.getChildIndex(t);for({cell:o,row:n,column:r}of new Xk(i,{row:t}))if(o===e)return{row:n,column:r}}createTable(e,t){var i=e.createElement("table"),o=parseInt(t.rows)||2,n=parseInt(t.columns)||2;return jw(e,i,0,o,n),t.headingRows&&qk("headingRows",Math.min(t.headingRows,o),i,e,0),t.headingColumns&&qk("headingColumns",Math.min(t.headingColumns,n),i,e,0),i}insertRows(g,e={}){const t=this.editor.model,m=e.at||0,f=e.rows||1,p=void 0!==e.copyStructureFromAbove,b=e.copyStructureFromAbove?m-1:m,k=this.getRows(g),w=this.getColumns(g);if(m>k)throw new Bt.a("tableutils-insertrows-insert-out-of-range",this,{options:e});t.change(t=>{var e=g.getAttribute("headingRows")||0;if(e>m&&qk("headingRows",e+f,g,t,0),p||0!==m&&m!==k){var i,o,n,r,s,e=p?Math.max(m,b):m,e=new Xk(g,{endRow:e});const u=new Array(w).fill(1);for({row:i,column:o,cellHeight:n,cellWidth:r,cell:s}of e){var a=i+n-1,l=i<m&&m<=a,a=i<=b&&b<=a;l?(t.setAttribute("rowspan",n+f,s),u[o]=-r):p&&a&&(u[o]=r)}for(let e=0;e<f;e++){var c=t.createElement("tableRow");t.insert(c,g,m);for(let e=0;e<u.length;e++){var d=u[e],h=t.createPositionAt(c,"end");0<d&&Uk(t,h,1<d?{colspan:d}:null),e+=Math.abs(d)-1}}}else jw(t,g,m,f,w)})}insertColumns(u,e={}){const t=this.editor.model,g=e.at||0,m=e.columns||1;t.change(e=>{var t=u.getAttribute("headingColumns");g<t&&e.setAttribute("headingColumns",t+m,u);t=this.getColumns(u);if(0!==g&&t!==g){const c=new Xk(u,{column:g,includeAllSlots:!0});for(const d of c){var{row:i,cell:o,cellAnchorColumn:n,cellAnchorRow:r,cellWidth:s,cellHeight:a}=d;if(n<g){e.setAttribute("colspan",s+m,o);var l=r+a-1;for(let e=i;e<=l;e++)c.skipRow(e)}else Ww(m,e,d.getPositionBefore())}}else for(const h of u.getChildren())h.is("element","tableRow")&&Ww(m,e,e.createPositionAt(h,g?"end":0))})}removeRows(l,e){const t=this.editor.model;var i=e.rows||1,o=this.getRows(l);const c=e.at,d=c+i-1;if(d>o-1)throw new Bt.a("tableutils-removerows-row-index-out-of-range",this,{table:l,options:e});t.change(t=>{var e,i,o,n,r,{cellsToMove:s,cellsToTrim:a}=function(e,t,i){const o=new Map,n=[];for(var{row:r,column:s,cellHeight:a,cell:l}of new Xk(e,{endRow:i})){var c,d=r+a-1;if(r>=t&&r<=i&&i<d&&(c=i-r+1,c=a-c,o.set(s,{cell:l,rowspan:c})),r<t&&t<=d){let e;e=i<=d?i-t+1:d-t+1,n.push({cell:l,rowspan:a-e})}}return{cellsToMove:o,cellsToTrim:n}}(l,c,d);s.size&&(r=1+d,function(e,t,i,o){var n=new Xk(e,{includeAllSlots:!0,row:t}),n=[...n],r=e.getChild(t);let s;for(var{column:a,cell:l,isAnchor:c}of n){var d,h;i.has(a)?({cell:d,rowspan:h}=i.get(a),a=s?o.createPositionAfter(s):o.createPositionAt(r,0),o.move(o.createRangeOn(d),a),qk("rowspan",h,d,o),s=d):c&&(s=l)}}(l,r,s,t));for(let e=d;e>=c;e--)t.remove(l.getChild(e));for({rowspan:e,cell:i}of a)qk("rowspan",e,i,t);o=l,n=c,r=d,s=t,a=o.getAttribute("headingRows")||0,n<a&&qk("headingRows",r<a?a-(r-n+1):n,o,s,0),Iw(l,this)||Rw(l,this)})}removeColumns(l,e){const t=this.editor.model,c=e.at;var i=e.columns||1;const d=e.at+i-1;t.change(t=>{var e,i,o,n;e=l,i={first:c,last:d},o=t,(n=e.getAttribute("headingColumns")||0)&&i.first<n&&(i=Math.min(n-1,i.last)-i.first+1,o.setAttribute("headingColumns",n-i,e));for(let e=d;e>=c;e--)for(var{cell:r,column:s,cellWidth:a}of[...new Xk(l)])s<=e&&1<a&&s+a>e?qk("colspan",a-1,r,t):s===e&&t.remove(r);Rw(l,this)||Iw(l,this)})}splitCellVertically(d,h=2){const e=this.editor.model;const u=d.parent.parent,g=parseInt(d.getAttribute("rowspan")||1),m=parseInt(d.getAttribute("colspan")||1);e.change(e=>{if(1<m){var{newCellsSpan:t,updatedSpan:i}=$w(m,h);qk("colspan",i,d,e);const s={};1<t&&(s.colspan=t),1<g&&(s.rowspan=g),Ww(m>h?h-1:m-1,e,e.createPositionAfter(d),s)}if(m<h){var o,n,r=h-m;const a=[...new Xk(u)],l=a.find(({cell:e})=>e===d)["column"];for({cell:o,cellWidth:n}of a.filter(({cell:e,cellWidth:t,column:i})=>{e=e!==d&&i===l,t=i<l&&i+t>l;return e||t}))e.setAttribute("colspan",n+r,o);const c={};1<g&&(c.rowspan=g),Ww(r,e,e.createPositionAfter(d),c);t=u.getAttribute("headingColumns")||0;t>l&&qk("headingColumns",t+r,u,e)}})}splitCellHorizontally(b,k=2){const e=this.editor.model;var t=b.parent;const w=t.parent,v=w.getChildIndex(t),_=parseInt(b.getAttribute("rowspan")||1),y=parseInt(b.getAttribute("colspan")||1);e.change(e=>{if(1<_){const g=[...new Xk(w,{startRow:v,endRow:v+_-1,includeAllSlots:!0})];var{newCellsSpan:t,updatedSpan:i}=$w(_,k);qk("rowspan",i,b,e);var o=g.find(({cell:e})=>e===b)["column"];const m={};
51<t&&(m.rowspan=t),1<y&&(m.colspan=y);for(const f of g){var{column:n,row:r}=f,s=r>=v+i,n=n===o,r=(r+v+i)%t==0;s&&n&&r&&Ww(1,e,f.getPositionBefore(),m)}}if(_<k){var a,l,c,d,h=k-_;for({cell:a,cellHeight:l,row:c}of[...new Xk(w,{startRow:0,endRow:v})])a!==b&&c+l>v&&(d=l+h,e.setAttribute("rowspan",d,a));const p={};1<y&&(p.colspan=y),jw(e,w,v+1,h,1,p);var u=w.getAttribute("headingRows")||0;u>v&&qk("headingRows",u+h,w,e)}})}getColumns(e){const t=e.getChild(0);return[...t.getChildren()].reduce((e,t)=>{return e+parseInt(t.getAttribute("colspan")||1)},0)}getRows(e){return Array.from(e.getChildren()).reduce((e,t)=>t.is("element","tableRow")?e+1:e,0)}}function jw(t,i,o,n,r,s={}){for(let e=0;e<n;e++){var a=t.createElement("tableRow");t.insert(a,i,o),Ww(r,t,t.createPositionAt(a,"end"),s)}}function Ww(t,i,o,n={}){for(let e=0;e<t;e++)Uk(i,o,n)}function $w(e,t){if(e<t)return{newCellsSpan:1,updatedSpan:1};var i=Math.floor(e/t);return{newCellsSpan:i,updatedSpan:e-i*t+i}}class qw extends Ec{refresh(){var e=hw(this.editor.model.document.selection);this.isEnabled=pw(e,this.editor.plugins.get(Hw))}execute(){const s=this.editor.model,a=this.editor.plugins.get(Hw);s.change(e=>{const t=hw(s.document.selection),i=t.shift();var{mergeWidth:o,mergeHeight:n}=function(e,t,i){let o=0,n=0;for(const a of t){var{row:r,column:s}=i.getCellLocation(a);o=Kw(a,s,o,"colspan"),n=Kw(a,r,n,"rowspan")}var{row:t,column:e}=i.getCellLocation(e),e=o-e,t=n-t;return{mergeWidth:e,mergeHeight:t}}(i,t,a);qk("colspan",o,i,e),qk("rowspan",n,i,e);for(const r of t)!function(e,t,i){Uw(e)||(Uw(t)&&i.remove(i.createRangeIn(t)),i.move(i.createRangeIn(e),i.createPositionAt(t,"end")));i.remove(e)}(r,i,e);Ow(i.findAncestor("table"),a),e.setSelection(i,"in")})}}function Uw(e){return 1==e.childCount&&e.getChild(0).is("element","paragraph")&&e.getChild(0).isEmpty}function Kw(e,t,i,o){o=parseInt(e.getAttribute(o)||1);return Math.max(i,t+o)}class Gw extends Ec{refresh(){var e=gw(this.editor.model.document.selection);this.isEnabled=0<e.length}execute(){const t=this.editor.model,e=gw(t.document.selection);var i=mw(e);
5const o=e[0].findAncestor("table"),n=[];for(let e=i.first;e<=i.last;e++)for(const r of o.getChild(e).getChildren())n.push(t.createRangeOn(r));t.change(e=>{e.setSelection(n)})}}class Jw extends Ec{refresh(){var e=gw(this.editor.model.document.selection);this.isEnabled=0<e.length}execute(){const e=this.editor.model,t=gw(e.document.selection),i=t[0];var o=t.pop(),n=i.findAncestor("table");const r=this.editor.plugins.get("TableUtils");var s=r.getCellLocation(i),a=r.getCellLocation(o),o=Math.min(s.column,a.column),a=Math.max(s.column,a.column);const l=[];for(const c of new Xk(n,{startColumn:o,endColumn:a}))l.push(e.createRangeOn(c.cell));e.change(e=>{e.setSelection(l)})}}function Yw(t){t.document.registerPostFixer(e=>function(t,e){e=e.document.differ.getChanges();let i=!1;const o=new Set;for(const n of e){let e;"table"==n.name&&"insert"==n.type&&(e=n.position.nodeAfter),"tableRow"!=n.name&&"tableCell"!=n.name||(e=n.position.findAncestor("table")),function(e){var t="attribute"===e.type,e=e.attributeKey;return t&&("headingRows"===e||"colspan"===e||"rowspan"===e)}(n)&&(e=n.range.start.findAncestor("table")),e&&!o.has(e)&&(i=function(e,t){let i=!1;e=function(e){const t=parseInt(e.getAttribute("headingRows")||0),i=Array.from(e.getChildren()).reduce((e,t)=>t.is("element","tableRow")?e+1:e,0),o=[];for(var{row:n,cell:r,cellHeight:s}of new Xk(e)){var a;s<2||(a=n<t?t:i,n+s>a&&(n=a-n,o.push({cell:r,rowspan:n})))}return o}(e);if(e.length){i=!0;for(const o of e)qk("rowspan",o.rowspan,o.cell,t,1)}return i}(e,t)||i,i=function(i,t){let e=!1;const o=function(e){const t=new Array(e.childCount).fill(0);for(var{rowIndex:i}of new Xk(e,{includeAllSlots:!0}))t[i]++;return t}(i),n=[];for(var[r,s]of o.entries())!s&&i.getChild(r).is("element","tableRow")&&n.push(r);if(n.length){e=!0;for(const m of n.reverse())t.remove(i.getChild(m)),o.splice(m,1)}const a=o.filter((e,t)=>i.getChild(t).is("element","tableRow")),l=a[0],c=a.every(e=>e===l);if(!c){var d,h,u=a.reduce((e,t)=>e<t?t:e,0);for([d,h]of a.entries()){var g=u-h;if(g){for(let e=0;e<g;e++)Uk(t,t.createPositionAt(i.getChild(d),"end"));e=!0}}}return e}(e,t)||i,o.add(e))}return i}(e,t))}function Xw(t){t.document.registerPostFixer(e=>function(e,t){t=t.document.differ.getChanges();let i=!1;for(const o of t)"insert"==o.type&&"table"==o.name&&(i=function(e,t){let i=!1;for(const o of e.getChildren())o.is("element","tableRow")&&(i=Qw(o,t)||i);return i}(o.position.nodeAfter,e)||i),"insert"==o.type&&"tableRow"==o.name&&(i=Qw(o.position.nodeAfter,e)||i),"insert"==o.type&&"tableCell"==o.name&&(i=Zw(o.position.nodeAfter,e)||i),function(e){return!(!e.position||!e.position.parent.is("element","tableCell"))&&("insert"==e.type&&"$text"==e.name||"remove"==e.type)}(o)&&(i=Zw(o.position.parent,e)||i);return i}(e,t))}function Qw(e,t){let i=!1;for(const o of e.getChildren())i=Zw(o,t)||i;return i}function Zw(e,t){if(0==e.childCount)return t.insertElement("paragraph",e),!0;e=Array.from(e.getChildren()).filter(e=>e.is("$text"));for(const i of e)t.wrap(t.createRangeOn(i),"paragraph");return!!e.length}function ev(e,t){e.document.registerPostFixer(()=>function(e,t){const i=new Set;for(const o of e.getChanges()){const n=("attribute"==o.type?o.range.start:o.position).parent;n.is("element","tableCell")&&i.add(n)}for(const r of i.values())for(const s of[...r.getChildren()].filter(e=>function(e,t){if(!e.is("element","paragraph"))return!1;const i=t.toViewElement(e);return!!i&&ow(e)!==i.is("element","span")}(e,t)))e.refreshItem(s);return!1}(e.document.differ,t))}function tv(e){e.document.registerPostFixer(()=>function(e){const t=e.document.differ,i=new Set;for(const o of t.getChanges())if("attribute"==o.type){const n=o.range.start.nodeAfter;n&&n.is("element","table")&&"headingRows"==o.attributeKey&&i.add(n)}if(i.size){for(const r of i.values())t.refreshItem(r);return!0}return!1}(e))}i(109);class iv extends Ac{static get pluginName(){return"TableEditing"}init(){const e=this.editor;var t=e.model;const i=t.schema,o=e.conversion;i.register("table",{allowWhere:"$block",allowAttributes:["headingRows","headingColumns"],isObject:!0,isBlock:!0}),i.register("tableRow",{allowIn:"table",isLimit:!0}),i.register("tableCell",{allowIn:"tableRow",allowChildren:"$block",allowAttributes:["colspan","rowspan"],isLimit:!0,isSelectable:!0}),o.for("upcast").add(Gk()),o.for("upcast").add(Jk()),o.for("editingDowncast").add(Zk({asWidget:!0})),o.for("dataDowncast").add(Zk()),o.for("upcast").elementToElement({model:"tableRow",view:"tr"}),o.for("upcast").add(e=>{e.on("element:tr",(e,t)=>{t.viewItem.isEmpty&&0==t.modelCursor.index&&e.stop()},{priority:"high"})}),o.for("editingDowncast").add(ew()),o.for("editingDowncast").add(e=>e.on("remove:tableRow",(e,t,i)=>{e.stop();const o=i.writer,n=i.mapper;e=n.toViewPosition(t.position).getLastMatchingPosition(e=>!e.item.is("element","tr")).nodeAfter,t=e.parent.parent,e=o.createRangeOn(e),e=o.remove(e);for(const r of o.createRangeIn(e).getItems())n.unbindViewElement(r);lw("thead",t,i),lw("tbody",t,i)},{priority:"higher"})),o.for("upcast").elementToElement({model:"tableCell",view:"td"}),o.for("upcast").elementToElement({model:"tableCell",view:"th"}),o.for("upcast").add(Yk("td")),o.for("upcast").add(Yk("th")),o.for("editingDowncast").add(e=>e.on("insert:tableCell",(e,t,i)=>{var o=t.item;if(i.consumable.consume(o,"insert")){const s=o.parent,a=s.parent;var t=a.getChildIndex(s),t=new Xk(a,{row:t}),n={headingRows:a.getAttribute("headingRows")||0,headingColumns:a.getAttribute("headingColumns")||0};for(const l of t)if(l.cell===o){var r=i.mapper.toViewElement(s),r=i.writer.createPositionAt(r,s.getChildIndex(o));return void nw(l,n,r,i,{asWidget:!0})}}})),o.for("editingDowncast").elementToElement({model:"paragraph",view:iw,converterPriority:"high"}),o.for("downcast").attributeToAttribute({model:"colspan",view:"colspan"}),o.for("upcast").attributeToAttribute({model:{key:"colspan",value:ov("colspan")},view:"colspan"}),o.for("downcast").attributeToAttribute({model:"rowspan",view:"rowspan"}),o.for("upcast").attributeToAttribute({model:{key:"rowspan",value:ov("rowspan")},view:"rowspan"}),o.for("editingDowncast").add(tw()),e.data.mapper.on("modelToViewPosition",(e,t)=>{const i=t.modelPosition.parent,o=t.modelPosition.nodeBefore;var n;i.is("element","tableCell")&&o&&o.is("element","paragraph")&&(t.mapper.toViewElement(o)===(n=t.mapper.toViewElement(i))&&(t.viewPosition=t.mapper.findPositionIn(n,o.maxOffset)))}),e.config.define("table.defaultHeadings.rows",0),e.config.define("table.defaultHeadings.columns",0),e.commands.add("insertTable",new dw(e)),e.commands.add("insertTableRowAbove",new _w(e,{order:"above"})),e.commands.add("insertTableRowBelow",new _w(e,{order:"below"})),e.commands.add("insertTableColumnLeft",new yw(e,{order:"left"})),e.commands.add("insertTableColumnRight",new yw(e,{order:"right"}
5)),e.commands.add("removeTableRow",new Bw(e)),e.commands.add("removeTableColumn",new Fw(e)),e.commands.add("splitTableCellVertically",new xw(e,{direction:"vertically"})),e.commands.add("splitTableCellHorizontally",new xw(e,{direction:"horizontally"})),e.commands.add("mergeTableCells",new qw(e)),e.commands.add("mergeTableCellRight",new Nw(e,{direction:"right"})),e.commands.add("mergeTableCellLeft",new Nw(e,{direction:"left"})),e.commands.add("mergeTableCellDown",new Nw(e,{direction:"down"})),e.commands.add("mergeTableCellUp",new Nw(e,{direction:"up"})),e.commands.add("setTableColumnHeader",new Lw(e)),e.commands.add("setTableRowHeader",new Dw(e)),e.commands.add("selectTableRow",new Gw(e)),e.commands.add("selectTableColumn",new Jw(e)),tv(t),Yw(t),ev(t,e.editing.mapper),Xw(t)}static get requires(){return[Hw]}}function ov(t){return e=>{e=parseInt(e.getAttribute(t));return Number.isNaN(e)||e<=0?null:e}}i(111);class nv extends Jl{constructor(e){super(e);const t=this.bindTemplate;this.items=this._createGridCollection(),this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",(e,t)=>`${t} × ${e}`),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},on:{"[email protected]":t.to("boxover")},children:this.items},{tag:"div",attributes:{class:["ck-insert-table-dropdown__label"]},children:[{text:t.to("label")}]}],on:{mousedown:t.to(e=>{e.preventDefault()}),click:t.to(()=>{this.fire("execute")})}}),this.on("boxover",(e,t)=>{var{row:i,column:t}=t.target.dataset;this.set({rows:parseInt(i),columns:parseInt(t)})}),this.on("change:columns",()=>{this._highlightGridBoxes()}),this.on("change:rows",()=>{this._highlightGridBoxes()})}focus(){}focusLast(){}_highlightGridBoxes(){const o=this.rows,n=this.columns;this.items.map((e,t)=>{var i=t%10,i=Math.floor(t/10)<o&&i<n;e.set("isOn",i)})}_createGridCollection(){const t=[];for(let e=0;e<100;e++){var i=Math.floor(e/10),o=e%10;t.push(new rv(this.locale,i+1,1+o))}return this.createCollection(t)}}class rv extends Jl{constructor(e,t,i){super(e);const o=this.bindTemplate;this.set("isOn",!1),this.setTemplate({tag:"div",attributes:{class:["ck-insert-table-dropdown-grid-box",o.if("isOn","ck-on")],"data-row":t,"data-column":i}})}}class sv extends Ac{static get pluginName(){return"TableUI"}init(){const n=this.editor,r=this.editor.t;const i="ltr"===n.locale.contentLanguageDirection;n.ui.componentFactory.add("insertTable",e=>{var t=n.commands.get("insertTable");const i=vc(e);i.bind("isEnabled").to(t),i.buttonView.set({icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 6v3h4V6H3zm0 4v3h4v-3H3zm0 4v3h4v-3H3zm5 3h4v-3H8v3zm5 0h4v-3h-4v3zm4-4v-3h-4v3h4zm0-4V6h-4v3h4zm1.5 8a1.5 1.5 0 0 1-1.5 1.5H3A1.5 1.5 0 0 1 1.5 17V4c.222-.863 1.068-1.5 2-1.5h13c.932 0 1.778.637 2 1.5v13zM12 13v-3H8v3h4zm0-4V6H8v3h4z"/></svg>',label:r("Insert table"),tooltip:!0});let o;return i.on("change:isOpen",()=>{o||(o=new nv(e),i.panelView.children.add(o),o.delegate("execute").to(i),i.buttonView.on("open",()=>{o.rows=0,o.columns=0}),i.on("execute",()=>{n.execute("insertTable",{rows:o.rows,columns:o.columns}),n.editing.view.focus()}))}),i}),n.ui.componentFactory.add("tableColumn",e=>{var t=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:r("Header column"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:i?"insertTableColumnLeft":"insertTableColumnRight",label:r("Insert column left")}},{type:"button",model:{commandName:i?"insertTableColumnRight":"insertTableColumnLeft",label:r("Insert column right")}},{type:"button",model:{commandName:"removeTableColumn",label:r("Delete column")}},{type:"button",model:{commandName:"selectTableColumn",label:r("Select column")}}];return this._prepareDropdown(r("Column"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M18 7v1H2V7h16zm0 5v1H2v-1h16z" opacity=".6"/><path d="M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1zm-2 1H8v4h4V2zm0 6H8v4h4V8zm0 6H8v4h4v-4z"/></svg>',t,e)}),n.ui.componentFactory.add("tableRow",e=>{var t=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:r("Header row"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowAbove",label:r("Insert row above")}},{type:"button",model:{commandName:"insertTableRowBelow",label:r("Insert row below")}},{type:"button",model:{commandName:"removeTableRow",label:r("Delete row")}},{type:"button",model:{commandName:"selectTableRow",label:r("Select row")}}];return this._prepareDropdown(r("Row"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v16h-1V2z" opacity=".6"/><path d="M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1 2v4h4V8H2zm6 0v4h4V8H8zm6 0v4h4V8h-4z"/></svg>',t,e)}),n.ui.componentFactory.add("mergeTableCells",e=>{var t=[{type:"button",model:{commandName:"mergeTableCellUp",label:r("Merge cell up")}},{type:"button",model:{commandName:i?"mergeTableCellRight":"mergeTableCellLeft",label:r("Merge cell right")}},{type:"button",model:{commandName:"mergeTableCellDown",label:r("Merge cell down")}},{type:"button",model:{commandName:i?"mergeTableCellLeft":"mergeTableCellRight",label:r("Merge cell left")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:r("Split cell vertically")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:r("Split cell horizontally")}}];return this._prepareMergeSplitButtonDropdown(r("Merge cells"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v7h-1V2zm6 5v1H2V7h16zM8 12v1H2v-1h6z" opacity=".6"/><path d="M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1 2v9h10V9H8z"/></svg>',t,e)})}_prepareDropdown(e,t,i,o){const n=this.editor,r=vc(o);i=this._fillDropdownWithListOptions(r,i);return r.buttonView.set({label:e,icon:t,tooltip:!0}),r.bind("isEnabled").toMany(i,"isEnabled",(...e)=>e.some(e=>e)),this.listenTo(r,"execute",e=>{n.execute(e.source.commandName),n.editing.view.focus()}),r}_prepareMergeSplitButtonDropdown(e,t,i,o){const n=this.editor,r=vc(o,Jc),s="mergeTableCells";o=n.commands.get(s),i=this._fillDropdownWithListOptions(r,i);return r.buttonView.set({label:e,icon:t,tooltip:!0,isEnabled:!0}),r.bind("isEnabled").toMany([o,...i],"isEnabled",(...e)=>e.some(e=>e)),this.listenTo(r.buttonView,"execute",()=>{n.execute(s),n.editing.view.focus()}),this.listenTo(r,"execute",e=>{n.execute(e.source.commandName),n.editing.view.focus()}),r}_fillDropdownWithListOptions(e,t){var i=this.editor,o=[],n=new Jt;for(const r of t)!function(e,t,i,o){const n=e.model=new id(e.model),{commandName:r,bindIsOn:s}=e.model;"button"!==e.type&&"switchbutton"!==e.type||(t=t.commands.get(r),i.push(t),n.set({commandName:r}),n.bind("isEnabled").to(t),s&&n.bind("isOn").to(t,"value"));n.set({withText:!0}),o.add(e)}(r,i,o,n);return yc(e,n,i.ui.componentFactory),o}}i(113);class av extends Ac{static get pluginName(){return"TableSelection"}static get requires(){return[Hw]}init(){var e=this.editor.model;this.listenTo(e,"deleteContent",(e,t)=>this._handleDeleteContent(e,t),{priority:"high"}
5),this._defineSelectionConverter(),this._enablePluginDisabling()}getSelectedTableCells(){var e=hw(this.editor.model.document.selection);return 0==e.length?null:e}getSelectionAsFragment(){const d=this.getSelectedTableCells();return d?this.editor.model.change(e=>{var t=e.createDocumentFragment(),i=this.editor.plugins.get("TableUtils"),{first:o,last:n}=fw(d),{first:r,last:s}=mw(d),a=d[0].findAncestor("table");let l=s,c=n;pw(d,i)&&(s={firstColumn:o,lastColumn:n,firstRow:r,lastRow:s},l=Vw(a,s),c=Mw(a,s));o=Cw(a,{startRow:r,startColumn:o,endRow:l,endColumn:c},e);return e.insert(o,t,0),t}):null}setCellSelection(e,t){const i=this._getCellsToSelect(e,t);this.editor.model.change(t=>{t.setSelection(i.cells.map(e=>t.createRangeOn(e)),{backward:i.backward})})}getFocusCell(){const e=this.editor.model.document.selection,t=[...e.getRanges()].pop(),i=t.getContainedElement();return i&&i.is("element","tableCell")?i:null}getAnchorCell(){const e=this.editor.model.document.selection,t=Yr(e.getRanges()),i=t.getContainedElement();return i&&i.is("element","tableCell")?i:null}_defineSelectionConverter(){const e=this.editor,a=new Set;e.conversion.for("editingDowncast").add(e=>e.on("selection",(e,t,i)=>{const o=i.writer;!function(e){for(const t of a)e.removeClass("ck-editor__editable_selected",t);a.clear()}(o);var n=this.getSelectedTableCells();if(n){for(const s of n){var r=i.mapper.toViewElement(s);o.addClass("ck-editor__editable_selected",r),a.add(r)}n=i.mapper.toViewElement(n[n.length-1]);o.setSelection(n,0)}},{priority:"lowest"}))}_enablePluginDisabling(){const o=this.editor;this.on("change:isEnabled",()=>{if(!this.isEnabled){const i=this.getSelectedTableCells();i&&o.model.change(e=>{var t=e.createPositionAt(i[0],0),t=o.model.schema.getNearestSelectionRange(t);e.setSelection(t)})}})}_handleDeleteContent(e,t){const[i,o]=t,n=this.editor.model,r=!o||"backward"==o.direction,s=hw(i);s.length&&(e.stop(),n.change(e=>{var t=s[r?s.length-1:0];n.change(e=>{for(const t of s)n.deleteContent(e.createSelection(t,"in"))});t=n.schema.getNearestSelectionRange(e.createPositionAt(t,0));i.is("documentSelection")?e.setSelection(t):i.setTo(t)}))}_getCellsToSelect(e,t){const i=this.editor.plugins.get("TableUtils");var o=i.getCellLocation(e),n=i.getCellLocation(t),r=Math.min(o.row,n.row),s=Math.max(o.row,n.row),a=Math.min(o.column,n.column),t=Math.max(o.column,n.column);const l=new Array(s-r+1).fill(null).map(()=>[]);var c,d,t={startRow:r,endRow:s,startColumn:a,endColumn:t};for({row:c,cell:d}of new Xk(e.findAncestor("table"),t))l[c-r].push(d);t=n.row<o.row,o=n.column<o.column;return t&&l.reverse(),o&&l.forEach(e=>e.reverse()),{cells:l.flat(),backward:t||o}}}class lv extends Ac{static get pluginName(){return"TableClipboard"}static get requires(){return[av,Hw]}init(){var e=this.editor,t=e.editing.view.document;this.listenTo(t,"copy",(e,t)=>this._onCopyCut(e,t)),this.listenTo(t,"cut",(e,t)=>this._onCopyCut(e,t)),this.listenTo(e.model,"insertContent",(e,t)=>this._onInsertContent(e,...t),{priority:"high"}),this.decorate("_replaceTableSlotCell")}_onCopyCut(e,t){const i=this.editor.plugins.get(av);if(i.getSelectedTableCells()&&("cut"!=e.name||!this.editor.isReadOnly)){t.preventDefault(),e.stop();const n=this.editor.data,r=this.editor.editing.view.document;var o=n.toView(i.getSelectionAsFragment());r.fire("clipboardOutput",{dataTransfer:t.dataTransfer,content:o,method:e.name})}}_onInsertContent(e,t,i){if(!i||i.is("documentSelection")){const o=this.editor.model,a=this.editor.plugins.get(Hw);let s=function(e,t){if(!e.is("documentFragment")&&!e.is("element"))return null;if(e.is("element","table"))return e;if(1==e.childCount&&e.getChild(0).is("element","table"))return e.getChild(0);const i=t.createRangeIn(e);for(const n of i.getItems())if(n.is("element","table")){var o=t.createRange(i.start,t.createPositionBefore(n));if(t.hasContent(o,{ignoreWhitespaces:!0}))return null;o=t.createRange(t.createPositionAfter(n),i.end);return t.hasContent(o,{ignoreWhitespaces:!0})?null:n}return null}(t,o);if(s){const l=gw(o.document.selection);l.length?(e.stop(),o.change(t=>{var e={width:a.getColumns(s),height:a.getRows(s)}
5,i=function(e,t,i,o){const n=e[0].findAncestor("table"),r=fw(e),s=mw(e),a={firstColumn:r.first,lastColumn:r.last,firstRow:s.first,lastRow:s.last},l=1===e.length;l&&(a.lastRow+=t.height-1,a.lastColumn+=t.width-1,function(e,t,i,o){var n=o.getColumns(e),r=o.getRows(e);n<i&&o.insertColumns(e,{at:n,columns:i-n});r<t&&o.insertRows(e,{at:r,rows:t-r})}(n,a.lastRow+1,a.lastColumn+1,o));l||!pw(e,o)?function(e,t,i){var{firstRow:o,lastRow:n,firstColumn:r,lastColumn:s}=t,a={first:o,last:n},t={first:r,last:s};dv(e,r,a,i),dv(e,s+1,a,i),cv(e,o,t,i),cv(e,n+1,t,i,o)}(n,a,i):(a.lastRow=Vw(n,a),a.lastColumn=Mw(n,a));return a}(l,e,t,a),o=i.lastRow-i.firstRow+1,n=i.lastColumn-i.firstColumn+1,n={startRow:0,startColumn:0,endRow:Math.min(o,e.height)-1,endColumn:Math.min(n,e.width)-1};s=Cw(s,n,t);n=l[0].findAncestor("table");const r=this._replaceSelectedCellsWithPasted(s,e,n,i,t);this.editor.plugins.get("TableSelection").isEnabled?(i=bw(r.map(e=>t.createRangeOn(e))),t.setSelection(i)):t.setSelection(r[0],0)})):Ow(s,a)}}}_replaceSelectedCellsWithPasted(e,t,i,o,n){var{width:r,height:s}=t,a=function(e,t,i){const o=new Array(i).fill(null).map(()=>new Array(t).fill(null));for(var{column:n,row:r,cell:s}of new Xk(e))o[r][n]=s;return o}(e,r,s);const l=[];let c;for(const p of[...new Xk(i,{startRow:o.firstRow,endRow:o.lastRow,startColumn:o.firstColumn,endColumn:o.lastColumn,includeAllSlots:!0})]){var{row:d,column:h}=p;h===o.firstColumn&&(c=p.getPositionBefore());var u=d-o.firstRow,g=h-o.firstColumn,g=a[u%s][g%r],g=g?n.cloneElement(g):null,g=this._replaceTableSlotCell(p,g,c,n);g&&(Sw(g,d,h,o.lastRow,o.lastColumn,n),l.push(g),c=n.createPositionAfter(g))}var m=parseInt(i.getAttribute("headingRows")||0),f=parseInt(i.getAttribute("headingColumns")||0),t=o.firstRow<m&&m<=o.lastRow,e=o.firstColumn<f&&f<=o.lastColumn;return t&&(m=cv(i,m,{first:o.firstColumn,last:o.lastColumn},n,o.firstRow),l.push(...m)),e&&(f=dv(i,f,{first:o.firstRow,last:o.lastRow},n),l.push(...f)),l}_replaceTableSlotCell(e,t,i,o){var{cell:n,isAnchor:e}=e;return e&&o.remove(n),t?(o.insert(t,i),t):null}}function cv(e,t,i,o,n=0){if(!(t<1)){const r=Aw(e,t,n),s=r.filter(({column:e,cellWidth:t})=>hv(e,t,i));return s.map(({cell:e})=>Tw(e,t,o))}}function dv(e,i,o,n){if(!(i<1)){const t=Ew(e,i),r=t.filter(({row:e,cellHeight:t})=>hv(e,t,o));return r.map(({cell:e,column:t})=>Pw(e,t,i,n))}}function hv(e,t,i){var{first:o,last:i}=i;return o<=e&&e<=i||e<o&&o<=e+t-1}class uv extends Ac{static get pluginName(){return"TableKeyboard"}static get requires(){return[av]}init(){var e=this.editor.editing.view.document;this.editor.keystrokes.set("Tab",(...e)=>this._handleTabOnSelectedTable(...e),{priority:"low"}),this.editor.keystrokes.set("Tab",this._getTabHandler(!0),{priority:"low"}),this.editor.keystrokes.set("Shift+Tab",this._getTabHandler(!1),{priority:"low"}),this.listenTo(e,"arrowKey",(...e)=>this._onArrowKey(...e),{context:"table"})}_handleTabOnSelectedTable(e,t){const i=this.editor,o=i.model.document.selection,n=o.getSelectedElement();n&&n.is("element","table")&&(t(),i.model.change(e=>{e.setSelection(e.createRangeIn(n.getChild(0).getChild(0)))}))}_getTabHandler(u){const g=this.editor;return(e,t)=>{let i=uw(g.model.document.selection)[0];if(i=i||this.editor.plugins.get("TableSelection").getFocusCell(),i){t();const a=i.parent,l=a.parent;var o=l.getChildIndex(a),n=a.getChildIndex(i),r=0===n;if(u||!r||0!==o){const c=this.editor.plugins.get("TableUtils");var s=n===a.childCount-1,t=o===c.getRows(l)-1;if(u&&t&&s&&(g.execute("insertTableRowBelow"),o===c.getRows(l)-1))g.model.change(e=>{e.setSelection(e.createRangeOn(l))});else{let t;if(u&&s){const d=l.getChild(o+1);t=d.getChild(0)}else if(!u&&r){const h=l.getChild(o-1);t=h.getChild(h.childCount-1)}else t=a.getChild(n+(u?1:-1));g.model.change(e=>{e.setSelection(e.createRangeIn(t))})}}else g.model.change(e=>{e.setSelection(e.createRangeOn(l))})}}}_onArrowKey(e,t){var i=this.editor,i=en(t.keyCode,i.locale.contentLanguageDirection);this._handleArrowKeys(i,t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),e.stop())}_handleArrowKeys(t,i){const e=this.editor.model.document.selection;var o=["right","down"].includes(t),n=hw(e);if(n.length){let e;return e=i?this.editor.plugins.get("TableSelection").getFocusCell():o?n[n.length-1]:n[0],this._navigateFromCellInDirection(e,t,i),!0}
5n=e.focus.findAncestor("tableCell");return!!n&&(!(i&&!e.isCollapsed&&e.isBackward==o)&&(!!this._isSelectionAtCellEdge(e,n,o)&&(this._navigateFromCellInDirection(n,t,i),!0)))}_isSelectionAtCellEdge(e,t,i){const o=this.editor.model,n=this.editor.model.schema,r=i?e.getLastPosition():e.getFirstPosition();if(!n.getLimitElement(r).is("element","tableCell")){const s=o.createPositionAt(t,i?"end":0);return s.isTouching(r)}t=o.createSelection(r);return o.modifySelection(t,{direction:i?"forward":"backward"}),r.isEqual(t.focus)}_navigateFromCellInDirection(t,e,i=!1){const o=this.editor.model,n=t.findAncestor("table"),r=[...new Xk(n,{includeAllSlots:!0})];var{row:s,column:a}=r[r.length-1],l=r.find(({cell:e})=>e==t);let{row:c,column:d}=l;switch(e){case"left":d--;break;case"up":c--;break;case"right":d+=l.cellWidth;break;case"down":c+=l.cellHeight}var h=c<0||c>s,u=d<0&&c<=0,s=d>a&&c>=s;if(h||u||s)o.change(e=>{e.setSelection(e.createRangeOn(n))});else{d<0?(d=i?0:a,c--):d>a&&(d=i?a:0,c++);a=r.find(e=>e.row==c&&e.column==d).cell,e=["right","down"].includes(e);const g=this.editor.plugins.get("TableSelection");if(i&&g.isEnabled){i=g.getAnchorCell()||t;g.setCellSelection(i,a)}else{const m=o.createPositionAt(a,e?0:"end");o.change(e=>{e.setSelection(m)})}}}}class gv extends kr{constructor(e){super(e),this.domEventType=["mousemove","mouseleave"]}onDomEvent(e){this.fire(e.type,e)}}class mv extends Ac{static get pluginName(){return"TableMouse"}static get requires(){return[av]}init(){const e=this.editor;e.editing.view.addObserver(gv),this._enableShiftClickSelection(),this._enableMouseDragSelection()}_enableShiftClickSelection(){const n=this.editor;let r=!1;const s=n.plugins.get(av);this.listenTo(n.editing.view.document,"mousedown",(e,t)=>{var i,o;this.isEnabled&&s.isEnabled&&t.domEvent.shiftKey&&(!(i=s.getAnchorCell()||uw(n.model.document.selection)[0])||(o=this._getModelTableCellFromDomEvent(t))&&fv(i,o)&&(r=!0,s.setCellSelection(i,o),t.preventDefault()))}),this.listenTo(n.editing.view.document,"mouseup",()=>{r=!1}),this.listenTo(n.editing.view.document,"selectionChange",e=>{r&&e.stop()},{priority:"highest"})}_enableMouseDragSelection(){const e=this.editor;let o,n,r=!1,s=!1;const a=e.plugins.get(av);this.listenTo(e.editing.view.document,"mousedown",(e,t)=>{this.isEnabled&&a.isEnabled&&(t.domEvent.shiftKey||t.domEvent.ctrlKey||t.domEvent.altKey||(o=this._getModelTableCellFromDomEvent(t)))}),this.listenTo(e.editing.view.document,"mousemove",(e,t)=>{var i;t.domEvent.buttons&&o&&((i=this._getModelTableCellFromDomEvent(t))&&fv(o,i)&&(n=i,r||n==o||(r=!0)),r&&(s=!0,a.setCellSelection(o,n),t.preventDefault()))}),this.listenTo(e.editing.view.document,"mouseup",()=>{r=!1,s=!1,o=null,n=null}),this.listenTo(e.editing.view.document,"selectionChange",e=>{s&&e.stop()},{priority:"highest"})}_getModelTableCellFromDomEvent(e){e=e.target,e=this.editor.editing.view.createPositionAt(e,0);const t=this.editor.editing.mapper.toModelPosition(e).parent;return t.findAncestor("tableCell",{includeSelf:!0})}}function fv(e,t){return e.parent.parent==t.parent.parent}i(115);class pv extends Ac{static get requires(){return[iv,sv,av,mv,uv,lv,Xh]}static get pluginName(){return"Table"}}function bv(e){e=e.getSelectedElement();return e&&wv(e)?e:null}function kv(e){let t=e.getFirstPosition().parent;for(;t;){if(t.is("element")&&wv(t))return t;t=t.parent}return null}function wv(e){return e.getCustomProperty("table")&&Sh(e)}class vv extends Ac{static get requires(){return[Dm]}static get pluginName(){return"TableToolbar"}afterInit(){const e=this.editor,t=e.t,i=e.plugins.get(Dm);var o=e.config.get("table.contentToolbar"),n=e.config.get("table.tableToolbar");o&&i.register("tableContent",{ariaLabel:t("Table toolbar"),items:o,getRelatedElement:kv}),n&&i.register("table",{ariaLabel:t("Table toolbar"),items:n,getRelatedElement:bv})}}function _v(e,t){const{viewElement:i,defaultValue:o,modelAttribute:n,styleName:r,reduceBoxSides:s=!1}=t;e.for("upcast").attributeToAttribute({view:{name:i,styles:{[r]:/[\s\S]+/}},model:{key:n,value:e=>{e=e.getNormalizedStyle(r),e=s?Av(e):e;if(o!==e)return e}}})}function yv(e,t,r){e.for("upcast").add(e=>e.on("element:"+t,(e,t,i)=>{var o,n;t.modelRange&&(!(o=["border-top-width","border-top-color","border-top-style","border-bottom-width","border-bottom-color","border-bottom-style","border-right-width","border-right-color","border-right-style","border-left-width","border-left-color","border-left-style"].filter(e=>t.viewItem.hasStyle(e))).length||i.consumable.test(t.viewItem,n={styles:o})&&(o=[...t.modelRange.getItems({shallow:!0})].pop(),i.consumable.consume(t.viewItem,n),(n={style:Av((n={style:t.viewItem.getNormalizedStyle("border-style"),color:t.viewItem.getNormalizedStyle("border-color"),width:t.viewItem.getNormalizedStyle("border-width")}).style),color:Av(n.color),width:Av(n.width)}).style!==r.style&&i.writer.setAttribute("borderStyle",n.style,o),n.color!==r.color&&i.writer.setAttribute("borderColor",n.color,o),n.width!==r.width&&i.writer.setAttribute("borderWidth",n.width,o)))}))}function xv(e,{modelElement:t,modelAttribute:i,styleName:o}){e.for("downcast").attributeToAttribute({model:{name:t,key:i},view:e=>({key:"style",value:{[o]:e}})})}function Cv(e,{modelAttribute:t,styleName:a}){e.for("downcast").add(e=>e.on(`attribute:${t}:table`,(e,t,i)=>{var{item:o,attributeNewValue:n}=t;const{mapper:r,writer:s}=i;i.consumable.consume(t.item,e.name)&&(o=[...r.toViewElement(o).getChildren()].find(e=>e.is("element","table")),n?s.setStyle(a,n,o):s.removeStyle(a,o))}))}function Av(t){if(t)return["top","right","bottom","left"].map(e=>t[e]).reduce((e,t)=>
5e==t?e:null)||t}class Tv extends Ec{constructor(e,t,i){super(e),this.attributeName=t,this._defaultValue=i}refresh(){const e=this.editor.model.document.selection;var t=e.getFirstPosition().findAncestor("table");this.isEnabled=!!t,this.value=this._getValue(t)}execute(e={}){const t=this.editor.model,i=t.document.selection;var{value:o,batch:e}=e;const n=i.getFirstPosition().findAncestor("table"),r=this._getValueToSet(o);t.enqueueChange(e||"default",e=>{r?e.setAttribute(this.attributeName,r,n):e.removeAttribute(this.attributeName,n)})}_getValue(e){if(e){e=e.getAttribute(this.attributeName);if(e!==this._defaultValue)return e}}_getValueToSet(e){if(e!==this._defaultValue)return e}}class Ev extends Tv{constructor(e,t){super(e,"backgroundColor",t)}}function Pv(e){if(!e||!V(e))return e;var{top:t,right:i,bottom:o,left:e}=e;return t==i&&i==o&&o==e?t:void 0}function Sv(e,t){var i=parseFloat(e);return Number.isNaN(i)||String(i)!==String(e)?e:`${i}${t}`}function Iv(e,t={}){const i=Object.assign({borderStyle:"none",borderWidth:"",borderColor:"",backgroundColor:"",width:"",height:""},e);return t.includeAlignmentProperty&&!i.alignment&&(i.alignment="center"),t.includePaddingProperty&&!i.padding&&(i.padding=""),t.includeVerticalAlignmentProperty&&!i.verticalAlignment&&(i.verticalAlignment="middle"),t.includeHorizontalAlignmentProperty&&!i.horizontalAlignment&&(i.horizontalAlignment=t.isRightToLeftContent?"right":"left"),i}class Rv extends Tv{constructor(e,t){super(e,"borderColor",t)}_getValue(e){if(e){e=Pv(e.getAttribute(this.attributeName));if(e!==this._defaultValue)return e}}}class Ov extends Tv{constructor(e,t){super(e,"borderStyle",t)}_getValue(e){if(e){e=Pv(e.getAttribute(this.attributeName));if(e!==this._defaultValue)return e}}}class Vv extends Tv{constructor(e,t){super(e,"borderWidth",t)}_getValue(e){if(e){e=Pv(e.getAttribute(this.attributeName));if(e!==this._defaultValue)return e}}_getValueToSet(e){if((e=Sv(e,"px"))!==this._defaultValue)return e}}class Mv extends Tv{constructor(e,t){super(e,"width",t)}_getValueToSet(e){if((e=Sv(e,"px"))!==this._defaultValue)return e}}class Nv extends Tv{constructor(e,t){super(e,"height",t)}_getValueToSet(e){return(e=Sv(e,"px"))===this._defaultValue?null:e}}class zv extends Tv{constructor(e,t){super(e,"alignment",t)}}const Bv=/^(left|center|right)$/,Fv=/^(left|none|right)$/;class Dv extends Ac{static get pluginName(){return"TablePropertiesEditing"}static get requires(){return[iv]}init(){const e=this.editor;var t=e.model.schema,i=e.conversion;e.config.define("table.tableProperties.defaultProperties",{});var o,n,r,s=Iv(e.config.get("table.tableProperties.defaultProperties"),{includeAlignmentProperty:!0});e.data.addStyleProcessorRules(Gd),n=i,r={color:s.borderColor,style:s.borderStyle,width:s.borderWidth},t.extend("table",{allowAttributes:["borderWidth","borderColor","borderStyle"]}),yv(n,"table",r),Cv(n,{modelAttribute:"borderColor",styleName:"border-color"}),Cv(n,{modelAttribute:"borderStyle",styleName:"border-style"}),Cv(n,{modelAttribute:"borderWidth",styleName:"border-width"}),e.commands.add("tableBorderColor",new Rv(e,s.borderColor)),e.commands.add("tableBorderStyle",new Ov(e,s.borderStyle)),e.commands.add("tableBorderWidth",new Vv(e,s.borderWidth)),r=i,o=s.alignment,t.extend("table",{allowAttributes:["alignment"]}),r.for("downcast").attributeToAttribute({model:{name:"table",key:"alignment"},view:e=>({key:"style",value:{float:"center"===e?"none":e}}),converterPriority:"high"}),r.for("upcast").attributeToAttribute({view:{name:/^(table|figure)$/,styles:{float:Fv}},model:{key:"alignment",value:e=>{let t=e.getStyle("float");return"none"===t&&(t="center"),t===o?null:t}}}).attributeToAttribute({view:{attributes:{align:Bv}},model:{name:"table",key:"alignment",value:e=>{e=e.getAttribute("align");return e===o?null:e}}}),e.commands.add("tableAlignment",new zv(e,s.alignment)),Lv(t,i,{modelAttribute:"width",styleName:"width",defaultValue:s.width}),e.commands.add("tableWidth",new Mv(e,s.width)),Lv(t,i,{modelAttribute:"height",styleName:"height",defaultValue:s.height}),e.commands.add("tableHeight",new Nv(e,s.height)),e.data.addStyleProcessorRules(Ud),n=i,r={modelAttribute:"backgroundColor",styleName:"background-color",defaultValue:s.backgroundColor},i=r.modelAttribute,t.extend("table",{allowAttributes:[i]}),_v(n,{viewElement:"table",...r}
5),Cv(n,r),e.commands.add("tableBackgroundColor",new Ev(e,s.backgroundColor))}}function Lv(e,t,i){var o=i["modelAttribute"];e.extend("table",{allowAttributes:[o]}),_v(t,{viewElement:/^(table|figure)$/,...i}),xv(t,{modelElement:"table",...i})}i(117);class Hv extends Jl{constructor(e,t){super(e);const i=this.bindTemplate;this.set("value",""),this.set("id"),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("isFocused",!1),this.set("isEmpty",!0),this.set("ariaDescribedById"),this.options=t,this._dropdownView=this._createDropdownView(),this._inputView=this._createInputTextView(),this._stillTyping=!1,this.setTemplate({tag:"div",attributes:{class:["ck","ck-input-color",i.if("hasError","ck-error")],id:i.to("id"),"aria-invalid":i.if("hasError",!0),"aria-describedby":i.to("ariaDescribedById")},children:[this._dropdownView,this._inputView]}),this.on("change:value",(e,t,i)=>this._setInputValue(i))}focus(){this._inputView.focus()}_createDropdownView(){var e=this.locale;const t=e.t,i=this.bindTemplate;var o=this._createColorGrid(e);const n=vc(e),r=new Jl;var s=this._createRemoveColorButton();return r.setTemplate({tag:"span",attributes:{class:["ck","ck-input-color__button__preview"],style:{backgroundColor:i.to("value")}},children:[{tag:"span",attributes:{class:["ck","ck-input-color__button__preview__no-color-indicator",i.if("value","ck-hidden",e=>""!=e)]}}]}),n.buttonView.extendTemplate({attributes:{class:"ck-input-color__button"}}),n.buttonView.children.add(r),n.buttonView.tooltip=t("Color picker"),n.panelPosition="rtl"===e.uiLanguageDirection?"se":"sw",n.panelView.children.add(s),n.panelView.children.add(o),n.bind("isEnabled").to(this,"isReadOnly",e=>!e),n}_createInputTextView(){var e=this.locale;const i=new Qc(e);return i.extendTemplate({on:{blur:i.bindTemplate.to("blur")}}),i.value=this.value,i.bind("isReadOnly","hasError").to(this),this.bind("isFocused","isEmpty").to(i),i.on("input",()=>{const t=i.element.value;var e=this.options.colorDefinitions.find(e=>t===e.label);this._stillTyping=!0,this.value=e&&e.color||t}),i.on("blur",()=>{this._stillTyping=!1,this._setInputValue(i.element.value)}),i.delegate("input").to(this),i}_createRemoveColorButton(){var e=this.locale;const t=e.t,i=new uc(e),o=this.options.defaultColorValue||"";e=o?t("Restore default"):t("Remove color");return i.class="ck-input-color__remove-color",i.withText=!0,i.icon=Vc.eraser,i.label=e,i.on("execute",()=>{this.value=o,this._dropdownView.isOpen=!1,this.fire("input")}),i}_createColorGrid(e){const t=new Gc(e,{colorDefinitions:this.options.colorDefinitions,columns:this.options.columns});return t.on("execute",(e,t)=>{this.value=t.value,this._dropdownView.isOpen=!1,this.fire("input")}),t.bind("selectedColor").to(this,"value"),t}_setInputValue(e){if(!this._stillTyping){const i=jv(e);var t=this.options.colorDefinitions.find(e=>i===jv(e.color));this._inputView.value=t?t.label:e||""}}}function jv(e){return e.replace(/([(,])\s+/g,"$1").replace(/^\s+|\s+(?=[),\s]|$)/g,"").replace(/,|\s/g," ")}const Wv=e=>""===e;function $v(e){return{none:e("None"),solid:e("Solid"),dotted:e("Dotted"),dashed:e("Dashed"),double:e("Double"),groove:e("Groove"),ridge:e("Ridge"),inset:e("Inset"),outset:e("Outset")}}function qv(e){return e('The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".')}function Uv(e){return e('The value is invalid. Try "10px" or "2em" or simply "2".')}function Kv(e){return e=e.trim(),Wv(e)||Od(e)}function Gv(e){return e=e.trim(),Wv(e)||e_(e)||Nd(e)||Bd(e)}function Jv(e){return e=e.trim(),Wv(e)||e_(e)||Nd(e)}function Yv(e,t){const i=new Jt;var o=$v(e.t);for(const n in o){const r={type:"button",model:new id({_borderStyleValue:n,label:o[n],withText:!0})};"none"===n?r.model.bind("isOn").to(e,"borderStyle",e=>"none"===t?!e:e===n):r.model.bind("isOn").to(e,"borderStyle",e=>e===n),i.add(r)}return i}function Xv(e){const{view:t,icons:i,toolbar:o,labels:n,propertyName:r,nameToValue:s,defaultValue:a}=e;for(const l in n){const c=new uc(t.locale);c.set({label:n[l],icon:i[l],tooltip:n[l]});const d=s?s(l):l;c.bind("isOn").to(t,r,e=>{let t=e;return""===e&&a&&(t=a),d===t}),c.on("execute",()=>{t[r]=d}),o.items.add(c)}}const Qv=[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}];function Zv(n){return(e,t,i)=>{const o=new Hv(e.locale,{colorDefinitions:n.colorConfig.map(e=>({color:e.model,label:e.label,options:{hasBorder:e.hasBorder}})),columns:n.columns,defaultColorValue:n.defaultColorValue});return o.set({id:t,ariaDescribedById:i}),o.bind("isReadOnly").to(e,"isEnabled",e=>!e),o.bind("hasError").to(e,"errorText",e=>!!e),o.on("input",()=>{e.errorText=null}),e.bind("isEmpty","isFocused").to(o),o}}function e_(e){var t=parseFloat(e);return!Number.isNaN(t)&&e===String(t)}i(119);class t_ extends Jl{constructor(e,t={}){super(e);const i=this.bindTemplate;this.set("class",t.class||null),this.children=this.createCollection(),t.children&&t.children.forEac
5h(e=>this.children.add(e)),this.set("_role",null),this.set("_ariaLabelledBy",null),t.labelView&&this.set({_role:"group",_ariaLabelledBy:t.labelView.id}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__row",i.to("class")],role:i.to("_role"),"aria-labelledby":i.to("_ariaLabelledBy")},children:this.children})}}i(15),i(16),i(123);const i_={left:Vc.objectLeft,center:Vc.objectCenter,right:Vc.objectRight};class o_ extends Jl{constructor(e,t){super(e),this.set({borderStyle:"",borderWidth:"",borderColor:"",backgroundColor:"",width:"",height:"",alignment:""}),this.options=t;var{borderStyleDropdown:i,borderWidthInput:o,borderColorInput:n,borderRowLabel:r}=this._createBorderFields(),{backgroundRowLabel:s,backgroundInput:a}=this._createBackgroundFields(),{widthInput:l,operatorLabel:c,heightInput:d,dimensionsLabel:h}=this._createDimensionFields(),{alignmentToolbar:u,alignmentLabel:g}=this._createAlignmentFields();this.focusTracker=new Xr,this.keystrokes=new Qr,this.children=this.createCollection(),this.borderStyleDropdown=i,this.borderWidthInput=o,this.borderColorInput=n,this.backgroundInput=a,this.widthInput=l,this.heightInput=d,this.alignmentToolbar=u;var{saveButtonView:m,cancelButtonView:t}=this._createActionButtons();this.saveButtonView=m,this.cancelButtonView=t,this._focusables=new Rl,this._focusCycler=new ec({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.children.add(new Xc(e,{label:this.t("Table properties")})),this.children.add(new t_(e,{labelView:r,children:[r,i,n,o],class:"ck-table-form__border-row"})),this.children.add(new t_(e,{labelView:s,children:[s,a],class:"ck-table-form__background-row"})),this.children.add(new t_(e,{children:[new t_(e,{labelView:h,children:[h,l,c,d],class:"ck-table-form__dimensions-row"}),new t_(e,{labelView:g,children:[g,u],class:"ck-table-properties-form__alignment-row"})]})),this.children.add(new t_(e,{children:[this.saveButtonView,this.cancelButtonView],class:"ck-table-form__action-row"})),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-table-form","ck-table-properties-form"],tabindex:"-1"},children:this.children})}render(){super.render(),Wc({view:this}),[this.borderStyleDropdown,this.borderColorInput,this.borderWidthInput,this.backgroundInput,this.widthInput,this.heightInput,this.alignmentToolbar,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createBorderFields(){var e=this.options.defaultTableProperties;const n={style:e.borderStyle,width:e.borderWidth,color:e.borderColor};var t=Zv({colorConfig:this.options.borderColors,columns:5,defaultColorValue:n.color}),e=this.locale;const i=this.t,o=new Yc(e);o.text=i("Border");const r=$v(this.t),s=new Zc(e,td);s.set({label:i("Style"),class:"ck-table-form__border-style"}),s.fieldView.buttonView.set({isOn:!1,withText:!0,tooltip:i("Style")}),s.fieldView.buttonView.bind("label").to(this,"borderStyle",e=>r[e||"none"]),s.fieldView.on("execute",e=>{this.borderStyle=e.source._borderStyleValue}),s.bind("isEmpty").to(this,"borderStyle",e=>!e),yc(s.fieldView,Yv(this,n.style));const a=new Zc(e,ed);a.set({label:i("Width"),class:"ck-table-form__border-width"}),a.fieldView.bind("value").to(this,"borderWidth"),a.bind("isEnabled").to(this,"borderStyle",n_),a.fieldView.on("input",()=>{this.borderWidth=a.fieldView.element.value});const l=new Zc(e,t);return l.set({label:i("Color"),class:"ck-table-form__border-color"}),l.fieldView.bind("value").to(this,"borderColor"),l.bind("isEnabled").to(this,"borderStyle",n_),l.fieldView.on("input",()=>{this.borderColor=l.fieldView.value}),this.on("change:borderStyle",(e,t,i,o)=>{n_(i)||(this.borderColor="",this.borderWidth=""),n_(o)||(this.borderColor=n.color,this.borderWidth=n.width)}),{borderRowLabel:o,borderStyleDropdown:s,borderColorInput:l,borderWidthInput:a}}_createBackgroundFields(){var e=this.locale;const t=this.t,i=new Yc(e);i.text=t("Background");var o=Zv({colorConfig:this.options.backgroundColors,columns:5,defaultColorValue:this.options.defaultTableProperties.backgroundColor});const n=new Zc(e,o);return n.set({label:t("Color"),class:"ck-table-properties-form__background"}),n.fieldView.bind("value").to(this,"backgroundColor"),n.fieldView.on("input",()=>{this.backgroundColor=n.fieldView.value}),{backgroundRowLabel:i,backgroundInput:n}}_createDimensionFields(){var e=this.locale;const t=this.t,i=new Yc(e);i.text=t("Dimensions");const o=new Zc(e,ed);o.set({label:t("Width"),class:"ck-table-form__dimensions-row__width"}),o.fieldView.bind("value").to(this,"width"),o.fieldView.on("input",()=>{this.width=o.fieldView.element.value});const n=new Jl(e);n.setTemplate({tag:"span",attributes:{class:["ck-table-form__dimension-operator"]},children:[{text:"×"}]});const r=new Zc(e,ed);return r.set({label:t("Height"),class:"ck-table-form__dimensions-row__height"}),r.fieldView.bind("value").to(this,"height"),r.fieldView.on("input",()=>{this.height=r.fieldView.element.value}),{dimensionsLabel:i,widthInput:o,operatorLabel:n,heightInput:r}}_createAlignmentFields(){var e=this.locale;const t=this.t,i=new Yc(e);i.text=t("Alignment");const o=new zc(e);return o.set({isCompact:!0,ariaLabel:t("Table alignment toolbar")}),Xv({view:this,icons:i_,toolbar:o,labels:this._alignmentLabels,propertyName:"alignment",defaultValue:this.options.defaultTableProperties.alignment}),{alignmentLabel:i,alignmentToolbar:o}}_createActionButtons(){var e=this.locale;const t=this.t,i=new uc(e),o=new uc(e);e=[this.borderWidthInput,this.borderColorInput,this.backgroundInput,this.widthInput,this.heightInput];return i.set({label:t("Save"),icon:Vc.check,class:"ck-button-save",type:"submit",withText:!0}),i.bind("isEnabled").toMany(e,"errorText",(...e)=>e.every(e=>!e)),o.set({label:t("Cancel"),icon:Vc.cancel,class:"ck-button-cancel",type:"cancel",withText:!0}),o.delegate("execute").to(this,"cancel"),{saveButtonView:i,cancelButtonView:o}}get _alignmentLabels(){var e=this.locale;const t=this.t;var i=t("Align table to the left"),o=t("Center table"),n=t("Align table to the right");
5return"rtl"===e.uiLanguageDirection?{right:n,center:o,left:i}:{left:i,center:o,right:n}}}function n_(e){return"none"!==e}S=rd.defaultPositions;const r_=[S.northArrowSouth,S.northArrowSouthWest,S.northArrowSouthEast,S.southArrowNorth,S.southArrowNorthWest,S.southArrowNorthEast],s_=[...r_,zh];function a_(t,i){const o=t.plugins.get("ContextualBalloon");if(kv(t.editing.view.document.selection)){let e;e=("cell"===i?c_:l_)(t),o.updatePosition(e)}}function l_(e){const t=e.model.document.selection.getFirstPosition();var i=t.findAncestor("table"),i=e.editing.mapper.toViewElement(i);return{target:e.editing.view.domConverter.viewToDom(i),positions:s_}}function c_(e){const t=e.editing.mapper,i=e.editing.view.domConverter,o=e.model.document.selection;if(1<o.rangeCount)return{target:()=>function(e,t){const i=t.editing.mapper,o=t.editing.view.domConverter,n=Array.from(e).map(e=>{e=d_(e.start),e=i.toViewElement(e);return new Wr(o.viewToDom(e))});return Wr.getBoundingRect(n)}(o.getRanges(),e),positions:r_};var n=d_(o.getFirstPosition()),n=t.toViewElement(n);return{target:i.viewToDom(n),positions:r_}}function d_(e){return e.nodeAfter&&e.nodeAfter.is("element","tableCell")?e.nodeAfter:e.findAncestor("tableCell")}const h_={borderStyle:"tableBorderStyle",borderColor:"tableBorderColor",borderWidth:"tableBorderWidth",backgroundColor:"tableBackgroundColor",width:"tableWidth",height:"tableHeight",alignment:"tableAlignment"};class u_ extends Ac{static get requires(){return[dd]}static get pluginName(){return"TablePropertiesUI"}constructor(e){super(e),e.config.define("table.tableProperties",{borderColors:Qv,backgroundColors:Qv})}init(){const i=this.editor,o=i.t;this._defaultTableProperties=Iv(i.config.get("table.tableProperties.defaultProperties"),{includeAlignmentProperty:!0}),this._balloon=i.plugins.get(dd),this.view=this._createPropertiesView(),this._undoStepBatch=null,i.ui.componentFactory.add("tableProperties",e=>{const t=new uc(e);t.set({label:o("Table properties"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8 2v5h4V2h1v5h5v1h-5v4h.021l-.172.351-1.916.28-.151.027c-.287.063-.54.182-.755.341L8 13v5H7v-5H2v-1h5V8H2V7h5V2h1zm4 6H8v4h4V8z" opacity=".6"/><path d="m15.5 11.5 1.323 2.68 2.957.43-2.14 2.085.505 2.946L15.5 18.25l-2.645 1.39.505-2.945-2.14-2.086 2.957-.43L15.5 11.5zM17 1a2 2 0 0 1 2 2v9.475l-.85-.124-.857-1.736a2.048 2.048 0 0 0-.292-.44L17 3H3v14h7.808l.402.392L10.935 19H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h14z"/></svg>',tooltip:!0}),this.listenTo(t,"execute",()=>this._showView());e=Object.values(h_).map(e=>i.commands.get(e));return t.bind("isEnabled").toMany(e,"isEnabled",(...e)=>e.some(e=>e)),t})}destroy(){super.destroy(),this.view.destroy()}_createPropertiesView(){const e=this.editor;var t=e.config.get("table.tableProperties"),i=qc(t.borderColors),i=$c(e.locale,i),t=qc(t.backgroundColors),t=$c(e.locale,t);const o=new o_(e.locale,{borderColors:i,backgroundColors:t,defaultTableProperties:this._defaultTableProperties});i=e.t;o.render(),this.listenTo(o,"submit",()=>{this._hideView()}),this.listenTo(o,"cancel",()=>{this._undoStepBatch.operations.length&&e.execute("undo",this._und
5oStepBatch),this._hideView()}),o.keystrokes.set("Esc",(e,t)=>{this._hideView(),t()}),wc({emitter:o,activator:()=>this._isViewInBalloon,contextElements:[this._balloon.view.element],callback:()=>this._hideView()});t=qv(i),i=Uv(i);return o.on("change:borderStyle",this._getPropertyChangeCallback("tableBorderStyle",this._defaultTableProperties.borderStyle)),o.on("change:borderColor",this._getValidatedPropertyChangeCallback({viewField:o.borderColorInput,commandName:"tableBorderColor",errorText:t,validator:Kv,defaultValue:this._defaultTableProperties.borderColor})),o.on("change:borderWidth",this._getValidatedPropertyChangeCallback({viewField:o.borderWidthInput,commandName:"tableBorderWidth",errorText:i,validator:Jv,defaultValue:this._defaultTableProperties.borderWidth})),o.on("change:backgroundColor",this._getValidatedPropertyChangeCallback({viewField:o.backgroundInput,commandName:"tableBackgroundColor",errorText:t,validator:Kv,defaultValue:this._defaultTableProperties.backgroundColor})),o.on("change:width",this._getValidatedPropertyChangeCallback({viewField:o.widthInput,commandName:"tableWidth",errorText:i,validator:Gv,defaultValue:this._defaultTableProperties.width})),o.on("change:height",this._getValidatedPropertyChangeCallback({viewField:o.heightInput,commandName:"tableHeight",errorText:i,validator:Gv,defaultValue:this._defaultTableProperties.height})),o.on("change:alignment",this._getPropertyChangeCallback("tableAlignment",this._defaultTableProperties.alignment)),o}_fillViewFormFromCommandValues(){const o=this.editor.commands,i=o.get("tableBorderStyle");Object.entries(h_).map(([e,t])=>{var i=this._defaultTableProperties[e]||"";return[e,o.get(t).value||i]}).forEach(([e,t])=>{("borderColor"!==e&&"borderWidth"!==e||"none"!==i.value)&&this.view.set(e,t)})}_showView(){const e=this.editor;this.listenTo(e.ui,"update",()=>{this._updateView()}),this._fillViewFormFromCommandValues(),this._balloon.add({view:this.view,position:l_(e)}),this._undoStepBatch=e.model.createBatch(),this.view.focus()}_hideView(){var e=this.editor;this.stopListening(e.ui,"update"),this.view.saveButtonView.focus(),this._balloon.remove(this.view),this.editor.editing.view.focus()}_updateView(){var e=this.editor;kv(e.editing.view.document.selection)?this._isViewVisible&&a_(e,"table"):this._hideView()}get _isViewVisible(){return this._balloon.visibleView===this.view}get _isViewInBalloon(){return this._balloon.hasView(this.view)}_getPropertyChangeCallback(n,r){return(e,t,i,o)=>{!o&&r===i||this.editor.execute(n,{value:i,batch:this._undoStepBatch})}}_getValidatedPropertyChangeCallback(e){const{commandName:n,viewField:r,validator:s,errorText:t,defaultValue:a}=e,l=Or(()=>{r.errorText=t},500);return(e,t,i,o)=>{l.cancel(),!o&&a===i||(s(i)?(this.editor.execute(n,{value:i,batch:this._undoStepBatch}),r.errorText=null):l())}}}class g_ extends Ac{static get pluginName(){return"TableProperties"}static get requires(){return[Dv,u_]}}i(125);const m_={left:Vc.alignLeft,center:Vc.alignCenter,right:Vc.alignRight,justify:Vc.alignJustify,top:Vc.alignTop,middle:Vc.alignMiddle,bottom:Vc.alignBottom};class f_ extends Jl{constructor(e,t){super(e),this.set({borderStyle:"",borderWidth:"",borderColor:"",padding:"",backgroundColor:"",width:"",height:"",horizontalAlignment:"",verticalAlignment:""}),this.options=t;var{borderStyleDropdown:i,borderWidthInput:o,borderColorInput:n,borderRowLabel:r}=this._createBorderFields(),{backgroundRowLabel:s,backgroundInput:a}=this._createBackgroundFields(),{widthInput:l,operatorLabel:c,heightInput:d,dimensionsLabel:h}=this._createDimensionFields(),{horizontalAlignmentToolbar:u,verticalAlignmentToolbar:g,alignmentLabel:m}=this._createAlignmentFields();this.focusTracker=new Xr,this.keystrokes=new Qr,this.children=this.createCollection(),this.borderStyleDropdown=i,this.borderWidthInput=o,this.borderColorInput=n,this.backgroundInput=a,this.paddingInput=this._createPaddingField(),this.widthInput=l,this.heightInput=d,this.horizontalAlignmentToolbar=u,this.verticalAlignmentToolbar=g;var{saveButtonView:f,cancelButtonView:t}=this._createActionButtons();this.saveButtonView=f,this.cancelButtonView=t,this._focusables=new Rl,this._focusCycler=new ec({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.children.add(new Xc(e,{label:this.t("Cell properties")})),this.children.add(new t_(e,{labelView:r,children:[r,i,n,o],class:"ck-table-form__border-row"})),this.children.add(new t_(e,{labelView:s,children:[s,a],class:"ck-table-form__background-row"})),this.children.add(new t_(e,{children:[new t_(e,{labelView:h,children:[h,l,c,d],class:"ck-table-form__dimensions-row"}),new t_(e,{children:[this.paddingInput],class:"ck-table-cell-properties-form__padding-row"})]})),this.children.add(new t_(e,{labelView:m,children:[m,u,g],class:"ck-table-cell-properties-form__alignment-row"})),this.children.add(new t_(e,{children:[this.saveButtonView,this.cancelButtonView],class:"ck-table-form__action-row"})),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-table-form","ck-table-cell-properties-form"],tabindex:"-1"},children:this.children})}render(){super.render(),Wc({view:this}),[this.borderStyleDropdown,this.borderColorInput,this.borderWidthInput,this.backgroundInput,this.widthInput,this.heightInput,this.paddingInput,this.horizontalAlignmentToolbar,this.verticalAlignmentToolbar,this.saveButtonView,this.cancelButtonView].forEac
5h(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createBorderFields(){var e=this.options.defaultTableCellProperties;const n={style:e.borderStyle,width:e.borderWidth,color:e.borderColor};var t=Zv({colorConfig:this.options.borderColors,columns:5,defaultColorValue:n.color}),e=this.locale;const i=this.t,o=new Yc(e);o.text=i("Border");const r=$v(i),s=new Zc(e,td);s.set({label:i("Style"),class:"ck-table-form__border-style"}),s.fieldView.buttonView.set({isOn:!1,withText:!0,tooltip:i("Style")}),s.fieldView.buttonView.bind("label").to(this,"borderStyle",e=>r[e||"none"]),s.fieldView.on("execute",e=>{this.borderStyle=e.source._borderStyleValue}),s.bind("isEmpty").to(this,"borderStyle",e=>!e),yc(s.fieldView,Yv(this,n.style));const a=new Zc(e,ed);a.set({label:i("Width"),class:"ck-table-form__border-width"}),a.fieldView.bind("value").to(this,"borderWidth"),a.bind("isEnabled").to(this,"borderStyle",p_),a.fieldView.on("input",()=>{this.borderWidth=a.fieldView.element.value});const l=new Zc(e,t);return l.set({label:i("Color"),class:"ck-table-form__border-color"}),l.fieldView.bind("value").to(this,"borderColor"),l.bind("isEnabled").to(this,"borderStyle",p_),l.fieldView.on("input",()=>{this.borderColor=l.fieldView.value}),this.on("change:borderStyle",(e,t,i,o)=>{p_(i)||(this.borderColor="",this.borderWidth=""),p_(o)||(this.borderColor=n.color,this.borderWidth=n.width)}),{borderRowLabel:o,borderStyleDropdown:s,borderColorInput:l,borderWidthInput:a}}_createBackgroundFields(){var e=this.locale;const t=this.t,i=new Yc(e);i.text=t("Background");var o=Zv({colorConfig:this.options.backgroundColors,columns:5,defaultColorValue:this.options.defaultTableCellProperties.backgroundColor});const n=new Zc(e,o);return n.set({label:t("Color"),class:"ck-table-cell-properties-form__background"}),n.fieldView.bind("value").to(this,"backgroundColor"),n.fieldView.on("input",()=>{this.backgroundColor=n.fieldView.value}),{backgroundRowLabel:i,backgroundInput:n}}_createDimensionFields(){var e=this.locale;const t=this.t,i=new Yc(e);i.text=t("Dimensions");const o=new Zc(e,ed);o.set({label:t("Width"),class:"ck-table-form__dimensions-row__width"}),o.fieldView.bind("value").to(this,"width"),o.fieldView.on("input",()=>{this.width=o.fieldView.element.value});const n=new Jl(e);n.setTemplate({tag:"span",attributes:{class:["ck-table-form__dimension-operator"]},children:[{text:"×"}]});const r=new Zc(e,ed);return r.set({label:t("Height"),class:"ck-table-form__dimensions-row__height"}),r.fieldView.bind("value").to(this,"height"),r.fieldView.on("input",()=>{this.height=r.fieldView.element.value}),{dimensionsLabel:i,widthInput:o,operatorLabel:n,heightInput:r}}_createPaddingField(){var e=this.locale;const t=this.t,i=new Zc(e,ed);return i.set({label:t("Padding"),class:"ck-table-cell-properties-form__padding"}),i.fieldView.bind("value").to(this,"padding"),i.fieldView.on("input",()=>{this.padding=i.fieldView.element.value}),i}_createAlignmentFields(){var e=this.locale;const t=this.t,i=new Yc(e);i.text=t("Table cell text alignment");const o=new zc(e),n="rtl"===this.locale.contentLanguageDirection;o.set({isCompact:!0,ariaLabel:t("Horizontal text alignment toolbar")}),Xv({view:this,icons:m_,toolbar:o,labels:this._horizontalAlignmentLabels,propertyName:"horizontalAlignment",nameToValue:e=>{if(n){if("left"===e)return"right";if("right"===e)return"left"}return e},defaultValue:this.options.defaultTableCellProperties.horizontalAlignment});const r=new zc(e);return r.set({isCompact:!0,ariaLabel:t("Vertical text alignment toolbar")}),Xv({view:this,icons:m_,toolbar:r,labels:this._verticalAlignmentLabels,propertyName:"verticalAlignment",defaultValue:this.options.defaultTableCellProperties.verticalAlignment}),{horizontalAlignmentToolbar:o,verticalAlignmentToolbar:r,alignmentLabel:i}}_createActionButtons(){var e=this.locale;const t=this.t,i=new uc(e),o=new uc(e);e=[this.borderWidthInput,this.borderColorInput,this.backgroundInput,this.paddingInput];return i.set({label:t("Save"),icon:Vc.check,class:"ck-button-save",type:"submit",withText:!0}),i.bind("isEnabled").toMany(e,"errorText",(...e)=>e.every(e=>!e)),o.set({label:t("Cancel"),icon:Vc.cancel,class:"ck-button-cancel",type:"cancel",withText:!0}),o.delegate("execute").to(this,"cancel"),{saveButtonView:i,cancelButtonView:o}}get _horizontalAlignmentLabels(){var e=this.locale;const t=this.t;var i=t("Align cell text to the left"),o=t("Align cell text to the center"),n=t("Align cell text to the right"),r=t("Justify cell text");
5return"rtl"===e.uiLanguageDirection?{right:n,center:o,left:i,justify:r}:{left:i,center:o,right:n,justify:r}}get _verticalAlignmentLabels(){const e=this.t;return{top:e("Align cell text to the top"),middle:e("Align cell text to the middle"),bottom:e("Align cell text to the bottom")}}}function p_(e){return"none"!==e}const b_={borderStyle:"tableCellBorderStyle",borderColor:"tableCellBorderColor",borderWidth:"tableCellBorderWidth",width:"tableCellWidth",height:"tableCellHeight",padding:"tableCellPadding",backgroundColor:"tableCellBackgroundColor",horizontalAlignment:"tableCellHorizontalAlignment",verticalAlignment:"tableCellVerticalAlignment"};class k_ extends Ac{static get requires(){return[dd]}static get pluginName(){return"TableCellPropertiesUI"}constructor(e){super(e),e.config.define("table.tableCellProperties",{borderColors:Qv,backgroundColors:Qv})}init(){const i=this.editor,o=i.t;this._defaultTableCellProperties=Iv(i.config.get("table.tableCellProperties.defaultProperties"),{includeVerticalAlignmentProperty:!0,includeHorizontalAlignmentProperty:!0,includePaddingProperty:!0,isRightToLeftContent:"rtl"===i.locale.contentLanguageDirection}),this._balloon=i.plugins.get(dd),this.view=this._createPropertiesView(),this._undoStepBatch=null,i.ui.componentFactory.add("tableCellProperties",e=>{const t=new uc(e);t.set({label:o("Cell properties"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.105 18-.17 1H2.5A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1h15A1.5 1.5 0 0 1 19 2.5v9.975l-.85-.124-.15-.302V8h-5v4h.021l-.172.351-1.916.28-.151.027c-.287.063-.54.182-.755.341L8 13v5h3.105zM2 12h5V8H2v4zm10-4H8v4h4V8zM2 2v5h5V2H2zm0 16h5v-5H2v5zM13 7h5V2h-5v5zM8 2v5h4V2H8z" opacity=".6"/><path d="m15.5 11.5 1.323 2.68 2.957.43-2.14 2.085.505 2.946L15.5 18.25l-2.645 1.39.505-2.945-2.14-2.086 2.957-.43L15.5 11.5zM13 6a1 1 0 0 1 1 1v3.172a2.047 2.047 0 0 0-.293.443l-.858 1.736-1.916.28-.151.027A1.976 1.976 0 0 0 9.315 14H7a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm-1 2H8v4h4V8z"/></svg>',tooltip:!0}),this.listenTo(t,"execute",()=>this._showView());e=Object.values(b_).map(e=>i.commands.get(e));return t.bind("isEnabled").toMany(e,"isEnabled",(...e)=>e.some(e=>e)),t})}destroy(){super.destroy(),this.view.destroy()}_createPropertiesView(){const e=this.editor,t=e.editing.view.document;var i=e.config.get("table.tableCellProperties"),o=qc(i.borderColors),o=$c(e.locale,o),i=qc(i.backgroundColors),i=$c(e.locale,i);const n=new f_(e.locale,{borderColors:o,backgroundColors:i,defaultTableCellProperties:this._defaultTableCellProperties});o=e.t;n.render(),this.listenTo(n,"submit",()=>{this._hideView()}),this.listenTo(n,"cancel",()=>{this._undoStepBatch.operations.length&&e.execute("undo",this._und
5oStepBatch),this._hideView()}),n.keystrokes.set("Esc",(e,t)=>{this._hideView(),t()}),this.listenTo(e.ui,"update",()=>{kv(t.selection)?this._isViewVisible&&a_(e,"cell"):this._hideView()}),wc({emitter:n,activator:()=>this._isViewInBalloon,contextElements:[this._balloon.view.element],callback:()=>this._hideView()});i=qv(o),o=Uv(o);return n.on("change:borderStyle",this._getPropertyChangeCallback("tableCellBorderStyle",this._defaultTableCellProperties.borderStyle)),n.on("change:borderColor",this._getValidatedPropertyChangeCallback({viewField:n.borderColorInput,commandName:"tableCellBorderColor",errorText:i,validator:Kv,defaultValue:this._defaultTableCellProperties.borderColor})),n.on("change:borderWidth",this._getValidatedPropertyChangeCallback({viewField:n.borderWidthInput,commandName:"tableCellBorderWidth",errorText:o,validator:Jv,defaultValue:this._defaultTableCellProperties.borderWidth})),n.on("change:padding",this._getValidatedPropertyChangeCallback({viewField:n.paddingInput,commandName:"tableCellPadding",errorText:o,validator:Gv,defaultValue:this._defaultTableCellProperties.padding})),n.on("change:width",this._getValidatedPropertyChangeCallback({viewField:n.widthInput,commandName:"tableCellWidth",errorText:o,validator:Gv,defaultValue:this._defaultTableCellProperties.width})),n.on("change:height",this._getValidatedPropertyChangeCallback({viewField:n.heightInput,commandName:"tableCellHeight",errorText:o,validator:Gv,defaultValue:this._defaultTableCellProperties.height})),n.on("change:backgroundColor",this._getValidatedPropertyChangeCallback({viewField:n.backgroundInput,commandName:"tableCellBackgroun
5dColor",errorText:i,validator:Kv,defaultValue:this._defaultTableCellProperties.backgroundColor})),n.on("change:horizontalAlignment",this._getPropertyChangeCallback("tableCellHorizontalAlignment",this._defaultTableCellProperties.horizontalAlignment)),n.on("change:verticalAlignment",this._getPropertyChangeCallback("tableCellVerticalAlignment",this._defaultTableCellProperties.verticalAlignment)),n}_fillViewFormFromCommandValues(){const o=this.editor.commands,i=o.get("tableCellBorderStyle");Object.entries(b_).map(([e,t])=>{var i=this._defaultTableCellProperties[e]||"";return[e,o.get(t).value||i]}).forEach(([e,t])=>{("borderColor"!==e&&"borderWidth"!==e||"none"!==i.value)&&this.view.set(e,t)})}_showView(){const e=this.editor;this._fillViewFormFromCommandValues(),this._balloon.add({view:this.view,position:c_(e)}),this._undoStepBatch=e.model.createBatch(),this.view.focus()}_hideView(){var e;this._isViewInBalloon&&(e=this.editor,this.stopListening(e.ui,"update"),this.view.saveButtonView.focus(),this._balloon.remove(this.view),this.editor.editing.view.focus())}get _isViewVisible(){return this._balloon.visibleView===this.view}get _isViewInBalloon(){return this._balloon.hasView(this.view)}_getPropertyChangeCallback(n,r){return(e,t,i,o)=>{!o&&r===i||this.editor.execute(n,{value:i,batch:this._undoStepBatch})}}_getValidatedPropertyChangeCallback(e){const{commandName:n,viewField:r,validator:s,errorText:t,defaultValue:a}=e,l=Or(()=>{r.errorText=t},500);return(e,t,i,o)=>{l.cancel(),!o&&a===i||(s(i)?(this.editor.execute(n,{value:i,batch:this._undoStepBatch}),r.errorText=null):l())}}}class w_ extends Ec{constructor(e,t,i){super(e),this.attributeName=t,this._defaultValue=i}refresh(){var e=gw(this.editor.model.document.selection);this.isEnabled=!!e.length,this.value=this._getSingleValue(e)}execute(e={}){var{value:t,batch:e}=e;const i=this.editor.model,o=gw(i.document.selection),n=this._getValueToSet(t);i.enqueueChange(e||"default",t=>{n?o.forEach(e=>t.setAttribute(this.attributeName,n,e)):o.forEach(e=>t.removeAttribute(this.attributeName,e))})}_getAttribute(e){if(e){e=e.getAttribute(this.attributeName);if(e!==this._defaultValue)return e}}_getValueToSet(e){if(e!==this._defaultValue)return e}_getSingleValue(e){const t=this._getAttribute(e[0]);return e.every(e=>this._getAttribute(e)===t)?t:void 0}}class v_ extends w_{constructor(e,t){super(e,"padding",t)}_getAttribute(e){if(e){e=Pv(e.getAttribute(this.attributeName));if(e!==this._defaultValue)return e}}_getValueToSet(e){if((e=Sv(e,"px"))!==this._defaultValue)return e}}class __ extends w_{constructor(e,t){super(e,"width",t)}_getValueToSet(e){if((e=Sv(e,"px"))!==this._defaultValue)return e}}class y_ extends w_{constructor(e,t){super(e,"height",t)}_getValueToSet(e){return(e=Sv(e,"px"))===this._defaultValue?null:e}}class x_ extends w_{constructor(e,t){super(e,"backgroundColor",t)}}class C_ extends w_{constructor(e,t){super(e,"verticalAlignment",t)}}class A_ extends w_{constructor(e,t){super(e,"horizontalAlignment",t)}}class T_ extends w_{constructor(e,t){super(e,"borderStyle",t)}_getAttribute(e){if(e){e=Pv(e.getAttribute(this.attributeName));if(e!==this._defaultValue)return e}}}class E_ extends w_{constructor(e,t){super(e,"borderColor",t)}_getAttribute(e){if(e){e=Pv(e.getAttribute(this.attributeName));if(e!==this._defaultValue)return e}}}class P_ extends w_{constructor(e,t){super(e,"borderWidth",t)}_getAttribute(e){if(e){e=Pv(e.getAttribute(this.attributeName));if(e!==this._defaultValue)return e}}_getValueToSet(e){if((e=Sv(e,"px"))!==this._defaultValue)return e}}const S_=/^(top|middle|bottom)$/,I_=/^(left|center|right|justify)$/;class R_ extends Ac{static get pluginName(){return"TableCellPropertiesEditing"}static get requires(){return[iv]}init(){const e=this.editor;var t=e.model.schema,i=e.conversion;e.config.define("table.tableCellProperties.defaultProperties",{});var o,n,r,s,a=Iv(e.config.get("table.tableCellProperties.defaultProperties"),{includeVerticalAlignmentProperty:!0,includeHorizontalAlignmentProperty:!0,includePaddingProperty:!0,isRightToLeftContent:"rtl"===e.locale.contentLanguageDirection});e.data.addStyleProcessorRules(Gd),n=i,o={color:a.borderColor,style:a.borderStyle,width:a.borderWidth},t.extend("tableCell",{allowAttributes:["borderWidth","borderColor","borderStyle"]}),yv(n,"td",o),yv(n,"th",o),xv(n,{modelElement:"tableCell",modelAttribute:"borderStyle",styleName:"border-style"}),xv(n,{modelElement:"tableCell",modelAttribute:"borderColor",styleName:"border-color"}),xv(n,{modelElement:"tableCell",modelAttribute:"borderWidth",styleName:"border-width"}),e.commands.add("tableCellBorderStyle",new T_(e,a.borderStyle)),e.commands.add("tableCellBorderColor",new E_(e,a.borderColor)),e.commands.add("tableCellBorderWidth",new P_(e,a.borderWidth)),n=i,r=a.horizontalAlignment,t.extend("tableCell",{allowAttributes:["horizontalAlignment"]}),n.for("downcast").attributeToAttribute({model:{name:"tableCell",key:"horizontalAlignment"},view:e=>({key:"style",value:{"text-align":e}})}),n.for("upcast").attributeToAttribute({view:{name:/^(td|th)$/,styles:{"text-align":I_}},model:{key:"horizontalAlignment",value:e=>{e=e.getStyle("text-align");return e===r?null:e}}}).attributeToAttribute({view:{name:/^(td|th)$/,attributes:{align:I_}},model:{key:"horizontalAlignment",value:e=>{e=e.getAttribute("align");return e===r?null:e}}}),e.commands.add("tableCellHorizontalAlignment",new A_(e,a.horizontalAlignment)),O_(t,i,{modelAttribute:"width",styleName:"width",defaultValue:a.width}),e.commands.add("tableCellWidth",new __(e,a.width)),O_(t,i,{modelAttribute:"height",styleName:"height",defaultValue:a.height}),e.commands.add("tableCellHeight",new y_(e,a.height)),e.data.addStyleProcessorRules(rh),O_(t,i,{modelAttribute:"padding",styleName:"padding",reduceBoxSides:!0,defaultValue:a.padding}),e.commands.add("tableCellPadding",new v_(e,a.padding)),e.data.addStyleProcessorRules(Ud),O_(t,i,{modelAttribute:"backgroundColor",styleName:"background-color",defaultValue:a.backgroundColor}
5),e.commands.add("tableCellBackgroundColor",new x_(e,a.backgroundColor)),i=i,s=a.verticalAlignment,t.extend("tableCell",{allowAttributes:["verticalAlignment"]}),i.for("downcast").attributeToAttribute({model:{name:"tableCell",key:"verticalAlignment"},view:e=>({key:"style",value:{"vertical-align":e}})}),i.for("upcast").attributeToAttribute({view:{name:/^(td|th)$/,styles:{"vertical-align":S_}},model:{key:"verticalAlignment",value:e=>{e=e.getStyle("vertical-align");return e===s?null:e}}}).attributeToAttribute({view:{name:/^(td|th)$/,attributes:{valign:S_}},model:{key:"verticalAlignment",value:e=>{e=e.getAttribute("valign");return e===s?null:e}}}),e.commands.add("tableCellVerticalAlignment",new C_(e,a.verticalAlignment))}}function O_(e,t,i){var o=i["modelAttribute"];e.extend("tableCell",{allowAttributes:[o]}),_v(t,{viewElement:/^(td|th)$/,...i}),xv(t,{modelElement:"tableCell",...i})}class V_ extends Ac{static get pluginName(){return"TableCellProperties"}static get requires(){return[R_,k_]}}class M_ extends Ac{init(){const i=this.editor;i.ui.componentFactory.add("ascInsertImage",e=>{const t=new uc(e);return t.set({label:"Insert image",icon:Rc,tooltip:!0}),t.on("execute",()=>{barNewDialog({source:"/elearning/?cmd=ImageBrowser",postData:{src:""},returnFunc:t=>{i.model.change(e=>{i.execute("insertImage",{source:t.src})})}})}),t}),i.ui.componentFactory.add("ascInsertObject",e=>{const t=new uc(e);return t.set({label:"Insert object",icon:Cc,tooltip:!0}),t.on("execute",()=>{i.fire("ascInsertObject",{editor:i,selection:i.model.document.selection})}),t})}}class N_ extends Ac{init(){const u=this.editor;u.ui.componentFactory.add("ascInsertMath",e=>{const t=new uc(e);return t.set({label:"undefined"!=typeof ls?ls(11718):"Insert math expression",icon:'<?xml version="1.0"?><svg fill="#000000" xmlns="http://www.w3.org/2000/svg"  viewBox="0 0 50 50" width="50px" height="50px">    <path d="M 28.25 3 C 24.304 3 21.52675 5.9357969 19.59375 9.0917969 C 17.896791 11.861754 16.704915 14.88138 15.779297 18 L 10 18 L 9 20 L 15.220703 20 C 14.711601 21.964316 14.283698 23.954055 13.900391 25.939453 C 13.182391 29.659453 12.573781 33.404891 11.675781 37.087891 C 11.053781 39.639891 10.248875 44.928312 7.171875 45.820312 C 5.462875 46.316313 4.3498125 45.367391 4.7578125 44.650391 C 5.4158125 44.264391 5.8757031 43.591828 5.9707031 42.798828 C 6.0027031 42.683828 6.021 42.578 6 42.5 C 6 41.119 4.881 40 3.5 40 C 2.12 40 1 41.119 1 42.5 C 1 42.5 0.89 47 5.75 47 C 12.284 47 15.248687 39.8
500719 16.804688 34.511719 C 18.202108 29.761066 18.926354 24.844521 19.953125 20 L 26 20 L 27 18 L 20.398438 18 C 20.941859 15.687351 21.582505 13.394929 22.433594 11.175781 C 23.196594 9.1857812 24.518078 4.8506875 26.830078 4.1796875 C 28.539078 3.6836875 29.652141 4.6335625 29.244141 5.3515625 C 28.582141 5.7395625 28.120297 6.4177969 28.029297 7.2167969 C 27.997297 7.3257969 27.981 7.427 28 7.5 C 28 8.881 29.119 10 30.5 10 C 31.881 10 33 8.881 33 7.5 C 33 7.5 33.11 3 28.25 3 z M 34.544922 18 C 31.631922 18 29.386 21.310234 28 24.490234 L 29.994141 24.789062 C 30.682141 22.929063 31.811578 21 33.267578 21 C 34.843578 21 35.361703 22.410938 35.720703 24.210938 L 36.480469 28 L 36.470703 28 C 36.500555 28.130265 36.5773 28.461596 36.611328 28.609375 L 31.328125 34.515625 C 30.974125 34.198625 30.512 34 30 34 C 28.895 34 28 34.895 28 36 C 28 37.105 28.895 38 30 38 C 30.617 38 31.162297 37.715391 31.529297 37.275391 L 31.535156 37.28125 L 37.162109 30.992188 C 37.291838 31.551135 37.346266 31.786186 37.509766 32.490234 C 38.239766 35.590234 39.279453 38 42.439453 38 C 45.359453 38 47.61 34.689766 49 31.509766 L 47 31.210938 C 46.31 33.070937 45.180703 35 43.720703 35 C 42.140703 35 41.619766 33.589063 41.259766 31.789062 L 40.5 28 C 40.471428 27.874755 40.397691 27.555478 40.365234 27.414062 L 45.669922 21.484375 C 46.023922 21.801375 46.487 22 47 22 C 48.105 22 49 21.105 49 20 C 49 18.895 48.105 18 47 18 C 46.399 18 45.867 18.270453 45.5 18.689453 L 45.492188 18.683594 L 39.814453 25.03125 C 39.6834 24.465779 39.628588 24.224739 39.462891 23.509766 C 38.734891 20.409766 37.696922 18 34.544922 18 z"/></svg>',tooltip:!0}),t.on("execute",()=>{var e="";const r=u.model.document.selection.getFirstPosition();var t,i=u.model.createPositionAt(r.root.getChild(0),0),o=u.model.createPositionAt(r.root,"end"),i=new ys(i,r),o=new ys(r,o),i=u.model.getSelectedContent(new Ps([i])),o=u.model.getSelectedContent(new Ps([o])),i=this.getElemTextContent(i),o=this.getElemTextContent(o),o=KatexUtils.splitWithDelimiters(i+o,[{left:"$$$",right:"$$$",display:!0,modeType:"graph"},{left:"$$",right:"$$",display:!0},{left:"$",right:"$",display:!1}]),n=i.length,s="",a=-1,l=-1,c="$";for(t of o){var d=t.rawData||t.data;if(s.length+d.length>=n){"math"==t.type&&(e=t.data,a=s.length,l=s.length+d.length,c=t.display?"$$":"$");break}s+=d}var h=null;0<=a&&(i=this.getPathForOffset(a,r.root,u.model),o=this.getPathForOffset(l,r.root,u.model),i&&o&&(h=u.model.createRange(i,o))),h&&u.model.change(e=>{e.setSelection(e.createSelection(h))}),barNewReactSourceDlg("/elearning/pics/jsw/MathEditor.js","MathEditor",{value:e,moreOpts:{inline:"$$"!=c},doneFunc:(n,e)=>{n&&(e&&!0===e.inline&&(c="$"),e&&!1===e.inline&&(c="$$"),u.model.change(e=>{var t,i,o=null;0<=a&&(t=this.getPathForOffset(a,r.root,e),i=this.getPathForOffset(l,r.root,e),t&&i&&(o=u.model.createRange(t,i))),o?(e.setSelection(e.createSelection(o)),u.execute("input",{text:c+n+c})):u.execute("input",{text:" "+c+n+c+" "})}))}})}),t})}getPathForOffset(e,t,i){var o=0,n=null;for(n of t.getChildren()){var r=this.getElemTextContent(n);if(o+r.length>e)return n.is("$text")?i.createPositionAt(n.parent,e-o):this.getPathForOffset(e-o,n,i);o+=r.length}return i.createPositionAt(t,"end")}getElemTextContent(e){var t,i="";if(e.is("$text"))return e.data;for(t of e.getChildren())i+=this.getElemTextContent(t);return i}}class z_ extends Ac{init(){const e=this.editor;e.ui.componentFactory.add("ascCustomizeTheme",e=>{const t=new uc(e);return t.set({label:"undefined"!=typeof ls?ls(7069).ucfirst():"Customize appearance",icon:'<?xml version="1.0"?><svg xmlns="http://www.w3.org/2000/svg"  viewBox="0 0 30 30" width="30px" height="30px">    <path d="M15,3C8.373,3,3,8.373,3,15c0,6.627,5.373,12,12,12h1c1.657,0,3-1.343,3-3c0,0,0-2.262,0-3c0-1.105,0.895-2,2-2 c0.738,0,4,0,4,0c1.105,0,2-0.895,2-2c0,0,0-1.375,0-2C27,8.373,21.627,3,15,3z M15,5c1.105,0,2,0.895,2,2c0,1.105-0.895,2-2,2 s-2-0.895-2-2C13,5.895,13.895,5,15,5z M7,17c-1.105,0-2-0.895-2-2c0-1.105,0.895-2,2-2s2,0.895,2,2C9,16.105,8.105,17,7,17z M14.5,25c-1.381,0-2.5-1.119-2.5-2.5c0-1.381,1.119-2.5,2.5-2.5s2.5,1.119,2.5,2.5C17,23.881,15.881,25,14.5,25z M23,17 c-1.105,0-2-0.895-2-2c0-1.105,0.895-2,2-2s2,0.895,2,2C25,16.105,24.105,17,23,17z M22.071,10.757 c-0.781,0.781-2.047,0.781-2.828,0c-0.781-0.781-0.781-2.047,0-2.828c0.781-0.781,2.047-0.781,2.828,0 C22.852,8.71,22.852,9.976,22.071,10.757z M7.929,10.757c-0.781-0.781-0.781-2.047,0-2.828c0.781-0.781,2.047-0.781,2.828,0 s0.781,2.047,0,2.828C9.976,11.538,8.71,11.538,7.929,10.757z"/></svg>',tooltip:!0}),t.on("execute",e=>{$(window).trigger("ckeditorCustomizeThemeClicked",[e])}),t})}}class B_ extends Ac{init(){const i=this.editor,s=i.model,t=s.schema,e=i.conversion,a=["paragraph","heading1","heading2","heading3","heading4","heading5","heading6","listItem","blockQuote","codeBlock","pre"];
5a.forEach(e=>{t.isRegistered(e)&&t.extend(e,{allowAttributes:["dataEid"]})}),e.for("upcast").attributeToAttribute({view:"data-eid",model:"dataEid"}),e.for("downcast").attributeToAttribute({model:"dataEid",view:"data-eid"}),s.document.registerPostFixer(t=>{let i=!1,o={};for(const e of s.document.roots)if(!1!==e._isAttached){var n=e.rootName&&"qw"==e.rootName.substring(0,2)?e.rootName.split("_")[0]:"x";for(const r of e.getChildren())if(a.includes(r.name)){let e=r.getAttribute("dataEid");e&&!o[n+"::"+e]||(e=F_(),t.setAttribute("dataEid",e,r),i=!0),o[n+"::"+e]=!0}}return i}),this.listenTo(i.plugins.get("ClipboardPipeline"),"contentInsertion",(e,t)=>{i.model.change(e=>{D_(Array.from(t.content.getChildren()),e,a)})})}}function F_(){if("undefined"!=typeof window&&window.ETestUtils&&window.ETestUtils.getRandomStr)return ETestUtils.getRandomStr(10);for(var e="abcdefghijklmnopqrstuvwxyz01234567890",t="",i=0;i<10;i++)t+=e.charAt(Math.round(Math.random()*e.length)%e.length);return t}function D_(e,t,i){for(const o of e)i.includes(o.name)&&t.setAttribute("dataId",F_(),o),o.is("element")&&0<o.childCount&&D_(Array.from(o.getChildren()),t,i)}class L_ extends Hc{}class H_ extends ch{}H_.MultirootEditor=L_,H_.builtinPlugins=L_.builtinPlugins=[$u,pv,vv,g_,V_,eg,kg,Mg,xg,Eg,Fg,qg,Yg,_m,tm,sm,hm,pm,Pm,Fm,mf,_f,Mf,Nf,$f,M_,N_,z_,Tp,$k,eb,Om,ru,fb,Ab,Ib,vb,B_],H_.defaultConfig=L_.defaultConfig={toolbar:{items:["heading","|","fontsize","|","bold","italic","underline","strikethrough","code","removeFormat","|","highlight","textColor","|","subscript","superscript","|","alignment","|","numberedList","bulletedList","|","link","blockquote","codeBlock","insertTable"]},image:{toolbar:["imageStyle:inline","imageStyle:wrapText","imageStyle:breakText","|","imageTextAlternative","|","resizeImage:50","resizeImage:75","resizeImage:original"],resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]},language:"en",table:{contentToolbar:["tableColumn","tableRow","mergeTableCells"]}
5,fontBackgroundColor:{colors:[{color:"#fdfd77",label:"fdfd77"},{color:"#63f963",label:"63f963"},{color:"#fc7999",label:"fc7999"},{color:"#72cdfd",label:"72cdfd"},{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}]},fontColor:{colors:[{color:"#D32F2F",type:"marker"},{color:"#F44336",type:"marker"},{color:"#E57373",type:"marker"},{color:"#AD1457",type:"marker"},{color:"#E91E63",type:"marker"},{color:"#F06292",type:"marker"},{color:"#6A1B9A",type:"marker"},{color:"#9C27B0",type:"marker"},{color:"#BA68C8",type:"marker"},{color:"#4527A0",type:"marker"},{color:"#673AB7",type:"marker"},{color:"#9575CD",type:"marker"},{color:"#283593",type:"marker"},{color:"#3F51B5",type:"marker"},{color:"#7986CB",type:"marker"},{color:"#1565C0",type:"marker"},{color:"#1E88E5",type:"marker"},{color:"#64B5F6",type:"marker"},{color:"#0091EA",type:"marker"},{color:"#0288D1",type:"marker"},{color:"#4FC3F7",type:"marker"},{color:"#00838F",type:"marker"},{color:"#00ACC1",type:"marker"},{color:"#4DD0E1",type:"marker"},{color:"#00695C",type:"marker"},{color:"#009688",type:"marker"},{color:"#4DB6AC",type:"marker"},{color:"#2E7D32",type:"marker"},{color:"#4CAF50",type:"marker"},{color:"#81C784",type:"marker"},{color:"#558B2F",type:"marker"},{color:"#8BC34A",type:"marker"},{color:"#AED581",type:"marker"},{color:"#F9A825",type:"marker"},{color:"#FFEB3B",type:"marker"},{color:"#FFF176",type:"marker"},{color:"#D84315",type:"marker"},{color:"#FF5722",type:"marker"},{color:"#FF8A65",type:"marker"},{color:"#4E342E",type:"marker"},{color:"#795548",type:"marker"},{color:"#A1887F",type:"marker"},{color:"#37474F",type:"marker"},{color:"#607D8B",type:"marker"},{color:"#90A4AE",type:"marker"},{color:"#424242",type:"marker"},{color:"#9E9E9E",type:"marker"},{color:"#E0E0E0",type:"marker"},{color:"#FFFFFF",type:"marker"},{color:"#000000",type:"marker"}]}},H_.build=L_.build={plugins:[$u,pv,vv,g_,V_,eg,kg,Mg,xg,Eg,Fg,qg,Yg,_m,tm,hm,pm,sm,Pm,Fm,mf,_f,Mf,Nf,$f,M_,Tp,$k,eb,Om,ru,fb,Ab,Ib,vb,B_],config:{toolbar:{items:["heading","|","fontsize","|","bold","italic","underline","strikethrough","code","fontcolor","fontbackgroundcolor","|","alignment","|","numberedList","bulletedList","|","link","blockquote","codeBlock","subscript","superscript"]},image:{styles:["full","alignLeft","alignRight"],toolbar:["imageStyle:alignLeft","imageStyle:full","imageStyle:alignRight","|","imageTextAlternative","|","resizeImage:50","resizeImage:75","resizeImage:original"],resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]},language:"en",table:{contentToolbar:["tableColumn","tableRow","mergeTableCells"]}}}}],o={},n.m=i,n.c=o,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=18).default;function n(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};
5return i[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}var i,o});
6//# sourceMappingURL=ckeditor.multiroot.es6.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.