{"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){e[\"en\"]=Object.assign(e[\"en\"]||{},{a:\"Cannot upload file:\",b:\"Image toolbar\",c:\"Media toolbar\",d:\"Table toolbar\",e:\"Words: %0\",f:\"Characters: %0\",g:\"Block quote\",h:\"Insert image or file\",i:\"Choose heading\",j:\"Heading\",k:\"Increase indent\",l:\"Decrease indent\",m:\"media widget\",n:\"Bold\",o:\"Italic\",p:\"Code\",q:\"Subscript\",r:\"Superscript\",s:\"Underline\",t:\"Strikethrough\",u:\"image widget\",v:\"Enter image caption\",w:\"Full size image\",x:\"Side image\",y:\"Left aligned image\",z:\"Centered image\",aa:\"Right aligned image\",ab:\"Insert image\",ac:\"Upload failed\",ad:\"Upload in progress\",ae:\"Widget toolbar\",af:\"Page break\",ag:\"Horizontal line\",ah:\"Yellow marker\",ai:\"Green marker\",aj:\"Pink marker\",ak:\"Blue marker\",al:\"Red pen\",am:\"Green pen\",an:\"Remove highlight\",ao:\"Highlight\",ap:\"Text highlight toolbar\",aq:\"Insert code block\",ar:\"Align left\",as:\"Align right\",at:\"Align center\",au:\"Justify\",av:\"Text alignment\",aw:\"Text alignment toolbar\",ax:\"Insert table\",ay:\"Header column\",az:\"Insert column left\",ba:\"Insert column right\",bb:\"Delete column\",bc:\"Column\",bd:\"Header row\",be:\"Insert row below\",bf:\"Insert row above\",bg:\"Delete row\",bh:\"Row\",bi:\"Merge cell up\",bj:\"Merge cell right\",bk:\"Merge cell down\",bl:\"Merge cell left\",bm:\"Split cell vertically\",bn:\"Split cell horizontally\",bo:\"Merge cells\",bp:\"Font Family\",bq:\"Default\",br:\"Font Size\",bs:\"Tiny\",bt:\"Small\",bu:\"Big\",bv:\"Huge\",bw:\"Font Color\",bx:\"Font Background Color\",by:\"Could not obtain resized image URL.\",bz:\"Selecting resized image failed\",ca:\"Could not insert image at the current position.\",cb:\"Inserting image failed\",cc:\"Change image text alternative\",cd:\"Rich Text Editor\",ce:\"Plain text\",cf:\"Black\",cg:\"Dim grey\",ch:\"Grey\",ci:\"Light grey\",cj:\"White\",ck:\"Red\",cl:\"Orange\",cm:\"Yellow\",cn:\"Light green\",co:\"Green\",cp:\"Aquamarine\",cq:\"Turquoise\",cr:\"Light blue\",cs:\"Blue\",ct:\"Purple\",cu:\"Dropdown toolbar\",cv:\"Remove color\",cw:\"Document colors\",cx:\"Editor toolbar\",cy:\"Show more items\",cz:\"Undo\",da:\"Redo\",db:\"%0 of %1\",dc:\"Previous\",dd:\"Next\",de:\"Save\",df:\"Cancel\",dg:\"Text alternative\",dh:\"Open in a new tab\",di:\"Downloadable\",dj:\"Paragraph\",dk:\"Heading 1\",dl:\"Heading 2\",dm:\"Heading 3\",dn:\"Heading 4\",do:\"Heading 5\",dp:\"Heading 6\",dq:\"Rich Text Editor, %0\",dr:\"Insert media\",ds:\"The URL must not be empty.\",dt:\"This media URL is not supported.\",du:\"Numbered List\",dv:\"Bulleted List\",dw:\"Link\",dx:\"Unlink\",dy:\"Edit link\",dz:\"Open link in new tab\",ea:\"This link has no URL\",eb:\"Link URL\",ec:\"Paste the media URL in the input.\",ed:\"Tip: Paste the URL into the content to embed faster.\",ee:\"Media URL\"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));(function e(t,i){if(typeof exports===\"object\"&&typeof module===\"object\")module.exports=i();else if(typeof define===\"function\"&&define.amd)define([],i);else if(typeof exports===\"object\")exports[\"ClassicEditor\"]=i();else t[\"ClassicEditor\"]=i()})(window,(function(){return function(e){var t={};function i(n){if(t[n]){return t[n].exports}var o=t[n]={i:n,l:false,exports:{}};e[n].call(o.exports,o,o.exports,i);o.l=true;return o.exports}i.m=e;i.c=t;i.d=function(e,t,n){if(!i.o(e,t)){Object.defineProperty(e,t,{enumerable:true,get:n})}};i.r=function(e){if(typeof Symbol!==\"undefined\"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"})}Object.defineProperty(e,\"__esModule\",{value:true})};i.t=function(e,t){if(t&1)e=i(e);if(t&8)return e;if(t&4&&typeof e===\"object\"&&e&&e.__esModule)return e;var n=Object.create(null);i.r(n);Object.defineProperty(n,\"default\",{enumerable:true,value:e});if(t&2&&typeof e!=\"string\")for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n};i.n=function(e){var t=e&&e.__esModule?function t(){return e[\"default\"]}:function t(){return e};i.d(t,\"a\",t);return t};i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};i.p=\"\";return i(i.s=116)}([function(e,t,i){\"use strict\";i.d(t,\"b\",(function(){return o}));i.d(t,\"a\",(function(){return s}));const n=\"https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html\";class o extends Error{constructor(e,t,i){e=s(e);if(i){e+=\" \"+JSON.stringify(i)}super(e);this.name=\"CKEditorError\";this.context=t;this.data=i}is(e){return e===\"CKEditorError\"}static rethrowUnexpectedError(e,t){if(e.is&&e.is(\"CKEditorError\")){throw e}const i=new o(e.message,t);i.stack=e.stack;throw i}}function s(e){const t=e.match(/^([^:]+):/);if(!t){return e}return e+` Read more: ${n}#error-${t[1]}\\n`}},function(e,t,i){\"use strict\";var n=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(i){if(typeof t[i]===\"undefined\"){var n=document.querySelector(i);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement){try{n=n.contentDocument.head}catch(e){n=null}}t[i]=n}return t[i]}}();var s=[];function r(e){var t=-1;for(var i=0;i:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}\"},function(e,t,i){var n=i(1);var o=i(22);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}\"},function(e,t,i){var n=i(1);var o=i(24);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{z-index:var(--ck-z-modal);position:fixed;top:0}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{top:auto;position:absolute}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{box-shadow:var(--ck-drop-shadow),0 0;border-width:0 1px 1px;border-top-left-radius:0;border-top-right-radius:0}\"},function(e,t,i){var n=i(1);var o=i(26);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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-small)}[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__panel{box-shadow:var(--ck-drop-shadow),0 0;border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;min-width:100%}\"},function(e,t,i){var n=i(1);var o=i(28);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{width:var(--ck-icon-size);height:var(--ck-icon-size);font-size:.8333350694em;will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon :not([fill]){fill:currentColor}\"},function(e,t,i){var n=i(1);var o=i(30);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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,i){var n=i(1);var o=i(32);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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,i){var n=i(1);var o=i(34);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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,i){var n=i(1);var o=i(36);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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:1.3846153847em}[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,i){var n=i(1);var o=i(38);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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,i){var n=i(1);var o=i(40);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}\"},function(e,t,i){var n=i(1);var o=i(42);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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-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_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__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.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck.ck-toolbar .ck.ck-toolbar__separator{align-self:stretch;width:1px;min-width:1px;margin-top:0;margin-bottom:0;background:var(--ck-color-toolbar-border)}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__grouped-dropdown,[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{padding-right:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__items>*,[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__items>*{margin-left:var(--ck-spacing-small);margin-right:0}.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__items>:last-child,[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__items>:last-child{margin-left:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_grouping>.ck-toolbar__items,[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__grouped-dropdown,[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{padding-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__items>:last-child,[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__items>:last-child{margin-right:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_grouping>.ck-toolbar__items,[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{margin-right:var(--ck-spacing-small)}\"},function(e,t,i){var n=i(1);var o=i(44);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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,i){var n=i(1);var o=i(46);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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,i){var n=i(1);var o=i(48);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}\"},function(e,t){e.exports=\".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}\"},function(e,t,i){var n=i(1);var o=i(51);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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-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-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child,.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}.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-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle .ck-widget__selection-handle:hover,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle .ck-widget__selection-handle,.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-editor__editable.ck-read-only .ck-widget{--ck-widget-outline-thickness:0}\"},function(e,t,i){var n=i(1);var o=i(53);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck.ck-labeled-input .ck-labeled-input__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-input .ck-labeled-input__status_error{color:var(--ck-color-base-error)}\"},function(e,t,i){var n=i(1);var o=i(55);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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,i){var n=i(1);var o=i(57);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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-input{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-input{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-input{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-text-alternative-form .ck-labeled-input .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,i){var n=i(1);var o=i(59);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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))}'},function(e,t,i){var n=i(1);var o=i(61);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck .ck-balloon-rotator__navigation{display:flex;align-items:center;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-small)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}\"},function(e,t,i){var n=i(1);var o=i(63);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-modal) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);width:100%;height:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}\"},function(e,t,i){var n=i(1);var o=i(65);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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,i){var n=i(1);var o=i(67);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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,i){var n=i(1);var o=i(69);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\":root{--ck-image-style-spacing:1.5em}.ck-content .image-style-align-center,.ck-content .image-style-align-left,.ck-content .image-style-align-right,.ck-content .image-style-side{max-width:50%}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing)}.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,i){var n=i(1);var o=i(71);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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,i){var n=i(1);var o=i(73);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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,i){var n=i(1);var o=i(75);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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,i){var n=i(1);var o=i(77);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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-input{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-input{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-form .ck-labeled-input .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-input{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-input .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,i){var n=i(1);var o=i(79);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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,i){var n=i(1);var o=i(81);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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,#1400c8,#b900b4,#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,i){var n=i(1);var o=i(83);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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-input{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-input{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-input{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-media-form .ck-labeled-input .ck-input-text{min-width:0;width:100%}.ck.ck-media-form .ck-labeled-input .ck-labeled-input__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,i){var n=i(1);var o=i(85);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck-content .media{clear:both;margin:1em 0;display:block;min-width:15em}\"},function(e,t,i){var n=i(1);var o=i(87);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\":root{--ck-color-table-focused-cell-background:#f5fafe}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused{background:var(--ck-color-table-focused-cell-background);border-style:none;outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}\"},function(e,t,i){var n=i(1);var o=i(89);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}:root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px}.ck .ck-insert-table-dropdown__grid{width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2);padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0}.ck .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{width:var(--ck-insert-table-dropdown-box-width);height:var(--ck-insert-table-dropdown-box-height);margin:var(--ck-insert-table-dropdown-box-margin);border:1px solid var(--ck-color-base-border);border-radius:1px}.ck .ck-insert-table-dropdown-grid-box.ck-on{border-color:var(--ck-color-focus-border);background:var(--ck-color-focus-outer-shadow)}\"},function(e,t,i){var n=i(1);var o=i(91);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck-content .table{margin:1em auto;display:table}.ck-content .table table{border-collapse:collapse;border-spacing:0;border:1px double #b3b3b3}.ck-content .table table td,.ck-content .table table th{min-width:2em;padding:.4em;border-color:#d9d9d9}.ck-content .table table th{font-weight:700;background:#fafafa}\"},function(e,t){e.exports=\".ck-content code{background-color:hsla(0,0%,78%,.3);padding:.15em;border-radius:2px}\"},function(e,t,i){var n=i(1);var o=i(94);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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,i){var n=i(1);var o=i(96);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck-content pre{padding:1em;color:#353535;background:hsla(0,0%,78%,.3);border:1px solid #c4c4c4;border-radius:2px;text-align:left;direction:ltr;tab-size:4;white-space:pre-wrap;font-style:normal;min-width:200px}.ck-content pre code{background:unset;padding:0;border-radius:0}.ck.ck-editor__editable pre{position:relative}.ck.ck-editor__editable pre[data-language]:after{content:attr(data-language);position:absolute}:root{--ck-color-code-block-label-background:#757575}.ck.ck-editor__editable pre[data-language]:after{top:-1px;right:10px;background:var(--ck-color-code-block-label-background);font-size:10px;font-family:var(--ck-font-face);line-height:16px;padding:var(--ck-spacing-tiny) var(--ck-spacing-medium);color:#fff;white-space:nowrap}.ck.ck-code-block-dropdown .ck-dropdown__panel{max-height:250px;overflow-y:auto;overflow-x:hidden}\"},function(e,t,i){var n=i(1);var o=i(98);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#000}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{width:var(--ck-color-grid-tile-size);height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);padding:0;transition:box-shadow .2s ease;border:0}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile.ck-color-table__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.ck.ck-color-grid__tile .ck.ck-icon{display:none;color:var(--ck-color-color-grid-check-icon)}.ck.ck-color-grid__tile.ck-on{box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-base-text)}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__tile.ck-on,.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){border:0}.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}\"},function(e,t,i){var n=i(1);var o=i(100);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck .ck-button.ck-color-table__remove-color{display:flex;align-items:center;width:100%}label.ck.ck-color-grid__label{font-weight:unset}.ck .ck-button.ck-color-table__remove-color{padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck .ck-button.ck-color-table__remove-color:not(:focus){border-bottom:1px solid var(--ck-color-base-border)}[dir=ltr] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-left:var(--ck-spacing-standard)}\"},function(e,t,i){var n=i(1);var o=i(102);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".text-tiny{font-size:.7em}.text-small{font-size:.85em}.text-big{font-size:1.4em}.text-huge{font-size:1.8em}\"},function(e,t,i){var n=i(1);var o=i(104);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\":root{--ck-highlight-marker-yellow:#fdfd77;--ck-highlight-marker-green:#63f963;--ck-highlight-marker-pink:#fc7999;--ck-highlight-marker-blue:#72cdfd;--ck-highlight-pen-red:#e91313;--ck-highlight-pen-green:#180}.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,i){var n=i(1);var o=i(106);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck-editor__editable .ck-horizontal-line{overflow:hidden}.ck-content hr{border:solid #5e5e5e;border-width:1px 0 0;margin:0}.ck-editor__editable .ck-horizontal-line{padding:5px 0}\"},function(e,t,i){var n=i(1);var o=i(108);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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,i){var n=i(1);var o=i(110);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},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}\"},function(module,__webpack_exports__,__webpack_require__){\"use strict\";var md5;var _unused_webpack_default_export=md5;(function(){var HxOverrides=function(){};HxOverrides.__name__=true;HxOverrides.dateStr=function(e){var t=e.getMonth()+1;var i=e.getDate();var n=e.getHours();var o=e.getMinutes();var s=e.getSeconds();return e.getFullYear()+\"-\"+(t<10?\"0\"+t:\"\"+t)+\"-\"+(i<10?\"0\"+i:\"\"+i)+\" \"+(n<10?\"0\"+n:\"\"+n)+\":\"+(o<10?\"0\"+o:\"\"+o)+\":\"+(s<10?\"0\"+s:\"\"+s)};HxOverrides.strDate=function(e){switch(e.length){case 8:var t=e.split(\":\");var i=new Date;i.setTime(0);i.setUTCHours(t[0]);i.setUTCMinutes(t[1]);i.setUTCSeconds(t[2]);return i;case 10:var t=e.split(\"-\");return new Date(t[0],t[1]-1,t[2],0,0,0);case 19:var t=e.split(\" \");var n=t[0].split(\"-\");var o=t[1].split(\":\");return new Date(n[0],n[1]-1,n[2],o[0],o[1],o[2]);default:throw\"Invalid date format : \"+e}};HxOverrides.cca=function(e,t){var i=e.charCodeAt(t);if(i!=i)return undefined;return i};HxOverrides.substr=function(e,t,i){if(t!=null&&t!=0&&i!=null&&i<0)return\"\";if(i==null)i=e.length;if(t<0){t=e.length+t;if(t<0)t=0}else if(i<0)i=e.length+i-t;return e.substr(t,i)};HxOverrides.remove=function(e,t){var i=0;var n=e.length;while(i>>32-t},str2blks:function(e){var t=(e.length+8>>6)+1;var i=new Array;var n=0,o=t*16;while(n>2]|=HxOverrides.cca(e,s)<<(e.length*8+s)%4*8;s++}i[s>>2]|=128<<(e.length*8+s)%4*8;var r=e.length*8;var a=t*16-2;i[a]=r&255;i[a]|=(r>>>8&255)<<8;i[a]|=(r>>>16&255)<<16;i[a]|=(r>>>24&255)<<24;return i},rhex:function(e){var t=\"\";var i=\"0123456789abcdef\";var n=0;while(n<4){var o=n++;t+=i.charAt(e>>o*8+4&15)+i.charAt(e>>o*8&15)}return t},addme:function(e,t){var i=(e&65535)+(t&65535);var n=(e>>16)+(t>>16)+(i>>16);return n<<16|i&65535},bitAND:function(e,t){var i=e&1&(t&1);var n=e>>>1&t>>>1;return n<<1|i},bitXOR:function(e,t){var i=e&1^t&1;var n=e>>>1^t>>>1;return n<<1|i},bitOR:function(e,t){var i=e&1|t&1;var n=e>>>1|t>>>1;return n<<1|i},__class__:haxe.Md5};haxe.Timer=function(e){var t=this;this.id=window.setInterval((function(){t.run()}),e)};haxe.Timer.__name__=true;haxe.Timer.delay=function(e,t){var i=new haxe.Timer(t);i.run=function(){i.stop();e()};return i};haxe.Timer.measure=function(e,t){var i=haxe.Timer.stamp();var n=e();haxe.Log.trace(haxe.Timer.stamp()-i+\"s\",t);return n};haxe.Timer.stamp=function(){return(new Date).getTime()/1e3};haxe.Timer.prototype={run:function(){},stop:function(){if(this.id==null)return;window.clearInterval(this.id);this.id=null},__class__:haxe.Timer};var js=js||{};js.Boot=function(){};js.Boot.__name__=true;js.Boot.__unhtml=function(e){return e.split(\"&\").join(\"&\").split(\"<\").join(\"<\").split(\">\").join(\">\")};js.Boot.__trace=function(e,t){var i=t!=null?t.fileName+\":\"+t.lineNumber+\": \":\"\";i+=js.Boot.__string_rec(e,\"\");var n;if(typeof document!=\"undefined\"&&(n=document.getElementById(\"haxe:trace\"))!=null)n.innerHTML+=js.Boot.__unhtml(i)+\"
\";else if(typeof console!=\"undefined\"&&console.log!=null)console.log(i)};js.Boot.__clear_trace=function(){var e=document.getElementById(\"haxe:trace\");if(e!=null)e.innerHTML=\"\"};js.Boot.isClass=function(e){return e.__name__};js.Boot.isEnum=function(e){return e.__ename__};js.Boot.getClass=function(e){return e.__class__};js.Boot.__string_rec=function(e,t){if(e==null)return\"null\";if(t.length>=5)return\"<...>\";var i=typeof e;if(i==\"function\"&&(e.__name__||e.__ename__))i=\"object\";switch(i){case\"object\":if(e instanceof Array){if(e.__enum__){if(e.length==2)return e[0];var n=e[0]+\"(\";t+=\"\\t\";var o=2,s=e.length;while(o0?\",\":\"\")+js.Boot.__string_rec(e[c],t)}n+=\"]\";return n}var l;try{l=e.toString}catch(e){return\"???\"}if(l!=null&&l!=Object.toString){var d=e.toString();if(d!=\"[object Object]\")return d}var u=null;var n=\"{\\n\";t+=\"\\t\";var h=e.hasOwnProperty!=null;for(var u in e){if(h&&!e.hasOwnProperty(u)){continue}if(u==\"prototype\"||u==\"__class__\"||u==\"__super__\"||u==\"__interfaces__\"||u==\"__properties__\"){continue}if(n.length!=2)n+=\", \\n\";n+=t+u+\" : \"+js.Boot.__string_rec(e[u],t)}t=t.substring(1);n+=\"\\n\"+t+\"}\";return n;case\"function\":return\"\";case\"string\":return e;default:return String(e)}};js.Boot.__interfLoop=function(e,t){if(e==null)return false;if(e==t)return true;var i=e.__interfaces__;if(i!=null){var n=0,o=i.length;while(n>>32-t},str2blks:function(e){var t=(e.length+8>>6)+1;var i=new Array;var n=0,o=t*16;while(n>2]|=HxOverrides.cca(e,s)<<(e.length*8+s)%4*8;s++}i[s>>2]|=128<<(e.length*8+s)%4*8;var r=e.length*8;var a=t*16-2;i[a]=r&255;i[a]|=(r>>>8&255)<<8;i[a]|=(r>>>16&255)<<16;i[a]|=(r>>>24&255)<<24;return i},rhex:function(e){var t=\"\";var i=\"0123456789abcdef\";var n=0;while(n<4){var o=n++;t+=i.charAt(e>>o*8+4&15)+i.charAt(e>>o*8&15)}return t},addme:function(e,t){var i=(e&65535)+(t&65535);var n=(e>>16)+(t>>16)+(i>>16);return n<<16|i&65535},bitAND:function(e,t){var i=e&1&(t&1);var n=e>>>1&t>>>1;return n<<1|i},bitXOR:function(e,t){var i=e&1^t&1;var n=e>>>1^t>>>1;return n<<1|i},bitOR:function(e,t){var i=e&1|t&1;var n=e>>>1|t>>>1;return n<<1|i},__class__:haxe.Md5};haxe.Timer=function(e){var t=this;this.id=window.setInterval((function(){t.run()}),e)};haxe.Timer.__name__=true;haxe.Timer.delay=function(e,t){var i=new haxe.Timer(t);i.run=function(){i.stop();e()};return i};haxe.Timer.measure=function(e,t){var i=haxe.Timer.stamp();var n=e();haxe.Log.trace(haxe.Timer.stamp()-i+\"s\",t);return n};haxe.Timer.stamp=function(){return(new Date).getTime()/1e3};haxe.Timer.prototype={run:function(){},stop:function(){if(this.id==null)return;window.clearInterval(this.id);this.id=null},__class__:haxe.Timer};var js=js||{};js.Boot=function(){};js.Boot.__name__=true;js.Boot.__unhtml=function(e){return e.split(\"&\").join(\"&\").split(\"<\").join(\"<\").split(\">\").join(\">\")};js.Boot.__trace=function(e,t){var i=t!=null?t.fileName+\":\"+t.lineNumber+\": \":\"\";i+=js.Boot.__string_rec(e,\"\");var n;if(typeof document!=\"undefined\"&&(n=document.getElementById(\"haxe:trace\"))!=null)n.innerHTML+=js.Boot.__unhtml(i)+\"
\";else if(typeof console!=\"undefined\"&&console.log!=null)console.log(i)};js.Boot.__clear_trace=function(){var e=document.getElementById(\"haxe:trace\");if(e!=null)e.innerHTML=\"\"};js.Boot.isClass=function(e){return e.__name__};js.Boot.isEnum=function(e){return e.__ename__};js.Boot.getClass=function(e){return e.__class__};js.Boot.__string_rec=function(e,t){if(e==null)return\"null\";if(t.length>=5)return\"<...>\";var i=typeof e;if(i==\"function\"&&(e.__name__||e.__ename__))i=\"object\";switch(i){case\"object\":if(e instanceof Array){if(e.__enum__){if(e.length==2)return e[0];var n=e[0]+\"(\";t+=\"\\t\";var o=2,s=e.length;while(o0?\",\":\"\")+js.Boot.__string_rec(e[c],t)}n+=\"]\";return n}var l;try{l=e.toString}catch(e){return\"???\"}if(l!=null&&l!=Object.toString){var d=e.toString();if(d!=\"[object Object]\")return d}var u=null;var n=\"{\\n\";t+=\"\\t\";var h=e.hasOwnProperty!=null;for(var u in e){if(h&&!e.hasOwnProperty(u)){continue}if(u==\"prototype\"||u==\"__class__\"||u==\"__super__\"||u==\"__interfaces__\"||u==\"__properties__\"){continue}if(n.length!=2)n+=\", \\n\";n+=t+u+\" : \"+js.Boot.__string_rec(e[u],t)}t=t.substring(1);n+=\"\\n\"+t+\"}\";return n;case\"function\":return\"\";case\"string\":return e;default:return String(e)}};js.Boot.__interfLoop=function(e,t){if(e==null)return false;if(e==t)return true;var i=e.__interfaces__;if(i!=null){var n=0,o=i.length;while(ndiv:first-child,.wrs_content_container.wrs_modal_desktop>div:first-child,.wrs_content_container.wrs_modal_ios>div:first-child{flex-grow:1}.wrs_modal_wrapper.wrs_modal_android{margin:auto;display:flex;flex-direction:column;height:100%;width:100%}.wrs_content_container.wrs_modal_desktop,.wrs_content_container.wrs_modal_ios{width:100%;flex-grow:1;display:flex;flex-direction:column}.wrs_modal_wrapper.wrs_modal_ios{margin:auto;display:flex;flex-direction:column;height:100%;width:100%}.wrs_virtual_keyboard{height:100%;width:100%;top:0;left:50%;transform:translate(-50%)}@media (orientation:portrait){.wrs_modal_dialogContainer.wrs_modal_mobile{width:100vmin;height:100vmin;margin:auto;border-width:0}.wrs_modal_wrapper.wrs_modal_mobile{width:100vmin;height:100vmin;margin:auto}}@media (orientation:landscape){.wrs_modal_dialogContainer.wrs_modal_mobile{width:100vmin;height:100vmin;margin:auto;border-width:0}.wrs_modal_wrapper.wrs_modal_mobile{width:100vmin;height:100vmin;margin:auto}}.wrs_modal_dialogContainer.wrs_modal_badStock,.wrs_modal_wrapper.wrs_modal_badStock{width:100%;height:280px;margin:0 auto;border-width:0}.wrs_noselect{-khtml-user-select:none}.wrs_bottom_right_resizer,.wrs_noselect{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.wrs_bottom_right_resizer{width:10px;height:10px;color:#778e9a;position:absolute;right:4px;bottom:8px;cursor:se-resize}.wrs_bottom_left_resizer{width:15px;height:15px;color:#778e9a;position:absolute;left:0;top:0;cursor:se-resize}.wrs_modal_controls{height:42px;margin:3px 0;overflow:hidden;line-height:normal}.wrs_modal_links{margin:10px auto 0;font-family:arial,sans-serif;padding:6px;display:inline;float:right;text-align:right}.wrs_modal_links>a{text-decoration:none;color:#778e9a;font-size:16px}.wrs_modal_button_cancel,.wrs_modal_button_cancel:active,.wrs_modal_button_cancel:focus,.wrs_modal_button_cancel:hover,.wrs_modal_button_cancel:visited{min-width:80px;font-size:14px;border-radius:3px;border:1px solid #778e9a;padding:6px 8px;margin:10px auto 0 5px;cursor:pointer;font-family:arial,sans-serif;background-color:#ddd;height:32px}.wrs_modal_button_accept,.wrs_modal_button_accept:active,.wrs_modal_button_accept:focus,.wrs_modal_button_accept:hover,.wrs_modal_button_accept:visited{min-width:80px;font-size:14px;border-radius:3px;border:1px solid #778e9a;padding:6px 8px;margin:10px 5px 0 auto;color:#fff;background:#778e9a;cursor:pointer;font-family:arial,sans-serif;height:32px}.wrs_editor_vertical_bar{height:20px;float:right;background:none;width:20px;cursor:pointer}.wrs_modal_buttons_container{display:inline;float:left}.wrs_modal_buttons_container.wrs_modalAndroid{padding-left:6px}.wrs_modal_buttons_container.wrs_modalDesktop{padding-left:0}.wrs_modal_buttons_container>button{line-height:normal;background-image:none}.wrs_modal_wrapper{margin:6px;display:flex;flex-direction:column}.wrs_modal_wrapper.wrs_modal_desktop.wrs_minimized{display:none}@media only screen and (max-device-width:480px) and (orientation:portrait){#wrs_modal_wrapper{width:140%}}.wrs_popupmessage_overlay_envolture{display:none;width:100%}.wrs_popupmessage_overlay{position:absolute;width:100%;height:100%;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.5);z-index:4;cursor:pointer}.wrs_popupmessage_panel{top:50%;left:50%;transform:translate(-50%,-50%);position:absolute;background:#fff;max-width:500px;width:75%;border-radius:2px;padding:20px;font-family:sans-serif;font-size:15px;text-align:left;color:#2e2e2e;z-index:5;max-height:75%;overflow:auto}.wrs_popupmessage_button_area{margin:10px 0 0}.wrs_panelContainer *{border:0}.wrs_button_cancel,.wrs_button_cancel:active,.wrs_button_cancel:focus,.wrs_button_cancel:hover,.wrs_button_cancel:visited{min-width:80px;font-size:14px;border-radius:3px;border:1px solid #778e9a;padding:6px 8px;margin:10px auto 0 5px;cursor:pointer;font-family:arial,sans-serif;background-color:#ddd;background-image:none;height:32px}.wrs_button_accept,.wrs_button_accept:active,.wrs_button_accept:focus,.wrs_button_accept:hover,.wrs_button_accept:visited{min-width:80px;font-size:14px;border-radius:3px;border:1px solid #778e9a;padding:6px 8px;margin:10px 5px 0 auto;color:#fff;background:#778e9a;cursor:pointer;font-family:arial,sans-serif;height:32px}.wrs_editor button{box-shadow:none}.wrs_editor .wrs_header button{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.wrs_modal_overlay.wrs_modal_desktop.wrs_stack.wrs_overlay_active{display:block}.wrs_toolbar tr:focus,.wrs_toolbar tr:hover{background:none}.wrs_modal_rtl .wrs_modal_button_cancel{margin-right:5px;margin-left:0}.wrs_modal_rtl .wrs_modal_button_accept{margin-right:0;margin-left:5px}.wrs_modal_rtl .wrs_button_cancel{margin-right:5px;margin-left:0}.wrs_modal_rtl .wrs_button_accept{margin-right:0;margin-left:5px}\"},function(e,t,i){var n=i(1);var o=i(115);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var s={injectType:\"singletonStyleTag\"};s.insert=\"head\";s.singleton=true;var r=n(o,s);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports='.ck-content .page-break{position:relative;clear:both;padding:5px 0;display:flex;align-items:center;justify-content:center}.ck-content .page-break:after{content:\"\";position:absolute;border-bottom:2px dashed #c4c4c4;width:100%}.ck-content .page-break__label{position:relative;z-index:1;padding:.3em .6em;display:block;text-transform:uppercase;border:1px solid #c4c4c4;border-radius:2px;font-family:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;font-size:.75em;font-weight:700;color:#333;background:#fff;box-shadow:2px 2px 1px rgba(0,0,0,.15);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media print{.ck-content .page-break{padding:0}.ck-content .page-break:after{display:none}}'},function(e,t,i){\"use strict\";i.r(t);var n=i(3);var o=n[\"a\"].Symbol;var s=o;var r=Object.prototype;var a=r.hasOwnProperty;var c=r.toString;var l=s?s.toStringTag:undefined;function d(e){var t=a.call(e,l),i=e[l];try{e[l]=undefined;var n=true}catch(e){}var o=c.call(e);if(n){if(t){e[l]=i}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=s?s.toStringTag:undefined;function _(e){if(e==null){return e===undefined?b:p}return w&&w in Object(e)?u(e):g(e)}var v=_;function k(e,t){return function(i){return e(t(i))}}var y=k;var x=y(Object.getPrototypeOf,Object);var A=x;function C(e){return e!=null&&typeof e==\"object\"}var T=C;var M=\"[object Object]\";var P=Function.prototype,E=Object.prototype;var S=P.toString;var I=E.hasOwnProperty;var O=S.call(Object);function N(e){if(!T(e)||v(e)!=M){return false}var t=A(e);if(t===null){return true}var i=I.call(t,\"constructor\")&&t.constructor;return typeof i==\"function\"&&i instanceof i&&S.call(i)==O}var L=N;function R(){this.__data__=[];this.size=0}var z=R;function j(e,t){return e===t||e!==e&&t!==t}var D=j;function B(e,t){var i=e.length;while(i--){if(D(e[i][0],t)){return i}}return-1}var V=B;var F=Array.prototype;var H=F.splice;function U(e){var t=this.__data__,i=V(t,e);if(i<0){return false}var n=t.length-1;if(i==n){t.pop()}else{H.call(t,i,1)}--this.size;return true}var W=U;function $(e){var t=this.__data__,i=V(t,e);return i<0?undefined:t[i][1]}var q=$;function Y(e){return V(this.__data__,e)>-1}var G=Y;function J(e,t){var i=this.__data__,n=V(i,e);if(n<0){++this.size;i.push([e,t])}else{i[n][1]=t}return this}var K=J;function X(e){var t=-1,i=e==null?0:e.length;this.clear();while(++t-1&&e%1==0&&e-1&&e%1==0&&e<=ti}var ni=ii;var oi=\"[object Arguments]\",si=\"[object Array]\",ri=\"[object Boolean]\",ai=\"[object Date]\",ci=\"[object Error]\",li=\"[object Function]\",di=\"[object Map]\",ui=\"[object Number]\",hi=\"[object Object]\",fi=\"[object RegExp]\",mi=\"[object Set]\",gi=\"[object String]\",pi=\"[object WeakMap]\";var bi=\"[object ArrayBuffer]\",wi=\"[object DataView]\",_i=\"[object Float32Array]\",vi=\"[object Float64Array]\",ki=\"[object Int8Array]\",yi=\"[object Int16Array]\",xi=\"[object Int32Array]\",Ai=\"[object Uint8Array]\",Ci=\"[object Uint8ClampedArray]\",Ti=\"[object Uint16Array]\",Mi=\"[object Uint32Array]\";var Pi={};Pi[_i]=Pi[vi]=Pi[ki]=Pi[yi]=Pi[xi]=Pi[Ai]=Pi[Ci]=Pi[Ti]=Pi[Mi]=true;Pi[oi]=Pi[si]=Pi[bi]=Pi[ri]=Pi[wi]=Pi[ai]=Pi[ci]=Pi[li]=Pi[di]=Pi[ui]=Pi[hi]=Pi[fi]=Pi[mi]=Pi[gi]=Pi[pi]=false;function Ei(e){return T(e)&&ni(e.length)&&!!Pi[v(e)]}var Si=Ei;function Ii(e){return function(t){return e(t)}}var Oi=Ii;var Ni=i(4);var Li=Ni[\"a\"]&&Ni[\"a\"].isTypedArray;var Ri=Li?Oi(Li):Si;var zi=Ri;var ji=Object.prototype;var Di=ji.hasOwnProperty;function Bi(e,t){var i=Jt(e),n=!i&&Yt(e),o=!i&&!n&&Object(Kt[\"a\"])(e),s=!i&&!n&&!o&&zi(e),r=i||n||o||s,a=r?Bt(e.length,String):[],c=a.length;for(var l in e){if((t||Di.call(e,l))&&!(r&&(l==\"length\"||o&&(l==\"offset\"||l==\"parent\")||s&&(l==\"buffer\"||l==\"byteLength\"||l==\"byteOffset\")||ei(l,c)))){a.push(l)}}return a}var Vi=Bi;var Fi=Object.prototype;function Hi(e){var t=e&&e.constructor,i=typeof t==\"function\"&&t.prototype||Fi;return e===i}var Ui=Hi;var Wi=y(Object.keys,Object);var $i=Wi;var qi=Object.prototype;var Yi=qi.hasOwnProperty;function Gi(e){if(!Ui(e)){return $i(e)}var t=[];for(var i in Object(e)){if(Yi.call(e,i)&&i!=\"constructor\"){t.push(i)}}return t}var Ji=Gi;function Ki(e){return e!=null&&ni(e.length)&&!me(e)}var Xi=Ki;function Qi(e){return Xi(e)?Vi(e):Ji(e)}var Zi=Qi;function en(e,t){return e&&jt(t,Zi(t),e)}var tn=en;function nn(e){var t=[];if(e!=null){for(var i in Object(e)){t.push(i)}}return t}var on=nn;var sn=Object.prototype;var rn=sn.hasOwnProperty;function an(e){if(!ce(e)){return on(e)}var t=Ui(e),i=[];for(var n in e){if(!(n==\"constructor\"&&(t||!rn.call(e,n)))){i.push(n)}}return i}var cn=an;function ln(e){return Xi(e)?Vi(e,true):cn(e)}var dn=ln;function un(e,t){return e&&jt(t,dn(t),e)}var hn=un;var fn=i(13);function mn(e,t){var i=-1,n=e.length;t||(t=Array(n));while(++i{this._setToTarget(e,n,t[n],i)})}}function Ks(e){return qs(e,Xs)}function Xs(e){return Gs(e)?e:undefined}var Qs=i(0);function Zs(){return function e(){e.called=true}}var er=Zs;class tr{constructor(e,t){this.source=e;this.name=t;this.path=[];this.stop=er();this.off=er()}}function ir(){let e=\"e\";for(let t=0;t<8;t++){e+=Math.floor((1+Math.random())*65536).toString(16).substring(1)}return e}const nr={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 or=nr;var sr=i(6);const rr=Symbol(\"listeningTo\");const ar=Symbol(\"emitterId\");const cr={on(e,t,i={}){this.listenTo(this,e,t,i)},once(e,t,i){let n=false;const o=function(e,...i){if(!n){n=true;e.off();t.call(this,e,...i)}};this.listenTo(this,e,o,i)},off(e,t){this.stopListening(this,e,t)},listenTo(e,t,i,n={}){let o,s;if(!this[rr]){this[rr]={}}const r=this[rr];if(!hr(e)){ur(e)}const a=hr(e);if(!(o=r[a])){o=r[a]={emitter:e,callbacks:{}}}if(!(s=o.callbacks[t])){s=o.callbacks[t]=[]}s.push(i);gr(e,t);const c=pr(e,t);const l=or.get(n.priority);const d={callback:i,priority:l};for(const e of c){let t=false;for(let i=0;i{if(!this._delegations){this._delegations=new Map}e.forEach(e=>{const n=this._delegations.get(e);if(!n){this._delegations.set(e,new Map([[t,i]]))}else{n.set(t,i)}})}}},stopDelegating(e,t){if(!this._delegations){return}if(!e){this._delegations.clear()}else if(!t){this._delegations.delete(e)}else{const i=this._delegations.get(e);if(i){i.delete(t)}}}};var lr=cr;function dr(e,t){if(e[rr]&&e[rr][t]){return e[rr][t].emitter}return null}function ur(e,t){if(!e[ar]){e[ar]=t||ir()}}function hr(e){return e[ar]}function fr(e){if(!e._events){Object.defineProperty(e,\"_events\",{value:{}})}return e._events}function mr(){return{callbacks:[],childEvents:[]}}function gr(e,t){const i=fr(e);if(i[t]){return}let n=t;let o=null;const s=[];while(n!==\"\"){if(i[n]){break}i[n]=mr();s.push(i[n]);if(o){i[n].childEvents.push(o)}o=n;n=n.substr(0,n.lastIndexOf(\":\"))}if(n!==\"\"){for(const e of s){e.callbacks=i[n].callbacks.slice()}i[n].childEvents.push(o)}}function pr(e,t){const i=fr(e)[t];if(!i){return[]}let n=[i.callbacks];for(let t=0;t-1){return br(e,t.substr(0,t.lastIndexOf(\":\")))}else{return null}}return i.callbacks}function wr(e,t,i){for(let[n,o]of e){if(!o){o=t.name}else if(typeof o==\"function\"){o=o(t.name)}const e=new tr(t.source,o);e.path=[...t.path];n.fire(e,...i)}}function _r(e,t,i){const n=pr(e,t);for(const e of n){for(let t=0;t{Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)).forEach(i=>{if(i in e.prototype){return}const n=Object.getOwnPropertyDescriptor(t,i);n.enumerable=false;Object.defineProperty(e.prototype,i,n)})})}function kr(e,t){const i=Math.min(e.length,t.length);for(let n=0;ne.data.length){throw new Qs[\"b\"](\"view-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.\",this)}if(i<0||t+i>e.data.length){throw new Qs[\"b\"](\"view-textproxy-wrong-length: Given length value is incorrect.\",this)}this.data=e.data.substring(t,t+i);this.offsetInText=t}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(e){return e==\"textProxy\"||e==\"view:textProxy\"}getAncestors(e={includeSelf:false,parentFirst:false}){const t=[];let i=e.includeSelf?this.textNode:this.parent;while(i!==null){t[e.parentFirst?\"push\":\"unshift\"](i);i=i.parent}return t}}function Pr(e){const t=new Map;for(const i in e){t.set(i,e[i])}return t}function Er(e){return!!(e&&e[Symbol.iterator])}class Sr{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 i=Ir(t,e);if(i){return{element:t,pattern:e,match:i}}}}return null}matchAll(...e){const t=[];for(const i of e){for(const e of this._patterns){const n=Ir(i,e);if(n){t.push({element:i,pattern:e,match:n})}}}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 Ir(e,t){if(typeof t==\"function\"){return t(e)}const i={};if(t.name){i.name=Or(t.name,e.name);if(!i.name){return null}}if(t.attributes){i.attributes=Nr(t.attributes,e);if(!i.attributes){return null}}if(t.classes){i.classes=Lr(t.classes,e);if(!i.classes){return false}}if(t.styles){i.styles=Rr(t.styles,e);if(!i.styles){return false}}return i}function Or(e,t){if(e instanceof RegExp){return e.test(t)}return e===t}function Nr(e,t){const i=[];for(const n in e){const o=e[n];if(t.hasAttribute(n)){const e=t.getAttribute(n);if(o===true){i.push(n)}else if(o instanceof RegExp){if(o.test(e)){i.push(n)}else{return null}}else if(e===o){i.push(n)}else{return null}}else{return null}}return i}function Lr(e,t){const i=[];for(const n of e){if(n instanceof RegExp){const e=t.getClassNames();for(const t of e){if(n.test(t)){i.push(t)}}if(i.length===0){return null}}else if(t.hasClass(n)){i.push(n)}else{return null}}return i}function Rr(e,t){const i=[];for(const n in e){const o=e[n];if(t.hasStyle(n)){const e=t.getStyle(n);if(o instanceof RegExp){if(o.test(e)){i.push(n)}else{return null}}else if(e===o){i.push(n)}else{return null}}else{return null}}return i}class zr extends Cr{constructor(e,t,i){super();this.name=e;this._attrs=jr(t);this._children=[];if(i){this._insertChild(0,i)}this._classes=new Set;if(this._attrs.has(\"class\")){const e=this._attrs.get(\"class\");Br(this._classes,e);this._attrs.delete(\"class\")}this._styles=new Map;if(this._attrs.has(\"style\")){Dr(this._styles,this._attrs.get(\"style\"));this._attrs.delete(\"style\")}this._customProperties=new Map}get childCount(){return this._children.length}get isEmpty(){return this._children.length===0}is(e,t=null){const i=e.replace(/^view:/,\"\");if(!t){return i==\"element\"||i==this.name||super.is(e)}else{return i==\"element\"&&t==this.name}}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){if(this._classes.size>0){yield\"class\"}if(this._styles.size>0){yield\"style\"}yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries();if(this._classes.size>0){yield[\"class\",this.getAttribute(\"class\")]}if(this._styles.size>0){yield[\"style\",this.getAttribute(\"style\")]}}getAttribute(e){if(e==\"class\"){if(this._classes.size>0){return[...this._classes].join(\" \")}return undefined}if(e==\"style\"){if(this._styles.size>0){let e=\"\";for(const[t,i]of this._styles){e+=`${t}:${i};`}return e}return undefined}return this._attrs.get(e)}hasAttribute(e){if(e==\"class\"){return this._classes.size>0}if(e==\"style\"){return this._styles.size>0}return this._attrs.has(e)}isSimilar(e){if(!(e instanceof zr)){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,i]of this._attrs){if(!e._attrs.has(t)||e._attrs.get(t)!==i){return false}}for(const t of this._classes){if(!e._classes.has(t)){return false}}for(const[t,i]of this._styles){if(!e._styles.has(t)||e._styles.get(t)!==i){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.get(e)}getStyleNames(){return this._styles.keys()}hasStyle(...e){for(const t of e){if(!this._styles.has(t)){return false}}return true}findAncestor(...e){const t=new Sr(...e);let i=this.parent;while(i){if(t.match(i)){return i}i=i.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=Array.from(this._classes).sort().join(\",\");const t=Array.from(this._styles).map(e=>`${e[0]}:${e[1]}`).sort().join(\";\");const i=Array.from(this._attrs).map(e=>`${e[0]}=\"${e[1]}\"`).sort().join(\" \");return this.name+(e==\"\"?\"\":` class=\"${e}\"`)+(t==\"\"?\"\":` style=\"${t}\"`)+(i==\"\"?\"\":` ${i}`)}_clone(e=false){const t=[];if(e){for(const i of this.getChildren()){t.push(i._clone(e))}}const i=new this.constructor(this.name,this._attrs,t);i._classes=new Set(this._classes);i._styles=new Map(this._styles);i._customProperties=new Map(this._customProperties);i.getFillerOffset=this.getFillerOffset;return i}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange(\"children\",this);let i=0;const n=Vr(t);for(const t of n){if(t.parent!==null){t._remove()}t.parent=this;this._children.splice(e,0,t);e++;i++}return i}_removeChildren(e,t=1){this._fireChange(\"children\",this);for(let i=e;i0){this._classes.clear();return true}return false}if(e==\"style\"){if(this._styles.size>0){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);if(L(e)){const t=Object.keys(e);for(const i of t){this._styles.set(i,e[i])}}else{this._styles.set(e,t)}}_removeStyle(e){this._fireChange(\"attributes\",this);e=Array.isArray(e)?e:[e];e.forEach(e=>this._styles.delete(e))}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}function jr(e){if(L(e)){e=Pr(e)}else{e=new Map(e)}for(const[t,i]of e){if(i===null){e.delete(t)}else if(typeof i!=\"string\"){e.set(t,String(i))}}return e}function Dr(e,t){let i=null;let n=0;let o=0;let s=null;e.clear();if(t===\"\"){return}if(t.charAt(t.length-1)!=\";\"){t=t+\";\"}for(let r=0;re.add(t))}function Vr(e){if(typeof e==\"string\"){return[new Tr(e)]}if(!Er(e)){e=[e]}return Array.from(e).map(e=>{if(typeof e==\"string\"){return new Tr(e)}if(e instanceof Mr){return new Tr(e.data)}return e})}class Fr extends zr{constructor(e,t,i){super(e,t,i);this.getFillerOffset=Hr}is(e,t=null){const i=e&&e.replace(/^view:/,\"\");if(!t){return i==\"containerElement\"||super.is(e)}else{return i==\"containerElement\"&&t==this.name||super.is(e,t)}}}function Hr(){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}function Ur(e){return e}var Wr=Ur;function $r(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}var qr=$r;var Yr=Math.max;function Gr(e,t,i){t=Yr(t===undefined?e.length-1:t,0);return function(){var n=arguments,o=-1,s=Yr(n.length-t,0),r=Array(s);while(++o0){if(++t>=ea){return arguments[0]}}else{t=0}return e.apply(undefined,arguments)}}var oa=na;var sa=oa(Zr);var ra=sa;function aa(e,t){return ra(Jr(e,t,Wr),e+\"\")}var ca=aa;function la(e,t,i){if(!ce(i)){return false}var n=typeof t;if(n==\"number\"?Xi(i)&&ei(t,i.length):n==\"string\"&&t in i){return D(i[t],e)}return false}var da=la;function ua(e){return ca((function(t,i){var n=-1,o=i.length,s=o>1?i[o-1]:undefined,r=o>2?i[2]:undefined;s=e.length>3&&typeof s==\"function\"?(o--,s):undefined;if(r&&da(i[0],i[1],r)){s=o<3?undefined:s;o=1}t=Object(t);while(++n{this.set(t,e[t])},this);return}va(this);const i=this[ga];if(e in this&&!i.has(e)){throw new Qs[\"b\"](\"observable-set-cannot-override: Cannot override an existing property.\",this)}Object.defineProperty(this,e,{enumerable:true,configurable:true,get(){return i.get(e)},set(t){const n=i.get(e);let o=this.fire(\"set:\"+e,e,t,n);if(o===undefined){o=t}if(n!==o||!i.has(e)){i.set(e,o);this.fire(\"change:\"+e,e,o,n)}}});this[e]=t},bind(...e){if(!e.length||!Aa(e)){throw new Qs[\"b\"](\"observable-bind-wrong-properties: All properties must be strings.\",this)}if(new Set(e).size!==e.length){throw new Qs[\"b\"](\"observable-bind-duplicate-properties: Properties must be unique.\",this)}va(this);const t=this[ba];e.forEach(e=>{if(t.has(e)){throw new Qs[\"b\"](\"observable-bind-rebind: Cannot bind the same property more than once.\",this)}});const i=new Map;e.forEach(e=>{const n={property:e,to:[]};t.set(e,n);i.set(e,n)});return{to:ka,toMany:ya,_observable:this,_bindProperties:e,_to:[],_bindings:i}},unbind(...e){if(!(ga in this)){return}const t=this[ba];const i=this[pa];if(e.length){if(!Aa(e)){throw new Qs[\"b\"](\"observable-unbind-wrong-properties: Properties must be strings.\",this)}e.forEach(e=>{const n=t.get(e);if(!n){return}let o,s,r,a;n.to.forEach(e=>{o=e[0];s=e[1];r=i.get(o);a=r[s];a.delete(n);if(!a.size){delete r[s]}if(!Object.keys(r).length){i.delete(o);this.stopListening(o,\"change\")}});t.delete(e)})}else{i.forEach((e,t)=>{this.stopListening(t,\"change\")});i.clear();t.clear()}},decorate(e){const t=this[e];if(!t){throw new Qs[\"b\"](\"observablemixin-cannot-decorate-undefined: Cannot decorate an undefined method.\",this,{object:this,methodName:e})}this.on(e,(e,i)=>{e.return=t.apply(this,i)});this[e]=function(...t){return this.fire(e,t)}}};ma(wa,lr);var _a=wa;function va(e){if(ga in e){return}Object.defineProperty(e,ga,{value:new Map});Object.defineProperty(e,pa,{value:new Map});Object.defineProperty(e,ba,{value:new Map})}function ka(...e){const t=Ca(...e);const i=Array.from(this._bindings.keys());const n=i.length;if(!t.callback&&t.to.length>1){throw new Qs[\"b\"](\"observable-bind-to-no-callback: Binding multiple observables only possible with callback.\",this)}if(n>1&&t.callback){throw new Qs[\"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!==n){throw new Qs[\"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(i[0]).callback=t.callback}Ea(this._observable,this._to);Ma(this);this._bindProperties.forEach(e=>{Pa(this._observable,e)})}function ya(e,t,i){if(this._bindings.size>1){throw new Qs[\"b\"](\"observable-bind-to-many-not-one-binding: Cannot bind multiple properties with toMany().\",this)}this.to(...xa(e,t),i)}function xa(e,t){const i=e.map(e=>[e,t]);return Array.prototype.concat.apply([],i)}function Aa(e){return e.every(e=>typeof e==\"string\")}function Ca(...e){if(!e.length){throw new Qs[\"b\"](\"observable-bind-to-parse-error: Invalid argument syntax in `to()`.\",null)}const t={to:[]};let i;if(typeof e[e.length-1]==\"function\"){t.callback=e.pop()}e.forEach(e=>{if(typeof e==\"string\"){i.properties.push(e)}else if(typeof e==\"object\"){i={observable:e,properties:[]};t.to.push(i)}else{throw new Qs[\"b\"](\"observable-bind-to-parse-error: Invalid argument syntax in `to()`.\",null)}});return t}function Ta(e,t,i,n){const o=e[pa];const s=o.get(i);const r=s||{};if(!r[n]){r[n]=new Set}r[n].add(t);if(!s){o.set(i,r)}}function Ma(e){let t;e._bindings.forEach((i,n)=>{e._to.forEach(o=>{t=o.properties[i.callback?0:e._bindProperties.indexOf(n)];i.to.push([o.observable,t]);Ta(e._observable,i,o.observable,t)})})}function Pa(e,t){const i=e[ba];const n=i.get(t);let o;if(n.callback){o=n.callback.apply(e,n.to.map(e=>e[0][e[1]]))}else{o=n.to[0];o=o[0][o[1]]}if(e.hasOwnProperty(t)){e[t]=o}else{e.set(t,o)}}function Ea(e,t){t.forEach(t=>{const i=e[pa];let n;if(!i.get(t.observable)){e.listenTo(t.observable,\"change\",(o,s)=>{n=i.get(t.observable)[s];if(n){n.forEach(t=>{Pa(e,t.property)})}})}})}const Sa=Symbol(\"document\");class Ia extends Fr{constructor(e,t,i){super(e,t,i);this.set(\"isReadOnly\",false);this.set(\"isFocused\",false)}is(e,t=null){const i=e&&e.replace(/^view:/,\"\");if(!t){return i==\"editableElement\"||super.is(e)}else{return i==\"editableElement\"&&t==this.name||super.is(e,t)}}destroy(){this.stopListening()}get document(){return this.getCustomProperty(Sa)}set _document(e){if(this.getCustomProperty(Sa)){throw new Qs[\"b\"](\"view-editableelement-document-already-set: View document is already set.\",this)}this._setCustomProperty(Sa,e);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})}}vr(Ia,_a);const Oa=Symbol(\"rootName\");class Na extends Ia{constructor(e){super(e);this.rootName=\"main\"}is(e,t=null){const i=e.replace(/^view:/,\"\");if(!t){return i==\"rootElement\"||super.is(e)}else{return i==\"rootElement\"&&t==this.name||super.is(e,t)}}get rootName(){return this.getCustomProperty(Oa)}set rootName(e){this._setCustomProperty(Oa,e)}set _name(e){this.name=e}}class La{constructor(e={}){if(!e.boundaries&&!e.startPosition){throw new Qs[\"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 Qs[\"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=Ra._createAt(e.startPosition)}else{this.position=Ra._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,i,n;do{n=this.position;({done:t,value:i}=this.next())}while(!t&&e(i));if(!t){this.position=n}}next(){if(this.direction==\"forward\"){return this._next()}else{return this._previous()}}_next(){let e=this.position.clone();const t=this.position;const i=e.parent;if(i.parent===null&&e.offset===i.childCount){return{done:true}}if(i===this._boundaryEndParent&&e.offset==this.boundaries.end.offset){return{done:true}}let n;if(i instanceof Tr){if(e.isAtEnd){this.position=Ra._createAfter(i);return this._next()}n=i.data[e.offset]}else{n=i.getChild(e.offset)}if(n instanceof zr){if(!this.shallow){e=new Ra(n,0)}else{e.offset++}this.position=e;return this._formatReturnValue(\"elementStart\",n,t,e,1)}else if(n instanceof Tr){if(this.singleCharacters){e=new Ra(n,0);this.position=e;return this._next()}else{let i=n.data.length;let o;if(n==this._boundaryEndParent){i=this.boundaries.end.offset;o=new Mr(n,0,i);e=Ra._createAfter(o)}else{o=new Mr(n,0,n.data.length);e.offset++}this.position=e;return this._formatReturnValue(\"text\",o,t,e,i)}}else if(typeof n==\"string\"){let n;if(this.singleCharacters){n=1}else{const t=i===this._boundaryEndParent?this.boundaries.end.offset:i.data.length;n=t-e.offset}const o=new Mr(i,e.offset,n);e.offset+=n;this.position=e;return this._formatReturnValue(\"text\",o,t,e,n)}else{e=Ra._createAfter(i);this.position=e;if(this.ignoreElementEnd){return this._next()}else{return this._formatReturnValue(\"elementEnd\",i,t,e)}}}_previous(){let e=this.position.clone();const t=this.position;const i=e.parent;if(i.parent===null&&e.offset===0){return{done:true}}if(i==this._boundaryStartParent&&e.offset==this.boundaries.start.offset){return{done:true}}let n;if(i instanceof Tr){if(e.isAtStart){this.position=Ra._createBefore(i);return this._previous()}n=i.data[e.offset-1]}else{n=i.getChild(e.offset-1)}if(n instanceof zr){if(!this.shallow){e=new Ra(n,n.childCount);this.position=e;if(this.ignoreElementEnd){return this._previous()}else{return this._formatReturnValue(\"elementEnd\",n,t,e)}}else{e.offset--;this.position=e;return this._formatReturnValue(\"elementStart\",n,t,e,1)}}else if(n instanceof Tr){if(this.singleCharacters){e=new Ra(n,n.data.length);this.position=e;return this._previous()}else{let i=n.data.length;let o;if(n==this._boundaryStartParent){const t=this.boundaries.start.offset;o=new Mr(n,t,n.data.length-t);i=o.data.length;e=Ra._createBefore(o)}else{o=new Mr(n,0,n.data.length);e.offset--}this.position=e;return this._formatReturnValue(\"text\",o,t,e,i)}}else if(typeof n==\"string\"){let n;if(!this.singleCharacters){const t=i===this._boundaryStartParent?this.boundaries.start.offset:0;n=e.offset-t}else{n=1}e.offset-=n;const o=new Mr(i,e.offset,n);this.position=e;return this._formatReturnValue(\"text\",o,t,e,n)}else{e=Ra._createBefore(i);this.position=e;return this._formatReturnValue(\"elementStart\",i,t,e,1)}}_formatReturnValue(e,t,i,n,o){if(t instanceof Mr){if(t.offsetInText+t.data.length==t.textNode.data.length){if(this.direction==\"forward\"&&!(this.boundaries&&this.boundaries.end.isEqual(this.position))){n=Ra._createAfter(t.textNode);this.position=n}else{i=Ra._createAfter(t.textNode)}}if(t.offsetInText===0){if(this.direction==\"backward\"&&!(this.boundaries&&this.boundaries.start.isEqual(this.position))){n=Ra._createBefore(t.textNode);this.position=n}else{i=Ra._createBefore(t.textNode)}}}return{done:false,value:{type:e,item:t,previousPosition:i,nextPosition:n,length:o}}}}class Ra{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 Ia)){if(e.parent){e=e.parent}else{return null}}return e}getShiftedBy(e){const t=Ra._createAt(this);const i=t.offset+e;t.offset=i<0?0:i;return t}getLastMatchingPosition(e,t={}){t.startPosition=this;const i=new La(t);i.skip(e);return i.position}getAncestors(){if(this.parent.is(\"documentFragment\")){return[this.parent]}else{return this.parent.getAncestors({includeSelf:true})}}getCommonAncestor(e){const t=this.getAncestors();const i=e.getAncestors();let n=0;while(t[n]==i[n]&&t[n]){n++}return n===0?null:t[n-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 i=e.parent.is(\"node\")?e.parent.getPath():[];t.push(this.offset);i.push(e.offset);const n=kr(t,i);switch(n){case\"prefix\":return\"before\";case\"extension\":return\"after\";default:return t[n]0?new this(i,n):new this(n,i)}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(Ra._createBefore(e),t)}}function ja(e){if(e.item.is(\"attributeElement\")||e.item.is(\"uiElement\")){return true}return false}function Da(e){let t=0;for(const i of e){t++}return t}class Ba{constructor(e=null,t,i){this._ranges=[];this._lastRangeBackward=false;this._isFake=false;this._fakeSelectionLabel=\"\";this.setTo(e,t,i)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length){return null}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 i=false;for(const n of e._ranges){if(t.isEqual(n)){i=true;break}}if(!i){return false}}return true}isSimilar(e){if(this.isBackward!=e.isBackward){return false}const t=Da(this.getRanges());const i=Da(e.getRanges());if(t!=i){return false}if(t==0){return true}for(let t of this.getRanges()){t=t.getTrimmed();let i=false;for(let n of e.getRanges()){n=n.getTrimmed();if(t.start.isEqual(n.start)&&t.end.isEqual(n.end)){i=true;break}}if(!i){return false}}return true}getSelectedElement(){if(this.rangeCount!==1){return null}const e=this.getFirstRange();let t=e.start.nodeAfter;let i=e.end.nodeBefore;if(e.start.parent.is(\"text\")&&e.start.isAtEnd&&e.start.parent.nextSibling){t=e.start.parent.nextSibling}if(e.end.parent.is(\"text\")&&e.end.isAtStart&&e.end.parent.previousSibling){i=e.end.parent.previousSibling}return t instanceof zr&&t==i?t:null}setTo(e,t,i){if(e===null){this._setRanges([]);this._setFakeOptions(t)}else if(e instanceof Ba||e instanceof Va){this._setRanges(e.getRanges(),e.isBackward);this._setFakeOptions({fake:e.isFake,label:e.fakeSelectionLabel})}else if(e instanceof za){this._setRanges([e],t&&t.backward);this._setFakeOptions(t)}else if(e instanceof Ra){this._setRanges([new za(e)]);this._setFakeOptions(t)}else if(e instanceof Cr){const n=!!i&&!!i.backward;let o;if(t===undefined){throw new Qs[\"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=za._createIn(e)}else if(t==\"on\"){o=za._createOn(e)}else{o=new za(Ra._createAt(e,t))}this._setRanges([o],n);this._setFakeOptions(i)}else if(Er(e)){this._setRanges(e,t&&t.backward);this._setFakeOptions(t)}else{throw new Qs[\"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 Qs[\"b\"](\"view-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.\",this)}const i=Ra._createAt(e,t);if(i.compareWith(this.focus)==\"same\"){return}const n=this.anchor;this._ranges.pop();if(i.compareWith(n)==\"before\"){this._addRange(new za(i,n),true)}else{this._addRange(new za(n,i))}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 za)){throw new Qs[\"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 Qs[\"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 za(e.start,e.end))}}vr(Ba,lr);class Va{constructor(e=null,t,i){this._selection=new Ba;this._selection.delegate(\"change\").to(this);this._selection.setTo(e,t,i)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}is(e){return e==\"selection\"||e==\"documentSelection\"||e==\"view:selection\"||e==\"view:documentSelection\"}_setTo(e,t,i){this._selection.setTo(e,t,i)}_setFocus(e,t){this._selection.setFocus(e,t)}}vr(Va,lr);class Fa{constructor(e={}){this._items=[];this._itemMap=new Map;this._idProperty=e.idProperty||\"id\";this._bindToExternalToInternalMap=new WeakMap;this._bindToInternalToExternalMap=new WeakMap;this._skippedIndexesFromExternal=[]}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(e,t){let i;const n=this._idProperty;if(n in e){i=e[n];if(typeof i!=\"string\"){throw new Qs[\"b\"](\"collection-add-invalid-id\",this)}if(this.get(i)){throw new Qs[\"b\"](\"collection-add-item-already-exists\",this)}}else{e[n]=i=ir()}if(t===undefined){t=this._items.length}else if(t>this._items.length||t<0){throw new Qs[\"b\"](\"collection-add-item-invalid-index\",this)}this._items.splice(t,0,e);this._itemMap.set(i,e);this.fire(\"add\",e,t);return this}get(e){let t;if(typeof e==\"string\"){t=this._itemMap.get(e)}else if(typeof e==\"number\"){t=this._items[e]}else{throw new Qs[\"b\"](\"collection-get-invalid-arg: Index or id must be given.\",this)}return t||null}has(e){if(typeof e==\"string\"){return this._itemMap.has(e)}else{const t=this._idProperty;const i=e[t];return this._itemMap.has(i)}}getIndex(e){let t;if(typeof e==\"string\"){t=this._itemMap.get(e)}else{t=e}return this._items.indexOf(t)}remove(e){let t,i,n;let o=false;const s=this._idProperty;if(typeof e==\"string\"){i=e;n=this._itemMap.get(i);o=!n;if(n){t=this._items.indexOf(n)}}else if(typeof e==\"number\"){t=e;n=this._items[t];o=!n;if(n){i=n[s]}}else{n=e;i=n[s];t=this._items.indexOf(n);o=t==-1||!this._itemMap.get(i)}if(o){throw new Qs[\"b\"](\"collection-remove-404: Item not found.\",this)}this._items.splice(t,1);this._itemMap.delete(i);const r=this._bindToInternalToExternalMap.get(n);this._bindToInternalToExternalMap.delete(n);this._bindToExternalToInternalMap.delete(r);this.fire(\"remove\",n,t);return n}map(e,t){return this._items.map(e,t)}find(e,t){return this._items.find(e,t)}filter(e,t){return this._items.filter(e,t)}clear(){if(this._bindToCollection){this.stopListening(this._bindToCollection);this._bindToCollection=null}while(this.length){this.remove(0)}}bindTo(e){if(this._bindToCollection){throw new Qs[\"b\"](\"collection-bind-to-rebind: The collection cannot be bound more than once.\",this)}this._bindToCollection=e;return{as:e=>{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 i=(i,n,o)=>{const s=t._bindToCollection==this;const r=t._bindToInternalToExternalMap.get(n);if(s&&r){this._bindToExternalToInternalMap.set(n,r);this._bindToInternalToExternalMap.set(r,n)}else{const i=e(n);if(!i){this._skippedIndexesFromExternal.push(o);return}let s=o;for(const e of this._skippedIndexesFromExternal){if(o>e){s--}}for(const e of t._skippedIndexesFromExternal){if(s>=e){s++}}this._bindToExternalToInternalMap.set(n,i);this._bindToInternalToExternalMap.set(i,n);this.add(i,s);for(let e=0;e{const n=this._bindToExternalToInternalMap.get(t);if(n){this.remove(n)}this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((e,t)=>{if(it){e.push(t)}return e},[])})}[Symbol.iterator](){return this._items[Symbol.iterator]()}}vr(Fa,lr);class Ha{constructor(){this.selection=new Va;this.roots=new Fa({idProperty:\"rootName\"});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 i of this._postFixers){t=i(e);if(t){break}}}while(t)}}vr(Ha,_a);const Ua=10;class Wa extends zr{constructor(e,t,i){super(e,t,i);this.getFillerOffset=$a;this._priority=Ua;this._id=null;this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(this.id===null){throw new Qs[\"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){const i=e&&e.replace(/^view:/,\"\");if(!t){return i==\"attributeElement\"||super.is(e)}else{return i==\"attributeElement\"&&t==this.name||super.is(e,t)}}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}}Wa.DEFAULT_PRIORITY=Ua;function $a(){if(qa(this)){return null}let e=this.parent;while(e&&e.is(\"attributeElement\")){if(qa(e)>1){return null}e=e.parent}if(!e||qa(e)>1){return null}return this.childCount}function qa(e){return Array.from(e.getChildren()).filter(e=>!e.is(\"uiElement\")).length}class Ya extends zr{constructor(e,t,i){super(e,t,i);this.getFillerOffset=Ga}is(e,t=null){const i=e.replace(/^view:/,\"\");if(!t){return i==\"emptyElement\"||super.is(e)}else{return i==\"emptyElement\"&&t==this.name||super.is(e,t)}}_insertChild(e,t){if(t&&(t instanceof Cr||Array.from(t).length>0)){throw new Qs[\"b\"](\"view-emptyelement-cannot-add: Cannot add child nodes to EmptyElement instance.\",[this,t])}}}function Ga(){return null}const Ja=navigator.userAgent.toLowerCase();const Ka={isMac:Qa(Ja),isEdge:Za(Ja),isGecko:ec(Ja),isSafari:tc(Ja),isAndroid:ic(Ja),features:{isRegExpUnicodePropertySupported:nc()}};var Xa=Ka;function Qa(e){return e.indexOf(\"macintosh\")>-1}function Za(e){return!!e.match(/edge\\/(\\d+.?\\d*)/)}function ec(e){return!!e.match(/gecko\\/\\d+/)}function tc(e){return e.indexOf(\" applewebkit/\")>-1&&e.indexOf(\"chrome\")===-1}function ic(e){return e.indexOf(\"android\")>-1}function nc(){let e=false;try{e=\"ć\".search(new RegExp(\"[\\\\p{L}]\",\"u\"))===0}catch(e){}return e}const oc={\"⌘\":\"ctrl\",\"⇧\":\"shift\",\"⌥\":\"alt\"};const sc={ctrl:\"⌘\",shift:\"⇧\",alt:\"⌥\"};const rc=dc();function ac(e){let t;if(typeof e==\"string\"){t=rc[e.toLowerCase()];if(!t){throw new Qs[\"b\"](\"keyboard-unknown-key: Unknown key name.\",null,{key:e})}}else{t=e.keyCode+(e.altKey?rc.alt:0)+(e.ctrlKey?rc.ctrl:0)+(e.shiftKey?rc.shift:0)}return t}function cc(e){if(typeof e==\"string\"){e=uc(e)}return e.map(e=>typeof e==\"string\"?ac(e):e).reduce((e,t)=>t+e,0)}function lc(e){if(!Xa.isMac){return e}return uc(e).map(e=>sc[e.toLowerCase()]||e).reduce((e,t)=>{if(e.slice(-1)in oc){return e+t}else{return e+\"+\"+t}})}function dc(){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 i=String.fromCharCode(t);e[i.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 uc(e){return e.split(/\\s*\\+\\s*/)}class hc extends zr{constructor(e,t,i){super(e,t,i);this.getFillerOffset=mc}is(e,t=null){const i=e.replace(/^view:/,\"\");if(!t){return i==\"uiElement\"||super.is(e)}else{return i==\"uiElement\"&&t==this.name||super.is(e,t)}}_insertChild(e,t){if(t&&(t instanceof Cr||Array.from(t).length>0)){throw new Qs[\"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 fc(e){e.document.on(\"keydown\",(t,i)=>gc(t,i,e.domConverter))}function mc(){return null}function gc(e,t,i){if(t.keyCode==rc.arrowright){const e=t.domTarget.ownerDocument.defaultView.getSelection();const n=e.rangeCount==1&&e.getRangeAt(0).collapsed;if(n||t.shiftKey){const t=e.focusNode;const o=e.focusOffset;const s=i.domPositionToView(t,o);if(s===null){return}let r=false;const a=s.getLastMatchingPosition(e=>{if(e.item.is(\"uiElement\")){r=true}if(e.item.is(\"uiElement\")||e.item.is(\"attributeElement\")){return true}return false});if(r){const t=i.viewPositionToDom(a);if(n){e.collapse(t.parent,t.offset)}else{e.extend(t.parent,t.offset)}}}}}class pc{constructor(e){this._children=[];if(e){this._insertChild(0,e)}}[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 i=0;const n=bc(t);for(const t of n){if(t.parent!==null){t._remove()}t.parent=this;this._children.splice(e,0,t);e++;i++}return i}_removeChildren(e,t=1){this._fireChange(\"children\",this);for(let i=e;i{if(typeof e==\"string\"){return new Tr(e)}if(e instanceof Mr){return new Tr(e.data)}return e})}class wc{constructor(e){this.document=e;this._cloneGroups=new Map}setSelection(e,t,i){this.document.selection._setTo(e,t,i)}setSelectionFocus(e,t){this.document.selection._setFocus(e,t)}createText(e){return new Tr(e)}createAttributeElement(e,t,i={}){const n=new Wa(e,t);if(i.priority){n._priority=i.priority}if(i.id){n._id=i.id}return n}createContainerElement(e,t){return new Fr(e,t)}createEditableElement(e,t){const i=new Ia(e,t);i._document=this.document;return i}createEmptyElement(e,t){return new Ya(e,t)}createUIElement(e,t,i){const n=new hc(e,t);if(i){n.render=i}return n}setAttribute(e,t,i){i._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,i){if(L(e)&&i===undefined){i=t}i._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,i){i._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}breakAttributes(e){if(e instanceof Ra){return this._breakAttributes(e)}else{return this._breakAttributesRange(e)}}breakContainer(e){const t=e.parent;if(!t.is(\"containerElement\")){throw new Qs[\"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 Qs[\"b\"](\"view-writer-break-root: Trying to break root element.\",this.document)}if(e.isAtStart){return Ra._createBefore(t)}else if(!e.isAtEnd){const i=t._clone(false);this.insert(Ra._createAfter(t),i);const n=new za(e,Ra._createAt(t,\"end\"));const o=new Ra(i,0);this.move(n,o)}return Ra._createAfter(t)}mergeAttributes(e){const t=e.offset;const i=e.parent;if(i.is(\"text\")){return e}if(i.is(\"attributeElement\")&&i.childCount===0){const e=i.parent;const t=i.index;i._remove();this._removeFromClonedElementsGroup(i);return this.mergeAttributes(new Ra(e,t))}const n=i.getChild(t-1);const o=i.getChild(t);if(!n||!o){return e}if(n.is(\"text\")&&o.is(\"text\")){return Ac(n,o)}else if(n.is(\"attributeElement\")&&o.is(\"attributeElement\")&&n.isSimilar(o)){const e=n.childCount;n._appendChild(o.getChildren());o._remove();this._removeFromClonedElementsGroup(o);return this.mergeAttributes(new Ra(n,e))}return e}mergeContainers(e){const t=e.nodeBefore;const i=e.nodeAfter;if(!t||!i||!t.is(\"containerElement\")||!i.is(\"containerElement\")){throw new Qs[\"b\"](\"view-writer-merge-containers-invalid-position: \"+\"Element before and after given position cannot be merged.\",this.document)}const n=t.getChild(t.childCount-1);const o=n instanceof Tr?Ra._createAt(n,\"end\"):Ra._createAt(t,\"end\");this.move(za._createIn(i),Ra._createAt(t,\"end\"));this.remove(za._createOn(i));return o}insert(e,t){t=Er(t)?[...t]:[t];Cc(t,this.document);const i=vc(e);if(!i){throw new Qs[\"b\"](\"view-writer-invalid-position-container\",this.document)}const n=this._breakAttributes(e,true);const o=i._insertChild(n.offset,t);for(const e of t){this._addToClonedElementsGroup(e)}const s=n.getShiftedBy(o);const r=this.mergeAttributes(n);if(o===0){return new za(r,r)}else{if(!r.isEqual(n)){s.offset--}const e=this.mergeAttributes(s);return new za(r,e)}}remove(e){const t=e instanceof za?e:za._createOn(e);Pc(t,this.document);if(t.isCollapsed){return new pc}const{start:i,end:n}=this._breakAttributesRange(t,true);const o=i.parent;const s=n.offset-i.offset;const r=o._removeChildren(i.offset,s);for(const e of r){this._removeFromClonedElementsGroup(e)}const a=this.mergeAttributes(i);t.start=a;t.end=a.clone();return new pc(r)}clear(e,t){Pc(e,this.document);const i=e.getWalker({direction:\"backward\",ignoreElementEnd:true});for(const n of i){const i=n.item;let o;if(i.is(\"element\")&&t.isSimilar(i)){o=za._createOn(i)}else if(!n.nextPosition.isAfter(e.start)&&i.is(\"textProxy\")){const e=i.getAncestors().find(e=>e.is(\"element\")&&t.isSimilar(e));if(e){o=za._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 i;if(t.isAfter(e.end)){t=this._breakAttributes(t,true);const n=t.parent;const o=n.childCount;e=this._breakAttributesRange(e,true);i=this.remove(e);t.offset+=n.childCount-o}else{i=this.remove(e)}return this.insert(t,i)}wrap(e,t){if(!(t instanceof Wa)){throw new Qs[\"b\"](\"view-writer-wrap-invalid-attribute\",this.document)}Pc(e,this.document);if(!e.isCollapsed){return this._wrapRange(e,t)}else{let i=e.start;if(i.parent.is(\"element\")&&!_c(i.parent)){i=i.getLastMatchingPosition(e=>e.item.is(\"uiElement\"))}i=this._wrapPosition(i,t);const n=this.document.selection;if(n.isCollapsed&&n.getFirstPosition().isEqual(e.start)){this.setSelection(i)}return new za(i)}}unwrap(e,t){if(!(t instanceof Wa)){throw new Qs[\"b\"](\"view-writer-unwrap-invalid-attribute\",this.document)}Pc(e,this.document);if(e.isCollapsed){return e}const{start:i,end:n}=this._breakAttributesRange(e,true);const o=i.parent;const s=this._unwrapChildren(o,i.offset,n.offset,t);const r=this.mergeAttributes(s.start);if(!r.isEqual(s.start)){s.end.offset--}const a=this.mergeAttributes(s.end);return new za(r,a)}rename(e,t){const i=new Fr(e,t.getAttributes());this.insert(Ra._createAfter(t),i);this.move(za._createIn(t),Ra._createAt(i,0));this.remove(za._createOn(t));return i}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return Ra._createAt(e,t)}createPositionAfter(e){return Ra._createAfter(e)}createPositionBefore(e){return Ra._createBefore(e)}createRange(e,t){return new za(e,t)}createRangeOn(e){return za._createOn(e)}createRangeIn(e){return za._createIn(e)}createSelection(e,t,i){return new Ba(e,t,i)}_wrapChildren(e,t,i,n){let o=t;const s=[];while(ofalse;e.parent._insertChild(e.offset,i);const n=new za(e,e.getShiftedBy(1));this.wrap(n,t);const o=new Ra(i.parent,i.index);i._remove();const s=o.nodeBefore;const r=o.nodeAfter;if(s instanceof Tr&&r instanceof Tr){return Ac(s,r)}return yc(o)}_wrapAttributeElement(e,t){if(!Ec(e,t)){return false}if(e.name!==t.name||e.priority!==t.priority){return false}for(const i of e.getAttributeKeys()){if(i===\"class\"||i===\"style\"){continue}if(t.hasAttribute(i)&&t.getAttribute(i)!==e.getAttribute(i)){return false}}for(const i of e.getStyleNames()){if(t.hasStyle(i)&&t.getStyle(i)!==e.getStyle(i)){return false}}for(const i of e.getAttributeKeys()){if(i===\"class\"||i===\"style\"){continue}if(!t.hasAttribute(i)){this.setAttribute(i,e.getAttribute(i),t)}}for(const i of e.getStyleNames()){if(!t.hasStyle(i)){this.setStyle(i,e.getStyle(i),t)}}for(const i of e.getClassNames()){if(!t.hasClass(i)){this.addClass(i,t)}}return true}_unwrapAttributeElement(e,t){if(!Ec(e,t)){return false}if(e.name!==t.name||e.priority!==t.priority){return false}for(const i of e.getAttributeKeys()){if(i===\"class\"||i===\"style\"){continue}if(!t.hasAttribute(i)||t.getAttribute(i)!==e.getAttribute(i)){return false}}if(!t.hasClass(...e.getClassNames())){return false}for(const i of e.getStyleNames()){if(!t.hasStyle(i)||t.getStyle(i)!==e.getStyle(i)){return false}}for(const i of e.getAttributeKeys()){if(i===\"class\"||i===\"style\"){continue}this.removeAttribute(i,t)}this.removeClass(Array.from(e.getClassNames()),t);this.removeStyle(Array.from(e.getStyleNames()),t);return true}_breakAttributesRange(e,t=false){const i=e.start;const n=e.end;Pc(e,this.document);if(e.isCollapsed){const i=this._breakAttributes(e.start,t);return new za(i,i)}const o=this._breakAttributes(n,t);const s=o.parent.childCount;const r=this._breakAttributes(i,t);o.offset+=o.parent.childCount-s;return new za(r,o)}_breakAttributes(e,t=false){const i=e.offset;const n=e.parent;if(e.parent.is(\"emptyElement\")){throw new Qs[\"b\"](\"view-writer-cannot-break-empty-element\",this.document)}if(e.parent.is(\"uiElement\")){throw new Qs[\"b\"](\"view-writer-cannot-break-ui-element\",this.document)}if(!t&&n.is(\"text\")&&Mc(n.parent)){return e.clone()}if(Mc(n)){return e.clone()}if(n.is(\"text\")){return this._breakAttributes(xc(e),t)}const o=n.childCount;if(i==o){const e=new Ra(n.parent,n.index+1);return this._breakAttributes(e,t)}else{if(i===0){const e=new Ra(n.parent,n.index);return this._breakAttributes(e,t)}else{const e=n.index+1;const o=n._clone();n.parent._insertChild(e,o);this._addToClonedElementsGroup(o);const s=n.childCount-i;const r=n._removeChildren(i,s);o._appendChild(r);const a=new Ra(n.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 i=this._cloneGroups.get(t);if(!i){i=new Set;this._cloneGroups.set(t,i)}i.add(e);e._clonesGroup=i}_removeFromClonedElementsGroup(e){if(e.is(\"element\")){for(const t of e.getChildren()){this._removeFromClonedElementsGroup(t)}}const t=e.id;if(!t){return}const i=this._cloneGroups.get(t);if(!i){return}i.delete(e)}}function _c(e){return Array.from(e.getChildren()).some(e=>!e.is(\"uiElement\"))}function vc(e){let t=e.parent;while(!Mc(t)){if(!t){return undefined}t=t.parent}return t}function kc(e,t){if(e.priorityt.priority){return false}return e.getIdentity()i instanceof e)){throw new Qs[\"b\"](\"view-writer-insert-invalid-node\",t)}if(!i.is(\"text\")){Cc(i.getChildren(),t)}}}const Tc=[Tr,Wa,Fr,Ya,hc];function Mc(e){return e&&(e.is(\"containerElement\")||e.is(\"documentFragment\"))}function Pc(e,t){const i=vc(e.start);const n=vc(e.end);if(!i||!n||i!==n){throw new Qs[\"b\"](\"view-writer-invalid-range-container\",t)}}function Ec(e,t){return e.id===null&&t.id===null}function Sc(e){return Object.prototype.toString.call(e)==\"[object Text]\"}const Ic=e=>e.createTextNode(\" \");const Oc=e=>{const t=e.createElement(\"br\");t.dataset.ckeFiller=true;return t};const Nc=7;const Lc=(()=>{let e=\"\";for(let t=0;t0){i.push({index:n,type:\"insert\",values:e.slice(n,s)})}if(o-n>0){i.push({index:n+(s-n),type:\"delete\",howMany:o-n})}return i}function $c(e,t){const{firstIndex:i,lastIndexOld:n,lastIndexNew:o}=e;if(i===-1){return Array(t).fill(\"equal\")}let s=[];if(i>0){s=s.concat(Array(i).fill(\"equal\"))}if(o-i>0){s=s.concat(Array(o-i).fill(\"insert\"))}if(n-i>0){s=s.concat(Array(n-i).fill(\"delete\"))}if(o200||o>200||n+o>300){return qc.fastDiff(e,t,i,true)}let s,r;if(ol?-1:1;if(d[n+h]){d[n]=d[n+h].slice(0)}if(!d[n]){d[n]=[]}d[n].push(o>l?s:r);let f=Math.max(o,l);let m=f-n;while(ml;m--){u[m]=h(m)}u[l]=h(l);f++}while(u[l]!==c);return d[l].slice(1)}qc.fastDiff=Vc;function Yc(e,t,i){e.insertBefore(i,e.childNodes[t]||null)}function Gc(e){const t=e.parentNode;if(t){t.removeChild(e)}}function Jc(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 Kc{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 Qs[\"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 i=t.parent.ownerDocument;if(!Rc(t.parent)){this._inlineFiller=Qc(i,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 i=this.domConverter.mapViewToDom(e).childNodes;const n=Array.from(this.domConverter.viewChildrenToDom(e,t.ownerDocument,{withChildren:false}));const o=this._diffNodeLists(i,n);const s=this._findReplaceActions(o,i,n);if(s.indexOf(\"replace\")!==-1){const t={equal:0,insert:0,delete:0};for(const o of s){if(o===\"replace\"){const o=t.equal+t.insert;const s=t.equal+t.delete;const r=e.getChild(o);if(r&&!r.is(\"uiElement\")){this._updateElementMappings(r,i[s])}Gc(n[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 Ra._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&&Sc(t.parent)&&Rc(t.parent)){return true}return false}_removeInlineFiller(){const e=this._inlineFiller;if(!Rc(e)){throw new Qs[\"b\"](\"view-renderer-filler-was-lost: The inline filler node was lost.\",this)}if(zc(e)){e.parentNode.removeChild(e)}else{e.data=e.data.substr(Nc)}this._inlineFiller=null}_needsInlineFillerAtSelection(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed){return false}const e=this.selection.getFirstPosition();const t=e.parent;const i=e.offset;if(!this.domConverter.mapViewToDom(t.root)){return false}if(!t.is(\"element\")){return false}if(!Xc(t)){return false}if(i===t.getFillerOffset()){return false}const n=e.nodeBefore;const o=e.nodeAfter;if(n instanceof Tr||o instanceof Tr){return false}return true}_updateText(e,t){const i=this.domConverter.findCorrespondingDomText(e);const n=this.domConverter.viewToDom(e,i.ownerDocument);const o=i.data;let s=n.data;const r=t.inlineFillerPosition;if(r&&r.parent==e.parent&&r.offset==e.index){s=Lc+s}if(o!=s){const e=Vc(o,s);for(const t of e){if(t.type===\"insert\"){i.insertData(t.index,t.values.join(\"\"))}else{i.deleteData(t.index,t.howMany)}}}}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(!t){return}const i=Array.from(t.attributes).map(e=>e.name);const n=e.getAttributeKeys();for(const i of n){t.setAttribute(i,e.getAttribute(i))}for(const n of i){if(!e.hasAttribute(n)){t.removeAttribute(n)}}}_updateChildren(e,t){const i=this.domConverter.mapViewToDom(e);if(!i){return}const n=t.inlineFillerPosition;const o=this.domConverter.mapViewToDom(e).childNodes;const s=Array.from(this.domConverter.viewChildrenToDom(e,i.ownerDocument,{bind:true,inlineFillerPosition:n}));if(n&&n.parent===e){Qc(i.ownerDocument,s,n.offset)}const r=this._diffNodeLists(o,s);let a=0;const c=new Set;for(const e of r){if(e===\"insert\"){Yc(i,a,s[a]);a++}else if(e===\"delete\"){c.add(o[a]);Gc(o[a])}else{this._markDescendantTextToSync(this.domConverter.domToView(s[a]));a++}}for(const e of c){if(!e.parentNode){this.domConverter.unbindDomElement(e)}}}_diffNodeLists(e,t){e=il(e,this._fakeSelectionContainer);return qc(e,t,el.bind(null,this.domConverter))}_findReplaceActions(e,t,i){if(e.indexOf(\"insert\")===-1||e.indexOf(\"delete\")===-1){return e}let n=[];let o=[];let s=[];const r={equal:0,insert:0,delete:0};for(const a of e){if(a===\"insert\"){s.push(i[r.equal+r.insert])}else if(a===\"delete\"){o.push(t[r.equal+r.delete])}else{n=n.concat(qc(o,s,Zc).map(e=>e===\"equal\"?\"replace\":e));n.push(\"equal\");o=[];s=[]}r[a]++}return n.concat(qc(o,s,Zc).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=nl(t)}const i=this._fakeSelectionContainer;this.domConverter.bindFakeSelection(i,this.selection);if(!this._fakeSelectionNeedsUpdate(e)){return}if(!i.parentElement||i.parentElement!=e){e.appendChild(i)}i.textContent=this.selection.fakeSelectionLabel||\" \";const n=t.getSelection();const o=t.createRange();n.removeAllRanges();o.selectNodeContents(i);n.addRange(o)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t)){return}const i=this.domConverter.viewPositionToDom(this.selection.anchor);const n=this.domConverter.viewPositionToDom(this.selection.focus);e.focus();t.collapse(i.parent,i.offset);t.extend(n.parent,n.offset);if(Xa.isGecko){tl(n,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 i=e.ownerDocument.getSelection();if(!t||t.parentElement!==e){return true}if(i.anchorNode!==t&&!t.contains(i.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 i=this.domConverter.mapDomToView(t);if(t&&i){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)}}}}vr(Kc,_a);function Xc(e){if(e.getAttribute(\"contenteditable\")==\"false\"){return false}const t=e.findAncestor(e=>e.hasAttribute(\"contenteditable\"));return!t||t.getAttribute(\"contenteditable\")==\"true\"}function Qc(e,t,i){const n=t instanceof Array?t:t.childNodes;const o=n[i];if(Sc(o)){o.data=Lc+o.data;return o}else{const o=e.createTextNode(Lc);if(Array.isArray(t)){n.splice(i,0,o)}else{Yc(t,i,o)}return o}}function Zc(e,t){return Jc(e)&&Jc(t)&&!Sc(e)&&!Sc(t)&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}function el(e,t,i){if(t===i){return true}else if(Sc(t)&&Sc(i)){return t.data===i.data}else if(e.isBlockFiller(t)&&e.isBlockFiller(i)){return true}return false}function tl(e,t){const i=e.parent;if(i.nodeType!=Node.ELEMENT_NODE||e.offset!=i.childNodes.length-1){return}const n=i.childNodes[e.offset];if(n&&n.tagName==\"BR\"){t.addRange(t.getRangeAt(0))}}function il(e,t){const i=Array.from(e);if(i.length==0||!t){return i}const n=i[i.length-1];if(n==t){i.pop()}return i}function nl(e){const t=e.createElement(\"div\");Object.assign(t.style,{position:\"fixed\",top:0,left:\"-9999px\",width:\"42px\"});t.textContent=\" \";return t}var ol={window:window,document:document};function sl(e){let t=0;while(e.previousSibling){e=e.previousSibling;t++}return t}function rl(e){const t=[];while(e&&e.nodeType!=Node.DOCUMENT_NODE){t.unshift(e);e=e.parentNode}return t}function al(e,t){const i=rl(e);const n=rl(t);let o=0;while(i[o]==n[o]&&i[o]){o++}return o===0?null:i[o-1]}const cl=Oc(document);class ll{constructor(e={}){this.blockFillerMode=e.blockFillerMode||\"br\";this.preElements=[\"pre\"];this.blockElements=[\"p\",\"div\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"li\",\"dd\",\"dt\",\"figcaption\"];this._blockFiller=this.blockFillerMode==\"br\"?Oc:Ic;this._domToViewMapping=new WeakMap;this._viewToDomMapping=new WeakMap;this._fakeSelectionMapping=new WeakMap}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new Ba(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 Array.from(e.childNodes)){this.unbindDomElement(t)}}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t);this._viewToDomMapping.set(t,e)}viewToDom(e,t,i={}){if(e.is(\"text\")){const i=this._processDataFromViewText(e);return t.createTextNode(i)}else{if(this.mapViewToDom(e)){return this.mapViewToDom(e)}let n;if(e.is(\"documentFragment\")){n=t.createDocumentFragment();if(i.bind){this.bindDocumentFragments(n,e)}}else if(e.is(\"uiElement\")){n=e.render(t);if(i.bind){this.bindElements(n,e)}return n}else{if(e.hasAttribute(\"xmlns\")){n=t.createElementNS(e.getAttribute(\"xmlns\"),e.name)}else{n=t.createElement(e.name)}if(i.bind){this.bindElements(n,e)}for(const t of e.getAttributeKeys()){n.setAttribute(t,e.getAttribute(t))}}if(i.withChildren||i.withChildren===undefined){for(const o of this.viewChildrenToDom(e,t,i)){n.appendChild(o)}}return n}}*viewChildrenToDom(e,t,i={}){const n=e.getFillerOffset&&e.getFillerOffset();let o=0;for(const s of e.getChildren()){if(n===o){yield this._blockFiller(t)}yield this.viewToDom(s,t,i);o++}if(n===o){yield this._blockFiller(t)}}viewRangeToDom(e){const t=this.viewPositionToDom(e.start);const i=this.viewPositionToDom(e.end);const n=document.createRange();n.setStart(t.parent,t.offset);n.setEnd(i.parent,i.offset);return n}viewPositionToDom(e){const t=e.parent;if(t.is(\"text\")){const i=this.findCorrespondingDomText(t);if(!i){return null}let n=e.offset;if(Rc(i)){n+=Nc}return{parent:i,offset:n}}else{let i,n,o;if(e.offset===0){i=this.mapViewToDom(t);if(!i){return null}o=i.childNodes[0]}else{const t=e.nodeBefore;n=t.is(\"text\")?this.findCorrespondingDomText(t):this.mapViewToDom(e.nodeBefore);if(!n){return null}i=n.parentNode;o=n.nextSibling}if(Sc(o)&&Rc(o)){return{parent:o,offset:Nc}}const s=n?sl(n)+1:0;return{parent:i,offset:s}}}domToView(e,t={}){if(this.isBlockFiller(e,this.blockFillerMode)){return null}const i=this.getParentUIElement(e,this._domToViewMapping);if(i){return i}if(Sc(e)){if(zc(e)){return null}else{const t=this._processDataFromDomText(e);return t===\"\"?null:new Tr(t)}}else if(this.isComment(e)){return null}else{if(this.mapDomToView(e)){return this.mapDomToView(e)}let i;if(this.isDocumentFragment(e)){i=new pc;if(t.bind){this.bindDocumentFragments(e,i)}}else{const n=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();i=new zr(n);if(t.bind){this.bindElements(e,i)}const o=e.attributes;for(let e=o.length-1;e>=0;e--){i._setAttribute(o[e].name,o[e].value)}}if(t.withChildren||t.withChildren===undefined){for(const n of this.domChildrenToView(e,t)){i._appendChild(n)}}return i}}*domChildrenToView(e,t={}){for(let i=0;i{const{scrollLeft:t,scrollTop:i}=e;n.push([t,i])});t.focus();ul(t,e=>{const[t,i]=n.shift();e.scrollLeft=t;e.scrollTop=i});ol.window.scrollTo(e,i)}}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(cl)}if(e.tagName===\"BR\"&&fl(e,this.blockElements)&&e.parentNode.childNodes.length===1){return true}return hl(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 i=t.collapsed;t.detach();return i}getParentUIElement(e){const t=rl(e);t.pop();while(t.length){const e=t.pop();const i=this._domToViewMapping.get(e);if(i&&i.is(\"uiElement\")){return i}}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}_isDomSelectionPositionCorrect(e,t){if(Sc(e)&&Rc(e)&&tthis.preElements.includes(e.name))){return t}if(t.charAt(0)==\" \"){const i=this._getTouchingViewTextNode(e,false);const n=i&&this._nodeEndsWithSpace(i);if(n||!i){t=\" \"+t.substr(1)}}if(t.charAt(t.length-1)==\" \"){const i=this._getTouchingViewTextNode(e,true);if(t.charAt(t.length-2)==\" \"||!i||i.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(dl(e,this.preElements)){return jc(e)}t=t.replace(/[ \\n\\t\\r]{1,}/g,\" \");const i=this._getTouchingInlineDomNode(e,false);const n=this._getTouchingInlineDomNode(e,true);const o=this._checkShouldLeftTrimDomText(i);const s=this._checkShouldRightTrimDomText(e,n);if(o){t=t.replace(/^ /,\"\")}if(s){t=t.replace(/ $/,\"\")}t=jc(new Text(t));t=t.replace(/ \\u00A0/g,\" \");if(/( |\\u00A0)\\u00A0$/.test(t)||!n||n.data&&n.data.charAt(0)==\" \"){t=t.replace(/\\u00A0$/,\" \")}if(o){t=t.replace(/^\\u00A0/,\" \")}return t}_checkShouldLeftTrimDomText(e){if(!e){return true}if(Gs(e)){return true}return/[^\\S\\u00A0]/.test(e.data.charAt(e.data.length-1))}_checkShouldRightTrimDomText(e,t){if(t){return false}return!Rc(e)}_getTouchingViewTextNode(e,t){const i=new La({startPosition:t?Ra._createAfter(e):Ra._createBefore(e),direction:t?\"forward\":\"backward\"});for(const e of i){if(e.item.is(\"containerElement\")){return null}else if(e.item.is(\"br\")){return null}else if(e.item.is(\"textProxy\")){return e.item}}return null}_getTouchingInlineDomNode(e,t){if(!e.parentNode){return null}const i=t?\"nextNode\":\"previousNode\";const n=e.ownerDocument;const o=rl(e)[0];const s=n.createTreeWalker(o,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,{acceptNode(e){if(Sc(e)){return NodeFilter.FILTER_ACCEPT}if(e.tagName==\"BR\"){return NodeFilter.FILTER_ACCEPT}return NodeFilter.FILTER_SKIP}});s.currentNode=e;const r=s[i]();if(r!==null){const t=al(e,r);if(t&&!dl(e,this.blockElements,t)&&!dl(r,this.blockElements,t)){return r}}return null}}function dl(e,t,i){let n=rl(e);if(i){n=n.slice(n.indexOf(i)+1)}return n.some(e=>e.tagName&&t.includes(e.tagName.toLowerCase()))}function ul(e,t){while(e&&e!=ol.document){t(e);e=e.parentNode}}function hl(e,t){const i=Sc(e)&&e.data==\" \";return i&&fl(e,t)&&e.parentNode.childNodes.length===1}function fl(e,t){const i=e.parentNode;return i&&i.tagName&&t.includes(i.tagName.toLowerCase())}function ml(e){const t=Object.prototype.toString.apply(e);if(t==\"[object Window]\"){return true}if(t==\"[object global]\"){return true}return false}const gl=ma({},lr,{listenTo(e,...t){if(Jc(e)||ml(e)){const i=this._getProxyEmitter(e)||new bl(e);i.attach(...t);e=i}lr.listenTo.call(this,e,...t)},stopListening(e,t,i){if(Jc(e)||ml(e)){const t=this._getProxyEmitter(e);if(!t){return}e=t}lr.stopListening.call(this,e,t,i);if(e instanceof bl){e.detach(t)}},_getProxyEmitter(e){return dr(this,wl(e))}});var pl=gl;class bl{constructor(e){ur(this,wl(e));this._domNode=e}}ma(bl.prototype,lr,{attach(e,t,i={}){if(this._domListeners&&this._domListeners[e]){return}const n=this._createDomListener(e,!!i.useCapture);this._domNode.addEventListener(e,n,!!i.useCapture);if(!this._domListeners){this._domListeners={}}this._domListeners[e]=n},detach(e){let t;if(this._domListeners[e]&&(!(t=this._events[e])||!t.callbacks.length)){this._domListeners[e].removeListener()}},_createDomListener(e,t){const i=t=>{this.fire(e,t)};i.removeListener=()=>{this._domNode.removeEventListener(e,i,t);delete this._domListeners[e]};return i}});function wl(e){return e[\"data-ck-expando\"]||(e[\"data-ck-expando\"]=ir())}class _l{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()}}vr(_l,pl);var vl=\"__lodash_hash_undefined__\";function kl(e){this.__data__.set(e,vl);return this}var yl=kl;function xl(e){return this.__data__.has(e)}var Al=xl;function Cl(e){var t=-1,i=e==null?0:e.length;this.__data__=new vt;while(++ta)){return false}var l=s.get(e);if(l&&s.get(t)){return l==t}var d=-1,u=true,h=i&Ol?new Tl:undefined;s.set(e,t);s.set(t,e);while(++d{this.listenTo(e,t,(e,t)=>{if(this.isEnabled){this.onDomEvent(t)}},{useCapture:this.useCapture})})}fire(e,t,i){if(this.isEnabled){this.document.fire(e,new vd(this.view,t,i))}}}class yd extends kd{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 ac(this)}})}}var xd=function(){return n[\"a\"].Date.now()};var Ad=xd;var Cd=\"[object Symbol]\";function Td(e){return typeof e==\"symbol\"||T(e)&&v(e)==Cd}var Md=Td;var Pd=0/0;var Ed=/^\\s+|\\s+$/g;var Sd=/^[-+]0x[0-9a-f]+$/i;var Id=/^0b[01]+$/i;var Od=/^0o[0-7]+$/i;var Nd=parseInt;function Ld(e){if(typeof e==\"number\"){return e}if(Md(e)){return Pd}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(Ed,\"\");var i=Id.test(e);return i||Od.test(e)?Nd(e.slice(2),i?2:8):Sd.test(e)?Pd:+e}var Rd=Ld;var zd=\"Expected a function\";var jd=Math.max,Dd=Math.min;function Bd(e,t,i){var n,o,s,r,a,c,l=0,d=false,u=false,h=true;if(typeof e!=\"function\"){throw new TypeError(zd)}t=Rd(t)||0;if(ce(i)){d=!!i.leading;u=\"maxWait\"in i;s=u?jd(Rd(i.maxWait)||0,t):s;h=\"trailing\"in i?!!i.trailing:h}function f(t){var i=n,s=o;n=o=undefined;l=t;r=e.apply(s,i);return r}function m(e){l=e;a=setTimeout(b,t);return d?f(e):r}function g(e){var i=e-c,n=e-l,o=t-i;return u?Dd(o,s-n):o}function p(e){var i=e-c,n=e-l;return c===undefined||i>=t||i<0||u&&n>=s}function b(){var e=Ad();if(p(e)){return w(e)}a=setTimeout(b,g(e))}function w(e){a=undefined;if(h&&n){return f(e)}n=o=undefined;return r}function _(){if(a!==undefined){clearTimeout(a)}l=0;n=c=o=a=undefined}function v(){return a===undefined?r:w(Ad())}function k(){var e=Ad(),i=p(e);n=arguments;o=this;c=e;if(i){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 r}k.cancel=_;k.flush=v;return k}var Vd=Bd;class Fd extends _l{constructor(e){super(e);this._fireSelectionChangeDoneDebounced=Vd(e=>this.document.fire(\"selectionChangeDone\",e),200)}observe(){const e=this.document;e.on(\"keydown\",(t,i)=>{const n=e.selection;if(n.isFake&&Hd(i.keyCode)&&this.isEnabled){i.preventDefault();this._handleSelectionMove(i.keyCode)}},{priority:\"lowest\"})}destroy(){super.destroy();this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection;const i=new Ba(t.getRanges(),{backward:t.isBackward,fake:false});if(e==rc.arrowleft||e==rc.arrowup){i.setTo(i.getFirstPosition())}if(e==rc.arrowright||e==rc.arrowdown){i.setTo(i.getLastPosition())}const n={oldSelection:t,newSelection:i,domSelection:null};this.document.fire(\"selectionChange\",n);this._fireSelectionChangeDoneDebounced(n)}}function Hd(e){return e==rc.arrowright||e==rc.arrowleft||e==rc.arrowup||e==rc.arrowdown}class Ud extends _l{constructor(e){super(e);this.mutationObserver=e.getObserver(_d);this.selection=this.document.selection;this.domConverter=e.domConverter;this._documents=new WeakSet;this._fireSelectionChangeDoneDebounced=Vd(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||!this.document.isFocused&&!this.document.isReadOnly){return}this.mutationObserver.flush();const t=e.defaultView.getSelection();const i=this.domConverter.domSelectionToView(t);if(this.selection.isEqual(i)&&this.domConverter.isDomSelectionCorrect(t)){return}if(++this._loopbackCounter>60){return}if(this.selection.isSimilar(i)){this.view.forceRender()}else{const e={oldSelection:this.selection,newSelection:i,domSelection:t};this.document.fire(\"selectionChange\",e);this._fireSelectionChangeDoneDebounced(e)}}_clearInfiniteLoop(){this._loopbackCounter=0}}class Wd extends kd{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\",(i,n)=>{const o=t.selection.editableElement;if(o===null||o===n.target){t.isFocused=false;e.forceRender()}})}onDomEvent(e){this.fire(e.type,e)}destroy(){if(this._renderTimeoutId){clearTimeout(this._renderTimeoutId)}super.destroy()}}class $d extends kd{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 qd extends kd{constructor(e){super(e);this.domEventType=[\"beforeinput\"]}onDomEvent(e){this.fire(e.type,e)}}function Yd(e){return Object.prototype.toString.apply(e)==\"[object Range]\"}function Gd(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 Jd=[\"top\",\"right\",\"bottom\",\"left\",\"width\",\"height\"];class Kd{constructor(e){const t=Yd(e);Object.defineProperty(this,\"_source\",{value:e._source||e,writable:true,enumerable:false});if(Gs(e)||t){if(t){Xd(this,Kd.getDomRangeRects(e)[0])}else{Xd(this,e.getBoundingClientRect())}}else if(ml(e)){const{innerWidth:t,innerHeight:i}=e;Xd(this,{top:0,right:t,bottom:i,left:0,width:t,height:i})}else{Xd(this,e)}}clone(){return new Kd(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 Kd(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(!Qd(e)){let i=e.parentNode||e.commonAncestorContainer;while(i&&!Qd(i)){const e=new Kd(i);const n=t.getIntersection(e);if(n){if(n.getArea()du(e,n));const r=du(e,n);iu(n,r,t);if(n.parent!=n){o=n.frameElement;n=n.parent;if(!o){return}}else{n=null}}}function tu(e){const t=lu(e);nu(t,()=>new Kd(e))}Object.assign(Zd,{scrollViewportToShowTarget:eu,scrollAncestorsToShowTarget:tu});function iu(e,t,i){const n=t.clone().moveBy(0,i);const o=t.clone().moveBy(0,-i);const s=new Kd(e).excludeScrollbarsAndBorders();const r=[o,n];if(!r.every(e=>s.contains(e))){let{scrollX:r,scrollY:a}=e;if(su(o,s)){a-=s.top-t.top+i}else if(ou(n,s)){a+=t.bottom-s.bottom+i}if(ru(t,s)){r-=s.left-t.left+i}else if(au(t,s)){r+=t.right-s.right+i}e.scrollTo(r,a)}}function nu(e,t){const i=cu(e);let n,o;while(e!=i.document.body){o=t();n=new Kd(e).excludeScrollbarsAndBorders();if(!n.contains(o)){if(su(o,n)){e.scrollTop-=n.top-o.top}else if(ou(o,n)){e.scrollTop+=o.bottom-n.bottom}if(ru(o,n)){e.scrollLeft-=n.left-o.left}else if(au(o,n)){e.scrollLeft+=o.right-n.right}}e=e.parentNode}}function ou(e,t){return e.bottom>t.bottom}function su(e,t){return e.topt.right}function cu(e){if(Yd(e)){return e.startContainer.ownerDocument.defaultView}else{return e.ownerDocument.defaultView}}function lu(e){if(Yd(e)){let t=e.commonAncestorContainer;if(Sc(t)){t=t.parentNode}return t}else{return e.parentNode}}function du(e,t){const i=cu(e);const n=new Kd(e);if(i===t){return n}else{let e=i;while(e!=t){const t=e.frameElement;const i=new Kd(t).excludeScrollbarsAndBorders();n.moveBy(i.left,i.top);e=e.parent}}return n}class uu{constructor(){this.document=new Ha;this.domConverter=new ll;this.domRoots=new Map;this.set(\"isRenderingInProgress\",false);this._renderer=new Kc(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 wc(this.document);this.addObserver(_d);this.addObserver(Ud);this.addObserver(Wd);this.addObserver(yd);this.addObserver(Fd);this.addObserver($d);if(Xa.isAndroid){this.addObserver(qd)}Dc(this);fc(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 i=this.document.getRoot(t);i._name=e.tagName.toLowerCase();const n={};for(const{name:t,value:o}of Array.from(e.attributes)){n[t]=o;if(t===\"class\"){this._writer.addClass(o.split(\" \"),i)}else{this._writer.setAttribute(t,o,i)}}this._initialDomRootAttributes.set(e,n);const o=()=>{this._writer.setAttribute(\"contenteditable\",!i.isReadOnly,i);if(i.isReadOnly){this._writer.addClass(\"ck-read-only\",i)}else{this._writer.removeClass(\"ck-read-only\",i)}};o();this.domRoots.set(t,e);this.domConverter.bindElements(e,i);this._renderer.markToSync(\"children\",i);this._renderer.markToSync(\"attributes\",i);this._renderer.domDocuments.add(e.ownerDocument);i.on(\"change:children\",(e,t)=>this._renderer.markToSync(\"children\",t));i.on(\"change:attributes\",(e,t)=>this._renderer.markToSync(\"attributes\",t));i.on(\"change:text\",(e,t)=>this._renderer.markToSync(\"text\",t));i.on(\"change:isReadOnly\",()=>this.change(o));i.on(\"change\",()=>{this._hasChangedSinceTheLastRendering=true});for(const i of this._observers.values()){i.observe(e,t)}}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach(({name:e})=>t.removeAttribute(e));const i=this._initialDomRootAttributes.get(t);for(const e in i){t.setAttribute(e,i[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,i]of this.domRoots){t.observe(i,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){eu({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 Qs[\"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){Qs[\"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 Ra._createAt(e,t)}createPositionAfter(e){return Ra._createAfter(e)}createPositionBefore(e){return Ra._createBefore(e)}createRange(e,t){return new za(e,t)}createRangeOn(e){return za._createOn(e)}createRangeIn(e){return za._createIn(e)}createSelection(e,t,i){return new Ba(e,t,i)}_disableRendering(e){this._renderingDisabled=e;if(e==false){this.change(()=>{})}}_render(){this.isRenderingInProgress=true;this.disableObservers();this._renderer.render();this.enableObservers();this.isRenderingInProgress=false}}vr(uu,_a);function hu(e){if(L(e)){return Pr(e)}else{return new Map(e)}}class fu{constructor(e){this.parent=null;this._attrs=hu(e)}get index(){let e;if(!this.parent){return null}if((e=this.parent.getChildIndex(this))===null){throw new Qs[\"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 Qs[\"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}get document(){if(this.root==this){return null}return this.root.document||null}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 i=e.includeSelf?this:this.parent;while(i){t[e.parentFirst?\"push\":\"unshift\"](i);i=i.parent}return t}getCommonAncestor(e,t={}){const i=this.getAncestors(t);const n=e.getAncestors(t);let o=0;while(i[o]==n[o]&&i[o]){o++}return o===0?null:i[o-1]}isBefore(e){if(this==e){return false}if(this.root!==e.root){return false}const t=this.getPath();const i=e.getPath();const n=kr(t,i);switch(n){case\"prefix\":return true;case\"extension\":return false;default:return t[n]{e[t[0]]=t[1];return e},{})}return e}is(e){return e==\"node\"||e==\"model:node\"}_clone(){return new fu(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=hu(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}class mu extends fu{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\"||super.is(e)}toJSON(){const e=super.toJSON();e.data=this.data;return e}_clone(){return new mu(this.data,this.getAttributes())}static fromJSON(e){return new mu(e.data,e.attributes)}}class gu{constructor(e,t,i){this.textNode=e;if(t<0||t>e.offsetSize){throw new Qs[\"b\"](\"model-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.\",this)}if(i<0||t+i>e.offsetSize){throw new Qs[\"b\"](\"model-textproxy-wrong-length: Given length value is incorrect.\",this)}this.data=e.data.substring(t,t+i);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}get document(){return this.textNode.document}is(e){return 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 i=e.includeSelf?this:this.parent;while(i){t[e.parentFirst?\"push\":\"unshift\"](i);i=i.parent}return t}hasAttribute(e){return this.textNode.hasAttribute(e)}getAttribute(e){return this.textNode.getAttribute(e)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}class pu{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 Qs[\"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 i of this._nodes){if(e>=t&&ee.toJSON())}}class bu extends fu{constructor(e,t,i){super(t);this.name=e;this._children=new pu;if(i){this._insertChild(0,i)}}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}is(e,t=null){const i=e.replace(/^model:/,\"\");if(!t){return i==\"element\"||i==this.name||super.is(e)}else{return i==\"element\"&&t==this.name}}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}offsetToIndex(e){return this._children.offsetToIndex(e)}getNodeByPath(e){let t=this;for(const i of e){t=t.getChild(t.offsetToIndex(i))}return t}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 bu(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const i=wu(t);for(const e of i){if(e.parent!==null){e._remove()}e.parent=this}this._children._insertNodes(e,i)}_removeChildren(e,t=1){const i=this._children._removeNodes(e,t);for(const e of i){e.parent=null}return i}static fromJSON(e){let t=null;if(e.children){t=[];for(const i of e.children){if(i.name){t.push(bu.fromJSON(i))}else{t.push(mu.fromJSON(i))}}}return new bu(e.name,e.attributes,t)}}function wu(e){if(typeof e==\"string\"){return[new mu(e)]}if(!Er(e)){e=[e]}return Array.from(e).map(e=>{if(typeof e==\"string\"){return new mu(e)}if(e instanceof gu){return new mu(e.data,e.getAttributes())}return e})}class _u{constructor(e={}){if(!e.boundaries&&!e.startPosition){throw new Qs[\"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 Qs[\"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=xu._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,i,n,o;do{n=this.position;o=this._visitedParent;({done:t,value:i}=this.next())}while(!t&&e(i));if(!t){this.position=n;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 i=this._visitedParent;if(i.parent===null&&t.offset===i.maxOffset){return{done:true}}if(i===this._boundaryEndParent&&t.offset==this.boundaries.end.offset){return{done:true}}const n=t.textNode?t.textNode:t.nodeAfter;if(n instanceof bu){if(!this.shallow){t.path.push(0);this._visitedParent=n}else{t.offset++}this.position=t;return vu(\"elementStart\",n,e,t,1)}else if(n instanceof mu){let o;if(this.singleCharacters){o=1}else{let e=n.endOffset;if(this._boundaryEndParent==i&&this.boundaries.end.offsete){e=this.boundaries.start.offset}o=t.offset-e}const s=t.offset-n.startOffset;const r=new gu(n,s-o,o);t.offset-=o;this.position=t;return vu(\"text\",r,e,t,o)}else{t.path.pop();this.position=t;this._visitedParent=i.parent;return vu(\"elementStart\",i,e,t,1)}}}function vu(e,t,i,n,o){return{done:false,value:{type:e,item:t,previousPosition:i,nextPosition:n,length:o}}}function ku(e){var t=e==null?0:e.length;return t?e[t-1]:undefined}var yu=ku;class xu{constructor(e,t,i=\"toNone\"){if(!e.is(\"element\")&&!e.is(\"documentFragment\")){throw new Qs[\"b\"](\"model-position-root-invalid: Position root invalid.\",e)}if(!(t instanceof Array)||t.length===0){throw new Qs[\"b\"](\"model-position-path-incorrect-format: Position path must be an array with at least one item.\",e,{path:t})}t=e.getPath().concat(t);e=e.root;this.root=e;this.path=t;this.stickiness=i}get offset(){return yu(this.path)}set offset(e){this.path[this.path.length-1]=e}get parent(){let e=this.root;for(let t=0;ti.path.length){if(t.offset!==o.maxOffset){return false}t.path=t.path.slice(0,-1);o=o.parent;t.offset++}else{if(i.offset!==0){return false}i.path=i.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 i=e.getParentPath();return kr(t,i)==\"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=xu._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 i=t.containsPosition(this)||t.start.isEqual(this)&&this.stickiness==\"toNext\";if(i){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 i=t.containsPosition(this)||t.start.isEqual(this);let n;if(i){n=this._getCombined(e.sourcePosition,e.targetPosition);if(e.sourcePosition.isBefore(e.targetPosition)){n=n._getTransformedByDeletion(e.deletionPosition,1)}}else if(this.isEqual(e.deletionPosition)){n=xu._createAt(e.deletionPosition)}else{n=this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1)}return n}_getTransformedByDeletion(e,t){const i=xu._createAt(this);if(this.root!=e.root){return i}if(kr(e.getParentPath(),this.getParentPath())==\"same\"){if(e.offsetthis.offset){return null}else{i.offset-=t}}}else if(kr(e.getParentPath(),this.getParentPath())==\"prefix\"){const n=e.path.length-1;if(e.offset<=this.path[n]){if(e.offset+t>this.path[n]){return null}else{i.path[n]-=t}}}return i}_getTransformedByInsertion(e,t){const i=xu._createAt(this);if(this.root!=e.root){return i}if(kr(e.getParentPath(),this.getParentPath())==\"same\"){if(e.offsett+1){const t=n.maxOffset-i.offset;if(t!==0){e.push(new Au(i,i.getShiftedBy(t)))}i.path=i.path.slice(0,-1);i.offset++;n=n.parent}while(i.path.length<=this.end.path.length){const t=this.end.path[i.path.length-1];const n=t-i.offset;if(n!==0){e.push(new Au(i,i.getShiftedBy(n)))}i.offset=t;i.path.push(0)}return e}getWalker(e={}){e.boundaries=this;return new _u(e)}*getItems(e={}){e.boundaries=this;e.ignoreElementEnd=true;const t=new _u(e);for(const e of t){yield e.item}}*getPositions(e={}){e.boundaries=this;const t=new _u(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 Au(this.start,this.end)]}getTransformedByOperations(e){const t=[new Au(this.start,this.end)];for(const i of e){for(let e=0;e0?new this(i,n):new this(n,i)}static _createIn(e){return new this(xu._createAt(e,0),xu._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(xu._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(e.length===0){throw new Qs[\"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 i=e.indexOf(t);const n=new this(t.start,t.end);if(i>0){for(let t=i-1;true;t++){if(e[t].end.isEqual(n.start)){n.start=xu._createAt(e[t].start)}else{break}}}for(let t=i+1;t{if(t.viewPosition){return}const i=this._modelToViewMapping.get(t.modelPosition.parent);t.viewPosition=this._findPositionIn(i,t.modelPosition.offset)},{priority:\"low\"});this.on(\"viewToModelPosition\",(e,t)=>{if(t.modelPosition){return}const i=this.findMappedViewAncestor(t.viewPosition);const n=this._viewToModelMapping.get(i);const o=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,i);t.modelPosition=xu._createAt(n,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 i=this._markerNameToElements.get(t)||new Set;i.add(e);const n=this._elementToMarkerNames.get(e)||new Set;n.add(t);this._markerNameToElements.set(t,i);this._elementToMarkerNames.set(e,n)}unbindElementFromMarkerName(e,t){const i=this._markerNameToElements.get(t);if(i){i.delete(e);if(i.size==0){this._markerNameToElements.delete(t)}}const n=this._elementToMarkerNames.get(e);if(n){n.delete(t);if(n.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 Au(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new za(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 i={modelPosition:e,mapper:this,isPhantom:t.isPhantom};this.fire(\"modelToViewPosition\",i);return i.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t){return null}const i=new Set;for(const e of t){if(e.is(\"attributeElement\")){for(const t of e.getElementsWithSameId()){i.add(t)}}else{i.add(e)}}return i}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,i){if(i!=e){const n=this._toModelOffset(e.parent,e.index,i);const o=this._toModelOffset(e,t,e);return n+o}if(e.is(\"text\")){return t}let n=0;for(let i=0;i1?t[0]+\":\"+t[1]:t[0]}class Pu{constructor(e){this.conversionApi=ma({dispatcher:this},e)}convertChanges(e,t,i){for(const t of e.getMarkersToRemove()){this.convertMarkerRemove(t.name,t.range,i)}for(const t of e.getChanges()){if(t.type==\"insert\"){this.convertInsert(Au._createFromPositionAndShift(t.position,t.length),i)}else if(t.type==\"remove\"){this.convertRemove(t.position,t.length,t.name,i)}else{this.convertAttribute(t.range,t.attributeKey,t.attributeOldValue,t.attributeNewValue,i)}}for(const e of this.conversionApi.mapper.flushUnboundMarkerNames()){const n=t.get(e).getRange();this.convertMarkerRemove(e,n,i);this.convertMarkerAdd(e,n,i)}for(const t of e.getMarkersToAdd()){this.convertMarkerAdd(t.name,t.range,i)}}convertInsert(e,t){this.conversionApi.writer=t;this.conversionApi.consumable=this._createInsertConsumable(e);for(const t of e){const e=t.item;const i=Au._createFromPositionAndShift(t.previousPosition,t.length);const n={item:e,range:i};this._testAndFire(\"insert\",n);for(const t of e.getAttributeKeys()){n.attributeKey=t;n.attributeOldValue=null;n.attributeNewValue=e.getAttribute(t);this._testAndFire(`attribute:${t}`,n)}}this._clearConversionApi()}convertRemove(e,t,i,n){this.conversionApi.writer=n;this.fire(\"remove:\"+i,{position:e,length:t},this.conversionApi);this._clearConversionApi()}convertAttribute(e,t,i,n,o){this.conversionApi.writer=o;this.conversionApi.consumable=this._createConsumableForRange(e,`attribute:${t}`);for(const o of e){const e=o.item;const s=Au._createFromPositionAndShift(o.previousPosition,o.length);const r={item:e,range:s,attributeKey:t,attributeOldValue:i,attributeNewValue:n};this._testAndFire(`attribute:${t}`,r)}this._clearConversionApi()}convertSelection(e,t,i){const n=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));this.conversionApi.writer=i;this.conversionApi.consumable=this._createSelectionConsumable(e,n);this.fire(\"selection\",{selection:e},this.conversionApi);if(!e.isCollapsed){return}for(const t of n){const i=t.getRange();if(!Eu(e.getFirstPosition(),t,this.conversionApi.mapper)){continue}const n={item:e,markerName:t.name,markerRange:i};if(this.conversionApi.consumable.test(e,\"addMarker:\"+t.name)){this.fire(\"addMarker:\"+t.name,n,this.conversionApi)}}for(const t of e.getAttributeKeys()){const i={item:e,range:e.getFirstRange(),attributeKey:t,attributeOldValue:null,attributeNewValue:e.getAttribute(t)};if(this.conversionApi.consumable.test(e,\"attribute:\"+i.attributeKey)){this.fire(\"attribute:\"+i.attributeKey+\":$text\",i,this.conversionApi)}}this._clearConversionApi()}convertMarkerAdd(e,t,i){if(!t.root.document||t.root.rootName==\"$graveyard\"){return}this.conversionApi.writer=i;const n=\"addMarker:\"+e;const o=new Tu;o.add(t,n);this.conversionApi.consumable=o;this.fire(n,{markerName:e,markerRange:t},this.conversionApi);if(!o.test(t,n)){return}this.conversionApi.consumable=this._createConsumableForRange(t,n);for(const i of t.getItems()){if(!this.conversionApi.consumable.test(i,n)){continue}const o={item:i,range:Au._createOn(i),markerName:e,markerRange:t};this.fire(n,o,this.conversionApi)}this._clearConversionApi()}convertMarkerRemove(e,t,i){if(!t.root.document||t.root.rootName==\"$graveyard\"){return}this.conversionApi.writer=i;this.fire(\"removeMarker:\"+e,{markerName:e,markerRange:t},this.conversionApi);this._clearConversionApi()}_createInsertConsumable(e){const t=new Tu;for(const i of e){const e=i.item;t.add(e,\"insert\");for(const i of e.getAttributeKeys()){t.add(e,\"attribute:\"+i)}}return t}_createConsumableForRange(e,t){const i=new Tu;for(const n of e.getItems()){i.add(n,t)}return i}_createSelectionConsumable(e,t){const i=new Tu;i.add(e,\"selection\");for(const n of t){i.add(e,\"addMarker:\"+n.name)}for(const t of e.getAttributeKeys()){i.add(e,\"attribute:\"+t)}return i}_testAndFire(e,t){if(!this.conversionApi.consumable.test(t.item,e)){return}const i=t.item.name||\"$text\";this.fire(e+\":\"+i,t,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer;delete this.conversionApi.consumable}}vr(Pu,lr);function Eu(e,t,i){const n=t.getRange();const o=Array.from(e.getAncestors());o.shift();o.reverse();const s=o.some(e=>{if(n.containsItem(e)){const t=i.toViewElement(e);return!!t.getCustomProperty(\"addHighlight\")}});return!s}class Su{constructor(e,t,i){this._lastRangeBackward=false;this._ranges=[];this._attrs=new Map;if(e){this.setTo(e,t,i)}}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 i=false;for(const n of e._ranges){if(t.isEqual(n)){i=true;break}}if(!i){return false}}return true}*getRanges(){for(const e of this._ranges){yield new Au(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 Au(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 Au(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,i){if(e===null){this._setRanges([])}else if(e instanceof Su){this._setRanges(e.getRanges(),e.isBackward)}else if(e&&typeof e.getRanges==\"function\"){this._setRanges(e.getRanges(),e.isBackward)}else if(e instanceof Au){this._setRanges([e],!!t&&!!t.backward)}else if(e instanceof xu){this._setRanges([new Au(e)])}else if(e instanceof fu){const n=!!i&&!!i.backward;let o;if(t==\"in\"){o=Au._createIn(e)}else if(t==\"on\"){o=Au._createOn(e)}else if(t!==undefined){o=new Au(xu._createAt(e,t))}else{throw new Qs[\"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],n)}else if(Er(e)){this._setRanges(e,t&&!!t.backward)}else{throw new Qs[\"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 i=e.some(t=>{if(!(t instanceof Au)){throw new Qs[\"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&&!i){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 Qs[\"b\"](\"model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.\",[this,e])}const i=xu._createAt(e,t);if(i.compareWith(this.focus)==\"same\"){return}const n=this.anchor;if(this._ranges.length){this._popRange()}if(i.compareWith(n)==\"before\"){this._pushRange(new Au(i,n));this._lastRangeBackward=true}else{this._pushRange(new Au(n,i));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}const e=this.getFirstRange();const t=e.start.nodeAfter;const i=e.end.nodeBefore;return t instanceof bu&&t==i?t:null}is(e){return e==\"selection\"||e==\"model:selection\"}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const i=Nu(t.start,e);if(i&&Lu(i,t)){yield i}for(const i of t.getWalker()){const n=i.item;if(i.type==\"elementEnd\"&&Ou(n,e,t)){yield n}}const n=Nu(t.end,e);if(n&&!t.end.isTouching(xu._createAt(n,0))&&Lu(n,t)){yield n}}}containsEntireContent(e=this.anchor.root){const t=xu._createAt(e,0);const i=xu._createAt(e,\"end\");return t.isTouching(this.getFirstPosition())&&i.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e);this._ranges.push(new Au(e.start,e.end))}_checkRange(e){for(let t=0;t0){this._popRange()}}_popRange(){this._ranges.pop()}}vr(Su,lr);function Iu(e,t){if(t.has(e)){return false}t.add(e);return e.document.model.schema.isBlock(e)&&e.parent}function Ou(e,t,i){return Iu(e,t)&&Lu(e,i)}function Nu(e,t){const i=e.parent.document.model.schema;const n=e.parent.getAncestors({parentFirst:true,includeSelf:true});let o=false;const s=n.find(e=>{if(o){return false}o=i.isLimit(e);return!o&&Iu(e,t)});n.forEach(e=>t.add(e));return s}function Lu(e,t){const i=Ru(e);if(!i){return true}const n=t.containsRange(Au._createOn(i),true);return!n}function Ru(e){const t=e.document.model.schema;let i=e.parent;while(i){if(t.isBlock(i)){return i}i=i.parent}}class zu extends Au{constructor(e,t){super(e,t);ju.call(this)}detach(){this.stopListening()}is(e){return e==\"liveRange\"||e==\"model:liveRange\"||super.is(e)}toRange(){return new Au(this.start,this.end)}static fromRange(e){return new zu(e.start,e.end)}}function ju(){this.listenTo(this.root.document.model,\"applyOperation\",(e,t)=>{const i=t[0];if(!i.isDocumentOperation){return}Du.call(this,i)},{priority:\"low\"})}function Du(e){const t=this.getTransformedByOperation(e);const i=Au._createFromRanges(t);const n=!i.isEqual(this);const o=Bu(this,e);let s=null;if(n){if(i.root.rootName==\"$graveyard\"){if(e.type==\"remove\"){s=e.sourcePosition}else{s=e.deletionPosition}}const t=this.toRange();this.start=i.start;this.end=i.end;this.fire(\"change:range\",t,{deletionPosition:s})}else if(o){this.fire(\"change:content\",this.toRange(),{deletionPosition:s})}}function Bu(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}vr(zu,lr);const Vu=\"selection:\";class Fu{constructor(e){this._selection=new Hu(e);this._selection.delegate(\"change:range\").to(this);this._selection.delegate(\"change:attribute\").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,i){this._selection.setTo(e,t,i)}_setAttribute(e,t){this._selection.setAttribute(e,t)}_removeAttribute(e){this._selection.removeAttribute(e)}_getStoredAttributes(){return this._selection._getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(e){this._selection.restoreGravity(e)}static _getStoreAttributeKey(e){return Vu+e}static _isStoreAttributeKey(e){return e.startsWith(Vu)}}vr(Fu,lr);class Hu extends Su{constructor(e){super();this.markers=new Fa({idProperty:\"name\"});this._model=e.model;this._document=e;this._attributePriority=new Map;this._fixGraveyardRangesData=[];this._hasChangedRange=false;this._overriddenGravityRegister=new Set;this.listenTo(this._model,\"applyOperation\",(e,t)=>{const i=t[0];if(!i.isDocumentOperation||i.type==\"marker\"||i.type==\"rename\"||i.type==\"noop\"){return}while(this._fixGraveyardRangesData.length){const{liveRange:e,sourcePosition:t}=this._fixGraveyardRangesData.shift();this._fixGraveyardSelection(e,t)}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 Qs[\"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)=>{Wu(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._fixGraveyardRangesData.push({liveRange:t,sourcePosition:n.deletionPosition})}});return t}_updateMarkers(){const e=[];for(const t of this._model.markers){const i=t.getRange();for(const n of this.getRanges()){if(i.containsRange(n,!n.isCollapsed)){e.push(t)}}}for(const t of e){if(!this.markers.has(t)){this.markers.add(t)}}for(const t of Array.from(this.markers)){if(!e.includes(t)){this.markers.remove(t)}}}_updateAttributes(e){const t=hu(this._getSurroundingAttributes());const i=hu(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 n=[];for(const[e,t]of this.getAttributes()){if(!i.has(e)||i.get(e)!==t){n.push(e)}}for(const[e]of i){if(!this.hasAttribute(e)){n.push(e)}}if(n.length>0){this.fire(\"change:attribute\",{attributeKeys:n,directChange:false})}}_setAttribute(e,t,i=true){const n=i?\"normal\":\"low\";if(n==\"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,n);return true}_removeAttribute(e,t=true){const i=t?\"normal\":\"low\";if(i==\"low\"&&this._attributePriority.get(e)==\"normal\"){return false}this._attributePriority.set(e,i);if(!super.hasAttribute(e)){return false}this._attrs.delete(e);return true}_setAttributesTo(e){const t=new Set;for(const[t,i]of this.getAttributes()){if(e.get(t)===i){continue}this._removeAttribute(t,false)}for(const[i,n]of e){const e=this._setAttribute(i,n,false);if(e){t.add(i)}}return t}*_getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty){for(const t of e.getAttributeKeys()){if(t.startsWith(Vu)){const i=t.substr(Vu.length);yield[i,e.getAttribute(t)]}}}}_getSurroundingAttributes(){const e=this.getFirstPosition();const t=this._model.schema;let i=null;if(!this.isCollapsed){const e=this.getFirstRange();for(const n of e){if(n.item.is(\"element\")&&t.isObject(n.item)){break}if(n.type==\"text\"){i=n.item.getAttributes();break}}}else{const t=e.textNode?e.textNode:e.nodeBefore;const n=e.textNode?e.textNode:e.nodeAfter;if(!this.isGravityOverridden){i=Uu(t)}if(!i){i=Uu(n)}if(!this.isGravityOverridden&&!i){let e=t;while(e&&!i){e=e.previousSibling;i=Uu(e)}}if(!i){let e=n;while(e&&!i){e=e.nextSibling;i=Uu(e)}}if(!i){i=this._getStoredAttributes()}}return i}_fixGraveyardSelection(e,t){const i=t.clone();const n=this._model.schema.getNearestSelectionRange(i);const o=this._ranges.indexOf(e);this._ranges.splice(o,1);e.detach();if(n){const e=this._prepareRange(n);this._ranges.splice(o,0,e)}}}function Uu(e){if(e instanceof gu||e instanceof mu){return e.getAttributes()}return null}function Wu(e,t){const i=e.document.differ;for(const n of i.getChanges()){if(n.type!=\"insert\"){continue}const i=n.position.parent;const o=n.length===i.maxOffset;if(o){e.enqueueChange(t,e=>{const t=Array.from(i.getAttributeKeys()).filter(e=>e.startsWith(Vu));for(const n of t){e.removeAttribute(n,i)}})}}}class $u{constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers){e(t)}return this}}var qu=1,Yu=4;function Gu(e){return Hs(e,qu|Yu)}var Ju=Gu;class Ku extends $u{elementToElement(e){return this.add(uh(e))}attributeToElement(e){return this.add(hh(e))}attributeToAttribute(e){return this.add(fh(e))}markerToElement(e){return this.add(mh(e))}markerToHighlight(e){return this.add(gh(e))}}function Xu(){return(e,t,i)=>{if(!i.consumable.consume(t.item,\"insert\")){return}const n=i.writer;const o=i.mapper.toViewPosition(t.range.start);const s=n.createText(t.item.data);n.insert(o,s)}}function Qu(){return(e,t,i)=>{const n=i.mapper.toViewPosition(t.position);const o=t.position.getShiftedBy(t.length);const s=i.mapper.toViewPosition(o,{isPhantom:true});const r=i.writer.createRange(n,s);const a=i.writer.remove(r.getTrimmed());for(const e of i.writer.createRangeIn(a).getItems()){i.mapper.unbindViewElement(e)}}}function Zu(e){const t=new Wa(\"span\",e.attributes);if(e.classes){t._addClass(e.classes)}if(e.priority){t._priority=e.priority}t._id=e.id;return t}function eh(){return(e,t,i)=>{const n=t.selection;if(n.isCollapsed){return}if(!i.consumable.consume(n,\"selection\")){return}const o=[];for(const e of n.getRanges()){const t=i.mapper.toViewRange(e);o.push(t)}i.writer.setSelection(o,{backward:n.isBackward})}}function th(){return(e,t,i)=>{const n=t.selection;if(!n.isCollapsed){return}if(!i.consumable.consume(n,\"selection\")){return}const o=i.writer;const s=n.getFirstPosition();const r=i.mapper.toViewPosition(s);const a=o.breakAttributes(r);o.setSelection(a)}}function ih(){return(e,t,i)=>{const n=i.writer;const o=n.document.selection;for(const e of o.getRanges()){if(e.isCollapsed){if(e.end.parent.document){i.writer.mergeAttributes(e.start)}}}n.setSelection(null)}}function nh(e){return(t,i,n)=>{const o=e(i.attributeOldValue,n.writer);const s=e(i.attributeNewValue,n.writer);if(!o&&!s){return}if(!n.consumable.consume(i.item,t.name)){return}const r=n.writer;const a=r.document.selection;if(i.item instanceof Su||i.item instanceof Fu){r.wrap(a.getFirstRange(),s)}else{let e=n.mapper.toViewRange(i.range);if(i.attributeOldValue!==null&&o){e=r.unwrap(e,o)}if(i.attributeNewValue!==null&&s){r.wrap(e,s)}}}}function oh(e){return(t,i,n)=>{const o=e(i.item,n.writer);if(!o){return}if(!n.consumable.consume(i.item,\"insert\")){return}const s=n.mapper.toViewPosition(i.range.start);n.mapper.bindElements(i.item,o);n.writer.insert(s,o)}}function sh(e){return(t,i,n)=>{i.isOpening=true;const o=e(i,n.writer);i.isOpening=false;const s=e(i,n.writer);if(!o||!s){return}const r=i.markerRange;if(r.isCollapsed&&!n.consumable.consume(r,t.name)){return}for(const e of r){if(!n.consumable.consume(e.item,t.name)){return}}const a=n.mapper;const c=n.writer;c.insert(a.toViewPosition(r.start),o);n.mapper.bindElementToMarker(o,i.markerName);if(!r.isCollapsed){c.insert(a.toViewPosition(r.end),s);n.mapper.bindElementToMarker(s,i.markerName)}t.stop()}}function rh(){return(e,t,i)=>{const n=i.mapper.markerNameToElements(t.markerName);if(!n){return}for(const e of n){i.mapper.unbindElementFromMarkerName(e,t.markerName);i.writer.clear(i.writer.createRangeOn(e),e)}i.writer.clearClonedElementsGroup(t.markerName);e.stop()}}function ah(e){return(t,i,n)=>{const o=e(i.attributeOldValue,i);const s=e(i.attributeNewValue,i);if(!o&&!s){return}if(!n.consumable.consume(i.item,t.name)){return}const r=n.mapper.toViewElement(i.item);const a=n.writer;if(!r){throw new Qs[\"b\"](\"conversion-attribute-to-attribute-on-text: \"+\"Trying to convert text node's attribute with attribute-to-attribute converter.\",[i,n])}if(i.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,r)}}else if(o.key==\"style\"){const e=Object.keys(o.value);for(const t of e){a.removeStyle(t,r)}}else{a.removeAttribute(o.key,r)}}if(i.attributeNewValue!==null&&s){if(s.key==\"class\"){const e=Array.isArray(s.value)?s.value:[s.value];for(const t of e){a.addClass(t,r)}}else if(s.key==\"style\"){const e=Object.keys(s.value);for(const t of e){a.setStyle(t,s.value[t],r)}}else{a.setAttribute(s.key,s.value,r)}}}}function ch(e){return(t,i,n)=>{if(!i.item){return}if(!(i.item instanceof Su||i.item instanceof Fu)&&!i.item.is(\"textProxy\")){return}const o=vh(e,i,n);if(!o){return}if(!n.consumable.consume(i.item,t.name)){return}const s=Zu(o);const r=n.writer;const a=r.document.selection;if(i.item instanceof Su||i.item instanceof Fu){r.wrap(a.getFirstRange(),s,a)}else{const e=n.mapper.toViewRange(i.range);const t=r.wrap(e,s);for(const e of t.getItems()){if(e.is(\"attributeElement\")&&e.isSimilar(s)){n.mapper.bindElementToMarker(e,i.markerName);break}}}}}function lh(e){return(t,i,n)=>{if(!i.item){return}if(!(i.item instanceof bu)){return}const o=vh(e,i,n);if(!o){return}if(!n.consumable.test(i.item,t.name)){return}const s=n.mapper.toViewElement(i.item);if(s&&s.getCustomProperty(\"addHighlight\")){n.consumable.consume(i.item,t.name);for(const e of Au._createIn(i.item)){n.consumable.consume(e.item,t.name)}s.getCustomProperty(\"addHighlight\")(s,o,n.writer);n.mapper.bindElementToMarker(s,i.markerName)}}}function dh(e){return(t,i,n)=>{if(i.markerRange.isCollapsed){return}const o=vh(e,i,n);if(!o){return}const s=Zu(o);const r=n.mapper.markerNameToElements(i.markerName);if(!r){return}for(const e of r){n.mapper.unbindElementFromMarkerName(e,i.markerName);if(e.is(\"attributeElement\")){n.writer.unwrap(n.writer.createRangeOn(e),s)}else{e.getCustomProperty(\"removeHighlight\")(e,o.id,n.writer)}}n.writer.clearClonedElementsGroup(i.markerName);t.stop()}}function uh(e){e=Ju(e);e.view=ph(e.view,\"container\");return t=>{t.on(\"insert:\"+e.model,oh(e.view),{priority:e.converterPriority||\"normal\"})}}function hh(e){e=Ju(e);const t=e.model.key?e.model.key:e.model;let i=\"attribute:\"+t;if(e.model.name){i+=\":\"+e.model.name}if(e.model.values){for(const t of e.model.values){e.view[t]=ph(e.view[t],\"attribute\")}}else{e.view=ph(e.view,\"attribute\")}const n=wh(e);return t=>{t.on(i,nh(n),{priority:e.converterPriority||\"normal\"})}}function fh(e){e=Ju(e);const t=e.model.key?e.model.key:e.model;let i=\"attribute:\"+t;if(e.model.name){i+=\":\"+e.model.name}if(e.model.values){for(const t of e.model.values){e.view[t]=_h(e.view[t])}}else{e.view=_h(e.view)}const n=wh(e);return t=>{t.on(i,ah(n),{priority:e.converterPriority||\"normal\"})}}function mh(e){e=Ju(e);e.view=ph(e.view,\"ui\");return t=>{t.on(\"addMarker:\"+e.model,sh(e.view),{priority:e.converterPriority||\"normal\"});t.on(\"removeMarker:\"+e.model,rh(e.view),{priority:e.converterPriority||\"normal\"})}}function gh(e){return t=>{t.on(\"addMarker:\"+e.model,ch(e.view),{priority:e.converterPriority||\"normal\"});t.on(\"addMarker:\"+e.model,lh(e.view),{priority:e.converterPriority||\"normal\"});t.on(\"removeMarker:\"+e.model,dh(e.view),{priority:e.converterPriority||\"normal\"})}}function ph(e,t){if(typeof e==\"function\"){return e}return(i,n)=>bh(e,n,t)}function bh(e,t,i){if(typeof e==\"string\"){e={name:e}}let n;const o=Object.assign({},e.attributes);if(i==\"container\"){n=t.createContainerElement(e.name,o)}else if(i==\"attribute\"){const i={priority:e.priority||Wa.DEFAULT_PRIORITY};n=t.createAttributeElement(e.name,o,i)}else{n=t.createUIElement(e.name,o)}if(e.styles){const i=Object.keys(e.styles);for(const o of i){t.setStyle(o,e.styles[o],n)}}if(e.classes){const i=e.classes;if(typeof i==\"string\"){t.addClass(i,n)}else{for(const e of i){t.addClass(e,n)}}}return n}function wh(e){if(e.model.values){return(t,i)=>{const n=e.view[t];if(n){return n(t,i)}return null}}else{return e.view}}function _h(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 vh(e,t,i){const n=typeof e==\"function\"?e(t,i):e;if(!n){return null}if(!n.priority){n.priority=10}if(!n.id){n.id=t.markerName}return n}class kh extends $u{elementToElement(e){return this.add(Ch(e))}elementToAttribute(e){return this.add(Th(e))}attributeToAttribute(e){return this.add(Mh(e))}elementToMarker(e){return this.add(Ph(e))}}function yh(){return(e,t,i)=>{if(!t.modelRange&&i.consumable.consume(t.viewItem,{name:true})){const{modelRange:e,modelCursor:n}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e;t.modelCursor=n}}}function xh(){return(e,t,i)=>{if(i.schema.checkChild(t.modelCursor,\"$text\")){if(i.consumable.consume(t.viewItem)){const e=i.writer.createText(t.viewItem.data);i.writer.insert(e,t.modelCursor);t.modelRange=Au._createFromPositionAndShift(t.modelCursor,e.offsetSize);t.modelCursor=t.modelRange.end}}}}function Ah(e,t){return(i,n)=>{const o=n.newSelection;const s=new Su;const r=[];for(const e of o.getRanges()){r.push(t.toModelRange(e))}s.setTo(r,{backward:o.isBackward});if(!s.isEqual(e.document.selection)){e.change(e=>{e.setSelection(s)})}}}function Ch(e){e=Ju(e);const t=Sh(e);const i=Eh(e.view);const n=i?\"element:\"+i:\"element\";return i=>{i.on(n,t,{priority:e.converterPriority||\"normal\"})}}function Th(e){e=Ju(e);Nh(e);const t=Lh(e,false);const i=Eh(e.view);const n=i?\"element:\"+i:\"element\";return i=>{i.on(n,t,{priority:e.converterPriority||\"low\"})}}function Mh(e){e=Ju(e);let t=null;if(typeof e.view==\"string\"||e.view.key){t=Oh(e)}Nh(e,t);const i=Lh(e,true);return t=>{t.on(\"element\",i,{priority:e.converterPriority||\"low\"})}}function Ph(e){e=Ju(e);jh(e);return Ch(e)}function Eh(e){if(typeof e==\"string\"){return e}if(typeof e==\"object\"&&typeof e.name==\"string\"){return e.name}return null}function Sh(e){const t=e.view?new Sr(e.view):null;return(i,n,o)=>{let s={};if(t){const e=t.match(n.viewItem);if(!e){return}s=e.match}s.name=true;const r=Ih(e.model,n.viewItem,o.writer);if(!r){return}if(!o.consumable.test(n.viewItem,s)){return}const a=o.splitToAllowedParent(r,n.modelCursor);if(!a){return}o.writer.insert(r,a.position);o.convertChildren(n.viewItem,o.writer.createPositionAt(r,0));o.consumable.consume(n.viewItem,s);const c=o.getSplitParts(r);n.modelRange=new Au(o.writer.createPositionBefore(r),o.writer.createPositionAfter(c[c.length-1]));if(a.cursorParent){n.modelCursor=o.writer.createPositionAt(a.cursorParent,0)}else{n.modelCursor=n.modelRange.end}}}function Ih(e,t,i){if(e instanceof Function){return e(t,i)}else{return i.createElement(e)}}function Oh(e){if(typeof e.view==\"string\"){e.view={key:e.view}}const t=e.view.key;let i;if(t==\"class\"||t==\"style\"){const n=t==\"class\"?\"classes\":\"styles\";i={[n]:e.view.value}}else{const n=typeof e.view.value==\"undefined\"?/[\\s\\S]*/:e.view.value;i={attributes:{[t]:n}}}if(e.view.name){i.name=e.view.name}e.view=i;return t}function Nh(e,t=null){const i=t===null?true:e=>e.getAttribute(t);const n=typeof e.model!=\"object\"?e.model:e.model.key;const o=typeof e.model!=\"object\"||typeof e.model.value==\"undefined\"?i:e.model.value;e.model={key:n,value:o}}function Lh(e,t){const i=new Sr(e.view);return(n,o,s)=>{const r=i.match(o.viewItem);if(!r){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(Rh(e.view,o.viewItem)){r.match.name=true}else{delete r.match.name}if(!s.consumable.test(o.viewItem,r.match)){return}if(!o.modelRange){o=Object.assign(o,s.convertChildren(o.viewItem,o.modelCursor))}const l=zh(o.modelRange,{key:a,value:c},t,s);if(l){s.consumable.consume(o.viewItem,r.match)}}}function Rh(e,t){const i=typeof e==\"function\"?e(t):e;if(typeof i==\"object\"&&!Eh(i)){return false}return!i.classes&&!i.attributes&&!i.styles}function zh(e,t,i,n){let o=false;for(const s of Array.from(e.getItems({shallow:i}))){if(n.schema.checkAttribute(s,t.key)){n.writer.setAttribute(t.key,t.value,s);o=true}}return o}function jh(e){const t=e.model;e.model=(e,i)=>{const n=typeof t==\"string\"?t:t(e);return i.createElement(\"$marker\",{\"data-name\":n})}}class Dh{constructor(e){this.model=e;this.view=new uu;this.mapper=new Cu;this.downcastDispatcher=new Pu({mapper:this.mapper});const t=this.model.document;const i=t.selection;const n=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(t,\"change\",()=>{this.view.change(e=>{this.downcastDispatcher.convertChanges(t.differ,n,e);this.downcastDispatcher.convertSelection(i,n,e)})},{priority:\"low\"});this.listenTo(this.view.document,\"selectionChange\",Ah(this.model,this.mapper));this.downcastDispatcher.on(\"insert:$text\",Xu(),{priority:\"lowest\"});this.downcastDispatcher.on(\"remove\",Qu(),{priority:\"low\"});this.downcastDispatcher.on(\"selection\",ih(),{priority:\"low\"});this.downcastDispatcher.on(\"selection\",eh(),{priority:\"low\"});this.downcastDispatcher.on(\"selection\",th(),{priority:\"low\"});this.view.document.roots.bindTo(this.model.document.roots).using(e=>{if(e.rootName==\"$graveyard\"){return null}const t=new Na(e.name);t.rootName=e.rootName;t._document=this.view.document;this.mapper.bindElements(e,t);return t})}destroy(){this.view.destroy();this.stopListening()}}vr(Dh,_a);class Bh{constructor(e,t=[]){this._editor=e;this._availablePlugins=new Map;this._plugins=new Map;for(const e of t){this._availablePlugins.set(e,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 i=e;if(typeof e==\"function\"){i=e.pluginName||e.name}throw new Qs[\"b\"](t,this._editor,{plugin:i})}return t}has(e){return this._plugins.has(e)}init(e,t=[]){const i=this;const n=this._editor;const o=new Set;const s=[];const r=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(Qs[\"a\"])(e),{plugins:c});return Promise.reject(new Qs[\"b\"](e,this._editor,{plugins:c}))}return Promise.all(r.map(l)).then(()=>d(s,\"init\")).then(()=>d(s,\"afterInit\")).then(()=>s);function l(e){if(a.includes(e)){return}if(i._plugins.has(e)||o.has(e)){return}return u(e).catch(t=>{console.error(Object(Qs[\"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}return e.then(i[t].bind(i))},Promise.resolve())}function u(e){return new Promise(r=>{o.add(e);if(e.requires){e.requires.forEach(i=>{const o=h(i);if(t.includes(o)){throw new Qs[\"b\"](\"plugincollection-required: Cannot load a plugin because one of its dependencies is listed in\"+\"the `removePlugins` option.\",n,{plugin:o,requiredBy:e})}l(o)})}const a=new e(n);i._add(e,a);s.push(a);r()})}function h(e){if(typeof e==\"function\"){return e}return i._availablePlugins.get(e)}function f(e){const t=[];for(const i of e){if(!h(i)){t.push(i)}}return t.length?t:null}function m(e){return e.map(e=>h(e)).filter(e=>!!e)}}destroy(){const e=Array.from(this).map(([,e])=>e).filter(e=>typeof e.destroy==\"function\").map(e=>e.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const i=e.pluginName;if(!i){return}if(this._plugins.has(i)){throw new Qs[\"b\"](\"plugincollection-plugin-name-conflict: Two plugins with the same name were loaded.\",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:e})}this._plugins.set(i,t)}}vr(Bh,lr);class Vh{constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const i=this.get(e);if(!i){throw new Qs[\"b\"](\"commandcollection-command-not-found: Command does not exist.\",this,{commandName:e})}i.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands()){e.destroy()}}}if(!window.CKEDITOR_TRANSLATIONS){window.CKEDITOR_TRANSLATIONS={}}function Fh(e,t){const i=window.CKEDITOR_TRANSLATIONS[e]||(window.CKEDITOR_TRANSLATIONS[e]={});Object.assign(i,t)}function Hh(e,t){const i=$h();if(i===1){e=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]}if(i===0||!Wh(e,t)){return t.replace(/ \\[context: [^\\]]+\\]$/,\"\")}const n=window.CKEDITOR_TRANSLATIONS[e];return n[t].replace(/ \\[context: [^\\]]+\\]$/,\"\")}function Uh(){window.CKEDITOR_TRANSLATIONS={}}function Wh(e,t){return e in window.CKEDITOR_TRANSLATIONS&&t in window.CKEDITOR_TRANSLATIONS[e]}function $h(){return Object.keys(window.CKEDITOR_TRANSLATIONS).length}const qh=[\"ar\",\"fa\",\"he\",\"ku\",\"ug\"];class Yh{constructor(e={}){this.uiLanguage=e.uiLanguage||\"en\";this.contentLanguage=e.contentLanguage||this.uiLanguage;this.uiLanguageDirection=Gh(this.uiLanguage);this.contentLanguageDirection=Gh(this.contentLanguage);this.t=(...e)=>this._t(...e)}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){let i=Hh(this.uiLanguage,e);if(t){i=i.replace(/%(\\d+)/g,(e,i)=>i{t[0]=new Qh(t[0])},{priority:\"highest\"});this.on(\"checkChild\",(e,t)=>{t[0]=new Qh(t[0]);t[1]=this.getDefinition(t[1])},{priority:\"highest\"})}register(e,t){if(this._sourceDefinitions[e]){throw new Qs[\"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 Qs[\"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 i=this.getDefinition(e.last);if(!i){return false}return i.allowAttributes.includes(t)}checkMerge(e,t=null){if(e instanceof xu){const t=e.nodeBefore;const i=e.nodeAfter;if(!(t instanceof bu)){throw new Qs[\"b\"](\"schema-check-merge-no-element-before: The node before the merge position must be an element.\",this)}if(!(i instanceof bu)){throw new Qs[\"b\"](\"schema-check-merge-no-element-after: The node after the merge position must be an element.\",this)}return this.checkMerge(t,i)}for(const i of t.getChildren()){if(!this.checkChild(e,i)){return false}}return true}addChildCheck(e){this.on(\"checkChild\",(t,[i,n])=>{if(!n){return}const o=e(i,n);if(typeof o==\"boolean\"){t.stop();t.return=o}},{priority:\"high\"})}addAttributeCheck(e){this.on(\"checkAttribute\",(t,[i,n])=>{const o=e(i,n);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 xu){t=e.parent}else{const i=e instanceof Au?[e]:Array.from(e.getRanges());t=i.reduce((e,t)=>{const i=t.getCommonAncestor();if(!e){return i}return e.getCommonAncestor(i,{includeSelf:true})},null)}while(!this.isLimit(t)){if(t.parent){t=t.parent}else{break}}return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const i=e.getFirstPosition();const n=[...i.getAncestors(),new mu(\"\",e.getAttributes())];return this.checkAttribute(n,t)}else{const i=e.getRanges();for(const e of i){for(const i of e){if(this.checkAttribute(i.item,t)){return true}}}}return false}*getValidRanges(e,t){e=mf(e);for(const i of e){yield*this._getValidRangesForRange(i,t)}}getNearestSelectionRange(e,t=\"both\"){if(this.checkChild(e,\"$text\")){return new Au(e)}let i,n;if(t==\"both\"||t==\"backward\"){i=new _u({startPosition:e,direction:\"backward\"})}if(t==\"both\"||t==\"forward\"){n=new _u({startPosition:e})}for(const e of ff(i,n)){const t=e.walker==i?\"elementEnd\":\"elementStart\";const n=e.value;if(n.type==t&&this.isObject(n.item)){return Au._createOn(n.item)}if(this.checkChild(n.nextPosition,\"$text\")){return new Au(n.nextPosition)}}return null}findAllowedParent(e,t){let i=e.parent;while(i){if(this.checkChild(i,t)){return i}if(this.isLimit(i)){return null}i=i.parent}return null}removeDisallowedAttributes(e,t){for(const i of e){if(i.is(\"text\")){gf(this,i,t)}else{const e=Au._createIn(i);const n=e.getPositions();for(const e of n){const i=e.nodeBefore||e.parent;gf(this,i,t)}}}}createContext(e){return new Qh(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={};const t=this._sourceDefinitions;const i=Object.keys(t);for(const n of i){e[n]=Zh(t[n],n)}for(const t of i){ef(e,t)}for(const t of i){tf(e,t)}for(const t of i){nf(e,t);of(e,t)}for(const t of i){sf(e,t);rf(e,t)}this._compiledDefinitions=e}_checkContextMatch(e,t,i=t.length-1){const n=t.getItem(i);if(e.allowIn.includes(n.name)){if(i==0){return true}else{const e=this.getDefinition(n);return this._checkContextMatch(e,t,i-1)}}else{return false}}*_getValidRangesForRange(e,t){let i=e.start;let n=e.start;for(const o of e.getItems({shallow:true})){if(o.is(\"element\")){yield*this._getValidRangesForRange(Au._createIn(o),t)}if(!this.checkAttribute(o,t)){if(!i.isEqual(n)){yield new Au(i,n)}i=xu._createAfter(o)}n=xu._createAfter(o)}if(!i.isEqual(n)){yield new Au(i,n)}}}vr(Xh,_a);class Qh{constructor(e){if(e instanceof Qh){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(hf)}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 Qh([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)}}function Zh(e,t){const i={name:t,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};af(e,i);cf(e,i,\"allowIn\");cf(e,i,\"allowContentOf\");cf(e,i,\"allowWhere\");cf(e,i,\"allowAttributes\");cf(e,i,\"allowAttributesOf\");cf(e,i,\"inheritTypesFrom\");lf(e,i);return i}function ef(e,t){for(const i of e[t].allowContentOf){if(e[i]){const n=df(e,i);n.forEach(e=>{e.allowIn.push(t)})}}delete e[t].allowContentOf}function tf(e,t){for(const i of e[t].allowWhere){const n=e[i];if(n){const i=n.allowIn;e[t].allowIn.push(...i)}}delete e[t].allowWhere}function nf(e,t){for(const i of e[t].allowAttributesOf){const n=e[i];if(n){const i=n.allowAttributes;e[t].allowAttributes.push(...i)}}delete e[t].allowAttributesOf}function of(e,t){const i=e[t];for(const t of i.inheritTypesFrom){const n=e[t];if(n){const e=Object.keys(n).filter(e=>e.startsWith(\"is\"));for(const t of e){if(!(t in i)){i[t]=n[t]}}}}delete i.inheritTypesFrom}function sf(e,t){const i=e[t];const n=i.allowIn.filter(t=>e[t]);i.allowIn=Array.from(new Set(n))}function rf(e,t){const i=e[t];i.allowAttributes=Array.from(new Set(i.allowAttributes))}function af(e,t){for(const i of e){const e=Object.keys(i).filter(e=>e.startsWith(\"is\"));for(const n of e){t[n]=i[n]}}}function cf(e,t,i){for(const n of e){if(typeof n[i]==\"string\"){t[i].push(n[i])}else if(Array.isArray(n[i])){t[i].push(...n[i])}}}function lf(e,t){for(const i of e){const e=i.inheritAllFrom;if(e){t.allowContentOf.push(e);t.allowWhere.push(e);t.allowAttributesOf.push(e);t.inheritTypesFrom.push(e)}}}function df(e,t){const i=e[t];return uf(e).filter(e=>e.allowIn.includes(i.name))}function uf(e){return Object.keys(e).map(t=>e[t])}function hf(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*ff(e,t){let i=false;while(!i){i=true;if(e){const t=e.next();if(!t.done){i=false;yield{walker:e,value:t.value}}}if(t){const e=t.next();if(!e.done){i=false;yield{walker:t,value:e.value}}}}}function*mf(e){for(const t of e){yield*t.getMinimalFlatRanges()}}function gf(e,t,i){for(const n of t.getAttributeKeys()){if(!e.checkAttribute(t,n)){i.removeAttribute(n,t)}}}class pf{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,i=[\"$root\"]){this.fire(\"viewCleanup\",e);this._modelCursor=wf(i,t);this.conversionApi.writer=t;this.conversionApi.consumable=Jh.createFrom(e);this.conversionApi.store={};const{modelRange:n}=this._convertItem(e,this._modelCursor);const o=t.createDocumentFragment();if(n){this._removeEmptyElements();for(const e of Array.from(this._modelCursor.parent.getChildren())){t.append(e,o)}o.markers=bf(o,t)}this._modelCursor=null;this._splitParts.clear();this.conversionApi.writer=null;this.conversionApi.store=null;return o}_convertItem(e,t){const i=Object.assign({viewItem:e,modelCursor:t,modelRange:null});if(e.is(\"element\")){this.fire(\"element:\"+e.name,i,this.conversionApi)}else if(e.is(\"text\")){this.fire(\"text\",i,this.conversionApi)}else{this.fire(\"documentFragment\",i,this.conversionApi)}if(i.modelRange&&!(i.modelRange instanceof Au)){throw new Qs[\"b\"](\"view-conversion-dispatcher-incorrect-result: Incorrect conversion result was dropped.\",this)}return{modelRange:i.modelRange,modelCursor:i.modelCursor}}_convertChildren(e,t){const i=new Au(t);let n=t;for(const t of Array.from(e.getChildren())){const e=this._convertItem(t,n);if(e.modelRange instanceof Au){i.end=e.modelRange.end;n=e.modelCursor}}return{modelRange:i,modelCursor:n}}_splitToAllowedParent(e,t){const i=this.conversionApi.schema.findAllowedParent(t,e);if(!i){return null}if(i===t.parent){return{position:t}}if(this._modelCursor.parent.getAncestors().includes(i)){return null}const n=this.conversionApi.writer.split(t,i);const o=[];for(const e of n.range.getWalker()){if(e.type==\"elementEnd\"){o.push(e.item)}else{const t=o.pop();const i=e.item;this._registerSplitPair(t,i)}}return{position:n.position,cursorParent:n.range.end.parent}}_registerSplitPair(e,t){if(!this._splitParts.has(e)){this._splitParts.set(e,[e])}const i=this._splitParts.get(e);this._splitParts.set(t,i);i.push(t)}_getSplitParts(e){let t;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()}}}vr(pf,lr);function bf(e,t){const i=new Set;const n=new Map;const o=Au._createIn(e).getItems();for(const e of o){if(e.name==\"$marker\"){i.add(e)}}for(const e of i){const i=e.getAttribute(\"data-name\");const o=t.createPositionBefore(e);if(!n.has(i)){n.set(i,new Au(o.clone()))}else{n.get(i).end=o.clone()}t.remove(e)}return n}function wf(e,t){let i;for(const n of new Qh(e)){const e={};for(const t of n.getAttributeKeys()){e[t]=n.getAttribute(t)}const o=t.createElement(n.name,e);if(i){t.append(o,i)}i=xu._createAt(o,0)}return i}class _f{constructor(e,t){this.model=e;this.processor=t;this.mapper=new Cu;this.downcastDispatcher=new Pu({mapper:this.mapper});this.downcastDispatcher.on(\"insert:$text\",Xu(),{priority:\"lowest\"});this.upcastDispatcher=new pf({schema:e.schema});this.upcastDispatcher.on(\"text\",xh(),{priority:\"lowest\"});this.upcastDispatcher.on(\"element\",yh(),{priority:\"lowest\"});this.upcastDispatcher.on(\"documentFragment\",yh(),{priority:\"lowest\"});this.decorate(\"init\");this.on(\"init\",()=>{this.fire(\"ready\")},{priority:\"lowest\"})}get(e){const{rootName:t=\"main\",trim:i=\"empty\"}=e||{};if(!this._checkIfRootsExists([t])){throw new Qs[\"b\"](\"datacontroller-get-non-existent-root: Attempting to get data from a non-existing root.\",this)}const n=this.model.document.getRoot(t);if(i===\"empty\"&&!this.model.hasContent(n,{ignoreWhitespaces:true})){return\"\"}return this.stringify(n)}stringify(e){const t=this.toView(e);return this.processor.toData(t)}toView(e){this.mapper.clearBindings();const t=Au._createIn(e);const i=new pc;const n=new wc(new Ha);this.mapper.bindElements(e,i);this.downcastDispatcher.convertInsert(t,n);if(!e.is(\"documentFragment\")){const t=vf(e);for(const[e,i]of t){this.downcastDispatcher.convertMarkerAdd(e,i,n)}}return i}init(e){if(this.model.document.version){throw new Qs[\"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 Qs[\"b\"](\"datacontroller-init-non-existent-root: Attempting to init data on a non-existing root.\",this)}this.model.enqueueChange(\"transparent\",e=>{for(const i of Object.keys(t)){const n=this.model.document.getRoot(i);e.insert(this.parse(t[i],n),n,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 Qs[\"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 i of Object.keys(t)){const n=this.model.document.getRoot(i);e.remove(e.createRangeIn(n));e.insert(this.parse(t[i],n),n,0)}})}parse(e,t=\"$root\"){const i=this.processor.toView(e);return this.toModel(i,t)}toModel(e,t=\"$root\"){return this.model.change(i=>this.upcastDispatcher.convert(e,i,t))}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e){if(!this.model.document.getRootNames().includes(t)){return false}}return true}}vr(_f,_a);function vf(e){const t=[];const i=e.root.document;if(!i){return[]}const n=Au._createIn(e);for(const e of i.model.markers){const i=n.getIntersection(e.getRange());if(i){t.push([e.name,i])}}return t}class kf{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 i=this._downcast.includes(t);const n=this._upcast.includes(t);if(!n&&!i){throw new Qs[\"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:i})}for(e){if(!this._helpers.has(e)){throw new Qs[\"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:i}of yf(e)){this.for(\"upcast\").elementToElement({model:t,view:i,converterPriority:e.converterPriority})}}attributeToElement(e){this.for(\"downcast\").attributeToElement(e);for(const{model:t,view:i}of yf(e)){this.for(\"upcast\").elementToAttribute({view:i,model:t,converterPriority:e.converterPriority})}}attributeToAttribute(e){this.for(\"downcast\").attributeToAttribute(e);for(const{model:t,view:i}of yf(e)){this.for(\"upcast\").attributeToAttribute({view:i,model:t})}}_createConversionHelpers({name:e,dispatchers:t,isDowncast:i}){if(this._helpers.has(e)){throw new Qs[\"b\"](\"conversion-group-exists: Trying to register a group name that has already been registered.\",this)}const n=i?new Ku(t):new kh(t);this._helpers.set(e,n)}}function*yf(e){if(e.model.values){for(const t of e.model.values){const i={key:e.model.key,value:t};const n=e.view[t];const o=e.upcastAlso?e.upcastAlso[t]:undefined;yield*xf(i,n,o)}}else{yield*xf(e.model,e.view,e.upcastAlso)}}function*xf(e,t,i){yield{model:e,view:t};if(i){i=Array.isArray(i)?i:[i];for(const t of i){yield{model:e,view:t}}}}class Af{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 Cf{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 Tf{constructor(e){this.markers=new Map;this._children=new pu;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 i of e){t=t.getChild(t.offsetToIndex(i))}return t}offsetToIndex(e){return this._children.offsetToIndex(e)}toJSON(){const e=[];for(const t of this._children){e.push(t.toJSON())}return e}static fromJSON(e){const t=[];for(const i of e){if(i.name){t.push(bu.fromJSON(i))}else{t.push(mu.fromJSON(i))}}return new Tf(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const i=Mf(t);for(const e of i){if(e.parent!==null){e._remove()}e.parent=this}this._children._insertNodes(e,i)}_removeChildren(e,t=1){const i=this._children._removeNodes(e,t);for(const e of i){e.parent=null}return i}}function Mf(e){if(typeof e==\"string\"){return[new mu(e)]}if(!Er(e)){e=[e]}return Array.from(e).map(e=>{if(typeof e==\"string\"){return new mu(e)}if(e instanceof gu){return new mu(e.data,e.getAttributes())}return e})}function Pf(e,t){t=Of(t);const i=t.reduce((e,t)=>e+t.offsetSize,0);const n=e.parent;Lf(e);const o=e.index;n._insertChild(o,t);Nf(n,o+t.length);Nf(n,o);return new Au(e,e.getShiftedBy(i))}function Ef(e){if(!e.isFlat){throw new Qs[\"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;Lf(e.start);Lf(e.end);const i=t._removeChildren(e.start.index,e.end.index-e.start.index);Nf(t,e.start.index);return i}function Sf(e,t){if(!e.isFlat){throw new Qs[\"b\"](\"operation-utils-move-range-not-flat: \"+\"Trying to move a range which starts and ends in different element.\",this)}const i=Ef(e);t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset);return Pf(t,i)}function If(e,t,i){Lf(e.start);Lf(e.end);for(const n of e.getItems({shallow:true})){const e=n.is(\"textProxy\")?n.textNode:n;if(i!==null){e._setAttribute(t,i)}else{e._removeAttribute(t)}Nf(e.parent,e.index)}Nf(e.end.parent,e.end.index)}function Of(e){const t=[];if(!(e instanceof Array)){e=[e]}for(let i=0;ie.maxOffset){throw new Qs[\"b\"](\"move-operation-nodes-do-not-exist: The nodes which should be moved do not exist.\",this)}else if(e===t&&i=i&&this.targetPosition.path[e]e._clone(true)));const t=new Ff(this.position,e,this.baseVersion);t.shouldReceiveAttributes=this.shouldReceiveAttributes;return t}getReversed(){const e=this.position.root.document.graveyard;const t=new xu(e,[0]);return new Vf(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffsete._clone(true)));Pf(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 i=[];for(const t of e.nodes){if(t.name){i.push(bu.fromJSON(t))}else{i.push(mu.fromJSON(t))}}const n=new Ff(xu.fromJSON(e.position,t),i,e.baseVersion);n.shouldReceiveAttributes=e.shouldReceiveAttributes;return n}}class Hf extends Cf{constructor(e,t,i,n,o,s){super(s);this.name=e;this.oldRange=t?t.clone():null;this.newRange=i?i.clone():null;this.affectsData=o;this._markers=n}get type(){return\"marker\"}clone(){return new Hf(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new Hf(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 Hf(e.name,e.oldRange?Au.fromJSON(e.oldRange,t):null,e.newRange?Au.fromJSON(e.newRange,t):null,t.model.markers,e.affectsData,e.baseVersion)}}class Uf extends Cf{constructor(e,t,i,n){super(n);this.position=e;this.position.stickiness=\"toNext\";this.oldName=t;this.newName=i}get type(){return\"rename\"}clone(){return new Uf(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new Uf(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(!(e instanceof bu)){throw new Qs[\"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 Qs[\"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 Uf(xu.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class Wf extends Cf{constructor(e,t,i,n,o){super(o);this.root=e;this.key=t;this.oldValue=i;this.newValue=n}get type(){if(this.oldValue===null){return\"addRootAttribute\"}else if(this.newValue===null){return\"removeRootAttribute\"}else{return\"changeRootAttribute\"}}clone(){return new Wf(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Wf(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is(\"documentFragment\")){throw new Qs[\"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 Qs[\"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 Qs[\"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 Qs[\"b\"](\"rootattribute-operation-fromjson-no-root: Cannot create RootAttributeOperation. Root with specified name does not exist.\",this,{rootName:e.root})}return new Wf(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}class $f extends Cf{constructor(e,t,i,n,o){super(o);this.sourcePosition=e.clone();this.sourcePosition.stickiness=\"toPrevious\";this.howMany=t;this.targetPosition=i.clone();this.targetPosition.stickiness=\"toNext\";this.graveyardPosition=n.clone()}get type(){return\"merge\"}get deletionPosition(){return new xu(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const e=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Au(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 i=new xu(this.sourcePosition.root,t)._getTransformedByMergeOperation(this);const n=new qf(e,this.howMany,this.graveyardPosition,this.baseVersion+1);n.insertionPosition=i;return n}_validate(){const e=this.sourcePosition.parent;const t=this.targetPosition.parent;if(!e.parent){throw new Qs[\"b\"](\"merge-operation-source-position-invalid: Merge source position is invalid.\",this)}else if(!t.parent){throw new Qs[\"b\"](\"merge-operation-target-position-invalid: Merge target position is invalid.\",this)}else if(this.howMany!=e.maxOffset){throw new Qs[\"b\"](\"merge-operation-how-many-invalid: Merge operation specifies wrong number of nodes to move.\",this)}}_execute(){const e=this.sourcePosition.parent;const t=Au._createIn(e);Sf(t,this.targetPosition);Sf(Au._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 i=xu.fromJSON(e.sourcePosition,t);const n=xu.fromJSON(e.targetPosition,t);const o=xu.fromJSON(e.graveyardPosition,t);return new this(i,e.howMany,n,o,e.baseVersion)}}class qf extends Cf{constructor(e,t,i,n){super(n);this.splitPosition=e.clone();this.splitPosition.stickiness=\"toNext\";this.howMany=t;this.insertionPosition=qf.getInsertionPosition(e);this.insertionPosition.stickiness=\"toNone\";this.graveyardPosition=i?i.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 xu(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Au(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 xu(e,[0]);return new $f(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 Au)){t(e)}else{for(const i of e.getItems()){t(i)}}}move(e,t,i){this._assertWriterUsedCorrectly();if(!(e instanceof Au)){throw new Qs[\"b\"](\"writer-move-invalid-range: Invalid range to move.\",this)}if(!e.isFlat){throw new Qs[\"b\"](\"writer-move-range-not-flat: Range to move is not flat.\",this)}const n=xu._createAt(t,i);if(n.isEqual(e.start)){return}this._addOperationForAffectedMarkers(\"move\",e);if(!Zf(e.root,n.root)){throw new Qs[\"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 s=new Vf(e.start,e.end.offset-e.start.offset,n,o);this.batch.addOperation(s);this.model.applyOperation(s)}remove(e){this._assertWriterUsedCorrectly();const t=e instanceof Au?e:Au._createOn(e);const i=t.getMinimalFlatRanges().reverse();for(const e of i){this._addOperationForAffectedMarkers(\"move\",e);Qf(e.start,e.end.offset-e.start.offset,this.batch,this.model)}}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore;const i=e.nodeAfter;this._addOperationForAffectedMarkers(\"merge\",e);if(!(t instanceof bu)){throw new Qs[\"b\"](\"writer-merge-no-element-before: Node before merge position must be an element.\",this)}if(!(i instanceof bu)){throw new Qs[\"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,i){return this.model.createPositionFromPath(e,t,i)}createPositionAt(e,t){return this.model.createPositionAt(e,t)}createPositionAfter(e){return this.model.createPositionAfter(e)}createPositionBefore(e){return this.model.createPositionBefore(e)}createRange(e,t){return this.model.createRange(e,t)}createRangeIn(e){return this.model.createRangeIn(e)}createRangeOn(e){return this.model.createRangeOn(e)}createSelection(e,t,i){return this.model.createSelection(e,t,i)}_mergeDetached(e){const t=e.nodeBefore;const i=e.nodeAfter;this.move(Au._createIn(i),xu._createAt(t,\"end\"));this.remove(i)}_merge(e){const t=xu._createAt(e.nodeBefore,\"end\");const i=xu._createAt(e.nodeAfter,0);const n=e.root.document.graveyard;const o=new xu(n,[0]);const s=e.root.document.version;const r=new $f(i,e.nodeAfter.maxOffset,t,o,s);this.batch.addOperation(r);this.model.applyOperation(r)}rename(e,t){this._assertWriterUsedCorrectly();if(!(e instanceof bu)){throw new Qs[\"b\"](\"writer-rename-not-element-instance: Trying to rename an object which is not an instance of Element.\",this)}const i=e.root.document?e.root.document.version:null;const n=new Uf(xu._createBefore(e),e.name,t,i);this.batch.addOperation(n);this.model.applyOperation(n)}split(e,t){this._assertWriterUsedCorrectly();let i=e.parent;if(!i.parent){throw new Qs[\"b\"](\"writer-split-element-no-parent: Element with no parent can not be split.\",this)}if(!t){t=i.parent}if(!e.parent.getAncestors({includeSelf:true}).includes(t)){throw new Qs[\"b\"](\"writer-split-invalid-limit-element: Limit element is not a position ancestor.\",this)}let n,o;do{const t=i.root.document?i.root.document.version:null;const s=i.maxOffset-e.offset;const r=new qf(e,s,null,t);this.batch.addOperation(r);this.model.applyOperation(r);if(!n&&!o){n=i;o=e.parent.nextSibling}e=this.createPositionAfter(e.parent);i=e.parent}while(i!==t);return{position:e,range:new Au(xu._createAt(n,\"end\"),xu._createAt(o,0))}}wrap(e,t){this._assertWriterUsedCorrectly();if(!e.isFlat){throw new Qs[\"b\"](\"writer-wrap-range-not-flat: Range to wrap is not flat.\",this)}const i=t instanceof bu?t:new bu(t);if(i.childCount>0){throw new Qs[\"b\"](\"writer-wrap-element-not-empty: Element to wrap with is not empty.\",this)}if(i.parent!==null){throw new Qs[\"b\"](\"writer-wrap-element-attached: Element to wrap with is already attached to tree model.\",this)}this.insert(i,e.start);const n=new Au(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(n,xu._createAt(i,0))}unwrap(e){this._assertWriterUsedCorrectly();if(e.parent===null){throw new Qs[\"b\"](\"writer-unwrap-element-no-parent: Trying to unwrap an element which has no parent.\",this)}this.move(Au._createIn(e),this.createPositionAfter(e));this.remove(e)}addMarker(e,t){this._assertWriterUsedCorrectly();if(!t||typeof t.usingOperation!=\"boolean\"){throw new Qs[\"b\"](\"writer-addMarker-no-usingOperation: The options.usingOperation parameter is required when adding a new marker.\",this)}const i=t.usingOperation;const n=t.range;const o=t.affectsData===undefined?false:t.affectsData;if(this.model.markers.has(e)){throw new Qs[\"b\"](\"writer-addMarker-marker-exists: Marker with provided name already exists.\",this)}if(!n){throw new Qs[\"b\"](\"writer-addMarker-no-range: Range parameter is required when adding a new marker.\",this)}if(!i){return this.model.markers._set(e,n,i,o)}Xf(this,e,null,n,o);return this.model.markers.get(e)}updateMarker(e,t){this._assertWriterUsedCorrectly();const i=typeof e==\"string\"?e:e.name;const n=this.model.markers.get(i);if(!n){throw new Qs[\"b\"](\"writer-updateMarker-marker-not-exists: Marker with provided name does not exists.\",this)}if(!t){this.model.markers._refresh(n);return}const o=typeof t.usingOperation==\"boolean\";const s=typeof t.affectsData==\"boolean\";const r=s?t.affectsData:n.affectsData;if(!o&&!t.range&&!s){throw new Qs[\"b\"](\"writer-updateMarker-wrong-options: One of the options is required - provide range, usingOperations or affectsData.\",this)}const a=n.getRange();const c=t.range?t.range:a;if(o&&t.usingOperation!==n.managedUsingOperations){if(t.usingOperation){Xf(this,i,null,c,r)}else{Xf(this,i,a,null,r);this.model.markers._set(i,c,undefined,r)}return}if(n.managedUsingOperations){Xf(this,i,a,c,r)}else{this.model.markers._set(i,c,undefined,r)}}removeMarker(e){this._assertWriterUsedCorrectly();const t=typeof e==\"string\"?e:e.name;if(!this.model.markers.has(t)){throw new Qs[\"b\"](\"writer-removeMarker-no-marker: Trying to remove marker which does not exist.\",this)}const i=this.model.markers.get(t);if(!i.managedUsingOperations){this.model.markers._remove(t);return}const n=i.getRange();Xf(this,t,n,null,i.affectsData)}setSelection(e,t,i){this._assertWriterUsedCorrectly();this.model.document.selection._setTo(e,t,i)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly();this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){this._assertWriterUsedCorrectly();if(typeof e===\"string\"){this._setSelectionAttribute(e,t)}else{for(const[t,i]of hu(e)){this._setSelectionAttribute(t,i)}}}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 i=this.model.document.selection;if(i.isCollapsed&&i.anchor.parent.isEmpty){const n=Fu._getStoreAttributeKey(e);this.setAttribute(n,t,i.anchor.parent)}i._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const i=Fu._getStoreAttributeKey(e);this.removeAttribute(i,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this){throw new Qs[\"b\"](\"writer-incorrect-use: Trying to use a writer outside the change() block.\",this)}}_addOperationForAffectedMarkers(e,t){for(const i of this.model.markers){if(!i.managedUsingOperations){continue}const n=i.getRange();let o=false;if(e==\"move\"){o=t.containsPosition(n.start)||t.start.isEqual(n.start)||t.containsPosition(n.end)||t.end.isEqual(n.end)}else{const e=t.nodeBefore;const i=t.nodeAfter;const s=n.start.parent==e&&n.start.isAtEnd;const r=n.end.parent==i&&n.end.offset==0;const a=n.end.nodeAfter==i;const c=n.start.nodeAfter==i;o=s||r||a||c}if(o){this.updateMarker(i.name,{range:n})}}}}function Jf(e,t,i,n){const o=e.model;const s=o.document;let r=n.start;let a;let c;let l;for(const e of n.getWalker({shallow:true})){l=e.item.getAttribute(t);if(a&&c!=l){if(c!=i){d()}r=a}a=e.nextPosition;c=l}if(a instanceof xu&&a!=r&&c!=i){d()}function d(){const n=new Au(r,a);const l=n.root.document?s.version:null;const d=new Df(n,t,c,i,l);e.batch.addOperation(d);o.applyOperation(d)}}function Kf(e,t,i,n){const o=e.model;const s=o.document;const r=n.getAttribute(t);let a,c;if(r!=i){const l=n.root===n;if(l){const e=n.document?s.version:null;c=new Wf(n,t,r,i,e)}else{a=new Au(xu._createBefore(n),e.createPositionAfter(n));const o=a.root.document?s.version:null;c=new Df(a,t,r,i,o)}e.batch.addOperation(c);o.applyOperation(c)}}function Xf(e,t,i,n,o){const s=e.model;const r=s.document;const a=new Hf(t,i,n,s.markers,o,r.version);e.batch.addOperation(a);s.applyOperation(a)}function Qf(e,t,i,n){let o;if(e.root.document){const i=n.document;const s=new xu(i.graveyard,[0]);o=new Vf(e,t,s,i.version)}else{o=new Bf(e,t)}i.addOperation(o);n.applyOperation(o)}function Zf(e,t){if(e===t){return true}if(e instanceof Yf&&t instanceof Yf){return true}return false}class em{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=Au._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 i=this._isInInsertedElement(e.targetPosition.parent);if(!t){this._markRemove(e.sourcePosition.parent,e.sourcePosition.offset,e.howMany)}if(!i){this._markInsert(e.targetPosition.parent,e.getMovedRangeStart().offset,e.howMany)}break}case\"rename\":{if(this._isInInsertedElement(e.position.parent)){return}this._markRemove(e.position.parent,e.position.offset,1);this._markInsert(e.position.parent,e.position.offset,1);const t=Au._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 i=e.graveyardPosition.parent;this._markInsert(i,e.graveyardPosition.offset,1);const n=e.targetPosition.parent;if(!this._isInInsertedElement(n)){this._markInsert(n,e.targetPosition.offset,t.maxOffset)}break}}this._cachedChanges=null}bufferMarkerChange(e,t,i,n){const o=this._changedMarkers.get(e);if(!o){this._changedMarkers.set(e,{oldRange:t,newRange:i,affectsData:n})}else{o.newRange=i;o.affectsData=n;if(o.oldRange==null&&o.newRange==null){this._changedMarkers.delete(e)}}}getMarkersToRemove(){const e=[];for(const[t,i]of this._changedMarkers){if(i.oldRange!=null){e.push({name:t,range:i.oldRange})}}return e}getMarkersToAdd(){const e=[];for(const[t,i]of this._changedMarkers){if(i.newRange!=null){e.push({name:t,range:i.newRange})}}return e}getChangedMarkers(){return Array.from(this._changedMarkers).map(e=>({name:e[0],data:{oldRange:e[1].oldRange,newRange:e[1].newRange}}))}hasDataChanges(){for(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 i=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.rootNamei.offset){if(n>o){const e={type:\"attribute\",offset:o,howMany:n-o,count:this._changeCount++};this._handleChange(e,t);t.push(e)}e.nodesToHandle=i.offset-e.offset;e.howMany=e.nodesToHandle}else if(e.offset>=i.offset&&e.offseto){e.nodesToHandle=n-o;e.offset=o}else{e.nodesToHandle=0}}}if(i.type==\"remove\"){if(e.offseti.offset){const o={type:\"attribute\",offset:i.offset,howMany:n-i.offset,count:this._changeCount++};this._handleChange(o,t);t.push(o);e.nodesToHandle=i.offset-e.offset;e.howMany=e.nodesToHandle}}if(i.type==\"attribute\"){if(e.offset>=i.offset&&n<=o){e.nodesToHandle=0;e.howMany=0;e.offset=0}else if(e.offset<=i.offset&&n>=o){i.howMany=0}}}}e.howMany=e.nodesToHandle;delete e.nodesToHandle}_getInsertDiff(e,t,i){return{type:\"insert\",position:xu._createAt(e,t),name:i,length:1,changeCount:this._changeCount++}}_getRemoveDiff(e,t,i){return{type:\"remove\",position:xu._createAt(e,t),name:i,length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,i){const n=[];i=new Map(i);for(const[o,s]of t){const t=i.has(o)?i.get(o):null;if(t!==s){n.push({type:\"attribute\",position:e.start,range:e.clone(),length:1,attributeKey:o,attributeOldValue:s,attributeNewValue:t,changeCount:this._changeCount++})}i.delete(o)}for(const[t,o]of i){n.push({type:\"attribute\",position:e.start,range:e.clone(),length:1,attributeKey:t,attributeOldValue:null,attributeNewValue:o,changeCount:this._changeCount++})}return n}_isInInsertedElement(e){const t=e.parent;if(!t){return false}const i=this._changesInElement.get(t);const n=e.startOffset;if(i){for(const e of i){if(e.type==\"insert\"&&n>=e.offset&&nn){for(let t=0;t{const i=t[0];if(i.isDocumentOperation&&i.baseVersion!==this.version){throw new Qs[\"b\"](\"model-document-applyOperation-wrong-version: Only operations with matching versions can be applied.\",this,{operation:i})}},{priority:\"highest\"});this.listenTo(e,\"applyOperation\",(e,t)=>{const i=t[0];if(i.isDocumentOperation){this.differ.bufferOperation(i)}},{priority:\"high\"});this.listenTo(e,\"applyOperation\",(e,t)=>{const i=t[0];if(i.isDocumentOperation){this.version++;this.history.addOperation(i)}},{priority:\"low\"});this.listenTo(this.selection,\"change\",()=>{this._hasSelectionChangedFromTheLastChangeBlock=true});this.listenTo(e.markers,\"update\",(e,t,i,n)=>{this.differ.bufferMarkerChange(t.name,i,n,t.affectsData);if(i===null){t.on(\"change\",(e,i)=>{this.differ.bufferMarkerChange(t.name,i,t.getRange(),t.affectsData)})}})}get graveyard(){return this.getRoot(dm)}createRoot(e=\"$root\",t=\"main\"){if(this.roots.get(t)){throw new Qs[\"b\"](\"model-document-createRoot-name-exists: Root with specified name already exists.\",this,{name:t})}const i=new Yf(this,e,t);this.roots.add(i);return i}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!=dm)}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=Ar(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 i=t.schema;const n=t.createPositionFromPath(e,[0]);const o=i.getNearestSelectionRange(n);return o||t.createRange(n)}_validateSelectionRange(e){return hm(e.start)&&hm(e.end)}_callPostFixers(e){let t=false;do{for(const i of this._postFixers){this.selection.refresh();t=i(e);if(t){break}}}while(t)}}vr(um,lr);function hm(e){const t=e.textNode;if(t){const i=t.data;const n=e.offset-t.startOffset;return!cm(i,n)&&!lm(i,n)}return true}class fm{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(e){return this._markers.has(e)}get(e){return this._markers.get(e)||null}_set(e,t,i=false,n=false){const o=e instanceof mm?e.name:e;const s=this._markers.get(o);if(s){const e=s.getRange();let r=false;if(!e.isEqual(t)){s._attachLiveRange(zu.fromRange(t));r=true}if(i!=s.managedUsingOperations){s._managedUsingOperations=i;r=true}if(typeof n===\"boolean\"&&n!=s.affectsData){s._affectsData=n;r=true}if(r){this.fire(\"update:\"+o,s,e,t)}return s}const r=zu.fromRange(t);const a=new mm(o,r,i,n);this._markers.set(o,a);this.fire(\"update:\"+o,a,null,t);return a}_remove(e){const t=e instanceof mm?e.name:e;const i=this._markers.get(t);if(i){this._markers.delete(t);this.fire(\"update:\"+t,i,i.getRange(),null);this._destroyMarker(i);return true}return false}_refresh(e){const t=e instanceof mm?e.name:e;const i=this._markers.get(t);if(!i){throw new Qs[\"b\"](\"markercollection-refresh-marker-not-exists: Marker with provided name does not exists.\",this)}const n=i.getRange();this.fire(\"update:\"+t,i,n,n,i.managedUsingOperations,i.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()}}vr(fm,lr);class mm{constructor(e,t,i,n){this.name=e;this._liveRange=this._attachLiveRange(t);this._managedUsingOperations=i;this._affectsData=n}get managedUsingOperations(){if(!this._liveRange){throw new Qs[\"b\"](\"marker-destroyed: Cannot use a destroyed marker instance.\",this)}return this._managedUsingOperations}get affectsData(){if(!this._liveRange){throw new Qs[\"b\"](\"marker-destroyed: Cannot use a destroyed marker instance.\",this)}return this._affectsData}getStart(){if(!this._liveRange){throw new Qs[\"b\"](\"marker-destroyed: Cannot use a destroyed marker instance.\",this)}return this._liveRange.start.clone()}getEnd(){if(!this._liveRange){throw new Qs[\"b\"](\"marker-destroyed: Cannot use a destroyed marker instance.\",this)}return this._liveRange.end.clone()}getRange(){if(!this._liveRange){throw new Qs[\"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}}vr(mm,lr);class gm extends xu{constructor(e,t,i=\"toNone\"){super(e,t,i);if(!this.root.is(\"rootElement\")){throw new Qs[\"b\"](\"model-liveposition-root-not-rootelement: LivePosition's root has to be an instance of RootElement.\",e)}pm.call(this)}detach(){this.stopListening()}is(e){return e==\"livePosition\"||e==\"model:livePosition\"||super.is(e)}toPosition(){return new xu(this.root,this.path.slice(),this.stickiness)}static fromPosition(e,t){return new this(e.root,e.path.slice(),t?t:e.stickiness)}}function pm(){this.listenTo(this.root.document.model,\"applyOperation\",(e,t)=>{const i=t[0];if(!i.isDocumentOperation){return}bm.call(this,i)},{priority:\"low\"})}function bm(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)}}vr(gm,lr);function wm(e,t,i,n){return e.change(o=>{let s;if(!i){s=e.document.selection}else if(i instanceof Su||i instanceof Fu){s=i}else{s=o.createSelection(i,n)}const r=s.getFirstPosition();if(!s.isCollapsed){e.deleteContent(s,{doNotAutoparagraph:true})}const a=new _m(e,o,r);let c;if(t.is(\"documentFragment\")){c=t.getChildren()}else{c=[t]}a.handleNodes(c,{isFirst:true,isLast:true});const l=a.getSelectionRange();if(l){if(s instanceof Fu){o.setSelection(l)}else{s.setTo(l)}}else{}const d=a.getAffectedRange()||e.createRange(r);a.destroy();return d})}class _m{constructor(e,t,i){this.model=e;this.writer=t;this.position=i;this.canMergeWith=new Set([this.position.parent]);this.schema=e.schema;this._filterAttributesOf=[];this._affectedStart=null;this._affectedEnd=null}handleNodes(e,t){e=Array.from(e);for(let i=0;i{if(!i.doNotResetEntireContent&&Tm(o,t)){Cm(e,t,o);return}const s=n.start;const r=gm.fromPosition(n.end,\"toNext\");if(!n.start.isTouching(n.end)){e.remove(n)}if(!i.leaveUnmerged){km(e,s,r);o.removeDisallowedAttributes(s.parent.getChildren(),e)}Mm(e,t,s);if(ym(o,s)){const n=o.getNearestSelectionRange(s);if(i.doNotAutoparagraph&&n){Mm(e,t,n)}else{Am(e,s,t)}}r.detach()})}function km(e,t,i){const n=t.parent;const o=i.parent;if(n==o){return}if(e.model.schema.isLimit(n)||e.model.schema.isLimit(o)){return}if(!xm(t,i,e.model.schema)){return}t=e.createPositionAfter(n);i=e.createPositionBefore(o);if(!i.isEqual(t)){e.insert(o,t)}e.merge(t);while(i.parent.isEmpty){const t=i.parent;i=e.createPositionBefore(t);e.remove(t)}km(e,t,i)}function ym(e,t){const i=e.checkChild(t,\"$text\");const n=e.checkChild(t,\"paragraph\");return!i&&n}function xm(e,t,i){const n=new Au(e,t);for(const e of n.getWalker()){if(i.isLimit(e.item)){return false}}return true}function Am(e,t,i){const n=e.createElement(\"paragraph\");e.insert(n,t);Mm(e,i,e.createPositionAt(n,0))}function Cm(e,t){const i=e.model.schema.getLimitElement(t);e.remove(e.createRangeIn(i));Am(e,e.createPositionAt(i,0),t)}function Tm(e,t){const i=e.getLimitElement(t);if(!t.containsEntireContent(i)){return false}const n=t.getFirstRange();if(n.start.parent==n.end.parent){return false}return e.checkChild(i,\"paragraph\")}function Mm(e,t,i){if(t instanceof Fu){e.setSelection(i)}else{t.setTo(i)}}const Pm=' ,.?!:;\"-()';function Em(e,t,i={}){const n=e.schema;const o=i.direction!=\"backward\";const s=i.unit?i.unit:\"character\";const r=t.focus;const a=new _u({boundaries:Nm(r,o),singleCharacters:true,direction:o?\"forward\":\"backward\"});const c={walker:a,schema:n,isForward:o,unit:s};let l;while(l=a.next()){if(l.done){return}const i=Sm(c,l.value);if(i){if(t instanceof Fu){e.change(e=>{e.setSelectionFocus(i)})}else{t.setFocus(i)}return}}}function Sm(e,t){if(t.type==\"text\"){if(e.unit===\"word\"){return Om(e.walker,e.isForward)}return Im(e.walker,e.unit,e.isForward)}if(t.type==(e.isForward?\"elementStart\":\"elementEnd\")){if(e.schema.isObject(t.item)){return xu._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 Im(e,t){const i=e.position.textNode;if(i){const n=i.data;let o=e.position.offset-i.startOffset;while(cm(n,o)||t==\"character\"&&lm(n,o)){e.next();o=e.position.offset-i.startOffset}}return e.position}function Om(e,t){let i=e.position.textNode;if(i){let n=e.position.offset-i.startOffset;while(!Lm(i.data,n,t)&&!Rm(i,n,t)){e.next();const o=t?e.position.nodeAfter:e.position.nodeBefore;if(o&&o.is(\"text\")){const n=o.data.charAt(t?0:o.data.length-1);if(!Pm.includes(n)){e.next();i=e.position.textNode}}n=e.position.offset-i.startOffset}}return e.position}function Nm(e,t){const i=e.root;const n=xu._createAt(i,t?\"end\":0);if(t){return new Au(e,n)}else{return new Au(n,e)}}function Lm(e,t,i){const n=t+(i?0:-1);return Pm.includes(e.charAt(n))}function Rm(e,t,i){return t===(i?e.endOffset:0)}function zm(e,t){return e.change(e=>{const i=e.createDocumentFragment();const n=t.getFirstRange();if(!n||n.isCollapsed){return i}const o=n.start.root;const s=n.start.getCommonPath(n.end);const r=o.getNodeByPath(s);let a;if(n.start.parent==n.end.parent){a=n}else{a=e.createRange(e.createPositionAt(r,n.start.path[s.length]),e.createPositionAt(r,n.end.path[s.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(),i)}else{e.append(t._clone(true),i)}}if(a!=n){const t=n._getTransformedByMove(a.start,e.createPositionAt(i,0),c)[0];const o=e.createRange(e.createPositionAt(i,0),t.start);const s=e.createRange(t.end,e.createPositionAt(i,\"end\"));jm(s,e);jm(o,e)}return i})}function jm(e,t){const i=[];Array.from(e.getItems({direction:\"backward\"})).map(e=>t.createRangeOn(e)).filter(t=>{const i=(t.start.isAfter(e.start)||t.start.isEqual(e.start))&&(t.end.isBefore(e.end)||t.end.isEqual(e.end));return i}).forEach(e=>{i.push(e.start.parent);t.remove(e)});i.forEach(e=>{let i=e;while(i.parent&&i.isEmpty){const e=t.createRangeOn(i);i=i.parent;t.remove(e)}})}function Dm(e){e.document.registerPostFixer(t=>Bm(t,e))}function Bm(e,t){const i=t.document.selection;const n=t.schema;const o=[];let s=false;for(const e of i.getRanges()){const t=Vm(e,n);if(t){o.push(t);s=true}else{o.push(e)}}if(s){let t=o;if(o.length>1){const e=o[0].start;const i=o[o.length-1].end;t=[new Au(e,i)]}e.setSelection(t,{backward:i.isBackward})}}function Vm(e,t){if(e.isCollapsed){return Fm(e,t)}return Hm(e,t)}function Fm(e,t){const i=e.start;const n=t.getNearestSelectionRange(i);if(!n){return null}const o=n.start;if(i.isEqual(o)){return null}if(o.nodeAfter&&t.isLimit(o.nodeAfter)){return new Au(o,xu._createAfter(o.nodeAfter))}return new Au(o)}function Hm(e,t){const i=e.start;const n=e.end;const o=t.checkChild(i,\"$text\");const s=t.checkChild(n,\"$text\");const r=t.getLimitElement(i);const a=t.getLimitElement(n);if(r===a){if(o&&s){return null}if(Wm(i,n,t)){const e=i.nodeAfter&&t.isObject(i.nodeAfter);const o=e?null:t.getNearestSelectionRange(i,\"forward\");const s=n.nodeBefore&&t.isObject(n.nodeBefore);const r=s?null:t.getNearestSelectionRange(n,\"backward\");const a=o?o.start:i;const c=r?r.start:n;return new Au(a,c)}}const c=r&&!r.is(\"rootElement\");const l=a&&!a.is(\"rootElement\");if(c||l){const e=i.nodeAfter&&n.nodeBefore&&i.nodeAfter.parent===n.nodeBefore.parent;const o=c&&(!e||!$m(i.nodeAfter,t));const s=l&&(!e||!$m(n.nodeBefore,t));let d=i;let u=n;if(o){d=xu._createBefore(Um(r,t))}if(s){u=xu._createAfter(Um(a,t))}return new Au(d,u)}return null}function Um(e,t){let i=e;let n=i;while(t.isLimit(n)&&n.parent){i=n;n=n.parent}return i}function Wm(e,t,i){const n=e.nodeAfter&&!i.isLimit(e.nodeAfter)||i.checkChild(e,\"$text\");const o=t.nodeBefore&&!i.isLimit(t.nodeBefore)||i.checkChild(t,\"$text\");return n||o}function $m(e,t){return e&&t.isObject(e)}class qm{constructor(){this.markers=new fm;this.document=new um(this);this.schema=new Xh;this._pendingChanges=[];this._currentWriter=null;[\"insertContent\",\"deleteContent\",\"modifySelection\",\"getSelectedContent\",\"applyOperation\"].forEach(e=>this.decorate(e));this.on(\"applyOperation\",(e,t)=>{const i=t[0];i._validate()},{priority:\"highest\"});this.schema.register(\"$root\",{isLimit: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}});Dm(this)}change(e){try{if(this._pendingChanges.length===0){this._pendingChanges.push({batch:new Af,callback:e});return this._runPendingChanges()[0]}else{return e(this._currentWriter)}}catch(e){Qs[\"b\"].rethrowUnexpectedError(e,this)}}enqueueChange(e,t){try{if(typeof e===\"string\"){e=new Af(e)}else if(typeof e==\"function\"){t=e;e=new Af}this._pendingChanges.push({batch:e,callback:t});if(this._pendingChanges.length==1){this._runPendingChanges()}}catch(e){Qs[\"b\"].rethrowUnexpectedError(e,this)}}applyOperation(e){e._execute()}insertContent(e,t,i){return wm(this,e,t,i)}deleteContent(e,t){vm(this,e,t)}modifySelection(e,t){Em(this,e,t)}getSelectedContent(e){return zm(this,e)}hasContent(e,t){const i=e instanceof bu?Au._createIn(e):e;if(i.isCollapsed){return false}for(const e of this.markers.getMarkersIntersectingRange(i)){if(e.affectsData){return true}}const{ignoreWhitespaces:n=false}=t||{};for(const e of i.getItems()){if(e.is(\"textProxy\")){if(!n){return true}else if(e.data.search(/\\S/)!==-1){return true}}else if(this.schema.isObject(e)){return true}}return false}createPositionFromPath(e,t,i){return new xu(e,t,i)}createPositionAt(e,t){return xu._createAt(e,t)}createPositionAfter(e){return xu._createAfter(e)}createPositionBefore(e){return xu._createBefore(e)}createRange(e,t){return new Au(e,t)}createRangeIn(e){return Au._createIn(e)}createRangeOn(e){return Au._createOn(e)}createSelection(e,t,i){return new Su(e,t,i)}createBatch(e){return new Af(e)}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 Gf(this,t);const i=this._pendingChanges[0].callback(this._currentWriter);e.push(i);this.document._handleChangeBlock(this._currentWriter);this._pendingChanges.shift();this._currentWriter=null}this.fire(\"_afterChanges\");return e}}vr(qm,_a);class Ym{constructor(){this._listener=Object.create(pl)}listenTo(e){this._listener.listenTo(e,\"keydown\",(e,t)=>{this._listener.fire(\"_keydown:\"+ac(t),t)})}set(e,t,i={}){const n=cc(e);const o=i.priority;this._listener.listenTo(this._listener,\"_keydown:\"+n,(e,i)=>{t(i,()=>{i.preventDefault();i.stopPropagation();e.stop()});e.return=true},{priority:o})}press(e){return!!this._listener.fire(\"_keydown:\"+ac(e),e)}destroy(){this._listener.stopListening()}}class Gm extends Ym{constructor(e){super();this.editor=e}set(e,t,i={}){if(typeof t==\"string\"){const e=t;t=(t,i)=>{this.editor.execute(e);i()}}super.set(e,t,i)}}class Jm{constructor(e){const t=this.constructor.builtinPlugins;this.config=new Js(e,this.constructor.defaultConfig);this.config.define(\"plugins\",t);this.plugins=new Bh(this,t);this.commands=new Vh;const i=this.config.get(\"language\")||{};this.locale=new Yh({uiLanguage:typeof i===\"string\"?i:i.ui,contentLanguage:this.config.get(\"language.content\")});this.t=this.locale.t;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 qm;this.data=new _f(this.model);this.editing=new Dh(this.model);this.editing.view.document.bind(\"isReadOnly\").to(this);this.conversion=new kf([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 Gm(this);this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const e=this.config;const t=e.get(\"plugins\")||[];const i=e.get(\"removePlugins\")||[];const n=e.get(\"extraPlugins\")||[];return this.plugins.init(t.concat(n),i)}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()})}execute(...e){try{this.commands.execute(...e)}catch(e){Qs[\"b\"].rethrowUnexpectedError(e,this)}}}vr(Jm,_a);const Km={setData(e){this.data.set(e)},getData(e){return this.data.get(e)}};var Xm=Km;function Qm(e,t){if(e instanceof HTMLTextAreaElement){e.value=t}e.innerHTML=t}const Zm={updateSourceElement(){if(!this.sourceElement){throw new Qs[\"b\"](\"editor-missing-sourceelement: Cannot update the source element of a detached editor.\",this)}Qm(this.sourceElement,this.data.get())}};var eg=Zm;function tg(e){if(!me(e.updateSourceElement)){throw new Qs[\"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 i;const n=t.form;const o=()=>e.updateSourceElement();if(me(n.submit)){i=n.submit;n.submit=()=>{o();i.apply(n)}}n.addEventListener(\"submit\",o);e.on(\"destroy\",()=>{n.removeEventListener(\"submit\",o);if(i){n.submit=i}})}}class ig{getHtml(e){const t=document.implementation.createHTMLDocument(\"\");const i=t.createElement(\"div\");i.appendChild(e);return i.innerHTML}}class ng{constructor(){this._domParser=new DOMParser;this._domConverter=new ll({blockFillerMode:\"nbsp\"});this._htmlWriter=new ig}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 i=t.createDocumentFragment();const n=t.body.childNodes;while(n.length>0){i.appendChild(n[0])}return i}}class og{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 Qs[\"b\"](\"componentfactory-item-exists: The item already exists in the component factory.\",this,{name:e})}this._components.set(sg(e),{callback:t,originalName:e})}create(e){if(!this.has(e)){throw new Qs[\"b\"](\"componentfactory-item-missing: The required component is not registered in the factory.\",this,{name:e})}return this._components.get(sg(e)).callback(this.editor.locale)}has(e){return this._components.has(sg(e))}}function sg(e){return String(e).toLowerCase()}class rg{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 Qs[\"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)}}vr(rg,pl);vr(rg,_a);class ag{constructor(e){this.editor=e;this.componentFactory=new og(e);this.focusTracker=new rg;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}}vr(ag,lr);function cg({origin:e,originKeystrokeHandler:t,originFocusTracker:i,toolbar:n,beforeFocus:o,afterBlur:s}){i.add(n.element);t.set(\"Alt+F10\",(e,t)=>{if(i.isFocused&&!n.focusTracker.isFocused){if(o){o()}n.focus();t()}});n.keystrokes.set(\"Esc\",(t,i)=>{if(n.focusTracker.isFocused){e.focus();if(s){s()}i()}})}function lg(e){if(Array.isArray(e)){return{items:e}}if(!e){return{items:[]}}return Object.assign({items:[]},e)}var dg=i(15);const ug=new WeakMap;function hg(e){const{view:t,element:i,text:n,isDirectHost:o=true}=e;const s=t.document;if(!ug.has(s)){ug.set(s,new Map);s.registerPostFixer(e=>bg(s,e))}ug.get(s).set(i,{text:n,isDirectHost:o});t.change(e=>bg(s,e))}function fg(e,t){const i=t.document;e.change(e=>{if(!ug.has(i)){return}const n=ug.get(i);const o=n.get(t);e.removeAttribute(\"data-placeholder\",o.hostElement);gg(e,o.hostElement);n.delete(t)})}function mg(e,t){if(!t.hasClass(\"ck-placeholder\")){e.addClass(\"ck-placeholder\",t);return true}return false}function gg(e,t){if(t.hasClass(\"ck-placeholder\")){e.removeClass(\"ck-placeholder\",t);return true}return false}function pg(e){const t=e.document;if(!t){return false}const i=!Array.from(e.getChildren()).some(e=>!e.is(\"uiElement\"));if(!t.isFocused&&i){return true}const n=t.selection;const o=n.anchor;if(i&&o&&o.parent!==e){return true}return false}function bg(e,t){const i=ug.get(e);let n=false;for(const[e,o]of i){if(wg(t,e,o)){n=true}}return n}function wg(e,t,i){const{text:n,isDirectHost:o}=i;const s=o?t:_g(t);let r=false;if(!s){return false}i.hostElement=s;if(s.getAttribute(\"data-placeholder\")!==n){e.setAttribute(\"data-placeholder\",n,s);r=true}if(pg(s)){if(mg(e,s)){r=true}}else if(gg(e,s)){r=true}return r}function _g(e){if(e.childCount===1){const t=e.getChild(0);if(t.is(\"element\")&&!t.is(\"uiElement\")){return t}}return null}class vg{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 kg extends ag{constructor(e,t){super(e);this.view=t;this._toolbarConfig=lg(e.config.get(\"toolbar\"));this._elementReplacer=new vg}get element(){return this.view.element}init(e){const t=this.editor;const i=this.view;const n=t.editing.view;const o=i.editable;const s=n.document.getRoot();o.name=s.rootName;i.render();const r=o.element;this.setEditableElement(o.name,r);this.focusTracker.add(r);i.editable.bind(\"isFocused\").to(this.focusTracker);n.attachDomRoot(r);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 i=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);cg({origin:i,originFocusTracker:this.focusTracker,originKeystrokeHandler:e.keystrokes,toolbar:t.toolbar})}_initPlaceholder(){const e=this.editor;const t=e.editing.view;const i=t.document.getRoot();const n=e.sourceElement;const o=e.config.get(\"placeholder\")||n&&n.tagName.toLowerCase()===\"textarea\"&&n.getAttribute(\"placeholder\");if(o){hg({view:t,element:i,text:o,isDirectHost:false})}}}class yg extends Fa{constructor(e){super({idProperty:\"viewUid\"});this.on(\"add\",(e,t,i)=>{if(!t.isRendered){t.render()}if(t.element&&this._parentElement){this._parentElement.insertBefore(t.element,this._parentElement.children[i])}});this.on(\"remove\",(e,t)=>{if(t.element&&this._parentElement){t.element.remove()}});this.locale=e;this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e}delegate(...e){if(!e.length||!xg(e)){throw new Qs[\"b\"](\"ui-viewcollection-delegate-wrong-events: All event names must be strings.\",this)}return{to:t=>{for(const i of this){for(const n of e){i.delegate(n).to(t)}}this.on(\"add\",(i,n)=>{for(const i of e){n.delegate(i).to(t)}});this.on(\"remove\",(i,n)=>{for(const i of e){n.stopDelegating(i,t)}})}}}}function xg(e){return e.every(e=>typeof e==\"string\")}const Ag=\"http://www.w3.org/1999/xhtml\";class Cg{constructor(e){Object.assign(this,zg(Rg(e)));this._isRendered=false;this._revertData=null}render(){const e=this._renderNode({intoFragment:true});this._isRendered=true;return e}apply(e){this._revertData=Jg();this._renderNode({node:e,isApplying:true,revertData:this._revertData});return e}revert(e){if(!this._revertData){throw new Qs[\"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 i of t.children){if(qg(i)){yield i}else if(Yg(i)){yield*e(i)}}}}yield*e(this)}static bind(e,t){return{to(i,n){return new Mg({eventNameOrFunction:i,attribute:i,observable:e,emitter:t,callback:n})},if(i,n,o){return new Pg({observable:e,emitter:t,attribute:i,valueIfTrue:n,callback:o})}}}static extend(e,t){if(e._isRendered){throw new Qs[\"b\"](\"template-extend-render: Attempting to extend a template which has already been rendered.\",[this,e])}Wg(e,zg(Rg(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 Qs[\"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||Ag,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(Eg(this.text)){this._bindToObservable({schema:this.text,updater:Og(t),data:e})}else{t.textContent=this.text.join(\"\")}return t}_renderAttributes(e){let t,i,n,o;if(!this.attributes){return}const s=e.node;const r=e.revertData;for(t in this.attributes){n=s.getAttribute(t);i=this.attributes[t];if(r){r.attributes[t]=n}o=ce(i[0])&&i[0].ns?i[0].ns:null;if(Eg(i)){const a=o?i[0].value:i;if(r&&Kg(t)){a.unshift(n)}this._bindToObservable({schema:a,updater:Ng(s,t,o),data:e})}else if(t==\"style\"&&typeof i[0]!==\"string\"){this._renderStyleAttribute(i[0],e)}else{if(r&&n&&Kg(t)){i.unshift(n)}i=i.map(e=>e?e.value||e:e).reduce((e,t)=>e.concat(t),[]).reduce(Hg,\"\");if(!$g(i)){s.setAttributeNS(o,t,i)}}}}_renderStyleAttribute(e,t){const i=t.node;for(const n in e){const o=e[n];if(Eg(o)){this._bindToObservable({schema:[o],updater:Lg(i,n),data:t})}else{i.style[n]=o}}}_renderElementChildren(e){const t=e.node;const i=e.intoFragment?document.createDocumentFragment():t;const n=e.isApplying;let o=0;for(const s of this.children){if(Gg(s)){if(!n){s.setParent(t);for(const e of s){i.appendChild(e.element)}}}else if(qg(s)){if(!n){if(!s.isRendered){s.render()}i.appendChild(s.element)}}else if(Jc(s)){i.appendChild(s)}else{if(n){const t=e.revertData;const n=Jg();t.children.push(n);s._renderNode({node:i.childNodes[o++],isApplying:true,revertData:n})}else{i.appendChild(s.render())}}}if(e.intoFragment){t.appendChild(i)}}_setUpListeners(e){if(!this.eventListeners){return}for(const t in this.eventListeners){const i=this.eventListeners[t].map(i=>{const[n,o]=t.split(\"@\");return i.activateDomEventListener(n,o,e)});if(e.revertData){e.revertData.bindings.push(i)}}}_bindToObservable({schema:e,updater:t,data:i}){const n=i.revertData;Ig(e,t,i);const o=e.filter(e=>!$g(e)).filter(e=>e.observable).map(n=>n.activateAttributeListener(e,t,i));if(n){n.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 i in t.attributes){const n=t.attributes[i];if(n===null){e.removeAttribute(i)}else{e.setAttribute(i,n)}}for(let i=0;iIg(e,t,i);this.emitter.listenTo(this.observable,\"change:\"+this.attribute,n);return()=>{this.emitter.stopListening(this.observable,\"change:\"+this.attribute,n)}}}class Mg extends Tg{activateDomEventListener(e,t,i){const n=(e,i)=>{if(!t||i.target.matches(t)){if(typeof this.eventNameOrFunction==\"function\"){this.eventNameOrFunction(i)}else{this.observable.fire(this.eventNameOrFunction,i)}}};this.emitter.listenTo(i.node,e,n);return()=>{this.emitter.stopListening(i.node,e,n)}}}class Pg extends Tg{getValue(e){const t=super.getValue(e);return $g(t)?false:this.valueIfTrue||true}}function Eg(e){if(!e){return false}if(e.value){e=e.value}if(Array.isArray(e)){return e.some(Eg)}else if(e instanceof Tg){return true}return false}function Sg(e,t){return e.map(e=>{if(e instanceof Tg){return e.getValue(t)}return e})}function Ig(e,t,{node:i}){let n=Sg(e,i);if(e.length==1&&e[0]instanceof Pg){n=n[0]}else{n=n.reduce(Hg,\"\")}if($g(n)){t.remove()}else{t.set(n)}}function Og(e){return{set(t){e.textContent=t},remove(){e.textContent=\"\"}}}function Ng(e,t,i){return{set(n){e.setAttributeNS(i,t,n)},remove(){e.removeAttributeNS(i,t)}}}function Lg(e,t){return{set(i){e.style[t]=i},remove(){e.style[t]=null}}}function Rg(e){const t=qs(e,e=>{if(e&&(e instanceof Tg||Yg(e)||qg(e)||Gg(e))){return e}});return t}function zg(e){if(typeof e==\"string\"){e=Bg(e)}else if(e.text){Vg(e)}if(e.on){e.eventListeners=Dg(e.on);delete e.on}if(!e.text){if(e.attributes){jg(e.attributes)}const t=[];if(e.children){if(Gg(e.children)){t.push(e.children)}else{for(const i of e.children){if(Yg(i)||qg(i)||Jc(i)){t.push(i)}else{t.push(new Cg(i))}}}}e.children=t}return e}function jg(e){for(const t in e){if(e[t].value){e[t].value=[].concat(e[t].value)}Fg(e,t)}}function Dg(e){for(const t in e){Fg(e,t)}return e}function Bg(e){return{text:[e]}}function Vg(e){if(!Array.isArray(e.text)){e.text=[e.text]}}function Fg(e,t){if(!Array.isArray(e[t])){e[t]=[e[t]]}}function Hg(e,t){if($g(t)){return e}else if($g(e)){return t}else{return`${e} ${t}`}}function Ug(e,t){for(const i in t){if(e[i]){e[i].push(...t[i])}else{e[i]=t[i]}}}function Wg(e,t){if(t.attributes){if(!e.attributes){e.attributes={}}Ug(e.attributes,t.attributes)}if(t.eventListeners){if(!e.eventListeners){e.eventListeners={}}Ug(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 Qs[\"b\"](\"ui-template-extend-children-mismatch: The number of children in extended definition does not match.\",e)}let i=0;for(const n of t.children){Wg(e.children[i++],n)}}}function $g(e){return!e&&e!==0}function qg(e){return e instanceof Qg}function Yg(e){return e instanceof Cg}function Gg(e){return e instanceof yg}function Jg(){return{children:[],bindings:[],attributes:{}}}function Kg(e){return e==\"class\"||e==\"style\"}var Xg=i(17);class Qg{constructor(e){this.element=null;this.isRendered=false;this.locale=e;this.t=e&&e.t;this._viewCollections=new Fa;this._unboundChildren=this.createCollection();this._viewCollections.on(\"add\",(t,i)=>{i.locale=e});this.decorate(\"render\")}get bindTemplate(){if(this._bindTemplate){return this._bindTemplate}return this._bindTemplate=Cg.bind(this,this)}createCollection(){const e=new yg;this._viewCollections.add(e);return e}registerChild(e){if(!Er(e)){e=[e]}for(const t of e){this._unboundChildren.add(t)}}deregisterChild(e){if(!Er(e)){e=[e]}for(const t of e){this._unboundChildren.remove(t)}}setTemplate(e){this.template=new Cg(e)}extendTemplate(e){Cg.extend(this.template,e)}render(){if(this.isRendered){throw new Qs[\"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)}}}vr(Qg,pl);vr(Qg,_a);var Zg=i(19);class ep extends Qg{constructor(e){super(e);this.body=this.createCollection()}render(){super.render();this._renderBodyCollection()}destroy(){this._bodyCollectionContainer.remove();return super.destroy()}_renderBodyCollection(){const e=this.locale;const t=this._bodyCollectionContainer=new Cg({tag:\"div\",attributes:{class:[\"ck\",\"ck-reset_all\",\"ck-body\",\"ck-rounded-corners\"],dir:e.uiLanguageDirection},children:this.body}).render();document.body.appendChild(t)}}var tp=i(21);class ip extends Qg{constructor(e){super(e);this.set(\"text\");this.set(\"for\");const t=this.bindTemplate;this.setTemplate({tag:\"label\",attributes:{class:[\"ck\",\"ck-label\"],for:t.to(\"for\")},children:[{text:t.to(\"text\")}]})}}class np extends ep{constructor(e){super(e);const t=ir();this.top=this.createCollection();this.main=this.createCollection();this._voiceLabelView=this._createVoiceLabel(t);this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-reset\",\"ck-editor\",\"ck-rounded-corners\"],role:\"application\",dir:e.uiLanguageDirection,lang:e.uiLanguage,\"aria-labelledby\":`ck-editor__aria-label_${t}`},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(e){const t=this.t;const i=new ip;i.text=t(\"cd\");i.extendTemplate({attributes:{id:`ck-editor__aria-label_${e}`,class:\"ck-voice-label\"}});return i}}class op extends Qg{constructor(e,t,i){super(e);this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-content\",\"ck-editor__editable\",\"ck-rounded-corners\"],lang:e.contentLanguage,dir:e.contentLanguageDirection}});this.name=null;this.set(\"isFocused\",false);this._editableElement=i;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){i(this)}else{t(this)}function t(t){e.change(i=>{const n=e.document.getRoot(t.name);i.addClass(t.isFocused?\"ck-focused\":\"ck-blurred\",n);i.removeClass(t.isFocused?\"ck-blurred\":\"ck-focused\",n)})}function i(n){e.once(\"change:isRenderingInProgress\",(e,o,s)=>{if(!s){t(n)}else{i(n)}})}}}class sp extends op{constructor(e,t,i){super(e,t,i);this.extendTemplate({attributes:{role:\"textbox\",class:\"ck-editor__editable_inline\"}})}render(){super.render();const e=this._editingView;const t=this.t;e.change(i=>{const n=e.document.getRoot(this.name);i.setAttribute(\"aria-label\",t(\"dq\",[this.name]),n)})}}function rp(e){return t=>t+e}var ap=i(23);const cp=rp(\"px\");class lp extends Qg{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 Cg({tag:\"div\",attributes:{class:[\"ck\",\"ck-sticky-panel__placeholder\"],style:{display:t.to(\"isSticky\",e=>e?\"block\":\"none\"),height:t.to(\"isSticky\",e=>e?cp(this._panelRect.height):null)}}}).render();this._contentPanel=new Cg({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?cp(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to(\"_hasViewportTopOffset\",e=>e?cp(this.viewportTopOffset):null),bottom:t.to(\"_isStickyToTheLimiter\",e=>e?cp(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(ol.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]();i()})}}}}get first(){return this.focusables.find(up)||null}get last(){return this.focusables.filter(up).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,i)=>{const n=t.element===this.focusTracker.focusedElement;if(n){e=i}return n});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 i=this.focusables.length;if(!i){return null}if(t===null){return this[e===1?\"first\":\"last\"]}let n=(t+i+e)%i;do{const t=this.focusables.get(n);if(up(t)){return t}n=(n+i+e)%i}while(n!==t);return null}}function up(e){return!!(e.focus&&ol.window.getComputedStyle(e.element).display!=\"none\")}class hp extends Qg{constructor(e){super(e);this.setTemplate({tag:\"span\",attributes:{class:[\"ck\",\"ck-toolbar__separator\"]}})}}const fp=100;function mp(e){if(typeof ol.window.ResizeObserver===\"function\"){return new ol.window.ResizeObserver(e)}else{return new gp(e)}}class gp{constructor(e){this._callback=e;this._elements=new Set;this._previousRects=new Map;this._periodicCheckTimeout=null}observe(e){this._elements.add(e);if(this._elements.size===1){this._startPeriodicCheck()}}unobserve(e){this._elements.delete(e);this._previousRects.delete(e);if(!this._elements.size){this._stopPeriodicCheck()}}disconnect(){this._elements.forEach(e=>this.unobserve(e))}_startPeriodicCheck(){const e=()=>{this._checkElementRectsAndExecuteCallback();this._periodicCheckTimeout=setTimeout(e,fp)};this.listenTo(ol.window,\"resize\",()=>{this._checkElementRectsAndExecuteCallback()});e()}_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 Kd(e);const i=this._previousRects.get(e);const n=!i||!i.isEqual(t);this._previousRects.set(e,t);return n}}vr(gp,pl);function pp(e){return e.bindTemplate.to(t=>{if(t.target===e.element){t.preventDefault()}})}class bp extends Qg{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 wp=i(25);function _p(e){while(e&&e.tagName.toLowerCase()!=\"html\"){if(ol.window.getComputedStyle(e).position!=\"static\"){return e}e=e.parentElement}return null}function vp({element:e,target:t,positions:i,limiter:n,fitInViewport:o}){if(me(t)){t=t()}if(me(n)){n=n()}const s=_p(e.parentElement);const r=new Kd(e);const a=new Kd(t);let c;let l;if(!n&&!o){[l,c]=kp(i[0],a,r)}else{const e=n&&new Kd(n).getVisible();const t=o&&new Kd(ol.window);[l,c]=yp(i,a,r,e,t)||kp(i[0],a,r)}let{left:d,top:u}=xp(c);if(s){const e=xp(new Kd(s));const t=Gd(s);d-=e.left;u-=e.top;d+=s.scrollLeft;u+=s.scrollTop;d-=t.left;u-=t.top}return{left:d,top:u,name:l}}function kp(e,t,i){const{left:n,top:o,name:s}=e(t,i);return[s,i.clone().moveTo(n,o)]}function yp(e,t,i,n,o){let s=0;let r=0;let a;let c;const l=i.getArea();e.some(e=>{const[d,u]=kp(e,t,i);let h;let f;if(n){if(o){const e=n.getIntersection(o);if(e){h=e.getIntersectionArea(u)}else{h=0}}else{h=n.getIntersectionArea(u)}}if(o){f=o.getIntersectionArea(u)}if(o&&!n){if(f>r){m()}}else if(!o&&n){if(h>s){m()}}else{if(f>r&&h>=s){m()}else if(f>=r&&h>s){m()}}function m(){r=f;s=h;a=u;c=d}return h===l});return a?[c,a]:null}function xp({left:e,top:t}){const{scrollX:i,scrollY:n}=ol.window;return{left:e+i,top:t+n}}class Ap extends Qg{constructor(e,t,i){super(e);const n=this.bindTemplate;this.buttonView=t;this.panelView=i;this.set(\"isOpen\",false);this.set(\"isEnabled\",true);this.set(\"class\");this.set(\"panelPosition\",\"auto\");this.focusTracker=new rg;this.keystrokes=new Ym;this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-dropdown\",n.to(\"class\"),n.if(\"isEnabled\",\"ck-disabled\",e=>!e)]},children:[t,i]});t.extendTemplate({attributes:{class:[\"ck-dropdown__button\"]}})}render(){super.render();this.listenTo(this.buttonView,\"open\",()=>{this.isOpen=!this.isOpen});this.panelView.bind(\"isVisible\").to(this,\"isOpen\");this.on(\"change:isOpen\",()=>{if(!this.isOpen){return}if(this.panelPosition===\"auto\"){this.panelView.position=Ap._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);this.focusTracker.add(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:i,northWest:n}=Ap.defaultPanelPositions;if(this.locale.uiLanguageDirection===\"ltr\"){return[e,t,i,n]}else{return[t,e,n,i]}}}Ap.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\"})};Ap._getOptimalPosition=vp;var Cp=i(27);class Tp extends Qg{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 i=t.getAttribute(\"viewBox\");if(i){this.viewBox=i}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 Mp=i(29);class Pp extends Qg{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 Ep=i(31);class Sp extends Qg{constructor(e){super(e);const t=this.bindTemplate;const i=ir();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(i);this.iconView=new Tp;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_${i}`,\"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 Pp;e.bind(\"text\").to(this,\"_tooltipString\");e.bind(\"position\").to(this,\"tooltipPosition\");return e}_createLabelView(e){const t=new Qg;const i=this.bindTemplate;t.setTemplate({tag:\"span\",attributes:{class:[\"ck\",\"ck-button__label\"],style:i.to(\"labelStyle\"),id:`ck-editor__aria-label_${e}`},children:[{text:this.bindTemplate.to(\"label\")}]});return t}_createKeystrokeView(){const e=new Qg;e.setTemplate({tag:\"span\",attributes:{class:[\"ck\",\"ck-button__keystroke\"]},children:[{text:this.bindTemplate.to(\"keystroke\",e=>lc(e))}]});return e}_getTooltipString(e,t,i){if(e){if(typeof e==\"string\"){return e}else{if(i){i=lc(i)}if(e instanceof Function){return e(t,i)}else{return`${t}${i?` (${i})`:\"\"}`}}}return\"\"}}var Ip='';class Op extends Sp{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 Tp;e.content=Ip;e.extendTemplate({attributes:{class:\"ck-dropdown__arrow\"}});return e}}var Np=i(33);class Lp extends Qg{constructor(){super();this.items=this.createCollection();this.focusTracker=new rg;this.keystrokes=new Ym;this._focusCycler=new dp({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 Rp extends Qg{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 zp extends Qg{constructor(e){super(e);this.setTemplate({tag:\"li\",attributes:{class:[\"ck\",\"ck-list__separator\"]}})}}var jp=i(35);class Dp extends Sp{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 Qg;e.setTemplate({tag:\"span\",attributes:{class:[\"ck\",\"ck-button__toggle\"]},children:[{tag:\"span\",attributes:{class:[\"ck\",\"ck-button__toggle__inner\"]}}]});return e}}function Bp({emitter:e,activator:t,callback:i,contextElements:n}){e.listenTo(document,\"mousedown\",(e,{target:o})=>{if(!t()){return}for(const e of n){if(e.contains(o)){return}}i()})}var Vp=i(37);var Fp=i(39);function Hp(e,t=Op){const i=new t(e);const n=new bp(e);const o=new Ap(e,i,n);i.bind(\"isEnabled\").to(o);if(i instanceof Op){i.bind(\"isOn\").to(o,\"isOpen\")}else{i.arrowView.bind(\"isOn\").to(o,\"isOpen\")}$p(o);return o}function Up(e,t){const i=e.locale;const n=i.t;const o=e.toolbarView=new Xp(i);o.set(\"ariaLabel\",n(\"cu\"));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 Wp(e,t){const i=e.locale;const n=e.listView=new Lp(i);n.items.bindTo(t).using(({type:e,model:t})=>{if(e===\"separator\"){return new zp(i)}else if(e===\"button\"||e===\"switchbutton\"){const n=new Rp(i);let o;if(e===\"button\"){o=new Sp(i)}else{o=new Dp(i)}o.bind(...Object.keys(t)).to(t);o.delegate(\"execute\").to(n);n.children.add(o);return n}});e.panelView.children.add(n);n.items.delegate(\"execute\").to(e)}function $p(e){qp(e);Yp(e);Gp(e)}function qp(e){e.on(\"render\",()=>{Bp({emitter:e,activator:()=>e.isOpen,callback:()=>{e.isOpen=false},contextElements:[e.element]})})}function Yp(e){e.on(\"execute\",t=>{if(t.source instanceof Dp){return}e.isOpen=false})}function Gp(e){e.keystrokes.set(\"arrowdown\",(t,i)=>{if(e.isOpen){e.panelView.focus();i()}});e.keystrokes.set(\"arrowup\",(t,i)=>{if(e.isOpen){e.panelView.focusLast();i()}})}var Jp='\\n';var Kp=i(41);class Xp extends Qg{constructor(e,t){super(e);const i=this.bindTemplate;const n=this.t;this.options=t||{};this.set(\"ariaLabel\",n(\"cx\"));this.items=this.createCollection();this.focusTracker=new rg;this.keystrokes=new Ym;this.set(\"class\");this.itemsView=new Qp(e);this.children=this.createCollection();this.children.add(this.itemsView);this.focusables=this.createCollection();this._focusCycler=new dp({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\",i.to(\"class\")],role:\"toolbar\",\"aria-label\":i.to(\"ariaLabel\")},children:this.children,on:{mousedown:pp(this)}});this._behavior=this.options.shouldGroupWhenFull?new eb(this):new Zp(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){e.map(e=>{if(e==\"|\"){this.items.add(new hp)}else if(t.has(e)){this.items.add(t.create(e))}else{console.warn(Object(Qs[\"a\"])(\"toolbarview-item-unavailable: The requested toolbar item is unavailable.\"),{name:e})}})}}class Qp extends Qg{constructor(e){super(e);this.children=this.createCollection();this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-toolbar__items\"]},children:this.children})}}class Zp{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 eb{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;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(\"add\",(e,t,i)=>{if(i>this.ungroupedItems.length){this.groupedItems.add(t,i-this.ungroupedItems.length)}else{this.ungroupedItems.add(t,i)}this._updateGrouping()});e.items.on(\"remove\",(e,t,i)=>{if(i>this.ungroupedItems.length){this.groupedItems.remove(t)}else{this.ungroupedItems.remove(t)}this._updateGrouping()});e.extendTemplate({attributes:{class:[\"ck-toolbar_grouping\"]}})}render(e){this.viewElement=e.element;this._enableGroupingOnResize()}destroy(){this.groupedItemsDropdown.destroy();this.resizeObserver.disconnect()}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement)){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 i=new Kd(e.lastChild);const n=new Kd(e);if(!this.cachedPadding){const i=ol.window.getComputedStyle(e);const n=t===\"ltr\"?\"paddingRight\":\"paddingLeft\";this.cachedPadding=Number.parseInt(i[n])}if(t===\"ltr\"){return i.right>n.right-this.cachedPadding}else{return i.left{if(!e||e!==t.contentRect.width){this._updateGrouping();e=t.contentRect.width}});this.resizeObserver.observe(this.viewElement);this._updateGrouping()}_groupLastItem(){if(!this.groupedItems.length){this.viewChildren.add(new hp);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 i=Hp(e);i.class=\"ck-toolbar__grouped-dropdown\";i.panelPosition=e.uiLanguageDirection===\"ltr\"?\"sw\":\"se\";Up(i,[]);i.buttonView.set({label:t(\"cy\"),tooltip:true,icon:Jp});i.toolbarView.items.bindTo(this.groupedItems).using(e=>e);return i}_updateFocusCycleableItems(){this.viewFocusables.clear();this.ungroupedItems.map(e=>{this.viewFocusables.add(e)});if(this.groupedItems.length){this.viewFocusables.add(this.groupedItemsDropdown)}}}var tb=i(43);class ib extends np{constructor(e,t,i={}){super(e);this.stickyPanel=new lp(e);this.toolbar=new Xp(e,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull});this.editable=new sp(e,t)}render(){super.render();this.stickyPanel.content.add(this.toolbar);this.top.add(this.stickyPanel);this.main.add(this.editable)}}function nb(e){if(e instanceof HTMLTextAreaElement){return e.value}return e.innerHTML}class ob extends Jm{constructor(e,t){super(t);if(Gs(e)){this.sourceElement=e}this.data.processor=new ng;this.model.document.createRoot();const i=!this.config.get(\"toolbar.shouldNotGroupWhenFull\");const n=new ib(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:i});this.ui=new kg(this,n);tg(this)}destroy(){if(this.sourceElement){this.updateSourceElement()}this.ui.destroy();return super.destroy()}static create(e,t={}){return new Promise(i=>{const n=new this(e,t);i(n.initPlugins().then(()=>n.ui.init(Gs(e)?e:null)).then(()=>{if(!Gs(e)&&t.initialData){throw new Qs[\"b\"](\"editor-create-initial-data: \"+\"The config.initialData option cannot be used together with initial data passed in Editor.create().\",null)}const i=t.initialData||sb(e);return n.data.init(i)}).then(()=>n.fire(\"ready\")).then(()=>n))})}}vr(ob,Xm);vr(ob,eg);function sb(e){return Gs(e)?nb(e):e}class rb{static get pluginName(){return\"BlockAutoformatEditing\"}constructor(e,t,i){let n;let o=null;if(typeof i==\"function\"){n=i}else{o=e.commands.get(i);n=()=>{e.execute(i)}}e.model.document.on(\"change\",(i,s)=>{if(o&&!o.isEnabled){return}if(s.type==\"transparent\"){return}const r=Array.from(e.model.document.differ.getChanges());const a=r[0];if(r.length!=1||a.type!==\"insert\"||a.name!=\"$text\"||a.length!=1){return}const c=a.position.parent;if(!c.is(\"paragraph\")||c.childCount!==1){return}const l=t.exec(c.getChild(0).data);if(!l){return}e.model.enqueueChange(e=>{const t=e.createPositionAt(c,0);const i=e.createPositionAt(c,l[0].length);const o=new zu(t,i);const s=n({match:l});if(s!==false){e.remove(o)}o.detach()})})}}function ab(e,t){let i=e.start;const n=Array.from(e.getItems()).reduce((e,n)=>{if(!(n.is(\"text\")||n.is(\"textProxy\"))){i=t.createPositionAfter(n);return\"\"}return e+n.data},\"\");return{text:n,range:t.createRange(i,e.end)}}class cb{static get pluginName(){return\"InlineAutoformatEditing\"}constructor(e,t,i){let n;let o;let s;let r;if(t instanceof RegExp){n=t}else{s=t}if(typeof i==\"string\"){o=i}else{r=i}s=s||(e=>{let t;const i=[];const o=[];while((t=n.exec(e))!==null){if(t&&t.length<4){break}let{index:e,1:n,2:s,3:r}=t;const a=n+s+r;e+=t[0].length-a.length;const c=[e,e+n.length];const l=[e+n.length+s.length,e+n.length+s.length+r.length];i.push(c);i.push(l);o.push([e+n.length,e+n.length+s.length])}return{remove:i,format:o}});r=r||((t,i)=>{const n=e.model.schema.getValidRanges(i,o);for(const e of n){t.setAttribute(o,true,e)}t.removeSelectionAttribute(o)});e.model.document.on(\"change\",(t,i)=>{if(i.type==\"transparent\"){return}const n=e.model;const o=n.document.selection;if(!o.isCollapsed){return}const a=Array.from(n.document.differ.getChanges());const c=a[0];if(a.length!=1||c.type!==\"insert\"||c.name!=\"$text\"||c.length!=1){return}const l=o.focus;const d=l.parent;const{text:u,range:h}=ab(n.createRange(n.createPositionAt(d,0),l),n);const f=s(u);const m=lb(h.start,f.format,n);const g=lb(h.start,f.remove,n);if(!(m.length&&g.length)){return}n.enqueueChange(e=>{const t=r(e,m);if(t===false){return}for(const t of g.reverse()){e.remove(t)}})})}}function lb(e,t,i){return t.filter(e=>e[0]!==undefined&&e[1]!==undefined).map(t=>i.createRange(e.getShiftedBy(t[0]),e.getShiftedBy(t[1])))}class db{constructor(e){this.editor=e}destroy(){this.stopListening()}}vr(db,_a);class ub extends db{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\")){new rb(this.editor,/^[*-]\\s$/,\"bulletedList\")}if(e.get(\"numberedList\")){new rb(this.editor,/^1[.|)]\\s$/,\"numberedList\")}}_addBasicStylesAutoformats(){const e=this.editor.commands;if(e.get(\"bold\")){const e=hb(this.editor,\"bold\");new cb(this.editor,/(\\*\\*)([^*]+)(\\*\\*)$/g,e);new cb(this.editor,/(__)([^_]+)(__)$/g,e)}if(e.get(\"italic\")){const e=hb(this.editor,\"italic\");new cb(this.editor,/(?:^|[^*])(\\*)([^*_]+)(\\*)$/g,e);new cb(this.editor,/(?:^|[^_])(_)([^_]+)(_)$/g,e)}if(e.get(\"code\")){const e=hb(this.editor,\"code\");new cb(this.editor,/(`)([^`]+)(`)$/g,e)}}_addHeadingAutoformats(){const e=this.editor.commands.get(\"heading\");if(e){e.modelElements.filter(e=>e.match(/^heading[1-6]$/)).forEach(t=>{const i=t[7];const n=new RegExp(`^(#{${i}})\\\\s$`);new rb(this.editor,n,()=>{if(!e.isEnabled){return false}this.editor.execute(\"heading\",{value:t})})})}}_addBlockQuoteAutoformats(){if(this.editor.commands.get(\"blockQuote\")){new rb(this.editor,/^>\\s$/,\"blockQuote\")}}_addCodeBlockAutoformats(){if(this.editor.commands.get(\"codeBlock\")){new rb(this.editor,/^```$/,\"codeBlock\")}}}function hb(e,t){return(i,n)=>{const o=e.commands.get(t);if(!o.isEnabled){return false}const s=e.model.schema.getValidRanges(n,t);for(const e of s){i.setAttribute(t,true,e)}i.removeSelectionAttribute(t)}}class fb{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,i)=>{if(i){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\",mb,{priority:\"highest\"});this.isEnabled=false}}clearForceDisabled(e){this._disableStack.delete(e);if(this._disableStack.size==0){this.off(\"set:isEnabled\",mb);this.refresh()}}execute(){}destroy(){this.stopListening()}}vr(fb,_a);function mb(e){e.return=false;e.stop()}function gb(e){const t=e.next();if(t.done){return null}return t.value}class pb extends fb{refresh(){this.value=this._getValue();this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model;const i=t.schema;const n=t.document.selection;const o=Array.from(n.getSelectedBlocks());const s=e.forceValue===undefined?!this.value:e.forceValue;t.change(e=>{if(!s){this._removeQuote(e,o.filter(bb))}else{const t=o.filter(e=>bb(e)||_b(i,e));this._applyQuote(e,t)}})}_getValue(){const e=this.editor.model.document.selection;const t=gb(e.getSelectedBlocks());return!!(t&&bb(t))}_checkEnabled(){if(this.value){return true}const e=this.editor.model.document.selection;const t=this.editor.model.schema;const i=gb(e.getSelectedBlocks());if(!i){return false}return _b(t,i)}_removeQuote(e,t){wb(e,t).reverse().forEach(t=>{if(t.start.isAtStart&&t.end.isAtEnd){e.unwrap(t.start.parent);return}if(t.start.isAtStart){const i=e.createPositionBefore(t.start.parent);e.move(t,i);return}if(!t.end.isAtEnd){e.split(t.end)}const i=e.createPositionAfter(t.end.parent);e.move(t,i)})}_applyQuote(e,t){const i=[];wb(e,t).reverse().forEach(t=>{let n=bb(t.start);if(!n){n=e.createElement(\"blockQuote\");e.wrap(t,n)}i.push(n)});i.reverse().reduce((t,i)=>{if(t.nextSibling==i){e.merge(e.createPositionAfter(t));return t}return i})}}function bb(e){return e.parent.name==\"blockQuote\"?e.parent:null}function wb(e,t){let i;let n=0;const o=[];while(n{if(e.endsWith(\"blockQuote\")&&t.name==\"blockQuote\"){return false}});e.conversion.elementToElement({model:\"blockQuote\",view:\"blockquote\"});e.model.document.registerPostFixer(i=>{const n=e.model.document.differ.getChanges();for(const e of n){if(e.type==\"insert\"){const n=e.position.nodeAfter;if(!n){continue}if(n.is(\"blockQuote\")&&n.isEmpty){i.remove(n);return true}else if(n.is(\"blockQuote\")&&!t.checkChild(e.position,n)){i.unwrap(n);return true}else if(n.is(\"element\")){const e=i.createRangeIn(n);for(const n of e.getItems()){if(n.is(\"blockQuote\")&&!t.checkChild(i.createPositionBefore(n),n)){i.unwrap(n);return true}}}}else if(e.type==\"remove\"){const t=e.position.parent;if(t.is(\"blockQuote\")&&t.isEmpty){i.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,i)=>{const n=this.editor.model.document;const o=n.selection.getLastPosition().parent;if(n.selection.isCollapsed&&o.isEmpty&&t.value){this.editor.execute(\"blockQuote\");this.editor.editing.view.scrollToTheSelection();i.preventDefault();e.stop()}})}}var kb='';var yb=i(45);class xb extends db{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(\"blockQuote\",i=>{const n=e.commands.get(\"blockQuote\");const o=new Sp(i);o.set({label:t(\"g\"),icon:kb,tooltip:true,isToggleable:true});o.bind(\"isOn\",\"isEnabled\").to(n,\"value\",\"isEnabled\");this.listenTo(o,\"execute\",()=>e.execute(\"blockQuote\"));return o})}}class Ab extends db{static get requires(){return[vb,xb]}static get pluginName(){return\"BlockQuote\"}}class Cb extends fb{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 i=t.document;const n=i.selection;const o=e.forceValue===undefined?!this.value:e.forceValue;t.change(e=>{if(n.isCollapsed){if(o){e.setSelectionAttribute(this.attributeKey,true)}else{e.removeSelectionAttribute(this.attributeKey)}}else{const i=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const t of i){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 i=e.document.selection;if(i.isCollapsed){return i.hasAttribute(this.attributeKey)}for(const e of i.getRanges()){for(const i of e.getItems()){if(t.checkAttribute(i,this.attributeKey)){return i.hasAttribute(this.attributeKey)}}}return false}}const Tb=\"bold\";class Mb extends db{static get pluginName(){return\"BoldEditing\"}init(){const e=this.editor;e.model.schema.extend(\"$text\",{allowAttributes:Tb});e.model.schema.setAttributeProperties(Tb,{isFormatting:true,copyOnEnter:true});e.conversion.attributeToElement({model:Tb,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(Tb,new Cb(e,Tb));e.keystrokes.set(\"CTRL+B\",Tb)}}var Pb='';const Eb=\"bold\";class Sb extends db{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(Eb,i=>{const n=e.commands.get(Eb);const o=new Sp(i);o.set({label:t(\"n\"),icon:Pb,keystroke:\"CTRL+B\",tooltip:true,isToggleable:true});o.bind(\"isOn\",\"isEnabled\").to(n,\"value\",\"isEnabled\");this.listenTo(o,\"execute\",()=>e.execute(Eb));return o})}}class Ib extends db{static get requires(){return[Mb,Sb]}static get pluginName(){return\"Bold\"}}var Ob='';class Nb extends db{static get pluginName(){return\"CKFinderUI\"}init(){const e=this.editor;const t=e.ui.componentFactory;const i=e.t;t.add(\"ckfinder\",t=>{const n=e.commands.get(\"ckfinder\");const o=new Sp(t);o.set({label:i(\"h\"),icon:Ob,tooltip:true});o.bind(\"isEnabled\").to(n);o.on(\"execute\",()=>{e.execute(\"ckfinder\");e.editing.view.focus()});return o})}}class Lb extends _l{observe(e){this.listenTo(e,\"load\",(e,t)=>{const i=t.target;if(i.tagName==\"IMG\"){this._fireEvents(t)}},{useCapture:true})}_fireEvents(e){if(this.isEnabled){this.document.fire(\"layoutChanged\");this.document.fire(\"imageLoaded\",e)}}}function Rb(){return t=>{t.on(\"element:figure\",e)};function e(e,t,i){if(!i.consumable.test(t.viewItem,{name:true,classes:\"image\"})){return}const n=Array.from(t.viewItem.getChildren()).find(e=>e.is(\"img\"));if(!n||!n.hasAttribute(\"src\")||!i.consumable.test(n,{name:true})){return}const o=i.convertItem(n,t.modelCursor);const s=gb(o.modelRange.getItems());if(!s){return}i.convertChildren(t.viewItem,i.writer.createPositionAt(s,0));t.modelRange=o.modelRange;t.modelCursor=o.modelCursor}}function zb(){return t=>{t.on(\"attribute:srcset:image\",e)};function e(e,t,i){if(!i.consumable.consume(t.item,e.name)){return}const n=i.writer;const o=i.mapper.toViewElement(t.item);const s=o.getChild(0);if(t.attributeNewValue===null){const e=t.attributeOldValue;if(e.data){n.removeAttribute(\"srcset\",s);n.removeAttribute(\"sizes\",s);if(e.width){n.removeAttribute(\"width\",s)}}}else{const e=t.attributeNewValue;if(e.data){n.setAttribute(\"srcset\",e.data,s);n.setAttribute(\"sizes\",\"100vw\",s);if(e.width){n.setAttribute(\"width\",e.width,s)}}}}}function jb(e){return i=>{i.on(`attribute:${e}:image`,t)};function t(e,t,i){if(!i.consumable.consume(t.item,e.name)){return}const n=i.writer;const o=i.mapper.toViewElement(t.item);const s=o.getChild(0);if(t.attributeNewValue!==null){n.setAttribute(t.attributeKey,t.attributeNewValue,s)}else{n.removeAttribute(t.attributeKey,s)}}}class Db{constructor(){this._stack=[]}add(e,t){const i=this._stack;const n=i[0];this._insertDescriptor(e);const o=i[0];if(n!==o&&!Bb(n,o)){this.fire(\"change:top\",{oldDescriptor:n,newDescriptor:o,writer:t})}}remove(e,t){const i=this._stack;const n=i[0];this._removeDescriptor(e);const o=i[0];if(n!==o&&!Bb(n,o)){this.fire(\"change:top\",{oldDescriptor:n,newDescriptor:o,writer:t})}}_insertDescriptor(e){const t=this._stack;const i=t.findIndex(t=>t.id===e.id);if(Bb(e,t[i])){return}if(i>-1){t.splice(i,1)}let n=0;while(t[n]&&Vb(t[n],e)){n++}t.splice(n,0,e)}_removeDescriptor(e){const t=this._stack;const i=t.findIndex(t=>t.id===e);if(i>-1){t.splice(i,1)}}}vr(Db,lr);function Bb(e,t){return e&&t&&e.priority==t.priority&&Fb(e.classes)==Fb(t.classes)}function Vb(e,t){if(e.priority>t.priority){return true}else if(e.priorityFb(t.classes)}function Fb(e){return Array.isArray(e)?e.sort().join(\",\"):e}var Hb='';const Ub=\"ck-widget\";const Wb=\"ck-widget_selected\";function $b(e){if(!e.is(\"element\")){return false}return!!e.getCustomProperty(\"widget\")}function qb(e,t,i={}){if(!Xa.isEdge){t.setAttribute(\"contenteditable\",\"false\",e)}t.addClass(Ub,e);t.setCustomProperty(\"widget\",true,e);e.getFillerOffset=Zb;if(i.label){Gb(e,i.label,t)}if(i.hasSelectionHandle){ew(e,t)}Yb(e,t,(e,t,i)=>i.addClass(n(t.classes),e),(e,t,i)=>i.removeClass(n(t.classes),e));return e;function n(e){return Array.isArray(e)?e:[e]}}function Yb(e,t,i,n){const o=new Db;o.on(\"change:top\",(t,o)=>{if(o.oldDescriptor){n(e,o.oldDescriptor,o.writer)}if(o.newDescriptor){i(e,o.newDescriptor,o.writer)}});t.setCustomProperty(\"addHighlight\",(e,t,i)=>o.add(t,i),e);t.setCustomProperty(\"removeHighlight\",(e,t,i)=>o.remove(t,i),e)}function Gb(e,t,i){i.setCustomProperty(\"widgetLabel\",t,e)}function Jb(e){const t=e.getCustomProperty(\"widgetLabel\");if(!t){return\"\"}return typeof t==\"function\"?t():t}function Kb(e,t){t.addClass([\"ck-editor__editable\",\"ck-editor__nested-editable\"],e);if(!Xa.isEdge){t.setAttribute(\"contenteditable\",e.isReadOnly?\"false\":\"true\",e);e.on(\"change:isReadOnly\",(i,n,o)=>{t.setAttribute(\"contenteditable\",o?\"false\":\"true\",e)})}e.on(\"change:isFocused\",(i,n,o)=>{if(o){t.addClass(\"ck-editor__nested-editable_focused\",e)}else{t.removeClass(\"ck-editor__nested-editable_focused\",e)}});return e}function Xb(e,t){const i=e.getSelectedElement();if(i&&t.schema.isBlock(i)){return t.createPositionAfter(i)}const n=e.getSelectedBlocks().next().value;if(n){if(n.isEmpty){return t.createPositionAt(n,0)}const i=t.createPositionAfter(n);if(e.focus.isTouching(i)){return i}return t.createPositionBefore(n)}return e.focus}function Qb(e,t){return(i,n)=>{const{mapper:o,viewPosition:s}=n;const r=o.findMappedViewAncestor(s);if(!t(r)){return}const a=o.toModelElement(r);n.modelPosition=e.createPositionAt(a,s.isAtStart?\"before\":\"after\")}}function Zb(){return null}function ew(e,t){const i=t.createUIElement(\"div\",{class:\"ck ck-widget__selection-handle\"},(function(e){const t=this.toDomElement(e);const i=new Tp;i.set(\"content\",Hb);i.render();t.appendChild(i.element);return t}));t.insert(t.createPositionAt(e,0),i);t.addClass([\"ck-widget_with-selection-handle\"],e)}function tw(e,t,i){t.setCustomProperty(\"image\",true,e);return qb(e,t,{label:n});function n(){const t=e.getChild(0);const n=t.getAttribute(\"alt\");return n?`${n} ${i}`:i}}function iw(e){return!!e.getCustomProperty(\"image\")&&$b(e)}function nw(e){const t=e.getSelectedElement();if(t&&iw(t)){return t}return null}function ow(e){return!!e&&e.is(\"image\")}function sw(e,t,i={}){const n=e.createElement(\"image\",i);const o=Xb(t.document.selection,t);t.insertContent(n,o);if(n.parent){e.setSelection(n,\"on\")}}function rw(e){const t=e.schema;const i=e.document.selection;return aw(i,t,e)&&!cw(i,t)&&lw(i)}function aw(e,t,i){const n=dw(e,i);return t.checkChild(n,\"image\")}function cw(e,t){const i=e.getSelectedElement();return i&&t.isObject(i)}function lw(e){return[...e.focus.getAncestors()].every(e=>!e.is(\"image\"))}function dw(e,t){const i=Xb(e,t);const n=i.parent;if(n.isEmpty&&!n.is(\"$root\")){return n.parent}return n}class uw extends fb{refresh(){this.isEnabled=rw(this.editor.model)}execute(e){const t=this.editor.model;t.change(i=>{const n=Array.isArray(e.source)?e.source:[e.source];for(const e of n){sw(i,t,{src:e})}})}}class hw extends db{static get pluginName(){return\"ImageEditing\"}init(){const e=this.editor;const t=e.model.schema;const i=e.t;const n=e.conversion;e.editing.view.addObserver(Lb);t.register(\"image\",{isObject:true,isBlock:true,allowWhere:\"$block\",allowAttributes:[\"alt\",\"src\",\"srcset\"]});n.for(\"dataDowncast\").elementToElement({model:\"image\",view:(e,t)=>fw(t)});n.for(\"editingDowncast\").elementToElement({model:\"image\",view:(e,t)=>tw(fw(t),t,i(\"u\"))});n.for(\"downcast\").add(jb(\"src\")).add(jb(\"alt\")).add(zb());n.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(Rb());e.commands.add(\"imageInsert\",new uw(e))}}function fw(e){const t=e.createEmptyElement(\"img\");const i=e.createContainerElement(\"figure\",{class:\"image\"});e.insert(e.createPositionAt(i,0),t);return i}function mw(e,t,i){return i.createRange(gw(e,t,true,i),gw(e,t,false,i))}function gw(e,t,i,n){let o=e.textNode||(i?e.nodeBefore:e.nodeAfter);let s=null;while(o&&o.getAttribute(\"linkHref\")==t){s=o;o=i?o.previousSibling:o.nextSibling}return s?n.createPositionAt(s,i?\"before\":\"after\"):e}class pw extends fb{constructor(e){super(e);this.manualDecorators=new Fa}restoreManualDecoratorStates(){for(const e of this.manualDecorators){e.value=this._getDecoratorStateFromModel(e.id)}}refresh(){const e=this.editor.model;const t=e.document;this.value=t.selection.getAttribute(\"linkHref\");for(const e of this.manualDecorators){e.value=this._getDecoratorStateFromModel(e.id)}this.isEnabled=e.schema.checkAttributeInSelection(t.selection,\"linkHref\")}execute(e,t={}){const i=this.editor.model;const n=i.document.selection;const o=[];const s=[];for(const e in t){if(t[e]){o.push(e)}else{s.push(e)}}i.change(t=>{if(n.isCollapsed){const r=n.getFirstPosition();if(n.hasAttribute(\"linkHref\")){const a=mw(r,n.getAttribute(\"linkHref\"),i);t.setAttribute(\"linkHref\",e,a);o.forEach(e=>{t.setAttribute(e,true,a)});s.forEach(e=>{t.removeAttribute(e,a)});t.setSelection(a)}else if(e!==\"\"){const s=hu(n.getAttributes());s.set(\"linkHref\",e);o.forEach(e=>{s.set(e,true)});const a=t.createText(e,s);i.insertContent(a,r);t.setSelection(t.createRangeOn(a))}}else{const r=i.schema.getValidRanges(n.getRanges(),\"linkHref\");for(const i of r){t.setAttribute(\"linkHref\",e,i);o.forEach(e=>{t.setAttribute(e,true,i)});s.forEach(e=>{t.removeAttribute(e,i)})}}})}_getDecoratorStateFromModel(e){const t=this.editor.model.document;return t.selection.getAttribute(e)||false}}class bw extends fb{refresh(){this.isEnabled=this.editor.model.document.selection.hasAttribute(\"linkHref\")}execute(){const e=this.editor;const t=this.editor.model;const i=t.document.selection;const n=e.commands.get(\"link\");t.change(e=>{const o=i.isCollapsed?[mw(i.getFirstPosition(),i.getAttribute(\"linkHref\"),t)]:i.getRanges();for(const t of o){e.removeAttribute(\"linkHref\",t);if(n){for(const i of n.manualDecorators){e.removeAttribute(i.id,t)}}}})}}function ww(e,t,i){var n=-1,o=e.length;if(t<0){t=-t>o?0:o+t}i=i>o?o:i;if(i<0){i+=o}o=t>i?0:i-t>>>0;t>>>=0;var s=Array(o);while(++n=n?e:_w(e,t,i)}var kw=vw;var yw=\"\\\\ud800-\\\\udfff\",xw=\"\\\\u0300-\\\\u036f\",Aw=\"\\\\ufe20-\\\\ufe2f\",Cw=\"\\\\u20d0-\\\\u20ff\",Tw=xw+Aw+Cw,Mw=\"\\\\ufe0e\\\\ufe0f\";var Pw=\"\\\\u200d\";var Ew=RegExp(\"[\"+Pw+yw+Tw+Mw+\"]\");function Sw(e){return Ew.test(e)}var Iw=Sw;function Ow(e){return e.split(\"\")}var Nw=Ow;var Lw=\"\\\\ud800-\\\\udfff\",Rw=\"\\\\u0300-\\\\u036f\",zw=\"\\\\ufe20-\\\\ufe2f\",jw=\"\\\\u20d0-\\\\u20ff\",Dw=Rw+zw+jw,Bw=\"\\\\ufe0e\\\\ufe0f\";var Vw=\"[\"+Lw+\"]\",Fw=\"[\"+Dw+\"]\",Hw=\"\\\\ud83c[\\\\udffb-\\\\udfff]\",Uw=\"(?:\"+Fw+\"|\"+Hw+\")\",Ww=\"[^\"+Lw+\"]\",$w=\"(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}\",qw=\"[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]\",Yw=\"\\\\u200d\";var Gw=Uw+\"?\",Jw=\"[\"+Bw+\"]?\",Kw=\"(?:\"+Yw+\"(?:\"+[Ww,$w,qw].join(\"|\")+\")\"+Jw+Gw+\")*\",Xw=Jw+Gw+Kw,Qw=\"(?:\"+[Ww+Fw+\"?\",Fw,$w,qw,Vw].join(\"|\")+\")\";var Zw=RegExp(Hw+\"(?=\"+Hw+\")|\"+Qw+Xw,\"g\");function e_(e){return e.match(Zw)||[]}var t_=e_;function i_(e){return Iw(e)?t_(e):Nw(e)}var n_=i_;function o_(e,t){var i=-1,n=e==null?0:e.length,o=Array(n);while(++i{if(e.label&&i[e.label]){e.label=i[e.label]}return e});return t}function A_(e){const t=[];if(e){for(const[i,n]of Object.entries(e)){const e=Object.assign({},n,{id:`link${p_(i)}`});t.push(e)}}return t}class C_{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,i)=>{if(!i.consumable.test(t.item,\"attribute:linkHref\")){return}const n=i.writer;const o=n.document.selection;for(const e of this._definitions){const s=n.createAttributeElement(\"a\",e.attributes,{priority:5});n.setCustomProperty(\"link\",true,s);if(e.callback(t.attributeNewValue)){if(t.item.is(\"selection\")){n.wrap(o.getFirstRange(),s)}else{n.wrap(i.mapper.toViewRange(t.range),s)}}else{n.unwrap(i.mapper.toViewRange(t.range),s)}}},{priority:\"high\"})}}}class T_{constructor({id:e,label:t,attributes:i}){this.id=e;this.set(\"value\");this.label=t;this.attributes=i}}vr(T_,_a);function M_({view:e,model:t,emitter:i,attribute:n,locale:o}){const s=new P_(t,i,n);const r=t.document.selection;i.listenTo(e.document,\"keydown\",(e,t)=>{if(!r.isCollapsed){return}if(t.shiftKey||t.altKey||t.ctrlKey){return}const i=t.keyCode==rc.arrowright;const n=t.keyCode==rc.arrowleft;if(!i&&!n){return}const a=r.getFirstPosition();const c=o.contentLanguageDirection;let l;if(c===\"ltr\"&&i||c===\"rtl\"&&n){l=s.handleForwardMovement(a,t)}else{l=s.handleBackwardMovement(a,t)}if(l){e.stop()}},{priority:or.get(\"high\")+1})}class P_{constructor(e,t,i){this.model=e;this.attribute=i;this._modelSelection=e.document.selection;this._overrideUid=null;this._isNextGravityRestorationSkipped=false;t.listenTo(this._modelSelection,\"change:range\",(e,t)=>{if(this._isNextGravityRestorationSkipped){this._isNextGravityRestorationSkipped=false;return}if(!this._isGravityOverridden){return}if(!t.directChange&&E_(this._modelSelection.getFirstPosition(),i)){return}this._restoreGravity()})}handleForwardMovement(e,t){const i=this.attribute;if(this._isGravityOverridden){return}if(e.isAtStart&&this._hasSelectionAttribute){return}if(O_(e,i)&&this._hasSelectionAttribute){this._preventCaretMovement(t);this._removeSelectionAttribute();return true}if(S_(e,i)){this._preventCaretMovement(t);this._overrideGravity();return true}if(I_(e,i)&&this._hasSelectionAttribute){this._preventCaretMovement(t);this._overrideGravity();return true}}handleBackwardMovement(e,t){const i=this.attribute;if(this._isGravityOverridden){if(O_(e,i)&&this._hasSelectionAttribute){this._preventCaretMovement(t);this._restoreGravity();this._removeSelectionAttribute();return true}else{this._preventCaretMovement(t);this._restoreGravity();if(e.isAtStart){this._removeSelectionAttribute()}return true}}else{if(O_(e,i)&&!this._hasSelectionAttribute){this._preventCaretMovement(t);this._setSelectionAttributeFromTheNodeBefore(e);return true}if(e.isAtEnd&&I_(e,i)){if(this._hasSelectionAttribute){if(N_(e,i)){this._skipNextAutomaticGravityRestoration();this._overrideGravity()}return}else{this._preventCaretMovement(t);this._setSelectionAttributeFromTheNodeBefore(e);return true}}if(e.isAtStart){if(this._hasSelectionAttribute){this._removeSelectionAttribute();this._preventCaretMovement(t);return true}return}if(N_(e,i)){this._skipNextAutomaticGravityRestoration();this._overrideGravity()}}}get _isGravityOverridden(){return!!this._overrideUid}get _hasSelectionAttribute(){return this._modelSelection.hasAttribute(this.attribute)}_overrideGravity(){this._overrideUid=this.model.change(e=>e.overrideSelectionGravity())}_restoreGravity(){this.model.change(e=>{e.restoreSelectionGravity(this._overrideUid);this._overrideUid=null})}_preventCaretMovement(e){e.preventDefault()}_removeSelectionAttribute(){this.model.change(e=>{e.removeSelectionAttribute(this.attribute)})}_setSelectionAttributeFromTheNodeBefore(e){const t=this.attribute;this.model.change(i=>{i.setSelectionAttribute(this.attribute,e.nodeBefore.getAttribute(t))})}_skipNextAutomaticGravityRestoration(){this._isNextGravityRestorationSkipped=true}}function E_(e,t){return S_(e,t)||I_(e,t)}function S_(e,t){const{nodeBefore:i,nodeAfter:n}=e;const o=i?i.hasAttribute(t):false;const s=n?n.hasAttribute(t):false;return s&&(!o||i.getAttribute(t)!==n.getAttribute(t))}function I_(e,t){const{nodeBefore:i,nodeAfter:n}=e;const o=i?i.hasAttribute(t):false;const s=n?n.hasAttribute(t):false;return o&&(!s||i.getAttribute(t)!==n.getAttribute(t))}function O_(e,t){const{nodeBefore:i,nodeAfter:n}=e;const o=i?i.hasAttribute(t):false;const s=n?n.hasAttribute(t):false;if(!s||!o){return}return n.getAttribute(t)!==i.getAttribute(t)}function N_(e,t){return E_(e.getShiftedBy(-1),t)}var L_=i(47);const R_=\"ck-link_selected\";const z_=\"automatic\";const j_=\"manual\";const D_=/^(https?:)?\\/\\//;class B_ extends db{static get pluginName(){return\"LinkEditing\"}constructor(e){super(e);e.config.define(\"link\",{addTargetToExternalLinks:false})}init(){const e=this.editor;const t=e.locale;e.model.schema.extend(\"$text\",{allowAttributes:\"linkHref\"});e.conversion.for(\"dataDowncast\").attributeToElement({model:\"linkHref\",view:v_});e.conversion.for(\"editingDowncast\").attributeToElement({model:\"linkHref\",view:(e,t)=>v_(k_(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 pw(e));e.commands.add(\"unlink\",new bw(e));const i=x_(e.t,A_(e.config.get(\"link.decorators\")));this._enableAutomaticDecorators(i.filter(e=>e.mode===z_));this._enableManualDecorators(i.filter(e=>e.mode===j_));M_({view:e.editing.view,model:e.model,emitter:this,attribute:\"linkHref\",locale:t});this._setupLinkHighlight()}_enableAutomaticDecorators(e){const t=this.editor;const i=new C_;if(t.config.get(\"link.addTargetToExternalLinks\")){i.add({id:\"linkIsExternal\",mode:z_,callback:e=>D_.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 i=t.commands.get(\"link\");const n=i.manualDecorators;e.forEach(e=>{t.model.schema.extend(\"$text\",{allowAttributes:e.id});n.add(new T_(e));t.conversion.for(\"downcast\").attributeToElement({model:e.id,view:(t,i)=>{if(t){const t=n.get(e.id).attributes;const o=i.createAttributeElement(\"a\",t,{priority:5});i.setCustomProperty(\"link\",true,o);return o}}});t.conversion.for(\"upcast\").elementToAttribute({view:{name:\"a\",attributes:n.get(e.id).attributes},model:{key:e.id}})})}_setupLinkHighlight(){const e=this.editor;const t=e.editing.view;const i=new Set;t.document.registerPostFixer(t=>{const n=e.model.document.selection;let o=false;if(n.hasAttribute(\"linkHref\")){const s=mw(n.getFirstPosition(),n.getAttribute(\"linkHref\"),e.model);const r=e.editing.mapper.toViewRange(s);for(const e of r.getItems()){if(e.is(\"a\")&&!e.hasClass(R_)){t.addClass(R_,e);i.add(e);o=true}}}return o});e.conversion.for(\"editingDowncast\").add(e=>{e.on(\"insert\",n,{priority:\"highest\"});e.on(\"remove\",n,{priority:\"highest\"});e.on(\"attribute\",n,{priority:\"highest\"});e.on(\"selection\",n,{priority:\"highest\"});function n(){t.change(e=>{for(const t of i.values()){e.removeClass(R_,t);i.delete(t)}})}})}}class V_ extends db{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 F_ extends fb{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 Qs[\"b\"]('ckfinder-unknown-openerMethod: The openerMethod config option must by \"popup\" or \"modal\".',e)}const i=this.editor.config.get(\"ckfinder.options\")||{};i.chooseFiles=true;const n=i.onInit;if(!i.language){i.language=e.locale.uiLanguage}i.onInit=t=>{if(n){n(t)}t.on(\"files:choose\",i=>{const n=i.data.files.toArray();const o=n.filter(e=>!e.isImage());const s=n.filter(e=>e.isImage());for(const t of o){e.execute(\"link\",t.getUrl())}const r=[];for(const e of s){const i=e.getUrl();r.push(i?i:t.request(\"file:getProxyUrl\",{file:e}))}if(r.length){H_(e,r)}});t.on(\"file:choose:resizedImage\",t=>{const i=t.data.resizedUrl;if(!i){const t=e.plugins.get(\"Notification\");const i=e.locale.t;t.showWarning(i(\"by\"),{title:i(\"bz\"),namespace:\"ckfinder\"});return}H_(e,[i])})};window.CKFinder[t](i)}}function H_(e,t){const i=e.commands.get(\"imageInsert\");if(!i.isEnabled){const t=e.plugins.get(\"Notification\");const i=e.locale.t;t.showWarning(i(\"ca\"),{title:i(\"cb\"),namespace:\"ckfinder\"});return}e.execute(\"imageInsert\",{source:t})}class U_ extends db{static get pluginName(){return\"CKFinderEditing\"}static get requires(){return[V_,hw,B_]}init(){const e=this.editor;e.commands.add(\"ckfinder\",new F_(e))}}class W_ extends db{static get pluginName(){return\"PendingActions\"}init(){this.set(\"hasAny\",false);this._actions=new Fa({idProperty:\"_id\"});this._actions.delegate(\"add\",\"remove\").to(this)}add(e){if(typeof e!==\"string\"){throw new Qs[\"b\"](\"pendingactions-add-invalid-message: The message must be a string.\",this)}const t=Object.create(_a);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 $_{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((i,n)=>{t.onload=()=>{const e=t.result;this._data=e;i(e)};t.onerror=()=>{n(\"error\")};t.onabort=()=>{n(\"aborted\")};this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}vr($_,_a);class q_ extends db{static get pluginName(){return\"FileRepository\"}static get requires(){return[W_]}init(){this.loaders=new Fa;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(Qs[\"a\"])(\"filerepository-no-upload-adapter: Upload adapter is not defined.\"));return null}const t=new Y_(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 Y_?e:this.getLoader(e);t._destroy();this.loaders.remove(t);this._loadersMap.forEach((e,i)=>{if(e===t){this._loadersMap.delete(i)}})}_updatePendingAction(){const e=this.editor.plugins.get(W_);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t;const i=e=>`${t(\"ad\")} ${parseInt(e)}%.`;this._pendingAction=e.add(i(this.uploadedPercent));this._pendingAction.bind(\"message\").to(this,\"uploadedPercent\",i)}}else{e.remove(this._pendingAction);this._pendingAction=null}}}vr(q_,_a);class Y_{constructor(e,t){this.id=ir();this._filePromiseWrapper=this._createFilePromiseWrapper(e);this._adapter=t(this);this._reader=new $_;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 Qs[\"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 Qs[\"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((i,n)=>{t.rejecter=n;t.isFulfilled=false;e.then(e=>{t.isFulfilled=true;i(e)}).catch(e=>{t.isFulfilled=true;n(e)})});return t}}vr(Y_,_a);const G_=\"ckCsrfToken\";const J_=40;const K_=\"abcdefghijklmnopqrstuvwxyz0123456789\";function X_(){let e=Q_(G_);if(!e||e.length!=J_){e=ev(J_);Z_(G_,e)}return e}function Q_(e){e=e.toLowerCase();const t=document.cookie.split(\";\");for(const i of t){const t=i.split(\"=\");const n=decodeURIComponent(t[0].trim().toLowerCase());if(n===e){return decodeURIComponent(t[1])}}return null}function Z_(e,t){document.cookie=encodeURIComponent(e)+\"=\"+encodeURIComponent(t)+\";path=/\"}function ev(e){let t=\"\";const i=new Uint8Array(e);window.crypto.getRandomValues(i);for(let e=0;e.5?n.toUpperCase():n}return t}class tv extends db{static get requires(){return[q_]}static get pluginName(){return\"CKFinderUploadAdapter\"}init(){const e=this.editor.config.get(\"ckfinder.uploadUrl\");if(!e){return}this.editor.plugins.get(q_).createUploadAdapter=t=>new iv(t,e,this.editor.t)}}class iv{constructor(e,t,i){this.loader=e;this.url=t;this.t=i}upload(){return this.loader.file.then(e=>new Promise((t,i)=>{this._initRequest();this._initListeners(t,i,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,i){const n=this.xhr;const o=this.loader;const s=this.t;const r=s(\"a\")+` ${i.name}.`;n.addEventListener(\"error\",()=>t(r));n.addEventListener(\"abort\",()=>t());n.addEventListener(\"load\",()=>{const i=n.response;if(!i||!i.uploaded){return t(i&&i.error&&i.error.message?i.error.message:r)}e({default:i.url})});if(n.upload){n.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\",X_());this.xhr.send(t)}}class nv extends db{static get pluginName(){return\"CKFinder\"}static get requires(){return[U_,Nb,tv]}}class ov extends fb{refresh(){const e=this.editor.model;const t=e.document;const i=gb(t.selection.getSelectedBlocks());this.value=!!i&&i.is(\"paragraph\");this.isEnabled=!!i&&sv(i,e.schema)}execute(e={}){const t=this.editor.model;const i=t.document;t.change(n=>{const o=(e.selection||i.selection).getSelectedBlocks();for(const e of o){if(!e.is(\"paragraph\")&&sv(e,t.schema)){n.rename(e,\"paragraph\")}}})}}function sv(e,t){return t.checkChild(e.parent,\"paragraph\")&&!t.isObject(e)}class rv extends db{static get pluginName(){return\"Paragraph\"}init(){const e=this.editor;const t=e.model;const i=e.data;e.commands.add(\"paragraph\",new ov(e));t.schema.register(\"paragraph\",{inheritAllFrom:\"$block\"});e.conversion.elementToElement({model:\"paragraph\",view:\"p\"});e.conversion.for(\"upcast\").elementToElement({model:(e,t)=>{if(!rv.paragraphLikeElements.has(e.name)){return null}if(e.isEmpty){return null}return t.createElement(\"paragraph\")},converterPriority:\"low\"});i.upcastDispatcher.on(\"element\",(e,t,i)=>{if(!i.consumable.test(t.viewItem,{name:t.viewItem.name})){return}if(cv(t.viewItem,t.modelCursor,i.schema)){Object.assign(t,av(t.viewItem,t.modelCursor,i))}},{priority:\"low\"});i.upcastDispatcher.on(\"text\",(e,t,i)=>{if(t.modelRange){return}if(cv(t.viewItem,t.modelCursor,i.schema)){Object.assign(t,av(t.viewItem,t.modelCursor,i))}},{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 i of t.document.getRootNames()){const n=t.document.getRoot(i);if(n.isEmpty&&n.rootName!=\"$graveyard\"){if(t.schema.checkChild(n,\"paragraph\")){e.insertElement(\"paragraph\",n);return true}}}}}rv.paragraphLikeElements=new Set([\"blockquote\",\"dd\",\"div\",\"dt\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"li\",\"p\",\"td\"]);function av(e,t,i){const n=i.writer.createElement(\"paragraph\");i.writer.insert(n,t);return i.convertItem(e,i.writer.createPositionAt(n,0))}function cv(e,t,i){const n=i.createContext(t);if(!i.checkChild(n,\"paragraph\")){return false}if(!i.checkChild(n.push(\"paragraph\"),e)){return false}return true}class lv extends fb{constructor(e,t){super(e);this.modelElements=t}refresh(){const e=gb(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name;this.isEnabled=!!e&&this.modelElements.some(t=>dv(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model;const i=t.document;const n=e.value;t.change(e=>{const o=Array.from(i.selection.getSelectedBlocks()).filter(e=>dv(e,n,t.schema));for(const t of o){if(!t.is(n)){e.rename(t,n)}}})}}function dv(e,t,i){return i.checkChild(e.parent,t)&&!i.isObject(e)}const uv=\"paragraph\";class hv extends db{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[rv]}init(){const e=this.editor;const t=e.config.get(\"heading.options\");const i=[];for(const n of t){if(n.model!==uv){e.model.schema.register(n.model,{inheritAllFrom:\"$block\"});e.conversion.elementToElement(n);i.push(n.model)}}this._addDefaultH1Conversion(e);e.commands.add(\"heading\",new lv(e,i))}afterInit(){const e=this.editor;const t=e.commands.get(\"enter\");const i=e.config.get(\"heading.options\");if(t){this.listenTo(t,\"afterExecute\",(t,n)=>{const o=e.model.document.selection.getFirstPosition().parent;const s=i.some(e=>o.is(e.model));if(s&&!o.is(uv)&&o.childCount===0){n.writer.rename(o,uv)}})}}_addDefaultH1Conversion(e){e.conversion.for(\"upcast\").elementToElement({model:\"heading1\",view:\"h1\",converterPriority:or.get(\"low\")+1})}}class fv{constructor(e,t){if(t){ma(this,t)}if(e){this.set(e)}}}vr(fv,_a);function mv(e){const t=e.t;const i={Paragraph:t(\"dj\"),\"Heading 1\":t(\"dk\"),\"Heading 2\":t(\"dl\"),\"Heading 3\":t(\"dm\"),\"Heading 4\":t(\"dn\"),\"Heading 5\":t(\"do\"),\"Heading 6\":t(\"dp\")};return e.config.get(\"heading.options\").map(e=>{const t=i[e.title];if(t&&t!=e.title){e.title=t}return e})}var gv=i(10);class pv extends db{init(){const e=this.editor;const t=e.t;const i=mv(e);const n=t(\"i\");const o=t(\"j\");e.ui.componentFactory.add(\"heading\",t=>{const s={};const r=new Fa;const a=e.commands.get(\"heading\");const c=e.commands.get(\"paragraph\");const l=[a];for(const e of i){const t={type:\"button\",model:new fv({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})}r.add(t);s[e.model]=e.title}const d=Hp(t);Wp(d,r);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 i=e||t&&\"paragraph\";return s[i]?s[i]:n});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 bv extends db{static get requires(){return[hv,pv]}static get pluginName(){return\"Heading\"}}class wv extends kd{constructor(e){super(e);this.domEventType=\"mousedown\"}onDomEvent(e){this.fire(e.type,e)}}var _v=i(50);const vv=cc(\"Ctrl+A\");class kv extends db{static get pluginName(){return\"Widget\"}init(){const e=this.editor.editing.view;const t=e.document;this._previouslySelected=new Set;this.editor.editing.downcastDispatcher.on(\"selection\",(e,t,i)=>{this._clearPreviouslySelectedWidgets(i.writer);const n=i.writer;const o=n.document.selection;const s=o.getSelectedElement();let r=null;for(const e of o.getRanges()){for(const t of e){const e=t.item;if($b(e)&&!Cv(e,r)){n.addClass(Wb,e);this._previouslySelected.add(e);r=e;if(e==s){n.setSelection(o.getRanges(),{fake:true,label:Jb(s)})}}}}},{priority:\"low\"});e.addObserver(wv);this.listenTo(t,\"mousedown\",(...e)=>this._onMousedown(...e));this.listenTo(t,\"keydown\",(...e)=>this._onKeydown(...e),{priority:\"high\"});this.listenTo(t,\"delete\",(e,t)=>{if(this._handleDelete(t.direction==\"forward\")){t.preventDefault();e.stop()}},{priority:\"high\"})}_onMousedown(e,t){const i=this.editor;const n=i.editing.view;const o=n.document;let s=t.target;if(Av(s)){if(Xa.isSafari&&t.domEvent.detail>=3){const e=i.editing.mapper;const n=e.toModelElement(s);this.editor.model.change(e=>{t.preventDefault();e.setSelection(n,\"in\")})}return}if(!$b(s)){s=s.findAncestor($b);if(!s){return}}t.preventDefault();if(!o.isFocused){n.focus()}const r=i.editing.mapper.toModelElement(s);this._setSelectionOverElement(r)}_onKeydown(e,t){const i=t.keyCode;const n=this.editor.locale.contentLanguageDirection===\"ltr\";const o=i==rc.arrowdown||i==rc[n?\"arrowright\":\"arrowleft\"];let s=false;if(yv(i)){s=this._handleArrowKeys(o)}else if(xv(t)){s=this._selectAllNestedEditableContent()||this._selectAllContent()}else if(i===rc.enter){s=this._handleEnterKey(t.shiftKey)}if(s){t.preventDefault();e.stop()}}_handleDelete(e){if(this.editor.isReadOnly){return}const t=this.editor.model.document;const i=t.selection;if(!i.isCollapsed){return}const n=this._getObjectElementNextToSelection(e);if(n){this.editor.model.change(e=>{let t=i.anchor.parent;while(t.isEmpty){const i=t;t=i.parent;e.remove(i)}this._setSelectionOverElement(n)});return true}}_handleArrowKeys(e){const t=this.editor.model;const i=t.schema;const n=t.document;const o=n.selection;const s=o.getSelectedElement();if(s&&i.isObject(s)){const n=e?o.getLastPosition():o.getFirstPosition();const s=i.getNearestSelectionRange(n,e?\"forward\":\"backward\");if(s){t.change(e=>{e.setSelection(s)})}return true}if(!o.isCollapsed){return}const r=this._getObjectElementNextToSelection(e);if(!!r&&i.isObject(r)){this._setSelectionOverElement(r);return true}}_handleEnterKey(e){const t=this.editor.model;const i=t.document.selection;const n=i.getSelectedElement();if(Tv(n,t.schema)){t.change(i=>{let o=i.createPositionAt(n,e?\"before\":\"after\");const s=i.createElement(\"paragraph\");if(t.schema.isBlock(n.parent)){const e=t.schema.findAllowedParent(o,s);o=i.split(o,e).position}i.insert(s,o);i.setSelection(s,\"in\")});return true}}_selectAllNestedEditableContent(){const e=this.editor.model;const t=e.document.selection;const i=e.schema.getLimitElement(t);if(t.getFirstRange().root==i){return false}e.change(e=>{e.setSelection(e.createRangeIn(i))});return true}_selectAllContent(){const e=this.editor.model;const t=this.editor.editing;const i=t.view;const n=i.document;const o=n.selection;const s=o.getSelectedElement();if(s&&$b(s)){const i=t.mapper.toModelElement(s.parent);e.change(e=>{e.setSelection(e.createRangeIn(i))});return true}return false}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model;const i=t.schema;const n=t.document.selection;const o=t.createSelection(n);t.modifySelection(o,{direction:e?\"forward\":\"backward\"});const s=e?o.focus.nodeBefore:o.focus.nodeAfter;if(!!s&&i.isObject(s)){return s}return null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected){e.removeClass(Wb,t)}this._previouslySelected.clear()}}function yv(e){return e==rc.arrowright||e==rc.arrowleft||e==rc.arrowup||e==rc.arrowdown}function xv(e){return ac(e)==vv}function Av(e){while(e){if(e.is(\"editableElement\")&&!e.is(\"rootElement\")){return true}if($b(e)){return false}e=e.parent}return false}function Cv(e,t){if(!t){return false}return Array.from(e.getAncestors()).includes(t)}function Tv(e,t){return e&&t.isObject(e)&&!t.isInline(e)}class Mv extends fb{refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=ow(e);if(ow(e)&&e.hasAttribute(\"alt\")){this.value=e.getAttribute(\"alt\")}else{this.value=false}}execute(e){const t=this.editor.model;const i=t.document.selection.getSelectedElement();t.change(t=>{t.setAttribute(\"alt\",e.newValue,i)})}}class Pv extends db{static get pluginName(){return\"ImageTextAlternativeEditing\"}init(){this.editor.commands.add(\"imageTextAlternative\",new Mv(this.editor))}}var Ev=i(52);class Sv extends Qg{constructor(e,t){super(e);const i=`ck-input-${ir()}`;const n=`ck-status-${ir()}`;this.set(\"label\");this.set(\"value\");this.set(\"isReadOnly\",false);this.set(\"errorText\",null);this.set(\"infoText\",null);this.labelView=this._createLabelView(i);this.inputView=this._createInputView(t,i,n);this.statusView=this._createStatusView(n);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-input\",o.if(\"isReadOnly\",\"ck-disabled\")]},children:[this.labelView,this.inputView,this.statusView]})}_createLabelView(e){const t=new ip(this.locale);t.for=e;t.bind(\"text\").to(this,\"label\");return t}_createInputView(e,t,i){const n=new e(this.locale,i);n.id=t;n.ariaDescribedById=i;n.bind(\"value\").to(this);n.bind(\"isReadOnly\").to(this);n.bind(\"hasError\").to(this,\"errorText\",e=>!!e);n.on(\"input\",()=>{this.errorText=null});return n}_createStatusView(e){const t=new Qg(this.locale);const i=this.bindTemplate;t.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-labeled-input__status\",i.if(\"errorText\",\"ck-labeled-input__status_error\"),i.if(\"_statusText\",\"ck-hidden\",e=>!e)],id:e,role:i.if(\"errorText\",\"alert\")},children:[{text:i.to(\"_statusText\")}]});return t}select(){this.inputView.select()}focus(){this.inputView.focus()}}var Iv=i(54);class Ov extends Qg{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,i,n)=>{e(n)})}select(){this.element.select()}focus(){this.element.focus()}}function Nv({view:e}){e.listenTo(e.element,\"submit\",(t,i)=>{i.preventDefault();e.fire(\"submit\")},{useCapture:true})}var Lv='';var Rv='';var zv=i(56);class jv extends Qg{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new rg;this.keystrokes=new Ym;this.labeledInput=this._createLabeledInputView();this.saveButtonView=this._createButton(t(\"de\"),Lv,\"ck-button-save\");this.saveButtonView.type=\"submit\";this.cancelButtonView=this._createButton(t(\"df\"),Rv,\"ck-button-cancel\",\"cancel\");this._focusables=new yg;this._focusCycler=new dp({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);Nv({view:this});[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e);this.focusTracker.add(e.element)})}_createButton(e,t,i,n){const o=new Sp(this.locale);o.set({label:e,icon:t,tooltip:true});o.extendTemplate({attributes:{class:i}});if(n){o.delegate(\"execute\").to(this,n)}return o}_createLabeledInputView(){const e=this.locale.t;const t=new Sv(this.locale,Ov);t.label=e(\"dg\");t.inputView.placeholder=e(\"dg\");return t}}var Dv=i(58);const Bv=rp(\"px\");const Vv=ol.document.body;class Fv extends Qg{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\",Bv),left:t.to(\"left\",Bv)}},children:this.content})}show(){this.isVisible=true}hide(){this.isVisible=false}attachTo(e){this.show();const t=Fv.defaultPositions;const i=Object.assign({},{element:this.element,positions:[t.southArrowNorth,t.southArrowNorthWest,t.southArrowNorthEast,t.northArrowSouth,t.northArrowSouthWest,t.northArrowSouthEast],limiter:Vv,fitInViewport:true},e);const n=Fv._getOptimalPosition(i);const o=parseInt(n.left);const s=parseInt(n.top);const r=n.name;Object.assign(this,{top:s,left:o,position:r})}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=Hv(e.target);const i=e.limiter?Hv(e.limiter):Vv;this.listenTo(ol.document,\"scroll\",(n,o)=>{const s=o.target;const r=t&&s.contains(t);const a=i&&s.contains(i);if(r||a||!t||!i){this.attachTo(e)}},{useCapture:true});this.listenTo(ol.window,\"resize\",()=>{this.attachTo(e)})}_stopPinning(){this.stopListening(ol.document,\"scroll\");this.stopListening(ol.window,\"resize\")}}function Hv(e){if(Gs(e)){return e}if(Yd(e)){return e.commonAncestorContainer}if(typeof e==\"function\"){return Hv(e())}return null}Fv.arrowHorizontalOffset=25;Fv.arrowVerticalOffset=10;Fv._getOptimalPosition=vp;Fv.defaultPositions={northArrowSouth:(e,t)=>({top:Uv(e,t),left:e.left+e.width/2-t.width/2,name:\"arrow_s\"}),northArrowSouthEast:(e,t)=>({top:Uv(e,t),left:e.left+e.width/2-t.width+Fv.arrowHorizontalOffset,name:\"arrow_se\"}),northArrowSouthWest:(e,t)=>({top:Uv(e,t),left:e.left+e.width/2-Fv.arrowHorizontalOffset,name:\"arrow_sw\"}),northWestArrowSouth:(e,t)=>({top:Uv(e,t),left:e.left-t.width/2,name:\"arrow_s\"}),northWestArrowSouthWest:(e,t)=>({top:Uv(e,t),left:e.left-Fv.arrowHorizontalOffset,name:\"arrow_sw\"}),northWestArrowSouthEast:(e,t)=>({top:Uv(e,t),left:e.left-t.width+Fv.arrowHorizontalOffset,name:\"arrow_se\"}),northEastArrowSouth:(e,t)=>({top:Uv(e,t),left:e.right-t.width/2,name:\"arrow_s\"}),northEastArrowSouthEast:(e,t)=>({top:Uv(e,t),left:e.right-t.width+Fv.arrowHorizontalOffset,name:\"arrow_se\"}),northEastArrowSouthWest:(e,t)=>({top:Uv(e,t),left:e.right-Fv.arrowHorizontalOffset,name:\"arrow_sw\"}),southArrowNorth:(e,t)=>({top:Wv(e,t),left:e.left+e.width/2-t.width/2,name:\"arrow_n\"}),southArrowNorthEast:(e,t)=>({top:Wv(e,t),left:e.left+e.width/2-t.width+Fv.arrowHorizontalOffset,name:\"arrow_ne\"}),southArrowNorthWest:(e,t)=>({top:Wv(e,t),left:e.left+e.width/2-Fv.arrowHorizontalOffset,name:\"arrow_nw\"}),southWestArrowNorth:(e,t)=>({top:Wv(e,t),left:e.left-t.width/2,name:\"arrow_n\"}),southWestArrowNorthWest:(e,t)=>({top:Wv(e,t),left:e.left-Fv.arrowHorizontalOffset,name:\"arrow_nw\"}),southWestArrowNorthEast:(e,t)=>({top:Wv(e,t),left:e.left-t.width+Fv.arrowHorizontalOffset,name:\"arrow_ne\"}),southEastArrowNorth:(e,t)=>({top:Wv(e,t),left:e.right-t.width/2,name:\"arrow_n\"}),southEastArrowNorthEast:(e,t)=>({top:Wv(e,t),left:e.right-t.width+Fv.arrowHorizontalOffset,name:\"arrow_ne\"}),southEastArrowNorthWest:(e,t)=>({top:Wv(e,t),left:e.right-Fv.arrowHorizontalOffset,name:\"arrow_nw\"})};function Uv(e,t){return e.top-t.height-Fv.arrowVerticalOffset}function Wv(e){return e.bottom+Fv.arrowVerticalOffset}var $v='\\n';var qv='\\n';var Yv=i(60);var Gv=i(62);const Jv=rp(\"px\");class Kv extends db{static get pluginName(){return\"ContextualBalloon\"}constructor(e){super(e);this.positionLimiter=()=>{const e=this.editor.editing.view;const t=e.document;const i=t.selection.editableElement;if(i){return e.domConverter.mapViewToDom(i.root)}return null};this.set(\"visibleView\",null);this.view=new Fv(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 Qs[\"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 i=this._idToStack.get(t);if(e.singleViewMode){this.showStack(t)}i.set(e.view,e);this._viewToStack.set(e.view,i);if(i===this._visibleStack){this._showView(e)}}remove(e){if(!this.hasView(e)){throw new Qs[\"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 Qs[\"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 Xv(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,i)=>{if(i<2){return\"\"}const n=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t(\"db\",[n,i])});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 Qv(this.editor.locale,this.view);e.bind(\"numberOfPanels\").to(this,\"_numberOfStacks\",this,\"_singleViewMode\",(e,t)=>{const i=!t&&e>=2;return i?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:i=true,singleViewMode:n=false}){this.view.class=t;this.view.withArrow=i;this._rotatorView.showView(e);this.visibleView=e;this.view.pin(this._getBalloonPosition());this._fakePanelsView.updatePosition();if(n){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 Xv extends Qg{constructor(e){super(e);const t=e.t;const i=this.bindTemplate;this.set(\"isNavigationVisible\",true);this.focusTracker=new rg;this.buttonPrevView=this._createButtonView(t(\"dc\"),$v);this.buttonNextView=this._createButtonView(t(\"dd\"),qv);this.content=this.createCollection();this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-balloon-rotator\"],\"z-index\":\"-1\"},children:[{tag:\"div\",attributes:{class:[\"ck-balloon-rotator__navigation\",i.to(\"isNavigationVisible\",e=>e?\"\":\"ck-hidden\")]},children:[this.buttonPrevView,{tag:\"span\",attributes:{class:[\"ck-balloon-rotator__counter\"]},children:[{text:i.to(\"counter\")}]},this.buttonNextView]},{tag:\"div\",attributes:{class:\"ck-balloon-rotator__content\"},children:this.content}]})}render(){super.render();this.focusTracker.add(this.element)}showView(e){this.hideView();this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const i=new Sp(this.locale);i.set({label:e,icon:t,tooltip:true});return i}}class Qv extends Qg{constructor(e,t){super(e);const i=this.bindTemplate;this.set(\"top\",0);this.set(\"left\",0);this.set(\"height\",0);this.set(\"width\",0);this.set(\"numberOfPanels\",0);this.content=this.createCollection();this._balloonPanelView=t;this.setTemplate({tag:\"div\",attributes:{class:[\"ck-fake-panel\",i.to(\"numberOfPanels\",e=>e?\"\":\"ck-hidden\")],style:{top:i.to(\"top\",Jv),left:i.to(\"left\",Jv),width:i.to(\"width\",Jv),height:i.to(\"height\",Jv)}},children:this.content});this.on(\"change:numberOfPanels\",(e,t,i,n)=>{if(i>n){this._addPanels(i-n)}else{this._removePanels(n-i)}this.updatePosition()})}_addPanels(e){while(e--){const e=new Qg;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:i,height:n}=new Kd(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:i,height:n})}}}var Zv='';function ek(e){const t=e.plugins.get(\"ContextualBalloon\");if(nw(e.editing.view.document.selection)){const i=tk(e);t.updatePosition(i)}}function tk(e){const t=e.editing.view;const i=Fv.defaultPositions;return{target:t.domConverter.viewToDom(t.document.selection.getSelectedElement()),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast]}}class ik extends db{static get requires(){return[Kv]}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\",i=>{const n=e.commands.get(\"imageTextAlternative\");const o=new Sp(i);o.set({label:t(\"cc\"),icon:Zv,tooltip:true});o.bind(\"isEnabled\").to(n,\"isEnabled\");this.listenTo(o,\"execute\",()=>this._showForm());return o})}_createForm(){const e=this.editor;const t=e.editing.view;const i=t.document;this._balloon=this.editor.plugins.get(\"ContextualBalloon\");this._form=new jv(e.locale);this._form.render();this.listenTo(this._form,\"submit\",()=>{e.execute(\"imageTextAlternative\",{newValue:this._form.labeledInput.inputView.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(!nw(i.selection)){this._hideForm(true)}else if(this._isVisible){ek(e)}});Bp({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 i=this._form.labeledInput;if(!this._isInBalloon){this._balloon.add({view:this._form,position:tk(e)})}i.value=i.inputView.element.value=t.value||\"\";this._form.labeledInput.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 nk extends db{static get requires(){return[Pv,ik]}static get pluginName(){return\"ImageTextAlternative\"}}var ok=i(64);class sk extends db{static get requires(){return[hw,kv,nk]}static get pluginName(){return\"Image\"}}function rk(e,t){return i=>{const n=i.createEditableElement(\"figcaption\");i.setCustomProperty(\"imageCaption\",true,n);hg({view:e,element:n,text:t});return Kb(n,i)}}function ak(e){return!!e.getCustomProperty(\"imageCaption\")}function ck(e){for(const t of e.getChildren()){if(!!t&&t.is(\"caption\")){return t}}return null}function lk(e){const t=e.parent;if(e.name==\"figcaption\"&&t&&t.name==\"figure\"&&t.hasClass(\"image\")){return{name:true}}return null}class dk extends db{static get pluginName(){return\"ImageCaptionEditing\"}init(){const e=this.editor;const t=e.editing.view;const i=e.model.schema;const n=e.data;const o=e.editing;const s=e.t;i.register(\"caption\",{allowIn:\"image\",allowContentOf:\"$block\",isLimit:true});e.model.document.registerPostFixer(e=>this._insertMissingModelCaptionElement(e));e.conversion.for(\"upcast\").elementToElement({view:lk,model:\"caption\"});const r=e=>e.createContainerElement(\"figcaption\");n.downcastDispatcher.on(\"insert:caption\",uk(r,false));const a=rk(t,s(\"v\"));o.downcastDispatcher.on(\"insert:caption\",uk(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 i=this._lastSelectedCaption;let n;const o=this.editor.model.document.selection;const s=o.getSelectedElement();if(s&&s.is(\"image\")){const e=ck(s);n=t.toViewElement(e)}const r=o.getFirstPosition();const a=fk(r.parent);if(a){n=t.toViewElement(a)}if(n){if(i){if(i===n){return gk(n,e)}else{mk(i,e);this._lastSelectedCaption=n;return gk(n,e)}}else{this._lastSelectedCaption=n;return gk(n,e)}}else{if(i){const t=mk(i,e);this._lastSelectedCaption=null;return t}else{return false}}}_fixCaptionVisibility(e){return(t,i,n)=>{const o=e(i);const s=fk(o);const r=this.editor.editing.mapper;const a=n.writer;if(s){const e=r.toViewElement(s);if(e){if(s.childCount){a.removeClass(\"ck-hidden\",e)}else{a.addClass(\"ck-hidden\",e)}}}}}_insertMissingModelCaptionElement(e){const t=this.editor.model;const i=t.document.differ.getChanges();const n=[];for(const e of i){if(e.type==\"insert\"&&e.name!=\"$text\"){const i=e.position.nodeAfter;if(i.is(\"image\")&&!ck(i)){n.push(i)}if(!i.is(\"image\")&&i.childCount){for(const e of t.createRangeIn(i).getItems()){if(e.is(\"image\")&&!ck(e)){n.push(e)}}}}}for(const t of n){e.appendElement(\"caption\",t)}return!!n.length}}function uk(e,t=true){return(i,n,o)=>{const s=n.item;if(!s.childCount&&!t){return}if(ow(s.parent)){if(!o.consumable.consume(n.item,\"insert\")){return}const t=o.mapper.toViewElement(n.range.start.parent);const i=e(o.writer);const r=o.writer;if(!s.childCount){r.addClass(\"ck-hidden\",i)}hk(i,n.item,t,o)}}}function hk(e,t,i,n){const o=n.writer.createPositionAt(i,\"end\");n.writer.insert(o,e);n.mapper.bindElements(t,e)}function fk(e){const t=e.getAncestors({includeSelf:true});const i=t.find(e=>e.name==\"caption\");if(i&&i.parent&&i.parent.name==\"image\"){return i}return null}function mk(e,t){if(!e.childCount&&!e.hasClass(\"ck-hidden\")){t.addClass(\"ck-hidden\",e);return true}return false}function gk(e,t){if(e.hasClass(\"ck-hidden\")){t.removeClass(\"ck-hidden\",e);return true}return false}var pk=i(66);class bk extends db{static get requires(){return[dk]}static get pluginName(){return\"ImageCaption\"}}class wk extends fb{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=ow(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 i=this.editor.model;const n=i.document.selection.getSelectedElement();i.change(e=>{if(this.styles[t].isDefault){e.removeAttribute(\"imageStyle\",n)}else{e.setAttribute(\"imageStyle\",t,n)}})}}function _k(e){return(t,i,n)=>{if(!n.consumable.consume(i.item,t.name)){return}const o=kk(i.attributeNewValue,e);const s=kk(i.attributeOldValue,e);const r=n.mapper.toViewElement(i.item);const a=n.writer;if(s){a.removeClass(s.className,r)}if(o){a.addClass(o.className,r)}}}function vk(e){const t=e.filter(e=>!e.isDefault);return(e,i,n)=>{if(!i.modelRange){return}const o=i.viewItem;const s=gb(i.modelRange.getItems());if(!n.schema.checkAttribute(s,\"imageStyle\")){return}for(const e of t){if(n.consumable.consume(o,{classes:e.className})){n.writer.setAttribute(\"imageStyle\",e.name,s)}}}}function kk(e,t){for(const i of t){if(i.name===e){return i}}}var yk='';var xk='';var Ak='';var Ck='';const Tk={full:{name:\"full\",title:\"Full size image\",icon:yk,isDefault:true},side:{name:\"side\",title:\"Side image\",icon:Ck,className:\"image-style-side\"},alignLeft:{name:\"alignLeft\",title:\"Left aligned image\",icon:xk,className:\"image-style-align-left\"},alignCenter:{name:\"alignCenter\",title:\"Centered image\",icon:Ak,className:\"image-style-align-center\"},alignRight:{name:\"alignRight\",title:\"Right aligned image\",icon:Ck,className:\"image-style-align-right\"}};const Mk={full:yk,left:xk,right:Ck,center:Ak};function Pk(e=[]){return e.map(Ek)}function Ek(e){if(typeof e==\"string\"){const t=e;if(Tk[t]){e=Object.assign({},Tk[t])}else{console.warn(Object(Qs[\"a\"])(\"image-style-not-found: There is no such image style of given name.\"),{name:t});e={name:t}}}else if(Tk[e.name]){const t=Tk[e.name];const i=Object.assign({},e);for(const n in t){if(!e.hasOwnProperty(n)){i[n]=t[n]}}e=i}if(typeof e.icon==\"string\"&&Mk[e.icon]){e.icon=Mk[e.icon]}return e}class Sk extends db{static get pluginName(){return\"ImageStyleEditing\"}init(){const e=this.editor;const t=e.model.schema;const i=e.data;const n=e.editing;e.config.define(\"image.styles\",[\"full\",\"side\"]);const o=Pk(e.config.get(\"image.styles\"));t.extend(\"image\",{allowAttributes:\"imageStyle\"});const s=_k(o);n.downcastDispatcher.on(\"attribute:imageStyle:image\",s);i.downcastDispatcher.on(\"attribute:imageStyle:image\",s);i.upcastDispatcher.on(\"element:figure\",vk(o),{priority:\"low\"});e.commands.add(\"imageStyle\",new wk(e,o))}}var Ik=i(68);class Ok extends db{static get pluginName(){return\"ImageStyleUI\"}get localizedDefaultStylesTitles(){const e=this.editor.t;return{\"Full size image\":e(\"w\"),\"Side image\":e(\"x\"),\"Left aligned image\":e(\"y\"),\"Centered image\":e(\"z\"),\"Right aligned image\":e(\"aa\")}}init(){const e=this.editor;const t=e.config.get(\"image.styles\");const i=Nk(Pk(t),this.localizedDefaultStylesTitles);for(const e of i){this._createButton(e)}}_createButton(e){const t=this.editor;const i=`imageStyle:${e.name}`;t.ui.componentFactory.add(i,i=>{const n=t.commands.get(\"imageStyle\");const o=new Sp(i);o.set({label:e.title,icon:e.icon,tooltip:true,isToggleable:true});o.bind(\"isEnabled\").to(n,\"isEnabled\");o.bind(\"isOn\").to(n,\"value\",t=>t===e.name);this.listenTo(o,\"execute\",()=>t.execute(\"imageStyle\",{value:e.name}));return o})}}function Nk(e,t){for(const i of e){if(t[i.title]){i.title=t[i.title]}}return e}class Lk extends db{static get requires(){return[Sk,Ok]}static get pluginName(){return\"ImageStyle\"}}class Rk extends db{static get requires(){return[Kv]}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(Dk(e.editing.view.document.selection)){t.stop()}},{priority:\"high\"})}this._toolbarDefinitions=new Map;this._balloon=this.editor.plugins.get(\"ContextualBalloon\");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:i,getRelatedElement:n,balloonClassName:o=\"ck-toolbar-container\"}){const s=this.editor;const r=s.t;const a=new Xp(s.locale);a.ariaLabel=t||r(\"ae\");if(this._toolbarDefinitions.has(e)){throw new Qs[\"b\"](\"widget-toolbar-duplicated: Toolbar with the given id was already added.\",this,{toolbarId:e})}a.fillFromConfig(i,s.ui.componentFactory);this._toolbarDefinitions.set(e,{view:a,getRelatedElement:n,balloonClassName:o})}_updateToolbarsVisibility(){let e=0;let t=null;let i=null;for(const n of this._toolbarDefinitions.values()){const o=n.getRelatedElement(this.editor.editing.view.document.selection);if(!this.editor.ui.focusTracker.isFocused){if(this._isToolbarVisible(n)){this._hideToolbar(n)}}else if(!o){if(this._isToolbarInBalloon(n)){this._hideToolbar(n)}}else{const s=o.getAncestors().length;if(s>e){e=s;t=o;i=n}}}if(i){this._showToolbar(i,t)}}_hideToolbar(e){this._balloon.remove(e.view);this.stopListening(this._balloon,\"change:visibleView\")}_showToolbar(e,t){if(this._isToolbarVisible(e)){zk(this.editor,t)}else if(!this._isToolbarInBalloon(e)){this._balloon.add({view:e.view,position:jk(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);zk(this.editor,t)}}})}}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function zk(e,t){const i=e.plugins.get(\"ContextualBalloon\");const n=jk(e,t);i.updatePosition(n)}function jk(e,t){const i=e.editing.view;const n=Fv.defaultPositions;return{target:i.domConverter.mapViewToDom(t),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}}function Dk(e){const t=e.getSelectedElement();return!!(t&&$b(t))}class Bk extends db{static get requires(){return[Rk]}static get pluginName(){return\"ImageToolbar\"}afterInit(){const e=this.editor;const t=e.t;const i=e.plugins.get(Rk);i.register(\"image\",{ariaLabel:t(\"b\"),items:e.config.get(\"image.toolbar\")||[],getRelatedElement:nw})}}class Vk extends Qg{constructor(e){super(e);this.buttonView=new Sp(e);this._fileInputView=new Fk(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 Fk extends Qg{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 Hk='';function Uk(e){const t=e.map(e=>e.replace(\"+\",\"\\\\+\"));return new RegExp(`^image\\\\/(${t.join(\"|\")})$`)}function Wk(e){return new Promise((t,i)=>{const n=e.getAttribute(\"src\");fetch(n).then(e=>e.blob()).then(e=>{const o=qk(e,n);const s=o.replace(\"image/\",\"\");const r=`image.${s}`;const a=Yk(e,r,o);a?t(a):i()}).catch(i)})}function $k(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 qk(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\"}}function Yk(e,t,i){try{return new File([e],t,{type:i})}catch(e){return null}}class Gk extends db{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(\"imageUpload\",i=>{const n=new Vk(i);const o=e.commands.get(\"imageUpload\");const s=e.config.get(\"image.upload.types\");const r=Uk(s);n.set({acceptedType:s.map(e=>`image/${e}`).join(\",\"),allowMultipleFiles:true});n.buttonView.set({label:t(\"ab\"),icon:Hk,tooltip:true});n.buttonView.bind(\"isEnabled\").to(o);n.on(\"done\",(t,i)=>{const n=Array.from(i).filter(e=>r.test(e.type));if(n.length){e.execute(\"imageUpload\",{file:n})}});return n})}}var Jk='';var Kk=i(70);var Xk=i(72);var Qk=i(74);class Zk extends db{constructor(e){super(e);this.placeholder=\"data:image/svg+xml;utf8,\"+encodeURIComponent(Jk)}init(){const e=this.editor;e.editing.downcastDispatcher.on(\"attribute:uploadStatus:image\",(...e)=>this.uploadStatusChange(...e))}uploadStatusChange(e,t,i){const n=this.editor;const o=t.item;const s=o.getAttribute(\"uploadId\");if(!i.consumable.consume(t.item,e.name)){return}const r=n.plugins.get(q_);const a=s?t.attributeNewValue:null;const c=this.placeholder;const l=n.editing.mapper.toViewElement(o);const d=i.writer;if(a==\"reading\"){ey(l,d);iy(c,l,d);return}if(a==\"uploading\"){const e=r.loaders.get(s);ey(l,d);if(!e){iy(c,l,d)}else{ny(l,d);oy(l,d,e,n.editing.view);uy(l,d,e)}return}if(a==\"complete\"&&r.loaders.get(s)&&!Xa.isEdge){ry(l,d,n.editing.view)}sy(l,d);ny(l,d);ty(l,d)}}function ey(e,t){if(!e.hasClass(\"ck-appear\")){t.addClass(\"ck-appear\",e)}}function ty(e,t){t.removeClass(\"ck-appear\",e)}function iy(e,t,i){if(!t.hasClass(\"ck-image-upload-placeholder\")){i.addClass(\"ck-image-upload-placeholder\",t)}const n=t.getChild(0);if(n.getAttribute(\"src\")!==e){i.setAttribute(\"src\",e,n)}if(!ly(t,\"placeholder\")){i.insert(i.createPositionAfter(n),cy(i))}}function ny(e,t){if(e.hasClass(\"ck-image-upload-placeholder\")){t.removeClass(\"ck-image-upload-placeholder\",e)}dy(e,t,\"placeholder\")}function oy(e,t,i,n){const o=ay(t);t.insert(t.createPositionAt(e,\"end\"),o);i.on(\"change:uploadedPercent\",(e,t,i)=>{n.change(e=>{e.setStyle(\"width\",i+\"%\",o)})})}function sy(e,t){dy(e,t,\"progressBar\")}function ry(e,t,i){const n=t.createUIElement(\"div\",{class:\"ck-image-upload-complete-icon\"});t.insert(t.createPositionAt(e,\"end\"),n);setTimeout(()=>{i.change(e=>e.remove(e.createRangeOn(n)))},3e3)}function ay(e){const t=e.createUIElement(\"div\",{class:\"ck-progress-bar\"});e.setCustomProperty(\"progressBar\",true,t);return t}function cy(e){const t=e.createUIElement(\"div\",{class:\"ck-upload-placeholder-loader\"});e.setCustomProperty(\"placeholder\",true,t);return t}function ly(e,t){for(const i of e.getChildren()){if(i.getCustomProperty(t)){return i}}}function dy(e,t,i){const n=ly(e,i);if(n){t.remove(t.createRangeOn(n))}}function uy(e,t,i){if(i.data){const n=e.getChild(0);t.setAttribute(\"src\",i.data,n)}}class hy{constructor(e){this.files=fy(e);this._native=e}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,t){this._native.setData(e,t)}}function fy(e){const t=e.files?Array.from(e.files):[];const i=e.items?Array.from(e.items):[];if(t.length){return t}return i.filter(e=>e.kind===\"file\").map(e=>e.getAsFile())}class my extends kd{constructor(e){super(e);const t=this.document;this.domEventType=[\"paste\",\"copy\",\"cut\",\"drop\",\"dragover\"];this.listenTo(t,\"paste\",i,{priority:\"low\"});this.listenTo(t,\"drop\",i,{priority:\"low\"});function i(e,i){i.preventDefault();const n=i.dropRange?[i.dropRange]:Array.from(t.selection.getRanges());const o=new tr(t,\"clipboardInput\");t.fire(o,{dataTransfer:i.dataTransfer,targetRanges:n});if(o.stop.called){i.stopPropagation()}}}onDomEvent(e){const t={dataTransfer:new hy(e.clipboardData?e.clipboardData:e.dataTransfer)};if(e.type==\"drop\"){t.dropRange=gy(this.view,e)}this.fire(e.type,e,t)}}function gy(e,t){const i=t.target.ownerDocument;const n=t.clientX;const o=t.clientY;let s;if(i.caretRangeFromPoint&&i.caretRangeFromPoint(n,o)){s=i.caretRangeFromPoint(n,o)}else if(t.rangeParent){s=i.createRange();s.setStart(t.rangeParent,t.rangeOffset);s.collapse(true)}if(s){return e.domConverter.domRangeToView(s)}else{return e.document.selection.getFirstRange()}}function py(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 by(e){return e.replace(/(\\s+)<\\/span>/g,(e,t)=>{if(t.length==1){return\" \"}return t})}const wy=[\"figcaption\",\"li\"];function _y(e){let t=\"\";if(e.is(\"text\")||e.is(\"textProxy\")){t=e.data}else if(e.is(\"img\")&&e.hasAttribute(\"alt\")){t=e.getAttribute(\"alt\")}else{let i=null;for(const n of e.getChildren()){const e=_y(n);if(i&&(i.is(\"containerElement\")||n.is(\"containerElement\"))){if(wy.includes(i.name)||wy.includes(n.name)){t+=\"\\n\"}else{t+=\"\\n\\n\"}}t+=e;i=n}}return t}class vy extends db{static get pluginName(){return\"Clipboard\"}init(){const e=this.editor;const t=e.model.document;const i=e.editing.view;const n=i.document;this._htmlDataProcessor=new ng;i.addObserver(my);this.listenTo(n,\"clipboardInput\",t=>{if(e.isReadOnly){t.stop()}},{priority:\"highest\"});this.listenTo(n,\"clipboardInput\",(e,t)=>{const n=t.dataTransfer;let o=\"\";if(n.getData(\"text/html\")){o=by(n.getData(\"text/html\"))}else if(n.getData(\"text/plain\")){o=py(n.getData(\"text/plain\"))}o=this._htmlDataProcessor.toView(o);this.fire(\"inputTransformation\",{content:o,dataTransfer:n});i.scrollToTheSelection()},{priority:\"low\"});this.listenTo(this,\"inputTransformation\",(e,t)=>{if(!t.content.isEmpty){const e=this.editor.data;const i=this.editor.model;const n=e.toModel(t.content,\"$clipboardHolder\");if(n.childCount==0){return}i.insertContent(n)}},{priority:\"low\"});function o(i,o){const s=o.dataTransfer;o.preventDefault();const r=e.data.toView(e.model.getSelectedContent(t.selection));n.fire(\"clipboardOutput\",{dataTransfer:s,content:r,method:i.name})}this.listenTo(n,\"copy\",o,{priority:\"low\"});this.listenTo(n,\"cut\",(t,i)=>{if(e.isReadOnly){i.preventDefault()}else{o(t,i)}},{priority:\"low\"});this.listenTo(n,\"clipboardOutput\",(i,n)=>{if(!n.content.isEmpty){n.dataTransfer.setData(\"text/html\",this._htmlDataProcessor.toData(n.content));n.dataTransfer.setData(\"text/plain\",_y(n.content))}if(n.method==\"cut\"){e.model.deleteContent(t.selection)}},{priority:\"low\"})}}class ky{createDocumentFragment(e){return new pc(e)}createElement(e,t,i){return new zr(e,t,i)}createText(e){return new Tr(e)}clone(e,t=false){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,i){return i._insertChild(e,t)}removeChildren(e,t,i){return i._removeChildren(e,t)}remove(e){const t=e.parent;if(t){return this.removeChildren(t.getChildIndex(e),1,t)}return[]}replace(e,t){const i=e.parent;if(i){const n=i.getChildIndex(e);this.removeChildren(n,1,i);this.insertChild(n,t,i);return true}return false}unwrapElement(e){const t=e.parent;if(t){const i=t.getChildIndex(e);this.remove(e);this.insertChild(i,e.getChildren(),t)}}rename(e,t){const i=new zr(e,t.getAttributes(),t.getChildren());return this.replace(t,i)?i:null}setAttribute(e,t,i){i._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,i){if(L(e)&&i===undefined){i=t}i._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,i){i._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return Ra._createAt(e,t)}createPositionAfter(e){return Ra._createAfter(e)}createPositionBefore(e){return Ra._createBefore(e)}createRange(e,t){return new za(e,t)}createRangeOn(e){return za._createOn(e)}createRangeIn(e){return za._createIn(e)}createSelection(e,t,i){return new Ba(e,t,i)}}class yy extends fb{refresh(){this.isEnabled=rw(this.editor.model)}execute(e){const t=this.editor;const i=t.model;const n=t.plugins.get(q_);i.change(t=>{const o=Array.isArray(e.file)?e.file:[e.file];for(const e of o){xy(t,i,n,e)}})}}function xy(e,t,i,n){const o=i.createLoader(n);if(!o){return}sw(e,t,{uploadId:o.id})}class Ay extends db{static get requires(){return[q_,V_,vy]}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 i=e.model.schema;const n=e.conversion;const o=e.plugins.get(q_);const s=Uk(e.config.get(\"image.upload.types\"));i.extend(\"image\",{allowAttributes:[\"uploadId\",\"uploadStatus\"]});e.commands.add(\"imageUpload\",new yy(e));n.for(\"upcast\").attributeToAttribute({view:{name:\"img\",key:\"uploadId\"},model:\"uploadId\"});this.listenTo(e.editing.view.document,\"clipboardInput\",(t,i)=>{if(Cy(i.dataTransfer)){return}const n=Array.from(i.dataTransfer.files).filter(e=>{if(!e){return false}return s.test(e.type)});const o=i.targetRanges.map(t=>e.editing.mapper.toModelRange(t));e.model.change(i=>{i.setSelection(o);if(n.length){t.stop();e.model.enqueueChange(\"default\",()=>{e.execute(\"imageUpload\",{file:n})})}})});this.listenTo(e.plugins.get(vy),\"inputTransformation\",(t,i)=>{const n=Array.from(e.editing.view.createRangeIn(i.content)).filter(e=>$k(e.item)&&!e.item.getAttribute(\"uploadProcessed\")).map(e=>({promise:Wk(e.item),imageElement:e.item}));if(!n.length){return}const s=new ky;for(const e of n){s.setAttribute(\"uploadProcessed\",true,e.imageElement);const t=o.createLoader(e.promise);if(t){s.setAttribute(\"src\",\"\",e.imageElement);s.setAttribute(\"uploadId\",t.id,e.imageElement)}}});e.editing.view.document.on(\"dragover\",(e,t)=>{t.preventDefault()});t.on(\"change\",()=>{const i=t.differ.getChanges({includeChangesInGraveyard:true});for(const t of i){if(t.type==\"insert\"&&t.name!=\"$text\"){const i=t.position.nodeAfter;const n=t.position.root.rootName==\"$graveyard\";for(const t of Ty(e,i)){const e=t.getAttribute(\"uploadId\");if(!e){continue}const i=o.loaders.get(e);if(!i){continue}if(n){i.abort()}else if(i.status==\"idle\"){this._readAndUpload(i,t)}}}}})}_readAndUpload(e,t){const i=this.editor;const n=i.model;const o=i.locale.t;const s=i.plugins.get(q_);const r=i.plugins.get(V_);n.enqueueChange(\"transparent\",e=>{e.setAttribute(\"uploadStatus\",\"reading\",t)});return e.read().then(()=>{const o=e.upload();if(Xa.isSafari){const e=i.editing.mapper.toViewElement(t);const n=e.getChild(0);i.editing.view.once(\"render\",()=>{if(!n.parent){return}const e=i.editing.view.domConverter.mapViewToDom(n.parent);if(!e){return}const t=e.style.display;e.style.display=\"none\";e._ckHack=e.offsetHeight;e.style.display=t})}n.enqueueChange(\"transparent\",e=>{e.setAttribute(\"uploadStatus\",\"uploading\",t)});return o}).then(e=>{n.enqueueChange(\"transparent\",i=>{i.setAttributes({uploadStatus:\"complete\",src:e.default},t);this._parseAndSetSrcsetAttributeOnImage(e,t,i)});a()}).catch(i=>{if(e.status!==\"error\"&&e.status!==\"aborted\"){throw i}if(e.status==\"error\"&&i){r.showWarning(i,{title:o(\"ac\"),namespace:\"upload\"})}a();n.enqueueChange(\"transparent\",e=>{e.remove(t)})});function a(){n.enqueueChange(\"transparent\",e=>{e.removeAttribute(\"uploadId\",t);e.removeAttribute(\"uploadStatus\",t)});s.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,i){let n=0;const o=Object.keys(e).filter(e=>{const t=parseInt(e,10);if(!isNaN(t)){n=Math.max(n,t);return true}}).map(t=>`${e[t]} ${t}w`).join(\", \");if(o!=\"\"){i.setAttribute(\"srcset\",{data:o,width:n},t)}}}function Cy(e){return Array.from(e.types).includes(\"text/html\")&&e.getData(\"text/html\")!==\"\"}function Ty(e,t){return Array.from(e.model.createRangeOn(t)).filter(e=>e.item.is(\"image\")).map(e=>e.item)}class My extends db{static get pluginName(){return\"ImageUpload\"}static get requires(){return[Ay,Gk,Zk]}}class Py extends fb{constructor(e){super(e);this._childCommands=[]}refresh(){}execute(...e){const t=this._getFirstEnabledCommand();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 Ey extends db{static get pluginName(){return\"IndentEditing\"}init(){const e=this.editor;e.commands.add(\"indent\",new Py(e));e.commands.add(\"outdent\",new Py(e))}}var Sy='\\n';var Iy='\\n';class Oy extends db{static get pluginName(){return\"IndentUI\"}init(){const e=this.editor;const t=e.locale;const i=e.t;const n=t.uiLanguageDirection==\"ltr\"?Sy:Iy;const o=t.uiLanguageDirection==\"ltr\"?Iy:Sy;this._defineButton(\"indent\",i(\"k\"),n);this._defineButton(\"outdent\",i(\"l\"),o)}_defineButton(e,t,i){const n=this.editor;n.ui.componentFactory.add(e,o=>{const s=n.commands.get(e);const r=new Sp(o);r.set({label:t,icon:i,tooltip:true});r.bind(\"isOn\",\"isEnabled\").to(s,\"value\",\"isEnabled\");this.listenTo(r,\"execute\",()=>n.execute(e));return r})}}class Ny extends db{static get pluginName(){return\"Indent\"}static get requires(){return[Ey,Oy]}}const Ly=\"italic\";class Ry extends db{static get pluginName(){return\"ItalicEditing\"}init(){const e=this.editor;e.model.schema.extend(\"$text\",{allowAttributes:Ly});e.model.schema.setAttributeProperties(Ly,{isFormatting:true,copyOnEnter:true});e.conversion.attributeToElement({model:Ly,view:\"i\",upcastAlso:[\"em\",{styles:{\"font-style\":\"italic\"}}]});e.commands.add(Ly,new Cb(e,Ly));e.keystrokes.set(\"CTRL+I\",Ly)}}var zy='';const jy=\"italic\";class Dy extends db{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(jy,i=>{const n=e.commands.get(jy);const o=new Sp(i);o.set({label:t(\"o\"),icon:zy,keystroke:\"CTRL+I\",tooltip:true,isToggleable:true});o.bind(\"isOn\",\"isEnabled\").to(n,\"value\",\"isEnabled\");this.listenTo(o,\"execute\",()=>e.execute(jy));return o})}}class By extends db{static get requires(){return[Ry,Dy]}static get pluginName(){return\"Italic\"}}class Vy extends kd{constructor(e){super(e);this.domEventType=\"click\"}onDomEvent(e){this.fire(e.type,e)}}var Fy=i(76);class Hy extends Qg{constructor(e,t=[]){super(e);const i=e.t;this.focusTracker=new rg;this.keystrokes=new Ym;this.urlInputView=this._createUrlInput();this.saveButtonView=this._createButton(i(\"de\"),Lv,\"ck-button-save\");this.saveButtonView.type=\"submit\";this.cancelButtonView=this._createButton(i(\"df\"),Rv,\"ck-button-cancel\",\"cancel\");this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t);this.children=this._createFormChildren(t);this._focusables=new yg;this._focusCycler=new dp({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:\"shift + tab\",focusNext:\"tab\"}});const n=[\"ck\",\"ck-link-form\"];if(t.length){n.push(\"ck-link-form_layout-vertical\")}this.setTemplate({tag:\"form\",attributes:{class:n,tabindex:\"-1\"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((e,t)=>{e[t.name]=t.isOn;return e},{})}render(){super.render();Nv({view:this});const e=[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView];e.forEach(e=>{this._focusables.add(e);this.focusTracker.add(e.element)});this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const e=this.locale.t;const t=new Sv(this.locale,Ov);t.label=e(\"eb\");t.inputView.placeholder=\"https://example.com\";return t}_createButton(e,t,i,n){const o=new Sp(this.locale);o.set({label:e,icon:t,tooltip:true});o.extendTemplate({attributes:{class:i}});if(n){o.delegate(\"execute\").to(this,n)}return o}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const i of e){const e=new Dp(this.locale);e.set({name:i.id,label:i.label,withText:true});e.bind(\"isOn\").to(i,\"value\");e.on(\"execute\",()=>{i.set(\"value\",!e.isOn)});t.add(e)}return t}_createFormChildren(e){const t=this.createCollection();t.add(this.urlInputView);if(e.length){const e=new Qg;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 Uy='';var Wy='';var $y=i(78);class qy extends Qg{constructor(e){super(e);const t=e.t;this.focusTracker=new rg;this.keystrokes=new Ym;this.previewButtonView=this._createPreviewButton();this.unlinkButtonView=this._createButton(t(\"dx\"),Uy,\"unlink\");this.editButtonView=this._createButton(t(\"dy\"),Wy,\"edit\");this.set(\"href\");this._focusables=new yg;this._focusCycler=new dp({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,i){const n=new Sp(this.locale);n.set({label:e,icon:t,tooltip:true});n.delegate(\"execute\").to(this,i);return n}_createPreviewButton(){const e=new Sp(this.locale);const t=this.bindTemplate;const i=this.t;e.set({withText:true,tooltip:i(\"dz\")});e.extendTemplate({attributes:{class:[\"ck\",\"ck-link-actions__preview\"],href:t.to(\"href\",e=>e&&k_(e)),target:\"_blank\",rel:\"noopener noreferrer\"}});e.bind(\"label\").to(this,\"href\",e=>e||i(\"ea\"));e.bind(\"isEnabled\").to(this,\"href\",e=>!!e);e.template.tag=\"a\";e.template.eventListeners={};return e}}var Yy='';const Gy=\"Ctrl+K\";class Jy extends db{static get requires(){return[Kv]}static get pluginName(){return\"LinkUI\"}init(){const e=this.editor;e.editing.view.addObserver(Vy);this.actionsView=this._createActionsView();this.formView=this._createFormView();this._balloon=e.plugins.get(Kv);this._createToolbarLinkButton();this._enableUserBalloonInteractions()}destroy(){super.destroy();this.formView.destroy()}_createActionsView(){const e=this.editor;const t=new qy(e.locale);const i=e.commands.get(\"link\");const n=e.commands.get(\"unlink\");t.bind(\"href\").to(i,\"value\");t.editButtonView.bind(\"isEnabled\").to(i);t.unlinkButtonView.bind(\"isEnabled\").to(n);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(Gy,(e,t)=>{this._addFormView();t()});return t}_createFormView(){const e=this.editor;const t=e.commands.get(\"link\");const i=new Hy(e.locale,t.manualDecorators);i.urlInputView.bind(\"value\").to(t,\"value\");i.urlInputView.bind(\"isReadOnly\").to(t,\"isEnabled\",e=>!e);i.saveButtonView.bind(\"isEnabled\").to(t);this.listenTo(i,\"submit\",()=>{e.execute(\"link\",i.urlInputView.inputView.element.value,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 i=e.t;e.keystrokes.set(Gy,(e,i)=>{i();if(t.isEnabled){this._showUI(true)}});e.ui.componentFactory.add(\"link\",e=>{const n=new Sp(e);n.isEnabled=true;n.label=i(\"dw\");n.icon=Yy;n.keystroke=Gy;n.tooltip=true;n.isToggleable=true;n.bind(\"isEnabled\").to(t,\"isEnabled\");n.bind(\"isOn\").to(t,\"value\",e=>!!e);this.listenTo(n,\"execute\",()=>this._showUI(true));return n})}_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()}});Bp({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.select()}this.formView.urlInputView.inputView.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()}}_showUI(e=false){const t=this.editor;const i=t.commands.get(\"link\");if(!i.isEnabled){return}if(!this._getSelectedLinkElement()){this._addActionsView();if(e){this._balloon.showStack(\"main\")}this._addFormView()}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)}_startUpdatingUI(){const e=this.editor;const t=e.editing.view.document;let i=this._getSelectedLinkElement();let n=s();const o=()=>{const e=this._getSelectedLinkElement();const t=s();if(i&&!e||!i&&t!==n){this._hideUI()}else if(this._isUIVisible){this._balloon.updatePosition(this._getBalloonPositionData())}i=e;n=t};function s(){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 i=this._getSelectedLinkElement();const n=i?e.domConverter.mapViewToDom(i):e.domConverter.viewRangeToDom(t.selection.getFirstRange());return{target:n}}_getSelectedLinkElement(){const e=this.editor.editing.view;const t=e.document.selection;if(t.isCollapsed){return Ky(t.getFirstPosition())}else{const i=t.getFirstRange().getTrimmed();const n=Ky(i.start);const o=Ky(i.end);if(!n||n!=o){return null}if(e.createRangeIn(n).getTrimmed().isEqual(i)){return n}else{return null}}}}function Ky(e){return e.getAncestors().find(e=>__(e))}class Xy extends db{static get requires(){return[B_,Jy]}static get pluginName(){return\"Link\"}}class Qy extends fb{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 i=Array.from(t.selection.getSelectedBlocks()).filter(t=>ex(t,e.schema));const n=this.value===true;e.change(e=>{if(n){let t=i[i.length-1].nextSibling;let n=Number.POSITIVE_INFINITY;let o=[];while(t&&t.name==\"listItem\"&&t.getAttribute(\"listIndent\")!==0){const e=t.getAttribute(\"listIndent\");if(e=i){if(s>o.getAttribute(\"listIndent\")){s=o.getAttribute(\"listIndent\")}if(o.getAttribute(\"listIndent\")==s){e[t?\"unshift\":\"push\"](o)}o=o[t?\"previousSibling\":\"nextSibling\"]}}}function ex(e,t){return t.checkChild(e.parent,\"listItem\")&&!t.isObject(e)}class tx extends fb{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 i=Array.from(t.selection.getSelectedBlocks());e.change(e=>{const t=i[i.length-1];let n=t.nextSibling;while(n&&n.name==\"listItem\"&&n.getAttribute(\"listIndent\")>t.getAttribute(\"listIndent\")){i.push(n);n=n.nextSibling}if(this._indentBy<0){i=i.reverse()}for(const t of i){const i=t.getAttribute(\"listIndent\")+this._indentBy;if(i<0){e.rename(t,\"paragraph\")}else{e.setAttribute(\"listIndent\",i,t)}}})}_checkEnabled(){const e=gb(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is(\"listItem\")){return false}if(this._indentBy>0){const t=e.getAttribute(\"listIndent\");const i=e.getAttribute(\"listType\");let n=e.previousSibling;while(n&&n.is(\"listItem\")&&n.getAttribute(\"listIndent\")>=t){if(n.getAttribute(\"listIndent\")==t){return n.getAttribute(\"listType\")==i}n=n.previousSibling}return false}return true}}function ix(e){const t=e.createContainerElement(\"li\");t.getFillerOffset=lx;return t}function nx(e,t){const i=t.mapper;const n=t.writer;const o=e.getAttribute(\"listType\")==\"numbered\"?\"ol\":\"ul\";const s=ix(n);const r=n.createContainerElement(o,null);n.insert(n.createPositionAt(r,0),s);i.bindElements(e,s);return s}function ox(e,t,i,n){const o=t.parent;const s=i.mapper;const r=i.writer;let a=s.toViewPosition(n.createPositionBefore(e));const c=ax(e.previousSibling,{sameIndent:true,smallerIndent:true,listIndent:e.getAttribute(\"listIndent\")});const l=e.previousSibling;if(c&&c.getAttribute(\"listIndent\")==e.getAttribute(\"listIndent\")){const e=s.toViewElement(c);a=r.breakContainer(r.createPositionAfter(e))}else{if(l&&l.name==\"listItem\"){a=s.toViewPosition(n.createPositionAt(l,\"end\"))}else{a=s.toViewPosition(n.createPositionBefore(e))}}a=rx(a);r.insert(a,o);if(l&&l.name==\"listItem\"){const e=s.toViewElement(l);const i=r.createRange(r.createPositionAt(e,0),a);const n=i.getWalker({ignoreElementEnd:true});for(const e of n){if(e.item.is(\"li\")){const i=r.breakContainer(r.createPositionBefore(e.item));const o=e.item.parent;const s=r.createPositionAt(t,\"end\");sx(r,s.nodeBefore,s.nodeAfter);r.move(r.createRangeOn(o),s);n.position=i}}}else{const i=o.nextSibling;if(i&&(i.is(\"ul\")||i.is(\"ol\"))){let n=null;for(const t of i.getChildren()){const i=s.toModelElement(t);if(i&&i.getAttribute(\"listIndent\")>e.getAttribute(\"listIndent\")){n=t}else{break}}if(n){r.breakContainer(r.createPositionAfter(n));r.move(r.createRangeOn(n.parent),r.createPositionAt(t,\"end\"))}}}sx(r,o,o.nextSibling);sx(r,o.previousSibling,o)}function sx(e,t,i){if(!t||!i||t.name!=\"ul\"&&t.name!=\"ol\"){return null}if(t.name!=i.name||t.getAttribute(\"class\")!==i.getAttribute(\"class\")){return null}return e.mergeContainers(e.createPositionAfter(t))}function rx(e){return e.getLastMatchingPosition(e=>e.item.is(\"uiElement\"))}function ax(e,t){const i=!!t.sameIndent;const n=!!t.smallerIndent;const o=t.listIndent;let s=e;while(s&&s.name==\"listItem\"){const e=s.getAttribute(\"listIndent\");if(i&&o==e||n&&o>e){return s}s=s.previousSibling}return null}function cx(e,t,i,n){e.ui.componentFactory.add(t,o=>{const s=e.commands.get(t);const r=new Sp(o);r.set({label:i,icon:n,tooltip:true,isToggleable:true});r.bind(\"isOn\",\"isEnabled\").to(s,\"value\",\"isEnabled\");r.on(\"execute\",()=>e.execute(t));return r})}function lx(){const e=!this.isEmpty&&(this.getChild(0).name==\"ul\"||this.getChild(0).name==\"ol\");if(this.isEmpty||e){return 0}return Hr.call(this)}function dx(e){return(t,i,n)=>{const o=n.consumable;if(!o.test(i.item,\"insert\")||!o.test(i.item,\"attribute:listType\")||!o.test(i.item,\"attribute:listIndent\")){return}o.consume(i.item,\"insert\");o.consume(i.item,\"attribute:listType\");o.consume(i.item,\"attribute:listIndent\");const s=i.item;const r=nx(s,n);ox(s,r,n,e)}}function ux(e){return(t,i,n)=>{const o=n.mapper.toViewPosition(i.position).getLastMatchingPosition(e=>!e.item.is(\"li\"));const s=o.nodeAfter;const r=n.writer;r.breakContainer(r.createPositionBefore(s));r.breakContainer(r.createPositionAfter(s));const a=s.parent;const c=a.previousSibling;const l=r.createRangeOn(a);const d=r.remove(l);if(c&&c.nextSibling){sx(r,c,c.nextSibling)}const u=n.mapper.toModelElement(s);Tx(u.getAttribute(\"listIndent\")+1,i.position,l.start,s,n,e);for(const e of r.createRangeIn(d).getItems()){n.mapper.unbindViewElement(e)}t.stop()}}function hx(e,t,i){if(!i.consumable.consume(t.item,\"attribute:listType\")){return}const n=i.mapper.toViewElement(t.item);const o=i.writer;o.breakContainer(o.createPositionBefore(n));o.breakContainer(o.createPositionAfter(n));const s=n.parent;const r=t.attributeNewValue==\"numbered\"?\"ol\":\"ul\";o.rename(r,s)}function fx(e,t,i){const n=i.mapper.toViewElement(t.item);const o=n.parent;const s=i.writer;sx(s,o,o.nextSibling);sx(s,o.previousSibling,o);for(const e of t.item.getChildren()){i.consumable.consume(e,\"insert\")}}function mx(e){return(t,i,n)=>{if(!n.consumable.consume(i.item,\"attribute:listIndent\")){return}const o=n.mapper.toViewElement(i.item);const s=n.writer;s.breakContainer(s.createPositionBefore(o));s.breakContainer(s.createPositionAfter(o));const r=o.parent;const a=r.previousSibling;const c=s.createRangeOn(r);s.remove(c);if(a&&a.nextSibling){sx(s,a,a.nextSibling)}Tx(i.attributeOldValue+1,i.range.start,c.start,o,n,e);ox(i.item,o,n,e);for(const e of i.item.getChildren()){n.consumable.consume(e,\"insert\")}}}function gx(e,t,i){if(t.item.name!=\"listItem\"){let e=i.mapper.toViewPosition(t.range.start);const n=i.writer;const o=[];while(e.parent.name==\"ul\"||e.parent.name==\"ol\"){e=n.breakContainer(e);if(e.parent.name!=\"li\"){break}const t=e;const i=n.createPositionAt(e.parent,\"end\");if(!t.isEqual(i)){const e=n.remove(n.createRange(t,i));o.push(e)}e=n.createPositionAfter(e.parent)}if(o.length>0){for(let t=0;t0){const t=sx(n,i,i.nextSibling);if(t&&t.parent==i){e.offset--}}}sx(n,e.nodeBefore,e.nodeAfter)}}}function px(e,t,i){const n=i.mapper.toViewPosition(t.position);const o=n.nodeBefore;const s=n.nodeAfter;sx(i.writer,o,s)}function bx(e,t,i){if(i.consumable.consume(t.viewItem,{name:true})){const e=i.writer;const n=e.createElement(\"listItem\");const o=Px(t.viewItem);e.setAttribute(\"listIndent\",o,n);const s=t.viewItem.parent&&t.viewItem.parent.name==\"ol\"?\"numbered\":\"bulleted\";e.setAttribute(\"listType\",s,n);const r=i.splitToAllowedParent(n,t.modelCursor);if(!r){return}e.insert(n,r.position);const a=Ax(n,t.viewItem.getChildren(),i);t.modelRange=e.createRange(t.modelCursor,a);if(r.cursorParent){t.modelCursor=e.createPositionAt(r.cursorParent,0)}else{t.modelCursor=t.modelRange.end}}}function wx(e,t,i){if(i.consumable.test(t.viewItem,{name:true})){const e=Array.from(t.viewItem.getChildren());for(const t of e){const e=!(t.is(\"li\")||Mx(t));if(e){t._remove()}}}}function _x(e,t,i){if(i.consumable.test(t.viewItem,{name:true})){if(t.viewItem.childCount===0){return}const e=[...t.viewItem.getChildren()];let i=false;let n=true;for(const t of e){if(i&&!Mx(t)){t._remove()}if(t.is(\"text\")){if(n){t._data=t.data.replace(/^\\s+/,\"\")}if(!t.nextSibling||Mx(t.nextSibling)){t._data=t.data.replace(/\\s+$/,\"\")}}else if(Mx(t)){i=true}n=false}}}function vx(e){return(t,i)=>{if(i.isPhantom){return}const n=i.modelPosition.nodeBefore;if(n&&n.is(\"listItem\")){const t=i.mapper.toViewElement(n);const o=t.getAncestors().find(Mx);const s=e.createPositionAt(t,0).getWalker();for(const e of s){if(e.type==\"elementStart\"&&e.item.is(\"li\")){i.viewPosition=e.previousPosition;break}else if(e.type==\"elementEnd\"&&e.item==o){i.viewPosition=e.nextPosition;break}}}}}function kx(e){return(t,i)=>{const n=i.viewPosition;const o=n.parent;const s=i.mapper;if(o.name==\"ul\"||o.name==\"ol\"){if(!n.isAtEnd){const t=s.toModelElement(n.nodeAfter);i.modelPosition=e.createPositionBefore(t)}else{const t=s.toModelElement(n.nodeBefore);const o=s.getModelLength(n.nodeBefore);i.modelPosition=e.createPositionBefore(t).getShiftedBy(o)}t.stop()}else if(o.name==\"li\"&&n.nodeBefore&&(n.nodeBefore.name==\"ul\"||n.nodeBefore.name==\"ol\")){const r=s.toModelElement(o);let a=1;let c=n.nodeBefore;while(c&&Mx(c)){a+=s.getModelLength(c);c=c.previousSibling}i.modelPosition=e.createPositionBefore(r).getShiftedBy(a);t.stop()}}}function yx(e,t){const i=e.document.differ.getChanges();const n=new Map;let o=false;for(const n of i){if(n.type==\"insert\"&&n.name==\"listItem\"){s(n.position)}else if(n.type==\"insert\"&&n.name!=\"listItem\"){if(n.name!=\"$text\"){const i=n.position.nodeAfter;if(i.hasAttribute(\"listIndent\")){t.removeAttribute(\"listIndent\",i);o=true}if(i.hasAttribute(\"listType\")){t.removeAttribute(\"listType\",i);o=true}for(const t of Array.from(e.createRangeIn(i)).filter(e=>e.item.is(\"listItem\"))){s(t.previousPosition)}}const i=n.position.getShiftedBy(n.length);s(i)}else if(n.type==\"remove\"&&n.name==\"listItem\"){s(n.position)}else if(n.type==\"attribute\"&&n.attributeKey==\"listIndent\"){s(n.range.start)}else if(n.type==\"attribute\"&&n.attributeKey==\"listType\"){s(n.range.start)}}for(const e of n.values()){r(e);a(e)}return o;function s(e){const t=e.nodeBefore;if(!t||!t.is(\"listItem\")){const t=e.nodeAfter;if(t&&t.is(\"listItem\")){n.set(t,t)}}else{let i=t;if(n.has(i)){return}while(i.previousSibling&&i.previousSibling.is(\"listItem\")){i=i.previousSibling;if(n.has(i)){return}}n.set(e.nodeBefore,i)}}function r(e){let i=0;let n=null;while(e&&e.is(\"listItem\")){const s=e.getAttribute(\"listIndent\");if(s>i){let r;if(n===null){n=s-i;r=i}else{if(n>s){n=s}r=s-n}t.setAttribute(\"listIndent\",r,e);o=true}else{n=null;i=e.getAttribute(\"listIndent\")+1}e=e.nextSibling}}function a(e){let i=[];let n=null;while(e&&e.is(\"listItem\")){const s=e.getAttribute(\"listIndent\");if(n&&n.getAttribute(\"listIndent\")>s){i=i.slice(0,s+1)}if(s!=0){if(i[s]){const n=i[s];if(e.getAttribute(\"listType\")!=n){t.setAttribute(\"listType\",n,e);o=true}}else{i[s]=e.getAttribute(\"listType\")}}n=e;e=e.nextSibling}}}function xx(e,[t,i]){let n=t.is(\"documentFragment\")?t.getChild(0):t;let o;if(!i){o=this.document.selection}else{o=this.createSelection(i)}if(n&&n.is(\"listItem\")){const e=o.getFirstPosition();let t=null;if(e.parent.is(\"listItem\")){t=e.parent}else if(e.nodeBefore&&e.nodeBefore.is(\"listItem\")){t=e.nodeBefore}if(t){const e=t.getAttribute(\"listIndent\");if(e>0){while(n&&n.is(\"listItem\")){n._setAttribute(\"listIndent\",n.getAttribute(\"listIndent\")+e);n=n.nextSibling}}}}}function Ax(e,t,i){const{writer:n,schema:o}=i;let s=n.createPositionAfter(e);for(const r of t){if(r.name==\"ul\"||r.name==\"ol\"){s=i.convertItem(r,s).modelCursor}else{const t=i.convertItem(r,n.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(\"listItem\")){e=t.modelCursor.parent}else{e=Cx(t.modelCursor)}s=n.createPositionAfter(e)}}}return s}function Cx(e){const t=new _u({startPosition:e});let i;do{i=t.next()}while(!i.value.item.is(\"listItem\"));return i.value.item}function Tx(e,t,i,n,o,s){const r=ax(t.nodeBefore,{sameIndent:true,smallerIndent:true,listIndent:e,foo:\"b\"});const a=o.mapper;const c=o.writer;const l=r?r.getAttribute(\"listIndent\"):null;let d;if(!r){d=i}else if(l==e){const e=a.toViewElement(r).parent;d=c.createPositionAfter(e)}else{const e=s.createPositionAt(r,\"end\");d=a.toViewPosition(e)}d=rx(d);for(const e of[...n.getChildren()]){if(Mx(e)){d=c.move(c.createRangeOn(e),d).end;sx(c,e,e.nextSibling);sx(c,e.previousSibling,e)}}}function Mx(e){return e.is(\"ol\")||e.is(\"ul\")}function Px(e){let t=0;let i=e.parent;while(i){if(i.is(\"li\")){t++}else{const e=i.previousSibling;if(e&&e.is(\"li\")){t++}}i=i.parent}return t}class Ex extends db{static get pluginName(){return\"ListEditing\"}static get requires(){return[rv]}init(){const e=this.editor;e.model.schema.register(\"listItem\",{inheritAllFrom:\"$block\",allowAttributes:[\"listType\",\"listIndent\"]});const t=e.data;const i=e.editing;e.model.document.registerPostFixer(t=>yx(e.model,t));i.mapper.registerViewToModelLength(\"li\",Sx);t.mapper.registerViewToModelLength(\"li\",Sx);i.mapper.on(\"modelToViewPosition\",vx(i.view));i.mapper.on(\"viewToModelPosition\",kx(e.model));t.mapper.on(\"modelToViewPosition\",vx(i.view));e.conversion.for(\"editingDowncast\").add(t=>{t.on(\"insert\",gx,{priority:\"high\"});t.on(\"insert:listItem\",dx(e.model));t.on(\"attribute:listType:listItem\",hx,{priority:\"high\"});t.on(\"attribute:listType:listItem\",fx,{priority:\"low\"});t.on(\"attribute:listIndent:listItem\",mx(e.model));t.on(\"remove:listItem\",ux(e.model));t.on(\"remove\",px,{priority:\"low\"})});e.conversion.for(\"dataDowncast\").add(t=>{t.on(\"insert\",gx,{priority:\"high\"});t.on(\"insert:listItem\",dx(e.model))});e.conversion.for(\"upcast\").add(e=>{e.on(\"element:ul\",wx,{priority:\"high\"});e.on(\"element:ol\",wx,{priority:\"high\"});e.on(\"element:li\",_x,{priority:\"high\"});e.on(\"element:li\",bx)});e.model.on(\"insertContent\",xx,{priority:\"high\"});e.commands.add(\"numberedList\",new Qy(e,\"numbered\"));e.commands.add(\"bulletedList\",new Qy(e,\"bulleted\"));e.commands.add(\"indentList\",new tx(e,\"forward\"));e.commands.add(\"outdentList\",new tx(e,\"backward\"));const n=i.view.document;this.listenTo(n,\"enter\",(e,t)=>{const i=this.editor.model.document;const n=i.selection.getLastPosition().parent;if(i.selection.isCollapsed&&n.name==\"listItem\"&&n.isEmpty){this.editor.execute(\"outdentList\");t.preventDefault();e.stop()}});this.listenTo(n,\"delete\",(e,t)=>{if(t.direction!==\"backward\"){return}const i=this.editor.model.document.selection;if(!i.isCollapsed){return}const n=i.getFirstPosition();if(!n.isAtStart){return}const o=n.parent;if(o.name!==\"listItem\"){return}const s=o.previousSibling&&o.previousSibling.name===\"listItem\";if(s){return}this.editor.execute(\"outdentList\");t.preventDefault();e.stop()},{priority:\"high\"});const o=e=>(t,i)=>{const n=this.editor.commands.get(e);if(n.isEnabled){this.editor.execute(e);i()}};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 i=e.get(\"outdent\");if(t){t.registerChildCommand(e.get(\"indentList\"))}if(i){i.registerChildCommand(e.get(\"outdentList\"))}}}function Sx(e){let t=1;for(const i of e.getChildren()){if(i.name==\"ul\"||i.name==\"ol\"){for(const e of i.getChildren()){t+=Sx(e)}}}return t}var Ix='';var Ox='';class Nx extends db{init(){const e=this.editor.t;cx(this.editor,\"numberedList\",e(\"du\"),Ix);cx(this.editor,\"bulletedList\",e(\"dv\"),Ox)}}class Lx extends db{static get requires(){return[Ex,Nx]}static get pluginName(){return\"List\"}}function Rx(e,t){return e=>{e.on(\"attribute:url:media\",i)};function i(i,n,o){if(!o.consumable.consume(n.item,i.name)){return}const s=n.attributeNewValue;const r=o.writer;const a=o.mapper.toViewElement(n.item);r.remove(r.createRangeIn(a));const c=e.getMediaViewElement(r,s,t);r.insert(r.createPositionAt(a,0),c)}}function zx(e,t,i){t.setCustomProperty(\"media\",true,e);return qb(e,t,{label:i})}function jx(e){const t=e.getSelectedElement();if(t&&Dx(t)){return t}return null}function Dx(e){return!!e.getCustomProperty(\"media\")&&$b(e)}function Bx(e,t,i,n){const o=e.createContainerElement(\"figure\",{class:\"media\"});o.getFillerOffset=Hx;e.insert(e.createPositionAt(o,0),t.getMediaViewElement(e,i,n));return o}function Vx(e){const t=e.getSelectedElement();if(t&&t.is(\"media\")){return t}return null}function Fx(e,t,i){e.change(n=>{const o=n.createElement(\"media\",{url:t});e.insertContent(o,i);n.setSelection(o,\"on\")})}function Hx(){return null}class Ux extends fb{refresh(){const e=this.editor.model;const t=e.document.selection;const i=e.schema;const n=t.getFirstPosition();const o=Vx(t);let s=n.parent;if(s!=s.root){s=s.parent}this.value=o?o.getAttribute(\"url\"):null;this.isEnabled=i.checkChild(s,\"media\")}execute(e){const t=this.editor.model;const i=t.document.selection;const n=Vx(i);if(n){t.change(t=>{t.setAttribute(\"url\",e,n)})}else{const n=Xb(i,t);Fx(t,e,n)}}}var Wx='';const $x=\"0 0 64 42\";class qx{constructor(e,t){const i=t.providers;const n=t.extraProviders||[];const o=new Set(t.removeProviders);const s=i.concat(n).filter(e=>{const t=e.name;if(!t){console.warn(Object(Qs[\"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=s}hasMedia(e){return!!this._getMedia(e)}getMediaViewElement(e,t,i){return this._getMedia(t).getViewElement(e,i)}_getMedia(e){if(!e){return new Yx(this.locale)}e=e.trim();for(const t of this.providerDefinitions){const i=t.html;let n=t.url;if(!Array.isArray(n)){n=[n]}for(const t of n){const n=this._getUrlMatches(e,t);if(n){return new Yx(this.locale,e,n,i)}}}return null}_getUrlMatches(e,t){let i=e.match(t);if(i){return i}let n=e.replace(/^https?:\\/\\//,\"\");i=n.match(t);if(i){return i}n=n.replace(/^www\\./,\"\");i=n.match(t);if(i){return i}return null}}class Yx{constructor(e,t,i,n){this.url=this._getValidUrl(t);this._t=e.t;this._match=i;this._previewRenderer=n}getViewElement(e,t){const i={};if(t.renderForEditingView||t.renderMediaPreview&&this.url&&this._previewRenderer){if(this.url){i[\"data-oembed-url\"]=this.url}if(t.renderForEditingView){i.class=\"ck-media__wrapper\"}const n=this._getPreviewHtml(t);return e.createUIElement(\"div\",i,(function(e){const t=this.toDomElement(e);t.innerHTML=n;return t}))}else{if(this.url){i.url=this.url}return e.createEmptyElement(\"oembed\",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 Pp;const t=new Tp;e.text=this._t(\"Open media in new tab\");t.content=Wx;t.viewBox=$x;const i=new Cg({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 i.outerHTML}_getValidUrl(e){if(!e){return null}if(e.match(/^https?/)){return e}return\"https://\"+e}}var Gx=i(80);class Jx extends db{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 qx(e.locale,e.config.get(\"mediaEmbed\"))}init(){const e=this.editor;const t=e.model.schema;const i=e.t;const n=e.conversion;const o=e.config.get(\"mediaEmbed.previewsInData\");const s=this.registry;e.commands.add(\"mediaEmbed\",new Ux(e));t.register(\"media\",{isObject:true,isBlock:true,allowWhere:\"$block\",allowAttributes:[\"url\"]});n.for(\"dataDowncast\").elementToElement({model:\"media\",view:(e,t)=>{const i=e.getAttribute(\"url\");return Bx(t,s,i,{renderMediaPreview:i&&o})}});n.for(\"dataDowncast\").add(Rx(s,{renderMediaPreview:o}));n.for(\"editingDowncast\").elementToElement({model:\"media\",view:(e,t)=>{const n=e.getAttribute(\"url\");const o=Bx(t,s,n,{renderForEditingView:true});return zx(o,t,i(\"m\"))}});n.for(\"editingDowncast\").add(Rx(s,{renderForEditingView:true}));n.for(\"upcast\").elementToElement({view:{name:\"oembed\",attributes:{url:true}},model:(e,t)=>{const i=e.getAttribute(\"url\");if(s.hasMedia(i)){return t.createElement(\"media\",{url:i})}}}).elementToElement({view:{name:\"div\",attributes:{\"data-oembed-url\":true}},model:(e,t)=>{const i=e.getAttribute(\"data-oembed-url\");if(s.hasMedia(i)){return t.createElement(\"media\",{url:i})}}})}}class Kx extends Cf{get type(){return\"noop\"}clone(){return new Kx(this.baseVersion)}getReversed(){return new Kx(this.baseVersion+1)}_execute(){}static get className(){return\"NoOperation\"}}const Xx=new Map;function Qx(e,t,i){let n=Xx.get(e);if(!n){n=new Map;Xx.set(e,n)}n.set(t,i)}function Zx(e,t){const i=Xx.get(e);if(i&&i.has(t)){return i.get(t)}return eA}function eA(e){return[e]}function tA(e,t,i={}){const n=Zx(e.constructor,t.constructor);try{e=e.clone();return n(e,t,i)}catch(e){throw e}}function iA(e,t,i){e=e.slice();t=t.slice();const n=new nA(i.document,i.useRelations,i.forceWeakRemove);n.setOriginalOperations(e);n.setOriginalOperations(t);const o=n.originalOperations;if(e.length==0||t.length==0){return{operationsA:e,operationsB:t,originalOperations:o}}const s=new WeakMap;for(const t of e){s.set(t,0)}const r={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){const n=e.range.getDifference(t.range).map(t=>new Df(t,e.key,e.oldValue,e.newValue,0));const o=e.range.getIntersection(t.range);if(o){if(i.aIsStrong){n.push(new Df(o,t.key,t.newValue,e.newValue,0))}}if(n.length==0){return[new Kx(0)]}return n}else{return[e]}});Qx(Df,Ff,(e,t)=>{if(e.range.start.hasSameParentAs(t.position)&&e.range.containsPosition(t.position)){const i=e.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes);const n=i.map(t=>new Df(t,e.key,e.oldValue,e.newValue,e.baseVersion));if(t.shouldReceiveAttributes){const i=rA(t,e.key,e.oldValue);if(i){n.unshift(i)}}return n}e.range=e.range._getTransformedByInsertion(t.position,t.howMany,false)[0];return[e]});function rA(e,t,i){const n=e.nodes;const o=n.getNode(0).getAttribute(t);if(o==i){return null}const s=new Au(e.position,e.position.getShiftedBy(e.howMany));return new Df(s,t,o,i,0)}Qx(Df,$f,(e,t)=>{const i=[];if(e.range.start.hasSameParentAs(t.deletionPosition)){if(e.range.containsPosition(t.deletionPosition)||e.range.start.isEqual(t.deletionPosition)){i.push(Au._createFromPositionAndShift(t.graveyardPosition,1))}}const n=e.range._getTransformedByMergeOperation(t);if(!n.isCollapsed){i.push(n)}return i.map(t=>new Df(t,e.key,e.oldValue,e.newValue,e.baseVersion))});Qx(Df,Vf,(e,t)=>{const i=aA(e.range,t);return i.map(t=>new Df(t,e.key,e.oldValue,e.newValue,e.baseVersion))});function aA(e,t){const i=Au._createFromPositionAndShift(t.sourcePosition,t.howMany);let n=null;let o=[];if(i.containsRange(e,true)){n=e}else if(e.start.hasSameParentAs(i.start)){o=e.getDifference(i);n=e.getIntersection(i)}else{o=[e]}const s=[];for(let e of o){e=e._getTransformedByDeletion(t.sourcePosition,t.howMany);const i=t.getMovedRangeStart();const n=e.start.hasSameParentAs(i);e=e._getTransformedByInsertion(i,t.howMany,n);s.push(...e)}if(n){s.push(n._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,false)[0])}return s}Qx(Df,qf,(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 i=e.clone();i.range=new Au(t.moveTargetPosition.clone(),e.range.end._getCombined(t.splitPosition,t.moveTargetPosition));e.range.end=t.splitPosition.clone();e.range.end.stickiness=\"toPrevious\";return[e,i]}e.range=e.range._getTransformedBySplitOperation(t);return[e]});Qx(Ff,Df,(e,t)=>{const i=[e];if(e.shouldReceiveAttributes&&e.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(e.position)){const n=rA(e,t.key,t.newValue);if(n){i.push(n)}}return i});Qx(Ff,Ff,(e,t,i)=>{if(e.position.isEqual(t.position)&&i.aIsStrong){return[e]}e.position=e.position._getTransformedByInsertOperation(t);return[e]});Qx(Ff,Vf,(e,t)=>{e.position=e.position._getTransformedByMoveOperation(t);return[e]});Qx(Ff,qf,(e,t)=>{e.position=e.position._getTransformedBySplitOperation(t);return[e]});Qx(Ff,$f,(e,t)=>{e.position=e.position._getTransformedByMergeOperation(t);return[e]});Qx(Hf,Ff,(e,t)=>{if(e.oldRange){e.oldRange=e.oldRange._getTransformedByInsertOperation(t)[0]}if(e.newRange){e.newRange=e.newRange._getTransformedByInsertOperation(t)[0]}return[e]});Qx(Hf,Hf,(e,t,i)=>{if(e.name==t.name){if(i.aIsStrong){e.oldRange=t.newRange?t.newRange.clone():null}else{return[new Kx(0)]}}return[e]});Qx(Hf,$f,(e,t)=>{if(e.oldRange){e.oldRange=e.oldRange._getTransformedByMergeOperation(t)}if(e.newRange){e.newRange=e.newRange._getTransformedByMergeOperation(t)}return[e]});Qx(Hf,Vf,(e,t,i)=>{if(e.oldRange){e.oldRange=Au._createFromRanges(e.oldRange._getTransformedByMoveOperation(t))}if(e.newRange){if(i.abRelation){const n=Au._createFromRanges(e.newRange._getTransformedByMoveOperation(t));if(i.abRelation.side==\"left\"&&t.targetPosition.isEqual(e.newRange.start)){e.newRange.start.path=i.abRelation.path;e.newRange.end=n.end;return[e]}else if(i.abRelation.side==\"right\"&&t.targetPosition.isEqual(e.newRange.end)){e.newRange.start=n.start;e.newRange.end.path=i.abRelation.path;return[e]}}e.newRange=Au._createFromRanges(e.newRange._getTransformedByMoveOperation(t))}return[e]});Qx(Hf,qf,(e,t,i)=>{if(e.oldRange){e.oldRange=e.oldRange._getTransformedBySplitOperation(t)}if(e.newRange){if(i.abRelation){const n=e.newRange._getTransformedBySplitOperation(t);if(e.newRange.start.isEqual(t.splitPosition)&&i.abRelation.wasStartBeforeMergedElement){e.newRange.start=xu._createAt(t.insertionPosition)}else if(e.newRange.start.isEqual(t.splitPosition)&&!i.abRelation.wasInLeftElement){e.newRange.start=xu._createAt(t.moveTargetPosition)}if(e.newRange.end.isEqual(t.splitPosition)&&i.abRelation.wasInRightElement){e.newRange.end=xu._createAt(t.moveTargetPosition)}else if(e.newRange.end.isEqual(t.splitPosition)&&i.abRelation.wasEndBeforeMergedElement){e.newRange.end=xu._createAt(t.insertionPosition)}else{e.newRange.end=n.end}return[e]}e.newRange=e.newRange._getTransformedBySplitOperation(t)}return[e]});Qx($f,Ff,(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]});Qx($f,$f,(e,t,i)=>{if(e.sourcePosition.isEqual(t.sourcePosition)&&e.targetPosition.isEqual(t.targetPosition)){if(!i.bWasUndone){return[new Kx(0)]}else{const i=t.graveyardPosition.path.slice();i.push(0);e.sourcePosition=new xu(t.graveyardPosition.root,i);e.howMany=0;return[e]}}if(e.sourcePosition.isEqual(t.sourcePosition)&&!e.targetPosition.isEqual(t.targetPosition)&&!i.bWasUndone&&i.abRelation!=\"splitAtSource\"){const n=e.targetPosition.root.rootName==\"$graveyard\";const o=t.targetPosition.root.rootName==\"$graveyard\";const s=n&&!o;const r=o&&!n;const a=r||!s&&i.aIsStrong;if(a){const i=t.targetPosition._getTransformedByMergeOperation(t);const n=e.targetPosition._getTransformedByMergeOperation(t);return[new Vf(i,e.howMany,n,0)]}else{return[new Kx(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)||!i.aIsStrong){e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)}return[e]});Qx($f,Vf,(e,t,i)=>{const n=Au._createFromPositionAndShift(t.sourcePosition,t.howMany);if(t.type==\"remove\"&&!i.bWasUndone&&!i.forceWeakRemove){if(e.deletionPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(e.sourcePosition)){return[new Kx(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]});Qx($f,qf,(e,t,i)=>{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 n=t.howMany!=0;const o=t.graveyardPosition&&e.deletionPosition.isEqual(t.graveyardPosition);if(n||o||i.abRelation==\"mergeTargetNotMoved\"){e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t);return[e]}}if(e.sourcePosition.isEqual(t.splitPosition)){if(i.abRelation==\"mergeSourceNotMoved\"){e.howMany=0;e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t);return[e]}if(i.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]});Qx(Vf,Ff,(e,t)=>{const i=Au._createFromPositionAndShift(e.sourcePosition,e.howMany);const n=i._getTransformedByInsertOperation(t,false)[0];e.sourcePosition=n.start;e.howMany=n.end.offset-n.start.offset;if(!e.targetPosition.isEqual(t.position)){e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)}return[e]});Qx(Vf,Vf,(e,t,i)=>{const n=Au._createFromPositionAndShift(e.sourcePosition,e.howMany);const o=Au._createFromPositionAndShift(t.sourcePosition,t.howMany);let s=i.aIsStrong;let r=!i.aIsStrong;if(i.abRelation==\"insertBefore\"||i.baRelation==\"insertAfter\"){r=true}else if(i.abRelation==\"insertAfter\"||i.baRelation==\"insertBefore\"){r=false}let a;if(e.targetPosition.isEqual(t.targetPosition)&&r){a=e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany)}else{a=e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany)}if(cA(e,t)&&cA(t,e)){return[t.getReversed()]}const c=n.containsPosition(t.targetPosition);if(c&&n.containsRange(o,true)){n.start=n.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);n.end=n.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);return lA([n],a)}const l=o.containsPosition(e.targetPosition);if(l&&o.containsRange(n,true)){n.start=n.start._getCombined(t.sourcePosition,t.getMovedRangeStart());n.end=n.end._getCombined(t.sourcePosition,t.getMovedRangeStart());return lA([n],a)}const d=kr(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if(d==\"prefix\"||d==\"extension\"){n.start=n.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);n.end=n.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);return lA([n],a)}if(e.type==\"remove\"&&t.type!=\"remove\"&&!i.aWasUndone&&!i.forceWeakRemove){s=true}else if(e.type!=\"remove\"&&t.type==\"remove\"&&!i.bWasUndone&&!i.forceWeakRemove){s=false}const u=[];const h=n.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 i=kr(e.start.getParentPath(),t.getMovedRangeStart().getParentPath())==\"same\";const n=e._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,i);u.push(...n)}const f=n.getIntersection(o);if(f!==null&&s){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(n.start)||o.start.isEqual(n.start)){u.unshift(f)}else{u.push(f)}}else{u.splice(1,0,f)}}if(u.length===0){return[new Kx(e.baseVersion)]}return lA(u,a)});Qx(Vf,qf,(e,t,i)=>{let n=e.targetPosition.clone();if(!e.targetPosition.isEqual(t.insertionPosition)||!t.graveyardPosition||i.abRelation==\"moveTargetAfter\"){n=e.targetPosition._getTransformedBySplitOperation(t)}const o=Au._createFromPositionAndShift(e.sourcePosition,e.howMany);if(o.end.isEqual(t.insertionPosition)){if(!t.graveyardPosition){e.howMany++}e.targetPosition=n;return[e]}if(o.start.hasSameParentAs(t.splitPosition)&&o.containsPosition(t.splitPosition)){let e=new Au(t.splitPosition,o.end);e=e._getTransformedBySplitOperation(t);const i=[new Au(o.start,t.splitPosition),e];return lA(i,n)}if(e.targetPosition.isEqual(t.splitPosition)&&i.abRelation==\"insertAtSource\"){n=t.moveTargetPosition}if(e.targetPosition.isEqual(t.insertionPosition)&&i.abRelation==\"insertBetween\"){n=e.targetPosition}const s=o._getTransformedBySplitOperation(t);const r=[s];if(t.graveyardPosition){const n=o.start.isEqual(t.graveyardPosition)||o.containsPosition(t.graveyardPosition);if(e.howMany>1&&n&&!i.aWasUndone){r.push(Au._createFromPositionAndShift(t.insertionPosition,1))}}return lA(r,n)});Qx(Vf,$f,(e,t,i)=>{const n=Au._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(t.sourcePosition)){if(e.type==\"remove\"&&!i.forceWeakRemove){if(!i.aWasUndone){const i=[];let n=t.graveyardPosition.clone();let o=t.targetPosition._getTransformedByMergeOperation(t);if(e.howMany>1){i.push(new Vf(e.sourcePosition,e.howMany-1,e.targetPosition,0));n=n._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1);o=o._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1)}const s=t.deletionPosition._getCombined(e.sourcePosition,e.targetPosition);const r=new Vf(n,1,s,0);const a=r.getMovedRangeStart().path.slice();a.push(0);const c=new xu(r.targetPosition.root,a);o=o._getTransformedByMove(n,s,1);const l=new Vf(o,t.howMany,c,0);i.push(r);i.push(l);return i}}else{if(e.howMany==1){if(!i.bWasUndone){return[new Kx(0)]}else{e.sourcePosition=t.graveyardPosition.clone();e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t);return[e]}}}}const o=Au._createFromPositionAndShift(e.sourcePosition,e.howMany);const s=o._getTransformedByMergeOperation(t);e.sourcePosition=s.start;e.howMany=s.end.offset-s.start.offset;e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t);return[e]});Qx(Uf,Ff,(e,t)=>{e.position=e.position._getTransformedByInsertOperation(t);return[e]});Qx(Uf,$f,(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]});Qx(Uf,Vf,(e,t)=>{e.position=e.position._getTransformedByMoveOperation(t);return[e]});Qx(Uf,Uf,(e,t,i)=>{if(e.position.isEqual(t.position)){if(i.aIsStrong){e.oldName=t.newName}else{return[new Kx(0)]}}return[e]});Qx(Uf,qf,(e,t)=>{const i=e.position.path;const n=t.splitPosition.getParentPath();if(kr(i,n)==\"same\"&&!t.graveyardPosition){const t=new Uf(e.position.getShiftedBy(1),e.oldName,e.newName,0);return[e,t]}e.position=e.position._getTransformedBySplitOperation(t);return[e]});Qx(Wf,Wf,(e,t,i)=>{if(e.root===t.root&&e.key===t.key){if(!i.aIsStrong||e.newValue===t.newValue){return[new Kx(0)]}else{e.oldValue=t.newValue}}return[e]});Qx(qf,Ff,(e,t)=>{if(e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset{if(!e.graveyardPosition&&!i.bWasUndone&&e.splitPosition.hasSameParentAs(t.sourcePosition)){const i=t.graveyardPosition.path.slice();i.push(0);const n=new xu(t.graveyardPosition.root,i);const o=qf.getInsertionPosition(new xu(t.graveyardPosition.root,i));const s=new qf(n,0,null,0);s.insertionPosition=o;e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t);e.insertionPosition=qf.getInsertionPosition(e.splitPosition);e.graveyardPosition=s.insertionPosition.clone();e.graveyardPosition.stickiness=\"toNext\";return[s,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=qf.getInsertionPosition(e.splitPosition);if(e.graveyardPosition){e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)}return[e]});Qx(qf,Vf,(e,t,i)=>{const n=Au._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.graveyardPosition){const o=n.start.isEqual(e.graveyardPosition)||n.containsPosition(e.graveyardPosition);if(!i.bWasUndone&&o){const i=e.splitPosition._getTransformedByMoveOperation(t);const n=e.graveyardPosition._getTransformedByMoveOperation(t);const o=n.path.slice();o.push(0);const s=new xu(n.root,o);const r=new Vf(i,e.howMany,s,0);return[r]}e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(e.splitPosition)){const i=t.howMany-(e.splitPosition.offset-t.sourcePosition.offset);e.howMany-=i;if(e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset{if(e.splitPosition.isEqual(t.splitPosition)){if(!e.graveyardPosition&&!t.graveyardPosition){return[new Kx(0)]}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){return[new Kx(0)]}if(i.abRelation==\"splitBefore\"){e.howMany=0;e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t);return[e]}}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){const n=e.splitPosition.root.rootName==\"$graveyard\";const o=t.splitPosition.root.rootName==\"$graveyard\";const s=n&&!o;const r=o&&!n;const a=r||!s&&i.aIsStrong;if(a){const i=[];if(t.howMany){i.push(new Vf(t.moveTargetPosition,t.howMany,t.splitPosition,0))}if(e.howMany){i.push(new Vf(e.splitPosition,e.howMany,e.moveTargetPosition,0))}return i}else{return[new Kx(0)]}}if(e.graveyardPosition){e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t)}if(e.splitPosition.isEqual(t.insertionPosition)&&i.abRelation==\"splitBefore\"){e.howMany++;return[e]}if(t.splitPosition.isEqual(e.insertionPosition)&&i.baRelation==\"splitBefore\"){const i=t.insertionPosition.path.slice();i.push(0);const n=new xu(t.insertionPosition.root,i);const o=new Vf(e.insertionPosition,1,n,0);return[e,o]}if(e.splitPosition.hasSameParentAs(t.splitPosition)&&e.splitPosition.offset0}addBatch(e){const t=this.editor.model.document.selection;const i={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:i});this.refresh()}clearStack(){this._stack=[];this.refresh()}_restoreSelection(e,t,i){const n=this.editor.model;const o=n.document;const s=[];for(const t of e){const e=uA(t,i);const n=e.find(e=>e.start.root!=o.graveyard);if(n){s.push(n)}}if(s.length){n.change(e=>{e.setSelection(s,{backward:t})})}}_undo(e,t){const i=this.editor.model;const n=i.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 s=Array.from(n.history.getOperations(o));const r=iA([e.getReversed()],s,{useRelations:true,document:this.editor.model.document,padWithNoOps:false,forceWeakRemove:true});const a=r.operationsA;for(const o of a){t.addOperation(o);i.applyOperation(o);n.history.setOperationAsUndone(e,o)}}}}function uA(e,t){const i=e.getTransformedByOperations(t);i.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let e=1;et.batch==e):this._stack.length-1;const i=this._stack.splice(t,1)[0];const n=this.editor.model.createBatch(\"transparent\");this.editor.model.enqueueChange(n,()=>{this._undo(i.batch,n);const e=this.editor.model.document.history.getOperations(i.batch.baseVersion);this._restoreSelection(i.selection.ranges,i.selection.isBackward,e);this.fire(\"revert\",i.batch,n)});this.refresh()}}class fA extends dA{execute(){const e=this._stack.pop();const t=this.editor.model.createBatch(\"transparent\");this.editor.model.enqueueChange(t,()=>{const i=e.batch.operations[e.batch.operations.length-1];const n=i.baseVersion+1;const o=this.editor.model.document.history.getOperations(n);this._restoreSelection(e.selection.ranges,e.selection.isBackward,o);this._undo(e.batch,t)});this.refresh()}}class mA extends db{static get pluginName(){return\"UndoEditing\"}constructor(e){super(e);this._batchRegistry=new WeakSet}init(){const e=this.editor;this._undoCommand=new hA(e);this._redoCommand=new fA(e);e.commands.add(\"undo\",this._undoCommand);e.commands.add(\"redo\",this._redoCommand);this.listenTo(e.model,\"applyOperation\",(e,t)=>{const i=t[0];if(!i.isDocumentOperation){return}const n=i.batch;const o=this._redoCommand._createdBatches.has(n);const s=this._undoCommand._createdBatches.has(n);const r=this._batchRegistry.has(n);if(r||n.type==\"transparent\"&&!o&&!s){return}else{if(o){this._undoCommand.addBatch(n)}else if(!s){this._undoCommand.addBatch(n);this._redoCommand.clearStack()}}this._batchRegistry.add(n)},{priority:\"highest\"});this.listenTo(this._undoCommand,\"revert\",(e,t,i)=>{this._redoCommand.addBatch(i)});e.keystrokes.set(\"CTRL+Z\",\"undo\");e.keystrokes.set(\"CTRL+Y\",\"redo\");e.keystrokes.set(\"CTRL+SHIFT+Z\",\"redo\")}}var gA='';var pA='';class bA extends db{init(){const e=this.editor;const t=e.locale;const i=e.t;const n=t.uiLanguageDirection==\"ltr\"?gA:pA;const o=t.uiLanguageDirection==\"ltr\"?pA:gA;this._addButton(\"undo\",i(\"cz\"),\"CTRL+Z\",n);this._addButton(\"redo\",i(\"da\"),\"CTRL+Y\",o)}_addButton(e,t,i,n){const o=this.editor;o.ui.componentFactory.add(e,s=>{const r=o.commands.get(e);const a=new Sp(s);a.set({label:t,icon:n,keystroke:i,tooltip:true});a.bind(\"isEnabled\").to(r,\"isEnabled\");this.listenTo(a,\"execute\",()=>o.execute(e));return a})}}class wA extends db{static get requires(){return[mA,bA]}static get pluginName(){return\"Undo\"}}const _A=/^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w.-]+)+[\\w\\-._~:/?#[\\]@!$&'()*+,;=]+$/;class vA extends db{static get requires(){return[vy,wA]}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(vy),\"inputTransformation\",()=>{const e=t.selection.getFirstRange();const i=gm.fromPosition(e.start);i.stickiness=\"toPrevious\";const n=gm.fromPosition(e.end);n.stickiness=\"toNext\";t.once(\"change:data\",()=>{this._embedMediaBetweenPositions(i,n);i.detach();n.detach()},{priority:\"high\"})});e.commands.get(\"undo\").on(\"execute\",()=>{if(this._timeoutId){ol.window.clearTimeout(this._timeoutId);this._positionToInsert.detach();this._timeoutId=null;this._positionToInsert=null}},{priority:\"high\"})}_embedMediaBetweenPositions(e,t){const i=this.editor;const n=i.plugins.get(Jx).registry;const o=new zu(e,t);const s=o.getWalker({ignoreElementEnd:true});let r=\"\";for(const e of s){if(e.item.is(\"textProxy\")){r+=e.item.data}}r=r.trim();if(!r.match(_A)){return}if(!n.hasMedia(r)){return}const a=i.commands.get(\"mediaEmbed\");if(!a.isEnabled){return}this._positionToInsert=gm.fromPosition(e);this._timeoutId=ol.window.setTimeout(()=>{i.model.change(e=>{this._timeoutId=null;e.remove(o);let t;if(this._positionToInsert.root.rootName!==\"$graveyard\"){t=this._positionToInsert}Fx(i.model,r,t);this._positionToInsert.detach();this._positionToInsert=null})},100)}}var kA=i(82);class yA extends Qg{constructor(e,t){super(t);const i=t.t;this.focusTracker=new rg;this.keystrokes=new Ym;this.urlInputView=this._createUrlInput();this.saveButtonView=this._createButton(i(\"de\"),Lv,\"ck-button-save\");this.saveButtonView.type=\"submit\";this.cancelButtonView=this._createButton(i(\"df\"),Rv,\"ck-button-cancel\",\"cancel\");this._focusables=new yg;this._focusCycler=new dp({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();Nv({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.inputView.element.value.trim()}set url(e){this.urlInputView.inputView.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 Sv(this.locale,Ov);const i=t.inputView;this._urlInputViewInfoDefault=e(\"ec\");this._urlInputViewInfoTip=e(\"ed\");t.label=e(\"ee\");t.infoText=this._urlInputViewInfoDefault;i.placeholder=\"https://example.com\";i.on(\"input\",()=>{t.infoText=i.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault});return t}_createButton(e,t,i,n){const o=new Sp(this.locale);o.set({label:e,icon:t,tooltip:true});o.extendTemplate({attributes:{class:i}});if(n){o.delegate(\"execute\").to(this,n)}return o}}var xA='';class AA extends db{static get requires(){return[Jx]}static get pluginName(){return\"MediaEmbedUI\"}init(){const e=this.editor;const t=e.commands.get(\"mediaEmbed\");const i=e.plugins.get(Jx).registry;this.form=new yA(CA(e.t,i),e.locale);e.ui.componentFactory.add(\"mediaEmbed\",i=>{const n=Hp(i);this._setUpDropdown(n,this.form,t,e);this._setUpForm(this.form,n,t);return n})}_setUpDropdown(e,t,i){const n=this.editor;const o=n.t;const s=e.buttonView;e.bind(\"isEnabled\").to(i);e.panelView.children.add(t);s.set({label:o(\"dr\"),icon:xA,tooltip:true});s.on(\"open\",()=>{t.url=i.value||\"\";t.urlInputView.select();t.focus()},{priority:\"low\"});e.on(\"submit\",()=>{if(t.isValid()){n.execute(\"mediaEmbed\",t.url);r()}});e.on(\"change:isOpen\",()=>t.resetFormStatus());e.on(\"cancel\",()=>r());function r(){n.editing.view.focus();e.isOpen=false}}_setUpForm(e,t,i){e.delegate(\"submit\",\"cancel\").to(t);e.urlInputView.bind(\"value\").to(i,\"value\");e.urlInputView.bind(\"isReadOnly\").to(i,\"isEnabled\",e=>!e);e.saveButtonView.bind(\"isEnabled\").to(i)}}function CA(e,t){return[t=>{if(!t.url.length){return e(\"ds\")}},i=>{if(!t.hasMedia(i.url)){return e(\"dt\")}}]}var TA=i(84);class MA extends db{static get requires(){return[Jx,AA,vA,kv]}static get pluginName(){return\"MediaEmbed\"}}function PA(e,t){for(const i of e.getChildren()){if(i.is(\"b\")&&i.getStyle(\"font-weight\")===\"normal\"){const n=e.getChildIndex(i);t.remove(i);t.insertChild(n,i.getChildren(),e)}}}function EA(e,t){if(!e.childCount){return}const i=new ky;const n=IA(e,i);if(!n.length){return}let o=null;n.forEach((e,s)=>{if(!o||jA(n[s-1],e)){const n=OA(e,t);o=NA(n,e.element,i)}const r=LA(e.element,i);i.appendChild(r,o)})}function SA(e,t){for(const i of t.createRangeIn(e)){const e=i.item;if(e.is(\"li\")){const i=e.getChild(0);if(i.is(\"p\")){t.unwrapElement(i)}}}}function IA(e,t){const i=t.createRangeIn(e);const n=new Sr({name:/^p|h\\d+$/,styles:{\"mso-list\":/.*/}});const o=[];for(const e of i){if(e.type===\"elementStart\"&&n.match(e.item)){const t=RA(e.item);o.push({element:e.item,id:t.id,order:t.order,indent:t.indent})}}return o}function OA(e,t){const i=new RegExp(`@list l${e.id}:level${e.indent}\\\\s*({[^}]*)`,\"gi\");const n=/mso-level-number-format:([^;]*);/gi;const o=i.exec(t);let s=\"decimal\";if(o&&o[1]){const e=n.exec(o[1]);if(e&&e[1]){s=e[1].trim()}}return{type:s!==\"bullet\"&&s!==\"image\"?\"ol\":\"ul\",style:s}}function NA(e,t,i){const n=new zr(e.type);const o=t.parent.getChildIndex(t);i.insertChild(o,n,t.parent);return n}function LA(e,t){zA(e,t);return t.rename(\"li\",e)}function RA(e){const t={};const i=e.getStyle(\"mso-list\");if(i){const e=i.match(/(^|\\s+)l(\\d+)/i);const n=i.match(/\\s*lfo(\\d+)/i);const o=i.match(/\\s*level(\\d+)/i);if(e&&n&&o){t.id=e[2];t.order=n[1];t.indent=o[1]}}return t}function zA(e,t){const i=new Sr({name:\"span\",styles:{\"mso-list\":\"Ignore\"}});const n=t.createRangeIn(e);for(const e of n){if(e.type===\"elementStart\"&&i.match(e.item)){t.remove(e.item)}}}function jA(e,t){if(e.id!==t.id){return true}const i=t.element.previousSibling;if(!i){return true}return!DA(i)}function DA(e){return e.is(\"ol\")||e.is(\"ul\")}const BA=/id=(\"|')docs-internal-guid-[-0-9a-f]+(\"|')/i;class VA{isActive(e){return BA.test(e)}execute(e){const t=new ky;PA(e.content,t);SA(e.content,t)}}function FA(e){return UA(UA(e)).replace(/([\\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 HA(e){e.querySelectorAll(\"span[style*=spacerun]\").forEach(e=>{const t=e.childNodes&&e.childNodes[0]&&e.childNodes[0].data&&e.childNodes[0].data.length||0;e.innerHTML=Array(t+1).join(\"  \").substr(0,t)})}function UA(e){return e.replace(/(\\s+)<\\/span>/g,(e,t)=>t.length===1?\" \":Array(t.length+1).join(\"  \").substr(0,t.length))}function WA(e){const t=new DOMParser;e=e.replace(/