{"version":3,"file":"ckeditor.js","sources":["webpack://ClassicEditor/ckeditor.js"],"sourcesContent":["/*!\n * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n(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 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\",\"Bulleted List\":\"Bulleted List\",Cancel:\"Cancel\",\"Cannot upload file:\":\"Cannot upload file:\",\"Cell properties\":\"Cell properties\",\"Center table\":\"Center table\",\"Centered image\":\"Centered image\",\"Change image text alternative\":\"Change image text alternative\",\"Characters: %0\":\"Characters: %0\",\"Choose heading\":\"Choose heading\",Color:\"Color\",\"Color picker\":\"Color picker\",Column:\"Column\",\"Could not insert image at the current position.\":\"Could not insert image at the current position.\",\"Could not obtain resized image URL.\":\"Could not obtain resized image URL.\",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 link\":\"Edit link\",\"Editor toolbar\":\"Editor toolbar\",\"Enter image caption\":\"Enter image caption\",\"Font Background Color\":\"Font Background Color\",\"Font Color\":\"Font Color\",\"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 line\":\"Horizontal line\",\"Horizontal text alignment toolbar\":\"Horizontal text alignment toolbar\",Huge:\"Huge\",\"Image resize list\":\"Image resize list\",\"Image toolbar\":\"Image toolbar\",\"image widget\":\"image widget\",\"Increase indent\":\"Increase indent\",\"Insert column left\":\"Insert column left\",\"Insert column right\":\"Insert column right\",\"Insert image\":\"Insert image\",\"Insert image or file\":\"Insert image or file\",\"Insert media\":\"Insert media\",\"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\",\"Inserting image failed\":\"Inserting image failed\",Inset:\"Inset\",Italic:\"Italic\",\"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\",\"Media URL\":\"Media URL\",\"media widget\":\"media widget\",\"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\",\"Paste the media URL in the input.\":\"Paste the media URL in the input.\",\"Pink marker\":\"Pink marker\",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\",\"Rich Text Editor\":\"Rich Text Editor\",\"Rich Text Editor, %0\":\"Rich Text Editor, %0\",Ridge:\"Ridge\",\"Right aligned image\":\"Right aligned image\",Row:\"Row\",Save:\"Save\",\"Select all\":\"Select all\",\"Select column\":\"Select column\",\"Select row\":\"Select row\",\"Selecting resized image failed\":\"Selecting resized image failed\",\"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\",Style:\"Style\",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 alternative\":\"Text alternative\",\"Text highlight toolbar\":\"Text highlight toolbar\",'The color is invalid. Try \"#FF0000\" or \"rgb(255,0,0)\" or \"red\".':'The color is invalid. Try \"#FF0000\" or \"rgb(255,0,0)\" or \"red\".',\"The URL must not be empty.\":\"The URL must not be empty.\",'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\",\"This media URL is not supported.\":\"This media URL is not supported.\",Tiny:\"Tiny\",\"Tip: Paste the URL into the content to embed faster.\":\"Tip: Paste the URL into the content to embed faster.\",Turquoise:\"Turquoise\",Undo:\"Undo\",Unlink:\"Unlink\",\"Upload failed\":\"Upload failed\",\"Upload in progress\":\"Upload in progress\",\"Vertical text alignment toolbar\":\"Vertical text alignment toolbar\",White:\"White\",\"Widget toolbar\":\"Widget toolbar\",Width:\"Width\",\"Words: %0\":\"Words: %0\",Yellow:\"Yellow\",\"Yellow marker\":\"Yellow marker\"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));(function e(t,n){if(typeof exports===\"object\"&&typeof module===\"object\")module.exports=n();else if(typeof define===\"function\"&&define.amd)define([],n);else if(typeof exports===\"object\")exports[\"ClassicEditor\"]=n();else t[\"ClassicEditor\"]=n()})(window,(function(){return function(e){var t={};function n(i){if(t[i]){return t[i].exports}var o=t[i]={i:i,l:false,exports:{}};e[i].call(o.exports,o,o.exports,n);o.l=true;return o.exports}n.m=e;n.c=t;n.d=function(e,t,i){if(!n.o(e,t)){Object.defineProperty(e,t,{enumerable:true,get:i})}};n.r=function(e){if(typeof Symbol!==\"undefined\"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"})}Object.defineProperty(e,\"__esModule\",{value:true})};n.t=function(e,t){if(t&1)e=n(e);if(t&8)return e;if(t&4&&typeof e===\"object\"&&e&&e.__esModule)return e;var i=Object.create(null);n.r(i);Object.defineProperty(i,\"default\",{enumerable:true,value:e});if(t&2&&typeof e!=\"string\")for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i};n.n=function(e){var t=e&&e.__esModule?function t(){return e[\"default\"]}:function t(){return e};n.d(t,\"a\",t);return t};n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};n.p=\"\";return n(n.s=126)}([function(e,t,n){\"use strict\";n.d(t,\"b\",(function(){return o}));n.d(t,\"a\",(function(){return r}));const i=\"https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html\";class o extends Error{constructor(e,t,n){e=r(e);if(n){e+=\" \"+JSON.stringify(n)}super(e);this.name=\"CKEditorError\";this.context=t;this.data=n}is(e){return e===\"CKEditorError\"}static rethrowUnexpectedError(e,t){if(e.is&&e.is(\"CKEditorError\")){throw e}const n=new o(e.message,t);n.stack=e.stack;throw n}}function r(e){const t=e.match(/^([^:]+):/);if(!t){return e}return e+` Read more: ${i}#error-${t[1]}\\n`}},function(e,t,n){\"use strict\";var i=function e(){var t;return function e(){if(typeof t===\"undefined\"){t=Boolean(window&&document&&document.all&&!window.atob)}return t}}();var o=function e(){var t={};return function e(n){if(typeof t[n]===\"undefined\"){var i=document.querySelector(n);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement){try{i=i.contentDocument.head}catch(e){i=null}}t[n]=i}return t[n]}}();var r=[];function s(e){var t=-1;for(var n=0;n:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-editor__editable_inline.ck-blurred ::selection{background:var(--ck-color-editable-blur-selection)}.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,n){var i=n(1);var o=n(22);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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,n){var i=n(1);var o=n(24);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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,n){var i=n(1);var o=n(26);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=\".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);position:absolute}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.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:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}:root{--ck-dropdown-arrow-size:calc(0.5*var(--ck-icon-size))}.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__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,n){var i=n(1);var o=n(28);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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,n){var i=n(1);var o=n(30);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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;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{bottom:calc(-1*var(--ck-tooltip-arrow-size));transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after{top:calc(-1*var(--ck-tooltip-arrow-size));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_n{top:calc(-1*var(--ck-tooltip-arrow-size));transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(-1*var(--ck-tooltip-arrow-size));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)}'},function(e,t,n){var i=n(1);var o=n(32);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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.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{outline:none;border:var(--ck-focus-ring);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(-1*var(--ck-spacing-small));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(-1*var(--ck-spacing-small));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,n){var i=n(1);var o=n(34);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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(0.2*var(--ck-line-height-base)*var(--ck-font-size-base)) calc(0.4*var(--ck-line-height-base)*var(--ck-font-size-base))}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(1.2*var(--ck-line-height-base)*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,n){var i=n(1);var o=n(36);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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) - 2*var(--ck-switch-button-toggle-spacing))}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(2*var(--ck-spacing-large))}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(2*var(--ck-spacing-large))}.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(0.5*var(--ck-border-radius))}.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(-1*var(--ck-switch-button-translation)))}\"},function(e,t,n){var i=n(1);var o=n(38);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=\".ck.ck-toolbar-dropdown .ck.ck-toolbar .ck.ck-toolbar__items{flex-wrap:nowrap}.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,n){var i=n(1);var o=n(40);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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,n){var i=n(1);var o=n(42);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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_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__items>*{margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small);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>*,.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,n){var i=n(1);var o=n(44);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=\".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}\"},function(e,t,n){var i=n(1);var o=n(46);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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,n){var i=n(1);var o=n(48);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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.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)}.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)}.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(-1*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.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(-1*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{left:calc(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{right:calc(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.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(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.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(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.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(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.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(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}'},function(e,t,n){var i=n(1);var o=n(50);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=\".ck .ck-link_selected{background: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,n){var i=n(1);var o=n(52);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=\":root{--ck-toolbar-spinner-size:18px}.ck-exportpdf_status-pending{position:relative}.ck.ck-exportpdf__spinner-container{display:none}.ck.ck-exportpdf__spinner{top:50%;left:0;right:0;margin:0 auto;border-radius:50%;border:2px solid var(--ck-color-text);border-top:2px solid transparent;transform:translateY(-50%);z-index:1}.ck-exportpdf_status-pending .ck.ck-exportpdf__spinner-container,.ck.ck-exportpdf__spinner{position:absolute;width:var(--ck-toolbar-spinner-size);height:var(--ck-toolbar-spinner-size)}.ck-exportpdf_status-pending .ck.ck-exportpdf__spinner-container{display:block;animation:rotate 1.5s linear infinite}.ck-exportpdf_status-pending .ck.ck-button__icon{color:transparent}@keyframes rotate{to{transform:rotate(1turn)}}\"},function(e,t,n){var i=n(1);var o=n(54);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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,n){var i=n(1);var o=n(56);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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,n){var i=n(1);var o=n(58);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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){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,n){var i=n(1);var o=n(61);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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__action{border-top-right-radius:unset;border-bottom-right-radius:unset}[dir=rtl] .ck.ck-splitbutton>.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-radius:0}.ck-rounded-corners [dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow,[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow.ck-rounded-corners{border-radius:var(--ck-border-radius);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)}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled){border-left-color:var(--ck-color-split-button-hover-border)}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled){border-right-color:var(--ck-color-split-button-hover-border)}.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,n){var i=n(1);var o=n(63);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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,n){var i=n(1);var o=n(65);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=\".ck-editor__editable .ck-horizontal-line{display:flow-root}.ck-content hr{margin:15px 0;height:4px;background:#dedede;border:0}\"},function(e,t,n){var i=n(1);var o=n(67);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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(-0.5*var(--ck-widget-outline-thickness));left:min(10%,30px);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(-0.5*var(--ck-widget-outline-thickness));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;left:0;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(-1*var(--ck-widget-outline-thickness));right:calc(-1*var(--ck-widget-outline-thickness))}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{top:calc(-1*var(--ck-widget-outline-thickness) - 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(-1*var(--ck-widget-outline-thickness) - 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}.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-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}to{opacity:1}}'},function(e,t,n){var i=n(1);var o=n(69);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=\":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-resizer-size:10px;--ck-resizer-border-width:1px;--ck-resizer-border-radius:2px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-tooltip-offset:10px;--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2}.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:var(--ck-spacing-small)}.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)}: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{outline:none;border:var(--ck-focus-ring);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))}.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 .ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover .ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-focus-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover .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,n){var i=n(1);var o=n(71);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=\".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_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view>.ck.ck-label{width:100%;text-overflow:ellipsis;overflow:hidden}\"},function(e,t,n){var i=n(1);var o=n(73);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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{box-shadow:var(--ck-inner-shadow),0 0;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 .2s ease-in-out,border .2s ease-in-out}.ck.ck-input-text:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),var(--ck-inner-shadow)}.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),var(--ck-inner-shadow)}.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),var(--ck-inner-shadow)}@keyframes ck-text-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}\"},function(e,t,n){var i=n(1);var o=n(75);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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%}}.ck.ck-text-alternative-form{padding:var(--ck-spacing-standard)}.ck.ck-text-alternative-form:focus{outline:none}[dir=ltr] .ck.ck-text-alternative-form>:not(:first-child),[dir=rtl] .ck.ck-text-alternative-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-text-alternative-form{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-text-alternative-form .ck-labeled-field-view{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-text-alternative-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-text-alternative-form .ck-button{padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-text-alternative-form .ck-button{margin-left:0}[dir=ltr] .ck.ck-text-alternative-form .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-text-alternative-form .ck-button{margin-left:0}[dir=rtl] .ck.ck-text-alternative-form .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}}\"},function(e,t,n){var i=n(1);var o=n(77);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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,n){var i=n(1);var o=n(79);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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,n){var i=n(1);var o=n(81);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=\".ck-content .image{display:table;clear:both;text-align:center;margin:1em auto}.ck-content .image img{display:block;margin:0 auto;max-width:100%;min-width:50px}\"},function(e,t,n){var i=n(1);var o=n(83);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=\".ck-content .image>figcaption{display:table-caption;caption-side:bottom;word-break:break-word;color:#333;background-color:#f7f7f7;padding:.6em;font-size:.75em;outline-offset:-1px}\"},function(e,t,n){var i=n(1);var o=n(85);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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;outline:1px solid var(--ck-color-resizer)}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{position:absolute;pointer-events:all;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);cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{top:var(--ck-resizer-offset);right:var(--ck-resizer-offset);cursor:nesw-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset);cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset);cursor:nesw-resize}\"},function(e,t,n){var i=n(1);var o=n(87);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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}[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,n){var i=n(1);var o=n(89);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=\":root{--ck-image-style-spacing:1.5em}.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)}\"},function(e,t,n){var i=n(1);var o=n(91);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=\".ck.ck-editor__editable .image{position:relative}.ck.ck-editor__editable .image .ck-progress-bar{position:absolute;top:0;left:0}.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}.ck.ck-editor__editable .image .ck-progress-bar{height:2px;width:0;background:var(--ck-color-upload-bar-background);transition:width .1s}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}\"},function(e,t,n){var i=n(1);var o=n(93);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.locals||{}},function(e,t){e.exports='.ck-image-upload-complete-icon{display:block;position:absolute;top:10px;right:10px;border-radius:50%}.ck-image-upload-complete-icon:after{content:\"\";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20px;--ck-image-upload-icon-width:2px}.ck-image-upload-complete-icon{width:var(--ck-image-upload-icon-size);height:var(--ck-image-upload-icon-size);opacity:0;background:var(--ck-color-image-upload-icon-background);animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;animation-fill-mode:forwards,forwards;animation-duration:.5s,.5s;font-size:var(--ck-image-upload-icon-size);animation-delay:0ms,3s}.ck-image-upload-complete-icon:after{left:25%;top:50%;opacity:0;height:0;width:0;transform:scaleX(-1) rotate(135deg);transform-origin:left top;border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);animation-name:ck-upload-complete-icon-check;animation-duration:.5s;animation-delay:.5s;animation-fill-mode:forwards;box-sizing:border-box}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{opacity:1;width:0;height:0}33%{width:.3em;height:0}to{opacity:1;width:.3em;height:.45em}}'},function(e,t,n){var i=n(1);var o=n(95);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.locals||{}},function(e,t){e.exports='.ck .ck-upload-placeholder-loader{position:absolute;display:flex;align-items:center;justify-content:center;top:0;left:0}.ck .ck-upload-placeholder-loader:before{content:\"\";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px}.ck .ck-image-upload-placeholder{width:100%;margin:0}.ck .ck-upload-placeholder-loader{width:100%;height:100%}.ck .ck-upload-placeholder-loader:before{width:var(--ck-upload-placeholder-loader-size);height:var(--ck-upload-placeholder-loader-size);border-radius:50%;border-top:3px solid var(--ck-color-upload-placeholder-loader);border-right:2px solid transparent;animation:ck-upload-placeholder-loader 1s linear infinite}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}'},function(e,t,n){var i=n(1);var o=n(97);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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{padding:var(--ck-spacing-standard)}.ck.ck-link-form:focus{outline:none}[dir=ltr] .ck.ck-link-form>:not(:first-child),[dir=rtl] .ck.ck-link-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-form{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-link-form .ck-labeled-field-view{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form .ck-button{padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-link-form .ck-button{margin-left:0}[dir=ltr] .ck.ck-link-form .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-link-form .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}}.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-standard) var(--ck-spacing-standard) 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{margin-left:0}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[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-left:0}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{border:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}\"},function(e,t,n){var i=n(1);var o=n(99);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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{padding:var(--ck-spacing-standard)}.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}.ck.ck-link-actions:focus{outline:none}[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{padding:0;width:calc(0.8*var(--ck-input-text-width))}.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%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview):first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview):last-of-type{border-right:1px solid var(--ck-color-base-border)}}\"},function(e,t,n){var i=n(1);var o=n(101);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.locals||{}},function(e,t){e.exports='.ck-media__wrapper .ck-media__placeholder{display:flex;flex-direction:column;align-items:center}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-tooltip{display:block}@media (hover:none){.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-tooltip{display:none}}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url{max-width:100%;position:relative}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url:hover .ck-tooltip{visibility:visible;opacity:1}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-media__placeholder__url__text{overflow:hidden;display:block}.ck-media__wrapper[data-oembed-url*=\"facebook.com\"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*=\"google.com/maps\"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*=\"instagram.com\"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*=\"twitter.com\"] .ck-media__placeholder__icon *{display:none}.ck-editor__editable:not(.ck-read-only) .ck-media__wrapper>:not(.ck-media__placeholder),.ck-editor__editable:not(.ck-read-only) .ck-widget:not(.ck-widget_selected) .ck-media__placeholder{pointer-events:none}:root{--ck-media-embed-placeholder-icon-size:3em;--ck-color-media-embed-placeholder-url-text:#757575;--ck-color-media-embed-placeholder-url-text-hover:var(--ck-color-base-text)}.ck-media__wrapper{margin:0 auto}.ck-media__wrapper .ck-media__placeholder{padding:calc(3*var(--ck-spacing-standard));background:var(--ck-color-base-foreground)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon{min-width:var(--ck-media-embed-placeholder-icon-size);height:var(--ck-media-embed-placeholder-icon-size);margin-bottom:var(--ck-spacing-large);background-position:50%;background-size:cover}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon .ck-icon{width:100%;height:100%}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text{color:var(--ck-color-media-embed-placeholder-url-text);white-space:nowrap;text-align:center;font-style:italic;text-overflow:ellipsis}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:var(--ck-color-media-embed-placeholder-url-text-hover);cursor:pointer;text-decoration:underline}.ck-media__wrapper[data-oembed-url*=\"open.spotify.com\"]{max-width:300px;max-height:380px}.ck-media__wrapper[data-oembed-url*=\"google.com/maps\"] .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAuMzc4IiBoZWlnaHQ9IjI1NC4xNjciIHZpZXdCb3g9IjAgMCA2Ni4yNDYgNjcuMjQ4Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcyLjUzMSAtMjE4LjQ1NSkgc2NhbGUoLjk4MDEyKSI+PHJlY3Qgcnk9IjUuMjM4IiByeD0iNS4yMzgiIHk9IjIzMS4zOTkiIHg9IjE3Ni4wMzEiIGhlaWdodD0iNjAuMDk5IiB3aWR0aD0iNjAuMDk5IiBmaWxsPSIjMzRhNjY4IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Ik0yMDYuNDc3IDI2MC45bC0yOC45ODcgMjguOTg3YTUuMjE4IDUuMjE4IDAgMDAzLjc4IDEuNjFoNDkuNjIxYzEuNjk0IDAgMy4xOS0uNzk4IDQuMTQ2LTIuMDM3eiIgZmlsbD0iIzVjODhjNSIvPjxwYXRoIGQ9Ik0yMjYuNzQyIDIyMi45ODhjLTkuMjY2IDAtMTYuNzc3IDcuMTctMTYuNzc3IDE2LjAxNC4wMDcgMi43NjIuNjYzIDUuNDc0IDIuMDkzIDcuODc1LjQzLjcwMy44MyAxLjQwOCAxLjE5IDIuMTA3LjMzMy41MDIuNjUgMS4wMDUuOTUgMS41MDguMzQzLjQ3Ny42NzMuOTU3Ljk4OCAxLjQ0IDEuMzEgMS43NjkgMi41IDMuNTAyIDMuNjM3IDUuMTY4Ljc5MyAxLjI3NSAxLjY4MyAyLjY0IDIuNDY2IDMuOTkgMi4zNjMgNC4wOTQgNC4wMDcgOC4wOTIgNC42IDEzLjkxNHYuMDEyYy4xODIuNDEyLjUxNi42NjYuODc5LjY2Ny40MDMtLjAwMS43NjgtLjMxNC45My0uNzk5LjYwMy01Ljc1NiAyLjIzOC05LjcyOSA0LjU4NS0xMy43OTQuNzgyLTEuMzUgMS42NzMtMi43MTUgMi40NjUtMy45OSAxLjEzNy0xLjY2NiAyLjMyOC0zLjQgMy42MzgtNS4xNjkuMzE1LS40ODIuNjQ1LS45NjIuOTg4LTEuNDM5LjMtLjUwMy42MTctMS4wMDYuOTUtMS41MDguMzU5LS43Ljc2LTEuNDA0IDEuMTktMi4xMDcgMS40MjYtMi40MDIgMi01LjExNCAyLjAwNC03Ljg3NSAwLTguODQ0LTcuNTExLTE2LjAxNC0xNi43NzYtMTYuMDE0eiIgZmlsbD0iI2RkNGIzZSIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48ZWxsaXBzZSByeT0iNS41NjQiIHJ4PSI1LjgyOCIgY3k9IjIzOS4wMDIiIGN4PSIyMjYuNzQyIiBmaWxsPSIjODAyZDI3IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Ik0xOTAuMzAxIDIzNy4yODNjLTQuNjcgMC04LjQ1NyAzLjg1My04LjQ1NyA4LjYwNnMzLjc4NiA4LjYwNyA4LjQ1NyA4LjYwN2MzLjA0MyAwIDQuODA2LS45NTggNi4zMzctMi41MTYgMS41My0xLjU1NyAyLjA4Ny0zLjkxMyAyLjA4Ny02LjI5IDAtLjM2Mi0uMDIzLS43MjItLjA2NC0xLjA3OWgtOC4yNTd2My4wNDNoNC44NWMtLjE5Ny43NTktLjUzMSAxLjQ1LTEuMDU4IDEuOTg2LS45NDIuOTU4LTIuMDI4IDEuNTQ4LTMuOTAxIDEuNTQ4LTIuODc2IDAtNS4yMDgtMi4zNzItNS4yMDgtNS4yOTkgMC0yLjkyNiAyLjMzMi01LjI5OSA1LjIwOC01LjI5OSAxLjM5OSAwIDIuNjE4LjQwNyAzLjU4NCAxLjI5M2wyLjM4MS0yLjM4YzAtLjAwMi0uMDAzLS4wMDQtLjAwNC0uMDA1LTEuNTg4LTEuNTI0LTMuNjItMi4yMTUtNS45NTUtMi4yMTV6bTQuNDMgNS42NmwuMDAzLjAwNnYtLjAwM3oiIGZpbGw9IiNmZmYiIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0iTTIxNS4xODQgMjUxLjkyOWwtNy45OCA3Ljk3OSAyOC40NzcgMjguNDc1YTUuMjMzIDUuMjMzIDAgMDAuNDQ5LTIuMTIzdi0zMS4xNjVjLS40NjkuNjc1LS45MzQgMS4zNDktMS4zODIgMi4wMDUtLjc5MiAxLjI3NS0xLjY4MiAyLjY0LTIuNDY1IDMuOTktMi4zNDcgNC4wNjUtMy45ODIgOC4wMzgtNC41ODUgMTMuNzk0LS4xNjIuNDg1LS41MjcuNzk4LS45My43OTktLjM2My0uMDAxLS42OTctLjI1NS0uODc5LS42Njd2LS4wMTJjLS41OTMtNS44MjItMi4yMzctOS44Mi00LjYtMTMuOTE0LS43ODMtMS4zNS0xLjY3My0yLjcxNS0yLjQ2Ni0zLjk5LTEuMTM3LTEuNjY2LTIuMzI3LTMuNC0zLjYzNy01LjE2OWwtLjAwMi0uMDAzeiIgZmlsbD0iI2MzYzNjMyIvPjxwYXRoIGQ9Ik0yMTIuOTgzIDI0OC40OTVsLTM2Ljk1MiAzNi45NTN2LjgxMmE1LjIyNyA1LjIyNyAwIDAwNS4yMzggNS4yMzhoMS4wMTVsMzUuNjY2LTM1LjY2NmExMzYuMjc1IDEzNi4yNzUgMCAwMC0yLjc2NC0zLjkgMzcuNTc1IDM3LjU3NSAwIDAwLS45ODktMS40NCAzNS4xMjcgMzUuMTI3IDAgMDAtLjk1LTEuNTA4Yy0uMDgzLS4xNjItLjE3Ni0uMzI2LS4yNjQtLjQ4OXoiIGZpbGw9IiNmZGRjNGYiIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0iTTIxMS45OTggMjYxLjA4M2wtNi4xNTIgNi4xNTEgMjQuMjY0IDI0LjI2NGguNzgxYTUuMjI3IDUuMjI3IDAgMDA1LjIzOS01LjIzOHYtMS4wNDV6IiBmaWxsPSIjZmZmIiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjwvZz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*=\"facebook.com\"] .ck-media__placeholder{background:#4268b3}.ck-media__wrapper[data-oembed-url*=\"facebook.com\"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyNCIgaGVpZ2h0PSIxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik05NjcuNDg0IDBINTYuNTE3QzI1LjMwNCAwIDAgMjUuMzA0IDAgNTYuNTE3djkxMC45NjZDMCA5OTguNjk0IDI1LjI5NyAxMDI0IDU2LjUyMiAxMDI0SDU0N1Y2MjhINDE0VjQ3M2gxMzNWMzU5LjAyOWMwLTEzMi4yNjIgODAuNzczLTIwNC4yODIgMTk4Ljc1Ni0yMDQuMjgyIDU2LjUxMyAwIDEwNS4wODYgNC4yMDggMTE5LjI0NCA2LjA4OVYyOTlsLTgxLjYxNi4wMzdjLTYzLjk5MyAwLTc2LjM4NCAzMC40OTItNzYuMzg0IDc1LjIzNlY0NzNoMTUzLjQ4N2wtMTkuOTg2IDE1NUg3MDd2Mzk2aDI2MC40ODRjMzEuMjEzIDAgNTYuNTE2LTI1LjMwMyA1Ni41MTYtNTYuNTE2VjU2LjUxNUMxMDI0IDI1LjMwMyA5OTguNjk3IDAgOTY3LjQ4NCAwIiBmaWxsPSIjRkZGRkZFIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*=\"facebook.com\"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#cdf}.ck-media__wrapper[data-oembed-url*=\"facebook.com\"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*=\"instagram.com\"] .ck-media__placeholder{background:linear-gradient(-135deg,#1400c7,#b800b1,#f50000)}.ck-media__wrapper[data-oembed-url*=\"instagram.com\"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTA0IiBoZWlnaHQ9IjUwNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PHBhdGggaWQ9ImEiIGQ9Ik0wIC4xNTloNTAzLjg0MVY1MDMuOTRIMHoiLz48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48bWFzayBpZD0iYiIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjYSIvPjwvbWFzaz48cGF0aCBkPSJNMjUxLjkyMS4xNTljLTY4LjQxOCAwLTc2Ljk5Ny4yOS0xMDMuODY3IDEuNTE2LTI2LjgxNCAxLjIyMy00NS4xMjcgNS40ODItNjEuMTUxIDExLjcxLTE2LjU2NiA2LjQzNy0zMC42MTUgMTUuMDUxLTQ0LjYyMSAyOS4wNTYtMTQuMDA1IDE0LjAwNi0yMi42MTkgMjguMDU1LTI5LjA1NiA0NC42MjEtNi4yMjggMTYuMDI0LTEwLjQ4NyAzNC4zMzctMTEuNzEgNjEuMTUxQy4yOSAxNzUuMDgzIDAgMTgzLjY2MiAwIDI1Mi4wOGMwIDY4LjQxNy4yOSA3Ni45OTYgMS41MTYgMTAzLjg2NiAxLjIyMyAyNi44MTQgNS40ODIgNDUuMTI3IDExLjcxIDYxLjE1MSA2LjQzNyAxNi41NjYgMTUuMDUxIDMwLjYxNSAyOS4wNTYgNDQuNjIxIDE0LjAwNiAxNC4wMDUgMjguMDU1IDIyLjYxOSA0NC42MjEgMjkuMDU3IDE2LjAyNCA2LjIyNyAzNC4zMzcgMTAuNDg2IDYxLjE1MSAxMS43MDkgMjYuODcgMS4yMjYgMzUuNDQ5IDEuNTE2IDEwMy44NjcgMS41MTYgNjguNDE3IDAgNzYuOTk2LS4yOSAxMDMuODY2LTEuNTE2IDI2LjgxNC0xLjIyMyA0NS4xMjctNS40ODIgNjEuMTUxLTExLjcwOSAxNi41NjYtNi40MzggMzAuNjE1LTE1LjA1MiA0NC42MjEtMjkuMDU3IDE0LjAwNS0xNC4wMDYgMjIuNjE5LTI4LjA1NSAyOS4wNTctNDQuNjIxIDYuMjI3LTE2LjAyNCAxMC40ODYtMzQuMzM3IDExLjcwOS02MS4xNTEgMS4yMjYtMjYuODcgMS41MTYtMzUuNDQ5IDEuNTE2LTEwMy44NjYgMC02OC40MTgtLjI5LTc2Ljk5Ny0xLjUxNi0xMDMuODY3LTEuMjIzLTI2LjgxNC01LjQ4Mi00NS4xMjctMTEuNzA5LTYxLjE1MS02LjQzOC0xNi41NjYtMTUuMDUyLTMwLjYxNS0yOS4wNTctNDQuNjIxLTE0LjAwNi0xNC4wMDUtMjguMDU1LTIyLjYxOS00NC42MjEtMjkuMDU2LTE2LjAyNC02LjIyOC0zNC4zMzctMTAuNDg3LTYxLjE1MS0xMS43MUMzMjguOTE3LjQ0OSAzMjAuMzM4LjE1OSAyNTEuOTIxLjE1OXptMCA0NS4zOTFjNjcuMjY1IDAgNzUuMjMzLjI1NyAxMDEuNzk3IDEuNDY5IDI0LjU2MiAxLjEyIDM3LjkwMSA1LjIyNCA0Ni43NzggOC42NzQgMTEuNzU5IDQuNTcgMjAuMTUxIDEwLjAyOSAyOC45NjYgMTguODQ1IDguODE2IDguODE1IDE0LjI3NSAxNy4yMDcgMTguODQ1IDI4Ljk2NiAzLjQ1IDguODc3IDcuNTU0IDIyLjIxNiA4LjY3NCA0Ni43NzggMS4yMTIgMjYuNTY0IDEuNDY5IDM0LjUzMiAxLjQ2OSAxMDEuNzk4IDAgNjcuMjY1LS4yNTcgNzUuMjMzLTEuNDY5IDEwMS43OTctMS4xMiAyNC41NjItNS4yMjQgMzcuOTAxLTguNjc0IDQ2Ljc3OC00LjU3IDExLjc1OS0xMC4wMjkgMjAuMTUxLTE4Ljg0NSAyOC45NjYtOC44MTUgOC44MTYtMTcuMjA3IDE0LjI3NS0yOC45NjYgMTguODQ1LTguODc3IDMuNDUtMjIuMjE2IDcuNTU0LTQ2Ljc3OCA4LjY3NC0yNi41NiAxLjIxMi0zNC41MjcgMS40NjktMTAxLjc5NyAxLjQ2OS02Ny4yNzEgMC03NS4yMzctLjI1Ny0xMDEuNzk4LTEuNDY5LTI0LjU2Mi0xLjEyLTM3LjkwMS01LjIyNC00Ni43NzgtOC42NzQtMTEuNzU5LTQuNTctMjAuMTUxLTEwLjAyOS0yOC45NjYtMTguODQ1LTguODE1LTguODE1LTE0LjI3NS0xNy4yMDctMTguODQ1LTI4Ljk2Ni0zLjQ1LTguODc3LTcuNTU0LTIyLjIxNi04LjY3NC00Ni43NzgtMS4yMTItMjYuNTY0LTEuNDY5LTM0LjUzMi0xLjQ2OS0xMDEuNzk3IDAtNjcuMjY2LjI1Ny03NS4yMzQgMS40NjktMTAxLjc5OCAxLjEyLTI0LjU2MiA1LjIyNC0zNy45MDEgOC42NzQtNDYuNzc4IDQuNTctMTEuNzU5IDEwLjAyOS0yMC4xNTEgMTguODQ1LTI4Ljk2NiA4LjgxNS04LjgxNiAxNy4yMDctMTQuMjc1IDI4Ljk2Ni0xOC44NDUgOC44NzctMy40NSAyMi4yMTYtNy41NTQgNDYuNzc4LTguNjc0IDI2LjU2NC0xLjIxMiAzNC41MzItMS40NjkgMTAxLjc5OC0xLjQ2OXoiIGZpbGw9IiNGRkYiIG1hc2s9InVybCgjYikiLz48cGF0aCBkPSJNMjUxLjkyMSAzMzYuMDUzYy00Ni4zNzggMC04My45NzQtMzcuNTk2LTgzLjk3NC04My45NzMgMC00Ni4zNzggMzcuNTk2LTgzLjk3NCA4My45NzQtODMuOTc0IDQ2LjM3NyAwIDgzLjk3MyAzNy41OTYgODMuOTczIDgzLjk3NCAwIDQ2LjM3Ny0zNy41OTYgODMuOTczLTgzLjk3MyA4My45NzN6bTAtMjEzLjMzOGMtNzEuNDQ3IDAtMTI5LjM2NSA1Ny45MTgtMTI5LjM2NSAxMjkuMzY1IDAgNzEuNDQ2IDU3LjkxOCAxMjkuMzY0IDEyOS4zNjUgMTI5LjM2NCA3MS40NDYgMCAxMjkuMzY0LTU3LjkxOCAxMjkuMzY0LTEyOS4zNjQgMC03MS40NDctNTcuOTE4LTEyOS4zNjUtMTI5LjM2NC0xMjkuMzY1ek00MTYuNjI3IDExNy42MDRjMCAxNi42OTYtMTMuNTM1IDMwLjIzLTMwLjIzMSAzMC4yMy0xNi42OTUgMC0zMC4yMy0xMy41MzQtMzAuMjMtMzAuMjMgMC0xNi42OTYgMTMuNTM1LTMwLjIzMSAzMC4yMy0zMC4yMzEgMTYuNjk2IDAgMzAuMjMxIDEzLjUzNSAzMC4yMzEgMzAuMjMxIiBmaWxsPSIjRkZGIi8+PC9nPjwvc3ZnPg==)}.ck-media__wrapper[data-oembed-url*=\"instagram.com\"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#ffe0fe}.ck-media__wrapper[data-oembed-url*=\"instagram.com\"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*=\"twitter.com\"] .ck.ck-media__placeholder{background:linear-gradient(90deg,#71c6f4,#0d70a5)}.ck-media__wrapper[data-oembed-url*=\"twitter.com\"] .ck.ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgNDAwIj48cGF0aCBkPSJNNDAwIDIwMGMwIDExMC41LTg5LjUgMjAwLTIwMCAyMDBTMCAzMTAuNSAwIDIwMCA4OS41IDAgMjAwIDBzMjAwIDg5LjUgMjAwIDIwMHpNMTYzLjQgMzA1LjVjODguNyAwIDEzNy4yLTczLjUgMTM3LjItMTM3LjIgMC0yLjEgMC00LjItLjEtNi4yIDkuNC02LjggMTcuNi0xNS4zIDI0LjEtMjUtOC42IDMuOC0xNy45IDYuNC0yNy43IDcuNiAxMC02IDE3LjYtMTUuNCAyMS4yLTI2LjctOS4zIDUuNS0xOS42IDkuNS0zMC42IDExLjctOC44LTkuNC0yMS4zLTE1LjItMzUuMi0xNS4yLTI2LjYgMC00OC4yIDIxLjYtNDguMiA0OC4yIDAgMy44LjQgNy41IDEuMyAxMS00MC4xLTItNzUuNi0yMS4yLTk5LjQtNTAuNC00LjEgNy4xLTYuNSAxNS40LTYuNSAyNC4yIDAgMTYuNyA4LjUgMzEuNSAyMS41IDQwLjEtNy45LS4yLTE1LjMtMi40LTIxLjgtNnYuNmMwIDIzLjQgMTYuNiA0Mi44IDM4LjcgNDcuMy00IDEuMS04LjMgMS43LTEyLjcgMS43LTMuMSAwLTYuMS0uMy05LjEtLjkgNi4xIDE5LjIgMjMuOSAzMy4xIDQ1IDMzLjUtMTYuNSAxMi45LTM3LjMgMjAuNi01OS45IDIwLjYtMy45IDAtNy43LS4yLTExLjUtLjcgMjEuMSAxMy44IDQ2LjUgMjEuOCA3My43IDIxLjgiIGZpbGw9IiNmZmYiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*=\"twitter.com\"] .ck.ck-media__placeholder .ck-media__placeholder__url__text{color:#b8e6ff}.ck-media__wrapper[data-oembed-url*=\"twitter.com\"] .ck.ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}'},function(e,t,n){var i=n(1);var o=n(103);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=\".ck.ck-media-form{display:flex;align-items:flex-start;flex-direction:row;flex-wrap:nowrap}.ck.ck-media-form .ck-labeled-field-view{display:inline-block}.ck.ck-media-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-media-form{flex-wrap:wrap}.ck.ck-media-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-media-form .ck-button{flex-basis:50%}}.ck.ck-media-form{padding:var(--ck-spacing-standard)}.ck.ck-media-form:focus{outline:none}[dir=ltr] .ck.ck-media-form>:not(:first-child),[dir=rtl] .ck.ck-media-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-media-form{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-media-form .ck-labeled-field-view{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-media-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-media-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-media-form .ck-button{padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-media-form .ck-button{margin-left:0}[dir=ltr] .ck.ck-media-form .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-media-form .ck-button{margin-left:0}[dir=rtl] .ck.ck-media-form .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}}\"},function(e,t,n){var i=n(1);var o=n(105);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=\".ck-content .media{clear:both;margin:1em 0;display:block;min-width:15em}\"},function(e,t,n){var i=n(1);var o=n(107);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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,n){var i=n(1);var o=n(109);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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,n){var i=n(1);var o=n(111);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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,n){var i=n(1);var o=n(113);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=\".ck-content .table{margin:1em 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}\"},function(e,t,n){var i=n(1);var o=n(115);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=\".ck.ck-input-color{width:100%;display:flex}.ck.ck-input-color>input.ck.ck-input-text{min-width:auto;flex-grow:1}.ck.ck-input-color>input.ck.ck-input-text:active,.ck.ck-input-color>input.ck.ck-input-text:focus{z-index:var(--ck-z-default)}.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-input-color__button{padding:0}[dir=ltr] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-input-color__button{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}[dir=rtl] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-input-color__button{border-top-right-radius:0;border-bottom-right-radius:0;margin-right:-1px}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-input-color__button.ck-disabled{background:var(--ck-color-input-disabled-background)}.ck.ck-input-color>.ck.ck-dropdown>.ck.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-input-color__button>.ck.ck-input-color__button__preview,.ck.ck-input-color>.ck.ck-dropdown>.ck.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-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-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,n){var i=n(1);var o=n(117);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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,n){var i=n(1);var o=n(119);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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){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__border-row{flex-wrap:wrap}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-labeled-field-view{display:flex;flex-direction:column-reverse}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-labeled-field-view .ck.ck-dropdown,.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{flex-grow:0}.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(-1*var(--ck-table-properties-error-arrow-size));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(-1*var(--ck-table-properties-error-arrow-size));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{width:80px;min-width:80px}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-width{width:50px;min-width:50px}.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-labeled-field-view>.ck-label{font-size:10px;text-align:center}.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:start;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 .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}to{opacity:1}}'},function(e,t,n){var i=n(1);var o=n(123);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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{flex-grow:0}.ck.ck-table-cell-properties-form{width:320px}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__padding-row{padding:0;width:35%}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar{background:none}\"},function(e,t,n){var i=n(1);var o=n(125);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=i(o,r);e.exports=o.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{padding:0}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar{background:none}.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,n){\"use strict\";n.r(t);var i=n(3);var o=i[\"a\"].Symbol;var r=o;var s=Object.prototype;var a=s.hasOwnProperty;var c=s.toString;var l=r?r.toStringTag:undefined;function d(e){var t=a.call(e,l),n=e[l];try{e[l]=undefined;var i=true}catch(e){}var o=c.call(e);if(i){if(t){e[l]=n}else{delete e[l]}}return o}var u=d;var h=Object.prototype;var f=h.toString;function m(e){return f.call(e)}var g=m;var p=\"[object Null]\",b=\"[object Undefined]\";var w=r?r.toStringTag:undefined;function k(e){if(e==null){return e===undefined?b:p}return w&&w in Object(e)?u(e):g(e)}var _=k;function v(e,t){return function(n){return e(t(n))}}var y=v;var x=y(Object.getPrototypeOf,Object);var C=x;function A(e){return e!=null&&typeof e==\"object\"}var T=A;var S=\"[object Object]\";var P=Function.prototype,E=Object.prototype;var M=P.toString;var I=E.hasOwnProperty;var N=M.call(Object);function R(e){if(!T(e)||_(e)!=S){return false}var t=C(e);if(t===null){return true}var n=I.call(t,\"constructor\")&&t.constructor;return typeof n==\"function\"&&n instanceof n&&M.call(n)==N}var O=R;function z(){this.__data__=[];this.size=0}var V=z;function L(e,t){return e===t||e!==e&&t!==t}var D=L;function B(e,t){var n=e.length;while(n--){if(D(e[n][0],t)){return n}}return-1}var j=B;var F=Array.prototype;var H=F.splice;function W(e){var t=this.__data__,n=j(t,e);if(n<0){return false}var i=t.length-1;if(n==i){t.pop()}else{H.call(t,n,1)}--this.size;return true}var U=W;function q(e){var t=this.__data__,n=j(t,e);return n<0?undefined:t[n][1]}var $=q;function Y(e){return j(this.__data__,e)>-1}var G=Y;function K(e,t){var n=this.__data__,i=j(n,e);if(i<0){++this.size;n.push([e,t])}else{n[i][1]=t}return this}var Q=K;function J(e){var t=-1,n=e==null?0:e.length;this.clear();while(++t-1&&e%1==0&&e-1&&e%1==0&&e<=tn}var on=nn;var rn=\"[object Arguments]\",sn=\"[object Array]\",an=\"[object Boolean]\",cn=\"[object Date]\",ln=\"[object Error]\",dn=\"[object Function]\",un=\"[object Map]\",hn=\"[object Number]\",fn=\"[object Object]\",mn=\"[object RegExp]\",gn=\"[object Set]\",pn=\"[object String]\",bn=\"[object WeakMap]\";var wn=\"[object ArrayBuffer]\",kn=\"[object DataView]\",_n=\"[object Float32Array]\",vn=\"[object Float64Array]\",yn=\"[object Int8Array]\",xn=\"[object Int16Array]\",Cn=\"[object Int32Array]\",An=\"[object Uint8Array]\",Tn=\"[object Uint8ClampedArray]\",Sn=\"[object Uint16Array]\",Pn=\"[object Uint32Array]\";var En={};En[_n]=En[vn]=En[yn]=En[xn]=En[Cn]=En[An]=En[Tn]=En[Sn]=En[Pn]=true;En[rn]=En[sn]=En[wn]=En[an]=En[kn]=En[cn]=En[ln]=En[dn]=En[un]=En[hn]=En[fn]=En[mn]=En[gn]=En[pn]=En[bn]=false;function Mn(e){return T(e)&&on(e.length)&&!!En[_(e)]}var In=Mn;function Nn(e){return function(t){return e(t)}}var Rn=Nn;var On=n(5);var zn=On[\"a\"]&&On[\"a\"].isTypedArray;var Vn=zn?Rn(zn):In;var Ln=Vn;var Dn=Object.prototype;var Bn=Dn.hasOwnProperty;function jn(e,t){var n=Kt(e),i=!n&&Yt(e),o=!n&&!i&&Object(Qt[\"a\"])(e),r=!n&&!i&&!o&&Ln(e),s=n||i||o||r,a=s?Bt(e.length,String):[],c=a.length;for(var l in e){if((t||Bn.call(e,l))&&!(s&&(l==\"length\"||o&&(l==\"offset\"||l==\"parent\")||r&&(l==\"buffer\"||l==\"byteLength\"||l==\"byteOffset\")||en(l,c)))){a.push(l)}}return a}var Fn=jn;var Hn=Object.prototype;function Wn(e){var t=e&&e.constructor,n=typeof t==\"function\"&&t.prototype||Hn;return e===n}var Un=Wn;var qn=y(Object.keys,Object);var $n=qn;var Yn=Object.prototype;var Gn=Yn.hasOwnProperty;function Kn(e){if(!Un(e)){return $n(e)}var t=[];for(var n in Object(e)){if(Gn.call(e,n)&&n!=\"constructor\"){t.push(n)}}return t}var Qn=Kn;function Jn(e){return e!=null&&on(e.length)&&!me(e)}var Zn=Jn;function Xn(e){return Zn(e)?Fn(e):Qn(e)}var ei=Xn;function ti(e,t){return e&&Lt(t,ei(t),e)}var ni=ti;function ii(e){var t=[];if(e!=null){for(var n in Object(e)){t.push(n)}}return t}var oi=ii;var ri=Object.prototype;var si=ri.hasOwnProperty;function ai(e){if(!ce(e)){return oi(e)}var t=Un(e),n=[];for(var i in e){if(!(i==\"constructor\"&&(t||!si.call(e,i)))){n.push(i)}}return n}var ci=ai;function li(e){return Zn(e)?Fn(e,true):ci(e)}var di=li;function ui(e,t){return e&&Lt(t,di(t),e)}var hi=ui;var fi=n(8);function mi(e,t){var n=-1,i=e.length;t||(t=Array(i));while(++n{this._setToTarget(e,i,t[i],n)})}}function Qr(e){return $r(e,Jr)}function Jr(e){return Gr(e)?e:undefined}function Zr(){return function e(){e.called=true}}var Xr=Zr;class es{constructor(e,t){this.source=e;this.name=t;this.path=[];this.stop=Xr();this.off=Xr()}}const ts=new Array(256).fill().map((e,t)=>(\"0\"+t.toString(16)).slice(-2));function ns(){const e=Math.random()*4294967296>>>0;const t=Math.random()*4294967296>>>0;const n=Math.random()*4294967296>>>0;const i=Math.random()*4294967296>>>0;return\"e\"+ts[e>>0&255]+ts[e>>8&255]+ts[e>>16&255]+ts[e>>24&255]+ts[t>>0&255]+ts[t>>8&255]+ts[t>>16&255]+ts[t>>24&255]+ts[n>>0&255]+ts[n>>8&255]+ts[n>>16&255]+ts[n>>24&255]+ts[i>>0&255]+ts[i>>8&255]+ts[i>>16&255]+ts[i>>24&255]}const is={get(e){if(typeof e!=\"number\"){return this[e]||this.normal}else{return e}},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};var os=is;var rs=n(6);var ss=n(0);const as=Symbol(\"listeningTo\");const cs=Symbol(\"emitterId\");const ls={on(e,t,n={}){this.listenTo(this,e,t,n)},once(e,t,n){let i=false;const o=function(e,...n){if(!i){i=true;e.off();t.call(this,e,...n)}};this.listenTo(this,e,o,n)},off(e,t){this.stopListening(this,e,t)},listenTo(e,t,n,i={}){let o,r;if(!this[as]){this[as]={}}const s=this[as];if(!fs(e)){hs(e)}const a=fs(e);if(!(o=s[a])){o=s[a]={emitter:e,callbacks:{}}}if(!(r=o.callbacks[t])){r=o.callbacks[t]=[]}r.push(n);ps(e,t);const c=bs(e,t);const l=os.get(i.priority);const d={callback:n,priority:l};for(const e of c){let t=false;for(let n=0;n{if(!this._delegations){this._delegations=new Map}e.forEach(e=>{const i=this._delegations.get(e);if(!i){this._delegations.set(e,new Map([[t,n]]))}else{i.set(t,n)}})}}},stopDelegating(e,t){if(!this._delegations){return}if(!e){this._delegations.clear()}else if(!t){this._delegations.delete(e)}else{const n=this._delegations.get(e);if(n){n.delete(t)}}}};var ds=ls;function us(e,t){if(e[as]&&e[as][t]){return e[as][t].emitter}return null}function hs(e,t){if(!e[cs]){e[cs]=t||ns()}}function fs(e){return e[cs]}function ms(e){if(!e._events){Object.defineProperty(e,\"_events\",{value:{}})}return e._events}function gs(){return{callbacks:[],childEvents:[]}}function ps(e,t){const n=ms(e);if(n[t]){return}let i=t;let o=null;const r=[];while(i!==\"\"){if(n[i]){break}n[i]=gs();r.push(n[i]);if(o){n[i].childEvents.push(o)}o=i;i=i.substr(0,i.lastIndexOf(\":\"))}if(i!==\"\"){for(const e of r){e.callbacks=n[i].callbacks.slice()}n[i].childEvents.push(o)}}function bs(e,t){const n=ms(e)[t];if(!n){return[]}let i=[n.callbacks];for(let t=0;t-1){return ws(e,t.substr(0,t.lastIndexOf(\":\")))}else{return null}}return n.callbacks}function ks(e,t,n){for(let[i,o]of e){if(!o){o=t.name}else if(typeof o==\"function\"){o=o(t.name)}const e=new es(t.source,o);e.path=[...t.path];i.fire(e,...n)}}function _s(e,t,n){const i=bs(e,t);for(const e of i){for(let t=0;t{Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)).forEach(n=>{if(n in e.prototype){return}const i=Object.getOwnPropertyDescriptor(t,n);i.enumerable=false;Object.defineProperty(e.prototype,n,i)})})}class xs{constructor(e={},t={}){const n=vs(e);if(!n){t=e}this._items=[];this._itemMap=new Map;this._idProperty=t.idProperty||\"id\";this._bindToExternalToInternalMap=new WeakMap;this._bindToInternalToExternalMap=new WeakMap;this._skippedIndexesFromExternal=[];if(n){for(const t of e){this._items.push(t);this._itemMap.set(this._getItemIdBeforeAdding(t),t)}}}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(e,t){if(t===undefined){t=this._items.length}else if(t>this._items.length||t<0){throw new ss[\"b\"](\"collection-add-item-invalid-index\",this)}for(let n=0;n{this._setUpBindToBinding(t=>new e(t))},using:e=>{if(typeof e==\"function\"){this._setUpBindToBinding(t=>e(t))}else{this._setUpBindToBinding(t=>t[e])}}}}_setUpBindToBinding(e){const t=this._bindToCollection;const n=(n,i,o)=>{const r=t._bindToCollection==this;const s=t._bindToInternalToExternalMap.get(i);if(r&&s){this._bindToExternalToInternalMap.set(i,s);this._bindToInternalToExternalMap.set(s,i)}else{const n=e(i);if(!n){this._skippedIndexesFromExternal.push(o);return}let r=o;for(const e of this._skippedIndexesFromExternal){if(o>e){r--}}for(const e of t._skippedIndexesFromExternal){if(r>=e){r++}}this._bindToExternalToInternalMap.set(i,n);this._bindToInternalToExternalMap.set(n,i);this.add(n,r);for(let e=0;e{const i=this._bindToExternalToInternalMap.get(t);if(i){this.remove(i)}this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((e,t)=>{if(nt){e.push(t)}return e},[])})}_getItemIdBeforeAdding(e){const t=this._idProperty;let n;if(t in e){n=e[t];if(typeof n!=\"string\"){throw new ss[\"b\"](\"collection-add-invalid-id\",this)}if(this.get(n)){throw new ss[\"b\"](\"collection-add-item-already-exists\",this)}}else{e[t]=n=ns()}return n}_remove(e){let t,n,i;let o=false;const r=this._idProperty;if(typeof e==\"string\"){n=e;i=this._itemMap.get(n);o=!i;if(i){t=this._items.indexOf(i)}}else if(typeof e==\"number\"){t=e;i=this._items[t];o=!i;if(i){n=i[r]}}else{i=e;n=i[r];t=this._items.indexOf(i);o=t==-1||!this._itemMap.get(n)}if(o){throw new ss[\"b\"](\"collection-remove-404: Item not found.\",this)}this._items.splice(t,1);this._itemMap.delete(n);const s=this._bindToInternalToExternalMap.get(i);this._bindToInternalToExternalMap.delete(i);this._bindToExternalToInternalMap.delete(s);this.fire(\"remove\",i,t);return[i,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}ys(xs,ds);class Cs{constructor(e,t=[],n=[]){this._context=e;this._plugins=new Map;this._availablePlugins=new Map;for(const e of t){if(e.pluginName){this._availablePlugins.set(e.pluginName,e)}}this._contextPlugins=new Map;for(const[e,t]of n){this._contextPlugins.set(e,t);this._contextPlugins.set(t,e);if(e.pluginName){this._availablePlugins.set(e.pluginName,e)}}}*[Symbol.iterator](){for(const e of this._plugins){if(typeof e[0]==\"function\"){yield e}}}get(e){const t=this._plugins.get(e);if(!t){const t=\"plugincollection-plugin-not-loaded: The requested plugin is not loaded.\";let n=e;if(typeof e==\"function\"){n=e.pluginName||e.name}throw new ss[\"b\"](t,this._context,{plugin:n})}return t}has(e){return this._plugins.has(e)}init(e,t=[]){const n=this;const i=this._context;const o=new Set;const r=[];const s=m(e);const a=m(t);const c=f(e);if(c){const e=\"plugincollection-plugin-not-found: Some plugins are not available and could not be loaded.\";console.error(Object(ss[\"a\"])(e),{plugins:c});return Promise.reject(new ss[\"b\"](e,i,{plugins:c}))}return Promise.all(s.map(l)).then(()=>d(r,\"init\")).then(()=>d(r,\"afterInit\")).then(()=>r);function l(e){if(a.includes(e)){return}if(n._plugins.has(e)||o.has(e)){return}return u(e).catch(t=>{console.error(Object(ss[\"a\"])(\"plugincollection-load: It was not possible to load the plugin.\"),{plugin:e});throw t})}function d(e,t){return e.reduce((e,i)=>{if(!i[t]){return e}if(n._contextPlugins.has(i)){return e}return e.then(i[t].bind(i))},Promise.resolve())}function u(e){return new Promise(s=>{o.add(e);if(e.requires){e.requires.forEach(n=>{const o=h(n);if(e.isContextPlugin&&!o.isContextPlugin){throw new ss[\"b\"](\"plugincollection-context-required: Context plugin can not require plugin which is not a context plugin\",null,{plugin:o.name,requiredBy:e.name})}if(t.includes(o)){throw new ss[\"b\"](\"plugincollection-required: Cannot load a plugin because one of its dependencies is listed in\"+\"the `removePlugins` option.\",i,{plugin:o.name,requiredBy:e.name})}l(o)})}const a=n._contextPlugins.get(e)||new e(i);n._add(e,a);r.push(a);s()})}function h(e){if(typeof e==\"function\"){return e}return n._availablePlugins.get(e)}function f(e){const t=[];for(const n of e){if(!h(n)){t.push(n)}}return t.length?t:null}function m(e){return e.map(e=>h(e)).filter(e=>!!e)}}destroy(){const e=[];for(const[,t]of this){if(typeof t.destroy==\"function\"&&!this._contextPlugins.has(t)){e.push(t.destroy())}}return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const n=e.pluginName;if(!n){return}if(this._plugins.has(n)){throw new ss[\"b\"](\"plugincollection-plugin-name-conflict: Two plugins with the same name were loaded.\",null,{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:e})}this._plugins.set(n,t)}}ys(Cs,ds);if(!window.CKEDITOR_TRANSLATIONS){window.CKEDITOR_TRANSLATIONS={}}function As(e,t,n){if(!window.CKEDITOR_TRANSLATIONS[e]){window.CKEDITOR_TRANSLATIONS[e]={}}const i=window.CKEDITOR_TRANSLATIONS[e];i.dictionary=i.dictionary||{};i.getPluralForm=n||i.getPluralForm;Object.assign(i.dictionary,t)}function Ts(e,t,n=1){if(typeof n!==\"number\"){throw new ss[\"b\"](\"translation-service-quantity-not-a-number: Expecting `quantity` to be a number.\",null,{quantity:n})}const i=Es();if(i===1){e=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]}const o=t.id||t.string;if(i===0||!Ps(e,o)){if(n!==1){return t.plural}return t.string}const r=window.CKEDITOR_TRANSLATIONS[e].dictionary;const s=window.CKEDITOR_TRANSLATIONS[e].getPluralForm||(e=>e===1?0:1);if(typeof r[o]===\"string\"){return r[o]}const a=Number(s(n));return r[o][a]}function Ss(){window.CKEDITOR_TRANSLATIONS={}}function Ps(e,t){return!!window.CKEDITOR_TRANSLATIONS[e]&&!!window.CKEDITOR_TRANSLATIONS[e].dictionary[t]}function Es(){return Object.keys(window.CKEDITOR_TRANSLATIONS).length}const Ms=[\"ar\",\"fa\",\"he\",\"ku\",\"ug\"];class Is{constructor(e={}){this.uiLanguage=e.uiLanguage||\"en\";this.contentLanguage=e.contentLanguage||this.uiLanguage;this.uiLanguageDirection=Rs(this.uiLanguage);this.contentLanguageDirection=Rs(this.contentLanguage);this.t=(e,t)=>this._t(e,t)}get language(){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.\");return this.uiLanguage}_t(e,t=[]){if(!Array.isArray(t)){t=[t]}if(typeof e===\"string\"){e={string:e}}const n=!!e.plural;const i=n?t[0]:1;const o=Ts(this.uiLanguage,e,i);return Ns(o,t)}}function Ns(e,t){return e.replace(/%(\\d+)/g,(e,n)=>ne.destroy())).then(()=>this.plugins.destroy())}_addEditor(e,t){if(this._contextOwner){throw new ss[\"b\"](\"context-addEditor-private-context: Cannot add multiple editors to the context which is created by the editor.\")}this.editors.add(e);if(t){this._contextOwner=e}}_removeEditor(e){if(this.editors.has(e)){this.editors.remove(e)}if(this._contextOwner===e){return this.destroy()}return Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names()){if(![\"plugins\",\"removePlugins\",\"extraPlugins\"].includes(t)){e[t]=this.config.get(t)}}return e}static create(e){return new Promise(t=>{const n=new this(e);t(n.initPlugins().then(()=>n))})}}function zs(e,t){const n=Math.min(e.length,t.length);for(let i=0;ie.data.length){throw new ss[\"b\"](\"view-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.\",this)}if(n<0||t+n>e.data.length){throw new ss[\"b\"](\"view-textproxy-wrong-length: Given length value is incorrect.\",this)}this.data=e.data.substring(t,t+n);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 e===\"$textProxy\"||e===\"view:$textProxy\"||e===\"textProxy\"||e===\"view:textProxy\"}getAncestors(e={includeSelf:false,parentFirst:false}){const t=[];let n=e.includeSelf?this.textNode:this.parent;while(n!==null){t[e.parentFirst?\"push\":\"unshift\"](n);n=n.parent}return t}}function Hs(e){const t=new Map;for(const n in e){t.set(n,e[n])}return t}function Ws(e){if(vs(e)){return new Map(e)}else{return Hs(e)}}class Us{constructor(...e){this._patterns=[];this.add(...e)}add(...e){for(let t of e){if(typeof t==\"string\"||t instanceof RegExp){t={name:t}}if(t.classes&&(typeof t.classes==\"string\"||t.classes instanceof RegExp)){t.classes=[t.classes]}this._patterns.push(t)}}match(...e){for(const t of e){for(const e of this._patterns){const n=qs(t,e);if(n){return{element:t,pattern:e,match:n}}}}return null}matchAll(...e){const t=[];for(const n of e){for(const e of this._patterns){const i=qs(n,e);if(i){t.push({element:n,pattern:e,match:i})}}}return t.length>0?t:null}getElementName(){if(this._patterns.length!==1){return null}const e=this._patterns[0];const t=e.name;return typeof e!=\"function\"&&t&&!(t instanceof RegExp)?t:null}}function qs(e,t){if(typeof t==\"function\"){return t(e)}const n={};if(t.name){n.name=$s(t.name,e.name);if(!n.name){return null}}if(t.attributes){n.attributes=Ys(t.attributes,e);if(!n.attributes){return null}}if(t.classes){n.classes=Gs(t.classes,e);if(!n.classes){return false}}if(t.styles){n.styles=Ks(t.styles,e);if(!n.styles){return false}}return n}function $s(e,t){if(e instanceof RegExp){return e.test(t)}return e===t}function Ys(e,t){const n=[];for(const i in e){const o=e[i];if(t.hasAttribute(i)){const e=t.getAttribute(i);if(o===true){n.push(i)}else if(o instanceof RegExp){if(o.test(e)){n.push(i)}else{return null}}else if(e===o){n.push(i)}else{return null}}else{return null}}return n}function Gs(e,t){const n=[];for(const i of e){if(i instanceof RegExp){const e=t.getClassNames();for(const t of e){if(i.test(t)){n.push(t)}}if(n.length===0){return null}}else if(t.hasClass(i)){n.push(i)}else{return null}}return n}function Ks(e,t){const n=[];for(const i in e){const o=e[i];if(t.hasStyle(i)){const e=t.getStyle(i);if(o instanceof RegExp){if(o.test(e)){n.push(i)}else{return null}}else if(e===o){n.push(i)}else{return null}}else{return null}}return n}var Qs=\"[object Symbol]\";function Js(e){return typeof e==\"symbol\"||T(e)&&_(e)==Qs}var Zs=Js;var Xs=/\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,ea=/^\\w*$/;function ta(e,t){if(Kt(e)){return false}var n=typeof e;if(n==\"number\"||n==\"symbol\"||n==\"boolean\"||e==null||Zs(e)){return true}return ea.test(e)||!Xs.test(e)||t!=null&&e in Object(t)}var na=ta;var ia=\"Expected a function\";function oa(e,t){if(typeof e!=\"function\"||t!=null&&typeof t!=\"function\"){throw new TypeError(ia)}var n=function(){var i=arguments,o=t?t.apply(this,i):i[0],r=n.cache;if(r.has(o)){return r.get(o)}var s=e.apply(this,i);n.cache=r.set(o,s)||r;return s};n.cache=new(oa.Cache||_t);return n}oa.Cache=_t;var ra=oa;var sa=500;function aa(e){var t=ra(e,(function(e){if(n.size===sa){n.clear()}return e}));var n=t.cache;return t}var ca=aa;var la=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;var da=/\\\\(\\\\)?/g;var ua=ca((function(e){var t=[];if(e.charCodeAt(0)===46){t.push(\"\")}e.replace(la,(function(e,n,i,o){t.push(i?o.replace(da,\"$1\"):n||e)}));return t}));var ha=ua;function fa(e,t){var n=-1,i=e==null?0:e.length,o=Array(i);while(++no?0:o+t}n=n>o?o:n;if(n<0){n+=o}o=t>n?0:n-t>>>0;t>>>=0;var r=Array(o);while(++i0){if(++t>=mc){return arguments[0]}}else{t=0}return e.apply(undefined,arguments)}}var wc=bc;var kc=wc(fc);var _c=kc;function vc(e,t){return _c(lc(e,t,oc),e+\"\")}var yc=vc;function xc(e,t,n){if(!ce(n)){return false}var i=typeof t;if(i==\"number\"?Zn(n)&&en(t,n.length):i==\"string\"&&t in n){return D(n[t],e)}return false}var Cc=xc;function Ac(e){return yc((function(t,n){var i=-1,o=n.length,r=o>1?n[o-1]:undefined,s=o>2?n[2]:undefined;r=e.length>3&&typeof r==\"function\"?(o--,r):undefined;if(s&&Cc(n[0],n[1],s)){r=o<3?undefined:r;o=1}t=Object(t);while(++it===e);return Array.isArray(n)}set(e,t){if(ce(e)){for(const[t,n]of Object.entries(e)){this._styleProcessor.toNormalizedForm(t,n,this._styles)}}else{this._styleProcessor.toNormalizedForm(e,t,this._styles)}}remove(e){const t=Vc(e);Da(this._styles,t);delete this._styles[e];this._cleanEmptyObjectsOnPath(t)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){if(this.isEmpty){return\"\"}return this._getStylesEntries().map(e=>e.join(\":\")).sort().join(\";\")+\";\"}getAsString(e){if(this.isEmpty){return}if(this._styles[e]&&!ce(this._styles[e])){return this._styles[e]}const t=this._styleProcessor.getReducedForm(e,this._styles);const n=t.find(([t])=>t===e);if(Array.isArray(n)){return n[1]}}getStyleNames(){if(this.isEmpty){return[]}const e=this._getStylesEntries();return e.map(([e])=>e)}clear(){this._styles={}}_getStylesEntries(){const e=[];const t=Object.keys(this._styles);for(const n of t){e.push(...this._styleProcessor.getReducedForm(n,this._styles))}return e}_cleanEmptyObjectsOnPath(e){const t=e.split(\".\");const n=t.length>1;if(!n){return}const i=t.splice(0,t.length-1).join(\".\");const o=ja(this._styles,i);if(!o){return}const r=!Array.from(Object.keys(o)).length;if(r){this.remove(i)}}}class Oc{constructor(){this._normalizers=new Map;this._extractors=new Map;this._reducers=new Map;this._consumables=new Map}toNormalizedForm(e,t,n){if(ce(t)){Lc(n,Vc(e),t);return}if(this._normalizers.has(e)){const i=this._normalizers.get(e);const{path:o,value:r}=i(t);Lc(n,o,r)}else{Lc(n,e,t)}}getNormalized(e,t){if(!e){return Pc({},t)}if(t[e]!==undefined){return t[e]}if(this._extractors.has(e)){const n=this._extractors.get(e);if(typeof n===\"string\"){return ja(t,n)}const i=n(e,t);if(i){return i}}return ja(t,Vc(e))}getReducedForm(e,t){const n=this.getNormalized(e,t);if(n===undefined){return[]}if(this._reducers.has(e)){const t=this._reducers.get(e);return t(n)}return[[e,n]]}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 n of t){this._mapStyleNames(n,[e])}}_mapStyleNames(e,t){if(!this._consumables.has(e)){this._consumables.set(e,[])}this._consumables.get(e).push(...t)}}function zc(e){let t=null;let n=0;let i=0;let o=null;const r=new Map;if(e===\"\"){return r}if(e.charAt(e.length-1)!=\";\"){e=e+\";\"}for(let s=0;s0){yield\"class\"}if(!this._styles.isEmpty){yield\"style\"}yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries();if(this._classes.size>0){yield[\"class\",this.getAttribute(\"class\")]}if(!this._styles.isEmpty){yield[\"style\",this.getAttribute(\"style\")]}}getAttribute(e){if(e==\"class\"){if(this._classes.size>0){return[...this._classes].join(\" \")}return undefined}if(e==\"style\"){const e=this._styles.toString();return e==\"\"?undefined:e}return this._attrs.get(e)}hasAttribute(e){if(e==\"class\"){return this._classes.size>0}if(e==\"style\"){return!this._styles.isEmpty}return this._attrs.has(e)}isSimilar(e){if(!(e instanceof Dc)){return false}if(this===e){return true}if(this.name!=e.name){return false}if(this._attrs.size!==e._attrs.size||this._classes.size!==e._classes.size||this._styles.size!==e._styles.size){return false}for(const[t,n]of this._attrs){if(!e._attrs.has(t)||e._attrs.get(t)!==n){return false}}for(const t of this._classes){if(!e._classes.has(t)){return false}}for(const t of this._styles.getStyleNames()){if(!e._styles.has(t)||e._styles.getAsString(t)!==this._styles.getAsString(t)){return false}}return true}hasClass(...e){for(const t of e){if(!this._classes.has(t)){return false}}return true}getClassNames(){return this._classes.keys()}getStyle(e){return this._styles.getAsString(e)}getNormalizedStyle(e){return this._styles.getNormalized(e)}getStyleNames(){return this._styles.getStyleNames()}hasStyle(...e){for(const t of e){if(!this._styles.has(t)){return false}}return true}findAncestor(...e){const t=new Us(...e);let n=this.parent;while(n){if(t.match(n)){return n}n=n.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=Array.from(this._classes).sort().join(\",\");const t=this._styles.toString();const n=Array.from(this._attrs).map(e=>`${e[0]}=\"${e[1]}\"`).sort().join(\" \");return this.name+(e==\"\"?\"\":` class=\"${e}\"`)+(!t?\"\":` style=\"${t}\"`)+(n==\"\"?\"\":` ${n}`)}_clone(e=false){const t=[];if(e){for(const n of this.getChildren()){t.push(n._clone(e))}}const n=new this.constructor(this.document,this.name,this._attrs,t);n._classes=new Set(this._classes);n._styles.set(this._styles.getNormalized());n._customProperties=new Map(this._customProperties);n.getFillerOffset=this.getFillerOffset;return n}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange(\"children\",this);let n=0;const i=Fc(this.document,t);for(const t of i){if(t.parent!==null){t._remove()}t.parent=this;t.document=this.document;this._children.splice(e,0,t);e++;n++}return n}_removeChildren(e,t=1){this._fireChange(\"children\",this);for(let n=e;n0){this._classes.clear();return true}return false}if(e==\"style\"){if(!this._styles.isEmpty){this._styles.clear();return true}return false}return this._attrs.delete(e)}_addClass(e){this._fireChange(\"attributes\",this);e=Array.isArray(e)?e:[e];e.forEach(e=>this._classes.add(e))}_removeClass(e){this._fireChange(\"attributes\",this);e=Array.isArray(e)?e:[e];e.forEach(e=>this._classes.delete(e))}_setStyle(e,t){this._fireChange(\"attributes\",this);this._styles.set(e,t)}_removeStyle(e){this._fireChange(\"attributes\",this);e=Array.isArray(e)?e:[e];e.forEach(e=>this._styles.remove(e))}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}function Bc(e){e=Ws(e);for(const[t,n]of e){if(n===null){e.delete(t)}else if(typeof n!=\"string\"){e.set(t,String(n))}}return e}function jc(e,t){const n=t.split(/\\s+/);e.clear();n.forEach(t=>e.add(t))}function Fc(e,t){if(typeof t==\"string\"){return[new js(e,t)]}if(!vs(t)){t=[t]}return Array.from(t).map(t=>{if(typeof t==\"string\"){return new js(e,t)}if(t instanceof Fs){return new js(e,t.data)}return t})}class Hc extends Dc{constructor(e,t,n,i){super(e,t,n,i);this.getFillerOffset=Wc}is(e,t=null){if(!t){return e===\"containerElement\"||e===\"view:containerElement\"||e===\"element\"||e===\"view:element\"||e===\"node\"||e===\"view:node\"}else{return t===this.name&&(e===\"containerElement\"||e===\"view:containerElement\"||e===\"element\"||e===\"view:element\")}}}function Wc(){const e=[...this.getChildren()];const t=e[this.childCount-1];if(t&&t.is(\"element\",\"br\")){return this.childCount}for(const t of e){if(!t.is(\"uiElement\")){return null}}return this.childCount}var Uc=Tc((function(e,t){Lt(t,di(t),e)}));var qc=Uc;const $c=Symbol(\"observableProperties\");const Yc=Symbol(\"boundObservables\");const Gc=Symbol(\"boundProperties\");const Kc={set(e,t){if(ce(e)){Object.keys(e).forEach(t=>{this.set(t,e[t])},this);return}Jc(this);const n=this[$c];if(e in this&&!n.has(e)){throw new ss[\"b\"](\"observable-set-cannot-override: Cannot override an existing property.\",this)}Object.defineProperty(this,e,{enumerable:true,configurable:true,get(){return n.get(e)},set(t){const i=n.get(e);let o=this.fire(\"set:\"+e,e,t,i);if(o===undefined){o=t}if(i!==o||!n.has(e)){n.set(e,o);this.fire(\"change:\"+e,e,o,i)}}});this[e]=t},bind(...e){if(!e.length||!tl(e)){throw new ss[\"b\"](\"observable-bind-wrong-properties: All properties must be strings.\",this)}if(new Set(e).size!==e.length){throw new ss[\"b\"](\"observable-bind-duplicate-properties: Properties must be unique.\",this)}Jc(this);const t=this[Gc];e.forEach(e=>{if(t.has(e)){throw new ss[\"b\"](\"observable-bind-rebind: Cannot bind the same property more than once.\",this)}});const n=new Map;e.forEach(e=>{const i={property:e,to:[]};t.set(e,i);n.set(e,i)});return{to:Zc,toMany:Xc,_observable:this,_bindProperties:e,_to:[],_bindings:n}},unbind(...e){if(!this[$c]){return}const t=this[Gc];const n=this[Yc];if(e.length){if(!tl(e)){throw new ss[\"b\"](\"observable-unbind-wrong-properties: Properties must be strings.\",this)}e.forEach(e=>{const i=t.get(e);if(!i){return}let o,r,s,a;i.to.forEach(e=>{o=e[0];r=e[1];s=n.get(o);a=s[r];a.delete(i);if(!a.size){delete s[r]}if(!Object.keys(s).length){n.delete(o);this.stopListening(o,\"change\")}});t.delete(e)})}else{n.forEach((e,t)=>{this.stopListening(t,\"change\")});n.clear();t.clear()}},decorate(e){const t=this[e];if(!t){throw new ss[\"b\"](\"observablemixin-cannot-decorate-undefined: Cannot decorate an undefined method.\",this,{object:this,methodName:e})}this.on(e,(e,n)=>{e.return=t.apply(this,n)});this[e]=function(...t){return this.fire(e,t)}}};qc(Kc,ds);var Qc=Kc;function Jc(e){if(e[$c]){return}Object.defineProperty(e,$c,{value:new Map});Object.defineProperty(e,Yc,{value:new Map});Object.defineProperty(e,Gc,{value:new Map})}function Zc(...e){const t=nl(...e);const n=Array.from(this._bindings.keys());const i=n.length;if(!t.callback&&t.to.length>1){throw new ss[\"b\"](\"observable-bind-to-no-callback: Binding multiple observables only possible with callback.\",this)}if(i>1&&t.callback){throw new ss[\"b\"](\"observable-bind-to-extra-callback: Cannot bind multiple properties and use a callback in one binding.\",this)}t.to.forEach(e=>{if(e.properties.length&&e.properties.length!==i){throw new ss[\"b\"](\"observable-bind-to-properties-length: The number of properties must match.\",this)}if(!e.properties.length){e.properties=this._bindProperties}});this._to=t.to;if(t.callback){this._bindings.get(n[0]).callback=t.callback}sl(this._observable,this._to);ol(this);this._bindProperties.forEach(e=>{rl(this._observable,e)})}function Xc(e,t,n){if(this._bindings.size>1){throw new ss[\"b\"](\"observable-bind-to-many-not-one-binding: Cannot bind multiple properties with toMany().\",this)}this.to(...el(e,t),n)}function el(e,t){const n=e.map(e=>[e,t]);return Array.prototype.concat.apply([],n)}function tl(e){return e.every(e=>typeof e==\"string\")}function nl(...e){if(!e.length){throw new ss[\"b\"](\"observable-bind-to-parse-error: Invalid argument syntax in `to()`.\",null)}const t={to:[]};let n;if(typeof e[e.length-1]==\"function\"){t.callback=e.pop()}e.forEach(e=>{if(typeof e==\"string\"){n.properties.push(e)}else if(typeof e==\"object\"){n={observable:e,properties:[]};t.to.push(n)}else{throw new ss[\"b\"](\"observable-bind-to-parse-error: Invalid argument syntax in `to()`.\",null)}});return t}function il(e,t,n,i){const o=e[Yc];const r=o.get(n);const s=r||{};if(!s[i]){s[i]=new Set}s[i].add(t);if(!r){o.set(n,s)}}function ol(e){let t;e._bindings.forEach((n,i)=>{e._to.forEach(o=>{t=o.properties[n.callback?0:e._bindProperties.indexOf(i)];n.to.push([o.observable,t]);il(e._observable,n,o.observable,t)})})}function rl(e,t){const n=e[Gc];const i=n.get(t);let o;if(i.callback){o=i.callback.apply(e,i.to.map(e=>e[0][e[1]]))}else{o=i.to[0];o=o[0][o[1]]}if(Object.prototype.hasOwnProperty.call(e,t)){e[t]=o}else{e.set(t,o)}}function sl(e,t){t.forEach(t=>{const n=e[Yc];let i;if(!n.get(t.observable)){e.listenTo(t.observable,\"change\",(o,r)=>{i=n.get(t.observable)[r];if(i){i.forEach(t=>{rl(e,t.property)})}})}})}class al extends Hc{constructor(e,t,n,i){super(e,t,n,i);this.set(\"isReadOnly\",false);this.set(\"isFocused\",false);this.bind(\"isReadOnly\").to(e);this.bind(\"isFocused\").to(e,\"isFocused\",t=>t&&e.selection.editableElement==this);this.listenTo(e.selection,\"change\",()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this})}is(e,t=null){if(!t){return e===\"editableElement\"||e===\"view:editableElement\"||e===\"containerElement\"||e===\"view:containerElement\"||e===\"element\"||e===\"view:element\"||e===\"node\"||e===\"view:node\"}else{return t===this.name&&(e===\"editableElement\"||e===\"view:editableElement\"||e===\"containerElement\"||e===\"view:containerElement\"||e===\"element\"||e===\"view:element\")}}destroy(){this.stopListening()}}ys(al,Qc);const cl=Symbol(\"rootName\");class ll extends al{constructor(e,t){super(e,t);this.rootName=\"main\"}is(e,t=null){if(!t){return 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\"}else{return t===this.name&&(e===\"rootElement\"||e===\"view:rootElement\"||e===\"editableElement\"||e===\"view:editableElement\"||e===\"containerElement\"||e===\"view:containerElement\"||e===\"element\"||e===\"view:element\")}}get rootName(){return this.getCustomProperty(cl)}set rootName(e){this._setCustomProperty(cl,e)}set _name(e){this.name=e}}class dl{constructor(e={}){if(!e.boundaries&&!e.startPosition){throw new ss[\"b\"](\"view-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.\",null)}if(e.direction&&e.direction!=\"forward\"&&e.direction!=\"backward\"){throw new ss[\"b\"](\"view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.\",e.startPosition,{direction:e.direction})}this.boundaries=e.boundaries||null;if(e.startPosition){this.position=ul._createAt(e.startPosition)}else{this.position=ul._createAt(e.boundaries[e.direction==\"backward\"?\"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,n,i;do{i=this.position;({done:t,value:n}=this.next())}while(!t&&e(n));if(!t){this.position=i}}next(){if(this.direction==\"forward\"){return this._next()}else{return this._previous()}}_next(){let e=this.position.clone();const t=this.position;const n=e.parent;if(n.parent===null&&e.offset===n.childCount){return{done:true}}if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset){return{done:true}}let i;if(n instanceof js){if(e.isAtEnd){this.position=ul._createAfter(n);return this._next()}i=n.data[e.offset]}else{i=n.getChild(e.offset)}if(i instanceof Dc){if(!this.shallow){e=new ul(i,0)}else{e.offset++}this.position=e;return this._formatReturnValue(\"elementStart\",i,t,e,1)}else if(i instanceof js){if(this.singleCharacters){e=new ul(i,0);this.position=e;return this._next()}else{let n=i.data.length;let o;if(i==this._boundaryEndParent){n=this.boundaries.end.offset;o=new Fs(i,0,n);e=ul._createAfter(o)}else{o=new Fs(i,0,i.data.length);e.offset++}this.position=e;return this._formatReturnValue(\"text\",o,t,e,n)}}else if(typeof i==\"string\"){let i;if(this.singleCharacters){i=1}else{const t=n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length;i=t-e.offset}const o=new Fs(n,e.offset,i);e.offset+=i;this.position=e;return this._formatReturnValue(\"text\",o,t,e,i)}else{e=ul._createAfter(n);this.position=e;if(this.ignoreElementEnd){return this._next()}else{return this._formatReturnValue(\"elementEnd\",n,t,e)}}}_previous(){let e=this.position.clone();const t=this.position;const n=e.parent;if(n.parent===null&&e.offset===0){return{done:true}}if(n==this._boundaryStartParent&&e.offset==this.boundaries.start.offset){return{done:true}}let i;if(n instanceof js){if(e.isAtStart){this.position=ul._createBefore(n);return this._previous()}i=n.data[e.offset-1]}else{i=n.getChild(e.offset-1)}if(i instanceof Dc){if(!this.shallow){e=new ul(i,i.childCount);this.position=e;if(this.ignoreElementEnd){return this._previous()}else{return this._formatReturnValue(\"elementEnd\",i,t,e)}}else{e.offset--;this.position=e;return this._formatReturnValue(\"elementStart\",i,t,e,1)}}else if(i instanceof js){if(this.singleCharacters){e=new ul(i,i.data.length);this.position=e;return this._previous()}else{let n=i.data.length;let o;if(i==this._boundaryStartParent){const t=this.boundaries.start.offset;o=new Fs(i,t,i.data.length-t);n=o.data.length;e=ul._createBefore(o)}else{o=new Fs(i,0,i.data.length);e.offset--}this.position=e;return this._formatReturnValue(\"text\",o,t,e,n)}}else if(typeof i==\"string\"){let i;if(!this.singleCharacters){const t=n===this._boundaryStartParent?this.boundaries.start.offset:0;i=e.offset-t}else{i=1}e.offset-=i;const o=new Fs(n,e.offset,i);this.position=e;return this._formatReturnValue(\"text\",o,t,e,i)}else{e=ul._createBefore(n);this.position=e;return this._formatReturnValue(\"elementStart\",n,t,e,1)}}_formatReturnValue(e,t,n,i,o){if(t instanceof Fs){if(t.offsetInText+t.data.length==t.textNode.data.length){if(this.direction==\"forward\"&&!(this.boundaries&&this.boundaries.end.isEqual(this.position))){i=ul._createAfter(t.textNode);this.position=i}else{n=ul._createAfter(t.textNode)}}if(t.offsetInText===0){if(this.direction==\"backward\"&&!(this.boundaries&&this.boundaries.start.isEqual(this.position))){i=ul._createBefore(t.textNode);this.position=i}else{n=ul._createBefore(t.textNode)}}}return{done:false,value:{type:e,item:t,previousPosition:n,nextPosition:i,length:o}}}}class ul{constructor(e,t){this.parent=e;this.offset=t}get nodeAfter(){if(this.parent.is(\"$text\")){return null}return this.parent.getChild(this.offset)||null}get nodeBefore(){if(this.parent.is(\"$text\")){return null}return this.parent.getChild(this.offset-1)||null}get isAtStart(){return this.offset===0}get isAtEnd(){const 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;while(!(e instanceof al)){if(e.parent){e=e.parent}else{return null}}return e}getShiftedBy(e){const t=ul._createAt(this);const n=t.offset+e;t.offset=n<0?0:n;return t}getLastMatchingPosition(e,t={}){t.startPosition=this;const n=new dl(t);n.skip(e);return n.position}getAncestors(){if(this.parent.is(\"documentFragment\")){return[this.parent]}else{return this.parent.getAncestors({includeSelf:true})}}getCommonAncestor(e){const t=this.getAncestors();const n=e.getAncestors();let i=0;while(t[i]==n[i]&&t[i]){i++}return i===0?null:t[i-1]}is(e){return e===\"position\"||e===\"view:position\"}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return this.compareWith(e)==\"before\"}isAfter(e){return this.compareWith(e)==\"after\"}compareWith(e){if(this.root!==e.root){return\"different\"}if(this.isEqual(e)){return\"same\"}const t=this.parent.is(\"node\")?this.parent.getPath():[];const n=e.parent.is(\"node\")?e.parent.getPath():[];t.push(this.offset);n.push(e.offset);const i=zs(t,n);switch(i){case\"prefix\":return\"before\";case\"extension\":return\"after\";default:return t[i]0?new this(n,i):new this(i,n)}static _createIn(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}static _createOn(e){const t=e.is(\"$textProxy\")?e.offsetSize:1;return this._createFromPositionAndShift(ul._createBefore(e),t)}}function fl(e){if(e.item.is(\"attributeElement\")||e.item.is(\"uiElement\")){return true}return false}function ml(e){let t=0;for(const n of e){t++}return t}class gl{constructor(e=null,t,n){this._ranges=[];this._lastRangeBackward=false;this._isFake=false;this._fakeSelectionLabel=\"\";this.setTo(e,t,n)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length){return null}const 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}const e=this._ranges[this._ranges.length-1];const t=this._lastRangeBackward?e.start:e.end;return t.clone()}get isCollapsed(){return this.rangeCount===1&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){if(this.anchor){return this.anchor.editableElement}return null}*getRanges(){for(const e of this._ranges){yield e.clone()}}getFirstRange(){let e=null;for(const t of this._ranges){if(!e||t.start.isBefore(e.start)){e=t}}return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges){if(!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(e){if(this.isFake!=e.isFake){return false}if(this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel){return false}if(this.rangeCount!=e.rangeCount){return false}else if(this.rangeCount===0){return true}if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus)){return false}for(const t of this._ranges){let n=false;for(const i of e._ranges){if(t.isEqual(i)){n=true;break}}if(!n){return false}}return true}isSimilar(e){if(this.isBackward!=e.isBackward){return false}const t=ml(this.getRanges());const n=ml(e.getRanges());if(t!=n){return false}if(t==0){return true}for(let t of this.getRanges()){t=t.getTrimmed();let n=false;for(let i of e.getRanges()){i=i.getTrimmed();if(t.start.isEqual(i.start)&&t.end.isEqual(i.end)){n=true;break}}if(!n){return false}}return true}getSelectedElement(){if(this.rangeCount!==1){return null}return this.getFirstRange().getContainedElement()}setTo(e,t,n){if(e===null){this._setRanges([]);this._setFakeOptions(t)}else if(e instanceof gl||e instanceof pl){this._setRanges(e.getRanges(),e.isBackward);this._setFakeOptions({fake:e.isFake,label:e.fakeSelectionLabel})}else if(e instanceof hl){this._setRanges([e],t&&t.backward);this._setFakeOptions(t)}else if(e instanceof ul){this._setRanges([new hl(e)]);this._setFakeOptions(t)}else if(e instanceof Bs){const i=!!n&&!!n.backward;let o;if(t===undefined){throw new ss[\"b\"](\"view-selection-setTo-required-second-parameter: \"+\"selection.setTo requires the second parameter when the first parameter is a node.\",this)}else if(t==\"in\"){o=hl._createIn(e)}else if(t==\"on\"){o=hl._createOn(e)}else{o=new hl(ul._createAt(e,t))}this._setRanges([o],i);this._setFakeOptions(n)}else if(vs(e)){this._setRanges(e,t&&t.backward);this._setFakeOptions(t)}else{throw new ss[\"b\"](\"view-selection-setTo-not-selectable: Cannot set selection to given place.\",this)}this.fire(\"change\")}setFocus(e,t){if(this.anchor===null){throw new ss[\"b\"](\"view-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.\",this)}const n=ul._createAt(e,t);if(n.compareWith(this.focus)==\"same\"){return}const i=this.anchor;this._ranges.pop();if(n.compareWith(i)==\"before\"){this._addRange(new hl(n,i),true)}else{this._addRange(new hl(i,n))}this.fire(\"change\")}is(e){return e===\"selection\"||e===\"view:selection\"}_setRanges(e,t=false){e=Array.from(e);this._ranges=[];for(const t of e){this._addRange(t)}this._lastRangeBackward=!!t}_setFakeOptions(e={}){this._isFake=!!e.fake;this._fakeSelectionLabel=e.fake?e.label||\"\":\"\"}_addRange(e,t=false){if(!(e instanceof hl)){throw new ss[\"b\"](\"view-selection-add-range-not-range: \"+\"Selection range set to an object that is not an instance of view.Range\",this)}this._pushRange(e);this._lastRangeBackward=!!t}_pushRange(e){for(const t of this._ranges){if(e.isIntersecting(t)){throw new ss[\"b\"](\"view-selection-range-intersects: Trying to add a range that intersects with another range from selection.\",this,{addedRange:e,intersectingRange:t})}}this._ranges.push(new hl(e.start,e.end))}}ys(gl,ds);class pl{constructor(e=null,t,n){this._selection=new gl;this._selection.delegate(\"change\").to(this);this._selection.setTo(e,t,n)}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 e===\"selection\"||e==\"documentSelection\"||e==\"view:selection\"||e==\"view:documentSelection\"}_setTo(e,t,n){this._selection.setTo(e,t,n)}_setFocus(e,t){this._selection.setFocus(e,t)}}ys(pl,ds);class bl{constructor(e){this.selection=new pl;this.roots=new xs({idProperty:\"rootName\"});this.stylesProcessor=e;this.set(\"isReadOnly\",false);this.set(\"isFocused\",false);this.set(\"isComposing\",false);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=false;do{for(const n of this._postFixers){t=n(e);if(t){break}}}while(t)}}ys(bl,Qc);const wl=10;class kl extends Dc{constructor(e,t,n,i){super(e,t,n,i);this.getFillerOffset=_l;this._priority=wl;this._id=null;this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(this.id===null){throw new ss[\"b\"](\"attribute-element-get-elements-with-same-id-no-id: \"+\"Cannot get elements with the same id for an attribute element without id.\",this)}return new Set(this._clonesGroup)}is(e,t=null){if(!t){return e===\"attributeElement\"||e===\"view:attributeElement\"||e===\"element\"||e===\"view:element\"||e===\"node\"||e===\"view:node\"}else{return t===this.name&&(e===\"attributeElement\"||e===\"view:attributeElement\"||e===\"element\"||e===\"view:element\")}}isSimilar(e){if(this.id!==null||e.id!==null){return this.id===e.id}return super.isSimilar(e)&&this.priority==e.priority}_clone(e){const t=super._clone(e);t._priority=this._priority;t._id=this._id;return t}}kl.DEFAULT_PRIORITY=wl;function _l(){if(vl(this)){return null}let e=this.parent;while(e&&e.is(\"attributeElement\")){if(vl(e)>1){return null}e=e.parent}if(!e||vl(e)>1){return null}return this.childCount}function vl(e){return Array.from(e.getChildren()).filter(e=>!e.is(\"uiElement\")).length}class yl extends Dc{constructor(e,t,n,i){super(e,t,n,i);this.getFillerOffset=xl}is(e,t=null){if(!t){return e===\"emptyElement\"||e===\"view:emptyElement\"||e===\"element\"||e===\"view:element\"||e===\"node\"||e===\"view:node\"}else{return t===this.name&&(e===\"emptyElement\"||e===\"view:emptyElement\"||e===\"element\"||e===\"view:element\")}}_insertChild(e,t){if(t&&(t instanceof Bs||Array.from(t).length>0)){throw new ss[\"b\"](\"view-emptyelement-cannot-add: Cannot add child nodes to EmptyElement instance.\",[this,t])}}}function xl(){return null}const Cl=navigator.userAgent.toLowerCase();const Al={isMac:Sl(Cl),isGecko:Pl(Cl),isSafari:El(Cl),isAndroid:Ml(Cl),features:{isRegExpUnicodePropertySupported:Il()}};var Tl=Al;function Sl(e){return e.indexOf(\"macintosh\")>-1}function Pl(e){return!!e.match(/gecko\\/\\d+/)}function El(e){return e.indexOf(\" applewebkit/\")>-1&&e.indexOf(\"chrome\")===-1}function Ml(e){return e.indexOf(\"android\")>-1}function Il(){let e=false;try{e=\"ć\".search(new RegExp(\"[\\\\p{L}]\",\"u\"))===0}catch(e){}return e}const Nl={\"⌘\":\"ctrl\",\"⇧\":\"shift\",\"⌥\":\"alt\"};const Rl={ctrl:\"⌘\",shift:\"⇧\",alt:\"⌥\"};const Ol=Fl();function zl(e){let t;if(typeof e==\"string\"){t=Ol[e.toLowerCase()];if(!t){throw new ss[\"b\"](\"keyboard-unknown-key: Unknown key name.\",null,{key:e})}}else{t=e.keyCode+(e.altKey?Ol.alt:0)+(e.ctrlKey?Ol.ctrl:0)+(e.shiftKey?Ol.shift:0)}return t}function Vl(e){if(typeof e==\"string\"){e=Hl(e)}return e.map(e=>typeof e==\"string\"?zl(e):e).reduce((e,t)=>t+e,0)}function Ll(e){if(!Tl.isMac){return e}return Hl(e).map(e=>Rl[e.toLowerCase()]||e).reduce((e,t)=>{if(e.slice(-1)in Nl){return e+t}else{return e+\"+\"+t}})}function Dl(e){return e==Ol.arrowright||e==Ol.arrowleft||e==Ol.arrowup||e==Ol.arrowdown}function Bl(e,t){const n=t===\"ltr\";switch(e){case Ol.arrowleft:return n?\"left\":\"right\";case Ol.arrowright:return n?\"right\":\"left\";case Ol.arrowup:return\"up\";case Ol.arrowdown:return\"down\"}}function jl(e,t){const n=Bl(e,t);return n===\"down\"||n===\"right\"}function Fl(){const e={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 t=65;t<=90;t++){const n=String.fromCharCode(t);e[n.toLowerCase()]=t}for(let t=48;t<=57;t++){e[t-48]=t}for(let t=112;t<=123;t++){e[\"f\"+(t-111)]=t}return e}function Hl(e){return e.split(/\\s*\\+\\s*/)}class Wl extends Dc{constructor(e,t,n,i){super(e,t,n,i);this.getFillerOffset=ql}is(e,t=null){if(!t){return e===\"uiElement\"||e===\"view:uiElement\"||e===\"element\"||e===\"view:element\"||e===\"node\"||e===\"view:node\"}else{return t===this.name&&(e===\"uiElement\"||e===\"view:uiElement\"||e===\"element\"||e===\"view:element\")}}_insertChild(e,t){if(t&&(t instanceof Bs||Array.from(t).length>0)){throw new ss[\"b\"](\"view-uielement-cannot-add: Cannot add child nodes to UIElement instance.\",this)}}render(e){return this.toDomElement(e)}toDomElement(e){const t=e.createElement(this.name);for(const e of this.getAttributeKeys()){t.setAttribute(e,this.getAttribute(e))}return t}}function Ul(e){e.document.on(\"keydown\",(t,n)=>$l(t,n,e.domConverter))}function ql(){return null}function $l(e,t,n){if(t.keyCode==Ol.arrowright){const e=t.domTarget.ownerDocument.defaultView.getSelection();const i=e.rangeCount==1&&e.getRangeAt(0).collapsed;if(i||t.shiftKey){const t=e.focusNode;const o=e.focusOffset;const r=n.domPositionToView(t,o);if(r===null){return}let s=false;const a=r.getLastMatchingPosition(e=>{if(e.item.is(\"uiElement\")){s=true}if(e.item.is(\"uiElement\")||e.item.is(\"attributeElement\")){return true}return false});if(s){const t=n.viewPositionToDom(a);if(i){e.collapse(t.parent,t.offset)}else{e.extend(t.parent,t.offset)}}}}}class Yl extends Dc{constructor(e,t,n,i){super(e,t,n,i);this.getFillerOffset=Gl}is(e,t=null){if(!t){return e===\"rawElement\"||e===\"view:rawElement\"||e===this.name||e===\"view:\"+this.name||e===\"element\"||e===\"view:element\"||e===\"node\"||e===\"view:node\"}else{return t===this.name&&(e===\"rawElement\"||e===\"view:rawElement\"||e===\"element\"||e===\"view:element\")}}_insertChild(e,t){if(t&&(t instanceof Bs||Array.from(t).length>0)){throw new ss[\"b\"](\"view-rawelement-cannot-add: Cannot add child nodes to a RawElement instance.\",[this,t])}}}function Gl(){return null}class Kl{constructor(e,t){this.document=e;this._children=[];if(t){this._insertChild(0,t)}}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return this.childCount===0}get root(){return this}get parent(){return null}is(e){return e===\"documentFragment\"||e===\"view:documentFragment\"}_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 n=0;const i=Ql(this.document,t);for(const t of i){if(t.parent!==null){t._remove()}t.parent=this;this._children.splice(e,0,t);e++;n++}return n}_removeChildren(e,t=1){this._fireChange(\"children\",this);for(let n=e;n{if(typeof t==\"string\"){return new js(e,t)}if(t instanceof Fs){return new js(e,t.data)}return t})}class Jl{constructor(e){this.document=e;this._cloneGroups=new Map}setSelection(e,t,n){this.document.selection._setTo(e,t,n)}setSelectionFocus(e,t){this.document.selection._setFocus(e,t)}createText(e){return new js(this.document,e)}createAttributeElement(e,t,n={}){const i=new kl(this.document,e,t);if(n.priority){i._priority=n.priority}if(n.id){i._id=n.id}return i}createContainerElement(e,t){return new Hc(this.document,e,t)}createEditableElement(e,t){const n=new al(this.document,e,t);n._document=this.document;return n}createEmptyElement(e,t){return new yl(this.document,e,t)}createUIElement(e,t,n){const i=new Wl(this.document,e,t);if(n){i.render=n}return i}createRawElement(e,t,n){const i=new Yl(this.document,e,t);i.render=n||(()=>{});return i}setAttribute(e,t,n){n._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,n){if(O(e)&&n===undefined){n=t}n._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,n){n._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}breakAttributes(e){if(e instanceof ul){return this._breakAttributes(e)}else{return this._breakAttributesRange(e)}}breakContainer(e){const t=e.parent;if(!t.is(\"containerElement\")){throw new ss[\"b\"](\"view-writer-break-non-container-element: Trying to break an element which is not a container element.\",this.document)}if(!t.parent){throw new ss[\"b\"](\"view-writer-break-root: Trying to break root element.\",this.document)}if(e.isAtStart){return ul._createBefore(t)}else if(!e.isAtEnd){const n=t._clone(false);this.insert(ul._createAfter(t),n);const i=new hl(e,ul._createAt(t,\"end\"));const o=new ul(n,0);this.move(i,o)}return ul._createAfter(t)}mergeAttributes(e){const t=e.offset;const n=e.parent;if(n.is(\"$text\")){return e}if(n.is(\"attributeElement\")&&n.childCount===0){const e=n.parent;const t=n.index;n._remove();this._removeFromClonedElementsGroup(n);return this.mergeAttributes(new ul(e,t))}const i=n.getChild(t-1);const o=n.getChild(t);if(!i||!o){return e}if(i.is(\"$text\")&&o.is(\"$text\")){return id(i,o)}else if(i.is(\"attributeElement\")&&o.is(\"attributeElement\")&&i.isSimilar(o)){const e=i.childCount;i._appendChild(o.getChildren());o._remove();this._removeFromClonedElementsGroup(o);return this.mergeAttributes(new ul(i,e))}return e}mergeContainers(e){const t=e.nodeBefore;const n=e.nodeAfter;if(!t||!n||!t.is(\"containerElement\")||!n.is(\"containerElement\")){throw new ss[\"b\"](\"view-writer-merge-containers-invalid-position: \"+\"Element before and after given position cannot be merged.\",this.document)}const i=t.getChild(t.childCount-1);const o=i instanceof js?ul._createAt(i,\"end\"):ul._createAt(t,\"end\");this.move(hl._createIn(n),ul._createAt(t,\"end\"));this.remove(hl._createOn(n));return o}insert(e,t){t=vs(t)?[...t]:[t];od(t,this.document);const n=Xl(e);if(!n){throw new ss[\"b\"](\"view-writer-invalid-position-container\",this.document)}const i=this._breakAttributes(e,true);const o=n._insertChild(i.offset,t);for(const e of t){this._addToClonedElementsGroup(e)}const r=i.getShiftedBy(o);const s=this.mergeAttributes(i);if(o===0){return new hl(s,s)}else{if(!s.isEqual(i)){r.offset--}const e=this.mergeAttributes(r);return new hl(s,e)}}remove(e){const t=e instanceof hl?e:hl._createOn(e);ad(t,this.document);if(t.isCollapsed){return new Kl(this.document)}const{start:n,end:i}=this._breakAttributesRange(t,true);const o=n.parent;const r=i.offset-n.offset;const s=o._removeChildren(n.offset,r);for(const e of s){this._removeFromClonedElementsGroup(e)}const a=this.mergeAttributes(n);t.start=a;t.end=a.clone();return new Kl(this.document,s)}clear(e,t){ad(e,this.document);const n=e.getWalker({direction:\"backward\",ignoreElementEnd:true});for(const i of n){const n=i.item;let o;if(n.is(\"element\")&&t.isSimilar(n)){o=hl._createOn(n)}else if(!i.nextPosition.isAfter(e.start)&&n.is(\"$textProxy\")){const e=n.getAncestors().find(e=>e.is(\"element\")&&t.isSimilar(e));if(e){o=hl._createIn(e)}}if(o){if(o.end.isAfter(e.end)){o.end=e.end}if(o.start.isBefore(e.start)){o.start=e.start}this.remove(o)}}}move(e,t){let n;if(t.isAfter(e.end)){t=this._breakAttributes(t,true);const i=t.parent;const o=i.childCount;e=this._breakAttributesRange(e,true);n=this.remove(e);t.offset+=i.childCount-o}else{n=this.remove(e)}return this.insert(t,n)}wrap(e,t){if(!(t instanceof kl)){throw new ss[\"b\"](\"view-writer-wrap-invalid-attribute\",this.document)}ad(e,this.document);if(!e.isCollapsed){return this._wrapRange(e,t)}else{let n=e.start;if(n.parent.is(\"element\")&&!Zl(n.parent)){n=n.getLastMatchingPosition(e=>e.item.is(\"uiElement\"))}n=this._wrapPosition(n,t);const i=this.document.selection;if(i.isCollapsed&&i.getFirstPosition().isEqual(e.start)){this.setSelection(n)}return new hl(n)}}unwrap(e,t){if(!(t instanceof kl)){throw new ss[\"b\"](\"view-writer-unwrap-invalid-attribute\",this.document)}ad(e,this.document);if(e.isCollapsed){return e}const{start:n,end:i}=this._breakAttributesRange(e,true);const o=n.parent;const r=this._unwrapChildren(o,n.offset,i.offset,t);const s=this.mergeAttributes(r.start);if(!s.isEqual(r.start)){r.end.offset--}const a=this.mergeAttributes(r.end);return new hl(s,a)}rename(e,t){const n=new Hc(this.document,e,t.getAttributes());this.insert(ul._createAfter(t),n);this.move(hl._createIn(t),ul._createAt(n,0));this.remove(hl._createOn(t));return n}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return ul._createAt(e,t)}createPositionAfter(e){return ul._createAfter(e)}createPositionBefore(e){return ul._createBefore(e)}createRange(e,t){return new hl(e,t)}createRangeOn(e){return hl._createOn(e)}createRangeIn(e){return hl._createIn(e)}createSelection(e,t,n){return new gl(e,t,n)}_wrapChildren(e,t,n,i){let o=t;const r=[];while(ofalse;e.parent._insertChild(e.offset,n);const i=new hl(e,e.getShiftedBy(1));this.wrap(i,t);const o=new ul(n.parent,n.index);n._remove();const r=o.nodeBefore;const s=o.nodeAfter;if(r instanceof js&&s instanceof js){return id(r,s)}return td(o)}_wrapAttributeElement(e,t){if(!cd(e,t)){return false}if(e.name!==t.name||e.priority!==t.priority){return false}for(const n of e.getAttributeKeys()){if(n===\"class\"||n===\"style\"){continue}if(t.hasAttribute(n)&&t.getAttribute(n)!==e.getAttribute(n)){return false}}for(const n of e.getStyleNames()){if(t.hasStyle(n)&&t.getStyle(n)!==e.getStyle(n)){return false}}for(const n of e.getAttributeKeys()){if(n===\"class\"||n===\"style\"){continue}if(!t.hasAttribute(n)){this.setAttribute(n,e.getAttribute(n),t)}}for(const n of e.getStyleNames()){if(!t.hasStyle(n)){this.setStyle(n,e.getStyle(n),t)}}for(const n of e.getClassNames()){if(!t.hasClass(n)){this.addClass(n,t)}}return true}_unwrapAttributeElement(e,t){if(!cd(e,t)){return false}if(e.name!==t.name||e.priority!==t.priority){return false}for(const n of e.getAttributeKeys()){if(n===\"class\"||n===\"style\"){continue}if(!t.hasAttribute(n)||t.getAttribute(n)!==e.getAttribute(n)){return false}}if(!t.hasClass(...e.getClassNames())){return false}for(const n of e.getStyleNames()){if(!t.hasStyle(n)||t.getStyle(n)!==e.getStyle(n)){return false}}for(const n of e.getAttributeKeys()){if(n===\"class\"||n===\"style\"){continue}this.removeAttribute(n,t)}this.removeClass(Array.from(e.getClassNames()),t);this.removeStyle(Array.from(e.getStyleNames()),t);return true}_breakAttributesRange(e,t=false){const n=e.start;const i=e.end;ad(e,this.document);if(e.isCollapsed){const n=this._breakAttributes(e.start,t);return new hl(n,n)}const o=this._breakAttributes(i,t);const r=o.parent.childCount;const s=this._breakAttributes(n,t);o.offset+=o.parent.childCount-r;return new hl(s,o)}_breakAttributes(e,t=false){const n=e.offset;const i=e.parent;if(e.parent.is(\"emptyElement\")){throw new ss[\"b\"](\"view-writer-cannot-break-empty-element\",this.document)}if(e.parent.is(\"uiElement\")){throw new ss[\"b\"](\"view-writer-cannot-break-ui-element\",this.document)}if(e.parent.is(\"rawElement\")){throw new ss[\"b\"](\"view-writer-cannot-break-raw-element: Cannot break inside a RawElement instance.\",this.document)}if(!t&&i.is(\"$text\")&&sd(i.parent)){return e.clone()}if(sd(i)){return e.clone()}if(i.is(\"$text\")){return this._breakAttributes(nd(e),t)}const o=i.childCount;if(n==o){const e=new ul(i.parent,i.index+1);return this._breakAttributes(e,t)}else{if(n===0){const e=new ul(i.parent,i.index);return this._breakAttributes(e,t)}else{const e=i.index+1;const o=i._clone();i.parent._insertChild(e,o);this._addToClonedElementsGroup(o);const r=i.childCount-n;const s=i._removeChildren(n,r);o._appendChild(s);const a=new ul(i.parent,e);return this._breakAttributes(a,t)}}}_addToClonedElementsGroup(e){if(!e.root.is(\"rootElement\")){return}if(e.is(\"element\")){for(const t of e.getChildren()){this._addToClonedElementsGroup(t)}}const t=e.id;if(!t){return}let n=this._cloneGroups.get(t);if(!n){n=new Set;this._cloneGroups.set(t,n)}n.add(e);e._clonesGroup=n}_removeFromClonedElementsGroup(e){if(e.is(\"element\")){for(const t of e.getChildren()){this._removeFromClonedElementsGroup(t)}}const t=e.id;if(!t){return}const n=this._cloneGroups.get(t);if(!n){return}n.delete(e)}}function Zl(e){return Array.from(e.getChildren()).some(e=>!e.is(\"uiElement\"))}function Xl(e){let t=e.parent;while(!sd(t)){if(!t){return undefined}t=t.parent}return t}function ed(e,t){if(e.priorityt.priority){return false}return e.getIdentity()n instanceof e)){throw new ss[\"b\"](\"view-writer-insert-invalid-node\",t)}if(!n.is(\"$text\")){od(n.getChildren(),t)}}}const rd=[js,kl,Hc,yl,Yl,Wl];function sd(e){return e&&(e.is(\"containerElement\")||e.is(\"documentFragment\"))}function ad(e,t){const n=Xl(e.start);const i=Xl(e.end);if(!n||!i||n!==i){throw new ss[\"b\"](\"view-writer-invalid-range-container\",t)}}function cd(e,t){return e.id===null&&t.id===null}function ld(e){return Object.prototype.toString.call(e)==\"[object Text]\"}const dd=e=>e.createTextNode(\" \");const ud=e=>{const t=e.createElement(\"br\");t.dataset.ckeFiller=true;return t};const hd=7;const fd=(()=>{let e=\"\";for(let t=0;t0){n.push({index:i,type:\"insert\",values:e.slice(i,r)})}if(o-i>0){n.push({index:i+(r-i),type:\"delete\",howMany:o-i})}return n}function Cd(e,t){const{firstIndex:n,lastIndexOld:i,lastIndexNew:o}=e;if(n===-1){return Array(t).fill(\"equal\")}let r=[];if(n>0){r=r.concat(Array(n).fill(\"equal\"))}if(o-n>0){r=r.concat(Array(o-n).fill(\"insert\"))}if(i-n>0){r=r.concat(Array(i-n).fill(\"delete\"))}if(o200||o>200||i+o>300){return Ad.fastDiff(e,t,n,true)}let r,s;if(ol?-1:1;if(d[i+h]){d[i]=d[i+h].slice(0)}if(!d[i]){d[i]=[]}d[i].push(o>l?r:s);let f=Math.max(o,l);let m=f-i;while(ml;m--){u[m]=h(m)}u[l]=h(l);f++}while(u[l]!==c);return d[l].slice(1)}Ad.fastDiff=kd;function Td(e,t,n){e.insertBefore(n,e.childNodes[t]||null)}function Sd(e){const t=e.parentNode;if(t){t.removeChild(e)}}function Pd(e){if(e){if(e.defaultView){return e instanceof e.defaultView.Document}else if(e.ownerDocument&&e.ownerDocument.defaultView){return e instanceof e.ownerDocument.defaultView.Node}}return false}class Ed{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=false;this._inlineFiller=null;this._fakeSelectionContainer=null}markToSync(e,t){if(e===\"text\"){if(this.domConverter.mapViewToDom(t.parent)){this.markedTexts.add(t)}}else{if(!this.domConverter.mapViewToDom(t)){return}if(e===\"attributes\"){this.markedAttributes.add(t)}else if(e===\"children\"){this.markedChildren.add(t)}else{throw new ss[\"b\"](\"view-renderer-unknown-type: Unknown type passed to Renderer.markToSync.\",this)}}}render(){let e;for(const e of this.markedChildren){this._updateChildrenMappings(e)}if(this._inlineFiller&&!this._isSelectionInInlineFiller()){this._removeInlineFiller()}if(this._inlineFiller){e=this._getInlineFillerPosition()}else if(this._needsInlineFillerAtSelection()){e=this.selection.getFirstPosition();this.markedChildren.add(e.parent)}for(const e of this.markedAttributes){this._updateAttrs(e)}for(const t of this.markedChildren){this._updateChildren(t,{inlineFillerPosition:e})}for(const t of this.markedTexts){if(!this.markedChildren.has(t.parent)&&this.domConverter.mapViewToDom(t.parent)){this._updateText(t,{inlineFillerPosition:e})}}if(e){const t=this.domConverter.viewPositionToDom(e);const n=t.parent.ownerDocument;if(!md(t.parent)){this._inlineFiller=Id(n,t.parent,t.offset)}else{this._inlineFiller=t.parent}}else{this._inlineFiller=null}this._updateSelection();this._updateFocus();this.markedTexts.clear();this.markedAttributes.clear();this.markedChildren.clear()}_updateChildrenMappings(e){const t=this.domConverter.mapViewToDom(e);if(!t){return}const n=this.domConverter.mapViewToDom(e).childNodes;const i=Array.from(this.domConverter.viewChildrenToDom(e,t.ownerDocument,{withChildren:false}));const o=this._diffNodeLists(n,i);const r=this._findReplaceActions(o,n,i);if(r.indexOf(\"replace\")!==-1){const t={equal:0,insert:0,delete:0};for(const o of r){if(o===\"replace\"){const o=t.equal+t.insert;const r=t.equal+t.delete;const s=e.getChild(o);if(s&&!(s.is(\"uiElement\")||s.is(\"rawElement\"))){this._updateElementMappings(s,n[r])}Sd(i[o]);t.equal++}else{t[o]++}}}}_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();if(e.parent.is(\"$text\")){return ul._createBefore(this.selection.getFirstPosition().parent)}else{return e}}_isSelectionInInlineFiller(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed){return false}const e=this.selection.getFirstPosition();const t=this.domConverter.viewPositionToDom(e);if(t&&ld(t.parent)&&md(t.parent)){return true}return false}_removeInlineFiller(){const e=this._inlineFiller;if(!md(e)){throw new ss[\"b\"](\"view-renderer-filler-was-lost: The inline filler node was lost.\",this)}if(gd(e)){e.parentNode.removeChild(e)}else{e.data=e.data.substr(hd)}this._inlineFiller=null}_needsInlineFillerAtSelection(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed){return false}const e=this.selection.getFirstPosition();const t=e.parent;const n=e.offset;if(!this.domConverter.mapViewToDom(t.root)){return false}if(!t.is(\"element\")){return false}if(!Md(t)){return false}if(n===t.getFillerOffset()){return false}const i=e.nodeBefore;const o=e.nodeAfter;if(i instanceof js||o instanceof js){return false}return true}_updateText(e,t){const n=this.domConverter.findCorrespondingDomText(e);const i=this.domConverter.viewToDom(e,n.ownerDocument);const o=n.data;let r=i.data;const s=t.inlineFillerPosition;if(s&&s.parent==e.parent&&s.offset==e.index){r=fd+r}if(o!=r){const e=kd(o,r);for(const t of e){if(t.type===\"insert\"){n.insertData(t.index,t.values.join(\"\"))}else{n.deleteData(t.index,t.howMany)}}}}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(!t){return}const n=Array.from(t.attributes).map(e=>e.name);const i=e.getAttributeKeys();for(const n of i){t.setAttribute(n,e.getAttribute(n))}for(const i of n){if(!e.hasAttribute(i)){t.removeAttribute(i)}}}_updateChildren(e,t){const n=this.domConverter.mapViewToDom(e);if(!n){return}const i=t.inlineFillerPosition;const o=this.domConverter.mapViewToDom(e).childNodes;const r=Array.from(this.domConverter.viewChildrenToDom(e,n.ownerDocument,{bind:true,inlineFillerPosition:i}));if(i&&i.parent===e){Id(n.ownerDocument,r,i.offset)}const s=this._diffNodeLists(o,r);let a=0;const c=new Set;for(const e of s){if(e===\"delete\"){c.add(o[a]);Sd(o[a])}else if(e===\"equal\"){a++}}a=0;for(const e of s){if(e===\"insert\"){Td(n,a,r[a]);a++}else if(e===\"equal\"){this._markDescendantTextToSync(this.domConverter.domToView(r[a]));a++}}for(const e of c){if(!e.parentNode){this.domConverter.unbindDomElement(e)}}}_diffNodeLists(e,t){e=zd(e,this._fakeSelectionContainer);return Ad(e,t,Rd.bind(null,this.domConverter))}_findReplaceActions(e,t,n){if(e.indexOf(\"insert\")===-1||e.indexOf(\"delete\")===-1){return e}let i=[];let o=[];let r=[];const s={equal:0,insert:0,delete:0};for(const a of e){if(a===\"insert\"){r.push(n[s.equal+s.insert])}else if(a===\"delete\"){o.push(t[s.equal+s.delete])}else{i=i.concat(Ad(o,r,Nd).map(e=>e===\"equal\"?\"replace\":e));i.push(\"equal\");o=[];r=[]}s[a]++}return i.concat(Ad(o,r,Nd).map(e=>e===\"equal\"?\"replace\":e))}_markDescendantTextToSync(e){if(!e){return}if(e.is(\"$text\")){this.markedTexts.add(e)}else if(e.is(\"element\")){for(const t of e.getChildren()){this._markDescendantTextToSync(t)}}}_updateSelection(){if(this.selection.rangeCount===0){this._removeDomSelection();this._removeFakeSelection();return}const e=this.domConverter.mapViewToDom(this.selection.editableElement);if(!this.isFocused||!e){return}if(this.selection.isFake){this._updateFakeSelection(e)}else{this._removeFakeSelection();this._updateDomSelection(e)}}_updateFakeSelection(e){const t=e.ownerDocument;if(!this._fakeSelectionContainer){this._fakeSelectionContainer=Vd(t)}const n=this._fakeSelectionContainer;this.domConverter.bindFakeSelection(n,this.selection);if(!this._fakeSelectionNeedsUpdate(e)){return}if(!n.parentElement||n.parentElement!=e){e.appendChild(n)}n.textContent=this.selection.fakeSelectionLabel||\" \";const i=t.getSelection();const o=t.createRange();i.removeAllRanges();o.selectNodeContents(n);i.addRange(o)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t)){return}const n=this.domConverter.viewPositionToDom(this.selection.anchor);const i=this.domConverter.viewPositionToDom(this.selection.focus);e.focus();t.collapse(n.parent,n.offset);t.extend(i.parent,i.offset);if(Tl.isGecko){Od(i,t)}}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e)){return true}const t=e&&this.domConverter.domSelectionToView(e);if(t&&this.selection.isEqual(t)){return false}if(!this.selection.isCollapsed&&this.selection.isSimilar(t)){return false}return true}_fakeSelectionNeedsUpdate(e){const t=this._fakeSelectionContainer;const n=e.ownerDocument.getSelection();if(!t||t.parentElement!==e){return true}if(n.anchorNode!==t&&!t.contains(n.anchorNode)){return true}return t.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const e of this.domDocuments){const t=e.getSelection();if(t.rangeCount){const t=e.activeElement;const n=this.domConverter.mapDomToView(t);if(t&&n){e.getSelection().removeAllRanges()}}}}_removeFakeSelection(){const e=this._fakeSelectionContainer;if(e){e.remove()}}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;if(e){this.domConverter.focus(e)}}}}ys(Ed,Qc);function Md(e){if(e.getAttribute(\"contenteditable\")==\"false\"){return false}const t=e.findAncestor(e=>e.hasAttribute(\"contenteditable\"));return!t||t.getAttribute(\"contenteditable\")==\"true\"}function Id(e,t,n){const i=t instanceof Array?t:t.childNodes;const o=i[n];if(ld(o)){o.data=fd+o.data;return o}else{const o=e.createTextNode(fd);if(Array.isArray(t)){i.splice(n,0,o)}else{Td(t,n,o)}return o}}function Nd(e,t){return Pd(e)&&Pd(t)&&!ld(e)&&!ld(t)&&e.nodeType!==Node.COMMENT_NODE&&t.nodeType!==Node.COMMENT_NODE&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}function Rd(e,t,n){if(t===n){return true}else if(ld(t)&&ld(n)){return t.data===n.data}else if(e.isBlockFiller(t)&&e.isBlockFiller(n)){return true}return false}function Od(e,t){const n=e.parent;if(n.nodeType!=Node.ELEMENT_NODE||e.offset!=n.childNodes.length-1){return}const i=n.childNodes[e.offset];if(i&&i.tagName==\"BR\"){t.addRange(t.getRangeAt(0))}}function zd(e,t){const n=Array.from(e);if(n.length==0||!t){return n}const i=n[n.length-1];if(i==t){n.pop()}return n}function Vd(e){const t=e.createElement(\"div\");Object.assign(t.style,{position:\"fixed\",top:0,left:\"-9999px\",width:\"42px\"});t.textContent=\" \";return t}var Ld={window:window,document:document};function Dd(e){let t=0;while(e.previousSibling){e=e.previousSibling;t++}return t}function Bd(e){const t=[];while(e&&e.nodeType!=Node.DOCUMENT_NODE){t.unshift(e);e=e.parentNode}return t}function jd(e,t){const n=Bd(e);const i=Bd(t);let o=0;while(n[o]==i[o]&&n[o]){o++}return o===0?null:n[o-1]}const Fd=ud(document);class Hd{constructor(e,t={}){this.document=e;this.blockFillerMode=t.blockFillerMode||\"br\";this.preElements=[\"pre\"];this.blockElements=[\"p\",\"div\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"li\",\"dd\",\"dt\",\"figcaption\",\"td\",\"th\"];this._blockFiller=this.blockFillerMode==\"br\"?ud:dd;this._domToViewMapping=new WeakMap;this._viewToDomMapping=new WeakMap;this._fakeSelectionMapping=new WeakMap}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new gl(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t);this._viewToDomMapping.set(t,e)}unbindDomElement(e){const t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e);this._viewToDomMapping.delete(t);for(const t of e.childNodes){this.unbindDomElement(t)}}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t);this._viewToDomMapping.set(t,e)}viewToDom(e,t,n={}){if(e.is(\"$text\")){const n=this._processDataFromViewText(e);return t.createTextNode(n)}else{if(this.mapViewToDom(e)){return this.mapViewToDom(e)}let i;if(e.is(\"documentFragment\")){i=t.createDocumentFragment();if(n.bind){this.bindDocumentFragments(i,e)}}else if(e.is(\"uiElement\")){i=e.render(t);if(n.bind){this.bindElements(i,e)}return i}else{if(e.hasAttribute(\"xmlns\")){i=t.createElementNS(e.getAttribute(\"xmlns\"),e.name)}else{i=t.createElement(e.name)}if(e.is(\"rawElement\")){e.render(i)}if(n.bind){this.bindElements(i,e)}for(const t of e.getAttributeKeys()){i.setAttribute(t,e.getAttribute(t))}}if(n.withChildren||n.withChildren===undefined){for(const o of this.viewChildrenToDom(e,t,n)){i.appendChild(o)}}return i}}*viewChildrenToDom(e,t,n={}){const i=e.getFillerOffset&&e.getFillerOffset();let o=0;for(const r of e.getChildren()){if(i===o){yield this._blockFiller(t)}yield this.viewToDom(r,t,n);o++}if(i===o){yield this._blockFiller(t)}}viewRangeToDom(e){const t=this.viewPositionToDom(e.start);const n=this.viewPositionToDom(e.end);const i=document.createRange();i.setStart(t.parent,t.offset);i.setEnd(n.parent,n.offset);return i}viewPositionToDom(e){const t=e.parent;if(t.is(\"$text\")){const n=this.findCorrespondingDomText(t);if(!n){return null}let i=e.offset;if(md(n)){i+=hd}return{parent:n,offset:i}}else{let n,i,o;if(e.offset===0){n=this.mapViewToDom(t);if(!n){return null}o=n.childNodes[0]}else{const t=e.nodeBefore;i=t.is(\"$text\")?this.findCorrespondingDomText(t):this.mapViewToDom(e.nodeBefore);if(!i){return null}n=i.parentNode;o=i.nextSibling}if(ld(o)&&md(o)){return{parent:o,offset:hd}}const r=i?Dd(i)+1:0;return{parent:n,offset:r}}}domToView(e,t={}){if(this.isBlockFiller(e,this.blockFillerMode)){return null}const n=this.getHostViewElement(e,this._domToViewMapping);if(n){return n}if(ld(e)){if(gd(e)){return null}else{const t=this._processDataFromDomText(e);return t===\"\"?null:new js(this.document,t)}}else if(this.isComment(e)){return null}else{if(this.mapDomToView(e)){return this.mapDomToView(e)}let n;if(this.isDocumentFragment(e)){n=new Kl(this.document);if(t.bind){this.bindDocumentFragments(e,n)}}else{const i=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();n=new Dc(this.document,i);if(t.bind){this.bindElements(e,n)}const o=e.attributes;for(let e=o.length-1;e>=0;e--){n._setAttribute(o[e].name,o[e].value)}}if(t.withChildren||t.withChildren===undefined){for(const i of this.domChildrenToView(e,t)){n._appendChild(i)}}return n}}*domChildrenToView(e,t={}){for(let n=0;n{const{scrollLeft:t,scrollTop:n}=e;i.push([t,n])});t.focus();Ud(t,e=>{const[t,n]=i.shift();e.scrollLeft=t;e.scrollTop=n});Ld.window.scrollTo(e,n)}}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){if(this.blockFillerMode==\"br\"){return e.isEqualNode(Fd)}if(e.tagName===\"BR\"&&$d(e,this.blockElements)&&e.parentNode.childNodes.length===1){return true}return qd(e,this.blockElements)}isDomSelectionBackward(e){if(e.isCollapsed){return false}const t=document.createRange();t.setStart(e.anchorNode,e.anchorOffset);t.setEnd(e.focusNode,e.focusOffset);const n=t.collapsed;t.detach();return n}getHostViewElement(e){const t=Bd(e);t.pop();while(t.length){const e=t.pop();const n=this._domToViewMapping.get(e);if(n&&(n.is(\"uiElement\")||n.is(\"rawElement\"))){return n}}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}_isDomSelectionPositionCorrect(e,t){if(ld(e)&&md(e)&&tthis.preElements.includes(e.name))){return t}if(t.charAt(0)==\" \"){const n=this._getTouchingViewTextNode(e,false);const i=n&&this._nodeEndsWithSpace(n);if(i||!n){t=\" \"+t.substr(1)}}if(t.charAt(t.length-1)==\" \"){const n=this._getTouchingViewTextNode(e,true);if(t.charAt(t.length-2)==\" \"||!n||n.data.charAt(0)==\" \"){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 false}const t=this._processDataFromViewText(e);return t.charAt(t.length-1)==\" \"}_processDataFromDomText(e){let t=e.data;if(Wd(e,this.preElements)){return pd(e)}t=t.replace(/[ \\n\\t\\r]{1,}/g,\" \");const n=this._getTouchingInlineDomNode(e,false);const i=this._getTouchingInlineDomNode(e,true);const o=this._checkShouldLeftTrimDomText(n);const r=this._checkShouldRightTrimDomText(e,i);if(o){t=t.replace(/^ /,\"\")}if(r){t=t.replace(/ $/,\"\")}t=pd(new Text(t));t=t.replace(/ \\u00A0/g,\" \");if(/( |\\u00A0)\\u00A0$/.test(t)||!i||i.data&&i.data.charAt(0)==\" \"){t=t.replace(/\\u00A0$/,\" \")}if(o){t=t.replace(/^\\u00A0/,\" \")}return t}_checkShouldLeftTrimDomText(e){if(!e){return true}if(Gr(e)){return true}return/[^\\S\\u00A0]/.test(e.data.charAt(e.data.length-1))}_checkShouldRightTrimDomText(e,t){if(t){return false}return!md(e)}_getTouchingViewTextNode(e,t){const n=new dl({startPosition:t?ul._createAfter(e):ul._createBefore(e),direction:t?\"forward\":\"backward\"});for(const e of n){if(e.item.is(\"containerElement\")){return null}else if(e.item.is(\"element\",\"br\")){return null}else if(e.item.is(\"$textProxy\")){return e.item}}return null}_getTouchingInlineDomNode(e,t){if(!e.parentNode){return null}const n=t?\"nextNode\":\"previousNode\";const i=e.ownerDocument;const o=Bd(e)[0];const r=i.createTreeWalker(o,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,{acceptNode(e){if(ld(e)){return NodeFilter.FILTER_ACCEPT}if(e.tagName==\"BR\"){return NodeFilter.FILTER_ACCEPT}return NodeFilter.FILTER_SKIP}});r.currentNode=e;const s=r[n]();if(s!==null){const t=jd(e,s);if(t&&!Wd(e,this.blockElements,t)&&!Wd(s,this.blockElements,t)){return s}}return null}}function Wd(e,t,n){let i=Bd(e);if(n){i=i.slice(i.indexOf(n)+1)}return i.some(e=>e.tagName&&t.includes(e.tagName.toLowerCase()))}function Ud(e,t){while(e&&e!=Ld.document){t(e);e=e.parentNode}}function qd(e,t){const n=ld(e)&&e.data==\" \";return n&&$d(e,t)&&e.parentNode.childNodes.length===1}function $d(e,t){const n=e.parentNode;return n&&n.tagName&&t.includes(n.tagName.toLowerCase())}function Yd(e){const t=Object.prototype.toString.apply(e);if(t==\"[object Window]\"){return true}if(t==\"[object global]\"){return true}return false}const Gd=qc({},ds,{listenTo(e,...t){if(Pd(e)||Yd(e)){const n=this._getProxyEmitter(e)||new Qd(e);n.attach(...t);e=n}ds.listenTo.call(this,e,...t)},stopListening(e,t,n){if(Pd(e)||Yd(e)){const t=this._getProxyEmitter(e);if(!t){return}e=t}ds.stopListening.call(this,e,t,n);if(e instanceof Qd){e.detach(t)}},_getProxyEmitter(e){return us(this,Jd(e))}});var Kd=Gd;class Qd{constructor(e){hs(this,Jd(e));this._domNode=e}}qc(Qd.prototype,ds,{attach(e,t,n={}){if(this._domListeners&&this._domListeners[e]){return}const i=this._createDomListener(e,!!n.useCapture);this._domNode.addEventListener(e,i,!!n.useCapture);if(!this._domListeners){this._domListeners={}}this._domListeners[e]=i},detach(e){let t;if(this._domListeners[e]&&(!(t=this._events[e])||!t.callbacks.length)){this._domListeners[e].removeListener()}},_createDomListener(e,t){const n=t=>{this.fire(e,t)};n.removeListener=()=>{this._domNode.removeEventListener(e,n,t);delete this._domListeners[e]};return n}});function Jd(e){return e[\"data-ck-expando\"]||(e[\"data-ck-expando\"]=ns())}class Zd{constructor(e){this.view=e;this.document=e.document;this.isEnabled=false}enable(){this.isEnabled=true}disable(){this.isEnabled=false}destroy(){this.disable();this.stopListening()}}ys(Zd,Kd);var Xd=\"__lodash_hash_undefined__\";function eu(e){this.__data__.set(e,Xd);return this}var tu=eu;function nu(e){return this.__data__.has(e)}var iu=nu;function ou(e){var t=-1,n=e==null?0:e.length;this.__data__=new _t;while(++ta)){return false}var l=r.get(e);if(l&&r.get(t)){return l==t}var d=-1,u=true,h=n&uu?new ru:undefined;r.set(e,t);r.set(t,e);while(++d{this.listenTo(e,t,(e,t)=>{if(this.isEnabled){this.onDomEvent(t)}},{useCapture:this.useCapture})})}fire(e,t,n){if(this.isEnabled){this.document.fire(e,new Xu(this.view,t,n))}}}class th extends eh{constructor(e){super(e);this.domEventType=[\"keydown\",\"keyup\"]}onDomEvent(e){this.fire(e.type,e,{keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey||e.metaKey,shiftKey:e.shiftKey,get keystroke(){return zl(this)}})}}var nh=function(){return i[\"a\"].Date.now()};var ih=nh;var oh=0/0;var rh=/^\\s+|\\s+$/g;var sh=/^[-+]0x[0-9a-f]+$/i;var ah=/^0b[01]+$/i;var ch=/^0o[0-7]+$/i;var lh=parseInt;function dh(e){if(typeof e==\"number\"){return e}if(Zs(e)){return oh}if(ce(e)){var t=typeof e.valueOf==\"function\"?e.valueOf():e;e=ce(t)?t+\"\":t}if(typeof e!=\"string\"){return e===0?e:+e}e=e.replace(rh,\"\");var n=ah.test(e);return n||ch.test(e)?lh(e.slice(2),n?2:8):sh.test(e)?oh:+e}var uh=dh;var hh=\"Expected a function\";var fh=Math.max,mh=Math.min;function gh(e,t,n){var i,o,r,s,a,c,l=0,d=false,u=false,h=true;if(typeof e!=\"function\"){throw new TypeError(hh)}t=uh(t)||0;if(ce(n)){d=!!n.leading;u=\"maxWait\"in n;r=u?fh(uh(n.maxWait)||0,t):r;h=\"trailing\"in n?!!n.trailing:h}function f(t){var n=i,r=o;i=o=undefined;l=t;s=e.apply(r,n);return s}function m(e){l=e;a=setTimeout(b,t);return d?f(e):s}function g(e){var n=e-c,i=e-l,o=t-n;return u?mh(o,r-i):o}function p(e){var n=e-c,i=e-l;return c===undefined||n>=t||n<0||u&&i>=r}function b(){var e=ih();if(p(e)){return w(e)}a=setTimeout(b,g(e))}function w(e){a=undefined;if(h&&i){return f(e)}i=o=undefined;return s}function k(){if(a!==undefined){clearTimeout(a)}l=0;i=c=o=a=undefined}function _(){return a===undefined?s:w(ih())}function v(){var e=ih(),n=p(e);i=arguments;o=this;c=e;if(n){if(a===undefined){return m(c)}if(u){clearTimeout(a);a=setTimeout(b,t);return f(c)}}if(a===undefined){a=setTimeout(b,t)}return s}v.cancel=k;v.flush=_;return v}var ph=gh;class bh extends Zd{constructor(e){super(e);this._fireSelectionChangeDoneDebounced=ph(e=>this.document.fire(\"selectionChangeDone\",e),200)}observe(){const e=this.document;e.on(\"keydown\",(t,n)=>{const i=e.selection;if(i.isFake&&wh(n.keyCode)&&this.isEnabled){n.preventDefault();this._handleSelectionMove(n.keyCode)}},{priority:\"lowest\"})}destroy(){super.destroy();this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection;const n=new gl(t.getRanges(),{backward:t.isBackward,fake:false});if(e==Ol.arrowleft||e==Ol.arrowup){n.setTo(n.getFirstPosition())}if(e==Ol.arrowright||e==Ol.arrowdown){n.setTo(n.getLastPosition())}const i={oldSelection:t,newSelection:n,domSelection:null};this.document.fire(\"selectionChange\",i);this._fireSelectionChangeDoneDebounced(i)}}function wh(e){return e==Ol.arrowright||e==Ol.arrowleft||e==Ol.arrowup||e==Ol.arrowdown}class kh extends Zd{constructor(e){super(e);this.mutationObserver=e.getObserver(Zu);this.selection=this.document.selection;this.domConverter=e.domConverter;this._documents=new WeakSet;this._fireSelectionChangeDoneDebounced=ph(e=>this.document.fire(\"selectionChangeDone\",e),200);this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3);this._loopbackCounter=0}observe(e){const t=e.ownerDocument;if(this._documents.has(t)){return}this.listenTo(t,\"selectionchange\",()=>{this._handleSelectionChange(t)});this._documents.add(t)}destroy(){super.destroy();clearInterval(this._clearInfiniteLoopInterval);this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(e){if(!this.isEnabled){return}this.mutationObserver.flush();const t=e.defaultView.getSelection();const n=this.domConverter.domSelectionToView(t);if(n.rangeCount==0){this.view.hasDomSelection=false;return}this.view.hasDomSelection=true;if(this.selection.isEqual(n)&&this.domConverter.isDomSelectionCorrect(t)){return}if(++this._loopbackCounter>60){return}if(this.selection.isSimilar(n)){this.view.forceRender()}else{const e={oldSelection:this.selection,newSelection:n,domSelection:t};this.document.fire(\"selectionChange\",e);this._fireSelectionChangeDoneDebounced(e)}}_clearInfiniteLoop(){this._loopbackCounter=0}}class _h extends eh{constructor(e){super(e);this.domEventType=[\"focus\",\"blur\"];this.useCapture=true;const t=this.document;t.on(\"focus\",()=>{t.isFocused=true;this._renderTimeoutId=setTimeout(()=>e.forceRender(),50)});t.on(\"blur\",(n,i)=>{const o=t.selection.editableElement;if(o===null||o===i.target){t.isFocused=false;e.forceRender()}})}onDomEvent(e){this.fire(e.type,e)}destroy(){if(this._renderTimeoutId){clearTimeout(this._renderTimeoutId)}super.destroy()}}class vh extends eh{constructor(e){super(e);this.domEventType=[\"compositionstart\",\"compositionupdate\",\"compositionend\"];const t=this.document;t.on(\"compositionstart\",()=>{t.isComposing=true});t.on(\"compositionend\",()=>{t.isComposing=false})}onDomEvent(e){this.fire(e.type,e)}}class yh extends eh{constructor(e){super(e);this.domEventType=[\"beforeinput\"]}onDomEvent(e){this.fire(e.type,e)}}function xh(e){return Object.prototype.toString.apply(e)==\"[object Range]\"}function Ch(e){const t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}const Ah=[\"top\",\"right\",\"bottom\",\"left\",\"width\",\"height\"];class Th{constructor(e){const t=xh(e);Object.defineProperty(this,\"_source\",{value:e._source||e,writable:true,enumerable:false});if(Gr(e)||t){if(t){Sh(this,Th.getDomRangeRects(e)[0])}else{Sh(this,e.getBoundingClientRect())}}else if(Yd(e)){const{innerWidth:t,innerHeight:n}=e;Sh(this,{top:0,right:t,bottom:n,left:0,width:t,height:n})}else{Sh(this,e)}}clone(){return new Th(this)}moveTo(e,t){this.top=t;this.right=e+this.width;this.bottom=t+this.height;this.left=e;return this}moveBy(e,t){this.top+=t;this.right+=e;this.left+=e;this.bottom+=t;return 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)};t.width=t.right-t.left;t.height=t.bottom-t.top;if(t.width<0||t.height<0){return null}else{return new Th(t)}}getIntersectionArea(e){const t=this.getIntersection(e);if(t){return t.getArea()}else{return 0}}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(!Ph(e)){let n=e.parentNode||e.commonAncestorContainer;while(n&&!Ph(n)){const e=new Th(n);const i=t.getIntersection(e);if(i){if(i.getArea()jh(e,i));const s=jh(e,i);Nh(i,s,t);if(i.parent!=i){o=i.frameElement;i=i.parent;if(!o){return}}else{i=null}}}function Ih(e){const t=Bh(e);Rh(t,()=>new Th(e))}Object.assign(Eh,{scrollViewportToShowTarget:Mh,scrollAncestorsToShowTarget:Ih});function Nh(e,t,n){const i=t.clone().moveBy(0,n);const o=t.clone().moveBy(0,-n);const r=new Th(e).excludeScrollbarsAndBorders();const s=[o,i];if(!s.every(e=>r.contains(e))){let{scrollX:s,scrollY:a}=e;if(zh(o,r)){a-=r.top-t.top+n}else if(Oh(i,r)){a+=t.bottom-r.bottom+n}if(Vh(t,r)){s-=r.left-t.left+n}else if(Lh(t,r)){s+=t.right-r.right+n}e.scrollTo(s,a)}}function Rh(e,t){const n=Dh(e);let i,o;while(e!=n.document.body){o=t();i=new Th(e).excludeScrollbarsAndBorders();if(!i.contains(o)){if(zh(o,i)){e.scrollTop-=i.top-o.top}else if(Oh(o,i)){e.scrollTop+=o.bottom-i.bottom}if(Vh(o,i)){e.scrollLeft-=i.left-o.left}else if(Lh(o,i)){e.scrollLeft+=o.right-i.right}}e=e.parentNode}}function Oh(e,t){return e.bottom>t.bottom}function zh(e,t){return e.topt.right}function Dh(e){if(xh(e)){return e.startContainer.ownerDocument.defaultView}else{return e.ownerDocument.defaultView}}function Bh(e){if(xh(e)){let t=e.commonAncestorContainer;if(ld(t)){t=t.parentNode}return t}else{return e.parentNode}}function jh(e,t){const n=Dh(e);const i=new Th(e);if(n===t){return i}else{let e=n;while(e!=t){const t=e.frameElement;const n=new Th(t).excludeScrollbarsAndBorders();i.moveBy(n.left,n.top);e=e.parent}}return i}class Fh{constructor(e){this.document=new bl(e);this.domConverter=new Hd(this.document);this.domRoots=new Map;this.set(\"isRenderingInProgress\",false);this.set(\"hasDomSelection\",false);this._renderer=new Ed(this.domConverter,this.document.selection);this._renderer.bind(\"isFocused\").to(this.document);this._initialDomRootAttributes=new WeakMap;this._observers=new Map;this._ongoingChange=false;this._postFixersInProgress=false;this._renderingDisabled=false;this._hasChangedSinceTheLastRendering=false;this._writer=new Jl(this.document);this.addObserver(Zu);this.addObserver(kh);this.addObserver(_h);this.addObserver(th);this.addObserver(bh);this.addObserver(vh);if(Tl.isAndroid){this.addObserver(yh)}bd(this);Ul(this);this.on(\"render\",()=>{this._render();this.document.fire(\"layoutChanged\");this._hasChangedSinceTheLastRendering=false});this.listenTo(this.document.selection,\"change\",()=>{this._hasChangedSinceTheLastRendering=true})}attachDomRoot(e,t=\"main\"){const n=this.document.getRoot(t);n._name=e.tagName.toLowerCase();const i={};for(const{name:t,value:o}of Array.from(e.attributes)){i[t]=o;if(t===\"class\"){this._writer.addClass(o.split(\" \"),n)}else{this._writer.setAttribute(t,o,n)}}this._initialDomRootAttributes.set(e,i);const o=()=>{this._writer.setAttribute(\"contenteditable\",!n.isReadOnly,n);if(n.isReadOnly){this._writer.addClass(\"ck-read-only\",n)}else{this._writer.removeClass(\"ck-read-only\",n)}};o();this.domRoots.set(t,e);this.domConverter.bindElements(e,n);this._renderer.markToSync(\"children\",n);this._renderer.markToSync(\"attributes\",n);this._renderer.domDocuments.add(e.ownerDocument);n.on(\"change:children\",(e,t)=>this._renderer.markToSync(\"children\",t));n.on(\"change:attributes\",(e,t)=>this._renderer.markToSync(\"attributes\",t));n.on(\"change:text\",(e,t)=>this._renderer.markToSync(\"text\",t));n.on(\"change:isReadOnly\",()=>this.change(o));n.on(\"change\",()=>{this._hasChangedSinceTheLastRendering=true});for(const n of this._observers.values()){n.observe(e,t)}}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach(({name:e})=>t.removeAttribute(e));const n=this._initialDomRootAttributes.get(t);for(const e in n){t.setAttribute(e,n[e])}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(const[e,n]of this.domRoots){t.observe(n,e)}t.enable();return 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(){const e=this.document.selection.getFirstRange();if(e){Mh({target:this.domConverter.viewRangeToDom(e),viewportOffset:20})}}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;if(e){this.domConverter.focus(e);this.forceRender()}else{}}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress){throw new ss[\"b\"](\"cannot-change-view-tree: \"+\"Attempting to make changes to the view when it is in an incorrect state: rendering or post-fixers are in progress. \"+\"This may cause some unexpected behavior and inconsistency between the DOM and the view.\",this)}try{if(this._ongoingChange){return e(this._writer)}this._ongoingChange=true;const t=e(this._writer);this._ongoingChange=false;if(!this._renderingDisabled&&this._hasChangedSinceTheLastRendering){this._postFixersInProgress=true;this.document._callPostFixers(this._writer);this._postFixersInProgress=false;this.fire(\"render\")}return t}catch(e){ss[\"b\"].rethrowUnexpectedError(e,this)}}forceRender(){this._hasChangedSinceTheLastRendering=true;this.change(()=>{})}destroy(){for(const e of this._observers.values()){e.destroy()}this.document.destroy();this.stopListening()}createPositionAt(e,t){return ul._createAt(e,t)}createPositionAfter(e){return ul._createAfter(e)}createPositionBefore(e){return ul._createBefore(e)}createRange(e,t){return new hl(e,t)}createRangeOn(e){return hl._createOn(e)}createRangeIn(e){return hl._createIn(e)}createSelection(e,t,n){return new gl(e,t,n)}_disableRendering(e){this._renderingDisabled=e;if(e==false){this.change(()=>{})}}_render(){this.isRenderingInProgress=true;this.disableObservers();this._renderer.render();this.enableObservers();this.isRenderingInProgress=false}}ys(Fh,Qc);class Hh{constructor(e){this.parent=null;this._attrs=Ws(e)}get index(){let e;if(!this.parent){return null}if((e=this.parent.getChildIndex(this))===null){throw new ss[\"b\"](\"model-node-not-found-in-parent: The node's parent does not contain this node.\",this)}return e}get startOffset(){let e;if(!this.parent){return null}if((e=this.parent.getChildStartOffset(this))===null){throw new ss[\"b\"](\"model-node-not-found-in-parent: The node's parent does not contain this node.\",this)}return e}get offsetSize(){return 1}get endOffset(){if(!this.parent){return null}return this.startOffset+this.offsetSize}get nextSibling(){const e=this.index;return e!==null&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return e!==null&&this.parent.getChild(e-1)||null}get root(){let e=this;while(e.parent){e=e.parent}return e}isAttached(){return this.root.is(\"rootElement\")}getPath(){const e=[];let t=this;while(t.parent){e.unshift(t.startOffset);t=t.parent}return e}getAncestors(e={includeSelf:false,parentFirst:false}){const t=[];let n=e.includeSelf?this:this.parent;while(n){t[e.parentFirst?\"push\":\"unshift\"](n);n=n.parent}return t}getCommonAncestor(e,t={}){const n=this.getAncestors(t);const i=e.getAncestors(t);let o=0;while(n[o]==i[o]&&n[o]){o++}return o===0?null:n[o-1]}isBefore(e){if(this==e){return false}if(this.root!==e.root){return false}const t=this.getPath();const n=e.getPath();const i=zs(t,n);switch(i){case\"prefix\":return true;case\"extension\":return false;default:return t[i]{e[t[0]]=t[1];return e},{})}return e}is(e){return e===\"node\"||e===\"model:node\"}_clone(){return new Hh(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=Ws(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}class Wh extends Hh{constructor(e,t){super(t);this._data=e||\"\"}get offsetSize(){return this.data.length}get data(){return this._data}is(e){return e===\"$text\"||e===\"model:$text\"||e===\"text\"||e===\"model:text\"||e===\"node\"||e===\"model:node\"}toJSON(){const e=super.toJSON();e.data=this.data;return e}_clone(){return new Wh(this.data,this.getAttributes())}static fromJSON(e){return new Wh(e.data,e.attributes)}}class Uh{constructor(e,t,n){this.textNode=e;if(t<0||t>e.offsetSize){throw new ss[\"b\"](\"model-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.\",this)}if(n<0||t+n>e.offsetSize){throw new ss[\"b\"](\"model-textproxy-wrong-length: Given length value is incorrect.\",this)}this.data=e.data.substring(t,t+n);this.offsetInText=t}get startOffset(){return this.textNode.startOffset!==null?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return this.startOffset!==null?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 e===\"$textProxy\"||e===\"model:$textProxy\"||e===\"textProxy\"||e===\"model:textProxy\"}getPath(){const e=this.textNode.getPath();if(e.length>0){e[e.length-1]+=this.offsetInText}return e}getAncestors(e={includeSelf:false,parentFirst:false}){const t=[];let n=e.includeSelf?this:this.parent;while(n){t[e.parentFirst?\"push\":\"unshift\"](n);n=n.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 qh{constructor(e){this._nodes=[];if(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){const t=this._nodes.indexOf(e);return t==-1?null:t}getNodeStartOffset(e){const t=this.getNodeIndex(e);return t===null?null:this._nodes.slice(0,t).reduce((e,t)=>e+t.offsetSize,0)}indexToOffset(e){if(e==this._nodes.length){return this.maxOffset}const t=this._nodes[e];if(!t){throw new ss[\"b\"](\"model-nodelist-index-out-of-bounds: Given index cannot be found in the node list.\",this)}return this.getNodeStartOffset(t)}offsetToIndex(e){let t=0;for(const n of this._nodes){if(e>=t&&ee.toJSON())}}class $h extends Hh{constructor(e,t,n){super(t);this.name=e;this._children=new qh;if(n){this._insertChild(0,n)}}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}is(e,t=null){if(!t){return e===\"element\"||e===\"model:element\"||e===\"node\"||e===\"model:node\"}return t===this.name&&(e===\"element\"||e===\"model:element\")}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 n of e){t=t.getChild(t.offsetToIndex(n))}return t}findAncestor(e,t={includeSelf:false}){let n=t.includeSelf?this:this.parent;while(n){if(n.name===e){return n}n=n.parent}return null}toJSON(){const e=super.toJSON();e.name=this.name;if(this._children.length>0){e.children=[];for(const t of this._children){e.children.push(t.toJSON())}}return e}_clone(e=false){const t=e?Array.from(this._children).map(e=>e._clone(true)):null;return new $h(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=Yh(t);for(const e of n){if(e.parent!==null){e._remove()}e.parent=this}this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const e of n){e.parent=null}return n}static fromJSON(e){let t=null;if(e.children){t=[];for(const n of e.children){if(n.name){t.push($h.fromJSON(n))}else{t.push(Wh.fromJSON(n))}}}return new $h(e.name,e.attributes,t)}}function Yh(e){if(typeof e==\"string\"){return[new Wh(e)]}if(!vs(e)){e=[e]}return Array.from(e).map(e=>{if(typeof e==\"string\"){return new Wh(e)}if(e instanceof Uh){return new Wh(e.data,e.getAttributes())}return e})}class Gh{constructor(e={}){if(!e.boundaries&&!e.startPosition){throw new ss[\"b\"](\"model-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.\",null)}const t=e.direction||\"forward\";if(t!=\"forward\"&&t!=\"backward\"){throw new ss[\"b\"](\"model-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.\",e,{direction:t})}this.direction=t;this.boundaries=e.boundaries||null;if(e.startPosition){this.position=e.startPosition.clone()}else{this.position=Qh._createAt(this.boundaries[this.direction==\"backward\"?\"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,n,i,o;do{i=this.position;o=this._visitedParent;({done:t,value:n}=this.next())}while(!t&&e(n));if(!t){this.position=i;this._visitedParent=o}}next(){if(this.direction==\"forward\"){return this._next()}else{return this._previous()}}_next(){const e=this.position;const t=this.position.clone();const n=this._visitedParent;if(n.parent===null&&t.offset===n.maxOffset){return{done:true}}if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset){return{done:true}}const i=t.parent;const o=Jh(t,i);const r=o?o:Zh(t,i,o);if(r instanceof $h){if(!this.shallow){t.path.push(0);this._visitedParent=r}else{t.offset++}this.position=t;return Kh(\"elementStart\",r,e,t,1)}else if(r instanceof Wh){let i;if(this.singleCharacters){i=1}else{let e=r.endOffset;if(this._boundaryEndParent==n&&this.boundaries.end.offsete){e=this.boundaries.start.offset}i=t.offset-e}const o=t.offset-r.startOffset;const s=new Uh(r,o-i,i);t.offset-=i;this.position=t;return Kh(\"text\",s,e,t,i)}else{t.path.pop();this.position=t;this._visitedParent=n.parent;return Kh(\"elementStart\",n,e,t,1)}}}function Kh(e,t,n,i,o){return{done:false,value:{type:e,item:t,previousPosition:n,nextPosition:i,length:o}}}class Qh{constructor(e,t,n=\"toNone\"){if(!e.is(\"element\")&&!e.is(\"documentFragment\")){throw new ss[\"b\"](\"model-position-root-invalid: Position root invalid.\",e)}if(!(t instanceof Array)||t.length===0){throw new ss[\"b\"](\"model-position-path-incorrect-format: Position path must be an array with at least one item.\",e,{path:t})}if(e.is(\"rootElement\")){t=t.slice()}else{t=[...e.getPath(),...t];e=e.root}this.root=e;this.path=t;this.stickiness=n}get offset(){return this.path[this.path.length-1]}set offset(e){this.path[this.path.length-1]=e}get parent(){let e=this.root;for(let t=0;tn.path.length){if(t.offset!==o.maxOffset){return false}t.path=t.path.slice(0,-1);o=o.parent;t.offset++}else{if(n.offset!==0){return false}n.path=n.path.slice(0,-1)}}}is(e){return e===\"position\"||e===\"model:position\"}hasSameParentAs(e){if(this.root!==e.root){return false}const t=this.getParentPath();const n=e.getParentPath();return zs(t,n)==\"same\"}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=Qh._createAt(this);break}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;const n=t.containsPosition(this)||t.start.isEqual(this)&&this.stickiness==\"toNext\";if(n){return this._getCombined(e.splitPosition,e.moveTargetPosition)}else{if(e.graveyardPosition){return this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1)}else{return this._getTransformedByInsertion(e.insertionPosition,1)}}}_getTransformedByMergeOperation(e){const t=e.movedRange;const n=t.containsPosition(this)||t.start.isEqual(this);let i;if(n){i=this._getCombined(e.sourcePosition,e.targetPosition);if(e.sourcePosition.isBefore(e.targetPosition)){i=i._getTransformedByDeletion(e.deletionPosition,1)}}else if(this.isEqual(e.deletionPosition)){i=Qh._createAt(e.deletionPosition)}else{i=this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1)}return i}_getTransformedByDeletion(e,t){const n=Qh._createAt(this);if(this.root!=e.root){return n}if(zs(e.getParentPath(),this.getParentPath())==\"same\"){if(e.offsetthis.offset){return null}else{n.offset-=t}}}else if(zs(e.getParentPath(),this.getParentPath())==\"prefix\"){const i=e.path.length-1;if(e.offset<=this.path[i]){if(e.offset+t>this.path[i]){return null}else{n.path[i]-=t}}}return n}_getTransformedByInsertion(e,t){const n=Qh._createAt(this);if(this.root!=e.root){return n}if(zs(e.getParentPath(),this.getParentPath())==\"same\"){if(e.offsett+1){const t=i.maxOffset-n.offset;if(t!==0){e.push(new ef(n,n.getShiftedBy(t)))}n.path=n.path.slice(0,-1);n.offset++;i=i.parent}while(n.path.length<=this.end.path.length){const t=this.end.path[n.path.length-1];const i=t-n.offset;if(i!==0){e.push(new ef(n,n.getShiftedBy(i)))}n.offset=t;n.path.push(0)}return e}getWalker(e={}){e.boundaries=this;return new Gh(e)}*getItems(e={}){e.boundaries=this;e.ignoreElementEnd=true;const t=new Gh(e);for(const e of t){yield e.item}}*getPositions(e={}){e.boundaries=this;const t=new Gh(e);yield t.position;for(const e of t){yield e.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 ef(this.start,this.end)]}getTransformedByOperations(e){const t=[new ef(this.start,this.end)];for(const n of e){for(let e=0;e0?new this(n,i):new this(i,n)}static _createIn(e){return new this(Qh._createAt(e,0),Qh._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(Qh._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(e.length===0){throw new ss[\"b\"](\"range-create-from-ranges-empty-array: At least one range has to be passed.\",null)}else if(e.length==1){return e[0].clone()}const t=e[0];e.sort((e,t)=>e.start.isAfter(t.start)?1:-1);const n=e.indexOf(t);const i=new this(t.start,t.end);if(n>0){for(let t=n-1;true;t++){if(e[t].end.isEqual(i.start)){i.start=Qh._createAt(e[t].start)}else{break}}}for(let t=n+1;t{if(t.viewPosition){return}const n=this._modelToViewMapping.get(t.modelPosition.parent);t.viewPosition=this.findPositionIn(n,t.modelPosition.offset)},{priority:\"low\"});this.on(\"viewToModelPosition\",(e,t)=>{if(t.modelPosition){return}const n=this.findMappedViewAncestor(t.viewPosition);const i=this._viewToModelMapping.get(n);const o=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,n);t.modelPosition=Qh._createAt(i,o)},{priority:\"low\"})}bindElements(e,t){this._modelToViewMapping.set(e,t);this._viewToModelMapping.set(t,e)}unbindViewElement(e){const t=this.toModelElement(e);this._viewToModelMapping.delete(e);if(this._elementToMarkerNames.has(e)){for(const t of this._elementToMarkerNames.get(e)){this._unboundMarkerNames.add(t)}}if(this._modelToViewMapping.get(t)==e){this._modelToViewMapping.delete(t)}}unbindModelElement(e){const t=this.toViewElement(e);this._modelToViewMapping.delete(e);if(this._viewToModelMapping.get(t)==e){this._viewToModelMapping.delete(t)}}bindElementToMarker(e,t){const n=this._markerNameToElements.get(t)||new Set;n.add(e);const i=this._elementToMarkerNames.get(e)||new Set;i.add(t);this._markerNameToElements.set(t,n);this._elementToMarkerNames.set(e,i)}unbindElementFromMarkerName(e,t){const n=this._markerNameToElements.get(t);if(n){n.delete(e);if(n.size==0){this._markerNameToElements.delete(t)}}const i=this._elementToMarkerNames.get(e);if(i){i.delete(t);if(i.size==0){this._elementToMarkerNames.delete(e)}}}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);this._unboundMarkerNames.clear();return 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 ef(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new hl(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};this.fire(\"viewToModelPosition\",t);return t.modelPosition}toViewPosition(e,t={isPhantom:false}){const n={modelPosition:e,mapper:this,isPhantom:t.isPhantom};this.fire(\"modelToViewPosition\",n);return n.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t){return null}const n=new Set;for(const e of t){if(e.is(\"attributeElement\")){for(const t of e.getElementsWithSameId()){n.add(t)}}else{n.add(e)}}return n}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;while(!this._viewToModelMapping.has(t)){t=t.parent}return t}_toModelOffset(e,t,n){if(n!=e){const i=this._toModelOffset(e.parent,e.index,n);const o=this._toModelOffset(e,t,e);return i+o}if(e.is(\"$text\")){return t}let i=0;for(let n=0;n1?t[0]+\":\"+t[1]:t[0]}class rf{constructor(e){this.conversionApi=qc({dispatcher:this},e)}convertChanges(e,t,n){for(const t of e.getMarkersToRemove()){this.convertMarkerRemove(t.name,t.range,n)}for(const t of e.getChanges()){if(t.type==\"insert\"){this.convertInsert(ef._createFromPositionAndShift(t.position,t.length),n)}else if(t.type==\"remove\"){this.convertRemove(t.position,t.length,t.name,n)}else{this.convertAttribute(t.range,t.attributeKey,t.attributeOldValue,t.attributeNewValue,n)}}for(const e of this.conversionApi.mapper.flushUnboundMarkerNames()){const i=t.get(e).getRange();this.convertMarkerRemove(e,i,n);this.convertMarkerAdd(e,i,n)}for(const t of e.getMarkersToAdd()){this.convertMarkerAdd(t.name,t.range,n)}}convertInsert(e,t){this.conversionApi.writer=t;this.conversionApi.consumable=this._createInsertConsumable(e);for(const t of e){const e=t.item;const n=ef._createFromPositionAndShift(t.previousPosition,t.length);const i={item:e,range:n};this._testAndFire(\"insert\",i);for(const t of e.getAttributeKeys()){i.attributeKey=t;i.attributeOldValue=null;i.attributeNewValue=e.getAttribute(t);this._testAndFire(`attribute:${t}`,i)}}this._clearConversionApi()}convertRemove(e,t,n,i){this.conversionApi.writer=i;this.fire(\"remove:\"+n,{position:e,length:t},this.conversionApi);this._clearConversionApi()}convertAttribute(e,t,n,i,o){this.conversionApi.writer=o;this.conversionApi.consumable=this._createConsumableForRange(e,`attribute:${t}`);for(const o of e){const e=o.item;const r=ef._createFromPositionAndShift(o.previousPosition,o.length);const s={item:e,range:r,attributeKey:t,attributeOldValue:n,attributeNewValue:i};this._testAndFire(`attribute:${t}`,s)}this._clearConversionApi()}convertSelection(e,t,n){const i=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));this.conversionApi.writer=n;this.conversionApi.consumable=this._createSelectionConsumable(e,i);this.fire(\"selection\",{selection:e},this.conversionApi);if(!e.isCollapsed){return}for(const t of i){const n=t.getRange();if(!sf(e.getFirstPosition(),t,this.conversionApi.mapper)){continue}const i={item:e,markerName:t.name,markerRange:n};if(this.conversionApi.consumable.test(e,\"addMarker:\"+t.name)){this.fire(\"addMarker:\"+t.name,i,this.conversionApi)}}for(const t of e.getAttributeKeys()){const n={item:e,range:e.getFirstRange(),attributeKey:t,attributeOldValue:null,attributeNewValue:e.getAttribute(t)};if(this.conversionApi.consumable.test(e,\"attribute:\"+n.attributeKey)){this.fire(\"attribute:\"+n.attributeKey+\":$text\",n,this.conversionApi)}}this._clearConversionApi()}convertMarkerAdd(e,t,n){if(!t.root.document||t.root.rootName==\"$graveyard\"){return}this.conversionApi.writer=n;const i=\"addMarker:\"+e;const o=new nf;o.add(t,i);this.conversionApi.consumable=o;this.fire(i,{markerName:e,markerRange:t},this.conversionApi);if(!o.test(t,i)){return}this.conversionApi.consumable=this._createConsumableForRange(t,i);for(const n of t.getItems()){if(!this.conversionApi.consumable.test(n,i)){continue}const o={item:n,range:ef._createOn(n),markerName:e,markerRange:t};this.fire(i,o,this.conversionApi)}this._clearConversionApi()}convertMarkerRemove(e,t,n){if(!t.root.document||t.root.rootName==\"$graveyard\"){return}this.conversionApi.writer=n;this.fire(\"removeMarker:\"+e,{markerName:e,markerRange:t},this.conversionApi);this._clearConversionApi()}_createInsertConsumable(e){const t=new nf;for(const n of e){const e=n.item;t.add(e,\"insert\");for(const n of e.getAttributeKeys()){t.add(e,\"attribute:\"+n)}}return t}_createConsumableForRange(e,t){const n=new nf;for(const i of e.getItems()){n.add(i,t)}return n}_createSelectionConsumable(e,t){const n=new nf;n.add(e,\"selection\");for(const i of t){n.add(e,\"addMarker:\"+i.name)}for(const t of e.getAttributeKeys()){n.add(e,\"attribute:\"+t)}return n}_testAndFire(e,t){if(!this.conversionApi.consumable.test(t.item,e)){return}const n=t.item.name||\"$text\";this.fire(e+\":\"+n,t,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer;delete this.conversionApi.consumable}}ys(rf,ds);function sf(e,t,n){const i=t.getRange();const o=Array.from(e.getAncestors());o.shift();o.reverse();const r=o.some(e=>{if(i.containsItem(e)){const t=n.toViewElement(e);return!!t.getCustomProperty(\"addHighlight\")}});return!r}class af{constructor(e,t,n){this._lastRangeBackward=false;this._ranges=[];this._attrs=new Map;if(e){this.setTo(e,t,n)}}get anchor(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}get focus(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}get isCollapsed(){const e=this._ranges.length;if(e===1){return this._ranges[0].isCollapsed}else{return false}}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount){return false}else if(this.rangeCount===0){return true}if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus)){return false}for(const t of this._ranges){let n=false;for(const i of e._ranges){if(t.isEqual(i)){n=true;break}}if(!n){return false}}return true}*getRanges(){for(const e of this._ranges){yield new ef(e.start,e.end)}}getFirstRange(){let e=null;for(const t of this._ranges){if(!e||t.start.isBefore(e.start)){e=t}}return e?new ef(e.start,e.end):null}getLastRange(){let e=null;for(const t of this._ranges){if(!e||t.end.isAfter(e.end)){e=t}}return e?new ef(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(e,t,n){if(e===null){this._setRanges([])}else if(e instanceof af){this._setRanges(e.getRanges(),e.isBackward)}else if(e&&typeof e.getRanges==\"function\"){this._setRanges(e.getRanges(),e.isBackward)}else if(e instanceof ef){this._setRanges([e],!!t&&!!t.backward)}else if(e instanceof Qh){this._setRanges([new ef(e)])}else if(e instanceof Hh){const i=!!n&&!!n.backward;let o;if(t==\"in\"){o=ef._createIn(e)}else if(t==\"on\"){o=ef._createOn(e)}else if(t!==undefined){o=new ef(Qh._createAt(e,t))}else{throw new ss[\"b\"](\"model-selection-setTo-required-second-parameter: \"+\"selection.setTo requires the second parameter when the first parameter is a node.\",[this,e])}this._setRanges([o],i)}else if(vs(e)){this._setRanges(e,t&&!!t.backward)}else{throw new ss[\"b\"](\"model-selection-setTo-not-selectable: Cannot set the selection to the given place.\",[this,e])}}_setRanges(e,t=false){e=Array.from(e);const n=e.some(t=>{if(!(t instanceof ef)){throw new ss[\"b\"](\"model-selection-set-ranges-not-range: \"+\"Selection range set to an object that is not an instance of model.Range.\",[this,e])}return this._ranges.every(e=>!e.isEqual(t))});if(e.length===this._ranges.length&&!n){return}this._removeAllRanges();for(const t of e){this._pushRange(t)}this._lastRangeBackward=!!t;this.fire(\"change:range\",{directChange:true})}setFocus(e,t){if(this.anchor===null){throw new ss[\"b\"](\"model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.\",[this,e])}const n=Qh._createAt(e,t);if(n.compareWith(this.focus)==\"same\"){return}const i=this.anchor;if(this._ranges.length){this._popRange()}if(n.compareWith(i)==\"before\"){this._pushRange(new ef(n,i));this._lastRangeBackward=true}else{this._pushRange(new ef(i,n));this._lastRangeBackward=false}this.fire(\"change:range\",{directChange:true})}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){if(this.hasAttribute(e)){this._attrs.delete(e);this.fire(\"change:attribute\",{attributeKeys:[e],directChange:true})}}setAttribute(e,t){if(this.getAttribute(e)!==t){this._attrs.set(e,t);this.fire(\"change:attribute\",{attributeKeys:[e],directChange:true})}}getSelectedElement(){if(this.rangeCount!==1){return null}return this.getFirstRange().getContainedElement()}is(e){return e===\"selection\"||e===\"model:selection\"}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const n=df(t.start,e);if(n&&uf(n,t)){yield n}for(const n of t.getWalker()){const i=n.item;if(n.type==\"elementEnd\"&&lf(i,e,t)){yield i}}const i=df(t.end,e);if(i&&!t.end.isTouching(Qh._createAt(i,0))&&uf(i,t)){yield i}}}containsEntireContent(e=this.anchor.root){const t=Qh._createAt(e,0);const n=Qh._createAt(e,\"end\");return t.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e);this._ranges.push(new ef(e.start,e.end))}_checkRange(e){for(let t=0;t0){this._popRange()}}_popRange(){this._ranges.pop()}}ys(af,ds);function cf(e,t){if(t.has(e)){return false}t.add(e);return e.root.document.model.schema.isBlock(e)&&e.parent}function lf(e,t,n){return cf(e,t)&&uf(e,n)}function df(e,t){const n=e.parent;const i=n.root.document.model.schema;const o=e.parent.getAncestors({parentFirst:true,includeSelf:true});let r=false;const s=o.find(e=>{if(r){return false}r=i.isLimit(e);return!r&&cf(e,t)});o.forEach(e=>t.add(e));return s}function uf(e,t){const n=hf(e);if(!n){return true}const i=t.containsRange(ef._createOn(n),true);return!i}function hf(e){const t=e.root.document.model.schema;let n=e.parent;while(n){if(t.isBlock(n)){return n}n=n.parent}}class ff extends ef{constructor(e,t){super(e,t);mf.call(this)}detach(){this.stopListening()}is(e){return e===\"liveRange\"||e===\"model:liveRange\"||e==\"range\"||e===\"model:range\"}toRange(){return new ef(this.start,this.end)}static fromRange(e){return new ff(e.start,e.end)}}function mf(){this.listenTo(this.root.document.model,\"applyOperation\",(e,t)=>{const n=t[0];if(!n.isDocumentOperation){return}gf.call(this,n)},{priority:\"low\"})}function gf(e){const t=this.getTransformedByOperation(e);const n=ef._createFromRanges(t);const i=!n.isEqual(this);const o=pf(this,e);let r=null;if(i){if(n.root.rootName==\"$graveyard\"){if(e.type==\"remove\"){r=e.sourcePosition}else{r=e.deletionPosition}}const t=this.toRange();this.start=n.start;this.end=n.end;this.fire(\"change:range\",t,{deletionPosition:r})}else if(o){this.fire(\"change:content\",this.toRange(),{deletionPosition:r})}}function pf(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 false}ys(ff,ds);const bf=\"selection:\";class wf{constructor(e){this._selection=new kf(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(false)}is(e){return e===\"selection\"||e==\"model:selection\"||e==\"documentSelection\"||e==\"model:documentSelection\"}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(e,t,n){this._selection.setTo(e,t,n)}_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 bf+e}static _isStoreAttributeKey(e){return e.startsWith(bf)}}ys(wf,ds);class kf extends af{constructor(e){super();this.markers=new xs({idProperty:\"name\"});this._model=e.model;this._document=e;this._attributePriority=new Map;this._selectionRestorePosition=null;this._hasChangedRange=false;this._overriddenGravityRegister=new Set;this.listenTo(this._model,\"applyOperation\",(e,t)=>{const n=t[0];if(!n.isDocumentOperation||n.type==\"marker\"||n.type==\"rename\"||n.type==\"noop\"){return}if(this._ranges.length==0&&this._selectionRestorePosition){this._fixGraveyardSelection(this._selectionRestorePosition)}this._selectionRestorePosition=null;if(this._hasChangedRange){this._hasChangedRange=false;this.fire(\"change:range\",{directChange:false})}},{priority:\"lowest\"});this.on(\"change:range\",()=>{for(const e of this.getRanges()){if(!this._document._validateSelectionRange(e)){throw new ss[\"b\"](\"document-selection-wrong-position: Range from document selection starts or ends at incorrect position.\",this,{range:e})}}});this.listenTo(this._model.markers,\"update\",()=>this._updateMarkers());this.listenTo(this._document,\"change\",(e,t)=>{vf(this._model,t)})}get isCollapsed(){const e=this._ranges.length;return e===0?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let e=0;e{this._hasChangedRange=true;if(t.root==this._document.graveyard){this._selectionRestorePosition=i.deletionPosition;const e=this._ranges.indexOf(t);this._ranges.splice(e,1);t.detach()}});return t}_updateMarkers(){const e=[];let t=false;for(const t of this._model.markers){const n=t.getRange();for(const i of this.getRanges()){if(n.containsRange(i,!i.isCollapsed)){e.push(t)}}}const n=Array.from(this.markers);for(const n of e){if(!this.markers.has(n)){this.markers.add(n);t=true}}for(const n of Array.from(this.markers)){if(!e.includes(n)){this.markers.remove(n);t=true}}if(t){this.fire(\"change:marker\",{oldMarkers:n,directChange:false})}}_updateAttributes(e){const t=Ws(this._getSurroundingAttributes());const n=Ws(this.getAttributes());if(e){this._attributePriority=new Map;this._attrs=new Map}else{for(const[e,t]of this._attributePriority){if(t==\"low\"){this._attrs.delete(e);this._attributePriority.delete(e)}}}this._setAttributesTo(t);const i=[];for(const[e,t]of this.getAttributes()){if(!n.has(e)||n.get(e)!==t){i.push(e)}}for(const[e]of n){if(!this.hasAttribute(e)){i.push(e)}}if(i.length>0){this.fire(\"change:attribute\",{attributeKeys:i,directChange:false})}}_setAttribute(e,t,n=true){const i=n?\"normal\":\"low\";if(i==\"low\"&&this._attributePriority.get(e)==\"normal\"){return false}const o=super.getAttribute(e);if(o===t){return false}this._attrs.set(e,t);this._attributePriority.set(e,i);return true}_removeAttribute(e,t=true){const n=t?\"normal\":\"low\";if(n==\"low\"&&this._attributePriority.get(e)==\"normal\"){return false}this._attributePriority.set(e,n);if(!super.hasAttribute(e)){return false}this._attrs.delete(e);return true}_setAttributesTo(e){const t=new Set;for(const[t,n]of this.getAttributes()){if(e.get(t)===n){continue}this._removeAttribute(t,false)}for(const[n,i]of e){const e=this._setAttribute(n,i,false);if(e){t.add(n)}}return t}*_getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty){for(const t of e.getAttributeKeys()){if(t.startsWith(bf)){const n=t.substr(bf.length);yield[n,e.getAttribute(t)]}}}}_getSurroundingAttributes(){const e=this.getFirstPosition();const t=this._model.schema;let n=null;if(!this.isCollapsed){const e=this.getFirstRange();for(const i of e){if(i.item.is(\"element\")&&t.isObject(i.item)){break}if(i.type==\"text\"){n=i.item.getAttributes();break}}}else{const t=e.textNode?e.textNode:e.nodeBefore;const i=e.textNode?e.textNode:e.nodeAfter;if(!this.isGravityOverridden){n=_f(t)}if(!n){n=_f(i)}if(!this.isGravityOverridden&&!n){let e=t;while(e&&!n){e=e.previousSibling;n=_f(e)}}if(!n){let e=i;while(e&&!n){e=e.nextSibling;n=_f(e)}}if(!n){n=this._getStoredAttributes()}}return n}_fixGraveyardSelection(e){const t=this._model.schema.getNearestSelectionRange(e);if(t){this._pushRange(t)}}}function _f(e){if(e instanceof Uh||e instanceof Wh){return e.getAttributes()}return null}function vf(e,t){const n=e.document.differ;for(const i of n.getChanges()){if(i.type!=\"insert\"){continue}const n=i.position.parent;const o=i.length===n.maxOffset;if(o){e.enqueueChange(t,e=>{const t=Array.from(n.getAttributeKeys()).filter(e=>e.startsWith(bf));for(const i of t){e.removeAttribute(i,n)}})}}}class yf{constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers){e(t)}return this}}var xf=1,Cf=4;function Af(e){return Hr(e,xf|Cf)}var Tf=Af;class Sf extends yf{elementToElement(e){return this.add(Yf(e))}attributeToElement(e){return this.add(Gf(e))}attributeToAttribute(e){return this.add(Kf(e))}markerToElement(e){return this.add(Qf(e))}markerToHighlight(e){return this.add(Zf(e))}markerToData(e){return this.add(Jf(e))}}function Pf(){return(e,t,n)=>{if(!n.consumable.consume(t.item,\"insert\")){return}const i=n.writer;const o=n.mapper.toViewPosition(t.range.start);const r=i.createText(t.item.data);i.insert(o,r)}}function Ef(){return(e,t,n)=>{const i=n.mapper.toViewPosition(t.position);const o=t.position.getShiftedBy(t.length);const r=n.mapper.toViewPosition(o,{isPhantom:true});const s=n.writer.createRange(i,r);const a=n.writer.remove(s.getTrimmed());for(const e of n.writer.createRangeIn(a).getItems()){n.mapper.unbindViewElement(e)}}}function Mf(e,t){const n=e.createAttributeElement(\"span\",t.attributes);if(t.classes){n._addClass(t.classes)}if(t.priority){n._priority=t.priority}n._id=t.id;return n}function If(){return(e,t,n)=>{const i=t.selection;if(i.isCollapsed){return}if(!n.consumable.consume(i,\"selection\")){return}const o=[];for(const e of i.getRanges()){const t=n.mapper.toViewRange(e);o.push(t)}n.writer.setSelection(o,{backward:i.isBackward})}}function Nf(){return(e,t,n)=>{const i=t.selection;if(!i.isCollapsed){return}if(!n.consumable.consume(i,\"selection\")){return}const o=n.writer;const r=i.getFirstPosition();const s=n.mapper.toViewPosition(r);const a=o.breakAttributes(s);o.setSelection(a)}}function Rf(){return(e,t,n)=>{const i=n.writer;const o=i.document.selection;for(const e of o.getRanges()){if(e.isCollapsed){if(e.end.parent.isAttached()){n.writer.mergeAttributes(e.start)}}}i.setSelection(null)}}function Of(e){return(t,n,i)=>{const o=e(n.attributeOldValue,i.writer);const r=e(n.attributeNewValue,i.writer);if(!o&&!r){return}if(!i.consumable.consume(n.item,t.name)){return}const s=i.writer;const a=s.document.selection;if(n.item instanceof af||n.item instanceof wf){s.wrap(a.getFirstRange(),r)}else{let e=i.mapper.toViewRange(n.range);if(n.attributeOldValue!==null&&o){e=s.unwrap(e,o)}if(n.attributeNewValue!==null&&r){s.wrap(e,r)}}}}function zf(e){return(t,n,i)=>{const o=e(n.item,i.writer);if(!o){return}if(!i.consumable.consume(n.item,\"insert\")){return}const r=i.mapper.toViewPosition(n.range.start);i.mapper.bindElements(n.item,o);i.writer.insert(r,o)}}function Vf(e){return(t,n,i)=>{n.isOpening=true;const o=e(n,i.writer);n.isOpening=false;const r=e(n,i.writer);if(!o||!r){return}const s=n.markerRange;if(s.isCollapsed&&!i.consumable.consume(s,t.name)){return}for(const e of s){if(!i.consumable.consume(e.item,t.name)){return}}const a=i.mapper;const c=i.writer;c.insert(a.toViewPosition(s.start),o);i.mapper.bindElementToMarker(o,n.markerName);if(!s.isCollapsed){c.insert(a.toViewPosition(s.end),r);i.mapper.bindElementToMarker(r,n.markerName)}t.stop()}}function Lf(){return(e,t,n)=>{const i=n.mapper.markerNameToElements(t.markerName);if(!i){return}for(const e of i){n.mapper.unbindElementFromMarkerName(e,t.markerName);n.writer.clear(n.writer.createRangeOn(e),e)}n.writer.clearClonedElementsGroup(t.markerName);e.stop()}}function Df(e){return(t,n,i)=>{const o=e(n.markerName);if(!o){return}const r=n.markerRange;if(!i.consumable.consume(r,t.name)){return}Bf(r,false,i,n,o);Bf(r,true,i,n,o);t.stop()}}function Bf(e,t,n,i,o){const r=t?e.start:e.end;const s=n.schema.checkChild(r,\"$text\");if(s){const e=n.mapper.toViewPosition(r);Ff(e,t,n,i,o)}else{let e;let s;if(t&&r.nodeAfter||!t&&!r.nodeBefore){e=r.nodeAfter;s=true}else{e=r.nodeBefore;s=false}const a=n.mapper.toViewElement(e);jf(a,t,s,n,i,o)}}function jf(e,t,n,i,o,r){const s=`data-${r.group}-${t?\"start\":\"end\"}-${n?\"before\":\"after\"}`;const a=e.hasAttribute(s)?e.getAttribute(s).split(\",\"):[];a.unshift(r.name);i.writer.setAttribute(s,a.join(\",\"),e);i.mapper.bindElementToMarker(e,o.markerName)}function Ff(e,t,n,i,o){const r=`${o.group}-${t?\"start\":\"end\"}`;const s=o.name?{name:o.name}:null;const a=n.writer.createUIElement(r,s);n.writer.insert(e,a);n.mapper.bindElementToMarker(a,i.markerName)}function Hf(e){return(t,n,i)=>{const o=e(n.markerName);if(!o){return}const r=i.mapper.markerNameToElements(n.markerName);if(!r){return}for(const e of r){i.mapper.unbindElementFromMarkerName(e,n.markerName);if(e.is(\"containerElement\")){s(`data-${o.group}-start-before`,e);s(`data-${o.group}-start-after`,e);s(`data-${o.group}-end-before`,e);s(`data-${o.group}-end-after`,e)}else{i.writer.clear(i.writer.createRangeOn(e),e)}}i.writer.clearClonedElementsGroup(n.markerName);t.stop();function s(e,t){if(t.hasAttribute(e)){const n=new Set(t.getAttribute(e).split(\",\"));n.delete(o.name);if(n.size==0){i.writer.removeAttribute(e,t)}else{i.writer.setAttribute(e,Array.from(n).join(\",\"),t)}}}}}function Wf(e){return(t,n,i)=>{const o=e(n.attributeOldValue,n);const r=e(n.attributeNewValue,n);if(!o&&!r){return}if(!i.consumable.consume(n.item,t.name)){return}const s=i.mapper.toViewElement(n.item);const a=i.writer;if(!s){throw new ss[\"b\"](\"conversion-attribute-to-attribute-on-text: \"+\"Trying to convert text node's attribute with attribute-to-attribute converter.\",[n,i])}if(n.attributeOldValue!==null&&o){if(o.key==\"class\"){const e=Array.isArray(o.value)?o.value:[o.value];for(const t of e){a.removeClass(t,s)}}else if(o.key==\"style\"){const e=Object.keys(o.value);for(const t of e){a.removeStyle(t,s)}}else{a.removeAttribute(o.key,s)}}if(n.attributeNewValue!==null&&r){if(r.key==\"class\"){const e=Array.isArray(r.value)?r.value:[r.value];for(const t of e){a.addClass(t,s)}}else if(r.key==\"style\"){const e=Object.keys(r.value);for(const t of e){a.setStyle(t,r.value[t],s)}}else{a.setAttribute(r.key,r.value,s)}}}}function Uf(e){return(t,n,i)=>{if(!n.item){return}if(!(n.item instanceof af||n.item instanceof wf)&&!n.item.is(\"$textProxy\")){return}const o=im(e,n,i);if(!o){return}if(!i.consumable.consume(n.item,t.name)){return}const r=i.writer;const s=Mf(r,o);const a=r.document.selection;if(n.item instanceof af||n.item instanceof wf){r.wrap(a.getFirstRange(),s,a)}else{const e=i.mapper.toViewRange(n.range);const t=r.wrap(e,s);for(const e of t.getItems()){if(e.is(\"attributeElement\")&&e.isSimilar(s)){i.mapper.bindElementToMarker(e,n.markerName);break}}}}}function qf(e){return(t,n,i)=>{if(!n.item){return}if(!(n.item instanceof $h)){return}const o=im(e,n,i);if(!o){return}if(!i.consumable.test(n.item,t.name)){return}const r=i.mapper.toViewElement(n.item);if(r&&r.getCustomProperty(\"addHighlight\")){i.consumable.consume(n.item,t.name);for(const e of ef._createIn(n.item)){i.consumable.consume(e.item,t.name)}r.getCustomProperty(\"addHighlight\")(r,o,i.writer);i.mapper.bindElementToMarker(r,n.markerName)}}}function $f(e){return(t,n,i)=>{if(n.markerRange.isCollapsed){return}const o=im(e,n,i);if(!o){return}const r=Mf(i.writer,o);const s=i.mapper.markerNameToElements(n.markerName);if(!s){return}for(const e of s){i.mapper.unbindElementFromMarkerName(e,n.markerName);if(e.is(\"attributeElement\")){i.writer.unwrap(i.writer.createRangeOn(e),r)}else{e.getCustomProperty(\"removeHighlight\")(e,o.id,i.writer)}}i.writer.clearClonedElementsGroup(n.markerName);t.stop()}}function Yf(e){e=Tf(e);e.view=Xf(e.view,\"container\");return t=>{t.on(\"insert:\"+e.model,zf(e.view),{priority:e.converterPriority||\"normal\"})}}function Gf(e){e=Tf(e);const t=e.model.key?e.model.key:e.model;let n=\"attribute:\"+t;if(e.model.name){n+=\":\"+e.model.name}if(e.model.values){for(const t of e.model.values){e.view[t]=Xf(e.view[t],\"attribute\")}}else{e.view=Xf(e.view,\"attribute\")}const i=tm(e);return t=>{t.on(n,Of(i),{priority:e.converterPriority||\"normal\"})}}function Kf(e){e=Tf(e);const t=e.model.key?e.model.key:e.model;let n=\"attribute:\"+t;if(e.model.name){n+=\":\"+e.model.name}if(e.model.values){for(const t of e.model.values){e.view[t]=nm(e.view[t])}}else{e.view=nm(e.view)}const i=tm(e);return t=>{t.on(n,Wf(i),{priority:e.converterPriority||\"normal\"})}}function Qf(e){e=Tf(e);e.view=Xf(e.view,\"ui\");return t=>{t.on(\"addMarker:\"+e.model,Vf(e.view),{priority:e.converterPriority||\"normal\"});t.on(\"removeMarker:\"+e.model,Lf(e.view),{priority:e.converterPriority||\"normal\"})}}function Jf(e){e=Tf(e);const t=e.model;if(!e.view){e.view=n=>({group:t,name:n.substr(e.model.length+1)})}return n=>{n.on(\"addMarker:\"+t,Df(e.view),{priority:e.converterPriority||\"normal\"});n.on(\"removeMarker:\"+t,Hf(e.view),{priority:e.converterPriority||\"normal\"})}}function Zf(e){return t=>{t.on(\"addMarker:\"+e.model,Uf(e.view),{priority:e.converterPriority||\"normal\"});t.on(\"addMarker:\"+e.model,qf(e.view),{priority:e.converterPriority||\"normal\"});t.on(\"removeMarker:\"+e.model,$f(e.view),{priority:e.converterPriority||\"normal\"})}}function Xf(e,t){if(typeof e==\"function\"){return e}return(n,i)=>em(e,i,t)}function em(e,t,n){if(typeof e==\"string\"){e={name:e}}let i;const o=Object.assign({},e.attributes);if(n==\"container\"){i=t.createContainerElement(e.name,o)}else if(n==\"attribute\"){const n={priority:e.priority||kl.DEFAULT_PRIORITY};i=t.createAttributeElement(e.name,o,n)}else{i=t.createUIElement(e.name,o)}if(e.styles){const n=Object.keys(e.styles);for(const o of n){t.setStyle(o,e.styles[o],i)}}if(e.classes){const n=e.classes;if(typeof n==\"string\"){t.addClass(n,i)}else{for(const e of n){t.addClass(e,i)}}}return i}function tm(e){if(e.model.values){return(t,n)=>{const i=e.view[t];if(i){return i(t,n)}return null}}else{return e.view}}function nm(e){if(typeof e==\"string\"){return t=>({key:e,value:t})}else if(typeof e==\"object\"){if(e.value){return()=>e}else{return t=>({key:e.key,value:t})}}else{return e}}function im(e,t,n){const i=typeof e==\"function\"?e(t,n):e;if(!i){return null}if(!i.priority){i.priority=10}if(!i.id){i.id=t.markerName}return i}class om extends yf{elementToElement(e){return this.add(cm(e))}elementToAttribute(e){return this.add(lm(e))}attributeToAttribute(e){return this.add(dm(e))}elementToMarker(e){console.warn(Object(ss[\"a\"])(\"upcast-helpers-element-to-marker-deprecated: \"+\"The UpcastHelpers#elementToMarker() method has been deprecated and will be removed in the near future. \"+\"Please use UpcastHelpers#dataToMarker() instead.\"));return this.add(um(e))}dataToMarker(e){return this.add(hm(e))}}function rm(){return(e,t,n)=>{if(!t.modelRange&&n.consumable.consume(t.viewItem,{name:true})){const{modelRange:e,modelCursor:i}=n.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e;t.modelCursor=i}}}function sm(){return(e,t,n)=>{if(n.schema.checkChild(t.modelCursor,\"$text\")){if(n.consumable.consume(t.viewItem)){const e=n.writer.createText(t.viewItem.data);n.writer.insert(e,t.modelCursor);t.modelRange=ef._createFromPositionAndShift(t.modelCursor,e.offsetSize);t.modelCursor=t.modelRange.end}}}}function am(e,t){return(n,i)=>{const o=i.newSelection;const r=new af;const s=[];for(const e of o.getRanges()){s.push(t.toModelRange(e))}r.setTo(s,{backward:o.isBackward});if(!r.isEqual(e.document.selection)){e.change(e=>{e.setSelection(r)})}}}function cm(e){e=Tf(e);const t=gm(e);const n=mm(e.view);const i=n?\"element:\"+n:\"element\";return n=>{n.on(i,t,{priority:e.converterPriority||\"normal\"})}}function lm(e){e=Tf(e);wm(e);const t=km(e,false);const n=mm(e.view);const i=n?\"element:\"+n:\"element\";return n=>{n.on(i,t,{priority:e.converterPriority||\"low\"})}}function dm(e){e=Tf(e);let t=null;if(typeof e.view==\"string\"||e.view.key){t=bm(e)}wm(e,t);const n=km(e,true);return t=>{t.on(\"element\",n,{priority:e.converterPriority||\"low\"})}}function um(e){e=Tf(e);ym(e);return cm(e)}function hm(e){e=Tf(e);if(!e.model){e.model=t=>t?e.view+\":\"+t:e.view}const t=gm(xm(e,\"start\"));const n=gm(xm(e,\"end\"));return i=>{i.on(\"element:\"+e.view+\"-start\",t,{priority:e.converterPriority||\"normal\"});i.on(\"element:\"+e.view+\"-end\",n,{priority:e.converterPriority||\"normal\"});const o=os.get(\"low\");const r=os.get(\"highest\");const s=os.get(e.converterPriority)/r;i.on(\"element\",fm(e),{priority:o+s})}}function fm(e){return(t,n,i)=>{const o=`data-${e.view}`;if(!n.modelRange){n=Object.assign(n,i.convertChildren(n.viewItem,n.modelCursor))}if(i.consumable.consume(n.viewItem,{attributes:o+\"-end-after\"})){r(n.modelRange.end,n.viewItem.getAttribute(o+\"-end-after\").split(\",\"))}if(i.consumable.consume(n.viewItem,{attributes:o+\"-start-after\"})){r(n.modelRange.end,n.viewItem.getAttribute(o+\"-start-after\").split(\",\"))}if(i.consumable.consume(n.viewItem,{attributes:o+\"-end-before\"})){r(n.modelRange.start,n.viewItem.getAttribute(o+\"-end-before\").split(\",\"))}if(i.consumable.consume(n.viewItem,{attributes:o+\"-start-before\"})){r(n.modelRange.start,n.viewItem.getAttribute(o+\"-start-before\").split(\",\"))}function r(t,o){for(const r of o){const o=e.model(r);const s=i.writer.createElement(\"$marker\",{\"data-name\":o});i.writer.insert(s,t);if(n.modelCursor.isEqual(t)){n.modelCursor=n.modelCursor.getShiftedBy(1)}else{n.modelCursor=n.modelCursor._getTransformedByInsertion(t,1)}n.modelRange=n.modelRange._getTransformedByInsertion(t,1)[0]}}}}function mm(e){if(typeof e==\"string\"){return e}if(typeof e==\"object\"&&typeof e.name==\"string\"){return e.name}return null}function gm(e){const t=e.view?new Us(e.view):null;return(n,i,o)=>{let r={};if(t){const e=t.match(i.viewItem);if(!e){return}r=e.match}r.name=true;const s=pm(e.model,i.viewItem,o.writer);if(!s){return}if(!o.consumable.test(i.viewItem,r)){return}const a=o.splitToAllowedParent(s,i.modelCursor);if(!a){return}o.writer.insert(s,a.position);o.convertChildren(i.viewItem,o.writer.createPositionAt(s,0));o.consumable.consume(i.viewItem,r);const c=o.getSplitParts(s);i.modelRange=new ef(o.writer.createPositionBefore(s),o.writer.createPositionAfter(c[c.length-1]));if(a.cursorParent){i.modelCursor=o.writer.createPositionAt(a.cursorParent,0)}else{i.modelCursor=i.modelRange.end}}}function pm(e,t,n){if(e instanceof Function){return e(t,n)}else{return n.createElement(e)}}function bm(e){if(typeof e.view==\"string\"){e.view={key:e.view}}const t=e.view.key;let n;if(t==\"class\"||t==\"style\"){const i=t==\"class\"?\"classes\":\"styles\";n={[i]:e.view.value}}else{const i=typeof e.view.value==\"undefined\"?/[\\s\\S]*/:e.view.value;n={attributes:{[t]:i}}}if(e.view.name){n.name=e.view.name}e.view=n;return t}function wm(e,t=null){const n=t===null?true:e=>e.getAttribute(t);const i=typeof e.model!=\"object\"?e.model:e.model.key;const o=typeof e.model!=\"object\"||typeof e.model.value==\"undefined\"?n:e.model.value;e.model={key:i,value:o}}function km(e,t){const n=new Us(e.view);return(i,o,r)=>{const s=n.match(o.viewItem);if(!s){return}const a=e.model.key;const c=typeof e.model.value==\"function\"?e.model.value(o.viewItem):e.model.value;if(c===null){return}if(_m(e.view,o.viewItem)){s.match.name=true}else{delete s.match.name}if(!r.consumable.test(o.viewItem,s.match)){return}if(!o.modelRange){o=Object.assign(o,r.convertChildren(o.viewItem,o.modelCursor))}const l=vm(o.modelRange,{key:a,value:c},t,r);if(l){r.consumable.consume(o.viewItem,s.match)}}}function _m(e,t){const n=typeof e==\"function\"?e(t):e;if(typeof n==\"object\"&&!mm(n)){return false}return!n.classes&&!n.attributes&&!n.styles}function vm(e,t,n,i){let o=false;for(const r of Array.from(e.getItems({shallow:n}))){if(i.schema.checkAttribute(r,t.key)){i.writer.setAttribute(t.key,t.value,r);o=true}}return o}function ym(e){const t=e.model;e.model=(e,n)=>{const i=typeof t==\"string\"?t:t(e);return n.createElement(\"$marker\",{\"data-name\":i})}}function xm(e,t){const n={};n.view=e.view+\"-\"+t;n.model=(t,n)=>{const i=t.getAttribute(\"name\");const o=e.model(i);return n.createElement(\"$marker\",{\"data-name\":o})};return n}class Cm{constructor(e,t){this.model=e;this.view=new Fh(t);this.mapper=new tf;this.downcastDispatcher=new rf({mapper:this.mapper,schema:e.schema});const n=this.model.document;const i=n.selection;const o=this.model.markers;this.listenTo(this.model,\"_beforeChanges\",()=>{this.view._disableRendering(true)},{priority:\"highest\"});this.listenTo(this.model,\"_afterChanges\",()=>{this.view._disableRendering(false)},{priority:\"lowest\"});this.listenTo(n,\"change\",()=>{this.view.change(e=>{this.downcastDispatcher.convertChanges(n.differ,o,e);this.downcastDispatcher.convertSelection(i,o,e)})},{priority:\"low\"});this.listenTo(this.view.document,\"selectionChange\",am(this.model,this.mapper));this.downcastDispatcher.on(\"insert:$text\",Pf(),{priority:\"lowest\"});this.downcastDispatcher.on(\"remove\",Ef(),{priority:\"low\"});this.downcastDispatcher.on(\"selection\",Rf(),{priority:\"low\"});this.downcastDispatcher.on(\"selection\",If(),{priority:\"low\"});this.downcastDispatcher.on(\"selection\",Nf(),{priority:\"low\"});this.view.document.roots.bindTo(this.model.document.roots).using(e=>{if(e.rootName==\"$graveyard\"){return null}const t=new ll(this.view.document,e.name);t.rootName=e.rootName;this.mapper.bindElements(e,t);return t})}destroy(){this.view.destroy();this.stopListening()}}ys(Cm,Qc);class Am{constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const n=this.get(e);if(!n){throw new ss[\"b\"](\"commandcollection-command-not-found: Command does not exist.\",this,{commandName:e})}return n.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 Tm{constructor(){this._consumables=new Map}add(e,t){let n;if(e.is(\"$text\")||e.is(\"documentFragment\")){this._consumables.set(e,true);return}if(!this._consumables.has(e)){n=new Sm(e);this._consumables.set(e,n)}else{n=this._consumables.get(e)}n.add(t)}test(e,t){const n=this._consumables.get(e);if(n===undefined){return null}if(e.is(\"$text\")||e.is(\"documentFragment\")){return n}return n.test(t)}consume(e,t){if(this.test(e,t)){if(e.is(\"$text\")||e.is(\"documentFragment\")){this._consumables.set(e,false)}else{this._consumables.get(e).consume(t)}return true}return false}revert(e,t){const n=this._consumables.get(e);if(n!==undefined){if(e.is(\"$text\")||e.is(\"documentFragment\")){this._consumables.set(e,true)}else{n.revert(t)}}}static consumablesFromElement(e){const t={element:e,name:true,attributes:[],classes:[],styles:[]};const n=e.getAttributeKeys();for(const e of n){if(e==\"style\"||e==\"class\"){continue}t.attributes.push(e)}const i=e.getClassNames();for(const e of i){t.classes.push(e)}const o=e.getStyleNames();for(const e of o){t.styles.push(e)}return t}static createFrom(e,t){if(!t){t=new Tm(e)}if(e.is(\"$text\")){t.add(e);return t}if(e.is(\"element\")){t.add(e,Tm.consumablesFromElement(e))}if(e.is(\"documentFragment\")){t.add(e)}for(const n of e.getChildren()){t=Tm.createFrom(n,t)}return t}}class Sm{constructor(e){this.element=e;this._canConsumeName=null;this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(e){if(e.name){this._canConsumeName=true}for(const t in this._consumables){if(t in e){this._add(t,e[t])}}}test(e){if(e.name&&!this._canConsumeName){return this._canConsumeName}for(const t in this._consumables){if(t in e){const n=this._test(t,e[t]);if(n!==true){return n}}}return true}consume(e){if(e.name){this._canConsumeName=false}for(const t in this._consumables){if(t in e){this._consume(t,e[t])}}}revert(e){if(e.name){this._canConsumeName=true}for(const t in this._consumables){if(t in e){this._revert(t,e[t])}}}_add(e,t){const n=Kt(t)?t:[t];const i=this._consumables[e];for(const t of n){if(e===\"attributes\"&&(t===\"class\"||t===\"style\")){throw new ss[\"b\"](\"viewconsumable-invalid-attribute: Classes and styles should be handled separately.\",this)}i.set(t,true);if(e===\"styles\"){for(const e of this.element.document.stylesProcessor.getRelatedStyles(t)){i.set(e,true)}}}}_test(e,t){const n=Kt(t)?t:[t];const i=this._consumables[e];for(const t of n){if(e===\"attributes\"&&(t===\"class\"||t===\"style\")){const e=t==\"class\"?\"classes\":\"styles\";const n=this._test(e,[...this._consumables[e].keys()]);if(n!==true){return n}}else{const e=i.get(t);if(e===undefined){return null}if(!e){return false}}}return true}_consume(e,t){const n=Kt(t)?t:[t];const i=this._consumables[e];for(const t of n){if(e===\"attributes\"&&(t===\"class\"||t===\"style\")){const e=t==\"class\"?\"classes\":\"styles\";this._consume(e,[...this._consumables[e].keys()])}else{i.set(t,false);if(e==\"styles\"){for(const e of this.element.document.stylesProcessor.getRelatedStyles(t)){i.set(e,false)}}}}}_revert(e,t){const n=Kt(t)?t:[t];const i=this._consumables[e];for(const t of n){if(e===\"attributes\"&&(t===\"class\"||t===\"style\")){const e=t==\"class\"?\"classes\":\"styles\";this._revert(e,[...this._consumables[e].keys()])}else{const e=i.get(t);if(e===false){i.set(t,true)}}}}}class Pm{constructor(){this._sourceDefinitions={};this._attributeProperties={};this.decorate(\"checkChild\");this.decorate(\"checkAttribute\");this.on(\"checkAttribute\",(e,t)=>{t[0]=new Em(t[0])},{priority:\"highest\"});this.on(\"checkChild\",(e,t)=>{t[0]=new Em(t[0]);t[1]=this.getDefinition(t[1])},{priority:\"highest\"})}register(e,t){if(this._sourceDefinitions[e]){throw new ss[\"b\"](\"schema-cannot-register-item-twice: A single item cannot be registered twice in the schema.\",this,{itemName:e})}this._sourceDefinitions[e]=[Object.assign({},t)];this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e]){throw new ss[\"b\"](\"schema-cannot-extend-missing-item: Cannot extend an item which was not registered yet.\",this,{itemName:e})}this._sourceDefinitions[e].push(Object.assign({},t));this._clearCache()}getDefinitions(){if(!this._compiledDefinitions){this._compile()}return this._compiledDefinitions}getDefinition(e){let t;if(typeof e==\"string\"){t=e}else if(e.is&&(e.is(\"$text\")||e.is(\"$textProxy\"))){t=\"$text\"}else{t=e.name}return this.getDefinitions()[t]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){const t=this.getDefinition(e);return!!(t&&t.isBlock)}isLimit(e){const t=this.getDefinition(e);if(!t){return false}return!!(t.isLimit||t.isObject)}isObject(e){const t=this.getDefinition(e);return!!(t&&t.isObject)}isInline(e){const t=this.getDefinition(e);return!!(t&&t.isInline)}checkChild(e,t){if(!t){return false}return this._checkContextMatch(t,e)}checkAttribute(e,t){const n=this.getDefinition(e.last);if(!n){return false}return n.allowAttributes.includes(t)}checkMerge(e,t=null){if(e instanceof Qh){const t=e.nodeBefore;const n=e.nodeAfter;if(!(t instanceof $h)){throw new ss[\"b\"](\"schema-check-merge-no-element-before: The node before the merge position must be an element.\",this)}if(!(n instanceof $h)){throw new ss[\"b\"](\"schema-check-merge-no-element-after: The node after the merge position must be an element.\",this)}return this.checkMerge(t,n)}for(const n of t.getChildren()){if(!this.checkChild(e,n)){return false}}return true}addChildCheck(e){this.on(\"checkChild\",(t,[n,i])=>{if(!i){return}const o=e(n,i);if(typeof o==\"boolean\"){t.stop();t.return=o}},{priority:\"high\"})}addAttributeCheck(e){this.on(\"checkAttribute\",(t,[n,i])=>{const o=e(n,i);if(typeof o==\"boolean\"){t.stop();t.return=o}},{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 Qh){t=e.parent}else{const n=e instanceof ef?[e]:Array.from(e.getRanges());t=n.reduce((e,t)=>{const n=t.getCommonAncestor();if(!e){return n}return e.getCommonAncestor(n,{includeSelf:true})},null)}while(!this.isLimit(t)){if(t.parent){t=t.parent}else{break}}return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const n=e.getFirstPosition();const i=[...n.getAncestors(),new Wh(\"\",e.getAttributes())];return this.checkAttribute(i,t)}else{const n=e.getRanges();for(const e of n){for(const n of e){if(this.checkAttribute(n.item,t)){return true}}}}return false}*getValidRanges(e,t){e=Um(e);for(const n of e){yield*this._getValidRangesForRange(n,t)}}getNearestSelectionRange(e,t=\"both\"){if(this.checkChild(e,\"$text\")){return new ef(e)}let n,i;const o=e.getAncestors().reverse().find(e=>this.isLimit(e))||e.root;if(t==\"both\"||t==\"backward\"){n=new Gh({boundaries:ef._createIn(o),startPosition:e,direction:\"backward\"})}if(t==\"both\"||t==\"forward\"){i=new Gh({boundaries:ef._createIn(o),startPosition:e})}for(const e of Wm(n,i)){const t=e.walker==n?\"elementEnd\":\"elementStart\";const i=e.value;if(i.type==t&&this.isObject(i.item)){return ef._createOn(i.item)}if(this.checkChild(i.nextPosition,\"$text\")){return new ef(i.nextPosition)}}return null}findAllowedParent(e,t){let n=e.parent;while(n){if(this.checkChild(n,t)){return n}if(this.isLimit(n)){return null}n=n.parent}return null}removeDisallowedAttributes(e,t){for(const n of e){if(n.is(\"$text\")){qm(this,n,t)}else{const e=ef._createIn(n);const i=e.getPositions();for(const e of i){const n=e.nodeBefore||e.parent;qm(this,n,t)}}}}createContext(e){return new Em(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={};const t=this._sourceDefinitions;const n=Object.keys(t);for(const i of n){e[i]=Mm(t[i],i)}for(const t of n){Im(e,t)}for(const t of n){Nm(e,t)}for(const t of n){Rm(e,t);Om(e,t)}for(const t of n){zm(e,t);Vm(e,t)}this._compiledDefinitions=e}_checkContextMatch(e,t,n=t.length-1){const i=t.getItem(n);if(e.allowIn.includes(i.name)){if(n==0){return true}else{const e=this.getDefinition(i);return this._checkContextMatch(e,t,n-1)}}else{return false}}*_getValidRangesForRange(e,t){let n=e.start;let i=e.start;for(const o of e.getItems({shallow:true})){if(o.is(\"element\")){yield*this._getValidRangesForRange(ef._createIn(o),t)}if(!this.checkAttribute(o,t)){if(!n.isEqual(i)){yield new ef(n,i)}n=Qh._createAfter(o)}i=Qh._createAfter(o)}if(!n.isEqual(i)){yield new ef(n,i)}}}ys(Pm,Qc);class Em{constructor(e){if(e instanceof Em){return e}if(typeof e==\"string\"){e=[e]}else if(!Array.isArray(e)){e=e.getAncestors({includeSelf:true})}if(e[0]&&typeof e[0]!=\"string\"&&e[0].is(\"documentFragment\")){e.shift()}this._items=e.map(Hm)}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 Em([e]);t._items=[...this._items,...t._items];return t}getItem(e){return this._items[e]}*getNames(){yield*this._items.map(e=>e.name)}endsWith(e){return Array.from(this.getNames()).join(\" \").endsWith(e)}startsWith(e){return Array.from(this.getNames()).join(\" \").startsWith(e)}}function Mm(e,t){const n={name:t,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};Lm(e,n);Dm(e,n,\"allowIn\");Dm(e,n,\"allowContentOf\");Dm(e,n,\"allowWhere\");Dm(e,n,\"allowAttributes\");Dm(e,n,\"allowAttributesOf\");Dm(e,n,\"inheritTypesFrom\");Bm(e,n);return n}function Im(e,t){for(const n of e[t].allowContentOf){if(e[n]){const i=jm(e,n);i.forEach(e=>{e.allowIn.push(t)})}}delete e[t].allowContentOf}function Nm(e,t){for(const n of e[t].allowWhere){const i=e[n];if(i){const n=i.allowIn;e[t].allowIn.push(...n)}}delete e[t].allowWhere}function Rm(e,t){for(const n of e[t].allowAttributesOf){const i=e[n];if(i){const n=i.allowAttributes;e[t].allowAttributes.push(...n)}}delete e[t].allowAttributesOf}function Om(e,t){const n=e[t];for(const t of n.inheritTypesFrom){const i=e[t];if(i){const e=Object.keys(i).filter(e=>e.startsWith(\"is\"));for(const t of e){if(!(t in n)){n[t]=i[t]}}}}delete n.inheritTypesFrom}function zm(e,t){const n=e[t];const i=n.allowIn.filter(t=>e[t]);n.allowIn=Array.from(new Set(i))}function Vm(e,t){const n=e[t];n.allowAttributes=Array.from(new Set(n.allowAttributes))}function Lm(e,t){for(const n of e){const e=Object.keys(n).filter(e=>e.startsWith(\"is\"));for(const i of e){t[i]=n[i]}}}function Dm(e,t,n){for(const i of e){if(typeof i[n]==\"string\"){t[n].push(i[n])}else if(Array.isArray(i[n])){t[n].push(...i[n])}}}function Bm(e,t){for(const n of e){const e=n.inheritAllFrom;if(e){t.allowContentOf.push(e);t.allowWhere.push(e);t.allowAttributesOf.push(e);t.inheritTypesFrom.push(e)}}}function jm(e,t){const n=e[t];return Fm(e).filter(e=>e.allowIn.includes(n.name))}function Fm(e){return Object.keys(e).map(t=>e[t])}function Hm(e){if(typeof e==\"string\"){return{name:e,*getAttributeKeys(){},getAttribute(){}}}else{return{name:e.is(\"element\")?e.name:\"$text\",*getAttributeKeys(){yield*e.getAttributeKeys()},getAttribute(t){return e.getAttribute(t)}}}}function*Wm(e,t){let n=false;while(!n){n=true;if(e){const t=e.next();if(!t.done){n=false;yield{walker:e,value:t.value}}}if(t){const e=t.next();if(!e.done){n=false;yield{walker:t,value:e.value}}}}}function*Um(e){for(const t of e){yield*t.getMinimalFlatRanges()}}function qm(e,t,n){for(const i of t.getAttributeKeys()){if(!e.checkAttribute(t,i)){n.removeAttribute(i,t)}}}class $m{constructor(e={}){this._splitParts=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.splitToAllowedParent=this._splitToAllowedParent.bind(this);this.conversionApi.getSplitParts=this._getSplitParts.bind(this)}convert(e,t,n=[\"$root\"]){this.fire(\"viewCleanup\",e);this._modelCursor=Gm(n,t);this.conversionApi.writer=t;this.conversionApi.consumable=Tm.createFrom(e);this.conversionApi.store={};const{modelRange:i}=this._convertItem(e,this._modelCursor);const o=t.createDocumentFragment();if(i){this._removeEmptyElements();for(const e of Array.from(this._modelCursor.parent.getChildren())){t.append(e,o)}o.markers=Ym(o,t)}this._modelCursor=null;this._splitParts.clear();this.conversionApi.writer=null;this.conversionApi.store=null;return o}_convertItem(e,t){const n=Object.assign({viewItem:e,modelCursor:t,modelRange:null});if(e.is(\"element\")){this.fire(\"element:\"+e.name,n,this.conversionApi)}else if(e.is(\"$text\")){this.fire(\"text\",n,this.conversionApi)}else{this.fire(\"documentFragment\",n,this.conversionApi)}if(n.modelRange&&!(n.modelRange instanceof ef)){throw new ss[\"b\"](\"view-conversion-dispatcher-incorrect-result: Incorrect conversion result was dropped.\",this)}return{modelRange:n.modelRange,modelCursor:n.modelCursor}}_convertChildren(e,t){const n=new ef(t);let i=t;for(const t of Array.from(e.getChildren())){const e=this._convertItem(t,i);if(e.modelRange instanceof ef){n.end=e.modelRange.end;i=e.modelCursor}}return{modelRange:n,modelCursor:i}}_splitToAllowedParent(e,t){const n=this.conversionApi.schema.findAllowedParent(t,e);if(!n){return null}if(n===t.parent){return{position:t}}if(this._modelCursor.parent.getAncestors().includes(n)){return null}const i=this.conversionApi.writer.split(t,n);const o=[];for(const e of i.range.getWalker()){if(e.type==\"elementEnd\"){o.push(e.item)}else{const t=o.pop();const n=e.item;this._registerSplitPair(t,n)}}return{position:i.position,cursorParent:i.range.end.parent}}_registerSplitPair(e,t){if(!this._splitParts.has(e)){this._splitParts.set(e,[e])}const n=this._splitParts.get(e);this._splitParts.set(t,n);n.push(t)}_getSplitParts(e){let t;if(!this._splitParts.has(e)){t=[e]}else{t=this._splitParts.get(e)}return t}_removeEmptyElements(){let e=false;for(const t of this._splitParts.keys()){if(t.isEmpty){this.conversionApi.writer.remove(t);this._splitParts.delete(t);e=true}}if(e){this._removeEmptyElements()}}}ys($m,ds);function Ym(e,t){const n=new Set;const i=new Map;const o=ef._createIn(e).getItems();for(const e of o){if(e.name==\"$marker\"){n.add(e)}}for(const e of n){const n=e.getAttribute(\"data-name\");const o=t.createPositionBefore(e);if(!i.has(n)){i.set(n,new ef(o.clone()))}else{i.get(n).end=o.clone()}t.remove(e)}return i}function Gm(e,t){let n;for(const i of new Em(e)){const e={};for(const t of i.getAttributeKeys()){e[t]=i.getAttribute(t)}const o=t.createElement(i.name,e);if(n){t.append(o,n)}n=Qh._createAt(o,0)}return n}class Km{constructor(e,t){this.model=e;this.stylesProcessor=t;this.processor;this.mapper=new tf;this.downcastDispatcher=new rf({mapper:this.mapper,schema:e.schema});this.downcastDispatcher.on(\"insert:$text\",Pf(),{priority:\"lowest\"});this.upcastDispatcher=new $m({schema:e.schema});this.viewDocument=new bl(t);this._viewWriter=new Jl(this.viewDocument);this.upcastDispatcher.on(\"text\",sm(),{priority:\"lowest\"});this.upcastDispatcher.on(\"element\",rm(),{priority:\"lowest\"});this.upcastDispatcher.on(\"documentFragment\",rm(),{priority:\"lowest\"});this.decorate(\"init\");this.decorate(\"set\");this.on(\"init\",()=>{this.fire(\"ready\")},{priority:\"lowest\"})}get(e){const{rootName:t=\"main\",trim:n=\"empty\"}=e||{};if(!this._checkIfRootsExists([t])){throw new ss[\"b\"](\"datacontroller-get-non-existent-root: Attempting to get data from a non-existing root.\",this)}const i=this.model.document.getRoot(t);if(n===\"empty\"&&!this.model.hasContent(i,{ignoreWhitespaces:true})){return\"\"}return this.stringify(i)}stringify(e){const t=this.toView(e);return this.processor.toData(t)}toView(e){const t=this.viewDocument;const n=this._viewWriter;this.mapper.clearBindings();const i=ef._createIn(e);const o=new Kl(t);this.mapper.bindElements(e,o);this.downcastDispatcher.convertInsert(i,n);if(!e.is(\"documentFragment\")){const t=Qm(e);for(const[e,i]of t){this.downcastDispatcher.convertMarkerAdd(e,i,n)}}return o}init(e){if(this.model.document.version){throw new ss[\"b\"](\"datacontroller-init-document-not-empty: Trying to set initial data to not empty document.\",this)}let t={};if(typeof e===\"string\"){t.main=e}else{t=e}if(!this._checkIfRootsExists(Object.keys(t))){throw new ss[\"b\"](\"datacontroller-init-non-existent-root: Attempting to init data on a non-existing root.\",this)}this.model.enqueueChange(\"transparent\",e=>{for(const n of Object.keys(t)){const i=this.model.document.getRoot(n);e.insert(this.parse(t[n],i),i,0)}});return Promise.resolve()}set(e){let t={};if(typeof e===\"string\"){t.main=e}else{t=e}if(!this._checkIfRootsExists(Object.keys(t))){throw new ss[\"b\"](\"datacontroller-set-non-existent-root: Attempting to set data on a non-existing root.\",this)}this.model.enqueueChange(\"transparent\",e=>{e.setSelection(null);e.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const n of Object.keys(t)){const i=this.model.document.getRoot(n);e.remove(e.createRangeIn(i));e.insert(this.parse(t[n],i),i,0)}})}parse(e,t=\"$root\"){const n=this.processor.toView(e);return this.toModel(n,t)}toModel(e,t=\"$root\"){return this.model.change(n=>this.upcastDispatcher.convert(e,n,t))}addStyleProcessorRules(e){e(this.stylesProcessor)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e){if(!this.model.document.getRootNames().includes(t)){return false}}return true}}ys(Km,Qc);function Qm(e){const t=[];const n=e.root.document;if(!n){return[]}const i=ef._createIn(e);for(const e of n.model.markers){const n=i.getIntersection(e.getRange());if(n){t.push([e.name,n])}}return t}class Jm{constructor(e,t){this._helpers=new Map;this._downcast=Array.isArray(e)?e:[e];this._createConversionHelpers({name:\"downcast\",dispatchers:this._downcast,isDowncast:true});this._upcast=Array.isArray(t)?t:[t];this._createConversionHelpers({name:\"upcast\",dispatchers:this._upcast,isDowncast:false})}addAlias(e,t){const n=this._downcast.includes(t);const i=this._upcast.includes(t);if(!i&&!n){throw new ss[\"b\"](\"conversion-add-alias-dispatcher-not-registered: \"+\"Trying to register and alias for a dispatcher that nas not been registered.\",this)}this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:n})}for(e){if(!this._helpers.has(e)){throw new ss[\"b\"](\"conversion-for-unknown-group: Trying to add a converter to an unknown dispatchers group.\",this)}return this._helpers.get(e)}elementToElement(e){this.for(\"downcast\").elementToElement(e);for(const{model:t,view:n}of Zm(e)){this.for(\"upcast\").elementToElement({model:t,view:n,converterPriority:e.converterPriority})}}attributeToElement(e){this.for(\"downcast\").attributeToElement(e);for(const{model:t,view:n}of Zm(e)){this.for(\"upcast\").elementToAttribute({view:n,model:t,converterPriority:e.converterPriority})}}attributeToAttribute(e){this.for(\"downcast\").attributeToAttribute(e);for(const{model:t,view:n}of Zm(e)){this.for(\"upcast\").attributeToAttribute({view:n,model:t})}}_createConversionHelpers({name:e,dispatchers:t,isDowncast:n}){if(this._helpers.has(e)){throw new ss[\"b\"](\"conversion-group-exists: Trying to register a group name that has already been registered.\",this)}const i=n?new Sf(t):new om(t);this._helpers.set(e,i)}}function*Zm(e){if(e.model.values){for(const t of e.model.values){const n={key:e.model.key,value:t};const i=e.view[t];const o=e.upcastAlso?e.upcastAlso[t]:undefined;yield*Xm(n,i,o)}}else{yield*Xm(e.model,e.view,e.upcastAlso)}}function*Xm(e,t,n){yield{model:e,view:t};if(n){n=Array.isArray(n)?n:[n];for(const t of n){yield{model:e,view:t}}}}class eg{constructor(e=\"default\"){this.operations=[];this.type=e}get baseVersion(){for(const e of this.operations){if(e.baseVersion!==null){return e.baseVersion}}return null}addOperation(e){e.batch=this;this.operations.push(e);return e}}class tg{constructor(e){this.baseVersion=e;this.isDocumentOperation=this.baseVersion!==null;this.batch=null}_validate(){}toJSON(){const e=Object.assign({},this);e.__className=this.constructor.className;delete e.batch;delete e.isDocumentOperation;return e}static get className(){return\"Operation\"}static fromJSON(e){return new this(e.baseVersion)}}class ng{constructor(e){this.markers=new Map;this._children=new qh;if(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 this.childCount===0}get root(){return this}get parent(){return null}is(e){return e===\"documentFragment\"||e===\"model:documentFragment\"}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 n of e){t=t.getChild(t.offsetToIndex(n))}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 n of e){if(n.name){t.push($h.fromJSON(n))}else{t.push(Wh.fromJSON(n))}}return new ng(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=ig(t);for(const e of n){if(e.parent!==null){e._remove()}e.parent=this}this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const e of n){e.parent=null}return n}}function ig(e){if(typeof e==\"string\"){return[new Wh(e)]}if(!vs(e)){e=[e]}return Array.from(e).map(e=>{if(typeof e==\"string\"){return new Wh(e)}if(e instanceof Uh){return new Wh(e.data,e.getAttributes())}return e})}function og(e,t){t=cg(t);const n=t.reduce((e,t)=>e+t.offsetSize,0);const i=e.parent;dg(e);const o=e.index;i._insertChild(o,t);lg(i,o+t.length);lg(i,o);return new ef(e,e.getShiftedBy(n))}function rg(e){if(!e.isFlat){throw new ss[\"b\"](\"operation-utils-remove-range-not-flat: \"+\"Trying to remove a range which starts and ends in different element.\",this)}const t=e.start.parent;dg(e.start);dg(e.end);const n=t._removeChildren(e.start.index,e.end.index-e.start.index);lg(t,e.start.index);return n}function sg(e,t){if(!e.isFlat){throw new ss[\"b\"](\"operation-utils-move-range-not-flat: \"+\"Trying to move a range which starts and ends in different element.\",this)}const n=rg(e);t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset);return og(t,n)}function ag(e,t,n){dg(e.start);dg(e.end);for(const i of e.getItems({shallow:true})){const e=i.is(\"$textProxy\")?i.textNode:i;if(n!==null){e._setAttribute(t,n)}else{e._removeAttribute(t)}lg(e.parent,e.index)}lg(e.end.parent,e.end.index)}function cg(e){const t=[];if(!(e instanceof Array)){e=[e]}for(let n=0;ne.maxOffset){throw new ss[\"b\"](\"move-operation-nodes-do-not-exist: The nodes which should be moved do not exist.\",this)}else if(e===t&&n=n&&this.targetPosition.path[e]e._clone(true)));const t=new bg(this.position,e,this.baseVersion);t.shouldReceiveAttributes=this.shouldReceiveAttributes;return t}getReversed(){const e=this.position.root.document.graveyard;const t=new Qh(e,[0]);return new pg(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffsete._clone(true)));og(this.position,e)}toJSON(){const e=super.toJSON();e.position=this.position.toJSON();e.nodes=this.nodes.toJSON();return e}static get className(){return\"InsertOperation\"}static fromJSON(e,t){const n=[];for(const t of e.nodes){if(t.name){n.push($h.fromJSON(t))}else{n.push(Wh.fromJSON(t))}}const i=new bg(Qh.fromJSON(e.position,t),n,e.baseVersion);i.shouldReceiveAttributes=e.shouldReceiveAttributes;return i}}class wg extends tg{constructor(e,t,n,i,o,r){super(r);this.name=e;this.oldRange=t?t.clone():null;this.newRange=n?n.clone():null;this.affectsData=o;this._markers=i}get type(){return\"marker\"}clone(){return new wg(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new wg(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){const e=this.newRange?\"_set\":\"_remove\";this._markers[e](this.name,this.newRange,true,this.affectsData)}toJSON(){const e=super.toJSON();if(this.oldRange){e.oldRange=this.oldRange.toJSON()}if(this.newRange){e.newRange=this.newRange.toJSON()}delete e._markers;return e}static get className(){return\"MarkerOperation\"}static fromJSON(e,t){return new wg(e.name,e.oldRange?ef.fromJSON(e.oldRange,t):null,e.newRange?ef.fromJSON(e.newRange,t):null,t.model.markers,e.affectsData,e.baseVersion)}}class kg extends tg{constructor(e,t,n,i){super(i);this.position=e;this.position.stickiness=\"toNext\";this.oldName=t;this.newName=n}get type(){return\"rename\"}clone(){return new kg(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new kg(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(!(e instanceof $h)){throw new ss[\"b\"](\"rename-operation-wrong-position: Given position is invalid or node after it is not an instance of Element.\",this)}else if(e.name!==this.oldName){throw new ss[\"b\"](\"rename-operation-wrong-name: Element to change has different name than operation's old name.\",this)}}_execute(){const e=this.position.nodeAfter;e.name=this.newName}toJSON(){const e=super.toJSON();e.position=this.position.toJSON();return e}static get className(){return\"RenameOperation\"}static fromJSON(e,t){return new kg(Qh.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class _g extends tg{constructor(e,t,n,i,o){super(o);this.root=e;this.key=t;this.oldValue=n;this.newValue=i}get type(){if(this.oldValue===null){return\"addRootAttribute\"}else if(this.newValue===null){return\"removeRootAttribute\"}else{return\"changeRootAttribute\"}}clone(){return new _g(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new _g(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is(\"documentFragment\")){throw new ss[\"b\"](\"rootattribute-operation-not-a-root: The element to change is not a root element.\",this,{root:this.root,key:this.key})}if(this.oldValue!==null&&this.root.getAttribute(this.key)!==this.oldValue){throw new ss[\"b\"](\"rootattribute-operation-wrong-old-value: Changed node has different attribute value than operation's \"+\"old attribute value.\",this,{root:this.root,key:this.key})}if(this.oldValue===null&&this.newValue!==null&&this.root.hasAttribute(this.key)){throw new ss[\"b\"](\"rootattribute-operation-attribute-exists: The attribute with given key already exists.\",this,{root:this.root,key:this.key})}}_execute(){if(this.newValue!==null){this.root._setAttribute(this.key,this.newValue)}else{this.root._removeAttribute(this.key)}}toJSON(){const e=super.toJSON();e.root=this.root.toJSON();return e}static get className(){return\"RootAttributeOperation\"}static fromJSON(e,t){if(!t.getRoot(e.root)){throw new ss[\"b\"](\"rootattribute-operation-fromjson-no-root: Cannot create RootAttributeOperation. Root with specified name does not exist.\",this,{rootName:e.root})}return new _g(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}class vg extends tg{constructor(e,t,n,i,o){super(o);this.sourcePosition=e.clone();this.sourcePosition.stickiness=\"toPrevious\";this.howMany=t;this.targetPosition=n.clone();this.targetPosition.stickiness=\"toNext\";this.graveyardPosition=i.clone()}get type(){return\"merge\"}get deletionPosition(){return new Qh(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const e=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new ef(this.sourcePosition,e)}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.targetPosition._getTransformedByMergeOperation(this);const t=this.sourcePosition.path.slice(0,-1);const n=new Qh(this.sourcePosition.root,t)._getTransformedByMergeOperation(this);const i=new yg(e,this.howMany,this.graveyardPosition,this.baseVersion+1);i.insertionPosition=n;return i}_validate(){const e=this.sourcePosition.parent;const t=this.targetPosition.parent;if(!e.parent){throw new ss[\"b\"](\"merge-operation-source-position-invalid: Merge source position is invalid.\",this)}else if(!t.parent){throw new ss[\"b\"](\"merge-operation-target-position-invalid: Merge target position is invalid.\",this)}else if(this.howMany!=e.maxOffset){throw new ss[\"b\"](\"merge-operation-how-many-invalid: Merge operation specifies wrong number of nodes to move.\",this)}}_execute(){const e=this.sourcePosition.parent;const t=ef._createIn(e);sg(t,this.targetPosition);sg(ef._createOn(e),this.graveyardPosition)}toJSON(){const e=super.toJSON();e.sourcePosition=e.sourcePosition.toJSON();e.targetPosition=e.targetPosition.toJSON();e.graveyardPosition=e.graveyardPosition.toJSON();return e}static get className(){return\"MergeOperation\"}static fromJSON(e,t){const n=Qh.fromJSON(e.sourcePosition,t);const i=Qh.fromJSON(e.targetPosition,t);const o=Qh.fromJSON(e.graveyardPosition,t);return new this(n,e.howMany,i,o,e.baseVersion)}}class yg extends tg{constructor(e,t,n,i){super(i);this.splitPosition=e.clone();this.splitPosition.stickiness=\"toNext\";this.howMany=t;this.insertionPosition=yg.getInsertionPosition(e);this.insertionPosition.stickiness=\"toNone\";this.graveyardPosition=n?n.clone():null;if(this.graveyardPosition){this.graveyardPosition.stickiness=\"toNext\"}}get type(){return\"split\"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();e.push(0);return new Qh(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new ef(this.splitPosition,e)}clone(){const e=new this.constructor(this.splitPosition,this.howMany,this.graveyardPosition,this.baseVersion);e.insertionPosition=this.insertionPosition;return e}getReversed(){const e=this.splitPosition.root.document.graveyard;const t=new Qh(e,[0]);return new vg(this.moveTargetPosition,this.howMany,this.splitPosition,t,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent;const t=this.splitPosition.offset;if(!e||e.maxOffset{for(const t of e.getAttributeKeys()){this.removeAttribute(t,e)}};if(!(e instanceof ef)){t(e)}else{for(const n of e.getItems()){t(n)}}}move(e,t,n){this._assertWriterUsedCorrectly();if(!(e instanceof ef)){throw new ss[\"b\"](\"writer-move-invalid-range: Invalid range to move.\",this)}if(!e.isFlat){throw new ss[\"b\"](\"writer-move-range-not-flat: Range to move is not flat.\",this)}const i=Qh._createAt(t,n);if(i.isEqual(e.start)){return}this._addOperationForAffectedMarkers(\"move\",e);if(!Eg(e.root,i.root)){throw new ss[\"b\"](\"writer-move-different-document: Range is going to be moved between different documents.\",this)}const o=e.root.document?e.root.document.version:null;const r=new pg(e.start,e.end.offset-e.start.offset,i,o);this.batch.addOperation(r);this.model.applyOperation(r)}remove(e){this._assertWriterUsedCorrectly();const t=e instanceof ef?e:ef._createOn(e);const n=t.getMinimalFlatRanges().reverse();for(const e of n){this._addOperationForAffectedMarkers(\"move\",e);Pg(e.start,e.end.offset-e.start.offset,this.batch,this.model)}}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore;const n=e.nodeAfter;this._addOperationForAffectedMarkers(\"merge\",e);if(!(t instanceof $h)){throw new ss[\"b\"](\"writer-merge-no-element-before: Node before merge position must be an element.\",this)}if(!(n instanceof $h)){throw new ss[\"b\"](\"writer-merge-no-element-after: Node after merge position must be an element.\",this)}if(!e.root.document){this._mergeDetached(e)}else{this._merge(e)}}createPositionFromPath(e,t,n){return this.model.createPositionFromPath(e,t,n)}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,n){return this.model.createSelection(e,t,n)}_mergeDetached(e){const t=e.nodeBefore;const n=e.nodeAfter;this.move(ef._createIn(n),Qh._createAt(t,\"end\"));this.remove(n)}_merge(e){const t=Qh._createAt(e.nodeBefore,\"end\");const n=Qh._createAt(e.nodeAfter,0);const i=e.root.document.graveyard;const o=new Qh(i,[0]);const r=e.root.document.version;const s=new vg(n,e.nodeAfter.maxOffset,t,o,r);this.batch.addOperation(s);this.model.applyOperation(s)}rename(e,t){this._assertWriterUsedCorrectly();if(!(e instanceof $h)){throw new ss[\"b\"](\"writer-rename-not-element-instance: Trying to rename an object which is not an instance of Element.\",this)}const n=e.root.document?e.root.document.version:null;const i=new kg(Qh._createBefore(e),e.name,t,n);this.batch.addOperation(i);this.model.applyOperation(i)}split(e,t){this._assertWriterUsedCorrectly();let n=e.parent;if(!n.parent){throw new ss[\"b\"](\"writer-split-element-no-parent: Element with no parent can not be split.\",this)}if(!t){t=n.parent}if(!e.parent.getAncestors({includeSelf:true}).includes(t)){throw new ss[\"b\"](\"writer-split-invalid-limit-element: Limit element is not a position ancestor.\",this)}let i,o;do{const t=n.root.document?n.root.document.version:null;const r=n.maxOffset-e.offset;const s=new yg(e,r,null,t);this.batch.addOperation(s);this.model.applyOperation(s);if(!i&&!o){i=n;o=e.parent.nextSibling}e=this.createPositionAfter(e.parent);n=e.parent}while(n!==t);return{position:e,range:new ef(Qh._createAt(i,\"end\"),Qh._createAt(o,0))}}wrap(e,t){this._assertWriterUsedCorrectly();if(!e.isFlat){throw new ss[\"b\"](\"writer-wrap-range-not-flat: Range to wrap is not flat.\",this)}const n=t instanceof $h?t:new $h(t);if(n.childCount>0){throw new ss[\"b\"](\"writer-wrap-element-not-empty: Element to wrap with is not empty.\",this)}if(n.parent!==null){throw new ss[\"b\"](\"writer-wrap-element-attached: Element to wrap with is already attached to tree model.\",this)}this.insert(n,e.start);const i=new ef(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(i,Qh._createAt(n,0))}unwrap(e){this._assertWriterUsedCorrectly();if(e.parent===null){throw new ss[\"b\"](\"writer-unwrap-element-no-parent: Trying to unwrap an element which has no parent.\",this)}this.move(ef._createIn(e),this.createPositionAfter(e));this.remove(e)}addMarker(e,t){this._assertWriterUsedCorrectly();if(!t||typeof t.usingOperation!=\"boolean\"){throw new ss[\"b\"](\"writer-addMarker-no-usingOperation: The options.usingOperation parameter is required when adding a new marker.\",this)}const n=t.usingOperation;const i=t.range;const o=t.affectsData===undefined?false:t.affectsData;if(this.model.markers.has(e)){throw new ss[\"b\"](\"writer-addMarker-marker-exists: Marker with provided name already exists.\",this)}if(!i){throw new ss[\"b\"](\"writer-addMarker-no-range: Range parameter is required when adding a new marker.\",this)}if(!n){return this.model.markers._set(e,i,n,o)}Sg(this,e,null,i,o);return this.model.markers.get(e)}updateMarker(e,t){this._assertWriterUsedCorrectly();const n=typeof e==\"string\"?e:e.name;const i=this.model.markers.get(n);if(!i){throw new ss[\"b\"](\"writer-updateMarker-marker-not-exists: Marker with provided name does not exists.\",this)}if(!t){this.model.markers._refresh(i);return}const o=typeof t.usingOperation==\"boolean\";const r=typeof t.affectsData==\"boolean\";const s=r?t.affectsData:i.affectsData;if(!o&&!t.range&&!r){throw new ss[\"b\"](\"writer-updateMarker-wrong-options: One of the options is required - provide range, usingOperations or affectsData.\",this)}const a=i.getRange();const c=t.range?t.range:a;if(o&&t.usingOperation!==i.managedUsingOperations){if(t.usingOperation){Sg(this,n,null,c,s)}else{Sg(this,n,a,null,s);this.model.markers._set(n,c,undefined,s)}return}if(i.managedUsingOperations){Sg(this,n,a,c,s)}else{this.model.markers._set(n,c,undefined,s)}}removeMarker(e){this._assertWriterUsedCorrectly();const t=typeof e==\"string\"?e:e.name;if(!this.model.markers.has(t)){throw new ss[\"b\"](\"writer-removeMarker-no-marker: Trying to remove marker which does not exist.\",this)}const n=this.model.markers.get(t);if(!n.managedUsingOperations){this.model.markers._remove(t);return}const i=n.getRange();Sg(this,t,i,null,n.affectsData)}setSelection(e,t,n){this._assertWriterUsedCorrectly();this.model.document.selection._setTo(e,t,n)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly();this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){this._assertWriterUsedCorrectly();if(typeof e===\"string\"){this._setSelectionAttribute(e,t)}else{for(const[t,n]of Ws(e)){this._setSelectionAttribute(t,n)}}}removeSelectionAttribute(e){this._assertWriterUsedCorrectly();if(typeof e===\"string\"){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 n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){const i=wf._getStoreAttributeKey(e);this.setAttribute(i,t,n.anchor.parent)}n._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const n=wf._getStoreAttributeKey(e);this.removeAttribute(n,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this){throw new ss[\"b\"](\"writer-incorrect-use: Trying to use a writer outside the change() block.\",this)}}_addOperationForAffectedMarkers(e,t){for(const n of this.model.markers){if(!n.managedUsingOperations){continue}const i=n.getRange();let o=false;if(e===\"move\"){o=t.containsPosition(i.start)||t.start.isEqual(i.start)||t.containsPosition(i.end)||t.end.isEqual(i.end)}else{const e=t.nodeBefore;const n=t.nodeAfter;const r=i.start.parent==e&&i.start.isAtEnd;const s=i.end.parent==n&&i.end.offset==0;const a=i.end.nodeAfter==n;const c=i.start.nodeAfter==n;o=r||s||a||c}if(o){this.updateMarker(n.name,{range:i})}}}}function Ag(e,t,n,i){const o=e.model;const r=o.document;let s=i.start;let a;let c;let l;for(const e of i.getWalker({shallow:true})){l=e.item.getAttribute(t);if(a&&c!=l){if(c!=n){d()}s=a}a=e.nextPosition;c=l}if(a instanceof Qh&&a!=s&&c!=n){d()}function d(){const i=new ef(s,a);const l=i.root.document?r.version:null;const d=new mg(i,t,c,n,l);e.batch.addOperation(d);o.applyOperation(d)}}function Tg(e,t,n,i){const o=e.model;const r=o.document;const s=i.getAttribute(t);let a,c;if(s!=n){const l=i.root===i;if(l){const e=i.document?r.version:null;c=new _g(i,t,s,n,e)}else{a=new ef(Qh._createBefore(i),e.createPositionAfter(i));const o=a.root.document?r.version:null;c=new mg(a,t,s,n,o)}e.batch.addOperation(c);o.applyOperation(c)}}function Sg(e,t,n,i,o){const r=e.model;const s=r.document;const a=new wg(t,n,i,r.markers,o,s.version);e.batch.addOperation(a);r.applyOperation(a)}function Pg(e,t,n,i){let o;if(e.root.document){const n=i.document;const r=new Qh(n.graveyard,[0]);o=new pg(e,t,r,n.version)}else{o=new gg(e,t)}n.addOperation(o);i.applyOperation(o)}function Eg(e,t){if(e===t){return true}if(e instanceof xg&&t instanceof xg){return true}return false}class Mg{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 this._changesInElement.size==0&&this._changedMarkers.size==0}refreshItem(e){if(this._isInInsertedElement(e.parent)){return}this._markRemove(e.parent,e.startOffset,e.offsetSize);this._markInsert(e.parent,e.startOffset,e.offsetSize);const t=ef._createOn(e);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getRange();this.bufferMarkerChange(e.name,t,t,e.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 t of e.range.getItems({shallow:true})){if(this._isInInsertedElement(t.parent)){continue}this._markAttribute(t)}break}case\"remove\":case\"move\":case\"reinsert\":{if(e.sourcePosition.isEqual(e.targetPosition)||e.sourcePosition.getShiftedBy(e.howMany).isEqual(e.targetPosition)){return}const t=this._isInInsertedElement(e.sourcePosition.parent);const n=this._isInInsertedElement(e.targetPosition.parent);if(!t){this._markRemove(e.sourcePosition.parent,e.sourcePosition.offset,e.howMany)}if(!n){this._markInsert(e.targetPosition.parent,e.getMovedRangeStart().offset,e.howMany)}break}case\"rename\":{if(this._isInInsertedElement(e.position.parent)){return}this._markRemove(e.position.parent,e.position.offset,1);this._markInsert(e.position.parent,e.position.offset,1);const t=ef._createFromPositionAndShift(e.position,1);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getRange();this.bufferMarkerChange(e.name,t,t,e.affectsData)}break}case\"split\":{const t=e.splitPosition.parent;if(!this._isInInsertedElement(t)){this._markRemove(t,e.splitPosition.offset,e.howMany)}if(!this._isInInsertedElement(e.insertionPosition.parent)){this._markInsert(e.insertionPosition.parent,e.insertionPosition.offset,1)}if(e.graveyardPosition){this._markRemove(e.graveyardPosition.parent,e.graveyardPosition.offset,1)}break}case\"merge\":{const t=e.sourcePosition.parent;if(!this._isInInsertedElement(t.parent)){this._markRemove(t.parent,t.startOffset,1)}const n=e.graveyardPosition.parent;this._markInsert(n,e.graveyardPosition.offset,1);const i=e.targetPosition.parent;if(!this._isInInsertedElement(i)){this._markInsert(i,e.targetPosition.offset,t.maxOffset)}break}}this._cachedChanges=null}bufferMarkerChange(e,t,n,i){const o=this._changedMarkers.get(e);if(!o){this._changedMarkers.set(e,{oldRange:t,newRange:n,affectsData:i})}else{o.newRange=n;o.affectsData=i;if(o.oldRange==null&&o.newRange==null){this._changedMarkers.delete(e)}}}getMarkersToRemove(){const e=[];for(const[t,n]of this._changedMarkers){if(n.oldRange!=null){e.push({name:t,range:n.oldRange})}}return e}getMarkersToAdd(){const e=[];for(const[t,n]of this._changedMarkers){if(n.newRange!=null){e.push({name:t,range:n.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(const[,e]of this._changedMarkers){if(e.affectsData){return true}}return this._changesInElement.size>0}getChanges(e={includeChangesInGraveyard:false}){if(this._cachedChanges){if(e.includeChangesInGraveyard){return this._cachedChangesWithGraveyard.slice()}else{return this._cachedChanges.slice()}}const t=[];for(const e of this._changesInElement.keys()){const n=this._changesInElement.get(e).sort((e,t)=>{if(e.offset===t.offset){if(e.type!=t.type){return e.type==\"remove\"?-1:1}return 0}return e.offset{if(e.position.root!=t.position.root){return e.position.root.rootNamen.offset){if(i>o){const e={type:\"attribute\",offset:o,howMany:i-o,count:this._changeCount++};this._handleChange(e,t);t.push(e)}e.nodesToHandle=n.offset-e.offset;e.howMany=e.nodesToHandle}else if(e.offset>=n.offset&&e.offseto){e.nodesToHandle=i-o;e.offset=o}else{e.nodesToHandle=0}}}if(n.type==\"remove\"){if(e.offsetn.offset){const o={type:\"attribute\",offset:n.offset,howMany:i-n.offset,count:this._changeCount++};this._handleChange(o,t);t.push(o);e.nodesToHandle=n.offset-e.offset;e.howMany=e.nodesToHandle}}if(n.type==\"attribute\"){if(e.offset>=n.offset&&i<=o){e.nodesToHandle=0;e.howMany=0;e.offset=0}else if(e.offset<=n.offset&&i>=o){n.howMany=0}}}}e.howMany=e.nodesToHandle;delete e.nodesToHandle}_getInsertDiff(e,t,n){return{type:\"insert\",position:Qh._createAt(e,t),name:n,length:1,changeCount:this._changeCount++}}_getRemoveDiff(e,t,n){return{type:\"remove\",position:Qh._createAt(e,t),name:n,length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,n){const i=[];n=new Map(n);for(const[o,r]of t){const t=n.has(o)?n.get(o):null;if(t!==r){i.push({type:\"attribute\",position:e.start,range:e.clone(),length:1,attributeKey:o,attributeOldValue:r,attributeNewValue:t,changeCount:this._changeCount++})}n.delete(o)}for(const[t,o]of n){i.push({type:\"attribute\",position:e.start,range:e.clone(),length:1,attributeKey:t,attributeOldValue:null,attributeNewValue:o,changeCount:this._changeCount++})}return i}_isInInsertedElement(e){const t=e.parent;if(!t){return false}const n=this._changesInElement.get(t);const i=e.startOffset;if(n){for(const e of n){if(e.type==\"insert\"&&i>=e.offset&&ii){for(let t=0;t{const n=t[0];if(n.isDocumentOperation&&n.baseVersion!==this.version){throw new ss[\"b\"](\"model-document-applyOperation-wrong-version: Only operations with matching versions can be applied.\",this,{operation:n})}},{priority:\"highest\"});this.listenTo(e,\"applyOperation\",(e,t)=>{const n=t[0];if(n.isDocumentOperation){this.differ.bufferOperation(n)}},{priority:\"high\"});this.listenTo(e,\"applyOperation\",(e,t)=>{const n=t[0];if(n.isDocumentOperation){this.version++;this.history.addOperation(n)}},{priority:\"low\"});this.listenTo(this.selection,\"change\",()=>{this._hasSelectionChangedFromTheLastChangeBlock=true});this.listenTo(e.markers,\"update\",(e,t,n,i)=>{this.differ.bufferMarkerChange(t.name,n,i,t.affectsData);if(n===null){t.on(\"change\",(e,n)=>{this.differ.bufferMarkerChange(t.name,n,t.getRange(),t.affectsData)})}})}get graveyard(){return this.getRoot(jg)}createRoot(e=\"$root\",t=\"main\"){if(this.roots.get(t)){throw new ss[\"b\"](\"model-document-createRoot-name-exists: Root with specified name already exists.\",this,{name:t})}const n=new xg(this,e,t);this.roots.add(n);return n}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!=jg)}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=Ds(this);e.selection=\"[engine.model.DocumentSelection]\";e.model=\"[engine.model.Model]\";return e}_handleChangeBlock(e){if(this._hasDocumentChangedFromTheLastChangeBlock()){this._callPostFixers(e);this.selection.refresh();if(this.differ.hasDataChanges()){this.fire(\"change:data\",e.batch)}else{this.fire(\"change\",e.batch)}this.selection.refresh();this.differ.reset()}this._hasSelectionChangedFromTheLastChangeBlock=false}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const e of this.roots){if(e!==this.graveyard){return e}}return this.graveyard}_getDefaultRange(){const e=this._getDefaultRoot();const t=this.model;const n=t.schema;const i=t.createPositionFromPath(e,[0]);const o=n.getNearestSelectionRange(i);return o||t.createRange(i)}_validateSelectionRange(e){return Hg(e.start)&&Hg(e.end)}_callPostFixers(e){let t=false;do{for(const n of this._postFixers){this.selection.refresh();t=n(e);if(t){break}}}while(t)}}ys(Fg,ds);function Hg(e){const t=e.textNode;if(t){const n=t.data;const i=e.offset-t.startOffset;return!Dg(n,i)&&!Bg(n,i)}return true}class Wg{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,n=false,i=false){const o=e instanceof Ug?e.name:e;if(o.includes(\",\")){throw new ss[\"b\"]('markercollection-incorrect-marker-name: Marker name cannot contain \",\" character.',this)}const r=this._markers.get(o);if(r){const e=r.getRange();let s=false;if(!e.isEqual(t)){r._attachLiveRange(ff.fromRange(t));s=true}if(n!=r.managedUsingOperations){r._managedUsingOperations=n;s=true}if(typeof i===\"boolean\"&&i!=r.affectsData){r._affectsData=i;s=true}if(s){this.fire(\"update:\"+o,r,e,t)}return r}const s=ff.fromRange(t);const a=new Ug(o,s,n,i);this._markers.set(o,a);this.fire(\"update:\"+o,a,null,t);return a}_remove(e){const t=e instanceof Ug?e.name:e;const n=this._markers.get(t);if(n){this._markers.delete(t);this.fire(\"update:\"+t,n,n.getRange(),null);this._destroyMarker(n);return true}return false}_refresh(e){const t=e instanceof Ug?e.name:e;const n=this._markers.get(t);if(!n){throw new ss[\"b\"](\"markercollection-refresh-marker-not-exists: Marker with provided name does not exists.\",this)}const i=n.getRange();this.fire(\"update:\"+t,n,i,i,n.managedUsingOperations,n.affectsData)}*getMarkersAtPosition(e){for(const t of this){if(t.getRange().containsPosition(e)){yield t}}}*getMarkersIntersectingRange(e){for(const t of this){if(t.getRange().getIntersection(e)!==null){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()){if(t.name.startsWith(e+\":\")){yield t}}}_destroyMarker(e){e.stopListening();e._detachLiveRange()}}ys(Wg,ds);class Ug{constructor(e,t,n,i){this.name=e;this._liveRange=this._attachLiveRange(t);this._managedUsingOperations=n;this._affectsData=i}get managedUsingOperations(){if(!this._liveRange){throw new ss[\"b\"](\"marker-destroyed: Cannot use a destroyed marker instance.\",this)}return this._managedUsingOperations}get affectsData(){if(!this._liveRange){throw new ss[\"b\"](\"marker-destroyed: Cannot use a destroyed marker instance.\",this)}return this._affectsData}getStart(){if(!this._liveRange){throw new ss[\"b\"](\"marker-destroyed: Cannot use a destroyed marker instance.\",this)}return this._liveRange.start.clone()}getEnd(){if(!this._liveRange){throw new ss[\"b\"](\"marker-destroyed: Cannot use a destroyed marker instance.\",this)}return this._liveRange.end.clone()}getRange(){if(!this._liveRange){throw new ss[\"b\"](\"marker-destroyed: Cannot use a destroyed marker instance.\",this)}return this._liveRange.toRange()}is(e){return e===\"marker\"||e===\"model:marker\"}_attachLiveRange(e){if(this._liveRange){this._detachLiveRange()}e.delegate(\"change:range\").to(this);e.delegate(\"change:content\").to(this);this._liveRange=e;return e}_detachLiveRange(){this._liveRange.stopDelegating(\"change:range\",this);this._liveRange.stopDelegating(\"change:content\",this);this._liveRange.detach();this._liveRange=null}}ys(Ug,ds);class qg extends tg{get type(){return\"noop\"}clone(){return new qg(this.baseVersion)}getReversed(){return new qg(this.baseVersion+1)}_execute(){}static get className(){return\"NoOperation\"}}const $g={};$g[mg.className]=mg;$g[bg.className]=bg;$g[wg.className]=wg;$g[pg.className]=pg;$g[qg.className]=qg;$g[tg.className]=tg;$g[kg.className]=kg;$g[_g.className]=_g;$g[yg.className]=yg;$g[vg.className]=vg;class Yg{static fromJSON(e,t){return $g[e.__className].fromJSON(e,t)}}class Gg extends Qh{constructor(e,t,n=\"toNone\"){super(e,t,n);if(!this.root.is(\"rootElement\")){throw new ss[\"b\"](\"model-liveposition-root-not-rootelement: LivePosition's root has to be an instance of RootElement.\",e)}Kg.call(this)}detach(){this.stopListening()}is(e){return e===\"livePosition\"||e===\"model:livePosition\"||e==\"position\"||e===\"model:position\"}toPosition(){return new Qh(this.root,this.path.slice(),this.stickiness)}static fromPosition(e,t){return new this(e.root,e.path.slice(),t?t:e.stickiness)}}function Kg(){this.listenTo(this.root.document.model,\"applyOperation\",(e,t)=>{const n=t[0];if(!n.isDocumentOperation){return}Qg.call(this,n)},{priority:\"low\"})}function Qg(e){const t=this.getTransformedByOperation(e);if(!this.isEqual(t)){const e=this.toPosition();this.path=t.path;this.root=t.root;this.fire(\"change\",e)}}ys(Gg,ds);function Jg(e,t,n,i){return e.change(o=>{let r;if(!n){r=e.document.selection}else if(n instanceof af||n instanceof wf){r=n}else{r=o.createSelection(n,i)}if(!r.isCollapsed){e.deleteContent(r,{doNotAutoparagraph:true})}const s=new Zg(e,o,r.anchor);let a;if(t.is(\"documentFragment\")){a=t.getChildren()}else{a=[t]}s.handleNodes(a,{isFirst:true,isLast:true});const c=s.getSelectionRange();if(c){if(r instanceof wf){o.setSelection(c)}else{r.setTo(c)}}else{}const l=s.getAffectedRange()||e.createRange(r.anchor);s.destroy();return l})}class Zg{constructor(e,t,n){this.model=e;this.writer=t;this.position=n;this.canMergeWith=new Set([this.position.parent]);this.schema=e.schema;this._filterAttributesOf=[];this._affectedStart=null;this._affectedEnd=null}handleNodes(e,t){e=Array.from(e);for(let n=0;n{if(!n.doNotResetEntireContent&&hp(o,t)){up(e,t,o);return}const[r,s]=ep(i);if(!i.start.isTouching(i.end)){e.remove(i)}if(!n.leaveUnmerged){np(e,r,s);o.removeDisallowedAttributes(r.parent.getChildren(),e)}fp(e,t,r);if(!n.doNotAutoparagraph&&cp(o,r)){dp(e,r,t)}r.detach();s.detach()})}function ep(e){const t=e.root.document.model;const n=e.start;let i=e.end;if(t.hasContent(e,{ignoreMarkers:true})){const n=tp(i);if(n&&i.isTouching(t.createPositionAt(n,0))){const n=t.createSelection(e);t.modifySelection(n,{direction:\"backward\"});i=n.getLastPosition()}}return[Gg.fromPosition(n,\"toPrevious\"),Gg.fromPosition(i,\"toNext\")]}function tp(e){const t=e.parent;const n=t.root.document.model.schema;const i=t.getAncestors({parentFirst:true,includeSelf:true});for(const e of i){if(n.isLimit(e)){return null}if(n.isBlock(e)){return e}}}function np(e,t,n){const i=e.model;if(!sp(e.model.schema,t,n)){return}const[o,r]=ap(t,n);if(!i.hasContent(o,{ignoreMarkers:true})&&i.hasContent(r,{ignoreMarkers:true})){op(e,t,n,o.parent)}else{ip(e,t,n,o.parent)}}function ip(e,t,n,i){const o=t.parent;const r=n.parent;if(o==i||r==i){return}t=e.createPositionAfter(o);n=e.createPositionBefore(r);if(!n.isEqual(t)){e.insert(r,t)}e.merge(t);while(n.parent.isEmpty){const t=n.parent;n=e.createPositionBefore(t);e.remove(t)}if(!sp(e.model.schema,t,n)){return}ip(e,t,n,i)}function op(e,t,n,i){const o=t.parent;const r=n.parent;if(o==i||r==i){return}t=e.createPositionAfter(o);n=e.createPositionBefore(r);if(!n.isEqual(t)){e.insert(o,n)}while(t.parent.isEmpty){const n=t.parent;t=e.createPositionBefore(n);e.remove(n)}n=e.createPositionBefore(r);rp(e,n);if(!sp(e.model.schema,t,n)){return}op(e,t,n,i)}function rp(e,t){const n=t.nodeBefore;const i=t.nodeAfter;if(n.name!=i.name){e.rename(n,i.name)}e.clearAttributes(n);e.setAttributes(Object.fromEntries(i.getAttributes()),n);e.merge(t)}function sp(e,t,n){const i=t.parent;const o=n.parent;if(i==o){return false}if(e.isLimit(i)||e.isLimit(o)){return false}return lp(t,n,e)}function ap(e,t){const n=e.getAncestors();const i=t.getAncestors();let o=0;while(n[o]&&n[o]==i[o]){o++}return[n[o],i[o]]}function cp(e,t){const n=e.checkChild(t,\"$text\");const i=e.checkChild(t,\"paragraph\");return!n&&i}function lp(e,t,n){const i=new ef(e,t);for(const e of i.getWalker()){if(n.isLimit(e.item)){return false}}return true}function dp(e,t,n){const i=e.createElement(\"paragraph\");e.insert(i,t);fp(e,n,e.createPositionAt(i,0))}function up(e,t){const n=e.model.schema.getLimitElement(t);e.remove(e.createRangeIn(n));dp(e,e.createPositionAt(n,0),t)}function hp(e,t){const n=e.getLimitElement(t);if(!t.containsEntireContent(n)){return false}const i=t.getFirstRange();if(i.start.parent==i.end.parent){return false}return e.checkChild(n,\"paragraph\")}function fp(e,t,n){if(t instanceof wf){e.setSelection(n)}else{t.setTo(n)}}const mp=' ,.?!:;\"-()';function gp(e,t,n={}){const i=e.schema;const o=n.direction!=\"backward\";const r=n.unit?n.unit:\"character\";const s=t.focus;const a=new Gh({boundaries:kp(s,o),singleCharacters:true,direction:o?\"forward\":\"backward\"});const c={walker:a,schema:i,isForward:o,unit:r};let l;while(l=a.next()){if(l.done){return}const n=pp(c,l.value);if(n){if(t instanceof wf){e.change(e=>{e.setSelectionFocus(n)})}else{t.setFocus(n)}return}}}function pp(e,t){if(t.type==\"text\"){if(e.unit===\"word\"){return wp(e.walker,e.isForward)}return bp(e.walker,e.unit,e.isForward)}if(t.type==(e.isForward?\"elementStart\":\"elementEnd\")){if(e.schema.isObject(t.item)){return Qh._createAt(t.item,e.isForward?\"after\":\"before\")}if(e.schema.checkChild(t.nextPosition,\"$text\")){return t.nextPosition}}else{if(e.schema.isLimit(t.item)){e.walker.skip(()=>true);return}if(e.schema.checkChild(t.nextPosition,\"$text\")){return t.nextPosition}}}function bp(e,t){const n=e.position.textNode;if(n){const i=n.data;let o=e.position.offset-n.startOffset;while(Dg(i,o)||t==\"character\"&&Bg(i,o)){e.next();o=e.position.offset-n.startOffset}}return e.position}function wp(e,t){let n=e.position.textNode;if(n){let i=e.position.offset-n.startOffset;while(!_p(n.data,i,t)&&!vp(n,i,t)){e.next();const o=t?e.position.nodeAfter:e.position.nodeBefore;if(o&&o.is(\"$text\")){const i=o.data.charAt(t?0:o.data.length-1);if(!mp.includes(i)){e.next();n=e.position.textNode}}i=e.position.offset-n.startOffset}}return e.position}function kp(e,t){const n=e.root;const i=Qh._createAt(n,t?\"end\":0);if(t){return new ef(e,i)}else{return new ef(i,e)}}function _p(e,t,n){const i=t+(n?0:-1);return mp.includes(e.charAt(i))}function vp(e,t,n){return t===(n?e.endOffset:0)}function yp(e,t){return e.change(e=>{const n=e.createDocumentFragment();const i=t.getFirstRange();if(!i||i.isCollapsed){return n}const o=i.start.root;const r=i.start.getCommonPath(i.end);const s=o.getNodeByPath(r);let a;if(i.start.parent==i.end.parent){a=i}else{a=e.createRange(e.createPositionAt(s,i.start.path[r.length]),e.createPositionAt(s,i.end.path[r.length]+1))}const c=a.end.offset-a.start.offset;for(const t of a.getItems({shallow:true})){if(t.is(\"$textProxy\")){e.appendText(t.data,t.getAttributes(),n)}else{e.append(e.cloneElement(t,true),n)}}if(a!=i){const t=i._getTransformedByMove(a.start,e.createPositionAt(n,0),c)[0];const o=e.createRange(e.createPositionAt(n,0),t.start);const r=e.createRange(t.end,e.createPositionAt(n,\"end\"));xp(r,e);xp(o,e)}return n})}function xp(e,t){const n=[];Array.from(e.getItems({direction:\"backward\"})).map(e=>t.createRangeOn(e)).filter(t=>{const n=(t.start.isAfter(e.start)||t.start.isEqual(e.start))&&(t.end.isBefore(e.end)||t.end.isEqual(e.end));return n}).forEach(e=>{n.push(e.start.parent);t.remove(e)});n.forEach(e=>{let n=e;while(n.parent&&n.isEmpty){const e=t.createRangeOn(n);n=n.parent;t.remove(e)}})}function Cp(e){e.document.registerPostFixer(t=>Ap(t,e))}function Ap(e,t){const n=t.document.selection;const i=t.schema;const o=[];let r=false;for(const e of n.getRanges()){const t=Tp(e,i);if(t&&!t.isEqual(e)){o.push(t);r=true}else{o.push(e)}}if(r){e.setSelection(Ip(o),{backward:n.isBackward})}}function Tp(e,t){if(e.isCollapsed){return Sp(e,t)}return Pp(e,t)}function Sp(e,t){const n=e.start;const i=t.getNearestSelectionRange(n);if(!i){return null}if(!i.isCollapsed){return i}const o=i.start;if(n.isEqual(o)){return null}return new ef(o)}function Pp(e,t){const n=e.start;const i=e.end;const o=t.checkChild(n,\"$text\");const r=t.checkChild(i,\"$text\");const s=t.getLimitElement(n);const a=t.getLimitElement(i);if(s===a){if(o&&r){return null}if(Mp(n,i,t)){const e=n.nodeAfter&&t.isObject(n.nodeAfter);const o=e?null:t.getNearestSelectionRange(n,\"forward\");const r=i.nodeBefore&&t.isObject(i.nodeBefore);const s=r?null:t.getNearestSelectionRange(i,\"backward\");const a=o?o.start:n;const c=s?s.start:i;return new ef(a,c)}}const c=s&&!s.is(\"rootElement\");const l=a&&!a.is(\"rootElement\");if(c||l){const e=n.nodeAfter&&i.nodeBefore&&n.nodeAfter.parent===i.nodeBefore.parent;const o=c&&(!e||!Np(n.nodeAfter,t));const r=l&&(!e||!Np(i.nodeBefore,t));let d=n;let u=i;if(o){d=Qh._createBefore(Ep(s,t))}if(r){u=Qh._createAfter(Ep(a,t))}return new ef(d,u)}return null}function Ep(e,t){let n=e;let i=n;while(t.isLimit(i)&&i.parent){n=i;i=i.parent}return n}function Mp(e,t,n){const i=e.nodeAfter&&!n.isLimit(e.nodeAfter)||n.checkChild(e,\"$text\");const o=t.nodeBefore&&!n.isLimit(t.nodeBefore)||n.checkChild(t,\"$text\");return i||o}function Ip(e){const t=[];t.push(e.shift());for(const n of e){const e=t.pop();if(n.isIntersecting(e)){const i=e.start.isAfter(n.start)?n.start:e.start;const o=e.end.isAfter(n.end)?e.end:n.end;const r=new ef(i,o);t.push(r)}else{t.push(e);t.push(n)}}return t}function Np(e,t){return e&&t.isObject(e)}class Rp{constructor(){this.markers=new Wg;this.document=new Fg(this);this.schema=new Pm;this._pendingChanges=[];this._currentWriter=null;[\"insertContent\",\"deleteContent\",\"modifySelection\",\"getSelectedContent\",\"applyOperation\"].forEach(e=>this.decorate(e));this.on(\"applyOperation\",(e,t)=>{const n=t[0];n._validate()},{priority:\"highest\"});this.schema.register(\"$root\",{isLimit:true});this.schema.register(\"$block\",{allowIn:\"$root\",isBlock:true});this.schema.register(\"$text\",{allowIn:\"$block\",isInline:true});this.schema.register(\"$clipboardHolder\",{allowContentOf:\"$root\",isLimit:true});this.schema.extend(\"$text\",{allowIn:\"$clipboardHolder\"});this.schema.register(\"$marker\");this.schema.addChildCheck((e,t)=>{if(t.name===\"$marker\"){return true}});Cp(this)}change(e){try{if(this._pendingChanges.length===0){this._pendingChanges.push({batch:new eg,callback:e});return this._runPendingChanges()[0]}else{return e(this._currentWriter)}}catch(e){ss[\"b\"].rethrowUnexpectedError(e,this)}}enqueueChange(e,t){try{if(typeof e===\"string\"){e=new eg(e)}else if(typeof e==\"function\"){t=e;e=new eg}this._pendingChanges.push({batch:e,callback:t});if(this._pendingChanges.length==1){this._runPendingChanges()}}catch(e){ss[\"b\"].rethrowUnexpectedError(e,this)}}applyOperation(e){e._execute()}insertContent(e,t,n){return Jg(this,e,t,n)}deleteContent(e,t){Xg(this,e,t)}modifySelection(e,t){gp(this,e,t)}getSelectedContent(e){return yp(this,e)}hasContent(e,t={}){const n=e instanceof $h?ef._createIn(e):e;if(n.isCollapsed){return false}const{ignoreWhitespaces:i=false,ignoreMarkers:o=false}=t;if(!o){for(const e of this.markers.getMarkersIntersectingRange(n)){if(e.affectsData){return true}}}for(const e of n.getItems()){if(e.is(\"$textProxy\")){if(!i){return true}else if(e.data.search(/\\S/)!==-1){return true}}else if(this.schema.isObject(e)){return true}}return false}createPositionFromPath(e,t,n){return new Qh(e,t,n)}createPositionAt(e,t){return Qh._createAt(e,t)}createPositionAfter(e){return Qh._createAfter(e)}createPositionBefore(e){return Qh._createBefore(e)}createRange(e,t){return new ef(e,t)}createRangeIn(e){return ef._createIn(e)}createRangeOn(e){return ef._createOn(e)}createSelection(e,t,n){return new af(e,t,n)}createBatch(e){return new eg(e)}createOperationFromJSON(e){return Yg.fromJSON(e,this.document)}destroy(){this.document.destroy();this.stopListening()}_runPendingChanges(){const e=[];this.fire(\"_beforeChanges\");while(this._pendingChanges.length){const t=this._pendingChanges[0].batch;this._currentWriter=new Cg(this,t);const n=this._pendingChanges[0].callback(this._currentWriter);e.push(n);this.document._handleChangeBlock(this._currentWriter);this._pendingChanges.shift();this._currentWriter=null}this.fire(\"_afterChanges\");return e}}ys(Rp,Qc);class Op{constructor(){this._listener=Object.create(Kd)}listenTo(e){this._listener.listenTo(e,\"keydown\",(e,t)=>{this._listener.fire(\"_keydown:\"+zl(t),t)})}set(e,t,n={}){const i=Vl(e);const o=n.priority;this._listener.listenTo(this._listener,\"_keydown:\"+i,(e,n)=>{t(n,()=>{n.preventDefault();n.stopPropagation();e.stop()});e.return=true},{priority:o})}press(e){return!!this._listener.fire(\"_keydown:\"+zl(e),e)}destroy(){this._listener.stopListening()}}class zp extends Op{constructor(e){super();this.editor=e}set(e,t,n={}){if(typeof t==\"string\"){const e=t;t=(t,n)=>{this.editor.execute(e);n()}}super.set(e,t,n)}}class Vp{constructor(e={}){this._context=e.context||new Os({language:e.language});this._context._addEditor(this,!e.context);const t=Array.from(this.constructor.builtinPlugins||[]);this.config=new Kr(e,this.constructor.defaultConfig);this.config.define(\"plugins\",t);this.config.define(this._context._getEditorConfig());this.plugins=new Cs(this,t,this._context.plugins);this.locale=this._context.locale;this.t=this.locale.t;this.commands=new Am;this.set(\"state\",\"initializing\");this.once(\"ready\",()=>this.state=\"ready\",{priority:\"high\"});this.once(\"destroy\",()=>this.state=\"destroyed\",{priority:\"high\"});this.set(\"isReadOnly\",false);this.model=new Rp;const n=new Oc;this.data=new Km(this.model,n);this.editing=new Cm(this.model,n);this.editing.view.document.bind(\"isReadOnly\").to(this);this.conversion=new Jm([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 zp(this);this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const e=this.config;const t=e.get(\"plugins\");const n=e.get(\"removePlugins\")||[];const i=e.get(\"extraPlugins\")||[];return this.plugins.init(t.concat(i),n)}destroy(){let e=Promise.resolve();if(this.state==\"initializing\"){e=new Promise(e=>this.once(\"ready\",e))}return 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){ss[\"b\"].rethrowUnexpectedError(e,this)}}}ys(Vp,Qc);const Lp={setData(e){this.data.set(e)},getData(e){return this.data.get(e)}};var Dp=Lp;function Bp(e,t){if(e instanceof HTMLTextAreaElement){e.value=t}e.innerHTML=t}const jp={updateSourceElement(){if(!this.sourceElement){throw new ss[\"b\"](\"editor-missing-sourceelement: Cannot update the source element of a detached editor.\",this)}Bp(this.sourceElement,this.data.get())}};var Fp=jp;function Hp(e){if(!me(e.updateSourceElement)){throw new ss[\"b\"](\"attachtoform-missing-elementapi-interface: Editor passed to attachToForm() must implement ElementApi.\",e)}const t=e.sourceElement;if(t&&t.tagName.toLowerCase()===\"textarea\"&&t.form){let n;const i=t.form;const o=()=>e.updateSourceElement();if(me(i.submit)){n=i.submit;i.submit=()=>{o();n.apply(i)}}i.addEventListener(\"submit\",o);e.on(\"destroy\",()=>{i.removeEventListener(\"submit\",o);if(n){i.submit=n}})}}class Wp{getHtml(e){const t=document.implementation.createHTMLDocument(\"\");const n=t.createElement(\"div\");n.appendChild(e);return n.innerHTML}}class Up{constructor(e){this._domParser=new DOMParser;this._domConverter=new Hd(e,{blockFillerMode:\"nbsp\"});this._htmlWriter=new Wp}toData(e){const t=this._domConverter.viewToDom(e,document);return this._htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this._domConverter.domToView(t)}_toDom(e){const t=this._domParser.parseFromString(e,\"text/html\");const n=t.createDocumentFragment();const i=t.body.childNodes;while(i.length>0){n.appendChild(i[0])}return n}}class qp{constructor(e){this.editor=e;this._components=new Map}*names(){for(const e of this._components.values()){yield e.originalName}}add(e,t){if(this.has(e)){throw new ss[\"b\"](\"componentfactory-item-exists: The item already exists in the component factory.\",this,{name:e})}this._components.set($p(e),{callback:t,originalName:e})}create(e){if(!this.has(e)){throw new ss[\"b\"](\"componentfactory-item-missing: The required component is not registered in the factory.\",this,{name:e})}return this._components.get($p(e)).callback(this.editor.locale)}has(e){return this._components.has($p(e))}}function $p(e){return String(e).toLowerCase()}class Yp{constructor(){this.set(\"isFocused\",false);this.set(\"focusedElement\",null);this._elements=new Set;this._nextEventLoopTimeout=null}add(e){if(this._elements.has(e)){throw new ss[\"b\"](\"focusTracker-add-element-already-exist\",this)}this.listenTo(e,\"focus\",()=>this._focus(e),{useCapture:true});this.listenTo(e,\"blur\",()=>this._blur(),{useCapture:true});this._elements.add(e)}remove(e){if(e===this.focusedElement){this._blur(e)}if(this._elements.has(e)){this.stopListening(e);this._elements.delete(e)}}destroy(){this.stopListening()}_focus(e){clearTimeout(this._nextEventLoopTimeout);this.focusedElement=e;this.isFocused=true}_blur(){clearTimeout(this._nextEventLoopTimeout);this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null;this.isFocused=false},0)}}ys(Yp,Kd);ys(Yp,Qc);class Gp{constructor(e){this.editor=e;this.componentFactory=new qp(e);this.focusTracker=new Yp;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);if(!t.ckeditorInstance){t.ckeditorInstance=this.editor}}getEditableElement(e=\"main\"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}get _editableElements(){console.warn(\"editor-ui-deprecated-editable-elements: \"+\"The EditorUI#_editableElements property has been deprecated and will be removed in the near future.\",{editorUI:this});return this._editableElementsMap}}ys(Gp,ds);function Kp({origin:e,originKeystrokeHandler:t,originFocusTracker:n,toolbar:i,beforeFocus:o,afterBlur:r}){n.add(i.element);t.set(\"Alt+F10\",(e,t)=>{if(n.isFocused&&!i.focusTracker.isFocused){if(o){o()}i.focus();t()}});i.keystrokes.set(\"Esc\",(t,n)=>{if(i.focusTracker.isFocused){e.focus();if(r){r()}n()}})}function Qp(e){if(Array.isArray(e)){return{items:e}}if(!e){return{items:[]}}return Object.assign({items:[]},e)}var Jp=n(15);const Zp=new WeakMap;function Xp(e){const{view:t,element:n,text:i,isDirectHost:o=true}=e;const r=t.document;if(!Zp.has(r)){Zp.set(r,new Map);r.registerPostFixer(e=>ob(r,e))}Zp.get(r).set(n,{text:i,isDirectHost:o});t.change(e=>ob(r,e))}function eb(e,t){const n=t.document;e.change(e=>{if(!Zp.has(n)){return}const i=Zp.get(n);const o=i.get(t);e.removeAttribute(\"data-placeholder\",o.hostElement);nb(e,o.hostElement);i.delete(t)})}function tb(e,t){if(!t.hasClass(\"ck-placeholder\")){e.addClass(\"ck-placeholder\",t);return true}return false}function nb(e,t){if(t.hasClass(\"ck-placeholder\")){e.removeClass(\"ck-placeholder\",t);return true}return false}function ib(e){if(!e.isAttached()){return false}const t=!Array.from(e.getChildren()).some(e=>!e.is(\"uiElement\"));const n=e.document;if(!n.isFocused&&t){return true}const i=n.selection;const o=i.anchor;if(t&&o&&o.parent!==e){return true}return false}function ob(e,t){const n=Zp.get(e);let i=false;for(const[e,o]of n){if(rb(t,e,o)){i=true}}return i}function rb(e,t,n){const{text:i,isDirectHost:o}=n;const r=o?t:sb(t);let s=false;if(!r){return false}n.hostElement=r;if(r.getAttribute(\"data-placeholder\")!==i){e.setAttribute(\"data-placeholder\",i,r);s=true}if(ib(r)){if(tb(e,r)){s=true}}else if(nb(e,r)){s=true}return s}function sb(e){if(e.childCount===1){const t=e.getChild(0);if(t.is(\"element\")&&!t.is(\"uiElement\")){return t}}return null}class ab{constructor(){this._replacedElements=[]}replace(e,t){this._replacedElements.push({element:e,newElement:t});e.style.display=\"none\";if(t){e.parentNode.insertBefore(t,e.nextSibling)}}restore(){this._replacedElements.forEach(({element:e,newElement:t})=>{e.style.display=\"\";if(t){t.remove()}});this._replacedElements=[]}}class cb extends Gp{constructor(e,t){super(e);this.view=t;this._toolbarConfig=Qp(e.config.get(\"toolbar\"));this._elementReplacer=new ab}get element(){return this.view.element}init(e){const t=this.editor;const n=this.view;const i=t.editing.view;const o=n.editable;const r=i.document.getRoot();o.name=r.rootName;n.render();const s=o.element;this.setEditableElement(o.name,s);this.focusTracker.add(s);n.editable.bind(\"isFocused\").to(this.focusTracker);i.attachDomRoot(s);if(e){this._elementReplacer.replace(e,this.element)}this._initPlaceholder();this._initToolbar();this.fire(\"ready\")}destroy(){const e=this.view;const t=this.editor.editing.view;this._elementReplacer.restore();t.detachDomRoot(e.editable.name);e.destroy();super.destroy()}_initToolbar(){const e=this.editor;const t=this.view;const n=e.editing.view;t.stickyPanel.bind(\"isActive\").to(this.focusTracker,\"isFocused\");t.stickyPanel.limiterElement=t.element;if(this._toolbarConfig.viewportTopOffset){t.stickyPanel.viewportTopOffset=this._toolbarConfig.viewportTopOffset}t.toolbar.fillFromConfig(this._toolbarConfig.items,this.componentFactory);Kp({origin:n,originFocusTracker:this.focusTracker,originKeystrokeHandler:e.keystrokes,toolbar:t.toolbar})}_initPlaceholder(){const e=this.editor;const t=e.editing.view;const n=t.document.getRoot();const i=e.sourceElement;const o=e.config.get(\"placeholder\")||i&&i.tagName.toLowerCase()===\"textarea\"&&i.getAttribute(\"placeholder\");if(o){Xp({view:t,element:n,text:o,isDirectHost:false})}}}class lb extends xs{constructor(e=[]){super(e,{idProperty:\"viewUid\"});this.on(\"add\",(e,t,n)=>{this._renderViewIntoCollectionParent(t,n)});this.on(\"remove\",(e,t)=>{if(t.element&&this._parentElement){t.element.remove()}});this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e;for(const e of this){this._renderViewIntoCollectionParent(e)}}delegate(...e){if(!e.length||!db(e)){throw new ss[\"b\"](\"ui-viewcollection-delegate-wrong-events: All event names must be strings.\",this)}return{to:t=>{for(const n of this){for(const i of e){n.delegate(i).to(t)}}this.on(\"add\",(n,i)=>{for(const n of e){i.delegate(n).to(t)}});this.on(\"remove\",(n,i)=>{for(const n of e){i.stopDelegating(n,t)}})}}}_renderViewIntoCollectionParent(e,t){if(!e.isRendered){e.render()}if(e.element&&this._parentElement){this._parentElement.insertBefore(e.element,this._parentElement.children[t])}}}function db(e){return e.every(e=>typeof e==\"string\")}const ub=\"http://www.w3.org/1999/xhtml\";class hb{constructor(e){Object.assign(this,xb(yb(e)));this._isRendered=false;this._revertData=null}render(){const e=this._renderNode({intoFragment:true});this._isRendered=true;return e}apply(e){this._revertData=Vb();this._renderNode({node:e,isApplying:true,revertData:this._revertData});return e}revert(e){if(!this._revertData){throw new ss[\"b\"](\"ui-template-revert-not-applied: Attempting to revert a template which has not been applied yet.\",[this,e])}this._revertTemplateFromNode(e,this._revertData)}*getViews(){function*e(t){if(t.children){for(const n of t.children){if(Rb(n)){yield n}else if(Ob(n)){yield*e(n)}}}}yield*e(this)}static bind(e,t){return{to(n,i){return new mb({eventNameOrFunction:n,attribute:n,observable:e,emitter:t,callback:i})},if(n,i,o){return new gb({observable:e,emitter:t,attribute:n,valueIfTrue:i,callback:o})}}}static extend(e,t){if(e._isRendered){throw new ss[\"b\"](\"template-extend-render: Attempting to extend a template which has already been rendered.\",[this,e])}Ib(e,xb(yb(t)))}_renderNode(e){let t;if(e.node){t=this.tag&&this.text}else{t=this.tag?this.text:!this.text}if(t){throw new ss[\"b\"]('ui-template-wrong-syntax: Node definition must have either \"tag\" or \"text\" when rendering a new Node.',this)}if(this.text){return this._renderText(e)}else{return this._renderElement(e)}}_renderElement(e){let t=e.node;if(!t){t=e.node=document.createElementNS(this.ns||ub,this.tag)}this._renderAttributes(e);this._renderElementChildren(e);this._setUpListeners(e);return t}_renderText(e){let t=e.node;if(t){e.revertData.text=t.textContent}else{t=e.node=document.createTextNode(\"\")}if(pb(this.text)){this._bindToObservable({schema:this.text,updater:kb(t),data:e})}else{t.textContent=this.text.join(\"\")}return t}_renderAttributes(e){let t,n,i,o;if(!this.attributes){return}const r=e.node;const s=e.revertData;for(t in this.attributes){i=r.getAttribute(t);n=this.attributes[t];if(s){s.attributes[t]=i}o=ce(n[0])&&n[0].ns?n[0].ns:null;if(pb(n)){const a=o?n[0].value:n;if(s&&Lb(t)){a.unshift(i)}this._bindToObservable({schema:a,updater:_b(r,t,o),data:e})}else if(t==\"style\"&&typeof n[0]!==\"string\"){this._renderStyleAttribute(n[0],e)}else{if(s&&i&&Lb(t)){n.unshift(i)}n=n.map(e=>e?e.value||e:e).reduce((e,t)=>e.concat(t),[]).reduce(Eb,\"\");if(!Nb(n)){r.setAttributeNS(o,t,n)}}}}_renderStyleAttribute(e,t){const n=t.node;for(const i in e){const o=e[i];if(pb(o)){this._bindToObservable({schema:[o],updater:vb(n,i),data:t})}else{n.style[i]=o}}}_renderElementChildren(e){const t=e.node;const n=e.intoFragment?document.createDocumentFragment():t;const i=e.isApplying;let o=0;for(const r of this.children){if(zb(r)){if(!i){r.setParent(t);for(const e of r){n.appendChild(e.element)}}}else if(Rb(r)){if(!i){if(!r.isRendered){r.render()}n.appendChild(r.element)}}else if(Pd(r)){n.appendChild(r)}else{if(i){const t=e.revertData;const i=Vb();t.children.push(i);r._renderNode({node:n.childNodes[o++],isApplying:true,revertData:i})}else{n.appendChild(r.render())}}}if(e.intoFragment){t.appendChild(n)}}_setUpListeners(e){if(!this.eventListeners){return}for(const t in this.eventListeners){const n=this.eventListeners[t].map(n=>{const[i,o]=t.split(\"@\");return n.activateDomEventListener(i,o,e)});if(e.revertData){e.revertData.bindings.push(n)}}}_bindToObservable({schema:e,updater:t,data:n}){const i=n.revertData;wb(e,t,n);const o=e.filter(e=>!Nb(e)).filter(e=>e.observable).map(i=>i.activateAttributeListener(e,t,n));if(i){i.bindings.push(o)}}_revertTemplateFromNode(e,t){for(const e of t.bindings){for(const t of e){t()}}if(t.text){e.textContent=t.text;return}for(const n in t.attributes){const i=t.attributes[n];if(i===null){e.removeAttribute(n)}else{e.setAttribute(n,i)}}for(let n=0;nwb(e,t,n);this.emitter.listenTo(this.observable,\"change:\"+this.attribute,i);return()=>{this.emitter.stopListening(this.observable,\"change:\"+this.attribute,i)}}}class mb extends fb{activateDomEventListener(e,t,n){const i=(e,n)=>{if(!t||n.target.matches(t)){if(typeof this.eventNameOrFunction==\"function\"){this.eventNameOrFunction(n)}else{this.observable.fire(this.eventNameOrFunction,n)}}};this.emitter.listenTo(n.node,e,i);return()=>{this.emitter.stopListening(n.node,e,i)}}}class gb extends fb{getValue(e){const t=super.getValue(e);return Nb(t)?false:this.valueIfTrue||true}}function pb(e){if(!e){return false}if(e.value){e=e.value}if(Array.isArray(e)){return e.some(pb)}else if(e instanceof fb){return true}return false}function bb(e,t){return e.map(e=>{if(e instanceof fb){return e.getValue(t)}return e})}function wb(e,t,{node:n}){let i=bb(e,n);if(e.length==1&&e[0]instanceof gb){i=i[0]}else{i=i.reduce(Eb,\"\")}if(Nb(i)){t.remove()}else{t.set(i)}}function kb(e){return{set(t){e.textContent=t},remove(){e.textContent=\"\"}}}function _b(e,t,n){return{set(i){e.setAttributeNS(n,t,i)},remove(){e.removeAttributeNS(n,t)}}}function vb(e,t){return{set(n){e.style[t]=n},remove(){e.style[t]=null}}}function yb(e){const t=$r(e,e=>{if(e&&(e instanceof fb||Ob(e)||Rb(e)||zb(e))){return e}});return t}function xb(e){if(typeof e==\"string\"){e=Tb(e)}else if(e.text){Sb(e)}if(e.on){e.eventListeners=Ab(e.on);delete e.on}if(!e.text){if(e.attributes){Cb(e.attributes)}const t=[];if(e.children){if(zb(e.children)){t.push(e.children)}else{for(const n of e.children){if(Ob(n)||Rb(n)||Pd(n)){t.push(n)}else{t.push(new hb(n))}}}}e.children=t}return e}function Cb(e){for(const t in e){if(e[t].value){e[t].value=[].concat(e[t].value)}Pb(e,t)}}function Ab(e){for(const t in e){Pb(e,t)}return e}function Tb(e){return{text:[e]}}function Sb(e){if(!Array.isArray(e.text)){e.text=[e.text]}}function Pb(e,t){if(!Array.isArray(e[t])){e[t]=[e[t]]}}function Eb(e,t){if(Nb(t)){return e}else if(Nb(e)){return t}else{return`${e} ${t}`}}function Mb(e,t){for(const n in t){if(e[n]){e[n].push(...t[n])}else{e[n]=t[n]}}}function Ib(e,t){if(t.attributes){if(!e.attributes){e.attributes={}}Mb(e.attributes,t.attributes)}if(t.eventListeners){if(!e.eventListeners){e.eventListeners={}}Mb(e.eventListeners,t.eventListeners)}if(t.text){e.text.push(...t.text)}if(t.children&&t.children.length){if(e.children.length!=t.children.length){throw new ss[\"b\"](\"ui-template-extend-children-mismatch: The number of children in extended definition does not match.\",e)}let n=0;for(const i of t.children){Ib(e.children[n++],i)}}}function Nb(e){return!e&&e!==0}function Rb(e){return e instanceof Bb}function Ob(e){return e instanceof hb}function zb(e){return e instanceof lb}function Vb(){return{children:[],bindings:[],attributes:{}}}function Lb(e){return e==\"class\"||e==\"style\"}var Db=n(17);class Bb{constructor(e){this.element=null;this.isRendered=false;this.locale=e;this.t=e&&e.t;this._viewCollections=new xs;this._unboundChildren=this.createCollection();this._viewCollections.on(\"add\",(t,n)=>{n.locale=e});this.decorate(\"render\")}get bindTemplate(){if(this._bindTemplate){return this._bindTemplate}return this._bindTemplate=hb.bind(this,this)}createCollection(e){const t=new lb(e);this._viewCollections.add(t);return t}registerChild(e){if(!vs(e)){e=[e]}for(const t of e){this._unboundChildren.add(t)}}deregisterChild(e){if(!vs(e)){e=[e]}for(const t of e){this._unboundChildren.remove(t)}}setTemplate(e){this.template=new hb(e)}extendTemplate(e){hb.extend(this.template,e)}render(){if(this.isRendered){throw new ss[\"b\"](\"ui-view-render-already-rendered: This View has already been rendered.\",this)}if(this.template){this.element=this.template.render();this.registerChild(this.template.getViews())}this.isRendered=true}destroy(){this.stopListening();this._viewCollections.map(e=>e.destroy());if(this.template&&this.template._revertData){this.template.revert(this.element)}}}ys(Bb,Kd);ys(Bb,Qc);var jb=\"[object String]\";function Fb(e){return typeof e==\"string\"||!Kt(e)&&T(e)&&_(e)==jb}var Hb=Fb;function Wb(e,t,n={},i=[]){const o=n&&n.xmlns;const r=o?e.createElementNS(o,t):e.createElement(t);for(const e in n){r.setAttribute(e,n[e])}if(Hb(i)||!vs(i)){i=[i]}for(let t of i){if(Hb(t)){t=e.createTextNode(t)}r.appendChild(t)}return r}class Ub extends lb{constructor(e,t=[]){super(t);this.locale=e}attachToDom(){this._bodyCollectionContainer=new hb({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\");if(!e){e=Wb(document,\"div\",{class:\"ck-body-wrapper\"});document.body.appendChild(e)}e.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy();if(this._bodyCollectionContainer){this._bodyCollectionContainer.remove()}const e=document.querySelector(\".ck-body-wrapper\");if(e&&e.childElementCount==0){e.remove()}}}var qb=n(19);class $b extends Bb{constructor(e){super(e);this.body=new Ub(e)}render(){super.render();this.body.attachToDom()}destroy(){this.body.detachFromDom();return super.destroy()}}var Yb=n(21);class Gb extends Bb{constructor(e){super(e);this.set(\"text\");this.set(\"for\");this.id=`ck-editor__label_${ns()}`;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\")}]})}}class Kb extends $b{constructor(e){super(e);this.top=this.createCollection();this.main=this.createCollection();this._voiceLabelView=this._createVoiceLabel();this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-reset\",\"ck-editor\",\"ck-rounded-corners\"],role:\"application\",dir:e.uiLanguageDirection,lang:e.uiLanguage,\"aria-labelledby\":this._voiceLabelView.id},children:[this._voiceLabelView,{tag:\"div\",attributes:{class:[\"ck\",\"ck-editor__top\",\"ck-reset_all\"],role:\"presentation\"},children:this.top},{tag:\"div\",attributes:{class:[\"ck\",\"ck-editor__main\"],role:\"presentation\"},children:this.main}]})}_createVoiceLabel(){const e=this.t;const t=new Gb;t.text=e(\"Rich Text Editor\");t.extendTemplate({attributes:{class:\"ck-voice-label\"}});return t}}class Qb extends Bb{constructor(e,t,n){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\",false);this._editableElement=n;this._hasExternalElement=!!this._editableElement;this._editingView=t}render(){super.render();if(this._hasExternalElement){this.template.apply(this.element=this._editableElement)}else{this._editableElement=this.element}this.on(\"change:isFocused\",()=>this._updateIsFocusedClasses());this._updateIsFocusedClasses()}destroy(){if(this._hasExternalElement){this.template.revert(this._editableElement)}super.destroy()}_updateIsFocusedClasses(){const e=this._editingView;if(e.isRenderingInProgress){n(this)}else{t(this)}function t(t){e.change(n=>{const i=e.document.getRoot(t.name);n.addClass(t.isFocused?\"ck-focused\":\"ck-blurred\",i);n.removeClass(t.isFocused?\"ck-blurred\":\"ck-focused\",i)})}function n(i){e.once(\"change:isRenderingInProgress\",(e,o,r)=>{if(!r){t(i)}else{n(i)}})}}}class Jb extends Qb{constructor(e,t,n){super(e,t,n);this.extendTemplate({attributes:{role:\"textbox\",class:\"ck-editor__editable_inline\"}})}render(){super.render();const e=this._editingView;const t=this.t;e.change(n=>{const i=e.document.getRoot(this.name);n.setAttribute(\"aria-label\",t(\"Rich Text Editor, %0\",[this.name]),i)})}}function Zb(e){return t=>t+e}var Xb=n(23);const ew=Zb(\"px\");class tw extends Bb{constructor(e){super(e);const t=this.bindTemplate;this.set(\"isActive\",false);this.set(\"isSticky\",false);this.set(\"limiterElement\",null);this.set(\"limiterBottomOffset\",50);this.set(\"viewportTopOffset\",0);this.set(\"_marginLeft\",null);this.set(\"_isStickyToTheLimiter\",false);this.set(\"_hasViewportTopOffset\",false);this.content=this.createCollection();this._contentPanelPlaceholder=new hb({tag:\"div\",attributes:{class:[\"ck\",\"ck-sticky-panel__placeholder\"],style:{display:t.to(\"isSticky\",e=>e?\"block\":\"none\"),height:t.to(\"isSticky\",e=>e?ew(this._panelRect.height):null)}}}).render();this._contentPanel=new hb({tag:\"div\",attributes:{class:[\"ck\",\"ck-sticky-panel__content\",t.if(\"isSticky\",\"ck-sticky-panel__content_sticky\"),t.if(\"_isStickyToTheLimiter\",\"ck-sticky-panel__content_sticky_bottom-limit\")],style:{width:t.to(\"isSticky\",e=>e?ew(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to(\"_hasViewportTopOffset\",e=>e?ew(this.viewportTopOffset):null),bottom:t.to(\"_isStickyToTheLimiter\",e=>e?ew(this.limiterBottomOffset):null),marginLeft:t.to(\"_marginLeft\")}},children:this.content}).render();this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-sticky-panel\"]},children:[this._contentPanelPlaceholder,this._contentPanel]})}render(){super.render();this._checkIfShouldBeSticky();this.listenTo(Ld.window,\"scroll\",()=>{this._checkIfShouldBeSticky()});this.listenTo(this,\"change:isActive\",()=>{this._checkIfShouldBeSticky()})}_checkIfShouldBeSticky(){const e=this._panelRect=this._contentPanel.getBoundingClientRect();let t;if(!this.limiterElement){this.isSticky=false}else{t=this._limiterRect=this.limiterElement.getBoundingClientRect();this.isSticky=this.isActive&&t.top{this[t]();n()})}}}}get first(){return this.focusables.find(iw)||null}get last(){return this.focusables.filter(iw).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let e=null;if(this.focusTracker.focusedElement===null){return null}this.focusables.find((t,n)=>{const i=t.element===this.focusTracker.focusedElement;if(i){e=n}return i});return e}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(e){if(e){e.focus()}}_getFocusableItem(e){const t=this.current;const n=this.focusables.length;if(!n){return null}if(t===null){return this[e===1?\"first\":\"last\"]}let i=(t+n+e)%n;do{const t=this.focusables.get(i);if(iw(t)){return t}i=(i+n+e)%n}while(i!==t);return null}}function iw(e){return!!(e.focus&&Ld.window.getComputedStyle(e.element).display!=\"none\")}class ow extends Bb{constructor(e){super(e);this.setTemplate({tag:\"span\",attributes:{class:[\"ck\",\"ck-toolbar__separator\"]}})}}const rw=100;class sw{constructor(e,t){if(!sw._observerInstance){sw._createObserver()}this._element=e;this._callback=t;sw._addElementCallback(e,t);sw._observerInstance.observe(e)}destroy(){sw._deleteElementCallback(this._element,this._callback)}static _addElementCallback(e,t){if(!sw._elementCallbacks){sw._elementCallbacks=new Map}let n=sw._elementCallbacks.get(e);if(!n){n=new Set;sw._elementCallbacks.set(e,n)}n.add(t)}static _deleteElementCallback(e,t){const n=sw._getElementCallbacks(e);if(n){n.delete(t);if(!n.size){sw._elementCallbacks.delete(e);sw._observerInstance.unobserve(e)}}if(sw._elementCallbacks&&!sw._elementCallbacks.size){sw._observerInstance=null;sw._elementCallbacks=null}}static _getElementCallbacks(e){if(!sw._elementCallbacks){return null}return sw._elementCallbacks.get(e)}static _createObserver(){let e;if(typeof Ld.window.ResizeObserver===\"function\"){e=Ld.window.ResizeObserver}else{e=aw}sw._observerInstance=new e(e=>{for(const t of e){if(!t.target.offsetParent){continue}const e=sw._getElementCallbacks(t.target);if(e){for(const n of e){n(t)}}}})}}sw._observerInstance=null;sw._elementCallbacks=null;class aw{constructor(e){this._callback=e;this._elements=new Set;this._previousRects=new Map;this._periodicCheckTimeout=null}observe(e){this._elements.add(e);this._checkElementRectsAndExecuteCallback();if(this._elements.size===1){this._startPeriodicCheck()}}unobserve(e){this._elements.delete(e);this._previousRects.delete(e);if(!this._elements.size){this._stopPeriodicCheck()}}_startPeriodicCheck(){const e=()=>{this._checkElementRectsAndExecuteCallback();this._periodicCheckTimeout=setTimeout(e,rw)};this.listenTo(Ld.window,\"resize\",()=>{this._checkElementRectsAndExecuteCallback()});this._periodicCheckTimeout=setTimeout(e,rw)}_stopPeriodicCheck(){clearTimeout(this._periodicCheckTimeout);this.stopListening();this._previousRects.clear()}_checkElementRectsAndExecuteCallback(){const e=[];for(const t of this._elements){if(this._hasRectChanged(t)){e.push({target:t,contentRect:this._previousRects.get(t)})}}if(e.length){this._callback(e)}}_hasRectChanged(e){if(!e.ownerDocument.body.contains(e)){return false}const t=new Th(e);const n=this._previousRects.get(e);const i=!n||!n.isEqual(t);this._previousRects.set(e,t);return i}}ys(aw,Kd);function cw(e){return e.bindTemplate.to(t=>{if(t.target===e.element){t.preventDefault()}})}class lw extends Bb{constructor(e){super(e);const t=this.bindTemplate;this.set(\"isVisible\",false);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(){if(this.children.length){this.children.first.focus()}}focusLast(){if(this.children.length){const e=this.children.last;if(typeof e.focusLast===\"function\"){e.focusLast()}else{e.focus()}}}}var dw=n(25);function uw(e){if(!e||!e.parentNode){return null}if(e.offsetParent===Ld.document.body){return null}return e.offsetParent}function hw({element:e,target:t,positions:n,limiter:i,fitInViewport:o}){if(me(t)){t=t()}if(me(i)){i=i()}const r=uw(e);const s=new Th(e);const a=new Th(t);let c;let l;if(!i&&!o){[l,c]=fw(n[0],a,s)}else{const e=i&&new Th(i).getVisible();const t=o&&new Th(Ld.window);const r=mw(n,{targetRect:a,elementRect:s,limiterRect:e,viewportRect:t});[l,c]=r||fw(n[0],a,s)}let d=ww(c);if(r){d=bw(d,r)}return{left:d.left,top:d.top,name:l}}function fw(e,t,n){const i=e(t,n);if(!i){return null}const{left:o,top:r,name:s}=i;return[s,n.clone().moveTo(o,r)]}function mw(e,t){const{elementRect:n,viewportRect:i}=t;const o=n.getArea();const r=gw(e,t);if(i){const e=r.filter(({viewportIntersectArea:e})=>e===o);const t=pw(e,o);if(t){return t}}return pw(r,o)}function gw(e,{targetRect:t,elementRect:n,limiterRect:i,viewportRect:o}){const r=[];const s=n.getArea();for(const a of e){const e=fw(a,t,n);if(!e){continue}const[c,l]=e;let d=0;let u=0;if(i){if(o){const e=i.getIntersection(o);if(e){d=e.getIntersectionArea(l)}}else{d=i.getIntersectionArea(l)}}if(o){u=o.getIntersectionArea(l)}const h={positionName:c,positionRect:l,limiterIntersectArea:d,viewportIntersectArea:u};if(d===s){return[h]}r.push(h)}return r}function pw(e,t){let n=0;let i;let o;for(const{positionName:r,positionRect:s,limiterIntersectArea:a,viewportIntersectArea:c}of e){if(a===t){return[r,s]}const e=c**2+a**2;if(e>n){n=e;i=s;o=r}}return i?[o,i]:null}function bw({left:e,top:t},n){const i=ww(new Th(n));const o=Ch(n);e-=i.left;t-=i.top;e+=n.scrollLeft;t+=n.scrollTop;e-=o.left;t-=o.top;return{left:e,top:t}}function ww({left:e,top:t}){const{scrollX:n,scrollY:i}=Ld.window;return{left:e+n,top:t+i}}class kw extends Bb{constructor(e,t,n){super(e);const i=this.bindTemplate;this.buttonView=t;this.panelView=n;this.set(\"isOpen\",false);this.set(\"isEnabled\",true);this.set(\"class\");this.set(\"id\");this.set(\"panelPosition\",\"auto\");this.keystrokes=new Op;this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-dropdown\",i.to(\"class\"),i.if(\"isEnabled\",\"ck-disabled\",e=>!e)],id:i.to(\"id\"),\"aria-describedby\":i.to(\"ariaDescribedById\")},children:[t,n]});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\",()=>{if(!this.isOpen){return}if(this.panelPosition===\"auto\"){this.panelView.position=kw._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:true,positions:this._panelPositions}).name}else{this.panelView.position=this.panelPosition}});this.keystrokes.listenTo(this.element);const e=(e,t)=>{if(this.isOpen){this.buttonView.focus();this.isOpen=false;t()}};this.keystrokes.set(\"arrowdown\",(e,t)=>{if(this.buttonView.isEnabled&&!this.isOpen){this.isOpen=true;t()}});this.keystrokes.set(\"arrowright\",(e,t)=>{if(this.isOpen){t()}});this.keystrokes.set(\"arrowleft\",e);this.keystrokes.set(\"esc\",e)}focus(){this.buttonView.focus()}get _panelPositions(){const{southEast:e,southWest:t,northEast:n,northWest:i}=kw.defaultPanelPositions;if(this.locale.uiLanguageDirection===\"ltr\"){return[e,t,n,i]}else{return[t,e,i,n]}}}kw.defaultPanelPositions={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\"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:\"ne\"}),northWest:(e,t)=>({top:e.bottom-t.height,left:e.left-t.width+e.width,name:\"nw\"})};kw._getOptimalPosition=hw;var _w=n(27);class vw extends Bb{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 e=(new DOMParser).parseFromString(this.content.trim(),\"image/svg+xml\");const t=e.querySelector(\"svg\");const n=t.getAttribute(\"viewBox\");if(n){this.viewBox=n}this.element.innerHTML=\"\";while(t.childNodes.length>0){this.element.appendChild(t.childNodes[0])}}}_colorFillPaths(){if(this.fillColor){this.element.querySelectorAll(\".ck-icon__fill\").forEach(e=>{e.style.fill=this.fillColor})}}}var yw=n(29);class xw extends Bb{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 Cw=n(31);class Aw extends Bb{constructor(e){super(e);const t=this.bindTemplate;const n=ns();this.set(\"class\");this.set(\"labelStyle\");this.set(\"icon\");this.set(\"isEnabled\",true);this.set(\"isOn\",false);this.set(\"isVisible\",true);this.set(\"isToggleable\",false);this.set(\"keystroke\");this.set(\"label\");this.set(\"tabindex\",-1);this.set(\"tooltip\");this.set(\"tooltipPosition\",\"s\");this.set(\"type\",\"button\");this.set(\"withText\",false);this.set(\"withKeystroke\",false);this.children=this.createCollection();this.tooltipView=this._createTooltipView();this.labelView=this._createLabelView(n);this.iconView=new vw;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?e:\"button\"),tabindex:t.to(\"tabindex\"),\"aria-labelledby\":`ck-editor__aria-label_${n}`,\"aria-disabled\":t.if(\"isEnabled\",true,e=>!e),\"aria-pressed\":t.to(\"isOn\",e=>this.isToggleable?String(e):false)},children:this.children,on:{mousedown:t.to(e=>{e.preventDefault()}),click:t.to(e=>{if(this.isEnabled){this.fire(\"execute\")}else{e.preventDefault()}})}})}render(){super.render();if(this.icon){this.iconView.bind(\"content\").to(this,\"icon\");this.children.add(this.iconView)}this.children.add(this.tooltipView);this.children.add(this.labelView);if(this.withKeystroke){this.children.add(this.keystrokeView)}}focus(){this.element.focus()}_createTooltipView(){const e=new xw;e.bind(\"text\").to(this,\"_tooltipString\");e.bind(\"position\").to(this,\"tooltipPosition\");return e}_createLabelView(e){const t=new Bb;const n=this.bindTemplate;t.setTemplate({tag:\"span\",attributes:{class:[\"ck\",\"ck-button__label\"],style:n.to(\"labelStyle\"),id:`ck-editor__aria-label_${e}`},children:[{text:this.bindTemplate.to(\"label\")}]});return t}_createKeystrokeView(){const e=new Bb;e.setTemplate({tag:\"span\",attributes:{class:[\"ck\",\"ck-button__keystroke\"]},children:[{text:this.bindTemplate.to(\"keystroke\",e=>Ll(e))}]});return e}_getTooltipString(e,t,n){if(e){if(typeof e==\"string\"){return e}else{if(n){n=Ll(n)}if(e instanceof Function){return e(t,n)}else{return`${t}${n?` (${n})`:\"\"}`}}}return\"\"}}var Tw='';class Sw extends Aw{constructor(e){super(e);this.arrowView=this._createArrowView();this.extendTemplate({attributes:{\"aria-haspopup\":true}});this.delegate(\"execute\").to(this,\"open\")}render(){super.render();this.children.add(this.arrowView)}_createArrowView(){const e=new vw;e.content=Tw;e.extendTemplate({attributes:{class:\"ck-dropdown__arrow\"}});return e}}var Pw=n(33);class Ew extends Bb{constructor(){super();this.items=this.createCollection();this.focusTracker=new Yp;this.keystrokes=new Op;this._focusCycler=new nw({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 Mw extends Bb{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 Iw extends Bb{constructor(e){super(e);this.setTemplate({tag:\"li\",attributes:{class:[\"ck\",\"ck-list__separator\"]}})}}var Nw=n(35);class Rw extends Aw{constructor(e){super(e);this.isToggleable=true;this.toggleSwitchView=this._createToggleView();this.extendTemplate({attributes:{class:\"ck-switchbutton\"}})}render(){super.render();this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new Bb;e.setTemplate({tag:\"span\",attributes:{class:[\"ck\",\"ck-button__toggle\"]},children:[{tag:\"span\",attributes:{class:[\"ck\",\"ck-button__toggle__inner\"]}}]});return e}}function Ow({emitter:e,activator:t,callback:n,contextElements:i}){e.listenTo(document,\"mousedown\",(e,{target:o})=>{if(!t()){return}for(const e of i){if(e.contains(o)){return}}n()})}var zw=n(37);var Vw=n(39);function Lw(e,t=Sw){const n=new t(e);const i=new lw(e);const o=new kw(e,n,i);n.bind(\"isEnabled\").to(o);if(n instanceof Sw){n.bind(\"isOn\").to(o,\"isOpen\")}else{n.arrowView.bind(\"isOn\").to(o,\"isOpen\")}jw(o);return o}function Dw(e,t){const n=e.locale;const i=n.t;const o=e.toolbarView=new $w(n);o.set(\"ariaLabel\",i(\"Dropdown toolbar\"));e.extendTemplate({attributes:{class:[\"ck-toolbar-dropdown\"]}});t.map(e=>o.items.add(e));e.panelView.children.add(o);o.items.delegate(\"execute\").to(e)}function Bw(e,t){const n=e.locale;const i=e.listView=new Ew(n);i.items.bindTo(t).using(({type:e,model:t})=>{if(e===\"separator\"){return new Iw(n)}else if(e===\"button\"||e===\"switchbutton\"){const i=new Mw(n);let o;if(e===\"button\"){o=new Aw(n)}else{o=new Rw(n)}o.bind(...Object.keys(t)).to(t);o.delegate(\"execute\").to(i);i.children.add(o);return i}});e.panelView.children.add(i);i.items.delegate(\"execute\").to(e)}function jw(e){Fw(e);Hw(e);Ww(e)}function Fw(e){e.on(\"render\",()=>{Ow({emitter:e,activator:()=>e.isOpen,callback:()=>{e.isOpen=false},contextElements:[e.element]})})}function Hw(e){e.on(\"execute\",t=>{if(t.source instanceof Rw){return}e.isOpen=false})}function Ww(e){e.keystrokes.set(\"arrowdown\",(t,n)=>{if(e.isOpen){e.panelView.focus();n()}});e.keystrokes.set(\"arrowup\",(t,n)=>{if(e.isOpen){e.panelView.focusLast();n()}})}var Uw='';var qw=n(41);class $w extends Bb{constructor(e,t){super(e);const n=this.bindTemplate;const i=this.t;this.options=t||{};this.set(\"ariaLabel\",i(\"Editor toolbar\"));this.set(\"maxWidth\",\"auto\");this.items=this.createCollection();this.focusTracker=new Yp;this.keystrokes=new Op;this.set(\"class\");this.set(\"isCompact\",false);this.itemsView=new Yw(e);this.children=this.createCollection();this.children.add(this.itemsView);this.focusables=this.createCollection();this._focusCycler=new nw({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[\"arrowleft\",\"arrowup\"],focusNext:[\"arrowright\",\"arrowdown\"]}});this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-toolbar\",n.to(\"class\"),n.if(\"isCompact\",\"ck-toolbar_compact\")],role:\"toolbar\",\"aria-label\":n.to(\"ariaLabel\"),style:{maxWidth:n.to(\"maxWidth\")}},children:this.children,on:{mousedown:cw(this)}});this._behavior=this.options.shouldGroupWhenFull?new Kw(this):new Gw(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(){this._behavior.destroy();return super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t){this.items.addMany(e.map(e=>{if(e==\"|\"){return new ow}else if(t.has(e)){return t.create(e)}else{console.warn(Object(ss[\"a\"])(\"toolbarview-item-unavailable: The requested toolbar item is unavailable.\"),{name:e})}}).filter(e=>e!==undefined))}}class Yw extends Bb{constructor(e){super(e);this.children=this.createCollection();this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-toolbar__items\"]},children:this.children})}}class Gw{constructor(e){const t=e.bindTemplate;e.set(\"isVertical\",false);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 Kw{constructor(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=false;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)=>{const n=t.index;for(const e of t.removed){if(n>=this.ungroupedItems.length){this.groupedItems.remove(e)}else{this.ungroupedItems.remove(e)}}for(let e=n;ethis.ungroupedItems.length){this.groupedItems.add(i,e-this.ungroupedItems.length)}else{this.ungroupedItems.add(i,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)){return}if(!this.viewElement.offsetParent){this.shouldUpdateGroupingOnNextResize=true;return}let e;while(this._areItemsOverflowing){this._groupLastItem();e=true}if(!e&&this.groupedItems.length){while(this.groupedItems.length&&!this._areItemsOverflowing){this._ungroupFirstItem()}if(this._areItemsOverflowing){this._groupLastItem()}}}get _areItemsOverflowing(){if(!this.ungroupedItems.length){return false}const e=this.viewElement;const t=this.viewLocale.uiLanguageDirection;const n=new Th(e.lastChild);const i=new Th(e);if(!this.cachedPadding){const n=Ld.window.getComputedStyle(e);const i=t===\"ltr\"?\"paddingRight\":\"paddingLeft\";this.cachedPadding=Number.parseInt(n[i])}if(t===\"ltr\"){return n.right>i.right-this.cachedPadding}else{return n.left{if(!e||e!==t.contentRect.width||this.shouldUpdateGroupingOnNextResize){this.shouldUpdateGroupingOnNextResize=false;this._updateGrouping();e=t.contentRect.width}});this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on(\"change:maxWidth\",()=>{this._updateGrouping()})}_groupLastItem(){if(!this.groupedItems.length){this.viewChildren.add(new ow);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));if(!this.groupedItems.length){this.viewChildren.remove(this.groupedItemsDropdown);this.viewChildren.remove(this.viewChildren.last);this.viewFocusTracker.remove(this.groupedItemsDropdown.element)}}_createGroupedItemsDropdown(){const e=this.viewLocale;const t=e.t;const n=Lw(e);n.class=\"ck-toolbar__grouped-dropdown\";n.panelPosition=e.uiLanguageDirection===\"ltr\"?\"sw\":\"se\";Dw(n,[]);n.buttonView.set({label:t(\"Show more items\"),tooltip:true,icon:Uw});n.toolbarView.items.bindTo(this.groupedItems).using(e=>e);return n}_updateFocusCycleableItems(){this.viewFocusables.clear();this.ungroupedItems.map(e=>{this.viewFocusables.add(e)});if(this.groupedItems.length){this.viewFocusables.add(this.groupedItemsDropdown)}}}var Qw=n(43);class Jw extends Kb{constructor(e,t,n={}){super(e);this.stickyPanel=new tw(e);this.toolbar=new $w(e,{shouldGroupWhenFull:n.shouldToolbarGroupWhenFull});this.editable=new Jb(e,t)}render(){super.render();this.stickyPanel.content.add(this.toolbar);this.top.add(this.stickyPanel);this.main.add(this.editable)}}function Zw(e){if(e instanceof HTMLTextAreaElement){return e.value}return e.innerHTML}class Xw extends Vp{constructor(e,t){super(t);if(Gr(e)){this.sourceElement=e}this.data.processor=new Up(this.data.viewDocument);this.model.document.createRoot();const n=!this.config.get(\"toolbar.shouldNotGroupWhenFull\");const i=new Jw(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:n});this.ui=new cb(this,i);Hp(this)}destroy(){if(this.sourceElement){this.updateSourceElement()}this.ui.destroy();return super.destroy()}static create(e,t={}){return new Promise(n=>{const i=new this(e,t);n(i.initPlugins().then(()=>i.ui.init(Gr(e)?e:null)).then(()=>{if(!Gr(e)&&t.initialData){throw new ss[\"b\"](\"editor-create-initial-data: \"+\"The config.initialData option cannot be used together with initial data passed in Editor.create().\",null)}const n=t.initialData||ek(e);return i.data.init(n)}).then(()=>i.fire(\"ready\")).then(()=>i))})}}ys(Xw,Dp);ys(Xw,Fp);function ek(e){return Gr(e)?Zw(e):e}function tk(e){const t=e.next();if(t.done){return null}return t.value}function nk(e,t,n,i){let o;let r=null;if(typeof i==\"function\"){o=i}else{r=e.commands.get(i);o=()=>{e.execute(i)}}e.model.document.on(\"change:data\",(i,s)=>{if(r&&!r.isEnabled||!t.isEnabled){return}const a=tk(e.model.document.selection.getRanges());if(!a.isCollapsed){return}if(s.type==\"transparent\"){return}const c=Array.from(e.model.document.differ.getChanges());const l=c[0];if(c.length!=1||l.type!==\"insert\"||l.name!=\"$text\"||l.length!=1){return}const d=l.position.parent;if(d.is(\"element\",\"codeBlock\")){return}if(r&&r.value===true){return}const u=d.getChild(0);const h=e.model.createRangeOn(u);if(!h.containsRange(a)&&!a.end.isEqual(h.end)){return}const f=n.exec(u.data.substr(0,a.end.offset));if(!f){return}e.model.enqueueChange(e=>{const t=e.createPositionAt(d,0);const n=e.createPositionAt(d,f[0].length);const i=new ff(t,n);const r=o({match:f});if(r!==false){e.remove(i)}i.detach()})})}function ik(e,t,n,i){let o;let r;if(n instanceof RegExp){o=n}else{r=n}r=r||(e=>{let t;const n=[];const i=[];while((t=o.exec(e))!==null){if(t&&t.length<4){break}let{index:e,1:o,2:r,3:s}=t;const a=o+r+s;e+=t[0].length-a.length;const c=[e,e+o.length];const l=[e+o.length+r.length,e+o.length+r.length+s.length];n.push(c);n.push(l);i.push([e+o.length,e+o.length+r.length])}return{remove:n,format:i}});e.model.document.on(\"change:data\",(n,o)=>{if(o.type==\"transparent\"||!t.isEnabled){return}const s=e.model;const a=s.document.selection;if(!a.isCollapsed){return}const c=Array.from(s.document.differ.getChanges());const l=c[0];if(c.length!=1||l.type!==\"insert\"||l.name!=\"$text\"||l.length!=1){return}const d=a.focus;const u=d.parent;const{text:h,range:f}=rk(s.createRange(s.createPositionAt(u,0),d),s);const m=r(h);const g=ok(f.start,m.format,s);const p=ok(f.start,m.remove,s);if(!(g.length&&p.length)){return}s.enqueueChange(e=>{const t=i(e,g);if(t===false){return}for(const t of p.reverse()){e.remove(t)}})})}function ok(e,t,n){return t.filter(e=>e[0]!==undefined&&e[1]!==undefined).map(t=>n.createRange(e.getShiftedBy(t[0]),e.getShiftedBy(t[1])))}function rk(e,t){let n=e.start;const i=Array.from(e.getItems()).reduce((e,i)=>{if(!(i.is(\"$text\")||i.is(\"$textProxy\"))||i.getAttribute(\"code\")){n=t.createPositionAfter(i);return\"\"}return e+i.data},\"\");return{text:i,range:t.createRange(n,e.end)}}class sk{constructor(e){this.editor=e;this.set(\"isEnabled\",true);this._disableStack=new Set}forceDisabled(e){this._disableStack.add(e);if(this._disableStack.size==1){this.on(\"set:isEnabled\",ak,{priority:\"highest\"});this.isEnabled=false}}clearForceDisabled(e){this._disableStack.delete(e);if(this._disableStack.size==0){this.off(\"set:isEnabled\",ak);this.isEnabled=true}}destroy(){this.stopListening()}static get isContextPlugin(){return false}}ys(sk,Qc);function ak(e){e.return=false;e.stop()}class ck extends sk{static get pluginName(){return\"Autoformat\"}afterInit(){this._addListAutoformats();this._addBasicStylesAutoformats();this._addHeadingAutoformats();this._addBlockQuoteAutoformats();this._addCodeBlockAutoformats()}_addListAutoformats(){const e=this.editor.commands;if(e.get(\"bulletedList\")){nk(this.editor,this,/^[*-]\\s$/,\"bulletedList\")}if(e.get(\"numberedList\")){nk(this.editor,this,/^1[.|)]\\s$/,\"numberedList\")}}_addBasicStylesAutoformats(){const e=this.editor.commands;if(e.get(\"bold\")){const e=lk(this.editor,\"bold\");ik(this.editor,this,/(\\*\\*)([^*]+)(\\*\\*)$/g,e);ik(this.editor,this,/(__)([^_]+)(__)$/g,e)}if(e.get(\"italic\")){const e=lk(this.editor,\"italic\");ik(this.editor,this,/(?:^|[^*])(\\*)([^*_]+)(\\*)$/g,e);ik(this.editor,this,/(?:^|[^_])(_)([^_]+)(_)$/g,e)}if(e.get(\"code\")){const e=lk(this.editor,\"code\");ik(this.editor,this,/(`)([^`]+)(`)$/g,e)}if(e.get(\"strikethrough\")){const e=lk(this.editor,\"strikethrough\");ik(this.editor,this,/(~~)([^~]+)(~~)$/g,e)}}_addHeadingAutoformats(){const e=this.editor.commands.get(\"heading\");if(e){e.modelElements.filter(e=>e.match(/^heading[1-6]$/)).forEach(t=>{const n=t[7];const i=new RegExp(`^(#{${n}})\\\\s$`);nk(this.editor,this,i,()=>{if(!e.isEnabled||e.value===t){return false}this.editor.execute(\"heading\",{value:t})})})}}_addBlockQuoteAutoformats(){if(this.editor.commands.get(\"blockQuote\")){nk(this.editor,this,/^>\\s$/,\"blockQuote\")}}_addCodeBlockAutoformats(){if(this.editor.commands.get(\"codeBlock\")){nk(this.editor,this,/^```$/,\"codeBlock\")}}}function lk(e,t){return(n,i)=>{const o=e.commands.get(t);if(!o.isEnabled){return false}const r=e.model.schema.getValidRanges(i,t);for(const e of r){n.setAttribute(t,true,e)}n.removeSelectionAttribute(t)}}function dk(e,t){let n=e.start;const i=Array.from(e.getItems()).reduce((e,i)=>{if(!(i.is(\"$text\")||i.is(\"$textProxy\"))){n=t.createPositionAfter(i);return\"\"}return e+i.data},\"\");return{text:i,range:t.createRange(n,e.end)}}class uk{constructor(e,t){this.model=e;this.testCallback=t;this.hasMatch=false;this.set(\"isEnabled\",true);this.on(\"change:isEnabled\",()=>{if(this.isEnabled){this._startListening()}else{this.stopListening(e.document.selection);this.stopListening(e.document)}});this._startListening()}_startListening(){const e=this.model;const t=e.document;this.listenTo(t.selection,\"change:range\",(e,{directChange:n})=>{if(!n){return}if(!t.selection.isCollapsed){if(this.hasMatch){this.fire(\"unmatched\");this.hasMatch=false}return}this._evaluateTextBeforeSelection(\"selection\")});this.listenTo(t,\"change:data\",(e,t)=>{if(t.type==\"transparent\"){return}this._evaluateTextBeforeSelection(\"data\",{batch:t})})}_evaluateTextBeforeSelection(e,t={}){const n=this.model;const i=n.document;const o=i.selection;const r=n.createRange(n.createPositionAt(o.focus.parent,0),o.focus);const{text:s,range:a}=dk(r,n);const c=this.testCallback(s);if(!c&&this.hasMatch){this.fire(\"unmatched\")}this.hasMatch=!!c;if(c){const n=Object.assign(t,{text:s,range:a});if(typeof c==\"object\"){Object.assign(n,c)}this.fire(`matched:${e}`,n)}}}ys(uk,Qc);const hk=4;const fk=new RegExp(\"(^|\\\\s)\"+\"(\"+\"(\"+\"(?:(?:(?:https?|ftp):)?\\\\/\\\\/)\"+\"(?:\\\\S+(?::\\\\S*)?@)?\"+\"(?:\"+\"(?![-_])(?:[-\\\\w\\\\u00a1-\\\\uffff]{0,63}[^-_]\\\\.)+\"+\"(?:[a-z\\\\u00a1-\\\\uffff]{2,})\"+\")\"+\"(?::\\\\d{2,5})?\"+\"(?:[/?#]\\\\S*)?\"+\")\"+\"|\"+\"(\"+\"(www.|(\\\\S+@))\"+\"((?![-_])(?:[-\\\\w\\\\u00a1-\\\\uffff]{0,63}[^-_]\\\\.))+\"+\"(?:[a-z\\\\u00a1-\\\\uffff]{2,})\"+\")\"+\")$\",\"i\");const mk=2;const gk=/^[\\S]+@((?![-_])(?:[-\\w\\u00a1-\\uffff]{0,63}[^-_]\\.))+(?:[a-z\\u00a1-\\uffff]{2,})$/i;class pk extends sk{static get pluginName(){return\"AutoLink\"}init(){const e=this.editor;const t=e.model.document.selection;t.on(\"change:range\",()=>{this.isEnabled=!t.anchor.parent.is(\"element\",\"codeBlock\")});this._enableTypingHandling()}afterInit(){this._enableEnterHandling();this._enableShiftEnterHandling()}_enableTypingHandling(){const e=this.editor;const t=new uk(e.model,e=>{if(!bk(e)){return}const t=wk(e.substr(0,e.length-1));if(t){return{url:t}}});const n=e.plugins.get(\"Input\");t.on(\"matched:data\",(t,i)=>{const{batch:o,range:r,url:s}=i;if(!n.isInput(o)){return}const a=r.end.getShiftedBy(-1);const c=a.getShiftedBy(-s.length);const l=e.model.createRange(c,a);this._applyAutoLink(s,l)});t.bind(\"isEnabled\").to(this)}_enableEnterHandling(){const e=this.editor;const t=e.model;const n=e.commands.get(\"enter\");if(!n){return}n.on(\"execute\",()=>{const e=t.document.selection.getFirstPosition();const n=t.createRange(t.createPositionAt(e.parent.previousSibling,0),t.createPositionAt(e.parent.previousSibling,\"end\"));this._checkAndApplyAutoLinkOnRange(n)})}_enableShiftEnterHandling(){const e=this.editor;const t=e.model;const n=e.commands.get(\"shiftEnter\");if(!n){return}n.on(\"execute\",()=>{const e=t.document.selection.getFirstPosition();const n=t.createRange(t.createPositionAt(e.parent,0),e.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(n)})}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model;const{text:n,range:i}=dk(e,t);const o=wk(n);if(o){const e=t.createRange(i.end.getShiftedBy(-o.length),i.end);this._applyAutoLink(o,e)}}_applyAutoLink(e,t){const n=this.editor.model;if(!this.isEnabled||!_k(t,n)){return}n.enqueueChange(n=>{const i=kk(e)?`mailto:${e}`:e;n.setAttribute(\"linkHref\",i,t)})}}function bk(e){return e.length>hk&&e[e.length-1]===\" \"&&e[e.length-2]!==\" \"}function wk(e){const t=fk.exec(e);return t?t[mk]:null}function kk(e){return gk.exec(e)}function _k(e,t){return t.schema.checkAttributeInSelection(t.createSelection(e),\"linkHref\")}class vk{constructor(e){this.editor=e;this.set(\"value\",undefined);this.set(\"isEnabled\",false);this._disableStack=new Set;this.decorate(\"execute\");this.listenTo(this.editor.model.document,\"change\",()=>{this.refresh()});this.on(\"execute\",e=>{if(!this.isEnabled){e.stop()}},{priority:\"high\"});this.listenTo(e,\"change:isReadOnly\",(e,t,n)=>{if(n){this.forceDisabled(\"readOnlyMode\")}else{this.clearForceDisabled(\"readOnlyMode\")}})}refresh(){this.isEnabled=true}forceDisabled(e){this._disableStack.add(e);if(this._disableStack.size==1){this.on(\"set:isEnabled\",yk,{priority:\"highest\"});this.isEnabled=false}}clearForceDisabled(e){this._disableStack.delete(e);if(this._disableStack.size==0){this.off(\"set:isEnabled\",yk);this.refresh()}}execute(){}destroy(){this.stopListening()}}ys(vk,Qc);function yk(e){e.return=false;e.stop()}class xk extends vk{refresh(){this.value=this._getValue();this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model;const n=t.schema;const i=t.document.selection;const o=Array.from(i.getSelectedBlocks());const r=e.forceValue===undefined?!this.value:e.forceValue;t.change(e=>{if(!r){this._removeQuote(e,o.filter(Ck))}else{const t=o.filter(e=>Ck(e)||Tk(n,e));this._applyQuote(e,t)}})}_getValue(){const e=this.editor.model.document.selection;const t=tk(e.getSelectedBlocks());return!!(t&&Ck(t))}_checkEnabled(){if(this.value){return true}const e=this.editor.model.document.selection;const t=this.editor.model.schema;const n=tk(e.getSelectedBlocks());if(!n){return false}return Tk(t,n)}_removeQuote(e,t){Ak(e,t).reverse().forEach(t=>{if(t.start.isAtStart&&t.end.isAtEnd){e.unwrap(t.start.parent);return}if(t.start.isAtStart){const n=e.createPositionBefore(t.start.parent);e.move(t,n);return}if(!t.end.isAtEnd){e.split(t.end)}const n=e.createPositionAfter(t.end.parent);e.move(t,n)})}_applyQuote(e,t){const n=[];Ak(e,t).reverse().forEach(t=>{let i=Ck(t.start);if(!i){i=e.createElement(\"blockQuote\");e.wrap(t,i)}n.push(i)});n.reverse().reduce((t,n)=>{if(t.nextSibling==n){e.merge(e.createPositionAfter(t));return t}return n})}}function Ck(e){return e.parent.name==\"blockQuote\"?e.parent:null}function Ak(e,t){let n;let i=0;const o=[];while(i{if(e.endsWith(\"blockQuote\")&&t.name==\"blockQuote\"){return false}});e.conversion.elementToElement({model:\"blockQuote\",view:\"blockquote\"});e.model.document.registerPostFixer(n=>{const i=e.model.document.differ.getChanges();for(const e of i){if(e.type==\"insert\"){const i=e.position.nodeAfter;if(!i){continue}if(i.is(\"element\",\"blockQuote\")&&i.isEmpty){n.remove(i);return true}else if(i.is(\"element\",\"blockQuote\")&&!t.checkChild(e.position,i)){n.unwrap(i);return true}else if(i.is(\"element\")){const e=n.createRangeIn(i);for(const i of e.getItems()){if(i.is(\"element\",\"blockQuote\")&&!t.checkChild(n.createPositionBefore(i),i)){n.unwrap(i);return true}}}}else if(e.type==\"remove\"){const t=e.position.parent;if(t.is(\"element\",\"blockQuote\")&&t.isEmpty){n.remove(t);return true}}}return false})}afterInit(){const e=this.editor;const t=e.commands.get(\"blockQuote\");this.listenTo(this.editor.editing.view.document,\"enter\",(e,n)=>{const i=this.editor.model.document;const o=i.selection.getLastPosition().parent;if(i.selection.isCollapsed&&o.isEmpty&&t.value){this.editor.execute(\"blockQuote\");this.editor.editing.view.scrollToTheSelection();n.preventDefault();e.stop()}})}}var Pk='';var Ek=n(45);class Mk extends sk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(\"blockQuote\",n=>{const i=e.commands.get(\"blockQuote\");const o=new Aw(n);o.set({label:t(\"Block quote\"),icon:Pk,tooltip:true,isToggleable:true});o.bind(\"isOn\",\"isEnabled\").to(i,\"value\",\"isEnabled\");this.listenTo(o,\"execute\",()=>{e.execute(\"blockQuote\");e.editing.view.focus()});return o})}}class Ik extends sk{static get requires(){return[Sk,Mk]}static get pluginName(){return\"BlockQuote\"}}class Nk extends vk{constructor(e,t){super(e);this.attributeKey=t}refresh(){const e=this.editor.model;const t=e.document;this.value=this._getValueFromFirstAllowedNode();this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model;const n=t.document;const i=n.selection;const o=e.forceValue===undefined?!this.value:e.forceValue;t.change(e=>{if(i.isCollapsed){if(o){e.setSelectionAttribute(this.attributeKey,true)}else{e.removeSelectionAttribute(this.attributeKey)}}else{const n=t.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const t of n){if(o){e.setAttribute(this.attributeKey,o,t)}else{e.removeAttribute(this.attributeKey,t)}}}})}_getValueFromFirstAllowedNode(){const e=this.editor.model;const t=e.schema;const n=e.document.selection;if(n.isCollapsed){return n.hasAttribute(this.attributeKey)}for(const e of n.getRanges()){for(const n of e.getItems()){if(t.checkAttribute(n,this.attributeKey)){return n.hasAttribute(this.attributeKey)}}}return false}}const Rk=\"bold\";class Ok extends sk{static get pluginName(){return\"BoldEditing\"}init(){const e=this.editor;e.model.schema.extend(\"$text\",{allowAttributes:Rk});e.model.schema.setAttributeProperties(Rk,{isFormatting:true,copyOnEnter:true});e.conversion.attributeToElement({model:Rk,view:\"strong\",upcastAlso:[\"b\",e=>{const t=e.getStyle(\"font-weight\");if(!t){return null}if(t==\"bold\"||Number(t)>=600){return{name:true,styles:[\"font-weight\"]}}}]});e.commands.add(Rk,new Nk(e,Rk));e.keystrokes.set(\"CTRL+B\",Rk)}}var zk='';const Vk=\"bold\";class Lk extends sk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(Vk,n=>{const i=e.commands.get(Vk);const o=new Aw(n);o.set({label:t(\"Bold\"),icon:zk,keystroke:\"CTRL+B\",tooltip:true,isToggleable:true});o.bind(\"isOn\",\"isEnabled\").to(i,\"value\",\"isEnabled\");this.listenTo(o,\"execute\",()=>{e.execute(Vk);e.editing.view.focus()});return o})}}class Dk extends sk{static get requires(){return[Ok,Lk]}static get pluginName(){return\"Bold\"}}var Bk='';class jk extends sk{static get pluginName(){return\"CKFinderUI\"}init(){const e=this.editor;const t=e.ui.componentFactory;const n=e.t;t.add(\"ckfinder\",t=>{const i=e.commands.get(\"ckfinder\");const o=new Aw(t);o.set({label:n(\"Insert image or file\"),icon:Bk,tooltip:true});o.bind(\"isEnabled\").to(i);o.on(\"execute\",()=>{e.execute(\"ckfinder\");e.editing.view.focus()});return o})}}class Fk extends Zd{observe(e){this.listenTo(e,\"load\",(e,t)=>{const n=t.target;if(n.tagName==\"IMG\"){this._fireEvents(t)}},{useCapture:true})}_fireEvents(e){if(this.isEnabled){this.document.fire(\"layoutChanged\");this.document.fire(\"imageLoaded\",e)}}}class Hk{constructor(){this._stack=[]}add(e,t){const n=this._stack;const i=n[0];this._insertDescriptor(e);const o=n[0];if(i!==o&&!Wk(i,o)){this.fire(\"change:top\",{oldDescriptor:i,newDescriptor:o,writer:t})}}remove(e,t){const n=this._stack;const i=n[0];this._removeDescriptor(e);const o=n[0];if(i!==o&&!Wk(i,o)){this.fire(\"change:top\",{oldDescriptor:i,newDescriptor:o,writer:t})}}_insertDescriptor(e){const t=this._stack;const n=t.findIndex(t=>t.id===e.id);if(Wk(e,t[n])){return}if(n>-1){t.splice(n,1)}let i=0;while(t[i]&&Uk(t[i],e)){i++}t.splice(i,0,e)}_removeDescriptor(e){const t=this._stack;const n=t.findIndex(t=>t.id===e);if(n>-1){t.splice(n,1)}}}ys(Hk,ds);function Wk(e,t){return e&&t&&e.priority==t.priority&&qk(e.classes)==qk(t.classes)}function Uk(e,t){if(e.priority>t.priority){return true}else if(e.priorityqk(t.classes)}function qk(e){return Array.isArray(e)?e.sort().join(\",\"):e}var $k=n(47);const Yk=Zb(\"px\");const Gk=Ld.document.body;class Kk extends Bb{constructor(e){super(e);const t=this.bindTemplate;this.set(\"top\",0);this.set(\"left\",0);this.set(\"position\",\"arrow_nw\");this.set(\"isVisible\",false);this.set(\"withArrow\",true);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\",Yk),left:t.to(\"left\",Yk)}},children:this.content})}show(){this.isVisible=true}hide(){this.isVisible=false}attachTo(e){this.show();const t=Kk.defaultPositions;const n=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:Gk,fitInViewport:true},e);const i=Kk._getOptimalPosition(n);const o=parseInt(i.left);const r=parseInt(i.top);const s=i.name;Object.assign(this,{top:r,left:o,position:s})}pin(e){this.unpin();this._pinWhenIsVisibleCallback=()=>{if(this.isVisible){this._startPinning(e)}else{this._stopPinning()}};this._startPinning(e);this.listenTo(this,\"change:isVisible\",this._pinWhenIsVisibleCallback)}unpin(){if(this._pinWhenIsVisibleCallback){this._stopPinning();this.stopListening(this,\"change:isVisible\",this._pinWhenIsVisibleCallback);this._pinWhenIsVisibleCallback=null;this.hide()}}_startPinning(e){this.attachTo(e);const t=Qk(e.target);const n=e.limiter?Qk(e.limiter):Gk;this.listenTo(Ld.document,\"scroll\",(i,o)=>{const r=o.target;const s=t&&r.contains(t);const a=n&&r.contains(n);if(s||a||!t||!n){this.attachTo(e)}},{useCapture:true});this.listenTo(Ld.window,\"resize\",()=>{this.attachTo(e)})}_stopPinning(){this.stopListening(Ld.document,\"scroll\");this.stopListening(Ld.window,\"resize\")}}function Qk(e){if(Gr(e)){return e}if(xh(e)){return e.commonAncestorContainer}if(typeof e==\"function\"){return Qk(e())}return null}Kk.arrowHorizontalOffset=25;Kk.arrowVerticalOffset=10;Kk._getOptimalPosition=hw;Kk.defaultPositions={northWestArrowSouthWest:(e,t)=>({top:Jk(e,t),left:e.left-Kk.arrowHorizontalOffset,name:\"arrow_sw\"}),northWestArrowSouthMiddleWest:(e,t)=>({top:Jk(e,t),left:e.left-t.width*.25-Kk.arrowHorizontalOffset,name:\"arrow_smw\"}),northWestArrowSouth:(e,t)=>({top:Jk(e,t),left:e.left-t.width/2,name:\"arrow_s\"}),northWestArrowSouthMiddleEast:(e,t)=>({top:Jk(e,t),left:e.left-t.width*.75+Kk.arrowHorizontalOffset,name:\"arrow_sme\"}),northWestArrowSouthEast:(e,t)=>({top:Jk(e,t),left:e.left-t.width+Kk.arrowHorizontalOffset,name:\"arrow_se\"}),northArrowSouthWest:(e,t)=>({top:Jk(e,t),left:e.left+e.width/2-Kk.arrowHorizontalOffset,name:\"arrow_sw\"}),northArrowSouthMiddleWest:(e,t)=>({top:Jk(e,t),left:e.left+e.width/2-t.width*.25-Kk.arrowHorizontalOffset,name:\"arrow_smw\"}),northArrowSouth:(e,t)=>({top:Jk(e,t),left:e.left+e.width/2-t.width/2,name:\"arrow_s\"}),northArrowSouthMiddleEast:(e,t)=>({top:Jk(e,t),left:e.left+e.width/2-t.width*.75+Kk.arrowHorizontalOffset,name:\"arrow_sme\"}),northArrowSouthEast:(e,t)=>({top:Jk(e,t),left:e.left+e.width/2-t.width+Kk.arrowHorizontalOffset,name:\"arrow_se\"}),northEastArrowSouthWest:(e,t)=>({top:Jk(e,t),left:e.right-Kk.arrowHorizontalOffset,name:\"arrow_sw\"}),northEastArrowSouthMiddleWest:(e,t)=>({top:Jk(e,t),left:e.right-t.width*.25-Kk.arrowHorizontalOffset,name:\"arrow_smw\"}),northEastArrowSouth:(e,t)=>({top:Jk(e,t),left:e.right-t.width/2,name:\"arrow_s\"}),northEastArrowSouthMiddleEast:(e,t)=>({top:Jk(e,t),left:e.right-t.width*.75+Kk.arrowHorizontalOffset,name:\"arrow_sme\"}),northEastArrowSouthEast:(e,t)=>({top:Jk(e,t),left:e.right-t.width+Kk.arrowHorizontalOffset,name:\"arrow_se\"}),southWestArrowNorthWest:(e,t)=>({top:Zk(e,t),left:e.left-Kk.arrowHorizontalOffset,name:\"arrow_nw\"}),southWestArrowNorthMiddleWest:(e,t)=>({top:Zk(e,t),left:e.left-t.width*.25-Kk.arrowHorizontalOffset,name:\"arrow_nmw\"}),southWestArrowNorth:(e,t)=>({top:Zk(e,t),left:e.left-t.width/2,name:\"arrow_n\"}),southWestArrowNorthMiddleEast:(e,t)=>({top:Zk(e,t),left:e.left-t.width*.75+Kk.arrowHorizontalOffset,name:\"arrow_nme\"}),southWestArrowNorthEast:(e,t)=>({top:Zk(e,t),left:e.left-t.width+Kk.arrowHorizontalOffset,name:\"arrow_ne\"}),southArrowNorthWest:(e,t)=>({top:Zk(e,t),left:e.left+e.width/2-Kk.arrowHorizontalOffset,name:\"arrow_nw\"}),southArrowNorthMiddleWest:(e,t)=>({top:Zk(e,t),left:e.left+e.width/2-t.width*.25-Kk.arrowHorizontalOffset,name:\"arrow_nmw\"}),southArrowNorth:(e,t)=>({top:Zk(e,t),left:e.left+e.width/2-t.width/2,name:\"arrow_n\"}),southArrowNorthMiddleEast:(e,t)=>({top:Zk(e,t),left:e.left+e.width/2-t.width*.75+Kk.arrowHorizontalOffset,name:\"arrow_nme\"}),southArrowNorthEast:(e,t)=>({top:Zk(e,t),left:e.left+e.width/2-t.width+Kk.arrowHorizontalOffset,name:\"arrow_ne\"}),southEastArrowNorthWest:(e,t)=>({top:Zk(e,t),left:e.right-Kk.arrowHorizontalOffset,name:\"arrow_nw\"}),southEastArrowNorthMiddleWest:(e,t)=>({top:Zk(e,t),left:e.right-t.width*.25-Kk.arrowHorizontalOffset,name:\"arrow_nmw\"}),southEastArrowNorth:(e,t)=>({top:Zk(e,t),left:e.right-t.width/2,name:\"arrow_n\"}),southEastArrowNorthMiddleEast:(e,t)=>({top:Zk(e,t),left:e.right-t.width*.75+Kk.arrowHorizontalOffset,name:\"arrow_nme\"}),southEastArrowNorthEast:(e,t)=>({top:Zk(e,t),left:e.right-t.width+Kk.arrowHorizontalOffset,name:\"arrow_ne\"})};function Jk(e,t){return e.top-t.height-Kk.arrowVerticalOffset}function Zk(e){return e.bottom+Kk.arrowVerticalOffset}var Xk='';const e_=\"widget-type-around\";function t_(e,t,n){return e&&c_(e)&&!n.isInline(t)}function n_(e){return e.closest(\".ck-widget__type-around__button\")}function i_(e){return e.classList.contains(\"ck-widget__type-around__button_before\")?\"before\":\"after\"}function o_(e,t){const n=e.closest(\".ck-widget\");return t.mapDomToView(n)}function r_(e){return e.getAttribute(e_)}const s_=\"ck-widget\";const a_=\"ck-widget_selected\";function c_(e){if(!e.is(\"element\")){return false}return!!e.getCustomProperty(\"widget\")}function l_(e,t,n={}){if(!e.is(\"containerElement\")){throw new ss[\"b\"](\"widget-to-widget-wrong-element-type: The element passed to toWidget() must be a container element instance.\",null,{element:e})}t.setAttribute(\"contenteditable\",\"false\",e);t.addClass(s_,e);t.setCustomProperty(\"widget\",true,e);e.getFillerOffset=b_;if(n.label){u_(e,n.label,t)}if(n.hasSelectionHandle){w_(e,t)}d_(e,t,(e,t,n)=>n.addClass(i(t.classes),e),(e,t,n)=>n.removeClass(i(t.classes),e));return e;function i(e){return Array.isArray(e)?e:[e]}}function d_(e,t,n,i){const o=new Hk;o.on(\"change:top\",(t,o)=>{if(o.oldDescriptor){i(e,o.oldDescriptor,o.writer)}if(o.newDescriptor){n(e,o.newDescriptor,o.writer)}});t.setCustomProperty(\"addHighlight\",(e,t,n)=>o.add(t,n),e);t.setCustomProperty(\"removeHighlight\",(e,t,n)=>o.remove(t,n),e)}function u_(e,t,n){n.setCustomProperty(\"widgetLabel\",t,e)}function h_(e){const t=e.getCustomProperty(\"widgetLabel\");if(!t){return\"\"}return typeof t==\"function\"?t():t}function f_(e,t){t.addClass([\"ck-editor__editable\",\"ck-editor__nested-editable\"],e);t.setAttribute(\"contenteditable\",e.isReadOnly?\"false\":\"true\",e);e.on(\"change:isReadOnly\",(n,i,o)=>{t.setAttribute(\"contenteditable\",o?\"false\":\"true\",e)});e.on(\"change:isFocused\",(n,i,o)=>{if(o){t.addClass(\"ck-editor__nested-editable_focused\",e)}else{t.removeClass(\"ck-editor__nested-editable_focused\",e)}});return e}function m_(e,t){const n=e.getSelectedElement();if(n){const i=r_(e);if(i){return t.createPositionAt(n,i)}if(t.schema.isBlock(n)){return t.createPositionAfter(n)}}const i=e.getSelectedBlocks().next().value;if(i){if(i.isEmpty){return t.createPositionAt(i,0)}const n=t.createPositionAfter(i);if(e.focus.isTouching(n)){return n}return t.createPositionBefore(i)}return e.focus}function g_(e,t){return(n,i)=>{const{mapper:o,viewPosition:r}=i;const s=o.findMappedViewAncestor(r);if(!t(s)){return}const a=o.toModelElement(s);i.modelPosition=e.createPositionAt(a,r.isAtStart?\"before\":\"after\")}}function p_(e,t){const n=new Th(Ld.window);const i=n.getIntersection(e);const o=t.height+Kk.arrowVerticalOffset;if(e.top-o>n.top||e.bottom+oe.is(\"element\",\"img\"))}function T_(e,t,n){const i=E_(e,n);return t.checkChild(i,\"image\")}function S_(e,t){const n=e.getSelectedElement();return n&&t.isObject(n)}function P_(e){return[...e.focus.getAncestors()].every(e=>!e.is(\"element\",\"image\"))}function E_(e,t){const n=m_(e,t);const i=n.parent;if(i.isEmpty&&!i.is(\"element\",\"$root\")){return i.parent}return i}function M_(){return t=>{t.on(\"element:figure\",e)};function e(e,t,n){if(!n.consumable.test(t.viewItem,{name:true,classes:\"image\"})){return}const i=A_(t.viewItem);if(!i||!i.hasAttribute(\"src\")||!n.consumable.test(i,{name:true})){return}const o=n.convertItem(i,t.modelCursor);const r=tk(o.modelRange.getItems());if(!r){return}n.convertChildren(t.viewItem,n.writer.createPositionAt(r,0));t.modelRange=o.modelRange;t.modelCursor=o.modelCursor}}function I_(){return t=>{t.on(\"attribute:srcset:image\",e)};function e(e,t,n){if(!n.consumable.consume(t.item,e.name)){return}const i=n.writer;const o=n.mapper.toViewElement(t.item);const r=A_(o);if(t.attributeNewValue===null){const e=t.attributeOldValue;if(e.data){i.removeAttribute(\"srcset\",r);i.removeAttribute(\"sizes\",r);if(e.width){i.removeAttribute(\"width\",r)}}}else{const e=t.attributeNewValue;if(e.data){i.setAttribute(\"srcset\",e.data,r);i.setAttribute(\"sizes\",\"100vw\",r);if(e.width){i.setAttribute(\"width\",e.width,r)}}}}}function N_(e){return n=>{n.on(`attribute:${e}:image`,t)};function t(e,t,n){if(!n.consumable.consume(t.item,e.name)){return}const i=n.writer;const o=n.mapper.toViewElement(t.item);const r=A_(o);i.setAttribute(t.attributeKey,t.attributeNewValue||\"\",r)}}class R_ extends vk{refresh(){this.isEnabled=C_(this.editor.model)}execute(e){const t=this.editor.model;t.change(n=>{const i=Array.isArray(e.source)?e.source:[e.source];for(const e of i){x_(n,t,{src:e})}})}}class O_ extends sk{static get pluginName(){return\"ImageEditing\"}init(){const e=this.editor;const t=e.model.schema;const n=e.t;const i=e.conversion;e.editing.view.addObserver(Fk);t.register(\"image\",{isObject:true,isBlock:true,allowWhere:\"$block\",allowAttributes:[\"alt\",\"src\",\"srcset\"]});i.for(\"dataDowncast\").elementToElement({model:\"image\",view:(e,t)=>z_(t)});i.for(\"editingDowncast\").elementToElement({model:\"image\",view:(e,t)=>k_(z_(t),t,n(\"image widget\"))});i.for(\"downcast\").add(N_(\"src\")).add(N_(\"alt\")).add(I_());i.for(\"upcast\").elementToElement({view:{name:\"img\",attributes:{src:true}},model:(e,t)=>t.createElement(\"image\",{src:e.getAttribute(\"src\")})}).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\")};if(e.hasAttribute(\"width\")){t.width=e.getAttribute(\"width\")}return t}}}).add(M_());e.commands.add(\"imageInsert\",new R_(e))}}function z_(e){const t=e.createEmptyElement(\"img\");const n=e.createContainerElement(\"figure\",{class:\"image\"});e.insert(e.createPositionAt(n,0),t);return n}class V_ extends eh{constructor(e){super(e);this.domEventType=\"mousedown\"}onDomEvent(e){this.fire(e.type,e)}}class L_ extends sk{static get pluginName(){return\"TwoStepCaretMovement\"}constructor(e){super(e);this.attributes=new Set;this._overrideUid=null}init(){const e=this.editor;const t=e.model;const n=e.editing.view;const i=e.locale;const o=t.document.selection;this.listenTo(n.document,\"keydown\",(e,t)=>{if(!o.isCollapsed){return}if(t.shiftKey||t.altKey||t.ctrlKey){return}const n=t.keyCode==Ol.arrowright;const r=t.keyCode==Ol.arrowleft;if(!n&&!r){return}const s=i.contentLanguageDirection;let a=false;if(s===\"ltr\"&&n||s===\"rtl\"&&r){a=this._handleForwardMovement(t)}else{a=this._handleBackwardMovement(t)}if(a===true){e.stop()}},{priority:os.get(\"high\")+1});this._isNextGravityRestorationSkipped=false;this.listenTo(o,\"change:range\",(e,t)=>{if(this._isNextGravityRestorationSkipped){this._isNextGravityRestorationSkipped=false;return}if(!this._isGravityOverridden){return}if(!t.directChange&&H_(o.getFirstPosition(),this.attributes)){return}this._restoreGravity()})}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes;const n=this.editor.model;const i=n.document.selection;const o=i.getFirstPosition();if(this._isGravityOverridden){return false}if(o.isAtStart&&D_(i,t)){return false}if(H_(o,t)){j_(e);this._overrideGravity();return true}}_handleBackwardMovement(e){const t=this.attributes;const n=this.editor.model;const i=n.document.selection;const o=i.getFirstPosition();if(this._isGravityOverridden){j_(e);this._restoreGravity();B_(n,t,o);return true}else{if(o.isAtStart){if(D_(i,t)){j_(e);B_(n,t,o);return true}return false}if(F_(o,t)){if(o.isAtEnd&&!D_(i,t)&&H_(o,t)){j_(e);B_(n,t,o);return true}this._isNextGravityRestorationSkipped=true;this._overrideGravity();return false}}}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 D_(e,t){for(const n of t){if(e.hasAttribute(n)){return true}}return false}function B_(e,t,n){const i=n.nodeBefore;e.change(e=>{if(i){e.setSelectionAttribute(i.getAttributes())}else{e.removeSelectionAttribute(t)}})}function j_(e){e.preventDefault()}function F_(e,t){const n=e.getShiftedBy(-1);return H_(n,t)}function H_(e,t){const{nodeBefore:n,nodeAfter:i}=e;for(const e of t){const t=n?n.getAttribute(e):undefined;const o=i?i.getAttribute(e):undefined;if(o!==t){return true}}return false}function W_(e,t,n,i){return i.createRange(U_(e,t,n,true,i),U_(e,t,n,false,i))}function U_(e,t,n,i,o){let r=e.textNode||(i?e.nodeBefore:e.nodeAfter);let s=null;while(r&&r.getAttribute(t)==n){s=r;r=i?r.previousSibling:r.nextSibling}return s?o.createPositionAt(s,i?\"before\":\"after\"):e}function q_(e,t,n,i){const o=e.editing.view;const r=new Set;o.document.registerPostFixer(o=>{const s=e.model.document.selection;let a=false;if(s.hasAttribute(t)){const c=W_(s.getFirstPosition(),t,s.getAttribute(t),e.model);const l=e.editing.mapper.toViewRange(c);for(const e of l.getItems()){if(e.is(\"element\",n)&&!e.hasClass(i)){o.addClass(i,e);r.add(e);a=true}}}return a});e.conversion.for(\"editingDowncast\").add(e=>{e.on(\"insert\",t,{priority:\"highest\"});e.on(\"remove\",t,{priority:\"highest\"});e.on(\"attribute\",t,{priority:\"highest\"});e.on(\"selection\",t,{priority:\"highest\"});function t(){o.change(e=>{for(const t of r.values()){e.removeClass(i,t);r.delete(t)}})}})}class $_{constructor(e,t=20){this.model=e;this.size=0;this.limit=t;this.isLocked=false;this._changeCallback=(e,t)=>{if(t.type!=\"transparent\"&&t!==this._batch){this._reset(true)}};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(){if(!this._batch){this._batch=this.model.createBatch()}return this._batch}input(e){this.size+=e;if(this.size>=this.limit){this._reset(true)}}lock(){this.isLocked=true}unlock(){this.isLocked=false}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){if(!this.isLocked||e){this._batch=null;this.size=0}}}class Y_ extends vk{constructor(e,t){super(e);this._buffer=new $_(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;const n=t.document;const i=e.text||\"\";const o=i.length;const r=e.range?t.createSelection(e.range):n.selection;const s=e.resultRange;t.enqueueChange(this._buffer.batch,e=>{this._buffer.lock();this._batches.add(this._buffer.batch);t.deleteContent(r);if(i){t.insertContent(e.createText(i,n.selection.getAttributes()),r)}if(s){e.setSelection(s)}else if(!r.is(\"documentSelection\")){e.setSelection(r)}this._buffer.unlock();this._buffer.input(o)})}}function G_(e){let t=null;const n=e.model;const i=e.editing.view;const o=e.commands.get(\"input\");if(Tl.isAndroid){i.document.on(\"beforeinput\",(e,t)=>r(t),{priority:\"lowest\"})}else{i.document.on(\"keydown\",(e,t)=>r(t),{priority:\"lowest\"})}i.document.on(\"compositionstart\",s,{priority:\"lowest\"});i.document.on(\"compositionend\",()=>{t=n.createSelection(n.document.selection)},{priority:\"lowest\"});function r(e){const r=n.document;const s=i.document.isComposing;const c=t&&t.isEqual(r.selection);t=null;if(!o.isEnabled){return}if(Q_(e)||r.selection.isCollapsed){return}if(s&&e.keyCode===229){return}if(!s&&e.keyCode===229&&c){return}a()}function s(){const e=n.document;const t=e.selection.rangeCount===1?e.selection.getFirstRange().isFlat:true;if(e.selection.isCollapsed||t){return}a()}function a(){const e=o.buffer;e.lock();const t=e.batch;o._batches.add(t);n.enqueueChange(t,()=>{n.deleteContent(n.document.selection)});e.unlock()}}const K_=[zl(\"arrowUp\"),zl(\"arrowRight\"),zl(\"arrowDown\"),zl(\"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++){K_.push(e)}function Q_(e){if(e.ctrlKey){return true}return K_.includes(e.keyCode)}function J_(e,t){const n=[];let i=0;let o;e.forEach(e=>{if(e==\"equal\"){r();i++}else if(e==\"insert\"){if(s(\"insert\")){o.values.push(t[i])}else{r();o={type:\"insert\",index:i,values:[t[i]]}}i++}else{if(s(\"delete\")){o.howMany++}else{r();o={type:\"delete\",index:i,howMany:1}}}});r();return n;function r(){if(o){n.push(o);o=null}}function s(e){return o&&o.type==e}}function Z_(e){if(e.length==0){return false}for(const t of e){if(t.type===\"children\"&&!X_(t)){return true}}return false}function X_(e){if(e.newChildren.length-e.oldChildren.length!=1){return}const t=Ad(e.oldChildren,e.newChildren,ev);const n=J_(t,e.newChildren);if(n.length>1){return}const i=n[0];if(!(!!i.values[0]&&i.values[0].is(\"$text\"))){return}return i}function ev(e,t){if(!!e&&e.is(\"$text\")&&!!t&&t.is(\"$text\")){return e.data===t.data}else{return e===t}}function tv(e){e.editing.view.document.on(\"mutations\",(t,n,i)=>{new nv(e).handle(n,i)})}class nv{constructor(e){this.editor=e;this.editing=this.editor.editing}handle(e,t){if(Z_(e)){this._handleContainerChildrenMutations(e,t)}else{for(const n of e){this._handleTextMutation(n,t);this._handleTextNodeInsertion(n)}}}_handleContainerChildrenMutations(e,t){const n=iv(e);if(!n){return}const i=this.editor.editing.view.domConverter;const o=i.mapViewToDom(n);const r=new Hd(this.editor.editing.view.document);const s=this.editor.data.toModel(r.domToView(o)).getChild(0);const a=this.editor.editing.mapper.toModelElement(n);if(!a){return}const c=Array.from(s.getChildren());const l=Array.from(a.getChildren());const d=c[c.length-1];const u=l[l.length-1];const h=d&&d.is(\"element\",\"softBreak\");const f=u&&!u.is(\"element\",\"softBreak\");if(h&&f){c.pop()}const m=this.editor.model.schema;if(!ov(c,m)||!ov(l,m)){return}const g=c.map(e=>e.is(\"$text\")?e.data:\"@\").join(\"\").replace(/\\u00A0/g,\" \");const p=l.map(e=>e.is(\"$text\")?e.data:\"@\").join(\"\").replace(/\\u00A0/g,\" \");if(p===g){return}const b=Ad(p,g);const{firstChangeAt:w,insertions:k,deletions:_}=rv(b);let v=null;if(t){v=this.editing.mapper.toModelRange(t.getFirstRange())}const y=g.substr(w,k);const x=this.editor.model.createRange(this.editor.model.createPositionAt(a,w),this.editor.model.createPositionAt(a,w+_));this.editor.execute(\"input\",{text:y,range:x,resultRange:v})}_handleTextMutation(e,t){if(e.type!=\"text\"){return}const n=e.newText.replace(/\\u00A0/g,\" \");const i=e.oldText.replace(/\\u00A0/g,\" \");if(i===n){return}const o=Ad(i,n);const{firstChangeAt:r,insertions:s,deletions:a}=rv(o);let c=null;if(t){c=this.editing.mapper.toModelRange(t.getFirstRange())}const l=this.editing.view.createPositionAt(e.node,r);const d=this.editing.mapper.toModelPosition(l);const u=this.editor.model.createRange(d,d.getShiftedBy(a));const h=n.substr(r,s);this.editor.execute(\"input\",{text:h,range:u,resultRange:c})}_handleTextNodeInsertion(e){if(e.type!=\"children\"){return}const t=X_(e);const n=this.editing.view.createPositionAt(e.node,t.index);const i=this.editing.mapper.toModelPosition(n);const o=t.values[0].data;this.editor.execute(\"input\",{text:o.replace(/\\u00A0/g,\" \"),range:this.editor.model.createRange(i)})}}function iv(e){const t=e.map(e=>e.node).reduce((e,t)=>e.getCommonAncestor(t,{includeSelf:true}));if(!t){return}return t.getAncestors({includeSelf:true,parentFirst:true}).find(e=>e.is(\"containerElement\")||e.is(\"rootElement\"))}function ov(e,t){return e.every(e=>t.isInline(e))}function rv(e){let t=null;let n=null;for(let i=0;ie.kind===\"file\").map(e=>e.getAsFile())}class lv extends eh{constructor(e){super(e);const t=this.document;this.domEventType=[\"paste\",\"copy\",\"cut\",\"drop\",\"dragover\"];this.listenTo(t,\"paste\",n,{priority:\"low\"});this.listenTo(t,\"drop\",n,{priority:\"low\"});function n(e,n){n.preventDefault();const i=n.dropRange?[n.dropRange]:Array.from(t.selection.getRanges());const o=new es(t,\"clipboardInput\");t.fire(o,{dataTransfer:n.dataTransfer,targetRanges:i});if(o.stop.called){n.stopPropagation()}}}onDomEvent(e){const t={dataTransfer:new av(e.clipboardData?e.clipboardData:e.dataTransfer)};if(e.type==\"drop\"){t.dropRange=dv(this.view,e)}this.fire(e.type,e,t)}}function dv(e,t){const n=t.target.ownerDocument;const i=t.clientX;const o=t.clientY;let r;if(n.caretRangeFromPoint&&n.caretRangeFromPoint(i,o)){r=n.caretRangeFromPoint(i,o)}else if(t.rangeParent){r=n.createRange();r.setStart(t.rangeParent,t.rangeOffset);r.collapse(true)}if(r){return e.domConverter.domRangeToView(r)}else{return e.document.selection.getFirstRange()}}function uv(e){e=e.replace(//g,\">\").replace(/\\n/g,\"

\").replace(/^\\s/,\" \").replace(/\\s$/,\" \").replace(/\\s\\s/g,\"  \");if(e.indexOf(\"

\")>-1){e=`

${e}

`}return e}function hv(e){return e.replace(/(\\s+)<\\/span>/g,(e,t)=>{if(t.length==1){return\" \"}return t})}const fv=[\"figcaption\",\"li\"];function mv(e){let t=\"\";if(e.is(\"$text\")||e.is(\"$textProxy\")){t=e.data}else if(e.is(\"element\",\"img\")&&e.hasAttribute(\"alt\")){t=e.getAttribute(\"alt\")}else{let n=null;for(const i of e.getChildren()){const e=mv(i);if(n&&(n.is(\"containerElement\")||i.is(\"containerElement\"))){if(fv.includes(n.name)||fv.includes(i.name)){t+=\"\\n\"}else{t+=\"\\n\\n\"}}t+=e;n=i}}return t}class gv extends sk{static get pluginName(){return\"Clipboard\"}init(){const e=this.editor;const t=e.model.document;const n=e.editing.view;const i=n.document;this._htmlDataProcessor=new Up(i);n.addObserver(lv);this.listenTo(i,\"clipboardInput\",t=>{if(e.isReadOnly){t.stop()}},{priority:\"highest\"});this.listenTo(i,\"clipboardInput\",(e,t)=>{const i=t.dataTransfer;let o=\"\";if(i.getData(\"text/html\")){o=hv(i.getData(\"text/html\"))}else if(i.getData(\"text/plain\")){o=uv(i.getData(\"text/plain\"))}o=this._htmlDataProcessor.toView(o);const r=new es(this,\"inputTransformation\");this.fire(r,{content:o,dataTransfer:i});if(r.stop.called){e.stop()}n.scrollToTheSelection()},{priority:\"low\"});this.listenTo(this,\"inputTransformation\",(e,t)=>{if(!t.content.isEmpty){const n=this.editor.data;const i=this.editor.model;const o=n.toModel(t.content,\"$clipboardHolder\");if(o.childCount==0){return}i.insertContent(o);e.stop()}},{priority:\"low\"});function o(n,o){const r=o.dataTransfer;o.preventDefault();const s=e.data.toView(e.model.getSelectedContent(t.selection));i.fire(\"clipboardOutput\",{dataTransfer:r,content:s,method:n.name})}this.listenTo(i,\"copy\",o,{priority:\"low\"});this.listenTo(i,\"cut\",(t,n)=>{if(e.isReadOnly){n.preventDefault()}else{o(t,n)}},{priority:\"low\"});this.listenTo(i,\"clipboardOutput\",(n,i)=>{if(!i.content.isEmpty){i.dataTransfer.setData(\"text/html\",this._htmlDataProcessor.toData(i.content));i.dataTransfer.setData(\"text/plain\",mv(i.content))}if(i.method==\"cut\"){e.model.deleteContent(t.selection)}},{priority:\"low\"})}}class pv{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(e){if(Array.isArray(e)){e.forEach(e=>this._definitions.add(e))}else{this._definitions.add(e)}}getDispatcher(){return e=>{e.on(\"attribute:linkHref\",(e,t,n)=>{if(!n.consumable.test(t.item,\"attribute:linkHref\")){return}const i=n.writer;const o=i.document.selection;for(const e of this._definitions){const r=i.createAttributeElement(\"a\",e.attributes,{priority:5});i.setCustomProperty(\"link\",true,r);if(e.callback(t.attributeNewValue)){if(t.item.is(\"selection\")){i.wrap(o.getFirstRange(),r)}else{i.wrap(n.mapper.toViewRange(t.range),r)}}else{i.unwrap(n.mapper.toViewRange(t.range),r)}}},{priority:\"high\"})}}getDispatcherForLinkedImage(){return e=>{e.on(\"attribute:linkHref:image\",(e,t,n)=>{const i=n.mapper.toViewElement(t.item);const o=Array.from(i.getChildren()).find(e=>e.name===\"a\");for(const e of this._definitions){const i=Ws(e.attributes);if(e.callback(t.attributeNewValue)){for(const[e,t]of i){if(e===\"class\"){n.writer.addClass(t,o)}else{n.writer.setAttribute(e,t,o)}}}else{for(const[e,t]of i){if(e===\"class\"){n.writer.removeClass(t,o)}else{n.writer.removeAttribute(e,o)}}}}})}}}function bv(e,t,n){var i=e.length;n=n===undefined?i:n;return!t&&n>=i?e:Na(e,t,n)}var wv=bv;var kv=\"\\\\ud800-\\\\udfff\",_v=\"\\\\u0300-\\\\u036f\",vv=\"\\\\ufe20-\\\\ufe2f\",yv=\"\\\\u20d0-\\\\u20ff\",xv=_v+vv+yv,Cv=\"\\\\ufe0e\\\\ufe0f\";var Av=\"\\\\u200d\";var Tv=RegExp(\"[\"+Av+kv+xv+Cv+\"]\");function Sv(e){return Tv.test(e)}var Pv=Sv;function Ev(e){return e.split(\"\")}var Mv=Ev;var Iv=\"\\\\ud800-\\\\udfff\",Nv=\"\\\\u0300-\\\\u036f\",Rv=\"\\\\ufe20-\\\\ufe2f\",Ov=\"\\\\u20d0-\\\\u20ff\",zv=Nv+Rv+Ov,Vv=\"\\\\ufe0e\\\\ufe0f\";var Lv=\"[\"+Iv+\"]\",Dv=\"[\"+zv+\"]\",Bv=\"\\\\ud83c[\\\\udffb-\\\\udfff]\",jv=\"(?:\"+Dv+\"|\"+Bv+\")\",Fv=\"[^\"+Iv+\"]\",Hv=\"(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}\",Wv=\"[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]\",Uv=\"\\\\u200d\";var qv=jv+\"?\",$v=\"[\"+Vv+\"]?\",Yv=\"(?:\"+Uv+\"(?:\"+[Fv,Hv,Wv].join(\"|\")+\")\"+$v+qv+\")*\",Gv=$v+qv+Yv,Kv=\"(?:\"+[Fv+Dv+\"?\",Dv,Hv,Wv,Lv].join(\"|\")+\")\";var Qv=RegExp(Bv+\"(?=\"+Bv+\")|\"+Kv+Gv,\"g\");function Jv(e){return e.match(Qv)||[]}var Zv=Jv;function Xv(e){return Pv(e)?Zv(e):Mv(e)}var ey=Xv;function ty(e){return function(t){t=va(t);var n=Pv(t)?ey(t):undefined;var i=n?n[0]:t.charAt(0);var o=n?wv(n,1).join(\"\"):t.slice(1);return i[e]()+o}}var ny=ty;var iy=ny(\"toUpperCase\");var oy=iy;const ry=/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205f\\u3000]/g;const sy=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;const ay=\"Ctrl+K\";function cy(e){return e.is(\"attributeElement\")&&!!e.getCustomProperty(\"link\")}function ly(e,t){const n=t.createAttributeElement(\"a\",{href:e},{priority:5});t.setCustomProperty(\"link\",true,n);return n}function dy(e){e=String(e);return uy(e)?e:\"#\"}function uy(e){const t=e.replace(ry,\"\");return t.match(sy)}function hy(e,t){const n={\"Open in a new tab\":e(\"Open in a new tab\"),Downloadable:e(\"Downloadable\")};t.forEach(e=>{if(e.label&&n[e.label]){e.label=n[e.label]}return e});return t}function fy(e){const t=[];if(e){for(const[n,i]of Object.entries(e)){const e=Object.assign({},i,{id:`link${oy(n)}`});t.push(e)}}return t}function my(e,t){if(!e){return false}return e.is(\"element\",\"image\")&&t.checkAttribute(\"image\",\"linkHref\")}class gy extends vk{constructor(e){super(e);this.manualDecorators=new xs;this.automaticDecorators=new pv}restoreManualDecoratorStates(){for(const e of this.manualDecorators){e.value=this._getDecoratorStateFromModel(e.id)}}refresh(){const e=this.editor.model;const t=e.document;const n=tk(t.selection.getSelectedBlocks());if(my(n,e.schema)){this.value=n.getAttribute(\"linkHref\");this.isEnabled=e.schema.checkAttribute(n,\"linkHref\")}else{this.value=t.selection.getAttribute(\"linkHref\");this.isEnabled=e.schema.checkAttributeInSelection(t.selection,\"linkHref\")}for(const e of this.manualDecorators){e.value=this._getDecoratorStateFromModel(e.id)}}execute(e,t={}){const n=this.editor.model;const i=n.document.selection;const o=[];const r=[];for(const e in t){if(t[e]){o.push(e)}else{r.push(e)}}n.change(t=>{if(i.isCollapsed){const s=i.getFirstPosition();if(i.hasAttribute(\"linkHref\")){const a=W_(s,\"linkHref\",i.getAttribute(\"linkHref\"),n);t.setAttribute(\"linkHref\",e,a);o.forEach(e=>{t.setAttribute(e,true,a)});r.forEach(e=>{t.removeAttribute(e,a)});t.setSelection(t.createPositionAfter(a.end.nodeBefore))}else if(e!==\"\"){const r=Ws(i.getAttributes());r.set(\"linkHref\",e);o.forEach(e=>{r.set(e,true)});const a=t.createText(e,r);n.insertContent(a,s);t.setSelection(t.createPositionAfter(a))}[\"linkHref\",...o,...r].forEach(e=>{t.removeSelectionAttribute(e)})}else{const s=n.schema.getValidRanges(i.getRanges(),\"linkHref\");const a=[];for(const e of i.getSelectedBlocks()){if(n.schema.checkAttribute(e,\"linkHref\")){a.push(t.createRangeOn(e))}}const c=a.slice();for(const e of s){if(this._isRangeToUpdate(e,a)){c.push(e)}}for(const n of c){t.setAttribute(\"linkHref\",e,n);o.forEach(e=>{t.setAttribute(e,true,n)});r.forEach(e=>{t.removeAttribute(e,n)})}}})}_getDecoratorStateFromModel(e){const t=this.editor.model;const n=t.document;const i=tk(n.selection.getSelectedBlocks());if(my(i,t.schema)){return i.getAttribute(e)}return n.selection.getAttribute(e)}_isRangeToUpdate(e,t){for(const n of t){if(n.containsRange(e)){return false}}return true}}class py extends vk{refresh(){const e=this.editor.model;const t=e.document;const n=tk(t.selection.getSelectedBlocks());if(my(n,e.schema)){this.isEnabled=e.schema.checkAttribute(n,\"linkHref\")}else{this.isEnabled=e.schema.checkAttributeInSelection(t.selection,\"linkHref\")}}execute(){const e=this.editor;const t=this.editor.model;const n=t.document.selection;const i=e.commands.get(\"link\");t.change(e=>{const o=n.isCollapsed?[W_(n.getFirstPosition(),\"linkHref\",n.getAttribute(\"linkHref\"),t)]:n.getRanges();for(const t of o){e.removeAttribute(\"linkHref\",t);if(i){for(const n of i.manualDecorators){e.removeAttribute(n.id,t)}}}})}}class by{constructor({id:e,label:t,attributes:n,defaultValue:i}){this.id=e;this.set(\"value\");this.defaultValue=i;this.label=t;this.attributes=n}}ys(by,Qc);var wy=n(49);const ky=\"ck-link_selected\";const _y=\"automatic\";const vy=\"manual\";const yy=/^(https?:)?\\/\\//;class xy extends sk{static get pluginName(){return\"LinkEditing\"}static get requires(){return[L_,sv,gv]}constructor(e){super(e);e.config.define(\"link\",{addTargetToExternalLinks:false})}init(){const e=this.editor;e.model.schema.extend(\"$text\",{allowAttributes:\"linkHref\"});e.conversion.for(\"dataDowncast\").attributeToElement({model:\"linkHref\",view:ly});e.conversion.for(\"editingDowncast\").attributeToElement({model:\"linkHref\",view:(e,t)=>ly(dy(e),t)});e.conversion.for(\"upcast\").elementToAttribute({view:{name:\"a\",attributes:{href:true}},model:{key:\"linkHref\",value:e=>e.getAttribute(\"href\")}});e.commands.add(\"link\",new gy(e));e.commands.add(\"unlink\",new py(e));const t=hy(e.t,fy(e.config.get(\"link.decorators\")));this._enableAutomaticDecorators(t.filter(e=>e.mode===_y));this._enableManualDecorators(t.filter(e=>e.mode===vy));const n=e.plugins.get(L_);n.registerAttribute(\"linkHref\");q_(e,\"linkHref\",\"a\",ky);this._enableInsertContentSelectionAttributesFixer();this._enableClickingAfterLink();this._enableTypingOverLink();this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(e){const t=this.editor;const n=t.commands.get(\"link\");const i=n.automaticDecorators;if(t.config.get(\"link.addTargetToExternalLinks\")){i.add({id:\"linkIsExternal\",mode:_y,callback:e=>yy.test(e),attributes:{target:\"_blank\",rel:\"noopener noreferrer\"}})}i.add(e);if(i.length){t.conversion.for(\"downcast\").add(i.getDispatcher())}}_enableManualDecorators(e){if(!e.length){return}const t=this.editor;const n=t.commands.get(\"link\");const i=n.manualDecorators;e.forEach(e=>{t.model.schema.extend(\"$text\",{allowAttributes:e.id});i.add(new by(e));t.conversion.for(\"downcast\").attributeToElement({model:e.id,view:(t,n)=>{if(t){const t=i.get(e.id).attributes;const o=n.createAttributeElement(\"a\",t,{priority:5});n.setCustomProperty(\"link\",true,o);return o}}});t.conversion.for(\"upcast\").elementToAttribute({view:{name:\"a\",attributes:i.get(e.id).attributes},model:{key:e.id}})})}_enableInsertContentSelectionAttributesFixer(){const e=this.editor;const t=e.model;const n=t.document.selection;const i=e.commands.get(\"link\");this.listenTo(t,\"insertContent\",()=>{const e=n.anchor.nodeBefore;const o=n.anchor.nodeAfter;if(!n.hasAttribute(\"linkHref\")){return}if(!e){return}if(!e.hasAttribute(\"linkHref\")){return}if(o&&o.hasAttribute(\"linkHref\")){return}t.change(e=>{Cy(e,i.manualDecorators)})},{priority:\"low\"})}_enableClickingAfterLink(){const e=this.editor;const t=e.commands.get(\"link\");e.editing.view.addObserver(V_);let n=false;this.listenTo(e.editing.view.document,\"mousedown\",()=>{n=true});this.listenTo(e.editing.view.document,\"selectionChange\",()=>{if(!n){return}n=false;const i=e.model.document.selection;if(!i.isCollapsed){return}if(!i.hasAttribute(\"linkHref\")){return}const o=i.getFirstPosition();const r=W_(o,\"linkHref\",i.getAttribute(\"linkHref\"),e.model);if(o.isTouching(r.start)||o.isTouching(r.end)){e.model.change(e=>{Cy(e,t.manualDecorators)})}})}_enableTypingOverLink(){const e=this.editor;const t=e.editing.view;let n;let i;this.listenTo(t.document,\"delete\",()=>{i=true},{priority:\"high\"});this.listenTo(e.model,\"deleteContent\",()=>{const t=e.model.document.selection;if(t.isCollapsed){return}if(i){i=false;return}if(!Ty(e)){return}if(Ay(e.model)){n=t.getAttributes()}},{priority:\"high\"});this.listenTo(e.model,\"insertContent\",(t,[o])=>{i=false;if(!Ty(e)){return}if(!n){return}e.model.change(e=>{for(const[t,i]of n){e.setAttribute(t,i,o)}});n=null},{priority:\"high\"})}_handleDeleteContentAfterLink(){const e=this.editor;const t=e.model;const n=t.document.selection;const i=e.editing.view;const o=e.commands.get(\"link\");let r=false;let s=false;this.listenTo(i.document,\"delete\",(e,t)=>{s=t.domEvent.keyCode===Ol.backspace},{priority:\"high\"});this.listenTo(t,\"deleteContent\",()=>{r=false;const e=n.getFirstPosition();const i=n.getAttribute(\"linkHref\");if(!i){return}const o=W_(e,\"linkHref\",i,t);r=o.containsPosition(e)||o.end.isEqual(e)},{priority:\"high\"});this.listenTo(t,\"deleteContent\",()=>{if(!s){return}s=false;if(r){return}e.model.enqueueChange(e=>{Cy(e,o.manualDecorators)})},{priority:\"low\"})}}function Cy(e,t){e.removeSelectionAttribute(\"linkHref\");for(const n of t){e.removeSelectionAttribute(n.id)}}function Ay(e){const t=e.document.selection;const n=t.getFirstPosition();const i=t.getLastPosition();const o=n.nodeAfter;if(!o){return false}if(!o.is(\"$text\")){return false}if(!o.hasAttribute(\"linkHref\")){return false}const r=i.textNode||i.nodeBefore;if(o===r){return true}const s=W_(n,\"linkHref\",o.getAttribute(\"linkHref\"),e);return s.containsRange(e.createRange(n,i),true)}function Ty(e){const t=e.plugins.get(\"Input\");return t.isInput(e.model.change(e=>e.batch))}class Sy{constructor(e){this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return true}}ys(Sy,Qc);class Py extends Sy{static get pluginName(){return\"Notification\"}init(){this.on(\"show:warning\",(e,t)=>{window.alert(t.message)},{priority:\"lowest\"})}showSuccess(e,t={}){this._showNotification({message:e,type:\"success\",namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:\"info\",namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:\"warning\",namespace:t.namespace,title:t.title})}_showNotification(e){const t=`show:${e.type}`+(e.namespace?`:${e.namespace}`:\"\");this.fire(t,{message:e.message,type:e.type,title:e.title||\"\"})}}class Ey extends vk{constructor(e){super(e);this.stopListening(this.editor.model.document,\"change\");this.listenTo(this.editor.model.document,\"change\",()=>this.refresh(),{priority:\"low\"})}refresh(){const e=this.editor.commands.get(\"imageInsert\");const t=this.editor.commands.get(\"link\");this.isEnabled=e.isEnabled||t.isEnabled}execute(){const e=this.editor;const t=this.editor.config.get(\"ckfinder.openerMethod\")||\"modal\";if(t!=\"popup\"&&t!=\"modal\"){throw new ss[\"b\"]('ckfinder-unknown-openerMethod: The openerMethod config option must by \"popup\" or \"modal\".',e)}const n=this.editor.config.get(\"ckfinder.options\")||{};n.chooseFiles=true;const i=n.onInit;if(!n.language){n.language=e.locale.uiLanguage}n.onInit=t=>{if(i){i(t)}t.on(\"files:choose\",n=>{const i=n.data.files.toArray();const o=i.filter(e=>!e.isImage());const r=i.filter(e=>e.isImage());for(const t of o){e.execute(\"link\",t.getUrl())}const s=[];for(const e of r){const n=e.getUrl();s.push(n?n:t.request(\"file:getProxyUrl\",{file:e}))}if(s.length){My(e,s)}});t.on(\"file:choose:resizedImage\",t=>{const n=t.data.resizedUrl;if(!n){const t=e.plugins.get(\"Notification\");const n=e.locale.t;t.showWarning(n(\"Could not obtain resized image URL.\"),{title:n(\"Selecting resized image failed\"),namespace:\"ckfinder\"});return}My(e,[n])})};window.CKFinder[t](n)}}function My(e,t){const n=e.commands.get(\"imageInsert\");if(!n.isEnabled){const t=e.plugins.get(\"Notification\");const n=e.locale.t;t.showWarning(n(\"Could not insert image at the current position.\"),{title:n(\"Inserting image failed\"),namespace:\"ckfinder\"});return}e.execute(\"imageInsert\",{source:t})}class Iy extends sk{static get pluginName(){return\"CKFinderEditing\"}static get requires(){return[Py,O_,xy]}init(){const e=this.editor;e.commands.add(\"ckfinder\",new Ey(e))}}class Ny extends Sy{static get pluginName(){return\"PendingActions\"}init(){this.set(\"hasAny\",false);this._actions=new xs({idProperty:\"_id\"});this._actions.delegate(\"add\",\"remove\").to(this)}add(e){if(typeof e!==\"string\"){throw new ss[\"b\"](\"pendingactions-add-invalid-message: The message must be a string.\",this)}const t=Object.create(Qc);t.set(\"message\",e);this._actions.add(t);this.hasAny=true;return t}remove(e){this._actions.remove(e);this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}class Ry{constructor(){const e=new window.FileReader;this._reader=e;this._data=undefined;this.set(\"loaded\",0);e.onprogress=e=>{this.loaded=e.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;this.total=e.size;return new Promise((n,i)=>{t.onload=()=>{const e=t.result;this._data=e;n(e)};t.onerror=()=>{i(\"error\")};t.onabort=()=>{i(\"aborted\")};this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}ys(Ry,Qc);class Oy extends sk{static get pluginName(){return\"FileRepository\"}static get requires(){return[Ny]}init(){this.loaders=new xs;this.loaders.on(\"add\",()=>this._updatePendingAction());this.loaders.on(\"remove\",()=>this._updatePendingAction());this._loadersMap=new Map;this._pendingAction=null;this.set(\"uploaded\",0);this.set(\"uploadTotal\",null);this.bind(\"uploadedPercent\").to(this,\"uploaded\",this,\"uploadTotal\",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter){console.warn(Object(ss[\"a\"])(\"filerepository-no-upload-adapter: Upload adapter is not defined.\"));return null}const t=new zy(Promise.resolve(e),this.createUploadAdapter);this.loaders.add(t);this._loadersMap.set(e,t);if(e instanceof Promise){t.file.then(e=>{this._loadersMap.set(e,t)}).catch(()=>{})}t.on(\"change:uploaded\",()=>{let e=0;for(const t of this.loaders){e+=t.uploaded}this.uploaded=e});t.on(\"change:uploadTotal\",()=>{let e=0;for(const t of this.loaders){if(t.uploadTotal){e+=t.uploadTotal}}this.uploadTotal=e});return t}destroyLoader(e){const t=e instanceof zy?e:this.getLoader(e);t._destroy();this.loaders.remove(t);this._loadersMap.forEach((e,n)=>{if(e===t){this._loadersMap.delete(n)}})}_updatePendingAction(){const e=this.editor.plugins.get(Ny);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t;const n=e=>`${t(\"Upload in progress\")} ${parseInt(e)}%.`;this._pendingAction=e.add(n(this.uploadedPercent));this._pendingAction.bind(\"message\").to(this,\"uploadedPercent\",n)}}else{e.remove(this._pendingAction);this._pendingAction=null}}}ys(Oy,Qc);class zy{constructor(e,t){this.id=ns();this._filePromiseWrapper=this._createFilePromiseWrapper(e);this._adapter=t(this);this._reader=new Ry;this.set(\"status\",\"idle\");this.set(\"uploaded\",0);this.set(\"uploadTotal\",null);this.bind(\"uploadedPercent\").to(this,\"uploaded\",this,\"uploadTotal\",(e,t)=>t?e/t*100:0);this.set(\"uploadResponse\",null)}get file(){if(!this._filePromiseWrapper){return Promise.resolve(null)}else{return this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null)}}get data(){return this._reader.data}read(){if(this.status!=\"idle\"){throw new ss[\"b\"](\"filerepository-read-wrong-status: You cannot call read if the status is different than idle.\",this)}this.status=\"reading\";return this.file.then(e=>this._reader.read(e)).then(e=>{if(this.status!==\"reading\"){throw this.status}this.status=\"idle\";return e}).catch(e=>{if(e===\"aborted\"){this.status=\"aborted\";throw\"aborted\"}this.status=\"error\";throw this._reader.error?this._reader.error:e})}upload(){if(this.status!=\"idle\"){throw new ss[\"b\"](\"filerepository-upload-wrong-status: You cannot call upload if the status is different than idle.\",this)}this.status=\"uploading\";return this.file.then(()=>this._adapter.upload()).then(e=>{this.uploadResponse=e;this.status=\"idle\";return e}).catch(e=>{if(this.status===\"aborted\"){throw\"aborted\"}this.status=\"error\";throw e})}abort(){const e=this.status;this.status=\"aborted\";if(!this._filePromiseWrapper.isFulfilled){this._filePromiseWrapper.promise.catch(()=>{});this._filePromiseWrapper.rejecter(\"aborted\")}else if(e==\"reading\"){this._reader.abort()}else if(e==\"uploading\"&&this._adapter.abort){this._adapter.abort()}this._destroy()}_destroy(){this._filePromiseWrapper=undefined;this._reader=undefined;this._adapter=undefined;this.uploadResponse=undefined}_createFilePromiseWrapper(e){const t={};t.promise=new Promise((n,i)=>{t.rejecter=i;t.isFulfilled=false;e.then(e=>{t.isFulfilled=true;n(e)}).catch(e=>{t.isFulfilled=true;i(e)})});return t}}ys(zy,Qc);const Vy=\"ckCsrfToken\";const Ly=40;const Dy=\"abcdefghijklmnopqrstuvwxyz0123456789\";function By(){let e=jy(Vy);if(!e||e.length!=Ly){e=Hy(Ly);Fy(Vy,e)}return e}function jy(e){e=e.toLowerCase();const t=document.cookie.split(\";\");for(const n of t){const t=n.split(\"=\");const i=decodeURIComponent(t[0].trim().toLowerCase());if(i===e){return decodeURIComponent(t[1])}}return null}function Fy(e,t){document.cookie=encodeURIComponent(e)+\"=\"+encodeURIComponent(t)+\";path=/\"}function Hy(e){let t=\"\";const n=new Uint8Array(e);window.crypto.getRandomValues(n);for(let e=0;e.5?i.toUpperCase():i}return t}class Wy extends sk{static get requires(){return[Oy]}static get pluginName(){return\"CKFinderUploadAdapter\"}init(){const e=this.editor.config.get(\"ckfinder.uploadUrl\");if(!e){return}this.editor.plugins.get(Oy).createUploadAdapter=t=>new Uy(t,e,this.editor.t)}}class Uy{constructor(e,t,n){this.loader=e;this.url=t;this.t=n}upload(){return this.loader.file.then(e=>new Promise((t,n)=>{this._initRequest();this._initListeners(t,n,e);this._sendRequest(e)}))}abort(){if(this.xhr){this.xhr.abort()}}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open(\"POST\",this.url,true);e.responseType=\"json\"}_initListeners(e,t,n){const i=this.xhr;const o=this.loader;const r=this.t;const s=r(\"Cannot upload file:\")+` ${n.name}.`;i.addEventListener(\"error\",()=>t(s));i.addEventListener(\"abort\",()=>t());i.addEventListener(\"load\",()=>{const n=i.response;if(!n||!n.uploaded){return t(n&&n.error&&n.error.message?n.error.message:s)}e({default:n.url})});if(i.upload){i.upload.addEventListener(\"progress\",e=>{if(e.lengthComputable){o.uploadTotal=e.total;o.uploaded=e.loaded}})}}_sendRequest(e){const t=new FormData;t.append(\"upload\",e);t.append(\"ckCsrfToken\",By());this.xhr.send(t)}}class qy extends sk{static get pluginName(){return\"CKFinder\"}static get requires(){return[Iy,jk,Wy]}}function*$y(e,t){for(const n of t){if(n&&e.getAttributeProperties(n[0]).copyOnEnter){yield n}}}class Yy extends vk{execute(){const e=this.editor.model;const t=e.document;e.change(n=>{Gy(this.editor.model,n,t.selection,e.schema);this.fire(\"afterExecute\",{writer:n})})}}function Gy(e,t,n,i){const o=n.isCollapsed;const r=n.getFirstRange();const s=r.start.parent;const a=r.end.parent;if(i.isLimit(s)||i.isLimit(a)){if(!o&&s==a){e.deleteContent(n)}return}if(o){const e=$y(t.model.schema,n.getAttributes());Ky(t,r.start);t.setSelectionAttribute(e)}else{const i=!(r.start.isAtStart&&r.end.isAtEnd);const o=s==a;e.deleteContent(n,{leaveUnmerged:i});if(i){if(o){Ky(t,n.focus)}else{t.setSelection(a,0)}}}}function Ky(e,t){e.split(t);e.setSelection(t.parent.nextSibling,0)}class Qy extends Zd{constructor(e){super(e);const t=this.document;t.on(\"keydown\",(e,n)=>{if(this.isEnabled&&n.keyCode==Ol.enter){let i;t.once(\"enter\",e=>i=e,{priority:\"highest\"});t.fire(\"enter\",new Xu(t,n.domEvent,{isSoft:n.shiftKey}));if(i&&i.stop.called){e.stop()}}})}observe(){}}class Jy extends sk{static get pluginName(){return\"Enter\"}init(){const e=this.editor;const t=e.editing.view;const n=t.document;t.addObserver(Qy);e.commands.add(\"enter\",new Yy(e));this.listenTo(n,\"enter\",(n,i)=>{i.preventDefault();if(i.isSoft){return}e.execute(\"enter\");t.scrollToTheSelection()},{priority:\"low\"})}}class Zy extends vk{execute(){const e=this.editor.model;const t=e.document;e.change(n=>{ex(e,n,t.selection);this.fire(\"afterExecute\",{writer:n})})}refresh(){const e=this.editor.model;const t=e.document;this.isEnabled=Xy(e.schema,t.selection)}}function Xy(e,t){if(t.rangeCount>1){return false}const n=t.anchor;if(!n||!e.checkChild(n,\"softBreak\")){return false}const i=t.getFirstRange();const o=i.start.parent;const r=i.end.parent;if((nx(o,e)||nx(r,e))&&o!==r){return false}return true}function ex(e,t,n){const i=n.isCollapsed;const o=n.getFirstRange();const r=o.start.parent;const s=o.end.parent;const a=r==s;if(i){const i=$y(e.schema,n.getAttributes());tx(e,t,o.end);t.removeSelectionAttribute(n.getAttributeKeys());t.setSelectionAttribute(i)}else{const i=!(o.start.isAtStart&&o.end.isAtEnd);e.deleteContent(n,{leaveUnmerged:i});if(a){tx(e,t,n.focus)}else{if(i){t.setSelection(s,0)}}}}function tx(e,t,n){const i=t.createElement(\"softBreak\");e.insertContent(i,n);t.setSelection(i,\"after\")}function nx(e,t){if(e.is(\"rootElement\")){return false}return t.isLimit(e)||nx(e.parent,t)}class ix extends sk{static get pluginName(){return\"ShiftEnter\"}init(){const e=this.editor;const t=e.model.schema;const n=e.conversion;const i=e.editing.view;const o=i.document;t.register(\"softBreak\",{allowWhere:\"$text\",isInline:true});n.for(\"upcast\").elementToElement({model:\"softBreak\",view:\"br\"});n.for(\"downcast\").elementToElement({model:\"softBreak\",view:(e,t)=>t.createEmptyElement(\"br\")});i.addObserver(Qy);e.commands.add(\"shiftEnter\",new Zy(e));this.listenTo(o,\"enter\",(t,n)=>{n.preventDefault();if(!n.isSoft){return}e.execute(\"shiftEnter\");i.scrollToTheSelection()},{priority:\"low\"})}}class ox extends vk{execute(){const e=this.editor.model;const t=e.document.selection;let n=e.schema.getLimitElement(t);if(t.containsEntireContent(n)||!rx(e.schema,n)){do{n=n.parent;if(!n){return}}while(!rx(e.schema,n))}e.change(e=>{e.setSelection(n,\"in\")})}}function rx(e,t){return e.isLimit(t)&&(e.checkChild(t,\"$text\")||e.checkChild(t,\"paragraph\"))}const sx=Vl(\"Ctrl+A\");class ax extends sk{static get pluginName(){return\"SelectAllEditing\"}init(){const e=this.editor;const t=e.editing.view;const n=t.document;e.commands.add(\"selectAll\",new ox(e));this.listenTo(n,\"keydown\",(t,n)=>{if(zl(n)===sx){e.execute(\"selectAll\");n.preventDefault()}})}}var cx='';class lx extends sk{static get pluginName(){return\"SelectAllUI\"}init(){const e=this.editor;e.ui.componentFactory.add(\"selectAll\",t=>{const n=e.commands.get(\"selectAll\");const i=new Aw(t);const o=t.t;i.set({label:o(\"Select all\"),icon:cx,keystroke:\"Ctrl+A\",tooltip:true});i.bind(\"isOn\",\"isEnabled\").to(n,\"value\",\"isEnabled\");this.listenTo(i,\"execute\",()=>{e.execute(\"selectAll\");e.editing.view.focus()});return i})}}class dx extends sk{static get requires(){return[ax,lx]}static get pluginName(){return\"SelectAll\"}}class ux extends vk{constructor(e,t){super(e);this.direction=t;this._buffer=new $_(e.model,e.config.get(\"typing.undoStep\"))}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model;const n=t.document;t.enqueueChange(this._buffer.batch,i=>{this._buffer.lock();const o=i.createSelection(e.selection||n.selection);const r=o.isCollapsed;if(o.isCollapsed){t.modifySelection(o,{direction:this.direction,unit:e.unit})}if(this._shouldEntireContentBeReplacedWithParagraph(e.sequence||1)){this._replaceEntireContentWithParagraph(i);return}if(o.isCollapsed){return}let s=0;o.getFirstRange().getMinimalFlatRanges().forEach(e=>{s+=ml(e.getWalker({singleCharacters:true,ignoreElementEnd:true,shallow:true}))});t.deleteContent(o,{doNotResetEntireContent:r,direction:this.direction});this._buffer.input(s);i.setSelection(o);this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1){return false}const t=this.editor.model;const n=t.document;const i=n.selection;const o=t.schema.getLimitElement(i);const r=i.isCollapsed&&i.containsEntireContent(o);if(!r){return false}if(!t.schema.checkChild(o,\"paragraph\")){return false}const s=o.getChild(0);if(s&&s.name===\"paragraph\"){return false}return true}_replaceEntireContentWithParagraph(e){const t=this.editor.model;const n=t.document;const i=n.selection;const o=t.schema.getLimitElement(i);const r=e.createElement(\"paragraph\");e.remove(e.createRangeIn(o));e.insert(r,o);e.setSelection(r,0)}}class hx extends Zd{constructor(e){super(e);const t=e.document;let n=0;t.on(\"keyup\",(e,t)=>{if(t.keyCode==Ol.delete||t.keyCode==Ol.backspace){n=0}});t.on(\"keydown\",(e,t)=>{const o={};if(t.keyCode==Ol.delete){o.direction=\"forward\";o.unit=\"character\"}else if(t.keyCode==Ol.backspace){o.direction=\"backward\";o.unit=\"codePoint\"}else{return}const r=Tl.isMac?t.altKey:t.ctrlKey;o.unit=r?\"word\":o.unit;o.sequence=++n;i(e,t.domEvent,o)});if(Tl.isAndroid){t.on(\"beforeinput\",(t,n)=>{if(n.domEvent.inputType!=\"deleteContentBackward\"){return}const o={unit:\"codepoint\",direction:\"backward\",sequence:1};const r=n.domTarget.ownerDocument.defaultView.getSelection();if(r.anchorNode==r.focusNode&&r.anchorOffset+1!=r.focusOffset){o.selectionToRemove=e.domConverter.domSelectionToView(r)}i(t,n.domEvent,o)})}function i(e,n,i){let o;t.once(\"delete\",e=>o=e,{priority:Number.POSITIVE_INFINITY});t.fire(\"delete\",new Xu(t,n,i));if(o&&o.stop.called){e.stop()}}}observe(){}}class fx extends sk{static get pluginName(){return\"Delete\"}init(){const e=this.editor;const t=e.editing.view;const n=t.document;t.addObserver(hx);e.commands.add(\"forwardDelete\",new ux(e,\"forward\"));e.commands.add(\"delete\",new ux(e,\"backward\"));this.listenTo(n,\"delete\",(n,i)=>{const o={unit:i.unit,sequence:i.sequence};if(i.selectionToRemove){const t=e.model.createSelection();const n=[];for(const t of i.selectionToRemove.getRanges()){n.push(e.editing.mapper.toModelRange(t))}t.setTo(n);o.selection=t}e.execute(i.direction==\"forward\"?\"forwardDelete\":\"delete\",o);i.preventDefault();t.scrollToTheSelection()});if(Tl.isAndroid){let e=null;this.listenTo(n,\"delete\",(t,n)=>{const i=n.domTarget.ownerDocument.defaultView.getSelection();e={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}},{priority:\"lowest\"});this.listenTo(n,\"keyup\",(t,n)=>{if(e){const t=n.domTarget.ownerDocument.defaultView.getSelection();t.collapse(e.anchorNode,e.anchorOffset);t.extend(e.focusNode,e.focusOffset);e=null}})}}}class mx extends sk{static get requires(){return[sv,fx]}static get pluginName(){return\"Typing\"}}const gx=new Map;function px(e,t,n){let i=gx.get(e);if(!i){i=new Map;gx.set(e,i)}i.set(t,n)}function bx(e,t){const n=gx.get(e);if(n&&n.has(t)){return n.get(t)}return wx}function wx(e){return[e]}function kx(e,t,n={}){const i=bx(e.constructor,t.constructor);try{e=e.clone();return i(e,t,n)}catch(e){throw e}}function _x(e,t,n){e=e.slice();t=t.slice();const i=new vx(n.document,n.useRelations,n.forceWeakRemove);i.setOriginalOperations(e);i.setOriginalOperations(t);const o=i.originalOperations;if(e.length==0||t.length==0){return{operationsA:e,operationsB:t,originalOperations:o}}const r=new WeakMap;for(const t of e){r.set(t,0)}const s={nextBaseVersionA:e[e.length-1].baseVersion+1,nextBaseVersionB:t[t.length-1].baseVersion+1,originalOperationsACount:e.length,originalOperationsBCount:t.length};let a=0;while(a{if(e.key===t.key&&e.range.start.hasSameParentAs(t.range.start)){const i=e.range.getDifference(t.range).map(t=>new mg(t,e.key,e.oldValue,e.newValue,0));const o=e.range.getIntersection(t.range);if(o){if(n.aIsStrong){i.push(new mg(o,t.key,t.newValue,e.newValue,0))}}if(i.length==0){return[new qg(0)]}return i}else{return[e]}});px(mg,bg,(e,t)=>{if(e.range.start.hasSameParentAs(t.position)&&e.range.containsPosition(t.position)){const n=e.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes);const i=n.map(t=>new mg(t,e.key,e.oldValue,e.newValue,e.baseVersion));if(t.shouldReceiveAttributes){const n=Cx(t,e.key,e.oldValue);if(n){i.unshift(n)}}return i}e.range=e.range._getTransformedByInsertion(t.position,t.howMany,false)[0];return[e]});function Cx(e,t,n){const i=e.nodes;const o=i.getNode(0).getAttribute(t);if(o==n){return null}const r=new ef(e.position,e.position.getShiftedBy(e.howMany));return new mg(r,t,o,n,0)}px(mg,vg,(e,t)=>{const n=[];if(e.range.start.hasSameParentAs(t.deletionPosition)){if(e.range.containsPosition(t.deletionPosition)||e.range.start.isEqual(t.deletionPosition)){n.push(ef._createFromPositionAndShift(t.graveyardPosition,1))}}const i=e.range._getTransformedByMergeOperation(t);if(!i.isCollapsed){n.push(i)}return n.map(t=>new mg(t,e.key,e.oldValue,e.newValue,e.baseVersion))});px(mg,pg,(e,t)=>{const n=Ax(e.range,t);return n.map(t=>new mg(t,e.key,e.oldValue,e.newValue,e.baseVersion))});function Ax(e,t){const n=ef._createFromPositionAndShift(t.sourcePosition,t.howMany);let i=null;let o=[];if(n.containsRange(e,true)){i=e}else if(e.start.hasSameParentAs(n.start)){o=e.getDifference(n);i=e.getIntersection(n)}else{o=[e]}const r=[];for(let e of o){e=e._getTransformedByDeletion(t.sourcePosition,t.howMany);const n=t.getMovedRangeStart();const i=e.start.hasSameParentAs(n);e=e._getTransformedByInsertion(n,t.howMany,i);r.push(...e)}if(i){r.push(i._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,false)[0])}return r}px(mg,yg,(e,t)=>{if(e.range.end.isEqual(t.insertionPosition)){if(!t.graveyardPosition){e.range.end.offset++}return[e]}if(e.range.start.hasSameParentAs(t.splitPosition)&&e.range.containsPosition(t.splitPosition)){const n=e.clone();n.range=new ef(t.moveTargetPosition.clone(),e.range.end._getCombined(t.splitPosition,t.moveTargetPosition));e.range.end=t.splitPosition.clone();e.range.end.stickiness=\"toPrevious\";return[e,n]}e.range=e.range._getTransformedBySplitOperation(t);return[e]});px(bg,mg,(e,t)=>{const n=[e];if(e.shouldReceiveAttributes&&e.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(e.position)){const i=Cx(e,t.key,t.newValue);if(i){n.push(i)}}return n});px(bg,bg,(e,t,n)=>{if(e.position.isEqual(t.position)&&n.aIsStrong){return[e]}e.position=e.position._getTransformedByInsertOperation(t);return[e]});px(bg,pg,(e,t)=>{e.position=e.position._getTransformedByMoveOperation(t);return[e]});px(bg,yg,(e,t)=>{e.position=e.position._getTransformedBySplitOperation(t);return[e]});px(bg,vg,(e,t)=>{e.position=e.position._getTransformedByMergeOperation(t);return[e]});px(wg,bg,(e,t)=>{if(e.oldRange){e.oldRange=e.oldRange._getTransformedByInsertOperation(t)[0]}if(e.newRange){e.newRange=e.newRange._getTransformedByInsertOperation(t)[0]}return[e]});px(wg,wg,(e,t,n)=>{if(e.name==t.name){if(n.aIsStrong){e.oldRange=t.newRange?t.newRange.clone():null}else{return[new qg(0)]}}return[e]});px(wg,vg,(e,t)=>{if(e.oldRange){e.oldRange=e.oldRange._getTransformedByMergeOperation(t)}if(e.newRange){e.newRange=e.newRange._getTransformedByMergeOperation(t)}return[e]});px(wg,pg,(e,t,n)=>{if(e.oldRange){e.oldRange=ef._createFromRanges(e.oldRange._getTransformedByMoveOperation(t))}if(e.newRange){if(n.abRelation){const i=ef._createFromRanges(e.newRange._getTransformedByMoveOperation(t));if(n.abRelation.side==\"left\"&&t.targetPosition.isEqual(e.newRange.start)){e.newRange.start.path=n.abRelation.path;e.newRange.end=i.end;return[e]}else if(n.abRelation.side==\"right\"&&t.targetPosition.isEqual(e.newRange.end)){e.newRange.start=i.start;e.newRange.end.path=n.abRelation.path;return[e]}}e.newRange=ef._createFromRanges(e.newRange._getTransformedByMoveOperation(t))}return[e]});px(wg,yg,(e,t,n)=>{if(e.oldRange){e.oldRange=e.oldRange._getTransformedBySplitOperation(t)}if(e.newRange){if(n.abRelation){const i=e.newRange._getTransformedBySplitOperation(t);if(e.newRange.start.isEqual(t.splitPosition)&&n.abRelation.wasStartBeforeMergedElement){e.newRange.start=Qh._createAt(t.insertionPosition)}else if(e.newRange.start.isEqual(t.splitPosition)&&!n.abRelation.wasInLeftElement){e.newRange.start=Qh._createAt(t.moveTargetPosition)}if(e.newRange.end.isEqual(t.splitPosition)&&n.abRelation.wasInRightElement){e.newRange.end=Qh._createAt(t.moveTargetPosition)}else if(e.newRange.end.isEqual(t.splitPosition)&&n.abRelation.wasEndBeforeMergedElement){e.newRange.end=Qh._createAt(t.insertionPosition)}else{e.newRange.end=i.end}return[e]}e.newRange=e.newRange._getTransformedBySplitOperation(t)}return[e]});px(vg,bg,(e,t)=>{if(e.sourcePosition.hasSameParentAs(t.position)){e.howMany+=t.howMany}e.sourcePosition=e.sourcePosition._getTransformedByInsertOperation(t);e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t);return[e]});px(vg,vg,(e,t,n)=>{if(e.sourcePosition.isEqual(t.sourcePosition)&&e.targetPosition.isEqual(t.targetPosition)){if(!n.bWasUndone){return[new qg(0)]}else{const n=t.graveyardPosition.path.slice();n.push(0);e.sourcePosition=new Qh(t.graveyardPosition.root,n);e.howMany=0;return[e]}}if(e.sourcePosition.isEqual(t.sourcePosition)&&!e.targetPosition.isEqual(t.targetPosition)&&!n.bWasUndone&&n.abRelation!=\"splitAtSource\"){const i=e.targetPosition.root.rootName==\"$graveyard\";const o=t.targetPosition.root.rootName==\"$graveyard\";const r=i&&!o;const s=o&&!i;const a=s||!r&&n.aIsStrong;if(a){const n=t.targetPosition._getTransformedByMergeOperation(t);const i=e.targetPosition._getTransformedByMergeOperation(t);return[new pg(n,e.howMany,i,0)]}else{return[new qg(0)]}}if(e.sourcePosition.hasSameParentAs(t.targetPosition)){e.howMany+=t.howMany}e.sourcePosition=e.sourcePosition._getTransformedByMergeOperation(t);e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t);if(!e.graveyardPosition.isEqual(t.graveyardPosition)||!n.aIsStrong){e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)}return[e]});px(vg,pg,(e,t,n)=>{const i=ef._createFromPositionAndShift(t.sourcePosition,t.howMany);if(t.type==\"remove\"&&!n.bWasUndone&&!n.forceWeakRemove){if(e.deletionPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(e.sourcePosition)){return[new qg(0)]}}if(e.sourcePosition.hasSameParentAs(t.targetPosition)){e.howMany+=t.howMany}if(e.sourcePosition.hasSameParentAs(t.sourcePosition)){e.howMany-=t.howMany}e.sourcePosition=e.sourcePosition._getTransformedByMoveOperation(t);e.targetPosition=e.targetPosition._getTransformedByMoveOperation(t);if(!e.graveyardPosition.isEqual(t.targetPosition)){e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}return[e]});px(vg,yg,(e,t,n)=>{if(t.graveyardPosition){e.graveyardPosition=e.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1);if(e.deletionPosition.isEqual(t.graveyardPosition)){e.howMany=t.howMany}}if(e.targetPosition.isEqual(t.splitPosition)){const i=t.howMany!=0;const o=t.graveyardPosition&&e.deletionPosition.isEqual(t.graveyardPosition);if(i||o||n.abRelation==\"mergeTargetNotMoved\"){e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t);return[e]}}if(e.sourcePosition.isEqual(t.splitPosition)){if(n.abRelation==\"mergeSourceNotMoved\"){e.howMany=0;e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t);return[e]}if(n.abRelation==\"mergeSameElement\"||e.sourcePosition.offset>0){e.sourcePosition=t.moveTargetPosition.clone();e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t);return[e]}}if(e.sourcePosition.hasSameParentAs(t.splitPosition)){e.howMany=t.splitPosition.offset}e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t);e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t);return[e]});px(pg,bg,(e,t)=>{const n=ef._createFromPositionAndShift(e.sourcePosition,e.howMany);const i=n._getTransformedByInsertOperation(t,false)[0];e.sourcePosition=i.start;e.howMany=i.end.offset-i.start.offset;if(!e.targetPosition.isEqual(t.position)){e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)}return[e]});px(pg,pg,(e,t,n)=>{const i=ef._createFromPositionAndShift(e.sourcePosition,e.howMany);const o=ef._createFromPositionAndShift(t.sourcePosition,t.howMany);let r=n.aIsStrong;let s=!n.aIsStrong;if(n.abRelation==\"insertBefore\"||n.baRelation==\"insertAfter\"){s=true}else if(n.abRelation==\"insertAfter\"||n.baRelation==\"insertBefore\"){s=false}let a;if(e.targetPosition.isEqual(t.targetPosition)&&s){a=e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany)}else{a=e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany)}if(Tx(e,t)&&Tx(t,e)){return[t.getReversed()]}const c=i.containsPosition(t.targetPosition);if(c&&i.containsRange(o,true)){i.start=i.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);i.end=i.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);return Sx([i],a)}const l=o.containsPosition(e.targetPosition);if(l&&o.containsRange(i,true)){i.start=i.start._getCombined(t.sourcePosition,t.getMovedRangeStart());i.end=i.end._getCombined(t.sourcePosition,t.getMovedRangeStart());return Sx([i],a)}const d=zs(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if(d==\"prefix\"||d==\"extension\"){i.start=i.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);i.end=i.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);return Sx([i],a)}if(e.type==\"remove\"&&t.type!=\"remove\"&&!n.aWasUndone&&!n.forceWeakRemove){r=true}else if(e.type!=\"remove\"&&t.type==\"remove\"&&!n.bWasUndone&&!n.forceWeakRemove){r=false}const u=[];const h=i.getDifference(o);for(const e of h){e.start=e.start._getTransformedByDeletion(t.sourcePosition,t.howMany);e.end=e.end._getTransformedByDeletion(t.sourcePosition,t.howMany);const n=zs(e.start.getParentPath(),t.getMovedRangeStart().getParentPath())==\"same\";const i=e._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,n);u.push(...i)}const f=i.getIntersection(o);if(f!==null&&r){f.start=f.start._getCombined(t.sourcePosition,t.getMovedRangeStart());f.end=f.end._getCombined(t.sourcePosition,t.getMovedRangeStart());if(u.length===0){u.push(f)}else if(u.length==1){if(o.start.isBefore(i.start)||o.start.isEqual(i.start)){u.unshift(f)}else{u.push(f)}}else{u.splice(1,0,f)}}if(u.length===0){return[new qg(e.baseVersion)]}return Sx(u,a)});px(pg,yg,(e,t,n)=>{let i=e.targetPosition.clone();if(!e.targetPosition.isEqual(t.insertionPosition)||!t.graveyardPosition||n.abRelation==\"moveTargetAfter\"){i=e.targetPosition._getTransformedBySplitOperation(t)}const o=ef._createFromPositionAndShift(e.sourcePosition,e.howMany);if(o.end.isEqual(t.insertionPosition)){if(!t.graveyardPosition){e.howMany++}e.targetPosition=i;return[e]}if(o.start.hasSameParentAs(t.splitPosition)&&o.containsPosition(t.splitPosition)){let e=new ef(t.splitPosition,o.end);e=e._getTransformedBySplitOperation(t);const n=[new ef(o.start,t.splitPosition),e];return Sx(n,i)}if(e.targetPosition.isEqual(t.splitPosition)&&n.abRelation==\"insertAtSource\"){i=t.moveTargetPosition}if(e.targetPosition.isEqual(t.insertionPosition)&&n.abRelation==\"insertBetween\"){i=e.targetPosition}const r=o._getTransformedBySplitOperation(t);const s=[r];if(t.graveyardPosition){const i=o.start.isEqual(t.graveyardPosition)||o.containsPosition(t.graveyardPosition);if(e.howMany>1&&i&&!n.aWasUndone){s.push(ef._createFromPositionAndShift(t.insertionPosition,1))}}return Sx(s,i)});px(pg,vg,(e,t,n)=>{const i=ef._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&i.containsPosition(t.sourcePosition)){if(e.type==\"remove\"&&!n.forceWeakRemove){if(!n.aWasUndone){const n=[];let i=t.graveyardPosition.clone();let o=t.targetPosition._getTransformedByMergeOperation(t);if(e.howMany>1){n.push(new pg(e.sourcePosition,e.howMany-1,e.targetPosition,0));i=i._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1);o=o._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1)}const r=t.deletionPosition._getCombined(e.sourcePosition,e.targetPosition);const s=new pg(i,1,r,0);const a=s.getMovedRangeStart().path.slice();a.push(0);const c=new Qh(s.targetPosition.root,a);o=o._getTransformedByMove(i,r,1);const l=new pg(o,t.howMany,c,0);n.push(s);n.push(l);return n}}else{if(e.howMany==1){if(!n.bWasUndone){return[new qg(0)]}else{e.sourcePosition=t.graveyardPosition.clone();e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t);return[e]}}}}const o=ef._createFromPositionAndShift(e.sourcePosition,e.howMany);const r=o._getTransformedByMergeOperation(t);e.sourcePosition=r.start;e.howMany=r.end.offset-r.start.offset;e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t);return[e]});px(kg,bg,(e,t)=>{e.position=e.position._getTransformedByInsertOperation(t);return[e]});px(kg,vg,(e,t)=>{if(e.position.isEqual(t.deletionPosition)){e.position=t.graveyardPosition.clone();e.position.stickiness=\"toNext\";return[e]}e.position=e.position._getTransformedByMergeOperation(t);return[e]});px(kg,pg,(e,t)=>{e.position=e.position._getTransformedByMoveOperation(t);return[e]});px(kg,kg,(e,t,n)=>{if(e.position.isEqual(t.position)){if(n.aIsStrong){e.oldName=t.newName}else{return[new qg(0)]}}return[e]});px(kg,yg,(e,t)=>{const n=e.position.path;const i=t.splitPosition.getParentPath();if(zs(n,i)==\"same\"&&!t.graveyardPosition){const t=new kg(e.position.getShiftedBy(1),e.oldName,e.newName,0);return[e,t]}e.position=e.position._getTransformedBySplitOperation(t);return[e]});px(_g,_g,(e,t,n)=>{if(e.root===t.root&&e.key===t.key){if(!n.aIsStrong||e.newValue===t.newValue){return[new qg(0)]}else{e.oldValue=t.newValue}}return[e]});px(yg,bg,(e,t)=>{if(e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset{if(!e.graveyardPosition&&!n.bWasUndone&&e.splitPosition.hasSameParentAs(t.sourcePosition)){const n=t.graveyardPosition.path.slice();n.push(0);const i=new Qh(t.graveyardPosition.root,n);const o=yg.getInsertionPosition(new Qh(t.graveyardPosition.root,n));const r=new yg(i,0,null,0);r.insertionPosition=o;e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t);e.insertionPosition=yg.getInsertionPosition(e.splitPosition);e.graveyardPosition=r.insertionPosition.clone();e.graveyardPosition.stickiness=\"toNext\";return[r,e]}if(e.splitPosition.hasSameParentAs(t.deletionPosition)&&!e.splitPosition.isAfter(t.deletionPosition)){e.howMany--}if(e.splitPosition.hasSameParentAs(t.targetPosition)){e.howMany+=t.howMany}e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t);e.insertionPosition=yg.getInsertionPosition(e.splitPosition);if(e.graveyardPosition){e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)}return[e]});px(yg,pg,(e,t,n)=>{const i=ef._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.graveyardPosition){const o=i.start.isEqual(e.graveyardPosition)||i.containsPosition(e.graveyardPosition);if(!n.bWasUndone&&o){const n=e.splitPosition._getTransformedByMoveOperation(t);const i=e.graveyardPosition._getTransformedByMoveOperation(t);const o=i.path.slice();o.push(0);const r=new Qh(i.root,o);const s=new pg(n,e.howMany,r,0);return[s]}e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(e.splitPosition)){const n=t.howMany-(e.splitPosition.offset-t.sourcePosition.offset);e.howMany-=n;if(e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset{if(e.splitPosition.isEqual(t.splitPosition)){if(!e.graveyardPosition&&!t.graveyardPosition){return[new qg(0)]}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){return[new qg(0)]}if(n.abRelation==\"splitBefore\"){e.howMany=0;e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t);return[e]}}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){const i=e.splitPosition.root.rootName==\"$graveyard\";const o=t.splitPosition.root.rootName==\"$graveyard\";const r=i&&!o;const s=o&&!i;const a=s||!r&&n.aIsStrong;if(a){const n=[];if(t.howMany){n.push(new pg(t.moveTargetPosition,t.howMany,t.splitPosition,0))}if(e.howMany){n.push(new pg(e.splitPosition,e.howMany,e.moveTargetPosition,0))}return n}else{return[new qg(0)]}}if(e.graveyardPosition){e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t)}if(e.splitPosition.isEqual(t.insertionPosition)&&n.abRelation==\"splitBefore\"){e.howMany++;return[e]}if(t.splitPosition.isEqual(e.insertionPosition)&&n.baRelation==\"splitBefore\"){const n=t.insertionPosition.path.slice();n.push(0);const i=new Qh(t.insertionPosition.root,n);const o=new pg(e.insertionPosition,1,i,0);return[e,o]}if(e.splitPosition.hasSameParentAs(t.splitPosition)&&e.splitPosition.offsetthis.clearStack())}refresh(){this.isEnabled=this._stack.length>0}addBatch(e){const t=this.editor.model.document.selection;const n={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:n});this.refresh()}clearStack(){this._stack=[];this.refresh()}_restoreSelection(e,t,n){const i=this.editor.model;const o=i.document;const r=[];const s=e.map(e=>e.getTransformedByOperations(n));const a=s.flat();for(const e of s){const t=e.filter(e=>!Mx(e,a));Ex(t);const n=t.find(e=>e.root!=o.graveyard);if(n){r.push(n)}}if(r.length){i.change(e=>{e.setSelection(r,{backward:t})})}}_undo(e,t){const n=this.editor.model;const i=n.document;this._createdBatches.add(t);const o=e.operations.slice().filter(e=>e.isDocumentOperation);o.reverse();for(const e of o){const o=e.baseVersion+1;const r=Array.from(i.history.getOperations(o));const s=_x([e.getReversed()],r,{useRelations:true,document:this.editor.model.document,padWithNoOps:false,forceWeakRemove:true});const a=s.operationsA;for(const o of a){t.addOperation(o);n.applyOperation(o);i.history.setOperationAsUndone(e,o)}}}}function Ex(e){e.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let t=1;tt!==e&&t.containsRange(e,true))}class Ix extends Px{execute(e=null){const t=e?this._stack.findIndex(t=>t.batch==e):this._stack.length-1;const n=this._stack.splice(t,1)[0];const i=this.editor.model.createBatch(\"transparent\");this.editor.model.enqueueChange(i,()=>{this._undo(n.batch,i);const e=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,e);this.fire(\"revert\",n.batch,i)});this.refresh()}}class Nx extends Px{execute(){const e=this._stack.pop();const t=this.editor.model.createBatch(\"transparent\");this.editor.model.enqueueChange(t,()=>{const n=e.batch.operations[e.batch.operations.length-1];const i=n.baseVersion+1;const o=this.editor.model.document.history.getOperations(i);this._restoreSelection(e.selection.ranges,e.selection.isBackward,o);this._undo(e.batch,t)});this.refresh()}}class Rx extends sk{static get pluginName(){return\"UndoEditing\"}constructor(e){super(e);this._batchRegistry=new WeakSet}init(){const e=this.editor;this._undoCommand=new Ix(e);this._redoCommand=new Nx(e);e.commands.add(\"undo\",this._undoCommand);e.commands.add(\"redo\",this._redoCommand);this.listenTo(e.model,\"applyOperation\",(e,t)=>{const n=t[0];if(!n.isDocumentOperation){return}const i=n.batch;const o=this._redoCommand._createdBatches.has(i);const r=this._undoCommand._createdBatches.has(i);const s=this._batchRegistry.has(i);if(s||i.type==\"transparent\"&&!o&&!r){return}else{if(o){this._undoCommand.addBatch(i)}else if(!r){this._undoCommand.addBatch(i);this._redoCommand.clearStack()}}this._batchRegistry.add(i)},{priority:\"highest\"});this.listenTo(this._undoCommand,\"revert\",(e,t,n)=>{this._redoCommand.addBatch(n)});e.keystrokes.set(\"CTRL+Z\",\"undo\");e.keystrokes.set(\"CTRL+Y\",\"redo\");e.keystrokes.set(\"CTRL+SHIFT+Z\",\"redo\")}}var Ox='';var zx='';class Vx extends sk{init(){const e=this.editor;const t=e.locale;const n=e.t;const i=t.uiLanguageDirection==\"ltr\"?Ox:zx;const o=t.uiLanguageDirection==\"ltr\"?zx:Ox;this._addButton(\"undo\",n(\"Undo\"),\"CTRL+Z\",i);this._addButton(\"redo\",n(\"Redo\"),\"CTRL+Y\",o)}_addButton(e,t,n,i){const o=this.editor;o.ui.componentFactory.add(e,r=>{const s=o.commands.get(e);const a=new Aw(r);a.set({label:t,icon:i,keystroke:n,tooltip:true});a.bind(\"isEnabled\").to(s,\"isEnabled\");this.listenTo(a,\"execute\",()=>{o.execute(e);o.editing.view.focus()});return a})}}class Lx extends sk{static get requires(){return[Rx,Vx]}static get pluginName(){return\"Undo\"}}class Dx extends sk{static get requires(){return[gv,Jy,dx,ix,mx,Lx]}static get pluginName(){return\"Essentials\"}}const Bx=[\":root\",\"cssRules\",\"text\",\"join\",\"trim\",\"cssText\",\"indexOf\",\"then\",\"push\",\".ck-content\",\"all\",\"The editor stylesheet could not be found in the document. Check your webpack config – style-loader should use data-cke=true attribute for the editor stylesheet.\",\"hasAttribute\",\"data-cke\",\"length\"];(function(e,t){const n=function(t){while(--t){e[\"push\"](e[\"shift\"]())}};n(++t)})(Bx,244);const jx=function(e,t){e=e-0;let n=Bx[e];return n};function Fx(e){if(!e)return new Promise(e=>e(\"\"));const t=[];for(const n of e)\"EDITOR_STYLES\"!==n?t[jx(\"0x4\")](window[\"fetch\"](n)[jx(\"0x3\")](e=>e[jx(\"0xd\")]())):t[jx(\"0x4\")](Hx());return Promise[jx(\"0x6\")](t)[\"then\"](e=>e[\"join\"](\" \")[jx(\"0x0\")]())}function Hx(){const e=[],t=[];for(const n of document[\"styleSheets\"])if(n[\"ownerNode\"][jx(\"0x8\")](jx(\"0x9\")))for(const i of n[jx(\"0xc\")])-1!==i[\"cssText\"][\"indexOf\"](jx(\"0x5\"))?e[jx(\"0x4\")](i[\"cssText\"]):-1!==i[jx(\"0x1\")][jx(\"0x2\")](jx(\"0xb\"))&&t[\"push\"](i[jx(\"0x1\")]);return e[jx(\"0xa\")]||console[\"warn\"](jx(\"0x7\")),[...t,...e][jx(\"0xe\")](\" \")[\"trim\"]()}class Wx extends vk{constructor(e){super(e),this[\"set\"](\"isBusy\",!1)}[\"refresh\"](){this[\"isEnabled\"]=!this[\"isBusy\"],this[\"value\"]=this[\"isBusy\"]?\"pending\":void 0}[\"execute\"](e={}){const t=this[\"editor\"],n=t[\"t\"],i=e[\"converterUrl\"]||\"https://pdf-converter.cke-cs.com/v1/convert/\";return this[\"isBusy\"]=!0,this[\"refresh\"](),Fx(e[\"stylesheets\"]||[\"EDITOR_STYLES\"])[\"then\"](n=>{const o={html:'\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t
\\n\\t\\t\\t\\t\\t\\t\\t\\t'+t[\"getData\"]()+\"\\n\\t\\t\\t\\t\\t\\t\\t
\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\",css:n,options:e[\"converterOptions\"]},r={method:\"POST\",headers:{\"Content-Type\":\"application/json\",Accept:\"application/pdf\",\"x-cs-app-id\":e[\"appID\"]||\"cke5\"},body:JSON[\"stringify\"](o)};return window[\"fetch\"](i,r)[\"then\"](e=>{if(200!==e[\"status\"])throw e;return e[\"blob\"]()})[\"then\"](t=>{this[\"o\"](t,e[\"fileName\"]||\"document.pdf\")})})[\"catch\"](e=>{throw t[\"plugins\"][\"get\"](\"Notification\")[\"showWarning\"](n(\"An error occurred while generating the PDF.\")),e})[\"finally\"](()=>{this[\"isBusy\"]=!1,this[\"refresh\"]()})}[\"o\"](e,t){const n=document[\"createElement\"](\"a\");n[\"href\"]=window[\"URL\"][\"createObjectURL\"](e),n[\"download\"]=t,n[\"click\"](),n[\"remove\"]()}}var Ux='\\n';var qx=n(51);class $x extends sk{static get[\"pluginName\"](){return\"ExportPdf\"}static get[\"requires\"](){return[Py]}[\"init\"](){const e=this[\"editor\"],t=e[\"t\"],n=e[\"config\"][\"get\"](\"exportPdf\")||{};e[\"commands\"][\"add\"](\"exportPdf\",new Wx(e)),e[\"ui\"][\"componentFactory\"][\"add\"](\"exportPdf\",i=>{const o=e[\"commands\"][\"get\"](\"exportPdf\"),r=new Aw(i);r[\"set\"]({label:t(\"Export to PDF\"),icon:Ux,tooltip:!0}),r[\"bind\"](\"isOn\",\"isEnabled\")[\"to\"](o,\"isBusy\",\"isEnabled\"),r[\"extendTemplate\"]({attributes:{class:[r[\"bindTemplate\"][\"if\"](\"isOn\",\"ck-exportpdf_status-pending\")]}});const s=new Bb;return s[\"setTemplate\"]({tag:\"span\",attributes:{class:[\"ck\",\"ck-exportpdf__spinner-container\"]},children:[{tag:\"span\",attributes:{class:[\"ck\",\"ck-exportpdf__spinner\"]}}]}),r[\"children\"][\"add\"](s),this[\"listenTo\"](r,\"execute\",()=>{e[\"execute\"](\"exportPdf\",n),e[\"editing\"][\"view\"][\"focus\"]()}),r})}}class Yx extends vk{constructor(e,t){super(e);this.attributeKey=t}refresh(){const e=this.editor.model;const t=e.document;this.value=t.selection.getAttribute(this.attributeKey);this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model;const n=t.document;const i=n.selection;const o=e.value;t.change(e=>{if(i.isCollapsed){if(o){e.setSelectionAttribute(this.attributeKey,o)}else{e.removeSelectionAttribute(this.attributeKey)}}else{const n=t.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const t of n){if(o){e.setAttribute(this.attributeKey,o,t)}else{e.removeAttribute(this.attributeKey,t)}}}})}}var Gx='';class Kx extends Aw{constructor(e){super(e);const t=this.bindTemplate;this.set(\"color\");this.set(\"hasBorder\");this.icon=Gx;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%)\"}}var Qx=n(53);class Jx extends Bb{constructor(e,t){super(e);const n=t&&t.colorDefinitions||[];const i={};if(t&&t.columns){i.gridTemplateColumns=`repeat( ${t.columns}, 1fr)`}this.set(\"selectedColor\");this.items=this.createCollection();this.focusTracker=new Yp;this.keystrokes=new Op;this._focusCycler=new nw({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:\"arrowleft\",focusNext:\"arrowright\"}});this.items.on(\"add\",(e,t)=>{t.isOn=t.color===this.selectedColor});n.forEach(e=>{const t=new Kx;t.set({color:e.color,label:e.label,tooltip:true,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:i}});this.on(\"change:selectedColor\",(e,t,n)=>{for(const e of this.items){e.isOn=e.color===n}})}focus(){if(this.items.length){this.items.first.focus()}}focusLast(){if(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)}}class Zx extends xs{constructor(e){super(e);this.set(\"isEmpty\",true);this.on(\"change\",()=>{this.set(\"isEmpty\",this.length===0)})}add(e,t){if(this.find(t=>t.color===e.color)){return}super.add(e,t)}hasColor(e){return!!this.find(t=>t.color===e)}}ys(Zx,Qc);var Xx='';var eC=n(55);class tC extends Bb{constructor(e,{colors:t,columns:n,removeButtonLabel:i,documentColorsLabel:o,documentColorsCount:r}){super(e);this.items=this.createCollection();this.colorDefinitions=t;this.focusTracker=new Yp;this.keystrokes=new Op;this.set(\"selectedColor\");this.removeButtonLabel=i;this.columns=n;this.documentColors=new Zx;this.documentColorsCount=r;this._focusCycler=new nw({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:\"arrowup\",focusNext:\"arrowdown\"}});this._documentColorsLabel=o;this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-color-table\"]},children:this.items});this.items.add(this._removeColorButton())}updateDocumentColors(e,t){const n=e.document;const i=this.documentColorsCount;this.documentColors.clear();for(const o of n.getRootNames()){const r=n.getRoot(o);const s=e.createRangeIn(r);for(const e of s.getItems()){if(e.is(\"$textProxy\")&&e.hasAttribute(t)){this._addColorToDocumentColors(e.getAttribute(t));if(this.documentColors.length>=i){return}}}}}updateSelectedColors(){const e=this.documentColorsGrid;const t=this.staticColorsGrid;const n=this.selectedColor;t.selectedColor=n;if(e){e.selectedColor=n}}render(){super.render();for(const e of this.items){this.focusTracker.add(e.element)}this.keystrokes.listenTo(this.element)}appendGrids(){if(this.staticColorsGrid){return}this.staticColorsGrid=this._createStaticColorsGrid();this.items.add(this.staticColorsGrid);if(this.documentColorsCount){const e=hb.bind(this.documentColors,this.documentColors);const t=new Gb(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 Aw;e.set({withText:true,icon:Xx,tooltip:true,label:this.removeButtonLabel});e.class=\"ck-color-table__remove-color\";e.on(\"execute\",()=>{this.fire(\"execute\",{value:null})});return e}_createStaticColorsGrid(){const e=new Jx(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});e.delegate(\"execute\").to(this);return e}_createDocumentColorsGrid(){const e=hb.bind(this.documentColors,this.documentColors);const t=new Jx(this.locale,{columns:this.columns});t.delegate(\"execute\").to(this);t.extendTemplate({attributes:{class:e.if(\"isEmpty\",\"ck-hidden\")}});t.items.bindTo(this.documentColors).using(e=>{const t=new Kx;t.set({color:e.color,hasBorder:e.options&&e.options.hasBorder});if(e.label){t.set({label:e.label,tooltip:true})}t.on(\"execute\",()=>{this.fire(\"execute\",{value:e.color})});return t});this.documentColors.on(\"change:isEmpty\",(e,n,i)=>{if(i){t.selectedColor=null}});return t}_addColorToDocumentColors(e){const t=this.colorDefinitions.find(t=>t.color===e);if(!t){this.documentColors.add({color:e,label:e,options:{hasBorder:false}})}else{this.documentColors.add(Object.assign({},t))}}}const nC=\"fontSize\";const iC=\"fontFamily\";const oC=\"fontColor\";const rC=\"fontBackgroundColor\";function sC(e,t){const n={model:{key:e,values:[]},view:{},upcastAlso:{}};for(const e of t){n.model.values.push(e.model);n.view[e.model]=e.view;if(e.upcastAlso){n.upcastAlso[e.model]=e.upcastAlso}}return n}function aC(e){return t=>dC(t.getStyle(e))}function cC(e){return(t,n)=>n.createAttributeElement(\"span\",{style:`${e}:${t}`},{priority:7})}function lC({dropdownView:e,colors:t,columns:n,removeButtonLabel:i,documentColorsLabel:o,documentColorsCount:r}){const s=e.locale;const a=new tC(s,{colors:t,columns:n,removeButtonLabel:i,documentColorsLabel:o,documentColorsCount:r});e.colorTableView=a;e.panelView.children.add(a);a.delegate(\"execute\").to(e,\"execute\");return a}function dC(e){return e.replace(/\\s/g,\"\")}class uC extends Yx{constructor(e){super(e,rC)}}const hC=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;const fC=/^rgb\\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\\)$/i;const mC=/^rgba\\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\\.?[0-9]+)\\)$/i;const gC=/^hsl\\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\\.?[0-9]+)?\\)$/i;const pC=/^hsla\\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\\.?[0-9]+)\\)$/i;const bC=new Set([\"black\",\"silver\",\"gray\",\"white\",\"maroon\",\"red\",\"purple\",\"fuchsia\",\"green\",\"lime\",\"olive\",\"yellow\",\"navy\",\"blue\",\"teal\",\"aqua\",\"orange\",\"aliceblue\",\"antiquewhite\",\"aquamarine\",\"azure\",\"beige\",\"bisque\",\"blanchedalmond\",\"blueviolet\",\"brown\",\"burlywood\",\"cadetblue\",\"chartreuse\",\"chocolate\",\"coral\",\"cornflowerblue\",\"cornsilk\",\"crimson\",\"cyan\",\"darkblue\",\"darkcyan\",\"darkgoldenrod\",\"darkgray\",\"darkgreen\",\"darkgrey\",\"darkkhaki\",\"darkmagenta\",\"darkolivegreen\",\"darkorange\",\"darkorchid\",\"darkred\",\"darksalmon\",\"darkseagreen\",\"darkslateblue\",\"darkslategray\",\"darkslategrey\",\"darkturquoise\",\"darkviolet\",\"deeppink\",\"deepskyblue\",\"dimgray\",\"dimgrey\",\"dodgerblue\",\"firebrick\",\"floralwhite\",\"forestgreen\",\"gainsboro\",\"ghostwhite\",\"gold\",\"goldenrod\",\"greenyellow\",\"grey\",\"honeydew\",\"hotpink\",\"indianred\",\"indigo\",\"ivory\",\"khaki\",\"lavender\",\"lavenderblush\",\"lawngreen\",\"lemonchiffon\",\"lightblue\",\"lightcoral\",\"lightcyan\",\"lightgoldenrodyellow\",\"lightgray\",\"lightgreen\",\"lightgrey\",\"lightpink\",\"lightsalmon\",\"lightseagreen\",\"lightskyblue\",\"lightslategray\",\"lightslategrey\",\"lightsteelblue\",\"lightyellow\",\"limegreen\",\"linen\",\"magenta\",\"mediumaquamarine\",\"mediumblue\",\"mediumorchid\",\"mediumpurple\",\"mediumseagreen\",\"mediumslateblue\",\"mediumspringgreen\",\"mediumturquoise\",\"mediumvioletred\",\"midnightblue\",\"mintcream\",\"mistyrose\",\"moccasin\",\"navajowhite\",\"oldlace\",\"olivedrab\",\"orangered\",\"orchid\",\"palegoldenrod\",\"palegreen\",\"paleturquoise\",\"palevioletred\",\"papayawhip\",\"peachpuff\",\"peru\",\"pink\",\"plum\",\"powderblue\",\"rosybrown\",\"royalblue\",\"saddlebrown\",\"salmon\",\"sandybrown\",\"seagreen\",\"seashell\",\"sienna\",\"skyblue\",\"slateblue\",\"slategray\",\"slategrey\",\"snow\",\"springgreen\",\"steelblue\",\"tan\",\"thistle\",\"tomato\",\"turquoise\",\"violet\",\"wheat\",\"whitesmoke\",\"yellowgreen\",\"rebeccapurple\",\"currentcolor\",\"transparent\"]);function wC(e){if(e.startsWith(\"#\")){return hC.test(e)}if(e.startsWith(\"rgb\")){return fC.test(e)||mC.test(e)}if(e.startsWith(\"hsl\")){return gC.test(e)||pC.test(e)}return bC.has(e.toLowerCase())}const kC=[\"none\",\"hidden\",\"dotted\",\"dashed\",\"solid\",\"double\",\"groove\",\"ridge\",\"inset\",\"outset\"];function _C(e){return kC.includes(e)}const vC=/^([+-]?[0-9]*[.]?[0-9]+(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;function yC(e){return vC.test(e)}const xC=/^[+-]?[0-9]*[.]?[0-9]+%$/;function CC(e){return xC.test(e)}const AC=[\"repeat-x\",\"repeat-y\",\"repeat\",\"space\",\"round\",\"no-repeat\"];function TC(e){return AC.includes(e)}const SC=[\"center\",\"top\",\"bottom\",\"left\",\"right\"];function PC(e){return SC.includes(e)}const EC=[\"fixed\",\"scroll\",\"local\"];function MC(e){return EC.includes(e)}const IC=/^url\\(/;function NC(e){return IC.test(e)}function RC(e=\"\"){if(e===\"\"){return{top:undefined,right:undefined,bottom:undefined,left:undefined}}const t=LC(e);const n=t[0];const i=t[2]||n;const o=t[1]||n;const r=t[3]||o;return{top:n,bottom:i,right:o,left:r}}function OC(e){return t=>{const{top:n,right:i,bottom:o,left:r}=t;const s=[];if(![n,i,r,o].every(e=>!!e)){if(n){s.push([e+\"-top\",n])}if(i){s.push([e+\"-right\",i])}if(o){s.push([e+\"-bottom\",o])}if(r){s.push([e+\"-left\",r])}}else{s.push([e,zC(t)])}return s}}function zC({top:e,right:t,bottom:n,left:i}){const o=[];if(i!==t){o.push(e,t,n,i)}else if(n!==e){o.push(e,t,n)}else if(t!==e){o.push(e,t)}else{o.push(e)}return o.join(\" \")}function VC(e){return t=>({path:e,value:RC(t)})}function LC(e){return e.replace(/, /g,\",\").split(\" \").map(e=>e.replace(/,/g,\", \"))}function DC(e){e.setNormalizer(\"background\",BC);e.setNormalizer(\"background-color\",e=>({path:\"background.color\",value:e}));e.setReducer(\"background\",e=>{const t=[];t.push([\"background-color\",e.color]);return t})}function BC(e){const t={};const n=LC(e);for(const e of n){if(TC(e)){t.repeat=t.repeat||[];t.repeat.push(e)}else if(PC(e)){t.position=t.position||[];t.position.push(e)}else if(MC(e)){t.attachment=e}else if(wC(e)){t.color=e}else if(NC(e)){t.image=e}}return{path:\"background\",value:t}}class jC extends sk{static get pluginName(){return\"FontBackgroundColorEditing\"}constructor(e){super(e);e.config.define(rC,{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:true},{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(DC);e.conversion.for(\"upcast\").elementToAttribute({view:{name:\"span\",styles:{\"background-color\":/[\\s\\S]+/}},model:{key:rC,value:aC(\"background-color\")}});e.conversion.for(\"downcast\").attributeToElement({model:rC,view:cC(\"background-color\")});e.commands.add(rC,new uC(e));e.model.schema.extend(\"$text\",{allowAttributes:rC});e.model.schema.setAttributeProperties(rC,{isFormatting:true,copyOnEnter:true})}}function FC(e,t){const n=e.t;const i={Black:n(\"Black\"),\"Dim grey\":n(\"Dim grey\"),Grey:n(\"Grey\"),\"Light grey\":n(\"Light grey\"),White:n(\"White\"),Red:n(\"Red\"),Orange:n(\"Orange\"),Yellow:n(\"Yellow\"),\"Light green\":n(\"Light green\"),Green:n(\"Green\"),Aquamarine:n(\"Aquamarine\"),Turquoise:n(\"Turquoise\"),\"Light blue\":n(\"Light blue\"),Blue:n(\"Blue\"),Purple:n(\"Purple\")};return t.map(e=>{const t=i[e.label];if(t&&t!=e.label){e.label=t}return e})}function HC(e){return e.map(WC).filter(e=>!!e)}function WC(e){if(typeof e===\"string\"){return{model:e,label:e,hasBorder:false,view:{name:\"span\",styles:{color:e}}}}else{return{model:e.color,label:e.label||e.color,hasBorder:e.hasBorder===undefined?false:e.hasBorder,view:{name:\"span\",styles:{color:`${e.color}`}}}}}class UC extends sk{constructor(e,{commandName:t,icon:n,componentName:i,dropdownLabel:o}){super(e);this.commandName=t;this.componentName=i;this.icon=n;this.dropdownLabel=o;this.columns=e.config.get(`${this.componentName}.columns`);this.colorTableView}init(){const e=this.editor;const t=e.locale;const n=t.t;const i=e.commands.get(this.commandName);const o=HC(e.config.get(this.componentName).colors);const r=FC(t,o);const s=e.config.get(`${this.componentName}.documentColors`);e.ui.componentFactory.add(this.componentName,t=>{const o=Lw(t);this.colorTableView=lC({dropdownView:o,colors:r.map(e=>({label:e.label,color:e.model,options:{hasBorder:e.hasBorder}})),columns:this.columns,removeButtonLabel:n(\"Remove color\"),documentColorsLabel:s!==0?n(\"Document colors\"):undefined,documentColorsCount:s===undefined?this.columns:s});this.colorTableView.bind(\"selectedColor\").to(i,\"value\");o.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:true});o.extendTemplate({attributes:{class:\"ck-color-ui-dropdown\"}});o.bind(\"isEnabled\").to(i);o.on(\"execute\",(t,n)=>{e.execute(this.commandName,n);e.editing.view.focus()});o.on(\"change:isOpen\",(t,n,i)=>{o.colorTableView.appendGrids();if(i){if(s!==0){this.colorTableView.updateDocumentColors(e.model,this.componentName)}this.colorTableView.updateSelectedColors()}});return o})}}var qC='';class $C extends UC{constructor(e){const t=e.locale.t;super(e,{commandName:rC,componentName:rC,icon:qC,dropdownLabel:t(\"Font Background Color\")})}static get pluginName(){return\"FontBackgroundColorUI\"}}class YC extends sk{static get requires(){return[jC,$C]}static get pluginName(){return\"FontBackgroundColor\"}}class GC extends Yx{constructor(e){super(e,oC)}}class KC extends sk{static get pluginName(){return\"FontColorEditing\"}constructor(e){super(e);e.config.define(oC,{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:true},{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:oC,value:aC(\"color\")}});e.conversion.for(\"downcast\").attributeToElement({model:oC,view:cC(\"color\")});e.commands.add(oC,new GC(e));e.model.schema.extend(\"$text\",{allowAttributes:oC});e.model.schema.setAttributeProperties(oC,{isFormatting:true,copyOnEnter:true})}}var QC='';class JC extends UC{constructor(e){const t=e.locale.t;super(e,{commandName:oC,componentName:oC,icon:QC,dropdownLabel:t(\"Font Color\")})}static get pluginName(){return\"FontColorUI\"}}class ZC extends sk{static get requires(){return[KC,JC]}static get pluginName(){return\"FontColor\"}}class XC extends Yx{constructor(e){super(e,nC)}}function eA(e){return e.map(e=>nA(e)).filter(e=>!!e)}const tA={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 nA(e){if(sA(e)){return oA(e)}const t=rA(e);if(t){return oA(t)}if(e===\"default\"){return{model:undefined,title:\"Default\"}}if(aA(e)){return}return iA(e)}function iA(e){if(typeof e===\"number\"||typeof e===\"string\"){e={title:String(e),model:`${parseFloat(e)}px`}}e.view={name:\"span\",styles:{\"font-size\":e.model}};return oA(e)}function oA(e){if(!e.view.priority){e.view.priority=7}return e}function rA(e){return tA[e]||tA[e.model]}function sA(e){return typeof e===\"object\"&&e.title&&e.model&&e.view}function aA(e){let t;if(typeof e===\"object\"){if(!e.model){throw new ss[\"b\"](\"font-size-invalid-definition: Provided font size definition is invalid.\",null,e)}else{t=parseFloat(e.model)}}else{t=parseFloat(e)}return isNaN(t)}class cA extends sk{static get pluginName(){return\"FontSizeEditing\"}constructor(e){super(e);e.config.define(nC,{options:[\"tiny\",\"small\",\"default\",\"big\",\"huge\"],supportAllValues:false})}init(){const e=this.editor;e.model.schema.extend(\"$text\",{allowAttributes:nC});e.model.schema.setAttributeProperties(nC,{isFormatting:true,copyOnEnter:true});const t=e.config.get(\"fontSize.supportAllValues\");const n=eA(this.editor.config.get(\"fontSize.options\")).filter(e=>e.model);const i=sC(nC,n);if(t){this._prepareAnyValueConverters(i)}else{e.conversion.attributeToElement(i)}e.commands.add(nC,new XC(e))}_prepareAnyValueConverters(e){const t=this.editor;const n=e.model.values.filter(e=>!String(e).match(/[\\d.]+[\\w%]+/));if(n.length){throw new ss[\"b\"](\"font-size-invalid-use-of-named-presets: \"+\"If config.fontSize.supportAllValues is set to true, you need to use numerical values as font size options.\",null,{presets:n})}t.conversion.for(\"downcast\").attributeToElement({model:nC,view:(e,t)=>{if(!e){return}return t.createAttributeElement(\"span\",{style:\"font-size:\"+e},{priority:7})}});t.conversion.for(\"upcast\").attributeToAttribute({model:{key:nC,value:e=>e.getStyle(\"font-size\")},view:{name:\"span\"}})}}class lA{constructor(e,t){if(t){qc(this,t)}if(e){this.set(e)}}}ys(lA,Qc);var dA='';var uA=n(57);class hA extends sk{init(){const e=this.editor;const t=e.t;const n=this._getLocalizedOptions();const i=e.commands.get(nC);e.ui.componentFactory.add(nC,o=>{const r=Lw(o);Bw(r,fA(n,i));r.buttonView.set({label:t(\"Font Size\"),icon:dA,tooltip:true});r.extendTemplate({attributes:{class:[\"ck-font-size-dropdown\"]}});r.bind(\"isEnabled\").to(i);this.listenTo(r,\"execute\",t=>{e.execute(t.source.commandName,{value:t.source.commandParam});e.editing.view.focus()});return r})}_getLocalizedOptions(){const e=this.editor;const t=e.t;const n={Default:t(\"Default\"),Tiny:t(\"Tiny\"),Small:t(\"Small\"),Big:t(\"Big\"),Huge:t(\"Huge\")};const i=eA(e.config.get(nC).options);return i.map(e=>{const t=n[e.title];if(t&&t!=e.title){e=Object.assign({},e,{title:t})}return e})}}function fA(e,t){const n=new xs;for(const i of e){const e={type:\"button\",model:new lA({commandName:nC,commandParam:i.model,label:i.title,class:\"ck-fontsize-option\",withText:true})};if(i.view&&i.view.styles){e.model.set(\"labelStyle\",`font-size:${i.view.styles[\"font-size\"]}`)}if(i.view&&i.view.classes){e.model.set(\"class\",`${e.model.class} ${i.view.classes}`)}e.model.bind(\"isOn\").to(t,\"value\",e=>e===i.model);n.add(e)}return n}class mA extends sk{static get requires(){return[cA,hA]}static get pluginName(){return\"FontSize\"}}class gA extends vk{refresh(){const e=this.editor.model;const t=e.document;const n=tk(t.selection.getSelectedBlocks());this.value=!!n&&n.is(\"element\",\"paragraph\");this.isEnabled=!!n&&pA(n,e.schema)}execute(e={}){const t=this.editor.model;const n=t.document;t.change(i=>{const o=(e.selection||n.selection).getSelectedBlocks();for(const e of o){if(!e.is(\"element\",\"paragraph\")&&pA(e,t.schema)){i.rename(e,\"paragraph\")}}})}}function pA(e,t){return t.checkChild(e.parent,\"paragraph\")&&!t.isObject(e)}class bA extends vk{execute(e){const t=this.editor.model;let n=e.position;t.change(e=>{const i=e.createElement(\"paragraph\");if(!t.schema.checkChild(n.parent,i)){const o=t.schema.findAllowedParent(n,i);if(!o){return}n=e.split(n,o).position}t.insertContent(i,n);e.setSelection(i,\"in\")})}}class wA extends sk{static get pluginName(){return\"Paragraph\"}init(){const e=this.editor;const t=e.model;const n=e.data;e.commands.add(\"paragraph\",new gA(e));e.commands.add(\"insertParagraph\",new bA(e));t.schema.register(\"paragraph\",{inheritAllFrom:\"$block\"});e.conversion.elementToElement({model:\"paragraph\",view:\"p\"});e.conversion.for(\"upcast\").elementToElement({model:(e,t)=>{if(!wA.paragraphLikeElements.has(e.name)){return null}if(e.isEmpty){return null}return t.createElement(\"paragraph\")},converterPriority:\"low\"});n.upcastDispatcher.on(\"element\",(e,t,n)=>{if(!n.consumable.test(t.viewItem,{name:t.viewItem.name})){return}if(_A(t.viewItem,t.modelCursor,n.schema)){Object.assign(t,kA(t.viewItem,t.modelCursor,n))}},{priority:\"low\"});n.upcastDispatcher.on(\"text\",(e,t,n)=>{if(t.modelRange){return}if(_A(t.viewItem,t.modelCursor,n.schema)){Object.assign(t,kA(t.viewItem,t.modelCursor,n))}},{priority:\"lowest\"});t.document.registerPostFixer(e=>this._autoparagraphEmptyRoots(e));e.data.on(\"ready\",()=>{t.enqueueChange(\"transparent\",e=>this._autoparagraphEmptyRoots(e))},{priority:\"lowest\"})}_autoparagraphEmptyRoots(e){const t=this.editor.model;for(const n of t.document.getRootNames()){const i=t.document.getRoot(n);if(i.isEmpty&&i.rootName!=\"$graveyard\"){if(t.schema.checkChild(i,\"paragraph\")){e.insertElement(\"paragraph\",i);return true}}}}}wA.paragraphLikeElements=new Set([\"blockquote\",\"dd\",\"div\",\"dt\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"li\",\"p\",\"td\"]);function kA(e,t,n){const i=n.writer.createElement(\"paragraph\");n.writer.insert(i,t);return n.convertItem(e,n.writer.createPositionAt(i,0))}function _A(e,t,n){const i=n.createContext(t);if(!n.checkChild(i,\"paragraph\")){return false}if(!n.checkChild(i.push(\"paragraph\"),e)){return false}return true}class vA extends vk{constructor(e,t){super(e);this.modelElements=t}refresh(){const e=tk(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name;this.isEnabled=!!e&&this.modelElements.some(t=>yA(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model;const n=t.document;const i=e.value;t.change(e=>{const o=Array.from(n.selection.getSelectedBlocks()).filter(e=>yA(e,i,t.schema));for(const t of o){if(!t.is(\"element\",i)){e.rename(t,i)}}})}}function yA(e,t,n){return n.checkChild(e.parent,t)&&!n.isObject(e)}const xA=\"paragraph\";class CA extends sk{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[wA]}init(){const e=this.editor;const t=e.config.get(\"heading.options\");const n=[];for(const i of t){if(i.model!==xA){e.model.schema.register(i.model,{inheritAllFrom:\"$block\"});e.conversion.elementToElement(i);n.push(i.model)}}this._addDefaultH1Conversion(e);e.commands.add(\"heading\",new vA(e,n))}afterInit(){const e=this.editor;const t=e.commands.get(\"enter\");const n=e.config.get(\"heading.options\");if(t){this.listenTo(t,\"afterExecute\",(t,i)=>{const o=e.model.document.selection.getFirstPosition().parent;const r=n.some(e=>o.is(\"element\",e.model));if(r&&!o.is(\"element\",xA)&&o.childCount===0){i.writer.rename(o,xA)}})}}_addDefaultH1Conversion(e){e.conversion.for(\"upcast\").elementToElement({model:\"heading1\",view:\"h1\",converterPriority:os.get(\"low\")+1})}}function AA(e){const t=e.t;const n={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=>{const t=n[e.title];if(t&&t!=e.title){e.title=t}return e})}var TA=n(11);class SA extends sk{init(){const e=this.editor;const t=e.t;const n=AA(e);const i=t(\"Choose heading\");const o=t(\"Heading\");e.ui.componentFactory.add(\"heading\",t=>{const r={};const s=new xs;const a=e.commands.get(\"heading\");const c=e.commands.get(\"paragraph\");const l=[a];for(const e of n){const t={type:\"button\",model:new lA({label:e.title,class:e.class,withText:true})};if(e.model===\"paragraph\"){t.model.bind(\"isOn\").to(c,\"value\");t.model.set(\"commandName\",\"paragraph\");l.push(c)}else{t.model.bind(\"isOn\").to(a,\"value\",t=>t===e.model);t.model.set({commandName:\"heading\",commandValue:e.model})}s.add(t);r[e.model]=e.title}const d=Lw(t);Bw(d,s);d.buttonView.set({isOn:false,withText:true,tooltip:o});d.extendTemplate({attributes:{class:[\"ck-heading-dropdown\"]}});d.bind(\"isEnabled\").toMany(l,\"isEnabled\",(...e)=>e.some(e=>e));d.buttonView.bind(\"label\").to(a,\"value\",c,\"value\",(e,t)=>{const n=e||t&&\"paragraph\";return r[n]?r[n]:i});this.listenTo(d,\"execute\",t=>{e.execute(t.source.commandName,t.source.commandValue?{value:t.source.commandValue}:undefined);e.editing.view.focus()});return d})}}class PA extends sk{static get requires(){return[CA,SA]}static get pluginName(){return\"Heading\"}}class EA extends vk{refresh(){const e=this.editor.model;const t=e.document;this.value=t.selection.getAttribute(\"highlight\");this.isEnabled=e.schema.checkAttributeInSelection(t.selection,\"highlight\")}execute(e={}){const t=this.editor.model;const n=t.document;const i=n.selection;const o=e.value;t.change(e=>{const n=t.schema.getValidRanges(i.getRanges(),\"highlight\");if(i.isCollapsed){const t=i.getFirstPosition();if(i.hasAttribute(\"highlight\")){const n=e=>e.item.hasAttribute(\"highlight\")&&e.item.getAttribute(\"highlight\")===this.value;const i=t.getLastMatchingPosition(n,{direction:\"backward\"});const r=t.getLastMatchingPosition(n);const s=e.createRange(i,r);if(!o||this.value===o){e.removeAttribute(\"highlight\",s);e.removeSelectionAttribute(\"highlight\")}else{e.setAttribute(\"highlight\",o,s);e.setSelectionAttribute(\"highlight\",o)}}else if(o){e.setSelectionAttribute(\"highlight\",o)}}else{for(const t of n){if(o){e.setAttribute(\"highlight\",o,t)}else{e.removeAttribute(\"highlight\",t)}}}})}}class MA extends sk{static get pluginName(){return\"HighlightEditing\"}constructor(e){super(e);e.config.define(\"highlight\",{options:[{model:\"yellowMarker\",class:\"marker-yellow\",title:\"Yellow marker\",color:\"var(--ck-highlight-marker-yellow)\",type:\"marker\"},{model:\"greenMarker\",class:\"marker-green\",title:\"Green marker\",color:\"var(--ck-highlight-marker-green)\",type:\"marker\"},{model:\"pinkMarker\",class:\"marker-pink\",title:\"Pink marker\",color:\"var(--ck-highlight-marker-pink)\",type:\"marker\"},{model:\"blueMarker\",class:\"marker-blue\",title:\"Blue marker\",color:\"var(--ck-highlight-marker-blue)\",type:\"marker\"},{model:\"redPen\",class:\"pen-red\",title:\"Red pen\",color:\"var(--ck-highlight-pen-red)\",type:\"pen\"},{model:\"greenPen\",class:\"pen-green\",title:\"Green pen\",color:\"var(--ck-highlight-pen-green)\",type:\"pen\"}]})}init(){const e=this.editor;e.model.schema.extend(\"$text\",{allowAttributes:\"highlight\"});const t=e.config.get(\"highlight.options\");e.conversion.attributeToElement(IA(t));e.commands.add(\"highlight\",new EA(e))}}function IA(e){const t={model:{key:\"highlight\",values:[]},view:{}};for(const n of e){t.model.values.push(n.model);t.view[n.model]={name:\"mark\",classes:n.class}}return t}var NA='';var RA='';var OA=n(60);class zA extends Bb{constructor(e){super(e);const t=this.bindTemplate;this.set(\"icon\");this.set(\"isEnabled\",true);this.set(\"isOn\",false);this.set(\"isToggleable\",false);this.set(\"isVisible\",true);this.set(\"keystroke\");this.set(\"label\");this.set(\"tabindex\",-1);this.set(\"tooltip\");this.set(\"tooltipPosition\",\"s\");this.set(\"type\",\"button\");this.set(\"withText\",false);this.children=this.createCollection();this.actionView=this._createActionView();this.arrowView=this._createArrowView();this.keystrokes=new Op;this.focusTracker=new Yp;this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-splitbutton\",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)=>{if(this.focusTracker.focusedElement===this.actionView.element){this.arrowView.focus();t()}});this.keystrokes.set(\"arrowleft\",(e,t)=>{if(this.focusTracker.focusedElement===this.arrowView.element){this.actionView.focus();t()}})}focus(){this.actionView.focus()}_createActionView(){const e=new Aw;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);return e}_createArrowView(){const e=new Aw;const t=e.bindTemplate;e.icon=Tw;e.extendTemplate({attributes:{class:\"ck-splitbutton__arrow\",\"aria-haspopup\":true,\"aria-expanded\":t.to(\"isOn\",e=>String(e))}});e.bind(\"isEnabled\").to(this);e.delegate(\"execute\").to(this,\"open\");return e}}var VA=n(62);class LA extends sk{get localizedOptionTitles(){const e=this.editor.t;return{\"Yellow marker\":e(\"Yellow marker\"),\"Green marker\":e(\"Green marker\"),\"Pink marker\":e(\"Pink marker\"),\"Blue marker\":e(\"Blue marker\"),\"Red pen\":e(\"Red pen\"),\"Green pen\":e(\"Green pen\")}}static get pluginName(){return\"HighlightUI\"}init(){const e=this.editor.config.get(\"highlight.options\");for(const t of e){this._addHighlighterButton(t)}this._addRemoveHighlightButton();this._addDropdown(e)}_addRemoveHighlightButton(){const e=this.editor.t;this._addButton(\"removeHighlight\",e(\"Remove highlight\"),Xx)}_addHighlighterButton(e){const t=this.editor.commands.get(\"highlight\");this._addButton(\"highlight:\"+e.model,e.title,BA(e.type),e.model,n);function n(n){n.bind(\"isEnabled\").to(t,\"isEnabled\");n.bind(\"isOn\").to(t,\"value\",t=>t===e.model);n.iconView.fillColor=e.color;n.isToggleable=true}}_addButton(e,t,n,i,o=(()=>{})){const r=this.editor;r.ui.componentFactory.add(e,e=>{const s=new Aw(e);const a=this.localizedOptionTitles[t]?this.localizedOptionTitles[t]:t;s.set({label:a,icon:n,tooltip:true});s.on(\"execute\",()=>{r.execute(\"highlight\",{value:i});r.editing.view.focus()});o(s);return s})}_addDropdown(e){const t=this.editor;const n=t.t;const i=t.ui.componentFactory;const o=e[0];const r=e.reduce((e,t)=>{e[t.model]=t;return e},{});i.add(\"highlight\",s=>{const a=t.commands.get(\"highlight\");const c=Lw(s,zA);const l=c.buttonView;l.set({tooltip:n(\"Highlight\"),lastExecuted:o.model,commandValue:o.model,isToggleable:true});l.bind(\"icon\").to(a,\"value\",e=>BA(u(e,\"type\")));l.bind(\"color\").to(a,\"value\",e=>u(e,\"color\"));l.bind(\"commandValue\").to(a,\"value\",e=>u(e,\"model\"));l.bind(\"isOn\").to(a,\"value\",e=>!!e);l.delegate(\"execute\").to(c);const d=e.map(e=>{const t=i.create(\"highlight:\"+e.model);this.listenTo(t,\"execute\",()=>c.buttonView.set({lastExecuted:e.model}));return t});c.bind(\"isEnabled\").toMany(d,\"isEnabled\",(...e)=>e.some(e=>e));d.push(new ow);d.push(i.create(\"removeHighlight\"));Dw(c,d);DA(c);c.toolbarView.ariaLabel=n(\"Text highlight toolbar\");l.on(\"execute\",()=>{t.execute(\"highlight\",{value:l.commandValue});t.editing.view.focus()});function u(e,t){const n=!e||e===l.lastExecuted?l.lastExecuted:e;return r[n][t]}return c})}}function DA(e){const t=e.buttonView.actionView;t.iconView.bind(\"fillColor\").to(e.buttonView,\"color\")}function BA(e){return e===\"marker\"?NA:RA}class jA extends sk{static get requires(){return[MA,LA]}static get pluginName(){return\"Highlight\"}}class FA extends vk{refresh(){this.isEnabled=HA(this.editor.model)}execute(){const e=this.editor.model;e.change(t=>{const n=t.createElement(\"horizontalLine\");e.insertContent(n);let i=n.nextSibling;const o=i&&e.schema.checkChild(i,\"$text\");if(!o&&e.schema.checkChild(n.parent,\"paragraph\")){i=t.createElement(\"paragraph\");e.insertContent(i,t.createPositionAfter(n))}if(i){t.setSelection(i,0)}})}}function HA(e){const t=e.schema;const n=e.document.selection;return WA(n,t,e)&&!UA(n,t)}function WA(e,t,n){const i=qA(e,n);return t.checkChild(i,\"horizontalLine\")}function UA(e,t){const n=e.getSelectedElement();return n&&t.isObject(n)}function qA(e,t){const n=m_(e,t);const i=n.parent;if(i.isEmpty&&!i.is(\"element\",\"$root\")){return i.parent}return i}var $A=n(64);class YA extends sk{static get pluginName(){return\"HorizontalLineEditing\"}init(){const e=this.editor;const t=e.model.schema;const n=e.t;const i=e.conversion;t.register(\"horizontalLine\",{isObject:true,allowWhere:\"$block\"});i.for(\"dataDowncast\").elementToElement({model:\"horizontalLine\",view:(e,t)=>t.createEmptyElement(\"hr\")});i.for(\"editingDowncast\").elementToElement({model:\"horizontalLine\",view:(e,t)=>{const i=n(\"Horizontal line\");const o=t.createContainerElement(\"div\");const r=t.createEmptyElement(\"hr\");t.addClass(\"ck-horizontal-line\",o);t.setCustomProperty(\"hr\",true,o);t.insert(t.createPositionAt(o,0),r);return GA(o,t,i)}});i.for(\"upcast\").elementToElement({view:\"hr\",model:\"horizontalLine\"});e.commands.add(\"horizontalLine\",new FA(e))}}function GA(e,t,n){t.setCustomProperty(\"horizontalLine\",true,e);return l_(e,t,{label:n})}var KA='';class QA extends sk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(\"horizontalLine\",n=>{const i=e.commands.get(\"horizontalLine\");const o=new Aw(n);o.set({label:t(\"Horizontal line\"),icon:KA,tooltip:true});o.bind(\"isEnabled\").to(i,\"isEnabled\");this.listenTo(o,\"execute\",()=>{e.execute(\"horizontalLine\");e.editing.view.focus()});return o})}}class JA extends sk{static get requires(){return[YA,QA]}static get pluginName(){return\"HorizontalLine\"}}var ZA='\\n';var XA=n(66);const eT=[\"before\",\"after\"];const tT=(new DOMParser).parseFromString(ZA,\"image/svg+xml\").firstChild;const nT=\"ck-widget__type-around_disabled\";class iT extends sk{static get pluginName(){return\"WidgetTypeAround\"}constructor(e){super(e);this._currentFakeCaretModelElement=null}init(){const e=this.editor;const t=e.editing.view;this.on(\"change:isEnabled\",(n,i,o)=>{t.change(e=>{for(const n of t.document.roots){if(o){e.removeClass(nT,n)}else{e.addClass(nT,n)}}});if(!o){e.model.change(e=>{e.removeSelectionAttribute(e_)})}});this._enableTypeAroundUIInjection();this._enableInsertingParagraphsOnButtonClick();this._enableInsertingParagraphsOnEnterKeypress();this._enableInsertingParagraphsOnTypingKeystroke();this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows();this._enableDeleteIntegration();this._enableInsertContentIntegration()}destroy(){this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const n=this.editor;const i=n.editing.view;n.execute(\"insertParagraph\",{position:n.model.createPositionAt(e,t)});i.focus();i.scrollToTheSelection()}_listenToIfEnabled(e,t,n,i){this.listenTo(e,t,(...e)=>{if(this.isEnabled){n(...e)}},i)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor;const t=e.model;const n=t.document.selection;const i=r_(n);if(!i){return false}const o=n.getSelectedElement();this._insertParagraph(o,i);return true}_enableTypeAroundUIInjection(){const e=this.editor;const t=e.model.schema;const n=e.locale.t;const i={before:n(\"Insert paragraph before block\"),after:n(\"Insert paragraph after block\")};e.editing.downcastDispatcher.on(\"insert\",(e,n,o)=>{const r=o.mapper.toViewElement(n.item);if(t_(r,n.item,t)){oT(o.writer,i,r)}},{priority:\"low\"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor;const t=e.model;const n=t.document.selection;const i=t.schema;const o=e.editing.view;this._listenToIfEnabled(o.document,\"keydown\",(e,t)=>{if(Dl(t.keyCode)){this._handleArrowKeyPress(e,t)}},{priority:os.get(\"high\")+10});this._listenToIfEnabled(n,\"change:range\",(t,n)=>{if(!n.directChange){return}e.model.change(e=>{e.removeSelectionAttribute(e_)})});this._listenToIfEnabled(t.document,\"change:data\",()=>{const t=n.getSelectedElement();if(t){const n=e.editing.mapper.toViewElement(t);if(t_(n,t,i)){return}}e.model.change(e=>{e.removeSelectionAttribute(e_)})});this._listenToIfEnabled(e.editing.downcastDispatcher,\"selection\",(e,t,n)=>{const o=n.writer;if(this._currentFakeCaretModelElement){const e=n.mapper.toViewElement(this._currentFakeCaretModelElement);if(e){o.removeClass(eT.map(r),e);this._currentFakeCaretModelElement=null}}const s=t.selection.getSelectedElement();if(!s){return}const a=n.mapper.toViewElement(s);if(!t_(a,s,i)){return}const c=r_(t.selection);if(!c){return}o.addClass(r(c),a);this._currentFakeCaretModelElement=s});this._listenToIfEnabled(e.ui.focusTracker,\"change:isFocused\",(t,n,i)=>{if(!i){e.model.change(e=>{e.removeSelectionAttribute(e_)})}});function r(e){return`ck-widget_type-around_show-fake-caret_${e}`}}_handleArrowKeyPress(e,t){const n=this.editor;const i=n.model;const o=i.document.selection;const r=i.schema;const s=n.editing.view;const a=t.keyCode;const c=jl(a,n.locale.contentLanguageDirection);const l=s.document.selection.getSelectedElement();const d=n.editing.mapper.toModelElement(l);let u;if(t_(l,d,r)){u=this._handleArrowKeyPressOnSelectedWidget(c)}else if(o.isCollapsed){u=this._handleArrowKeyPressWhenSelectionNextToAWidget(c)}if(u){t.preventDefault();e.stop()}}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor;const n=t.model;const i=n.document.selection;const o=r_(i);return n.change(t=>{if(o){const n=o===(e?\"after\":\"before\");if(!n){t.removeSelectionAttribute(e_);return true}}else{t.setSelectionAttribute(e_,e?\"after\":\"before\");return true}return false})}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor;const n=t.model;const i=n.schema;const o=t.plugins.get(\"Widget\");const r=o._getObjectElementNextToSelection(e);const s=t.editing.mapper.toViewElement(r);if(t_(s,r,i)){n.change(t=>{o._setSelectionOverElement(r);t.setSelectionAttribute(e_,e?\"before\":\"after\")});return true}return false}_enableInsertingParagraphsOnButtonClick(){const e=this.editor;const t=e.editing.view;this._listenToIfEnabled(t.document,\"mousedown\",(n,i)=>{const o=n_(i.domTarget);if(!o){return}const r=i_(o);const s=o_(o,t.domConverter);const a=e.editing.mapper.toModelElement(s);this._insertParagraph(a,r);i.preventDefault();n.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor;const t=e.editing.view;this._listenToIfEnabled(t.document,\"enter\",(n,i)=>{const o=t.document.selection.getSelectedElement();const r=e.editing.mapper.toModelElement(o);const s=e.model.schema;let a;if(this._insertParagraphAccordingToFakeCaretPosition()){a=true}else if(t_(o,r,s)){this._insertParagraph(r,i.isSoft?\"before\":\"after\");a=true}if(a){i.preventDefault();n.stop()}})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor;const t=e.editing.view;const n=[Ol.enter,Ol.delete,Ol.backspace];this._listenToIfEnabled(t.document,\"keydown\",(e,t)=>{if(!n.includes(t.keyCode)&&!Q_(t)){this._insertParagraphAccordingToFakeCaretPosition()}},{priority:os.get(\"high\")+1})}_enableDeleteIntegration(){const e=this.editor;const t=e.editing.view;const n=e.model;const i=n.schema;this._listenToIfEnabled(t.document,\"delete\",(t,o)=>{const r=r_(n.document.selection);if(!r){return}const s=o.direction;const a=n.document.selection.getSelectedElement();const c=r===\"before\";const l=s==\"forward\";const d=c===l;if(d){e.execute(\"delete\",{selection:n.createSelection(a,\"on\")})}else{const t=i.getNearestSelectionRange(n.createPositionAt(a,r),s);if(t){if(!t.isCollapsed){n.change(n=>{n.setSelection(t);e.execute(l?\"forwardDelete\":\"delete\")})}else{const o=n.createSelection(t.start);n.modifySelection(o,{direction:s});if(!o.focus.isEqual(t.start)){n.change(n=>{n.setSelection(t);e.execute(l?\"forwardDelete\":\"delete\")})}else{const e=aT(i,t.start.parent);n.deleteContent(n.createSelection(e,\"on\"),{doNotAutoparagraph:true})}}}}o.preventDefault();t.stop()},{priority:os.get(\"high\")+1})}_enableInsertContentIntegration(){const e=this.editor;const t=this.editor.model;const n=t.document.selection;this._listenToIfEnabled(e.model,\"insertContent\",(e,[i,o])=>{if(o&&!o.is(\"documentSelection\")){return}const r=r_(n);if(!r){return}e.stop();return t.change(e=>{const o=n.getSelectedElement();const s=t.createPositionAt(o,r);const a=e.createSelection(s);const c=t.insertContent(i,a);e.setSelection(a);return c})},{priority:\"high\"})}}function oT(e,t,n){const i=e.createUIElement(\"div\",{class:\"ck ck-reset_all ck-widget__type-around\"},(function(e){const n=this.toDomElement(e);rT(n,t);sT(n);return n}));e.insert(e.createPositionAt(n,\"end\"),i)}function rT(e,t){for(const n of eT){const i=new hb({tag:\"div\",attributes:{class:[\"ck\",\"ck-widget__type-around__button\",`ck-widget__type-around__button_${n}`],title:t[n]},children:[e.ownerDocument.importNode(tT,true)]});e.appendChild(i.render())}}function sT(e){const t=new hb({tag:\"div\",attributes:{class:[\"ck\",\"ck-widget__type-around__fake-caret\"]}});e.appendChild(t.render())}function aT(e,t){let n=t;for(const i of t.getAncestors({parentFirst:true})){if(i.childCount>1||e.isLimit(i)){break}n=i}return n}var cT=n(68);class lT extends sk{static get pluginName(){return\"Widget\"}static get requires(){return[iT]}init(){const e=this.editor.editing.view;const t=e.document;this._previouslySelected=new Set;this.editor.editing.downcastDispatcher.on(\"selection\",(e,t,n)=>{this._clearPreviouslySelectedWidgets(n.writer);const i=n.writer;const o=i.document.selection;const r=o.getSelectedElement();let s=null;for(const e of o.getRanges()){for(const t of e){const e=t.item;if(c_(e)&&!uT(e,s)){i.addClass(a_,e);this._previouslySelected.add(e);s=e;if(e==r){i.setSelection(o.getRanges(),{fake:true,label:h_(r)})}}}}},{priority:\"low\"});e.addObserver(V_);this.listenTo(t,\"mousedown\",(...e)=>this._onMousedown(...e));this.listenTo(t,\"keydown\",(...e)=>{this._handleSelectionChangeOnArrowKeyPress(...e)},{priority:\"high\"});this.listenTo(t,\"keydown\",(...e)=>{this._preventDefaultOnArrowKeyPress(...e)},{priority:os.get(\"high\")-20});this.listenTo(t,\"delete\",(e,t)=>{if(this._handleDelete(t.direction==\"forward\")){t.preventDefault();e.stop()}},{priority:\"high\"})}_onMousedown(e,t){const n=this.editor;const i=n.editing.view;const o=i.document;let r=t.target;if(dT(r)){if((Tl.isSafari||Tl.isGecko)&&t.domEvent.detail>=3){const e=n.editing.mapper;const i=r.is(\"attributeElement\")?r.findAncestor(e=>!e.is(\"attributeElement\")):r;const o=e.toModelElement(i);t.preventDefault();this.editor.model.change(e=>{e.setSelection(o,\"in\")})}return}if(!c_(r)){r=r.findAncestor(c_);if(!r){return}}t.preventDefault();if(!o.isFocused){i.focus()}const s=n.editing.mapper.toModelElement(r);this._setSelectionOverElement(s)}_handleSelectionChangeOnArrowKeyPress(e,t){const n=t.keyCode;if(!Dl(n)){return}const i=this.editor.model;const o=i.schema;const r=i.document.selection;const s=r.getSelectedElement();const a=jl(n,this.editor.locale.contentLanguageDirection);if(s&&o.isObject(s)){const n=a?r.getLastPosition():r.getFirstPosition();const s=o.getNearestSelectionRange(n,a?\"forward\":\"backward\");if(s){i.change(e=>{e.setSelection(s)});t.preventDefault();e.stop()}return}if(!r.isCollapsed){return}const c=this._getObjectElementNextToSelection(a);if(c&&o.isObject(c)){this._setSelectionOverElement(c);t.preventDefault();e.stop()}}_preventDefaultOnArrowKeyPress(e,t){const n=t.keyCode;if(!Dl(n)){return}const i=this.editor.model;const o=i.schema;const r=i.document.selection.getSelectedElement();if(r&&o.isObject(r)){t.preventDefault();e.stop()}}_handleDelete(e){if(this.editor.isReadOnly){return}const t=this.editor.model.document;const n=t.selection;if(!n.isCollapsed){return}const i=this._getObjectElementNextToSelection(e);if(i){this.editor.model.change(e=>{let t=n.anchor.parent;while(t.isEmpty){const n=t;t=n.parent;e.remove(n)}this._setSelectionOverElement(i)});return true}}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model;const n=t.schema;const i=t.document.selection;const o=t.createSelection(i);t.modifySelection(o,{direction:e?\"forward\":\"backward\"});const r=e?o.focus.nodeBefore:o.focus.nodeAfter;if(!!r&&n.isObject(r)){return r}return null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected){e.removeClass(a_,t)}this._previouslySelected.clear()}}function dT(e){while(e){if(e.is(\"editableElement\")&&!e.is(\"rootElement\")){return true}if(c_(e)){return false}e=e.parent}return false}function uT(e,t){if(!t){return false}return Array.from(e.getAncestors()).includes(t)}class hT extends vk{refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=y_(e);if(y_(e)&&e.hasAttribute(\"alt\")){this.value=e.getAttribute(\"alt\")}else{this.value=false}}execute(e){const t=this.editor.model;const n=t.document.selection.getSelectedElement();t.change(t=>{t.setAttribute(\"alt\",e.newValue,n)})}}class fT extends sk{static get pluginName(){return\"ImageTextAlternativeEditing\"}init(){this.editor.commands.add(\"imageTextAlternative\",new hT(this.editor))}}var mT=n(70);class gT extends Bb{constructor(e,t){super(e);const n=`ck-labeled-field-view-${ns()}`;const i=`ck-labeled-field-view-status-${ns()}`;this.fieldView=t(this,n,i);this.set(\"label\");this.set(\"isEnabled\",true);this.set(\"errorText\",null);this.set(\"infoText\",null);this.set(\"class\");this.labelView=this._createLabelView(n);this.statusView=this._createStatusView(i);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)]},children:[this.labelView,this.fieldView,this.statusView]})}_createLabelView(e){const t=new Gb(this.locale);t.for=e;t.bind(\"text\").to(this,\"label\");return t}_createStatusView(e){const t=new Bb(this.locale);const n=this.bindTemplate;t.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-labeled-field-view__status\",n.if(\"errorText\",\"ck-labeled-field-view__status_error\"),n.if(\"_statusText\",\"ck-hidden\",e=>!e)],id:e,role:n.if(\"errorText\",\"alert\")},children:[{text:n.to(\"_statusText\")}]});return t}focus(){this.fieldView.focus()}}var pT=n(72);class bT extends Bb{constructor(e){super(e);this.set(\"value\");this.set(\"id\");this.set(\"placeholder\");this.set(\"isReadOnly\",false);this.set(\"hasError\",false);this.set(\"ariaDescribedById\");const t=this.bindTemplate;this.setTemplate({tag:\"input\",attributes:{type:\"text\",class:[\"ck\",\"ck-input\",\"ck-input-text\",t.if(\"hasError\",\"ck-error\")],id:t.to(\"id\"),placeholder:t.to(\"placeholder\"),readonly:t.to(\"isReadOnly\"),\"aria-invalid\":t.if(\"hasError\",true),\"aria-describedby\":t.to(\"ariaDescribedById\")},on:{input:t.to(\"input\")}})}render(){super.render();const e=e=>{this.element.value=!e&&e!==0?\"\":e};e(this.value);this.on(\"change:value\",(t,n,i)=>{e(i)})}select(){this.element.select()}focus(){this.element.focus()}}function wT(e,t,n){const i=new bT(e.locale);i.set({id:t,ariaDescribedById:n});i.bind(\"isReadOnly\").to(e,\"isEnabled\",e=>!e);i.bind(\"hasError\").to(e,\"errorText\",e=>!!e);i.on(\"input\",()=>{e.errorText=null});return i}function kT(e,t,n){const i=Lw(e.locale);i.set({id:t,ariaDescribedById:n});i.bind(\"isEnabled\").to(e);return i}function _T({view:e}){e.listenTo(e.element,\"submit\",(t,n)=>{n.preventDefault();e.fire(\"submit\")},{useCapture:true})}var vT='';var yT='';var xT=n(74);class CT extends Bb{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new Yp;this.keystrokes=new Op;this.labeledInput=this._createLabeledInputView();this.saveButtonView=this._createButton(t(\"Save\"),vT,\"ck-button-save\");this.saveButtonView.type=\"submit\";this.cancelButtonView=this._createButton(t(\"Cancel\"),yT,\"ck-button-cancel\",\"cancel\");this._focusables=new lb;this._focusCycler=new nw({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:\"shift + tab\",focusNext:\"tab\"}});this.setTemplate({tag:\"form\",attributes:{class:[\"ck\",\"ck-text-alternative-form\"],tabindex:\"-1\"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render();this.keystrokes.listenTo(this.element);_T({view:this});[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e);this.focusTracker.add(e.element)})}_createButton(e,t,n,i){const o=new Aw(this.locale);o.set({label:e,icon:t,tooltip:true});o.extendTemplate({attributes:{class:n}});if(i){o.delegate(\"execute\").to(this,i)}return o}_createLabeledInputView(){const e=this.locale.t;const t=new gT(this.locale,wT);t.label=e(\"Text alternative\");t.fieldView.placeholder=e(\"Text alternative\");return t}}var AT='';var TT='';var ST=n(76);var PT=n(78);const ET=Zb(\"px\");class MT extends sk{static get pluginName(){return\"ContextualBalloon\"}constructor(e){super(e);this.positionLimiter=()=>{const e=this.editor.editing.view;const t=e.document;const n=t.selection.editableElement;if(n){return e.domConverter.mapViewToDom(n.root)}return null};this.set(\"visibleView\",null);this.view=new Kk(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\",false);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 ss[\"b\"](\"contextualballoon-add-view-exist: Cannot add configuration of the same view twice.\",[this,e])}const t=e.stackId||\"main\";if(!this._idToStack.has(t)){this._idToStack.set(t,new Map([[e.view,e]]));this._viewToStack.set(e.view,this._idToStack.get(t));this._numberOfStacks=this._idToStack.size;if(!this._visibleStack||e.singleViewMode){this.showStack(t)}return}const n=this._idToStack.get(t);if(e.singleViewMode){this.showStack(t)}n.set(e.view,e);this._viewToStack.set(e.view,n);if(n===this._visibleStack){this._showView(e)}}remove(e){if(!this.hasView(e)){throw new ss[\"b\"](\"contextualballoon-remove-view-not-exist: Cannot remove the configuration of a non-existent view.\",[this,e])}const t=this._viewToStack.get(e);if(this._singleViewMode&&this.visibleView===e){this._singleViewMode=false}if(this.visibleView===e){if(t.size===1){if(this._idToStack.size>1){this._showNextStack()}else{this.view.hide();this.visibleView=null;this._rotatorView.hideView()}}else{this._showView(Array.from(t.values())[t.size-2])}}if(t.size===1){this._idToStack.delete(this._getStackId(t));this._numberOfStacks=this._idToStack.size}else{t.delete(e)}this._viewToStack.delete(e)}updatePosition(e){if(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 ss[\"b\"](\"contextualballoon-showstack-stack-not-exist: Cannot show a stack that does not exist.\",this)}if(this._visibleStack===t){return}this._showView(Array.from(t.values()).pop())}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){const t=Array.from(this._idToStack.entries()).find(t=>t[1]===e);return t[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;if(!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;if(!e[t]){t=e.length-1}this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new IT(this.editor.locale);const t=this.editor.locale.t;this.view.content.add(e);e.bind(\"isNavigationVisible\").to(this,\"_numberOfStacks\",this,\"_singleViewMode\",(e,t)=>!t&&e>1);e.on(\"change:isNavigationVisible\",()=>this.updatePosition(),{priority:\"low\"});e.bind(\"counter\").to(this,\"visibleView\",this,\"_numberOfStacks\",(e,n)=>{if(n<2){return\"\"}const i=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t(\"%0 of %1\",[i,n])});e.buttonNextView.on(\"execute\",()=>{if(e.focusTracker.isFocused){this.editor.editing.view.focus()}this._showNextStack()});e.buttonPrevView.on(\"execute\",()=>{if(e.focusTracker.isFocused){this.editor.editing.view.focus()}this._showPrevStack()});return e}_createFakePanelsView(){const e=new NT(this.editor.locale,this.view);e.bind(\"numberOfPanels\").to(this,\"_numberOfStacks\",this,\"_singleViewMode\",(e,t)=>{const n=!t&&e>=2;return n?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);return e}_showView({view:e,balloonClassName:t=\"\",withArrow:n=true,singleViewMode:i=false}){this.view.class=t;this.view.withArrow=n;this._rotatorView.showView(e);this.visibleView=e;this.view.pin(this._getBalloonPosition());this._fakePanelsView.updatePosition();if(i){this._singleViewMode=true}}_getBalloonPosition(){let e=Array.from(this._visibleStack.values()).pop().position;if(e&&!e.limiter){e=Object.assign({},e,{limiter:this.positionLimiter})}return e}}class IT extends Bb{constructor(e){super(e);const t=e.t;const n=this.bindTemplate;this.set(\"isNavigationVisible\",true);this.focusTracker=new Yp;this.buttonPrevView=this._createButtonView(t(\"Previous\"),AT);this.buttonNextView=this._createButtonView(t(\"Next\"),TT);this.content=this.createCollection();this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-balloon-rotator\"],\"z-index\":\"-1\"},children:[{tag:\"div\",attributes:{class:[\"ck-balloon-rotator__navigation\",n.to(\"isNavigationVisible\",e=>e?\"\":\"ck-hidden\")]},children:[this.buttonPrevView,{tag:\"span\",attributes:{class:[\"ck-balloon-rotator__counter\"]},children:[{text:n.to(\"counter\")}]},this.buttonNextView]},{tag:\"div\",attributes:{class:\"ck-balloon-rotator__content\"},children:this.content}]})}render(){super.render();this.focusTracker.add(this.element)}showView(e){this.hideView();this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const n=new Aw(this.locale);n.set({label:e,icon:t,tooltip:true});return n}}class NT extends Bb{constructor(e,t){super(e);const n=this.bindTemplate;this.set(\"top\",0);this.set(\"left\",0);this.set(\"height\",0);this.set(\"width\",0);this.set(\"numberOfPanels\",0);this.content=this.createCollection();this._balloonPanelView=t;this.setTemplate({tag:\"div\",attributes:{class:[\"ck-fake-panel\",n.to(\"numberOfPanels\",e=>e?\"\":\"ck-hidden\")],style:{top:n.to(\"top\",ET),left:n.to(\"left\",ET),width:n.to(\"width\",ET),height:n.to(\"height\",ET)}},children:this.content});this.on(\"change:numberOfPanels\",(e,t,n,i)=>{if(n>i){this._addPanels(n-i)}else{this._removePanels(i-n)}this.updatePosition()})}_addPanels(e){while(e--){const e=new Bb;e.setTemplate({tag:\"div\"});this.content.add(e);this.registerChild(e)}}_removePanels(e){while(e--){const e=this.content.last;this.content.remove(e);this.deregisterChild(e);e.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:e,left:t}=this._balloonPanelView;const{width:n,height:i}=new Th(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:n,height:i})}}}var RT='';function OT(e){const t=e.plugins.get(\"ContextualBalloon\");if(v_(e.editing.view.document.selection)){const n=zT(e);t.updatePosition(n)}}function zT(e){const t=e.editing.view;const n=Kk.defaultPositions;return{target:t.domConverter.viewToDom(t.document.selection.getSelectedElement()),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}}class VT extends sk{static get requires(){return[MT]}static get pluginName(){return\"ImageTextAlternativeUI\"}init(){this._createButton();this._createForm()}destroy(){super.destroy();this._form.destroy()}_createButton(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(\"imageTextAlternative\",n=>{const i=e.commands.get(\"imageTextAlternative\");const o=new Aw(n);o.set({label:t(\"Change image text alternative\"),icon:RT,tooltip:true});o.bind(\"isEnabled\").to(i,\"isEnabled\");this.listenTo(o,\"execute\",()=>{this._showForm()});return o})}_createForm(){const e=this.editor;const t=e.editing.view;const n=t.document;this._balloon=this.editor.plugins.get(\"ContextualBalloon\");this._form=new CT(e.locale);this._form.render();this.listenTo(this._form,\"submit\",()=>{e.execute(\"imageTextAlternative\",{newValue:this._form.labeledInput.fieldView.element.value});this._hideForm(true)});this.listenTo(this._form,\"cancel\",()=>{this._hideForm(true)});this._form.keystrokes.set(\"Esc\",(e,t)=>{this._hideForm(true);t()});this.listenTo(e.ui,\"update\",()=>{if(!v_(n.selection)){this._hideForm(true)}else if(this._isVisible){OT(e)}});Ow({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible){return}const e=this.editor;const t=e.commands.get(\"imageTextAlternative\");const n=this._form.labeledInput;if(!this._isInBalloon){this._balloon.add({view:this._form,position:zT(e)})}n.fieldView.value=n.fieldView.element.value=t.value||\"\";this._form.labeledInput.fieldView.select()}_hideForm(e){if(!this._isInBalloon){return}if(this._form.focusTracker.isFocused){this._form.saveButtonView.focus()}this._balloon.remove(this._form);if(e){this.editor.editing.view.focus()}}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class LT extends sk{static get requires(){return[fT,VT]}static get pluginName(){return\"ImageTextAlternative\"}}var DT=n(80);class BT extends sk{static get requires(){return[O_,lT,LT]}static get pluginName(){return\"Image\"}}function jT(e,t){return n=>{const i=n.createEditableElement(\"figcaption\");n.setCustomProperty(\"imageCaption\",true,i);Xp({view:e,element:i,text:t});return f_(i,n)}}function FT(e){return!!e.getCustomProperty(\"imageCaption\")}function HT(e){for(const t of e.getChildren()){if(!!t&&t.is(\"element\",\"caption\")){return t}}return null}function WT(e){const t=e.parent;if(e.name==\"figcaption\"&&t&&t.name==\"figure\"&&t.hasClass(\"image\")){return{name:true}}return null}class UT extends sk{static get pluginName(){return\"ImageCaptionEditing\"}init(){const e=this.editor;const t=e.editing.view;const n=e.model.schema;const i=e.data;const o=e.editing;const r=e.t;n.register(\"caption\",{allowIn:\"image\",allowContentOf:\"$block\",isLimit:true});e.model.document.registerPostFixer(e=>this._insertMissingModelCaptionElement(e));e.conversion.for(\"upcast\").elementToElement({view:WT,model:\"caption\"});const s=e=>e.createContainerElement(\"figcaption\");i.downcastDispatcher.on(\"insert:caption\",qT(s,false));const a=jT(t,r(\"Enter image caption\"));o.downcastDispatcher.on(\"insert:caption\",qT(a));o.downcastDispatcher.on(\"insert\",this._fixCaptionVisibility(e=>e.item),{priority:\"high\"});o.downcastDispatcher.on(\"remove\",this._fixCaptionVisibility(e=>e.position.parent),{priority:\"high\"});t.document.registerPostFixer(e=>this._updateCaptionVisibility(e))}_updateCaptionVisibility(e){const t=this.editor.editing.mapper;const n=this._lastSelectedCaption;let i;const o=this.editor.model.document.selection;const r=o.getSelectedElement();if(r&&r.is(\"element\",\"image\")){const e=HT(r);i=t.toViewElement(e)}const s=o.getFirstPosition();const a=YT(s.parent);if(a){i=t.toViewElement(a)}if(i){if(n){if(n===i){return KT(i,e)}else{GT(n,e);this._lastSelectedCaption=i;return KT(i,e)}}else{this._lastSelectedCaption=i;return KT(i,e)}}else{if(n){const t=GT(n,e);this._lastSelectedCaption=null;return t}else{return false}}}_fixCaptionVisibility(e){return(t,n,i)=>{const o=e(n);const r=YT(o);const s=this.editor.editing.mapper;const a=i.writer;if(r){const e=s.toViewElement(r);if(e){if(r.childCount){a.removeClass(\"ck-hidden\",e)}else{a.addClass(\"ck-hidden\",e)}}}}}_insertMissingModelCaptionElement(e){const t=this.editor.model;const n=t.document.differ.getChanges();const i=[];for(const e of n){if(e.type==\"insert\"&&e.name!=\"$text\"){const n=e.position.nodeAfter;if(n.is(\"element\",\"image\")&&!HT(n)){i.push(n)}if(!n.is(\"element\",\"image\")&&n.childCount){for(const e of t.createRangeIn(n).getItems()){if(e.is(\"element\",\"image\")&&!HT(e)){i.push(e)}}}}}for(const t of i){e.appendElement(\"caption\",t)}return!!i.length}}function qT(e,t=true){return(n,i,o)=>{const r=i.item;if(!r.childCount&&!t){return}if(y_(r.parent)){if(!o.consumable.consume(i.item,\"insert\")){return}const t=o.mapper.toViewElement(i.range.start.parent);const n=e(o.writer);const s=o.writer;if(!r.childCount){s.addClass(\"ck-hidden\",n)}$T(n,i.item,t,o)}}}function $T(e,t,n,i){const o=i.writer.createPositionAt(n,\"end\");i.writer.insert(o,e);i.mapper.bindElements(t,e)}function YT(e){const t=e.getAncestors({includeSelf:true});const n=t.find(e=>e.name==\"caption\");if(n&&n.parent&&n.parent.name==\"image\"){return n}return null}function GT(e,t){if(!e.childCount&&!e.hasClass(\"ck-hidden\")){t.addClass(\"ck-hidden\",e);return true}return false}function KT(e,t){if(e.hasClass(\"ck-hidden\")){t.removeClass(\"ck-hidden\",e);return true}return false}var QT=n(82);class JT extends sk{static get requires(){return[UT]}static get pluginName(){return\"ImageCaption\"}}class ZT extends vk{refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=y_(e);if(!e||!e.hasAttribute(\"width\")){this.value=null}else{this.value={width:e.getAttribute(\"width\"),height:null}}}execute(e){const t=this.editor.model;const n=t.document.selection.getSelectedElement();this.value={width:e.width,height:null};if(n){t.change(t=>{t.setAttribute(\"width\",e.width,n)})}}}class XT extends sk{static get pluginName(){return\"ImageResizeEditing\"}constructor(e){super(e);e.config.define(\"image\",{resizeUnit:\"%\",resizeOptions:[{name:\"imageResize:original\",value:null,icon:\"original\"},{name:\"imageResize:25\",value:\"25\",icon:\"small\"},{name:\"imageResize:50\",value:\"50\",icon:\"medium\"},{name:\"imageResize:75\",value:\"75\",icon:\"large\"}]})}init(){const e=this.editor;const t=new ZT(e);this._registerSchema();this._registerConverters();e.commands.add(\"imageResize\",t)}_registerSchema(){this.editor.model.schema.extend(\"image\",{allowAttributes:\"width\"});this.editor.model.schema.setAttributeProperties(\"width\",{isFormatting:true})}_registerConverters(){const e=this.editor;e.conversion.for(\"downcast\").add(e=>e.on(\"attribute:width:image\",(e,t,n)=>{if(!n.consumable.consume(t.item,e.name)){return}const i=n.writer;const o=n.mapper.toViewElement(t.item);if(t.attributeNewValue!==null){i.setStyle(\"width\",t.attributeNewValue,o);i.addClass(\"image_resized\",o)}else{i.removeStyle(\"width\",o);i.removeClass(\"image_resized\",o)}}));e.conversion.for(\"upcast\").attributeToAttribute({view:{name:\"figure\",styles:{width:/.+/}},model:{key:\"width\",value:e=>e.getStyle(\"width\")}})}}var eS='';var tS='';var nS='';var iS='';const oS={small:eS,medium:tS,large:nS,original:iS};class rS extends sk{static get requires(){return[XT]}static get pluginName(){return\"ImageResizeButtons\"}constructor(e){super(e);this._resizeUnit=e.config.get(\"image.resizeUnit\")}init(){const e=this.editor;const t=e.config.get(\"image.resizeOptions\");const n=e.commands.get(\"imageResize\");this.bind(\"isEnabled\").to(n);for(const e of t){this._registerImageResizeButton(e)}this._registerImageResizeDropdown(t)}_registerImageResizeButton(e){const t=this.editor;const{name:n,value:i,icon:o}=e;const r=i?i+this._resizeUnit:null;t.ui.componentFactory.add(n,i=>{const s=new Aw(i);const a=t.commands.get(\"imageResize\");const c=this._getOptionLabelValue(e,true);if(!oS[o]){throw new ss[\"b\"](\"imageresizebuttons-missing-icon: \"+'The resize option \"'+n+'\" misses the \"icon\" property '+\"or the property value doesn't match any of available icons.\",t,e)}s.set({label:c,icon:oS[o],tooltip:c,isToggleable:true});s.bind(\"isEnabled\").to(this);s.bind(\"isOn\").to(a,\"value\",sS(r));this.listenTo(s,\"execute\",()=>{t.execute(\"imageResize\",{width:r})});return s})}_registerImageResizeDropdown(e){const t=this.editor;const n=t.t;const i=e.find(e=>!e.value);t.ui.componentFactory.add(\"imageResize\",o=>{const r=t.commands.get(\"imageResize\");const s=Lw(o,Sw);const a=s.buttonView;a.set({tooltip:n(\"Resize image\"),commandValue:i.value,icon:tS,isToggleable:true,label:this._getOptionLabelValue(i),withText:true,class:\"ck-resize-image-button\"});a.bind(\"label\").to(r,\"value\",e=>{if(e&&e.width){return e.width}else{return this._getOptionLabelValue(i)}});s.bind(\"isOn\").to(r);s.bind(\"isEnabled\").to(this);Bw(s,this._getResizeDropdownListItemDefinitions(e,r));s.listView.ariaLabel=n(\"Image resize list\");this.listenTo(s,\"execute\",e=>{t.execute(e.source.commandName,{width:e.source.commandValue});t.editing.view.focus()});return s})}_getOptionLabelValue(e,t){const n=this.editor.t;if(e.label){return e.label}else if(t){if(e.value){return n(\"Resize image to %0\",e.value+this._resizeUnit)}else{return n(\"Resize image to the original size\")}}else{if(e.value){return e.value+this._resizeUnit}else{return n(\"Original\")}}}_getResizeDropdownListItemDefinitions(e,t){const n=new xs;e.map(e=>{const i=e.value?e.value+this._resizeUnit:null;const o={type:\"button\",model:new lA({commandName:\"imageResize\",commandValue:i,label:this._getOptionLabelValue(e),withText:true,icon:null})};o.model.bind(\"isOn\").to(t,\"value\",sS(i));n.add(o)});return n}}function sS(e){return t=>{if(e===null&&t===e){return true}return t&&t.width===e}}class aS{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,n){const i=new Th(t);this.activeHandlePosition=uS(e);this._referenceCoordinates=lS(t,hS(this.activeHandlePosition));this.originalWidth=i.width;this.originalHeight=i.height;this.aspectRatio=i.width/i.height;const o=n.style.width;if(o&&o.match(/^\\d+\\.?\\d*%$/)){this.originalWidthPercents=parseFloat(o)}else{this.originalWidthPercents=cS(n,i)}}update(e){this.proposedWidth=e.width;this.proposedHeight=e.height;this.proposedWidthPercents=e.widthPercents;this.proposedHandleHostWidth=e.handleHostWidth;this.proposedHandleHostHeight=e.handleHostHeight}}ys(aS,Qc);function cS(e,t){const n=e.parentElement;const i=parseFloat(n.ownerDocument.defaultView.getComputedStyle(n).width);return t.width/i*100}function lS(e,t){const n=new Th(e);const i=t.split(\"-\");const o={x:i[1]==\"right\"?n.right:n.left,y:i[0]==\"bottom\"?n.bottom:n.top};o.x+=e.ownerDocument.defaultView.scrollX;o.y+=e.ownerDocument.defaultView.scrollY;return o}function dS(e){return`ck-widget__resizer__handle-${e}`}function uS(e){const t=[\"top-left\",\"top-right\",\"bottom-right\",\"bottom-left\"];for(const n of t){if(e.classList.contains(dS(n))){return n}}}function hS(e){const t=e.split(\"-\");const n={top:\"bottom\",bottom:\"top\",left:\"right\",right:\"left\"};return`${n[t[0]]}-${n[t[1]]}`}class fS{constructor(e){this._options=e;this._domResizerWrapper=null;this._viewResizerWrapper=null;this.set(\"isEnabled\",true);this.decorate(\"begin\");this.decorate(\"cancel\");this.decorate(\"commit\");this.decorate(\"updateSize\");this.on(\"commit\",e=>{if(!this.state.proposedWidth&&!this.state.proposedWidthPercents){this._cleanup();e.stop()}},{priority:\"high\"});this.on(\"change:isEnabled\",()=>{if(this.isEnabled){this.redraw()}})}attach(){const e=this;const t=this._options.viewElement;const n=this._options.editor.editing.view;n.change(n=>{const i=n.createUIElement(\"div\",{class:\"ck ck-reset_all ck-widget__resizer\"},(function(t){const n=this.toDomElement(t);e._appendHandles(n);e._appendSizeUI(n);e._domResizerWrapper=n;e.on(\"change:isEnabled\",(e,t,i)=>{n.style.display=i?\"\":\"none\"});n.style.display=e.isEnabled?\"\":\"none\";return n}));n.insert(n.createPositionAt(t,\"end\"),i);n.addClass(\"ck-widget_with-resizer\",t);this._viewResizerWrapper=i})}begin(e){this.state=new aS(this._options);this._sizeUI.bindToState(this._options,this.state);this._initialViewWidth=this._options.viewElement.getStyle(\"width\");this.state.begin(e,this._getHandleHost(),this._getResizeHost())}updateSize(e){const t=this._proposeNewSize(e);const n=this._options.editor.editing.view;n.change(e=>{const n=this._options.unit||\"%\";const i=(n===\"%\"?t.widthPercents:t.width)+n;e.setStyle(\"width\",i,this._options.viewElement)});const i=this._getHandleHost();const o=new Th(i);t.handleHostWidth=Math.round(o.width);t.handleHostHeight=Math.round(o.height);const r=new Th(i);t.width=Math.round(r.width);t.height=Math.round(r.height);this.redraw(o);this.state.update(t)}commit(){const 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){const t=this._domResizerWrapper;if(!bS(t)){return}const n=t.parentElement;const i=this._getHandleHost();const o=this._viewResizerWrapper;const r=[o.getStyle(\"width\"),o.getStyle(\"height\"),o.getStyle(\"left\"),o.getStyle(\"top\")];let s;if(n.isSameNode(i)){const t=e||new Th(i);s=[t.width+\"px\",t.height+\"px\",undefined,undefined]}else{s=[i.offsetWidth+\"px\",i.offsetHeight+\"px\",i.offsetLeft+\"px\",i.offsetTop+\"px\"]}if(zs(r,s)!==\"same\"){this._options.editor.editing.view.change(e=>{e.setStyle({width:s[0],height:s[1],left:s[2],top:s[3]},o)})}}containsHandle(e){return this._domResizerWrapper.contains(e)}static isResizeHandle(e){return e.classList.contains(\"ck-widget__resizer__handle\")}_cleanup(){this._sizeUI.dismiss();this._sizeUI.isVisible=false;const e=this._options.editor.editing.view;e.change(e=>{e.setStyle(\"width\",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(e){const t=this.state;const n=pS(e);const i=this._options.isCentered?this._options.isCentered(this):true;const o={x:t._referenceCoordinates.x-(n.x+t.originalWidth),y:n.y-t.originalHeight-t._referenceCoordinates.y};if(i&&t.activeHandlePosition.endsWith(\"-right\")){o.x=n.x-(t._referenceCoordinates.x+t.originalWidth)}if(i){o.x*=2}const r={width:Math.abs(t.originalWidth+o.x),height:Math.abs(t.originalHeight+o.y)};r.dominant=r.width/t.aspectRatio>r.height?\"width\":\"height\";r.max=r[r.dominant];const s={width:r.width,height:r.height};if(r.dominant==\"width\"){s.height=s.width/t.aspectRatio}else{s.width=s.height*t.aspectRatio}return{width:Math.round(s.width),height:Math.round(s.height),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*s.width*100)/100,100)}}_getResizeHost(){const e=this._domResizerWrapper.parentElement;return this._options.getResizeHost(e)}_getHandleHost(){const e=this._domResizerWrapper.parentElement;return this._options.getHandleHost(e)}_appendHandles(e){const t=[\"top-left\",\"top-right\",\"bottom-right\",\"bottom-left\"];for(const n of t){e.appendChild(new hb({tag:\"div\",attributes:{class:`ck-widget__resizer__handle ${gS(n)}`}}).render())}}_appendSizeUI(e){const t=new mS;t.render();this._sizeUI=t;e.appendChild(t.element)}}ys(fS,Qc);class mS extends Bb{constructor(){super();const e=this.bindTemplate;this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-size-view\",e.to(\"activeHandlePosition\",e=>e?`ck-orientation-${e}`:\"\")],style:{display:e.if(\"isVisible\",\"none\",e=>!e)}},children:[{text:e.to(\"label\")}]})}bindToState(e,t){this.bind(\"isVisible\").to(t,\"proposedWidth\",t,\"proposedHeight\",(e,t)=>e!==null&&t!==null);this.bind(\"label\").to(t,\"proposedHandleHostWidth\",t,\"proposedHandleHostHeight\",t,\"proposedWidthPercents\",(t,n,i)=>{if(e.unit===\"px\"){return`${t}×${n}`}else{return`${i}%`}});this.bind(\"activeHandlePosition\").to(t)}dismiss(){this.unbind();this.isVisible=false}}function gS(e){return`ck-widget__resizer__handle-${e}`}function pS(e){return{x:e.pageX,y:e.pageY}}function bS(e){return e&&e.ownerDocument&&e.ownerDocument.contains(e)}var wS=\"Expected a function\";function kS(e,t,n){var i=true,o=true;if(typeof e!=\"function\"){throw new TypeError(wS)}if(ce(n)){i=\"leading\"in n?!!n.leading:i;o=\"trailing\"in n?!!n.trailing:o}return ph(e,t,{leading:i,maxWait:t,trailing:o})}var _S=kS;var vS=n(84);class yS extends sk{static get pluginName(){return\"WidgetResize\"}init(){this.set(\"_visibleResizer\",null);this.set(\"_activeResizer\",null);this._resizers=new Map;const e=Ld.window.document;this.editor.model.schema.setAttributeProperties(\"width\",{isFormatting:true});this.editor.editing.view.addObserver(V_);this._observer=Object.create(Kd);this.listenTo(this.editor.editing.view.document,\"mousedown\",this._mouseDownListener.bind(this),{priority:\"high\"});this._observer.listenTo(e,\"mousemove\",this._mouseMoveListener.bind(this));this._observer.listenTo(e,\"mouseup\",this._mouseUpListener.bind(this));const t=()=>{if(this._visibleResizer){this._visibleResizer.redraw()}};const n=_S(t,200);this.on(\"change:_visibleResizer\",t);this.editor.ui.on(\"update\",n);this._observer.listenTo(Ld.window,\"resize\",n);const i=this.editor.editing.view.document.selection;i.on(\"change\",()=>{const e=i.getSelectedElement();this._visibleResizer=this._getResizerByViewElement(e)||null})}destroy(){this._observer.stopListening();for(const e of this._resizers.values()){e.destroy()}}attachTo(e){const t=new fS(e);const n=this.editor.plugins;t.attach();if(n.has(\"WidgetToolbarRepository\")){const e=n.get(\"WidgetToolbarRepository\");t.on(\"begin\",()=>{e.forceDisabled(\"resize\")},{priority:\"lowest\"});t.on(\"cancel\",()=>{e.clearForceDisabled(\"resize\")},{priority:\"highest\"});t.on(\"commit\",()=>{e.clearForceDisabled(\"resize\")},{priority:\"highest\"})}this._resizers.set(e.viewElement,t);return t}_getResizerByHandle(e){for(const t of this._resizers.values()){if(t.containsHandle(e)){return t}}}_getResizerByViewElement(e){return this._resizers.get(e)}_mouseDownListener(e,t){const n=t.domTarget;if(!fS.isResizeHandle(n)){return}this._activeResizer=this._getResizerByHandle(n);if(this._activeResizer){this._activeResizer.begin(n);e.stop();t.preventDefault()}}_mouseMoveListener(e,t){if(this._activeResizer){this._activeResizer.updateSize(t)}}_mouseUpListener(){if(this._activeResizer){this._activeResizer.commit();this._activeResizer=null}}}ys(yS,Qc);class xS extends sk{static get requires(){return[yS]}static get pluginName(){return\"ImageResizeHandles\"}init(){const e=this.editor;const t=e.commands.get(\"imageResize\");this.bind(\"isEnabled\").to(t);e.editing.downcastDispatcher.on(\"insert:image\",(t,n,i)=>{const o=i.mapper.toViewElement(n.item);const r=e.plugins.get(yS).attachTo({unit:e.config.get(\"image.resizeUnit\"),modelElement:n.item,viewElement:o,editor:e,getHandleHost(e){return e.querySelector(\"img\")},getResizeHost(e){return e},isCentered(){const e=n.item.getAttribute(\"imageStyle\");return!e||e==\"full\"||e==\"alignCenter\"},onCommit(t){e.execute(\"imageResize\",{width:t})}});r.on(\"updateSize\",()=>{if(!o.hasClass(\"image_resized\")){e.editing.view.change(e=>{e.addClass(\"image_resized\",o)})}});r.bind(\"isEnabled\").to(this)},{priority:\"low\"})}}var CS=n(86);class AS extends sk{static get requires(){return[XT,xS,rS]}static get pluginName(){return\"ImageResize\"}}class TS extends vk{constructor(e,t){super(e);this.defaultStyle=false;this.styles=t.reduce((e,t)=>{e[t.name]=t;if(t.isDefault){this.defaultStyle=t.name}return e},{})}refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=y_(e);if(!e){this.value=false}else if(e.hasAttribute(\"imageStyle\")){const t=e.getAttribute(\"imageStyle\");this.value=this.styles[t]?t:false}else{this.value=this.defaultStyle}}execute(e){const t=e.value;const n=this.editor.model;const i=n.document.selection.getSelectedElement();n.change(e=>{if(this.styles[t].isDefault){e.removeAttribute(\"imageStyle\",i)}else{e.setAttribute(\"imageStyle\",t,i)}})}}function SS(e){return(t,n,i)=>{if(!i.consumable.consume(n.item,t.name)){return}const o=ES(n.attributeNewValue,e);const r=ES(n.attributeOldValue,e);const s=i.mapper.toViewElement(n.item);const a=i.writer;if(r){a.removeClass(r.className,s)}if(o){a.addClass(o.className,s)}}}function PS(e){const t=e.filter(e=>!e.isDefault);return(e,n,i)=>{if(!n.modelRange){return}const o=n.viewItem;const r=tk(n.modelRange.getItems());if(!i.schema.checkAttribute(r,\"imageStyle\")){return}for(const e of t){if(i.consumable.consume(o,{classes:e.className})){i.writer.setAttribute(\"imageStyle\",e.name,r)}}}}function ES(e,t){for(const n of t){if(n.name===e){return n}}}var MS='';var IS='';var NS='';var RS='';const OS={full:{name:\"full\",title:\"Full size image\",icon:MS,isDefault:true},side:{name:\"side\",title:\"Side image\",icon:RS,className:\"image-style-side\"},alignLeft:{name:\"alignLeft\",title:\"Left aligned image\",icon:IS,className:\"image-style-align-left\"},alignCenter:{name:\"alignCenter\",title:\"Centered image\",icon:NS,className:\"image-style-align-center\"},alignRight:{name:\"alignRight\",title:\"Right aligned image\",icon:RS,className:\"image-style-align-right\"}};const zS={full:MS,left:IS,right:RS,center:NS};function VS(e=[]){return e.map(LS)}function LS(e){if(typeof e==\"string\"){const t=e;if(OS[t]){e=Object.assign({},OS[t])}else{console.warn(Object(ss[\"a\"])(\"image-style-not-found: There is no such image style of given name.\"),{name:t});e={name:t}}}else if(OS[e.name]){const t=OS[e.name];const n=Object.assign({},e);for(const i in t){if(!Object.prototype.hasOwnProperty.call(e,i)){n[i]=t[i]}}e=n}if(typeof e.icon==\"string\"&&zS[e.icon]){e.icon=zS[e.icon]}return e}class DS extends sk{static get pluginName(){return\"ImageStyleEditing\"}init(){const e=this.editor;const t=e.model.schema;const n=e.data;const i=e.editing;e.config.define(\"image.styles\",[\"full\",\"side\"]);const o=VS(e.config.get(\"image.styles\"));t.extend(\"image\",{allowAttributes:\"imageStyle\"});const r=SS(o);i.downcastDispatcher.on(\"attribute:imageStyle:image\",r);n.downcastDispatcher.on(\"attribute:imageStyle:image\",r);n.upcastDispatcher.on(\"element:figure\",PS(o),{priority:\"low\"});e.commands.add(\"imageStyle\",new TS(e,o))}}var BS=n(88);class jS extends sk{static get pluginName(){return\"ImageStyleUI\"}get localizedDefaultStylesTitles(){const e=this.editor.t;return{\"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;const t=e.config.get(\"image.styles\");const n=FS(VS(t),this.localizedDefaultStylesTitles);for(const e of n){this._createButton(e)}}_createButton(e){const t=this.editor;const n=`imageStyle:${e.name}`;t.ui.componentFactory.add(n,n=>{const i=t.commands.get(\"imageStyle\");const o=new Aw(n);o.set({label:e.title,icon:e.icon,tooltip:true,isToggleable:true});o.bind(\"isEnabled\").to(i,\"isEnabled\");o.bind(\"isOn\").to(i,\"value\",t=>t===e.name);this.listenTo(o,\"execute\",()=>{t.execute(\"imageStyle\",{value:e.name});t.editing.view.focus()});return o})}}function FS(e,t){for(const n of e){if(t[n.title]){n.title=t[n.title]}}return e}class HS extends sk{static get requires(){return[DS,jS]}static get pluginName(){return\"ImageStyle\"}}class WS extends sk{static get requires(){return[MT]}static get pluginName(){return\"WidgetToolbarRepository\"}init(){const e=this.editor;if(e.plugins.has(\"BalloonToolbar\")){const t=e.plugins.get(\"BalloonToolbar\");this.listenTo(t,\"show\",t=>{if($S(e.editing.view.document.selection)){t.stop()}},{priority:\"high\"})}this._toolbarDefinitions=new Map;this._balloon=this.editor.plugins.get(\"ContextualBalloon\");this.on(\"change:isEnabled\",()=>{this._updateToolbarsVisibility()});this.listenTo(e.ui,\"update\",()=>{this._updateToolbarsVisibility()});this.listenTo(e.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:n,getRelatedElement:i,balloonClassName:o=\"ck-toolbar-container\"}){if(!n.length){console.warn(Object(ss[\"a\"])(\"widget-toolbar-no-items: Trying to register a toolbar without items.\"),{toolbarId:e});return}const r=this.editor;const s=r.t;const a=new $w(r.locale);a.ariaLabel=t||s(\"Widget toolbar\");if(this._toolbarDefinitions.has(e)){throw new ss[\"b\"](\"widget-toolbar-duplicated: Toolbar with the given id was already added.\",this,{toolbarId:e})}a.fillFromConfig(n,r.ui.componentFactory);this._toolbarDefinitions.set(e,{view:a,getRelatedElement:i,balloonClassName:o})}_updateToolbarsVisibility(){let e=0;let t=null;let n=null;for(const i of this._toolbarDefinitions.values()){const o=i.getRelatedElement(this.editor.editing.view.document.selection);if(!this.isEnabled||!o){if(this._isToolbarInBalloon(i)){this._hideToolbar(i)}}else if(!this.editor.ui.focusTracker.isFocused){if(this._isToolbarVisible(i)){this._hideToolbar(i)}}else{const r=o.getAncestors().length;if(r>e){e=r;t=o;n=i}}}if(n){this._showToolbar(n,t)}}_hideToolbar(e){this._balloon.remove(e.view);this.stopListening(this._balloon,\"change:visibleView\")}_showToolbar(e,t){if(this._isToolbarVisible(e)){US(this.editor,t)}else if(!this._isToolbarInBalloon(e)){this._balloon.add({view:e.view,position:qS(this.editor,t),balloonClassName:e.balloonClassName});this.listenTo(this._balloon,\"change:visibleView\",()=>{for(const e of this._toolbarDefinitions.values()){if(this._isToolbarVisible(e)){const t=e.getRelatedElement(this.editor.editing.view.document.selection);US(this.editor,t)}}})}}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function US(e,t){const n=e.plugins.get(\"ContextualBalloon\");const i=qS(e,t);n.updatePosition(i)}function qS(e,t){const n=e.editing.view;const i=Kk.defaultPositions;return{target:n.domConverter.mapViewToDom(t),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast,p_]}}function $S(e){const t=e.getSelectedElement();return!!(t&&c_(t))}class YS extends sk{static get requires(){return[WS]}static get pluginName(){return\"ImageToolbar\"}afterInit(){const e=this.editor;const t=e.t;const n=e.plugins.get(WS);n.register(\"image\",{ariaLabel:t(\"Image toolbar\"),items:e.config.get(\"image.toolbar\")||[],getRelatedElement:v_})}}class GS extends Bb{constructor(e){super(e);this.buttonView=new Aw(e);this._fileInputView=new KS(e);this._fileInputView.bind(\"acceptedType\").to(this);this._fileInputView.bind(\"allowMultipleFiles\").to(this);this._fileInputView.delegate(\"done\").to(this);this.setTemplate({tag:\"span\",attributes:{class:\"ck-file-dialog-button\"},children:[this.buttonView,this._fileInputView]});this.buttonView.on(\"execute\",()=>{this._fileInputView.open()})}focus(){this.buttonView.focus()}}class KS extends Bb{constructor(e){super(e);this.set(\"acceptedType\");this.set(\"allowMultipleFiles\",false);const t=this.bindTemplate;this.setTemplate({tag:\"input\",attributes:{class:[\"ck-hidden\"],type:\"file\",tabindex:\"-1\",accept:t.to(\"acceptedType\"),multiple:t.to(\"allowMultipleFiles\")},on:{change:t.to(()=>{if(this.element&&this.element.files&&this.element.files.length){this.fire(\"done\",this.element.files)}this.element.value=\"\"})}})}open(){this.element.click()}}var QS='';function JS(e){const t=e.map(e=>e.replace(\"+\",\"\\\\+\"));return new RegExp(`^image\\\\/(${t.join(\"|\")})$`)}function ZS(e){return new Promise((t,n)=>{const i=e.getAttribute(\"src\");fetch(i).then(e=>e.blob()).then(e=>{const n=eP(e,i);const o=n.replace(\"image/\",\"\");const r=`image.${o}`;const s=new File([e],r,{type:n});t(s)}).catch(n)})}function XS(e){if(!e.is(\"element\",\"img\")||!e.getAttribute(\"src\")){return false}return e.getAttribute(\"src\").match(/^data:image\\/\\w+;base64,/g)||e.getAttribute(\"src\").match(/^blob:/g)}function eP(e,t){if(e.type){return e.type}else if(t.match(/data:(image\\/\\w+);base64/)){return t.match(/data:(image\\/\\w+);base64/)[1].toLowerCase()}else{return\"image/jpeg\"}}class tP extends sk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(\"imageUpload\",n=>{const i=new GS(n);const o=e.commands.get(\"imageUpload\");const r=e.config.get(\"image.upload.types\");const s=JS(r);i.set({acceptedType:r.map(e=>`image/${e}`).join(\",\"),allowMultipleFiles:true});i.buttonView.set({label:t(\"Insert image\"),icon:QS,tooltip:true});i.buttonView.bind(\"isEnabled\").to(o);i.on(\"done\",(t,n)=>{const i=Array.from(n).filter(e=>s.test(e.type));if(i.length){e.execute(\"imageUpload\",{file:i})}});return i})}}var nP='';var iP=n(90);var oP=n(92);var rP=n(94);class sP extends sk{constructor(e){super(e);this.placeholder=\"data:image/svg+xml;utf8,\"+encodeURIComponent(nP)}init(){const e=this.editor;e.editing.downcastDispatcher.on(\"attribute:uploadStatus:image\",(...e)=>this.uploadStatusChange(...e))}uploadStatusChange(e,t,n){const i=this.editor;const o=t.item;const r=o.getAttribute(\"uploadId\");if(!n.consumable.consume(t.item,e.name)){return}const s=i.plugins.get(Oy);const a=r?t.attributeNewValue:null;const c=this.placeholder;const l=i.editing.mapper.toViewElement(o);const d=n.writer;if(a==\"reading\"){aP(l,d);lP(c,l,d);return}if(a==\"uploading\"){const e=s.loaders.get(r);aP(l,d);if(!e){lP(c,l,d)}else{dP(l,d);uP(l,d,e,i.editing.view);wP(l,d,e)}return}if(a==\"complete\"&&s.loaders.get(r)){fP(l,d,i.editing.view)}hP(l,d);dP(l,d);cP(l,d)}}function aP(e,t){if(!e.hasClass(\"ck-appear\")){t.addClass(\"ck-appear\",e)}}function cP(e,t){t.removeClass(\"ck-appear\",e)}function lP(e,t,n){if(!t.hasClass(\"ck-image-upload-placeholder\")){n.addClass(\"ck-image-upload-placeholder\",t)}const i=A_(t);if(i.getAttribute(\"src\")!==e){n.setAttribute(\"src\",e,i)}if(!pP(t,\"placeholder\")){n.insert(n.createPositionAfter(i),gP(n))}}function dP(e,t){if(e.hasClass(\"ck-image-upload-placeholder\")){t.removeClass(\"ck-image-upload-placeholder\",e)}bP(e,t,\"placeholder\")}function uP(e,t,n,i){const o=mP(t);t.insert(t.createPositionAt(e,\"end\"),o);n.on(\"change:uploadedPercent\",(e,t,n)=>{i.change(e=>{e.setStyle(\"width\",n+\"%\",o)})})}function hP(e,t){bP(e,t,\"progressBar\")}function fP(e,t,n){const i=t.createUIElement(\"div\",{class:\"ck-image-upload-complete-icon\"});t.insert(t.createPositionAt(e,\"end\"),i);setTimeout(()=>{n.change(e=>e.remove(e.createRangeOn(i)))},3e3)}function mP(e){const t=e.createUIElement(\"div\",{class:\"ck-progress-bar\"});e.setCustomProperty(\"progressBar\",true,t);return t}function gP(e){const t=e.createUIElement(\"div\",{class:\"ck-upload-placeholder-loader\"});e.setCustomProperty(\"placeholder\",true,t);return t}function pP(e,t){for(const n of e.getChildren()){if(n.getCustomProperty(t)){return n}}}function bP(e,t,n){const i=pP(e,n);if(i){t.remove(t.createRangeOn(i))}}function wP(e,t,n){if(n.data){const i=A_(e);t.setAttribute(\"src\",n.data,i)}}class kP{constructor(e){this.document=e}createDocumentFragment(e){return new Kl(this.document,e)}createElement(e,t,n){return new Dc(this.document,e,t,n)}createText(e){return new js(this.document,e)}clone(e,t=false){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,n){return n._insertChild(e,t)}removeChildren(e,t,n){return n._removeChildren(e,t)}remove(e){const t=e.parent;if(t){return this.removeChildren(t.getChildIndex(e),1,t)}return[]}replace(e,t){const n=e.parent;if(n){const i=n.getChildIndex(e);this.removeChildren(i,1,n);this.insertChild(i,t,n);return true}return false}unwrapElement(e){const t=e.parent;if(t){const n=t.getChildIndex(e);this.remove(e);this.insertChild(n,e.getChildren(),t)}}rename(e,t){const n=new Dc(this.document,e,t.getAttributes(),t.getChildren());return this.replace(t,n)?n:null}setAttribute(e,t,n){n._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,n){if(O(e)&&n===undefined){n=t}n._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,n){n._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return ul._createAt(e,t)}createPositionAfter(e){return ul._createAfter(e)}createPositionBefore(e){return ul._createBefore(e)}createRange(e,t){return new hl(e,t)}createRangeOn(e){return hl._createOn(e)}createRangeIn(e){return hl._createIn(e)}createSelection(e,t,n){return new gl(e,t,n)}}class _P extends vk{refresh(){this.isEnabled=C_(this.editor.model)}execute(e){const t=this.editor;const n=t.model;const i=t.plugins.get(Oy);n.change(t=>{const o=Array.isArray(e.file)?e.file:[e.file];for(const e of o){vP(t,n,i,e)}})}}function vP(e,t,n,i){const o=n.createLoader(i);if(!o){return}x_(e,t,{uploadId:o.id})}class yP extends sk{static get requires(){return[Oy,Py,gv]}static get pluginName(){return\"ImageUploadEditing\"}constructor(e){super(e);e.config.define(\"image\",{upload:{types:[\"jpeg\",\"png\",\"gif\",\"bmp\",\"webp\",\"tiff\"]}})}init(){const e=this.editor;const t=e.model.document;const n=e.model.schema;const i=e.conversion;const o=e.plugins.get(Oy);const r=JS(e.config.get(\"image.upload.types\"));n.extend(\"image\",{allowAttributes:[\"uploadId\",\"uploadStatus\"]});e.commands.add(\"imageUpload\",new _P(e));i.for(\"upcast\").attributeToAttribute({view:{name:\"img\",key:\"uploadId\"},model:\"uploadId\"});this.listenTo(e.editing.view.document,\"clipboardInput\",(t,n)=>{if(xP(n.dataTransfer)){return}const i=Array.from(n.dataTransfer.files).filter(e=>{if(!e){return false}return r.test(e.type)});const o=n.targetRanges.map(t=>e.editing.mapper.toModelRange(t));e.model.change(n=>{n.setSelection(o);if(i.length){t.stop();e.model.enqueueChange(\"default\",()=>{e.execute(\"imageUpload\",{file:i})})}})});this.listenTo(e.plugins.get(gv),\"inputTransformation\",(t,n)=>{const i=Array.from(e.editing.view.createRangeIn(n.content)).filter(e=>XS(e.item)&&!e.item.getAttribute(\"uploadProcessed\")).map(e=>({promise:ZS(e.item),imageElement:e.item}));if(!i.length){return}const r=new kP(e.editing.view.document);for(const e of i){r.setAttribute(\"uploadProcessed\",true,e.imageElement);const t=o.createLoader(e.promise);if(t){r.setAttribute(\"src\",\"\",e.imageElement);r.setAttribute(\"uploadId\",t.id,e.imageElement)}}});e.editing.view.document.on(\"dragover\",(e,t)=>{t.preventDefault()});t.on(\"change\",()=>{const n=t.differ.getChanges({includeChangesInGraveyard:true});for(const t of n){if(t.type==\"insert\"&&t.name!=\"$text\"){const n=t.position.nodeAfter;const i=t.position.root.rootName==\"$graveyard\";for(const t of CP(e,n)){const e=t.getAttribute(\"uploadId\");if(!e){continue}const n=o.loaders.get(e);if(!n){continue}if(i){n.abort()}else if(n.status==\"idle\"){this._readAndUpload(n,t)}}}}})}_readAndUpload(e,t){const n=this.editor;const i=n.model;const o=n.locale.t;const r=n.plugins.get(Oy);const s=n.plugins.get(Py);i.enqueueChange(\"transparent\",e=>{e.setAttribute(\"uploadStatus\",\"reading\",t)});return e.read().then(()=>{const o=e.upload();if(Tl.isSafari){const e=n.editing.mapper.toViewElement(t);const i=A_(e);n.editing.view.once(\"render\",()=>{if(!i.parent){return}const e=n.editing.view.domConverter.mapViewToDom(i.parent);if(!e){return}const t=e.style.display;e.style.display=\"none\";e._ckHack=e.offsetHeight;e.style.display=t})}i.enqueueChange(\"transparent\",e=>{e.setAttribute(\"uploadStatus\",\"uploading\",t)});return o}).then(e=>{i.enqueueChange(\"transparent\",n=>{n.setAttributes({uploadStatus:\"complete\",src:e.default},t);this._parseAndSetSrcsetAttributeOnImage(e,t,n)});a()}).catch(n=>{if(e.status!==\"error\"&&e.status!==\"aborted\"){throw n}if(e.status==\"error\"&&n){s.showWarning(n,{title:o(\"Upload failed\"),namespace:\"upload\"})}a();i.enqueueChange(\"transparent\",e=>{e.remove(t)})});function a(){i.enqueueChange(\"transparent\",e=>{e.removeAttribute(\"uploadId\",t);e.removeAttribute(\"uploadStatus\",t)});r.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,n){let i=0;const o=Object.keys(e).filter(e=>{const t=parseInt(e,10);if(!isNaN(t)){i=Math.max(i,t);return true}}).map(t=>`${e[t]} ${t}w`).join(\", \");if(o!=\"\"){n.setAttribute(\"srcset\",{data:o,width:i},t)}}}function xP(e){return Array.from(e.types).includes(\"text/html\")&&e.getData(\"text/html\")!==\"\"}function CP(e,t){return Array.from(e.model.createRangeOn(t)).filter(e=>e.item.is(\"element\",\"image\")).map(e=>e.item)}class AP extends sk{static get pluginName(){return\"ImageUpload\"}static get requires(){return[yP,tP,sP]}}class TP extends vk{constructor(e){super(e);this._childCommands=[]}refresh(){}execute(...e){const t=this._getFirstEnabledCommand();return 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 SP extends sk{static get pluginName(){return\"IndentEditing\"}init(){const e=this.editor;e.commands.add(\"indent\",new TP(e));e.commands.add(\"outdent\",new TP(e))}}var PP='';var EP='';class MP extends sk{static get pluginName(){return\"IndentUI\"}init(){const e=this.editor;const t=e.locale;const n=e.t;const i=t.uiLanguageDirection==\"ltr\"?PP:EP;const o=t.uiLanguageDirection==\"ltr\"?EP:PP;this._defineButton(\"indent\",n(\"Increase indent\"),i);this._defineButton(\"outdent\",n(\"Decrease indent\"),o)}_defineButton(e,t,n){const i=this.editor;i.ui.componentFactory.add(e,o=>{const r=i.commands.get(e);const s=new Aw(o);s.set({label:t,icon:n,tooltip:true});s.bind(\"isOn\",\"isEnabled\").to(r,\"value\",\"isEnabled\");this.listenTo(s,\"execute\",()=>{i.execute(e);i.editing.view.focus()});return s})}}class IP extends sk{static get pluginName(){return\"Indent\"}static get requires(){return[SP,MP]}}const NP=\"italic\";class RP extends sk{static get pluginName(){return\"ItalicEditing\"}init(){const e=this.editor;e.model.schema.extend(\"$text\",{allowAttributes:NP});e.model.schema.setAttributeProperties(NP,{isFormatting:true,copyOnEnter:true});e.conversion.attributeToElement({model:NP,view:\"i\",upcastAlso:[\"em\",{styles:{\"font-style\":\"italic\"}}]});e.commands.add(NP,new Nk(e,NP));e.keystrokes.set(\"CTRL+I\",NP)}}var OP='';const zP=\"italic\";class VP extends sk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(zP,n=>{const i=e.commands.get(zP);const o=new Aw(n);o.set({label:t(\"Italic\"),icon:OP,keystroke:\"CTRL+I\",tooltip:true,isToggleable:true});o.bind(\"isOn\",\"isEnabled\").to(i,\"value\",\"isEnabled\");this.listenTo(o,\"execute\",()=>{e.execute(zP);e.editing.view.focus()});return o})}}class LP extends sk{static get requires(){return[RP,VP]}static get pluginName(){return\"Italic\"}}class DP extends eh{constructor(e){super(e);this.domEventType=\"click\"}onDomEvent(e){this.fire(e.type,e)}}var BP=n(96);class jP extends Bb{constructor(e,t,n){super(e);const i=e.t;this.focusTracker=new Yp;this.keystrokes=new Op;this.urlInputView=this._createUrlInput(n);this.saveButtonView=this._createButton(i(\"Save\"),vT,\"ck-button-save\");this.saveButtonView.type=\"submit\";this.cancelButtonView=this._createButton(i(\"Cancel\"),yT,\"ck-button-cancel\",\"cancel\");this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t);this.children=this._createFormChildren(t.manualDecorators);this._focusables=new lb;this._focusCycler=new nw({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:\"shift + tab\",focusNext:\"tab\"}});const o=[\"ck\",\"ck-link-form\"];if(t.manualDecorators.length){o.push(\"ck-link-form_layout-vertical\")}this.setTemplate({tag:\"form\",attributes:{class:o,tabindex:\"-1\"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((e,t)=>{e[t.name]=t.isOn;return e},{})}render(){super.render();_T({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(e=\"https://\"){const t=this.locale.t;const n=new gT(this.locale,wT);n.label=t(\"Link URL\");n.fieldView.placeholder=e+\"example.com\";return n}_createButton(e,t,n,i){const o=new Aw(this.locale);o.set({label:e,icon:t,tooltip:true});o.extendTemplate({attributes:{class:n}});if(i){o.delegate(\"execute\").to(this,i)}return o}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const n of e.manualDecorators){const i=new Rw(this.locale);i.set({name:n.id,label:n.label,withText:true});i.bind(\"isOn\").toMany([n,e],\"value\",(e,t)=>t===undefined&&e===undefined?n.defaultValue:e);i.on(\"execute\",()=>{n.set(\"value\",!i.isOn)});t.add(i)}return t}_createFormChildren(e){const t=this.createCollection();t.add(this.urlInputView);if(e.length){const e=new Bb;e.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(e)}t.add(this.saveButtonView);t.add(this.cancelButtonView);return t}}var FP='';var HP='';var WP=n(98);class UP extends Bb{constructor(e){super(e);const t=e.t;this.focusTracker=new Yp;this.keystrokes=new Op;this.previewButtonView=this._createPreviewButton();this.unlinkButtonView=this._createButton(t(\"Unlink\"),FP,\"unlink\");this.editButtonView=this._createButton(t(\"Edit link\"),HP,\"edit\");this.set(\"href\");this._focusables=new lb;this._focusCycler=new nw({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\"],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,n){const i=new Aw(this.locale);i.set({label:e,icon:t,tooltip:true});i.delegate(\"execute\").to(this,n);return i}_createPreviewButton(){const e=new Aw(this.locale);const t=this.bindTemplate;const n=this.t;e.set({withText:true,tooltip:n(\"Open link in new tab\")});e.extendTemplate({attributes:{class:[\"ck\",\"ck-link-actions__preview\"],href:t.to(\"href\",e=>e&&dy(e)),target:\"_blank\",rel:\"noopener noreferrer\"}});e.bind(\"label\").to(this,\"href\",e=>e||n(\"This link has no URL\"));e.bind(\"isEnabled\").to(this,\"href\",e=>!!e);e.template.tag=\"a\";e.template.eventListeners={};return e}}var qP='';const $P=/^((\\w+:(\\/{2,})?)|(\\W))/i;const YP=/[\\w-]+@[\\w-]+\\.+[\\w-]+/i;const GP=\"link-ui\";class KP extends sk{static get requires(){return[MT]}static get pluginName(){return\"LinkUI\"}init(){const e=this.editor;e.editing.view.addObserver(DP);this.actionsView=this._createActionsView();this.formView=this._createFormView();this._balloon=e.plugins.get(MT);this._createToolbarLinkButton();this._enableUserBalloonInteractions();e.conversion.for(\"editingDowncast\").markerToHighlight({model:GP,view:{classes:[\"ck-fake-link-selection\"]}});e.conversion.for(\"editingDowncast\").markerToElement({model:GP,view:{name:\"span\",classes:[\"ck-fake-link-selection\",\"ck-fake-link-selection_collapsed\"]}})}destroy(){super.destroy();this.formView.destroy()}_createActionsView(){const e=this.editor;const t=new UP(e.locale);const n=e.commands.get(\"link\");const i=e.commands.get(\"unlink\");t.bind(\"href\").to(n,\"value\");t.editButtonView.bind(\"isEnabled\").to(n);t.unlinkButtonView.bind(\"isEnabled\").to(i);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(ay,(e,t)=>{this._addFormView();t()});return t}_createFormView(){const e=this.editor;const t=e.commands.get(\"link\");const n=e.config.get(\"link.defaultProtocol\");const i=new jP(e.locale,t,n);i.urlInputView.fieldView.bind(\"value\").to(t,\"value\");i.urlInputView.bind(\"isReadOnly\").to(t,\"isEnabled\",e=>!e);i.saveButtonView.bind(\"isEnabled\").to(t);this.listenTo(i,\"submit\",()=>{const{value:t}=i.urlInputView.fieldView.element;const o=!!n&&!$P.test(t);const r=YP.test(t);const s=r?\"mailto:\":n;const a=t&&o?s+t:t;e.execute(\"link\",a,i.getDecoratorSwitchesState());this._closeFormView()});this.listenTo(i,\"cancel\",()=>{this._closeFormView()});i.keystrokes.set(\"Esc\",(e,t)=>{this._closeFormView();t()});return i}_createToolbarLinkButton(){const e=this.editor;const t=e.commands.get(\"link\");const n=e.t;e.keystrokes.set(ay,(e,t)=>{t();this._showUI(true)});e.ui.componentFactory.add(\"link\",e=>{const i=new Aw(e);i.isEnabled=true;i.label=n(\"Link\");i.icon=qP;i.keystroke=ay;i.tooltip=true;i.isToggleable=true;i.bind(\"isEnabled\").to(t,\"isEnabled\");i.bind(\"isOn\").to(t,\"value\",e=>!!e);this.listenTo(i,\"execute\",()=>this._showUI(true));return i})}_enableUserBalloonInteractions(){const e=this.editor.editing.view.document;this.listenTo(e,\"click\",()=>{const e=this._getSelectedLinkElement();if(e){this._showUI()}});this.editor.keystrokes.set(\"Tab\",(e,t)=>{if(this._areActionsVisible&&!this.actionsView.focusTracker.isFocused){this.actionsView.focus();t()}},{priority:\"high\"});this.editor.keystrokes.set(\"Esc\",(e,t)=>{if(this._isUIVisible){this._hideUI();t()}});Ow({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){if(this._areActionsInPanel){return}this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel){return}const e=this.editor;const t=e.commands.get(\"link\");this._balloon.add({view:this.formView,position:this._getBalloonPositionData()});if(this._balloon.visibleView===this.formView){this.formView.urlInputView.fieldView.select()}this.formView.urlInputView.fieldView.element.value=t.value||\"\"}_closeFormView(){const e=this.editor.commands.get(\"link\");e.restoreManualDecoratorStates();if(e.value!==undefined){this._removeFormView()}else{this._hideUI()}}_removeFormView(){if(this._isFormInPanel){this.formView.saveButtonView.focus();this._balloon.remove(this.formView);this.editor.editing.view.focus();this._hideFakeVisualSelection()}}_showUI(e=false){if(!this._getSelectedLinkElement()){this._addActionsView();if(e){this._balloon.showStack(\"main\")}this._addFormView();this._showFakeVisualSelection()}else{if(this._areActionsVisible){this._addFormView()}else{this._addActionsView()}if(e){this._balloon.showStack(\"main\")}}this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel){return}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(){const e=this.editor;const t=e.editing.view.document;let n=this._getSelectedLinkElement();let i=r();const o=()=>{const e=this._getSelectedLinkElement();const t=r();if(n&&!e||!n&&t!==i){this._hideUI()}else if(this._isUIVisible){this._balloon.updatePosition(this._getBalloonPositionData())}n=e;i=t};function r(){return t.selection.focus.getAncestors().reverse().find(e=>e.is(\"element\"))}this.listenTo(e.ui,\"update\",o);this.listenTo(this._balloon,\"change:visibleView\",o)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){const e=this._balloon.visibleView;return e==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view;const t=e.document;const n=this._getSelectedLinkElement();const i=n?e.domConverter.mapViewToDom(n):e.domConverter.viewRangeToDom(t.selection.getFirstRange());return{target:i}}_getSelectedLinkElement(){const e=this.editor.editing.view;const t=e.document.selection;if(t.isCollapsed){return QP(t.getFirstPosition())}else{const n=t.getFirstRange().getTrimmed();const i=QP(n.start);const o=QP(n.end);if(!i||i!=o){return null}if(e.createRangeIn(i).getTrimmed().isEqual(n)){return i}else{return null}}}_showFakeVisualSelection(){const e=this.editor.model;e.change(t=>{if(e.markers.has(GP)){t.updateMarker(GP,{range:e.document.selection.getFirstRange()})}else{t.addMarker(GP,{usingOperation:false,affectsData:false,range:e.document.selection.getFirstRange()})}})}_hideFakeVisualSelection(){const e=this.editor.model;if(e.markers.has(GP)){e.change(e=>{e.removeMarker(GP)})}}}function QP(e){return e.getAncestors().find(e=>cy(e))}class JP extends sk{static get requires(){return[xy,KP]}static get pluginName(){return\"Link\"}}class ZP extends vk{constructor(e,t){super(e);this.type=t}refresh(){this.value=this._getValue();this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model;const t=e.document;const n=Array.from(t.selection.getSelectedBlocks()).filter(t=>eE(t,e.schema));const i=this.value===true;e.change(e=>{if(i){let t=n[n.length-1].nextSibling;let i=Number.POSITIVE_INFINITY;let o=[];while(t&&t.name==\"listItem\"&&t.getAttribute(\"listIndent\")!==0){const e=t.getAttribute(\"listIndent\");if(e=n){if(r>o.getAttribute(\"listIndent\")){r=o.getAttribute(\"listIndent\")}if(o.getAttribute(\"listIndent\")==r){e[t?\"unshift\":\"push\"](o)}o=o[t?\"previousSibling\":\"nextSibling\"]}}}function eE(e,t){return t.checkChild(e.parent,\"listItem\")&&!t.isObject(e)}class tE extends vk{constructor(e,t){super(e);this._indentBy=t==\"forward\"?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model;const t=e.document;let n=Array.from(t.selection.getSelectedBlocks());e.change(e=>{const t=n[n.length-1];let i=t.nextSibling;while(i&&i.name==\"listItem\"&&i.getAttribute(\"listIndent\")>t.getAttribute(\"listIndent\")){n.push(i);i=i.nextSibling}if(this._indentBy<0){n=n.reverse()}for(const t of n){const n=t.getAttribute(\"listIndent\")+this._indentBy;if(n<0){e.rename(t,\"paragraph\")}else{e.setAttribute(\"listIndent\",n,t)}}})}_checkEnabled(){const e=tk(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is(\"element\",\"listItem\")){return false}if(this._indentBy>0){const t=e.getAttribute(\"listIndent\");const n=e.getAttribute(\"listType\");let i=e.previousSibling;while(i&&i.is(\"element\",\"listItem\")&&i.getAttribute(\"listIndent\")>=t){if(i.getAttribute(\"listIndent\")==t){return i.getAttribute(\"listType\")==n}i=i.previousSibling}return false}return true}}function nE(e){const t=e.createContainerElement(\"li\");t.getFillerOffset=dE;return t}function iE(e,t){const n=t.mapper;const i=t.writer;const o=e.getAttribute(\"listType\")==\"numbered\"?\"ol\":\"ul\";const r=nE(i);const s=i.createContainerElement(o,null);i.insert(i.createPositionAt(s,0),r);n.bindElements(e,r);return r}function oE(e,t,n,i){const o=t.parent;const r=n.mapper;const s=n.writer;let a=r.toViewPosition(i.createPositionBefore(e));const c=aE(e.previousSibling,{sameIndent:true,smallerIndent:true,listIndent:e.getAttribute(\"listIndent\")});const l=e.previousSibling;if(c&&c.getAttribute(\"listIndent\")==e.getAttribute(\"listIndent\")){const e=r.toViewElement(c);a=s.breakContainer(s.createPositionAfter(e))}else{if(l&&l.name==\"listItem\"){a=r.toViewPosition(i.createPositionAt(l,\"end\"));const e=r.findMappedViewAncestor(a);const t=lE(e);if(t){a=s.createPositionBefore(t)}else{a=s.createPositionAt(e,\"end\")}}else{a=r.toViewPosition(i.createPositionBefore(e))}}a=sE(a);s.insert(a,o);if(l&&l.name==\"listItem\"){const e=r.toViewElement(l);const n=s.createRange(s.createPositionAt(e,0),a);const i=n.getWalker({ignoreElementEnd:true});for(const e of i){if(e.item.is(\"element\",\"li\")){const n=s.breakContainer(s.createPositionBefore(e.item));const o=e.item.parent;const r=s.createPositionAt(t,\"end\");rE(s,r.nodeBefore,r.nodeAfter);s.move(s.createRangeOn(o),r);i.position=n}}}else{const n=o.nextSibling;if(n&&(n.is(\"element\",\"ul\")||n.is(\"element\",\"ol\"))){let i=null;for(const t of n.getChildren()){const n=r.toModelElement(t);if(n&&n.getAttribute(\"listIndent\")>e.getAttribute(\"listIndent\")){i=t}else{break}}if(i){s.breakContainer(s.createPositionAfter(i));s.move(s.createRangeOn(i.parent),s.createPositionAt(t,\"end\"))}}}rE(s,o,o.nextSibling);rE(s,o.previousSibling,o)}function rE(e,t,n){if(!t||!n||t.name!=\"ul\"&&t.name!=\"ol\"){return null}if(t.name!=n.name||t.getAttribute(\"class\")!==n.getAttribute(\"class\")){return null}return e.mergeContainers(e.createPositionAfter(t))}function sE(e){return e.getLastMatchingPosition(e=>e.item.is(\"uiElement\"))}function aE(e,t){const n=!!t.sameIndent;const i=!!t.smallerIndent;const o=t.listIndent;let r=e;while(r&&r.name==\"listItem\"){const e=r.getAttribute(\"listIndent\");if(n&&o==e||i&&o>e){return r}r=r.previousSibling}return null}function cE(e,t,n,i){e.ui.componentFactory.add(t,o=>{const r=e.commands.get(t);const s=new Aw(o);s.set({label:n,icon:i,tooltip:true,isToggleable:true});s.bind(\"isOn\",\"isEnabled\").to(r,\"value\",\"isEnabled\");s.on(\"execute\",()=>{e.execute(t);e.editing.view.focus()});return s})}function lE(e){for(const t of e.getChildren()){if(t.name==\"ul\"||t.name==\"ol\"){return t}}return null}function dE(){const e=!this.isEmpty&&(this.getChild(0).name==\"ul\"||this.getChild(0).name==\"ol\");if(this.isEmpty||e){return 0}return Wc.call(this)}function uE(e){return(t,n,i)=>{const o=i.consumable;if(!o.test(n.item,\"insert\")||!o.test(n.item,\"attribute:listType\")||!o.test(n.item,\"attribute:listIndent\")){return}o.consume(n.item,\"insert\");o.consume(n.item,\"attribute:listType\");o.consume(n.item,\"attribute:listIndent\");const r=n.item;const s=iE(r,i);oE(r,s,i,e)}}function hE(e){return(t,n,i)=>{const o=i.mapper.toViewPosition(n.position);const r=o.getLastMatchingPosition(e=>!e.item.is(\"element\",\"li\"));const s=r.nodeAfter;const a=i.writer;a.breakContainer(a.createPositionBefore(s));a.breakContainer(a.createPositionAfter(s));const c=s.parent;const l=c.previousSibling;const d=a.createRangeOn(c);const u=a.remove(d);if(l&&l.nextSibling){rE(a,l,l.nextSibling)}const h=i.mapper.toModelElement(s);SE(h.getAttribute(\"listIndent\")+1,n.position,d.start,s,i,e);for(const e of a.createRangeIn(u).getItems()){i.mapper.unbindViewElement(e)}t.stop()}}function fE(e,t,n){if(!n.consumable.consume(t.item,\"attribute:listType\")){return}const i=n.mapper.toViewElement(t.item);const o=n.writer;o.breakContainer(o.createPositionBefore(i));o.breakContainer(o.createPositionAfter(i));const r=i.parent;const s=t.attributeNewValue==\"numbered\"?\"ol\":\"ul\";o.rename(s,r)}function mE(e,t,n){const i=n.mapper.toViewElement(t.item);const o=i.parent;const r=n.writer;rE(r,o,o.nextSibling);rE(r,o.previousSibling,o);for(const e of t.item.getChildren()){n.consumable.consume(e,\"insert\")}}function gE(e){return(t,n,i)=>{if(!i.consumable.consume(n.item,\"attribute:listIndent\")){return}const o=i.mapper.toViewElement(n.item);const r=i.writer;r.breakContainer(r.createPositionBefore(o));r.breakContainer(r.createPositionAfter(o));const s=o.parent;const a=s.previousSibling;const c=r.createRangeOn(s);r.remove(c);if(a&&a.nextSibling){rE(r,a,a.nextSibling)}SE(n.attributeOldValue+1,n.range.start,c.start,o,i,e);oE(n.item,o,i,e);for(const e of n.item.getChildren()){i.consumable.consume(e,\"insert\")}}}function pE(e,t,n){if(t.item.name!=\"listItem\"){let e=n.mapper.toViewPosition(t.range.start);const i=n.writer;const o=[];while(e.parent.name==\"ul\"||e.parent.name==\"ol\"){e=i.breakContainer(e);if(e.parent.name!=\"li\"){break}const t=e;const n=i.createPositionAt(e.parent,\"end\");if(!t.isEqual(n)){const e=i.remove(i.createRange(t,n));o.push(e)}e=i.createPositionAfter(e.parent)}if(o.length>0){for(let t=0;t0){const t=rE(i,n,n.nextSibling);if(t&&t.parent==n){e.offset--}}}rE(i,e.nodeBefore,e.nodeAfter)}}}function bE(e,t,n){const i=n.mapper.toViewPosition(t.position);const o=i.nodeBefore;const r=i.nodeAfter;rE(n.writer,o,r)}function wE(e,t,n){if(n.consumable.consume(t.viewItem,{name:true})){const e=n.writer;const i=e.createElement(\"listItem\");const o=EE(t.viewItem);e.setAttribute(\"listIndent\",o,i);const r=t.viewItem.parent&&t.viewItem.parent.name==\"ol\"?\"numbered\":\"bulleted\";e.setAttribute(\"listType\",r,i);const s=n.splitToAllowedParent(i,t.modelCursor);if(!s){return}e.insert(i,s.position);const a=AE(i,t.viewItem.getChildren(),n);t.modelRange=e.createRange(t.modelCursor,a);if(s.cursorParent){t.modelCursor=e.createPositionAt(s.cursorParent,0)}else{t.modelCursor=t.modelRange.end}}}function kE(e,t,n){if(n.consumable.test(t.viewItem,{name:true})){const e=Array.from(t.viewItem.getChildren());for(const t of e){const e=!(t.is(\"element\",\"li\")||PE(t));if(e){t._remove()}}}}function _E(e,t,n){if(n.consumable.test(t.viewItem,{name:true})){if(t.viewItem.childCount===0){return}const e=[...t.viewItem.getChildren()];let n=false;let i=true;for(const t of e){if(n&&!PE(t)){t._remove()}if(t.is(\"$text\")){if(i){t._data=t.data.replace(/^\\s+/,\"\")}if(!t.nextSibling||PE(t.nextSibling)){t._data=t.data.replace(/\\s+$/,\"\")}}else if(PE(t)){n=true}i=false}}}function vE(e){return(t,n)=>{if(n.isPhantom){return}const i=n.modelPosition.nodeBefore;if(i&&i.is(\"element\",\"listItem\")){const t=n.mapper.toViewElement(i);const o=t.getAncestors().find(PE);const r=e.createPositionAt(t,0).getWalker();for(const e of r){if(e.type==\"elementStart\"&&e.item.is(\"element\",\"li\")){n.viewPosition=e.previousPosition;break}else if(e.type==\"elementEnd\"&&e.item==o){n.viewPosition=e.nextPosition;break}}}}}function yE(e){return(t,n)=>{const i=n.viewPosition;const o=i.parent;const r=n.mapper;if(o.name==\"ul\"||o.name==\"ol\"){if(!i.isAtEnd){const t=r.toModelElement(i.nodeAfter);n.modelPosition=e.createPositionBefore(t)}else{const t=r.toModelElement(i.nodeBefore);const o=r.getModelLength(i.nodeBefore);n.modelPosition=e.createPositionBefore(t).getShiftedBy(o)}t.stop()}else if(o.name==\"li\"&&i.nodeBefore&&(i.nodeBefore.name==\"ul\"||i.nodeBefore.name==\"ol\")){const s=r.toModelElement(o);let a=1;let c=i.nodeBefore;while(c&&PE(c)){a+=r.getModelLength(c);c=c.previousSibling}n.modelPosition=e.createPositionBefore(s).getShiftedBy(a);t.stop()}}}function xE(e,t){const n=e.document.differ.getChanges();const i=new Map;let o=false;for(const i of n){if(i.type==\"insert\"&&i.name==\"listItem\"){r(i.position)}else if(i.type==\"insert\"&&i.name!=\"listItem\"){if(i.name!=\"$text\"){const n=i.position.nodeAfter;if(n.hasAttribute(\"listIndent\")){t.removeAttribute(\"listIndent\",n);o=true}if(n.hasAttribute(\"listType\")){t.removeAttribute(\"listType\",n);o=true}for(const t of Array.from(e.createRangeIn(n)).filter(e=>e.item.is(\"element\",\"listItem\"))){r(t.previousPosition)}}const n=i.position.getShiftedBy(i.length);r(n)}else if(i.type==\"remove\"&&i.name==\"listItem\"){r(i.position)}else if(i.type==\"attribute\"&&i.attributeKey==\"listIndent\"){r(i.range.start)}else if(i.type==\"attribute\"&&i.attributeKey==\"listType\"){r(i.range.start)}}for(const e of i.values()){s(e);a(e)}return o;function r(e){const t=e.nodeBefore;if(!t||!t.is(\"element\",\"listItem\")){const t=e.nodeAfter;if(t&&t.is(\"element\",\"listItem\")){i.set(t,t)}}else{let e=t;if(i.has(e)){return}for(let t=e.previousSibling;t&&t.is(\"element\",\"listItem\");t=e.previousSibling){e=t;if(i.has(e)){return}}i.set(t,e)}}function s(e){let n=0;let i=null;while(e&&e.is(\"element\",\"listItem\")){const r=e.getAttribute(\"listIndent\");if(r>n){let s;if(i===null){i=r-n;s=n}else{if(i>r){i=r}s=r-i}t.setAttribute(\"listIndent\",s,e);o=true}else{i=null;n=e.getAttribute(\"listIndent\")+1}e=e.nextSibling}}function a(e){let n=[];let i=null;while(e&&e.is(\"element\",\"listItem\")){const r=e.getAttribute(\"listIndent\");if(i&&i.getAttribute(\"listIndent\")>r){n=n.slice(0,r+1)}if(r!=0){if(n[r]){const i=n[r];if(e.getAttribute(\"listType\")!=i){t.setAttribute(\"listType\",i,e);o=true}}else{n[r]=e.getAttribute(\"listType\")}}i=e;e=e.nextSibling}}}function CE(e,[t,n]){let i=t.is(\"documentFragment\")?t.getChild(0):t;let o;if(!n){o=this.document.selection}else{o=this.createSelection(n)}if(i&&i.is(\"element\",\"listItem\")){const e=o.getFirstPosition();let t=null;if(e.parent.is(\"element\",\"listItem\")){t=e.parent}else if(e.nodeBefore&&e.nodeBefore.is(\"element\",\"listItem\")){t=e.nodeBefore}if(t){const e=t.getAttribute(\"listIndent\");if(e>0){while(i&&i.is(\"element\",\"listItem\")){i._setAttribute(\"listIndent\",i.getAttribute(\"listIndent\")+e);i=i.nextSibling}}}}}function AE(e,t,n){const{writer:i,schema:o}=n;let r=i.createPositionAfter(e);for(const s of t){if(s.name==\"ul\"||s.name==\"ol\"){r=n.convertItem(s,r).modelCursor}else{const t=n.convertItem(s,i.createPositionAt(e,\"end\"));const a=t.modelRange.start.nodeAfter;const c=a&&a.is(\"element\")&&!o.checkChild(e,a.name);if(c){if(t.modelCursor.parent.is(\"element\",\"listItem\")){e=t.modelCursor.parent}else{e=TE(t.modelCursor)}r=i.createPositionAfter(e)}}}return r}function TE(e){const t=new Gh({startPosition:e});let n;do{n=t.next()}while(!n.value.item.is(\"element\",\"listItem\"));return n.value.item}function SE(e,t,n,i,o,r){const s=aE(t.nodeBefore,{sameIndent:true,smallerIndent:true,listIndent:e,foo:\"b\"});const a=o.mapper;const c=o.writer;const l=s?s.getAttribute(\"listIndent\"):null;let d;if(!s){d=n}else if(l==e){const e=a.toViewElement(s).parent;d=c.createPositionAfter(e)}else{const e=r.createPositionAt(s,\"end\");d=a.toViewPosition(e)}d=sE(d);for(const e of[...i.getChildren()]){if(PE(e)){d=c.move(c.createRangeOn(e),d).end;rE(c,e,e.nextSibling);rE(c,e.previousSibling,e)}}}function PE(e){return e.is(\"element\",\"ol\")||e.is(\"element\",\"ul\")}function EE(e){let t=0;let n=e.parent;while(n){if(n.is(\"element\",\"li\")){t++}else{const e=n.previousSibling;if(e&&e.is(\"element\",\"li\")){t++}}n=n.parent}return t}class ME extends sk{static get pluginName(){return\"ListEditing\"}static get requires(){return[wA]}init(){const e=this.editor;e.model.schema.register(\"listItem\",{inheritAllFrom:\"$block\",allowAttributes:[\"listType\",\"listIndent\"]});const t=e.data;const n=e.editing;e.model.document.registerPostFixer(t=>xE(e.model,t));n.mapper.registerViewToModelLength(\"li\",IE);t.mapper.registerViewToModelLength(\"li\",IE);n.mapper.on(\"modelToViewPosition\",vE(n.view));n.mapper.on(\"viewToModelPosition\",yE(e.model));t.mapper.on(\"modelToViewPosition\",vE(n.view));e.conversion.for(\"editingDowncast\").add(t=>{t.on(\"insert\",pE,{priority:\"high\"});t.on(\"insert:listItem\",uE(e.model));t.on(\"attribute:listType:listItem\",fE,{priority:\"high\"});t.on(\"attribute:listType:listItem\",mE,{priority:\"low\"});t.on(\"attribute:listIndent:listItem\",gE(e.model));t.on(\"remove:listItem\",hE(e.model));t.on(\"remove\",bE,{priority:\"low\"})});e.conversion.for(\"dataDowncast\").add(t=>{t.on(\"insert\",pE,{priority:\"high\"});t.on(\"insert:listItem\",uE(e.model))});e.conversion.for(\"upcast\").add(e=>{e.on(\"element:ul\",kE,{priority:\"high\"});e.on(\"element:ol\",kE,{priority:\"high\"});e.on(\"element:li\",_E,{priority:\"high\"});e.on(\"element:li\",wE)});e.model.on(\"insertContent\",CE,{priority:\"high\"});e.commands.add(\"numberedList\",new ZP(e,\"numbered\"));e.commands.add(\"bulletedList\",new ZP(e,\"bulleted\"));e.commands.add(\"indentList\",new tE(e,\"forward\"));e.commands.add(\"outdentList\",new tE(e,\"backward\"));const i=n.view.document;this.listenTo(i,\"enter\",(e,t)=>{const n=this.editor.model.document;const i=n.selection.getLastPosition().parent;if(n.selection.isCollapsed&&i.name==\"listItem\"&&i.isEmpty){this.editor.execute(\"outdentList\");t.preventDefault();e.stop()}});this.listenTo(i,\"delete\",(e,t)=>{if(t.direction!==\"backward\"){return}const n=this.editor.model.document.selection;if(!n.isCollapsed){return}const i=n.getFirstPosition();if(!i.isAtStart){return}const o=i.parent;if(o.name!==\"listItem\"){return}const r=o.previousSibling&&o.previousSibling.name===\"listItem\";if(r){return}this.editor.execute(\"outdentList\");t.preventDefault();e.stop()},{priority:\"high\"});const o=e=>(t,n)=>{const i=this.editor.commands.get(e);if(i.isEnabled){this.editor.execute(e);n()}};e.keystrokes.set(\"Tab\",o(\"indentList\"));e.keystrokes.set(\"Shift+Tab\",o(\"outdentList\"))}afterInit(){const e=this.editor.commands;const t=e.get(\"indent\");const n=e.get(\"outdent\");if(t){t.registerChildCommand(e.get(\"indentList\"))}if(n){n.registerChildCommand(e.get(\"outdentList\"))}}}function IE(e){let t=1;for(const n of e.getChildren()){if(n.name==\"ul\"||n.name==\"ol\"){for(const e of n.getChildren()){t+=IE(e)}}}return t}var NE='';var RE='';class OE extends sk{init(){const e=this.editor.t;cE(this.editor,\"numberedList\",e(\"Numbered List\"),NE);cE(this.editor,\"bulletedList\",e(\"Bulleted List\"),RE)}}class zE extends sk{static get requires(){return[ME,OE]}static get pluginName(){return\"List\"}}function VE(e,t){return e=>{e.on(\"attribute:url:media\",n)};function n(n,i,o){if(!o.consumable.consume(i.item,n.name)){return}const r=i.attributeNewValue;const s=o.writer;const a=o.mapper.toViewElement(i.item);const c=[...a.getChildren()].find(e=>e.getCustomProperty(\"media-content\"));s.remove(c);const l=e.getMediaViewElement(s,r,t);s.insert(s.createPositionAt(a,0),l)}}function LE(e,t,n){t.setCustomProperty(\"media\",true,e);return l_(e,t,{label:n})}function DE(e){const t=e.getSelectedElement();if(t&&BE(t)){return t}return null}function BE(e){return!!e.getCustomProperty(\"media\")&&c_(e)}function jE(e,t,n,i){const o=e.createContainerElement(\"figure\",{class:\"media\"});e.insert(e.createPositionAt(o,0),t.getMediaViewElement(e,n,i));return o}function FE(e){const t=e.getSelectedElement();if(t&&t.is(\"element\",\"media\")){return t}return null}function HE(e,t,n){e.change(i=>{const o=i.createElement(\"media\",{url:t});e.insertContent(o,n);i.setSelection(o,\"on\")})}class WE extends vk{refresh(){const e=this.editor.model;const t=e.document.selection;const n=e.schema;const i=t.getFirstPosition();const o=FE(t);let r=i.parent;if(r!=r.root){r=r.parent}this.value=o?o.getAttribute(\"url\"):null;this.isEnabled=n.checkChild(r,\"media\")}execute(e){const t=this.editor.model;const n=t.document.selection;const i=FE(n);if(i){t.change(t=>{t.setAttribute(\"url\",e,i)})}else{const i=m_(n,t);HE(t,e,i)}}}var UE='';const qE=\"0 0 64 42\";class $E{constructor(e,t){const n=t.providers;const i=t.extraProviders||[];const o=new Set(t.removeProviders);const r=n.concat(i).filter(e=>{const t=e.name;if(!t){console.warn(Object(ss[\"a\"])(\"media-embed-no-provider-name: The configured media provider has no name and cannot be used.\"),{provider:e});return false}return!o.has(t)});this.locale=e;this.providerDefinitions=r}hasMedia(e){return!!this._getMedia(e)}getMediaViewElement(e,t,n){return this._getMedia(t).getViewElement(e,n)}_getMedia(e){if(!e){return new YE(this.locale)}e=e.trim();for(const t of this.providerDefinitions){const n=t.html;let i=t.url;if(!Array.isArray(i)){i=[i]}for(const t of i){const i=this._getUrlMatches(e,t);if(i){return new YE(this.locale,e,i,n)}}}return null}_getUrlMatches(e,t){let n=e.match(t);if(n){return n}let i=e.replace(/^https?:\\/\\//,\"\");n=i.match(t);if(n){return n}i=i.replace(/^www\\./,\"\");n=i.match(t);if(n){return n}return null}}class YE{constructor(e,t,n,i){this.url=this._getValidUrl(t);this._t=e.t;this._match=n;this._previewRenderer=i}getViewElement(e,t){const n={};let i;if(t.renderForEditingView||t.renderMediaPreview&&this.url&&this._previewRenderer){if(this.url){n[\"data-oembed-url\"]=this.url}if(t.renderForEditingView){n.class=\"ck-media__wrapper\"}const o=this._getPreviewHtml(t);i=e.createRawElement(\"div\",n,(function(e){e.innerHTML=o}))}else{if(this.url){n.url=this.url}i=e.createEmptyElement(\"oembed\",n)}e.setCustomProperty(\"media-content\",true,i);return i}_getPreviewHtml(e){if(this._previewRenderer){return this._previewRenderer(this._match)}else{if(this.url&&e.renderForEditingView){return this._getPlaceholderHtml()}return\"\"}}_getPlaceholderHtml(){const e=new xw;const t=new vw;e.text=this._t(\"Open media in new tab\");t.content=UE;t.viewBox=qE;const n=new hb({tag:\"div\",attributes:{class:\"ck ck-reset_all ck-media__placeholder\"},children:[{tag:\"div\",attributes:{class:\"ck-media__placeholder__icon\"},children:[t]},{tag:\"a\",attributes:{class:\"ck-media__placeholder__url\",target:\"_blank\",rel:\"noopener noreferrer\",href:this.url},children:[{tag:\"span\",attributes:{class:\"ck-media__placeholder__url__text\"},children:[this.url]},e]}]}).render();return n.outerHTML}_getValidUrl(e){if(!e){return null}if(e.match(/^https?/)){return e}return\"https://\"+e}}var GE=n(100);class KE extends sk{static get pluginName(){return\"MediaEmbedEditing\"}constructor(e){super(e);e.config.define(\"mediaEmbed\",{providers:[{name:\"dailymotion\",url:/^dailymotion\\.com\\/video\\/(\\w+)/,html:e=>{const t=e[1];return'
'+`\"+\"
\"}},{name:\"spotify\",url:[/^open\\.spotify\\.com\\/(artist\\/\\w+)/,/^open\\.spotify\\.com\\/(album\\/\\w+)/,/^open\\.spotify\\.com\\/(track\\/\\w+)/],html:e=>{const t=e[1];return'
'+`\"+\"
\"}},{name:\"youtube\",url:[/^(?:m\\.)?youtube\\.com\\/watch\\?v=([\\w-]+)/,/^(?:m\\.)?youtube\\.com\\/v\\/([\\w-]+)/,/^youtube\\.com\\/embed\\/([\\w-]+)/,/^youtu\\.be\\/([\\w-]+)/],html:e=>{const t=e[1];return'
'+`\"+\"
\"}},{name:\"vimeo\",url:[/^vimeo\\.com\\/(\\d+)/,/^vimeo\\.com\\/[^/]+\\/[^/]+\\/video\\/(\\d+)/,/^vimeo\\.com\\/album\\/[^/]+\\/video\\/(\\d+)/,/^vimeo\\.com\\/channels\\/[^/]+\\/(\\d+)/,/^vimeo\\.com\\/groups\\/[^/]+\\/videos\\/(\\d+)/,/^vimeo\\.com\\/ondemand\\/[^/]+\\/(\\d+)/,/^player\\.vimeo\\.com\\/video\\/(\\d+)/],html:e=>{const t=e[1];return'
'+`\"+\"
\"}},{name:\"instagram\",url:/^instagram\\.com\\/p\\/(\\w+)/},{name:\"twitter\",url:/^twitter\\.com/},{name:\"googleMaps\",url:/^google\\.com\\/maps/},{name:\"flickr\",url:/^flickr\\.com/},{name:\"facebook\",url:/^facebook\\.com/}]});this.registry=new $E(e.locale,e.config.get(\"mediaEmbed\"))}init(){const e=this.editor;const t=e.model.schema;const n=e.t;const i=e.conversion;const o=e.config.get(\"mediaEmbed.previewsInData\");const r=this.registry;e.commands.add(\"mediaEmbed\",new WE(e));t.register(\"media\",{isObject:true,isBlock:true,allowWhere:\"$block\",allowAttributes:[\"url\"]});i.for(\"dataDowncast\").elementToElement({model:\"media\",view:(e,t)=>{const n=e.getAttribute(\"url\");return jE(t,r,n,{renderMediaPreview:n&&o})}});i.for(\"dataDowncast\").add(VE(r,{renderMediaPreview:o}));i.for(\"editingDowncast\").elementToElement({model:\"media\",view:(e,t)=>{const i=e.getAttribute(\"url\");const o=jE(t,r,i,{renderForEditingView:true});return LE(o,t,n(\"media widget\"))}});i.for(\"editingDowncast\").add(VE(r,{renderForEditingView:true}));i.for(\"upcast\").elementToElement({view:{name:\"oembed\",attributes:{url:true}},model:(e,t)=>{const n=e.getAttribute(\"url\");if(r.hasMedia(n)){return t.createElement(\"media\",{url:n})}}}).elementToElement({view:{name:\"div\",attributes:{\"data-oembed-url\":true}},model:(e,t)=>{const n=e.getAttribute(\"data-oembed-url\");if(r.hasMedia(n)){return t.createElement(\"media\",{url:n})}}})}}const QE=/^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w.-]+)+[\\w\\-._~:/?#[\\]@!$&'()*+,;=]+$/;class JE extends sk{static get requires(){return[gv,Lx]}static get pluginName(){return\"AutoMediaEmbed\"}constructor(e){super(e);this._timeoutId=null;this._positionToInsert=null}init(){const e=this.editor;const t=e.model.document;this.listenTo(e.plugins.get(gv),\"inputTransformation\",()=>{const e=t.selection.getFirstRange();const n=Gg.fromPosition(e.start);n.stickiness=\"toPrevious\";const i=Gg.fromPosition(e.end);i.stickiness=\"toNext\";t.once(\"change:data\",()=>{this._embedMediaBetweenPositions(n,i);n.detach();i.detach()},{priority:\"high\"})});e.commands.get(\"undo\").on(\"execute\",()=>{if(this._timeoutId){Ld.window.clearTimeout(this._timeoutId);this._positionToInsert.detach();this._timeoutId=null;this._positionToInsert=null}},{priority:\"high\"})}_embedMediaBetweenPositions(e,t){const n=this.editor;const i=n.plugins.get(KE).registry;const o=new ff(e,t);const r=o.getWalker({ignoreElementEnd:true});let s=\"\";for(const e of r){if(e.item.is(\"$textProxy\")){s+=e.item.data}}s=s.trim();if(!s.match(QE)){o.detach();return}if(!i.hasMedia(s)){o.detach();return}const a=n.commands.get(\"mediaEmbed\");if(!a.isEnabled){o.detach();return}this._positionToInsert=Gg.fromPosition(e);this._timeoutId=Ld.window.setTimeout(()=>{n.model.change(e=>{this._timeoutId=null;e.remove(o);o.detach();let t;if(this._positionToInsert.root.rootName!==\"$graveyard\"){t=this._positionToInsert}HE(n.model,s,t);this._positionToInsert.detach();this._positionToInsert=null})},100)}}var ZE=n(102);class XE extends Bb{constructor(e,t){super(t);const n=t.t;this.focusTracker=new Yp;this.keystrokes=new Op;this.urlInputView=this._createUrlInput();this.saveButtonView=this._createButton(n(\"Save\"),vT,\"ck-button-save\");this.saveButtonView.type=\"submit\";this.cancelButtonView=this._createButton(n(\"Cancel\"),yT,\"ck-button-cancel\",\"cancel\");this._focusables=new lb;this._focusCycler=new nw({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:\"shift + tab\",focusNext:\"tab\"}});this._validators=e;this.setTemplate({tag:\"form\",attributes:{class:[\"ck\",\"ck-media-form\"],tabindex:\"-1\"},children:[this.urlInputView,this.saveButtonView,this.cancelButtonView]})}render(){super.render();_T({view:this});const e=[this.urlInputView,this.saveButtonView,this.cancelButtonView];e.forEach(e=>{this._focusables.add(e);this.focusTracker.add(e.element)});this.keystrokes.listenTo(this.element);const t=e=>e.stopPropagation();this.keystrokes.set(\"arrowright\",t);this.keystrokes.set(\"arrowleft\",t);this.keystrokes.set(\"arrowup\",t);this.keystrokes.set(\"arrowdown\",t);this.listenTo(this.urlInputView.element,\"selectstart\",(e,t)=>{t.stopPropagation()},{priority:\"high\"})}focus(){this._focusCycler.focusFirst()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(e){this.urlInputView.fieldView.element.value=e.trim()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t){this.urlInputView.errorText=t;return false}}return true}resetFormStatus(){this.urlInputView.errorText=null;this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const e=this.locale.t;const t=new gT(this.locale,wT);const n=t.fieldView;this._urlInputViewInfoDefault=e(\"Paste the media URL in the input.\");this._urlInputViewInfoTip=e(\"Tip: Paste the URL into the content to embed faster.\");t.label=e(\"Media URL\");t.infoText=this._urlInputViewInfoDefault;n.placeholder=\"https://example.com\";n.on(\"input\",()=>{t.infoText=n.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault});return t}_createButton(e,t,n,i){const o=new Aw(this.locale);o.set({label:e,icon:t,tooltip:true});o.extendTemplate({attributes:{class:n}});if(i){o.delegate(\"execute\").to(this,i)}return o}}var eM='';class tM extends sk{static get requires(){return[KE]}static get pluginName(){return\"MediaEmbedUI\"}init(){const e=this.editor;const t=e.commands.get(\"mediaEmbed\");const n=e.plugins.get(KE).registry;e.ui.componentFactory.add(\"mediaEmbed\",i=>{const o=Lw(i);const r=new XE(nM(e.t,n),e.locale);this._setUpDropdown(o,r,t,e);this._setUpForm(o,r,t);return o})}_setUpDropdown(e,t,n){const i=this.editor;const o=i.t;const r=e.buttonView;e.bind(\"isEnabled\").to(n);e.panelView.children.add(t);r.set({label:o(\"Insert media\"),icon:eM,tooltip:true});r.on(\"open\",()=>{t.url=n.value||\"\";t.urlInputView.fieldView.select();t.focus()},{priority:\"low\"});e.on(\"submit\",()=>{if(t.isValid()){i.execute(\"mediaEmbed\",t.url);s()}});e.on(\"change:isOpen\",()=>t.resetFormStatus());e.on(\"cancel\",()=>s());function s(){i.editing.view.focus();e.isOpen=false}}_setUpForm(e,t,n){t.delegate(\"submit\",\"cancel\").to(e);t.urlInputView.bind(\"value\").to(n,\"value\");t.urlInputView.bind(\"isReadOnly\").to(n,\"isEnabled\",e=>!e);t.saveButtonView.bind(\"isEnabled\").to(n)}}function nM(e,t){return[t=>{if(!t.url.length){return e(\"The URL must not be empty.\")}},n=>{if(!t.hasMedia(n.url)){return e(\"This media URL is not supported.\")}}]}var iM=n(104);class oM extends sk{static get requires(){return[KE,tM,JE,lT]}static get pluginName(){return\"MediaEmbed\"}}function rM(e,t){for(const n of e.getChildren()){if(n.is(\"element\",\"b\")&&n.getStyle(\"font-weight\")===\"normal\"){const i=e.getChildIndex(n);t.remove(n);t.insertChild(i,n.getChildren(),e)}}}function sM(e,t){if(!e.childCount){return}const n=new kP(e.document);const i=cM(e,n);if(!i.length){return}let o=null;let r=1;i.forEach((e,s)=>{const a=mM(i[s-1],e);const c=a?null:i[s-1];const l=pM(c,e);if(a){o=null;r=1}if(!o||l!==0){const i=lM(e,t);if(!o){o=dM(i,e.element,n)}else if(e.indent>r){const e=o.getChild(o.childCount-1);const t=e.getChild(e.childCount-1);o=dM(i,t,n);r+=1}else if(e.indent[\\s]*?)[\\r\\n]+(\\s*<\\/span>)/g,\"$1$2\").replace(/<\\/span>/g,\"\").replace(/ <\\//g,\" <\\/o:p>/g,\" \").replace(/( |\\u00A0)<\\/o:p>/g,\"\").replace(/>(\\s*[\\r\\n]\\s*)<\")}function vM(e){e.querySelectorAll(\"span[style*=spacerun]\").forEach(e=>{const t=e.innerText.length||0;e.innerHTML=Array(t+1).join(\"  \").substr(0,t)})}function yM(e){return e.replace(/(\\s+)<\\/span>/g,(e,t)=>t.length===1?\" \":Array(t.length+1).join(\"  \").substr(0,t.length))}function xM(e,t){const n=new DOMParser;e=e.replace(/