(\s+)<\/span>/g,((t,e)=>1==e.length?" ":e)).replace(//g,"")}(o.getData("text/html")):o.getData("text/plain")&&(((s=(s=o.getData("text/plain")).replace(//g,">").replace(/\r?\n\r?\n/g,"").replace(/\r?\n/g,"
").replace(/\t/g," ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g," ")).includes("
")||s.includes("
"))&&(s=`
${s}
`),t=s),r=this.editor.data.htmlProcessor.toView(t)}var s;const a=new t.M3(this,"inputTransformation");this.fire(a,{content:r,dataTransfer:o,targetRanges:n.targetRanges,method:n.method}),a.stop.called&&e.stop(),i.scrollToTheSelection()}),{priority:"low"}),this.listenTo(this,"inputTransformation",((t,e)=>{if(e.content.isEmpty)return;const i=this.editor.data.toModel(e.content,"$clipboardHolder");0!=i.childCount&&(t.stop(),n.change((()=>{this.fire("contentInsertion",{content:i,method:e.method,dataTransfer:e.dataTransfer,targetRanges:e.targetRanges})})))}),{priority:"low"}),this.listenTo(this,"contentInsertion",((t,e)=>{e.resultRange=n.insertContent(e.content)}),{priority:"low"})}_setupCopyCut(){const t=this.editor,e=t.model.document,n=t.editing.view.document,i=(i,o)=>{const r=o.dataTransfer;o.preventDefault();const s=t.data.toView(t.model.getSelectedContent(e.selection));n.fire("clipboardOutput",{dataTransfer:r,content:s,method:i.name})};this.listenTo(n,"copy",i,{priority:"low"}),this.listenTo(n,"cut",((e,n)=>{t.isReadOnly?n.preventDefault():i(e,n)}),{priority:"low"}),this.listenTo(n,"clipboardOutput",((n,i)=>{i.content.isEmpty||(i.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(i.content)),i.dataTransfer.setData("text/plain",vf(i.content))),"cut"==i.method&&t.model.deleteContent(e.selection)}),{priority:"low"})}}class yf extends((0,t.ln)()){constructor(){super(),this._stack=[]}add(t,e){const n=this._stack,i=n[0];this._insertDescriptor(t);const o=n[0];i===o||Ef(i,o)||this.fire("change:top",{oldDescriptor:i,newDescriptor:o,writer:e})}remove(t,e){const n=this._stack,i=n[0];this._removeDescriptor(t);const o=n[0];i===o||Ef(i,o)||this.fire("change:top",{oldDescriptor:i,newDescriptor:o,writer:e})}_insertDescriptor(t){const e=this._stack,n=e.findIndex((e=>e.id===t.id));if(Ef(t,e[n]))return;n>-1&&e.splice(n,1);let i=0;for(;e[i]&&Tf(e[i],t);)i++;e.splice(i,0,t)}_removeDescriptor(t){const e=this._stack,n=e.findIndex((e=>e.id===t));n>-1&&e.splice(n,1)}}function Ef(t,e){return t&&e&&t.priority==e.priority&&Df(t.classes)==Df(e.classes)}function Tf(t,e){return t.priority>e.priority||!(t.priorityDf(e.classes)}function Df(t){return Array.isArray(t)?t.sort().join(","):t}const Sf='',If="ck-widget_selected";function Bf(t){return!!t.is("element")&&!!t.getCustomProperty("widget")}function Mf(e,n,i={}){if(!e.is("containerElement"))throw new t.Bb("widget-to-widget-wrong-element-type",null,{element:e});return n.setAttribute("contenteditable","false",e),n.addClass("ck-widget",e),n.setCustomProperty("widget",!0,e),e.getFillerOffset=zf,n.setCustomProperty("widgetLabel",[],e),i.label&&function(t,e){const n=t.getCustomProperty("widgetLabel");n.push(e)}(e,i.label),i.hasSelectionHandle&&function(t,e){const n=e.createUIElement("div",{class:"ck ck-widget__selection-handle"},(function(t){const e=this.toDomElement(t),n=new tc;return n.set("content",Sf),n.render(),e.appendChild(n.element),e}));e.insert(e.createPositionAt(t,0),n),e.addClass(["ck-widget_with-selection-handle"],t)}(e,n),Rf(e,n),e}function Nf(e,n,i){if(n.classes&&i.addClass((0,t.qo)(n.classes),e),n.attributes)for(const t in n.attributes)i.setAttribute(t,n.attributes[t],e)}function Of(e,n,i){if(n.classes&&i.removeClass((0,t.qo)(n.classes),e),n.attributes)for(const t in n.attributes)i.removeAttribute(t,e)}function Rf(t,e,n=Nf,i=Of){const o=new yf;o.on("change:top",((e,o)=>{o.oldDescriptor&&i(t,o.oldDescriptor,o.writer),o.newDescriptor&&n(t,o.newDescriptor,o.writer)}));e.setCustomProperty("addHighlight",((t,e,n)=>o.add(e,n)),t),e.setCustomProperty("removeHighlight",((t,e,n)=>o.remove(e,n)),t)}function Pf(t,e,n={}){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],t),e.setAttribute("role","textbox",t),n.label&&e.setAttribute("aria-label",n.label,t),e.setAttribute("contenteditable",t.isReadOnly?"false":"true",t),t.on("change:isReadOnly",((n,i,o)=>{e.setAttribute("contenteditable",o?"false":"true",t)})),t.on("change:isFocused",((n,i,o)=>{o?e.addClass("ck-editor__nested-editable_focused",t):e.removeClass("ck-editor__nested-editable_focused",t)})),Rf(t,e),t}function Lf(t,e){const n=t.getSelectedElement();if(n){const i=Vf(t);if(i)return e.createRange(e.createPositionAt(n,i))}return Jr(t,e)}function zf(){return null}const jf="widget-type-around";function Ff(t,e,n){return!!t&&Bf(t)&&!n.isInline(e)}function Vf(t){return t.getAttribute(jf)}var Uf=__webpack_require__(5137),Hf={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(Uf.Z,Hf);Uf.Z.locals;const qf=["before","after"],Wf=(new DOMParser).parseFromString('',"image/svg+xml").firstChild,Gf="ck-widget__type-around_disabled";class Zf extends e{static get pluginName(){return"WidgetTypeAround"}static get requires(){return[ih,Fd]}constructor(t){super(t),this._currentFakeCaretModelElement=null}init(){const t=this.editor,e=t.editing.view;this.on("change:isEnabled",((n,i,o)=>{e.change((t=>{for(const n of e.document.roots)o?t.removeClass(Gf,n):t.addClass(Gf,n)})),o||t.model.change((t=>{t.removeSelectionAttribute(jf)}))})),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){super.destroy(),this._currentFakeCaretModelElement=null}_insertParagraph(t,e){const n=this.editor,i=n.editing.view,o=n.model.schema.getAttributesWithProperty(t,"copyOnReplace",!0);n.execute("insertParagraph",{position:n.model.createPositionAt(t,e),attributes:o}),i.focus(),i.scrollToTheSelection()}_listenToIfEnabled(t,e,n,i){this.listenTo(t,e,((...t)=>{this.isEnabled&&n(...t)}),i)}_insertParagraphAccordingToFakeCaretPosition(){const t=this.editor.model.document.selection,e=Vf(t);if(!e)return!1;const n=t.getSelectedElement();return this._insertParagraph(n,e),!0}_enableTypeAroundUIInjection(){const t=this.editor,e=t.model.schema,n=t.locale.t,i={before:n("Insert paragraph before block"),after:n("Insert paragraph after block")};t.editing.downcastDispatcher.on("insert",((t,o,r)=>{const s=r.mapper.toViewElement(o.item);if(s&&Ff(s,o.item,e)){!function(t,e,n){const i=t.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},(function(t){const n=this.toDomElement(t);return function(t,e){for(const n of qf){const i=new Xs({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${n}`],title:e[n],"aria-hidden":"true"},children:[t.ownerDocument.importNode(Wf,!0)]});t.appendChild(i.render())}}(n,e),function(t){const e=new Xs({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});t.appendChild(e.render())}(n),n}));t.insert(t.createPositionAt(n,"end"),i)}(r.writer,i,s);s.getCustomProperty("widgetLabel").push((()=>this.isEnabled?n("Press Enter to type after or press Shift + Enter to type before the widget"):""))}}),{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const t=this.editor,e=t.model,n=e.document.selection,i=e.schema,o=t.editing.view;function r(t){return`ck-widget_type-around_show-fake-caret_${t}`}this._listenToIfEnabled(o.document,"arrowKey",((t,e)=>{this._handleArrowKeyPress(t,e)}),{context:[Bf,"$text"],priority:"high"}),this._listenToIfEnabled(n,"change:range",((e,n)=>{n.directChange&&t.model.change((t=>{t.removeSelectionAttribute(jf)}))})),this._listenToIfEnabled(e.document,"change:data",(()=>{const e=n.getSelectedElement();if(e){if(Ff(t.editing.mapper.toViewElement(e),e,i))return}t.model.change((t=>{t.removeSelectionAttribute(jf)}))})),this._listenToIfEnabled(t.editing.downcastDispatcher,"selection",((t,e,n)=>{const o=n.writer;if(this._currentFakeCaretModelElement){const t=n.mapper.toViewElement(this._currentFakeCaretModelElement);t&&(o.removeClass(qf.map(r),t),this._currentFakeCaretModelElement=null)}const s=e.selection.getSelectedElement();if(!s)return;const a=n.mapper.toViewElement(s);if(!Ff(a,s,i))return;const c=Vf(e.selection);c&&(o.addClass(r(c),a),this._currentFakeCaretModelElement=s)})),this._listenToIfEnabled(t.ui.focusTracker,"change:isFocused",((e,n,i)=>{i||t.model.change((t=>{t.removeSelectionAttribute(jf)}))}))}_handleArrowKeyPress(e,n){const i=this.editor,o=i.model,r=o.document.selection,s=o.schema,a=i.editing.view,c=n.keyCode,l=(0,t.Zt)(c,i.locale.contentLanguageDirection),d=a.document.selection.getSelectedElement();let u;Ff(d,i.editing.mapper.toModelElement(d),s)?u=this._handleArrowKeyPressOnSelectedWidget(l):r.isCollapsed?u=this._handleArrowKeyPressWhenSelectionNextToAWidget(l):n.shiftKey||(u=this._handleArrowKeyPressWhenNonCollapsedSelection(l)),u&&(n.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(t){const e=this.editor.model,n=Vf(e.document.selection);return e.change((e=>{if(!n)return e.setSelectionAttribute(jf,t?"after":"before"),!0;if(!(n===(t?"after":"before")))return e.removeSelectionAttribute(jf),!0;return!1}))}_handleArrowKeyPressWhenSelectionNextToAWidget(t){const e=this.editor,n=e.model,i=n.schema,o=e.plugins.get("Widget"),r=o._getObjectElementNextToSelection(t);return!!Ff(e.editing.mapper.toViewElement(r),r,i)&&(n.change((e=>{o._setSelectionOverElement(r),e.setSelectionAttribute(jf,t?"before":"after")})),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(t){const e=this.editor,n=e.model,i=n.schema,o=e.editing.mapper,r=n.document.selection,s=t?r.getLastPosition().nodeBefore:r.getFirstPosition().nodeAfter;return!!Ff(o.toViewElement(s),s,i)&&(n.change((e=>{e.setSelection(s,"on"),e.setSelectionAttribute(jf,t?"after":"before")})),!0)}_enableInsertingParagraphsOnButtonClick(){const t=this.editor,e=t.editing.view;this._listenToIfEnabled(e.document,"mousedown",((n,i)=>{const o=i.domTarget.closest(".ck-widget__type-around__button");if(!o)return;const r=function(t){return t.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(o),s=function(t,e){const n=t.closest(".ck-widget");return e.mapDomToView(n)}(o,e.domConverter),a=t.editing.mapper.toModelElement(s);this._insertParagraph(a,r),i.preventDefault(),n.stop()}))}_enableInsertingParagraphsOnEnterKeypress(){const t=this.editor,e=t.model.document.selection,n=t.editing.view;this._listenToIfEnabled(n.document,"enter",((n,i)=>{if("atTarget"!=n.eventPhase)return;const o=e.getSelectedElement(),r=t.editing.mapper.toViewElement(o),s=t.model.schema;let a;this._insertParagraphAccordingToFakeCaretPosition()?a=!0:Ff(r,o,s)&&(this._insertParagraph(o,i.isSoft?"before":"after"),a=!0),a&&(i.preventDefault(),n.stop())}),{context:Bf})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor.editing.view.document;this._listenToIfEnabled(e,"insertText",((t,n)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(n.selection=e.selection)}),{priority:"high"}),t.OB.isAndroid?this._listenToIfEnabled(e,"keydown",((t,e)=>{229==e.keyCode&&this._insertParagraphAccordingToFakeCaretPosition()})):this._listenToIfEnabled(e,"compositionstart",(()=>{this._insertParagraphAccordingToFakeCaretPosition()}),{priority:"high"})}_enableDeleteIntegration(){const t=this.editor,e=t.editing.view,n=t.model,i=n.schema;this._listenToIfEnabled(e.document,"delete",((e,o)=>{if("atTarget"!=e.eventPhase)return;const r=Vf(n.document.selection);if(!r)return;const s=o.direction,a=n.document.selection.getSelectedElement(),c="forward"==s;if("before"===r===c)t.execute("delete",{selection:n.createSelection(a,"on")});else{const e=i.getNearestSelectionRange(n.createPositionAt(a,r),s);if(e)if(e.isCollapsed){const o=n.createSelection(e.start);if(n.modifySelection(o,{direction:s}),o.focus.isEqual(e.start)){const t=function(t,e){let n=e;for(const i of e.getAncestors({parentFirst:!0})){if(i.childCount>1||t.isLimit(i))break;n=i}return n}(i,e.start.parent);n.deleteContent(n.createSelection(t,"on"),{doNotAutoparagraph:!0})}else n.change((n=>{n.setSelection(e),t.execute(c?"deleteForward":"delete")}))}else n.change((n=>{n.setSelection(e),t.execute(c?"deleteForward":"delete")}))}o.preventDefault(),e.stop()}),{context:Bf})}_enableInsertContentIntegration(){const t=this.editor,e=this.editor.model,n=e.document.selection;this._listenToIfEnabled(t.model,"insertContent",((t,[i,o])=>{if(o&&!o.is("documentSelection"))return;const r=Vf(n);return r?(t.stop(),e.change((t=>{const o=n.getSelectedElement(),s=e.createPositionAt(o,r),a=t.createSelection(s),c=e.insertContent(i,a);return t.setSelection(a),c}))):void 0}),{priority:"high"})}_enableInsertObjectIntegration(){const t=this.editor,e=this.editor.model.document.selection;this._listenToIfEnabled(t.model,"insertObject",((t,n)=>{const[,i,,o={}]=n;if(i&&!i.is("documentSelection"))return;const r=Vf(e);r&&(o.findOptimalPosition=r,n[3]=o)}),{priority:"high"})}_enableDeleteContentIntegration(){const t=this.editor,e=this.editor.model.document.selection;this._listenToIfEnabled(t.model,"deleteContent",((t,[n])=>{if(n&&!n.is("documentSelection"))return;Vf(e)&&t.stop()}),{priority:"high"})}}function Kf(e){const n=e.model;return(i,o)=>{const r=o.keyCode==t.Do.arrowup,s=o.keyCode==t.Do.arrowdown,a=o.shiftKey,c=n.document.selection;if(!r&&!s)return;const l=s;if(a&&function(t,e){return!t.isCollapsed&&t.isBackward==e}(c,l))return;const d=function(t,e,n){const i=t.model;if(n){const t=e.isCollapsed?e.focus:e.getLastPosition(),n=$f(i,t,"forward");if(!n)return null;const o=i.createRange(t,n),r=Yf(i.schema,o,"backward");return r?i.createRange(t,r):null}{const t=e.isCollapsed?e.focus:e.getFirstPosition(),n=$f(i,t,"backward");if(!n)return null;const o=i.createRange(n,t),r=Yf(i.schema,o,"forward");return r?i.createRange(r,t):null}}(e,c,l);if(d){if(d.isCollapsed){if(c.isCollapsed)return;if(a)return}(d.isCollapsed||function(e,n,i){const o=e.model,r=e.view.domConverter;if(i){const t=o.createSelection(n.start);o.modifySelection(t),t.focus.isAtEnd||n.start.isEqual(t.focus)||(n=o.createRange(t.focus,n.end))}const s=e.mapper.toViewRange(n),a=r.viewRangeToDom(s),c=t.UL.getDomRangeRects(a);let l;for(const t of c)if(void 0!==l){if(Math.round(t.top)>=l)return!1;l=Math.max(l,Math.round(t.bottom))}else l=Math.round(t.bottom);return!0}(e,d,l))&&(n.change((t=>{const e=l?d.end:d.start;if(a){const i=n.createSelection(c.anchor);i.setFocus(e),t.setSelection(i)}else t.setSelection(e)})),i.stop(),o.preventDefault(),o.stopPropagation())}}}function $f(t,e,n){const i=t.schema,o=t.createRangeIn(e.root),r="forward"==n?"elementStart":"elementEnd";for(const{previousPosition:t,item:s,type:a}of o.getWalker({startPosition:e,direction:n})){if(i.isLimit(s)&&!i.isInline(s))return t;if(a==r&&i.isBlock(s))return null}return null}function Yf(t,e,n){const i="backward"==n?e.end:e.start;if(t.checkChild(i,"$text"))return i;for(const{nextPosition:i}of e.getWalker({direction:n}))if(t.checkChild(i,"$text"))return i;return null}var Jf=__webpack_require__(6507),Qf={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(Jf.Z,Qf);Jf.Z.locals;class Xf extends e{static get pluginName(){return"Widget"}static get requires(){return[Zf,Fd]}init(){const t=this.editor,e=t.editing.view,n=e.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",((e,n,i)=>{const o=i.writer,r=n.selection;if(r.isCollapsed)return;const s=r.getSelectedElement();if(!s)return;const a=t.editing.mapper.toViewElement(s);var c;Bf(a)&&(i.consumable.consume(r,"selection")&&o.setSelection(o.createRangeOn(a),{fake:!0,label:(c=a,c.getCustomProperty("widgetLabel").reduce(((t,e)=>"function"==typeof e?t?t+". "+e():e():t?t+". "+e:e),""))}))})),this.editor.editing.downcastDispatcher.on("selection",((t,e,n)=>{this._clearPreviouslySelectedWidgets(n.writer);const i=n.writer,o=i.document.selection;let r=null;for(const t of o.getRanges())for(const e of t){const t=e.item;Bf(t)&&!tb(t,r)&&(i.addClass(If,t),this._previouslySelected.add(t),r=t)}}),{priority:"low"}),e.addObserver(rs),this.listenTo(n,"mousedown",((...t)=>this._onMousedown(...t))),this.listenTo(n,"arrowKey",((...t)=>{this._handleSelectionChangeOnArrowKeyPress(...t)}),{context:[Bf,"$text"]}),this.listenTo(n,"arrowKey",((...t)=>{this._preventDefaultOnArrowKeyPress(...t)}),{context:"$root"}),this.listenTo(n,"arrowKey",Kf(this.editor.editing),{context:"$text"}),this.listenTo(n,"delete",((t,e)=>{this._handleDelete("forward"==e.direction)&&(e.preventDefault(),t.stop())}),{context:"$root"})}_onMousedown(e,n){const i=this.editor,o=i.editing.view,r=o.document;let s=n.target;if(function(t){let e=t;for(;e;){if(e.is("editableElement")&&!e.is("rootElement"))return!0;if(Bf(e))return!1;e=e.parent}return!1}(s)){if((t.OB.isSafari||t.OB.isGecko)&&n.domEvent.detail>=3){const t=i.editing.mapper,e=s.is("attributeElement")?s.findAncestor((t=>!t.is("attributeElement"))):s,o=t.toModelElement(e);n.preventDefault(),this.editor.model.change((t=>{t.setSelection(o,"in")}))}return}if(!Bf(s)&&(s=s.findAncestor(Bf),!s))return;t.OB.isAndroid&&n.preventDefault(),r.isFocused||o.focus();const a=i.editing.mapper.toModelElement(s);this._setSelectionOverElement(a)}_handleSelectionChangeOnArrowKeyPress(e,n){const i=n.keyCode,o=this.editor.model,r=o.schema,s=o.document.selection,a=s.getSelectedElement(),c=(0,t.mA)(i,this.editor.locale.contentLanguageDirection),l="down"==c||"right"==c,d="up"==c||"down"==c;if(a&&r.isObject(a)){const t=l?s.getLastPosition():s.getFirstPosition(),i=r.getNearestSelectionRange(t,l?"forward":"backward");return void(i&&(o.change((t=>{t.setSelection(i)})),n.preventDefault(),e.stop()))}if(!s.isCollapsed&&!n.shiftKey){const t=s.getFirstPosition(),i=s.getLastPosition(),a=t.nodeAfter,c=i.nodeBefore;return void((a&&r.isObject(a)||c&&r.isObject(c))&&(o.change((e=>{e.setSelection(l?i:t)})),n.preventDefault(),e.stop()))}if(!s.isCollapsed)return;const u=this._getObjectElementNextToSelection(l);if(u&&r.isObject(u)){if(r.isInline(u)&&d)return;this._setSelectionOverElement(u),n.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(t,e){const n=this.editor.model,i=n.schema,o=n.document.selection.getSelectedElement();o&&i.isObject(o)&&(e.preventDefault(),t.stop())}_handleDelete(t){if(this.editor.isReadOnly)return;const e=this.editor.model.document.selection;if(!e.isCollapsed)return;const n=this._getObjectElementNextToSelection(t);return n?(this.editor.model.change((t=>{let i=e.anchor.parent;for(;i.isEmpty;){const e=i;i=e.parent,t.remove(e)}this._setSelectionOverElement(n)})),!0):void 0}_setSelectionOverElement(t){this.editor.model.change((e=>{e.setSelection(e.createRangeOn(t))}))}_getObjectElementNextToSelection(t){const e=this.editor.model,n=e.schema,i=e.document.selection,o=e.createSelection(i);if(e.modifySelection(o,{direction:t?"forward":"backward"}),o.isEqual(i))return null;const r=t?o.focus.nodeBefore:o.focus.nodeAfter;return r&&n.isObject(r)?r:null}_clearPreviouslySelectedWidgets(t){for(const e of this._previouslySelected)t.removeClass(If,e);this._previouslySelected.clear()}}function tb(t,e){return!!e&&Array.from(t.getAncestors()).includes(e)}class eb extends e{static get requires(){return[Tl]}static get pluginName(){return"WidgetToolbarRepository"}init(){const t=this.editor;if(t.plugins.has("BalloonToolbar")){const e=t.plugins.get("BalloonToolbar");this.listenTo(e,"show",(e=>{(function(t){const e=t.getSelectedElement();return!(!e||!Bf(e))})(t.editing.view.document.selection)&&e.stop()}),{priority:"high"})}this._toolbarDefinitions=new Map,this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",(()=>{this._updateToolbarsVisibility()})),this.listenTo(t.ui,"update",(()=>{this._updateToolbarsVisibility()})),this.listenTo(t.ui.focusTracker,"change:isFocused",(()=>{this._updateToolbarsVisibility()}),{priority:"low"})}destroy(){super.destroy();for(const t of this._toolbarDefinitions.values())t.view.destroy()}register(e,{ariaLabel:n,items:i,getRelatedElement:o,balloonClassName:r="ck-toolbar-container"}){if(!i.length)return void(0,t.KE)("widget-toolbar-no-items",{toolbarId:e});const s=this.editor,a=s.t,c=new Nc(s.locale);if(c.ariaLabel=n||a("Widget toolbar"),this._toolbarDefinitions.has(e))throw new t.Bb("widget-toolbar-duplicated",this,{toolbarId:e});c.fillFromConfig(i,s.ui.componentFactory);const l={view:c,getRelatedElement:o,balloonClassName:r};s.ui.addToolbar(c,{isContextual:!0,beforeFocus:()=>{const t=o(s.editing.view.document.selection);t&&this._showToolbar(l,t)},afterBlur:()=>{this._hideToolbar(l)}}),this._toolbarDefinitions.set(e,l)}_updateToolbarsVisibility(){let t=0,e=null,n=null;for(const i of this._toolbarDefinitions.values()){const o=i.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&o)if(this.editor.ui.focusTracker.isFocused){const r=o.getAncestors().length;r>t&&(t=r,e=o,n=i)}else this._isToolbarVisible(i)&&this._hideToolbar(i);else this._isToolbarInBalloon(i)&&this._hideToolbar(i)}n&&this._showToolbar(n,e)}_hideToolbar(t){this._balloon.remove(t.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(t,e){this._isToolbarVisible(t)?nb(this.editor,e):this._isToolbarInBalloon(t)||(this._balloon.add({view:t.view,position:ib(this.editor,e),balloonClassName:t.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",(()=>{for(const t of this._toolbarDefinitions.values())if(this._isToolbarVisible(t)){const e=t.getRelatedElement(this.editor.editing.view.document.selection);nb(this.editor,e)}})))}_isToolbarVisible(t){return this._balloon.visibleView===t.view}_isToolbarInBalloon(t){return this._balloon.hasView(t.view)}}function nb(t,e){const n=t.plugins.get("ContextualBalloon"),i=ib(t,e);n.updatePosition(i)}function ib(t,e){const n=t.editing.view,i=Da.defaultPositions;return{target:n.domConverter.mapViewToDom(e),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast,i.viewportStickyNorth]}}class ob extends((0,t.Re)()){constructor(t){super(),this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=t,this._referenceCoordinates=null}get originalWidth(){return this._originalWidth}get originalHeight(){return this._originalHeight}get originalWidthPercents(){return this._originalWidthPercents}get aspectRatio(){return this._aspectRatio}begin(e,n,i){const o=new t.UL(n);this.activeHandlePosition=function(t){const e=["top-left","top-right","bottom-right","bottom-left"];for(const n of e)if(t.classList.contains(rb(n)))return n}(e),this._referenceCoordinates=function(e,n){const i=new t.UL(e),o=n.split("-"),r={x:"right"==o[1]?i.right:i.left,y:"bottom"==o[0]?i.bottom:i.top};return r.x+=e.ownerDocument.defaultView.scrollX,r.y+=e.ownerDocument.defaultView.scrollY,r}(n,function(t){const e=t.split("-"),n={top:"bottom",bottom:"top",left:"right",right:"left"};return`${n[e[0]]}-${n[e[1]]}`}(this.activeHandlePosition)),this._originalWidth=o.width,this._originalHeight=o.height,this._aspectRatio=o.width/o.height;const r=i.style.width;r&&r.match(/^\d+(\.\d*)?%$/)?this._originalWidthPercents=parseFloat(r):this._originalWidthPercents=function(t,e){const n=t.parentElement,i=parseFloat(n.ownerDocument.defaultView.getComputedStyle(n).width);return e.width/i*100}(i,o)}update(t){this.proposedWidth=t.width,this.proposedHeight=t.height,this.proposedWidthPercents=t.widthPercents,this.proposedHandleHostWidth=t.handleHostWidth,this.proposedHandleHostHeight=t.handleHostHeight}}function rb(t){return`ck-widget__resizer__handle-${t}`}class sb extends Aa{constructor(){super();const t=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",t.to("_viewPosition",(t=>t?`ck-orientation-${t}`:""))],style:{display:t.if("_isVisible","none",(t=>!t))}},children:[{text:t.to("_label")}]})}_bindToState(t,e){this.bind("_isVisible").to(e,"proposedWidth",e,"proposedHeight",((t,e)=>null!==t&&null!==e)),this.bind("_label").to(e,"proposedHandleHostWidth",e,"proposedHandleHostHeight",e,"proposedWidthPercents",((e,n,i)=>"px"===t.unit?`${e}×${n}`:`${i}%`)),this.bind("_viewPosition").to(e,"activeHandlePosition",e,"proposedHandleHostWidth",e,"proposedHandleHostHeight",((t,e,n)=>e<50||n<50?"above-center":t))}_dismiss(){this.unbind(),this._isVisible=!1}}class ab extends((0,t.Re)()){constructor(t){super(),this._options=t,this._viewResizerWrapper=null,this.set("isEnabled",!0),this.set("isSelected",!1),this.bind("isVisible").to(this,"isEnabled",this,"isSelected",((t,e)=>t&&e)),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",(t=>{this.state.proposedWidth||this.state.proposedWidthPercents||(this._cleanup(),t.stop())}),{priority:"high"})}get state(){return this._state}show(){this._options.editor.editing.view.change((t=>{t.removeClass("ck-hidden",this._viewResizerWrapper)}))}hide(){this._options.editor.editing.view.change((t=>{t.addClass("ck-hidden",this._viewResizerWrapper)}))}attach(){const t=this,e=this._options.viewElement;this._options.editor.editing.view.change((n=>{const i=n.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},(function(e){const n=this.toDomElement(e);return t._appendHandles(n),t._appendSizeUI(n),n}));n.insert(n.createPositionAt(e,"end"),i),n.addClass("ck-widget_with-resizer",e),this._viewResizerWrapper=i,this.isVisible||this.hide()})),this.on("change:isVisible",(()=>{this.isVisible?(this.show(),this.redraw()):this.hide()}))}begin(t){this._state=new ob(this._options),this._sizeView._bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(t,this._getHandleHost(),this._getResizeHost())}updateSize(e){const n=this._proposeNewSize(e);this._options.editor.editing.view.change((t=>{const e=this._options.unit||"%",i=("%"===e?n.widthPercents:n.width)+e;t.setStyle("width",i,this._options.viewElement)}));const i=this._getHandleHost(),o=new t.UL(i),r=Math.round(o.width),s=Math.round(o.height),a=new t.UL(i);n.width=Math.round(a.width),n.height=Math.round(a.height),this.redraw(o),this.state.update({...n,handleHostWidth:r,handleHostHeight:s})}commit(){const t=this._options.unit||"%",e=("%"===t?this.state.proposedWidthPercents:this.state.proposedWidth)+t;this._options.editor.editing.view.change((()=>{this._cleanup(),this._options.onCommit(e)}))}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(e){const n=this._domResizerWrapper;if(!((i=n)&&i.ownerDocument&&i.ownerDocument.contains(i)))return;var i;const o=n.parentElement,r=this._getHandleHost(),s=this._viewResizerWrapper,a=[s.getStyle("width"),s.getStyle("height"),s.getStyle("left"),s.getStyle("top")];let c;if(o.isSameNode(r)){const n=e||new t.UL(r);c=[n.width+"px",n.height+"px",void 0,void 0]}else c=[r.offsetWidth+"px",r.offsetHeight+"px",r.offsetLeft+"px",r.offsetTop+"px"];"same"!==(0,t.Rt)(a,c)&&this._options.editor.editing.view.change((t=>{t.setStyle({width:c[0],height:c[1],left:c[2],top:c[3]},s)}))}containsHandle(t){return this._domResizerWrapper.contains(t)}static isResizeHandle(t){return t.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss();this._options.editor.editing.view.change((t=>{t.setStyle("width",this._initialViewWidth,this._options.viewElement)}))}_proposeNewSize(t){const e=this.state,n={x:(i=t).pageX,y:i.pageY};var i;const o=!this._options.isCentered||this._options.isCentered(this),r={x:e._referenceCoordinates.x-(n.x+e.originalWidth),y:n.y-e.originalHeight-e._referenceCoordinates.y};o&&e.activeHandlePosition.endsWith("-right")&&(r.x=n.x-(e._referenceCoordinates.x+e.originalWidth)),o&&(r.x*=2);let s=Math.abs(e.originalWidth+r.x),a=Math.abs(e.originalHeight+r.y);return"width"==(s/e.aspectRatio>a?"width":"height")?a=s/e.aspectRatio:s=a*e.aspectRatio,{width:Math.round(s),height:Math.round(a),widthPercents:Math.min(Math.round(e.originalWidthPercents/e.originalWidth*s*100)/100,100)}}_getResizeHost(){const t=this._domResizerWrapper.parentElement;return this._options.getResizeHost(t)}_getHandleHost(){const t=this._domResizerWrapper.parentElement;return this._options.getHandleHost(t)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(t){const e=["top-left","top-right","bottom-right","bottom-left"];for(const i of e)t.appendChild(new Xs({tag:"div",attributes:{class:"ck-widget__resizer__handle "+(n=i,`ck-widget__resizer__handle-${n}`)}}).render());var n}_appendSizeUI(t){this._sizeView=new sb,this._sizeView.render(),t.appendChild(this._sizeView.element)}}const cb=function(t,e,n){var i=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return(0,S.Z)(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),En(t,e,{leading:i,maxWait:e,trailing:o})};var lb=__webpack_require__(2263),db={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(lb.Z,db);lb.Z.locals;class ub extends e{static get pluginName(){return"WidgetResize"}init(){const e=this.editor.editing,n=t.CO.window.document;this.set("selectedResizer",null),this.set("_activeResizer",null),this._resizers=new Map,e.view.addObserver(rs),this._observer=new((0,t.Xu)()),this.listenTo(e.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(n,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(n,"mouseup",this._mouseUpListener.bind(this)),this._redrawSelectedResizerThrottled=cb((()=>this.redrawSelectedResizer()),200),this.editor.ui.on("update",this._redrawSelectedResizerThrottled),this.editor.model.document.on("change",(()=>{for(const[t,e]of this._resizers)t.isAttached()||(this._resizers.delete(t),e.destroy())}),{priority:"lowest"}),this._observer.listenTo(t.CO.window,"resize",this._redrawSelectedResizerThrottled);const i=this.editor.editing.view.document.selection;i.on("change",(()=>{const t=i.getSelectedElement(),e=this.getResizerByViewElement(t)||null;e?this.select(e):this.deselect()}))}redrawSelectedResizer(){this.selectedResizer&&this.selectedResizer.isVisible&&this.selectedResizer.redraw()}destroy(){super.destroy(),this._observer.stopListening();for(const t of this._resizers.values())t.destroy();this._redrawSelectedResizerThrottled.cancel()}select(t){this.deselect(),this.selectedResizer=t,this.selectedResizer.isSelected=!0}deselect(){this.selectedResizer&&(this.selectedResizer.isSelected=!1),this.selectedResizer=null}attachTo(t){const e=new ab(t),n=this.editor.plugins;if(e.attach(),n.has("WidgetToolbarRepository")){const t=n.get("WidgetToolbarRepository");e.on("begin",(()=>{t.forceDisabled("resize")}),{priority:"lowest"}),e.on("cancel",(()=>{t.clearForceDisabled("resize")}),{priority:"highest"}),e.on("commit",(()=>{t.clearForceDisabled("resize")}),{priority:"highest"})}this._resizers.set(t.viewElement,e);const i=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(i)==e&&this.select(e),e}getResizerByViewElement(t){return this._resizers.get(t)}_getResizerByHandle(t){for(const e of this._resizers.values())if(e.containsHandle(t))return e}_mouseDownListener(t,e){const n=e.domTarget;ab.isResizeHandle(n)&&(this._activeResizer=this._getResizerByHandle(n)||null,this._activeResizer&&(this._activeResizer.begin(n),t.stop(),e.preventDefault()))}_mouseMoveListener(t,e){this._activeResizer&&this._activeResizer.updateSize(e)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}}var hb=__webpack_require__(390),mb={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(hb.Z,mb);hb.Z.locals;class gb extends e{static get pluginName(){return"DragDrop"}static get requires(){return[Cf,Xf]}init(){const e=this.editor,n=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,this._updateDropMarkerThrottled=cb((t=>this._updateDropMarker(t)),40),this._removeDropMarkerDelayed=bb((()=>this._removeDropMarker()),40),this._clearDraggableAttributesDelayed=bb((()=>this._clearDraggableAttributes()),40),n.addObserver(_f),n.addObserver(rs),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDropMarker(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",((t,e,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})),this.on("change:isEnabled",((t,e,n)=>{n||this._finalizeDragging(!1)})),t.OB.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._updateDropMarkerThrottled.cancel(),this._removeDropMarkerDelayed.cancel(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const e=this.editor,n=e.model,i=n.document,o=e.editing.view,r=o.document;this.listenTo(r,"dragstart",((o,s)=>{const a=i.selection;if(s.target&&s.target.is("editableElement"))return void s.preventDefault();const c=s.target?kb(s.target):null;if(c){const t=e.editing.mapper.toModelElement(c);this._draggedRange=Oi.fromRange(n.createRangeOn(t)),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop")}else if(!r.selection.isCollapsed){const t=r.selection.getSelectedElement();t&&Bf(t)||(this._draggedRange=Oi.fromRange(a.getFirstRange()))}if(!this._draggedRange)return void s.preventDefault();this._draggingUid=(0,t.hQ)(),s.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",s.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const l=n.createSelection(this._draggedRange.toRange()),d=e.data.toView(n.getSelectedContent(l));r.fire("clipboardOutput",{dataTransfer:s.dataTransfer,content:d,method:"dragstart"}),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")}),{priority:"low"}),this.listenTo(r,"dragend",((t,e)=>{this._finalizeDragging(!e.dataTransfer.isCanceled&&"move"==e.dataTransfer.dropEffect)}),{priority:"low"}),this.listenTo(r,"dragenter",(()=>{this.isEnabled&&o.focus()})),this.listenTo(r,"dragleave",(()=>{this._removeDropMarkerDelayed()})),this.listenTo(r,"dragging",((n,i)=>{if(!this.isEnabled)return void(i.dataTransfer.dropEffect="none");this._removeDropMarkerDelayed.cancel();const o=pb(e,i.targetRanges,i.target);this._draggedRange||(i.dataTransfer.dropEffect="copy"),t.OB.isGecko||("copy"==i.dataTransfer.effectAllowed?i.dataTransfer.dropEffect="copy":["all","copyMove"].includes(i.dataTransfer.effectAllowed)&&(i.dataTransfer.dropEffect="move")),o&&this._updateDropMarkerThrottled(o)}),{priority:"low"})}_setupClipboardInputIntegration(){const t=this.editor,e=t.editing.view.document;this.listenTo(e,"clipboardInput",((e,n)=>{if("drop"!=n.method)return;const i=pb(t,n.targetRanges,n.target);if(this._removeDropMarker(),!i)return this._finalizeDragging(!1),void e.stop();this._draggedRange&&this._draggingUid!=n.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="");if("move"==fb(n.dataTransfer)&&this._draggedRange&&this._draggedRange.containsRange(i,!0))return this._finalizeDragging(!1),void e.stop();n.targetRanges=[t.editing.mapper.toViewRange(i)]}),{priority:"high"})}_setupContentInsertionIntegration(){const t=this.editor.plugins.get(Cf);t.on("contentInsertion",((t,e)=>{if(!this.isEnabled||"drop"!==e.method)return;const n=e.targetRanges.map((t=>this.editor.editing.mapper.toModelRange(t)));this.editor.model.change((t=>t.setSelection(n)))}),{priority:"high"}),t.on("contentInsertion",((t,e)=>{if(!this.isEnabled||"drop"!==e.method)return;const n="move"==fb(e.dataTransfer),i=!e.resultRange||!e.resultRange.isCollapsed;this._finalizeDragging(i&&n)}),{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,n=e.editing.view,i=n.document;this.listenTo(i,"mousedown",((o,r)=>{if(t.OB.isAndroid||!r)return;this._clearDraggableAttributesDelayed.cancel();let s=kb(r.target);if(t.OB.isBlink&&!e.isReadOnly&&!s&&!i.selection.isCollapsed){const t=i.selection.getSelectedElement();t&&Bf(t)||(s=i.selection.editableElement)}s&&(n.change((t=>{t.setAttribute("draggable","true",s)})),this._draggableElement=e.editing.mapper.toModelElement(s))})),this.listenTo(i,"mouseup",(()=>{t.OB.isAndroid||this._clearDraggableAttributesDelayed()}))}_clearDraggableAttributes(){const t=this.editor.editing;t.view.change((e=>{this._draggableElement&&"$graveyard"!=this._draggableElement.root.rootName&&e.removeAttribute("draggable",t.mapper.toViewElement(this._draggableElement)),this._draggableElement=null}))}_setupDropMarker(){const t=this.editor;t.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),t.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(e,{writer:n})=>{if(t.model.schema.checkChild(e.markerRange.start,"$text"))return n.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},(function(t){const e=this.toDomElement(t);return e.append("",t.createElement("span"),""),e}))}})}_updateDropMarker(t){const e=this.editor,n=e.model.markers;e.model.change((e=>{n.has("drop-target")?n.get("drop-target").getRange().isEqual(t)||e.updateMarker("drop-target",{range:t}):e.addMarker("drop-target",{range:t,usingOperation:!1,affectsData:!1})}))}_removeDropMarker(){const t=this.editor.model;this._removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),t.markers.has("drop-target")&&t.change((t=>{t.removeMarker("drop-target")}))}_finalizeDragging(t){const e=this.editor,n=e.model;this._removeDropMarker(),this._clearDraggableAttributes(),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._draggedRange&&(t&&this.isEnabled&&n.deleteContent(n.createSelection(this._draggedRange),{doNotAutoparagraph:!0}),this._draggedRange.detach(),this._draggedRange=null)}}function pb(e,n,i){const o=e.model,r=e.editing.mapper;let s=null;const a=n?n[0].start:null;if(i.is("uiElement")&&(i=i.parent),s=function(t,e){const n=t.model,i=t.editing.mapper;if(Bf(e))return n.createRangeOn(i.toModelElement(e));if(!e.is("editableElement")){const t=e.findAncestor((t=>Bf(t)||t.is("editableElement")));if(Bf(t))return n.createRangeOn(i.toModelElement(t))}return null}(e,i),s)return s;const c=function(t,e){const n=t.editing.mapper,i=t.editing.view,o=n.toModelElement(e);if(o)return o;const r=i.createPositionBefore(e),s=n.findMappedViewAncestor(r);return n.toModelElement(s)}(e,i),l=a?r.toModelPosition(a):null;return l?(s=function(t,e,n){const i=t.model;if(!i.schema.checkChild(n,"$block"))return null;const o=i.createPositionAt(n,0),r=e.path.slice(0,o.path.length),s=i.createPositionFromPath(e.root,r),a=s.nodeAfter;if(a&&i.schema.isObject(a))return i.createRangeOn(a);return null}(e,l,c),s||(s=o.schema.getNearestSelectionRange(l,t.OB.isGecko?"forward":"backward"),s||function(t,e){const n=t.model;let i=e;for(;i;){if(n.schema.isObject(i))return n.createRangeOn(i);i=i.parent}return null}(e,l.parent))):function(t,e){const n=t.model,i=n.schema,o=n.createPositionAt(e,0);return i.getNearestSelectionRange(o,"forward")}(e,c)}function fb(e){return t.OB.isGecko?e.dropEffect:["all","copyMove"].includes(e.effectAllowed)?"move":"copy"}function bb(t,e){let n;function i(...o){i.cancel(),n=setTimeout((()=>t(...o)),e)}return i.cancel=()=>{clearTimeout(n)},i}function kb(t){if(t.is("editableElement"))return null;if(t.hasClass("ck-widget__selection-handle"))return t.findAncestor(Bf);if(Bf(t))return t;const e=t.findAncestor((t=>Bf(t)||t.is("editableElement")));return Bf(e)?e:null}class xb extends e{static get pluginName(){return"PastePlainText"}static get requires(){return[Cf]}init(){const t=this.editor,e=t.model,n=t.editing.view,i=n.document,o=e.document.selection;let r=!1;n.addObserver(_f),this.listenTo(i,"keydown",((t,e)=>{r=e.shiftKey})),t.plugins.get(Cf).on("contentInsertion",((t,n)=>{(r||function(t,e){if(t.childCount>1)return!1;const n=t.getChild(0);if(e.isObject(n))return!1;return 0==Array.from(n.getAttributeKeys()).length}(n.content,e.schema))&&e.change((t=>{const i=Array.from(o.getAttributes()).filter((([t])=>e.schema.getAttributeProperties(t).isFormatting));o.isCollapsed||e.deleteContent(o,{doNotAutoparagraph:!0}),i.push(...o.getAttributes());const r=t.createRangeIn(n.content);for(const e of r.getItems())e.is("$textProxy")&&t.setAttributes(i,e)}))}))}}class wb extends e{static get pluginName(){return"Clipboard"}static get requires(){return[Cf,gb,xb]}}class _b extends i{constructor(t){super(t),this.affectsData=!1}execute(){const t=this.editor.model,e=t.document.selection;let n=t.schema.getLimitElement(e);if(e.containsEntireContent(n)||!Ab(t.schema,n))do{if(n=n.parent,!n)return}while(!Ab(t.schema,n));t.change((t=>{t.setSelection(n,"in")}))}}function Ab(t,e){return t.isLimit(e)&&(t.checkChild(e,"$text")||t.checkChild(e,"paragraph"))}const vb=(0,t.Zz)("Ctrl+A");class Cb extends e{static get pluginName(){return"SelectAllEditing"}init(){const e=this.editor,n=e.editing.view.document;e.commands.add("selectAll",new _b(e)),this.listenTo(n,"keydown",((n,i)=>{(0,t.Cq)(i)===vb&&(e.execute("selectAll"),i.preventDefault())}))}}class yb extends e{static get pluginName(){return"SelectAllUI"}init(){const t=this.editor;t.ui.componentFactory.add("selectAll",(e=>{const n=t.commands.get("selectAll"),i=new ic(e),o=e.t;return i.set({label:o("Select all"),icon:'',keystroke:"Ctrl+A",tooltip:!0}),i.bind("isEnabled").to(n,"isEnabled"),this.listenTo(i,"execute",(()=>{t.execute("selectAll"),t.editing.view.focus()})),i}))}}class Eb extends e{static get requires(){return[Cb,yb]}static get pluginName(){return"SelectAll"}}class Tb extends i{constructor(t){super(t),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this.listenTo(t.data,"set",((t,e)=>{e[1]={...e[1]};const n=e[1];n.batchType||(n.batchType={isUndoable:!1})}),{priority:"high"}),this.listenTo(t.data,"set",((t,e)=>{e[1].batchType.isUndoable||this.clearStack()}))}refresh(){this.isEnabled=this._stack.length>0}addBatch(t){const e=this.editor.model.document.selection,n={ranges:e.hasOwnRange?Array.from(e.getRanges()):[],isBackward:e.isBackward};this._stack.push({batch:t,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(t,e,n){const i=this.editor.model,o=i.document,r=[],s=t.map((t=>t.getTransformedByOperations(n))),a=s.flat();for(const t of s){const e=t.filter((t=>t.root!=o.graveyard)).filter((t=>!Sb(t,a)));e.length&&(Db(e),r.push(e[0]))}r.length&&i.change((t=>{t.setSelection(r,{backward:e})}))}_undo(t,e){const n=this.editor.model,i=n.document;this._createdBatches.add(e);const o=t.operations.slice().filter((t=>t.isDocumentOperation));o.reverse();for(const t of o){const o=t.baseVersion+1,r=Array.from(i.history.getOperations(o)),s=lr([t.getReversed()],r,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const o of s)e.addOperation(o),n.applyOperation(o),i.history.setOperationAsUndone(t,o)}}}function Db(t){t.sort(((t,e)=>t.start.isBefore(e.start)?-1:1));for(let e=1;ee!==t&&e.containsRange(t,!0)))}class Ib extends Tb{execute(t=null){const e=t?this._stack.findIndex((e=>e.batch==t)):this._stack.length-1,n=this._stack.splice(e,1)[0],i=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(i,(()=>{this._undo(n.batch,i);const t=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,t),this.fire("revert",n.batch,i)})),this.refresh()}}class Bb extends Tb{execute(){const t=this._stack.pop(),e=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(e,(()=>{const n=t.batch.operations[t.batch.operations.length-1].baseVersion+1,i=this.editor.model.document.history.getOperations(n);this._restoreSelection(t.selection.ranges,t.selection.isBackward,i),this._undo(t.batch,e)})),this.refresh()}}class Mb extends e{static get pluginName(){return"UndoEditing"}constructor(t){super(t),this._batchRegistry=new WeakSet}init(){const t=this.editor;this._undoCommand=new Ib(t),this._redoCommand=new Bb(t),t.commands.add("undo",this._undoCommand),t.commands.add("redo",this._redoCommand),this.listenTo(t.model,"applyOperation",((t,e)=>{const n=e[0];if(!n.isDocumentOperation)return;const i=n.batch,o=this._redoCommand._createdBatches.has(i),r=this._undoCommand._createdBatches.has(i);this._batchRegistry.has(i)||(this._batchRegistry.add(i),i.isUndoable&&(o?this._undoCommand.addBatch(i):r||(this._undoCommand.addBatch(i),this._redoCommand.clearStack())))}),{priority:"highest"}),this.listenTo(this._undoCommand,"revert",((t,e,n)=>{this._redoCommand.addBatch(n)})),t.keystrokes.set("CTRL+Z","undo"),t.keystrokes.set("CTRL+Y","redo"),t.keystrokes.set("CTRL+SHIFT+Z","redo")}}const Nb='',Ob='';class Rb extends e{static get pluginName(){return"UndoUI"}init(){const t=this.editor,e=t.locale,n=t.t,i="ltr"==e.uiLanguageDirection?Nb:Ob,o="ltr"==e.uiLanguageDirection?Ob:Nb;this._addButton("undo",n("Undo"),"CTRL+Z",i),this._addButton("redo",n("Redo"),"CTRL+Y",o)}_addButton(t,e,n,i){const o=this.editor;o.ui.componentFactory.add(t,(r=>{const s=o.commands.get(t),a=new ic(r);return a.set({label:e,icon:i,keystroke:n,tooltip:!0}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",(()=>{o.execute(t),o.editing.view.focus()})),a}))}}class Pb extends e{static get requires(){return[Mb,Rb]}static get pluginName(){return"Undo"}}class Lb extends i{refresh(){const e=this.editor.model,n=e.document,i=(0,t.Ps)(n.selection.getSelectedBlocks());this.value=!!i&&i.is("element","paragraph"),this.isEnabled=!!i&&zb(i,e.schema)}execute(t={}){const e=this.editor.model,n=e.document;e.change((i=>{const o=(t.selection||n.selection).getSelectedBlocks();for(const t of o)!t.is("element","paragraph")&&zb(t,e.schema)&&i.rename(t,"paragraph")}))}}function zb(t,e){return e.checkChild(t.parent,"paragraph")&&!e.isObject(t)}class jb extends i{execute(t){const e=this.editor.model,n=t.attributes;let i=t.position;e.change((t=>{const o=t.createElement("paragraph");if(n&&e.schema.setAllowedAttributes(o,n,t),!e.schema.checkChild(i.parent,o)){const n=e.schema.findAllowedParent(i,o);if(!n)return;i=t.split(i,n).position}e.insertContent(o,i),t.setSelection(o,"in")}))}}class Fb extends e{static get pluginName(){return"Paragraph"}init(){const t=this.editor,e=t.model;t.commands.add("paragraph",new Lb(t)),t.commands.add("insertParagraph",new jb(t)),e.schema.register("paragraph",{inheritAllFrom:"$block"}),t.conversion.elementToElement({model:"paragraph",view:"p"}),t.conversion.for("upcast").elementToElement({model:(t,{writer:e})=>Fb.paragraphLikeElements.has(t.name)?t.isEmpty?null:e.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}}Fb.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);const Vb=["then","model","getChild","getRoot","set","create","destroy","defaultPlugins","plugins","assign","placeholderElement","editing","low","change","end","init","_updatePlaceholder","document","placeholder","fire","config","focus","initPlugins","get","view","childCount","setSelection"];var Ub,Hb;Ub=Vb,Hb=487,function(t){for(;--t;)Ub.push(Ub.shift())}(++Hb);const qb=function(t,e){return Vb[t-=0]};class Wb extends Ks{constructor(t={}){(t=Object[qb("0x8")]({},t)).plugins||(t[qb("0x7")]=Wb[qb("0x6")]),super(t),this.ui=new wf(this),this[qb("0x3")](qb("0x11"),""),this[qb("0x0")][qb("0x10")].on(qb("0xc"),(()=>this[qb("0xf")]()),{priority:qb("0xb")}),this.on("change:placeholder",(()=>this._updatePlaceholder())),this.model[qb("0x10")].createRoot()}[qb("0x4")](){const t=this[qb("0x13")][qb("0x16")]("initialData")||"";return this[qb("0x15")]()[qb("0x1a")]((()=>this.ui[qb("0xe")]())).then((()=>this.data[qb("0xe")](t))).then((()=>this[qb("0x12")]("ready")))}[qb("0x5")](){return super[qb("0x5")]()[qb("0x1a")]((()=>this.ui[qb("0x5")]()))}[qb("0x14")](){this[qb("0x0")][qb("0xc")]((t=>{const e=this[qb("0x0")][qb("0x10")][qb("0x2")](),n=e[qb("0x1")](e[qb("0x18")]-1);t[qb("0x19")](n,qb("0xd")),this[qb("0xa")][qb("0x17")].focus()}))}[qb("0xf")](){const t=this[qb("0xa")][qb("0x17")],e=t[qb("0x10")].getRoot(),n=e[qb("0x1")](0);e[qb("0x18")]>1||!n||"p"!=n.name?this.placeholderElement&&(function(t,e){const n=e.document;t.change((t=>{if(!m.has(n))return;const i=m.get(n),o=i.get(e);t.removeAttribute("data-placeholder",o.hostElement),p(t,o.hostElement),i.delete(e)}))}(t,this[qb("0x9")]),this.placeholderElement=void 0):(g({view:t,element:n,text:this[qb("0x11")],keepOnFocus:!0}),this[qb("0x9")]=n)}}(0,jl.mix)(Wb,jl.ObservableMixin),(0,jl.mix)(Wb,ja),Wb[qb("0x6")]=[wb,ih,ah,Eb,Vd,Pb,Fb];const Gb=["focus","focusTracker","set","document","cancel","then","editor","placeholder","length","cancelButtonView","create","_initializeFocusCycling","render","TOO_LONG_COMMENT_ALERT","fire","low","_createSubmitButton","label","view","extendTemplate","model","check","createEditor","icon","getData","editorReady","_isDestroyed","div","element","_editorCreationPromise","Cancel","tab","listenTo","isEnabled","submitButtonView","_createCancelButton","focusPrevious","Reply...","firstChild","execute","disabledSubmit","initialData","destroy","bindTemplate","showButtons","focusNext","change","Submit","ck-comment__input-actions--submit","add","_editorConfig","keystrokes","value","setData"];var Zb,Kb;Zb=Gb,Kb=208,function(t){for(;--t;)Zb.push(Zb.shift())}(++Kb);const $b=function(t,e){return Gb[t-=0]};class Yb extends Aa{constructor(t,e={}){super(t),this[$b("0xe")]=null,this[$b("0x4")]=e,this.keystrokes=new jl.KeystrokeHandler,this[$b("0x9")]=new jl.FocusTracker,this[$b("0xa")]($b("0x6"),e[$b("0x31")]||""),this[$b("0xa")]($b("0x30"),!1),this.set($b("0x34"),!0),this.set("placeholder",df(t,$b("0x2d"))),this[$b("0x2a")]=this[$b("0x18")](),this[$b("0x11")]=this[$b("0x2b")](),this.setTemplate({tag:$b("0x23"),attributes:{class:["ck-comment__input-wrapper"]},children:[{tag:"div",attributes:{class:["ck-comment__input-actions",this[$b("0x33")].if("showButtons","ck-comment__input-actions--active")]},children:[this[$b("0x2a")],this[$b("0x11")]]}]}),this[$b("0x5")][$b("0xa")]("Esc",((t,e)=>{this[$b("0x11")].fire("execute"),e()})),this.on("submit",((e,n)=>{n[$b("0x10")]>65e3?(alert(df(t,$b("0x15"),[n[$b("0x10")],65e3])),e.stop()):this[$b("0xe")][$b("0x7")]("")}),{priority:"high"})}[$b("0x14")](){super[$b("0x14")](),this[$b("0x5")][$b("0x28")](this.element),this[$b("0x9")][$b("0x3")](this[$b("0x24")])}[$b("0x1e")](){return this[$b("0xe")]||(this[$b("0xe")]=new Wb(this[$b("0x4")]),this[$b("0x25")]=this[$b("0xe")][$b("0x12")]()[$b("0xd")]((()=>{this[$b("0x22")]||(this[$b("0x24")].insertBefore(this[$b("0xe")].ui[$b("0x24")],this[$b("0x24")][$b("0x2e")]),this[$b("0xe")][$b("0x1c")][$b("0xb")].on($b("0x0"),(()=>this.value=this[$b("0xe")][$b("0x20")]())),this[$b("0xe")].bind($b("0xf")).to(this),this[$b("0x13")](this[$b("0xe")]),this[$b("0x16")]($b("0x21")))}))),this[$b("0x25")]}[$b("0x8")](){this[$b("0xe")]&&this[$b("0xe")][$b("0x8")]()}async[$b("0x32")](){this[$b("0x22")]||(this[$b("0x22")]=!0,this[$b("0xe")]&&(await this[$b("0x25")],await this.editor.destroy()),await super.destroy())}[$b("0x18")](){const{locale:t}=this,e=new ic(t);return e.extendTemplate({attributes:{class:[$b("0x2")]}}),e[$b("0x19")]=df(t,$b("0x1")),e[$b("0x1f")]=Ga[$b("0x1d")],e.on($b("0x2f"),(()=>{this.fire("submit",this[$b("0x6")])})),e.bind($b("0x29")).to(this,$b("0x6"),this,"disabledSubmit",((t,e)=>!e&&!!t.trim())),e}[$b("0x2b")](){const{locale:t}=this,e=new ic(t);return e[$b("0x1b")]({attributes:{class:["ck-comment__input-actions--cancel"]}}),e[$b("0x19")]=df(t,$b("0x26")),e.icon=Ga.cancel,e.on($b("0x2f"),(()=>{this[$b("0xe")].setData(""),this[$b("0x16")]($b("0xc"))})),e}[$b("0x13")](t){const e=this[$b("0x9")],n=new Js;[t.ui[$b("0x1a")],this[$b("0x2a")],this[$b("0x11")]].forEach((t=>{n[$b("0x3")](t),e[$b("0x3")](t.element)}));const i=new Cc({focusables:n,focusTracker:e});this[$b("0x5")][$b("0xa")]($b("0x27"),((t,e)=>{i[$b("0x35")](),e()}),{priority:$b("0x17")}),this[$b("0x5")][$b("0xa")]("shift + tab",((t,e)=>{i[$b("0x2c")](),e()}),{priority:$b("0x17")})}}var Jb,Qb,Xb=["bind","value","ck-thread__user","then","ck-comment__input-container--active","set","userView","bindTemplate","editor","showInput","ck-thread__input","div","setTemplate","ck-comment__input-container","extendTemplate","change:showInput","commentInputView","destroy"];Jb=Xb,Qb=248,function(t){for(;--t;)Jb.push(Jb.shift())}(++Qb);var tk=function(t,e){return Xb[t-=0]};class ek extends Aa{constructor(t,e,n){super(t),this.commentInputView=new Yb(t,n),this[tk("0x2")][tk("0x4")]("showButtons").to(this[tk("0x2")].focusTracker,"isFocused",this[tk("0x2")],tk("0x5"),((t,e)=>t||!!e)),this[tk("0x9")](tk("0xd"),!1),this.on(tk("0x1"),(()=>{this[tk("0xd")]&&!this[tk("0x2")][tk("0xc")]&&this[tk("0x2")].createEditor()})),this.userView=new Nm(t,e),this[tk("0xa")][tk("0x0")]({attributes:{class:tk("0x6")}}),this.commentInputView[tk("0x0")]({attributes:{class:tk("0xe")}}),this[tk("0x10")]({tag:tk("0xf"),attributes:{class:[tk("0x11"),this[tk("0xb")].if(tk("0xd"),tk("0x8"))]},children:[this[tk("0xa")],this[tk("0x2")]]})}[tk("0x3")](){return this.commentInputView.destroy()[tk("0x7")]((()=>super[tk("0x3")]()))}}const nk=["bindTemplate","set","ck-thread__comment-count","count","NUMBER_OF_COMMENTS"];var ik,ok;ik=nk,ok=385,function(t){for(;--t;)ik.push(ik.shift())}(++ok);const rk=function(t,e){return nk[t-=0]};class sk extends Aa{constructor(t){super(t);const e=this[rk("0x0")];this[rk("0x1")]("count"),this.setTemplate({tag:"li",attributes:{class:rk("0x2")},children:[{text:e.to(rk("0x3"),(e=>df(t,rk("0x4"),e)))}]})}}const ak=["destroy","remove","weight","_rearrangeCollapse","createCollection","stopListening","formatDateTime","_config","delete","_shouldCollapse","listenTo","editorConfig","ck-thread__comments","count","from","locale","render","set","_collapsedCommentsView","_handleRemoveCommentModel","maxThreadTotalWeight","isEditMode","collapse","_model","_updateHasDirtyComment","focus","hasDirtyComment","maxCommentCharsWhenCollapsed","add","isActive","equal","length","expand","delegate","refreshVisibleViews","CommentView","_rearrangeExpand","visibleViews","commentViews","some","change:isEditMode","maxCommentsWhenCollapsed","_handleNewCommentModel","comments"];var ck,lk;ck=ak,lk=229,function(t){for(;--t;)ck.push(ck.shift())}(++lk);const dk=function(t,e){return ak[t-=0]};class uk extends Aa{constructor(t,e,n){super(t),this[dk("0x8")](dk("0x11"),!1),this[dk("0x8")](dk("0x16"),e[dk("0x22")][dk("0x16")]),this[dk("0x8")](dk("0x14"),!1),this[dk("0xe")]=e,this._config=n,this[dk("0x1d")]=this[dk("0x27")](),this[dk("0x1c")]=this[dk("0x27")](),this._collapsedCommentsView=new sk(t),this[dk("0x9")].bind(dk("0x4")).to(this,dk("0x16"),(t=>t-this[dk("0x2a")][dk("0x20")]));for(const t of e[dk("0x22")])this[dk("0x21")](t);this[dk("0x1")](e[dk("0x22")],dk("0x13"),((t,e)=>{this[dk("0x16")]++,this._handleNewCommentModel(e),this[dk("0x19")]()})),this[dk("0x1")](e.comments,dk("0x24"),((t,e)=>{this[dk("0x16")]--,this[dk("0xa")](e),this[dk("0x19")]()})),this[dk("0x1")](e,"commentUpdated",(()=>this.refreshVisibleViews())),this.on("change:isActive",(()=>this.refreshVisibleViews())),this.on("change:hasDirtyComment",(()=>this.refreshVisibleViews())),this.setTemplate({tag:"ul",attributes:{class:[dk("0x3")]},children:this.visibleViews})}get[dk("0x0")](){return this[dk("0xe")][dk("0x25")]>this[dk("0x2a")][dk("0xb")]&&!this.isActive&&!this[dk("0x11")]}render(){super[dk("0x7")](),this[dk("0x19")]()}focus(){this.element[dk("0x10")]()}destroy(){this[dk("0x9")][dk("0x23")]();for(const t of this[dk("0x1d")])t[dk("0x23")]();super[dk("0x23")]()}refreshVisibleViews(){this[dk("0x0")]?this[dk("0x26")]():this._rearrangeExpand()}_handleNewCommentModel(t){const e=new(this[dk("0x2a")][dk("0x1a")])(this[dk("0x6")],t,{maxCommentCharsWhenCollapsed:this[dk("0x2a")][dk("0x12")],formatDateTime:this[dk("0x2a")][dk("0x29")],editorConfig:this[dk("0x2a")][dk("0x2")]});e.viewUid=t.id,e.delegate("removeComment").to(this),e[dk("0x18")]("updateComment").to(this),this.listenTo(e,dk("0x1f"),(()=>this[dk("0xf")]())),this.commentViews.add(e)}_handleRemoveCommentModel(t){const e=this[dk("0x1d")][dk("0x24")](t.id);this[dk("0x28")](e),e[dk("0xc")]&&this[dk("0xf")](),e[dk("0x23")]()}_updateHasDirtyComment(){this[dk("0x11")]=Array.from(this[dk("0x1d")])[dk("0x1e")]((t=>t[dk("0xc")]))}[dk("0x26")](){const t=function(t){const e=new jl.Collection;for(const n of t)e[dk("0x13")](n);return e}(this[dk("0x1d")]),e=this[dk("0x9")].count;for(let n=1;n<=e;n++)t[dk("0x24")](1);for(const e of t)e[dk("0xd")]();e>0&&t.add(this[dk("0x9")],1),hk((0,jl.diff)(Array.from(this[dk("0x1c")]),Array[dk("0x5")](t)),this[dk("0x1c")],t)}[dk("0x1b")](){hk((0,jl.diff)(Array[dk("0x5")](this[dk("0x1c")]),Array[dk("0x5")](this[dk("0x1d")])),this[dk("0x1c")],this[dk("0x1d")]);for(const t of this[dk("0x1c")])t[dk("0x17")]()}}function hk(t,e,n){let i=0;for(const o of t)switch(o){case"insert":e.add(n.get(i),i),i++;break;case dk("0x2b"):e[dk("0x24")](i);break;case dk("0x15"):i++}}const mk=["commentInputView","showInput","value","_model","focus","_localUser","destroy","disabledSubmit","submit","isDirty","change:isActive","fire","length","delegate","commentThreadInputView","isReadOnly","removeCommentThread","_config","placeholder","set","addComment","Write a comment...","cancel","editorConfig","commentsListView","element","bind","Reply...","_createCommentThreadInputView","updateComment","hasDirtyComment","assign","removeComment","isActive","stop","locale"];var gk,pk;gk=mk,pk=396,function(t){for(;--t;)gk.push(gk.shift())}(++pk);const fk=function(t,e){return mk[t-=0]};class bk extends Aa{constructor(t,e,n,i){super(t),this[fk("0x13")](fk("0x21"),!1),this[fk("0x13")](fk("0x9"),!1),this[fk("0x3")]=e,this[fk("0x5")]=n,this[fk("0x11")]=i,this[fk("0x18")]=new uk(t,e,Object[fk("0x1f")]({CommentView:this[fk("0x11")].CommentView},i)),this[fk("0x18")].delegate(fk("0x20")).to(this),this.commentsListView[fk("0xd")](fk("0x1d")).to(this),this[fk("0x18")][fk("0x1a")](fk("0x21")).to(this),this[fk("0x13")](fk("0xc"),this.commentsListView[fk("0xc")]),this.bind(fk("0xc")).to(this.commentsListView,"length"),this[fk("0xe")]=this[fk("0x1c")](),this.on("removeComment",(()=>this[fk("0x4")]())),this.bind(fk("0x9")).to(this[fk("0x18")],fk("0x1e"),this.commentThreadInputView.commentInputView,fk("0x2"),((t,e)=>t||!!e))}focus(){this[fk("0x19")].focus()}[fk("0x6")](){this[fk("0x9")]=!1,this[fk("0x18")][fk("0x6")](),this.commentThreadInputView[fk("0x6")](),super[fk("0x6")]()}[fk("0x1c")](){const t=new ek(this[fk("0x23")],this[fk("0x5")],this[fk("0x11")][fk("0x17")]),e=t[fk("0x0")];return t[fk("0x1a")](fk("0x1")).to(this,fk("0x21"),this._model,fk("0xf"),e,fk("0x2"),((t,e,n)=>!!n||t&&!e)),e[fk("0x1a")](fk("0x12")).to(this,"length",(t=>df(this[fk("0x23")],fk(t?"0x1b":"0x15")))),e.on(fk("0x8"),((t,e)=>{this.fire(fk("0x14"),e)})),e.on(fk("0x16"),(()=>{this[fk("0x4")]()})),e.bind(fk("0x7")).to(this[fk("0x3")],fk("0xf")),e.on(fk("0x16"),(t=>{0==this.length&&(this.fire(fk("0x10")),t[fk("0x22")]())})),this.on(fk("0xa"),((t,n,i)=>{i||this[fk("0xc")]||e.value||this[fk("0xb")](fk("0x10"))})),t}}const kk=["commentsListView","isConfirm","ck-thread--","setTemplate","render","locale","querySelector","element","ck-thread__container","then","commentViews","div","Delete comment thread?","removeCommentThread","Write a comment...","high","getTemplate","isActive",".ck-thread__container","stop","set","cancelConfirm","listenTo","length","ck-thread--active","_cancelAllConfirms","execute","ck-thread--remove-confirmation","remove","commentThreadInputView","fire","change:isActive","unbind","containerElement","showConfirm","removeButton","_bindFirstCommentView","placeholder","actionIndicator","add","bindTemplate","_model","_boundFirstCommentView"];var xk,wk;xk=kk,wk=317,function(t){for(;--t;)xk.push(xk.shift())}(++wk);const _k=function(t,e){return kk[t-=0]};class Ak extends bk{constructor(t,e,n,i){super(t,e,n,i),this[_k("0x4")](_k("0x16"),null),this[_k("0x11")]=null,this._boundFirstCommentView=null,this[_k("0x20")]=t,this[_k("0x1e")](this.getTemplate()),this.on(_k("0xf"),((t,e,n)=>{n||this._cancelAllConfirms()})),this[_k("0x6")](this[_k("0x19")],"change:isReadOnly",((t,e,n)=>{n&&this._cancelAllConfirms()})),this[_k("0x7")]>0&&this._bindFirstCommentView(),this[_k("0x6")](this.commentsListView[_k("0x25")],_k("0x17"),(()=>{this._bindFirstCommentView()}))}[_k("0x0")](){const t=this[_k("0x18")];return{tag:_k("0x26"),attributes:{class:["ck-thread",t.if(_k("0x1"),_k("0x8")),t.if(_k("0x1c"),_k("0xb")),t.to(_k("0x16"),(t=>t?_k("0x1d")+t:""))],"data-thread-id":this._model.id,tabindex:-1},children:[{tag:"div",attributes:{class:_k("0x23")},children:[this[_k("0x1b")],this[_k("0xd")]]}]}}[_k("0x1f")](){super[_k("0x1f")](),this.containerElement=this[_k("0x22")][_k("0x21")](_k("0x2"))}[_k("0x9")](){this[_k("0x5")]();for(const t of this[_k("0x1b")][_k("0x25")])t[_k("0x5")]()}[_k("0x14")](){const{locale:t}=this,e=this[_k("0x1b")][_k("0x25")].get(0);e!==this[_k("0x1a")]&&(this._boundFirstCommentView=e,this[_k("0x10")](_k("0x16")),this.bind(_k("0x16")).to(e,_k("0x16"),(t=>"remove"===t?_k("0xc"):null)),e[_k("0x15")]=df(t,_k("0x29")),e[_k("0x13")].on(_k("0xa"),(e=>{e[_k("0x3")](),this[_k("0x12")](df(t,_k("0x27")),this[_k("0x11")])[_k("0x24")]((()=>{this[_k("0xe")](_k("0x28"))}))}),{priority:_k("0x2a")}))}}(0,jl.mix)(Ak,Bp);var vk,Ck,yk=["set","element","ck-annotation__content","div","change:content","ck-comment__content","innerHTML"];vk=yk,Ck=177,function(t){for(;--t;)vk.push(vk.shift())}(++Ck);var Ek=function(t,e){return yk[t-=0]};class Tk extends Aa{constructor(t){super(t),this[Ek("0x5")]("content",""),this.setTemplate({tag:Ek("0x1"),attributes:{class:[Ek("0x3"),Ek("0x0")]}})}render(){super.render(),this.on(Ek("0x2"),((t,e,n)=>{this.element[Ek("0x4")]=n})),this[Ek("0x6")].innerHTML=this.content}}const Dk=["_config","initialData","switchToDisplayMode","submit","bind","maxCommentCharsWhenCollapsed","visibleView","switchToEditMode","destroy","createCollection","collapse","editorReady","_createCommentInputView","expand","locale","cancel","_createCommentContentView","set","remove","add","focus","_model","isEditMode","fire","content","value","editorConfig","isCollapsed","disabledSubmit"];var Sk,Ik;Sk=Dk,Ik=422,function(t){for(;--t;)Sk.push(Sk.shift())}(++Ik);const Bk=function(t,e){return Dk[t-=0]};class Mk extends Aa{constructor(t,e,n){super(t),this[Bk("0x5")]=e,this[Bk("0xd")]=n,this[Bk("0x1")](Bk("0x6"),!1),this[Bk("0x1")]("isCollapsed",!0),this[Bk("0x13")]=this[Bk("0x16")](),this[Bk("0x13")].add(this[Bk("0x0")]())}[Bk("0x1a")](){this[Bk("0xb")]=!1}[Bk("0x17")](){this[Bk("0x6")]||(this[Bk("0xb")]=!0)}[Bk("0x4")](){this.element[Bk("0x4")]()}async destroy(){await this.visibleView.get(0).destroy(),super[Bk("0x15")]()}[Bk("0x14")](){this[Bk("0x6")]||(this.isEditMode=!0,this.visibleView[Bk("0x2")](0).destroy(),this[Bk("0x13")][Bk("0x3")](this[Bk("0x19")]()))}[Bk("0xf")](){this[Bk("0x6")]&&(this[Bk("0x6")]=!1,this.visibleView.remove(0)[Bk("0x15")](),this.visibleView[Bk("0x3")](this[Bk("0x0")]()))}[Bk("0x0")](){const t=new Tk(this[Bk("0x1b")]);return t[Bk("0x11")]("content").to(this[Bk("0x5")],Bk("0x8"),this,Bk("0xb"),((t,e)=>e?wp(t,{limit:this._config[Bk("0x12")]}):t)),t}[Bk("0x19")](){this._config.editorConfig||(this._config.editorConfig={}),this[Bk("0xd")][Bk("0xa")][Bk("0xe")]=this[Bk("0x5")][Bk("0x8")];const t=new Yb(this.locale,this[Bk("0xd")][Bk("0xa")]);return t[Bk("0x9")]=this[Bk("0x5")].content,t[Bk("0x11")](Bk("0xc")).to(this[Bk("0x5")],"isReadOnly"),t.on(Bk("0x10"),((t,e)=>{this[Bk("0x7")]("updateComment",this[Bk("0x5")].id,e),this[Bk("0xf")](),this.focus()})),t.on(Bk("0x1c"),(()=>{this[Bk("0xf")](),this[Bk("0x4")]()})),t.once(Bk("0x18"),(()=>{t.focus()})),t.createEditor(),t}}const Nk=["edit","isReadOnly","ck-annotation__info","EXTERNAL_IMPORT_WORD_AVATAR","ck-comment__info-time","importWord","change:isRemovable","ck-comment--remove-confirmation","listenTo","EXTERNAL_IMPORT_WORD_COMMENT","ck-annotation__info-name","label","Remove","fire","isConfirm","isExternal","removeComment","ck-comment__wrapper","ck-comment__info-name","ck-comment__external","ck-comment__user","extendTemplate","locale","ck-comment--edit","ck-annotation__content-wrapper","remove","source","ck-comment","Reply...","userView","element","removeButton","ck-annotation__main","mouseleave","render","_attachActions","isVisible","isRemovable","ck-comment__info","set","getUserViewNotificationText","Edit","push","editButton","name","placeholder","div","setTemplate","cancelConfirm","mouseenter","attributes","actionIndicator","visibleView","isEditMode","icon","getExternalCommentNote","author","ck-comment__actions","time","_model","authoredAt","@external","isEnabled","ck-annotation__user","creator","switchToEditMode","ck-annotation__info-time","formatDateTime","bind","ck-annotation","EXTERNAL_AVATAR","_createEditButton","execute","_createRemoveButton","_createCommentInputView","ck-annotation__actions--hidden","EXTERNAL_COMMENT","_config","then"];var Ok,Rk;Ok=Nk,Rk=192,function(t){for(;--t;)Ok.push(Ok.shift())}(++Rk);const Pk=function(t,e){return Nk[t-=0]};class Lk extends Mk{constructor(t,e,n){super(t,e,n),this[Pk("0x5")](Pk("0x11"),null),this.set(Pk("0xb"),df(t,Pk("0x49"))),this[Pk("0x5")](Pk("0x1a"),null),this.bind(Pk("0x1a")).to(e),this[Pk("0x9")]=this[Pk("0x25")](),this.removeButton=this[Pk("0x27")](),this[Pk("0x4a")]=new Nm(t,e[Pk("0x16")],this[Pk("0x6")]()),this[Pk("0x4a")][Pk("0x42")]({attributes:{class:[Pk("0x41"),Pk("0x1d")]}}),this[Pk("0x35")](e,Pk("0x33"),(()=>this[Pk("0xe")]())),this[Pk("0xd")](this.getTemplate())}getTemplate(){const t=this.bindTemplate,e=[{tag:Pk("0xc"),attributes:{class:[Pk("0x4"),Pk("0x2f")]},children:[{tag:"span",children:[{text:this[Pk("0x4a")][Pk("0xa")]}],attributes:{class:[Pk("0x3f"),Pk("0x37")]}},{tag:Pk("0x18"),attributes:{datetime:t.to(Pk("0x1a")),class:[Pk("0x31"),Pk("0x20")]},children:[{text:t.to(Pk("0x1a"),(t=>this[Pk("0x2b")][Pk("0x21")](t)))}]}]},{tag:Pk("0xc"),attributes:{class:[Pk("0x17"),"ck-annotation__actions",t.if(Pk("0x13"),"ck-comment__actions--hidden"),t.if(Pk("0x13"),Pk("0x29"))]},children:[this.editButton,this.removeButton]},{tag:"div",attributes:{class:[Pk("0x45")]},children:this[Pk("0x12")]}];return this._model[Pk("0x3c")]&&e[Pk("0x8")]({tag:Pk("0xc"),attributes:{class:[Pk("0x40")]},children:[{text:this[Pk("0x15")]()}]}),{tag:"li",attributes:{class:[Pk("0x3e"),t.if(Pk("0x3b"),Pk("0x34"))],tabindex:-1},children:[{tag:Pk("0xc"),attributes:{class:[Pk("0x48"),Pk("0x23"),t.if("isEditMode",Pk("0x44")),t.to(Pk("0x11"),(t=>t?"ck-comment--"+t:""))],"data-author-id":this._model.author.id,"data-comment-id":this._model.id},children:[this[Pk("0x4a")],{tag:"div",attributes:{class:["ck-comment__main",Pk("0x4d")]},children:e}]}]}}[Pk("0x25")](){const t=new ic(this[Pk("0x43")]);return t[Pk("0x38")]=df(this.locale,Pk("0x7")),t.icon=Ga.pencil,t[Pk("0x42")]({attributes:{class:"ck-comment--edit"}}),t[Pk("0x22")](Pk("0x1c")).to(this[Pk("0x19")],Pk("0x2e"),(t=>!t)),t[Pk("0x22")](Pk("0x2")).to(this._model,"isEditable"),t.on(Pk("0x26"),(()=>this[Pk("0x1f")]())),t}[Pk("0x27")](){const t=new ic(this[Pk("0x43")]);return t[Pk("0x38")]=df(this[Pk("0x43")],Pk("0x39")),t[Pk("0x14")]='\x3c!--\n\n What you\'re currently looking at is the source code of a legally protected, proprietary software.\n CKEditor 5 Collaboration is licensed under a commercial license and protected by copyright law. Where not otherwise indicated,\n all CKEditor 5 Collaboration content is authored by CKSource engineers and consists of CKSource-owned intellectual property.\n\n Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n\n!--\x3e\n\n\n',t.extendTemplate({attributes:{class:"ck-comment--remove"}}),t.bind("isEnabled").to(this._model,Pk("0x2e"),(t=>!t)),t[Pk("0x22")](Pk("0x2")).to(this._model,Pk("0x3")),t.on("execute",(()=>{this.showConfirm(df(this[Pk("0x43")],"Delete comment?"),this[Pk("0x4b")])[Pk("0x2c")]((()=>{this[Pk("0x3a")](Pk("0x3d"),this[Pk("0x19")].id)}))})),t}[Pk("0x1")](t,e){this.listenTo(t,Pk("0xf"),(()=>this[Pk("0x11")]=e)),this[Pk("0x35")](t,"focus",(()=>this[Pk("0x11")]=e)),this[Pk("0x35")](t,Pk("0x4e"),(()=>this[Pk("0x11")]=null)),this[Pk("0x35")](t,"blur",(()=>this[Pk("0x11")]=null))}[Pk("0x28")](){const t=super[Pk("0x28")]();return t[Pk("0x22")](Pk("0xb")).to(this),t}[Pk("0x15")](){return Pk("0x32")===this._model.attributes[Pk("0x1b")][Pk("0x47")]?df(this[Pk("0x43")],Pk("0x36")):df(this[Pk("0x43")],Pk("0x2a"))}[Pk("0x6")](){return this[Pk("0x19")][Pk("0x3c")]?"importWord"===this[Pk("0x19")][Pk("0x10")][Pk("0x1b")][Pk("0x47")]?df(this[Pk("0x43")],Pk("0x30"),this._model[Pk("0x1e")][Pk("0xa")]):df(this.locale,Pk("0x24"),this[Pk("0x19")].creator[Pk("0xa")]):null}[Pk("0x0")](){super[Pk("0x0")](),this[Pk("0x1")](this[Pk("0x9")][Pk("0x4b")],Pk("0x2d")),this[Pk("0x1")](this[Pk("0x4c")][Pk("0x4b")],Pk("0x46"))}}(0,jl.mix)(Lk,Bp);var zk=__webpack_require__(1556),jk={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(zk.Z,jk);zk.Z.locals;var Fk=__webpack_require__(4342),Vk={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(Fk.Z,Vk);Fk.Z.locals;var Uk=__webpack_require__(4964),Hk={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(Uk.Z,Hk);Uk.Z.locals;const qk=["attributeName","type","cancel","class","disconnect","observe","childList","attributes"];var Wk,Gk;Wk=qk,Gk=196,function(t){for(;--t;)Wk.push(Wk.shift())}(++Gk);const Zk=function(t,e){return qk[t-=0]};function Kk(t){const e=cb(t,30),n=new MutationObserver((t=>{for(const n of t)(Zk("0x3")==n[Zk("0x5")]&&Zk("0x7")==n[Zk("0x4")]||Zk("0x2")==n.type)&&e()}));return{attach(t){n[Zk("0x1")](t,{attributes:!0,childList:!0,subtree:!0})},detach(){n[Zk("0x0")](),e[Zk("0x6")]()}}}var $k=__webpack_require__(5899),Yk={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()($k.Z,Yk);$k.Z.locals;const Jk=["length","focusTracker","bindTemplate","content","isActive","_mutationObserver","createCollection","setTemplate","div","type","render","add","clientHeight","height","ck-annotation-wrapper--active","clear","Esc","fire","focus","detach","keystrokes","_updateHeight","listenTo","element","isDirty","destroy","mainView","ck-annotation-wrapper","set","attach"];var Qk,Xk;Qk=Jk,Xk=150,function(t){for(;--t;)Qk.push(Qk.shift())}(++Xk);const tx=function(t,e){return Jk[t-=0]};class ex extends Aa{constructor(t,e){super(t),this.id=(0,jl.uid)(),this[tx("0x1")]=new jl.FocusTracker,this[tx("0x14")]=new jl.KeystrokeHandler,this[tx("0x14")].set(tx("0x10"),((t,e)=>this[tx("0x11")](tx("0x10"),e))),this[tx("0x1c")]("targetRect",{top:0,right:0,bottom:0,left:0}),this[tx("0x1c")](tx("0xd"),0),this[tx("0x1c")](tx("0x4"),!1),this[tx("0x1c")](tx("0x18"),!1),this[tx("0x1c")](tx("0x0"),0),this[tx("0x1c")](tx("0x9"),""),this[tx("0x5")]=Kk((()=>this._updateHeight())),this.content=this[tx("0x6")](),this[tx("0x3")][tx("0xb")](e),this[tx("0x1a")]=e;const n=this[tx("0x2")];this[tx("0x7")]({tag:tx("0x8"),attributes:{class:["ck",tx("0x1b"),"ck-rounded-corners",n.if(tx("0x4"),tx("0xe"))],tabindex:-1},children:this[tx("0x3")]})}[tx("0xa")](){super[tx("0xa")](),this.focusTracker.add(this[tx("0x17")]),this[tx("0x14")][tx("0x16")](this[tx("0x17")]),this._mutationObserver[tx("0x1d")](this[tx("0x17")])}[tx("0x19")](){this[tx("0x3")][tx("0xf")](),this[tx("0x14")][tx("0x19")](),this[tx("0x1")].destroy(),this._mutationObserver[tx("0x13")](),super[tx("0x19")]()}[tx("0x12")](){this.element.focus()}[tx("0x15")](){const t=this[tx("0x17")][tx("0xc")];t&&(this[tx("0xd")]=t)}}const nx=["target","targetRect","nodeType","focusTracker","getClientRects","_target","_type","annotation-invalid-target","render","type","remove","function","clear","isVisible","_id","stopListening","updateTargetRect","destroy","isActive","element","_isTargetElementVisible","_assertCorrectTarget","add","focusableElements","set","view","mainView","item"];var ix,ox;ix=nx,ox=424,function(t){for(;--t;)ix.push(ix.shift())}(++ox);const rx=function(t,e){return nx[t-=0]};class sx{constructor({view:t,target:e,type:n,isVisible:i=!0}){this.view=t,this[rx("0x15")][rx("0xf")]||this.view[rx("0x4")](),this[rx("0x2")]=n,this[rx("0x1")]=e,this[rx("0x11")](),this[rx("0x13")]=new jl.Collection([this[rx("0x15")][rx("0xf")]],{idProperty:rx("0xa")}),this[rx("0x13")].on(rx("0x12"),((t,e)=>{this[rx("0x15")][rx("0x1b")][rx("0x12")](e)})),this[rx("0x13")].on(rx("0x6"),((t,e)=>{this.view.focusTracker.remove(e)})),this[rx("0x14")](rx("0x9"),i)}get[rx("0x5")](){return rx("0x7")==typeof this[rx("0x2")]?this[rx("0x2")]():this[rx("0x2")]}get innerView(){return this[rx("0x15")][rx("0x16")]}get target(){return"function"==typeof this._target?this[rx("0x1")]():this[rx("0x1")]}get targetRect(){const t=this.target;return this[rx("0x11")](),null!==t&&this[rx("0x10")]()?ax(t)?new jl.Rect(t[rx("0x0")]()[rx("0x17")](0)):new jl.Rect(t):null}get[rx("0xe")](){return this[rx("0x15")][rx("0xe")]}set[rx("0xe")](t){this.view[rx("0xe")]=t,this[rx("0x15")][rx("0x16")][rx("0xe")]=t}[rx("0xc")](){this.view[rx("0x19")]=this.targetRect}[rx("0xd")](){this.focusableElements[rx("0xb")](),this[rx("0x13")][rx("0x8")](),this[rx("0xb")]()}refreshVisibility(){this.isVisible=this[rx("0x10")]()}_isTargetElementVisible(){const t=this[rx("0x18")];return!ax(t)||(!!t.offsetParent||!!t[rx("0x0")]()[rx("0x17")](0))}[rx("0x11")](){const t=this[rx("0x18")];if(!(null===t||t instanceof jl.Rect||ax(t)))throw new jl.CKEditorError(rx("0x3"),null,{target:t})}}function ax(t){return null!==t&&"object"==typeof t&&1===t[rx("0x1a")]}(0,jl.mix)(sx,jl.ObservableMixin);const cx=["getIndex","_getOrderInContent","clear","getByView","length","innerView","sort","refreshPositioning","annotationcollection-duplicated-item","view","_items","delete","annotationcollection-not-existing-item","focus","left","top","remove","_focusTracker","_sort","has","_innerViewToAnnotation","_viewToAnnotation","get","fire","targetRect","destroy","set","stopListening","updateTargetRect","change:isFocused","focusTracker","add","listenTo","focusableElements"];var lx,dx;lx=cx,dx=321,function(t){for(;--t;)lx.push(lx.shift())}(++dx);const ux=function(t,e){return cx[t-=0]};class hx extends jl.Collection{constructor(t=[]){super(),this[ux("0x5")]=new Map,this[ux("0x6")]=new Map,this[ux("0x2")]=new jl.FocusTracker,this[ux("0x2")].on(ux("0xe"),((t,e,n)=>{n||this[ux("0x8")]("blur")}));for(const e of t)this[ux("0x10")](e)}get isFocused(){return this[ux("0x2")].isFocused}[ux("0x10")](t){if(this[ux("0x4")](t))throw new jl.CKEditorError(ux("0x1b"),null);this[ux("0x5")][ux("0xb")](t[ux("0x18")],t),this._viewToAnnotation[ux("0xb")](t[ux("0x1c")],t);for(const e of t.focusableElements)this[ux("0x2")].add(e);this[ux("0x11")](t[ux("0x12")],ux("0x10"),((t,e)=>{this._focusTracker[ux("0x10")](e)})),this.listenTo(t[ux("0x12")],ux("0x1"),((t,e)=>{this[ux("0x2")][ux("0x1")](e)})),this[ux("0x11")](t[ux("0x1c")][ux("0xf")],ux("0xe"),((e,n,i)=>{i&&this.fire(ux("0x20"),t)})),t[ux("0xd")]();const e=this[ux("0x14")](t.view[ux("0x9")]);super[ux("0x10")](t,e)}[ux("0x1")](t){if(!this[ux("0x4")](t))throw new jl.CKEditorError(ux("0x1f"),null);this[ux("0xc")](t[ux("0x1c")][ux("0xf")]),this[ux("0xc")](t[ux("0x12")]);for(const e of t[ux("0x12")])this[ux("0x2")].remove(e);this[ux("0x6")][ux("0x1e")](t[ux("0x1c")]),this[ux("0x5")].delete(t[ux("0x18")]),super[ux("0x1")](t)}getByInnerView(t){return this._innerViewToAnnotation[ux("0x7")](t)}[ux("0x16")](t){return this[ux("0x6")][ux("0x7")](t)}[ux("0xa")](){super[ux("0x15")](),this[ux("0xc")](),this[ux("0x5")][ux("0x15")](),this[ux("0x6")][ux("0x15")](),this._focusTracker[ux("0xa")]()}[ux("0x1a")](){for(const t of this)t[ux("0xd")]();this[ux("0x3")]()}[ux("0x3")](){const t=Array.from(this)[ux("0x19")](((t,e)=>mx(t[ux("0x1c")].targetRect,e[ux("0x1c")][ux("0x9")])));for(let e=t[ux("0x17")]-1;e>0;e--){const n=t[e];e!==this[ux("0x13")](n)&&(this[ux("0x1")](n),this.add(n,e))}}[ux("0x14")](t){let e=0;if(!t)return this[ux("0x1d")][ux("0x17")];for(const n of this){const i=n[ux("0x1c")][ux("0x9")];if(i){if(mx(t,i)<0)return e;e++}}return e}}function mx(t,e){if(null===t&&null===e)return 0;if(null===t)return-1;if(null===e)return 1;const n=t.top-e[ux("0x0")];return 0==n?t[ux("0x21")]-e.left:n}const gx=["collection","_activateAnnotation","activeAnnotations","createAnnotation","activate","refreshVisibility","remove","deactivateAll","add","_addActiveAnnotation","stopListening","pluginName","fire","change:isVisible","createAnnotationView","getByInnerView","set","isVisible","_bindAnnotationsToVisibleAnnotations","_removeActiveAnnotation","_visibleAnnotations","_deactivateAllAnnotations","destroy"];var px,fx;px=gx,fx=448,function(t){for(;--t;)px.push(px.shift())}(++fx);const bx=function(t,e){return gx[t-=0]};class kx extends c{static get[bx("0x0")](){return"Annotations"}constructor(t){super(t),this[bx("0xc")]=new hx,this[bx("0x9")]=new hx,this[bx("0x5")](bx("0xe"),new Set),this[bx("0x7")]()}[bx("0x14")](t){this.collection[bx("0x14")](t)}[bx("0x12")](t){this[bx("0xc")].remove(t),t[bx("0xb")]()}refreshVisibility(){for(const t of this[bx("0xc")])t[bx("0x11")]()}refreshPositioning(){this[bx("0x9")].refreshPositioning()}[bx("0x4")](t){return this.collection.getByInnerView(t)}[bx("0x13")](){this[bx("0x1")](bx("0xa"))}[bx("0xb")](){for(const t of this[bx("0xc")])t[bx("0xb")]();this[bx("0x9")].destroy(),this.collection[bx("0xb")](),super[bx("0xb")]()}[bx("0x10")](t){this[bx("0x1")](bx("0xd"),t)}[bx("0xf")](t){return new sx(t)}[bx("0x3")](t,e){return new ex(t,e)}[bx("0x15")](t){const e=new Set(this.activeAnnotations);e.add(t),this[bx("0xe")]=e}[bx("0x8")](t){const e=new Set(this[bx("0xe")]);e.delete(t),this[bx("0xe")]=e}_bindAnnotationsToVisibleAnnotations(){const t=this[bx("0xc")],e=this[bx("0x9")];function n(t){const n=t.source;n[bx("0x6")]&&!e.has(n)?e[bx("0x14")](n):!n.isVisible&&e.has(n)&&e.remove(n)}this.listenTo(t,bx("0x14"),((t,i)=>{i.isVisible&&e.add(i),this.listenTo(i,"change:isVisible",n)})),this.listenTo(t,"remove",((t,i)=>{e.has(i)&&e.remove(i),this[bx("0x16")](i,bx("0x2"),n)}))}}const xx=["licenseKey","length","substring","pluginName","_getExternalAuthor","error","delete","content","author","update","_viewToController","getTime","deactivateAll","_threads","addCommentThread","lowest","_updateComment","createElement","_threadToController","CommentThreadView","adapter","commentsrepository-invalid-comment-content","_isAttached","pop","catch","commentsrepository-remove-comment-thread-internal-error","commentsrepository-remove-missing-comment-thread","removeComment","commentsrepository-get-comment-invalid-id","weight","_addCommentThread","_removeComment","activeCommentThread","getIndex","external:","authorName","_addComment","getCommentThread","commentsrepository-remove-missing-comment","define","creator","noChannel","trim","isEditable","warn","model","addUser","editorReady","fromCharCode","comments.CommentThreadView","commentsrepository-fetch-comment-thread","then","getUser","attributes","view","commentsrepository-missing-thread-and-adapter","getComment","CommentView","locale","setAttribute","_createCommentThreadView","isReadOnly","threadId","isAttached","commentsrepository-update-missing-comment","_detachCommentThread","find","listenTo","config","hasCommentThread","fire","comments.maxCommentCharsWhenCollapsed","plugins","Users","addComment","reduce","isActive","parse","commentsrepository-active-missing-comment-thread","bind","set","getByInnerView","remove","commentsrepository-update-comment-invalid-content","comments.maxCommentsWhenCollapsed","focus","channelId","string","commentsrepository-add-comment-internal-error","commentsrepository-update-comment-missing-comment-thread","commentInputView","isRemovable","@external","PendingActions","comments.maxThreadTotalWeight","max","createdAt","isDirty","innerHTML","_removeCommentThread","map","has","replace","toJSON","_nonAdminChannels","comments","add","change:activeAnnotations","commentsrepository-adapter-already-set","openNewCommentThread","_adapter","get","commentsrepository-add-comment-to-missing-comment-thread","commentsrepository-remove-comment-internal-error","authoredAt","resolve","destroy","change:isDirty","removeCommentThread","commentsrepository-missing-target","fetchCommentThread","from","removeAttribute","commentsrepository-duplicated-comment-thread-id","type","push","context","_add","div","commentsrepository-update-comment-internal-error","filter","stopListening","comments.editorConfig","change:authoredAt","updateComment","activate","commentsrepository-active-not-attached","_findOptimalIndex","_repository","_attachCommentThread","PENDING_ACTION_COMMENT_THREAD","commentsrepository-attach-missing-comment-thread","assign","commentsrepository-invalid-comment-authorid","slice","commentsrepository-add-comment-user-not-exists","once","commentUpdated","commentsrepository-invalid-comment-thread-id","getCommentThreads","_remove","innerView","attachTo","_readOnlyChannels","setAdminPermissions","function","values","afterInit"];var wx,_x;wx=xx,_x=276,function(t){for(;--t;)wx.push(wx.shift())}(++_x);const Ax=function(t,e){return xx[t-=0]},vx=Symbol(Ax("0x51"));class Cx extends c{static get requires(){return[kx,Ua,Cm]}static get[Ax("0x2b")](){return"CommentsRepository"}constructor(t){super(t),this[Ax("0x35")]=new Map,this._threadToController=new Map,this[Ax("0x32")]=new Map,this[Ax("0x23")]=new Set,this[Ax("0x78")]("_nonAdminChannels",new Set),this.licenseKey=this[Ax("0x8")][Ax("0x6c")].get(Ax("0x28"));const e=this.context[Ax("0x6c")];e[Ax("0x4f")](Ax("0x7c"),2),e[Ax("0x4f")](Ax("0x86"),500),e[Ax("0x4f")](Ax("0x6f"),140),e.define(Ax("0x59"),Ak),e[Ax("0x4f")]("comments.CommentView",Lk),e[Ax("0x97")](Ax("0xe"))||console[Ax("0x54")]("Missing comments editor configuration (`comments.editorConfig`). Default configuration will be used instead.")}init(){const t=this.context[Ax("0x70")][Ax("0x97")](kx);this[Ax("0x78")]("activeCommentThread",null),this.on(Ax("0x36"),((t,e)=>this[Ax("0x46")](e))),this.on(Ax("0x0"),((t,e)=>this[Ax("0x8b")](e))),this.on(Ax("0x72"),((t,e)=>this[Ax("0x4c")](e))),this.on(Ax("0x10"),((t,e)=>this._updateComment(e))),this.on(Ax("0x43"),((t,e)=>this._removeComment(e))),this.on("addComment",((t,{threadId:e,isFromAdapter:n})=>{if(n)return;const i=this[Ax("0x4d")](e),o=this[Ax("0x3a")][Ax("0x97")](i);o&&o[Ax("0x5e")][Ax("0x7d")]()}),{priority:Ax("0x37")}),this[Ax("0x6b")](t,Ax("0x93"),((t,e,n)=>{const i=Array.from(n)[Ax("0x8c")]((t=>this._viewToController[Ax("0x97")](t[Ax("0x21")])))[Ax("0xc")](Boolean)[0];this[Ax("0x48")]=i?i[Ax("0x55")]:null}))}[Ax("0x27")](){!function(t){const e=t instanceof a,n=[1,85,78,115,198,255,50,112,83,87,161],i=h([52,48,52,52,50,52,50,54]),o=[127,34,6,211,167,86,146,199,132,160,18],r=h([65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57]),s=function(e){if(t[h([112,108,117,103,105,110,115])][h([104,97,115])](h([87,101,98,83,111,99,107,101,116,71,97,116,101,119,97,121]))&&t[h([112,108,117,103,105,110,115])][h([103,101,116])](h([87,101,98,83,111,99,107,101,116,71,97,116,101,119,97,121]))[h([115,116,97,116,101])]==h([99,111,110,110,101,99,116,101,100]))return c(h([108,105,99,101,110,115,101,75,101,121,86,97,108,105,100]));if(t[h([112,108,117,103,105,110,115])][h([104,97,115])](h([84,114,97,99,107,67,104,97,110,103,101,115,68,97,116,97,71,101,116,116,101,114]))&&t[h([112,108,117,103,105,110,115])][h([103,101,116])](h([84,114,97,99,107,67,104,97,110,103,101,115,68,97,116,97,71,101,116,116,101,114]))[h([114,101,115,117,108,116])]==h([101,110,100]))return c(h([108,105,99,101,110,115,101,75,101,121,86,97,108,105,100]));try{const r=function(t){const e=[29,221,175,90,231,133,239,240,75,180];return function(t,e){const n=atob(t),i=Array[Ax("0x3")](function(t){const e=new Uint8Array(t.length);for(let n=0;n=0;--t)o[t]=n%256,n=parseInt(n/256);let r=null,s=16;const a=new Uint8Array(e),c=[],l=[];g();for(let e=0;e=0;e--){if(255!==t[e]){t[e]++;break}t[e]=0}}function m(t){const e=c[Ax("0x29")]-1,n=[0,0,0,0];let o=d(t);for(let t=0;t<4;t++)o[t]^=c[0][t];for(let t=1;t>24&255]^i[h([84,50])][o[(e+1)%4]>>16&255]^i[h([84,51])][o[(e+2)%4]>>8&255]^i[h([84,52])][255&o[(e+3)%4]]^c[t][e];o=n[Ax("0x1a")]()}const r=new Uint8Array(16);let s;for(let t=0;t<4;t++)s=c[e][t],r[4*t]=255&(i[h([83])][o[t]>>24&255]^s>>24),r[4*t+1]=255&(i[h([83])][o[(t+1)%4]>>16&255]^s>>16),r[4*t+2]=255&(i[h([83])][o[(t+2)%4]>>8&255]^s>>8),r[4*t+3]=255&(i[h([83])][255&o[(t+3)%4]]^s);return r}function g(){const t=i[h([110,117,109,98,101,114,79,102,82,111,117,110,100,115])][a[Ax("0x29")]];for(let e=0;e<=t;e++)c[Ax("0x7")]([0,0,0,0]),l[Ax("0x7")]([0,0,0,0]);const e=4*(t+1),n=a[Ax("0x29")]/4,o=d(a);let r;for(let e=0;e>2,c[r][e%4]=o[e],l[t-r][e%4]=o[e];let s,u=0,m=n;for(;m>16&255]<<24^i[h([83])][s>>8&255]<<16^i[h([83])][255&s]<<8^i[h([83])][s>>24&255]^i[h([114,99,111,110])][u]<<24,u+=1;for(let t=1;t>8&255]<<8^i[h([83])][s>>16&255]<<16^i[h([83])][s>>24&255]<<24;for(let t=n/2+1;t>2,a=m%4,c[r][a]=o[d],l[t-r][a]=o[d++],m++}for(let e=1;e>24&255]^i[h([85,50])][s>>16&255]^i[h([85,51])][s>>8&255]^i[h([85,52])][255&s]}}(i,e,r+256*o))}(t,new(window[h([85,105,110,116,56,65,114,114,97,121])])([...n,...e,...o]))}(e),s=JSON[Ax("0x75")](r),a=parseInt(s[h([49])]),l=parseInt(s[h([51])]),d=parseInt(s[h([52])])||0,u=parseInt(s[h([53])])||0,m=2;if(!(1&d)||t[h([112,108,117,103,105,110,115])][h([104,97,115])](h([84,114,97,99,107,67,104,97,110,103,101,115,69,100,105,116,105,110,103]))&&!(d&m))return c(h([108,105,99,101,110,115,101,75,101,121,73,110,118,97,108,105,100]));if(u&&!window[h([111,112,101,110])][h([99,108,111,115,101,100])])return c(h([108,105,99,101,110,115,101,75,101,121,73,110,118,97,108,105,100]));if(parseInt(i)/2>a)return c(h([108,105,99,101,110,115,101,75,101,121,73,110,118,97,108,105,100]));if(t[h([112,108,117,103,105,110,115])][h([104,97,115])](h([84,114,97,99,107,67,104,97,110,103,101,115,69,100,105,116,105,110,103]))){const e=t[h([112,108,117,103,105,110,115])][h([103,101,116])](h([84,114,97,99,107,67,104,97,110,103,101,115,69,100,105,116,105,110,103]));if(parseInt(e[h([95,101,120,101,99,117,116,101,83,117,103,103,101,115,116,105,111,110])])/2>a)return c(h([108,105,99,101,110,115,101,75,101,121,73,110,118,97,108,105,100]))}return c(h(l?[108,105,99,101,110,115,101,75,101,121,84,114,105,97,108]:[108,105,99,101,110,115,101,75,101,121,86,97,108,105,100]))}catch(t){return c(h([108,105,99,101,110,115,101,75,101,121,73,110,118,97,108,105,100]))}}(t[Ax("0x6c")].get(h([108,105,99,101,110,115,101,75,101,121])));function c(e){const n=function(){const t=String(window[h([112,101,114,102,111,114,109,97,110,99,101])][h([110,111,119])]())[Ax("0x8e")](h([46]),"");let e="";for(let n=0;n=r[Ax("0x29")]&&(i-=r.length),e+=r[i]}return e}();return t[n]=e,e}function l(t){for(const e of t[h([101,100,105,116,111,114,115])])d(e);t[h([112,108,117,103,105,110,115])][h([103,101,116])](h([67,111,109,109,101,110,116,115,82,101,112,111,115,105,116,111,114,121]))[h([115,119,105,116,99,104,82,101,97,100,79,110,108,121])](!0),t[h([112,108,117,103,105,110,115])][h([103,101,116])](h([67,111,109,109,101,110,116,115,82,101,112,111,115,105,116,111,114,121]))[h([115,119,105,116,99,104,82,101,97,100,79,110,108,121])]=u}function d(t){function e(){t[h([109,111,100,101,108])][h([99,104,97,110,103,101])]=u,t[h([109,111,100,101,108])][h([101,110,113,117,101,117,101,67,104,97,110,103,101])]=u,t[h([101,110,97,98,108,101,82,101,97,100,79,110,108,121,77,111,100,101])](h([109,111,100,101,108]))}t[h([115,116,97,116,101])]==h([114,101,97,100,121])?e():t[h([111,110,99,101])](h([114,101,97,100,121]),(()=>e()))}function u(){return null}function h(t){return t.map((t=>String[Ax("0x58")](t))).join("")}e?(s==h([108,105,99,101,110,115,101,75,101,121,73,110,118,97,108,105,100])?l(t):s==h([108,105,99,101,110,115,101,75,101,121,84,114,105,97,108])&&window[h([115,101,116,84,105,109,101,111,117,116])]((()=>{l(t),c(h([108,105,99,101,110,115,101,75,101,121,84,114,105,97,108,76,105,109,105,116,58,116,105,109,101]))}),o[6]*n[8]*n[6]),t[h([101,100,105,116,111,114,115])][h([111,110])](h([97,100,100]),((t,e)=>{s!=h([108,105,99,101,110,115,101,75,101,121,73,110,118,97,108,105,100])&&s!=h([108,105,99,101,110,115,101,75,101,121,84,114,105,97,108,76,105,109,105,116,58,116,105,109,101])&&s!=h([108,105,99,101,110,115,101,75,101,121,84,114,105,97,108,76,105,109,105,116,58,111,112,101,114,97,116,105,111,110,115])||d(e)}))):s==h([108,105,99,101,110,115,101,75,101,121,73,110,118,97,108,105,100])?d(t):s==h([108,105,99,101,110,115,101,75,101,121,84,114,105,97,108])&&t[h([111,110])](h([114,101,97,100,121]),(()=>{let e=0;t[h([109,111,100,101,108])][h([111,110])](h([97,112,112,108,121,79,112,101,114,97,116,105,111,110]),((n,i)=>{i[0][h([105,115,68,111,99,117,109,101,110,116,79,112,101,114,97,116,105,111,110])]&&e++,504===e&&(d(t),c(h([108,105,99,101,110,115,101,75,101,121,84,114,105,97,108,76,105,109,105,116,58,111,112,101,114,97,116,105,111,110,115])),n[h([111,102,102])]())}),{priority:h([104,105,103,104,101,115,116])})}))}(this[Ax("0x8")])}set adapter(t){if(this[Ax("0x96")])throw new jl.CKEditorError(Ax("0x94"));this[Ax("0x96")]=t}get[Ax("0x3c")](){return this[Ax("0x96")]}addCommentThread({channelId:t=vx,threadId:e=(0,jl.uid)(),comments:n=[],target:i,isFromAdapter:o}={}){return this[Ax("0x6e")](Tx("addCommentThread",t),{channelId:t,threadId:e,comments:n,target:i,isFromAdapter:o}),this.getCommentThread(e)}[Ax("0x95")]({channelId:t=vx,threadId:e=(0,jl.uid)(),target:n}){if(this._readOnlyChannels.has(t)||this[Ax("0x23")].has(void 0))return;if(!n)throw new jl.CKEditorError(Ax("0x1"));const i=this[Ax("0x36")]({channelId:t,threadId:e,target:n});if(!i)return null;const o=this[Ax("0x3a")][Ax("0x97")](i),r=o[Ax("0x5e")].commentThreadInputView[Ax("0x82")],s=this[Ax("0x8")][Ax("0x70")][Ax("0x97")](kx),a=s[Ax("0x79")](o[Ax("0x5e")]);return s[Ax("0x11")](a),r[Ax("0x1c")](Ax("0x57"),(()=>r[Ax("0x7d")]())),i}[Ax("0x6d")](t){if(Ax("0x7f")!=typeof t)throw new jl.CKEditorError("commentsrepository-invalid-comment-thread-id");return this._threads[Ax("0x8d")](t)}[Ax("0x4d")](t){if(Ax("0x7f")!=typeof t)throw new jl.CKEditorError(Ax("0x1e"));return this[Ax("0x35")].get(t)}[Ax("0x2")]({channelId:t,threadId:e}={}){const n=this[Ax("0x4d")](e);if(n)return Promise[Ax("0x9b")](n);if(!this[Ax("0x3c")])throw new jl.CKEditorError(Ax("0x5f"),this[Ax("0x8")]);if("function"!=typeof this[Ax("0x3c")][Ax("0x4d")])throw new jl.CKEditorError("commentsrepository-missing-thread-and-adapter-method",this[Ax("0x8")]);return this.adapter[Ax("0x4d")]({channelId:t,threadId:e})[Ax("0x5b")]((n=>this.hasCommentThread(e)?this[Ax("0x4d")](e):n?this[Ax("0x36")](Object[Ax("0x18")]({isFromAdapter:!0,channelId:t},n)):void 0))[Ax("0x40")]((t=>{throw console[Ax("0x2d")](t),new jl.CKEditorError(Ax("0x5a"),this[Ax("0x8")])}))}getCommentThreads({channelId:t,skipNotAttached:e=!1,skipEmpty:n=!1,toJSON:i=!1}={}){const o=[];for(const i of this._threads[Ax("0x26")]())t&&i[Ax("0x7e")]!==t||e&&!i[Ax("0x67")]||n&&0===i[Ax("0x29")]||o[Ax("0x7")](i);return i?o[Ax("0x8c")]((t=>t[Ax("0x8f")]())):o}setActiveCommentThread(t){const e=this[Ax("0x8")][Ax("0x70")][Ax("0x97")](kx);if(!t)return void(this[Ax("0x48")]&&e[Ax("0x34")]());const n=this[Ax("0x4d")](t);if(!n)throw new jl.CKEditorError(Ax("0x76"),null,{threadId:t});if(!this[Ax("0x3a")][Ax("0x8d")](n))throw new jl.CKEditorError(Ax("0x12"),null,{threadId:t});const i=e[Ax("0x79")](this[Ax("0x3a")][Ax("0x97")](n).view);e[Ax("0x11")](i)}switchReadOnly(t,e){t?this._readOnlyChannels.add(e):this[Ax("0x23")][Ax("0x2e")](e);for(const n of this[Ax("0x1f")]({channelId:e}))n[Ax("0x65")]=!!t}[Ax("0x65")](t){return this._readOnlyChannels[Ax("0x8d")](t)||this._readOnlyChannels.has(void 0)}createCommentThreadController(t,e){return new lf(t,e)}[Ax("0x24")](t,e=vx){const n=!this[Ax("0x90")].has(e),i=new Set(this[Ax("0x90")]);n&&!t&&(i[Ax("0x92")](e),this[Ax("0x90")]=i),!n&&t&&(i[Ax("0x2e")](e),this[Ax("0x90")]=i)}_addCommentThread({channelId:t,threadId:e,comments:n,target:i,isFromAdapter:o}){if(Ax("0x7f")!=typeof e)throw new jl.CKEditorError(Ax("0x1e"),null,{threadId:e});if(this[Ax("0x6d")](e))throw new jl.CKEditorError(Ax("0x5"),null,{threadId:e});const r=new yx(this,{channelId:t,id:e});(this._readOnlyChannels[Ax("0x8d")](t)||this[Ax("0x23")][Ax("0x8d")](void 0))&&(r.isReadOnly=!0),this[Ax("0x35")][Ax("0x78")](e,r);for(const t of n)r.addComment(Object.assign({isFromAdapter:o},t));i&&r[Ax("0x22")](i)}_attachCommentThread({threadId:t,target:e}){const n=this.getCommentThread(t);if(!n)throw new jl.CKEditorError(Ax("0x17"),this);const i=this[Ax("0x8")].plugins[Ax("0x97")]("PendingActions"),o=this[Ax("0x8")][Ax("0x70")][Ax("0x97")](kx),r=this[Ax("0x64")](n),s=new lf(n,r);let a=null;r.on(Ax("0x9d"),((t,e,n)=>{n?a=i[Ax("0x92")](df(this[Ax("0x8")][Ax("0x62")],Ax("0x16"))):(i[Ax("0x7a")](a),a=null)})),this[Ax("0x3a")].set(n,s),this[Ax("0x32")].set(r,s);const c=new ex(this[Ax("0x8")][Ax("0x62")],r);c[Ax("0x77")](Ax("0x29")).to(r),c.bind("isDirty").to(r,Ax("0x89"),r,Ax("0x29"),((t,e)=>t||!e)),c[Ax("0x77")](Ax("0x74")).to(r),c[Ax("0x6")]="comment";const l=new sx({view:c,target:e,type:"comment"});return o[Ax("0x92")](l),l}[Ax("0x64")](t){const e=this[Ax("0x8")][Ax("0x70")][Ax("0x97")]("Users"),{config:n,locale:i}=this[Ax("0x8")],o=dp(n.get("locale"));return new(0,n.get("comments")[Ax("0x3b")])(i,t,e.me,{editorConfig:n.get("comments.editorConfig"),maxCommentsWhenCollapsed:n.get(Ax("0x7c")),maxThreadTotalWeight:n[Ax("0x97")]("comments.maxThreadTotalWeight"),maxCommentCharsWhenCollapsed:n.get(Ax("0x6f")),formatDateTime:o,CommentView:n[Ax("0x97")](Ax("0x91"))[Ax("0x61")]})}[Ax("0x8b")]({threadId:t,isFromAdapter:e}){const n=this[Ax("0x4d")](t);if(!n)throw new jl.CKEditorError(Ax("0x42"),this);if(this[Ax("0x69")](t),this[Ax("0x35")][Ax("0x2e")](t),!n[Ax("0x29")]||e||!this[Ax("0x3c")]||Ax("0x25")!=typeof this.adapter[Ax("0x0")])return Promise[Ax("0x9b")]();const i=this[Ax("0x8")][Ax("0x70")][Ax("0x97")]("PendingActions"),{channelId:o}=n,r=i.add(df(this[Ax("0x8")].locale,"PENDING_ACTION_COMMENT_THREAD"));return this[Ax("0x3c")][Ax("0x0")]({channelId:o,threadId:t})[Ax("0x5b")]((()=>i[Ax("0x7a")](r)))[Ax("0x40")]((t=>{throw console[Ax("0x2d")](t),new jl.CKEditorError(Ax("0x41"),this)}))}[Ax("0x69")](t){const e=this[Ax("0x8")][Ax("0x70")][Ax("0x97")](kx),n=this.getCommentThread(t);if(this[Ax("0x3a")][Ax("0x8d")](n)){const t=this._threadToController.get(n),i=t[Ax("0x5e")],o=e[Ax("0x79")](i);this[Ax("0x3a")].delete(n),this[Ax("0x32")].delete(i),o&&e[Ax("0x7a")](o),t[Ax("0x9c")](),i[Ax("0x9c")]()}}[Ax("0x2c")](t){const e=this[Ax("0x8")][Ax("0x70")][Ax("0x97")](Cm),n=Pp(Ax("0x4a")+t);return e.getUser(n)||e[Ax("0x56")]({id:n,name:t})}_addComment({threadId:t,commentId:e=(0,jl.uid)(),content:n,authorId:i,createdAt:o,attributes:r,isFromAdapter:s}){if(Ax("0x7f")!=typeof e)throw new jl.CKEditorError("commentsrepository-invalid-commentid");if(Ax("0x7f")!=typeof i)throw new jl.CKEditorError(Ax("0x19"));if(Ax("0x7f")!=typeof n||!n[Ax("0x52")]())throw new jl.CKEditorError(Ax("0x3d"));const a=this.getCommentThread(t);if(!a)throw new jl.CKEditorError(Ax("0x98"),this);const c=this[Ax("0x8")][Ax("0x70")].get(Cm)[Ax("0x5c")](i);if(!c)throw new jl.CKEditorError(Ax("0x1b"),null,{authorId:i});let l=null,d=o;r&&r[Ax("0x84")]&&(l=this._getExternalAuthor(r[Ax("0x84")][Ax("0x4b")]),d=r["@external"][Ax("0x88")]);const u=new Ex(this,{threadId:t,id:e,author:l||c,creator:c,content:n,createdAt:o,authoredAt:d,attributes:r});if(a[Ax("0x9")](u),s||!this.adapter||Ax("0x25")!=typeof this.adapter.addComment)return Promise.resolve();const h=this[Ax("0x8")][Ax("0x70")][Ax("0x97")](Ax("0x85")),{channelId:m}=a,g=h[Ax("0x92")](df(this[Ax("0x8")][Ax("0x62")],Ax("0x16")));return r||(r={}),this[Ax("0x3c")][Ax("0x72")]({channelId:m,threadId:t,commentId:e,content:n,attributes:r})[Ax("0x5b")]((i=>{if(h[Ax("0x7a")](g),this[Ax("0x6d")](t))i&&i[Ax("0x88")]&&this[Ax("0x38")]({threadId:t,commentId:e,createdAt:i.createdAt,isFromAdapter:!0});else{const s={threadId:t,commentId:e,content:n,attributes:r,createdAt:i&&i[Ax("0x88")]?i[Ax("0x88")]:o,authorId:c.id};this[Ax("0x36")]({channelId:m,threadId:t,comments:[s],isFromAdapter:!0})}})).catch((t=>{throw console.error(t),new jl.CKEditorError(Ax("0x80"),this)}))}[Ax("0x38")]({threadId:t,commentId:e,content:n,createdAt:i,attributes:o,isFromAdapter:r}){if(void 0!==n&&(Ax("0x7f")!=typeof n||!n[Ax("0x52")]()[Ax("0x29")]))throw new jl.CKEditorError(Ax("0x7b"));const s=this.getCommentThread(t),a=s.getComment(e);if(!a)throw new jl.CKEditorError(Ax("0x68"),this);let c=!1;if(n&&n!==a[Ax("0x2f")]&&(a[Ax("0x53")]||r)&&(a[Ax("0x2f")]=n,c=!0),i&&i!==a[Ax("0x88")]&&(a[Ax("0x88")]=i,a[Ax("0x5d")]&&a[Ax("0x5d")][Ax("0x84")]||(a[Ax("0x9a")]=i),c=!0),o&&!Yo(o,a[Ax("0x5d")])&&(a[Ax("0x5d")]=o,c=!0),!c)return Promise.resolve();if(s.fire(Ax("0x1d")),r||!this[Ax("0x3c")]||Ax("0x25")!=typeof this[Ax("0x3c")][Ax("0x10")])return Promise[Ax("0x9b")]();const l=this[Ax("0x8")][Ax("0x70")][Ax("0x97")](Ax("0x85")),{channelId:d}=this[Ax("0x4d")](a[Ax("0x66")]),u=l[Ax("0x92")](df(this.context[Ax("0x62")],Ax("0x16")));return this[Ax("0x3c")][Ax("0x10")]({channelId:d,threadId:t,commentId:e,content:n,attributes:o})[Ax("0x5b")]((()=>l.remove(u)))[Ax("0x40")]((t=>{throw console.error(t),new jl.CKEditorError(Ax("0xb"),this)}))}[Ax("0x47")]({threadId:t,commentId:e,isFromAdapter:n}){const i=this[Ax("0x4d")](t),o=i[Ax("0x60")](e);if(!o)throw new jl.CKEditorError(Ax("0x4e"),this);if(i[Ax("0x20")](o),n||!this[Ax("0x3c")]||"function"!=typeof this.adapter[Ax("0x43")])return Promise[Ax("0x9b")]();const r=this[Ax("0x8")][Ax("0x70")][Ax("0x97")](Ax("0x85")),{channelId:s}=i,a=r.add(df(this[Ax("0x8")][Ax("0x62")],Ax("0x16")));return this[Ax("0x3c")][Ax("0x43")]({channelId:s,threadId:t,commentId:e}).then((()=>r[Ax("0x7a")](a)))[Ax("0x40")]((t=>{throw console[Ax("0x2d")](t),new jl.CKEditorError(Ax("0x99"),this)}))}}class yx{constructor(t,e){this[Ax("0x7e")]=e[Ax("0x7e")],this.id=e.id,this[Ax("0x78")]("isReadOnly",!1),this[Ax("0x77")]("isRemovable").to(t,Ax("0x90"),(t=>!t[Ax("0x8d")](this[Ax("0x7e")]))),this.comments=new jl.Collection,this[Ax("0x14")]=t,this[Ax("0x3e")]=!1}get[Ax("0x45")](){return Array[Ax("0x3")](this[Ax("0x91")])[Ax("0x73")](((t,e)=>t+e.weight),0)}get length(){return this[Ax("0x91")][Ax("0x29")]}get[Ax("0x67")](){return this[Ax("0x3e")]}[Ax("0x7a")]({isFromAdapter:t=!1}={}){const{channelId:e,id:n}=this;this[Ax("0x14")][Ax("0x6e")](Tx(Ax("0x0"),e),{channelId:e,threadId:n,isFromAdapter:t})}[Ax("0x22")](t){return this[Ax("0x14")][Ax("0x15")]({threadId:this.id,target:t})}[Ax("0x72")](t){const{channelId:e,id:n}=this;this[Ax("0x14")][Ax("0x6e")](Tx(Ax("0x72"),e,n),Object[Ax("0x18")]({channelId:e,threadId:n},t))}[Ax("0x60")](t){if("string"!=typeof t)throw new jl.CKEditorError(Ax("0x44"),null,{commentId:t});return this.comments.get(t)}[Ax("0x8f")](){return{threadId:this.id,comments:this[Ax("0x91")][Ax("0x8c")]((t=>t[Ax("0x8f")]()))}}[Ax("0x9")](t){return this.listenTo(t,Ax("0xf"),(()=>{const e=this[Ax("0x13")](t),n=this[Ax("0x91")];e-1!=n[Ax("0x49")](t)&&e+1!=n.getIndex(t)&&(this._remove(t),this[Ax("0x9")](t))})),t.createdAt?this[Ax("0x91")][Ax("0x92")](t,this._findOptimalIndex(t)):this.comments[Ax("0x92")](t)}_remove(t){return this[Ax("0xd")](t),t[Ax("0x9c")](),this[Ax("0x91")].remove(t)}[Ax("0x13")](t){const e=this[Ax("0x91")][Ax("0x6a")]((e=>new Date(e.authoredAt)[Ax("0x33")]()>new Date(t[Ax("0x9a")])[Ax("0x33")]()));return e?this[Ax("0x91")][Ax("0x49")](e):this[Ax("0x29")]}}(0,jl.mix)(yx,jl.ObservableMixin);class Ex{constructor(t,e){const n=t[Ax("0x8")][Ax("0x70")].get(Ax("0x71")).me,i=t[Ax("0x4d")](e[Ax("0x66")]),o=0===i.comments[Ax("0x29")],r=n===e[Ax("0x30")];this.id=e.id,this[Ax("0x66")]=e[Ax("0x66")],this[Ax("0x30")]=e[Ax("0x30")],this.creator=e[Ax("0x50")],this.isExternal=Boolean(e[Ax("0x5d")]&&e[Ax("0x5d")][Ax("0x84")]),this[Ax("0x78")]("content",e[Ax("0x2f")]),this[Ax("0x88")]=e[Ax("0x88")]||new Date,this[Ax("0x78")](Ax("0x9a"),e[Ax("0x9a")]||new Date),this[Ax("0x78")]("attributes",e[Ax("0x5d")]||{}),this.set("isEditable",r),this[Ax("0x77")](Ax("0x83")).to(i,Ax("0x83"),(t=>t&&o||r)),this.bind(Ax("0x65")).to(i,Ax("0x65")),this._repository=t}get weight(){return Math[Ax("0x87")](function(t){const e=document[Ax("0x39")](Ax("0xa"));return e[Ax("0x8a")]=t,e.textContent.length}(this[Ax("0x2f")]),200)}[Ax("0x31")](t){const{threadId:e,id:n}=this;if(!this[Ax("0x14")][Ax("0x6d")](e))throw new jl.CKEditorError(Ax("0x81"),this);const{channelId:i}=this[Ax("0x14")].getCommentThread(e);this[Ax("0x14")][Ax("0x6e")](Tx(Ax("0x10"),i,e),Object.assign({channelId:i,threadId:e,commentId:n},t))}[Ax("0x63")](t,e){const n=Ui(this[Ax("0x5d")]);Ut(n,t,e),this.update({attributes:n})}[Ax("0x4")](t){const e=Ui(this.attributes);it(e,t),this.update({attributes:e})}[Ax("0x7a")](t={}){if(!t.isFromAdapter&&!this[Ax("0x83")])return;const{threadId:e,id:n}=this;if(!this[Ax("0x14")].hasCommentThread(e))throw new jl.CKEditorError("commentsrepository-remove-comment-missing-comment-thread",this);const{channelId:i}=this[Ax("0x14")][Ax("0x4d")](e);this[Ax("0x14")][Ax("0x6e")](Tx(Ax("0x43"),i,e),Object[Ax("0x18")]({channelId:i,threadId:e,commentId:n},t))}[Ax("0x8f")](){return{commentId:this.id,content:this[Ax("0x2f")],createdAt:this[Ax("0x88")],authorId:this[Ax("0x50")].id,attributes:this[Ax("0x5d")]}}destroy(){this[Ax("0xd")]()}}function Tx(t,...e){for(const n of e)void 0!==n&&(t+=":"+String(n));return t}(0,jl.mix)(Ex,jl.ObservableMixin);const Dx=["element","item","push","createRange","backward","model","textProxy","getRanges","isEnabled","editor","getLastMatchingPosition","_itemIsContent","comment:","execute","addMarker","_trimToContent","tableCell","substr","isObject"];var Sx,Ix;Sx=Dx,Ix=373,function(t){for(;--t;)Sx.push(Sx.shift())}(++Ix);const Bx=function(t,e){return Dx[t-=0]};class Mx extends i{refresh(){const t=this.editor.model.document.selection;for(const e of t[Bx("0xe")]())if(this._hasContent(e))return void(this.isEnabled=!0);this[Bx("0xf")]=!1}[Bx("0x1")]({threadId:t=(0,jl.uid)()}={}){const e=this[Bx("0x10")][Bx("0xc")],n=[];for(const t of e.document.selection.getRanges())this._hasContent(t)&&n[Bx("0x9")](this[Bx("0x3")](t));e.change((e=>{for(const i of n){const n=(0,jl.uid)()[Bx("0x5")](1,5),o=Bx("0x0")+t+":"+n;e[Bx("0x2")](o,{range:i,usingOperation:!1,affectData:!1})}}))}_hasContent(t){for(const e of t.getItems())if(this[Bx("0x12")](e))return!0;return!1}[Bx("0x12")](t){return t.is(Bx("0xd"))||this[Bx("0x10")][Bx("0xc")].schema[Bx("0x6")](t)&&!t.is(Bx("0x7"),Bx("0x4"))}[Bx("0x3")](t){const e=t=>!this._itemIsContent(t[Bx("0x8")]),n=t.start[Bx("0x11")](e),i=t.end[Bx("0x11")](e,{direction:Bx("0xb")});return this.editor[Bx("0xc")][Bx("0xa")](n,i)}}const Nx=["editorannotations-invalid-source-callback","pluginName","getByInnerView","editor","refresh","requires","annotation","listenTo","change:range","focusTracker","_editorAnnotationsData","change:isFocused","_editorAnnotations","EditorAnnotations","directChange","element","_dataCollectors","plugins","isReadOnly","update","remove","refreshSelectedViews","fire","function","from","push","init","document","blur","map","addSourceCollector","collection","containsRange","innerView","view","editing","hasDomSelection","model","isEqual","add","isCollapsed","range","sort","selection","set","getOrderedSelectedAnnotations"];var Ox,Rx;Ox=Nx,Rx=304,function(t){for(;--t;)Ox.push(Ox.shift())}(++Rx);const Px=function(t,e){return Nx[t-=0]};class Lx extends e{static get[Px("0x17")](){return[kx]}static get[Px("0x13")](){return Px("0x1f")}constructor(t){super(t),this[Px("0x22")]=new Set,this._editorAnnotations=new Set}[Px("0x2c")](){const t=this[Px("0x15")],e=t[Px("0x9")][Px("0x2d")][Px("0xf")],n=En((()=>this[Px("0x27")]()),10);e.on(Px("0x1a"),((t,e)=>{e[Px("0x20")]&&(n.cancel(),this[Px("0x27")]())})),this[Px("0x19")](t.editing.view[Px("0x2d")],Px("0x1d"),((t,e,i)=>{i&&n()})),this[Px("0x19")](t.ui.focusTracker,Px("0x1d"),((e,n,i)=>{i||t[Px("0x24")]||this[Px("0x28")](Px("0x0"),{isAnnotationTracked:t=>this[Px("0x1c")].has(t[Px("0x5")])})})),this[Px("0x19")](this[Px("0x15")].ui,Px("0x25"),(()=>this.fire("uiUpdate")))}registerAnnotation(t){if(this[Px("0x1e")].has(t))return;this[Px("0x1e")][Px("0xb")](t[Px("0x6")]),this[Px("0x15")].ui[Px("0x1b")].add(t.view[Px("0x21")]);const e=this[Px("0x15")][Px("0x23")].get(kx);this[Px("0x19")](e[Px("0x3")],"remove",((t,e)=>{this[Px("0x15")].ui[Px("0x1b")][Px("0x26")](e.view.element),this[Px("0x1e")].delete(e[Px("0x6")])}))}[Px("0x8")](){return this[Px("0x15")][Px("0x7")][Px("0x6")].hasDomSelection}[Px("0x2")](t){if(Px("0x29")!=typeof t)throw new jl.CKEditorError(Px("0x12"));this[Px("0x22")][Px("0xb")](t)}refreshSelectedViews(){this.fire(Px("0x16"))}[Px("0x11")]({activeAnnotation:t,annotations:e}){const n=[],i=this.editor.model[Px("0x2d")][Px("0xf")],o=Array[Px("0x2a")](i.getRanges());for(const[t,i]of this[Px("0x1c")]){const o=r(i),s=e[Px("0x14")](t);o&&s&&n[Px("0x2b")]({annotation:s,range:o})}function r(t){for(const e of t)for(const t of o)if(e[Px("0x4")](t,!i[Px("0xc")]))return e;return null}return n[Px("0xe")](((e,n)=>{const i=e[Px("0xd")],o=n[Px("0xd")];if(!i[Px("0xa")](o)){if(i.containsRange(o,!0))return 1;if(o.containsRange(i,!0))return-1}return e[Px("0x18")]==t?-1:n[Px("0x18")]==t?1:0}))[Px("0x1")]((t=>t[Px("0x18")]))}get[Px("0x1c")](){const t=new Map;for(const e of Array[Px("0x2a")](this._dataCollectors))for(const[n,i]of e())t[Px("0x10")](n,i);return t}}const zx=["get","RestrictedEditingModeEditing","afterInit","editor","plugins","has","addCommentThread","enableCommand"];var jx,Fx;jx=zx,Fx=319,function(t){for(;--t;)jx.push(jx.shift())}(++Fx);const Vx=function(t,e){return zx[t-=0]};class Ux extends e{[Vx("0x3")](){const t=this[Vx("0x4")];t.plugins[Vx("0x6")](Vx("0x2"))&&t[Vx("0x5")][Vx("0x1")]("RestrictedEditingModeEditing")[Vx("0x0")](Vx("0x7"))}}var Hx=__webpack_require__(5743),qx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(Hx.Z,qx);Hx.Z.locals;const Wx=["dataInsert","commands","addCommentThread","execute","get","high","_handleImportedData","plugins","afterInit","importWord.commentsStyles","config","forEach","importWord","basic","define","editor","Users","listenTo"];var Gx,Zx;Gx=Wx,Zx=280,function(t){for(;--t;)Gx.push(Gx.shift())}(++Zx);const Kx=function(t,e){return Wx[t-=0]};class $x extends e{constructor(t){super(t),this[Kx("0x5")].config[Kx("0x4")](Kx("0x11"),Kx("0x3"))}[Kx("0x10")](){const t=this[Kx("0x5")],e=t[Kx("0x9")].get("importWord"),n=t[Kx("0xf")][Kx("0xc")](Kx("0x6"));e&&(e.on(Kx("0xb"),((t,[,e])=>{e.collaboration_features={comments:!0,user_id:n.me.id,comments_styles:this[Kx("0x5")][Kx("0x0")][Kx("0xc")](Kx("0x11"))}}),{priority:jl.priorities[Kx("0xd")]+10}),this[Kx("0x7")](e,Kx("0x8"),this[Kx("0xe")]))}[Kx("0xe")](t,e){const{comment_threads:n}=e;n&&n[Kx("0x1")]((({thread_id:t,comments:e})=>{const n=e.map((({author:t,content:e,created_at:n})=>({content:e,authorId:this[Kx("0x5")][Kx("0xf")][Kx("0xc")](Kx("0x6")).me.id,createdAt:new Date,attributes:{"@external":{authorName:t,createdAt:n?new Date(n):new Date,source:Kx("0x2")}}}))),i=this[Kx("0x5")].config.get("collaboration.channelId");this[Kx("0x5")][Kx("0xf")][Kx("0xc")](Cx)[Kx("0xa")]({channelId:i,threadId:t,comments:n})}))}}const Yx=["getCommentThread","removeCommentThread","CommentsRepository","init","destroy","hasContent","change:isThreadsLoadingPaused","_initializeMarkerConverters","registerAnnotation","upcast","document","dataToMarker","openNewCommentThread","differ","stop","map","addComment","switchReadOnly","for","ck-comment-marker","set","removeMarker","requires","updateMarker","_attachedThreads","hasCommentThread","name","high","CommentsEditing","getAllMarkersForId","EditorAnnotations","pluginName","_handleMarkerAddAndRemove","collaboration.channelId","getByInnerView","editing","listenTo","end","top","_detachCommentThread","model","low","view","start","includes","split","change","render","reconvertMarker","markerName","left","$marker","isObject","update:comment","Annotations","markers","commands","destroyed","schema","fetchCommentThread","delete","get","activeMarker","root","_threadToController","affectsData","_attachMarkerToThread","rootName","$graveyard","length","markerToHighlight","dataDowncast","comment:","once","change:isReadOnly","createPositionBefore","editor","_threads","filter","config","registerPostFixer","push","has","getAttribute","ck-comment-marker--active","isThreadsLoadingPaused","comment","conversion","elementToElement","add","plugins","createElement","data"];var Jx,Qx;Jx=Yx,Qx=132,function(t){for(;--t;)Jx.push(Jx.shift())}(++Qx);const Xx=function(t,e){return Yx[t-=0]};class tw extends e{static get[Xx("0x4c")](){return[Cx,Lx,Ux,$x]}static get[Xx("0x55")](){return Xx("0x52")}constructor(t){super(t),this.set("isThreadsLoadingPaused",!0),t[Xx("0x35")][Xx("0x22")]("ready",(()=>this[Xx("0x2e")]=!1)),this[Xx("0x4a")](Xx("0x17"),null),this.on("change:activeMarker",((e,n,i,o)=>{t[Xx("0x1")].change((()=>{if(i){const{id:e}=nw(i),n=this[Xx("0x53")](e);for(const e of n)t[Xx("0x59")][Xx("0x9")](e)}if(o){const{id:e}=nw(o),n=this[Xx("0x53")](e);for(const e of n)t[Xx("0x59")][Xx("0x9")](e)}}))})),this[Xx("0x4e")]=new Map}[Xx("0x39")](){const t=this[Xx("0x25")],e=t.plugins.get(Xx("0x38")),n=t[Xx("0x28")].get("collaboration.channelId");t[Xx("0x11")][Xx("0x32")]("addCommentThread",new Mx(t)),this.listenTo(t,Xx("0x23"),((n,i,o)=>{e[Xx("0x47")](o,t[Xx("0x28")][Xx("0x16")](Xx("0x57")))})),this[Xx("0x5a")](e,ew(Xx("0x37"),n),((n,{threadId:i})=>{t.model[Xx("0x7")]((t=>{for(const e of this[Xx("0x53")](i))t[Xx("0x4b")](e)}));const o=e[Xx("0x36")](i);e.hasCommentThread(i)&&!o.length||n[Xx("0x44")]()}),{priority:Xx("0x51")}),this[Xx("0x5a")](e,ew(Xx("0x46"),n),((n,{threadId:i,isFromAdapter:o})=>{const r=this.getAllMarkersForId(i);!o&&0!=r.length&&e[Xx("0x4f")](i)&&1===e.getCommentThread(i)[Xx("0x1e")]&&t[Xx("0x1")].change((t=>{for(const e of r)t[Xx("0x4d")](e,{usingOperation:!0,affectsData:!0})}))}),{priority:Xx("0x2")}),this[Xx("0x3d")](),this._handleMarkerAddAndRemove()}[Xx("0x3a")](){const t=this[Xx("0x25")][Xx("0x33")][Xx("0x16")](Xx("0x38")),e=this[Xx("0x25")][Xx("0x28")][Xx("0x16")](Xx("0x57"));for(const n of t.getCommentThreads({channelId:e}))t[Xx("0x0")](n.id),t[Xx("0x26")][Xx("0x15")](n.id);super[Xx("0x3a")]()}hasMarkerForId(t){return this[Xx("0x53")](t).length>0}getAllMarkersForId(t){return(this[Xx("0x4e")].get(t)||[])[Xx("0x45")]((t=>this[Xx("0x25")].model[Xx("0x10")][Xx("0x16")](t)))[Xx("0x27")]((t=>t))}[Xx("0x3d")](){const t=this[Xx("0x25")];t[Xx("0x30")][Xx("0x48")]("editingDowncast")[Xx("0x1f")]({model:Xx("0x2f"),view:t=>{const{id:e}=nw(t[Xx("0xa")]),n=[Xx("0x49")];return this.activeMarker&&nw(this[Xx("0x17")]).id===e&&n[Xx("0x2a")](Xx("0x2d")),{classes:n,attributes:{"data-comment":e}}}}),t[Xx("0x30")][Xx("0x48")](Xx("0x20")).markerToData({model:"comment",view:e=>{const n=t.model[Xx("0x10")][Xx("0x16")](e),{id:i,part:o}=nw(e);return n&&!n[Xx("0x1a")]?null:{group:Xx("0x2f"),name:o?i+":"+o:i}}}),t.conversion[Xx("0x48")]("upcast")[Xx("0x31")]({view:{name:"comment",attribute:{id:/^\w/}},model:(t,{writer:e})=>e[Xx("0x34")](Xx("0xc"),{"data-name":Xx("0x21")+t[Xx("0x2c")]("id")})}),t[Xx("0x30")].for(Xx("0x3f"))[Xx("0x41")]({view:Xx("0x2f")})}[Xx("0x56")](){const t=this[Xx("0x25")],e=t[Xx("0x33")][Xx("0x16")](Xx("0x38")),n=new Set;t.model[Xx("0x40")][Xx("0x29")]((e=>{let i=!1;for(const{name:o,data:r}of t[Xx("0x1")][Xx("0x40")][Xx("0x43")].getChangedMarkers()){const{group:s,id:a}=nw(o);let c=r.newRange;if(Xx("0x2f")!==s||!c)continue;const l=Xx("0x1d")===c[Xx("0x18")][Xx("0x1c")];l||(c=iw(c,t[Xx("0x1")]),!c||c.isEqual(r.newRange))?!c||!t[Xx("0x1")][Xx("0x3b")](c)||this[Xx("0x4e")][Xx("0x2b")](a)&&l?(e.removeMarker(o),i=!0):l||(this.isThreadsLoadingPaused?n.add(o):this[Xx("0x1b")](o,a)):(e[Xx("0x4d")](o,{range:c}),i=!0)}return i})),this.on(Xx("0x3c"),((e,i,o)=>{if(!o&&n.size)for(const e of n){const{id:i}=nw(e);n.delete(i),t[Xx("0x1")][Xx("0x10")][Xx("0x16")](e)&&this[Xx("0x1b")](e,i)}})),this.listenTo(t[Xx("0x1")][Xx("0x10")],Xx("0xe"),((i,o,r,s)=>{if(s)return;const{id:a}=nw(o[Xx("0x50")]),c=t[Xx("0x33")][Xx("0x16")]("CommentsRepository")[Xx("0x36")](a);n[Xx("0x15")](a),c&&!this.hasMarkerForId(a)&&(this[Xx("0x4e")].delete(a),e[Xx("0x0")](a))}))}[Xx("0x1b")](t,e){if(this[Xx("0x4e")][Xx("0x2b")](e)){const n=this[Xx("0x4e")][Xx("0x16")](e);return void(n[Xx("0x5")](t)||n.push(t))}this[Xx("0x4e")][Xx("0x4a")](e,[t]);const n=this[Xx("0x25")],i=n[Xx("0x33")][Xx("0x16")](Xx("0x38")),o=n[Xx("0x28")].get("collaboration.channelId"),r=n[Xx("0x33")].get(Xx("0x54")),s=()=>{const t=this[Xx("0x53")](e);if(0===t.length)return null;if(1===t[Xx("0x1e")])return pp(n[Xx("0x59")],t[0]);const i=t.map((t=>pp(n[Xx("0x59")],t)));return i.sort(((t,e)=>{const n=new jl.Rect(t),i=new jl.Rect(e),o=n[Xx("0x5c")]-i[Xx("0x5c")];return 0==o?n.left-i[Xx("0xb")]:o})),i[0]};this[Xx("0x53")](e)[0].managedUsingOperations?i[Xx("0x14")]({channelId:o,threadId:e}).then((t=>{if(Xx("0x12")!==n.state)if(t){const e=t.attachTo(s);r[Xx("0x3e")](e)}else{const t=this[Xx("0x53")](e);n[Xx("0x1")][Xx("0x7")]((e=>{for(const n of t)e[Xx("0x4b")](n)}))}})):n[Xx("0x59")][Xx("0x3")].once(Xx("0x8"),(()=>{const t=n[Xx("0x33")].get(Xx("0xf")),a=i[Xx("0x42")]({channelId:o,threadId:e,target:s}),c=i[Xx("0x19")][Xx("0x16")](a)[Xx("0x3")],l=t[Xx("0x58")](c);r[Xx("0x3e")](l)}),{priority:"low"})}}function ew(t,e){return e?t+":"+e:t}function nw(t){const e=t[Xx("0x6")](":");return{group:e[0],id:e[1],part:e[2]}}function iw(t,e){const n=e[Xx("0x13")],i=e.createRange(t[Xx("0x4")]);for(const o of t.getWalker()){const{type:t,item:r,nextPosition:s}=o;if("text"===t||n[Xx("0xd")](r)){const t=e[Xx("0x24")](r);i.isCollapsed&&(i[Xx("0x4")]=t),i[Xx("0x5b")]=s}}return i.isCollapsed?null:i}const ow='\x3c!--\n\n What you\'re currently looking at is the source code of a legally protected, proprietary software.\n CKEditor 5 Collaboration is licensed under a commercial license and protected by copyright law. Where not otherwise indicated,\n all CKEditor 5 Collaboration content is authored by CKSource engineers and consists of CKSource-owned intellectual property.\n\n Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n\n!--\x3e\n\n\n',rw=["_threadToController","_createUIButton","CommentsUI","editor","view","removeCommentThread","Comment","execute","getCommentThread","plugins","hasMarkerForId","model","hasCommentThread","map","pluginName","has","innerView","getAllMarkersForId","CommentThreadInputView","comment","low","activeMarker","get","listenTo","add","addSourceCollector","from","tooltip","highest","find","addComment","requires","icon","comment:","CommentsListView","length","locale","focus","commands","init"];var sw,aw;sw=rw,aw=292,function(t){for(;--t;)sw.push(sw.shift())}(++aw);const cw=function(t,e){return rw[t-=0]};class lw extends e{static get[cw("0x2")](){return cw("0x1e")}static get[cw("0x13")](){return[Cx,tw,Lx,kx]}get[cw("0x16")](){return uk}get[cw("0x6")](){return ek}[cw("0x1b")](){const t=this[cw("0x1f")],e=t[cw("0x25")][cw("0xa")](Cx),n=t[cw("0x25")][cw("0xa")](tw),i=t[cw("0x25")][cw("0xa")](kx),o=t[cw("0x25")].get(Lx);t.ui.componentFactory[cw("0xc")](cw("0x7"),(()=>this[cw("0x1d")]())),o[cw("0xd")]((()=>{const t=[];for(const[i,o]of e[cw("0x1c")]){const e=n[cw("0x5")](i.id),r=e[cw("0x1")]((t=>t.getRange()));e[cw("0x17")]>0&&t.push([o.view,r])}return t})),this[cw("0xb")](i,"change:activeAnnotations",((t,i,o)=>{const r=Array[cw("0xe")](o).map((t=>t[cw("0x4")]))[cw("0x11")]((t=>e._viewToController[cw("0x3")](t)));if(!r)return void(n[cw("0x9")]=null);const s=e._viewToController.get(r)[cw("0x27")].id,a=cw("0x15")+s;n[cw("0x26")](s)?n.activeMarker=a:n[cw("0x9")]&&(n.activeMarker=null)})),this.listenTo(e,cw("0x21"),((e,{threadId:i,isFromAdapter:o})=>{!o&&t.ui.focusTracker.isFocused&&n[cw("0x26")](i)&&t.editing.view.focus()}),{priority:cw("0x10")}),this[cw("0xb")](e,cw("0x12"),((i,{threadId:o,isFromAdapter:r})=>{!r&&n.hasMarkerForId(o)&&e[cw("0x0")](o)&&1===e[cw("0x24")](o)[cw("0x17")]&&(t.editing[cw("0x20")][cw("0x19")](),i.stop())}),{priority:cw("0x8")})}[cw("0x1d")](){const t=this.editor,e=new ic(t[cw("0x18")]),n=t[cw("0x1a")][cw("0xa")]("addCommentThread");return e.label=df(t.locale,"Comment"),e[cw("0xf")]=df(t[cw("0x18")],cw("0x22")),e[cw("0x14")]=ow,e.bind("isEnabled").to(n),this[cw("0xb")](e,cw("0x23"),(()=>n.execute())),e}}const dw=["listenTo","affectsData","clearForceDisabled","clipboardInput","afterInit","editing","editor","DragDrop","set","config","has","commands","view","forceDisabled","highest","commentsOnlyMode","_disableCommentsOnlyMode","document","cut","delete","plugins","stop","change:isEnabled","pluginName","get","addCommentThread","requires","stopListening","_enableCommentsOnlyMode","isEnabled"];var uw,hw;uw=dw,hw=305,function(t){for(;--t;)uw.push(uw.shift())}(++hw);const mw=function(t,e){return dw[t-=0]};class gw extends e{static get[mw("0x12")](){return"CommentsOnly"}static get[mw("0x15")](){return[tw]}constructor(t){super(t),this[mw("0x3")](mw("0x18"),null),this.on(mw("0x11"),((t,e,n)=>{n?this[mw("0x17")]():this[mw("0xb")]()}))}[mw("0x1d")](){null===this.isEnabled&&(this[mw("0x18")]=!!this[mw("0x1")][mw("0x4")][mw("0x13")]("commentsOnly"))}[mw("0x17")](){for(const[t,e]of this.editor.commands)e[mw("0x1a")]&&"addCommentThread"!==t&&e[mw("0x8")](mw("0xa"));this[mw("0x1")].plugins[mw("0x5")](mw("0x2"))&&this[mw("0x1")][mw("0xf")].get(mw("0x2")).forceDisabled(mw("0xa"));const t=this.editor[mw("0x0")][mw("0x7")].document;this[mw("0x19")](t,mw("0xd"),(t=>t[mw("0x10")]()),{priority:mw("0x9")}),this[mw("0x19")](t,mw("0x1c"),(t=>t.stop()),{priority:"highest"}),this[mw("0x19")](t,mw("0xe"),(t=>t[mw("0x10")]()),{priority:mw("0x9")})}_disableCommentsOnlyMode(){for(const[t,e]of this[mw("0x1")][mw("0x6")])e.affectsData&&mw("0x14")!==t&&e[mw("0x1b")](mw("0xa"));this[mw("0x16")](this.editor[mw("0x0")].view[mw("0xc")])}}const pw=["length","_assertAnnotationDoesNotBelongToMultipleUIs","requires","set","change:activeAnnotation","annotationsuis-annotation-mismatch","_uisData","has","deactivate","push","deactivateAll","stopListening","add","register","_setSelectedAnnotations","plugins","setActiveAnnotation","activeUIs","destroy","detach","find","hasActive","isActive","remove","_visibleAnnotations","from","collection","activate","_activateAnnotation","attach","context","listenTo","delete","annotationsuis-activate-missing-ui","_uis","filter","activeAnnotations","get","_removeActiveAnnotation","switchTo","pluginName","_addActiveAnnotation","refilterAnnotations"];var fw,bw;fw=pw,bw=103,function(t){for(;--t;)fw.push(fw.shift())}(++bw);const kw=function(t,e){return pw[t-=0]};class xw extends c{static get[kw("0x1c")](){return[kx]}static get[kw("0x17")](){return"AnnotationsUIs"}constructor(t){super(t),this[kw("0x0")]=new Set,this._uis=new Map,this[kw("0x20")]=new Map}init(){const t=this[kw("0xd")][kw("0x29")][kw("0x14")](kx);this[kw("0xe")](t,kw("0xb"),((t,e)=>{for(const t of this[kw("0x0")]){const n=this[kw("0x11")][kw("0x14")](t);(0,this._uisData[kw("0x14")](t)[kw("0x12")])(e)&&n[kw("0x2a")](e)}})),this[kw("0xe")](t,"_deactivateAllAnnotations",(()=>{for(const t of this.activeUIs)this._uis[kw("0x14")](t)[kw("0x2a")](null)})),this[kw("0xe")](t[kw("0x7")],kw("0x26"),((t,e)=>{this[kw("0x1b")](e)}))}[kw("0x4")](){return this.activeUIs.size>0}[kw("0x5")](t){return this[kw("0x0")][kw("0x21")](t)}[kw("0xa")](t,e=(()=>!0)){const n=this[kw("0xd")].plugins[kw("0x14")](kx);if(!this._uis[kw("0x21")](t))throw new jl.CKEditorError(kw("0x10"),this,{uiName:t});this.isActive(t)&&this[kw("0x22")](t),this[kw("0x0")][kw("0x26")](t);const i=new hx;(function({source:t,target:e,filter:n}){for(const i of t)n(i)&&e[ux("0x10")](i);e[ux("0x11")](t,ux("0x10"),((t,i)=>{n(i)&&e[ux("0x10")](i)})),e[ux("0x11")](t,ux("0x1"),((t,n)=>{e[ux("0x4")](n)&&e[ux("0x1")](n)}))})({source:n[kw("0x7")],target:i,filter:e}),this[kw("0x20")].set(t,{collection:i,filter:e});const o=this[kw("0x11")][kw("0x14")](t);o[kw("0xc")](i),this[kw("0xe")](o,kw("0x1e"),((t,e,i,o)=>{o&&n[kw("0x15")](o),i&&n[kw("0x18")](i)}))}deactivate(t){this[kw("0x0")][kw("0xf")](t);const e=this[kw("0x11")][kw("0x14")](t);e[kw("0x2")](),this[kw("0x25")](e),this[kw("0x20")].get(t)[kw("0x9")][kw("0x1")](),this[kw("0x20")][kw("0xf")](t)}[kw("0x16")](t){const e=this.context[kw("0x29")].get(kx),n=Array[kw("0x8")](e[kw("0x13")])[0]||null;this[kw("0x24")](),this[kw("0xa")](t);const i=this[kw("0x11")][kw("0x14")](t);i[kw("0x2a")](n),i[kw("0x28")]&&n&&i[kw("0x28")]([n])}deactivateAll(){for(const t of this.activeUIs)this.deactivate(t)}[kw("0x27")](t,e){if(this[kw("0x11")][kw("0x21")](t))throw new jl.CKEditorError("annotationsuis-register-already-registered");if("function"!=typeof e[kw("0xc")]||"function"!=typeof e[kw("0x2")]||"function"!=typeof e[kw("0x2a")])throw new jl.CKEditorError("annotationsuis-register-invalid-interface",null);this._uis[kw("0x1d")](t,e)}[kw("0x19")](){const t=this[kw("0xd")][kw("0x29")].get(kx)[kw("0x9")],e=new Map,n=Array.from(this.activeUIs);for(const t of this[kw("0x0")]){const n=this[kw("0x20")][kw("0x14")](t).collection;for(const i of n)e[kw("0x1d")](i,t)}for(const i of t){const t=e[kw("0x14")](i);this[kw("0x1b")](i);const o=n[kw("0x3")]((t=>this[kw("0x20")][kw("0x14")](t)[kw("0x12")](i)));t!==o&&(t&&this[kw("0x20")][kw("0x14")](t)[kw("0x9")][kw("0x6")](i),o&&this[kw("0x20")][kw("0x14")](o)[kw("0x9")][kw("0x26")](i))}}[kw("0x1")](){this[kw("0x24")](),super[kw("0x1")]()}[kw("0x1b")](t){const e=[];for(const n of this[kw("0x0")])(0,this._uisData[kw("0x14")](n).filter)(t)&&e[kw("0x23")](n);if(e[kw("0x1a")]>1)throw new jl.CKEditorError(kw("0x1f"),null,{matchedUIs:e,annotationType:t.type})}}var ww=__webpack_require__(5745),_w={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(ww.Z,_w);ww.Z.locals;const Aw=["div","setTemplate","class","minHeight","set","list","bindTemplate","createCollection","ck-reset"];var vw,Cw;vw=Aw,Cw=186,function(t){for(;--t;)vw.push(vw.shift())}(++Cw);const yw=function(t,e){return Aw[t-=0]},Ew=(0,jl.toUnit)("px");class Tw extends Aa{constructor(t){super(t);const e=this[yw("0x0")];this[yw("0x7")](yw("0x6"),0),this[yw("0x7")](yw("0x5"),""),this[yw("0x8")]=this[yw("0x1")](),this[yw("0x4")]({tag:yw("0x3"),attributes:{class:["ck","ck-sidebar",yw("0x2"),e.to(yw("0x5"))],style:{minHeight:e.to(yw("0x6"),(t=>t?Ew(t+10):null))}},children:this[yw("0x8")]})}}const Dw=["bindTemplate","_mutationObserver","createCollection","height","set","top","element","destroy","ck-sidebar-item","content","detach","ck-sidebar-item--no-animation","updateHeight","clientHeight","setTemplate","_targetTop","attach","render","bottom","bind","isAnimationDisabled"];var Sw,Iw;Sw=Dw,Iw=288,function(t){for(;--t;)Sw.push(Sw.shift())}(++Iw);const Bw=function(t,e){return Dw[t-=0]},Mw=(0,jl.toUnit)("px");class Nw extends Aa{constructor(t){super(t),this[Bw("0xa")]("top"),this[Bw("0xa")](Bw("0x9"),0),this[Bw("0x4")](Bw("0x3")).to(this,Bw("0xb"),this,Bw("0x9"),((t,e)=>(t||0)+e)),this.set(Bw("0x5"),!1),this[Bw("0x7")]=Kk((()=>this[Bw("0x12")]())),this[Bw("0x0")]=null,this[Bw("0xf")]=this[Bw("0x8")]();const e=this[Bw("0x6")];this[Bw("0x14")]({tag:"div",attributes:{class:[Bw("0xe"),e.to(Bw("0x5"),(t=>t?Bw("0x11"):""))],style:{top:e.to("top",Mw)}},children:this[Bw("0xf")]})}[Bw("0x2")](){super[Bw("0x2")](),this[Bw("0x7")][Bw("0x1")](this[Bw("0xc")])}[Bw("0x12")](){const t=this[Bw("0xc")][Bw("0x13")];t&&(this.height=t)}[Bw("0xd")](){this[Bw("0xf")].clear(),this[Bw("0x7")][Bw("0x10")](),super[Bw("0xd")]()}}const Ow=["container","destroy","get","object","locale","_activeAnnotation","minHeight","_getTargetTop","stopListening","_createSidebarView","_lastItem","change:targetRect","_detachFromContainer","_annotations","clear","list","add","refresh","target","_getItemAfter","set","_getMaxAvailableTop","content","appendChild","bottom","pluginName","_setItemTop","define","render","_alignAfterItem","updateHeight","sidebar.container","_destroySidebarItemView","bind","_alignBeforeItem","top","_attachToContainer","_sidebarItemViewToAnnotation","change:top","getIndex","view","sidebar-attachtocontainer-missing-container","nodeType","context","sidebar.preventScrollOutOfView","push","_annotationToSidebarItemView","_getItemBefore","listenTo","Sidebar","addAnnotation","_alignForTopChange","init","class","_updateLastItem","isAnimationDisabled","delete","change:bottom","_recalculateBuffer","max","remove","isActive","element","_alignToTargetRect","config","sidebar-setcontainer-invalid-element","length","_alignForBottomChange","_recalculate","_spaceBetweenItems","getSidebarItemView"];var Rw,Pw;Rw=Ow,Pw=414,function(t){for(;--t;)Rw.push(Rw.shift())}(++Pw);const Lw=function(t,e){return Ow[t-=0]};class zw extends c{static get[Lw("0x25")](){return Lw("0x3d")}constructor(t){super(t),this[Lw("0x20")](Lw("0x16")),this[Lw("0x34")]=this[Lw("0x15")](),this[Lw("0x20")](Lw("0xc"),null),this._spaceBetweenItems=25,this._sidebarItemViewToAnnotation=new Map,this[Lw("0x3a")]=new Map,this[Lw("0x37")].config[Lw("0x27")](Lw("0x38"),!1),this[Lw("0x19")]=null,this[Lw("0x11")]=null,this._recalculateBuffer=[]}[Lw("0x40")](){const t=this[Lw("0x37")][Lw("0x5")][Lw("0xe")](Lw("0x2b"));t&&this.setContainer(t)}setContainer(t){if(!Fw(t))throw new jl.CKEditorError(Lw("0x6"));this.container=t}[Lw("0x30")]({viewClass:t="",spaceBetweenItems:e=25}={}){if(!Fw(this[Lw("0xc")]))throw new jl.CKEditorError(Lw("0x35"),this);this[Lw("0xc")][Lw("0x23")](this[Lw("0x34")][Lw("0x3")]),this[Lw("0x34")][Lw("0x41")]=t,this[Lw("0xa")]=e}rearrange({removedAnnotation:t,previousAnnotation:e,nextAnnotation:n}){const i=this.getSidebarItemView(t);this.view[Lw("0x1b")][Lw("0x1")](i),this._destroySidebarItemView(t),e&&this[Lw("0x4")](this[Lw("0xb")](e)),n&&this[Lw("0x4")](this.getSidebarItemView(n)),this._updateLastItem()}[Lw("0x1d")]({blurredAnnotation:t,activatedAnnotation:e,disableAnimationOnActivatedAnnotation:n}){if(this._activeAnnotation=e,t){t.isActive=!1;const e=this.getSidebarItemView(t);e&&n&&(e.isAnimationDisabled=!1)}if(e){const t=this[Lw("0xb")](e);t&&(e[Lw("0x2")]=!0,n&&(t[Lw("0x43")]=!0,t[Lw("0x2f")]+=1),this[Lw("0x4")](t))}}[Lw("0x18")](t){this[Lw("0x14")](),this[Lw("0x34")][Lw("0x3")][Lw("0x1")]();for(const e of t)this._destroySidebarItemView(e);this[Lw("0x34")][Lw("0x1b")][Lw("0x1a")](),this[Lw("0x34")].class="",this[Lw("0x16")]=null}[Lw("0x3e")](t,e){e||(e=t[Lw("0x34")]);const n=new Nw(this[Lw("0x37")][Lw("0x10")]);this._sidebarItemViewToAnnotation.set(n,t),this[Lw("0x3a")][Lw("0x20")](t,n),n.content[Lw("0x1c")](e),this.listenTo(t[Lw("0x34")],Lw("0x17"),((e,i,o)=>{const r=this._getTargetTop(t,o);n._targetTop!=r&&(n._targetTop=r,this[Lw("0x26")](n,r))})),this.listenTo(n,Lw("0x32"),(()=>{this[Lw("0x9")](n,"top")})),this[Lw("0x3c")](n,Lw("0x45"),(()=>{this[Lw("0x9")](n,"bottom")})),this._alignToTargetRect(n);const i=this._getItemBefore(n);return i?this[Lw("0x29")](i,n)||this._alignToTargetRect(n):this[Lw("0x4")](n),this._updateLastItem(),this[Lw("0x34")].list[Lw("0x1c")](n),n}[Lw("0x3f")](t){if(!t[Lw("0x22")].length)return;const e=this._getItemBefore(t);if(!e)return;const n=this[Lw("0x31")][Lw("0xe")](e),i=this[Lw("0x11")];i&&i===n?this[Lw("0x29")](e,t):this[Lw("0x2e")](t,e)}[Lw("0x8")](t){if(!t.content[Lw("0x7")])return;const e=this._getItemAfter(t);if(!e)return;const n=this[Lw("0x31")].get(e),i=this[Lw("0x37")].config[Lw("0xe")](Lw("0x38")),o=this[Lw("0x11")];o&&o===n&&i?(this._alignBeforeItem(e,t),this[Lw("0x29")](t,e)):o&&o===n?this[Lw("0x2e")](e,t):this._alignAfterItem(t,e)}_recalculate(t,e){0===this[Lw("0x46")][Lw("0x7")]&&setTimeout((()=>{for(const{sidebarItemView:t,changedProp:e}of this._recalculateBuffer)Lw("0x2f")===e?this._alignForTopChange(t):this[Lw("0x8")](t);this._recalculateBuffer=[]}),10),this._recalculateBuffer[Lw("0x39")]({sidebarItemView:t,changedProp:e})}[Lw("0xb")](t){return this[Lw("0x3a")][Lw("0xe")](t)}destroy(){this[Lw("0x34")][Lw("0xd")]()}[Lw("0x2c")](t){const e=this[Lw("0xb")](t);this[Lw("0x14")](e),this[Lw("0x14")](t[Lw("0x34")]),e[Lw("0xd")](),this[Lw("0x3a")][Lw("0x44")](t),this._sidebarItemViewToAnnotation[Lw("0x44")](e)}_createSidebarView(){const t=new Tw(this[Lw("0x37")][Lw("0x10")]);return t[Lw("0x28")](),this.on("change:_lastItem",((e,n,i,o)=>{o&&t.unbind(Lw("0x12")),i?t[Lw("0x2d")](Lw("0x12")).to(i,Lw("0x24")):t[Lw("0x12")]=null})),t}[Lw("0x42")](){this[Lw("0x16")]=this[Lw("0xb")](this[Lw("0x19")].last)}[Lw("0x3b")](t){const e=this[Lw("0x31")].get(t),n=this[Lw("0x19")][Lw("0xe")](this[Lw("0x19")][Lw("0x33")](e)-1);return n&&this[Lw("0xb")](n)}[Lw("0x1f")](t){const e=this._sidebarItemViewToAnnotation[Lw("0xe")](t),n=this[Lw("0x19")][Lw("0xe")](this[Lw("0x19")][Lw("0x33")](e)+1);return n&&this.getSidebarItemView(n)}[Lw("0x2e")](t,e){t[Lw("0x2a")]();const n=jw(e[Lw("0x24")]+this[Lw("0xa")],t.top);return!!n&&(this[Lw("0x26")](e,e[Lw("0x2f")]-n),!0)}_alignAfterItem(t,e){t.updateHeight();const n=jw(t[Lw("0x24")]+this[Lw("0xa")],e[Lw("0x2f")]);return!!n&&(this._setItemTop(e,e[Lw("0x2f")]+n,!1),!0)}[Lw("0x4")](t){const e=this._sidebarItemViewToAnnotation.get(t);if(!e||!e[Lw("0x1e")])return;const n=this[Lw("0x13")](e,e.targetRect);this[Lw("0x26")](t,n)}[Lw("0x13")](t,e){if(null===e)return 0;if(t[Lw("0x1e")]instanceof jl.Rect)return e.top;{const t=new jl.Rect(this[Lw("0x34")].element).top;return e[Lw("0x2f")]-t}}[Lw("0x26")](t,e,n=this[Lw("0x37")][Lw("0x5")][Lw("0xe")]("sidebar.preventScrollOutOfView")){n&&(e=Math[Lw("0x0")](e,this._getMaxAvailableTop(t))),t[Lw("0x2f")]=e}[Lw("0x21")](t){let e=this[Lw("0x3b")](t),n=0;for(;e;)e[Lw("0x2a")](),n+=this[Lw("0xa")]+e.height,e=this[Lw("0x3b")](e);return n}}function jw(t,e){return Math[Lw("0x0")](t-e,0)}function Fw(t){return null!==t&&Lw("0xf")==typeof t&&1===t[Lw("0x36")]}const Vw=["hasDomSelection","getOrderedSelectedAnnotations","uiUpdate","_destroyEditorAnnotationsIntegration","_detachFromContainer","attach","context","ck-sidebar--wide","updateTargetRect","_refreshPositioningDebounced","_integrateWithEditorAnnotations","wideSidebar","get","set","Sidebar","widesidebar-attach-already-attached","cancel","ready","requires","editors","annotations","addAnnotation","off","detach","removeEventListener","listenTo","stopListening","activeAnnotation","stop","remove","isAttached","add","blur","WideSidebar","refreshPositioning","set:container","_attachToContainer","plugins","_editorAnnotations","setActiveAnnotation","rearrange","EditorAnnotations","high","refresh","addEventListener","_activeAnnotation","widesidebar-detach-not-attached","_annotations","resize","change:container"];var Uw,Hw;Uw=Vw,Hw=264,function(t){for(;--t;)Uw.push(Uw.shift())}(++Hw);const qw=function(t,e){return Vw[t-=0]};class Ww extends c{static get[qw("0x4")](){return[zw,xw]}static get pluginName(){return qw("0x13")}constructor(t){super(t),this[qw("0x10")]=!1,this[qw("0x31")](qw("0xd"),null),this[qw("0x6")]=null,this._editorAnnotations=new jl.Collection,this[qw("0x2d")]=En((()=>{this[qw("0x6")].refreshPositioning()}),250,{leading:!1})}init(){const t=this[qw("0x2a")].plugins[qw("0x30")](xw),e=this[qw("0x2a")].plugins[qw("0x30")](zw);t.register(qw("0x2f"),this),e.container&&t.switchTo(qw("0x2f"))}setActiveAnnotation(t){if(t===this[qw("0xd")])return;const e=this.context[qw("0x17")].get(zw);e[qw("0x1f")]=t;const n=this[qw("0xd")];this[qw("0xd")]=t,e.refresh({blurredAnnotation:n,activatedAnnotation:this[qw("0xd")]})}attach(t){this[qw("0x6")]=t;const e=this[qw("0x2a")][qw("0x17")][qw("0x30")](qw("0x0"));if(e[qw("0x21")]=t,this[qw("0x10")])throw new jl.CKEditorError(qw("0x1"),this);this[qw("0x10")]=!0,this[qw("0xb")](e,qw("0x15"),(()=>{this[qw("0x9")](),this[qw("0xb")](e,qw("0x23"),(e=>{e[qw("0x8")](),this[qw("0x29")](t)}))})),e[qw("0x16")]({viewClass:qw("0x2b")});const n=t=>{t[qw("0x2c")](),e[qw("0x7")](t)};for(const e of t)n(e);this[qw("0xb")](t,qw("0x11"),((t,e)=>{n(e)})),this[qw("0xb")](t,qw("0xf"),((n,i,o)=>{e[qw("0x1a")]({removedAnnotation:i,previousAnnotation:t[qw("0x30")](o-1),nextAnnotation:t.get(o+1)}),i===this[qw("0xd")]&&this[qw("0x19")](null)}),{priority:"high"}),this[qw("0xb")](t,"focus",((t,e)=>{this.setActiveAnnotation(e)})),this[qw("0xb")](t,qw("0x12"),(()=>{this[qw("0x19")](null)}));const i=this.context[qw("0x5")]?this[qw("0x2a")][qw("0x5")]:new jl.Collection([this.context]);for(const t of i)this[qw("0x2e")](t);this[qw("0xb")](i,qw("0x11"),((t,e)=>{this[qw("0xb")](e,qw("0x3"),(()=>{this[qw("0x2e")](e)}))})),this[qw("0xb")](i,qw("0xf"),((t,e)=>{e.plugins.has(qw("0x1b"))&&this._destroyEditorAnnotationsIntegration(e[qw("0x17")][qw("0x30")](qw("0x1b")))})),window[qw("0x1e")]("resize",this[qw("0x2d")]),this[qw("0x6")][qw("0x14")]()}[qw("0x9")](){if(!this[qw("0x10")])throw new jl.CKEditorError(qw("0x20"),this);this[qw("0x19")](null);const t=this[qw("0x2a")].plugins[qw("0x30")](zw);t[qw("0x28")](this[qw("0x6")]),this[qw("0xc")](t),this[qw("0xc")](this[qw("0x6")]),this[qw("0xc")](this[qw("0x2a")][qw("0x5")]);for(const t of Array.from(this._editorAnnotations))this[qw("0x27")](t);window[qw("0xa")](qw("0x22"),this[qw("0x2d")]),this[qw("0x2d")][qw("0x2")](),this[qw("0xd")]=null,this[qw("0x10")]=!1,this[qw("0x6")]=null}destroy(){this[qw("0x10")]&&this[qw("0x9")]()}_integrateWithEditorAnnotations(t){const e=t[qw("0x17")].get(qw("0x1b"));if(!e)return;const n=()=>{const t=e[qw("0x25")]({annotations:this[qw("0x6")],activeAnnotation:this[qw("0xd")]});this[qw("0x19")](t[0]||null)};this[qw("0xb")](e,qw("0x1d"),n),this[qw("0xb")](e,qw("0x12"),((t,{isAnnotationTracked:e})=>{this[qw("0xd")]&&e(this[qw("0xd")])&&this[qw("0x19")](null)})),this[qw("0xb")](e,qw("0x26"),(()=>{this._refreshPositioningDebounced()})),this[qw("0xb")](this[qw("0x6")],qw("0x12"),(t=>{e[qw("0x24")]()&&(n(),t[qw("0xe")]())}),{priority:qw("0x1c")}),this[qw("0x18")].add(e)}[qw("0x27")](t){t&&(this[qw("0xc")](t),this._editorAnnotations[qw("0xf")](t))}}const Gw=["counterView","_badge","extendTemplate","set","isDirty","add","children","bind","span","ck-annotation-counter__badge","number","icon","ck-annotation-counter","...","ck-annotation-counter__badge--edit-mode"];var Zw,Kw;Zw=Gw,Kw=384,function(t){for(;--t;)Zw.push(Zw.shift())}(++Kw);const $w=function(t,e){return Gw[t-=0]};class Yw extends ic{constructor(t){super(t);const e=this.bindTemplate;this[$w("0x9")]("isDirty",!1),this[$w("0x9")]($w("0x1"),0),this[$w("0xd")]($w("0x7")).to(this,$w("0xa"),this,$w("0x1"),((t,e)=>t?$w("0x4"):e)),this[$w("0x9")]("annotationType",""),this[$w("0x2")]=ow,this[$w("0x8")]({attributes:{class:[$w("0x3")]}}),this[$w("0x6")]=new Aa,this.counterView.setTemplate({tag:$w("0xe"),attributes:{class:[$w("0x0"),e.to("annotationType",(t=>"ck-annotation-counter__badge--"+t)),e.if($w("0xa"),$w("0x5"))]},children:[{text:e.to($w("0x7"))}]}),this[$w("0xc")][$w("0xb")](this[$w("0x6")])}}var Jw=__webpack_require__(659),Qw={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(Jw.Z,Qw);Jw.Z.locals;const Xw=["_showBalloon","content","add","stopListening","detach","keyCode","refresh","annotationType","isDirty","southArrowNorthWest","_annotationToNarrowView","editors","_setSelectedAnnotations","register","southArrowNorth","bodyCollection","ready","Sidebar","pluginName","setActiveAnnotation","remove","mousedown","set:container","defaultPositions","init","isVisible","_refreshPositioning","removeEventListener","preventDefault","requires","number","attach","isAttached","keydown","create","target","_domEmitter","delete","off","preventClosingBalloon","resize","ck-sidebar--narrow","activeAnnotation","contains","first","_refreshPositioningDebounced","view","addEventListener","unpin","set","attachToDom","element","narrowsidebar-attach-already-attached","_hideBalloon","annotations","stop","locale","_updateBalloonPosition","_attachListeners","pin","destroy","_detachListeners","_annotations","_integrateWithEditorAnnotations","addAnnotation","Esc","_manuallyClosedAnnotationViews","getSidebarItemView","context","northArrowSouthWest","_destroyEditorAnnotationsIntegration","high","type","_attachToContainer","has","NarrowSidebar","balloonPanelView","get","blur","getByView","change:container","from","refreshPositioning","listenTo","plugins","EditorAnnotations","detachFromDom","includes","focus","execute","northArrowSouth","hasDomSelection","_editorAnnotations","narrowsidebar-detach-not-attached","_selectedAnnotations","clear","southArrowNorthEast"];var t_,e_;t_=Xw,e_=204,function(t){for(;--t;)t_.push(t_.shift())}(++e_);const n_=function(t,e){return Xw[t-=0]};class i_ extends c{static get[n_("0x13")](){return[zw,xw]}static get[n_("0x8")](){return n_("0x41")}constructor(t){super(t),this.isAttached=!1,this[n_("0x38")]=new Set,this._domEmitter=Object[n_("0x18")](jl.DomEmitterMixin),this[n_("0x0")]=new Map,this.set(n_("0x20"),null),this[n_("0x2c")]=null,this._selectedAnnotations=[],this[n_("0x52")]=new jl.Collection,this[n_("0x23")]=En((()=>{this[n_("0x10")]()}),250,{leading:!1})}[n_("0xe")](){this[n_("0x3a")][n_("0x4a")][n_("0x43")](xw)[n_("0x3")]("narrowSidebar",this),this[n_("0x5")]=new Ja(this[n_("0x3a")][n_("0x2e")]),this[n_("0x42")]=new Da(this.context[n_("0x2e")]),this[n_("0x5")][n_("0x28")](),this[n_("0x5")][n_("0x59")](this[n_("0x42")])}[n_("0x15")](t){this[n_("0x2c")]=t;const e=this.context.plugins[n_("0x43")](zw),n=this[n_("0x42")];if(e[n_("0x34")]=t,this.isAttached)throw new jl.CKEditorError(n_("0x2a"),this);this[n_("0x16")]=!0,this[n_("0x49")](e,n_("0xc"),(()=>{this.detach(),this.listenTo(e,n_("0x46"),(e=>{e[n_("0x1c")](),this[n_("0x15")](t)}))})),e[n_("0x3f")]({viewClass:n_("0x1f"),spaceBetweenItems:5});const i=t=>{const i=new Yw(this[n_("0x3a")].locale);e[n_("0x36")](t,i),this._annotationToNarrowView[n_("0x27")](t,i),i.bind("isDirty",n_("0x5e"),n_("0x14")).to(t[n_("0x24")],n_("0x5f"),n_("0x3e"),"length"),i.on(n_("0x4f"),(()=>{this[n_("0x38")][n_("0x55")](),n[n_("0x58")][n_("0x22")]!==t[n_("0x24")]?(this[n_("0x57")](t),t[n_("0x24")][n_("0x29")][n_("0x4e")](),this.setActiveAnnotation(t)):this.setActiveAnnotation(null)}))};for(const e of t)i(e);this[n_("0x49")](t,"add",((t,e)=>{i(e)})),this[n_("0x49")](t,n_("0xa"),((n,i,o)=>{this._annotationToNarrowView.get(i)[n_("0x32")](),this[n_("0x0")][n_("0x1b")](i),e.rearrange({removedAnnotation:i,previousAnnotation:t.get(o-1),nextAnnotation:t.get(o+1)}),i===this.activeAnnotation&&this[n_("0x9")](null)}),{priority:"low"}),this[n_("0x49")](t,n_("0x4e"),((t,e)=>{this.setActiveAnnotation(e)})),this[n_("0x49")](t,n_("0x44"),(()=>{this[n_("0x9")](null)})),this[n_("0x1a")][n_("0x49")](document,n_("0x17"),((t,e)=>{e[n_("0x5c")]===jl.keyCodes.esc&&n[n_("0xf")]&&(this._manuallyClosedAnnotationViews[n_("0x59")](n[n_("0x58")][n_("0x22")]),this[n_("0x2b")](),e.stopPropagation(),e[n_("0x12")]())})),this[n_("0x1a")][n_("0x49")](document,n_("0xb"),((t,i)=>{const o=i[n_("0x19")];n.isVisible&&n[n_("0x29")][n_("0x21")](o)||e.view[n_("0x29")][n_("0x21")](o)||t[n_("0x1d")]||(this[n_("0x38")][n_("0x55")](),this[n_("0x2b")](),this[n_("0x9")](null))}));const o=this.context[n_("0x1")]?this[n_("0x3a")][n_("0x1")]:new jl.Collection([this[n_("0x3a")]]);for(const t of o)this[n_("0x35")](t);this[n_("0x49")](o,n_("0x59"),((t,e)=>{this[n_("0x49")](e,n_("0x6"),(()=>{this[n_("0x35")](e)}))})),this[n_("0x49")](o,"remove",((t,e)=>{e.plugins[n_("0x40")](n_("0x4b"))&&this[n_("0x3c")](e.plugins[n_("0x43")](n_("0x4b")))})),window[n_("0x25")](n_("0x1e"),this[n_("0x23")]),this._refreshPositioning()}[n_("0x9")](t){if(t===this.activeAnnotation)return;const e=this[n_("0x3a")][n_("0x4a")][n_("0x43")](n_("0x7"));e[n_("0x5d")]({blurredAnnotation:this.activeAnnotation,activatedAnnotation:t,disableAnimationOnActivatedAnnotation:!0}),t?e[n_("0x39")](t)?this._showBalloon(t):this[n_("0x2b")]():this._hideBalloon(),this[n_("0x20")]=t}[n_("0x5b")](){if(!this[n_("0x16")])throw new jl.CKEditorError(n_("0x53"),this);this[n_("0x9")](null);const t=this[n_("0x3a")].plugins.get(n_("0x7"));this._hideBalloon(),Array[n_("0x47")](this[n_("0x0")].values(),(t=>t[n_("0x32")]())),this[n_("0x0")][n_("0x55")](),t._detachFromContainer(this.annotations),this[n_("0x5a")](),this[n_("0x1a")][n_("0x5a")](),this[n_("0x5a")](this[n_("0x3a")][n_("0x1")]);for(const t of Array[n_("0x47")](this[n_("0x52")]))this._destroyEditorAnnotationsIntegration(t);window[n_("0x11")](n_("0x1e"),this[n_("0x23")]),this._refreshPositioningDebounced.cancel(),this[n_("0x54")]=[],this[n_("0x16")]=!1,this[n_("0x2c")]=null}[n_("0x32")](){this[n_("0x16")]&&this[n_("0x5b")](),this[n_("0x5")][n_("0x4c")]()}_integrateWithEditorAnnotations(t){const e=t.plugins[n_("0x43")]("EditorAnnotations"),n=this[n_("0x3a")][n_("0x4a")].get(zw),i=this[n_("0x2c")],o=this[n_("0x42")],r=()=>{const t=e.getOrderedSelectedAnnotations({activeAnnotation:this.activeAnnotation,annotations:this.annotations});this[n_("0x2")](t),this[n_("0x9")](t[0]||null)};this[n_("0x49")](e,"refresh",r),this[n_("0x49")](e,n_("0x44"),((t,{isAnnotationTracked:e})=>{this[n_("0x20")]&&e(this.activeAnnotation)&&(this[n_("0x2")]([]),this[n_("0x9")](null))})),this[n_("0x49")](e,"uiUpdate",(()=>{this[n_("0x23")]()})),this.listenTo(i,n_("0x44"),(t=>{e[n_("0x51")]()&&t[n_("0x2d")]()}),{priority:n_("0x3d")}),this._domEmitter[n_("0x49")](document,n_("0xb"),((t,i)=>{const s=i[n_("0x19")];o[n_("0xf")]&&o[n_("0x29")].contains(s)||n.view[n_("0x29")][n_("0x21")](s)||this.activeAnnotation&&e[n_("0x51")]()&&(r(),t[n_("0x1d")]=!0)}),{priority:"high"}),this[n_("0x52")][n_("0x59")](e)}_destroyEditorAnnotationsIntegration(t){t&&(this.stopListening(t),this[n_("0x52")].remove(t))}_setSelectedAnnotations(t){for(const e of this[n_("0x54")])t[n_("0x4d")](e)||this[n_("0x38")][n_("0x1b")](e[n_("0x24")]);this._selectedAnnotations=t}[n_("0x10")](){const t=this[n_("0x42")];this[n_("0x2c")][n_("0x48")](),t[n_("0xf")]&&this._updateBalloonPosition()}[n_("0x57")](t){if(this._manuallyClosedAnnotationViews[n_("0x40")](t[n_("0x24")]))return;const e=this.balloonPanelView[n_("0x58")][n_("0x22")];e!==t.view?(e&&this[n_("0x33")](e),this._attachListeners(t[n_("0x24")]),this.balloonPanelView.content[n_("0x55")](),this.balloonPanelView.content[n_("0x59")](t[n_("0x24")]),this[n_("0x2f")]()):this[n_("0x2f")]()}[n_("0x2f")](){const t=this[n_("0x42")][n_("0x58")].first,e=this[n_("0x2c")][n_("0x45")](t);if(!this[n_("0x0")].has(e))return;const n=this._annotationToNarrowView[n_("0x43")](e)[n_("0x29")],i=function(){const t=Da[n_("0xd")];return[t[n_("0x56")],t.northArrowSouthEast,t[n_("0x4")],t[n_("0x50")],t[n_("0x60")],t[n_("0x3b")]]}();this[n_("0x42")][n_("0x31")]({target:n,positions:i})}[n_("0x2b")](){const t=this[n_("0x42")],e=t[n_("0x58")][n_("0x22")];e&&(this[n_("0x33")](e),t[n_("0x26")](),t[n_("0x58")][n_("0x55")]())}[n_("0x30")](t){this[n_("0x49")](t,"change:height",(()=>this[n_("0x2f")]())),this[n_("0x49")](t,n_("0x37"),((e,n)=>{this[n_("0x38")].add(t),this[n_("0x2b")](),n()}))}[n_("0x33")](t){this.stopListening(t)}}var o_=__webpack_require__(6610),r_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(o_.Z,r_);o_.Z.locals;const s_=["set","afterInit","focusTracker","has","inlineannotations-not-allowed-with-context","focus","inline","setActiveAnnotation","isFocused","_setSelectedAnnotations","visibleView","get","getSelection","mousedown","change:isFocused","switchTo","updatePosition","EditorAnnotations","update","_addedAnnotations","register","Esc","_selectedAnnotations","includes","destroy","init","requires","getRangeAt","every","editableElement","length","annotations","detach","target","InlineAnnotations","listenTo","activeAnnotation","stopListening","delete","attach","addObserver","inlineannotations-attach-already-attached","hasView","change:visibleView","plugins","pluginName","document","_manuallyClosed","view","_addAnnotationToBalloon","_balloon","_forceRefresh","_removeAnnotationFromBalloon","refresh","inlineannotations-detach-not-attached","editor","_closeAnnotation","blur","getByView","isAttached","context","selection","keystrokes","add","getOrderedSelectedAnnotations","editing","isActive","remove"];var a_,c_;a_=s_,c_=138,function(t){for(;--t;)a_.push(a_.shift())}(++c_);const l_=function(t,e){return s_[t-=0]};class d_ extends e{static get[l_("0x18")](){return[Lx,Tl,xw]}static get[l_("0x2b")](){return l_("0x20")}constructor(t){super(t),t.editing[l_("0x2e")][l_("0x26")](rs),this[l_("0x39")]=!1,this[l_("0x42")](l_("0x22"),null),this[l_("0x1d")]=null,this[l_("0x2d")]=new Set,this._balloon=t[l_("0x2a")][l_("0x9")](Tl),this[l_("0x11")]=new Set,this[l_("0x14")]=[],this[l_("0x31")]=!1}[l_("0x17")](){const t=this[l_("0x35")][l_("0x2a")].get(xw);t.context===this.editor&&(t[l_("0x12")]("inline",this),this.editor[l_("0x3c")].set(l_("0x13"),((t,e)=>{const n=this._balloon;if(this[l_("0x39")]&&n[l_("0x8")]){const t=this[l_("0x1d")].getByView(n[l_("0x8")]);this[l_("0x36")](t),e()}})))}[l_("0x43")](){const t=this[l_("0x35")].plugins[l_("0x9")](xw);t[l_("0x3a")]===this[l_("0x35")]&&(t.hasActive()||t[l_("0xd")](l_("0x4")))}[l_("0x5")](t){t!==this[l_("0x22")]&&(this[l_("0x22")]&&(this[l_("0x22")].isActive=!1),t&&this[l_("0x35")].ui[l_("0x0")][l_("0x6")]&&(this[l_("0x2f")](t,!0),t[l_("0x40")]=!0),t||this._setSelectedAnnotations([]),this[l_("0x22")]=t)}[l_("0x25")](t){this[l_("0x1d")]=t;const e=this[l_("0x35")][l_("0x2a")][l_("0x9")](xw),n=this._balloon;if(this[l_("0x39")])throw new jl.CKEditorError(l_("0x27"),this);if(e.context!==this.editor)throw new jl.CKEditorError(l_("0x2"),this);const i=this[l_("0x35")][l_("0x2a")][l_("0x9")](l_("0xf"));this[l_("0x21")](i,l_("0x33"),function(){const t=i[l_("0x3e")]({activeAnnotation:this[l_("0x22")],annotations:this.annotations});var e,n;!this[l_("0x31")]&&(e=t,n=this[l_("0x14")],e.length===n[l_("0x1c")]&&e[l_("0x1a")]((t=>n[l_("0x15")](t))))||(this[l_("0x31")]=!1,this[l_("0x7")](t),this[l_("0x5")](t[0]||null))}.bind(this)),this[l_("0x21")](i,l_("0x37"),((t,{isAnnotationTracked:e})=>{this[l_("0x22")]&&e(this.activeAnnotation)&&(this[l_("0x7")]([]),this[l_("0x5")](null))})),this[l_("0x21")](this[l_("0x35")].ui.focusTracker,l_("0xc"),((t,e,n)=>{n||this[l_("0x5")](null)})),this[l_("0x21")](t,l_("0x41"),((t,e)=>{this[l_("0x32")](e),e===this[l_("0x22")]&&this[l_("0x5")](null)})),this.listenTo(n,l_("0x29"),((e,i,o,r)=>{if(r&&this[l_("0x23")](r),!o||!t[l_("0x38")](o))return;const s=t.getByView(o);this[l_("0x21")](o,"change:height",(()=>{n[l_("0xe")]()})),this.listenTo(o,"Esc",(()=>{this[l_("0x36")](s),this[l_("0x35")][l_("0x3f")].view[l_("0x3")]()})),this.activeAnnotation!==s&&this[l_("0x5")](s)})),this[l_("0x21")](this.editor.ui,l_("0x10"),(()=>{n[l_("0x8")]&&t[l_("0x38")](n[l_("0x8")])&&n[l_("0xe")]()})),this[l_("0x21")](this[l_("0x35")].editing[l_("0x2e")][l_("0x2c")],l_("0xb"),(()=>{this[l_("0x31")]=!0,this[l_("0x2d")].clear()})),this[l_("0x35")][l_("0x3f")][l_("0x2e")][l_("0x2c")][l_("0x3b")][l_("0x1b")]&&this[l_("0x35")][l_("0x3f")][l_("0x2e")][l_("0x3")](),this[l_("0x39")]=!0}detach(){if(!this[l_("0x39")])throw new jl.CKEditorError(l_("0x34"),this);this[l_("0x5")](null);for(const t of this._addedAnnotations)this[l_("0x32")](t);this.stopListening(),this.isAttached=!1,this.annotations=null}[l_("0x16")](){this[l_("0x39")]&&this[l_("0x1e")]()}[l_("0x7")](t){for(const e of this[l_("0x14")])t[l_("0x15")](e)||this[l_("0x2d")][l_("0x24")](e);for(const e of this[l_("0x1d")])t[l_("0x15")](e)||this[l_("0x32")](e);if(this[l_("0x35")].ui[l_("0x0")][l_("0x6")])for(const e of t)this[l_("0x2f")](e);this._selectedAnnotations=t}[l_("0x2f")](t,e){this[l_("0x2d")].has(t)||(this._addedAnnotations[l_("0x1")](t)||this._balloon[l_("0x28")](t[l_("0x2e")])||(this[l_("0x11")][l_("0x3d")](t),this[l_("0x30")][l_("0x3d")]({stackId:t.view.id,view:t.view,position:{target:()=>t[l_("0x1f")]||t.targetRect||document[l_("0xa")]()[l_("0x19")](0)}})),e&&this[l_("0x30")].showStack(t.view.id))}_removeAnnotationFromBalloon(t){this[l_("0x11")].has(t)&&this[l_("0x30")][l_("0x28")](t[l_("0x2e")])&&(this._addedAnnotations[l_("0x24")](t),this[l_("0x30")][l_("0x41")](t.view))}[l_("0x36")](t){this[l_("0x2d")][l_("0x3d")](t),this[l_("0x32")](t)}}var u_,h_,m_=["pluginName","requires","Comments"];u_=m_,h_=474,function(t){for(;--t;)u_.push(u_.shift())}(++h_);var g_=function(t,e){return m_[t-=0]};class p_ extends e{static get[g_("0x1")](){return[Cx,tw,lw,gw,Ww,i_,d_]}static get[g_("0x0")](){return g_("0x2")}}class f_ extends e{static get pluginName(){return"CloudServicesUploadAdapter"}static get requires(){return["CloudServices",sd]}init(){const t=this.editor,e=t.plugins.get("CloudServices"),n=e.token,i=e.uploadUrl;n&&(this._uploadGateway=t.plugins.get("CloudServicesCore").createUploadGateway(n,i),t.plugins.get(sd).createUploadAdapter=t=>new b_(this._uploadGateway,t))}}class b_{constructor(t,e){this.uploadGateway=t,this.loader=e}upload(){return this.loader.file.then((t=>(this.fileUploader=this.uploadGateway.upload(t),this.fileUploader.on("progress",((t,e)=>{this.loader.uploadTotal=e.total,this.loader.uploaded=e.uploaded})),this.fileUploader.send())))}abort(){this.fileUploader.abort()}}class k_ extends e{static get requires(){return[f_,"ImageUpload"]}init(){const t=this.editor;t.plugins.has("ImageBlockEditing")||t.plugins.has("ImageInlineEditing")||(0,jl.logWarning)("easy-image-image-feature-missing",t)}static get pluginName(){return"EasyImage"}}class x_ extends e{static get requires(){return[wb,ih,Eb,ah,Vd,Pb]}static get pluginName(){return"Essentials"}}const w_=["length","then",".ck-content","fetch","cssText","trim","EDITOR_STYLES","push","cssRules","styleSheets","all","The editor stylesheet could not be found in the document. Check your webpack config – style-loader should use data-cke=true attribute for the editor stylesheet.","indexOf","join"];var __,A_;__=w_,A_=307,function(t){for(;--t;)__.push(__.shift())}(++A_);const v_=function(t,e){return w_[t-=0]};function C_(){const t=[],e=[];for(const n of document[v_("0xa")])if(n.ownerNode.hasAttribute("data-cke"))for(const i of n[v_("0x9")])-1!==i.cssText[v_("0xd")](v_("0x3"))?t[v_("0x8")](i.cssText):-1!==i[v_("0x5")][v_("0xd")](":root")&&e[v_("0x8")](i[v_("0x5")]);return t[v_("0x1")]||console.warn(v_("0xc")),[...e,...t].join(" ")[v_("0x6")]()}class y_ extends i{constructor(t){super(t),this.set("isBusy",!1),this.affectsData=!1}refresh(){this.isEnabled=!this.isBusy,this.value=this.isBusy?"pending":void 0}execute(t={}){const e=this.editor,n=e.t,i=t.converterUrl||"https://pdf-converter.cke-cs.com/v1/convert/",o=t.dataCallback||(t=>t.getData()),r=e.plugins.get("ExportPdf"),s=t.token||r._token;return this.isBusy=!0,this.refresh(),function(t){if(!t)return new Promise((t=>t("")));const e=[];for(const n of t)v_("0x7")!==n?e[v_("0x8")](window[v_("0x4")](n)[v_("0x2")]((t=>t.text()))):e.push(C_());return Promise[v_("0xb")](e)[v_("0x2")]((t=>t[v_("0x0")](" ")[v_("0x6")]()))}(t.stylesheets||["EDITOR_STYLES"]).then((async n=>{const r={html:'\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t'+await o(e)+"\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t",css:n,options:t.converterOptions},a={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/pdf",...s?{Authorization:s.value}:null,"x-cs-app-id":t.appID||"cke5"},body:JSON.stringify(r)};return window.fetch(i,a).then((t=>{if(200!==t.status)throw t;return t.blob()})).then((e=>{const n="function"==typeof t.fileName?t.fileName():t.fileName;this.o(e,n||"document.pdf")}))})).catch((t=>{throw e.plugins.get("Notification").showWarning(n("An error occurred while generating the PDF.")),t})).finally((()=>{this.isBusy=!1,this.refresh()}))}o(t,e){const n=document.createElement("a");n.href=window.URL.createObjectURL(t),n.download=e,n.click(),n.remove()}}var E_=__webpack_require__(6491),T_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(E_.Z,T_);E_.Z.locals;class D_ extends e{static get pluginName(){return"ExportPdf"}static get requires(){return["CloudServices",xl]}init(){const t=this.editor,e=t.t,n=t.config.get("exportPdf")||{};t.commands.add("exportPdf",new y_(t)),t.ui.componentFactory.add("exportPdf",(i=>{const o=t.commands.get("exportPdf"),r=new ic(i);r.set({label:e("Export to PDF"),icon:'',tooltip:!0}),r.bind("isOn","isEnabled").to(o,"isBusy","isEnabled"),r.extendTemplate({attributes:{class:[r.bindTemplate.if("isOn","ck-exportpdf_status-pending")]}});const s=new Aa;return s.setTemplate({tag:"span",attributes:{class:["ck","ck-exportpdf__spinner-container"]},children:[{tag:"span",attributes:{class:["ck","ck-exportpdf__spinner"]}}]}),r.children.add(s),this.listenTo(r,"execute",(()=>{t.execute("exportPdf",n),t.editing.view.focus()})),r}));const i=t.plugins.get("CloudServices");if(!1===n.tokenUrl)this._token=null;else{if(n.tokenUrl)return i.registerTokenUrl(n.tokenUrl).then((t=>{this._token=t}));this._token=i.token}}}const S_=["length",".ck-content","name","content","then",":root","cssText","all","ownerNode","createdAt","keys","getSuggestions","plugins","text","join","cssRules","suggestions","hasAttribute","indexOf","comments","Users","styleSheets","trim","The editor stylesheet could not be found in the document. Check your webpack config – style-loader should use data-cke=true attribute for the editor stylesheet.","fetch","map","get","authorId","push","EDITOR_STYLES","users","has"];var I_,B_;I_=S_,B_=361,function(t){for(;--t;)I_.push(I_.shift())}(++B_);const M_=function(t,e){return S_[t-=0]};function N_(){const t=[],e=[];for(const n of document[M_("0xc")])if(n[M_("0x1f")][M_("0x8")]("data-cke"))for(const i of n[M_("0x6")])-1!==i[M_("0x1d")][M_("0x9")](M_("0x18"))?t[M_("0x13")](i[M_("0x1d")]):-1!==i[M_("0x1d")][M_("0x9")](M_("0x1c"))&&e[M_("0x13")](i[M_("0x1d")]);return t[M_("0x17")]||console.warn(M_("0xe")),[...e,...t][M_("0x5")](" ").trim()}function O_(t){const e=t[M_("0x3")][M_("0x16")](M_("0xb")),n=t[M_("0x3")][M_("0x16")]("CommentsRepository"),i=t.plugins[M_("0x16")]("TrackChanges"),o={};if(e&&n){const e=function(t){const e={};if(!t[M_("0x17")])return e;for(const n of t)n[M_("0xa")][M_("0x10")]((t=>{void 0===e[n.id]&&(e[n.id]=[]),e[n.id][M_("0x13")]({author:t.author[M_("0x19")],content:t[M_("0x1a")],created:t.createdAt})}));return e}(t.plugins[M_("0x11")]("CommentsRepository").getCommentThreads({skipNotAttached:!0,skipEmpty:!0}));Object[M_("0x1")](e)[M_("0x17")]&&(o[M_("0xa")]=e)}if(e&&i){const e=t[M_("0x3")].get("TrackChanges"),n=t.plugins[M_("0x11")]("Users"),i=function(t,e){const n={};if(!t[M_("0x17")]||!e.length)return n;for(const i of t)n[i.id]={author:e.get(i[M_("0x12")])[M_("0x19")],created:i[M_("0x0")]};return n}(e[M_("0x2")]({toJSON:!0}),n[M_("0x15")]);Object.keys(i)[M_("0x17")]&&(o[M_("0x7")]=i)}return(o.suggestions||o[M_("0xa")])&&(o.timezone=(new Intl.DateTimeFormat).resolvedOptions().timeZone),o}class R_ extends i{constructor(t){super(t),this.set("isBusy",!1),this.affectsData=!1}refresh(){this.isEnabled=!this.isBusy,this.value=this.isBusy?"pending":void 0}execute(t={}){const e=this.editor,n=e.t,i=t.converterUrl||"https://docx-converter.cke-cs.com/v1/convert",o=t.converterOptions||{},r=e.plugins.get("ExportWord"),s=t.token||r._token,a=!1!==o.auto_pagination,c=t.dataCallback||(t=>t.getData({pagination:a}));return this.isBusy=!0,this.refresh(),function(t){if(!t)return new Promise((t=>t("")));const e=[];for(const n of t)M_("0x14")!==n?e.push(window[M_("0xf")](n)[M_("0x1b")]((t=>t[M_("0x4")]()))):e[M_("0x13")](N_());return Promise[M_("0x1e")](e)[M_("0x1b")]((t=>t.join(" ")[M_("0xd")]()))}(t.stylesheets||["EDITOR_STYLES"]).then((async n=>{const r=await c(e),a={html:''+r+"
",css:n,options:{...o,...O_(e)}},l={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/docx",...s?{Authorization:s.value}:null},body:JSON.stringify(a)};return window.fetch(i,l).then((t=>{if(200!==t.status)throw t;return t.blob()})).then((e=>{const n="function"==typeof t.fileName?t.fileName():t.fileName;this.o(e,n||"document.docx")}))})).catch((t=>{throw e.plugins.get("Notification").showWarning(n("An error occurred while generating the Word file.")),t})).finally((()=>{this.isBusy=!1,this.refresh()}))}o(t,e){const n=document.createElement("a");n.href=window.URL.createObjectURL(t),n.download=e,n.click(),n.remove()}}var P_=__webpack_require__(160),L_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(P_.Z,L_);P_.Z.locals;class z_ extends e{static get pluginName(){return"ExportWord"}static get requires(){return["CloudServices",xl]}init(){const t=this.editor,e=t.t,n=t.config.get("exportWord")||{};t.commands.add("exportWord",new R_(t)),t.ui.componentFactory.add("exportWord",(i=>{const o=t.commands.get("exportWord"),r=new ic(i);r.set({label:e("Export to Word"),icon:'',tooltip:!0}),r.bind("isOn","isEnabled").to(o,"isBusy","isEnabled"),r.extendTemplate({attributes:{class:[r.bindTemplate.if("isOn","ck-exportword_status-pending")]}});const s=new Aa;return s.setTemplate({tag:"span",attributes:{class:["ck","ck-exportword__spinner-container"]},children:[{tag:"span",attributes:{class:["ck","ck-exportword__spinner"]}}]}),r.children.add(s),this.listenTo(r,"execute",(()=>{t.execute("exportWord",n),t.editing.view.focus()})),r}));const i=t.plugins.get("CloudServices");if(!1===n.tokenUrl)this._token=null;else{if(n.tokenUrl)return i.registerTokenUrl(n.tokenUrl).then((t=>{this._token=t}));this._token=i.token}}}class j_ extends i{constructor(t,e){super(t),this.modelElements=e}refresh(){const t=(0,jl.first)(this.editor.model.document.selection.getSelectedBlocks());this.value=!!t&&this.modelElements.includes(t.name)&&t.name,this.isEnabled=!!t&&this.modelElements.some((e=>F_(t,e,this.editor.model.schema)))}execute(t){const e=this.editor.model,n=e.document,i=t.value;e.change((t=>{const o=Array.from(n.selection.getSelectedBlocks()).filter((t=>F_(t,i,e.schema)));for(const e of o)e.is("element",i)||t.rename(e,i)}))}}function F_(t,e,n){return n.checkChild(t.parent,e)&&!n.isObject(t)}const V_="paragraph";class U_ extends e{static get pluginName(){return"HeadingEditing"}constructor(t){super(t),t.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[Fb]}init(){const t=this.editor,e=t.config.get("heading.options"),n=[];for(const i of e)i.model!==V_&&(t.model.schema.register(i.model,{inheritAllFrom:"$block"}),t.conversion.elementToElement(i),n.push(i.model));this._addDefaultH1Conversion(t),t.commands.add("heading",new j_(t,n))}afterInit(){const t=this.editor,e=t.commands.get("enter"),n=t.config.get("heading.options");e&&this.listenTo(e,"afterExecute",((e,i)=>{const o=t.model.document.selection.getFirstPosition().parent;n.some((t=>o.is("element",t.model)))&&!o.is("element",V_)&&0===o.childCount&&i.writer.rename(o,V_)}))}_addDefaultH1Conversion(t){t.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:jl.priorities.get("low")+1})}}var H_=__webpack_require__(3230),q_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(H_.Z,q_);H_.Z.locals;class W_ extends e{static get pluginName(){return"HeadingUI"}init(){const t=this.editor,e=t.t,n=function(t){const e=t.t,n={Paragraph:e("Paragraph"),"Heading 1":e("Heading 1"),"Heading 2":e("Heading 2"),"Heading 3":e("Heading 3"),"Heading 4":e("Heading 4"),"Heading 5":e("Heading 5"),"Heading 6":e("Heading 6")};return t.config.get("heading.options").map((t=>{const e=n[t.title];return e&&e!=t.title&&(t.title=e),t}))}(t),i=e("Choose heading"),o=e("Heading");t.ui.componentFactory.add("heading",(e=>{const r={},s=new jl.Collection,a=t.commands.get("heading"),c=t.commands.get("paragraph"),l=[a];for(const t of n){const e={type:"button",model:new wl({label:t.title,class:t.class,withText:!0})};"paragraph"===t.model?(e.model.bind("isOn").to(c,"value"),e.model.set("commandName","paragraph"),l.push(c)):(e.model.bind("isOn").to(a,"value",(e=>e===t.model)),e.model.set({commandName:"heading",commandValue:t.model})),s.add(e),r[t.model]=t.title}const d=Gc(e);return Kc(d,s),d.buttonView.set({isOn:!1,withText:!0,tooltip:o}),d.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),d.bind("isEnabled").toMany(l,"isEnabled",((...t)=>t.some((t=>t)))),d.buttonView.bind("label").to(a,"value",c,"value",((t,e)=>{const n=t||e&&"paragraph";return r[n]?r[n]:i})),this.listenTo(d,"execute",(e=>{t.execute(e.source.commandName,e.source.commandValue?{value:e.source.commandValue}:void 0),t.editing.view.focus()})),d}))}}class G_ extends e{static get requires(){return[U_,W_]}static get pluginName(){return"Heading"}}new Set(["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"]);function Z_(t){return t.createContainerElement("figure",{class:"image"},[t.createEmptyElement("img"),t.createSlot()])}function K_(t,e){const n=t.plugins.get("ImageUtils"),i=t.plugins.has("ImageInlineEditing")&&t.plugins.has("ImageBlockEditing");return t=>{if(!n.isInlineImageView(t))return null;if(!i)return o(t);return("block"==t.getStyle("display")||t.findAncestor(n.isBlockImageView)?"imageBlock":"imageInline")!==e?null:o(t)};function o(t){const e={name:!0};return t.hasAttribute("src")&&(e.attributes=["src"]),e}}function $_(t,e){const n=(0,jl.first)(e.getSelectedBlocks());return!n||t.isObject(n)||n.isEmpty&&"listItem"!=n.name?"imageBlock":"imageInline"}class Y_ extends e{static get pluginName(){return"ImageUtils"}isImage(t){return this.isInlineImage(t)||this.isBlockImage(t)}isInlineImageView(t){return!!t&&t.is("element","img")}isBlockImageView(t){return!!t&&t.is("element","figure")&&t.hasClass("image")}insertImage(t={},e=null,n=null){const i=this.editor,o=i.model,r=o.document.selection;n=J_(i,e||r,n),t={...Object.fromEntries(r.getAttributes()),...t};for(const e in t)o.schema.checkAttribute(n,e)||delete t[e];return o.change((i=>{const r=i.createElement(n,t);return o.insertObject(r,e,null,{setSelection:"on",findOptimalPosition:!e&&"imageInline"!=n}),r.parent?r:null}))}getClosestSelectedImageWidget(t){const e=t.getFirstPosition();if(!e)return null;const n=t.getSelectedElement();if(n&&this.isImageWidget(n))return n;let i=e.parent;for(;i;){if(i.is("element")&&this.isImageWidget(i))return i;i=i.parent}return null}getClosestSelectedImageElement(t){const e=t.getSelectedElement();return this.isImage(e)?e:t.getFirstPosition().findAncestor("imageBlock")}isImageAllowed(){const t=this.editor.model.document.selection;return function(t,e){const n=J_(t,e);if("imageBlock"==n){const n=function(t,e){const n=Lf(t,e),i=n.start.parent;if(i.isEmpty&&!i.is("element","$root"))return i.parent;return i}(e,t.model);if(t.model.schema.checkChild(n,"imageBlock"))return!0}else if(t.model.schema.checkChild(e.focus,"imageInline"))return!0;return!1}(this.editor,t)&&function(t){return[...t.focus.getAncestors()].every((t=>!t.is("element","imageBlock")))}(t)}toImageWidget(t,e,n){e.setCustomProperty("image",!0,t);return Mf(t,e,{label:()=>{const e=this.findViewImgElement(t).getAttribute("alt");return e?`${e} ${n}`:n}})}isImageWidget(t){return!!t.getCustomProperty("image")&&Bf(t)}isBlockImage(t){return!!t&&t.is("element","imageBlock")}isInlineImage(t){return!!t&&t.is("element","imageInline")}findViewImgElement(t){if(this.isInlineImageView(t))return t;const e=this.editor.editing.view;for(const{item:n}of e.createRangeIn(t))if(this.isInlineImageView(n))return n}}function J_(t,e,n){const i=t.model.schema,o=t.config.get("image.insert.type");return t.plugins.has("ImageBlockEditing")?t.plugins.has("ImageInlineEditing")?n||("inline"===o?"imageInline":"block"===o?"imageBlock":e.is("selection")?$_(i,e):i.checkChild(e,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}const Q_=new RegExp(String(/^(http(s)?:\/\/)?[\w-]+\.[\w.~:/[\]@!$&'()*+,;=%-]+/.source+/\.(jpg|jpeg|png|gif|ico|webp|JPG|JPEG|PNG|GIF|ICO|WEBP)/.source+/(\?[\w.~:/[\]@!$&'()*+,;=%-]*)?/.source+/(#[\w.~:/[\]@!$&'()*+,;=%-]*)?$/.source));class X_ extends e{static get requires(){return[wb,Y_,Pb,Fd]}static get pluginName(){return"AutoImage"}constructor(t){super(t),this._timeoutId=null,this._positionToInsert=null}init(){const t=this.editor,e=t.model.document;this.listenTo(t.plugins.get("ClipboardPipeline"),"inputTransformation",(()=>{const t=e.selection.getFirstRange(),n=fr.fromPosition(t.start);n.stickiness="toPrevious";const i=fr.fromPosition(t.end);i.stickiness="toNext",e.once("change:data",(()=>{this._embedImageBetweenPositions(n,i),n.detach(),i.detach()}),{priority:"high"})})),t.commands.get("undo").on("execute",(()=>{this._timeoutId&&(jl.global.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)}),{priority:"high"})}_embedImageBetweenPositions(t,e){const n=this.editor,i=new Oi(t,e),o=i.getWalker({ignoreElementEnd:!0}),r=Object.fromEntries(n.model.document.selection.getAttributes()),s=this.editor.plugins.get("ImageUtils");let a="";for(const t of o)t.item.is("$textProxy")&&(a+=t.item.data);a=a.trim(),a.match(Q_)?(this._positionToInsert=fr.fromPosition(t),this._timeoutId=jl.global.window.setTimeout((()=>{n.commands.get("insertImage").isEnabled?(n.model.change((t=>{let e;this._timeoutId=null,t.remove(i),i.detach(),"$graveyard"!==this._positionToInsert.root.rootName&&(e=this._positionToInsert.toPosition()),s.insertImage({...r,src:a},e),this._positionToInsert.detach(),this._positionToInsert=null})),n.plugins.get("Delete").requestUndoOnBackspace()):i.detach()}),100)):i.detach()}}class tA extends i{refresh(){const t=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!t,this.isEnabled&&t.hasAttribute("alt")?this.value=t.getAttribute("alt"):this.value=!1}execute(t){const e=this.editor,n=e.plugins.get("ImageUtils"),i=e.model,o=n.getClosestSelectedImageElement(i.document.selection);i.change((e=>{e.setAttribute("alt",t.newValue,o)}))}}class eA extends e{static get requires(){return[Y_]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new tA(this.editor))}}var nA=__webpack_require__(6831),iA={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(nA.Z,iA);nA.Z.locals;var oA=__webpack_require__(1590),rA={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(oA.Z,rA);oA.Z.locals;class sA extends Aa{constructor(t){super(t);const e=this.locale.t;this.focusTracker=new jl.FocusTracker,this.keystrokes=new jl.KeystrokeHandler,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(e("Save"),Ga.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(e("Cancel"),Ga.cancel,"ck-button-cancel","cancel"),this._focusables=new Js,this._focusCycler=new Cc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]}),Ka(this)}render(){super.render(),this.keystrokes.listenTo(this.element),$a({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach((t=>{this._focusables.add(t),this.focusTracker.add(t.element)}))}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createButton(t,e,n,i){const o=new ic(this.locale);return o.set({label:t,icon:e,tooltip:!0}),o.extendTemplate({attributes:{class:n}}),i&&o.delegate("execute").to(this,i),o}_createLabeledInputView(){const t=this.locale.t,e=new pl(this.locale,fl);return e.label=t("Text alternative"),e}}function aA(t){const e=t.editing.view,n=Da.defaultPositions,i=t.plugins.get("ImageUtils");return{target:e.domConverter.mapViewToDom(i.getClosestSelectedImageWidget(e.document.selection)),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,n.viewportStickyNorth]}}class cA extends e{static get requires(){return[Tl]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton(),this._createForm()}destroy(){super.destroy(),this._form.destroy()}_createButton(){const t=this.editor,e=t.t;t.ui.componentFactory.add("imageTextAlternative",(n=>{const i=t.commands.get("imageTextAlternative"),o=new ic(n);return o.set({label:e("Change image text alternative"),icon:Ga.lowVision,tooltip:!0}),o.bind("isEnabled").to(i,"isEnabled"),o.bind("isOn").to(i,"value",(t=>!!t)),this.listenTo(o,"execute",(()=>{this._showForm()})),o}))}_createForm(){const t=this.editor,e=t.editing.view.document,n=t.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new sA(t.locale),this._form.render(),this.listenTo(this._form,"submit",(()=>{t.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)})),this.listenTo(this._form,"cancel",(()=>{this._hideForm(!0)})),this._form.keystrokes.set("Esc",((t,e)=>{this._hideForm(!0),e()})),this.listenTo(t.ui,"update",(()=>{n.getClosestSelectedImageWidget(e.selection)?this._isVisible&&function(t){const e=t.plugins.get("ContextualBalloon");if(t.plugins.get("ImageUtils").getClosestSelectedImageWidget(t.editing.view.document.selection)){const n=aA(t);e.updatePosition(n)}}(t):this._hideForm(!0)})),Za({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const t=this.editor,e=t.commands.get("imageTextAlternative"),n=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:aA(t)}),n.fieldView.value=n.fieldView.element.value=e.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(t){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),t&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class lA extends e{static get requires(){return[eA,cA]}static get pluginName(){return"ImageTextAlternative"}}function dA(t,e){return t=>{t.on(`attribute:srcset:${e}`,n)};function n(e,n,i){if(!i.consumable.consume(n.item,e.name))return;const o=i.writer,r=i.mapper.toViewElement(n.item),s=t.findViewImgElement(r);if(null===n.attributeNewValue){const t=n.attributeOldValue;t.data&&(o.removeAttribute("srcset",s),o.removeAttribute("sizes",s),t.width&&o.removeAttribute("width",s))}else{const t=n.attributeNewValue;t.data&&(o.setAttribute("srcset",t.data,s),o.setAttribute("sizes","100vw",s),t.width&&o.setAttribute("width",t.width,s))}}}function uA(t,e,n){return t=>{t.on(`attribute:${n}:${e}`,i)};function i(e,n,i){if(!i.consumable.consume(n.item,e.name))return;const o=i.writer,r=i.mapper.toViewElement(n.item),s=t.findViewImgElement(r);o.setAttribute(n.attributeKey,n.attributeNewValue||"",s)}}class hA extends cn{observe(t){this.listenTo(t,"load",((t,e)=>{const n=e.target;this.checkShouldIgnoreEventFromTarget(n)||"IMG"==n.tagName&&this._fireEvents(e)}),{useCapture:!0})}_fireEvents(t){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",t))}}class mA extends i{constructor(t){super(t);const e=t.config.get("image.insert.type");t.plugins.has("ImageBlockEditing")||"block"===e&&(0,jl.logWarning)("image-block-plugin-required"),t.plugins.has("ImageInlineEditing")||"inline"===e&&(0,jl.logWarning)("image-inline-plugin-required")}refresh(){this.isEnabled=this.editor.plugins.get("ImageUtils").isImageAllowed()}execute(t){const e=(0,jl.toArray)(t.source),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),o=Object.fromEntries(n.getAttributes());e.forEach(((t,e)=>{const r=n.getSelectedElement();if("string"==typeof t&&(t={src:t}),e&&r&&i.isImage(r)){const e=this.editor.model.createPositionAfter(r);i.insertImage({...t,...o},e)}else i.insertImage({...t,...o})}))}}class gA extends e{static get requires(){return[Y_]}static get pluginName(){return"ImageEditing"}init(){const t=this.editor,e=t.conversion;t.editing.view.addObserver(hA),e.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:t=>{const e={data:t.getAttribute("srcset")};return t.hasAttribute("width")&&(e.width=t.getAttribute("width")),e}}});const n=new mA(t);t.commands.add("insertImage",n),t.commands.add("imageInsert",n)}}class pA extends i{constructor(t,e){super(t),this._modelElementName=e}refresh(){const t=this.editor.plugins.get("ImageUtils"),e=t.getClosestSelectedImageElement(this.editor.model.document.selection);"imageBlock"===this._modelElementName?this.isEnabled=t.isInlineImage(e):this.isEnabled=t.isBlockImage(e)}execute(){const t=this.editor,e=this.editor.model,n=t.plugins.get("ImageUtils"),i=n.getClosestSelectedImageElement(e.document.selection),o=Object.fromEntries(i.getAttributes());return o.src||o.uploadId?e.change((t=>{const r=Array.from(e.markers).filter((t=>t.getRange().containsItem(i))),s=n.insertImage(o,e.createSelection(i,"on"),this._modelElementName);if(!s)return null;const a=t.createRangeOn(s);for(const e of r){const n=e.getRange(),i="$graveyard"!=n.root.rootName?n.getJoined(a,!0):a;t.updateMarker(e,{range:i})}return{oldElement:i,newElement:s}})):null}}class fA extends e{static get requires(){return[gA,Y_,Cf]}static get pluginName(){return"ImageBlockEditing"}init(){const t=this.editor;t.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),t.plugins.has("ImageInlineEditing")&&(t.commands.add("imageTypeBlock",new pA(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const t=this.editor,e=t.t,n=t.conversion,i=t.plugins.get("ImageUtils");n.for("dataDowncast").elementToStructure({model:"imageBlock",view:(t,{writer:e})=>Z_(e)}),n.for("editingDowncast").elementToStructure({model:"imageBlock",view:(t,{writer:n})=>i.toImageWidget(Z_(n),n,e("image widget"))}),n.for("downcast").add(uA(i,"imageBlock","src")).add(uA(i,"imageBlock","alt")).add(dA(i,"imageBlock")),n.for("upcast").elementToElement({view:K_(t,"imageBlock"),model:(t,{writer:e})=>e.createElement("imageBlock",t.hasAttribute("src")?{src:t.getAttribute("src")}:null)}).add(function(t){return t=>{t.on("element:figure",e)};function e(e,n,i){if(!i.consumable.test(n.viewItem,{name:!0,classes:"image"}))return;const o=t.findViewImgElement(n.viewItem);if(!o||!i.consumable.test(o,{name:!0}))return;i.consumable.consume(n.viewItem,{name:!0,classes:"image"});const r=i.convertItem(o,n.modelCursor),s=(0,jl.first)(r.modelRange.getItems());s?(i.convertChildren(n.viewItem,s),i.updateConversionResult(s,n)):i.consumable.revert(n.viewItem,{name:!0,classes:"image"})}}(i))}_setupClipboardIntegration(){const t=this.editor,e=t.model,n=t.editing.view,i=t.plugins.get("ImageUtils");this.listenTo(t.plugins.get("ClipboardPipeline"),"inputTransformation",((o,r)=>{const s=Array.from(r.content.getChildren());let a;if(!s.every(i.isInlineImageView))return;a=r.targetRanges?t.editing.mapper.toModelRange(r.targetRanges[0]):e.document.selection.getFirstRange();const c=e.createSelection(a);if("imageBlock"===$_(e.schema,c)){const t=new ss(n.document),e=s.map((e=>t.createElement("figure",{class:"image"},e)));r.content=t.createDocumentFragment(e)}}))}}var bA=__webpack_require__(9048),kA={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(bA.Z,kA);bA.Z.locals;class xA extends e{static get requires(){return[fA,Xf,lA]}static get pluginName(){return"ImageBlock"}}class wA extends e{static get requires(){return[gA,Y_,Cf]}static get pluginName(){return"ImageInlineEditing"}init(){const t=this.editor,e=t.model.schema;e.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"]}),e.addChildCheck(((t,e)=>{if(t.endsWith("caption")&&"imageInline"===e.name)return!1})),this._setupConversion(),t.plugins.has("ImageBlockEditing")&&(t.commands.add("imageTypeInline",new pA(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const t=this.editor,e=t.t,n=t.conversion,i=t.plugins.get("ImageUtils");n.for("dataDowncast").elementToElement({model:"imageInline",view:(t,{writer:e})=>e.createEmptyElement("img")}),n.for("editingDowncast").elementToStructure({model:"imageInline",view:(t,{writer:n})=>i.toImageWidget(function(t){return t.createContainerElement("span",{class:"image-inline"},t.createEmptyElement("img"))}(n),n,e("image widget"))}),n.for("downcast").add(uA(i,"imageInline","src")).add(uA(i,"imageInline","alt")).add(dA(i,"imageInline")),n.for("upcast").elementToElement({view:K_(t,"imageInline"),model:(t,{writer:e})=>e.createElement("imageInline",t.hasAttribute("src")?{src:t.getAttribute("src")}:null)})}_setupClipboardIntegration(){const t=this.editor,e=t.model,n=t.editing.view,i=t.plugins.get("ImageUtils");this.listenTo(t.plugins.get("ClipboardPipeline"),"inputTransformation",((o,r)=>{const s=Array.from(r.content.getChildren());let a;if(!s.every(i.isBlockImageView))return;a=r.targetRanges?t.editing.mapper.toModelRange(r.targetRanges[0]):e.document.selection.getFirstRange();const c=e.createSelection(a);if("imageInline"===$_(e.schema,c)){const t=new ss(n.document),e=s.map((e=>1===e.childCount?(Array.from(e.getAttributes()).forEach((n=>t.setAttribute(...n,i.findViewImgElement(e)))),e.getChild(0)):e));r.content=t.createDocumentFragment(e)}}))}}class _A extends e{static get requires(){return[wA,Xf,lA]}static get pluginName(){return"ImageInline"}}class AA extends e{static get requires(){return[xA,_A]}static get pluginName(){return"Image"}}class vA extends e{static get pluginName(){return"ImageCaptionUtils"}static get requires(){return[Y_]}getCaptionFromImageModelElement(t){for(const e of t.getChildren())if(e&&e.is("element","caption"))return e;return null}getCaptionFromModelSelection(t){const e=this.editor.plugins.get("ImageUtils"),n=t.getFirstPosition().findAncestor("caption");return n&&e.isBlockImage(n.parent)?n:null}matchImageCaptionViewElement(t){const e=this.editor.plugins.get("ImageUtils");return"figcaption"==t.name&&e.isBlockImageView(t.parent)?{name:!0}:null}}class CA extends i{refresh(){const t=this.editor,e=t.plugins.get("ImageCaptionUtils");if(!t.plugins.has(fA))return this.isEnabled=!1,void(this.value=!1);const n=t.model.document.selection,i=n.getSelectedElement();if(!i){const t=e.getCaptionFromModelSelection(n);return this.isEnabled=!!t,void(this.value=!!t)}this.isEnabled=this.editor.plugins.get("ImageUtils").isImage(i),this.isEnabled?this.value=!!e.getCaptionFromImageModelElement(i):this.value=!1}execute(t={}){const{focusCaptionOnShow:e}=t;this.editor.model.change((t=>{this.value?this._hideImageCaption(t):this._showImageCaption(t,e)}))}_showImageCaption(t,e){const n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageCaptionEditing");let o=n.getSelectedElement();const r=i._getSavedCaption(o);this.editor.plugins.get("ImageUtils").isInlineImage(o)&&(this.editor.execute("imageTypeBlock"),o=n.getSelectedElement());const s=r||t.createElement("caption");t.append(s,o),e&&t.setSelection(s,"in")}_hideImageCaption(t){const e=this.editor,n=e.model.document.selection,i=e.plugins.get("ImageCaptionEditing"),o=e.plugins.get("ImageCaptionUtils");let r,s=n.getSelectedElement();s?r=o.getCaptionFromImageModelElement(s):(r=o.getCaptionFromModelSelection(n),s=r.parent),i._saveCaption(s,r),t.setSelection(s,"on"),t.remove(r)}}class yA extends e{static get requires(){return[Y_,vA]}static get pluginName(){return"ImageCaptionEditing"}constructor(t){super(t),this._savedCaptionsMap=new WeakMap}init(){const t=this.editor,e=t.model.schema;e.isRegistered("caption")?e.extend("caption",{allowIn:"imageBlock"}):e.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),t.commands.add("toggleImageCaption",new CA(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration(),this._registerCaptionReconversion()}_setupConversion(){const t=this.editor,e=t.editing.view,n=t.plugins.get("ImageUtils"),i=t.plugins.get("ImageCaptionUtils"),o=t.t;t.conversion.for("upcast").elementToElement({view:t=>i.matchImageCaptionViewElement(t),model:"caption"}),t.conversion.for("dataDowncast").elementToElement({model:"caption",view:(t,{writer:e})=>n.isBlockImage(t.parent)?e.createContainerElement("figcaption"):null}),t.conversion.for("editingDowncast").elementToElement({model:"caption",view:(t,{writer:i})=>{if(!n.isBlockImage(t.parent))return null;const r=i.createEditableElement("figcaption");i.setCustomProperty("imageCaption",!0,r),g({view:e,element:r,text:o("Enter image caption"),keepOnFocus:!0});const s=t.parent.getAttribute("alt");return Pf(r,i,{label:s?o("Caption for image: %0",[s]):o("Caption for the image")})}})}_setupImageTypeCommandsIntegration(){const t=this.editor,e=t.plugins.get("ImageUtils"),n=t.plugins.get("ImageCaptionUtils"),i=t.commands.get("imageTypeInline"),o=t.commands.get("imageTypeBlock"),r=t=>{if(!t.return)return;const{oldElement:i,newElement:o}=t.return;if(!i)return;if(e.isBlockImage(i)){const t=n.getCaptionFromImageModelElement(i);if(t)return void this._saveCaption(o,t)}const r=this._getSavedCaption(i);r&&this._saveCaption(o,r)};i&&this.listenTo(i,"execute",r,{priority:"low"}),o&&this.listenTo(o,"execute",r,{priority:"low"})}_getSavedCaption(t){const e=this._savedCaptionsMap.get(t);return e?mi.fromJSON(e):null}_saveCaption(t,e){this._savedCaptionsMap.set(t,e.toJSON())}_registerCaptionReconversion(){const t=this.editor,e=t.model,n=t.plugins.get("ImageUtils"),i=t.plugins.get("ImageCaptionUtils");e.document.on("change:data",(()=>{const o=e.document.differ.getChanges();for(const e of o){if("alt"!==e.attributeKey)continue;const o=e.range.start.nodeAfter;if(n.isBlockImage(o)){const e=i.getCaptionFromImageModelElement(o);if(!e)return;t.editing.reconvertItem(e)}}}))}}class EA extends e{static get requires(){return[vA]}static get pluginName(){return"ImageCaptionUI"}init(){const t=this.editor,e=t.editing.view,n=t.plugins.get("ImageCaptionUtils"),i=t.t;t.ui.componentFactory.add("toggleImageCaption",(o=>{const r=t.commands.get("toggleImageCaption"),s=new ic(o);return s.set({icon:Ga.caption,tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.bind("label").to(r,"value",(t=>i(t?"Toggle caption off":"Toggle caption on"))),this.listenTo(s,"execute",(()=>{t.execute("toggleImageCaption",{focusCaptionOnShow:!0});const i=n.getCaptionFromModelSelection(t.model.document.selection);if(i){const n=t.editing.mapper.toViewElement(i);e.scrollToTheSelection(),e.change((t=>{t.addClass("image__caption_highlighted",n)}))}t.editing.view.focus()})),s}))}}var TA=__webpack_require__(8662),DA={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(TA.Z,DA);TA.Z.locals;class SA extends e{static get requires(){return[yA,EA]}static get pluginName(){return"ImageCaption"}}function IA(t){const e=t.map((t=>t.replace("+","\\+")));return new RegExp(`^image\\/(${e.join("|")})$`)}function BA(t){return new Promise(((e,n)=>{const i=t.getAttribute("src");fetch(i).then((t=>t.blob())).then((t=>{const n=MA(t,i),o=n.replace("image/",""),r=new File([t],`image.${o}`,{type:n});e(r)})).catch((t=>t&&"TypeError"===t.name?function(t){return function(t){return new Promise(((e,n)=>{const i=jl.global.document.createElement("img");i.addEventListener("load",(()=>{const t=jl.global.document.createElement("canvas");t.width=i.width,t.height=i.height;t.getContext("2d").drawImage(i,0,0),t.toBlob((t=>t?e(t):n()))})),i.addEventListener("error",(()=>n())),i.src=t}))}(t).then((e=>{const n=MA(e,t),i=n.replace("image/","");return new File([e],`image.${i}`,{type:n})}))}(i).then(e).catch(n):n(t)))}))}function MA(t,e){return t.type?t.type:e.match(/data:(image\/\w+);base64/)?e.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class NA extends e{static get pluginName(){return"ImageUploadUI"}init(){const t=this.editor,e=t.t,n=n=>{const i=new cd(n),o=t.commands.get("uploadImage"),r=t.config.get("image.upload.types"),s=IA(r);return i.set({acceptedType:r.map((t=>`image/${t}`)).join(","),allowMultipleFiles:!0}),i.buttonView.set({label:e("Insert image"),icon:Ga.image,tooltip:!0}),i.buttonView.bind("isEnabled").to(o),i.on("done",((e,n)=>{const i=Array.from(n).filter((t=>s.test(t.type)));i.length&&(t.execute("uploadImage",{file:i}),t.editing.view.focus())})),i};t.ui.componentFactory.add("uploadImage",n),t.ui.componentFactory.add("imageUpload",n)}}var OA=__webpack_require__(5870),RA={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(OA.Z,RA);OA.Z.locals;var PA=__webpack_require__(9899),LA={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(PA.Z,LA);PA.Z.locals;var zA=__webpack_require__(9825),jA={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(zA.Z,jA);zA.Z.locals;class FA extends e{static get pluginName(){return"ImageUploadProgress"}constructor(t){super(t),this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}init(){const t=this.editor;t.plugins.has("ImageBlockEditing")&&t.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",((...t)=>this.uploadStatusChange(...t))),t.plugins.has("ImageInlineEditing")&&t.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",((...t)=>this.uploadStatusChange(...t)))}uploadStatusChange(t,e,n){const i=this.editor,o=e.item,r=o.getAttribute("uploadId");if(!n.consumable.consume(e.item,t.name))return;const s=i.plugins.get("ImageUtils"),a=i.plugins.get(sd),c=r?e.attributeNewValue:null,l=this.placeholder,d=i.editing.mapper.toViewElement(o),u=n.writer;if("reading"==c)return VA(d,u),void UA(s,l,d,u);if("uploading"==c){const t=a.loaders.get(r);return VA(d,u),void(t?(HA(d,u),function(t,e,n,i){const o=function(t){const e=t.createUIElement("div",{class:"ck-progress-bar"});return t.setCustomProperty("progressBar",!0,e),e}(e);e.insert(e.createPositionAt(t,"end"),o),n.on("change:uploadedPercent",((t,e,n)=>{i.change((t=>{t.setStyle("width",n+"%",o)}))}))}(d,u,t,i.editing.view),function(t,e,n,i){if(i.data){const o=t.findViewImgElement(e);n.setAttribute("src",i.data,o)}}(s,d,u,t)):UA(s,l,d,u))}"complete"==c&&a.loaders.get(r)&&function(t,e,n){const i=e.createUIElement("div",{class:"ck-image-upload-complete-icon"});e.insert(e.createPositionAt(t,"end"),i),setTimeout((()=>{n.change((t=>t.remove(t.createRangeOn(i))))}),3e3)}(d,u,i.editing.view),function(t,e){WA(t,e,"progressBar")}(d,u),HA(d,u),function(t,e){e.removeClass("ck-appear",t)}(d,u)}}function VA(t,e){t.hasClass("ck-appear")||e.addClass("ck-appear",t)}function UA(t,e,n,i){n.hasClass("ck-image-upload-placeholder")||i.addClass("ck-image-upload-placeholder",n);const o=t.findViewImgElement(n);o.getAttribute("src")!==e&&i.setAttribute("src",e,o),qA(n,"placeholder")||i.insert(i.createPositionAfter(o),function(t){const e=t.createUIElement("div",{class:"ck-upload-placeholder-loader"});return t.setCustomProperty("placeholder",!0,e),e}(i))}function HA(t,e){t.hasClass("ck-image-upload-placeholder")&&e.removeClass("ck-image-upload-placeholder",t),WA(t,e,"placeholder")}function qA(t,e){for(const n of t.getChildren())if(n.getCustomProperty(e))return n}function WA(t,e,n){const i=qA(t,n);i&&e.remove(e.createRangeOn(i))}class GA extends i{refresh(){const t=this.editor,e=t.plugins.get("ImageUtils"),n=t.model.document.selection.getSelectedElement();this.isEnabled=e.isImageAllowed()||e.isImage(n)}execute(t){const e=(0,jl.toArray)(t.file),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),o=Object.fromEntries(n.getAttributes());e.forEach(((t,e)=>{const r=n.getSelectedElement();if(e&&r&&i.isImage(r)){const e=this.editor.model.createPositionAfter(r);this._uploadImage(t,o,e)}else this._uploadImage(t,o)}))}_uploadImage(t,e,n){const i=this.editor,o=i.plugins.get(sd).createLoader(t),r=i.plugins.get("ImageUtils");o&&r.insertImage({...e,uploadId:o.id},n)}}class ZA extends e{static get requires(){return[sd,xl,Cf,Y_]}static get pluginName(){return"ImageUploadEditing"}constructor(t){super(t),t.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}init(){const t=this.editor,e=t.model.document,n=t.conversion,i=t.plugins.get(sd),o=t.plugins.get("ImageUtils"),r=IA(t.config.get("image.upload.types")),s=new GA(t);t.commands.add("uploadImage",s),t.commands.add("imageUpload",s),n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(t.editing.view.document,"clipboardInput",((e,n)=>{if(i=n.dataTransfer,Array.from(i.types).includes("text/html")&&""!==i.getData("text/html"))return;var i;const o=Array.from(n.dataTransfer.files).filter((t=>!!t&&r.test(t.type)));o.length&&(e.stop(),t.model.change((e=>{n.targetRanges&&e.setSelection(n.targetRanges.map((e=>t.editing.mapper.toModelRange(e)))),t.model.enqueueChange((()=>{t.execute("uploadImage",{file:o})}))})))})),this.listenTo(t.plugins.get("ClipboardPipeline"),"inputTransformation",((e,n)=>{const r=Array.from(t.editing.view.createRangeIn(n.content)).filter((t=>function(t,e){return!(!t.isInlineImageView(e)||!e.getAttribute("src"))&&(e.getAttribute("src").match(/^data:image\/\w+;base64,/g)||e.getAttribute("src").match(/^blob:/g))}(o,t.item)&&!t.item.getAttribute("uploadProcessed"))).map((t=>({promise:BA(t.item),imageElement:t.item})));if(!r.length)return;const s=new ss(t.editing.view.document);for(const t of r){s.setAttribute("uploadProcessed",!0,t.imageElement);const e=i.createLoader(t.promise);e&&(s.setAttribute("src","",t.imageElement),s.setAttribute("uploadId",e.id,t.imageElement))}})),t.editing.view.document.on("dragover",((t,e)=>{e.preventDefault()})),e.on("change",(()=>{const n=e.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),o=new Set;for(const e of n)if("insert"==e.type&&"$text"!=e.name){const n=e.position.nodeAfter,r="$graveyard"==e.position.root.rootName;for(const e of KA(t,n)){const t=e.getAttribute("uploadId");if(!t)continue;const n=i.loaders.get(t);n&&(r?o.has(t)||n.abort():(o.add(t),this._uploadImageElements.set(t,e),"idle"==n.status&&this._readAndUpload(n)))}}})),this.on("uploadComplete",((t,{imageElement:e,data:n})=>{const i=n.urls?n.urls:n;this.editor.model.change((t=>{t.setAttribute("src",i.default,e),this._parseAndSetSrcsetAttributeOnImage(i,e,t)}))}),{priority:"low"})}afterInit(){const t=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&t.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this.editor.plugins.has("ImageInlineEditing")&&t.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]})}_readAndUpload(t){const e=this.editor,n=e.model,i=e.locale.t,o=e.plugins.get(sd),r=e.plugins.get(xl),s=e.plugins.get("ImageUtils"),a=this._uploadImageElements;return n.enqueueChange({isUndoable:!1},(e=>{e.setAttribute("uploadStatus","reading",a.get(t.id))})),t.read().then((()=>{const i=t.upload(),o=a.get(t.id);if(jl.env.isSafari){const t=e.editing.mapper.toViewElement(o),n=s.findViewImgElement(t);e.editing.view.once("render",(()=>{if(!n.parent)return;const t=e.editing.view.domConverter.mapViewToDom(n.parent);if(!t)return;const i=t.style.display;t.style.display="none",t._ckHack=t.offsetHeight,t.style.display=i}))}return n.enqueueChange({isUndoable:!1},(t=>{t.setAttribute("uploadStatus","uploading",o)})),i})).then((e=>{n.enqueueChange({isUndoable:!1},(n=>{const i=a.get(t.id);n.setAttribute("uploadStatus","complete",i),this.fire("uploadComplete",{data:e,imageElement:i})})),c()})).catch((e=>{if("error"!==t.status&&"aborted"!==t.status)throw e;"error"==t.status&&e&&r.showWarning(e,{title:i("Upload failed"),namespace:"upload"}),n.enqueueChange({isUndoable:!1},(e=>{e.remove(a.get(t.id))})),c()}));function c(){n.enqueueChange({isUndoable:!1},(e=>{const n=a.get(t.id);e.removeAttribute("uploadId",n),e.removeAttribute("uploadStatus",n),a.delete(t.id)})),o.destroyLoader(t)}}_parseAndSetSrcsetAttributeOnImage(t,e,n){let i=0;const o=Object.keys(t).filter((t=>{const e=parseInt(t,10);if(!isNaN(e))return i=Math.max(i,e),!0})).map((e=>`${t[e]} ${e}w`)).join(", ");""!=o&&n.setAttribute("srcset",{data:o,width:i},e)}}function KA(t,e){const n=t.plugins.get("ImageUtils");return Array.from(t.model.createRangeOn(e)).filter((t=>n.isImage(t.item))).map((t=>t.item))}class $A extends e{static get pluginName(){return"ImageUpload"}static get requires(){return[ZA,NA,FA]}}var YA=__webpack_require__(5150),JA={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(YA.Z,JA);YA.Z.locals;class QA extends Aa{constructor(t,e={}){super(t);const n=this.bindTemplate;this.set("class",e.class||null),this.children=this.createCollection(),e.children&&e.children.forEach((t=>this.children.add(t))),this.set("_role",null),this.set("_ariaLabelledBy",null),e.labelView&&this.set({_role:"group",_ariaLabelledBy:e.labelView.id}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__row",n.to("class")],role:n.to("_role"),"aria-labelledby":n.to("_ariaLabelledBy")},children:this.children})}}var XA=__webpack_require__(9292),tv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(XA.Z,tv);XA.Z.locals;class ev extends Aa{constructor(t,e){super(t);const{insertButtonView:n,cancelButtonView:i}=this._createActionButtons(t);if(this.insertButtonView=n,this.cancelButtonView=i,this.set("imageURLInputValue",""),this.focusTracker=new jl.FocusTracker,this.keystrokes=new jl.KeystrokeHandler,this._focusables=new Js,this._focusCycler=new Cc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.set("_integrations",new jl.Collection),e)for(const[t,n]of Object.entries(e))"insertImageViaUrl"===t&&(n.fieldView.bind("value").to(this,"imageURLInputValue",(t=>t||"")),n.fieldView.on("input",(()=>{this.imageURLInputValue=n.fieldView.element.value.trim()}))),n.name=t,this._integrations.add(n);this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:"-1"},children:[...this._integrations,new QA(t,{children:[this.insertButtonView,this.cancelButtonView],class:"ck-image-insert-form__action-row"})]})}render(){super.render(),$a({view:this});const t=[...this._integrations,this.insertButtonView,this.cancelButtonView];t.forEach((t=>{this._focusables.add(t),this.focusTracker.add(t.element)})),this.keystrokes.listenTo(this.element);const e=t=>t.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e),this.listenTo(t[0].element,"selectstart",((t,e)=>{e.stopPropagation()}),{priority:"high"})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}getIntegration(t){return this._integrations.find((e=>e.name===t))}_createActionButtons(t){const e=t.t,n=new ic(t),i=new ic(t);return n.set({label:e("Insert"),icon:Ga.check,class:"ck-button-save",type:"submit",withText:!0,isEnabled:this.imageURLInputValue}),i.set({label:e("Cancel"),icon:Ga.cancel,class:"ck-button-cancel",withText:!0}),n.bind("isEnabled").to(this,"imageURLInputValue",(t=>!!t)),n.delegate("execute").to(this,"submit"),i.delegate("execute").to(this,"cancel"),{insertButtonView:n,cancelButtonView:i}}focus(){this._focusCycler.focusFirst()}}function nv(t){const e=t.t,n=new pl(t,fl);return n.set({label:e("Insert image via URL")}),n.fieldView.placeholder="https://example.com/image.png",n}class iv extends e{static get pluginName(){return"ImageInsertUI"}init(){const t=this.editor,e=t=>this._createDropdownView(t);t.ui.componentFactory.add("insertImage",e),t.ui.componentFactory.add("imageInsert",e)}_createDropdownView(t){const e=this.editor,n=t.t,i=e.commands.get("uploadImage"),o=e.commands.get("insertImage");this.dropdownView=Gc(t,i?xc:void 0);const r=this.dropdownView.buttonView,s=this.dropdownView.panelView;if(r.set({label:n("Insert image"),icon:Ga.image,tooltip:!0}),s.extendTemplate({attributes:{class:"ck-image-insert__panel"}}),i){const t=this.dropdownView.buttonView;t.actionView=e.ui.componentFactory.create("uploadImage"),t.actionView.extendTemplate({attributes:{class:"ck ck-button ck-splitbutton__action"}})}return this._setUpDropdown(i||o)}_setUpDropdown(t){const e=this.editor,n=e.t,i=new ev(e.locale,function(t){const e=t.config.get("image.insert.integrations"),n=t.plugins.get("ImageInsertUI"),i={insertImageViaUrl:nv(t.locale)};if(!e)return i;if(e.find((t=>"openCKFinder"===t))&&t.ui.componentFactory.has("ckfinder")){const e=t.ui.componentFactory.create("ckfinder");e.set({withText:!0,class:"ck-image-insert__ck-finder-button"}),e.delegate("execute").to(n,"cancel"),i.openCKFinder=e}return e.reduce(((e,n)=>(i[n]?e[n]=i[n]:t.ui.componentFactory.has(n)&&(e[n]=t.ui.componentFactory.create(n)),e)),{})}(e)),o=i.insertButtonView,r=i.getIntegration("insertImageViaUrl"),s=this.dropdownView,a=s.panelView,c=this.editor.plugins.get("ImageUtils");function l(){e.editing.view.focus(),s.isOpen=!1}return s.bind("isEnabled").to(t),s.once("change:isOpen",(()=>{a.children.add(i)})),s.on("change:isOpen",(()=>{const t=e.model.document.selection.getSelectedElement();s.isOpen&&(c.isImage(t)?(i.imageURLInputValue=t.getAttribute("src"),o.label=n("Update"),r.label=n("Update image URL")):(i.imageURLInputValue="",o.label=n("Insert"),r.label=n("Insert image via URL")))}),{priority:"low"}),i.delegate("submit","cancel").to(s),this.delegate("cancel").to(s),s.on("submit",(()=>{l(),function(){const t=e.model.document.selection.getSelectedElement();c.isImage(t)?e.model.change((e=>{e.setAttribute("src",i.imageURLInputValue,t),e.removeAttribute("srcset",t),e.removeAttribute("sizes",t)})):e.execute("insertImage",{source:i.imageURLInputValue})}()})),s.on("cancel",(()=>{l()})),s}}class ov extends e{static get pluginName(){return"ImageInsertViaUrl"}static get requires(){return[iv]}}class rv extends e{static get pluginName(){return"ImageInsert"}static get requires(){return[$A,ov,iv]}}class sv extends i{refresh(){const t=this.editor,e=t.plugins.get("ImageUtils").getClosestSelectedImageElement(t.model.document.selection);this.isEnabled=!!e,e&&e.hasAttribute("width")?this.value={width:e.getAttribute("width"),height:null}:this.value=null}execute(t){const e=this.editor,n=e.model,i=e.plugins.get("ImageUtils").getClosestSelectedImageElement(n.document.selection);this.value={width:t.width,height:null},i&&n.change((e=>{e.setAttribute("width",t.width,i)}))}}class av extends e{static get requires(){return[Y_]}static get pluginName(){return"ImageResizeEditing"}constructor(t){super(t),t.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]})}init(){const t=this.editor,e=new sv(t);this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline"),t.commands.add("resizeImage",e),t.commands.add("imageResize",e)}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:"width"}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:"width"})}_registerConverters(t){const e=this.editor;e.conversion.for("downcast").add((e=>e.on(`attribute:width:${t}`,((t,e,n)=>{if(!n.consumable.consume(e.item,t.name))return;const i=n.writer,o=n.mapper.toViewElement(e.item);null!==e.attributeNewValue?(i.setStyle("width",e.attributeNewValue,o),i.addClass("image_resized",o)):(i.removeStyle("width",o),i.removeClass("image_resized",o))})))),e.conversion.for("upcast").attributeToAttribute({view:{name:"imageBlock"===t?"figure":"img",styles:{width:/.+/}},model:{key:"width",value:t=>t.getStyle("width")}})}}const cv={small:Ga.objectSizeSmall,medium:Ga.objectSizeMedium,large:Ga.objectSizeLarge,original:Ga.objectSizeFull};class lv extends e{static get requires(){return[av]}static get pluginName(){return"ImageResizeButtons"}constructor(t){super(t),this._resizeUnit=t.config.get("image.resizeUnit")}init(){const t=this.editor,e=t.config.get("image.resizeOptions"),n=t.commands.get("resizeImage");this.bind("isEnabled").to(n);for(const t of e)this._registerImageResizeButton(t);this._registerImageResizeDropdown(e)}_registerImageResizeButton(t){const e=this.editor,{name:n,value:i,icon:o}=t,r=i?i+this._resizeUnit:null;e.ui.componentFactory.add(n,(n=>{const i=new ic(n),s=e.commands.get("resizeImage"),a=this._getOptionLabelValue(t,!0);if(!cv[o])throw new jl.CKEditorError("imageresizebuttons-missing-icon",e,t);return i.set({label:a,icon:cv[o],tooltip:a,isToggleable:!0}),i.bind("isEnabled").to(this),i.bind("isOn").to(s,"value",dv(r)),this.listenTo(i,"execute",(()=>{e.execute("resizeImage",{width:r})})),i}))}_registerImageResizeDropdown(t){const e=this.editor,n=e.t,i=t.find((t=>!t.value)),o=o=>{const r=e.commands.get("resizeImage"),s=Gc(o,fc),a=s.buttonView;return a.set({tooltip:n("Resize image"),commandValue:i.value,icon:cv.medium,isToggleable:!0,label:this._getOptionLabelValue(i),withText:!0,class:"ck-resize-image-button"}),a.bind("label").to(r,"value",(t=>t&&t.width?t.width:this._getOptionLabelValue(i))),s.bind("isOn").to(r),s.bind("isEnabled").to(this),Kc(s,this._getResizeDropdownListItemDefinitions(t,r)),s.listView.ariaLabel=n("Image resize list"),this.listenTo(s,"execute",(t=>{e.execute(t.source.commandName,{width:t.source.commandValue}),e.editing.view.focus()})),s};e.ui.componentFactory.add("resizeImage",o),e.ui.componentFactory.add("imageResize",o)}_getOptionLabelValue(t,e){const n=this.editor.t;return t.label?t.label:e?t.value?n("Resize image to %0",t.value+this._resizeUnit):n("Resize image to the original size"):t.value?t.value+this._resizeUnit:n("Original")}_getResizeDropdownListItemDefinitions(t,e){const n=new jl.Collection;return t.map((t=>{const i=t.value?t.value+this._resizeUnit:null,o={type:"button",model:new wl({commandName:"resizeImage",commandValue:i,label:this._getOptionLabelValue(t),withText:!0,icon:null})};o.model.bind("isOn").to(e,"value",dv(i)),n.add(o)})),n}}function dv(t){return e=>null===t&&e===t||e&&e.width===t}const uv=/(image|image-inline)/,hv="image_resized";class mv extends e{static get requires(){return[ub]}static get pluginName(){return"ImageResizeHandles"}init(){const t=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(t),this._setupResizerCreator()}_setupResizerCreator(){const t=this.editor,e=t.editing.view;e.addObserver(hA),this.listenTo(e.document,"imageLoaded",((n,i)=>{if(!i.target.matches("figure.image.ck-widget > img,figure.image.ck-widget > picture > img,figure.image.ck-widget > a > img,figure.image.ck-widget > a > picture > img,span.image-inline.ck-widget > img,span.image-inline.ck-widget > picture > img"))return;const o=t.editing.view.domConverter,r=o.domToView(i.target).findAncestor({classes:uv});let s=this.editor.plugins.get(ub).getResizerByViewElement(r);if(s)return void s.redraw();const a=t.editing.mapper,c=a.toModelElement(r);s=t.plugins.get(ub).attachTo({unit:t.config.get("image.resizeUnit"),modelElement:c,viewElement:r,editor:t,getHandleHost:t=>t.querySelector("img"),getResizeHost:()=>o.mapViewToDom(a.toViewElement(c.parent)),isCentered(){const t=c.getAttribute("imageStyle");return!t||"block"==t||"alignCenter"==t},onCommit(n){e.change((t=>{t.removeClass(hv,r)})),t.execute("resizeImage",{width:n})}}),s.on("updateSize",(()=>{r.hasClass(hv)||e.change((t=>{t.addClass(hv,r)}))})),s.bind("isEnabled").to(this)}))}}var gv=__webpack_require__(1043),pv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(gv.Z,pv);gv.Z.locals;class fv extends e{static get requires(){return[av,mv,lv]}static get pluginName(){return"ImageResize"}}class bv extends i{constructor(t,e){super(t),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(e.map((t=>{if(t.isDefault)for(const e of t.modelElements)this._defaultStyles[e]=t.name;return[t.name,t]})))}refresh(){const t=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!t,this.isEnabled?t.hasAttribute("imageStyle")?this.value=t.getAttribute("imageStyle"):this.value=this._defaultStyles[t.name]:this.value=!1}execute(t={}){const e=this.editor,n=e.model,i=e.plugins.get("ImageUtils");n.change((e=>{const o=t.value;let r=i.getClosestSelectedImageElement(n.document.selection);o&&this.shouldConvertImageType(o,r)&&(this.editor.execute(i.isBlockImage(r)?"imageTypeInline":"imageTypeBlock"),r=i.getClosestSelectedImageElement(n.document.selection)),!o||this._styles.get(o).isDefault?e.removeAttribute("imageStyle",r):e.setAttribute("imageStyle",o,r)}))}shouldConvertImageType(t,e){return!this._styles.get(t).modelElements.includes(e.name)}}const{objectFullWidth:kv,objectInline:xv,objectLeft:wv,objectRight:_v,objectCenter:Av,objectBlockLeft:vv,objectBlockRight:Cv}=Ga,yv={get inline(){return{name:"inline",title:"In line",icon:xv,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:wv,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:vv,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:Av,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:_v,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:Cv,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:Av,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:_v,modelElements:["imageBlock"],className:"image-style-side"}}},Ev={full:kv,left:vv,right:Cv,center:Av,inlineLeft:wv,inlineRight:_v,inline:xv},Tv=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function Dv(t){(0,jl.logWarning)("image-style-configuration-definition-invalid",t)}const Sv={normalizeStyles:function(t){const e=(t.configuredStyles.options||[]).map((t=>function(t){t="string"==typeof t?yv[t]?{...yv[t]}:{name:t}:function(t,e){const n={...e};for(const i in t)Object.prototype.hasOwnProperty.call(e,i)||(n[i]=t[i]);return n}(yv[t.name],t);"string"==typeof t.icon&&(t.icon=Ev[t.icon]||t.icon);return t}(t))).filter((e=>function(t,{isBlockPluginLoaded:e,isInlinePluginLoaded:n}){const{modelElements:i,name:o}=t;if(!(i&&i.length&&o))return Dv({style:t}),!1;{const o=[e?"imageBlock":null,n?"imageInline":null];if(!i.some((t=>o.includes(t))))return(0,jl.logWarning)("image-style-missing-dependency",{style:t,missingPlugins:i.map((t=>"imageBlock"===t?"ImageBlockEditing":"ImageInlineEditing"))}),!1}return!0}(e,t)));return e},getDefaultStylesConfiguration:function(t,e){return t&&e?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:t?{options:["block","side"]}:e?{options:["inline","alignLeft","alignRight"]}:{}},getDefaultDropdownDefinitions:function(t){return t.has("ImageBlockEditing")&&t.has("ImageInlineEditing")?[...Tv]:[]},warnInvalidStyle:Dv,DEFAULT_OPTIONS:yv,DEFAULT_ICONS:Ev,DEFAULT_DROPDOWN_DEFINITIONS:Tv};function Iv(t,e){for(const n of e)if(n.name===t)return n}class Bv extends e{static get pluginName(){return"ImageStyleEditing"}static get requires(){return[Y_]}init(){const{normalizeStyles:t,getDefaultStylesConfiguration:e}=Sv,n=this.editor,i=n.plugins.has("ImageBlockEditing"),o=n.plugins.has("ImageInlineEditing");n.config.define("image.styles",e(i,o)),this.normalizedStyles=t({configuredStyles:n.config.get("image.styles"),isBlockPluginLoaded:i,isInlinePluginLoaded:o}),this._setupConversion(i,o),this._setupPostFixer(),n.commands.add("imageStyle",new bv(n,this.normalizedStyles))}_setupConversion(t,e){const n=this.editor,i=n.model.schema,o=function(t){return(e,n,i)=>{if(!i.consumable.consume(n.item,e.name))return;const o=Iv(n.attributeNewValue,t),r=Iv(n.attributeOldValue,t),s=i.mapper.toViewElement(n.item),a=i.writer;r&&a.removeClass(r.className,s),o&&a.addClass(o.className,s)}}(this.normalizedStyles),r=function(t){const e={imageInline:t.filter((t=>!t.isDefault&&t.modelElements.includes("imageInline"))),imageBlock:t.filter((t=>!t.isDefault&&t.modelElements.includes("imageBlock")))};return(t,n,i)=>{if(!n.modelRange)return;const o=n.viewItem,r=(0,jl.first)(n.modelRange.getItems());if(r&&i.schema.checkAttribute(r,"imageStyle"))for(const t of e[r.name])i.consumable.consume(o,{classes:t.className})&&i.writer.setAttribute("imageStyle",t.name,r)}}(this.normalizedStyles);n.editing.downcastDispatcher.on("attribute:imageStyle",o),n.data.downcastDispatcher.on("attribute:imageStyle",o),t&&(i.extend("imageBlock",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:figure",r,{priority:"low"})),e&&(i.extend("imageInline",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:img",r,{priority:"low"}))}_setupPostFixer(){const t=this.editor,e=t.model.document,n=t.plugins.get(Y_),i=new Map(this.normalizedStyles.map((t=>[t.name,t])));e.registerPostFixer((t=>{let o=!1;for(const r of e.differ.getChanges())if("insert"==r.type||"attribute"==r.type&&"imageStyle"==r.attributeKey){let e="insert"==r.type?r.position.nodeAfter:r.range.start.nodeAfter;if(e&&e.is("element","paragraph")&&e.childCount>0&&(e=e.getChild(0)),!n.isImage(e))continue;const s=e.getAttribute("imageStyle");if(!s)continue;const a=i.get(s);a&&a.modelElements.includes(e.name)||(t.removeAttribute("imageStyle",e),o=!0)}return o}))}}var Mv=__webpack_require__(4622),Nv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(Mv.Z,Nv);Mv.Z.locals;class Ov extends e{static get requires(){return[Bv]}static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const t=this.editor.t;return{"Wrap text":t("Wrap text"),"Break text":t("Break text"),"In line":t("In line"),"Full size image":t("Full size image"),"Side image":t("Side image"),"Left aligned image":t("Left aligned image"),"Centered image":t("Centered image"),"Right aligned image":t("Right aligned image")}}init(){const t=this.editor.plugins,e=this.editor.config.get("image.toolbar")||[],n=Rv(t.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const t of n)this._createButton(t);const i=Rv([...e.filter(S.Z),...Sv.getDefaultDropdownDefinitions(t)],this.localizedDefaultStylesTitles);for(const t of i)this._createDropdown(t,n)}_createDropdown(t,e){const n=this.editor.ui.componentFactory;n.add(t.name,(i=>{let o;const{defaultItem:r,items:s,title:a}=t,c=s.filter((t=>e.find((({name:e})=>Pv(e)===t)))).map((t=>{const e=n.create(t);return t===r&&(o=e),e}));s.length!==c.length&&Sv.warnInvalidStyle({dropdown:t});const l=Gc(i,xc),d=l.buttonView,u=d.arrowView;return Zc(l,c,{enableActiveItemFocusOnDropdownOpen:!0}),d.set({label:Lv(a,o.label),class:null,tooltip:!0}),u.unbind("label"),u.set({label:a}),d.bind("icon").toMany(c,"isOn",((...t)=>{const e=t.findIndex(Et);return e<0?o.icon:c[e].icon})),d.bind("label").toMany(c,"isOn",((...t)=>{const e=t.findIndex(Et);return Lv(a,e<0?o.label:c[e].label)})),d.bind("isOn").toMany(c,"isOn",((...t)=>t.some(Et))),d.bind("class").toMany(c,"isOn",((...t)=>t.some(Et)?"ck-splitbutton_flatten":null)),d.on("execute",(()=>{c.some((({isOn:t})=>t))?l.isOpen=!l.isOpen:o.fire("execute")})),l.bind("isEnabled").toMany(c,"isEnabled",((...t)=>t.some(Et))),this.listenTo(l,"execute",(()=>{this.editor.editing.view.focus()})),l}))}_createButton(t){const e=t.name;this.editor.ui.componentFactory.add(Pv(e),(n=>{const i=this.editor.commands.get("imageStyle"),o=new ic(n);return o.set({label:t.title,icon:t.icon,tooltip:!0,isToggleable:!0}),o.bind("isEnabled").to(i,"isEnabled"),o.bind("isOn").to(i,"value",(t=>t===e)),o.on("execute",this._executeCommand.bind(this,e)),o}))}_executeCommand(t){this.editor.execute("imageStyle",{value:t}),this.editor.editing.view.focus()}}function Rv(t,e){for(const n of t)e[n.title]&&(n.title=e[n.title]);return t}function Pv(t){return`imageStyle:${t}`}function Lv(t,e){return(t?t+": ":"")+e}class zv extends e{static get requires(){return[Bv,Ov]}static get pluginName(){return"ImageStyle"}}class jv extends e{static get requires(){return[eb,Y_]}static get pluginName(){return"ImageToolbar"}afterInit(){const t=this.editor,e=t.t,n=t.plugins.get(eb),i=t.plugins.get("ImageUtils");var o;n.register("image",{ariaLabel:e("Image toolbar"),items:(o=t.config.get("image.toolbar")||[],o.map((t=>(0,S.Z)(t)?t.name:t))),getRelatedElement:t=>i.getClosestSelectedImageWidget(t)})}}class Fv extends e{static get requires(){return[gA,Y_]}static get pluginName(){return"PictureEditing"}afterInit(){const t=this.editor;t.plugins.has("ImageBlockEditing")&&t.model.schema.extend("imageBlock",{allowAttributes:["sources"]}),t.plugins.has("ImageInlineEditing")&&t.model.schema.extend("imageInline",{allowAttributes:["sources"]}),this._setupConversion(),this._setupImageUploadEditingIntegration()}_setupConversion(){const t=this.editor,e=t.conversion,n=t.plugins.get("ImageUtils");e.for("upcast").add(function(t){const e=["srcset","media","type","sizes"];return t=>{t.on("element:picture",n)};function n(n,i,o){const r=i.viewItem;if(!o.consumable.test(r,{name:!0}))return;const s=new Map;for(const t of r.getChildren())if(t.is("element","source")){const n={};for(const i of e)t.hasAttribute(i)&&o.consumable.test(t,{attributes:i})&&(n[i]=t.getAttribute(i));Object.keys(n).length&&s.set(t,n)}const a=t.findViewImgElement(r);if(!a)return;let c=i.modelCursor.parent;if(!c.is("element","imageBlock")){const t=o.convertItem(a,i.modelCursor);i.modelRange=t.modelRange,i.modelCursor=t.modelCursor,c=(0,jl.first)(t.modelRange.getItems())}o.consumable.consume(r,{name:!0});for(const[t,e]of s)o.consumable.consume(t,{attributes:Object.keys(e)});s.size&&o.writer.setAttribute("sources",Array.from(s.values()),c),o.convertChildren(r,c)}}(n)),e.for("downcast").add(function(t){return t=>{t.on("attribute:sources:imageBlock",e),t.on("attribute:sources:imageInline",e)};function e(e,n,i){if(!i.consumable.consume(n.item,e.name))return;const o=i.writer,r=i.mapper.toViewElement(n.item),s=t.findViewImgElement(r);if(n.attributeNewValue&&n.attributeNewValue.length){const t=o.createContainerElement("picture",null,n.attributeNewValue.map((t=>o.createEmptyElement("source",t)))),e=[];let i=s.parent;for(;i&&i.is("attributeElement");){const t=i.parent;o.unwrap(o.createRangeOn(s),i),e.unshift(i),i=t}o.insert(o.createPositionBefore(s),t),o.move(o.createRangeOn(s),o.createPositionAt(t,"end"));for(const n of e)o.wrap(o.createRangeOn(t),n)}else if(s.parent.is("element","picture")){const t=s.parent;o.move(o.createRangeOn(s),o.createPositionBefore(t)),o.remove(t)}}}(n))}_setupImageUploadEditingIntegration(){const t=this.editor;t.plugins.has("ImageUploadEditing")&&this.listenTo(t.plugins.get("ImageUploadEditing"),"uploadComplete",((e,{imageElement:n,data:i})=>{const o=i.sources;o&&t.model.change((t=>{t.setAttributes({sources:o},n)}))}))}}class Vv extends e{static get pluginName(){return"IndentEditing"}init(){const t=this.editor;t.commands.add("indent",new r(t)),t.commands.add("outdent",new r(t))}}const Uv='',Hv='';class qv extends e{static get pluginName(){return"IndentUI"}init(){const t=this.editor,e=t.locale,n=t.t,i="ltr"==e.uiLanguageDirection?Uv:Hv,o="ltr"==e.uiLanguageDirection?Hv:Uv;this._defineButton("indent",n("Increase indent"),i),this._defineButton("outdent",n("Decrease indent"),o)}_defineButton(t,e,n){const i=this.editor;i.ui.componentFactory.add(t,(o=>{const r=i.commands.get(t),s=new ic(o);return s.set({label:e,icon:n,tooltip:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),this.listenTo(s,"execute",(()=>{i.execute(t),i.editing.view.focus()})),s}))}}class Wv extends e{static get pluginName(){return"Indent"}static get requires(){return[Vv,qv]}}class Gv extends i{constructor(t,e){super(t),this._indentBehavior=e}refresh(){const t=this.editor.model,e=(0,jl.first)(t.document.selection.getSelectedBlocks());e&&t.schema.checkAttribute(e,"blockIndent")?this.isEnabled=this._indentBehavior.checkEnabled(e.getAttribute("blockIndent")):this.isEnabled=!1}execute(){const t=this.editor.model,e=function(t){const e=t.document.selection,n=t.schema;return Array.from(e.getSelectedBlocks()).filter((t=>n.checkAttribute(t,"blockIndent")))}(t);t.change((t=>{for(const n of e){const e=n.getAttribute("blockIndent"),i=this._indentBehavior.getNextIndent(e);i?t.setAttribute("blockIndent",i,n):t.removeAttribute("blockIndent",n)}}))}}class Zv{constructor(t){this.isForward="forward"===t.direction,this.offset=t.offset,this.unit=t.unit}checkEnabled(t){const e=parseFloat(t||0);return this.isForward||e>0}getNextIndent(t){const e=parseFloat(t||0);if(!(!t||t.endsWith(this.unit)))return this.isForward?this.offset+this.unit:void 0;const n=e+(this.isForward?this.offset:-this.offset);return n>0?n+this.unit:void 0}}class Kv{constructor(t){this.isForward="forward"===t.direction,this.classes=t.classes}checkEnabled(t){const e=this.classes.indexOf(t);return this.isForward?e=0}getNextIndent(t){const e=this.classes.indexOf(t),n=this.isForward?1:-1;return this.classes[e+n]}}const $v=["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"];class Yv extends e{constructor(t){super(t),t.config.define("indentBlock",{offset:40,unit:"px"})}static get pluginName(){return"IndentBlock"}init(){const t=this.editor,e=t.config.get("indentBlock"),n=!e.classes||!e.classes.length,i=Object.assign({direction:"forward"},e),o=Object.assign({direction:"backward"},e);n?(t.data.addStyleProcessorRules(qs),this._setupConversionUsingOffset(t.conversion),t.commands.add("indentBlock",new Gv(t,new Zv(i))),t.commands.add("outdentBlock",new Gv(t,new Zv(o)))):(this._setupConversionUsingClasses(e.classes),t.commands.add("indentBlock",new Gv(t,new Kv(i))),t.commands.add("outdentBlock",new Gv(t,new Kv(o))))}afterInit(){const t=this.editor,e=t.model.schema,n=t.commands.get("indent"),i=t.commands.get("outdent"),o=t.config.get("heading.options");(o&&o.map((t=>t.model))||$v).forEach((t=>{e.isRegistered(t)&&e.extend(t,{allowAttributes:"blockIndent"})})),e.setAttributeProperties("blockIndent",{isFormatting:!0}),n.registerChildCommand(t.commands.get("indentBlock")),i.registerChildCommand(t.commands.get("outdentBlock"))}_setupConversionUsingOffset(){const t=this.editor.conversion,e="rtl"===this.editor.locale.contentLanguageDirection?"margin-right":"margin-left";t.for("upcast").attributeToAttribute({view:{styles:{[e]:/[\s\S]+/}},model:{key:"blockIndent",value:t=>t.getStyle(e)}}),t.for("downcast").attributeToAttribute({model:"blockIndent",view:t=>({key:"style",value:{[e]:t}})})}_setupConversionUsingClasses(t){const e={model:{key:"blockIndent",values:[]},view:{}};for(const n of t)e.model.values.push(n),e.view[n]={key:"class",value:[n]};this.editor.conversion.attributeToAttribute(e)}}function Jv(t,e){return`${t}:${e=e||(0,jl.getLanguageDirection)(t)}`}class Qv extends i{refresh(){const t=this.editor.model,e=t.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,"language")}execute({languageCode:t,textDirection:e}={}){const n=this.editor.model,i=n.document.selection,o=!!t&&Jv(t,e);n.change((t=>{if(i.isCollapsed)o?t.setSelectionAttribute("language",o):t.removeSelectionAttribute("language");else{const e=n.schema.getValidRanges(i.getRanges(),"language");for(const n of e)o?t.setAttribute("language",o,n):t.removeAttribute("language",n)}}))}_getValueFromFirstAllowedNode(){const t=this.editor.model,e=t.schema,n=t.document.selection;if(n.isCollapsed)return n.getAttribute("language")||!1;for(const t of n.getRanges())for(const n of t.getItems())if(e.checkAttribute(n,"language"))return n.getAttribute("language")||!1;return!1}}class Xv extends e{static get pluginName(){return"TextPartLanguageEditing"}constructor(t){super(t),t.config.define("language",{textPartLanguage:[{title:"Arabic",languageCode:"ar"},{title:"French",languageCode:"fr"},{title:"Spanish",languageCode:"es"}]})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"language"}),t.model.schema.setAttributeProperties("language",{copyOnEnter:!0}),this._defineConverters(),t.commands.add("textPartLanguage",new Qv(t))}_defineConverters(){const t=this.editor.conversion;t.for("upcast").elementToAttribute({model:{key:"language",value:t=>Jv(t.getAttribute("lang"),t.getAttribute("dir"))},view:{name:"span",attributes:{lang:/[\s\S]+/}}}),t.for("downcast").attributeToElement({model:"language",view:(t,{writer:e},n)=>{if(!t)return;if(!n.item.is("$textProxy")&&!n.item.is("documentSelection"))return;const{languageCode:i,textDirection:o}=function(t){const[e,n]=t.split(":");return{languageCode:e,textDirection:n}}(t);return e.createAttributeElement("span",{lang:i,dir:o})}})}}var tC=__webpack_require__(4704),eC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(tC.Z,eC);tC.Z.locals;class nC extends e{static get pluginName(){return"TextPartLanguageUI"}init(){const t=this.editor,e=t.t,n=t.config.get("language.textPartLanguage"),i=e("Choose language"),o=e("Remove language"),r=e("Language");t.ui.componentFactory.add("textPartLanguage",(e=>{const s=new jl.Collection,a={},c=t.commands.get("textPartLanguage");s.add({type:"button",model:new wl({label:o,languageCode:!1,withText:!0})}),s.add({type:"separator"});for(const t of n){const e={type:"button",model:new wl({label:t.title,languageCode:t.languageCode,textDirection:t.textDirection,withText:!0})},n=Jv(t.languageCode,t.textDirection);e.model.bind("isOn").to(c,"value",(t=>t===n)),s.add(e),a[n]=t.title}const l=Gc(e);return Kc(l,s),l.buttonView.set({isOn:!1,withText:!0,tooltip:r}),l.extendTemplate({attributes:{class:["ck-text-fragment-language-dropdown"]}}),l.bind("isEnabled").to(c,"isEnabled"),l.buttonView.bind("label").to(c,"value",(t=>a[t]||i)),this.listenTo(l,"execute",(e=>{c.execute({languageCode:e.source.languageCode,textDirection:e.source.textDirection}),t.editing.view.focus()})),l}))}}class iC extends e{static get requires(){return[Xv,nC]}static get pluginName(){return"TextPartLanguage"}}class oC{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(t){Array.isArray(t)?t.forEach((t=>this._definitions.add(t))):this._definitions.add(t)}getDispatcher(){return t=>{t.on("attribute:linkHref",((t,e,n)=>{if(!n.consumable.test(e.item,"attribute:linkHref"))return;if(!e.item.is("selection")&&!n.schema.isInline(e.item))return;const i=n.writer,o=i.document.selection;for(const t of this._definitions){const r=i.createAttributeElement("a",t.attributes,{priority:5});t.classes&&i.addClass(t.classes,r);for(const e in t.styles)i.setStyle(e,t.styles[e],r);i.setCustomProperty("link",!0,r),t.callback(e.attributeNewValue)?e.item.is("selection")?i.wrap(o.getFirstRange(),r):i.wrap(n.mapper.toViewRange(e.range),r):i.unwrap(n.mapper.toViewRange(e.range),r)}}),{priority:"high"})}}getDispatcherForLinkedImage(){return t=>{t.on("attribute:linkHref:imageBlock",((t,e,{writer:n,mapper:i})=>{const o=i.toViewElement(e.item),r=Array.from(o.getChildren()).find((t=>"a"===t.name));for(const t of this._definitions){const i=(0,jl.toMap)(t.attributes);if(t.callback(e.attributeNewValue)){for(const[t,e]of i)"class"===t?n.addClass(e,r):n.setAttribute(t,e,r);t.classes&&n.addClass(t.classes,r);for(const e in t.styles)n.setStyle(e,t.styles[e],r)}else{for(const[t,e]of i)"class"===t?n.removeClass(e,r):n.removeAttribute(t,r);t.classes&&n.removeClass(t.classes,r);for(const e in t.styles)n.removeStyle(e,r)}}}))}}}const rC=function(t,e,n){var i=t.length;return n=void 0===n?i:n,!e&&n>=i?t:tt(t,e,n)};var sC=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const aC=function(t){return sC.test(t)};const cC=function(t){return t.split("")};var lC="\\ud800-\\udfff",dC="["+lC+"]",uC="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",hC="\\ud83c[\\udffb-\\udfff]",mC="[^"+lC+"]",gC="(?:\\ud83c[\\udde6-\\uddff]){2}",pC="[\\ud800-\\udbff][\\udc00-\\udfff]",fC="(?:"+uC+"|"+hC+")"+"?",bC="[\\ufe0e\\ufe0f]?",kC=bC+fC+("(?:\\u200d(?:"+[mC,gC,pC].join("|")+")"+bC+fC+")*"),xC="(?:"+[mC+uC+"?",uC,gC,pC,dC].join("|")+")",wC=RegExp(hC+"(?="+hC+")|"+xC+kC,"g");const _C=function(t){return t.match(wC)||[]};const AC=function(t){return aC(t)?_C(t):cC(t)};const vC=function(t){return function(e){e=$(e);var n=aC(e)?AC(e):void 0,i=n?n[0]:e.charAt(0),o=n?rC(n,1).join(""):e.slice(1);return i[t]()+o}}("toUpperCase"),CC=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,yC=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i,EC=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,TC=/^((\w+:(\/{2,})?)|(\W))/i,DC="Ctrl+K";function SC(t,{writer:e}){const n=e.createAttributeElement("a",{href:t},{priority:5});return e.setCustomProperty("link",!0,n),n}function IC(t){return function(t){const e=t.replace(CC,"");return e.match(yC)}(t=String(t))?t:"#"}function BC(t,e){return!!t&&e.checkAttribute(t.name,"linkHref")}function MC(t,e){const n=(i=t,EC.test(i)?"mailto:":e);var i;const o=!!n&&!NC(t);return t&&o?n+t:t}function NC(t){return TC.test(t)}function OC(t){window.open(t,"_blank","noopener")}class RC extends i{constructor(t){super(t),this.manualDecorators=new jl.Collection,this.automaticDecorators=new oC}restoreManualDecoratorStates(){for(const t of this.manualDecorators)t.value=this._getDecoratorStateFromModel(t.id)}refresh(){const t=this.editor.model,e=t.document.selection,n=e.getSelectedElement()||(0,jl.first)(e.getSelectedBlocks());BC(n,t.schema)?(this.value=n.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttribute(n,"linkHref")):(this.value=e.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttributeInSelection(e,"linkHref"));for(const t of this.manualDecorators)t.value=this._getDecoratorStateFromModel(t.id)}execute(t,e={}){const n=this.editor.model,i=n.document.selection,o=[],r=[];for(const t in e)e[t]?o.push(t):r.push(t);n.change((e=>{if(i.isCollapsed){const s=i.getFirstPosition();if(i.hasAttribute("linkHref")){const a=su(s,"linkHref",i.getAttribute("linkHref"),n);e.setAttribute("linkHref",t,a),o.forEach((t=>{e.setAttribute(t,!0,a)})),r.forEach((t=>{e.removeAttribute(t,a)})),e.setSelection(e.createPositionAfter(a.end.nodeBefore))}else if(""!==t){const r=(0,jl.toMap)(i.getAttributes());r.set("linkHref",t),o.forEach((t=>{r.set(t,!0)}));const{end:a}=n.insertContent(e.createText(t,r),s);e.setSelection(a)}["linkHref",...o,...r].forEach((t=>{e.removeSelectionAttribute(t)}))}else{const s=n.schema.getValidRanges(i.getRanges(),"linkHref"),a=[];for(const t of i.getSelectedBlocks())n.schema.checkAttribute(t,"linkHref")&&a.push(e.createRangeOn(t));const c=a.slice();for(const t of s)this._isRangeToUpdate(t,a)&&c.push(t);for(const n of c)e.setAttribute("linkHref",t,n),o.forEach((t=>{e.setAttribute(t,!0,n)})),r.forEach((t=>{e.removeAttribute(t,n)}))}}))}_getDecoratorStateFromModel(t){const e=this.editor.model,n=e.document.selection,i=n.getSelectedElement();return BC(i,e.schema)?i.getAttribute(t):n.getAttribute(t)}_isRangeToUpdate(t,e){for(const n of e)if(n.containsRange(t))return!1;return!0}}class PC extends i{refresh(){const t=this.editor.model,e=t.document.selection,n=e.getSelectedElement();BC(n,t.schema)?this.isEnabled=t.schema.checkAttribute(n,"linkHref"):this.isEnabled=t.schema.checkAttributeInSelection(e,"linkHref")}execute(){const t=this.editor,e=this.editor.model,n=e.document.selection,i=t.commands.get("link");e.change((t=>{const o=n.isCollapsed?[su(n.getFirstPosition(),"linkHref",n.getAttribute("linkHref"),e)]:e.schema.getValidRanges(n.getRanges(),"linkHref");for(const e of o)if(t.removeAttribute("linkHref",e),i)for(const n of i.manualDecorators)t.removeAttribute(n.id,e)}))}}class LC{constructor({id:t,label:e,attributes:n,classes:i,styles:o,defaultValue:r}){this.id=t,this.set("value"),this.defaultValue=r,this.label=e,this.attributes=n,this.classes=i,this.styles=o}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}(0,jl.mix)(LC,jl.ObservableMixin);var zC=__webpack_require__(399),jC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(zC.Z,jC);zC.Z.locals;const FC="automatic",VC=/^(https?:)?\/\//;class UC extends e{static get pluginName(){return"LinkEditing"}static get requires(){return[qd,Bd,Cf]}constructor(t){super(t),t.config.define("link",{addTargetToExternalLinks:!1})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"linkHref"}),t.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:SC}),t.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(t,e)=>SC(IC(t),e)}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:t=>t.getAttribute("href")}}),t.commands.add("link",new RC(t)),t.commands.add("unlink",new PC(t));const e=function(t,e){const n={"Open in a new tab":t("Open in a new tab"),Downloadable:t("Downloadable")};return e.forEach((t=>(t.label&&n[t.label]&&(t.label=n[t.label]),t))),e}(t.t,function(t){const e=[];if(t)for(const[n,i]of Object.entries(t)){const t=Object.assign({},i,{id:`link${vC(n)}`});e.push(t)}return e}(t.config.get("link.decorators")));this._enableAutomaticDecorators(e.filter((t=>t.mode===FC))),this._enableManualDecorators(e.filter((t=>"manual"===t.mode)));t.plugins.get(qd).registerAttribute("linkHref"),cu(t,"linkHref","a","ck-link_selected"),this._enableLinkOpen(),this._enableInsertContentSelectionAttributesFixer(),this._enableClickingAfterLink(),this._enableTypingOverLink(),this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(t){const e=this.editor,n=e.commands.get("link").automaticDecorators;e.config.get("link.addTargetToExternalLinks")&&n.add({id:"linkIsExternal",mode:FC,callback:t=>VC.test(t),attributes:{target:"_blank",rel:"noopener noreferrer"}}),n.add(t),n.length&&e.conversion.for("downcast").add(n.getDispatcher())}_enableManualDecorators(t){if(!t.length)return;const e=this.editor,n=e.commands.get("link").manualDecorators;t.forEach((t=>{e.model.schema.extend("$text",{allowAttributes:t.id}),t=new LC(t),n.add(t),e.conversion.for("downcast").attributeToElement({model:t.id,view:(e,{writer:n,schema:i},{item:o})=>{if((o.is("selection")||i.isInline(o))&&e){const e=n.createAttributeElement("a",t.attributes,{priority:5});t.classes&&n.addClass(t.classes,e);for(const i in t.styles)n.setStyle(i,t.styles[i],e);return n.setCustomProperty("link",!0,e),e}}}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",...t._createPattern()},model:{key:t.id}})}))}_enableLinkOpen(){const t=this.editor,e=t.editing.view.document;this.listenTo(e,"click",((t,e)=>{if(!(jl.env.isMac?e.domEvent.metaKey:e.domEvent.ctrlKey))return;let n=e.domTarget;if("a"!=n.tagName.toLowerCase()&&(n=n.closest("a")),!n)return;const i=n.getAttribute("href");i&&(t.stop(),e.preventDefault(),OC(i))}),{context:"$capture"}),this.listenTo(e,"keydown",((e,n)=>{const i=t.commands.get("link").value;i&&n.keyCode===jl.keyCodes.enter&&n.altKey&&(e.stop(),OC(i))}))}_enableInsertContentSelectionAttributesFixer(){const t=this.editor.model,e=t.document.selection;this.listenTo(t,"insertContent",(()=>{const n=e.anchor.nodeBefore,i=e.anchor.nodeAfter;e.hasAttribute("linkHref")&&n&&n.hasAttribute("linkHref")&&(i&&i.hasAttribute("linkHref")||t.change((e=>{HC(e,WC(t.schema))})))}),{priority:"low"})}_enableClickingAfterLink(){const t=this.editor,e=t.model;t.editing.view.addObserver(rs);let n=!1;this.listenTo(t.editing.view.document,"mousedown",(()=>{n=!0})),this.listenTo(t.editing.view.document,"selectionChange",(()=>{if(!n)return;n=!1;const t=e.document.selection;if(!t.isCollapsed)return;if(!t.hasAttribute("linkHref"))return;const i=t.getFirstPosition(),o=su(i,"linkHref",t.getAttribute("linkHref"),e);(i.isTouching(o.start)||i.isTouching(o.end))&&e.change((t=>{HC(t,WC(e.schema))}))}))}_enableTypingOverLink(){const t=this.editor,e=t.editing.view;let n,i;this.listenTo(e.document,"delete",(()=>{i=!0}),{priority:"high"}),this.listenTo(t.model,"deleteContent",(()=>{const e=t.model.document.selection;e.isCollapsed||(i?i=!1:qC(t)&&function(t){const e=t.document.selection,n=e.getFirstPosition(),i=e.getLastPosition(),o=n.nodeAfter;if(!o)return!1;if(!o.is("$text"))return!1;if(!o.hasAttribute("linkHref"))return!1;const r=i.textNode||i.nodeBefore;if(o===r)return!0;return su(n,"linkHref",o.getAttribute("linkHref"),t).containsRange(t.createRange(n,i),!0)}(t.model)&&(n=e.getAttributes()))}),{priority:"high"}),this.listenTo(t.model,"insertContent",((e,[o])=>{i=!1,qC(t)&&n&&(t.model.change((t=>{for(const[e,i]of n)t.setAttribute(e,i,o)})),n=null)}),{priority:"high"})}_handleDeleteContentAfterLink(){const t=this.editor,e=t.model,n=e.document.selection,i=t.editing.view;let o=!1,r=!1;this.listenTo(i.document,"delete",((t,e)=>{r="backward"===e.direction}),{priority:"high"}),this.listenTo(e,"deleteContent",(()=>{o=!1;const t=n.getFirstPosition(),i=n.getAttribute("linkHref");if(!i)return;const r=su(t,"linkHref",i,e);o=r.containsPosition(t)||r.end.isEqual(t)}),{priority:"high"}),this.listenTo(e,"deleteContent",(()=>{r&&(r=!1,o||t.model.enqueueChange((t=>{HC(t,WC(e.schema))})))}),{priority:"low"})}}function HC(t,e){t.removeSelectionAttribute("linkHref");for(const n of e)t.removeSelectionAttribute(n)}function qC(t){return t.model.change((t=>t.batch)).isTyping}function WC(t){return t.getDefinition("$text").allowAttributes.filter((t=>t.startsWith("link")))}var GC=__webpack_require__(4827),ZC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(GC.Z,ZC);GC.Z.locals;class KC extends Aa{constructor(t,e){super(t);const n=t.t;this.focusTracker=new jl.FocusTracker,this.keystrokes=new jl.KeystrokeHandler,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),Ga.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),Ga.cancel,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(e),this.children=this._createFormChildren(e.manualDecorators),this._focusables=new Js,this._focusCycler=new Cc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const i=["ck","ck-link-form","ck-responsive-form"];e.manualDecorators.length&&i.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:i,tabindex:"-1"},children:this.children}),Ka(this)}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce(((t,e)=>(t[e.name]=e.isOn,t)),{})}render(){super.render(),$a({view:this});[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach((t=>{this._focusables.add(t),this.focusTracker.add(t.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const t=this.locale.t,e=new pl(this.locale,fl);return e.label=t("Link URL"),e}_createButton(t,e,n,i){const o=new ic(this.locale);return o.set({label:t,icon:e,tooltip:!0}),o.extendTemplate({attributes:{class:n}}),i&&o.delegate("execute").to(this,i),o}_createManualDecoratorSwitches(t){const e=this.createCollection();for(const n of t.manualDecorators){const i=new sc(this.locale);i.set({name:n.id,label:n.label,withText:!0}),i.bind("isOn").toMany([n,t],"value",((t,e)=>void 0===e&&void 0===t?n.defaultValue:t)),i.on("execute",(()=>{n.set("value",!i.isOn)})),e.add(i)}return e}_createFormChildren(t){const e=this.createCollection();if(e.add(this.urlInputView),t.length){const t=new Aa;t.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map((t=>({tag:"li",children:[t],attributes:{class:["ck","ck-list__item"]}}))),attributes:{class:["ck","ck-reset","ck-list"]}}),e.add(t)}return e.add(this.saveButtonView),e.add(this.cancelButtonView),e}}var $C=__webpack_require__(9465),YC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()($C.Z,YC);$C.Z.locals;class JC extends Aa{constructor(t){super(t);const e=t.t;this.focusTracker=new jl.FocusTracker,this.keystrokes=new jl.KeystrokeHandler,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(e("Unlink"),'',"unlink"),this.editButtonView=this._createButton(e("Edit link"),Ga.pencil,"edit"),this.set("href"),this._focusables=new Js,this._focusCycler=new Cc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render();[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach((t=>{this._focusables.add(t),this.focusTracker.add(t.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createButton(t,e,n){const i=new ic(this.locale);return i.set({label:t,icon:e,tooltip:!0}),i.delegate("execute").to(this,n),i}_createPreviewButton(){const t=new ic(this.locale),e=this.bindTemplate,n=this.t;return t.set({withText:!0,tooltip:n("Open link in new tab")}),t.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:e.to("href",(t=>t&&IC(t))),target:"_blank",rel:"noopener noreferrer"}}),t.bind("label").to(this,"href",(t=>t||n("This link has no URL"))),t.bind("isEnabled").to(this,"href",(t=>!!t)),t.template.tag="a",t.template.eventListeners={},t}}const QC='',XC="link-ui";class ty extends e{static get requires(){return[Tl]}static get pluginName(){return"LinkUI"}init(){const t=this.editor;t.editing.view.addObserver(os),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=t.plugins.get(Tl),this._createToolbarLinkButton(),this._enableUserBalloonInteractions(),t.conversion.for("editingDowncast").markerToHighlight({model:XC,view:{classes:["ck-fake-link-selection"]}}),t.conversion.for("editingDowncast").markerToElement({model:XC,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy(),this.formView.destroy()}_createActionsView(){const t=this.editor,e=new JC(t.locale),n=t.commands.get("link"),i=t.commands.get("unlink");return e.bind("href").to(n,"value"),e.editButtonView.bind("isEnabled").to(n),e.unlinkButtonView.bind("isEnabled").to(i),this.listenTo(e,"edit",(()=>{this._addFormView()})),this.listenTo(e,"unlink",(()=>{t.execute("unlink"),this._hideUI()})),e.keystrokes.set("Esc",((t,e)=>{this._hideUI(),e()})),e.keystrokes.set(DC,((t,e)=>{this._addFormView(),e()})),e}_createFormView(){const t=this.editor,e=t.commands.get("link"),n=t.config.get("link.defaultProtocol"),i=new KC(t.locale,e);return i.urlInputView.fieldView.bind("value").to(e,"value"),i.urlInputView.bind("isReadOnly").to(e,"isEnabled",(t=>!t)),i.saveButtonView.bind("isEnabled").to(e),this.listenTo(i,"submit",(()=>{const{value:e}=i.urlInputView.fieldView.element,o=MC(e,n);t.execute("link",o,i.getDecoratorSwitchesState()),this._closeFormView()})),this.listenTo(i,"cancel",(()=>{this._closeFormView()})),i.keystrokes.set("Esc",((t,e)=>{this._closeFormView(),e()})),i}_createToolbarLinkButton(){const t=this.editor,e=t.commands.get("link"),n=t.t;t.keystrokes.set(DC,((t,n)=>{n(),e.isEnabled&&this._showUI(!0)})),t.ui.componentFactory.add("link",(t=>{const i=new ic(t);return i.isEnabled=!0,i.label=n("Link"),i.icon=QC,i.keystroke=DC,i.tooltip=!0,i.isToggleable=!0,i.bind("isEnabled").to(e,"isEnabled"),i.bind("isOn").to(e,"value",(t=>!!t)),this.listenTo(i,"execute",(()=>this._showUI(!0))),i}))}_enableUserBalloonInteractions(){const t=this.editor.editing.view.document;this.listenTo(t,"click",(()=>{this._getSelectedLinkElement()&&this._showUI()})),this.editor.keystrokes.set("Tab",((t,e)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),e())}),{priority:"high"}),this.editor.keystrokes.set("Esc",((t,e)=>{this._isUIVisible&&(this._hideUI(),e())})),Za({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel)return;const t=this.editor.commands.get("link");this.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions(),this.formView.urlInputView.fieldView.element.value=t.value||""}_closeFormView(){const t=this.editor.commands.get("link");t.restoreManualDecoratorStates(),void 0!==t.value?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(t=!1){this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),t&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),t&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const t=this.editor;this.stopListening(t.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),t.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const t=this.editor,e=t.editing.view.document;let n=this._getSelectedLinkElement(),i=r();const o=()=>{const t=this._getSelectedLinkElement(),e=r();n&&!t||!n&&e!==i?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),n=t,i=e};function r(){return e.selection.focus.getAncestors().reverse().find((t=>t.is("element")))}this.listenTo(t.ui,"update",o),this.listenTo(this._balloon,"change:visibleView",o)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const t=this.editor.editing.view,e=this.editor.model,n=t.document;let i=null;if(e.markers.has(XC)){const e=Array.from(this.editor.editing.mapper.markerNameToElements(XC)),n=t.createRange(t.createPositionBefore(e[0]),t.createPositionAfter(e[e.length-1]));i=t.domConverter.viewRangeToDom(n)}else i=()=>{const e=this._getSelectedLinkElement();return e?t.domConverter.mapViewToDom(e):t.domConverter.viewRangeToDom(n.selection.getFirstRange())};return{target:i}}_getSelectedLinkElement(){const t=this.editor.editing.view,e=t.document.selection,n=e.getSelectedElement();if(e.isCollapsed||n&&Bf(n))return ey(e.getFirstPosition());{const n=e.getFirstRange().getTrimmed(),i=ey(n.start),o=ey(n.end);return i&&i==o&&t.createRangeIn(i).getTrimmed().isEqual(n)?i:null}}_showFakeVisualSelection(){const t=this.editor.model;t.change((e=>{const n=t.document.selection.getFirstRange();if(t.markers.has(XC))e.updateMarker(XC,{range:n});else if(n.start.isAtEnd){const i=n.start.getLastMatchingPosition((({item:e})=>!t.schema.isContent(e)),{boundaries:n});e.addMarker(XC,{usingOperation:!1,affectsData:!1,range:e.createRange(i,n.end)})}else e.addMarker(XC,{usingOperation:!1,affectsData:!1,range:n})}))}_hideFakeVisualSelection(){const t=this.editor.model;t.markers.has(XC)&&t.change((t=>{t.removeMarker(XC)}))}}function ey(t){return t.getAncestors().find((t=>{return(e=t).is("attributeElement")&&!!e.getCustomProperty("link");var e}))}const ny=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class iy extends e{static get requires(){return[Fd]}static get pluginName(){return"AutoLink"}init(){const t=this.editor.model.document.selection;t.on("change:range",(()=>{this.isEnabled=!t.anchor.parent.is("element","codeBlock")})),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling()}_enableTypingHandling(){const t=this.editor,e=new Hd(t.model,(t=>{if(!function(t){return t.length>4&&" "===t[t.length-1]&&" "!==t[t.length-2]}(t))return;const e=oy(t.substr(0,t.length-1));return e?{url:e}:void 0}));e.on("matched:data",((e,n)=>{const{batch:i,range:o,url:r}=n;if(!i.isTyping)return;const s=o.end.getShiftedBy(-1),a=s.getShiftedBy(-r.length),c=t.model.createRange(a,s);this._applyAutoLink(r,c)})),e.bind("isEnabled").to(this)}_enableEnterHandling(){const t=this.editor,e=t.model,n=t.commands.get("enter");n&&n.on("execute",(()=>{const t=e.document.selection.getFirstPosition();if(!t.parent.previousSibling)return;const n=e.createRangeIn(t.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(n)}))}_enableShiftEnterHandling(){const t=this.editor,e=t.model,n=t.commands.get("shiftEnter");n&&n.on("execute",(()=>{const t=e.document.selection.getFirstPosition(),n=e.createRange(e.createPositionAt(t.parent,0),t.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(n)}))}_checkAndApplyAutoLinkOnRange(t){const e=this.editor.model,{text:n,range:i}=Ud(t,e),o=oy(n);if(o){const t=e.createRange(i.end.getShiftedBy(-o.length),i.end);this._applyAutoLink(o,t)}}_applyAutoLink(t,e){const n=this.editor.model,i=MC(t,this.editor.config.get("link.defaultProtocol"));this.isEnabled&&function(t,e){return e.schema.checkAttributeInSelection(e.createSelection(t),"linkHref")}(e,n)&&NC(i)&&!function(t){const e=t.start.nodeAfter;return e&&e.hasAttribute("linkHref")}(e)&&this._persistAutoLink(i,e)}_persistAutoLink(t,e){const n=this.editor.model,i=this.editor.plugins.get("Delete");n.enqueueChange((o=>{o.setAttribute("linkHref",t,e),n.enqueueChange((()=>{i.requestUndoOnBackspace()}))}))}}function oy(t){const e=ny.exec(t);return e?e[2]:null}class ry extends e{static get requires(){return[UC,ty,iy]}static get pluginName(){return"Link"}}class sy extends e{static get requires(){return["ImageEditing","ImageUtils",UC]}static get pluginName(){return"LinkImageEditing"}init(){const t=this.editor,e=t.model.schema;t.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["linkHref"]}),t.conversion.for("upcast").add(function(t){const e=t.plugins.has("ImageInlineEditing"),n=t.plugins.get("ImageUtils");return t=>{t.on("element:a",((t,i,o)=>{const r=i.viewItem,s=n.findViewImgElement(r);if(!s)return;const a=s.findAncestor((t=>n.isBlockImageView(t)));if(e&&!a)return;const c={attributes:["href"]};if(!o.consumable.consume(r,c))return;const l=r.getAttribute("href");if(!l)return;let d=i.modelCursor.parent;if(!d.is("element","imageBlock")){const t=o.convertItem(s,i.modelCursor);i.modelRange=t.modelRange,i.modelCursor=t.modelCursor,d=i.modelCursor.nodeBefore}d&&d.is("element","imageBlock")&&o.writer.setAttribute("linkHref",l,d)}),{priority:"high"})}}(t)),t.conversion.for("downcast").add(function(t){const e=t.plugins.get("ImageUtils");return t=>{t.on("attribute:linkHref:imageBlock",((t,n,i)=>{if(!i.consumable.consume(n.item,t.name))return;const o=i.mapper.toViewElement(n.item),r=i.writer,s=Array.from(o.getChildren()).find((t=>"a"===t.name)),a=e.findViewImgElement(o),c=a.parent.is("element","picture")?a.parent:a;if(s)n.attributeNewValue?r.setAttribute("href",n.attributeNewValue,s):(r.move(r.createRangeOn(c),r.createPositionAt(o,0)),r.remove(s));else{const t=r.createContainerElement("a",{href:n.attributeNewValue});r.insert(r.createPositionAt(o,0),t),r.move(r.createRangeOn(c),r.createPositionAt(t,0))}}),{priority:"high"})}}(t)),this._enableAutomaticDecorators(),this._enableManualDecorators()}_enableAutomaticDecorators(){const t=this.editor,e=t.commands.get("link").automaticDecorators;e.length&&t.conversion.for("downcast").add(e.getDispatcherForLinkedImage())}_enableManualDecorators(){const t=this.editor,e=t.commands.get("link");for(const n of e.manualDecorators)t.plugins.has("ImageBlockEditing")&&t.model.schema.extend("imageBlock",{allowAttributes:n.id}),t.plugins.has("ImageInlineEditing")&&t.model.schema.extend("imageInline",{allowAttributes:n.id}),t.conversion.for("downcast").add(ay(n)),t.conversion.for("upcast").add(cy(t,n))}}function ay(t){return e=>{e.on(`attribute:${t.id}:imageBlock`,((e,n,i)=>{const o=i.mapper.toViewElement(n.item),r=Array.from(o.getChildren()).find((t=>"a"===t.name));if(r){for(const[e,n]of(0,jl.toMap)(t.attributes))i.writer.setAttribute(e,n,r);t.classes&&i.writer.addClass(t.classes,r);for(const e in t.styles)i.writer.setStyle(e,t.styles[e],r)}}))}}function cy(t,e){const n=t.plugins.has("ImageInlineEditing"),i=t.plugins.get("ImageUtils");return t=>{t.on("element:a",((t,o,r)=>{const s=o.viewItem,a=i.findViewImgElement(s);if(!a)return;const c=a.findAncestor((t=>i.isBlockImageView(t)));if(n&&!c)return;const l=new E(e._createPattern()).match(s);if(!l)return;if(!r.consumable.consume(s,l.match))return;const d=o.modelCursor.nodeBefore||o.modelCursor.parent;r.writer.setAttribute(e.id,!0,d)}),{priority:"high"})}}class ly extends e{static get requires(){return[UC,ty,"ImageBlockEditing"]}static get pluginName(){return"LinkImageUI"}init(){const t=this.editor,e=t.editing.view.document;this.listenTo(e,"click",((e,n)=>{this._isSelectedLinkedImage(t.model.document.selection)&&(n.preventDefault(),e.stop())}),{priority:"high"}),this._createToolbarLinkImageButton()}_createToolbarLinkImageButton(){const t=this.editor,e=t.t;t.ui.componentFactory.add("linkImage",(n=>{const i=new ic(n),o=t.plugins.get("LinkUI"),r=t.commands.get("link");return i.set({isEnabled:!0,label:e("Link image"),icon:QC,keystroke:DC,tooltip:!0,isToggleable:!0}),i.bind("isEnabled").to(r,"isEnabled"),i.bind("isOn").to(r,"value",(t=>!!t)),this.listenTo(i,"execute",(()=>{this._isSelectedLinkedImage(t.model.document.selection)?o._addActionsView():o._showUI(!0)})),i}))}_isSelectedLinkedImage(t){const e=t.getSelectedElement();return this.editor.plugins.get("ImageUtils").isImage(e)&&e.hasAttribute("linkHref")}}var dy=__webpack_require__(3858),uy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(dy.Z,uy);dy.Z.locals;class hy extends e{static get requires(){return[sy,ly]}static get pluginName(){return"LinkImage"}}class my{constructor(t,e){this._startElement=t,this._referenceIndent=t.getAttribute("listIndent"),this._isForward="forward"==e.direction,this._includeSelf=!!e.includeSelf,this._sameAttributes=toArray(e.sameAttributes||[]),this._sameIndent=!!e.sameIndent,this._lowerIndent=!!e.lowerIndent,this._higherIndent=!!e.higherIndent}static first(t,e){const n=new this(t,e)[Symbol.iterator]();return first(n)}*[Symbol.iterator](){const t=[];for(const{node:e}of gy(this._getStartNode(),this._isForward?"forward":"backward")){const n=e.getAttribute("listIndent");if(nthis._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){t.push(e);continue}}else{if(!this._sameIndent){if(this._higherIndent){t.length&&(yield*t,t.length=0);break}continue}if(this._sameAttributes.some((t=>e.getAttribute(t)!==this._startElement.getAttribute(t))))break}t.length&&(yield*t,t.length=0),yield e}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}function*gy(t,e="forward"){const n="forward"==e;let i=null;for(;isListItemBlock(t);)yield{node:t,previous:i},i=t,t=n?t.nextSibling:t.previousSibling}class py{constructor(t){this._listHead=t}[Symbol.iterator](){return gy(this._listHead,"forward")}}var fy=__webpack_require__(8676),by={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(fy.Z,by);fy.Z.locals;function ky(t,e){const n=e.mapper,i=e.writer,o="numbered"==t.getAttribute("listType")?"ol":"ul",r=function(t){const e=t.createContainerElement("li");return e.getFillerOffset=Iy,e}(i),s=i.createContainerElement(o,null);return i.insert(i.createPositionAt(s,0),r),n.bindElements(t,r),r}function xy(t,e,n,i){const o=e.parent,r=n.mapper,s=n.writer;let a=r.toViewPosition(i.createPositionBefore(t));const c=Ay(t.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:t.getAttribute("listIndent")}),l=t.previousSibling;if(c&&c.getAttribute("listIndent")==t.getAttribute("listIndent")){const t=r.toViewElement(c);a=s.breakContainer(s.createPositionAfter(t))}else if(l&&"listItem"==l.name){a=r.toViewPosition(i.createPositionAt(l,"end"));const t=r.findMappedViewAncestor(a),e=Cy(t);a=e?s.createPositionBefore(e):s.createPositionAt(t,"end")}else a=r.toViewPosition(i.createPositionBefore(t));if(a=_y(a),s.insert(a,o),l&&"listItem"==l.name){const t=r.toViewElement(l),n=s.createRange(s.createPositionAt(t,0),a).getWalker({ignoreElementEnd:!0});for(const t of n)if(t.item.is("element","li")){const i=s.breakContainer(s.createPositionBefore(t.item)),o=t.item.parent,r=s.createPositionAt(e,"end");wy(s,r.nodeBefore,r.nodeAfter),s.move(s.createRangeOn(o),r),n.position=i}}else{const n=o.nextSibling;if(n&&(n.is("element","ul")||n.is("element","ol"))){let i=null;for(const e of n.getChildren()){const n=r.toModelElement(e);if(!(n&&n.getAttribute("listIndent")>t.getAttribute("listIndent")))break;i=e}i&&(s.breakContainer(s.createPositionAfter(i)),s.move(s.createRangeOn(i.parent),s.createPositionAt(e,"end")))}}wy(s,o,o.nextSibling),wy(s,o.previousSibling,o)}function wy(t,e,n){return!e||!n||"ul"!=e.name&&"ol"!=e.name||e.name!=n.name||e.getAttribute("class")!==n.getAttribute("class")?null:t.mergeContainers(t.createPositionAfter(e))}function _y(t){return t.getLastMatchingPosition((t=>t.item.is("uiElement")))}function Ay(t,e){const n=!!e.sameIndent,i=!!e.smallerIndent,o=e.listIndent;let r=t;for(;r&&"listItem"==r.name;){const t=r.getAttribute("listIndent");if(n&&o==t||i&&o>t)return r;r="forward"===e.direction?r.nextSibling:r.previousSibling}return null}function vy(t,e,n,i){t.ui.componentFactory.add(e,(o=>{const r=t.commands.get(e),s=new ic(o);return s.set({label:n,icon:i,tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.on("execute",(()=>{t.execute(e),t.editing.view.focus()})),s}))}function Cy(t){for(const e of t.getChildren())if("ul"==e.name||"ol"==e.name)return e;return null}function yy(t,e){const n=[],i=t.parent,o={ignoreElementEnd:!1,startPosition:t,shallow:!0,direction:e},r=i.getAttribute("listIndent"),s=[...new gi(o)].filter((t=>t.item.is("element"))).map((t=>t.item));for(const t of s){if(!t.is("element","listItem"))break;if(t.getAttribute("listIndent")r)){if(t.getAttribute("listType")!==i.getAttribute("listType"))break;if(t.getAttribute("listStyle")!==i.getAttribute("listStyle"))break;if(t.getAttribute("listReversed")!==i.getAttribute("listReversed"))break;if(t.getAttribute("listStart")!==i.getAttribute("listStart"))break;"backward"===e?n.unshift(t):n.push(t)}}return n}function Ey(t){let e=[...t.document.selection.getSelectedBlocks()].filter((t=>t.is("element","listItem"))).map((e=>{const n=t.change((t=>t.createPositionAt(e,0)));return[...yy(n,"backward"),...yy(n,"forward")]})).flat();return e=[...new Set(e)],e}const Ty=["disc","circle","square"],Dy=["decimal","decimal-leading-zero","lower-roman","upper-roman","lower-latin","upper-latin"];function Sy(t){return Ty.includes(t)?"bulleted":Dy.includes(t)?"numbered":null}function Iy(){const t=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||t?0:Yt.call(this)}const By='',My='';class Ny extends e{static get pluginName(){return"ListUI"}init(){const t=this.editor.t;vy(this.editor,"numberedList",t("Numbered List"),By),vy(this.editor,"bulletedList",t("Bulleted List"),My)}}const Oy={},Ry={},Py={},Ly=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"}];for(const{listStyle:t,typeAttribute:e,listType:n}of Ly)Oy[t]=n,Ry[t]=e,e&&(Py[e]=t);var zy=__webpack_require__(3195),jy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(zy.Z,jy);zy.Z.locals;class Fy extends Aa{constructor(t,e){super(t);const n=this.bindTemplate;this.set("isCollapsed",!1),this.set("label",""),this.buttonView=this._createButtonView(),this.children=this.createCollection(),this.set("_collapsibleAriaLabelUid"),e&&this.children.addMany(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-collapsible",n.if("isCollapsed","ck-collapsible_collapsed")]},children:[this.buttonView,{tag:"div",attributes:{class:["ck","ck-collapsible__children"],role:"region",hidden:n.if("isCollapsed","hidden"),"aria-labelledby":n.to("_collapsibleAriaLabelUid")},children:this.children}]})}render(){super.render(),this._collapsibleAriaLabelUid=this.buttonView.labelView.element.id}_createButtonView(){const t=new ic(this.locale),e=t.bindTemplate;return t.set({withText:!0,icon:pc}),t.extendTemplate({attributes:{"aria-expanded":e.to("isOn",(t=>String(t)))}}),t.bind("label").to(this),t.bind("isOn").to(this,"isCollapsed",(t=>!t)),t.on("execute",(()=>{this.isCollapsed=!this.isCollapsed})),t}}var Vy=__webpack_require__(7133),Uy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(Vy.Z,Uy);Vy.Z.locals;class Hy extends Aa{constructor(t,{enabledProperties:e,styleButtonViews:n,styleGridAriaLabel:i}){super(t);const o=["ck","ck-list-properties"];this.children=this.createCollection(),this.stylesView=null,this.additionalPropertiesCollapsibleView=null,this.startIndexFieldView=null,this.reversedSwitchButtonView=null,this.focusTracker=new jl.FocusTracker,this.keystrokes=new jl.KeystrokeHandler,this.focusables=new Js,this.focusCycler=new Cc({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),e.styles?(this.stylesView=this._createStylesView(n,i),this.children.add(this.stylesView)):o.push("ck-list-properties_without-styles"),(e.startIndex||e.reversed)&&(this._addNumberedListPropertyViews(e,n),o.push("ck-list-properties_with-numbered-properties")),this.setTemplate({tag:"div",attributes:{class:o},children:this.children})}render(){if(super.render(),this.stylesView){this.focusables.add(this.stylesView),this.focusTracker.add(this.stylesView.element),(this.startIndexFieldView||this.reversedSwitchButtonView)&&(this.focusables.add(this.children.last.buttonView),this.focusTracker.add(this.children.last.buttonView.element));for(const t of this.stylesView.children)this.stylesView.focusTracker.add(t.element);Ya({keystrokeHandler:this.stylesView.keystrokes,focusTracker:this.stylesView.focusTracker,gridItems:this.stylesView.children,numberOfColumns:()=>jl.global.window.getComputedStyle(this.stylesView.element).getPropertyValue("grid-template-columns").split(" ").length,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection})}if(this.startIndexFieldView){this.focusables.add(this.startIndexFieldView),this.focusTracker.add(this.startIndexFieldView.element),this.listenTo(this.startIndexFieldView.element,"selectstart",((t,e)=>{e.stopPropagation()}),{priority:"high"});const t=t=>t.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t)}this.reversedSwitchButtonView&&(this.focusables.add(this.reversedSwitchButtonView),this.focusTracker.add(this.reversedSwitchButtonView.element)),this.keystrokes.listenTo(this.element)}focus(){this.focusCycler.focusFirst()}focusLast(){this.focusCycler.focusLast()}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createStylesView(t,e){const n=new Aa(this.locale);return n.children=n.createCollection(this.locale),n.children.addMany(t),n.setTemplate({tag:"div",attributes:{"aria-label":e,class:["ck","ck-list-styles-list"]},children:n.children}),n.children.delegate("execute").to(this),n.focus=function(){this.children.first.focus()},n.focusTracker=new jl.FocusTracker,n.keystrokes=new jl.KeystrokeHandler,n.render(),n.keystrokes.listenTo(n.element),n}_addNumberedListPropertyViews(t){const e=this.locale.t,n=[];t.startIndex&&(this.startIndexFieldView=this._createStartIndexField(),n.push(this.startIndexFieldView)),t.reversed&&(this.reversedSwitchButtonView=this._createReversedSwitchButton(),n.push(this.reversedSwitchButtonView)),t.styles?(this.additionalPropertiesCollapsibleView=new Fy(this.locale,n),this.additionalPropertiesCollapsibleView.set({label:e("List properties"),isCollapsed:!0}),this.additionalPropertiesCollapsibleView.buttonView.bind("isEnabled").toMany(n,"isEnabled",((...t)=>t.some((t=>t)))),this.additionalPropertiesCollapsibleView.buttonView.on("change:isEnabled",((t,e,n)=>{n||(this.additionalPropertiesCollapsibleView.isCollapsed=!0)})),this.children.add(this.additionalPropertiesCollapsibleView)):this.children.addMany(n)}_createStartIndexField(){const t=this.locale.t,e=new pl(this.locale,bl);return e.set({label:t("Start at"),class:"ck-numbered-list-properties__start-index"}),e.fieldView.set({min:0,step:1,value:1,inputMode:"numeric"}),e.fieldView.on("input",(()=>{const n=e.fieldView.element,i=n.valueAsNumber;Number.isNaN(i)||(n.checkValidity()?this.fire("listStart",{startIndex:i}):e.errorText=t("Start index must be greater than 0."))})),e}_createReversedSwitchButton(){const t=this.locale.t,e=new sc(this.locale);return e.set({withText:!0,label:t("Reversed order"),class:"ck-numbered-list-properties__reversed-order"}),e.delegate("execute").to(this,"listReversed"),e}}var qy=__webpack_require__(4553),Wy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(qy.Z,Wy);qy.Z.locals;class Gy extends e{static get pluginName(){return"ListPropertiesUI"}init(){const t=this.editor,e=t.locale.t,n=t.config.get("list.properties");n.styles&&t.ui.componentFactory.add("bulletedList",Zy({editor:t,parentCommandName:"bulletedList",buttonLabel:e("Bulleted List"),buttonIcon:My,styleGridAriaLabel:e("Bulleted list styles toolbar"),styleDefinitions:[{label:e("Toggle the disc list style"),tooltip:e("Disc"),type:"disc",icon:''},{label:e("Toggle the circle list style"),tooltip:e("Circle"),type:"circle",icon:''},{label:e("Toggle the square list style"),tooltip:e("Square"),type:"square",icon:''}]})),(n.styles||n.startIndex||n.reversed)&&t.ui.componentFactory.add("numberedList",Zy({editor:t,parentCommandName:"numberedList",buttonLabel:e("Numbered List"),buttonIcon:By,styleGridAriaLabel:e("Numbered list styles toolbar"),styleDefinitions:[{label:e("Toggle the decimal list style"),tooltip:e("Decimal"),type:"decimal",icon:''},{label:e("Toggle the decimal with leading zero list style"),tooltip:e("Decimal with leading zero"),type:"decimal-leading-zero",icon:''},{label:e("Toggle the lower–roman list style"),tooltip:e("Lower–roman"),type:"lower-roman",icon:''},{label:e("Toggle the upper–roman list style"),tooltip:e("Upper-roman"),type:"upper-roman",icon:''},{label:e("Toggle the lower–latin list style"),tooltip:e("Lower-latin"),type:"lower-latin",icon:''},{label:e("Toggle the upper–latin list style"),tooltip:e("Upper-latin"),type:"upper-latin",icon:''}]}))}}function Zy({editor:t,parentCommandName:e,buttonLabel:n,buttonIcon:i,styleGridAriaLabel:o,styleDefinitions:r}){const s=t.commands.get(e);return a=>{const c=Gc(a,xc),l=c.buttonView;c.bind("isEnabled").to(s),c.class="ck-list-styles-dropdown",l.on("execute",(()=>{t.execute(e),t.editing.view.focus()})),l.set({label:n,icon:i,tooltip:!0,isToggleable:!0}),l.bind("isOn").to(s,"value",(t=>!!t));const d=function({editor:t,dropdownView:e,parentCommandName:n,styleDefinitions:i,styleGridAriaLabel:o}){const r=t.locale,s=t.config.get("list.properties");let a;"numberedList"!=n&&(s.startIndex=!1,s.reversed=!1);if(s.styles){const e=t.commands.get("listStyle"),o=function({editor:t,listStyleCommand:e,parentCommandName:n}){const i=t.locale,o=t.commands.get(n);return({label:n,type:r,icon:s,tooltip:a})=>{const c=new ic(i);return c.set({label:n,icon:s,tooltip:a}),e.on("change:value",(()=>{c.isOn=e.value===r})),c.on("execute",(()=>{o.value?e.value!==r?t.execute("listStyle",{type:r}):t.execute("listStyle",{type:e._defaultType}):t.model.change((()=>{t.execute("listStyle",{type:r})}))})),c}}({editor:t,parentCommandName:n,listStyleCommand:e}),r="function"==typeof e.isStyleTypeSupported?t=>e.isStyleTypeSupported(t.type):()=>!0;a=i.filter(r).map(o)}const c=new Hy(r,{styleGridAriaLabel:o,enabledProperties:s,styleButtonViews:a});s.styles&&$c(e,(()=>c.stylesView.children.find((t=>t.isOn))));if(s.startIndex){const e=t.commands.get("listStart");c.startIndexFieldView.bind("isEnabled").to(e),c.startIndexFieldView.fieldView.bind("value").to(e),c.on("listStart",((e,n)=>t.execute("listStart",n)))}if(s.reversed){const e=t.commands.get("listReversed");c.reversedSwitchButtonView.bind("isEnabled").to(e),c.reversedSwitchButtonView.bind("isOn").to(e,"value"),c.on("listReversed",(()=>{const n=e.value;t.execute("listReversed",{reversed:!n})}))}return c.delegate("execute").to(e),c}({editor:t,dropdownView:c,parentCommandName:e,styleGridAriaLabel:o,styleDefinitions:r});return c.panelView.children.add(d),c.on("execute",(()=>{t.editing.view.focus()})),c}}class Ky extends i{constructor(t,e){super(t),this.type=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,n=e.document,i=Array.from(n.selection.getSelectedBlocks()).filter((t=>Yy(t,e.schema))),o=void 0!==t.forceValue?!t.forceValue:this.value;e.change((t=>{if(o){let e=i[i.length-1].nextSibling,n=Number.POSITIVE_INFINITY,o=[];for(;e&&"listItem"==e.name&&0!==e.getAttribute("listIndent");){const t=e.getAttribute("listIndent");t=n;)r>o.getAttribute("listIndent")&&(r=o.getAttribute("listIndent")),o.getAttribute("listIndent")==r&&t[e?"unshift":"push"](o),o=o[e?"previousSibling":"nextSibling"]}}function Yy(t,e){return e.checkChild(t.parent,"listItem")&&!e.isObject(t)}class Jy extends i{constructor(t,e){super(t),this._indentBy="forward"==e?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document;let n=Array.from(e.selection.getSelectedBlocks());t.change((t=>{const e=n[n.length-1];let i=e.nextSibling;for(;i&&"listItem"==i.name&&i.getAttribute("listIndent")>e.getAttribute("listIndent");)n.push(i),i=i.nextSibling;this._indentBy<0&&(n=n.reverse());for(const e of n){const n=e.getAttribute("listIndent")+this._indentBy;n<0?t.rename(e,"paragraph"):t.setAttribute("listIndent",n,e)}this.fire("_executeCleanup",n)}))}_checkEnabled(){const t=(0,jl.first)(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is("element","listItem"))return!1;if(this._indentBy>0){const e=t.getAttribute("listIndent"),n=t.getAttribute("listType");let i=t.previousSibling;for(;i&&i.is("element","listItem")&&i.getAttribute("listIndent")>=e;){if(i.getAttribute("listIndent")==e)return i.getAttribute("listType")==n;i=i.previousSibling}return!1}return!0}}class Qy extends e{static get pluginName(){return"ListUtils"}getListTypeFromListStyleType(t){return Sy(t)}getSelectedListItems(t){return Ey(t)}getSiblingNodes(t,e){return yy(t,e)}}function Xy(t){return(e,n,i)=>{const o=i.consumable;if(!o.test(n.item,"insert")||!o.test(n.item,"attribute:listType")||!o.test(n.item,"attribute:listIndent"))return;o.consume(n.item,"insert"),o.consume(n.item,"attribute:listType"),o.consume(n.item,"attribute:listIndent");const r=n.item;xy(r,ky(r,i),i,t)}}function tE(t,e,n){if(!n.consumable.test(e.item,t.name))return;const i=n.mapper.toViewElement(e.item),o=n.writer;o.breakContainer(o.createPositionBefore(i)),o.breakContainer(o.createPositionAfter(i));const r=i.parent,s="numbered"==e.attributeNewValue?"ol":"ul";o.rename(s,r)}function eE(t,e,n){n.consumable.consume(e.item,t.name);const i=n.mapper.toViewElement(e.item).parent,o=n.writer;wy(o,i,i.nextSibling),wy(o,i.previousSibling,i)}function nE(t,e,n){if(n.consumable.test(e.item,t.name)&&"listItem"!=e.item.name){let t=n.mapper.toViewPosition(e.range.start);const i=n.writer,o=[];for(;("ul"==t.parent.name||"ol"==t.parent.name)&&(t=i.breakContainer(t),"li"==t.parent.name);){const e=t,n=i.createPositionAt(t.parent,"end");if(!e.isEqual(n)){const t=i.remove(i.createRange(e,n));o.push(t)}t=i.createPositionAfter(t.parent)}if(o.length>0){for(let e=0;e0){const e=wy(i,n,n.nextSibling);e&&e.parent==n&&t.offset--}}wy(i,t.nodeBefore,t.nodeAfter)}}}function iE(t,e,n){const i=n.mapper.toViewPosition(e.position),o=i.nodeBefore,r=i.nodeAfter;wy(n.writer,o,r)}function oE(t,e,n){if(n.consumable.consume(e.viewItem,{name:!0})){const t=n.writer,i=t.createElement("listItem"),o=function(t){let e=0,n=t.parent;for(;n;){if(n.is("element","li"))e++;else{const t=n.previousSibling;t&&t.is("element","li")&&e++}n=n.parent}return e}(e.viewItem);t.setAttribute("listIndent",o,i);const r=e.viewItem.parent&&"ol"==e.viewItem.parent.name?"numbered":"bulleted";if(t.setAttribute("listType",r,i),!n.safeInsert(i,e.modelCursor))return;const s=function(t,e,n){const{writer:i,schema:o}=n;let r=i.createPositionAfter(t);for(const s of e)if("ul"==s.name||"ol"==s.name)r=n.convertItem(s,r).modelCursor;else{const e=n.convertItem(s,i.createPositionAt(t,"end")),a=e.modelRange.start.nodeAfter;a&&a.is("element")&&!o.checkChild(t,a.name)&&(t=e.modelCursor.parent.is("element","listItem")?e.modelCursor.parent:lE(e.modelCursor),r=i.createPositionAfter(t))}return r}(i,e.viewItem.getChildren(),n);e.modelRange=t.createRange(e.modelCursor,s),n.updateConversionResult(i,e)}}function rE(t,e,n){if(n.consumable.test(e.viewItem,{name:!0})){const t=Array.from(e.viewItem.getChildren());for(const e of t){!(e.is("element","li")||uE(e))&&e._remove()}}}function sE(t,e,n){if(n.consumable.test(e.viewItem,{name:!0})){if(0===e.viewItem.childCount)return;const t=[...e.viewItem.getChildren()];let n=!1;for(const e of t)n&&!uE(e)&&e._remove(),uE(e)&&(n=!0)}}function aE(t){return(e,n)=>{if(n.isPhantom)return;const i=n.modelPosition.nodeBefore;if(i&&i.is("element","listItem")){const e=n.mapper.toViewElement(i),o=e.getAncestors().find(uE),r=t.createPositionAt(e,0).getWalker();for(const t of r){if("elementStart"==t.type&&t.item.is("element","li")){n.viewPosition=t.previousPosition;break}if("elementEnd"==t.type&&t.item==o){n.viewPosition=t.nextPosition;break}}}}}function cE(t,[e,n,i]){let o,r=e.is("documentFragment")?e.getChild(0):e;if(o=n?this.createSelection(n,i):this.document.selection,r&&r.is("element","listItem")){const t=o.getFirstPosition();let e=null;if(t.parent.is("element","listItem")?e=t.parent:t.nodeBefore&&t.nodeBefore.is("element","listItem")&&(e=t.nodeBefore),e){const t=e.getAttribute("listIndent");if(t>0)for(;r&&r.is("element","listItem");)r._setAttribute("listIndent",r.getAttribute("listIndent")+t),r=r.nextSibling}}}function lE(t){const e=new gi({startPosition:t});let n;do{n=e.next()}while(!n.value.item.is("element","listItem"));return n.value.item}function dE(t,e,n,i,o,r){const s=Ay(e.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:t,foo:"b"}),a=o.mapper,c=o.writer,l=s?s.getAttribute("listIndent"):null;let d;if(s)if(l==t){const t=a.toViewElement(s).parent;d=c.createPositionAfter(t)}else{const t=r.createPositionAt(s,"end");d=a.toViewPosition(t)}else d=n;d=_y(d);for(const t of[...i.getChildren()])uE(t)&&(d=c.move(c.createRangeOn(t),d).end,wy(c,t,t.nextSibling),wy(c,t.previousSibling,t))}function uE(t){return t.is("element","ol")||t.is("element","ul")}class hE extends e{static get pluginName(){return"ListEditing"}static get requires(){return[ih,Fd,Qy]}init(){const t=this.editor;t.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const e=t.data,n=t.editing;var i;t.model.document.registerPostFixer((e=>function(t,e){const n=t.document.differ.getChanges(),i=new Map;let o=!1;for(const i of n)if("insert"==i.type&&"listItem"==i.name)r(i.position);else if("insert"==i.type&&"listItem"!=i.name){if("$text"!=i.name){const n=i.position.nodeAfter;n.hasAttribute("listIndent")&&(e.removeAttribute("listIndent",n),o=!0),n.hasAttribute("listType")&&(e.removeAttribute("listType",n),o=!0),n.hasAttribute("listStyle")&&(e.removeAttribute("listStyle",n),o=!0),n.hasAttribute("listReversed")&&(e.removeAttribute("listReversed",n),o=!0),n.hasAttribute("listStart")&&(e.removeAttribute("listStart",n),o=!0);for(const e of Array.from(t.createRangeIn(n)).filter((t=>t.item.is("element","listItem"))))r(e.previousPosition)}r(i.position.getShiftedBy(i.length))}else"remove"==i.type&&"listItem"==i.name?r(i.position):("attribute"==i.type&&"listIndent"==i.attributeKey||"attribute"==i.type&&"listType"==i.attributeKey)&&r(i.range.start);for(const t of i.values())s(t),a(t);return o;function r(t){const e=t.nodeBefore;if(e&&e.is("element","listItem")){let t=e;if(i.has(t))return;for(let e=t.previousSibling;e&&e.is("element","listItem");e=t.previousSibling)if(t=e,i.has(t))return;i.set(e,t)}else{const e=t.nodeAfter;e&&e.is("element","listItem")&&i.set(e,e)}}function s(t){let n=0,i=null;for(;t&&t.is("element","listItem");){const r=t.getAttribute("listIndent");if(r>n){let s;null===i?(i=r-n,s=n):(i>r&&(i=r),s=r-i),e.setAttribute("listIndent",s,t),o=!0}else i=null,n=t.getAttribute("listIndent")+1;t=t.nextSibling}}function a(t){let n=[],i=null;for(;t&&t.is("element","listItem");){const r=t.getAttribute("listIndent");if(i&&i.getAttribute("listIndent")>r&&(n=n.slice(0,r+1)),0!=r)if(n[r]){const i=n[r];t.getAttribute("listType")!=i&&(e.setAttribute("listType",i,t),o=!0)}else n[r]=t.getAttribute("listType");i=t,t=t.nextSibling}}}(t.model,e))),n.mapper.registerViewToModelLength("li",mE),e.mapper.registerViewToModelLength("li",mE),n.mapper.on("modelToViewPosition",aE(n.view)),n.mapper.on("viewToModelPosition",(i=t.model,(t,e)=>{const n=e.viewPosition,o=n.parent,r=e.mapper;if("ul"==o.name||"ol"==o.name){if(n.isAtEnd){const t=r.toModelElement(n.nodeBefore),o=r.getModelLength(n.nodeBefore);e.modelPosition=i.createPositionBefore(t).getShiftedBy(o)}else{const t=r.toModelElement(n.nodeAfter);e.modelPosition=i.createPositionBefore(t)}t.stop()}else if("li"==o.name&&n.nodeBefore&&("ul"==n.nodeBefore.name||"ol"==n.nodeBefore.name)){const s=r.toModelElement(o);let a=1,c=n.nodeBefore;for(;c&&uE(c);)a+=r.getModelLength(c),c=c.previousSibling;e.modelPosition=i.createPositionBefore(s).getShiftedBy(a),t.stop()}})),e.mapper.on("modelToViewPosition",aE(n.view)),t.conversion.for("editingDowncast").add((e=>{e.on("insert",nE,{priority:"high"}),e.on("insert:listItem",Xy(t.model)),e.on("attribute:listType:listItem",tE,{priority:"high"}),e.on("attribute:listType:listItem",eE,{priority:"low"}),e.on("attribute:listIndent:listItem",function(t){return(e,n,i)=>{if(!i.consumable.consume(n.item,"attribute:listIndent"))return;const o=i.mapper.toViewElement(n.item),r=i.writer;r.breakContainer(r.createPositionBefore(o)),r.breakContainer(r.createPositionAfter(o));const s=o.parent,a=s.previousSibling,c=r.createRangeOn(s);r.remove(c),a&&a.nextSibling&&wy(r,a,a.nextSibling),dE(n.attributeOldValue+1,n.range.start,c.start,o,i,t),xy(n.item,o,i,t);for(const t of n.item.getChildren())i.consumable.consume(t,"insert")}}(t.model)),e.on("remove:listItem",function(t){return(e,n,i)=>{const o=i.mapper.toViewPosition(n.position).getLastMatchingPosition((t=>!t.item.is("element","li"))).nodeAfter,r=i.writer;r.breakContainer(r.createPositionBefore(o)),r.breakContainer(r.createPositionAfter(o));const s=o.parent,a=s.previousSibling,c=r.createRangeOn(s),l=r.remove(c);a&&a.nextSibling&&wy(r,a,a.nextSibling),dE(i.mapper.toModelElement(o).getAttribute("listIndent")+1,n.position,c.start,o,i,t);for(const t of r.createRangeIn(l).getItems())i.mapper.unbindViewElement(t);e.stop()}}(t.model)),e.on("remove",iE,{priority:"low"})})),t.conversion.for("dataDowncast").add((e=>{e.on("insert",nE,{priority:"high"}),e.on("insert:listItem",Xy(t.model))})),t.conversion.for("upcast").add((t=>{t.on("element:ul",rE,{priority:"high"}),t.on("element:ol",rE,{priority:"high"}),t.on("element:li",sE,{priority:"high"}),t.on("element:li",oE)})),t.model.on("insertContent",cE,{priority:"high"}),t.commands.add("numberedList",new Ky(t,"numbered")),t.commands.add("bulletedList",new Ky(t,"bulleted")),t.commands.add("indentList",new Jy(t,"forward")),t.commands.add("outdentList",new Jy(t,"backward"));const o=n.view.document;this.listenTo(o,"enter",((t,e)=>{const n=this.editor.model.document,i=n.selection.getLastPosition().parent;n.selection.isCollapsed&&"listItem"==i.name&&i.isEmpty&&(this.editor.execute("outdentList"),e.preventDefault(),t.stop())}),{context:"li"}),this.listenTo(o,"delete",((t,e)=>{if("backward"!==e.direction)return;const n=this.editor.model.document.selection;if(!n.isCollapsed)return;const i=n.getFirstPosition();if(!i.isAtStart)return;const o=i.parent;if("listItem"!==o.name)return;o.previousSibling&&"listItem"===o.previousSibling.name||(this.editor.execute("outdentList"),e.preventDefault(),t.stop())}),{context:"li"}),this.listenTo(t.editing.view.document,"tab",((e,n)=>{const i=n.shiftKey?"outdentList":"indentList";this.editor.commands.get(i).isEnabled&&(t.execute(i),n.stopPropagation(),n.preventDefault(),e.stop())}),{context:"li"})}afterInit(){const t=this.editor.commands,e=t.get("indent"),n=t.get("outdent");e&&e.registerChildCommand(t.get("indentList")),n&&n.registerChildCommand(t.get("outdentList"))}}function mE(t){let e=1;for(const n of t.getChildren())if("ul"==n.name||"ol"==n.name)for(const t of n.getChildren())e+=mE(t);return e}class gE extends e{static get requires(){return[hE,Ny]}static get pluginName(){return"List"}}class pE extends i{constructor(t,e){super(t),this._defaultType=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){this._tryToConvertItemsToList(t);const e=this.editor.model,n=Ey(e);n.length&&e.change((e=>{for(const i of n)e.setAttribute("listStyle",t.type||this._defaultType,i)}))}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")?t.getAttribute("listStyle"):null}_checkEnabled(){const t=this.editor,e=t.commands.get("numberedList"),n=t.commands.get("bulletedList");return e.isEnabled||n.isEnabled}_tryToConvertItemsToList(t){if(!t.type)return;const e=Sy(t.type);if(!e)return;const n=this.editor,i=e+"List";n.commands.get(i).value||n.execute(i)}}class fE extends i{refresh(){const t=this._getValue();this.value=t,this.isEnabled=null!=t}execute(t={}){const e=this.editor.model,n=Ey(e).filter((t=>"numbered"==t.getAttribute("listType")));e.change((e=>{for(const i of n)e.setAttribute("listReversed",!!t.reversed,i)}))}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")&&"numbered"==t.getAttribute("listType")?t.getAttribute("listReversed"):null}}class bE extends i{refresh(){const t=this._getValue();this.value=t,this.isEnabled=null!=t}execute(t={}){const e=this.editor.model,n=Ey(e).filter((t=>"numbered"==t.getAttribute("listType")));e.change((e=>{for(const i of n)e.setAttribute("listStart",t.startIndex>=0?t.startIndex:1,i)}))}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")&&"numbered"==t.getAttribute("listType")?t.getAttribute("listStart"):null}}const kE="default";class xE extends e{static get requires(){return[hE]}static get pluginName(){return"ListPropertiesEditing"}constructor(t){super(t),t.config.define("list",{properties:{styles:!0,startIndex:!1,reversed:!1}})}init(){const t=this.editor,e=t.model,n=function(t){const e=[];t.styles&&e.push({attributeName:"listStyle",defaultValue:kE,addCommand(t){t.commands.add("listStyle",new pE(t,kE))},appliesToListItem:()=>!0,setAttributeOnDowncast(t,e,n){e&&e!==kE?t.setStyle("list-style-type",e,n):t.removeStyle("list-style-type",n)},getAttributeOnUpcast:t=>t.getStyle("list-style-type")||kE});t.reversed&&e.push({attributeName:"listReversed",defaultValue:!1,addCommand(t){t.commands.add("listReversed",new fE(t))},appliesToListItem:t=>"numbered"==t.getAttribute("listType"),setAttributeOnDowncast(t,e,n){e?t.setAttribute("reversed","reversed",n):t.removeAttribute("reversed",n)},getAttributeOnUpcast:t=>t.hasAttribute("reversed")});t.startIndex&&e.push({attributeName:"listStart",defaultValue:1,addCommand(t){t.commands.add("listStart",new bE(t))},appliesToListItem:t=>"numbered"==t.getAttribute("listType"),setAttributeOnDowncast(t,e,n){0==e||e>1?t.setAttribute("start",e,n):t.removeAttribute("start",n)},getAttributeOnUpcast(t){const e=t.getAttribute("start");return e>=0?e:1}});return e}(t.config.get("list.properties"));e.schema.extend("listItem",{allowAttributes:n.map((t=>t.attributeName))});for(const e of n)e.addCommand(t);var i;this.listenTo(t.commands.get("indentList"),"_executeCleanup",function(t,e){return(n,i)=>{const o=i[0],r=o.getAttribute("listIndent"),s=i.filter((t=>t.getAttribute("listIndent")===r));let a=null;o.previousSibling.getAttribute("listIndent")+1!==r&&(a=Ay(o.previousSibling,{sameIndent:!0,direction:"backward",listIndent:r})),t.model.change((t=>{for(const n of s)for(const i of e)if(i.appliesToListItem(n)){const e=null==a?i.defaultValue:a.getAttribute(i.attributeName);t.setAttribute(i.attributeName,e,n)}}))}}(t,n)),this.listenTo(t.commands.get("outdentList"),"_executeCleanup",function(t,e){return(n,i)=>{if(!(i=i.reverse().filter((t=>t.is("element","listItem")))).length)return;const o=i[0].getAttribute("listIndent"),r=i[0].getAttribute("listType");let s=i[0].previousSibling;if(s.is("element","listItem"))for(;s.getAttribute("listIndent")!==o;)s=s.previousSibling;else s=null;s||(s=i[i.length-1].nextSibling),s&&s.is("element","listItem")&&s.getAttribute("listType")===r&&t.model.change((t=>{const n=i.filter((t=>t.getAttribute("listIndent")===o));for(const i of n)for(const n of e)if(n.appliesToListItem(i)){const e=n.attributeName,o=s.getAttribute(e);t.setAttribute(e,o,i)}}))}}(t,n)),this.listenTo(t.commands.get("bulletedList"),"_executeCleanup",AE(t)),this.listenTo(t.commands.get("numberedList"),"_executeCleanup",AE(t)),e.document.registerPostFixer(function(t,e){return n=>{let i=!1;const o=vE(t.model.document.differ.getChanges()).filter((t=>"todo"!==t.getAttribute("listType")));if(!o.length)return i;let r=o[o.length-1].nextSibling;if((!r||!r.is("element","listItem"))&&(r=o[0].previousSibling,r)){const t=o[0].getAttribute("listIndent");for(;r.is("element","listItem")&&r.getAttribute("listIndent")!==t&&(r=r.previousSibling,r););}for(const t of e){const e=t.attributeName;for(const s of o)if(t.appliesToListItem(s))if(s.hasAttribute(e)){const o=s.previousSibling;_E(o,s,t.attributeName)&&(n.setAttribute(e,o.getAttribute(e),s),i=!0)}else wE(r,s,t)?n.setAttribute(e,r.getAttribute(e),s):n.setAttribute(e,t.defaultValue,s),i=!0;else n.removeAttribute(e,s)}return i}}(t,n)),t.conversion.for("upcast").add((i=n,t=>{t.on("element:li",((t,e,n)=>{const o=e.viewItem.parent,r=e.modelRange.start.nodeAfter||e.modelRange.end.nodeBefore;for(const t of i)if(t.appliesToListItem(r)){const e=t.getAttributeOnUpcast(o);n.writer.setAttribute(t.attributeName,e,r)}}),{priority:"low"})})),t.conversion.for("downcast").add(function(t){return n=>{for(const i of t)n.on(`attribute:${i.attributeName}:listItem`,((t,n,o)=>{const r=o.writer,s=n.item,a=Ay(s.previousSibling,{sameIndent:!0,listIndent:s.getAttribute("listIndent"),direction:"backward"}),c=o.mapper.toViewElement(s);e(s,a)||r.breakContainer(r.createPositionBefore(c)),i.setAttributeOnDowncast(r,n.attributeNewValue,c.parent)}),{priority:"low"})};function e(t,e){return e&&t.getAttribute("listType")===e.getAttribute("listType")&&t.getAttribute("listIndent")===e.getAttribute("listIndent")&&t.getAttribute("listStyle")===e.getAttribute("listStyle")&&t.getAttribute("listReversed")===e.getAttribute("listReversed")&&t.getAttribute("listStart")===e.getAttribute("listStart")}}(n)),this._mergeListAttributesWhileMergingLists(n)}afterInit(){const t=this.editor;t.commands.get("todoList")&&t.model.document.registerPostFixer(function(t){return e=>{const n=vE(t.model.document.differ.getChanges()).filter((t=>"todo"===t.getAttribute("listType")&&(t.hasAttribute("listStyle")||t.hasAttribute("listReversed")||t.hasAttribute("listStart"))));if(!n.length)return!1;for(const t of n)e.removeAttribute("listStyle",t),e.removeAttribute("listReversed",t),e.removeAttribute("listStart",t);return!0}}(t))}_mergeListAttributesWhileMergingLists(t){const e=this.editor.model;let n;this.listenTo(e,"deleteContent",((t,[e])=>{const i=e.getFirstPosition(),o=e.getLastPosition();if(i.parent===o.parent)return;if(!i.parent.is("element","listItem"))return;const r=o.parent.nextSibling;if(!r||!r.is("element","listItem"))return;const s=Ay(i.parent,{sameIndent:!0,listIndent:r.getAttribute("listIndent")});s&&s.getAttribute("listType")===r.getAttribute("listType")&&(n=s)}),{priority:"high"}),this.listenTo(e,"deleteContent",(()=>{n&&(e.change((e=>{const i=Ay(n.nextSibling,{sameIndent:!0,listIndent:n.getAttribute("listIndent"),direction:"forward"});if(!i)return void(n=null);const o=[i,...yy(e.createPositionAt(i,0),"forward")];for(const i of o)for(const o of t)if(o.appliesToListItem(i)){const t=o.attributeName,r=n.getAttribute(t);e.setAttribute(t,r,i)}})),n=null)}),{priority:"low"})}}function wE(t,e,n){if(!t)return!1;const i=t.getAttribute(n.attributeName);return!!i&&(i!=n.defaultValue&&t.getAttribute("listType")===e.getAttribute("listType"))}function _E(t,e,n){if(!t||!t.is("element","listItem"))return!1;if(e.getAttribute("listType")!==t.getAttribute("listType"))return!1;const i=t.getAttribute("listIndent");if(i<1||i!==e.getAttribute("listIndent"))return!1;const o=t.getAttribute(n);return!(!o||o===e.getAttribute(n))}function AE(t){return(e,n)=>{n=n.filter((t=>t.is("element","listItem"))),t.model.change((t=>{for(const e of n)t.removeAttribute("listStyle",e)}))}}function vE(t){const e=[];for(const n of t){const t=CE(n);t&&t.is("element","listItem")&&e.push(t)}return e}function CE(t){return"attribute"===t.type?t.range.start.nodeAfter:"insert"===t.type?t.position.nodeAfter:null}class yE extends e{static get requires(){return[xE,Gy]}static get pluginName(){return"ListProperties"}}const EE="todoListChecked";class TE extends i{constructor(t){super(t),this._selectedElements=[],this.on("execute",(()=>{this.refresh()}),{priority:"highest"})}refresh(){this._selectedElements=this._getSelectedItems(),this.value=this._selectedElements.every((t=>!!t.getAttribute("todoListChecked"))),this.isEnabled=!!this._selectedElements.length}_getSelectedItems(){const t=this.editor.model,e=t.schema,n=t.document.selection.getFirstRange(),i=n.start.parent,o=[];e.checkAttribute(i,EE)&&o.push(i);for(const t of n.getItems())e.checkAttribute(t,EE)&&!o.includes(t)&&o.push(t);return o}execute(t={}){this.editor.model.change((e=>{for(const n of this._selectedElements){(void 0===t.forceValue?!this.value:t.forceValue)?e.setAttribute(EE,!0,n):e.removeAttribute(EE,n)}}))}}function DE(t,e,n){const i=e.modelCursor,o=i.parent,r=e.viewItem;if("checkbox"!=r.getAttribute("type")||"listItem"!=o.name||!i.isAtStart)return;if(!n.consumable.consume(r,{name:!0}))return;const s=n.writer;s.setAttribute("listType","todo",o),e.viewItem.hasAttribute("checked")&&s.setAttribute("todoListChecked",!0,o),e.modelRange=s.createRange(i)}function SE(t){return(e,n)=>{const i=n.modelPosition,o=i.parent;if(!o.is("element","listItem")||"todo"!=o.getAttribute("listType"))return;const r=BE(n.mapper.toViewElement(o),t);r&&(n.viewPosition=n.mapper.findPositionIn(r,i.offset))}}function IE(t,e,n,i){return e.createUIElement("label",{class:"todo-list__label",contenteditable:!1},(function(e){const o=(0,jl.createElement)(document,"input",{type:"checkbox",tabindex:-1});n&&o.setAttribute("checked","checked"),o.addEventListener("change",(()=>i(t)));const r=this.toDomElement(e);return r.appendChild(o),r}))}function BE(t,e){const n=e.createRangeIn(t);for(const t of n)if(t.item.is("containerElement","span")&&t.item.hasClass("todo-list__label__description"))return t.item}const ME=(0,jl.parseKeystroke)("Ctrl+Enter");class NE extends e{static get pluginName(){return"TodoListEditing"}static get requires(){return[hE]}init(){const t=this.editor,{editing:e,data:n,model:i}=t;i.schema.extend("listItem",{allowAttributes:["todoListChecked"]}),i.schema.addAttributeCheck(((t,e)=>{const n=t.last;if("todoListChecked"==e&&"listItem"==n.name&&"todo"!=n.getAttribute("listType"))return!1})),t.commands.add("todoList",new Ky(t,"todo"));const o=new TE(t);var r,s;t.commands.add("checkTodoList",o),t.commands.add("todoListCheck",o),n.downcastDispatcher.on("insert:listItem",function(t){return(e,n,i)=>{const o=i.consumable;if(!o.test(n.item,"insert")||!o.test(n.item,"attribute:listType")||!o.test(n.item,"attribute:listIndent"))return;if("todo"!=n.item.getAttribute("listType"))return;const r=n.item;o.consume(r,"insert"),o.consume(r,"attribute:listType"),o.consume(r,"attribute:listIndent"),o.consume(r,"attribute:todoListChecked");const s=i.writer,a=ky(r,i);s.addClass("todo-list",a.parent);const c=s.createContainerElement("label",{class:"todo-list__label"}),l=s.createEmptyElement("input",{type:"checkbox",disabled:"disabled"}),d=s.createContainerElement("span",{class:"todo-list__label__description"});r.getAttribute("todoListChecked")&&s.setAttribute("checked","checked",l),s.insert(s.createPositionAt(a,0),c),s.insert(s.createPositionAt(c,0),l),s.insert(s.createPositionAfter(l),d),xy(r,a,i,t)}}(i),{priority:"high"}),n.upcastDispatcher.on("element:input",DE,{priority:"high"}),e.downcastDispatcher.on("insert:listItem",function(t,e){return(n,i,o)=>{const r=o.consumable;if(!r.test(i.item,"insert")||!r.test(i.item,"attribute:listType")||!r.test(i.item,"attribute:listIndent"))return;if("todo"!=i.item.getAttribute("listType"))return;const s=i.item;r.consume(s,"insert"),r.consume(s,"attribute:listType"),r.consume(s,"attribute:listIndent"),r.consume(s,"attribute:todoListChecked");const a=o.writer,c=ky(s,o),l=!!s.getAttribute("todoListChecked"),d=IE(s,a,l,e),u=a.createContainerElement("span",{class:"todo-list__label__description"});a.addClass("todo-list",c.parent),a.insert(a.createPositionAt(c,0),d),a.insert(a.createPositionAfter(d),u),xy(s,c,o,t)}}(i,(t=>this._handleCheckmarkChange(t))),{priority:"high"}),e.downcastDispatcher.on("attribute:listType:listItem",(r=t=>this._handleCheckmarkChange(t),s=e.view,(t,e,n)=>{if(!n.consumable.consume(e.item,t.name))return;const i=n.mapper.toViewElement(e.item),o=n.writer,a=function(t,e){const n=e.createRangeIn(t);for(const t of n)if(t.item.is("uiElement","label"))return t.item}(i,s);if("todo"==e.attributeNewValue){const t=!!e.item.getAttribute("todoListChecked"),n=IE(e.item,o,t,r),s=o.createContainerElement("span",{class:"todo-list__label__description"}),a=o.createRangeIn(i),c=Cy(i),l=_y(a.start),d=c?o.createPositionBefore(c):a.end,u=o.createRange(l,d);o.addClass("todo-list",i.parent),o.move(u,o.createPositionAt(s,0)),o.insert(o.createPositionAt(i,0),n),o.insert(o.createPositionAfter(n),s)}else if("todo"==e.attributeOldValue){const t=BE(i,s);o.removeClass("todo-list",i.parent),o.remove(a),o.move(o.createRangeIn(t),o.createPositionBefore(t)),o.remove(t)}})),e.downcastDispatcher.on("attribute:todoListChecked:listItem",function(t){return(e,n,i)=>{if("todo"!=n.item.getAttribute("listType"))return;if(!i.consumable.consume(n.item,"attribute:todoListChecked"))return;const{mapper:o,writer:r}=i,s=!!n.item.getAttribute("todoListChecked"),a=o.toViewElement(n.item).getChild(0),c=IE(n.item,r,s,t);r.insert(r.createPositionAfter(a),c),r.remove(a)}}((t=>this._handleCheckmarkChange(t)))),e.mapper.on("modelToViewPosition",SE(e.view)),n.mapper.on("modelToViewPosition",SE(e.view)),this.listenTo(e.view.document,"arrowKey",function(t,e){return(n,i)=>{if("left"!=(0,jl.getLocalizedArrowKeyCodeDirection)(i.keyCode,e.contentLanguageDirection))return;const o=t.schema,r=t.document.selection;if(!r.isCollapsed)return;const s=r.getFirstPosition(),a=s.parent;if("listItem"===a.name&&"todo"==a.getAttribute("listType")&&s.isAtStart){const e=o.getNearestSelectionRange(t.createPositionBefore(a),"backward");e&&t.change((t=>t.setSelection(e))),i.preventDefault(),i.stopPropagation(),n.stop()}}}(i,t.locale),{context:"li"}),this.listenTo(e.view.document,"keydown",((e,n)=>{(0,jl.getCode)(n)===ME&&(t.execute("checkTodoList"),e.stop())}),{priority:"high"});const a=new Set;this.listenTo(i,"applyOperation",((t,e)=>{const n=e[0];if("rename"==n.type&&"listItem"==n.oldName){const t=n.position.nodeAfter;t.hasAttribute("todoListChecked")&&a.add(t)}else if("changeAttribute"==n.type&&"listType"==n.key&&"todo"===n.oldValue)for(const t of n.range.getItems())t.hasAttribute("todoListChecked")&&"todo"!==t.getAttribute("listType")&&a.add(t)})),i.document.registerPostFixer((t=>{let e=!1;for(const n of a)t.removeAttribute("todoListChecked",n),e=!0;return a.clear(),e}))}_handleCheckmarkChange(t){const e=this.editor,n=e.model,i=Array.from(n.document.selection.getRanges());n.change((n=>{n.setSelection(t,"end"),e.execute("checkTodoList"),n.setSelection(i)}))}}class OE extends e{static get pluginName(){return"TodoListUI"}init(){const t=this.editor.t;vy(this.editor,"todoList",t("To-do List"),'')}}var RE=__webpack_require__(1588),PE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(RE.Z,PE);RE.Z.locals;class LE extends e{static get requires(){return[NE,OE]}static get pluginName(){return"TodoList"}}function zE(t,e){return t=>{t.on("attribute:url:media",n)};function n(n,i,o){if(!o.consumable.consume(i.item,n.name))return;const r=i.attributeNewValue,s=o.writer,a=o.mapper.toViewElement(i.item),c=[...a.getChildren()].find((t=>t.getCustomProperty("media-content")));s.remove(c);const l=t.getMediaViewElement(s,r,e);s.insert(s.createPositionAt(a,0),l)}}function jE(t,e,n,i){return t.createContainerElement("figure",{class:"media"},[e.getMediaViewElement(t,n,i),t.createSlot()])}function FE(t){const e=t.getSelectedElement();return e&&e.is("element","media")?e:null}function VE(t,e,n,i){t.change((o=>{const r=o.createElement("media",{url:e});t.insertObject(r,n,null,{setSelection:"on",findOptimalPosition:i})}))}class UE extends i{refresh(){const t=this.editor.model,e=t.document.selection,n=FE(e);this.value=n?n.getAttribute("url"):null,this.isEnabled=function(t){const e=t.getSelectedElement();return!!e&&"media"===e.name}(e)||function(t,e){const n=Lf(t,e);let i=n.start.parent;i.isEmpty&&!e.schema.isLimit(i)&&(i=i.parent);return e.schema.checkChild(i,"media")}(e,t)}execute(t){const e=this.editor.model,n=e.document.selection,i=FE(n);i?e.change((e=>{e.setAttribute("url",t,i)})):VE(e,t,n,!0)}}class HE{constructor(t,e){const n=e.providers,i=e.extraProviders||[],o=new Set(e.removeProviders),r=n.concat(i).filter((t=>{const e=t.name;return e?!o.has(e):((0,jl.logWarning)("media-embed-no-provider-name",{provider:t}),!1)}));this.locale=t,this.providerDefinitions=r}hasMedia(t){return!!this._getMedia(t)}getMediaViewElement(t,e,n){return this._getMedia(e).getViewElement(t,n)}_getMedia(t){if(!t)return new qE(this.locale);t=t.trim();for(const e of this.providerDefinitions){const n=e.html,i=(0,jl.toArray)(e.url);for(const e of i){const i=this._getUrlMatches(t,e);if(i)return new qE(this.locale,t,i,n)}}return null}_getUrlMatches(t,e){let n=t.match(e);if(n)return n;let i=t.replace(/^https?:\/\//,"");return n=i.match(e),n||(i=i.replace(/^www\./,""),n=i.match(e),n||null)}}class qE{constructor(t,e,n,i){this.url=this._getValidUrl(e),this._locale=t,this._match=n,this._previewRenderer=i}getViewElement(t,e){const n={};let i;if(e.renderForEditingView||e.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(n["data-oembed-url"]=this.url),e.renderForEditingView&&(n.class="ck-media__wrapper");const o=this._getPreviewHtml(e);i=t.createRawElement("div",n,((t,e)=>{e.setContentOf(t,o)}))}else this.url&&(n.url=this.url),i=t.createEmptyElement(e.elementName,n);return t.setCustomProperty("media-content",!0,i),i}_getPreviewHtml(t){return this._previewRenderer?this._previewRenderer(this._match):this.url&&t.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const t=new tc,e=this._locale.t;t.content='',t.viewBox="0 0 64 42";return new Xs({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[t]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url,"data-cke-tooltip-text":e("Open media in new tab")},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]}]}]}).render().outerHTML}_getValidUrl(t){return t?t.match(/^https?/)?t:"https://"+t:null}}var WE=__webpack_require__(952),GE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(WE.Z,GE);WE.Z.locals;class ZE extends e{static get pluginName(){return"MediaEmbedEditing"}constructor(t){super(t),t.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:/^dailymotion\.com\/video\/(\w+)/,html:t=>``},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:t=>``},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)(?:&t=(\d+))?/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)(?:\?t=(\d+))?/,/^youtube\.com\/embed\/([\w-]+)(?:\?start=(\d+))?/,/^youtu\.be\/([\w-]+)(?:\?t=(\d+))?/],html:t=>{const e=t[1],n=t[2];return``}},{name:"vimeo",url:[/^vimeo\.com\/(\d+)/,/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/channels\/[^/]+\/(\d+)/,/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,/^player\.vimeo\.com\/video\/(\d+)/],html:t=>``},{name:"instagram",url:/^instagram\.com\/p\/(\w+)/},{name:"twitter",url:/^twitter\.com/},{name:"googleMaps",url:[/^google\.com\/maps/,/^goo\.gl\/maps/,/^maps\.google\.com/,/^maps\.app\.goo\.gl/]},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]}),this.registry=new HE(t.locale,t.config.get("mediaEmbed"))}init(){const t=this.editor,e=t.model.schema,n=t.t,i=t.conversion,o=t.config.get("mediaEmbed.previewsInData"),r=t.config.get("mediaEmbed.elementName"),s=this.registry;t.commands.add("mediaEmbed",new UE(t)),e.register("media",{inheritAllFrom:"$blockObject",allowAttributes:["url"]}),i.for("dataDowncast").elementToStructure({model:"media",view:(t,{writer:e})=>{const n=t.getAttribute("url");return jE(e,s,n,{elementName:r,renderMediaPreview:n&&o})}}),i.for("dataDowncast").add(zE(s,{elementName:r,renderMediaPreview:o})),i.for("editingDowncast").elementToStructure({model:"media",view:(t,{writer:e})=>{const i=t.getAttribute("url");return function(t,e,n){return e.setCustomProperty("media",!0,t),Mf(t,e,{label:n})}(jE(e,s,i,{elementName:r,renderForEditingView:!0}),e,n("media widget"))}}),i.for("editingDowncast").add(zE(s,{elementName:r,renderForEditingView:!0})),i.for("upcast").elementToElement({view:t=>["oembed",r].includes(t.name)&&t.getAttribute("url")?{name:!0}:null,model:(t,{writer:e})=>{const n=t.getAttribute("url");if(s.hasMedia(n))return e.createElement("media",{url:n})}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(t,{writer:e})=>{const n=t.getAttribute("data-oembed-url");if(s.hasMedia(n))return e.createElement("media",{url:n})}}).add((t=>{t.on("element:figure",(function(t,e,n){if(!n.consumable.consume(e.viewItem,{name:!0,classes:"media"}))return;const{modelRange:i,modelCursor:o}=n.convertChildren(e.viewItem,e.modelCursor);e.modelRange=i,e.modelCursor=o;(0,jl.first)(i.getItems())||n.consumable.revert(e.viewItem,{name:!0,classes:"media"})}))}))}}const KE=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class $E extends e{static get requires(){return[wb,Fd,Pb]}static get pluginName(){return"AutoMediaEmbed"}constructor(t){super(t),this._timeoutId=null,this._positionToInsert=null}init(){const t=this.editor,e=t.model.document;this.listenTo(t.plugins.get("ClipboardPipeline"),"inputTransformation",(()=>{const t=e.selection.getFirstRange(),n=fr.fromPosition(t.start);n.stickiness="toPrevious";const i=fr.fromPosition(t.end);i.stickiness="toNext",e.once("change:data",(()=>{this._embedMediaBetweenPositions(n,i),n.detach(),i.detach()}),{priority:"high"})})),t.commands.get("undo").on("execute",(()=>{this._timeoutId&&(jl.global.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)}),{priority:"high"})}_embedMediaBetweenPositions(t,e){const n=this.editor,i=n.plugins.get(ZE).registry,o=new Oi(t,e),r=o.getWalker({ignoreElementEnd:!0});let s="";for(const t of r)t.item.is("$textProxy")&&(s+=t.item.data);if(s=s.trim(),!s.match(KE))return void o.detach();if(!i.hasMedia(s))return void o.detach();n.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=fr.fromPosition(t),this._timeoutId=jl.global.window.setTimeout((()=>{n.model.change((t=>{let e;this._timeoutId=null,t.remove(o),o.detach(),"$graveyard"!==this._positionToInsert.root.rootName&&(e=this._positionToInsert),VE(n.model,s,e,!1),this._positionToInsert.detach(),this._positionToInsert=null})),n.plugins.get("Delete").requestUndoOnBackspace()}),100)):o.detach()}}var YE=__webpack_require__(3525),JE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(YE.Z,JE);YE.Z.locals;class QE extends Aa{constructor(t,e){super(e);const n=e.t;this.focusTracker=new jl.FocusTracker,this.keystrokes=new jl.KeystrokeHandler,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),Ga.check,"ck-button-save"),this.saveButtonView.type="submit",this.saveButtonView.bind("isEnabled").to(this,"mediaURLInputValue",(t=>!!t)),this.cancelButtonView=this._createButton(n("Cancel"),Ga.cancel,"ck-button-cancel","cancel"),this._focusables=new Js,this._focusCycler=new Cc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=t,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView,this.saveButtonView,this.cancelButtonView]}),Ka(this)}render(){super.render(),$a({view:this});[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach((t=>{this._focusables.add(t),this.focusTracker.add(t.element)})),this.keystrokes.listenTo(this.element);const t=t=>t.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t),this.listenTo(this.urlInputView.element,"selectstart",((t,e)=>{e.stopPropagation()}),{priority:"high"})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(t){this.urlInputView.fieldView.element.value=t.trim()}isValid(){this.resetFormStatus();for(const t of this._validators){const e=t(this);if(e)return this.urlInputView.errorText=e,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const t=this.locale.t,e=new pl(this.locale,fl),n=e.fieldView;return this._urlInputViewInfoDefault=t("Paste the media URL in the input."),this._urlInputViewInfoTip=t("Tip: Paste the URL into the content to embed faster."),e.label=t("Media URL"),e.infoText=this._urlInputViewInfoDefault,n.on("input",(()=>{e.infoText=n.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=n.element.value.trim()})),e}_createButton(t,e,n,i){const o=new ic(this.locale);return o.set({label:t,icon:e,tooltip:!0}),o.extendTemplate({attributes:{class:n}}),i&&o.delegate("execute").to(this,i),o}}class XE extends e{static get requires(){return[ZE]}static get pluginName(){return"MediaEmbedUI"}init(){const t=this.editor,e=t.commands.get("mediaEmbed"),n=t.plugins.get(ZE).registry;t.ui.componentFactory.add("mediaEmbed",(i=>{const o=Gc(i),r=new QE(function(t,e){return[e=>{if(!e.url.length)return t("The URL must not be empty.")},n=>{if(!e.hasMedia(n.url))return t("This media URL is not supported.")}]}(t.t,n),t.locale);return this._setUpDropdown(o,r,e,t),this._setUpForm(o,r,e),o}))}_setUpDropdown(t,e,n){const i=this.editor,o=i.t,r=t.buttonView;t.bind("isEnabled").to(n),t.panelView.children.add(e),r.set({label:o("Insert media"),icon:'',tooltip:!0}),r.on("open",(()=>{e.disableCssTransitions(),e.url=n.value||"",e.urlInputView.fieldView.select(),e.enableCssTransitions()}),{priority:"low"}),t.on("submit",(()=>{e.isValid()&&(i.execute("mediaEmbed",e.url),i.editing.view.focus())})),t.on("change:isOpen",(()=>e.resetFormStatus())),t.on("cancel",(()=>{i.editing.view.focus()}))}_setUpForm(t,e,n){e.delegate("submit","cancel").to(t),e.urlInputView.bind("value").to(n,"value"),e.urlInputView.bind("isReadOnly").to(n,"isEnabled",(t=>!t))}}var tT=__webpack_require__(5777),eT={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(tT.Z,eT);tT.Z.locals;class nT extends e{static get requires(){return[ZE,XE,$E,Xf]}static get pluginName(){return"MediaEmbed"}}var iT=__webpack_require__(9289),oT={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(iT.Z,oT);iT.Z.locals;class rT extends Aa{constructor(t){super(t);const e=t.t;this.set("matchCount",0),this.set("highlightOffset",0),this.set("isDirty",!1),this.set("_areCommandsEnabled",{}),this.set("_resultsCounterText",""),this.set("_matchCase",!1),this.set("_wholeWordsOnly",!1),this.bind("_searchResultsFound").to(this,"matchCount",this,"isDirty",((t,e)=>t>0&&!e)),this._findInputView=this._createInputField(e("Find in text…")),this._replaceInputView=this._createInputField(e("Replace with…")),this._findButtonView=this._createButton({label:e("Find"),class:"ck-button-find ck-button-action",withText:!0}),this._findPrevButtonView=this._createButton({label:e("Previous result"),class:"ck-button-prev",icon:_l,keystroke:"Shift+F3",tooltip:!0}),this._findNextButtonView=this._createButton({label:e("Next result"),class:"ck-button-next",icon:_l,keystroke:"F3",tooltip:!0}),this._optionsDropdown=this._createOptionsDropdown(),this._replaceButtonView=this._createButton({label:e("Replace"),class:"ck-button-replace",withText:!0}),this._replaceAllButtonView=this._createButton({label:e("Replace all"),class:"ck-button-replaceall",withText:!0}),this._findFieldsetView=this._createFindFieldset(),this._replaceFieldsetView=this._createReplaceFieldset(),this._focusTracker=new jl.FocusTracker,this._keystrokes=new jl.KeystrokeHandler,this._focusables=new Js,this._focusCycler=new Cc({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this._keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-find-and-replace-form"],tabindex:"-1"},children:[new al(t,{label:e("Find and replace")}),this._findFieldsetView,this._replaceFieldsetView]}),Ka(this)}render(){super.render(),$a({view:this}),this._initFocusCycling(),this._initKeystrokeHandling()}destroy(){super.destroy(),this._focusTracker.destroy(),this._keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}reset(){this._findInputView.errorText=null,this.isDirty=!0}get _textToFind(){return this._findInputView.fieldView.element.value}get _textToReplace(){return this._replaceInputView.fieldView.element.value}_createFindFieldset(){const t=this.locale,e=new Aa(t);return this._findInputView.fieldView.on("input",(()=>{this.isDirty=!0})),this._findButtonView.on("execute",this._onFindButtonExecute.bind(this)),this._findPrevButtonView.delegate("execute").to(this,"findPrevious"),this._findNextButtonView.delegate("execute").to(this,"findNext"),this._findPrevButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",(({findPrevious:t})=>t)),this._findNextButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",(({findNext:t})=>t)),this._injectFindResultsCounter(),e.setTemplate({tag:"fieldset",attributes:{class:["ck","ck-find-and-replace-form__find"]},children:[this._findInputView,this._findButtonView,this._findPrevButtonView,this._findNextButtonView]}),e}_onFindButtonExecute(){if(this._textToFind)this.isDirty=!1,this.fire("findNext",{searchText:this._textToFind,matchCase:this._matchCase,wholeWords:this._wholeWordsOnly});else{const t=this.t;this._findInputView.errorText=t("Text to find must not be empty.")}}_injectFindResultsCounter(){const t=this.locale,e=t.t,n=this.bindTemplate,i=new Aa(t);this.bind("_resultsCounterText").to(this,"highlightOffset",this,"matchCount",((t,n)=>e("%0 of %1",[t,n]))),i.setTemplate({tag:"span",attributes:{class:["ck","ck-results-counter",n.if("isDirty","ck-hidden")]},children:[{text:n.to("_resultsCounterText")}]});const o=()=>{const e=this._findInputView.fieldView.element;if(!e||!(0,jl.isVisible)(e))return;const n=new jl.Rect(i.element).width,o="ltr"===t.uiLanguageDirection?"paddingRight":"paddingLeft";e.style[o]=n?`calc( 2 * var(--ck-spacing-standard) + ${n}px )`:null};this.on("change:_resultsCounterText",o,{priority:"low"}),this.on("change:isDirty",o,{priority:"low"}),this._findInputView.template.children[0].children.push(i)}_createReplaceFieldset(){const t=this.locale,e=t.t,n=new Aa(t);return this._replaceButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",(({replace:t},e)=>t&&e)),this._replaceAllButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",(({replaceAll:t},e)=>t&&e)),this._replaceInputView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",(({replace:t},e)=>t&&e)),this._replaceInputView.bind("infoText").to(this._replaceInputView,"isEnabled",this._replaceInputView,"isFocused",((t,n)=>t||!n?"":e("Tip: Find some text first in order to replace it."))),this._replaceButtonView.on("execute",(()=>{this.fire("replace",{searchText:this._textToFind,replaceText:this._textToReplace})})),this._replaceAllButtonView.on("execute",(()=>{this.fire("replaceAll",{searchText:this._textToFind,replaceText:this._textToReplace}),this.focus()})),n.setTemplate({tag:"fieldset",attributes:{class:["ck","ck-find-and-replace-form__replace"]},children:[this._replaceInputView,this._optionsDropdown,this._replaceButtonView,this._replaceAllButtonView]}),n}_createOptionsDropdown(){const t=this.locale,e=t.t,n=Gc(t);n.class="ck-options-dropdown",n.buttonView.set({withText:!1,label:e("Show options"),icon:Ga.cog,tooltip:!0});const i=new wl({withText:!0,label:e("Match case"),_isMatchCaseSwitch:!0}),o=new wl({withText:!0,label:e("Whole words only")});return i.bind("isOn").to(this,"_matchCase"),o.bind("isOn").to(this,"_wholeWordsOnly"),n.on("execute",(t=>{t.source._isMatchCaseSwitch?this._matchCase=!this._matchCase:this._wholeWordsOnly=!this._wholeWordsOnly,this.isDirty=!0})),Kc(n,new jl.Collection([{type:"switchbutton",model:i},{type:"switchbutton",model:o}])),n}_initFocusCycling(){[this._findInputView,this._findButtonView,this._findPrevButtonView,this._findNextButtonView,this._replaceInputView,this._optionsDropdown,this._replaceButtonView,this._replaceAllButtonView].forEach((t=>{this._focusables.add(t),this._focusTracker.add(t.element)}))}_initKeystrokeHandling(){const t=t=>t.stopPropagation(),e=t=>{t.stopPropagation(),t.preventDefault()};this._keystrokes.listenTo(this.element),this._keystrokes.set("f3",(t=>{e(t),this._findNextButtonView.fire("execute")})),this._keystrokes.set("shift+f3",(t=>{e(t),this._findPrevButtonView.fire("execute")})),this._keystrokes.set("enter",(t=>{const n=t.target;n===this._findInputView.fieldView.element?(this._areCommandsEnabled.findNext?this._findNextButtonView.fire("execute"):this._findButtonView.fire("execute"),e(t)):n!==this._replaceInputView.fieldView.element||this.isDirty||(this._replaceButtonView.fire("execute"),e(t))})),this._keystrokes.set("shift+enter",(t=>{t.target===this._findInputView.fieldView.element&&(this._areCommandsEnabled.findPrevious?this._findPrevButtonView.fire("execute"):this._findButtonView.fire("execute"),e(t))})),this._keystrokes.set("arrowright",t),this._keystrokes.set("arrowleft",t),this._keystrokes.set("arrowup",t),this._keystrokes.set("arrowdown",t),this.listenTo(this._findInputView.element,"selectstart",((t,e)=>{e.stopPropagation()}),{priority:"high"}),this.listenTo(this._replaceInputView.element,"selectstart",((t,e)=>{e.stopPropagation()}),{priority:"high"})}_createButton(t){const e=new ic(this.locale);return e.set(t),e}_createInputField(t){const e=new pl(this.locale,fl);return e.label=t,e}}class sT extends e{static get pluginName(){return"FindAndReplaceUI"}constructor(t){super(t),this.formView=null}init(){const t=this.editor;t.ui.componentFactory.add("findAndReplace",(e=>{const n=Gc(e),i=this.formView=new rT(t.locale);return n.bind("isEnabled").to(t.commands.get("find")),n.panelView.children.add(i),n.on("change:isOpen",((t,e,n)=>{n?(i.disableCssTransitions(),i.reset(),i._findInputView.fieldView.select(),i.enableCssTransitions()):this.fire("searchReseted")}),{priority:"low"}),this._setupDropdownButton(n),this._setupFormView(i),n}))}_setupDropdownButton(t){const e=this.editor,n=e.locale.t;t.buttonView.set({icon:'',label:n("Find and replace"),keystroke:"CTRL+F",tooltip:!0}),e.keystrokes.set("Ctrl+F",((e,n)=>{t.isOpen=!0,n()}))}_setupFormView(t){const e=this.editor.commands,n=this.editor.plugins.get("FindAndReplaceEditing").state,i={before:-1,same:0,after:1};t.bind("highlightOffset").to(n,"highlightedResult",(t=>t?Array.from(n.results).sort(((t,e)=>i[t.marker.getStart().compareWith(e.marker.getStart())])).indexOf(t)+1:0)),t.listenTo(n.results,"change",(()=>{t.matchCount=n.results.length})),t.bind("_areCommandsEnabled").to(e.get("findNext"),"isEnabled",e.get("findPrevious"),"isEnabled",e.get("replace"),"isEnabled",e.get("replaceAll"),"isEnabled",((t,e,n,i)=>({findNext:t,findPrevious:e,replace:n,replaceAll:i}))),t.delegate("findNext","findPrevious","replace","replaceAll").to(this),t.on("change:isDirty",((t,e,n)=>{n&&this.fire("searchReseted")}))}}function aT(t,e,n,i){const o=i||new jl.Collection;return e.change((i=>{[...t].forEach((({type:t,item:r})=>{if("elementStart"===t&&e.schema.checkChild(r,"$text")){const t=n({item:r,text:cT(e.createRangeIn(r))});if(!t)return;t.forEach((t=>{const e=`findResult:${(0,jl.uid)()}`,n=i.addMarker(e,{usingOperation:!1,affectsData:!1,range:i.createRange(i.createPositionAt(r,t.start),i.createPositionAt(r,t.end))}),s=function(t,e){const n=t.find((({marker:t})=>e.getStart().isBefore(t.getStart())));return n?t.getIndex(n):t.length}(o,n);o.add({id:e,label:t.label,marker:n},s)}))}}))})),o}function cT(t){return Array.from(t.getItems()).reduce(((t,e)=>e.is("text")||e.is("textProxy")?t+e.data:`${t}\n`),"")}function lT(t){const e=t.length-1;let n=t.index;return 3===t.length&&(n+=t[1].length),{label:t[e],start:n,end:n+t[e].length}}function dT(t,e){let n="gu";e.matchCase||(n+="i");let i=`(${Jd(t)})`;if(e.wholeWords){const e="[^a-zA-ZÀ-ɏḀ-ỿ]";new RegExp("^"+e).test(t)||(i=`(^|${e}|_)${i}`),new RegExp(e+"$").test(t)||(i=`${i}(?=_|${e}|$)`)}const o=new RegExp(i,n);return function({text:t}){return[...t.matchAll(o)].map(lT)}}class uT extends i{constructor(t,e){super(t),this.isEnabled=!0,this.affectsData=!1,this._state=e}execute(t,{matchCase:e,wholeWords:n}={}){const{editor:i}=this,{model:o}=i;let r;"string"==typeof t?(r=dT(t,{matchCase:e,wholeWords:n}),this._state.searchText=t):r=t;const s=o.document.getRootNames().reduce(((t,e)=>aT(o.createRangeIn(o.document.getRoot(e)),o,r,t)),null);return this._state.clear(o),this._state.results.addMany(Array.from(s)),this._state.highlightedResult=s.get(0),"string"==typeof t&&(this._state.searchText=t),this._state.matchCase=!!e,this._state.matchWholeWords=!!n,{results:s,findCallback:r}}}class hT extends i{constructor(t,e){super(t),this.isEnabled=!0,this._state=e}execute(t,e){const{model:n}=this.editor;n.change((i=>{const o=e.marker.getRange();if("$graveyard"===o.root.rootName)return void this._state.results.remove(e);let r={};for(const t of o.getItems())if(t.is("$text")||t.is("$textProxy")){r=t.getAttributes();break}n.insertContent(i.createText(t,r),o),this._state.results.has(e)&&this._state.results.remove(e)}))}}class mT extends hT{execute(t,e){const{editor:n}=this,{model:i}=n,o=e instanceof jl.Collection?e:i.document.getRootNames().reduce(((t,n)=>aT(i.createRangeIn(i.document.getRoot(n)),i,dT(e,this._state),t)),null);o.length&&i.change((()=>{[...o].forEach((e=>{super.execute(t,e)}))}))}}class gT extends i{constructor(t,e){super(t),this.affectsData=!1,this._state=e,this.isEnabled=!1,this.listenTo(this._state.results,"change",(()=>{this.isEnabled=this._state.results.length>1}))}refresh(){this.isEnabled=this._state.results.length>1}execute(){const t=this._state.results,e=t.getIndex(this._state.highlightedResult),n=e+1>=t.length?0:e+1;this._state.highlightedResult=this._state.results.get(n)}}class pT extends gT{execute(){const t=this._state.results.getIndex(this._state.highlightedResult),e=t-1<0?this._state.results.length-1:t-1;this._state.highlightedResult=this._state.results.get(e)}}class fT{constructor(t){this.set("results",new jl.Collection),this.set("highlightedResult",null),this.set("searchText",""),this.set("replaceText",""),this.set("matchCase",!1),this.set("matchWholeWords",!1),this.results.on("change",((e,{removed:n,index:i})=>{if((n=Array.from(n)).length){let e=!1;if(t.change((i=>{for(const o of n)this.highlightedResult===o&&(e=!0),t.markers.has(o.marker.name)&&i.removeMarker(o.marker)})),e){const t=i>=this.results.length?0:i;this.highlightedResult=this.results.get(t)}}}))}clear(t){this.searchText="",t.change((e=>{if(this.highlightedResult){const n=this.highlightedResult.marker.name.split(":")[1],i=t.markers.get(`findResultHighlighted:${n}`);i&&e.removeMarker(i)}[...this.results].forEach((({marker:t})=>{e.removeMarker(t)}))})),this.results.clear()}}(0,jl.mix)(fT,jl.ObservableMixin);var bT=__webpack_require__(7275),kT=__webpack_require__(5436),xT={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(kT.Z,xT);kT.Z.locals;class wT extends e{static get pluginName(){return"FindAndReplaceEditing"}init(){this._activeResults=null,this.state=new fT(this.editor.model),this._defineConverters(),this._defineCommands(),this.listenTo(this.state,"change:highlightedResult",((t,e,n,i)=>{const{model:o}=this.editor;o.change((t=>{if(i){const e=i.marker.name.split(":")[1],n=o.markers.get(`findResultHighlighted:${e}`);n&&t.removeMarker(n)}if(n){const e=n.marker.name.split(":")[1];t.addMarker(`findResultHighlighted:${e}`,{usingOperation:!1,affectsData:!1,range:n.marker.getRange()})}}))}));const t=En(function(t,e,n){if(n){const t=this.editor.editing.view.domConverter,e=this.editor.editing.mapper.toViewRange(n.marker.getRange());(0,bT.m)({target:t.viewRangeToDom(e),viewportOffset:40})}}.bind(this),32);this.listenTo(this.state,"change:highlightedResult",t,{priority:"low"}),this.listenTo(this.editor,"destroy",t.cancel)}find(t){const{editor:e}=this,{model:n}=e,{findCallback:i,results:o}=e.execute("find",t);return this._activeResults=o,this.listenTo(n.document,"change:data",(()=>function(t,e,n){const i=new Set,o=new Set;e.document.differ.getChanges().forEach((t=>{"$text"===t.name||e.schema.isInline(t.position.nodeAfter)?(i.add(t.position.parent),[...e.markers.getMarkersAtPosition(t.position)].forEach((t=>{o.add(t.name)}))):"insert"===t.type&&i.add(t.position.nodeAfter)})),e.document.differ.getChangedMarkers().forEach((({name:t,data:{newRange:e}})=>{e&&"$graveyard"===e.start.root.rootName&&o.add(t)})),i.forEach((t=>{[...e.markers.getMarkersIntersectingRange(e.createRangeIn(t))].forEach((t=>o.add(t.name)))})),e.change((e=>{o.forEach((n=>{t.has(n)&&t.remove(n),e.removeMarker(n)}))})),i.forEach((i=>{aT(e.createRangeOn(i),e,n,t)}))}(this._activeResults,n,i))),this._activeResults}stop(){this._activeResults&&(this.stopListening(this.editor.model.document),this.state.clear(this.editor.model),this._activeResults=null)}_defineCommands(){this.editor.commands.add("find",new uT(this.editor,this.state)),this.editor.commands.add("findNext",new gT(this.editor,this.state)),this.editor.commands.add("findPrevious",new pT(this.editor,this.state)),this.editor.commands.add("replace",new hT(this.editor,this.state)),this.editor.commands.add("replaceAll",new mT(this.editor,this.state))}_defineConverters(){const{editor:t}=this;t.conversion.for("editingDowncast").markerToHighlight({model:"findResult",view:({markerName:t})=>{const[,e]=t.split(":");return{name:"span",classes:["ck-find-result"],attributes:{"data-find-result":e}}}}),t.conversion.for("editingDowncast").markerToHighlight({model:"findResultHighlighted",view:({markerName:t})=>{const[,e]=t.split(":");return{name:"span",classes:["ck-find-result_selected"],attributes:{"data-find-result":e}}}})}}class _T extends e{static get requires(){return[wT,sT]}static get pluginName(){return"FindAndReplace"}init(){const t=this.editor.plugins.get("FindAndReplaceUI"),e=this.editor.plugins.get("FindAndReplaceEditing"),n=e.state;t.on("findNext",((t,e)=>{e?(n.searchText=e.searchText,this.editor.execute("find",e.searchText,e)):this.editor.execute("findNext")})),t.on("findPrevious",((t,e)=>{e&&n.searchText!==e.searchText?this.editor.execute("find",e.searchText):this.editor.execute("findPrevious")})),t.on("replace",((t,e)=>{n.searchText!==e.searchText&&this.editor.execute("find",e.searchText);const i=n.highlightedResult;i&&this.editor.execute("replace",e.replaceText,i)})),t.on("replaceAll",((t,e)=>{n.searchText!==e.searchText&&this.editor.execute("find",e.searchText),this.editor.execute("replaceAll",e.replaceText,n.results)})),t.on("searchReseted",(()=>{n.clear(this.editor.model),e.stop()}))}}class AT extends i{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=e.selection.getAttribute(this.attributeKey),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,n=e.document.selection,i=t.value;e.change((t=>{if(n.isCollapsed)i?t.setSelectionAttribute(this.attributeKey,i):t.removeSelectionAttribute(this.attributeKey);else{const o=e.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const e of o)i?t.setAttribute(this.attributeKey,i,e):t.removeAttribute(this.attributeKey,e)}}))}}class vT extends jl.Collection{constructor(t){super(t),this.set("isEmpty",!0),this.on("change",(()=>{this.set("isEmpty",0===this.length)}))}add(t,e){this.find((e=>e.color===t.color))||super.add(t,e)}hasColor(t){return!!this.find((e=>e.color===t))}}(0,jl.mix)(vT,jl.ObservableMixin);var CT=__webpack_require__(2585),yT={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(CT.Z,yT);CT.Z.locals;class ET extends Aa{constructor(t,{colors:e,columns:n,removeButtonLabel:i,documentColorsLabel:o,documentColorsCount:r}){super(t),this.items=this.createCollection(),this.colorDefinitions=e,this.focusTracker=new jl.FocusTracker,this.keystrokes=new jl.KeystrokeHandler,this.set("selectedColor"),this.removeButtonLabel=i,this.columns=n,this.documentColors=new vT,this.documentColorsCount=r,this._focusables=new Js,this._focusCycler=new Cc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._documentColorsLabel=o,this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-table"]},children:this.items}),this.items.add(this._createRemoveColorButton())}updateDocumentColors(t,e){const n=t.document,i=this.documentColorsCount;this.documentColors.clear();for(const o of n.getRootNames()){const r=n.getRoot(o),s=t.createRangeIn(r);for(const t of s.getItems())if(t.is("$textProxy")&&t.hasAttribute(e)&&(this._addColorToDocumentColors(t.getAttribute(e)),this.documentColors.length>=i))return}}updateSelectedColors(){const t=this.documentColorsGrid,e=this.staticColorsGrid,n=this.selectedColor;e.selectedColor=n,t&&(t.selectedColor=n)}render(){super.render(),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}appendGrids(){if(!this.staticColorsGrid&&(this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.focusTracker.add(this.staticColorsGrid.element),this._focusables.add(this.staticColorsGrid),this.documentColorsCount)){const t=Xs.bind(this.documentColors,this.documentColors),e=new el(this.locale);e.text=this._documentColorsLabel,e.extendTemplate({attributes:{class:["ck","ck-color-grid__label",t.if("isEmpty","ck-hidden")]}}),this.items.add(e),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid),this.focusTracker.add(this.documentColorsGrid.element),this._focusables.add(this.documentColorsGrid)}}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_createRemoveColorButton(){const t=new ic;return t.set({withText:!0,icon:Ga.eraser,label:this.removeButtonLabel}),t.class="ck-color-table__remove-color",t.on("execute",(()=>{this.fire("execute",{value:null})})),t.render(),this.focusTracker.add(t.element),this._focusables.add(t),t}_createStaticColorsGrid(){const t=new gc(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return t.delegate("execute").to(this),t}_createDocumentColorsGrid(){const t=Xs.bind(this.documentColors,this.documentColors),e=new gc(this.locale,{columns:this.columns});return e.delegate("execute").to(this),e.extendTemplate({attributes:{class:t.if("isEmpty","ck-hidden")}}),e.items.bindTo(this.documentColors).using((t=>{const e=new dc;return e.set({color:t.color,hasBorder:t.options&&t.options.hasBorder}),t.label&&e.set({label:t.label,tooltip:!0}),e.on("execute",(()=>{this.fire("execute",{value:t.color})})),e})),this.documentColors.on("change:isEmpty",((t,n,i)=>{i&&(e.selectedColor=null)})),e}_addColorToDocumentColors(t){const e=this.colorDefinitions.find((e=>e.color===t));e?this.documentColors.add(Object.assign({},e)):this.documentColors.add({color:t,label:t,options:{hasBorder:!1}})}}const TT="fontSize",DT="fontFamily",ST="fontColor",IT="fontBackgroundColor";function BT(t,e){const n={model:{key:t,values:[]},view:{},upcastAlso:{}};for(const t of e)n.model.values.push(t.model),n.view[t.model]=t.view,t.upcastAlso&&(n.upcastAlso[t.model]=t.upcastAlso);return n}function MT(t){return e=>e.getStyle(t).replace(/\s/g,"")}function NT(t){return(e,{writer:n})=>n.createAttributeElement("span",{style:`${t}:${e}`},{priority:7})}class OT extends AT{constructor(t){super(t,DT)}}function RT(t){return t.map(PT).filter((t=>!!t))}function PT(t){return"object"==typeof t?t:"default"===t?{title:"Default",model:void 0}:"string"==typeof t?function(t){const e=t.replace(/"|'/g,"").split(","),n=e[0],i=e.map(LT).join(", ");return{title:n,model:i,view:{name:"span",styles:{"font-family":i},priority:7}}}(t):void 0}function LT(t){return(t=t.trim()).indexOf(" ")>0&&(t=`'${t}'`),t}class zT extends e{static get pluginName(){return"FontFamilyEditing"}constructor(t){super(t),t.config.define(DT,{options:["default","Arial, Helvetica, sans-serif","Courier New, Courier, monospace","Georgia, serif","Lucida Sans Unicode, Lucida Grande, sans-serif","Tahoma, Geneva, sans-serif","Times New Roman, Times, serif","Trebuchet MS, Helvetica, sans-serif","Verdana, Geneva, sans-serif"],supportAllValues:!1})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:DT}),t.model.schema.setAttributeProperties(DT,{isFormatting:!0,copyOnEnter:!0});const e=RT(t.config.get("fontFamily.options")).filter((t=>t.model)),n=BT(DT,e);t.config.get("fontFamily.supportAllValues")?(this._prepareAnyValueConverters(),this._prepareCompatibilityConverter()):t.conversion.attributeToElement(n),t.commands.add(DT,new OT(t))}_prepareAnyValueConverters(){const t=this.editor;t.conversion.for("downcast").attributeToElement({model:DT,view:(t,{writer:e})=>e.createAttributeElement("span",{style:"font-family:"+t},{priority:7})}),t.conversion.for("upcast").elementToAttribute({model:{key:DT,value:t=>t.getStyle("font-family")},view:{name:"span",styles:{"font-family":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{face:/.*/}},model:{key:DT,value:t=>t.getAttribute("face")}})}}class jT extends e{static get pluginName(){return"FontFamilyUI"}init(){const t=this.editor,e=t.t,n=this._getLocalizedOptions(),i=t.commands.get(DT);t.ui.componentFactory.add(DT,(o=>{const r=Gc(o);return Kc(r,function(t,e){const n=new jl.Collection;for(const i of t){const t={type:"button",model:new wl({commandName:DT,commandParam:i.model,label:i.title,withText:!0})};t.model.bind("isOn").to(e,"value",(t=>t===i.model||!(!t||!i.model)&&t.split(",")[0].replace(/'/g,"").toLowerCase()===i.model.toLowerCase())),i.view&&i.view.styles&&t.model.set("labelStyle",`font-family: ${i.view.styles["font-family"]}`),n.add(t)}return n}(n,i)),r.buttonView.set({label:e("Font Family"),icon:'',tooltip:!0}),r.extendTemplate({attributes:{class:"ck-font-family-dropdown"}}),r.bind("isEnabled").to(i),this.listenTo(r,"execute",(e=>{t.execute(e.source.commandName,{value:e.source.commandParam}),t.editing.view.focus()})),r}))}_getLocalizedOptions(){const t=this.editor,e=t.t;return RT(t.config.get(DT).options).map((t=>("Default"===t.title&&(t.title=e("Default")),t)))}}class FT extends e{static get requires(){return[zT,jT]}static get pluginName(){return"FontFamily"}}class VT extends AT{constructor(t){super(t,TT)}}function UT(t){return t.map((t=>function(t){if(e=t,"object"==typeof e&&e.title&&e.model&&e.view)return qT(t);var e;const n=function(t){return HT[t]||HT[t.model]}(t);if(n)return qT(n);if("default"===t)return{model:void 0,title:"Default"};if(function(t){let e;if("object"==typeof t){if(!t.model)throw new jl.CKEditorError("font-size-invalid-definition",null,t);e=parseFloat(t.model)}else e=parseFloat(t);return isNaN(e)}(t))return;return function(t){"number"!=typeof t&&"string"!=typeof t||(t={title:String(t),model:`${parseFloat(t)}px`});return t.view={name:"span",styles:{"font-size":t.model}},qT(t)}(t)}(t))).filter((t=>!!t))}const HT={get tiny(){return{title:"Tiny",model:"tiny",view:{name:"span",classes:"text-tiny",priority:7}}},get small(){return{title:"Small",model:"small",view:{name:"span",classes:"text-small",priority:7}}},get big(){return{title:"Big",model:"big",view:{name:"span",classes:"text-big",priority:7}}},get huge(){return{title:"Huge",model:"huge",view:{name:"span",classes:"text-huge",priority:7}}}};function qT(t){return t.view.priority||(t.view.priority=7),t}const WT=["x-small","x-small","small","medium","large","x-large","xx-large","xxx-large"];class GT extends e{static get pluginName(){return"FontSizeEditing"}constructor(t){super(t),t.config.define(TT,{options:["tiny","small","default","big","huge"],supportAllValues:!1})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:TT}),t.model.schema.setAttributeProperties(TT,{isFormatting:!0,copyOnEnter:!0});const e=t.config.get("fontSize.supportAllValues"),n=UT(this.editor.config.get("fontSize.options")).filter((t=>t.model)),i=BT(TT,n);e?(this._prepareAnyValueConverters(i),this._prepareCompatibilityConverter()):t.conversion.attributeToElement(i),t.commands.add(TT,new VT(t))}_prepareAnyValueConverters(t){const e=this.editor,n=t.model.values.filter((t=>!bs(String(t))&&!xs(String(t))));if(n.length)throw new jl.CKEditorError("font-size-invalid-use-of-named-presets",null,{presets:n});e.conversion.for("downcast").attributeToElement({model:TT,view:(t,{writer:e})=>{if(t)return e.createAttributeElement("span",{style:"font-size:"+t},{priority:7})}}),e.conversion.for("upcast").elementToAttribute({model:{key:TT,value:t=>t.getStyle("font-size")},view:{name:"span",styles:{"font-size":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{size:/^[+-]?\d{1,3}$/}},model:{key:TT,value:t=>{const e=t.getAttribute("size"),n="-"===e[0]||"+"===e[0];let i=parseInt(e,10);n&&(i=3+i);const o=WT.length-1,r=Math.min(Math.max(i,0),o);return WT[r]}}})}}var ZT=__webpack_require__(6203),KT={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(ZT.Z,KT);ZT.Z.locals;class $T extends e{static get pluginName(){return"FontSizeUI"}init(){const t=this.editor,e=t.t,n=this._getLocalizedOptions(),i=t.commands.get(TT);t.ui.componentFactory.add(TT,(o=>{const r=Gc(o);return Kc(r,function(t,e){const n=new jl.Collection;for(const i of t){const t={type:"button",model:new wl({commandName:TT,commandParam:i.model,label:i.title,class:"ck-fontsize-option",withText:!0})};i.view&&i.view.styles&&t.model.set("labelStyle",`font-size:${i.view.styles["font-size"]}`),i.view&&i.view.classes&&t.model.set("class",`${t.model.class} ${i.view.classes}`),t.model.bind("isOn").to(e,"value",(t=>t===i.model)),n.add(t)}return n}(n,i)),r.buttonView.set({label:e("Font Size"),icon:'',tooltip:!0}),r.extendTemplate({attributes:{class:["ck-font-size-dropdown"]}}),r.bind("isEnabled").to(i),this.listenTo(r,"execute",(e=>{t.execute(e.source.commandName,{value:e.source.commandParam}),t.editing.view.focus()})),r}))}_getLocalizedOptions(){const t=this.editor,e=t.t,n={Default:e("Default"),Tiny:e("Tiny"),Small:e("Small"),Big:e("Big"),Huge:e("Huge")};return UT(t.config.get(TT).options).map((t=>{const e=n[t.title];return e&&e!=t.title&&(t=Object.assign({},t,{title:e})),t}))}}class YT extends e{static get requires(){return[GT,$T]}static get pluginName(){return"FontSize"}normalizeSizeOptions(t){return UT(t)}}class JT extends AT{constructor(t){super(t,ST)}}class QT extends e{static get pluginName(){return"FontColorEditing"}constructor(t){super(t),t.config.define(ST,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),t.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:ST,value:MT("color")}}),t.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{color:/^#?\w+$/}},model:{key:ST,value:t=>t.getAttribute("color")}}),t.conversion.for("downcast").attributeToElement({model:ST,view:NT("color")}),t.commands.add(ST,new JT(t)),t.model.schema.extend("$text",{allowAttributes:ST}),t.model.schema.setAttributeProperties(ST,{isFormatting:!0,copyOnEnter:!0})}}class XT extends e{constructor(t,{commandName:e,icon:n,componentName:i,dropdownLabel:o}){super(t),this.commandName=e,this.componentName=i,this.icon=n,this.dropdownLabel=o,this.columns=t.config.get(`${this.componentName}.columns`),this.colorTableView=void 0}init(){const t=this.editor,e=t.locale,n=e.t,i=t.commands.get(this.commandName),o=ac(e,cc(t.config.get(this.componentName).colors)),r=t.config.get(`${this.componentName}.documentColors`);t.ui.componentFactory.add(this.componentName,(e=>{const s=Gc(e);return this.colorTableView=function({dropdownView:t,colors:e,columns:n,removeButtonLabel:i,documentColorsLabel:o,documentColorsCount:r}){const s=t.locale,a=new ET(s,{colors:e,columns:n,removeButtonLabel:i,documentColorsLabel:o,documentColorsCount:r});return t.colorTableView=a,t.panelView.children.add(a),a.delegate("execute").to(t,"execute"),a}({dropdownView:s,colors:o.map((t=>({label:t.label,color:t.model,options:{hasBorder:t.hasBorder}}))),columns:this.columns,removeButtonLabel:n("Remove color"),documentColorsLabel:0!==r?n("Document colors"):void 0,documentColorsCount:void 0===r?this.columns:r}),this.colorTableView.bind("selectedColor").to(i,"value"),s.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:!0}),s.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}}),s.bind("isEnabled").to(i),s.on("execute",((e,n)=>{t.execute(this.commandName,n),t.editing.view.focus()})),s.on("change:isOpen",((e,n,i)=>{s.colorTableView.appendGrids(),i&&(0!==r&&this.colorTableView.updateDocumentColors(t.model,this.componentName),this.colorTableView.updateSelectedColors())})),$c(s,(()=>s.colorTableView.staticColorsGrid.items.find((t=>t.isOn)))),s}))}}class tD extends XT{constructor(t){const e=t.locale.t;super(t,{commandName:ST,componentName:ST,icon:'',dropdownLabel:e("Font Color")})}static get pluginName(){return"FontColorUI"}}class eD extends e{static get requires(){return[QT,tD]}static get pluginName(){return"FontColor"}}class nD extends AT{constructor(t){super(t,IT)}}class iD extends e{static get pluginName(){return"FontBackgroundColorEditing"}constructor(t){super(t),t.config.define(IT,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),t.data.addStyleProcessorRules(Ns),t.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:IT,value:MT("background-color")}}),t.conversion.for("downcast").attributeToElement({model:IT,view:NT("background-color")}),t.commands.add(IT,new nD(t)),t.model.schema.extend("$text",{allowAttributes:IT}),t.model.schema.setAttributeProperties(IT,{isFormatting:!0,copyOnEnter:!0})}}class oD extends XT{constructor(t){const e=t.locale.t;super(t,{commandName:IT,componentName:IT,icon:'',dropdownLabel:e("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class rD extends e{static get requires(){return[iD,oD]}static get pluginName(){return"FontBackgroundColor"}}class sD extends i{refresh(){const t=this.editor.model,e=t.document;this.value=e.selection.getAttribute("highlight"),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,"highlight")}execute(t={}){const e=this.editor.model,n=e.document.selection,i=t.value;e.change((t=>{if(n.isCollapsed){const e=n.getFirstPosition();if(n.hasAttribute("highlight")){const n=t=>t.item.hasAttribute("highlight")&&t.item.getAttribute("highlight")===this.value,o=e.getLastMatchingPosition(n,{direction:"backward"}),r=e.getLastMatchingPosition(n),s=t.createRange(o,r);i&&this.value!==i?(e.isEqual(r)||t.setAttribute("highlight",i,s),t.setSelectionAttribute("highlight",i)):(e.isEqual(r)||t.removeAttribute("highlight",s),t.removeSelectionAttribute("highlight"))}else i&&t.setSelectionAttribute("highlight",i)}else{const o=e.schema.getValidRanges(n.getRanges(),"highlight");for(const e of o)i?t.setAttribute("highlight",i,e):t.removeAttribute("highlight",e)}}))}}class aD extends e{static get pluginName(){return"HighlightEditing"}constructor(t){super(t),t.config.define("highlight",{options:[{model:"yellowMarker",class:"marker-yellow",title:"Yellow marker",color:"var(--ck-highlight-marker-yellow)",type:"marker"},{model:"greenMarker",class:"marker-green",title:"Green marker",color:"var(--ck-highlight-marker-green)",type:"marker"},{model:"pinkMarker",class:"marker-pink",title:"Pink marker",color:"var(--ck-highlight-marker-pink)",type:"marker"},{model:"blueMarker",class:"marker-blue",title:"Blue marker",color:"var(--ck-highlight-marker-blue)",type:"marker"},{model:"redPen",class:"pen-red",title:"Red pen",color:"var(--ck-highlight-pen-red)",type:"pen"},{model:"greenPen",class:"pen-green",title:"Green pen",color:"var(--ck-highlight-pen-green)",type:"pen"}]})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"highlight"});const e=t.config.get("highlight.options");t.conversion.attributeToElement(function(t){const e={model:{key:"highlight",values:[]},view:{}};for(const n of t)e.model.values.push(n.model),e.view[n.model]={name:"mark",classes:n.class};return e}(e)),t.commands.add("highlight",new sD(t))}}var cD=__webpack_require__(713),lD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(cD.Z,lD);cD.Z.locals;class dD extends e{get localizedOptionTitles(){const t=this.editor.t;return{"Yellow marker":t("Yellow marker"),"Green marker":t("Green marker"),"Pink marker":t("Pink marker"),"Blue marker":t("Blue marker"),"Red pen":t("Red pen"),"Green pen":t("Green pen")}}static get pluginName(){return"HighlightUI"}init(){const t=this.editor.config.get("highlight.options");for(const e of t)this._addHighlighterButton(e);this._addRemoveHighlightButton(),this._addDropdown(t)}_addRemoveHighlightButton(){const t=this.editor.t,e=this.editor.commands.get("highlight");this._addButton("removeHighlight",t("Remove highlight"),Ga.eraser,null,(t=>{t.bind("isEnabled").to(e,"isEnabled")}))}_addHighlighterButton(t){const e=this.editor.commands.get("highlight");this._addButton("highlight:"+t.model,t.title,uD(t.type),t.model,(function(n){n.bind("isEnabled").to(e,"isEnabled"),n.bind("isOn").to(e,"value",(e=>e===t.model)),n.iconView.fillColor=t.color,n.isToggleable=!0}))}_addButton(t,e,n,i,o){const r=this.editor;r.ui.componentFactory.add(t,(t=>{const s=new ic(t),a=this.localizedOptionTitles[e]?this.localizedOptionTitles[e]:e;return s.set({label:a,icon:n,tooltip:!0}),s.on("execute",(()=>{r.execute("highlight",{value:i}),r.editing.view.focus()})),o(s),s}))}_addDropdown(t){const e=this.editor,n=e.t,i=e.ui.componentFactory,o=t[0],r=t.reduce(((t,e)=>(t[e.model]=e,t)),{});i.add("highlight",(s=>{const a=e.commands.get("highlight"),c=Gc(s,xc),l=c.buttonView;l.set({label:n("Highlight"),tooltip:!0,lastExecuted:o.model,commandValue:o.model,isToggleable:!0}),l.bind("icon").to(a,"value",(t=>uD(u(t,"type")))),l.bind("color").to(a,"value",(t=>u(t,"color"))),l.bind("commandValue").to(a,"value",(t=>u(t,"model"))),l.bind("isOn").to(a,"value",(t=>!!t)),l.delegate("execute").to(c);const d=t.map((t=>{const e=i.create("highlight:"+t.model);return this.listenTo(e,"execute",(()=>{c.buttonView.set({lastExecuted:t.model})})),e}));function u(t,e){const n=t&&t!==l.lastExecuted?t:l.lastExecuted;return r[n][e]}return c.bind("isEnabled").toMany(d,"isEnabled",((...t)=>t.some((t=>t)))),d.push(new Ec),d.push(i.create("removeHighlight")),Zc(c,d,{enableActiveItemFocusOnDropdownOpen:!0}),function(t){const e=t.buttonView.actionView;e.iconView.bind("fillColor").to(t.buttonView,"color")}(c),c.toolbarView.ariaLabel=n("Text highlight toolbar"),l.on("execute",(()=>{e.execute("highlight",{value:l.commandValue})})),this.listenTo(c,"execute",(()=>{e.editing.view.focus()})),c}))}}function uD(t){return"marker"===t?'':''}class hD extends e{static get requires(){return[aD,dD]}static get pluginName(){return"Highlight"}}class mD extends i{refresh(){const t=this.editor.model,e=t.schema,n=t.document.selection;this.isEnabled=function(t,e,n){const i=function(t,e){const n=Lf(t,e),i=n.start.parent;if(i.isEmpty&&!i.is("element","$root"))return i.parent;return i}(t,n);return e.checkChild(i,"horizontalLine")}(n,e,t)}execute(){const t=this.editor.model;t.change((e=>{const n=e.createElement("horizontalLine");t.insertObject(n,null,null,{setSelection:"after"})}))}}var gD=__webpack_require__(9118),pD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(gD.Z,pD);gD.Z.locals;class fD extends e{static get pluginName(){return"HorizontalLineEditing"}init(){const t=this.editor,e=t.model.schema,n=t.t,i=t.conversion;e.register("horizontalLine",{inheritAllFrom:"$blockObject"}),i.for("dataDowncast").elementToElement({model:"horizontalLine",view:(t,{writer:e})=>e.createEmptyElement("hr")}),i.for("editingDowncast").elementToStructure({model:"horizontalLine",view:(t,{writer:e})=>{const i=n("Horizontal line"),o=e.createContainerElement("div",null,e.createEmptyElement("hr"));return e.addClass("ck-horizontal-line",o),e.setCustomProperty("hr",!0,o),function(t,e,n){return e.setCustomProperty("horizontalLine",!0,t),Mf(t,e,{label:n})}(o,e,i)}}),i.for("upcast").elementToElement({view:"hr",model:"horizontalLine"}),t.commands.add("horizontalLine",new mD(t))}}class bD extends e{static get pluginName(){return"HorizontalLineUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("horizontalLine",(n=>{const i=t.commands.get("horizontalLine"),o=new ic(n);return o.set({label:e("Horizontal line"),icon:'',tooltip:!0}),o.bind("isEnabled").to(i,"isEnabled"),this.listenTo(o,"execute",(()=>{t.execute("horizontalLine"),t.editing.view.focus()})),o}))}}class kD extends e{static get requires(){return[fD,bD,Xf]}static get pluginName(){return"HorizontalLine"}}class xD extends i{refresh(){const t=this.editor.model,e=t.schema,n=t.document.selection,i=wD(n);this.isEnabled=function(t,e,n){const i=function(t,e){const n=Lf(t,e),i=n.start.parent;if(i.isEmpty&&!i.is("element","$root"))return i.parent;return i}(t,n);return e.checkChild(i,"rawHtml")}(n,e,t),this.value=i?i.getAttribute("value")||"":null}execute(t){const e=this.editor.model,n=e.document.selection;e.change((i=>{let o;null!==this.value?o=wD(n):(o=i.createElement("rawHtml"),e.insertObject(o,null,null,{setSelection:"on"})),i.setAttribute("value",t,o)}))}}function wD(t){const e=t.getSelectedElement();return e&&e.is("element","rawHtml")?e:null}var _D=__webpack_require__(3403),AD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(_D.Z,AD);_D.Z.locals;class vD extends e{static get pluginName(){return"HtmlEmbedEditing"}constructor(t){super(t),t.config.define("htmlEmbed",{showPreviews:!1,sanitizeHtml:t=>((0,jl.logWarning)("html-embed-provide-sanitize-function"),{html:t,hasChanged:!1})}),this._widgetButtonViewReferences=new Set}init(){const t=this.editor;t.model.schema.register("rawHtml",{inheritAllFrom:"$blockObject",allowAttributes:["value"]}),t.commands.add("htmlEmbed",new xD(t)),this._setupConversion()}_setupConversion(){const t=this.editor,e=t.t,n=t.editing.view,i=this._widgetButtonViewReferences,o=t.config.get("htmlEmbed");function r({domElement:t,editor:n,state:o,props:r}){t.textContent="";const a=t.ownerDocument;let c;if(o.isEditable){const e={isDisabled:!1,placeholder:r.textareaPlaceholder};c=s({domDocument:a,state:o,props:e}),t.append(c)}else if(o.showPreviews){const i={sanitizeHtml:r.sanitizeHtml};t.append(function({domDocument:t,state:n,props:i,editor:o}){const r=i.sanitizeHtml(n.getRawHtmlValue()),s=n.getRawHtmlValue().length>0?e("No preview available"):e("Empty snippet content"),a=(0,jl.createElement)(t,"div",{class:"ck ck-reset_all raw-html-embed__preview-placeholder"},s),c=(0,jl.createElement)(t,"div",{class:"raw-html-embed__preview-content",dir:o.locale.contentLanguageDirection}),l=t.createRange(),d=l.createContextualFragment(r.html);c.appendChild(d);const u=(0,jl.createElement)(t,"div",{class:"raw-html-embed__preview"},[a,c]);return u}({domDocument:a,state:o,props:i,editor:n}))}else{const e={isDisabled:!0,placeholder:r.textareaPlaceholder};t.append(s({domDocument:a,state:o,props:e}))}const l={onEditClick:r.onEditClick,onSaveClick:()=>{r.onSaveClick(c.value)},onCancelClick:r.onCancelClick};t.prepend(function({editor:t,domDocument:e,state:n,props:o}){const r=(0,jl.createElement)(e,"div",{class:"raw-html-embed__buttons-wrapper"});if(n.isEditable){const e=CD(t,"save",o.onSaveClick),n=CD(t,"cancel",o.onCancelClick);r.append(e.element,n.element),i.add(e).add(n)}else{const e=CD(t,"edit",o.onEditClick);r.append(e.element),i.add(e)}return r}({editor:n,domDocument:a,state:o,props:l}))}function s({domDocument:t,state:e,props:n}){const i=(0,jl.createElement)(t,"textarea",{placeholder:n.placeholder,class:"ck ck-reset ck-input ck-input-text raw-html-embed__source"});return i.disabled=n.isDisabled,i.value=e.getRawHtmlValue(),i}this.editor.editing.view.on("render",(()=>{for(const t of i){if(t.element.isConnected)return;t.destroy(),i.delete(t)}}),{priority:"lowest"}),t.data.registerRawContentMatcher({name:"div",classes:"raw-html-embed"}),t.conversion.for("upcast").elementToElement({view:{name:"div",classes:"raw-html-embed"},model:(t,{writer:e})=>e.createElement("rawHtml",{value:t.getCustomProperty("$rawContent")})}),t.conversion.for("dataDowncast").elementToElement({model:"rawHtml",view:(t,{writer:e})=>e.createRawElement("div",{class:"raw-html-embed"},(function(e){e.innerHTML=t.getAttribute("value")||""}))}),t.conversion.for("editingDowncast").elementToStructure({model:{name:"rawHtml",attributes:["value"]},view:(i,{writer:s})=>{let a,c,l;const d=s.createRawElement("div",{class:"raw-html-embed__content-wrapper"},(function(e){a=e,r({domElement:e,editor:t,state:c,props:l}),a.addEventListener("mousedown",(()=>{if(c.isEditable){const e=t.model;e.document.selection.getSelectedElement()!==i&&e.change((t=>t.setSelection(i,"on")))}}),!0)})),u={makeEditable(){c=Object.assign({},c,{isEditable:!0}),r({domElement:a,editor:t,state:c,props:l}),n.change((t=>{t.setAttribute("data-cke-ignore-events","true",d)})),a.querySelector("textarea").focus()},save(e){e!==c.getRawHtmlValue()?(t.execute("htmlEmbed",e),t.editing.view.focus()):this.cancel()},cancel(){c=Object.assign({},c,{isEditable:!1}),r({domElement:a,editor:t,state:c,props:l}),t.editing.view.focus(),n.change((t=>{t.removeAttribute("data-cke-ignore-events",d)}))}};c={showPreviews:o.showPreviews,isEditable:!1,getRawHtmlValue:()=>i.getAttribute("value")||""},l={sanitizeHtml:o.sanitizeHtml,textareaPlaceholder:e("Paste raw HTML here..."),onEditClick(){u.makeEditable()},onSaveClick(t){u.save(t)},onCancelClick(){u.cancel()}};const h=s.createContainerElement("div",{class:"raw-html-embed","data-html-embed-label":e("HTML snippet"),dir:t.locale.uiLanguageDirection},d);return s.setCustomProperty("rawHtmlApi",u,h),s.setCustomProperty("rawHtml",!0,h),Mf(h,s,{widgetLabel:e("HTML snippet"),hasSelectionHandle:!0})}})}}function CD(t,e,n){const i=t.locale.t,o=new ic(t.locale),r=t.commands.get("htmlEmbed");return o.set({class:`raw-html-embed__${e}-button`,icon:Ga.pencil,tooltip:!0,tooltipPosition:"rtl"===t.locale.uiLanguageDirection?"e":"w"}),o.render(),"edit"===e?(o.set({icon:Ga.pencil,label:i("Edit source")}),o.bind("isEnabled").to(r)):"save"===e?(o.set({icon:Ga.check,label:i("Save changes")}),o.bind("isEnabled").to(r)):o.set({icon:Ga.cancel,label:i("Cancel")}),o.on("execute",n),o}class yD extends e{static get pluginName(){return"HtmlEmbedUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("htmlEmbed",(n=>{const i=t.commands.get("htmlEmbed"),o=new ic(n);return o.set({label:e("Insert HTML"),icon:'',tooltip:!0}),o.bind("isEnabled").to(i,"isEnabled"),this.listenTo(o,"execute",(()=>{t.execute("htmlEmbed"),t.editing.view.focus();t.editing.view.document.selection.getSelectedElement().getCustomProperty("rawHtmlApi").makeEditable()})),o}))}}class ED extends e{static get requires(){return[vD,yD,Xf]}static get pluginName(){return"HtmlEmbed"}}const TD=[{model:"codeBlock",view:"pre"},{model:"paragraph",view:"p"},{model:"blockQuote",view:"blockquote"},{model:"listItem",view:"li"},{model:"pageBreak",view:"div"},{model:"rawHtml",view:"div"},{model:"table",view:"table"},{model:"tableRow",view:"tr"},{model:"tableCell",view:"td"},{model:"tableCell",view:"th"},{model:"caption",view:"caption"},{model:"caption",view:"figcaption"},{model:"imageBlock",view:"img"},{model:"imageInline",view:"img"},{model:"htmlP",view:"p",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlBlockquote",view:"blockquote",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlTable",view:"table",modelSchema:{allowWhere:"$block",isBlock:!0}},{model:"htmlTbody",view:"tbody",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlThead",view:"thead",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlTfoot",view:"tfoot",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlCaption",view:"caption",modelSchema:{allowIn:"htmlTable",allowChildren:"$text",isBlock:!1}},{model:"htmlColgroup",view:"colgroup",modelSchema:{allowIn:"htmlTable",allowChildren:"col",isBlock:!1}},{model:"htmlCol",view:"col",modelSchema:{allowIn:"htmlColgroup",isBlock:!1}},{model:"htmlTr",view:"tr",modelSchema:{allowIn:["htmlTable","htmlThead","htmlTbody"],isLimit:!0}},{model:"htmlTd",view:"td",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlTh",view:"th",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlFigure",view:"figure",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFigcaption",view:"figcaption",modelSchema:{allowIn:"htmlFigure",allowChildren:"$text",isBlock:!1}},{model:"htmlAddress",view:"address",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlAside",view:"aside",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlMain",view:"main",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDetails",view:"details",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSummary",view:"summary",modelSchema:{allowChildren:"$text",allowIn:"htmlDetails",isBlock:!1}},{model:"htmlDiv",view:"div",paragraphLikeModel:"htmlDivParagraph",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlFieldset",view:"fieldset",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlLegend",view:"legend",modelSchema:{allowIn:"htmlFieldset",allowChildren:"$text"}},{model:"htmlHeader",view:"header",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFooter",view:"footer",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlForm",view:"form",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlHgroup",view:"hgroup",modelSchema:{allowChildren:["htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6"],isBlock:!1}},{model:"htmlH1",view:"h1",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH2",view:"h2",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH3",view:"h3",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH4",view:"h4",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH5",view:"h5",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH6",view:"h6",modelSchema:{inheritAllFrom:"$block"}},{model:"$htmlList",modelSchema:{allowWhere:"$container",allowChildren:["$htmlList","htmlLi"],isBlock:!1}},{model:"htmlDir",view:"dir",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlMenu",view:"menu",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlUl",view:"ul",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlOl",view:"ol",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlLi",view:"li",modelSchema:{allowIn:"$htmlList",allowChildren:"$text",isBlock:!1}},{model:"htmlPre",view:"pre",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlArticle",view:"article",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSection",view:"section",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlNav",view:"nav",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDl",view:"dl",modelSchema:{allowWhere:"$container",allowChildren:["htmlDt","htmlDd"],isBlock:!1}},{model:"htmlDt",view:"dt",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlDd",view:"dd",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlCenter",view:"center",modelSchema:{inheritAllFrom:"$container",isBlock:!1}}],DD=[{model:"htmlAcronym",view:"acronym",attributeProperties:{copyOnEnter:!0}},{model:"htmlTt",view:"tt",attributeProperties:{copyOnEnter:!0}},{model:"htmlFont",view:"font",attributeProperties:{copyOnEnter:!0}},{model:"htmlTime",view:"time",attributeProperties:{copyOnEnter:!0}},{model:"htmlVar",view:"var",attributeProperties:{copyOnEnter:!0}},{model:"htmlBig",view:"big",attributeProperties:{copyOnEnter:!0}},{model:"htmlSmall",view:"small",attributeProperties:{copyOnEnter:!0}},{model:"htmlSamp",view:"samp",attributeProperties:{copyOnEnter:!0}},{model:"htmlQ",view:"q",attributeProperties:{copyOnEnter:!0}},{model:"htmlOutput",view:"output",attributeProperties:{copyOnEnter:!0}},{model:"htmlKbd",view:"kbd",attributeProperties:{copyOnEnter:!0}},{model:"htmlBdi",view:"bdi",attributeProperties:{copyOnEnter:!0}},{model:"htmlBdo",view:"bdo",attributeProperties:{copyOnEnter:!0}},{model:"htmlAbbr",view:"abbr",attributeProperties:{copyOnEnter:!0}},{model:"htmlA",view:"a",priority:5,coupledAttribute:"linkHref",attributeProperties:{copyOnEnter:!0}},{model:"htmlStrong",view:"strong",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlB",view:"b",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlI",view:"i",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlEm",view:"em",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlS",view:"s",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDel",view:"del",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0}},{model:"htmlIns",view:"ins",attributeProperties:{copyOnEnter:!0}},{model:"htmlU",view:"u",coupledAttribute:"underline",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSub",view:"sub",coupledAttribute:"subscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSup",view:"sup",coupledAttribute:"superscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCode",view:"code",coupledAttribute:"code",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlMark",view:"mark",attributeProperties:{copyOnEnter:!0}},{model:"htmlSpan",view:"span",attributeProperties:{copyOnEnter:!0}},{model:"htmlCite",view:"cite",attributeProperties:{copyOnEnter:!0}},{model:"htmlLabel",view:"label",attributeProperties:{copyOnEnter:!0}},{model:"htmlDfn",view:"dfn",attributeProperties:{copyOnEnter:!0}},{model:"htmlObject",view:"object",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlIframe",view:"iframe",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlInput",view:"input",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlButton",view:"button",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlTextarea",view:"textarea",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlSelect",view:"select",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlVideo",view:"video",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlEmbed",view:"embed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlOembed",view:"oembed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlAudio",view:"audio",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlImg",view:"img",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlCanvas",view:"canvas",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlMeter",view:"meter",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlProgress",view:"progress",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlScript",view:"script",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlStyle",view:"style",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlCustomElement",view:"$customElement",modelSchema:{allowWhere:["$text","$block"],isInline:!0}}];const SD=zt((function(t,e,n,i){yt(t,e,n,i)}));class ID extends e{constructor(t){super(t),this._definitions=new Map}static get pluginName(){return"DataSchema"}init(){for(const t of TD)this.registerBlockElement(t);for(const t of DD)this.registerInlineElement(t)}registerBlockElement(t){this._definitions.set(t.model,{...t,isBlock:!0})}registerInlineElement(t){this._definitions.set(t.model,{...t,isInline:!0})}extendBlockElement(t){this._extendDefinition({...t,isBlock:!0})}extendInlineElement(t){this._extendDefinition({...t,isInline:!0})}getDefinitionsForView(t,e){const n=new Set;for(const i of this._getMatchingViewDefinitions(t)){if(e)for(const t of this._getReferences(i.model))n.add(t);n.add(i)}return n}_getMatchingViewDefinitions(t){return Array.from(this._definitions.values()).filter((e=>e.view&&function(t,e){if("string"==typeof t)return t===e;if(t instanceof RegExp)return t.test(e);return!1}(t,e.view)))}*_getReferences(t){const{modelSchema:e}=this._definitions.get(t);if(!e)return;const n=["inheritAllFrom","inheritTypesFrom","allowWhere","allowContentOf","allowAttributesOf"];for(const i of n)for(const n of(0,jl.toArray)(e[i]||[])){const e=this._definitions.get(n);n!==t&&e&&(yield*this._getReferences(e.model),yield e)}}_extendDefinition(t){const e=this._definitions.get(t.model),n=SD({},e,t,((t,e)=>Array.isArray(t)?t.concat(e):void 0));this._definitions.set(t.model,n)}}function BD(t,e,n,i){e&&function(t,e,n){if(e.attributes)for(const[i]of Object.entries(e.attributes))t.removeAttribute(i,n);if(e.styles)for(const i of Object.keys(e.styles))t.removeStyle(i,n);e.classes&&t.removeClass(e.classes,n)}(t,e,i),n&&MD(t,n,i)}function MD(t,e,n){if(e.attributes)for(const[i,o]of Object.entries(e.attributes))t.setAttribute(i,o,n);e.styles&&t.setStyle(e.styles,n),e.classes&&t.addClass(e.classes,n)}function ND(t,e){const n=Ui(t);for(const i in e)Array.isArray(e[i])?n[i]=Array.from(new Set([...t[i]||[],...e[i]])):n[i]={...t[i],...e[i]};return n}function OD({model:t}){return(e,n)=>n.writer.createElement(t,{htmlContent:e.getCustomProperty("$rawContent")})}function RD(t,{view:e,isInline:n}){const i=t.t;return(t,{writer:o})=>{const r=i("HTML object"),s=PD(e,t,o),a=t.getAttribute("htmlAttributes");o.addClass("html-object-embed__content",s),a&&MD(o,a,s);return Mf(o.createContainerElement(n?"span":"div",{class:"html-object-embed","data-html-object-embed-label":r},s),o,{widgetLabel:r})}}function PD(t,e,n){return n.createRawElement(t,null,((t,n)=>{n.setContentOf(t,e.getAttribute("htmlContent"))}))}function LD({priority:t,view:e}){return(n,i)=>{if(!n)return;const{writer:o}=i,r=o.createAttributeElement(e,null,{priority:t});return MD(o,n,r),r}}function zD({view:t},e){return n=>{n.on(`element:${t}`,((t,n,i)=>{if(!n.modelRange||n.modelRange.isCollapsed)return;const o=e.processViewAttributes(n.viewItem,i);o&&i.writer.setAttribute("htmlAttributes",o,n.modelRange)}),{priority:"low"})}}function jD({model:t}){return e=>{e.on(`attribute:htmlAttributes:${t}`,((t,e,n)=>{if(!n.consumable.consume(e.item,t.name))return;const{attributeOldValue:i,attributeNewValue:o}=e;BD(n.writer,i,o,n.mapper.toViewElement(e.item))}))}}const FD=function(t,e,n,i){for(var o=t.length,r=n+(i?1:-1);i?r--:++r-1;)a!==t&&GD.call(a,c,1),GD.call(t,c,1);return t};const KD=Rt((function(t,e){return t&&t.length&&e&&e.length?ZD(t,e):t}));var $D=__webpack_require__(8468),YD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()($D.Z,YD);$D.Z.locals;class JD extends e{constructor(t){super(t),this._dataSchema=t.plugins.get("DataSchema"),this._allowedAttributes=new E,this._disallowedAttributes=new E,this._allowedElements=new Set,this._disallowedElements=new Set,this._dataInitialized=!1,this._coupledAttributes=null,this._registerElementsAfterInit(),this._registerElementHandlers(),this._registerModelPostFixer()}static get pluginName(){return"DataFilter"}static get requires(){return[ID,Xf]}loadAllowedConfig(t){for(const e of t){const t=e.name||/[\s\S]+/,n=nS(e);this.allowElement(t),n.forEach((t=>this.allowAttributes(t)))}}loadDisallowedConfig(t){for(const e of t){const t=e.name||/[\s\S]+/,n=nS(e);0==n.length?this.disallowElement(t):n.forEach((t=>this.disallowAttributes(t)))}}allowElement(t){for(const e of this._dataSchema.getDefinitionsForView(t,!0))this._allowedElements.has(e)||(this._allowedElements.add(e),this._dataInitialized&&this.editor.data.once("set",(()=>{this._fireRegisterEvent(e)}),{priority:jl.priorities.get("highest")+1}),this._coupledAttributes=null)}disallowElement(t){for(const e of this._dataSchema.getDefinitionsForView(t,!1))this._disallowedElements.add(e.view)}allowAttributes(t){this._allowedAttributes.add(t)}disallowAttributes(t){this._disallowedAttributes.add(t)}processViewAttributes(t,e){return QD(t,e,this._disallowedAttributes),QD(t,e,this._allowedAttributes)}_registerElementsAfterInit(){this.editor.data.on("init",(()=>{this._dataInitialized=!0;for(const t of this._allowedElements)this._fireRegisterEvent(t)}),{priority:jl.priorities.get("highest")+1})}_registerElementHandlers(){this.on("register",((t,e)=>{const n=this.editor.model.schema;if(e.isObject&&!n.isRegistered(e.model))this._registerObjectElement(e);else if(e.isBlock)this._registerBlockElement(e);else{if(!e.isInline)throw new jl.CKEditorError("data-filter-invalid-definition",null,e);this._registerInlineElement(e)}t.stop()}),{priority:"lowest"})}_registerModelPostFixer(){const t=this.editor.model;t.document.registerPostFixer((e=>{const n=t.document.differ.getChanges();let i=!1;const o=this._getCoupledAttributesMap();for(const t of n){if("attribute"!=t.type||null!==t.attributeNewValue)continue;const n=o.get(t.attributeKey);if(n)for(const{item:o}of t.range.getWalker({shallow:!0}))for(const t of n)o.hasAttribute(t)&&(e.removeAttribute(t,o),i=!0)}return i}))}_getCoupledAttributesMap(){if(this._coupledAttributes)return this._coupledAttributes;this._coupledAttributes=new Map;for(const t of this._allowedElements)if(t.coupledAttribute&&t.model){const e=this._coupledAttributes.get(t.coupledAttribute);e?e.push(t.model):this._coupledAttributes.set(t.coupledAttribute,[t.model])}}_fireRegisterEvent(t){t.view&&this._disallowedElements.has(t.view)||this.fire(t.view?`register:${t.view}`:"register",t)}_registerObjectElement(t){const e=this.editor,n=e.model.schema,i=e.conversion,{view:o,model:r}=t;n.register(r,t.modelSchema),o&&(n.extend(t.model,{allowAttributes:["htmlAttributes","htmlContent"]}),e.data.registerRawContentMatcher({name:o}),i.for("upcast").elementToElement({view:o,model:OD(t),converterPriority:jl.priorities.get("low")+1}),i.for("upcast").add(zD(t,this)),i.for("editingDowncast").elementToStructure({model:{name:r,attributes:["htmlAttributes"]},view:RD(e,t)}),i.for("dataDowncast").elementToElement({model:r,view:(t,{writer:e})=>PD(o,t,e)}),i.for("dataDowncast").add(jD(t)))}_registerBlockElement(t){const e=this.editor,n=e.model.schema,i=e.conversion,{view:o,model:r}=t;if(!n.isRegistered(t.model)){if(n.register(t.model,t.modelSchema),!o)return;i.for("upcast").elementToElement({model:r,view:o,converterPriority:jl.priorities.get("low")+1}),i.for("downcast").elementToElement({model:r,view:o})}o&&(n.extend(t.model,{allowAttributes:"htmlAttributes"}),i.for("upcast").add(zD(t,this)),i.for("downcast").add(jD(t)))}_registerInlineElement(t){const e=this.editor,n=e.model.schema,i=e.conversion,o=t.model;n.extend("$text",{allowAttributes:o}),t.attributeProperties&&n.setAttributeProperties(o,t.attributeProperties),i.for("upcast").add(function({view:t,model:e},n){return i=>{i.on(`element:${t}`,((t,i,o)=>{let r=n.processViewAttributes(i.viewItem,o);if(r||o.consumable.test(i.viewItem,{name:!0})){r=r||{},o.consumable.consume(i.viewItem,{name:!0}),i.modelRange||(i=Object.assign(i,o.convertChildren(i.viewItem,i.modelCursor)));for(const t of i.modelRange.getItems())if(o.schema.checkAttribute(t,e)){const n=ND(r,t.getAttribute(e)||{});o.writer.setAttribute(e,n,t)}}}),{priority:"low"})}}(t,this)),i.for("downcast").attributeToElement({model:o,view:LD(t)})}}function QD(t,e,n){const i=function(t,{consumable:e},n){const i=n.matchAll(t)||[],o=[];for(const n of i)XD(e,t,n),delete n.match.name,e.consume(t,n.match),o.push(n);return o}(t,e,n),{attributes:o,styles:r,classes:s}=function(t){const e={attributes:new Set,classes:new Set,styles:new Set};for(const n of t)for(const t in e){(n.match[t]||[]).forEach((n=>e[t].add(n)))}return e}(i),a={};if(o.size)for(const t of o)iS(t)||o.delete(t);return o.size&&(a.attributes=tS(o,(e=>t.getAttribute(e)))),r.size&&(a.styles=tS(r,(e=>t.getStyle(e)))),s.size&&(a.classes=Array.from(s)),Object.keys(a).length?a:null}function XD(t,e,n){for(const i of["attributes","classes","styles"]){const o=n.match[i];if(o)for(const n of Array.from(o))t.test(e,{[i]:[n]})||KD(o,n)}}function tS(t,e){const n={};for(const i of t){void 0!==e(i)&&(n[i]=e(i))}return n}function eS(t,e){const{name:n}=t;return(0,y.Z)(t[e])?Object.entries(t[e]).map((([t,i])=>({name:n,[e]:{[t]:i}}))):Array.isArray(t[e])?t[e].map((t=>({name:n,[e]:[t]}))):[t]}function nS(t){const{name:e,attributes:n,classes:i,styles:o}=t,r=[];return n&&r.push(...eS({name:e,attributes:n},"attributes")),i&&r.push(...eS({name:e,classes:i},"classes")),o&&r.push(...eS({name:e,styles:o},"styles")),r}function iS(t){try{document.createAttribute(t)}catch(t){return!1}return!0}class oS extends e{static get requires(){return[JD]}static get pluginName(){return"CodeBlockElementSupport"}init(){if(!this.editor.plugins.has("CodeBlockEditing"))return;const t=this.editor.plugins.get(JD);t.on("register:pre",((e,n)=>{if("codeBlock"!==n.model)return;const i=this.editor,o=i.model.schema,r=i.conversion;o.extend("codeBlock",{allowAttributes:["htmlAttributes","htmlContentAttributes"]}),r.for("upcast").add(function(t){return e=>{e.on("element:code",((e,n,i)=>{const o=n.viewItem,r=o.parent;function s(e,o){const r=t.processViewAttributes(e,i);r&&i.writer.setAttribute(o,r,n.modelRange)}r&&r.is("element","pre")&&(s(r,"htmlAttributes"),s(o,"htmlContentAttributes"))}),{priority:"low"})}}(t)),r.for("downcast").add((t=>{t.on("attribute:htmlAttributes:codeBlock",((t,e,n)=>{if(!n.consumable.consume(e.item,t.name))return;const{attributeOldValue:i,attributeNewValue:o}=e,r=n.mapper.toViewElement(e.item).parent;BD(n.writer,i,o,r)})),t.on("attribute:htmlContentAttributes:codeBlock",((t,e,n)=>{if(!n.consumable.consume(e.item,t.name))return;const{attributeOldValue:i,attributeNewValue:o}=e,r=n.mapper.toViewElement(e.item);BD(n.writer,i,o,r)}))})),e.stop()}))}}class rS extends e{static get requires(){return[JD]}static get pluginName(){return"DualContentModelElementSupport"}init(){this.editor.plugins.get(JD).on("register",((t,e)=>{const n=this.editor,i=n.model.schema,o=n.conversion;if(!e.paragraphLikeModel)return;if(i.isRegistered(e.model)||i.isRegistered(e.paragraphLikeModel))return;const r={model:e.paragraphLikeModel,view:e.view};i.register(e.model,e.modelSchema),i.register(r.model,{inheritAllFrom:"$block"}),o.for("upcast").elementToElement({view:e.view,model:(t,{writer:n})=>this._hasBlockContent(t)?n.createElement(e.model):n.createElement(r.model),converterPriority:jl.priorities.get("low")+1}),o.for("downcast").elementToElement({view:e.view,model:e.model}),this._addAttributeConversion(e),o.for("downcast").elementToElement({view:r.view,model:r.model}),this._addAttributeConversion(r),t.stop()}))}_hasBlockContent(t){const e=this.editor.editing.view,n=e.domConverter.blockElements;for(const i of e.createRangeIn(t).getItems())if(i.is("element")&&n.includes(i.name))return!0;return!1}_addAttributeConversion(t){const e=this.editor,n=e.conversion,i=e.plugins.get(JD);e.model.schema.extend(t.model,{allowAttributes:"htmlAttributes"}),n.for("upcast").add(zD(t,i)),n.for("downcast").add(jD(t))}}class sS extends e{static get requires(){return[ID]}static get pluginName(){return"HeadingElementSupport"}init(){const t=this.editor;if(!t.plugins.has("HeadingEditing"))return;const e=t.plugins.get(ID),n=t.config.get("heading.options"),i=[];for(const t of n)"model"in t&&"view"in t&&(e.registerBlockElement({view:t.view,model:t.model}),i.push(t.model));e.extendBlockElement({model:"htmlHgroup",modelSchema:{allowChildren:i}})}}class aS extends e{static get requires(){return[JD]}static get pluginName(){return"ImageElementSupport"}init(){const t=this.editor;if(!t.plugins.has("ImageInlineEditing")&&!t.plugins.has("ImageBlockEditing"))return;const e=t.model.schema,n=t.conversion,i=t.plugins.get(JD);i.on("register:figure",(()=>{n.for("upcast").add(function(t){return e=>{e.on("element:figure",((e,n,i)=>{const o=n.viewItem;if(!n.modelRange||!o.hasClass("image"))return;const r=t.processViewAttributes(o,i);r&&i.writer.setAttribute("htmlFigureAttributes",r,n.modelRange)}),{priority:"low"})}}(i))})),i.on("register:img",((t,o)=>{"imageBlock"!==o.model&&"imageInline"!==o.model||(e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["htmlAttributes","htmlFigureAttributes","htmlLinkAttributes"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["htmlA","htmlAttributes"]}),n.for("upcast").add(function(t){return e=>{e.on("element:img",((e,n,i)=>{if(!n.modelRange)return;const o=n.viewItem,r=o.parent;function s(e,o){const r=t.processViewAttributes(e,i);r&&i.writer.setAttribute(o,r,n.modelRange)}function a(t){n.modelRange&&n.modelRange.getContainedElement().is("element","imageBlock")&&s(t,"htmlLinkAttributes")}s(o,"htmlAttributes"),r.is("element","a")&&a(r)}),{priority:"low"})}}(i)),n.for("downcast").add((t=>{function e(e){t.on(`attribute:${e}:imageInline`,((t,e,n)=>{if(!n.consumable.consume(e.item,t.name))return;const{attributeOldValue:i,attributeNewValue:o}=e,r=n.mapper.toViewElement(e.item);BD(n.writer,i,o,r)}),{priority:"low"})}function n(e,n){t.on(`attribute:${n}:imageBlock`,((t,n,i)=>{if(!i.consumable.test(n.item,t.name))return;const{attributeOldValue:o,attributeNewValue:r}=n,s=i.mapper.toViewElement(n.item),a=cS(i.writer,s,e);a&&(BD(i.writer,o,r,a),i.consumable.consume(n.item,t.name))}),{priority:"low"}),"a"===e&&t.on("attribute:linkHref:imageBlock",((t,e,n)=>{if(!n.consumable.consume(e.item,"attribute:htmlLinkAttributes:imageBlock"))return;const i=n.mapper.toViewElement(e.item),o=cS(n.writer,i,"a");MD(n.writer,e.item.getAttribute("htmlLinkAttributes"),o)}),{priority:"low"})}e("htmlAttributes"),n("img","htmlAttributes"),n("figure","htmlFigureAttributes"),n("a","htmlLinkAttributes")})),t.stop())}))}}function cS(t,e,n){const i=t.createRangeOn(e);for(const{item:t}of i.getWalker())if(t.is("element",n))return t}class lS extends e{static get requires(){return[JD]}static get pluginName(){return"MediaEmbedElementSupport"}init(){const t=this.editor;if(!t.plugins.has("MediaEmbed")||t.config.get("mediaEmbed.previewsInData"))return;const e=t.model.schema,n=t.conversion,i=this.editor.plugins.get(JD),o=this.editor.plugins.get(ID),r=t.config.get("mediaEmbed.elementName");o.registerBlockElement({model:"media",view:r}),i.on("register:figure",(()=>{n.for("upcast").add(function(t){return e=>{e.on("element:figure",((e,n,i)=>{const o=n.viewItem;if(!n.modelRange||!o.hasClass("media"))return;const r=t.processViewAttributes(o,i);r&&i.writer.setAttribute("htmlFigureAttributes",r,n.modelRange)}),{priority:"low"})}}(i))})),i.on(`register:${r}`,((t,o)=>{"media"===o.model&&(e.extend("media",{allowAttributes:["htmlAttributes","htmlFigureAttributes"]}),n.for("upcast").add(function(t,e){return t=>{t.on(`element:${e}`,n,{priority:"low"})};function n(e,n,i){function o(e,o){const r=t.processViewAttributes(e,i);r&&i.writer.setAttribute(o,r,n.modelRange)}o(n.viewItem,"htmlAttributes")}}(i,r)),n.for("dataDowncast").add(function(t){return e=>{function n(t,n){e.on(`attribute:${n}:media`,((e,n,i)=>{if(!i.consumable.consume(n.item,e.name))return;const{attributeOldValue:o,attributeNewValue:r}=n,s=i.mapper.toViewElement(n.item),a=function(t,e,n){const i=t.createRangeOn(e);for(const{item:t}of i.getWalker())if(t.is("element",n))return t}(i.writer,s,t);BD(i.writer,o,r,a)}))}n(t,"htmlAttributes"),n("figure","htmlFigureAttributes")}}(r)),t.stop())}))}}class dS extends e{static get requires(){return[JD]}static get pluginName(){return"ScriptElementSupport"}init(){const t=this.editor.plugins.get(JD);t.on("register:script",((e,n)=>{const i=this.editor,o=i.model.schema,r=i.conversion;o.register("htmlScript",n.modelSchema),o.extend("htmlScript",{allowAttributes:["htmlAttributes","htmlContent"],isContent:!0}),i.data.registerRawContentMatcher({name:"script"}),r.for("upcast").elementToElement({view:"script",model:OD(n)}),r.for("upcast").add(zD(n,t)),r.for("downcast").elementToElement({model:"htmlScript",view:(t,{writer:e})=>PD("script",t,e)}),r.for("downcast").add(jD(n)),e.stop()}))}}class uS extends e{static get requires(){return[JD]}static get pluginName(){return"TableElementSupport"}init(){const t=this.editor;if(!t.plugins.has("TableEditing"))return;const e=t.model.schema,n=t.conversion,i=t.plugins.get(JD);i.on("register:figure",(()=>{n.for("upcast").add(function(t){return e=>{e.on("element:figure",((e,n,i)=>{const o=n.viewItem;if(!n.modelRange||!o.hasClass("table"))return;const r=t.processViewAttributes(o,i);r&&i.writer.setAttribute("htmlFigureAttributes",r,n.modelRange)}),{priority:"low"})}}(i))})),i.on("register:table",((t,o)=>{"table"===o.model&&(e.extend("table",{allowAttributes:["htmlAttributes","htmlFigureAttributes","htmlTheadAttributes","htmlTbodyAttributes"]}),n.for("upcast").add(function(t){return e=>{e.on("element:table",((e,n,i)=>{const o=n.viewItem;r(o,"htmlAttributes");for(const t of o.getChildren())t.is("element","thead")&&r(t,"htmlTheadAttributes"),t.is("element","tbody")&&r(t,"htmlTbodyAttributes");function r(e,o){const r=t.processViewAttributes(e,i);r&&i.writer.setAttribute(o,r,n.modelRange)}}),{priority:"low"})}}(i)),n.for("downcast").add((t=>{function e(e,n){t.on(`attribute:${n}:table`,((t,n,i)=>{if(!i.consumable.consume(n.item,t.name))return;const o=i.mapper.toViewElement(n.item),r=function(t,e,n){const i=t.createRangeOn(e);for(const{item:t}of i.getWalker())if(t.is("element",n))return t}(i.writer,o,e);MD(i.writer,n.attributeNewValue,r)}))}e("table","htmlAttributes"),e("figure","htmlFigureAttributes"),e("thead","htmlTheadAttributes"),e("tbody","htmlTbodyAttributes")})),t.stop())}))}}class hS extends e{static get requires(){return[JD]}static get pluginName(){return"StyleElementSupport"}init(){const t=this.editor.plugins.get(JD);t.on("register:style",((e,n)=>{const i=this.editor,o=i.model.schema,r=i.conversion;o.register("htmlStyle",n.modelSchema),o.extend("htmlStyle",{allowAttributes:["htmlAttributes","htmlContent"],isContent:!0}),i.data.registerRawContentMatcher({name:"style"}),r.for("upcast").elementToElement({view:"style",model:OD(n)}),r.for("upcast").add(zD(n,t)),r.for("downcast").elementToElement({model:"htmlStyle",view:(t,{writer:e})=>PD("style",t,e)}),r.for("downcast").add(jD(n)),e.stop()}))}}class mS extends e{static get requires(){return[JD]}static get pluginName(){return"DocumentListElementSupport"}init(){const t=this.editor;if(!t.plugins.has("DocumentListEditing"))return;const e=t.model.schema,n=t.conversion,i=t.plugins.get(JD),o=t.plugins.get("DocumentListEditing");o.registerDowncastStrategy({scope:"item",attributeName:"htmlLiAttributes",setAttributeOnDowncast(t,e,n){MD(t,e,n)}}),o.registerDowncastStrategy({scope:"list",attributeName:"htmlListAttributes",setAttributeOnDowncast(t,e,n){MD(t,e,n)}}),i.on("register",((t,o)=>{["ul","ol","li"].includes(o.view)&&(t.stop(),e.checkAttribute("$block","htmlListAttributes")||(e.extend("$block",{allowAttributes:["htmlListAttributes","htmlLiAttributes"]}),e.extend("$blockObject",{allowAttributes:["htmlListAttributes","htmlLiAttributes"]}),e.extend("$container",{allowAttributes:["htmlListAttributes","htmlLiAttributes"]}),n.for("upcast").add((t=>{t.on("element:ul",gS("htmlListAttributes",i),{priority:"low"}),t.on("element:ol",gS("htmlListAttributes",i),{priority:"low"}),t.on("element:li",gS("htmlLiAttributes",i),{priority:"low"})}))))})),o.on("postFixer",((t,{listNodes:e,writer:n})=>{const i=[];for(const{node:o,previous:r}of e){if(!r)continue;const e=o.getAttribute("listIndent"),s=r.getAttribute("listIndent");let a=null;if(e>s?i[s]=r:e{t.model.change((t=>{for(const e of n)t.setAttribute("htmlListAttributes",{},e)}))}))}}function gS(t,e){return(n,i,o)=>{const r=i.viewItem;i.modelRange||Object.assign(i,o.convertChildren(i.viewItem,i.modelCursor));const s=e.processViewAttributes(r,o);for(const e of i.modelRange.getItems({shallow:!0}))e.hasAttribute("listItemId")&&(e.hasAttribute(t)||o.writer.setAttribute(t,s||{},e))}}class pS extends e{static get requires(){return[JD,ID]}static get pluginName(){return"CustomElementSupport"}init(){const t=this.editor.plugins.get(JD),e=this.editor.plugins.get(ID);t.on("register:$customElement",((n,i)=>{n.stop();const o=this.editor,r=o.model.schema,s=o.conversion,a=o.editing.view.domConverter.unsafeElements,c=o.data.htmlProcessor.domConverter.preElements;r.register(i.model,i.modelSchema),r.extend(i.model,{allowAttributes:["htmlElementName","htmlAttributes","htmlContent"],isContent:!0}),s.for("upcast").elementToElement({view:/.*/,model:(n,r)=>{if("$comment"==n.name)return;if(!function(t){try{document.createElement(t)}catch(t){return!1}return!0}(n.name))return;if(e.getDefinitionsForView(n.name).size)return;a.includes(n.name)||a.push(n.name),c.includes(n.name)||c.push(n.name);const s=r.writer.createElement(i.model,{htmlElementName:n.name}),l=t.processViewAttributes(n,r);l&&r.writer.setAttribute("htmlAttributes",l,s);const d=new ss(n.document).createDocumentFragment(n),u=o.data.processor.toData(d);r.writer.setAttribute("htmlContent",u,s);for(const{item:t}of o.editing.view.createRangeIn(n))r.consumable.consume(t,{name:!0});return s},converterPriority:"low"}),s.for("editingDowncast").elementToElement({model:{name:i.model,attributes:["htmlElementName","htmlAttributes","htmlContent"]},view:(t,{writer:e})=>{const n=t.getAttribute("htmlElementName"),i=e.createRawElement(n);return t.hasAttribute("htmlAttributes")&&MD(e,t.getAttribute("htmlAttributes"),i),i}}),s.for("dataDowncast").elementToElement({model:{name:i.model,attributes:["htmlElementName","htmlAttributes","htmlContent"]},view:(t,{writer:e})=>{const n=t.getAttribute("htmlElementName"),i=t.getAttribute("htmlContent"),o=e.createRawElement(n,null,((t,e)=>{e.setContentOf(t,i);const n=t.firstChild;for(n.remove();n.firstChild;)t.appendChild(n.firstChild)}));return t.hasAttribute("htmlAttributes")&&MD(e,t.getAttribute("htmlAttributes"),o),o}})}))}}class fS extends e{static get pluginName(){return"GeneralHtmlSupport"}static get requires(){return[JD,oS,rS,sS,aS,lS,dS,uS,hS,mS,pS]}init(){const t=this.editor,e=t.plugins.get(JD);e.loadAllowedConfig(t.config.get("htmlSupport.allow")||[]),e.loadDisallowedConfig(t.config.get("htmlSupport.disallow")||[])}getGhsAttributeNameForElement(t){const e=this.editor.plugins.get("DataSchema"),n=Array.from(e.getDefinitionsForView(t,!1));return n&&n.length&&n[0].isInline&&!n[0].isObject?n[0].model:"htmlAttributes"}addModelHtmlClass(t,e,n){const i=this.editor.model,o=this.getGhsAttributeNameForElement(t);i.change((t=>{for(const r of bS(i,n,o))kS(t,r,o,"classes",(t=>{for(const n of(0,jl.toArray)(e))t.add(n)}))}))}removeModelHtmlClass(t,e,n){const i=this.editor.model,o=this.getGhsAttributeNameForElement(t);i.change((t=>{for(const r of bS(i,n,o))kS(t,r,o,"classes",(t=>{for(const n of(0,jl.toArray)(e))t.delete(n)}))}))}setModelHtmlAttributes(t,e,n){const i=this.editor.model,o=this.getGhsAttributeNameForElement(t);i.change((t=>{for(const r of bS(i,n,o))kS(t,r,o,"attributes",(t=>{for(const[n,i]of Object.entries(e))t.set(n,i)}))}))}removeModelHtmlAttributes(t,e,n){const i=this.editor.model,o=this.getGhsAttributeNameForElement(t);i.change((t=>{for(const r of bS(i,n,o))kS(t,r,o,"attributes",(t=>{for(const n of(0,jl.toArray)(e))t.delete(n)}))}))}setModelHtmlStyles(t,e,n){const i=this.editor.model,o=this.getGhsAttributeNameForElement(t);i.change((t=>{for(const r of bS(i,n,o))kS(t,r,o,"styles",(t=>{for(const[n,i]of Object.entries(e))t.set(n,i)}))}))}removeModelHtmlStyles(t,e,n){const i=this.editor.model,o=this.getGhsAttributeNameForElement(t);i.change((t=>{for(const r of bS(i,n,o))kS(t,r,o,"styles",(t=>{for(const n of(0,jl.toArray)(e))t.delete(n)}))}))}}function*bS(t,e,n){if(e.is("documentSelection")&&e.isCollapsed)t.schema.checkAttributeInSelection(e,n)&&(yield e);else for(const i of function(t,e,n){return e.is("node")||e.is("$text")||e.is("$textProxy")?t.schema.checkAttribute(e,n)?[t.createRangeOn(e)]:[]:t.schema.getValidRanges(t.createSelection(e).getRanges(),n)}(t,e,n))yield*i.getItems({shallow:!0})}function kS(t,e,n,i,o){const r=e.getAttribute(n),s={};for(const t of["attributes","styles","classes"])if(t!=i)r&&r[t]&&(s[t]=r[t]);else{const e="classes"==t?new Set(r&&r[t]||[]):new Map(Object.entries(r&&r[t]||{}));o(e),e.size&&(s[t]="classes"==t?Array.from(e):Object.fromEntries(e))}Object.keys(s).length?e.is("documentSelection")?t.setSelectionAttribute(n,s):t.setAttribute(n,s,e):r&&(e.is("documentSelection")?t.removeSelectionAttribute(n):t.removeAttribute(n,e))}class xS extends e{static get pluginName(){return"HtmlComment"}init(){const t=this.editor;t.data.processor.skipComments=!1,t.model.schema.addAttributeCheck(((t,e)=>{if(t.endsWith("$root")&&e.startsWith("$comment"))return!0})),t.conversion.for("upcast").elementToMarker({view:"$comment",model:(t,{writer:e})=>{const n=this.editor.model.document.getRoot(),i=t.getCustomProperty("$rawContent"),o=`$comment:${(0,jl.uid)()}`;return e.setAttribute(o,i,n),o}}),t.conversion.for("dataDowncast").markerToElement({model:"$comment",view:(t,{writer:e})=>{const n=this.editor.model.document.getRoot(),i=t.markerName,o=n.getAttribute(i),r=e.createUIElement("$comment");return e.setCustomProperty("$rawContent",o,r),r}}),t.model.document.registerPostFixer((e=>{const n=t.model.document.getRoot(),i=t.model.document.differ.getChangedMarkers().filter((t=>t.name.startsWith("$comment"))),o=i.filter((t=>{const e=t.data.newRange;return e&&"$graveyard"===e.root.rootName}));if(0===o.length)return!1;for(const t of o)e.removeMarker(t.name),e.removeAttribute(t.name,n);return!0})),t.data.on("set",(()=>{for(const e of t.model.markers.getMarkersGroup("$comment"))this.removeHtmlComment(e.name)}),{priority:"high"}),t.model.on("deleteContent",((e,[n])=>{for(const e of n.getRanges()){const n=t.model.schema.getLimitElement(e),i=t.model.createPositionAt(n,0),o=t.model.createPositionAt(n,"end");let r;r=i.isTouching(e.start)&&o.isTouching(e.end)?this.getHtmlCommentsInRange(t.model.createRange(i,o)):this.getHtmlCommentsInRange(e,{skipBoundaries:!0});for(const t of r)this.removeHtmlComment(t)}}),{priority:"high"})}createHtmlComment(t,e){const n=(0,jl.uid)(),i=this.editor.model,o=i.document.getRoot(),r=`$comment:${n}`;return i.change((n=>{const i=n.createRange(t);return n.addMarker(r,{usingOperation:!0,affectsData:!0,range:i}),n.setAttribute(r,e,o),r}))}removeHtmlComment(t){const e=this.editor,n=e.model.document.getRoot(),i=e.model.markers.get(t);return!!i&&(e.model.change((e=>{e.removeMarker(i),e.removeAttribute(t,n)})),!0)}getHtmlCommentData(t){const e=this.editor,n=e.model.markers.get(t),i=e.model.document.getRoot();return n?{content:i.getAttribute(t),position:n.getStart()}:null}getHtmlCommentsInRange(t,{skipBoundaries:e=!1}={}){const n=!e;return Array.from(this.editor.model.markers.getMarkersGroup("$comment")).filter((e=>function(t,e){const i=t.getRange().start;return(i.isAfter(e.start)||n&&i.isEqual(e.start))&&(i.isBefore(e.end)||n&&i.isEqual(e.end))}(e,t))).map((t=>t.name))}}class wS extends i{refresh(){const t=this.editor.model,e=t.document;this.isEnabled=t.schema.checkAttributeInSelection(e.selection,"mention")}execute(t){const e=this.editor.model,n=e.document.selection,i="string"==typeof t.mention?{id:t.mention}:t.mention,o=i.id,r=t.range||n.getFirstRange(),s=t.text||o,a=AS({_text:s,id:o},i);if(1!=t.marker.length)throw new jl.CKEditorError("mentioncommand-incorrect-marker",this);if(o.charAt(0)!=t.marker)throw new jl.CKEditorError("mentioncommand-incorrect-id",this);e.change((t=>{const i=(0,jl.toMap)(n.getAttributes()),o=new Map(i.entries());o.set("mention",a),e.insertContent(t.createText(s,o),r),e.insertContent(t.createText(" ",i),r.start.getShiftedBy(s.length))}))}}class _S extends e{static get pluginName(){return"MentionEditing"}init(){const t=this.editor,e=t.model,n=e.document;e.schema.extend("$text",{allowAttributes:"mention"}),t.conversion.for("upcast").elementToAttribute({view:{name:"span",key:"data-mention",classes:"mention"},model:{key:"mention",value:t=>vS(t)}}),t.conversion.for("downcast").attributeToElement({model:"mention",view:yS}),t.conversion.for("downcast").add(CS),n.registerPostFixer((t=>function(t,e,n){const i=e.differ.getChanges();let o=!1;for(const e of i){const i=e.position;if("$text"==e.name){const e=i.textNode&&i.textNode.nextSibling;o=TS(i.textNode,t)||o,o=TS(e,t)||o,o=TS(i.nodeBefore,t)||o,o=TS(i.nodeAfter,t)||o}if("$text"!=e.name&&"insert"==e.type){const e=i.nodeAfter;for(const n of t.createRangeIn(e).getItems())o=TS(n,t)||o}if("insert"==e.type&&n.isInline(e.name)){const e=i.nodeAfter&&i.nodeAfter.nextSibling;o=TS(i.nodeBefore,t)||o,o=TS(e,t)||o}}return o}(t,n,e.schema))),n.registerPostFixer((t=>function(t,e){const n=e.differ.getChanges();let i=!1;for(const e of n)if("attribute"===e.type&&"mention"!=e.attributeKey){const n=e.range.start.nodeBefore,o=e.range.end.nodeAfter;for(const r of[n,o])ES(r)&&r.getAttribute(e.attributeKey)!=e.attributeNewValue&&(t.setAttribute(e.attributeKey,e.attributeNewValue,r),i=!0)}return i}(t,n))),n.registerPostFixer((t=>function(t,e){const n=e.selection,i=n.focus;if(n.isCollapsed&&n.hasAttribute("mention")&&function(t){const e=t.isAtStart;return t.nodeBefore&&t.nodeBefore.is("$text")||e}(i))return t.removeSelectionAttribute("mention"),!0}(t,n))),t.commands.add("mention",new wS(t))}}function AS(t,e){return Object.assign({uid:(0,jl.uid)()},t,e||{})}function vS(t,e){const n=t.getAttribute("data-mention"),i=t.getChild(0);if(!i)return;return AS({id:n,_text:i.data},e)}function CS(t){t.on("attribute:mention",((t,e,n)=>{const i=e.attributeNewValue;if(!e.item.is("$textProxy")||!i)return;const o=e.range.start;(o.textNode||o.nodeAfter).data!=i._text&&n.consumable.consume(e.item,t.name)}),{priority:"highest"})}function yS(t,{writer:e}){if(!t)return;const n={class:"mention","data-mention":t.id},i={id:t.uid,priority:20};return e.createAttributeElement("span",n,i)}function ES(t){if(!t||!t.is("$text")&&!t.is("$textProxy")||!t.hasAttribute("mention"))return!1;return t.data!=t.getAttribute("mention")._text}function TS(t,e){return!!ES(t)&&(e.removeAttribute("mention",t),!0)}var DS=__webpack_require__(6391),SS={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(DS.Z,SS);DS.Z.locals;class IS extends jc{constructor(t){super(t),this.extendTemplate({attributes:{class:["ck-mentions"],tabindex:"-1"}})}selectFirst(){this.select(0)}selectNext(){const t=this.selected,e=this.items.getIndex(t);this.select(e+1)}selectPrevious(){const t=this.selected,e=this.items.getIndex(t);this.select(e-1)}select(t){let e=0;t>0&&t{n?(this.domElement.classList.add("ck-on"),this.domElement.classList.remove("ck-off")):(this.domElement.classList.add("ck-off"),this.domElement.classList.remove("ck-on"))})),this.listenTo(this.domElement,"click",(()=>{this.fire("execute")}))}render(){super.render(),this.element=this.domElement}}class MS extends Fc{highlight(){this.children.first.isOn=!0}removeHighlight(){this.children.first.isOn=!1}}const NS=[jl.keyCodes.arrowup,jl.keyCodes.arrowdown,jl.keyCodes.esc],OS=[jl.keyCodes.enter,jl.keyCodes.tab];class RS extends e{static get pluginName(){return"MentionUI"}static get requires(){return[Tl]}constructor(t){super(t),this._mentionsView=this._createMentionView(),this._mentionsConfigurations=new Map,this._requestFeedDebounced=En(this._requestFeed,100),t.config.define("mention",{feeds:[]})}init(){const t=this.editor,e=t.config.get("mention.commitKeys")||OS,n=NS.concat(e);this._balloon=t.plugins.get(Tl),t.editing.view.document.on("keydown",((t,i)=>{var o;o=i.keyCode,n.includes(o)&&this._isUIVisible&&(i.preventDefault(),t.stop(),i.keyCode==jl.keyCodes.arrowdown&&this._mentionsView.selectNext(),i.keyCode==jl.keyCodes.arrowup&&this._mentionsView.selectPrevious(),e.includes(i.keyCode)&&this._mentionsView.executeSelected(),i.keyCode==jl.keyCodes.esc&&this._hideUIAndRemoveMarker())}),{priority:"highest"}),Za({emitter:this._mentionsView,activator:()=>this._isUIVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideUIAndRemoveMarker()});const i=t.config.get("mention.feeds");for(const t of i){const e=t.feed,n=t.marker;if(!FS(n))throw new jl.CKEditorError("mentionconfig-incorrect-marker",null,{marker:n});const i={marker:n,feedCallback:"function"==typeof e?e.bind(this.editor):jS(e),itemRenderer:t.itemRenderer};this._mentionsConfigurations.set(n,i)}this._setupTextWatcher(i),this.listenTo(t,"change:isReadOnly",(()=>{this._hideUIAndRemoveMarker()})),this.on("requestFeed:response",((t,e)=>this._handleFeedResponse(e))),this.on("requestFeed:error",(()=>this._hideUIAndRemoveMarker()))}destroy(){super.destroy(),this._mentionsView.destroy()}get _isUIVisible(){return this._balloon.visibleView===this._mentionsView}_createMentionView(){const t=this.editor.locale,e=new IS(t);return this._items=new jl.Collection,e.items.bindTo(this._items).using((n=>{const{item:i,marker:o}=n,r=this.editor.config.get("mention.dropdownLimit")||10;if(e.items.length>=r)return;const s=new MS(t),a=this._renderItem(i,o);return a.delegate("execute").to(s),s.children.add(a),s.item=i,s.marker=o,s.on("execute",(()=>{e.fire("execute",{item:i,marker:o})})),s})),e.on("execute",((t,e)=>{const n=this.editor,i=n.model,o=e.item,r=e.marker,s=n.model.markers.get("mention"),a=i.createPositionAt(i.document.selection.focus),c=i.createPositionAt(s.getStart()),l=i.createRange(c,a);this._hideUIAndRemoveMarker(),n.execute("mention",{mention:o,text:o.text,marker:r,range:l}),n.editing.view.focus()})),e}_getItemRenderer(t){const{itemRenderer:e}=this._mentionsConfigurations.get(t);return e}_requestFeed(t,e){this._lastRequested=e;const{feedCallback:n}=this._mentionsConfigurations.get(t),i=n(e);i instanceof Promise?i.then((n=>{this._lastRequested==e?this.fire("requestFeed:response",{feed:n,marker:t,feedText:e}):this.fire("requestFeed:discarded",{feed:n,marker:t,feedText:e})})).catch((e=>{this.fire("requestFeed:error",{error:e}),(0,jl.logWarning)("mention-feed-callback-error",{marker:t})})):this.fire("requestFeed:response",{feed:i,marker:t,feedText:e})}_setupTextWatcher(t){const e=this.editor,n=t.map((t=>({...t,pattern:zS(t.marker,t.minimumCharacters||0)}))),i=new Hd(e.model,function(t){const e=e=>{const n=LS(t,e);if(!n)return!1;let i=0;0!==n.position&&(i=n.position-1);const o=e.substring(i);return n.pattern.test(o)};return e}(n));i.on("matched",((t,i)=>{const o=LS(n,i.text),r=e.model.document.selection.focus,s=e.model.createPositionAt(r.parent,o.position);if(function(t){const e=t.textNode&&t.textNode.hasAttribute("mention"),n=t.nodeBefore;return e||n&&n.is("$text")&&n.hasAttribute("mention")}(r)||function(t){const e=t.nodeAfter;return e&&e.is("$text")&&e.hasAttribute("mention")}(s))return void this._hideUIAndRemoveMarker();const a=function(t,e){let n=0;0!==t.position&&(n=t.position-1);const i=zS(t.marker,0),o=e.substring(n).match(i);return o[2]}(o,i.text),c=o.marker.length+a.length,l=r.getShiftedBy(-c),d=r.getShiftedBy(-a.length),u=e.model.createRange(l,d);if(VS(e)){const t=e.model.markers.get("mention");e.model.change((e=>{e.updateMarker(t,{range:u})}))}else e.model.change((t=>{t.addMarker("mention",{range:u,usingOperation:!1,affectsData:!1})}));this._requestFeedDebounced(o.marker,a)})),i.on("unmatched",(()=>{this._hideUIAndRemoveMarker()}));const o=e.commands.get("mention");return i.bind("isEnabled").to(o),i}_handleFeedResponse(t){const{feed:e,marker:n}=t;if(!VS(this.editor))return;this._items.clear();for(const t of e){const e="object"!=typeof t?{id:t,text:t}:t;this._items.add({item:e,marker:n})}const i=this.editor.model.markers.get("mention");this._items.length?this._showOrUpdateUI(i):this._hideUIAndRemoveMarker()}_showOrUpdateUI(t){this._isUIVisible?this._balloon.updatePosition(this._getBalloonPanelPositionData(t,this._mentionsView.position)):this._balloon.add({view:this._mentionsView,position:this._getBalloonPanelPositionData(t,this._mentionsView.position),singleViewMode:!0}),this._mentionsView.position=this._balloon.view.position,this._mentionsView.selectFirst()}_hideUIAndRemoveMarker(){this._balloon.hasView(this._mentionsView)&&this._balloon.remove(this._mentionsView),VS(this.editor)&&this.editor.model.change((t=>t.removeMarker("mention"))),this._mentionsView.position=void 0}_renderItem(t,e){const n=this.editor;let i,o=t.id;const r=this._getItemRenderer(e);if(r){const e=r(t);"string"!=typeof e?i=new BS(n.locale,e):o=e}if(!i){const t=new ic(n.locale);t.label=o,t.withText=!0,i=t}return i}_getBalloonPanelPositionData(t,e){const n=this.editor,i=n.editing,o=i.view.domConverter,r=i.mapper;return{target:()=>{let e=t.getRange();"$graveyard"==e.start.root.rootName&&(e=n.model.document.selection.getFirstRange());const i=r.toViewRange(e);return jl.Rect.getDomRangeRects(o.viewRangeToDom(i)).pop()},limiter:()=>{const t=this.editor.editing.view,e=t.document.selection.editableElement;return e?t.domConverter.mapViewToDom(e.root):null},positions:PS(e)}}}function PS(t){const e={caret_se:t=>({top:t.bottom+3,left:t.right,name:"caret_se",config:{withArrow:!1}}),caret_ne:(t,e)=>({top:t.top-e.height-3,left:t.right,name:"caret_ne",config:{withArrow:!1}}),caret_sw:(t,e)=>({top:t.bottom+3,left:t.right-e.width,name:"caret_sw",config:{withArrow:!1}}),caret_nw:(t,e)=>({top:t.top-e.height-3,left:t.right-e.width,name:"caret_nw",config:{withArrow:!1}})};return Object.prototype.hasOwnProperty.call(e,t)?[e[t]]:[e.caret_se,e.caret_sw,e.caret_ne,e.caret_nw]}function LS(t,e){let n;for(const i of t){const t=e.lastIndexOf(i.marker);t>0&&!e.substring(t-1).match(i.pattern)||(!n||t>=n.position)&&(n={marker:i.marker,position:t,minimumCharacters:i.minimumCharacters,pattern:i.pattern})}return n}function zS(t,e){const n=0==e?"*":`{${e},}`,i=jl.env.features.isRegExpUnicodePropertySupported?"\\p{Ps}\\p{Pi}\"'":"\\(\\[{\"'";return new RegExp(`(?:^|[ ${i}])([${t}])(.${n})$`,"u")}function jS(t){return e=>t.filter((t=>("string"==typeof t?t:String(t.id)).toLowerCase().includes(e.toLowerCase())))}function FS(t){return t&&1==t.length}function VS(t){return t.model.markers.has("mention")}var US=__webpack_require__(7583),HS={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(US.Z,HS);US.Z.locals;class qS extends e{toMentionAttribute(t,e){return vS(t,e)}static get pluginName(){return"Mention"}static get requires(){return[_S,RS]}}class WS extends i{refresh(){const t=this.editor.model,e=t.schema,n=t.document.selection;this.isEnabled=function(t,e,n){const i=function(t,e){const n=Lf(t,e),i=n.start.parent;if(i.isEmpty&&!i.is("element","$root"))return i.parent;return i}(t,n);return e.checkChild(i,"pageBreak")}(n,e,t)}execute(){const t=this.editor.model;t.change((e=>{const n=e.createElement("pageBreak");t.insertObject(n,null,null,{setSelection:"after"})}))}}var GS=__webpack_require__(6448),ZS={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(GS.Z,ZS);GS.Z.locals;class KS extends e{static get pluginName(){return"PageBreakEditing"}init(){const t=this.editor,e=t.model.schema,n=t.t,i=t.conversion;e.register("pageBreak",{inheritAllFrom:"$blockObject"}),i.for("dataDowncast").elementToStructure({model:"pageBreak",view:(t,{writer:e})=>e.createContainerElement("div",{class:"page-break",style:"page-break-after: always"},e.createContainerElement("span",{style:"display: none"}))}),i.for("editingDowncast").elementToStructure({model:"pageBreak",view:(t,{writer:e})=>{const i=n("Page break"),o=e.createContainerElement("div"),r=e.createRawElement("span",{class:"page-break__label"},(function(t){t.innerText=n("Page break")}));return e.addClass("page-break",o),e.insert(e.createPositionAt(o,0),r),function(t,e,n){return e.setCustomProperty("pageBreak",!0,t),Mf(t,e,{label:n})}(o,e,i)}}),i.for("upcast").elementToElement({view:t=>{const e="always"==t.getStyle("page-break-before"),n="always"==t.getStyle("page-break-after");if(e||n){if(1==t.childCount){const e=t.getChild(0);if(!e.is("element","span")||"none"!=e.getStyle("display"))return}else if(t.childCount>1)return;return{name:!0}}},model:"pageBreak",converterPriority:"high"}),t.commands.add("pageBreak",new WS(t))}}class $S extends e{static get pluginName(){return"PageBreakUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("pageBreak",(n=>{const i=t.commands.get("pageBreak"),o=new ic(n);return o.set({label:e("Page break"),icon:'',tooltip:!0}),o.bind("isEnabled").to(i,"isEnabled"),this.listenTo(o,"execute",(()=>{t.execute("pageBreak"),t.editing.view.focus()})),o}))}}class YS extends e{static get requires(){return[KS,$S,Xf]}static get pluginName(){return"PageBreak"}}function JS(t,e,n,{blockElements:i,inlineObjectElements:o}){let r=n.createPositionAt(t,"forward"==e?"after":"before");return r=r.getLastMatchingPosition((({item:t})=>t.is("element")&&!i.includes(t.name)&&!o.includes(t.name)),{direction:e}),"forward"==e?r.nodeAfter:r.nodeBefore}function QS(t,e){return!!t&&t.is("element")&&e.includes(t.name)}function XS(t,e){if(!t.childCount)return;const n=new ss(t.document),i=function(t,e){const n=e.createRangeIn(t),i=new E({name:/^p|h\d+$/,styles:{"mso-list":/.*/}}),o=[];for(const t of n)if("elementStart"===t.type&&i.match(t.item)){const e=nI(t.item);o.push({element:t.item,id:e.id,order:e.order,indent:e.indent})}return o}(t,n);if(!i.length)return;let o=null,r=1;i.forEach(((t,s)=>{const a=function(t,e){if(!t)return!0;if(t.id!==e.id)return e.indent-t.indent!=1;const n=e.element.previousSibling;if(!n)return!0;return i=n,!(i.is("element","ol")||i.is("element","ul"));var i}(i[s-1],t),c=a?null:i[s-1],l=(u=t,(d=c)?u.indent-d.indent:u.indent-1);var d,u;if(a&&(o=null,r=1),!o||0!==l){const i=function(t,e){const n=new RegExp(`@list l${t.id}:level${t.indent}\\s*({[^}]*)`,"gi"),i=/mso-level-number-format:([^;]{0,100});/gi,o=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,r=n.exec(e);let s="decimal",a="ol",c=null;if(r&&r[1]){const e=i.exec(r[1]);if(e&&e[1]&&(s=e[1].trim(),a="bullet"!==s&&"image"!==s?"ol":"ul"),"bullet"===s){const e=function(t){const e=function(t){if(t.getChild(0).is("$text"))return null;for(const e of t.getChildren()){if(!e.is("element","span"))continue;const t=e.getChild(0);return t.is("$text")?t:t.getChild(0)}}(t);if(!e)return null;const n=e._data;if("o"===n)return"circle";if("·"===n)return"disc";if("§"===n)return"square";return null}(t.element);e&&(s=e)}else{const t=o.exec(r[1]);t&&t[1]&&(c=parseInt(t[1]))}}return{type:a,startIndex:c,style:tI(s)}}(t,e);if(o){if(t.indent>r){const t=o.getChild(o.childCount-1),e=t.getChild(t.childCount-1);o=eI(i,e,n),r+=1}else if(t.indent1&&n.setAttribute("start",t.startIndex,o),o}function nI(t){const e={},n=t.getStyle("mso-list");if(n){const t=n.match(/(^|\s{1,100})l(\d+)/i),i=n.match(/\s{0,100}lfo(\d+)/i),o=n.match(/\s{0,100}level(\d+)/i);t&&i&&o&&(e.id=t[2],e.order=i[1],e.indent=o[1])}return e}const iI=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class oI{constructor(t){this.document=t}isActive(t){return iI.test(t)}execute(t){const e=new ss(this.document),{body:n}=t._parsedData;!function(t,e){for(const n of t.getChildren())if(n.is("element","b")&&"normal"===n.getStyle("font-weight")){const i=t.getChildIndex(n);e.remove(n),e.insertChild(i,n.getChildren(),t)}}(n,e),function(t,e){for(const n of e.createRangeIn(t)){const t=n.item;if(t.is("element","li")){const n=t.getChild(0);n&&n.is("element","p")&&e.unwrapElement(n)}}}(n,e),function(t,e){const n=new me(e.document.stylesProcessor),i=new on(n,{renderingMode:"data"}),o=i.blockElements,r=i.inlineObjectElements,s=[];for(const n of e.createRangeIn(t)){const t=n.item;if(t.is("element","br")){const n=JS(t,"forward",e,{blockElements:o,inlineObjectElements:r}),i=JS(t,"backward",e,{blockElements:o,inlineObjectElements:r}),a=QS(n,o);(QS(i,o)||a)&&s.push(t)}}for(const t of s)t.hasClass("Apple-interchange-newline")?e.remove(t):e.replace(t,e.createElement("p"))}(n,e),t.content=n}}function rI(t,e){if(!t.childCount)return;const n=new ss,i=function(t,e){const n=e.createRangeIn(t),i=new E({name:/v:(.+)/}),o=[];for(const t of n){if("elementStart"!=t.type)continue;const e=t.item,n=e.previousSibling&&e.previousSibling.name||null;i.match(e)&&e.getAttribute("o:gfxdata")&&"v:shapetype"!==n&&o.push(t.item.getAttribute("id"))}return o}(t,n);!function(t,e,n){const i=n.createRangeIn(e),o=new E({name:"img"}),r=[];for(const e of i)if(o.match(e.item)){const n=e.item,i=n.getAttribute("v:shapes")?n.getAttribute("v:shapes").split(" "):[];i.length&&i.every((e=>t.indexOf(e)>-1))?r.push(n):n.getAttribute("src")||r.push(n)}for(const t of r)n.remove(t)}(i,t,n),function(t,e){const n=e.createRangeIn(t),i=new E({name:/v:(.+)/}),o=[];for(const t of n)"elementStart"==t.type&&i.match(t.item)&&o.push(t.item);for(const t of o)e.remove(t)}(t,n);const o=function(t,e){const n=e.createRangeIn(t),i=new E({name:"img"}),o=[];for(const t of n)i.match(t.item)&&t.item.getAttribute("src").startsWith("file://")&&o.push(t.item);return o}(t,n);o.length&&function(t,e,n){if(t.length===e.length)for(let i=0;iString.fromCharCode(parseInt(t,16)))).join(""))}const aI=//i,cI=/xmlns:o="urn:schemas-microsoft-com/i;class lI{constructor(t){this.document=t}isActive(t){return aI.test(t)||cI.test(t)}execute(t){const{body:e,stylesString:n}=t._parsedData;XS(e,n),rI(e,t.dataTransfer.getData("text/rtf")),t.content=e}}function dI(t){return t.replace(/(\s+)<\/span>/g,((t,e)=>1===e.length?" ":Array(e.length+1).join(" ").substr(0,e.length)))}function uI(t,e){const n=new DOMParser,i=function(t){return dI(dI(t)).replace(/([^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<\/span>/g,"").replace(/ <\//g," ").replace(/ <\/o:p>/g," ").replace(/( |\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)<")}(function(t){const e="",n="",i=t.indexOf(e);if(i<0)return t;const o=t.indexOf(n,i+e.length);return t.substring(0,i+e.length)+(o>=0?t.substring(o):"")}(t=t.replace(/