/** * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */ (function(e){e.en=Object.assign(e.en||{},{a:'Cannot upload file:',b:'Italic',c:'Bold',d:'Code',e:'Enter image caption',f:'image widget',g:'Block quote',h:'Full size image',i:'Side image',j:'Left aligned image',k:'Centered image',l:'Right aligned image',m:'Choose heading',n:'Heading',o:'Link',p:'Insert table',q:'Header column',r:'Insert column before',s:'Insert column after',t:'Delete column',u:'Column',v:'Header row',w:'Insert row below',x:'Insert row above',y:'Delete row',z:'Row',aa:'Merge cell up',ab:'Merge cell right',ac:'Merge cell down',ad:'Merge cell left',ae:'Split cell vertically',af:'Split cell horizontally',ag:'Merge cells',ah:'Numbered List',ai:'Bulleted List',aj:'Upload in progress',ak:'Change image text alternative',al:'Upload failed',am:'Undo',an:'Redo',ao:'Save',ap:'Cancel',aq:'Text alternative',ar:'Insert image',as:'Paragraph',at:'Heading 1',au:'Heading 2',av:'Heading 3',aw:'Unlink',ax:'Edit link',ay:'Open link in new tab',az:'This link has no URL',ba:'Link URL',bb:'Rich Text Editor, %0',bc:'Rich Text Editor'})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),function(e,t){'object'==typeof exports&&'object'==typeof module?module.exports=t():'function'==typeof define&&define.amd?define([],t):'object'==typeof exports?exports.BalloonEditor=t():e.BalloonEditor=t()}('undefined'==typeof self?this:self,function(){var e=String.fromCharCode;return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e['default']}:function(){return e};return t.d(n,'a',n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p='',t(t.s=8)}([function(e,t,n){function o(e,t){for(var n=0;n'},function(e){e.exports=''},function(t,n,o){'use strict';function i(e){const t=e.match(/^([^:]+):/);return t?e+` Read more: ${Vd}#error-${t[1]}\n`:e}function r(){let e='e';for(let t=0;8>t;t++)e+=vd(65536*(1+Math.random())).toString(16).substring(1);return e}function a(e,t){return e[Ld]&&e[Ld][t]?e[Ld][t].emitter:null}function s(e,t){e[zd]||(e[zd]=t||r())}function l(e){return e[zd]}function d(e){return e._events||Object.defineProperty(e,'_events',{value:{}}),e._events}function c(){return{callbacks:[],childEvents:[]}}function u(e,t){const n=d(e);if(n[t])return;let o=t,i=null;const r=[];for(;''!==o&&!n[o];)n[o]=c(),r.push(n[o]),i&&n[o].childEvents.push(i),i=o,o=o.substr(0,o.lastIndexOf(':'));if(''!==o){for(const e of r)e.callbacks=n[o].callbacks.slice();n[o].childEvents.push(i)}}function p(e,t){const n=d(e)[t];if(!n)return[];let o=[n.callbacks];for(let r=0;r{Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)).forEach((n)=>{if(!(n in e.prototype)){const o=Object.getOwnPropertyDescriptor(t,n);o.enumerable=!1,Object.defineProperty(e.prototype,n,o)}})})}function b(e){var t=-1,n=e?e.length:0;for(this.clear();++te.add(t))}function B(e){return'string'==typeof e?[new up(e)]:(E(e)||(e=[e]),Array.from(e).map((e)=>'string'==typeof e?new up(e):e instanceof pp?new up(e.data):e))}function M(){const e=[...this.getChildren()],t=e[this.childCount-1];if(t&&t.is('element','br'))return this.childCount;for(const t of e)if(!t.is('uiElement'))return null;return this.childCount}function L(e,t,n){if(!Gd(n))return!1;var o=typeof t;return!('number'==o?!(Dc(n)&&Qc(t,n.length)):!('string'==o&&t in n))&&Wd(n[t],e)}function z(e){e=null==e?e:Object(e);var t=[];for(var n in e)t.push(n);return t}function j(e){Gp in e||(Object.defineProperty(e,Gp,{value:new Map}),Object.defineProperty(e,Jp,{value:new Map}),Object.defineProperty(e,Qp,{value:new Map}))}function q(...e){const t=$(...e),n=Array.from(this._bindings.keys()),o=n.length;if(!t.callback&&1{if(e.properties.length&&e.properties.length!==o)throw new Fd('observable-bind-to-properties-length: The number of properties must match.');e.properties.length||(e.properties=this._bindProperties)}),this._to=t.to,t.callback&&(this._bindings.get(n[0]).callback=t.callback),Q(this._observable,this._to),G(this),this._bindProperties.forEach((e)=>{J(this._observable,e)})}function W(e,t,n){if(1[e,t]);return Array.prototype.concat.apply([],n)}function U(e){return e.every((e)=>'string'==typeof e)}function $(...e){if(!e.length)throw new Fd('observable-bind-to-parse-error: Invalid argument syntax in `to()`.');const t={to:[]};let n;return'function'==typeof e[e.length-1]&&(t.callback=e.pop()),e.forEach((e)=>{if('string'==typeof e)n.properties.push(e);else if('object'==typeof e)n={observable:e,properties:[]},t.to.push(n);else throw new Fd('observable-bind-to-parse-error: Invalid argument syntax in `to()`.')}),t}function K(e,t,n,o){const i=e[Jp],r=i.get(n),a=r||{};a[o]||(a[o]=new Set),a[o].add(t),r||i.set(n,a)}function G(e){let t;e._bindings.forEach((n,o)=>{e._to.forEach((i)=>{t=i.properties[n.callback?0:e._bindProperties.indexOf(o)],n.to.push([i.observable,t]),K(e._observable,n,i.observable,t)})})}function J(e,t){const n=e[Qp],o=n.get(t);let i;o.callback?i=o.callback.apply(e,o.to.map((e)=>e[0][e[1]])):(i=o.to[0],i=i[0][i[1]]),e.hasOwnProperty(t)?e[t]=i:e.set(t,i)}function Q(e,t){t.forEach((t)=>{const n=e[Jp];let o;n.get(t.observable)||e.listenTo(t.observable,'change',(i,r)=>{o=n.get(t.observable)[r],o&&o.forEach((t)=>{J(e,t.property)})})})}function Y(e){return!!(e.item.is('attributeElement')||e.item.is('uiElement'))}function X(e){let t=0;for(const n of e)t++;return t}function Z(){if(ee(this))return null;let e=this.parent;for(;e&&e.is('attributeElement');){if(1!e.is('uiElement')).length}function te(){return null}function ne(e){let t;if('string'!=typeof e)t=e.keyCode+(e.altKey?km.alt:0)+(e.ctrlKey?km.ctrl:0)+(e.shiftKey?km.shift:0);else if(t=km[e.toLowerCase()],!t)throw new Fd('keyboard-unknown-key: Unknown key name.',{key:e});return t}function oe(e){return'string'==typeof e&&(e=re(e)),e.map((e)=>'string'==typeof e?ne(e):e).reduce((e,t)=>t+e,0)}function ie(e){return fm.isMac?re(e).map((e)=>bm[e.toLowerCase()]||e).reduce((e,t)=>e.slice(-1)in hm?e+t:e+'+'+t):e}function re(e){return e.split(/\s*\+\s*/)}function ae(e){e.document.on('keydown',(t,n)=>le(t,n,e.domConverter))}function se(){return null}function le(e,t,n){if(t.keyCode==km.arrowright){const e=t.domTarget.ownerDocument.defaultView.getSelection(),o=1==e.rangeCount&&e.getRangeAt(0).collapsed;if(o||t.shiftKey){const t=e.focusNode,i=e.focusOffset,r=n.domPositionToView(t,i);if(null===r)return;let a=!1;const s=r.getLastMatchingPosition((e)=>(e.item.is('uiElement')&&(a=!0),!!(e.item.is('uiElement')||e.item.is('attributeElement'))));if(a){const t=n.viewPositionToDom(s);o?e.collapse(t.parent,t.offset):e.extend(t.parent,t.offset)}}}}function de(e){return'string'==typeof e?[new up(e)]:(E(e)||(e=[e]),Array.from(e).map((e)=>'string'==typeof e?new up(e):e instanceof pp?new up(e.data):e))}function ce(e){return Array.from(e.getChildren()).some((e)=>!e.is('uiElement'))}function ue(e){let t=e.parent;for(;!ke(t);){if(!t)return;t=t.parent}return t}function pe(e,t){if(e.priorityt.priority)&&e.getIdentity()t instanceof e))throw new Fd('view-writer-insert-invalid-node');t.is('text')||be(t.getChildren())}}function ke(e){return e&&(e.is('containerElement')||e.is('documentFragment'))}function _e(e){const t=ue(e.start),n=ue(e.end);if(!t||!n||t!==n)throw new Fd('view-writer-invalid-range-container')}function we(e,t){return null===e.id&&null===t.id}function ve(e){return e instanceof Text&&e.data.substr(0,Am)===Tm}function ye(e){return e.data.length==Am&&ve(e)}function xe(e){return ve(e)?e.data.slice(Am):e.data}function Ce(e,t){let n=Pm.get(t);return n||(n=t(window.document),Pm.set(t,n)),e.isEqualNode(n)}function Ae(e){e.document.on('keydown',Te)}function Te(e,t){if(t.keyCode==km.arrowleft){const e=t.domTarget.ownerDocument.defaultView.getSelection();if(1==e.rangeCount&&e.getRangeAt(0).collapsed){const t=e.getRangeAt(0).startContainer,n=e.getRangeAt(0).startOffset;ve(t)&&n<=Am&&e.collapse(t,0)}}}function Pe(e,t,o){function i(n){const i=(c[n-1]===void 0?-1:c[n-1])+1,u=c[n+1]===void 0?-1:c[n+1],p=i>u?-1:1;d[n+p]&&(d[n]=d[n+p].slice(0)),d[n]||(d[n]=[]),d[n].push(i>u?r:a);let m=_d(i,u),g=m-n;for(;gn;m--)c[m]=i(m);c[n]=i(n),u++}while(c[n]!==l);return d[n].slice(1)}function Ee(e,t,n){e.insertBefore(n,e.childNodes[t]||null)}function Se(e){const t=e.parentNode;t&&t.removeChild(e)}function Oe(e){return'[object Text]'==Object.prototype.toString.call(e)}function Re(e){if(e){if(e.defaultView)return e instanceof e.defaultView.Document;if(e.ownerDocument&&e.ownerDocument.defaultView)return e instanceof e.ownerDocument.defaultView.Node}return!1}function Ie(e,t){if(e===t)return[];const n=Ve(e,t);return De(t,n)}function Ve(e,t){const n=Fe(e,t),o=Ne(e,n),i=Ne(t,n),r=Fe(o,i),a=e.length-r,s=t.length-r;return{firstIndex:n,lastIndexOld:a,lastIndexNew:s}}function Fe(e,t){for(let n=0;n<_d(e.length,t.length);n++)if(e[n]!==t[n])return n}function Ne(e,t){return e.substring(t).split('').reverse().join('')}function De(e,t){const n=[],{firstIndex:o,lastIndexOld:i,lastIndexNew:r}=t;return 0e.hasAttribute('contenteditable'));return!t||'true'==t.getAttribute('contenteditable')}function Me(e,t){return Re(e)&&Re(t)&&!Oe(e)&&!Oe(t)&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}function Le(e,t,n){if(t===n)return!0;return Oe(t)&&Oe(n)?t.data===n.data:!!(Ce(t,e)&&Ce(n,e))}function ze(e){let t=0;for(;e.previousSibling;)e=e.previousSibling,t++;return t}function je(e){const t=[];for(;e&&e.nodeType!=Node.DOCUMENT_NODE;)t.unshift(e),e=e.parentNode;return t}function qe(e,t){const n=je(e),o=je(t);let r=0;for(;n[r]==o[r]&&n[r];)r++;return 0==r?null:n[r-1]}function We(e,t,n){let o=je(e);return n&&(o=o.slice(o.indexOf(n)+1)),o.some((e)=>e.tagName&&t.includes(e.tagName.toLowerCase()))}function He(e,t){for(;e&&e!=Sm.document;)t(e),e=e.parentNode}function Ue(e){return'[object Window]'==Object.prototype.toString.apply(e)}function $e(e){return e['data-ck-expando']||(e['data-ck-expando']=r())}function Ke(e){var t=-1,n=e?e.length:0;for(this.__data__=new wc;++t=t||0>n||f&&o>=_}function s(){var e=ag();return a(e)?l(e):void(v=setTimeout(s,r(e)))}function l(e){return(clearTimeout(v),v=void 0,h&&b)?o(e):(b=k=void 0,w)}function d(){void 0!==v&&clearTimeout(v),p=m=0,b=k=v=void 0}function c(){return void 0===v?w:l(ag())}function u(){var e=ag(),n=a(e);if(b=arguments,k=this,p=e,n){if(void 0===v)return i(p);if(f)return clearTimeout(v),v=setTimeout(s,t),o(p)}return void 0===v&&(v=setTimeout(s,t)),w}var p=0,m=0,g=!1,f=!1,h=!0,b,k,_,w,v;if('function'!=typeof e)throw new TypeError(sg);return t=Pp(t)||0,Gd(n)&&(g=!!n.leading,f='maxWait'in n,_=f?lg(Pp(n.maxWait)||0,t):_,h='trailing'in n?!!n.trailing:h),u.cancel=d,u.flush=c,u}function Ye(e){return e==km.arrowright||e==km.arrowleft||e==km.arrowup||e==km.arrowdown}function Xe(e){return'[object Range]'==Object.prototype.toString.apply(e)}function Ze(e){const t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}function et(e,t){for(const n of kg)e[n]=t[n]}function tt(e){return!!Om(e)&&e===e.ownerDocument.body}function nt({target:e,viewportOffset:t=0}){const n=ct(e);for(let o=n,i=null;o;){let r;r=o==n?ut(e):ut(i),rt(r,()=>pt(e,o));const a=pt(e,o);if(it(o,a,t),o.parent==o)o=null;else if(i=o.frameElement,o=o.parent,!i)return}}function it(e,t,n){const o=t.clone().moveBy(0,n),i=t.clone().moveBy(0,-n),r=new bg(e).excludeScrollbarsAndBorders();if(![i,o].every((e)=>r.contains(e))){let{scrollX:a,scrollY:s}=e;st(i,r)?s-=r.top-t.top+n:at(o,r)&&(s+=t.bottom-r.bottom+n),lt(t,r)?a-=r.left-t.left+n:dt(t,r)&&(a+=t.right-r.right+n),e.scrollTo(a,s)}}function rt(e,t){const n=ct(e);for(let o,i;e!=n.document.body;)i=t(),o=new bg(e).excludeScrollbarsAndBorders(),o.contains(i)||(st(i,o)?e.scrollTop-=o.top-i.top:at(i,o)&&(e.scrollTop+=i.bottom-o.bottom),lt(i,o)?e.scrollLeft-=o.left-i.left:dt(i,o)&&(e.scrollLeft+=i.right-o.right)),e=e.parentNode}function at(e,t){return e.bottom>t.bottom}function st(e,t){return e.topt.right}function ct(e){return Xe(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function ut(e){if(Xe(e)){let t=e.commonAncestorContainer;return Oe(t)&&(t=t.parentNode),t}return e.parentNode}function pt(e,t){const n=ct(e),o=new bg(e);if(n===t)return o;for(let i=n;i!=t;){const e=i.frameElement,t=new bg(e).excludeScrollbarsAndBorders();o.moveBy(t.left,t.top),i=i.parent}return o}function mt(e){return Rd(e)?P(e):new Map(e)}function gt(e){return'string'==typeof e?[new vg(e)]:(E(e)||(e=[e]),Array.from(e).map((e)=>'string'==typeof e?new vg(e):e instanceof yg?new vg(e.data,e.getAttributes()):e))}function ft(e,t,n,o,i){return{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:o,length:i}}}function ht(e){const t=e.split(':');return 1{if(o.containsItem(e)){const t=n.toViewElement(e);return!!t.getCustomProperty('addHighlight')}});return!r}function kt(e,t){return!t.has(e)&&(t.add(e),e.document.model.schema.isBlock(e)&&e.parent)}function _t(e,t){const n=e.parent.getAncestors({parentFirst:!0,includeSelf:!0}),o=n.find((e)=>kt(e,t));return n.forEach((e)=>t.add(e)),o}function wt(){const e=new Set(['insert','move','remove','reinsert']);this.listenTo(this.root.document.model,'applyOperation',(t,n)=>{const o=n[0];!o.isDocumentOperation||e.has(o.type)&&vt.call(this,o)},{priority:'low'})}function vt(e){const t=e.type,n=e.delta.batch;let o,i;'insert'==t?o=Eg.createFromPositionAndShift(e.position,e.nodes.maxOffset):(o=Eg.createFromPositionAndShift(e.getMovedRangeStart(),e.howMany),i=e.sourcePosition);const r=o.end.offset-o.start.offset;let a=o.start;('move'==t||'remove'==t||'reinsert'==t)&&(a=a._getTransformedByInsertion(i,r));const s=this._getTransformedByDocumentChange(t,e.delta.type,a,r,i);('move'==t||'remove'==t||'reinsert'==t)&&3==s.length&&(s[2]=o);const l=Eg.createFromRanges(s),d=!l.isEqual(this),c=this.containsPosition(a),u=i&&(this.containsPosition(i)||this.start.isEqual(i));if(d){const e=Eg.createFromRange(this);this.start=l.start,this.end=l.end,this.fire('change:range',e,{type:t,batch:n,range:o,sourcePosition:i})}else(c||u)&&this.fire('change:content',Eg.createFromRange(this),{type:t,batch:n,range:o,sourcePosition:i})}function yt(e){return e instanceof yg||e instanceof vg?e.getAttributes():null}function xt(e,t){const n=e.document.differ;for(const o of n.getChanges()){if('insert'!=o.type)continue;const n=o.position.parent,i=o.length===n.maxOffset;i&&e.enqueueChange(t,(e)=>{const t=Array.from(n.getAttributeKeys()).filter((e)=>e.startsWith(Fg));for(const o of t)e.removeAttribute(o,n)})}}function Ct(e){return e=Bg(e),e.view=Pt(e.view,'container'),(t)=>{t.on('insert:'+e.model,Rt(e.view),{priority:e.converterPriority||'normal'})}}function At(e){e=Bg(e);const t=e.model.key?e.model.key:e.model;let n='attribute:'+t;if(e.model.name&&(n+=':'+e.model.name),e.model.values)for(const t of e.model.values)e.view[t]=Pt(e.view[t],'attribute');else e.view=Pt(e.view,'attribute');const o=St(e);return(t)=>{t.on(n,Nt(o),{priority:e.converterPriority||'normal'})}}function Tt(e){e=Bg(e);const t=e.model.key?e.model.key:e.model;let n='attribute:'+t;if(e.model.name&&(n+=':'+e.model.name),e.model.values)for(const t of e.model.values)e.view[t]=Ot(e.view[t]);else e.view=Ot(e.view);const o=St(e);return(t)=>{t.on(n,Ft(o),{priority:e.converterPriority||'normal'})}}function Pt(e,t){return'function'==typeof e?e:(n,o)=>Et(e,o,t)}function Et(e,t,n){'string'==typeof e&&(e={name:e});let o;const i=Object.assign({},e.attributes);if('container'==n)o=t.createContainerElement(e.name,i);else if('attribute'==n){const n={priority:e.priority||um.DEFAULT_PRIORITY};o=t.createAttributeElement(e.name,i,n)}else o=t.createUIElement(e.name,i);if(e.styles){const n=Object.keys(e.styles);for(const i of n)t.setStyle(i,e.styles[i],o)}if(e.classes){const n=e.classes;if('string'==typeof n)t.addClass(n,o);else for(const e of n)t.addClass(e,o)}return o}function St(e){return e.model.values?(t,n)=>{const o=e.view[t];return o?o(t,n):null}:e.view}function Ot(e){return'string'==typeof e?(t)=>({key:e,value:t}):'object'==typeof e?e.value?()=>e:(t)=>({key:e.key,value:t}):e}function Rt(e){return(t,n,o)=>{const i=e(n.item,o.writer);if(i&&o.consumable.consume(n.item,'insert')){const e=o.mapper.toViewPosition(n.range.start);o.mapper.bindElements(n.item,i),o.writer.insert(e,i)}}}function It(){return(e,t,n)=>{if(n.consumable.consume(t.item,'insert')){const e=n.writer,o=n.mapper.toViewPosition(t.range.start),i=e.createText(t.item.data);e.insert(o,i)}}}function Vt(){return(e,t,n)=>{const o=n.mapper.toViewPosition(t.position),i=t.position.getShiftedBy(t.length),r=n.mapper.toViewPosition(i,{isPhantom:!0}),a=new rm(o,r),s=n.writer.remove(a.getTrimmed());for(const o of rm.createIn(s).getItems())n.mapper.unbindViewElement(o)}}function Ft(e){return e=e||((e,t)=>({value:e,key:t.attributeKey})),(t,n,o)=>{const i=e(n.attributeOldValue,n),r=e(n.attributeNewValue,n);if((i||r)&&o.consumable.consume(n.item,t.name)){const e=o.mapper.toViewElement(n.item),t=o.writer;if(null!==n.attributeOldValue&&i)if('class'==i.key){const n=Array.isArray(i.value)?i.value:[i.value];for(const o of n)t.removeClass(o,e)}else if('style'==i.key){const n=Object.keys(i.value);for(const o of n)t.removeStyle(o,e)}else t.removeAttribute(i.key,e);if(null!==n.attributeNewValue&&r)if('class'==r.key){const n=Array.isArray(r.value)?r.value:[r.value];for(const o of n)t.addClass(o,e)}else if('style'==r.key){const n=Object.keys(r.value);for(const o of n)t.setStyle(o,r.value[o],e)}else t.setAttribute(r.key,r.value,e)}}}function Nt(e){return(t,n,o)=>{const i=e(n.attributeOldValue,o.writer),r=e(n.attributeNewValue,o.writer);if((i||r)&&o.consumable.consume(n.item,t.name)){const e=o.writer,t=e.document.selection;if(n.item instanceof Ig||n.item instanceof Ng)e.wrap(t.getFirstRange(),r);else{let t=o.mapper.toViewRange(n.range);null!==n.attributeOldValue&&i&&(t=e.unwrap(t,i)),null!==n.attributeNewValue&&r&&e.wrap(t,r)}}}}function Dt(e,t){return(n,o)=>{const i=o.newSelection,r=new Ig,a=[];for(const e of i.getRanges())a.push(t.toModelRange(e));r.setTo(a,{backward:i.isBackward}),r.isEqual(e.document.selection)||e.change((e)=>{e.setSelection(r)})}}function Bt(){return(e,t,n)=>{const o=t.selection;if(!o.isCollapsed&&n.consumable.consume(o,'selection')){const e=[];for(const t of o.getRanges()){const o=n.mapper.toViewRange(t);e.push(o)}n.writer.setSelection(e,{backward:o.isBackward})}}}function Mt(){return(e,t,n)=>{const o=t.selection;if(o.isCollapsed&&n.consumable.consume(o,'selection')){const e=n.writer,t=o.getFirstPosition(),i=n.mapper.toViewPosition(t),r=e.breakAttributes(i);e.setSelection(r)}}}function Lt(){return(e,t,n)=>{const o=n.writer,i=o.document.selection;for(const o of i.getRanges())o.isCollapsed&&o.end.parent.document&&n.writer.mergeAttributes(o.start);o.setSelection(null)}}function zt(e,t){const n=qt();if(1===n&&(e=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]),0===n||!jt(e,t))return t.replace(/ \[context: [^\]]+\]$/,'');const o=window.CKEDITOR_TRANSLATIONS[e];return o[t].replace(/ \[context: [^\]]+\]$/,'')}function jt(e,t){return e in window.CKEDITOR_TRANSLATIONS&&t in window.CKEDITOR_TRANSLATIONS[e]}function qt(){return Object.keys(window.CKEDITOR_TRANSLATIONS).length}function Wt(e,t){const n={name:t,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};return Qt(e,n),Yt(e,n,'allowIn'),Yt(e,n,'allowContentOf'),Yt(e,n,'allowWhere'),Yt(e,n,'allowAttributes'),Yt(e,n,'allowAttributesOf'),Yt(e,n,'inheritTypesFrom'),Xt(e,n),n}function Ht(e,t){for(const n of e[t].allowContentOf)if(e[n]){const o=Zt(e,n);o.forEach((e)=>{e.allowIn.push(t)})}delete e[t].allowContentOf}function Ut(e,t){for(const n of e[t].allowWhere){const o=e[n];if(o){const n=o.allowIn;e[t].allowIn.push(...n)}}delete e[t].allowWhere}function $t(e,t){for(const n of e[t].allowAttributesOf){const o=e[n];if(o){const n=o.allowAttributes;e[t].allowAttributes.push(...n)}}delete e[t].allowAttributesOf}function Kt(e,t){const n=e[t];for(const o of n.inheritTypesFrom){const t=e[o];if(t){const e=Object.keys(t).filter((e)=>e.startsWith('is'));for(const o of e)o in n||(n[o]=t[o])}}delete n.inheritTypesFrom}function Gt(e,t){const n=e[t],o=n.allowIn.filter((t)=>e[t]);n.allowIn=Array.from(new Set(o))}function Jt(e,t){const n=e[t];n.allowAttributes=Array.from(new Set(n.allowAttributes))}function Qt(e,t){for(const n of e){const e=Object.keys(n).filter((e)=>e.startsWith('is'));for(const o of e)t[o]=n[o]}}function Yt(e,t,n){for(const o of e)'string'==typeof o[n]?t[n].push(o[n]):Array.isArray(o[n])&&t[n].push(...o[n])}function Xt(e,t){for(const n of e){const e=n.inheritAllFrom;e&&(t.allowContentOf.push(e),t.allowWhere.push(e),t.allowAttributesOf.push(e),t.inheritTypesFrom.push(e))}}function Zt(e,t){const n=e[t];return en(e).filter((e)=>e.allowIn.includes(n.name))}function en(e){return Object.keys(e).map((t)=>e[t])}function tn(e){return'string'==typeof e?{name:e,*getAttributeKeys(){},getAttribute(){}}:{name:e.is('element')?e.name:'$text',*getAttributeKeys(){yield*e.getAttributeKeys()},getAttribute(t){return e.getAttribute(t)}}}function*nn(e,t){for(let n=!1;!n;){if(n=!0,e){const t=e.next();t.done||(n=!1,yield{walker:e,value:t.value})}if(t){const e=t.next();e.done||(n=!1,yield{walker:t,value:e.value})}}}function on(e,t){const n=new Set,o=new Map,i=Eg.createIn(e).getItems();for(const o of i)'$marker'==o.name&&n.add(o);for(const i of n){const e=i.getAttribute('data-name'),n=Pg.createBefore(i);o.has(e)?o.get(e).end=Pg.createFromPosition(n):o.set(e,new Eg(Pg.createFromPosition(n))),t.remove(i)}return o}function rn(e,t){let n;for(const o of new Ug(e)){const e={};for(const t of o.getAttributeKeys())e[t]=o.getAttribute(t);const i=t.createElement(o.name,e);n&&t.append(i,n),n=Pg.createAt(i)}return n}function an(e){e=Bg(e);const t=cn(e),n=dn(e),o=n?'element:'+n:'element';return(n)=>{n.on(o,t,{priority:e.converterPriority||'normal'})}}function sn(e){e=Bg(e),mn(e);const t=gn(e),n=dn(e),o=n?'element:'+n:'element';return(n)=>{n.on(o,t,{priority:e.converterPriority||'normal'})}}function ln(e){e=Bg(e);let t=null;('string'==typeof e.view||e.view.key)&&(t=pn(e)),mn(e,t);const n=gn(e);return(t)=>{t.on('element',n,{priority:e.converterPriority||'low'})}}function dn(e){return'string'==typeof e.view?e.view:'object'==typeof e.view&&'string'==typeof e.view.name?e.view.name:null}function cn(e){const t=new mp(e.view);return(n,o,i)=>{const r=t.match(o.viewItem);if(r){r.match.name=!0;const t=un(e.model,o.viewItem,i.writer);if(t&&i.consumable.test(o.viewItem,r.match)){const e=i.splitToAllowedParent(t,o.modelCursor);if(e){i.writer.insert(t,e.position);const n=i.convertChildren(o.viewItem,Pg.createAt(t));i.consumable.consume(o.viewItem,r.match),o.modelRange=new Eg(Pg.createBefore(t),Pg.createAfter(n.modelCursor.parent)),o.modelCursor=e.cursorParent?Pg.createAt(e.cursorParent):o.modelRange.end}}}}}function un(e,t,n){return e instanceof Function?e(t,n):n.createElement(e)}function pn(e){'string'==typeof e.view&&(e.view={key:e.view});const t=e.view.key;let n;if('class'==t||'style'==t){const o='class'==t?'classes':'styles';n={[o]:e.view.value}}else{const o='undefined'==typeof e.view.value?/[\s\S]*/:e.view.value;n={attributes:{[t]:o}}}return e.view.name&&(n.name=e.view.name),e.view=n,t}function mn(e,t=null){const n='object'==typeof e.model?e.model.key:e.model,o='object'!=typeof e.model||'undefined'==typeof e.model.value?!(null!==t)||((e)=>e.getAttribute(t)):e.model.value;e.model={key:n,value:o}}function gn(e){const t=new mp(e.view);return(n,o,i)=>{const r=t.match(o.viewItem);if(r){const t=e.model.key,n='function'==typeof e.model.value?e.model.value(o.viewItem):e.model.value;if(null!==n&&(fn(e)?r.match.name=!0:delete r.match.name,!!i.consumable.test(o.viewItem,r.match))){o.modelRange||(o=Object.assign(o,i.convertChildren(o.viewItem,o.modelCursor)));const e=hn(o.modelRange,{key:t,value:n},i);e&&i.consumable.consume(o.viewItem,r.match)}}}}function fn(e){return!!('object'!=typeof e.view||dn(e))&&!e.view.classes&&!e.view.attributes&&!e.view.styles}function hn(e,t,n){let o=!1;for(const i of Array.from(e.getItems()))n.schema.checkAttribute(i,t.key)&&(n.writer.setAttribute(t.key,t.value,i),o=!0);return o}function bn(){return(e,t,n)=>{if(!t.modelRange&&n.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:o}=n.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=o}}}function kn(){return(e,t,n)=>{if(n.schema.checkChild(t.modelCursor,'$text')&&n.consumable.consume(t.viewItem)){const e=n.writer.createText(t.viewItem.data);n.writer.insert(e,t.modelCursor),t.modelRange=Eg.createFromPositionAndShift(t.modelCursor,e.offsetSize),t.modelCursor=t.modelRange.end}}}function _n(e){const t=[],n=e.root.document;if(!n)return[];const o=Eg.createIn(e);for(const i of n.model.markers){const e=o.getIntersection(i.getRange());e&&t.push([i.name,e])}return t}function wn(e,t){for(const n of e)t(n)}function*vn(e){if(e.model.values)for(const t of e.model.values){const n={key:e.model.key,value:t},o=e.view[t],i=e.upcastAlso?e.upcastAlso[t]:void 0;yield*yn(n,o,i)}else yield*yn(e.model,e.view,e.upcastAlso)}function*yn(e,t,n){if(yield{model:e,view:t},n){n=Array.isArray(n)?n:[n];for(const t of n)yield{model:e,view:t}}}function xn(e){return'string'==typeof e?[new vg(e)]:(E(e)||(e=[e]),Array.from(e).map((e)=>'string'==typeof e?new vg(e):e instanceof yg?new vg(e.data,e.getAttributes()):e))}function Cn(e,t){t=En(t);const n=t.reduce((e,t)=>e+t.offsetSize,0),o=e.parent;On(e);const i=e.index;return o._insertChild(i,t),Sn(o,i+t.length),Sn(o,i),new Eg(e,e.getShiftedBy(n))}function An(e){if(!e.isFlat)throw new Fd('operation-utils-remove-range-not-flat: Trying to remove a range which starts and ends in different element.');const t=e.start.parent;On(e.start),On(e.end);const n=t._removeChildren(e.start.index,e.end.index-e.start.index);return Sn(t,e.start.index),n}function Tn(e,t){if(!e.isFlat)throw new Fd('operation-utils-move-range-not-flat: Trying to move a range which starts and ends in different element.');const n=An(e);return t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset),Cn(t,n)}function Pn(e,t,n){On(e.start),On(e.end);for(const o of e.getItems()){const e=o.is('textProxy')?o.textNode:o;null===n?e._removeAttribute(t):e._setAttribute(t,n),Sn(e.parent,e.index)}Sn(e.end.parent,e.end.index)}function En(e){const t=[];e instanceof Array||(e=[e]);for(let n=0;ne+t.operations.length,0)}function Un(e,t){const n=e[e.length-1];let o=n.operations.length+n.baseVersion;const r=new pf;for(let n=0;no&&(n.push(...'e'.repeat(r.offset-o).split('')),i+=r.offset-o),'insert'==r.type?(n.push(...'i'.repeat(r.howMany).split('')),o=r.offset+r.howMany):'remove'==r.type?(n.push(...'r'.repeat(r.howMany).split('')),o=r.offset,i+=r.howMany):(n.push(...'a'.repeat(r.howMany).split('')),o=r.offset+r.howMany,i+=r.howMany);return i{const o=n[0];!o.isDocumentOperation||e.has(o.type)&&_o.call(this,o)},{priority:'low'})}function _o(e){let t,n;'insert'==e.type?t=Eg.createFromPositionAndShift(e.position,e.nodes.maxOffset):(t=Eg.createFromPositionAndShift(e.getMovedRangeStart(),e.howMany),n=e.sourcePosition);const o=t.end.offset-t.start.offset;let i;switch(e.type){case'insert':const r='sticksToNext'==this.stickiness;i=this._getTransformedByInsertion(t.start,o,r);break;case'move':case'remove':case'reinsert':const a=Eg.createFromPositionAndShift(n,o),s=a.containsPosition(this)||a.start.isEqual(this)&&'sticksToNext'==this.stickiness||a.end.isEqual(this)&&'sticksToPrevious'==this.stickiness;if(s)i=this._getCombined(n,t.start);else{const e='sticksToNext'==this.stickiness,r=t.start._getTransformedByInsertion(n,o);i=this._getTransformedByMove(n,r,o,e)}}if(!this.isEqual(i)){const e=Pg.createFromPosition(this);this.path=i.path,this.root=i.root,this.fire('change',e)}}function wo(e,t,n){e.change((o)=>{n.isCollapsed||e.deleteContent(n);const i=new Ib(e,o,n.anchor);let r;r=t.is('documentFragment')?t.getChildren():[t],i.handleNodes(r,{isFirst:!0,isLast:!0});const a=i.getSelectionRange();a?n instanceof Ng?o.setSelection(a):n.setTo(a):mg.warn('insertcontent-no-range: Cannot determine a proper selection range after insertion.')})}function vo(e,t,n={}){if(t.isCollapsed)return;const o=e.schema;e.change((e)=>{if(!n.doNotResetEntireContent&&Po(o,t))return void To(e,t,o);const i=t.getFirstRange(),r=i.start,a=Rb.createFromPosition(i.end);i.start.isTouching(i.end)||e.remove(i),n.leaveUnmerged||(yo(e,r,a),o.removeDisallowedAttributes(r.parent.getChildren(),e)),t instanceof Ng?e.setSelection(r):t.setTo(r),xo(o,r)&&Ao(e,r,t),a.detach()})}function yo(e,t,n){const o=t.parent,i=n.parent;if(o!=i&&o.parent&&i.parent&&Co(t,n,e.model.schema)){for(t=Pg.createAfter(o),n=Pg.createBefore(i),n.isEqual(t)||e.insert(i,t),e.merge(t);n.parent.isEmpty;){const t=n.parent;n=Pg.createBefore(t),e.remove(t)}yo(e,t,n)}}function xo(e,t){const n=e.checkChild(t,'$text'),o=e.checkChild(t,'paragraph');return!n&&o}function Co(e,t,n){const o=new Eg(e,t);for(const i of o.getWalker())if(n.isLimit(i.item))return!1;return!0}function Ao(e,t,n){const o=e.createElement('paragraph');e.insert(o,t),n instanceof Ng?e.setSelection(o,0):n.setTo(o,0)}function To(e,t){const n=e.model.schema.getLimitElement(t);e.remove(Eg.createIn(n)),Ao(e,Pg.createAt(n),t)}function Po(e,t){const n=e.getLimitElement(t);if(!t.containsEntireContent(n))return!1;const o=t.getFirstRange();return o.start.parent!=o.end.parent&&e.checkChild(n,'paragraph')}function Eo(e,t,n={}){const o=e.schema,i='backward'!=n.direction,r=n.unit?n.unit:'character',a=t.focus,s=new Ag({boundaries:Io(a,i),singleCharacters:!0,direction:i?'forward':'backward'}),l={walker:s,schema:o,isForward:i,unit:r};for(let o;o=s.next();){if(o.done)return;const n=So(l,o.value);if(n)return void(t instanceof Ng?e.change((e)=>{e.setSelectionFocus(n)}):t.setFocus(n))}}function So(e,t){if('text'==t.type)return'word'===e.unit?Ro(e.walker,e.isForward):Oo(e.walker,e.unit,e.isForward);if(t.type==(e.isForward?'elementStart':'elementEnd')){if(e.schema.isObject(t.item))return Pg.createAt(t.item,e.isForward?'after':'before');if(e.schema.checkChild(t.nextPosition,'$text'))return t.nextPosition}else{if(e.schema.isLimit(t.item))return void e.walker.skip(()=>!0);if(e.schema.checkChild(t.nextPosition,'$text'))return t.nextPosition}}function Oo(e,t){const n=e.position.textNode;if(n){const o=n.data;for(let i=e.position.offset-n.startOffset;fo(o,i)||'character'==t&&ho(o,i);)e.next(),i=e.position.offset-n.startOffset}return e.position}function Ro(e,t){let n=e.position.textNode;if(n)for(let o=e.position.offset-n.startOffset;!Vo(n.data,o,t)&&!Fo(n,o,t);){e.next();const i=t?e.position.nodeAfter:e.position.nodeBefore;if(i){const o=i.data.charAt(t?0:i.data.length-1);Vb.includes(o)||(e.next(),n=e.position.textNode)}o=e.position.offset-n.startOffset}return e.position}function Io(e,t){const n=e.root,o=Pg.createAt(n,t?'end':0);return t?new Eg(e,o):new Eg(o,e)}function Vo(e,t,n){const o=t+(n?0:-1);return Vb.includes(e.charAt(o))}function Fo(e,t,n){return t===(n?e.endOffset:0)}function No(e,t){return e.change((e)=>{const n=e.createDocumentFragment(),o=t.getFirstRange();if(!o||o.isCollapsed)return n;const i=o.start.root,r=o.start.getCommonPath(o.end),a=i.getNodeByPath(r);let s=o.start.parent==o.end.parent?o:Eg.createFromParentsAndOffsets(a,o.start.path[r.length],a,o.end.path[r.length]+1);const l=s.end.offset-s.start.offset;for(const t of s.getItems({shallow:!0}))t.is('textProxy')?e.appendText(t.data,t.getAttributes(),n):e.append(t._clone(!0),n);if(s!=o){const t=o._getTransformedByMove(s.start,Pg.createAt(n,0),l)[0],i=new Eg(Pg.createAt(n),t.start),r=new Eg(t.end,Pg.createAt(n,'end'));Do(r,e),Do(i,e)}return n})}function Do(e,t){const n=[];Array.from(e.getItems({direction:'backward'})).map((e)=>Eg.createOn(e)).filter((t)=>{const n=(t.start.isAfter(e.start)||t.start.isEqual(e.start))&&(t.end.isBefore(e.end)||t.end.isEqual(e.end));return n}).forEach((e)=>{n.push(e.start.parent),t.remove(e)}),n.forEach((e)=>{for(let n=e;n.parent&&n.isEmpty;){const e=Eg.createOn(n);n=n.parent,t.remove(e)}})}function Bo(e){e.document.registerPostFixer((t)=>Mo(t,e))}function Mo(e,t){const n=t.document.selection,o=t.schema,i=[];let r=!1;for(const a of n.getRanges()){const e=Lo(a,o);e?(i.push(e),r=!0):i.push(a)}if(r){const t=Wo(i);e.setSelection(t,{backward:n.isBackward})}}function Lo(e,t){return e.isCollapsed?zo(e,t):jo(e,t)}function zo(e,t){const n=e.start,o=t.getNearestSelectionRange(n);if(!o)return null;const i=o.start;return n.isEqual(i)?null:i.nodeAfter&&t.isLimit(i.nodeAfter)?new Eg(i,Pg.createAfter(i.nodeAfter)):new Eg(i)}function jo(e,t){if(e.isFlat)return null;const n=e.start,o=e.end,i=qo(n,t,'start'),r=qo(o,t,'end');return n.isEqual(i)&&o.isEqual(r)?null:new Eg(i,r)}function qo(e,t,n){let o=e.parent,i=o;for(;t.isLimit(i)&&i.parent;)o=i,i=i.parent;return o===i?e:'start'===n?Pg.createBefore(o):Pg.createAfter(o)}function Wo(e){const t=[];let n=e[0];t.push(n);for(const o of e)if(!o.isEqual(n)){if(o.isIntersecting(n)){const e=n.start.isBefore(o.start)?n.start:o.start,i=o.end.isAfter(n.end)?o.end:n.end,r=new Eg(e,i);t.splice(t.indexOf(n),1,r),n=r;continue}n=o,t.push(o)}return t}function Ho(e){return e.every((e)=>'string'==typeof e)}function Uo(e){return!!e&&((e.value&&(e=e.value),Array.isArray(e))?e.some(Uo):!!(e instanceof Hb))}function $o(e,t){return e.map((e)=>e instanceof Hb?e.getValue(t):e)}function Ko(e,t,{node:n}){let o=$o(e,n);o=1==e.length&&e[0]instanceof $b?o[0]:o.reduce(ii,''),si(o)?t.remove():t.set(o)}function Go(e){return{set(t){e.textContent=t},remove(){e.textContent=''}}}function Jo(e,t,n){return{set(o){e.setAttributeNS(n,t,o)},remove(){e.removeAttributeNS(n,t)}}}function Qo(e,t){return{set(n){e.style[t]=n},remove(){e.style[t]=null}}}function Yo(e){const t=qb(e,(e)=>{if(e&&(e instanceof Hb||di(e)||li(e)||ci(e)))return e});return t}function Xo(e){if('string'==typeof e?e=ti(e):e.text&&ni(e),e.on&&(e.eventListeners=ei(e.on),delete e.on),!e.text){e.attributes&&Zo(e.attributes);const t=[];if(e.children)if(ci(e.children))t.push(e.children);else for(const n of e.children)di(n)||li(n)||Re(n)?t.push(n):t.push(new Wb(n));e.children=t}return e}function Zo(e){for(const t in e)e[t].value&&(e[t].value=[].concat(e[t].value)),oi(e,t)}function ei(e){for(const t in e)oi(e,t);return e}function ti(e){return{text:[e]}}function ni(e){Array.isArray(e.text)||(e.text=[e.text])}function oi(e,t){Array.isArray(e[t])||(e[t]=[e[t]])}function ii(e,t){return si(t)?e:si(e)?t:`${e} ${t}`}function ri(e,t){for(const n in t)e[n]?e[n].push(...t[n]):e[n]=t[n]}function ai(e,t){if(t.attributes&&(!e.attributes&&(e.attributes={}),ri(e.attributes,t.attributes)),t.eventListeners&&(!e.eventListeners&&(e.eventListeners={}),ri(e.eventListeners,t.eventListeners)),t.text&&e.text.push(...t.text),t.children&&t.children.length){if(e.children.length!=t.children.length)throw new Fd('ui-template-extend-children-mismatch: The number of children in extended definition does not match.');let n=0;for(const o of t.children)ai(e.children[n++],o)}}function si(e){return!e&&0!==e}function li(e){return e instanceof Jb}function di(e){return e instanceof Wb}function ci(e){return e instanceof jb}function ui(){return{children:[],bindings:[],attributes:{}}}function pi(e){return'class'==e||'style'==e}function mi(e){for(;e&&'html'!=e.tagName.toLowerCase();){if('static'!=Sm.window.getComputedStyle(e).position)return e;e=e.parentElement}return null}function gi({element:e,target:t,positions:n,limiter:o,fitInViewport:i}){Yd(t)&&(t=t()),Yd(o)&&(o=o());const r=mi(e.parentElement),a=new bg(e),s=new bg(t);let l,d;if(!o&&!i)[d,l]=fi(n[0],s,a);else{const e=o&&new bg(o).getVisible(),t=i&&new bg(Sm.window);[d,l]=hi(n,s,a,e,t)||fi(n[0],s,a)}let{left:c,top:u}=bi(l);if(r){const e=bi(new bg(r)),t=Ze(r);c-=e.left,u-=e.top,c+=r.scrollLeft,u+=r.scrollTop,c-=t.left,u-=t.top}return{left:c,top:u,name:d}}function fi(e,t,n){const{left:o,top:i,name:r}=e(t,n);return[r,n.clone().moveTo(o,i)]}function hi(e,t,n,o,i){let r=0,a=0,s,l;const d=n.getArea();return e.some((e)=>{function c(){a=g,r=m,s=p,l=u}const[u,p]=fi(e,t,n);let m,g;if(o)if(i){const e=o.getIntersection(i);m=e?e.getIntersectionArea(p):0}else m=o.getIntersectionArea(p);return i&&(g=i.getIntersectionArea(p)),i&&!o?g>a&&c():!i&&o?m>r&&c():g>a&&m>=r?c():g>=a&&m>r&&c(),m===d}),s?[l,s]:null}function bi({left:e,top:t}){const{scrollX:n,scrollY:o}=Sm.window;return{left:e+n,top:t+o}}function ki(e){return(t)=>t+e}function _i(e){return Om(e)?e:Xe(e)?e.commonAncestorContainer:'function'==typeof e?_i(e()):null}function wi(e,t){return e.top-t.height-ek.arrowVerticalOffset}function vi(e){return e.bottom+ek.arrowVerticalOffset}function yi(e){return!!(e.focus&&'none'!=Sm.window.getComputedStyle(e.element).display)}function xi(e){return e.bindTemplate.to((t)=>{t.target===e.element&&t.preventDefault()})}function Ci(e){return Array.isArray(e)?{items:e}:e?Object.assign({items:[]},e):{items:[]}}function Ai(e){const t=ek.defaultPositions;return e?[t.northWestArrowSouth,t.northWestArrowSouthWest,t.northWestArrowSouthEast,t.southWestArrowNorth,t.southWestArrowNorthWest,t.southWestArrowNorthEast]:[t.southEastArrowNorth,t.southEastArrowNorthEast,t.southEastArrowNorthWest,t.northEastArrowSouth,t.northEastArrowSouthEast,t.northEastArrowSouthWest]}function Ti(e){return(e+'').toLowerCase()}function Pi({origin:e,originKeystrokeHandler:t,originFocusTracker:n,toolbar:o,beforeFocus:i,afterBlur:r}){n.add(o.element),t.set('Alt+F10',(e,t)=>{n.isFocused&&!o.focusTracker.isFocused&&(i&&i(),o.focus(),t())}),o.keystrokes.set('Esc',(t,n)=>{o.focusTracker.isFocused&&(e.focus(),r&&r(),n())})}function Ei(e,t){e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=t}function Si(e){return e instanceof HTMLTextAreaElement?e.value:e.innerHTML}function Oi(e){if(!Yd(e.updateElement))throw new Fd('attachtoform-missing-elementapi-interface: ElementApi interface is required.');const t=e.element;if(t&&'textarea'===t.tagName.toLowerCase()&&t.form){let n;const o=t.form,i=()=>e.updateElement();Yd(o.submit)&&(n=o.submit,o.submit=()=>{i(),n.apply(o)}),o.addEventListener('submit',i),e.on('destroy',()=>{o.removeEventListener('submit',i),n&&(o.submit=n)})}}function Ri(e){const t=e.files?Array.from(e.files):[],n=e.items?Array.from(e.items):[];return t.length?t:n.filter((e)=>'file'===e.kind).map((e)=>e.getAsFile())}function Ii(e,t){const n=t.target.ownerDocument,o=t.clientX,i=t.clientY;let r;return n.caretRangeFromPoint&&n.caretRangeFromPoint(o,i)?r=n.caretRangeFromPoint(o,i):t.rangeParent&&(r=n.createRange(),r.setStart(t.rangeParent,t.rangeOffset),r.collapse(!0)),r?e.domConverter.domRangeToView(r):e.document.selection.getFirstRange()}function Vi(e){return e=e.replace(//g,'>').replace(/\n\n/g,'

').replace(/\n/g,'
').replace(/^\s/,' ').replace(/\s$/,' ').replace(/\s\s/g,'  '),-1

')&&(e=`

${e}

`),e}function Fi(e){return e.replace(/(\s+)<\/span>/g,(e,t)=>1==t.length?' ':t)}function Ni(e){let t='';if(e.is('text')||e.is('textProxy'))t=e.data;else if(e.is('img')&&e.hasAttribute('alt'))t=e.getAttribute('alt');else{let n=null;for(const o of e.getChildren()){const e=Ni(o);n&&(n.is('containerElement')||o.is('containerElement'))&&(Mk.includes(n.name)||Mk.includes(o.name)?t+='\n':t+='\n\n'),t+=e,n=o}}return t}function Di(e){e.return=!1,e.stop()}function Bi(e,t,n,o){const i=n.isCollapsed,r=n.getFirstRange(),a=r.start.parent,s=r.end.parent;if(o.isLimit(a)||o.isLimit(s))return void(i||a!=s||e.deleteContent(n));if(i)Mi(t,n,r.start);else{const o=!(r.start.isAtStart&&r.end.isAtEnd);e.deleteContent(n,{leaveUnmerged:o}),o&&(a==s?Mi(t,n,n.focus):t.setSelection(s,0))}}function Mi(e,t,n){const o=n.parent,i=new o.constructor(o.name,o.getAttributes());n.isAtEnd?e.insert(i,n.parent,'after'):n.isAtStart?e.insert(i,n.parent,'before'):e.split(n),e.setSelection(n.parent.nextSibling,0)}function Li(e,t){if(1{'equal'==e?(n(),r++):'insert'==e?(o('insert')?a.values.push(t[r]):(n(),a={type:'insert',index:r,values:[t[r]]}),r++):o('delete')?a.howMany++:(n(),a={type:'delete',index:r,howMany:1})}),n(),i}function Hi(e){return!!e.ctrlKey||Qk.includes(e.keyCode)}function Ui(e,t){return e instanceof up&&t instanceof up?e.data===t.data:e===t}function $i(e){if(1==e.newChildren.length-e.oldChildren.length){const t=Pe(e.oldChildren,e.newChildren,Ui),n=Wi(t,e.newChildren);if(!(1e.node).reduce((e,t)=>e.getCommonAncestor(t,{includeSelf:!0}));return t?t.getAncestors({includeSelf:!0,parentFirst:!0}).find((e)=>e.is('containerElement')||e.is('rootElement')):void 0}function Gi(e){if(0==e.length)return!1;for(const t of e)if('children'===t.type&&!$i(t))return!0;return!1}function Ji(e){return e.every((e)=>e.is('text')||e.is('softBreak'))}function Qi(e){let t=null,n=null;for(let o=0;oe.start.isBefore(t.start)?-1:1);for(let o=1;oe+t.data,'')}function ir(e,t){return t.filter((e)=>e[0]!==void 0&&e[1]!==void 0).map((t)=>Eg.createFromParentsAndOffsets(e,t[0],e,t[1]))}function rr(e){const t=e.next();return t.done?null:t.value}function ar(e){return'blockQuote'==e.parent.name?e.parent:null}function sr(e){let t=0,n;const o=[];for(;t{if(t()){for(const e of o)if(e.contains(i))return;n()}})}function gr(e,t=xw){const n=new t(e),o=new bw(e),i=new ww(e,n,o);return n.bind('isEnabled').to(i),n instanceof xw?n.bind('isOn').to(i,'isOpen'):n.arrowView.bind('isOn').to(i,'isOpen'),br(i),i}function fr(e,t){const n=e.toolbarView=new sk;e.extendTemplate({attributes:{class:['ck-toolbar-dropdown']}}),t.map((e)=>n.items.add(e)),e.panelView.children.add(n),n.items.delegate('execute').to(e)}function hr(e,t){const n=e.locale,o=e.listView=new Tw(n);o.items.bindTo(t).using((e)=>{let t;return e.isSeparator?t=new Ew(n):(t=new Pw(n),t.bind(...Object.keys(e)).to(e)),t}),e.panelView.children.add(o),o.items.delegate('execute').to(e)}function br(e){kr(e),_r(e),wr(e)}function kr(e){e.on('render',()=>{mr({emitter:e,activator:()=>e.isOpen,callback:()=>{e.isOpen=!1},contextElements:[e.element]})})}function _r(e){e.on('execute',()=>{e.isOpen=!1})}function wr(e){e.keystrokes.set('arrowdown',(t,n)=>{e.isOpen&&(e.panelView.focus(),n())}),e.keystrokes.set('arrowup',(t,n)=>{e.isOpen&&(e.panelView.focusLast(),n())})}function vr(e){const n=e.t,t={Paragraph:n('as'),"Heading 1":n('at'),"Heading 2":n('au'),"Heading 3":n('av')};return e.config.get('heading.options').map((e)=>{const n=t[e.title];return n&&n!=e.title&&(e=Object.assign({},e,{title:n})),e})}function yr(){function e(e,t,n){if(n.consumable.test(t.viewItem,{name:!0,classes:'image'})){const e=Array.from(t.viewItem.getChildren()).find((e)=>e.is('img'));if(e&&e.hasAttribute('src')&&n.consumable.test(e,{name:!0})){const o=n.convertItem(e,t.modelCursor),i=rr(o.modelRange.getItems());i&&(n.convertChildren(t.viewItem,Pg.createAt(i)),t.modelRange=o.modelRange,t.modelCursor=o.modelCursor)}}}return(t)=>{t.on('element:figure',e)}}function xr(){function e(e,t,n){if(n.consumable.consume(t.item,e.name)){const e=n.writer,o=n.mapper.toViewElement(t.item),i=o.getChild(0);if(null===t.attributeNewValue){const n=t.attributeOldValue;n.data&&(e.removeAttribute('srcset',i),e.removeAttribute('sizes',i),n.width&&e.removeAttribute('width',i))}else{const n=t.attributeNewValue;n.data&&(e.setAttribute('srcset',n.data,i),e.setAttribute('sizes','100vw',i),n.width&&e.setAttribute('width',n.width,i))}}}return(t)=>{t.on('attribute:srcset:image',e)}}function Cr(e){function t(e,t,n){if(n.consumable.consume(t.item,e.name)){const e=n.writer,o=n.mapper.toViewElement(t.item),i=o.getChild(0);null===t.attributeNewValue?e.removeAttribute(t.attributeKey,i):e.setAttribute(t.attributeKey,t.attributeNewValue,i)}}return(n)=>{n.on(`attribute:${e}:image`,t)}}function Ar(e,t){return e&&t&&e.priority==t.priority&&Pr(e.classes)==Pr(t.classes)}function Tr(e,t){if(e.priority>t.priority)return!0;return!(e.priorityPr(t.classes)}function Pr(e){return Array.isArray(e)?e.sort().join(','):e}function Er(e){return!!e.getCustomProperty(Mw)}function Sr(e,t,n={}){function o(e){return Array.isArray(e)?e:[e]}return t.setAttribute('contenteditable','false',e),t.addClass(zw,e),t.setCustomProperty(Mw,!0,e),e.getFillerOffset=Fr,n.label&&Rr(e,n.label,t),Or(e,t,(e,t,n)=>n.addClass(o(t.classes),e),(e,t,n)=>n.removeClass(o(t.classes),e)),e}function Or(e,t,n,o){const i=new Bw;i.on('change:top',(t,i)=>{i.oldDescriptor&&o(e,i.oldDescriptor,i.writer),i.newDescriptor&&n(e,i.newDescriptor,i.writer)}),t.setCustomProperty('addHighlight',(e,t,n)=>i.add(t,n),e),t.setCustomProperty('removeHighlight',(e,t,n)=>i.remove(t,n),e)}function Rr(e,t,n){n.setCustomProperty(Lw,t,e)}function Ir(e){const t=e.getCustomProperty(Lw);return t?'function'==typeof t?t():t:''}function Vr(e,t){return t.addClass(['ck-editor__editable','ck-editor__nested-editable'],e),t.setAttribute('contenteditable',e.isReadOnly?'false':'true',e),e.on('change:isReadOnly',(n,o,i)=>{t.setAttribute('contenteditable',i?'false':'true',e)}),e.on('change:isFocused',(n,o,i)=>{i?t.addClass('ck-editor__nested-editable_focused',e):t.removeClass('ck-editor__nested-editable_focused',e)}),e}function Fr(){return null}function Nr(e,t,n){return t.setCustomProperty(qw,!0,e),Sr(e,t,{label:function(){const t=e.getChild(0),o=t.getAttribute('alt');return o?`${o} ${n}`:n}})}function Dr(e){return!!e.getCustomProperty(qw)&&Er(e)}function Br(e){const t=e.getSelectedElement();return!!(t&&Dr(t))}function Mr(e){return e instanceof Cg&&'image'==e.name}function Lr(e){const t=e.createEmptyElement('img'),n=e.createContainerElement('figure',{class:'image'});return e.insert(im.createAt(n),t),n}function zr(e){return e==km.arrowright||e==km.arrowleft||e==km.arrowup||e==km.arrowdown}function jr(e){return ne(e)==Kw}function qr(e){for(;e;){if(e instanceof em&&!(e instanceof nm))return!0;e=e.parent}return!1}function Wr({view:e}){e.listenTo(e.element,'submit',(t,n)=>{n.preventDefault(),e.fire('submit')},{useCapture:!0})}function Hr(e){const t=e.plugins.get('ContextualBalloon');if(Br(e.editing.view.document.selection)){const n=Ur(e);t.updatePosition(n)}}function Ur(e){const t=e.editing.view,n=ek.defaultPositions;return{target:t.domConverter.viewToDom(t.document.selection.getSelectedElement()),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}}function $r(e,t,n,o){const i=e.document;bv.has(i)||(bv.set(i,new Map),i.registerPostFixer((e)=>Kr(i,e))),bv.get(i).set(t,{placeholderText:n,checkFunction:o}),e.render()}function Kr(e,t){const n=bv.get(e);let o=!1;for(const[i,r]of n)Gr(t,i,r)&&(o=!0);return o}function Gr(e,t,n){const o=t.document,i=n.placeholderText;let r=!1;if(!o)return!1;t.getAttribute('data-placeholder')!==i&&(e.setAttribute('data-placeholder',i,t),r=!0);const a=o.selection,s=a.anchor,l=n.checkFunction;if(l&&!l())return t.hasClass('ck-placeholder')&&(e.removeClass('ck-placeholder',t),r=!0),r;const d=!Array.from(t.getChildren()).some((e)=>!e.is('uiElement'));return!o.isFocused&&d?(t.hasClass('ck-placeholder')||(e.addClass('ck-placeholder',t),r=!0),r):(d&&s&&s.parent!==t?!t.hasClass('ck-placeholder')&&(e.addClass('ck-placeholder',t),r=!0):t.hasClass('ck-placeholder')&&(e.removeClass('ck-placeholder',t),r=!0),r)}function Jr(e,t){return(n)=>{const o=n.createEditableElement('figcaption');return n.setCustomProperty(kv,!0,o),$r(e,o,t),Vr(o,n)}}function Qr(e){for(const t of e.getChildren())if(t instanceof Cg&&'caption'==t.name)return t;return null}function Yr(e){const t=e.parent;return'figcaption'==e.name&&t&&'figure'==t.name&&t.hasClass('image')?{name:!0}:null}function Xr(e,t=!0){return(n,o,i)=>{const r=o.item;if((r.childCount||t)&&Mr(r.parent)){if(!i.consumable.consume(o.item,'insert'))return;const t=i.mapper.toViewElement(o.range.start.parent),n=e(i.writer),a=i.writer;r.childCount||a.addClass('ck-hidden',n),Zr(n,o.item,t,i)}}}function Zr(e,t,n,o){const i=im.createAt(n,'end');o.writer.insert(i,e),o.mapper.bindElements(t,e)}function ea(e){const t=e.getAncestors({includeSelf:!0}),n=t.find((e)=>'caption'==e.name);return n&&n.parent&&'image'==n.parent.name?n:null}function ta(e,t){return!(e.childCount||e.hasClass('ck-hidden'))&&(t.addClass('ck-hidden',e),!0)}function na(e,t){return!!e.hasClass('ck-hidden')&&(t.removeClass('ck-hidden',e),!0)}function oa(e){return(t,n,o)=>{if(o.consumable.consume(n.item,t.name)){const t=ra(n.attributeNewValue,e),i=ra(n.attributeOldValue,e),r=o.mapper.toViewElement(n.item),a=o.writer;i&&a.removeClass(i.className,r),t&&a.addClass(t.className,r)}}}function ia(e){const t=e.filter((e)=>!e.isDefault);return(e,n,o)=>{if(n.modelRange){const e=n.viewItem,i=rr(n.modelRange.getItems());if(o.schema.checkAttribute(i,'imageStyle'))for(const n of t)o.consumable.consume(e,{classes:n.className})&&o.writer.setAttribute('imageStyle',n.name,i)}}}function ra(e,t){for(const n of t)if(n.name===e)return n}function aa(e=[]){return e.map(sa).map((e)=>Object.assign({},e))}function sa(e){if('string'==typeof e){const t=e;Iv[t]?e=Object.assign({},Iv[t]):(mg.warn('image-style-not-found: There is no such image style of given name.',{name:t}),e={name:t})}else if(Iv[e.name]){const t=Iv[e.name],n=Object.assign({},e);for(const o in t)e.hasOwnProperty(o)||(n[o]=t[o]);e=n}return'string'==typeof e.icon&&Vv[e.icon]&&(e.icon=Vv[e.icon]),e}function la(e,t){for(const n of e)t[n.title]&&(n.title=t[n.title]);return e}function da(e,t){return new Eg(ca(e,t,!0),ca(e,t,!1))}function ca(e,t,n){let o=e.textNode||(n?e.nodeBefore:e.nodeAfter),i=null;for(;o&&o.getAttribute('linkHref')==t;)i=o,o=n?o.previousSibling:o.nextSibling;return i?Pg.createAt(i,n?'before':'after'):e}function ua(e){return e.is('attributeElement')&&!!e.getCustomProperty(qv)}function pa(e,t){const n=t.createAttributeElement('a',{href:e},{priority:5});return t.setCustomProperty(qv,!0,n),n}function ma(e){return e+='',ga(e)?e:'#'}function ga(e){const t=e.replace(Wv,'');return t.match(Hv)}function fa(e,t,n,o){const i=new Uv(t,n,o),r=t.document.selection;n.listenTo(e.document,'keydown',(e,t)=>{if(!r.isCollapsed)return;if(t.shiftKey||t.altKey||t.ctrlKey)return;const n=t.keyCode==km.arrowright,o=t.keyCode==km.arrowleft;if(!n&&!o)return;const a=r.getFirstPosition();let s;s=n?i.handleForwardMovement(a,t):i.handleBackwardMovement(a,t),s&&e.stop()},{priority:Md.get('high')+1})}function ha(e,t){return ba(e,t)||ka(e,t)}function ba(e,t){const{nodeBefore:n,nodeAfter:o}=e,i=!!n&&n.hasAttribute(t),r=!!o&&o.hasAttribute(t);return r&&(!i||n.getAttribute(t)!==o.getAttribute(t))}function ka(e,t){const{nodeBefore:n,nodeAfter:o}=e,i=!!n&&n.hasAttribute(t),r=!!o&&o.hasAttribute(t);return i&&(!r||n.getAttribute(t)!==o.getAttribute(t))}function _a(e,t){const{nodeBefore:n,nodeAfter:o}=e,i=!!n&&n.hasAttribute(t),r=!!o&&o.hasAttribute(t);return r&&i?o.getAttribute(t)!==n.getAttribute(t):void 0}function wa(e,t){return ha(e.getShiftedBy(-1),t)}function va(e){return e.getAncestors().find((e)=>ua(e))}function ya(e,t,n){const o=t?e[0]:e[e.length-1];if(o.is('listItem'))for(let i=o[t?'previousSibling':'nextSibling'],r=o.getAttribute('listIndent');i&&i.is('listItem')&&i.getAttribute('listIndent')>=n;)r>i.getAttribute('listIndent')&&(r=i.getAttribute('listIndent')),i.getAttribute('listIndent')==r&&e[t?'unshift':'push'](i),i=i[t?'previousSibling':'nextSibling']}function xa(e,t){return t.checkChild(e.parent,'listItem')&&!t.isObject(e)}function Ca(e){const t=e.createContainerElement('li');return t.getFillerOffset=Aa,t}function Aa(){const e=!this.isEmpty&&('ul'==this.getChild(0).name||'ol'==this.getChild(0).name);return this.isEmpty||e?0:null}function Ta(e,t,n){const o=n.consumable;if(o.test(t.item,'insert')&&o.test(t.item,'attribute:listType')&&o.test(t.item,'attribute:listIndent')){o.consume(t.item,'insert'),o.consume(t.item,'attribute:listType'),o.consume(t.item,'attribute:listIndent');const e=t.item,i=La(e,n);qa(e,i,n)}}function Pa(e,t,n){const o=n.mapper.toViewPosition(t.position).getLastMatchingPosition((e)=>!e.item.is('li')),i=o.nodeAfter,r=n.writer;r.breakContainer(im.createBefore(i)),r.breakContainer(im.createAfter(i));const a=i.parent,s=a.previousSibling,l=rm.createOn(a),d=r.remove(l);s&&s.nextSibling&&ja(r,s,s.nextSibling);const c=n.mapper.toModelElement(i);Wa(c.getAttribute('listIndent')+1,t.position,l.start,i,n);for(const o of rm.createIn(d).getItems())n.mapper.unbindViewElement(o);e.stop()}function Ea(e,t,n){if(!n.consumable.consume(t.item,'attribute:listType'))return;const o=n.mapper.toViewElement(t.item),i=n.writer;i.breakContainer(im.createBefore(o)),i.breakContainer(im.createAfter(o));let r=o.parent;const a='numbered'==t.attributeNewValue?'ol':'ul';r=i.rename(r,a),ja(i,r,r.nextSibling),ja(i,r.previousSibling,r);for(const o of t.item.getChildren())n.consumable.consume(o,'insert')}function Sa(e,t,n){if(n.consumable.consume(t.item,'attribute:listIndent')){const e=n.mapper.toViewElement(t.item),o=n.writer;o.breakContainer(im.createBefore(e)),o.breakContainer(im.createAfter(e));const i=e.parent,r=i.previousSibling,a=rm.createOn(i);o.remove(a),r&&r.nextSibling&&ja(o,r,r.nextSibling),Wa(t.attributeOldValue+1,t.range.start,a.start,e,n),qa(t.item,e,n);for(const e of t.item.getChildren())n.consumable.consume(e,'insert')}}function Oa(e,t,n){if('listItem'!=t.item.name){let e=n.mapper.toViewPosition(t.range.start);const o=n.writer,r=[];for(;('ul'==e.parent.name||'ol'==e.parent.name)&&(e=o.breakContainer(e),'li'==e.parent.name);){const t=e,n=im.createAt(e.parent,'end');if(!t.isEqual(n)){const e=o.remove(new rm(t,n));r.push(e)}e=im.createAfter(e.parent)}if(0e.is('ul')||e.is('ol')),i=new om({startPosition:im.createAt(n,0)});for(const e of i)if('elementStart'==e.type&&e.item.is('li')){t.viewPosition=e.previousPosition;break}else if('elementEnd'==e.type&&e.item==o){t.viewPosition=e.nextPosition;break}}}}function Da(e,t){const n=t.viewPosition,o=n.parent,i=t.mapper;if('ul'==o.name||'ol'==o.name){if(!n.isAtEnd){const e=i.toModelElement(n.nodeAfter);t.modelPosition=Pg.createBefore(e)}else{const e=i.toModelElement(n.nodeBefore),o=i.getModelLength(n.nodeBefore);t.modelPosition=Pg.createBefore(e).getShiftedBy(o)}e.stop()}else if('li'==o.name&&n.nodeBefore&&('ul'==n.nodeBefore.name||'ol'==n.nodeBefore.name)){const r=i.toModelElement(o);let a=1,s=n.nodeBefore;for(;s&&(s.is('ul')||s.is('ol'));)a+=i.getModelLength(s),s=s.previousSibling;t.modelPosition=Pg.createBefore(r).getShiftedBy(a),e.stop()}}function Ba(e,t){function n(e){const t=e.nodeBefore;if(!t||!t.is('listItem')){const t=e.nodeAfter;t&&t.is('listItem')&&a.set(t,t)}else{let n=t;if(a.has(n))return;for(;n.previousSibling&&n.previousSibling.is('listItem');)if(n=n.previousSibling,a.has(n))return;a.set(e.nodeBefore,n)}}function o(e){for(let n=0,o=null;e&&e.is('listItem');){const i=e.getAttribute('listIndent');if(i>n){let r;null===o?(o=i-n,r=n):(o>i&&(o=i),r=i-o),t.setAttribute('listIndent',r,e),s=!0}else o=null,n=e.getAttribute('listIndent')+1;e=e.nextSibling}}function i(e){for(let n=[],o=null;e&&e.is('listItem');){const i=e.getAttribute('listIndent');if(o&&o.getAttribute('listIndent')>i&&(n=n.slice(0,i+1)),0!=i)if(n[i]){const o=n[i];e.getAttribute('listType')!=o&&(t.setAttribute('listType',o,e),s=!0)}else n[i]=e.getAttribute('listType');o=e,e=e.nextSibling}}const r=e.document.differ.getChanges(),a=new Map;let s=!1;for(const o of r)if('insert'==o.type&&'listItem'==o.name)n(o.position);else if('insert'==o.type&&'listItem'!=o.name){if('$text'!=o.name){const e=o.position.nodeAfter;e.hasAttribute('listIndent')&&(t.removeAttribute('listIndent',e),s=!0),e.hasAttribute('listType')&&(t.removeAttribute('listType',e),s=!0)}const e=o.position.getShiftedBy(o.length);n(e)}else'remove'==o.type&&'listItem'==o.name?n(o.position):'attribute'==o.type&&'listIndent'==o.attributeKey?n(o.range.start):'attribute'==o.type&&'listType'==o.attributeKey&&n(o.range.start);for(const n of a.values())o(n),i(n);return s}function Ma(e,[t,n]){let o=t.is('documentFragment')?t.getChild(0):t;if(o&&o.is('listItem')){const e=n.getFirstPosition();let t=null;if(e.parent.is('listItem')?t=e.parent:e.nodeBefore&&e.nodeBefore.is('listItem')&&(t=e.nodeBefore),t){const e=t.getAttribute('listIndent');if(0e)return r;r=r.previousSibling}return null}function ja(e,t,n){return t&&n&&('ul'==t.name||'ol'==t.name)&&t.name==n.name?e.mergeContainers(im.createAfter(t)):null}function qa(e,t,n){const o=t.parent,i=n.mapper,r=n.writer;let a=i.toViewPosition(Pg.createBefore(e));const s=za(e,{sameIndent:!0,smallerIndent:!0}),l=e.previousSibling;if(s&&s.getAttribute('listIndent')==e.getAttribute('listIndent')){const e=i.toViewElement(s);a=r.breakContainer(im.createAfter(e))}else a=l&&'listItem'==l.name?i.toViewPosition(Pg.createAt(l,'end')):i.toViewPosition(Pg.createBefore(e));if(a=Ha(a),r.insert(a,o),l&&'listItem'==l.name){const e=i.toViewElement(l),n=new om({boundaries:new rm(im.createAt(e,0),a),ignoreElementEnd:!0});for(const e of n)if(e.item.is('li')){const o=r.breakContainer(im.createBefore(e.item)),i=e.item.parent,a=im.createAt(t,'end');ja(r,a.nodeBefore,a.nodeAfter),r.move(rm.createOn(i),a),n.position=o}}else{const n=o.nextSibling;if(n&&(n.is('ul')||n.is('ol'))){let o=null;for(const t of n.getChildren()){const n=i.toModelElement(t);if(n&&n.getAttribute('listIndent')>e.getAttribute('listIndent'))o=t;else break}o&&(r.breakContainer(im.createAfter(o)),r.move(rm.createOn(o.parent),im.createAt(t,'end')))}}ja(r,o,o.nextSibling),ja(r,o.previousSibling,o)}function Wa(e,t,n,o,i){const r=za(t,{sameIndent:!0,smallerIndent:!0,listIndent:e}),a=i.mapper,s=i.writer,l=r?r.getAttribute('listIndent'):null;let d;if(!r)d=n;else if(l==e){const e=a.toViewElement(r).parent;d=im.createAfter(e)}else{const e=Pg.createAt(r,'end');d=a.toViewPosition(e)}d=Ha(d);for(const r of[...o.getChildren()])(r.is('ul')||r.is('ol'))&&(d=s.move(rm.createOn(r),d).end,ja(s,r,r.nextSibling),ja(s,r.previousSibling,r))}function Ha(e){return e.getLastMatchingPosition((e)=>e.item.is('uiElement'))}function Ua(e){let t=1;for(const n of e.getChildren())if('ul'==n.name||'ol'==n.name)for(const e of n.getChildren())t+=Ua(e);return t}function $a(){return(e)=>{e.on('element:table',(e,t,n)=>{const o=t.viewItem;if(!n.consumable.test(o,{name:!0}))return;const{rows:i,headingRows:r,headingColumns:a}=Ka(o),s={};a&&(s.headingColumns=a),r&&(s.headingRows=r);const l=n.writer.createElement('table',s),d=n.splitToAllowedParent(l,t.modelCursor);if(n.writer.insert(l,d.position),n.consumable.consume(o,{name:!0}),i.length)i.forEach((e)=>n.convertItem(e,Pg.createAt(l,'end')));else{const e=n.writer.createElement('tableRow');n.writer.insert(e,Pg.createAt(l,'end')),n.writer.insertElement('tableCell',Pg.createAt(e,'end'))}t.modelRange=new Eg(Pg.createBefore(l),Pg.createAfter(l)),t.modelCursor=d.cursorParent?Pg.createAt(d.cursorParent):t.modelRange.end},{priority:'normal'})}}function Ka(e){const t={headingRows:0,headingColumns:0},n=[],o=[];let i;for(const r of Array.from(e.getChildren()))if('tbody'===r.name||'thead'===r.name||'tfoot'===r.name){'thead'!==r.name||i||(i=r);for(const e of Array.from(r.getChildren()))if('thead'===e.parent.name&&e.parent===i)t.headingRows++,n.push(e);else{o.push(e);const n=Ga(e,t,i);n>t.headingColumns&&(t.headingColumns=n)}}return t.rows=[...n,...o],t}function Ga(e){let t=0,n=0;for(const o=Array.from(e.getChildren()).filter((e)=>'th'===e.name||'td'===e.name);ni?o.setAttribute(e,t,n):o.removeAttribute(e,n)}function Ya(e,t){return t.setCustomProperty(yy,!0,e),Sr(e,t)}function Xa(e){return!!e.getCustomProperty(yy)&&Er(e)}function Za(e){const t=e.getSelectedElement();return!!(t&&Xa(t))}function es(e){const t=Ja(e.getFirstPosition());return!!(t&&Xa(t.parent))}function ts(e={}){return(t)=>t.on('insert:table',(t,n,o)=>{const i=n.item;if(!o.consumable.consume(i,'insert'))return;o.consumable.consume(i,'attribute:headingRows:table'),o.consumable.consume(i,'attribute:headingColumns:table');const r=e&&e.asWidget,a=o.writer.createContainerElement('figure',{class:'table'}),s=o.writer.createContainerElement('table');o.writer.insert(im.createAt(a),s);let l;r&&(l=Ya(a,o.writer));const d=new vy(i),c={headingRows:i.getAttribute('headingRows')||0,headingColumns:i.getAttribute('headingColumns')||0};for(const r of d){const{row:t,cell:n}=r,a=ms(ps(t,c),s,o),l=i.getChild(t),d=cs(l,t,a,o);o.consumable.consume(n,'insert');const u=im.createAt(d,'end');ds(r,c,u,o,e)}const u=o.mapper.toViewPosition(n.range.start);o.mapper.bindElements(i,r?l:a),o.writer.insert(u,r?l:a)},{priority:'normal'})}function ns(e={}){return(t)=>t.on('insert:tableRow',(t,n,o)=>{const i=n.item;if(o.consumable.consume(i,'insert')){const t=i.parent,n=o.mapper.toViewElement(t),r=n.getChild(0),a=t.getChildIndex(i),s=new vy(t,{startRow:a,endRow:a}),l={headingRows:t.getAttribute('headingRows')||0,headingColumns:t.getAttribute('headingColumns')||0};for(const t of s){const n=ms(ps(a,l),r,o),s=cs(i,a,n,o);o.consumable.consume(t.cell,'insert');const d=im.createAt(s,'end');ds(t,l,d,o,e)}}},{priority:'normal'})}function os(e={}){return(t)=>t.on('insert:tableCell',(t,n,o)=>{const i=n.item;if(o.consumable.consume(i,'insert')){const t=i.parent,n=t.parent,r=n.getChildIndex(t),a=new vy(n,{startRow:r,endRow:r}),s={headingRows:n.getAttribute('headingRows')||0,headingColumns:n.getAttribute('headingColumns')||0};for(const n of a)if(n.cell===i){const r=o.mapper.toViewElement(t),a=im.createAt(r,t.getChildIndex(i));return void ds(n,s,a,o,e)}}},{priority:'normal'})}function is(e={}){const t=!!e.asWidget;return(e)=>e.on('attribute:headingRows:table',(e,n,o)=>{function i(e,t,n){return e>t&&el){const e=Array.from(r.getChildren()).filter(({index:e})=>i(e,l-1,d)),n=ms('thead',s,o);bs(e,n,o,'end');for(const n of e)for(const e of n.getChildren())ss(e,'th',o,t);hs('tbody',s,o)}else{const e=Array.from(r.getChildren()).filter(({index:e})=>i(e,d-1,l)).reverse(),n=ms('tbody',s,o);bs(e,n,o);const a=new vy(r,{startRow:d?d-1:d,endRow:l-1}),c={headingRows:r.getAttribute('headingRows')||0,headingColumns:r.getAttribute('headingColumns')||0};for(const e of a)ls(e,c,o,t);hs('thead',s,o)}},{priority:'normal'})}function rs(e={}){const t=!!e.asWidget;return(e)=>e.on('attribute:headingColumns:table',(e,n,o)=>{const i=n.item;if(o.consumable.consume(n.item,e.name)){const e={headingRows:i.getAttribute('headingRows')||0,headingColumns:i.getAttribute('headingColumns')||0},r=n.attributeOldValue,a=n.attributeNewValue,s=(r>a?r:a)-1;for(const n of new vy(i))n.column>s||ls(n,e,o,t)}},{priority:'normal'})}function as(){return(e)=>e.on('remove:tableRow',(e,t,n)=>{e.stop();const o=n.mapper.toViewPosition(t.position).getLastMatchingPosition((e)=>!e.item.is('tr')),i=o.nodeAfter,r=i.parent,a=rm.createOn(i),s=n.writer.remove(a);for(const o of rm.createIn(s).getItems())n.mapper.unbindViewElement(o);r.childCount||n.writer.remove(rm.createOn(r))},{priority:'higher'})}function ss(e,t,n,o){const i=n.mapper.toViewElement(e);let r;if(o){const e=n.writer.createEditableElement(t,i.getAttributes());r=Vr(e,n.writer),n.writer.insert(im.createAfter(i),r),n.writer.move(rm.createIn(i),im.createAt(r)),n.writer.remove(rm.createOn(i))}else r=n.writer.rename(i,t);n.mapper.bindElements(e,r)}function ls(e,t,n,o){const{cell:i}=e,r=us(e,t),a=n.mapper.toViewElement(i);a&&a.name!==r&&ss(i,r,n,o)}function ds(e,t,n,o,i){const r=i&&i.asWidget,a=us(e,t),s=r?Vr(o.writer.createEditableElement(a),o.writer):o.writer.createContainerElement(a),l=e.cell;o.mapper.bindElements(l,s),o.writer.insert(n,s)}function cs(e,t,n,o){let i=o.mapper.toViewElement(e);if(!i){o.consumable.consume(e,'insert'),i=o.writer.createContainerElement('tr'),o.mapper.bindElements(e,i);const r=e.parent.getAttribute('headingRows')||0,a=0=r?t-r:t,s=im.createAt(n,a);o.writer.insert(s,i)}return i}function us(e,t){const{row:n,column:o}=e,{headingColumns:i,headingRows:r}=t;if(r&&r>n)return'th';return i&&i>o?'th':'td'}function ps(e,t){return et.cell===e),c=d.column,u=l.find(({row:e,rowspan:n,column:o})=>o===c&&('down'==t?e===s:s===e+n));return u&&u.cell}function Cs(e,t,n){const o=[],i=t>n?n:0,r=new vy(e,{startRow:i,endRow:t-1});for(const{row:i,rowspan:a,cell:s}of r)1t&&o.push(s);return o}function As(e,t,n){const o=e.parent,i=o.parent,r=o.index,a=parseInt(e.getAttribute('rowspan')),s=t-r,l={},d=a-s;1e.add(t))}function Bs(e){return'string'==typeof e?[new tx(e)]:(E(e)||(e=[e]),Array.from(e).map((e)=>'string'==typeof e?new tx(e):e instanceof nx?new tx(e.data):e))}function Ms(){for(const e of this.getChildren())if(!e.is('uiElement'))return null;return this.childCount}function Ls(e){return!!(e.item.is('attributeElement')||e.item.is('uiElement'))}function zs(e){return'string'==typeof e?[new tx(e)]:(E(e)||(e=[e]),Array.from(e).map((e)=>'string'==typeof e?new tx(e):e instanceof nx?new tx(e.data):e))}function js(e){return e instanceof Text&&e.data.substr(0,hx)===bx}function qs(e){return e.data.length==hx&&js(e)}function Ws(e){return js(e)?e.data.slice(hx):e.data}function Hs(e,t){let n=kx.get(t);return n||(n=t(window.document),kx.set(t,n)),e.isEqualNode(n)}function Us(e,t,n){let o=je(e);return n&&(o=o.slice(o.indexOf(n)+1)),o.some((e)=>e.tagName&&t.includes(e.tagName.toLowerCase()))}function $s(e,t){for(;e&&e!=Sm.document;)t(e),e=e.parentNode}function Ks(e){e.addRule('highlightedCodeBlock',{filter:function(e){var t=e.firstChild;return'DIV'===e.nodeName&&vx.test(e.className)&&t&&'PRE'===t.nodeName},replacement:function(e,t,n){var o=t.className||'',i=(o.match(vx)||[null,''])[1];return'\n\n'+n.fence+i+'\n'+t.firstChild.textContent+'\n'+n.fence+'\n\n'}})}function Gs(e){e.addRule('strikethrough',{filter:['del','s','strike'],replacement:function(e){return'~'+e+'~'}})}function Js(e){var t=e.parentNode;return'THEAD'===t.nodeName||t.firstChild===e&&('TABLE'===t.nodeName||Qs(t))&&xx.call(e.childNodes,function(e){return'TH'===e.nodeName})}function Qs(e){var t=e.previousSibling;return'TBODY'===e.nodeName&&(!t||'THEAD'===t.nodeName&&/^\s*$/i.test(t.textContent))}function Ys(e,t){var n=yx.call(t.parentNode.childNodes,t),o=' ';return 0===n&&(o='| '),o+e+' |'}function Xs(e){for(var t in e.keep(function(e){return'TABLE'===e.nodeName&&!Js(e.rows[0])}),Cx)e.addRule(t,Cx[t])}function Zs(e){e.addRule('taskListItems',{filter:function(e){return'checkbox'===e.type&&'LI'===e.parentNode.nodeName},replacement:function(e,t){return(t.checked?'[x]':'[ ]')+' '}})}function tl(e){e.use([Ks,Gs,Xs,Zs])}function nl(e){for(var t=1,n;t'+e+'','text/html');t=n.getElementById('turndown-root')}else t=e.cloneNode(!0);return cl({element:t,isBlock:il,isVoid:rl}),t}function gl(){return Fx=Fx||new Ox,Fx}function fl(e){return e.isBlock=il(e),e.isCode='code'===e.nodeName.toLowerCase()||e.parentNode.isCode,e.isBlank=hl(e),e.flankingWhitespace=bl(e),e}function hl(e){return-1===['A','TH','TD'].indexOf(e.nodeName)&&/^\s*$/i.test(e.textContent)&&!rl(e)&&!al(e)}function bl(e){var t='',n='';if(!e.isBlock){var o=/^[ \r\n\t]/.test(e.textContent),i=/[ \r\n\t]$/.test(e.textContent);o&&!kl('left',e)&&(t=' '),i&&!kl('right',e)&&(n=' ')}return{leading:t,trailing:n}}function kl(e,t){var n,o,i;return'left'===e?(n=t.previousSibling,o=/ $/):(n=t.nextSibling,o=/^ /),n&&(3===n.nodeType?i=o.test(n.nodeValue):1===n.nodeType&&!il(n)&&(i=o.test(n.textContent))),i}function _l(e){if(!(this instanceof _l))return new _l(e);this.options=nl({},{rules:Ex,headingStyle:'setext',hr:'* * *',bulletListMarker:'*',codeBlockStyle:'indented',fence:'```',emDelimiter:'_',strongDelimiter:'**',linkStyle:'inlined',linkReferenceStyle:'full',br:' ',blankReplacement:function(e,t){return t.isBlock?'\n\n':''},keepReplacement:function(e,t){return t.isBlock?'\n\n'+t.outerHTML+'\n\n':t.outerHTML},defaultReplacement:function(e,t){return t.isBlock?'\n\n'+e+'\n\n':e}},e),this.rules=new sl(this.options)}function wl(e){var t=this;return Rx.call(e.childNodes,function(e,n){n=new fl(n);var o='';return 3===n.nodeType?o=n.isCode?n.nodeValue:t.escape(n.nodeValue):1===n.nodeType&&(o=yl.call(t,n)),Cl(e,o)},'')}function vl(e){var t=this;return this.rules.forEach(function(n){'function'==typeof n.append&&(e=Cl(e,n.append(t.options)))}),e.replace(/^[\t\r\n]+/,'').replace(/[\t\r\n\s]+$/,'')}function yl(e){var t=this.rules.forNode(e),n=wl.call(this,e),o=e.flankingWhitespace;return(o.leading||o.trailing)&&(n=n.trim()),o.leading+t.replacement(n,e,this.options)+o.trailing}function xl(e,t){var n=[e.match(Vx)[0],t.match(Ix)[0]].sort(),o=n[n.length-1];return 2>o.length?o:'\n\n'}function Cl(e,t){var n=xl(e,t);return e=e.replace(Vx,''),t=t.replace(Ix,''),e+n+t}function Al(e){return null!=e&&('string'==typeof e||e.nodeType&&(1===e.nodeType||9===e.nodeType||11===e.nodeType))}function Tl(e){this.options=e||{}}function Pl(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,'&').replace(//g,'>').replace(/"/g,'"').replace(/'/g,''')}function El(t){return t.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(t,o){return o=o.toLowerCase(),'colon'===o?':':'#'===o.charAt(0)?'x'===o.charAt(1)?e(parseInt(o.substring(2),16)):e(+o.substring(1)):''})}function Sl(e,t,n){return t.setCustomProperty(Wx,!0,e),Sr(e,t,{label:n})}function Ol(e){return!!e.getCustomProperty(Wx)&&Er(e)}function Rl(e){const t=e.getSelectedElement();return!!(t&&Ol(t))}function Il(e,t,n){const o=t.createContainerElement('div',{class:'op-ckeditor--code-block',title:window.I18n.t('js.editor.macro.toolbar_help')});return Vl(t,e,o),Sl(o,t,n)}function Vl(e,t,n){const o=t.getAttribute('opCodeblockLanguage')||'language-text',i=o.replace(/^language-/,''),r=e.createContainerElement('div',{class:'op-ckeditor--code-block-language'});Fl(e,i,r,'text'),e.insert(im.createAt(n),r);const a=t.getAttribute('opCodeblockContent');Fl(e,a,n,'(empty)')}function Fl(e,t,n,o){const i=e.createText(t||o);e.insert(im.createAt(n),i)}function Nl(){function e(e,t,n){const o=t.item,i=o.getAttribute('opCodeblockLanguage')||'language-text',r=o.getAttribute('opCodeblockContent');n.consumable.consume(o,'insert');const a=n.writer,s=a.createContainerElement('pre'),l=a.createContainerElement('div',{class:'op-ckeditor--code-block-language'}),d=a.createContainerElement('code',{class:i}),c=a.createText(i),u=a.createText(r);a.insert(im.createAt(d),u),a.insert(im.createAt(l),c),a.insert(im.createAt(s),l),a.insert(im.createAt(s),d),n.mapper.bindElements(o,d);const p=n.mapper.toViewPosition(t.range.start);a.insert(p,s),e.stop()}return(t)=>{t.on('insert:codeblock',e,{priority:'high'})}}function Dl(){function e(e,t,n){if(n.consumable.test(t.viewItem,{name:!0})){const e=Array.from(t.viewItem.getChildren()).find((e)=>e.is('code'));if(e&&n.consumable.consume(e,{name:!0})){const o=n.writer.createElement('codeblock');n.writer.setAttribute('opCodeblockLanguage',e.getAttribute('class'),o);const i=n.splitToAllowedParent(o,t.modelCursor);if(i){n.writer.insert(o,i.position);const r=e.getChild(0);n.consumable.consume(r,{name:!0});const a=r.data;n.writer.setAttribute('opCodeblockContent',a,o),t.modelRange=new Eg(Pg.createBefore(o),Pg.createAfter(o)),t.modelCursor=t.modelRange.end}}}}return(t)=>{t.on('element:pre',e,{priority:'high'})}}function Bl(){function e(e,t,n){const o=t.item;n.consumable.consume(t.item,e.name);const i=n.mapper.toViewElement(o);n.writer.remove(rm.createOn(i.getChild(1))),n.writer.remove(rm.createOn(i.getChild(0))),Vl(n.writer,o,i)}return(t)=>{t.on('attribute:opCodeblockContent',e),t.on('attribute:opCodeblockLanguage',e)}}function Ml(e,t,n){e.ui.componentFactory.add(t,(t)=>{const o=new m_(t);return o.set({label:I18n.t('js.button_edit'),icon:Kx.a,tooltip:!0}),o.on('execute',()=>{const t=e.model.document.selection.getSelectedElement();t&&n(t)}),o})}function Ll(e,t,n,o){function i(){t.ui.focusTracker.isFocused?o(t.editing.view.document.selection)?r():a():a()}function r(){s()?zl(t,o):!d.hasView(c)&&d.add({view:c,position:jl(t),balloonClassName:Gx})}function a(){s()&&d.remove(c)}function s(){return d.visibleView==c}const l=t.config.get(n+'.toolbar');if(!l||!l.length)return;const d=t.plugins.get('ContextualBalloon'),c=new sk;c.fillFromConfig(l,t.ui.componentFactory),e.listenTo(t.editing.view,'render',i),e.listenTo(t.ui.focusTracker,'change:isFocused',i,{priority:'low'})}function zl(e,t){const n=e.plugins.get('ContextualBalloon');if(t(e.editing.view.document.selection)){const t=jl(e);n.updatePosition(t)}}function jl(e){const t=e.editing.view,n=ek.defaultPositions;return{target:t.domConverter.viewToDom(t.document.selection.getSelectedElement()),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}}function ql(e,t){return e.config.get('openProject.pluginContext').services[t]}function Wl(e){return e.config.get('openProject.context.resource')}function Hl(e){return e.config.get('openProject.context.previewContext')}function Ul(e){return ql(e,'pathHelperService')}function $l(e,t){return t.setCustomProperty(oC,!0,e),Sr(e,t,{label:'your label here'})}function Kl(e){return!!e.getCustomProperty(oC)&&Er(e)}function Gl(e){const t=e.getSelectedElement();return!!(t&&Kl(t))}function Jl(e,t,n){return t.setCustomProperty(sC,!0,e),Sr(e,t,{label:n})}function Ql(e){return!!e.getCustomProperty(sC)&&Er(e)}function Yl(e){const t=e.getSelectedElement();return!!(t&&Ql(t))}function Xl(e,t,n){return t.setCustomProperty(uC,!0,e),Sr(e,t,{label:n})}function Zl(e){return!!e.getCustomProperty(uC)&&Er(e)}function ed(e){const t=e.getSelectedElement();return!!(t&&Zl(t))}function td(e,t){let n=function(e){let t=i(this.app.document),n=this._getRange(),o=n.startOffset-this.at.length-e.length;return n.setStart(n.startContainer,o),this.currentRangeProperties={current:n,start:o,end:n.endOffset},n.surroundContents(t.get(0)),t},o=function(){let e=i(this.app.document),t=this.currentRangeProperties.current,n=t.cloneRange(),o=t.startContainer.childNodes[0],r=t.endContainer.childNodes[0];return n.setStart(o,this.currentRangeProperties.start),n.setEnd(r,this.currentRangeProperties.end),n.surroundContents(e.get(0)),e},i=function(e){return jQuery('',e).addClass('atwho-query')},r=jQuery.extend({},{at:'#',startWithSpace:!1,searchKey:'id_subject',displayTpl:'
  • ${to_s}
  • ',insertTpl:'${atwho-at}${id}',limit:10,callbacks:{remoteFilter:function(e,t){let o=this;this.getOpt('remoteUrl')(e,function(i){i&&(i=o.getOpt('remoteDataPreparation').call(o,i),o.query.el=n.call(o,e),jQuery(a).is(':visible')?t(i):t([]))})},sorter:function(e,t){return t},beforeInsert:function(e){return this.query.el=o.call(this),e}},functionOverrides:{insert:function(e,t){let n,o,i,r;return i=''===(i=this.getOpt('suffix'))?i:i||'\xA0',n=t.data('item-data'),this.query.el.removeClass('atwho-query').addClass('atwho-inserted').html(e).attr('data-atwho-at-query',''+n['atwho-at']+this.query.text).attr('contenteditable','false'),(o=this._getRange())&&(this.query.el.length&&o.setEndAfter(this.query.el[0]),o.collapse(!1),o.insertNode(r=this.app.document.createTextNode(''+i)),this._setRange('after',r,o)),this.$inputor.change()}}},t),a;e.model.document.once('change',()=>{t.isSupportedContext&&!t.isSupportedContext()||(a=jQuery(e.element),!a.is('.ck-editor__editable')&&(a=a.closest('op-ckeditor-form').find('.ck-editor__editable')),a.atwho(r),jQuery(a).on('shown.atwho',()=>{e.commands.get('enter').isAtJsOpen=!0}).on('hidden.atwho',()=>{e.commands.get('enter').isAtJsOpen=!1}))})}function nd(e){const t=/^image\/(jpeg|png|gif|bmp)$/;return t.test(e.type)}function od(e){const t=e.getSelectedElement();if(t)return Pg.createAfter(t);const n=e.getSelectedBlocks().next().value;if(n){if(n.isEmpty)return Pg.createAt(n);const t=Pg.createAfter(n);return e.focus.isTouching(t)?t:Pg.createBefore(n)}return e.focus}function id(e,t){e.hasClass('ck-appear')||t.addClass('ck-appear',e)}function rd(e,t){t.removeClass('ck-appear',e)}function ad(e,t,n){t.hasClass('ck-image-upload-placeholder')||n.addClass('ck-image-upload-placeholder',t),t.hasClass('ck-infinite-progress')||n.addClass('ck-infinite-progress',t);const o=t.getChild(0);o.getAttribute('src')!==e&&n.setAttribute('src',e,o)}function sd(e,t){e.hasClass('ck-image-upload-placeholder')&&t.removeClass('ck-image-upload-placeholder',e),e.hasClass('ck-infinite-progress')&&t.removeClass('ck-infinite-progress',e)}function ld(e,t,n,o){const i=ud(t);t.insert(im.createAt(e,'end'),i),n.on('change:uploadedPercent',(e,t,n)=>{o.change((e)=>{e.setStyle('width',n+'%',i)})})}function dd(e,t){const n=pd(e);n&&t.remove(rm.createOn(n))}function cd(e,t,n){const o=new _m('div',{class:'ck-image-upload-complete-icon'});t.insert(im.createAt(e,'end'),o),setTimeout(()=>{n.change((e)=>e.remove(rm.createOn(o)))},3e3)}function ud(e){const t=e.createUIElement('div',{class:'ck-progress-bar'});return e.setCustomProperty(OC,!0,t),t}function pd(e){for(const t of e.getChildren())if(t.getCustomProperty(OC))return t}function md(e){return Array.from(e.types).includes('text/html')&&''!==e.getData('text/html')}function gd(e,t,n){return t.setCustomProperty(DC,!0,e),Sr(e,t,{label:n})}function fd(e){return!!e.getCustomProperty(DC)&&Er(e)}function hd(e){const t=e.getSelectedElement();return!!(t&&fd(t))}function bd(e){return(t,n)=>{const o=n.openProject.context;n.removePlugins=n.removePlugins||[];const i=o.resource;if(i&&i.uploadAttachments||n.removePlugins.push(...jC.map((e)=>e.pluginName)),!1===o.macros&&n.removePlugins.push(...zC.map((e)=>e.pluginName)),Array.isArray(o.macros)){const e=zC.filter(plugin=-1===o.macros.indexOf(el.pluginName));n.removePlugins.push(...e)}return e.create(t,n)}}var kd=Number.POSITIVE_INFINITY,_d=Math.max,wd=Math.min,vd=Math.floor;Object.defineProperty(n,'__esModule',{value:!0});var yd=Object.getPrototypeOf,xd=function(e){return yd(Object(e))},Cd=function(e){var t=!1;if(null!=e&&'function'!=typeof e.toString)try{t=!!(e+'')}catch(t){}return t},Ad=function(e){return!!e&&'object'==typeof e},Td=Object.prototype,Pd=Function.prototype.toString,Ed=Td.hasOwnProperty,Sd=Pd.call(Object),Od=Td.toString,Rd=function(e){if(!Ad(e)||Od.call(e)!='[object Object]'||Cd(e))return!1;var t=xd(e);if(null===t)return!0;var n=Ed.call(t,'constructor')&&t.constructor;return'function'==typeof n&&n instanceof n&&Pd.call(n)==Sd};class Id{constructor(e,t){this._config={},t&&this.define(t),e&&this._setObjectToTarget(this._config,e)}set(e,t){this._setToTarget(this._config,e,t)}define(e,t){this._setToTarget(this._config,e,t,!0)}get(e){return this._getFromSource(this._config,e)}_setToTarget(e,t,n,o=!1){if(Rd(t))return void this._setObjectToTarget(e,t,o);const i=t.split('.');t=i.pop();for(const r of i)Rd(e[r])||(e[r]={}),e=e[r];return Rd(n)?(Rd(e[t])||(e[t]={}),e=e[t],void this._setObjectToTarget(e,n,o)):void(o&&'undefined'!=typeof e[t]||(e[t]=n))}_getFromSource(e,t){const n=t.split('.');t=n.pop();for(const o of n){if(!Rd(e[o])){e=null;break}e=e[o]}return e?e[t]:void 0}_setObjectToTarget(e,t,n){Object.keys(t).forEach((o)=>{this._setToTarget(e,o,t[o],n)})}}const Vd='https://docs.ckeditor.com/ckeditor5/latest/framework/guides/support/error-codes.html';class Fd extends Error{constructor(e,t){e=i(e),t&&(e+=' '+JSON.stringify(t)),super(e),this.name='CKEditorError',this.data=t}static isCKEditorError(e){return e instanceof Fd}}var Nd=function(){return function e(){e.called=!0}};class Dd{constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=Nd(),this.off=Nd()}}const Bd={get(e){return'number'==typeof e?e:this[e]||this.normal},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};var Md=Bd;const Ld=Symbol('listeningTo'),zd=Symbol('emitterId'),jd={on(e,t,n={}){this.listenTo(this,e,t,n)},once(e,t,n){this.listenTo(this,e,function(e,...n){e.off(),t.call(this,e,...n)},n)},off(e,t){this.stopListening(this,e,t)},listenTo(e,t,n,o={}){let i,r;this[Ld]||(this[Ld]={});const a=this[Ld];l(e)||s(e);const d=l(e);(i=a[d])||(i=a[d]={emitter:e,callbacks:{}}),(r=i.callbacks[t])||(r=i.callbacks[t]=[]),r.push(n),u(e,t);const c=p(e,t),m=Md.get(o.priority),g={callback:n,priority:m};for(const r of c){let e=!1;for(let t=0;t{this._delegations||(this._delegations=new Map);for(const o of e){const e=this._delegations.get(o);e?e.set(t,n):this._delegations.set(o,new Map([[t,n]]))}}}},stopDelegating(e,t){if(this._delegations)if(!e)this._delegations.clear();else if(!t)this._delegations.delete(e);else{const n=this._delegations.get(e);n&&n.delete(t)}}};var qd=jd,Wd=function(e,t){return e===t||e!==e&&t!==t},Hd=function(e,t){for(var n=e.length;n--;)if(Wd(e[n][0],t))return n;return-1},Ud=Array.prototype,$d=Ud.splice;b.prototype.clear=function(){this.__data__=[]},b.prototype['delete']=function(e){var t=this.__data__,n=Hd(t,e);if(0>n)return!1;var o=t.length-1;return n==o?t.pop():$d.call(t,n,1),!0},b.prototype.get=function(e){var t=this.__data__,n=Hd(t,e);return 0>n?void 0:t[n][1]},b.prototype.has=function(e){return-1o?n.push([e,t]):n[o][1]=t,this};var Kd=b,Gd=function(e){var t=typeof e;return!!e&&('object'==t||'function'==t)},Jd=Object.prototype,Qd=Jd.toString,Yd=function(e){var t=Gd(e)?Qd.call(e):'';return t=='[object Function]'||t=='[object GeneratorFunction]'},Xd=Function.prototype.toString,Zd=function(e){if(null!=e){try{return Xd.call(e)}catch(t){}try{return e+''}catch(t){}}return''},ec=/[\\^$.*+?()[\]{}|]/g,tc=/^\[object .+?Constructor\]$/,nc=Object.prototype,oc=Function.prototype.toString,ic=nc.hasOwnProperty,rc=RegExp('^'+oc.call(ic).replace(ec,'\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,'$1.*?')+'$'),ac=function(e){if(!Gd(e))return!1;var t=Yd(e)||Cd(e)?rc:tc;return t.test(Zd(e))},sc=function(e,t){var n=e[t];return ac(n)?n:void 0},lc=sc(Object,'create'),dc=lc,cc=Object.prototype,uc=cc.hasOwnProperty,pc=Object.prototype,mc=pc.hasOwnProperty;k.prototype.clear=function(){this.__data__=dc?dc(null):{}},k.prototype['delete']=function(e){return this.has(e)&&delete this.__data__[e]},k.prototype.get=function(e){var t=this.__data__;if(dc){var n=t[e];return n==='__lodash_hash_undefined__'?void 0:n}return uc.call(t,e)?t[e]:void 0},k.prototype.has=function(e){var t=this.__data__;return dc?t[e]!==void 0:mc.call(t,e)},k.prototype.set=function(e,t){var n=this.__data__;return n[e]=dc&&void 0===t?'__lodash_hash_undefined__':t,this};var gc=k,fc=o(1),hc=sc(fc.a,'Map'),bc=hc,kc=function(e){var t=typeof e;return'string'==t||'number'==t||'symbol'==t||'boolean'==t?'__proto__'!==e:null===e},_c=function(e,t){var n=e.__data__;return kc(t)?n['string'==typeof t?'string':'hash']:n.map};_.prototype.clear=function(){this.__data__={hash:new gc,map:new(bc||Kd),string:new gc}},_.prototype['delete']=function(e){return _c(this,e)['delete'](e)},_.prototype.get=function(e){return _c(this,e).get(e)},_.prototype.has=function(e){return _c(this,e).has(e)},_.prototype.set=function(e,t){return _c(this,e).set(e,t),this};var wc=_;w.prototype.clear=function(){this.__data__=new Kd},w.prototype['delete']=function(e){return this.__data__['delete'](e)},w.prototype.get=function(e){return this.__data__.get(e)},w.prototype.has=function(e){return this.__data__.has(e)},w.prototype.set=function(e,t){var n=this.__data__;return n instanceof Kd&&n.__data__.length==200&&(n=this.__data__=new wc(n.__data__)),n.set(e,t),this};var vc=w,yc=function(e,t){for(var n=-1,o=e.length;++nt||t>e.data.length)throw new Fd('view-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.');if(0>n||t+n>e.data.length)throw new Fd('view-textproxy-wrong-length: Given length value is incorrect.');this.data=e.data.substring(t,t+n),this.offsetInText=t}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(e){return'textProxy'==e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];for(let n=e.includeSelf?this.textNode:this.parent;null!==n;)t[e.parentFirst?'push':'unshift'](n),n=n.parent;return t}}class mp{constructor(...e){this._patterns=[],this.add(...e)}add(...e){for(let t of e)('string'==typeof t||t instanceof RegExp)&&(t={name:t}),t.classes&&('string'==typeof t.classes||t.classes instanceof RegExp)&&(t.classes=[t.classes]),this._patterns.push(t)}match(...e){for(const t of e)for(const e of this._patterns){const n=S(t,e);if(n)return{element:t,pattern:e,match:n}}return null}matchAll(...e){const t=[];for(const n of e)for(const e of this._patterns){const o=S(n,e);o&&t.push({element:n,pattern:e,match:o})}return 0`${e[0]}:${e[1]}`).sort().join(';'),n=Array.from(this._attrs).map((e)=>`${e[0]}="${e[1]}"`).sort().join(' ');return this.name+(''==e?'':` class="${e}"`)+(''==t?'':` style="${t}"`)+(''==n?'':` ${n}`)}_clone(e=!1){const t=[];if(e)for(const n of this.getChildren())t.push(n._clone(e));const n=new this.constructor(this.name,this._attrs,t);return n._classes=new Set(this._classes),n._styles=new Map(this._styles),n._customProperties=new Map(this._customProperties),n.getFillerOffset=this.getFillerOffset,n}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange('children',this);let n=0;const o=B(t);for(const i of o)null!==i.parent&&i._remove(),i.parent=this,this._children.splice(e,0,i),e++,n++;return n}_removeChildren(e,t=1){this._fireChange('children',this);for(let n=e;nthis._classes.add(e))}_removeClass(e){this._fireChange('attributes',this),e=Array.isArray(e)?e:[e],e.forEach((e)=>this._classes.delete(e))}_setStyle(e,t){if(this._fireChange('attributes',this),Rd(e)){const t=Object.keys(e);for(const n of t)this._styles.set(n,e[n])}else this._styles.set(e,t)}_removeStyle(e){this._fireChange('attributes',this),e=Array.isArray(e)?e:[e],e.forEach((e)=>this._styles.delete(e))}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}class fp extends gp{constructor(e,t,n){super(e,t,n),this.getFillerOffset=M}is(e,t=null){return t?'containerElement'==e&&t==this.name||super.is(e,t):'containerElement'==e||super.is(e)}}var hp=L,bp=function(e,t,n){var o=n.length;return 0===o?e.call(t):1===o?e.call(t,n[0]):2===o?e.call(t,n[0],n[1]):3===o?e.call(t,n[0],n[1],n[2]):e.apply(t,n)},kp=Object.prototype,_p=kp.toString,wp=function(e){return'symbol'==typeof e||Ad(e)&&_p.call(e)=='[object Symbol]'},vp=0/0,yp=/^\s+|\s+$/g,xp=/^[-+]0x[0-9a-f]+$/i,Cp=/^0b[01]+$/i,Ap=/^0o[0-7]+$/i,Tp=parseInt,Pp=function(e){if('number'==typeof e)return e;if(wp(e))return vp;if(Gd(e)){var t=Yd(e.valueOf)?e.valueOf():e;e=Gd(t)?t+'':t}if('string'!=typeof e)return 0===e?e:+e;e=e.replace(yp,'');var n=Cp.test(e);return n||Ap.test(e)?Tp(e.slice(2),n?2:8):xp.test(e)?vp:+e},Ep=1/0,Sp=function(e){if(!e)return 0===e?e:0;if(e=Pp(e),e===Ep||e===-Ep){var t=0>e?-1:1;return t*17976931348623157e292}return e===e?e:0},Op=function(e){var t=Sp(e),n=t%1;return t===t?n?t-n:t:0},Rp=_d,Ip=function(e,t){if('function'!=typeof e)throw new TypeError('Expected a function');return t=Rp(void 0===t?e.length-1:Op(t),0),function(){for(var n=arguments,o=-1,i=Rp(n.length-t,0),r=Array(i);++oi?void 0:r,i=1),t=Object(t);++o{this.set(t,e[t])},this);j(this);const n=this[Gp];if(e in this&&!n.has(e))throw new Fd('observable-set-cannot-override: Cannot override an existing property.');Object.defineProperty(this,e,{enumerable:!0,configurable:!0,get(){return n.get(e)},set(t){const o=n.get(e);let i=this.fire('set:'+e,e,t,o);i===void 0&&(i=t),o===i&&n.has(e)||(n.set(e,i),this.fire('change:'+e,e,i,o))}}),this[e]=t},bind(...e){if(!e.length||!U(e))throw new Fd('observable-bind-wrong-properties: All properties must be strings.');if(new Set(e).size!==e.length)throw new Fd('observable-bind-duplicate-properties: Properties must be unique.');j(this);const t=this[Qp];e.forEach((e)=>{if(t.has(e))throw new Fd('observable-bind-rebind: Cannot bind the same property more that once.')});const n=new Map;return e.forEach((e)=>{const o={property:e,to:[]};t.set(e,o),n.set(e,o)}),{to:q,toMany:W,_observable:this,_bindProperties:e,_to:[],_bindings:n}},unbind(...e){if(!(Gp in this))return;const t=this[Qp],n=this[Jp];if(e.length){if(!U(e))throw new Fd('observable-unbind-wrong-properties: Properties must be strings.');e.forEach((e)=>{const o=t.get(e);if(!o)return;let i,r,a,s;o.to.forEach((e)=>{i=e[0],r=e[1],a=n.get(i),s=a[r],s.delete(o),s.size||delete a[r],Object.keys(a).length||(n.delete(i),this.stopListening(i,'change'))}),t.delete(e)})}else n.forEach((e,t)=>{this.stopListening(t,'change')}),n.clear(),t.clear()},decorate(e){const t=this[e];if(!t)throw new Fd('observablemixin-cannot-decorate-undefined: Cannot decorate an undefined method.',{object:this,methodName:e});this.on(e,(e,n)=>{e.return=t.apply(this,n)}),this[e]=function(...t){return this.fire(e,t)}}};Kp(Yp,qd);var Xp=Yp;const Zp=Symbol('document');class em extends fp{constructor(e,t,n){super(e,t,n),this.set('isReadOnly',!1),this.set('isFocused',!1)}get document(){return this.getCustomProperty(Zp)}set _document(e){if(this.getCustomProperty(Zp))throw new Fd('view-editableelement-document-already-set: View document is already set.');this._setCustomProperty(Zp,e),this.bind('isReadOnly').to(e),this.bind('isFocused').to(e,'isFocused',(t)=>t&&e.selection.editableElement==this),this.listenTo(e.selection,'change',()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this})}}h(em,Xp);const tm=Symbol('rootName');class nm extends em{constructor(e){super(e),this.rootName='main'}is(e,t=null){return t?'rootElement'==e&&t==this.name||super.is(e,t):'rootElement'==e||super.is(e)}get rootName(){return this.getCustomProperty(tm)}set rootName(e){this._setCustomProperty(tm,e)}set _name(e){this.name=e}}class om{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new Fd('view-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.');if(e.direction&&'forward'!=e.direction&&'backward'!=e.direction)throw new Fd('view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.',{direction:e.direction});this.boundaries=e.boundaries||null,this.position=e.startPosition?im.createFromPosition(e.startPosition):im.createFromPosition(e.boundaries['backward'==e.direction?'end':'start']),this.direction=e.direction||'forward',this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(e){let t,n,o;do o=this.position,({done:t,value:n}=this.next());while(!t&&e(n));t||(this.position=o)}next(){return'forward'==this.direction?this._next():this._previous()}_next(){let e=im.createFromPosition(this.position);const t=this.position,n=e.parent;if(null===n.parent&&e.offset===n.childCount)return{done:!0};if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0};let o;if(n instanceof up){if(e.isAtEnd)return this.position=im.createAfter(n),this._next();o=n.data[e.offset]}else o=n.getChild(e.offset);if(o instanceof gp)return this.shallow?e.offset++:e=new im(o,0),this.position=e,this._formatReturnValue('elementStart',o,t,e,1);if(!(o instanceof up)){if('string'==typeof o){let o;if(this.singleCharacters)o=1;else{const t=n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length;o=t-e.offset}const i=new pp(n,e.offset,o);return e.offset+=o,this.position=e,this._formatReturnValue('text',i,t,e,o)}return e=im.createAfter(n),this.position=e,this.ignoreElementEnd?this._next():this._formatReturnValue('elementEnd',n,t,e)}if(this.singleCharacters)return e=new im(o,0),this.position=e,this._next();else{let n=o.data.length,i;return o==this._boundaryEndParent?(n=this.boundaries.end.offset,i=new pp(o,0,n),e=im.createAfter(i)):(i=new pp(o,0,o.data.length),e.offset++),this.position=e,this._formatReturnValue('text',i,t,e,n)}}_previous(){let e=im.createFromPosition(this.position);const t=this.position,n=e.parent;if(null===n.parent&&0===e.offset)return{done:!0};if(n==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0};let o;if(n instanceof up){if(e.isAtStart)return this.position=im.createBefore(n),this._previous();o=n.data[e.offset-1]}else o=n.getChild(e.offset-1);if(o instanceof gp)return this.shallow?(e.offset--,this.position=e,this._formatReturnValue('elementStart',o,t,e,1)):(e=new im(o,o.childCount),this.position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue('elementEnd',o,t,e));if(!(o instanceof up)){if('string'==typeof o){let o;if(!this.singleCharacters){const t=n===this._boundaryStartParent?this.boundaries.start.offset:0;o=e.offset-t}else o=1;e.offset-=o;const i=new pp(n,e.offset,o);return this.position=e,this._formatReturnValue('text',i,t,e,o)}return e=im.createBefore(n),this.position=e,this._formatReturnValue('elementStart',n,t,e,1)}if(this.singleCharacters)return e=new im(o,o.data.length),this.position=e,this._previous();else{let n=o.data.length,i;if(o==this._boundaryStartParent){const t=this.boundaries.start.offset;i=new pp(o,t,o.data.length-t),n=i.data.length,e=im.createBefore(i)}else i=new pp(o,0,o.data.length),e.offset--;return this.position=e,this._formatReturnValue('text',i,t,e,n)}}_formatReturnValue(e,t,n,o,i){return t instanceof pp&&(t.offsetInText+t.data.length==t.textNode.data.length&&('forward'!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=im.createAfter(t.textNode):(o=im.createAfter(t.textNode),this.position=o)),0===t.offsetInText&&('backward'!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=im.createBefore(t.textNode):(o=im.createBefore(t.textNode),this.position=o))),{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:o,length:i}}}}class im{constructor(e,t){this.parent=e,this.offset=t}get nodeAfter(){return this.parent.is('text')?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is('text')?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){const e=this.parent.is('text')?this.parent.data.length:this.parent.childCount;return this.offset===e}get root(){return this.parent.root}get editableElement(){let e=this.parent;for(;!(e instanceof em);)if(e.parent)e=e.parent;else return null;return e}getShiftedBy(e){const t=im.createFromPosition(this),n=t.offset+e;return t.offset=0>n?0:n,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const n=new om(t);return n.skip(e),n.position}getAncestors(){return this.parent.is('documentFragment')?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){const t=this.getAncestors(),n=e.getAncestors();let o=0;for(;t[o]==n[o]&&t[o];)o++;return 0==o?null:t[o-1]}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return'before'==this.compareWith(e)}isAfter(e){return'after'==this.compareWith(e)}compareWith(e){if(this.root!==e.root)return'different';if(this.isEqual(e))return'same';const t=this.parent.is('node')?this.parent.getPath():[],n=e.parent.is('node')?e.parent.getPath():[];t.push(this.offset),n.push(e.offset);const o=T(t,n);return'prefix'===o?'before':'extension'===o?'after':t[o]this._items.length||0>t)throw new Fd('collection-add-item-invalid-index');return this._items.splice(t,0,e),this._itemMap.set(n,e),this.fire('add',e,t),this}get(e){let t;if('string'==typeof e)t=this._itemMap.get(e);else if('number'==typeof e)t=this._items[e];else throw new Fd('collection-get-invalid-arg: Index or id must be given.');return t||null}getIndex(e){let t;return t='string'==typeof e?this._itemMap.get(e):e,this._items.indexOf(t)}remove(e){let t=!1,n,o,i;const r=this._idProperty;if('string'==typeof e?(o=e,i=this._itemMap.get(o),t=!i,i&&(n=this._items.indexOf(i))):'number'==typeof e?(n=e,i=this._items[n],t=!i,i&&(o=i[r])):(i=e,o=i[r],n=this._items.indexOf(i),t=-1==n||!this._itemMap.get(o)),t)throw new Fd('collection-remove-404: Item not found.');this._items.splice(n,1),this._itemMap.delete(o);const a=this._bindToInternalToExternalMap.get(i);return this._bindToInternalToExternalMap.delete(i),this._bindToExternalToInternalMap.delete(a),this.fire('remove',i,n),i}map(e,t){return this._items.map(e,t)}find(e,t){return this._items.find(e,t)}filter(e,t){return this._items.filter(e,t)}clear(){for(this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);this.length;)this.remove(0)}bindTo(e){if(this._bindToCollection)throw new Fd('collection-bind-to-rebind: The collection cannot be bound more than once.');return this._bindToCollection=e,{as:(e)=>{this._setUpBindToBinding((t)=>new e(t))},using:(e)=>{'function'==typeof e?this._setUpBindToBinding((t)=>e(t)):this._setUpBindToBinding((t)=>t[e])}}}_setUpBindToBinding(e){const t=this._bindToCollection,n=(n,o,i)=>{const r=t._bindToCollection==this,a=t._bindToInternalToExternalMap.get(o);if(r&&a)this._bindToExternalToInternalMap.set(o,a),this._bindToInternalToExternalMap.set(a,o);else{const n=e(o);if(!n)return void this._skippedIndexesFromExternal.push(i);let r=i;for(const e of this._skippedIndexesFromExternal)i>e&&r--;for(const e of t._skippedIndexesFromExternal)r>=e&&r++;this._bindToExternalToInternalMap.set(o,n),this._bindToInternalToExternalMap.set(n,o),this.add(n,r);for(let e=0;e{const o=this._bindToExternalToInternalMap.get(t);o&&this.remove(o),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((e,t)=>(nt&&e.push(t),e),[])})}[Symbol.iterator](){return this._items[Symbol.iterator]()}}h(lm,qd);class dm{constructor(){this.selection=new sm,this.roots=new lm({idProperty:'rootName'}),this.set('isReadOnly',!1),this.set('isFocused',!1),this.set('isComposing',!1),this._postFixers=new Set}getRoot(e='main'){return this.roots.get(e)}registerPostFixer(e){this._postFixers.add(e)}_callPostFixers(e){let t=!1;do for(const n of this._postFixers)if(t=n(e),t)break;while(t)}}h(dm,Xp);const cm=10;class um extends gp{constructor(e,t,n){super(e,t,n),this.getFillerOffset=Z,this._priority=cm,this._id=null,this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new Fd('attribute-element-get-elements-with-same-id-no-id: Cannot get elements with the same id for an attribute element without id.');return new Set(this._clonesGroup)}is(e,t=null){return t?'attributeElement'==e&&t==this.name||super.is(e,t):'attributeElement'==e||super.is(e)}isSimilar(e){return null!==this.id||null!==e.id?this.id===e.id:super.isSimilar(e)&&this.priority==e.priority}_clone(e){const t=super._clone(e);return t._priority=this._priority,t._id=this._id,t}}um.DEFAULT_PRIORITY=cm;class pm extends gp{constructor(e,t,n){super(e,t,n),this.getFillerOffset=te}is(e,t=null){return t?'emptyElement'==e&&t==this.name||super.is(e,t):'emptyElement'==e||super.is(e)}_insertChild(e,t){if(t&&(t instanceof cp||0=n;n++){const o=e(n);t[o.toLowerCase()]=n}for(let e=48;57>=e;e++)t[e-48]=e;for(let e=112;123>=e;e++)t['f'+(e-111)]=e;return t}();class _m extends gp{constructor(e,t,n){super(e,t,n),this.getFillerOffset=se}is(e,t=null){return t?'uiElement'==e&&t==this.name||super.is(e,t):'uiElement'==e||super.is(e)}_insertChild(e,t){if(t&&(t instanceof cp||0e.is('element')&&t.isSimilar(e));e&&(i=rm.createIn(e))}i&&(i.end.isAfter(e.end)&&(i.end=e.end),i.start.isBefore(e.start)&&(i.start=e.start),this.remove(i))}}move(e,t){let n;if(t.isAfter(e.end)){t=this._breakAttributes(t,!0);const o=t.parent,i=o.childCount;e=this._breakAttributesRange(e,!0),n=this.remove(e),t.offset+=o.childCount-i}else n=this.remove(e);return this.insert(t,n)}wrap(e,t){if(!(t instanceof um))throw new Fd('view-writer-wrap-invalid-attribute');if(_e(e),!e.isCollapsed)return this._wrapRange(e,t);else{let n=e.start;n.parent.is('element')&&!ce(n.parent)&&(n=n.getLastMatchingPosition((e)=>e.item.is('uiElement'))),n=this._wrapPosition(n,t);const o=this.document.selection;return o.isCollapsed&&o.getFirstPosition().isEqual(e.start)&&this.setSelection(n),new rm(n)}}unwrap(e,t){if(!(t instanceof um))throw new Fd('view-writer-unwrap-invalid-attribute');if(_e(e),e.isCollapsed)return e;const{start:n,end:o}=this._breakAttributesRange(e,!0);if(o.isEqual(n.getShiftedBy(1))){const e=n.nodeAfter;if(!t.isSimilar(e)&&e instanceof um&&this._unwrapAttributeElement(t,e)){const e=this.mergeAttributes(n);e.isEqual(n)||o.offset--;const t=this.mergeAttributes(o);return new rm(e,t)}}const i=n.parent,r=this._unwrapChildren(i,n.offset,o.offset,t),a=this.mergeAttributes(r.start);a.isEqual(r.start)||r.end.offset--;const s=this.mergeAttributes(r.end);return new rm(a,s)}rename(e,t){const n=new fp(t,e.getAttributes());return this.insert(im.createAfter(e),n),this.move(rm.createIn(e),im.createAt(n)),this.remove(rm.createOn(e)),n}_wrapChildren(e,t,n,o){let r=t;const i=[];for(;r!1,e.parent._insertChild(e.offset,n);const o=new rm(e,e.getShiftedBy(1));this.wrap(o,t);const i=new im(n.parent,n.index);n._remove();const r=i.nodeBefore,a=i.nodeAfter;return r instanceof up&&a instanceof up?fe(r,a):me(i)}_wrapAttributeElement(e,t){if(!we(e,t))return!1;if(e.name!==t.name||e.priority!==t.priority)return!1;for(const n of e.getAttributeKeys())if('class'!==n&&'style'!==n&&t.hasAttribute(n)&&t.getAttribute(n)!==e.getAttribute(n))return!1;for(const n of e.getStyleNames())if(t.hasStyle(n)&&t.getStyle(n)!==e.getStyle(n))return!1;for(const n of e.getAttributeKeys())'class'!==n&&'style'!==n&&(t.hasAttribute(n)||this.setAttribute(n,e.getAttribute(n),t));for(const n of e.getStyleNames())t.hasStyle(n)||this.setStyle(n,e.getStyle(n),t);for(const n of e.getClassNames())t.hasClass(n)||this.addClass(n,t);return!0}_unwrapAttributeElement(e,t){if(!we(e,t))return!1;if(e.name!==t.name||e.priority!==t.priority)return!1;for(const n of e.getAttributeKeys())if('class'!==n&&'style'!==n&&(!t.hasAttribute(n)||t.getAttribute(n)!==e.getAttribute(n)))return!1;if(!t.hasClass(...e.getClassNames()))return!1;for(const n of e.getStyleNames())if(!t.hasStyle(n)||t.getStyle(n)!==e.getStyle(n))return!1;for(const n of e.getAttributeKeys())'class'!==n&&'style'!==n&&this.removeAttribute(n,t);return this.removeClass(Array.from(e.getClassNames()),t),this.removeStyle(Array.from(e.getStyleNames()),t),!0}_breakAttributesRange(e,t=!1){const n=e.start,o=e.end;if(_e(e),e.isCollapsed){const n=this._breakAttributes(e.start,t);return new rm(n,n)}const i=this._breakAttributes(o,t),r=i.parent.childCount,a=this._breakAttributes(n,t);return i.offset+=i.parent.childCount-r,new rm(a,i)}_breakAttributes(e,t=!1){const n=e.offset,o=e.parent;if(e.parent.is('emptyElement'))throw new Fd('view-writer-cannot-break-empty-element');if(e.parent.is('uiElement'))throw new Fd('view-writer-cannot-break-ui-element');if(!t&&o.is('text')&&ke(o.parent))return im.createFromPosition(e);if(ke(o))return im.createFromPosition(e);if(o.is('text'))return this._breakAttributes(ge(e),t);const i=o.childCount;if(n==i){const e=new im(o.parent,o.index+1);return this._breakAttributes(e,t)}if(0===n){const e=new im(o.parent,o.index);return this._breakAttributes(e,t)}else{const e=o.index+1,i=o._clone();o.parent._insertChild(e,i),this._addToClonedElementsGroup(i);const r=o.childCount-n,a=o._removeChildren(n,r);i._appendChild(a);const s=new im(o.parent,e);return this._breakAttributes(s,t)}}_addToClonedElementsGroup(e){if(!e.root.is('rootElement'))return;if(e.is('element'))for(const t of e.getChildren())this._addToClonedElementsGroup(t);const t=e.id;if(!t)return;let n=this._cloneGroups.get(t);n||(n=new Set,this._cloneGroups.set(t,n)),n.add(e),e._clonesGroup=n}_removeFromClonedElementsGroup(e){if(e.is('element'))for(const t of e.getChildren())this._removeFromClonedElementsGroup(t);const t=e.id;if(t){const n=this._cloneGroups.get(t);n&&(n.delete(e),0===n.size&&this._cloneGroups.delete(t))}}}const ym=[up,um,fp,pm,_m],xm=(e)=>{const t=e.createElement('br');return t.dataset.ckeFiller=!0,t},Cm=(e)=>e.createTextNode('\xA0'),Am=7;let Tm='';for(let e=0;ee.name),o=e.getAttributeKeys();for(const n of o)t.setAttribute(n,e.getAttribute(n));for(const o of n)e.hasAttribute(o)||t.removeAttribute(o)}}_updateChildren(e,t){const n=this.domConverter.mapViewToDom(e);if(n){const o=t.inlineFillerPosition,r=this._getElementExpectedChildren(e,n,{bind:!0,inlineFillerPosition:o}),a=this._diffChildren(e,o),s=a.actualDomChildren;let l=0;const i=new Set;for(const e of a.actions)'insert'===e?(Ee(n,l,r[l]),l++):'delete'===e?(i.add(s[l]),Se(s[l])):(this._markDescendantTextToSync(this.domConverter.domToView(r[l])),l++);for(const e of i)e.parentNode||this.domConverter.unbindDomElement(e)}}_diffChildren(e,t=null){const n=this.domConverter.mapViewToDom(e),o=n.childNodes,i=this._getElementExpectedChildren(e,n,{withChildren:!1,inlineFillerPosition:t});return{actions:Pe(o,i,Le.bind(null,this.domConverter.blockFiller)),actualDomChildren:o,expectedDomChildren:i}}_getElementExpectedChildren(e,t,n){const o=Array.from(this.domConverter.viewChildrenToDom(e,t.ownerDocument,n)),i=n.inlineFillerPosition;return i&&i.parent===e&&this._addInlineFiller(t.ownerDocument,o,i.offset),o}_findReplaceActions(e,t,n){if(-1===e.indexOf('insert')||-1===e.indexOf('delete'))return e;let o=[],i=[],r=[];const a={equal:0,insert:0,delete:0};for(const s of e)'insert'===s?r.push(n[a.equal+a.insert]):'delete'===s?i.push(t[a.equal+a.delete]):(o=o.concat(Pe(i,r,Me).map((e)=>'equal'===e?'replace':e)),o.push('equal'),i=[],r=[]),a[s]++;return o.concat(Pe(i,r,Me).map((e)=>'equal'===e?'replace':e))}_markDescendantTextToSync(e){if(e)if(e.is('text'))this.markedTexts.add(e);else if(e.is('element'))for(const t of e.getChildren())this._markDescendantTextToSync(t)}_updateSelection(){if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const e=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&e&&(this.selection.isFake?this._updateFakeSelection(e):(this._removeFakeSelection(),this._updateDomSelection(e)))}_updateFakeSelection(e){const t=e.ownerDocument;let n=this._fakeSelectionContainer;n||(this._fakeSelectionContainer=n=t.createElement('div'),Object.assign(n.style,{position:'fixed',top:0,left:'-9999px',width:'42px'}),n.appendChild(t.createTextNode('\xA0'))),n.parentElement||e.appendChild(n),n.firstChild.data=this.selection.fakeSelectionLabel||'\xA0';const o=t.getSelection(),i=t.createRange();o.removeAllRanges(),i.selectNodeContents(n),o.addRange(i),this.domConverter.bindFakeSelection(n,this.selection)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(this._domSelectionNeedsUpdate(t)){const n=this.domConverter.viewPositionToDom(this.selection.anchor),o=this.domConverter.viewPositionToDom(this.selection.focus);e.focus(),t.collapse(n.parent,n.offset),t.extend(o.parent,o.offset)}}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;const t=e&&this.domConverter.domSelectionToView(e);return!(t&&this.selection.isEqual(t))&&(this.selection.isCollapsed||!this.selection.isSimilar(t))}_removeDomSelection(){for(const e of this.domDocuments){const t=e.getSelection();if(t.rangeCount){const t=e.activeElement,n=this.domConverter.mapDomToView(t);t&&n&&e.getSelection().removeAllRanges()}}}_removeFakeSelection(){const e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;e&&this.domConverter.focus(e)}}}h(Em,Xp);var Sm={window,document},Om=function(e){return!!e&&1===e.nodeType&&Ad(e)&&!Rd(e)};class Rm{constructor(e={}){this.blockFiller=e.blockFiller||xm,this.preElements=['pre'],this.blockElements=['p','div','h1','h2','h3','h4','h5','h6'],this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new am(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}unbindDomElement(e){const t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);for(const t of Array.from(e.childNodes))this.unbindDomElement(t)}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}viewToDom(e,t,n={}){if(e.is('text')){const n=this._processDataFromViewText(e);return t.createTextNode(n)}else{if(this.mapViewToDom(e))return this.mapViewToDom(e);let o;if(e.is('documentFragment'))o=t.createDocumentFragment(),n.bind&&this.bindDocumentFragments(o,e);else{if(e.is('uiElement'))return o=e.render(t),n.bind&&this.bindElements(o,e),o;o=t.createElement(e.name),n.bind&&this.bindElements(o,e);for(const t of e.getAttributeKeys())o.setAttribute(t,e.getAttribute(t))}if(n.withChildren||void 0===n.withChildren)for(const i of this.viewChildrenToDom(e,t,n))o.appendChild(i);return o}}*viewChildrenToDom(e,t,n={}){const o=e.getFillerOffset&&e.getFillerOffset();let i=0;for(const r of e.getChildren())o===i&&(yield this.blockFiller(t)),yield this.viewToDom(r,t,n),i++;o===i&&(yield this.blockFiller(t))}viewRangeToDom(e){const t=this.viewPositionToDom(e.start),n=this.viewPositionToDom(e.end),o=document.createRange();return o.setStart(t.parent,t.offset),o.setEnd(n.parent,n.offset),o}viewPositionToDom(e){const t=e.parent;if(t.is('text')){const n=this.findCorrespondingDomText(t);if(!n)return null;let o=e.offset;return ve(n)&&(o+=Am),{parent:n,offset:o}}else{let n,o,i;if(0===e.offset){if(n=this.mapViewToDom(t),!n)return null;i=n.childNodes[0]}else{const t=e.nodeBefore;if(o=t.is('text')?this.findCorrespondingDomText(t):this.mapViewToDom(e.nodeBefore),!o)return null;n=o.parentNode,i=o.nextSibling}if(Oe(i)&&ve(i))return{parent:i,offset:Am};const r=o?ze(o)+1:0;return{parent:n,offset:r}}}domToView(e,t={}){if(Ce(e,this.blockFiller))return null;const n=this.getParentUIElement(e,this._domToViewMapping);if(n)return n;if(Oe(e)){if(ye(e))return null;else{const t=this._processDataFromDomText(e);return''===t?null:new up(t)}}else if(this.isComment(e))return null;else{if(this.mapDomToView(e))return this.mapDomToView(e);let n;if(this.isDocumentFragment(e))n=new wm,t.bind&&this.bindDocumentFragments(e,n);else{const o=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();n=new gp(o),t.bind&&this.bindElements(e,n);const r=e.attributes;for(let e=r.length-1;0<=e;e--)n._setAttribute(r[e].name,r[e].value)}if(t.withChildren||void 0===t.withChildren)for(const o of this.domChildrenToView(e,t))n._appendChild(o);return n}}*domChildrenToView(e,t={}){for(let n=0;no?0:o),new im(n,o)):null}if(0===t){const t=this.mapDomToView(e);if(t)return new im(t,0)}else{const n=e.childNodes[t-1],o=Oe(n)?this.findCorrespondingViewText(n):this.mapDomToView(n);if(o&&o.parent)return new im(o.parent,o.index+1)}return null}mapDomToView(e){return this.getParentUIElement(e)||this._domToViewMapping.get(e)}findCorrespondingViewText(e){if(ye(e))return null;const t=this.getParentUIElement(e);if(t)return t;const n=e.previousSibling;if(n){if(!this.isElement(n))return null;const e=this.mapDomToView(n);if(e){const t=e.nextSibling;return t instanceof up?e.nextSibling:null}}else{const t=this.mapDomToView(e.parentNode);if(t){const e=t.getChild(0);return e instanceof up?e:null}}return null}mapViewToDom(e){return this._viewToDomMapping.get(e)}findCorrespondingDomText(e){const t=e.previousSibling;return t&&this.mapViewToDom(t)?this.mapViewToDom(t).nextSibling:!t&&e.parent&&this.mapViewToDom(e.parent)?this.mapViewToDom(e.parent).childNodes[0]:null}focus(e){const t=this.mapViewToDom(e);if(t&&t.ownerDocument.activeElement!==t){const{scrollX:e,scrollY:n}=Sm.window,o=[];He(t,(e)=>{const{scrollLeft:t,scrollTop:n}=e;o.push([t,n])}),t.focus(),He(t,(e)=>{const[t,n]=o.shift();e.scrollLeft=t,e.scrollTop=n}),Sm.window.scrollTo(e,n)}}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isComment(e){return e&&e.nodeType==Node.COMMENT_NODE}isDomSelectionBackward(e){if(e.isCollapsed)return!1;const t=document.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset);const n=t.collapsed;return t.detach(),n}getParentUIElement(e){const t=je(e);for(t.pop();t.length;){const e=t.pop(),n=this._domToViewMapping.get(e);if(n&&n.is('uiElement'))return n}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}_isDomSelectionPositionCorrect(e,t){if(Oe(e)&&ve(e)&&tthis.preElements.includes(e.name)))return t;if(' '==t.charAt(0)){const n=this._getTouchingViewTextNode(e,!1),o=n&&this._nodeEndsWithSpace(n);(o||!n)&&(t='\xA0'+t.substr(1))}if(' '==t.charAt(t.length-1)){const n=this._getTouchingViewTextNode(e,!0);n||(t=t.substr(0,t.length-1)+'\xA0')}return t.replace(/ {2}/g,' \xA0')}_nodeEndsWithSpace(e){if(e.getAncestors().some((e)=>this.preElements.includes(e.name)))return!1;const t=this._processDataFromViewText(e);return' '==t.charAt(t.length-1)}_processDataFromDomText(e){let t=e.data;if(We(e,this.preElements))return xe(e);t=t.replace(/[ \n\t\r]{1,}/g,' ');const n=this._getTouchingInlineDomNode(e,!1),o=this._getTouchingInlineDomNode(e,!0),i=this._checkShouldLeftTrimDomText(n),r=this._checkShouldRightTrimDomText(e,o);return i&&(t=t.replace(/^ /,'')),r&&(t=t.replace(/ $/,'')),t=xe(new Text(t)),t=t.replace(/ \u00A0/g,' '),i&&(t=t.replace(/^\u00A0/,' ')),(!Oe(o)||'\xA0'==o.data.charAt(0))&&(t=t.replace(/\u00A0( *)$/,' $1')),t}_checkShouldLeftTrimDomText(e){return!e||!!Om(e)||/[^\S\u00A0]/.test(e.data.charAt(e.data.length-1))}_checkShouldRightTrimDomText(e,t){return!t&&!ve(e)}_getTouchingViewTextNode(e,t){const n=new om({startPosition:t?im.createAfter(e):im.createBefore(e),direction:t?'forward':'backward'});for(const o of n){if(o.item.is('containerElement'))return null;if(o.item.is('br'))return null;if(o.item.is('textProxy'))return o.item}return null}_getTouchingInlineDomNode(e,t){if(!e.parentNode)return null;const n=t?'nextNode':'previousNode',o=e.ownerDocument,i=je(e)[0],r=o.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,{acceptNode(e){return Oe(e)?NodeFilter.FILTER_ACCEPT:'BR'==e.tagName?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});r.currentNode=e;const a=r[n]();if(null!==a){const t=qe(e,a);if(t&&!We(e,this.blockElements,t)&&!We(a,this.blockElements,t))return a}return null}}const Im=Kp({},qd,{listenTo(e,...t){if(Re(e)||Ue(e)){const n=this._getProxyEmitter(e)||new Fm(e);n.attach(...t),e=n}qd.listenTo.call(this,e,...t)},stopListening(e,t,n){if(Re(e)||Ue(e)){const t=this._getProxyEmitter(e);if(!t)return;e=t}qd.stopListening.call(this,e,t,n),e instanceof Fm&&e.detach(t)},_getProxyEmitter(e){return a(this,$e(e))}});var Vm=Im;class Fm{constructor(e){s(this,$e(e)),this._domNode=e}}Kp(Fm.prototype,qd,{attach(e,t,n={}){if(!(this._domListeners&&this._domListeners[e])){const t=this._createDomListener(e,!!n.useCapture);this._domNode.addEventListener(e,t,!!n.useCapture),this._domListeners||(this._domListeners={}),this._domListeners[e]=t}},detach(e){let t;!this._domListeners[e]||(t=this._events[e])&&t.callbacks.length||this._domListeners[e].removeListener()},_createDomListener(e,t){const n=(t)=>{this.fire(e,t)};return n.removeListener=()=>{this._domNode.removeEventListener(e,n,t),delete this._domListeners[e]},n}});class Nm{constructor(e){this.view=e,this.document=e.document,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}}h(Nm,Vm);Ke.prototype.add=Ke.prototype.push=function(e){return this.__data__.set(e,'__lodash_hash_undefined__'),this},Ke.prototype.has=function(e){return this.__data__.has(e)};var Dm=Ke,Bm=function(e,t){for(var n=-1,o=e.length;++ns))return!1;var d=r.get(e);if(d)return d==t;var c=-1,u=!0,p=i&1?new Dm:void 0;for(r.set(e,t);++c{this.listenTo(e,t,(e,t)=>{this.isEnabled&&this.onDomEvent(t)},{useCapture:this.useCapture})})}fire(e,t,n){this.isEnabled&&this.document.fire(e,new ng(this.view,t,n))}}class ig extends og{constructor(e){super(e),this.domEventType=['keydown','keyup']}onDomEvent(e){this.fire(e.type,e,{keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey||e.metaKey,shiftKey:e.shiftKey,get keystroke(){return ne(this)}})}}var rg=Date.now,ag=rg,sg='Expected a function',lg=_d,dg=wd,cg=Qe;class ug extends Nm{constructor(e){super(e),this._fireSelectionChangeDoneDebounced=cg((e)=>this.document.fire('selectionChangeDone',e),200)}observe(){const e=this.document;e.on('keydown',(t,n)=>{const o=e.selection;o.isFake&&Ye(n.keyCode)&&this.isEnabled&&(n.preventDefault(),this._handleSelectionMove(n.keyCode))},{priority:'lowest'})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection,n=new am(t.getRanges(),{backward:t.isBackward,fake:!1});(e==km.arrowleft||e==km.arrowup)&&n.setTo(n.getFirstPosition()),(e==km.arrowright||e==km.arrowdown)&&n.setTo(n.getLastPosition());const o={oldSelection:t,newSelection:n,domSelection:null};this.document.fire('selectionChange',o),this._fireSelectionChangeDoneDebounced(o)}}const pg={error(e,t){console.error(i(e),t)},warn(e,t){console.warn(i(e),t)}};var mg=pg;class gg extends Nm{constructor(e){super(e),this.mutationObserver=e.getObserver(tg),this.selection=this.document.selection,this.domConverter=e.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=cg((e)=>this.document.fire('selectionChangeDone',e),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._loopbackCounter=0}observe(e){const t=e.ownerDocument;this._documents.has(t)||(this.listenTo(t,'selectionchange',()=>{this._handleSelectionChange(t)}),this._documents.add(t))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(e){if(this.isEnabled&&(this.document.isFocused||this.document.isReadOnly)){this.mutationObserver.flush();const t=e.defaultView.getSelection(),n=this.domConverter.domSelectionToView(t);if(!(this.selection.isEqual(n)&&this.domConverter.isDomSelectionCorrect(t))){if(60<++this._loopbackCounter)return void mg.warn('selectionchange-infinite-loop: Selection change observer detected an infinite rendering loop.');if(this.selection.isSimilar(n))this.view.render();else{const e={oldSelection:this.selection,newSelection:n,domSelection:t};this.document.fire('selectionChange',e),this._fireSelectionChangeDoneDebounced(e)}}}}_clearInfiniteLoop(){this._loopbackCounter=0}}class fg extends og{constructor(e){super(e),this.domEventType=['focus','blur'],this.useCapture=!0;const t=this.document;t.on('focus',()=>{t.isFocused=!0,this._renderTimeoutId=setTimeout(()=>e.render(),50)}),t.on('blur',(n,o)=>{const i=t.selection.editableElement;(null===i||i===o.target)&&(t.isFocused=!1,e.render())})}onDomEvent(e){this.fire(e.type,e)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class hg extends og{constructor(e){super(e),this.domEventType=['compositionstart','compositionupdate','compositionend'];const t=this.document;t.on('compositionstart',()=>{t.isComposing=!0}),t.on('compositionend',()=>{t.isComposing=!1})}onDomEvent(e){this.fire(e.type,e)}}class bg{constructor(e){const t=Xe(e);if(Object.defineProperty(this,'_source',{value:e._source||e,writable:!0,enumerable:!1}),Om(e)||t){const n=t?e.startContainer:e;n.ownerDocument&&n.ownerDocument.body.contains(n)||mg.warn('rect-source-not-in-dom: The source of this rect does not belong to any rendered DOM tree.',{source:e}),t?et(this,bg.getDomRangeRects(e)[0]):et(this,e.getBoundingClientRect())}else if(Ue(e)){const{innerWidth:t,innerHeight:n}=e;et(this,{top:0,right:t,bottom:n,left:0,width:t,height:n})}else et(this,e)}clone(){return new bg(this)}moveTo(e,t){return this.top=t,this.right=e+this.width,this.bottom=t+this.height,this.left=e,this}moveBy(e,t){return this.top+=t,this.right+=e,this.left+=e,this.bottom+=t,this}getIntersection(e){const t={top:_d(this.top,e.top),right:wd(this.right,e.right),bottom:wd(this.bottom,e.bottom),left:_d(this.left,e.left)};return t.width=t.right-t.left,t.height=t.bottom-t.top,0>t.width||0>t.height?null:new bg(t)}getIntersectionArea(e){const t=this.getIntersection(e);return t?t.getArea():0}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(!tt(e))for(let n=e.parentNode||e.commonAncestorContainer;n&&!tt(n);){const e=new bg(n),o=t.getIntersection(e);if(o)o.getArea()new bg(e))}});class _g{constructor(){this.document=new dm,this.domConverter=new Rm,this._renderer=new Em(this.domConverter,this.document.selection),this._renderer.bind('isFocused').to(this.document),this.domRoots=new Map,this._observers=new Map,this._ongoingChange=!1,this._renderingInProgress=!1,this._postFixersInProgress=!1,this._writer=new vm(this.document),this.addObserver(tg),this.addObserver(gg),this.addObserver(fg),this.addObserver(ig),this.addObserver(ug),this.addObserver(hg),Ae(this),ae(this),this.on('render',()=>{this._render()})}attachDomRoot(e,t='main'){const n=this.document.getRoot(t);n._name=e.tagName.toLowerCase(),this.domRoots.set(t,e),this.domConverter.bindElements(e,n),this._renderer.markToSync('children',n),this._renderer.domDocuments.add(e.ownerDocument),n.on('change:children',(e,t)=>this._renderer.markToSync('children',t)),n.on('change:attributes',(e,t)=>this._renderer.markToSync('attributes',t)),n.on('change:text',(e,t)=>this._renderer.markToSync('text',t));for(const n of this._observers.values())n.observe(e,t)}getDomRoot(e='main'){return this.domRoots.get(e)}addObserver(e){let t=this._observers.get(e);if(t)return t;t=new e(this),this._observers.set(e,t);for(const[n,o]of this.domRoots)t.observe(o,n);return t.enable(),t}getObserver(e){return this._observers.get(e)}disableObservers(){for(const e of this._observers.values())e.disable()}enableObservers(){for(const e of this._observers.values())e.enable()}scrollToTheSelection(){const e=this.document.selection.getFirstRange();e&&nt({target:this.domConverter.viewRangeToDom(e),viewportOffset:20})}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;e?(this.domConverter.focus(e),this.render()):mg.warn('view-focus-no-selection: There is no selection in any editable to focus.')}}change(e){if(this._renderingInProgress||this._postFixersInProgress)throw new Fd('cannot-change-view-tree: Attempting to make changes to the view when it is in incorrect state: rendering or post-fixers are in progress. This may cause some unexpected behaviour and inconsistency between the DOM and the view.');return this._ongoingChange?void e(this._writer):void(this._ongoingChange=!0,e(this._writer),this._ongoingChange=!1,this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire('render'))}render(){this.change(()=>{})}destroy(){for(const e of this._observers.values())e.destroy();this.stopListening()}_render(){this._renderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this._renderingInProgress=!1}}h(_g,Xp);class wg{constructor(e){this.parent=null,this._attrs=mt(e)}get index(){let e;if(!this.parent)return null;if(null===(e=this.parent.getChildIndex(this)))throw new Fd('model-node-not-found-in-parent: The node\'s parent does not contain this node.');return e}get startOffset(){let e;if(!this.parent)return null;if(null===(e=this.parent.getChildStartOffset(this)))throw new Fd('model-node-not-found-in-parent: The node\'s parent does not contain this node.');return e}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}get document(){return this.root==this?null:this.root.document||null}getPath(){const e=[];for(let t=this;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];for(let n=e.includeSelf?this:this.parent;n;)t[e.parentFirst?'push':'unshift'](n),n=n.parent;return t}getCommonAncestor(e,t={}){const n=this.getAncestors(t),o=e.getAncestors(t);let r=0;for(;n[r]==o[r]&&n[r];)r++;return 0==r?null:n[r-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),n=e.getPath(),o=T(t,n);return!('prefix'!==o)||'extension'!==o&&t[o]t||t>e.offsetSize)throw new Fd('model-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.');if(0>n||t+n>e.offsetSize)throw new Fd('model-textproxy-wrong-length: Given length value is incorrect.');this.data=e.data.substring(t,t+n),this.offsetInText=t}get startOffset(){return null===this.textNode.startOffset?null:this.textNode.startOffset+this.offsetInText}get offsetSize(){return this.data.length}get endOffset(){return null===this.startOffset?null:this.startOffset+this.offsetSize}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(e){return'textProxy'==e}getPath(){const e=this.textNode.getPath();return 0e+t.offsetSize,0)}getNode(e){return this._nodes[e]||null}getNodeIndex(e){const t=this._nodes.indexOf(e);return-1==t?null:t}getNodeStartOffset(e){const t=this.getNodeIndex(e);return null===t?null:this._nodes.slice(0,t).reduce((e,t)=>e+t.offsetSize,0)}indexToOffset(e){if(e==this._nodes.length)return this.maxOffset;const t=this._nodes[e];if(!t)throw new Fd('model-nodelist-index-out-of-bounds: Given index cannot be found in the node list.');return this.getNodeStartOffset(t)}offsetToIndex(e){let t=0;for(const n of this._nodes){if(e>=t&&ee.toJSON())}}class Cg extends wg{constructor(e,t,n){super(t),this.name=e,this._children=new xg,n&&this._insertChild(0,n)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}is(e,t=null){return t?'element'==e&&t==this.name:'element'==e||e==this.name||super.is(e)}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}offsetToIndex(e){return this._children.offsetToIndex(e)}getNodeByPath(e){let t=this;for(const n of e)t=t.getChild(t.offsetToIndex(n));return t}toJSON(){const e=super.toJSON();if(e.name=this.name,0e._clone(!0)):null;return new Cg(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=gt(t);for(const o of n)null!==o.parent&&o._remove(),o.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const o of n)o.parent=null;return n}static fromJSON(e){let t=null;if(e.children){t=[];for(const n of e.children)n.name?t.push(Cg.fromJSON(n)):t.push(vg.fromJSON(n))}return new Cg(e.name,e.attributes,t)}}class Ag{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new Fd('model-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.');const t=e.direction||'forward';if('forward'!=t&&'backward'!=t)throw new Fd('model-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.',{direction:t});this.direction=t,this.boundaries=e.boundaries||null,this.position=e.startPosition?Pg.createFromPosition(e.startPosition):Pg.createFromPosition(this.boundaries['backward'==this.direction?'end':'start']),this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}skip(e){let t,n,o,i;do o=this.position,i=this._visitedParent,({done:t,value:n}=this.next());while(!t&&e(n));t||(this.position=o,this._visitedParent=i)}next(){return'forward'==this.direction?this._next():this._previous()}_next(){const e=this.position,t=Pg.createFromPosition(this.position),n=this._visitedParent;if(null===n.parent&&t.offset===n.maxOffset)return{done:!0};if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};const o=t.textNode?t.textNode:t.nodeAfter;if(o instanceof Cg)return this.shallow?t.offset++:(t.path.push(0),this._visitedParent=o),this.position=t,ft('elementStart',o,e,t,1);if(o instanceof vg){let i;if(this.singleCharacters)i=1;else{let e=o.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offsete&&(e=this.boundaries.start.offset),i=t.offset-e}const r=t.offset-o.startOffset,a=new yg(o,r-i,i);return t.offset-=i,this.position=t,ft('text',a,e,t,i)}return t.path.pop(),this.position=t,this._visitedParent=n.parent,ft('elementStart',n,e,t,1)}}var Tg=function(e){var t=e?e.length:0;return t?e[t-1]:void 0};class Pg{constructor(e,t){if(!e.is('element')&&!e.is('documentFragment'))throw new Fd('model-position-root-invalid: Position root invalid.');if(!(t instanceof Array)||0===t.length)throw new Fd('model-position-path-incorrect: Position path must be an array with at least one item.',{path:t});t=e.getPath().concat(t),e=e.root,this.root=e,this.path=t}get offset(){return Tg(this.path)}set offset(e){this.path[this.path.length-1]=e}get parent(){let e=this.root;for(let t=0;tn?0:n,t}isAfter(e){return'after'==this.compareWith(e)}isBefore(e){return'before'==this.compareWith(e)}isEqual(e){return'same'==this.compareWith(e)}isTouching(e){let t=null,n=null;const o=this.compareWith(e);switch(o){case'same':return!0;case'before':t=Pg.createFromPosition(this),n=Pg.createFromPosition(e);break;case'after':t=Pg.createFromPosition(e),n=Pg.createFromPosition(this);break;default:return!1;}for(let o=t.parent;t.path.length+n.path.length;){if(t.isEqual(n))return!0;if(t.path.length>n.path.length){if(t.offset!==o.maxOffset)return!1;t.path=t.path.slice(0,-1),o=o.parent,t.offset++}else{if(0!==n.offset)return!1;n.path=n.path.slice(0,-1)}}}_getTransformedByDeletion(e,t){const n=Pg.createFromPosition(this);if(this.root!=e.root)return n;if('same'==T(e.getParentPath(),this.getParentPath())){if(e.offsetthis.offset)return null;n.offset-=t}}else if('prefix'==T(e.getParentPath(),this.getParentPath())){const o=e.path.length-1;if(e.offset<=this.path[o]){if(e.offset+t>this.path[o])return null;n.path[o]-=t}}return n}_getTransformedByInsertion(e,t,n){const o=Pg.createFromPosition(this);if(this.root!=e.root)return o;if('same'==T(e.getParentPath(),this.getParentPath()))(e.offsett+1;){const t=o.maxOffset-n.offset;0!=t&&e.push(new Eg(n,n.getShiftedBy(t))),n.path=n.path.slice(0,-1),n.offset++,o=o.parent}for(;n.path.length<=this.end.path.length;){const t=this.end.path[n.path.length-1],o=t-n.offset;0!=o&&e.push(new Eg(n,n.getShiftedBy(o))),n.offset=t,n.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new Ag(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new Ag(e);for(const n of t)yield n.item}*getPositions(e={}){e.boundaries=this;const t=new Ag(e);yield t.position;for(const n of t)yield n.nextPosition}getTransformedByDelta(e){const t=[Eg.createFromRange(this)],n=new Set(['insert','move','remove','reinsert']);for(const o of e.operations)if(n.has(o.type))for(let n=0;ne.start.isAfter(t.start)?1:-1);const n=e.indexOf(t),o=new this(t.start,t.end);for(let t=n-1;0<=t&&e[t].end.isEqual(o.start);t++)o.start=Pg.createFromPosition(e[t].start);for(let t=n+1;t{if(!t.viewPosition){const e=this._modelToViewMapping.get(t.modelPosition.parent);t.viewPosition=this._findPositionIn(e,t.modelPosition.offset)}},{priority:'low'}),this.on('viewToModelPosition',(e,t)=>{if(t.modelPosition)return;let n=t.viewPosition.parent,o=this._viewToModelMapping.get(n);for(;!o;)n=n.parent,o=this._viewToModelMapping.get(n);const i=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,n);t.modelPosition=Pg.createFromParentAndOffset(o,i)},{priority:'low'})}bindElements(e,t){this._modelToViewMapping.set(e,t),this._viewToModelMapping.set(t,e)}unbindViewElement(e){const t=this.toModelElement(e);this._viewToModelMapping.delete(e),this._modelToViewMapping.get(t)==e&&this._modelToViewMapping.delete(t)}unbindModelElement(e){const t=this.toViewElement(e);this._modelToViewMapping.delete(e),this._viewToModelMapping.get(t)==e&&this._viewToModelMapping.delete(t)}bindElementToMarker(e,t){const n=this._markerNameToElements.get(t)||new Set;n.add(e),this._markerNameToElements.set(t,n)}unbindElementsFromMarkerName(e){this._markerNameToElements.delete(e)}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new Eg(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new rm(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};return this.fire('viewToModelPosition',t),t.modelPosition}toViewPosition(e,t={isPhantom:!1}){const n={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire('modelToViewPosition',n),n.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t)return null;const n=new Set;for(const o of t)if(o.is('attributeElement'))for(const e of o.getElementsWithSameId())n.add(e);else n.add(o);return n}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}_toModelOffset(e,t,n){if(n!=e){const o=this._toModelOffset(e.parent,e.index,n),i=this._toModelOffset(e,t,e);return o+i}if(e.is('text'))return t;let o=0;for(let r=0;r{if(!(e instanceof Eg))throw new Fd('model-selection-added-not-range: Trying to add an object that is not an instance of Range.');return this._ranges.every((t)=>!t.isEqual(e))});if(e.length!==this._ranges.length||n){this._removeAllRanges();for(const t of e)this._pushRange(t);this._lastRangeBackward=!!t,this.fire('change:range',{directChange:!0})}}setFocus(e,t){if(null===this.anchor)throw new Fd('model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.');const n=Pg.createAt(e,t);if('same'!=n.compareWith(this.focus)){const e=this.anchor;this._ranges.length&&this._popRange(),'before'==n.compareWith(e)?(this._pushRange(new Eg(n,e)),this._lastRangeBackward=!0):(this._pushRange(new Eg(e,n)),this._lastRangeBackward=!1),this.fire('change:range',{directChange:!0})}}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(e){return this._attrs.has(e)}removeAttribute(e){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire('change:attribute',{attributeKeys:[e],directChange:!0}))}setAttribute(e,t){this.getAttribute(e)!==t&&(this._attrs.set(e,t),this.fire('change:attribute',{attributeKeys:[e],directChange:!0}))}getSelectedElement(){if(1!==this.rangeCount)return null;const e=this.getFirstRange(),t=e.start.nodeAfter,n=e.end.nodeBefore;return t instanceof Cg&&t==n?t:null}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const n=_t(t.start,e);n&&(yield n);for(const n of t.getWalker())'elementEnd'==n.type&&kt(n.item,e)&&(yield n.item);const o=_t(t.end,e);o&&!t.end.isTouching(Pg.createAt(o))&&(yield o)}}containsEntireContent(e=this.anchor.root){const t=Pg.createAt(e),n=Pg.createAt(e,'end');return t.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e),this._ranges.push(Eg.createFromRange(e))}_checkRange(e){for(let t=0;t{for(const e of this.getRanges())if(!this._document._validateSelectionRange(e))throw new Fd('document-selection-wrong-position: Range from document selection starts or ends at incorrect position.',{range:e})}),this.listenTo(this._document,'change',(e,t)=>{this._updateAttributes(!1),xt(this._model,t)}),this.listenTo(this._model,'applyOperation',()=>{for(;this._fixGraveyardRangesData.length;){const{liveRange:e,sourcePosition:t}=this._fixGraveyardRangesData.shift();this._fixGraveyardSelection(e,t)}this._hasChangedRange&&(this._hasChangedRange=!1,this.fire('change:range',{directChange:!1}))},{priority:'lowest'})}get isCollapsed(){const e=this._ranges.length;return 0===e?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return 0{this._hasChangedRange=!0,t.root==this._document.graveyard&&this._fixGraveyardRangesData.push({liveRange:t,sourcePosition:o.sourcePosition})}),t}_updateAttributes(e){const t=mt(this._getSurroundingAttributes()),n=mt(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(const[e,t]of this._attributePriority)'low'==t&&(this._attrs.delete(e),this._attributePriority.delete(e));this._setAttributesTo(t);const o=[];for(const[t,i]of this.getAttributes())n.has(t)&&n.get(t)===i||o.push(t);for(const[t]of n)this.hasAttribute(t)||o.push(t);0{this.view.change((e)=>{this.downcastDispatcher.convertChanges(t.differ,e),this.downcastDispatcher.convertSelection(n,o,e)})},{priority:'low'}),this.listenTo(this.view.document,'selectionChange',Dt(this.model,this.mapper)),this.downcastDispatcher.on('insert:$text',It(),{priority:'lowest'}),this.downcastDispatcher.on('remove',Vt(),{priority:'low'}),this.downcastDispatcher.on('selection',Lt(),{priority:'low'}),this.downcastDispatcher.on('selection',Bt(),{priority:'low'}),this.downcastDispatcher.on('selection',Mt(),{priority:'low'}),this.view.document.roots.bindTo(this.model.document.roots).using((e)=>{if('$graveyard'==e.rootName)return null;const t=new nm(e.name);return t.rootName=e.rootName,t._document=this.view.document,this.mapper.bindElements(e,t),t})}destroy(){this.view.destroy(),this.stopListening()}}h(Mg,Xp);class Lg{constructor(e,t=[]){this._editor=e,this._availablePlugins=new Map,this._plugins=new Map;for(const n of t)this._availablePlugins.set(n,n),n.pluginName&&this._availablePlugins.set(n.pluginName,n)}*[Symbol.iterator](){for(const e of this._plugins)'function'==typeof e[0]&&(yield e)}get(e){return this._plugins.get(e)}load(e,t=[]){function n(e){return u.includes(e)||a.get(e)||l.has(e)?void 0:o(e).catch((t)=>{throw mg.error('plugincollection-load: It was not possible to load the plugin.',{plugin:e}),t})}function o(e){return new Promise((o)=>{l.add(e),e.requires&&e.requires.forEach((o)=>{const r=i(o);if(t.includes(r))throw new Fd('plugincollection-required: Cannot load a plugin because one of its dependencies is listed inthe `removePlugins` option.',{plugin:r,requiredBy:e});n(r)});const r=new e(s);a._add(e,r),d.push(r),o()})}function i(e){return'function'==typeof e?e:a._availablePlugins.get(e)}function r(e){return e.map((e)=>i(e)).filter((e)=>!!e)}const a=this,s=this._editor,l=new Set,d=[],c=r(e),u=r(t),p=function(e){const t=[];for(const n of e)i(n)||t.push(n);return t.length?t:null}(e);if(p){const e='plugincollection-plugin-not-found: Some plugins are not available and could not be loaded.';return mg.error(e,{plugins:p}),Promise.reject(new Fd(e,{plugins:p}))}return Promise.all(c.map(n)).then(()=>d)}destroy(){const e=Array.from(this).map(([,e])=>e).filter((e)=>'function'==typeof e.destroy).map((e)=>e.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const n=e.pluginName;n&&(this._plugins.has(n)?mg.warn('plugincollection-plugin-name-conflict: Two plugins with the same name were loaded.',{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:e}):this._plugins.set(n,t))}}class zg{constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const n=this.get(e);if(!n)throw new Fd('commandcollection-command-not-found: Command does not exist.',{commandName:e});n.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands())e.destroy()}}window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={});class jg{constructor(e){this.language=e||'en',this.t=(...e)=>this._t(...e)}_t(e,t){let n=zt(this.language,e);return t&&(n=n.replace(/%(\d+)/g,(e,n)=>n{t[0]=new Ug(t[0])},{priority:'highest'}),this.on('checkChild',(e,t)=>{t[0]=new Ug(t[0]),t[1]=this.getDefinition(t[1])},{priority:'highest'})}register(e,t){if(this._sourceDefinitions[e])throw new Fd('schema-cannot-register-item-twice: A single item cannot be registered twice in the schema.',{itemName:e});this._sourceDefinitions[e]=[Object.assign({},t)],this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e])throw new Fd('schema-cannot-extend-missing-item: Cannot extend an item which was not registered yet.',{itemName:e});this._sourceDefinitions[e].push(Object.assign({},t)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(e){let t;return t='string'==typeof e?e:e.is&&(e.is('text')||e.is('textProxy'))?'$text':e.name,this.getDefinitions()[t]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){const t=this.getDefinition(e);return!!(t&&t.isBlock)}isLimit(e){const t=this.getDefinition(e);return!!t&&!!(t.isLimit||t.isObject)}isObject(e){const t=this.getDefinition(e);return!!(t&&t.isObject)}checkChild(e,t){return!!t&&this._checkContextMatch(t,e)}checkAttribute(e,t){const n=this.getDefinition(e.last);return!!n&&n.allowAttributes.includes(t)}checkMerge(e,t=null){if(e instanceof Pg){const t=e.nodeBefore,n=e.nodeAfter;if(!(t instanceof Cg))throw new Fd('schema-check-merge-no-element-before: The node before the merge position must be an element.');if(!(n instanceof Cg))throw new Fd('schema-check-merge-no-element-after: The node after the merge position must be an element.');return this.checkMerge(t,n)}for(const n of t.getChildren())if(!this.checkChild(e,n))return!1;return!0}addChildCheck(e){this.on('checkChild',(t,[n,o])=>{if(o){const i=e(n,o);'boolean'==typeof i&&(t.stop(),t.return=i)}},{priority:'high'})}addAttributeCheck(e){this.on('checkAttribute',(t,[n,o])=>{const i=e(n,o);'boolean'==typeof i&&(t.stop(),t.return=i)},{priority:'high'})}getLimitElement(e){let t=Array.from(e.getRanges()).reduce((e,t)=>{const n=t.getCommonAncestor();return e?e.getCommonAncestor(n,{includeSelf:!0}):n},null);for(;!this.isLimit(t)&&t.parent;)t=t.parent;return t}checkAttributeInSelection(e,t){if(e.isCollapsed)return this.checkAttribute([...e.getFirstPosition().getAncestors(),'$text'],t);else{const n=e.getRanges();for(const e of n)for(const n of e)if(this.checkAttribute(n.item,t))return!0}return!1}getValidRanges(e,t){const n=[];for(const o of e){let e=o.start,i=o.start;const r=o.end;for(const r of o.getWalker())this.checkAttribute(r.item,t)||(!i.isEqual(e)&&n.push(new Eg(i,e)),i=r.nextPosition),e=r.nextPosition;i&&!i.isEqual(r)&&n.push(new Eg(i,r))}return n}getNearestSelectionRange(e,t='both'){if(this.checkChild(e,'$text'))return new Eg(e);let n,o;('both'==t||'backward'==t)&&(n=new Ag({startPosition:e,direction:'backward'})),('both'==t||'forward'==t)&&(o=new Ag({startPosition:e}));for(const i of nn(n,o)){const e=i.walker==n?'elementEnd':'elementStart',t=i.value;if(t.type==e&&this.isObject(t.item))return Eg.createOn(t.item);if(this.checkChild(t.nextPosition,'$text'))return new Eg(t.nextPosition)}return null}findAllowedParent(e,t){for(let n=t.parent;n;){if(this.checkChild(n,e))return n;if(this.isLimit(n))return null;n=n.parent}return null}removeDisallowedAttributes(e,t){for(const n of e){for(const e of n.getAttributeKeys())this.checkAttribute(n,e)||t.removeAttribute(e,n);n.is('element')&&this.removeDisallowedAttributes(n.getChildren(),t)}}_clearCache(){this._compiledDefinitions=null}_compile(){const e={},t=this._sourceDefinitions,n=Object.keys(t);for(const o of n)e[o]=Wt(t[o],o);for(const t of n)Ht(e,t);for(const t of n)Ut(e,t);for(const t of n)$t(e,t),Kt(e,t);for(const t of n)Gt(e,t),Jt(e,t);this._compiledDefinitions=e}_checkContextMatch(e,t,n=t.length-1){const o=t.getItem(n);if(!e.allowIn.includes(o.name))return!1;else if(0==n)return!0;else{const e=this.getDefinition(o);return this._checkContextMatch(e,t,n-1)}}}h(Hg,Xp);class Ug{constructor(e){return e instanceof Ug?e:void('string'==typeof e?e=[e]:!Array.isArray(e)&&(e=e.getAncestors({includeSelf:!0})),e[0]&&'string'!=typeof e[0]&&e[0].is('documentFragment')&&e.shift(),this._items=e.map(tn))}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(e){const t=new Ug([e]);return t._items=[...this._items,...t._items],t}getItem(e){return this._items[e]}*getNames(){yield*this._items.map((e)=>e.name)}endsWith(e){return Array.from(this.getNames()).join(' ').endsWith(e)}}class $g{constructor(e={}){this._removeIfEmpty=new Set,this._modelCursor=null,this.conversionApi=Object.assign({},e),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this),this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this)}convert(e,t,n=['$root']){this.fire('viewCleanup',e),this._modelCursor=rn(n,t),this.conversionApi.writer=t,this.conversionApi.consumable=qg.createFrom(e),this.conversionApi.store={};const{modelRange:o}=this._convertItem(e,this._modelCursor),i=t.createDocumentFragment();if(o){this._removeEmptyElements();for(const e of Array.from(this._modelCursor.parent.getChildren()))t.append(e,i);i.markers=on(i,t)}return this._modelCursor=null,this._removeIfEmpty.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,i}_convertItem(e,t){const n=Object.assign({viewItem:e,modelCursor:t,modelRange:null});if(e.is('element')?this.fire('element:'+e.name,n,this.conversionApi):e.is('text')?this.fire('text',n,this.conversionApi):this.fire('documentFragment',n,this.conversionApi),n.modelRange&&!(n.modelRange instanceof Eg))throw new Fd('view-conversion-dispatcher-incorrect-result: Incorrect conversion result was dropped.');return{modelRange:n.modelRange,modelCursor:n.modelCursor}}_convertChildren(e,t){const n=new Eg(t);let o=t;for(const i of Array.from(e.getChildren())){const e=this._convertItem(i,o);e.modelRange instanceof Eg&&(n.end=e.modelRange.end,o=e.modelCursor)}return{modelRange:n,modelCursor:o}}_splitToAllowedParent(e,t){const n=this.conversionApi.schema.findAllowedParent(e,t);if(!n)return null;if(n===t.parent)return{position:t};if(this._modelCursor.parent.getAncestors().includes(n))return null;const o=this.conversionApi.writer.split(t,n);for(const n of o.range.getPositions())n.isEqual(o.position)||this._removeIfEmpty.add(n.parent);return{position:o.position,cursorParent:o.range.end.parent}}_removeEmptyElements(){let e=!1;for(const t of this._removeIfEmpty)t.isEmpty&&(this.conversionApi.writer.remove(t),this._removeIfEmpty.delete(t),e=!0);e&&this._removeEmptyElements()}}h($g,qd);class Kg{constructor(e,t){this.model=e,this.processor=t,this.mapper=new Sg,this.downcastDispatcher=new Rg({mapper:this.mapper}),this.downcastDispatcher.on('insert:$text',It(),{priority:'lowest'}),this.upcastDispatcher=new $g({schema:e.schema}),this.upcastDispatcher.on('text',kn(),{priority:'lowest'}),this.upcastDispatcher.on('element',bn(),{priority:'lowest'}),this.upcastDispatcher.on('documentFragment',bn(),{priority:'lowest'}),this.decorate('init')}get(e='main'){return this.stringify(this.model.document.getRoot(e))}stringify(e){const t=this.toView(e);return this.processor.toData(t)}toView(e){const t=Eg.createIn(e),n=new wm,o=new vm(new dm());if(this.mapper.bindElements(e,n),this.downcastDispatcher.convertInsert(t,o),!e.is('documentFragment')){const t=_n(e);for(const[e,n]of t)this.downcastDispatcher.convertMarkerAdd(e,n,o)}return this.mapper.clearBindings(),n}init(e,t='main'){if(this.model.document.version)throw new Fd('datacontroller-init-document-not-empty: Trying to set initial data to not empty document.');const n=this.model.document.getRoot(t);return this.model.enqueueChange('transparent',(t)=>{t.insert(this.parse(e,n),n)}),Promise.resolve()}set(e,t='main'){const n=this.model.document.getRoot(t);this.model.enqueueChange('transparent',(t)=>{t.setSelection(null),t.removeSelectionAttribute(this.model.document.selection.getAttributeKeys()),t.remove(Eg.createIn(n)),t.insert(this.parse(e,n),n)})}parse(e,t='$root'){const n=this.processor.toView(e);return this.toModel(n,t)}toModel(e,t='$root'){return this.model.change((n)=>this.upcastDispatcher.convert(e,n,t))}destroy(){}}h(Kg,Xp);class Gg{constructor(){this._dispatchersGroups=new Map}register(e,t){if(this._dispatchersGroups.has(e))throw new Fd('conversion-register-group-exists: Trying to register a group name that was already registered.');this._dispatchersGroups.set(e,t)}for(e){const t=this._getDispatchers(e);return{add(e){return wn(t,e),this}}}elementToElement(e){this.for('downcast').add(Ct(e));for(const{model:t,view:n}of vn(e))this.for('upcast').add(an({model:t,view:n,converterPriority:e.converterPriority}))}attributeToElement(e){this.for('downcast').add(At(e));for(const{model:t,view:n}of vn(e))this.for('upcast').add(sn({view:n,model:t,priority:e.priority}))}attributeToAttribute(e){this.for('downcast').add(Tt(e));for(const{model:t,view:n}of vn(e))this.for('upcast').add(ln({view:n,model:t}))}_getDispatchers(e){const t=this._dispatchersGroups.get(e);if(!t)throw new Fd('conversion-for-unknown-group: Trying to add a converter to an unknown dispatchers group.');return t}}class Jg{constructor(e){this.baseVersion=e,this.isDocumentOperation=null!==this.baseVersion}_validate(){}toJSON(){const e=dp(this,!0);return e.__className=this.constructor.className,delete e.delta,delete e.isDocumentOperation,e}static get className(){return'engine.model.operation.Operation'}static fromJSON(e){return new this(e.baseVersion)}}class Qg{constructor(e){this.markers=new Map,this._children=new xg,e&&this._insertChild(0,e)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(e){return'documentFragment'==e}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}getPath(){return[]}getNodeByPath(e){let t=this;for(const n of e)t=t.getChild(t.offsetToIndex(n));return t}offsetToIndex(e){return this._children.offsetToIndex(e)}toJSON(){const e=[];for(const t of this._children)e.push(t.toJSON());return e}static fromJSON(e){const t=[];for(const n of e)n.name?t.push(Cg.fromJSON(n)):t.push(vg.fromJSON(n));return new Qg(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=xn(t);for(const o of n)null!==o.parent&&o._remove(),o.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const o of n)o.parent=null;return n}}var Yg=function(e,t){return Zm(e,t)};class Xg extends Jg{constructor(e,t,n,o,i){super(i),this.range=Eg.createFromRange(e),this.key=t,this.oldValue=n===void 0?null:n,this.newValue=o===void 0?null:o}get type(){return null===this.oldValue?'addAttribute':null===this.newValue?'removeAttribute':'changeAttribute'}clone(){return new Xg(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Xg(this.range,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){for(const e of this.range.getItems()){if(null!==this.oldValue&&!Yg(e.getAttribute(this.key),this.oldValue))throw new Fd('attribute-operation-wrong-old-value: Changed node has different attribute value than operation\'s old attribute value.',{item:e,key:this.key,value:this.oldValue});if(null===this.oldValue&&null!==this.newValue&&e.hasAttribute(this.key))throw new Fd('attribute-operation-attribute-exists: The attribute with given key already exists.',{node:e,key:this.key})}}_execute(){Yg(this.oldValue,this.newValue)||Pn(this.range,this.key,this.newValue)}static get className(){return'engine.model.operation.AttributeOperation'}static fromJSON(e,t){return new Xg(Eg.fromJSON(e.range,t),e.key,e.oldValue,e.newValue,e.baseVersion)}}class Zg extends Jg{constructor(e,t,n,o){super(o),this.sourcePosition=Pg.createFromPosition(e),this.howMany=t,this.targetPosition=Pg.createFromPosition(n),this.isSticky=!1}get type(){return'move'}clone(){const e=new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.baseVersion);return e.isSticky=this.isSticky,e}getMovedRangeStart(){return this.targetPosition._getTransformedByDeletion(this.sourcePosition,this.howMany)}getReversed(){const e=this.sourcePosition._getTransformedByInsertion(this.targetPosition,this.howMany),t=new this.constructor(this.getMovedRangeStart(),this.howMany,e,this.baseVersion+1);return t.isSticky=this.isSticky,t}_validate(){const e=this.sourcePosition.parent,t=this.targetPosition.parent,n=this.sourcePosition.offset,o=this.targetPosition.offset;if(!e||!t)throw new Fd('move-operation-position-invalid: Source position or target position is invalid.');else if(n+this.howMany>e.maxOffset)throw new Fd('move-operation-nodes-do-not-exist: The nodes which should be moved do not exist.');else if(e===t&&n=n&&this.targetPosition.path[e]e._clone(!0)));return new nf(this.position,e,this.baseVersion)}getReversed(){const e=this.position.root.document.graveyard,t=new Pg(e,[0]);return new tf(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffsete._clone(!0))),Cn(this.position,e)}static get className(){return'engine.model.operation.InsertOperation'}static fromJSON(e,t){const n=[];for(const o of e.nodes)o.name?n.push(Cg.fromJSON(o)):n.push(vg.fromJSON(o));return new nf(Pg.fromJSON(e.position,t),n,e.baseVersion)}}class of extends Jg{constructor(e,t,n,o,i,r){super(i),this.name=e,this.oldRange=t?Eg.createFromRange(t):null,this.newRange=n?Eg.createFromRange(n):null,this.affectsData=r,this._markers=o}get type(){return'marker'}clone(){return new of(this.name,this.oldRange,this.newRange,this._markers,this.baseVersion,this.affectsData)}getReversed(){return new of(this.name,this.newRange,this.oldRange,this._markers,this.baseVersion+1,this.affectsData)}_execute(){const e=this.newRange?'_set':'_remove';this._markers[e](this.name,this.newRange,!0,this.affectsData)}toJSON(){const e=super.toJSON();return delete e._markers,e}static get className(){return'engine.model.operation.MarkerOperation'}static fromJSON(e,t){return new of(e.name,e.oldRange?Eg.fromJSON(e.oldRange,t):null,e.newRange?Eg.fromJSON(e.newRange,t):null,t.model.markers,e.baseVersion,e.affectsData)}}class rf extends Jg{get type(){return'noop'}clone(){return new rf(this.baseVersion)}getReversed(){return new rf(this.baseVersion+1)}_execute(){}static get className(){return'engine.model.operation.NoOperation'}}class af extends Jg{constructor(e,t,n,o){super(o),this.position=e,this.oldName=t,this.newName=n}get type(){return'rename'}clone(){return new af(Pg.createFromPosition(this.position),this.oldName,this.newName,this.baseVersion)}getReversed(){return new af(Pg.createFromPosition(this.position),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(!(e instanceof Cg))throw new Fd('rename-operation-wrong-position: Given position is invalid or node after it is not an instance of Element.');else if(e.name!==this.oldName)throw new Fd('rename-operation-wrong-name: Element to change has different name than operation\'s old name.')}_execute(){const e=this.position.nodeAfter;e.name=this.newName}static get className(){return'engine.model.operation.RenameOperation'}static fromJSON(e,t){return new af(Pg.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class sf extends Jg{constructor(e,t,n,o,i){super(i),this.root=e,this.key=t,this.oldValue=n,this.newValue=o}get type(){return null===this.oldValue?'addRootAttribute':null===this.newValue?'removeRootAttribute':'changeRootAttribute'}clone(){return new sf(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new sf(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is('documentFragment'))throw new Fd('rootattribute-operation-not-a-root: The element to change is not a root element.',{root:this.root,key:this.key});if(null!==this.oldValue&&this.root.getAttribute(this.key)!==this.oldValue)throw new Fd('rootattribute-operation-wrong-old-value: Changed node has different attribute value than operation\'s old attribute value.',{root:this.root,key:this.key});if(null===this.oldValue&&null!==this.newValue&&this.root.hasAttribute(this.key))throw new Fd('rootattribute-operation-attribute-exists: The attribute with given key already exists.',{root:this.root,key:this.key})}_execute(){null===this.newValue?this.root._removeAttribute(this.key):this.root._setAttribute(this.key,this.newValue)}static get className(){return'engine.model.operation.RootAttributeOperation'}static fromJSON(e,t){if(!t.getRoot(e.root))throw new Fd('rootattribute-operation-fromjson-no-root: Cannot create RootAttributeOperation. Root with specified name does not exist.',{rootName:e});return new sf(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}const lf={};lf[Xg.className]=Xg,lf[nf.className]=nf,lf[of.className]=of,lf[Zg.className]=Zg,lf[rf.className]=rf,lf[Jg.className]=Jg,lf[ef.className]=ef,lf[tf.className]=tf,lf[af.className]=af,lf[sf.className]=sf;class df{static fromJSON(e,t){return lf[e.__className].fromJSON(e,t)}}const cf=new Map;class uf{static fromJSON(e,t){if(!cf.has(e.__className))throw new Fd('delta-fromjson-no-deserializer: This delta has no defined deserializer',{name:e.__className});const n=cf.get(e.__className),o=new n;for(const n of e.operations)o.addOperation(df.fromJSON(n,t));for(const n in e)'__className'!=n&&void 0===o[n]&&(o[n]=e[n]);return o}static register(e){cf.set(e.className,e)}}class pf{constructor(){this.batch=null,this.operations=[]}get baseVersion(){return 0new Xg(t,e.key,e.oldValue,e.newValue,e.baseVersion))},AttributeOperation(e,t,n){if(e.key===t.key){const o=e.range.getDifference(t.range).map((t)=>new Xg(t,e.key,e.oldValue,e.newValue,e.baseVersion)),i=e.range.getIntersection(t.range);return i&&(n.isStrong?o.push(new Xg(i,t.key,t.newValue,e.newValue,e.baseVersion)):0===o.length&&o.push(new rf(0))),o}return[e.clone()]},RootAttributeOperation:In,RenameOperation:In,MarkerOperation:In,MoveOperation(e,t){const n=Eg.createFromPositionAndShift(t.sourcePosition,t.howMany);let o=[];const i=Nn(e.range.getDifference(n)),r=e.range.getIntersection(n);return null!==i&&(i.start=i.start._getTransformedByDeletion(t.sourcePosition,t.howMany),i.end=i.end._getTransformedByDeletion(t.sourcePosition,t.howMany),o=i._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,!0,!1).reverse()),null!==r&&(r.start=r.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),r.end=r.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),o.push(r)),o.map((t)=>new Xg(t,e.key,e.oldValue,e.newValue,e.baseVersion))}},RootAttributeOperation:{InsertOperation:In,AttributeOperation:In,RootAttributeOperation(e,t,n){return e.root!==t.root||e.key!==t.key||(e.newValue===t.newValue||n.isStrong)&&e.newValue!==t.newValue?[e.clone()]:[new rf(e.baseVersion)]},RenameOperation:In,MarkerOperation:In,MoveOperation:In},RenameOperation:{InsertOperation(e,t){const n=e.clone();return n.position=n.position._getTransformedByInsertion(t.position,t.nodes.maxOffset,!0),[n]},AttributeOperation:In,RootAttributeOperation:In,RenameOperation(e,t,n){const o=e.clone();if(e.position.isEqual(t.position))if(n.isStrong)o.oldName=t.newName;else return[new rf(e.baseVersion)];return[o]},MarkerOperation:In,MoveOperation(e,t){const n=e.clone(),o=n.position.isEqual(t.sourcePosition);return n.position=n.position._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,!0,o),[n]}},MarkerOperation:{InsertOperation(e,t){const n=e.clone();return n.oldRange&&(n.oldRange=n.oldRange._getTransformedByInsertion(t.position,t.nodes.maxOffset,!1,!1)[0]),n.newRange&&(n.newRange=n.newRange._getTransformedByInsertion(t.position,t.nodes.maxOffset,!1,!1)[0]),[n]},AttributeOperation:In,RootAttributeOperation:In,RenameOperation:In,MarkerOperation(e,t,n){const o=e.clone();if(e.name==t.name)if(n.isStrong)o.oldRange=t.newRange;else return[new rf(e.baseVersion)];return[o]},MoveOperation(e,t){const n=e.clone();if(n.oldRange){const e=n.oldRange._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);n.oldRange=Eg.createFromRanges(e)}if(n.newRange){const e=n.newRange._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);n.newRange=Eg.createFromRanges(e)}return[n]}},MoveOperation:{InsertOperation(e,t,n){let o=Eg.createFromPositionAndShift(e.sourcePosition,e.howMany);const i=e.isSticky&&!n.forceNotSticky;o=o._getTransformedByInsertion(t.position,t.nodes.maxOffset,!1,i)[0];const r=void 0===n.insertBefore?!n.isStrong:n.insertBefore,a=new e.constructor(o.start,o.end.offset-o.start.offset,e.targetPosition._getTransformedByInsertion(t.position,t.nodes.maxOffset,r),e.baseVersion);return a.isSticky=e.isSticky,[a]},AttributeOperation:In,RootAttributeOperation:In,RenameOperation:In,MarkerOperation:In,MoveOperation(e,t,n){const o=Eg.createFromPositionAndShift(e.sourcePosition,e.howMany),i=Eg.createFromPositionAndShift(t.sourcePosition,t.howMany);let r=n.isStrong;const a=e.isSticky&&!n.forceNotSticky,s=void 0===n.insertBefore?!r:n.insertBefore,l=e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,s,t.isSticky&&!n.forceNotSticky);if(Fn(e,t)&&Fn(t,e))return[t.getReversed()];const d=o.containsPosition(t.targetPosition)||o.start.isEqual(t.targetPosition)&&a||o.end.isEqual(t.targetPosition)&&a;if(d&&o.containsRange(i,!0))return o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,!a),o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,a),Dn([o],l,e);const c=i.containsPosition(e.targetPosition)||i.start.isEqual(e.targetPosition)&&t.isSticky&&!n.forceNotSticky||i.end.isEqual(e.targetPosition)&&t.isSticky&&!n.forceNotSticky;if(c&&i.containsRange(o,!0))return o.start=o.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),o.end=o.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),Dn([o],l,e);const u=T(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if('prefix'==u||'extension'==u)return o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,!a),o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,a),Dn([o],l,e);n.forceWeakRemove||(e instanceof tf&&!(t instanceof tf)?r=!0:!(e instanceof tf)&&t instanceof tf&&(r=!1));const p=[],m=o.getDifference(i);for(const o of m){o.start=o.start._getTransformedByDeletion(t.sourcePosition,t.howMany),o.end=o.end._getTransformedByDeletion(t.sourcePosition,t.howMany);const e='same'==T(o.start.getParentPath(),t.getMovedRangeStart().getParentPath()),n=o._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,e,a);p.push(...n)}const g=o.getIntersection(i);return null!==g&&r&&!d&&(g.start=g.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),g.end=g.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),0===p.length?p.push(g):1==p.length?i.start.isBefore(o.start)||i.start.isEqual(o.start)?p.unshift(g):p.push(g):p.splice(1,0,g)),0===p.length?[new rf(e.baseVersion)]:Dn(p,l,e)}}};var ot=function(e,t,n){var o=-1,i=e.length;0>t&&(t=-t>i?0:i+t),n=n>i?i:n,0>n&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var r=Array(i);++o=200&&(r=Ff,a=!1,t=new Dm(t));outer:for(;++it?0:t,o)):[]},bh=function(e,t,n){var o=e?e.length:0;return o?(t=n||void 0===t?1:Op(t),t=o-t,ot(e,0,0>t?0:t)):[]},kh=function(e,t,n,o){for(var i=e.length,r=o?i:-1;(o?r--:++r=t?e:t)),e},wh=function(e){return e?_h(Op(e),0,4294967295):0},vh=function(e,t,n,o){var i=e.length;for(n=Op(n),0>n&&(n=-n>i?0:i+n),o=void 0===o||o>i?i:Op(o),0>o&&(o+=i),o=n>o?0:wh(o);nt?n:0,Qc(t,n)?e[t]:void 0},Ih=function(e,t,n,o){for(var i=n-1,r=e.length;++it||r&&a&&l&&!s&&!d||o&&a&&l||!n&&l||!i)return 1;if(!o&&!r&&!d&&e>>1){for(;o>>1,a=e[r];null!==a&&!wp(a)&&(n?a<=t:a=200){var d=t?null:Qh(e);if(d)return Hu(d);a=!1,i=Ff,l=new Dm}else l=t?[]:s;outer:for(;++ot)return[];for(var i=0,r=0,a=Array(Af(o/t));in&&(n=_d(o+n,0)),Sf(e,t,n)):-1},initial:function(e){return bh(e,1)},intersection:Th,intersectionBy:Ph,intersectionWith:Eh,join:function(e,t){return e?Oh.call(e,t):''},last:Tg,lastIndexOf:function(e,t,n){var o=e?e.length:0;if(!o)return-1;var i=o;if(void 0!==n&&(i=Op(n),i=(0>i?_d(o+i,0):wd(i,o-1))+1),t!==t)return Ef(e,i,!0);for(;i--;)if(e[i]===t)return i;return-1},nth:function(e,t){return e&&e.length?Rh(e,Op(t)):void 0},pull:Bh,pullAll:Dh,pullAllBy:function(e,t,n){return e&&e.length&&t&&t.length?Nh(e,t,mh(n)):e},pullAllWith:function(e,t,n){return e&&e.length&&t&&t.length?Nh(e,t,void 0,n):e},pullAt:Hh,remove:function(e,t){var n=[];if(!(e&&e.length))return n;var o=-1,i=[],r=e.length;for(t=mh(t,3);++ot?0:t)):[]},takeRight:function(e,t,n){var o=e?e.length:0;return o?(t=n||void 0===t?1:Op(t),t=o-t,ot(e,0>t?0:t,o)):[]},takeRightWhile:function(e,t){return e&&e.length?kh(e,mh(t,3),!1,!0):[]},takeWhile:function(e,t){return e&&e.length?kh(e,mh(t,3)):[]},union:Xh,unionBy:Zh,unionWith:eb,uniq:function(e){return e&&e.length?Yh(e):[]},uniqBy:function(e,t){return e&&e.length?Yh(e,mh(t)):[]},uniqWith:function(e,t){return e&&e.length?Yh(e,void 0,t):[]},unzip:nb,unzipWith:ob,without:ib,xor:ab,xorBy:sb,xorWith:lb,zip:db,zipObject:function(e,t){return cb(e||[],t||[],Ac)},zipObjectDeep:function(e,t){return cb(e||[],t||[],ub)},zipWith:pb};const gb=new Map,fb={transform(e,t,n){const o=fb.getTransformationCase(e,t)||fb.defaultTransform,i=o(e,t,Object.assign({},n)),r=mb.last(t.operations).baseVersion;return Wn(r,i)},defaultTransform(e,t,n){const o=[];let i=t.operations,r=[];for(const a of e.operations){const e=[a];for(const t of i)for(let o=0;o{const o=_b(e,t,n);return e.range.containsPosition(t.position)&&o.push(to(t,e)),o}),kb(mf,gf,(e,t,n)=>{if(!t.position)return _b(e,t,n);const o=n.undoMode,i=new Pg(t.position.root,t.position.path.slice(0,-1)),r=_b(e,t,n);if(o||!(t._cloneOperation instanceof nf))return r;for(const o of e.operations)if(o.range.containsPosition(i)||o.range.start.isEqual(i)){const e=new mf,n=i.getShiftedBy(1),a=Pg.createFromPosition(n);a.path.push(0);const s=t._cloneOperation.nodes.getNode(0).getAttribute(o.key);e.addOperation(new Xg(new Eg(n,a),o.key,s===void 0?null:s,o.newValue,0)),r.push(e);break}return r}),kb(vf,ff,(e,t,n)=>{if(!t.position)return _b(e,t,n);const o=n.undoMode;return!o&&e.position.isEqual(t.position)?[t.getReversed(),e.clone()]:_b(e,t,n)}),kb(bb,gf,eo),kb(bb,ff,eo),kb(bb,_f,eo),kb(bb,wf,eo),kb(bb,hf,eo),kb(bb,kf,eo),kb(hf,ff,(e,t,n)=>{const o=n.undoMode;if(o||!t.position)return _b(e,t,n);const i=e.sourcePosition.root==t.position.root&&'same'===T(e.sourcePosition.getParentPath(),t.position.getParentPath()),r=e.sourcePosition.offset<=t.position.offset&&e.sourcePosition.offset+e.howMany>t.position.offset;return i&&r?[t.getReversed(),e.clone()]:_b(e,t,n)}),kb(ff,vf,(e,t,n)=>{if(!e.position)return _b(e,t,n);const o=n.undoMode;return!o&&e.position.isEqual(t.position)?[no()]:_b(e,t,n)}),kb(ff,hf,(e,t,n)=>{const o=n.undoMode;if(o||!e.position)return _b(e,t,n);const i=e.position.root==t.sourcePosition.root&&'same'===T(e.position.getParentPath(),t.sourcePosition.getParentPath()),r=t.sourcePosition.offset<=e.position.offset&&t.sourcePosition.offset+t.howMany>e.position.offset;return i&&r?[no()]:_b(e,t,n)}),kb(gf,gf,(e,t,n)=>{const o=n.undoMode;if(o)return _b(e,t,n);if(!e.position||!t.position)return _b(e,t,n);const i=e.position.getParentPath(),r=t.position.getParentPath();if(e.position.root==t.position.root&&'same'==T(i,r))if(e=e.clone(),e.position.offsett._cloneOperation.sourcePosition.offset&&e._cloneOperation.sourcePosition.offset--;const n=Eg.createFromPositionAndShift(e.position,e._moveOperation.howMany),o=Eg.createFromPositionAndShift(t.position,t._moveOperation.howMany),i=n.getDifference(o);let r=0;for(const e of i)r+=e.end.offset-e.start.offset;return 0==r?(e.operations.pop(),e.addOperation(new rf(e.operations[0].baseVersion+1))):e.operations[1].howMany=r,[e]}else{const o=Object.assign({},n);return o.isStrong=!0,o.insertBefore=!0,_b(e,t,o)}return _b(e,t,n)}),kb(gf,wf,(e,t,n)=>e.position?e.position.root==t.position.root&&'same'===T(t.position.path,e.position.getParentPath())?[no()]:_b(e,t,n):_b(e,t,n)),kb(gf,_f,(e,t,n)=>{if(!e.position)return _b(e,t,n);const o=e.position.root==t.range.start.root,i=o&&'same'===T(e.position.getParentPath(),t.range.start.getParentPath()),r=t.range.start.offset=e.position.offset;if(i&&r)return[no()];if(o&&'same'===T(e.position.getParentPath(),t.range.end.getShiftedBy(-1).path)){const n=e.clone(),o=Pg.createFromPosition(t.range.start);o.path.push(t.howMany-1);const i=o.getShiftedBy(1);n._cloneOperation.position=i;const r=Pg.createFromPosition(o);r.path.push(e.position.offset),n._moveOperation.sourcePosition=r;const a=Pg.createFromPosition(i);return a.path.push(0),n._moveOperation.targetPosition=a,[n]}return _b(e,t,n)}),kb(gf,mf,(e,t,n)=>{if(!e.position)return _b(e,t,n);e=e.clone();const o=n.undoMode,i=new Pg(e.position.root,e.position.path.slice(0,-1));if(o||!(e._cloneOperation instanceof nf))return[e];for(const o of t.operations)if(o.range.containsPosition(i)||o.range.start.isEqual(i)){null===o.newValue?e._cloneOperation.nodes.getNode(0)._removeAttribute(o.key):e._cloneOperation.nodes.getNode(0)._setAttribute(o.key,o.newValue);break}return[e]}),kb(wf,gf,(e,t,n)=>t.position?e.position.root==t.position.root&&'same'===T(e.position.path,t.position.getParentPath())?[t.getReversed(),e.clone()]:_b(e,t,n):_b(e,t,n)),kb(yf,mf,(e,t)=>{const n=[e.clone()];return t.range.containsPosition(e.position)&&n.push(to(e,t)),n}),kb(_f,gf,(e,t,n)=>{if(!t.position)return _b(e,t,n);const o=e.range.start.root==t.position.root,i=o&&'same'===T(e.range.start.getParentPath(),t.position.getParentPath()),r=e.range.start.offset=t.position.offset;if(i&&r)return[t.getReversed(),e.clone()];if(o&&'same'===T(t.position.getParentPath(),e.range.end.getShiftedBy(-1).path)){const t=e.clone();return t._insertOperation.position.offset++,t._moveOperation.howMany++,t._moveOperation.targetPosition.path[t._moveOperation.targetPosition.path.length-2]++,[t]}return _b(e,t,n)}),kb(kf,gf,(e,t,n)=>{const o=n.undoMode,i=_b(e,t,n);if(o||!(t._cloneOperation instanceof nf))return i;const r=t._cloneOperation.position.getShiftedBy(-1);if(r&&e.operations[0].position.isEqual(r)){const t=e.clone();t.operations[0].position=r.getShiftedBy(1),i.push(t)}return i}),kb(gf,kf,(e,t,n)=>{e=e.clone();const o=n.undoMode;if(o||!(e._cloneOperation instanceof nf))return[e];const i=e._cloneOperation.position.getShiftedBy(-1);if(i&&!o&&t.operations[0].position.isEqual(i)){const n=t.clone();return n.operations[0].position=i.getShiftedBy(1),n.operations[0].oldName=e._cloneOperation.nodes.getNode(0).name,[e,n]}return[e]}),kb(bf,gf,(e,t,n)=>{const o=_b(e,t,n),i=t._cloneOperation.position||t._cloneOperation.targetPosition;if(!i)return _b(e,t,n);const r=n.undoMode;if(r)return o;for(const r of o)if(r instanceof bf){const e=r._moveOperation,t=e.sourcePosition.getShiftedBy(e.howMany);t.isEqual(i)&&(e.howMany+=1)}return o}),kb(gf,bf,(e,t,n)=>{const o=n.undoMode;if(o)return _b(e,t,n);const i=e._cloneOperation.position||e._cloneOperation.targetPosition;if(!i)return _b(e,t,n);t=t.clone();const r=t._moveOperation,a=r.sourcePosition.getShiftedBy(r.howMany);return a.isEqual(i)&&(r.howMany+=1),_b(e,t,n)});class wb{constructor(e='default'){this.deltas=[],this.type=e}get baseVersion(){for(const e of this.deltas)if(null!==e.baseVersion)return e.baseVersion;return null}addDelta(e){return e.batch=this,this.deltas.push(e),e}*getOperations(){for(const e of this.deltas)yield*e.operations}}class vb extends pf{static get className(){return'engine.model.delta.RootAttributeDelta'}}uf.register(vb);class yb extends Jg{constructor(e,t){super(null),this.sourcePosition=Pg.createFromPosition(e),this.howMany=t}get type(){return'detach'}_validate(){if(this.sourcePosition.root.document)throw new Fd('detach-operation-on-document-node: Cannot detach document node.')}_execute(){An(Eg.createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return'engine.model.operation.DetachOperation'}}class xb extends Cg{constructor(e,t,n='main'){super(t),this._doc=e,this.rootName=n}get document(){return this._doc}is(e,t){return t?'rootElement'==e&&t==this.name||super.is(e,t):'rootElement'==e||super.is(e)}toJSON(){return this.rootName}}class Cb{constructor(e,t){this.model=e,this.batch=t}createText(e,t){return new vg(e,t)}createElement(e,t){return new Cg(e,t)}createDocumentFragment(){return new Qg}insert(e,t,n){this._assertWriterUsedCorrectly();const o=Pg.createAt(t,n),i=e instanceof vg&&!e.parent?new yf:new vf;if(e.parent){if(so(e.root,o.root))return void this.move(Eg.createOn(e),o);if(e.root.document)throw new Error('model-writer-insert-forbidden-move: Cannot move a node from a document to a different tree.');else this.remove(e)}const r=o.root.document?o.root.document.version:null,a=new nf(o,e,r);if(this.batch.addDelta(i),i.addOperation(a),this.model.applyOperation(a),e instanceof Qg)for(const[t,n]of e.markers){const e=Pg.createAt(n.root),i=new Eg(n.start._getCombined(e,o),n.end._getCombined(e,o));this.addMarker(t,{range:i,usingOperation:!0})}}insertText(e,t,n,o){t instanceof Qg||t instanceof Cg||t instanceof Pg?this.insert(this.createText(e),t,n):this.insert(this.createText(e,t),n,o)}insertElement(e,t,n,o){t instanceof Qg||t instanceof Cg||t instanceof Pg?this.insert(this.createElement(e),t,n):this.insert(this.createElement(e,t),n,o)}append(e,t){this.insert(e,t,'end')}appendText(e,t,n){t instanceof Qg||t instanceof Cg?this.insert(this.createText(e),t,'end'):this.insert(this.createText(e,t),n,'end')}appendElement(e,t,n){t instanceof Qg||t instanceof Cg?this.insert(this.createElement(e),t,'end'):this.insert(this.createElement(e,t),n,'end')}setAttribute(e,t,n){this._assertWriterUsedCorrectly(),n instanceof Eg?oo(this,e,t,n):io(this,e,t,n)}setAttributes(e,t){for(const[n,o]of mt(e))this.setAttribute(n,o,t)}removeAttribute(e,t){this._assertWriterUsedCorrectly(),t instanceof Eg?oo(this,e,null,t):io(this,e,null,t)}clearAttributes(e){this._assertWriterUsedCorrectly();const t=(e)=>{for(const t of e.getAttributeKeys())this.removeAttribute(t,e)};if(!(e instanceof Eg))t(e);else for(const n of e.getItems())t(n)}move(e,t,n){if(this._assertWriterUsedCorrectly(),!(e instanceof Eg))throw new Fd('writer-move-invalid-range: Invalid range to move.');if(!e.isFlat)throw new Fd('writer-move-range-not-flat: Range to move is not flat.');const o=Pg.createAt(t,n);if(!so(e.root,o.root))throw new Fd('writer-move-different-document: Range is going to be moved between different documents.');const i=new hf;this.batch.addDelta(i);const r=e.root.document?e.root.document.version:null,a=new Zg(e.start,e.end.offset-e.start.offset,o,r);i.addOperation(a),this.model.applyOperation(a)}remove(e){this._assertWriterUsedCorrectly();const t=(e,t)=>{const n=new bf;this.batch.addDelta(n),ao(e,t,n,this.model)};if(e instanceof Eg){const n=e.getMinimalFlatRanges().reverse();for(const e of n)t(e.start,e.end.offset-e.start.offset)}else{const n=e.is('text')?e.offsetSize:1;t(Pg.createBefore(e),n)}}merge(e){this._assertWriterUsedCorrectly();const t=new ff;this.batch.addDelta(t);const n=e.nodeBefore,o=e.nodeAfter;if(!(n instanceof Cg))throw new Fd('writer-merge-no-element-before: Node before merge position must be an element.');if(!(o instanceof Cg))throw new Fd('writer-merge-no-element-after: Node after merge position must be an element.');const i=Pg.createFromParentAndOffset(o,0),r=Pg.createFromParentAndOffset(n,n.maxOffset),a=e.root.document?e.root.document.version:null,s=new Zg(i,o.maxOffset,r,a);s.isSticky=!0,t.addOperation(s),this.model.applyOperation(s),ao(e,1,t,this.model)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof Cg))throw new Fd('writer-rename-not-element-instance: Trying to rename an object which is not an instance of Element.');const n=new kf;this.batch.addDelta(n);const o=e.root.document?e.root.document.version:null,i=new af(Pg.createBefore(e),e.name,t,o);n.addOperation(i),this.model.applyOperation(i)}split(e,t){this._assertWriterUsedCorrectly();let n=e.parent;if(!n.parent)throw new Fd('writer-split-element-no-parent: Element with no parent can not be split.');if(t||(t=n.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new Fd('writer-split-invalid-limit-element: Limit element is not a position ancestor.');let o,i;do{const t=new gf;this.batch.addDelta(t);const r=new Cg(n.name,n.getAttributes()),a=n.root.document?n.root.document.version:null,s=new nf(Pg.createAfter(n),r,a);t.addOperation(s),this.model.applyOperation(s);const l=null===a?null:a+1,d=new Zg(e,n.maxOffset-e.offset,Pg.createFromParentAndOffset(r,0),l);d.isSticky=!0,t.addOperation(d),this.model.applyOperation(d),o||i||(o=n,i=r),e=Pg.createBefore(r),n=e.parent}while(n!==t);return{position:e,range:new Eg(Pg.createAt(o,'end'),Pg.createAt(i))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new Fd('writer-wrap-range-not-flat: Range to wrap is not flat.');const n=t instanceof Cg?t:new Cg(t);if(0e.offset===t.offset?e.type==t.type?0:'remove'==e.type?-1:1:e.offsete.position.root==t.position.root?e.position.isEqual(t.position)?e.changeCountn[o].howMany&&(n.splice(o,1),o--)}_getChangesForElement(e){let t;return this._changesInElement.has(e)?t=this._changesInElement.get(e):(t=[],this._changesInElement.set(e,t)),t}_makeSnapshot(e){this._elementSnapshots.has(e)||this._elementSnapshots.set(e,lo(e.getChildren()))}_handleChange(e,t){e.nodesToHandle=e.howMany;for(const n of t){const o=e.offset+e.howMany,i=n.offset+n.howMany;if('insert'==e.type&&('insert'==n.type&&(e.offset<=n.offset?n.offset+=e.howMany:e.offsetn.offset){if(o>i){const e={type:'attribute',offset:i,howMany:o-i,count:this._changeCount++};this._handleChange(e,t),t.push(e)}e.nodesToHandle=n.offset-e.offset,e.howMany=e.nodesToHandle}else e.offset>=n.offset&&e.offseti?(e.nodesToHandle=o-i,e.offset=i):e.nodesToHandle=0);'attribute'==n.type&&(e.offset>=n.offset&&o<=i?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=n.offset&&o>=i&&(n.howMany=0))}}e.howMany=e.nodesToHandle,delete e.nodesToHandle}_getInsertDiff(e,t,n){return{type:'insert',position:Pg.createFromParentAndOffset(e,t),name:n,length:1,changeCount:this._changeCount++}}_getRemoveDiff(e,t,n){return{type:'remove',position:Pg.createFromParentAndOffset(e,t),name:n,length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,n){const o=[];n=new Map(n);for(const[i,r]of t){const t=n.has(i)?n.get(i):null;t!==r&&o.push({type:'attribute',position:e.start,range:Eg.createFromRange(e),length:1,attributeKey:i,attributeOldValue:r,attributeNewValue:t,changeCount:this._changeCount++}),n.delete(i)}for(const[i,r]of n)o.push({type:'attribute',position:e.start,range:Eg.createFromRange(e),length:1,attributeKey:i,attributeOldValue:null,attributeNewValue:r,changeCount:this._changeCount++});return o}_isInInsertedElement(e){const t=e.parent;if(!t)return!1;const n=this._changesInElement.get(t),o=e.startOffset;if(n)for(const e of n)if('insert'==e.type&&o>=e.offset&&o=t)break;yield e}}}getDelta(e){const t=this._historyPoints.get(e);return t===void 0?null:this._deltas[t]}setDeltaAsUndone(e,t){this._undoPairs.set(t,e),this._undoneDeltas.add(e)}isUndoingDelta(e){return this._undoPairs.has(e)}isUndoneDelta(e){return this._undoneDeltas.has(e)}getUndoneDelta(e){return this._undoPairs.get(e)}_getIndex(e){const t=this._historyPoints.get(e);if(t===void 0){const t=this._deltas[this._deltas.length-1],n=t.baseVersion+t.operations.length;if(0>e||e>=n)return-1;throw new Fd('model-history-wrong-version: Given base version points to the middle of a delta.')}return t}}const Pb='$graveyard';class Eb{constructor(e){this.model=e,this.version=0,this.history=new Tb(this),this.selection=new Ng(this),this.roots=new lm({idProperty:'rootName'}),this.differ=new Ab(e.markers),this._postFixers=new Set,this.createRoot('$root',Pb),this.listenTo(e,'applyOperation',(e,t)=>{const n=t[0];if(n.isDocumentOperation&&n.baseVersion!==this.version)throw new Fd('model-document-applyOperation-wrong-version: Only operations with matching versions can be applied.',{operation:n})},{priority:'highest'}),this.listenTo(e,'applyOperation',(e,t)=>{const n=t[0];n.isDocumentOperation&&this.differ.bufferOperation(n)},{priority:'high'}),this.listenTo(e,'applyOperation',(e,t)=>{const n=t[0];n.isDocumentOperation&&(this.version++,this.history.addDelta(n.delta))},{priority:'low'});let t=!1;this.listenTo(this.selection,'change',()=>{t=!0}),this.listenTo(e,'_change',(e,n)=>{(!this.differ.isEmpty||t)&&(this._callPostFixers(n),this.differ.hasDataChanges()?this.fire('change:data',n.batch):this.fire('change',n.batch),this.differ.reset(),t=!1)}),this.listenTo(e.markers,'update',(e,t,n,o)=>{this.differ.bufferMarkerChange(t.name,n,o,t.affectsData),null===n&&t.on('change',(e,n)=>{this.differ.bufferMarkerChange(t.name,n,t.getRange(),t.affectsData)})})}get graveyard(){return this.getRoot(Pb)}createRoot(e='$root',t='main'){if(this.roots.get(t))throw new Fd('model-document-createRoot-name-exists: Root with specified name already exists.',{name:t});const n=new xb(this,e,t);return this.roots.add(n),n}destroy(){this.selection.destroy(),this.stopListening()}getRoot(e='main'){return this.roots.get(e)}getRootNames(){return Array.from(this.roots,(e)=>e.rootName).filter((e)=>e!=Pb)}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=dp(this);return e.selection='[engine.model.DocumentSelection]',e.model='[engine.model.Model]',e}_getDefaultRoot(){for(const e of this.roots)if(e!==this.graveyard)return e;return this.graveyard}_getDefaultRange(){const e=this._getDefaultRoot(),t=this.model.schema,n=new Pg(e,[0]),o=t.getNearestSelectionRange(n);return o||new Eg(n)}_validateSelectionRange(e){return bo(e.start)&&bo(e.end)}_callPostFixers(e){let t=!1;do for(const n of this._postFixers)if(t=n(e),t)break;while(t)}}h(Eb,qd);class Sb{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(e){return this._markers.has(e)}get(e){return this._markers.get(e)||null}_set(e,t,n=!1,o=!1){const i=e instanceof Ob?e.name:e,r=this._markers.get(i);if(r){const e=r.getRange();let a=!1;return e.isEqual(t)||(r._attachLiveRange(Vg.createFromRange(t)),a=!0),n!=r.managedUsingOperations&&(r._managedUsingOperations=n,a=!0),'boolean'==typeof o&&o!=r.affectsData&&(r._affectsData=o,a=!0),a&&this.fire('update:'+i,r,e,t),r}const a=Vg.createFromRange(t),s=new Ob(i,a,n,o);return this._markers.set(i,s),this.fire('update:'+i,s,null,t),s}_remove(e){const t=e instanceof Ob?e.name:e,n=this._markers.get(t);return!!n&&(this._markers.delete(t),this.fire('update:'+t,n,n.getRange(),null),this._destroyMarker(n),!0)}*getMarkersAtPosition(e){for(const t of this)t.getRange().containsPosition(e)&&(yield t)}*getMarkersIntersectingRange(e){for(const t of this)null!==t.getRange().getIntersection(e)&&(yield t)}destroy(){for(const e of this._markers.values())this._destroyMarker(e);this._markers=null,this.stopListening()}*getMarkersGroup(e){for(const t of this._markers.values())t.name.startsWith(e+':')&&(yield t)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}}h(Sb,qd);class Ob{constructor(e,t,n,o){this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=n,this._affectsData=o}get managedUsingOperations(){if(!this._liveRange)throw new Fd('marker-destroyed: Cannot use a destroyed marker instance.');return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new Fd('marker-destroyed: Cannot use a destroyed marker instance.');return this._affectsData}getStart(){if(!this._liveRange)throw new Fd('marker-destroyed: Cannot use a destroyed marker instance.');return Pg.createFromPosition(this._liveRange.start)}getEnd(){if(!this._liveRange)throw new Fd('marker-destroyed: Cannot use a destroyed marker instance.');return Pg.createFromPosition(this._liveRange.end)}getRange(){if(!this._liveRange)throw new Fd('marker-destroyed: Cannot use a destroyed marker instance.');return Eg.createFromRange(this._liveRange)}_attachLiveRange(e){return this._liveRange&&this._detachLiveRange(),e.delegate('change:range').to(this),e.delegate('change:content').to(this),this._liveRange=e,e}_detachLiveRange(){this._liveRange.stopDelegating('change:range',this),this._liveRange.stopDelegating('change:content',this),this._liveRange.detach(),this._liveRange=null}}h(Ob,qd);class Rb extends Pg{constructor(e,t,n){if(super(e,t),!this.root.is('rootElement'))throw new Fd('model-liveposition-root-not-rootelement: LivePosition\'s root has to be an instance of RootElement.');this.stickiness=n||'sticksToNext',ko.call(this)}detach(){this.stopListening()}}h(Rb,qd);class Ib{constructor(e,t,n){this.model=e,this.writer=t,this.position=n,this.canMergeWith=new Set([this.position.parent]),this.schema=e.schema,this._filterAttributesOf=[]}handleNodes(e,t){e=Array.from(e);for(let n=0;nthis.decorate(e)),this.on('applyOperation',(e,t)=>{const n=t[0];n._validate()},{priority:'highest'}),this.schema.register('$root',{isLimit:!0}),this.schema.register('$block',{allowIn:'$root',isBlock:!0}),this.schema.register('$text',{allowIn:'$block'}),this.schema.register('$clipboardHolder',{allowContentOf:'$root',isLimit:!0}),this.schema.extend('$text',{allowIn:'$clipboardHolder'}),this.schema.register('$marker',{allowIn:['$root','$block']}),Bo(this)}change(e){return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new wb,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}enqueueChange(e,t){'string'==typeof e?e=new wb(e):'function'==typeof e&&(t=e,e=new wb),this._pendingChanges.push({batch:e,callback:t}),1==this._pendingChanges.length&&this._runPendingChanges()}applyOperation(e){e._execute()}transformDeltas(e,t,n=!1){return hb.transformDeltaSets(e,t,n?this.document:null)}insertContent(e,t){wo(this,e,t)}deleteContent(e,t){vo(this,e,t)}modifySelection(e,t){Eo(this,e,t)}getSelectedContent(e){return No(this,e)}hasContent(e){if(e instanceof Cg&&(e=Eg.createIn(e)),e.isCollapsed)return!1;for(const t of e.getItems())if(t.is('textProxy')||this.schema.isObject(t))return!0;return!1}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const e=[];for(;this._pendingChanges.length;){const t=this._pendingChanges[0].batch;this._currentWriter=new Cb(this,t);const n=this._pendingChanges[0].callback(this._currentWriter);e.push(n),this.fire('_change',this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return e}}h(Fb,Xp);class Nb{constructor(){this._listener=Object.create(Vm)}listenTo(e){this._listener.listenTo(e,'keydown',(e,t)=>{this._listener.fire('_keydown:'+ne(t),t)})}set(e,t,n={}){const o=oe(e),i=n.priority;this._listener.listenTo(this._listener,'_keydown:'+o,(e,n)=>{t(n,()=>{n.preventDefault(),n.stopPropagation(),e.stop()}),e.return=!0},{priority:i})}press(e){return!!this._listener.fire('_keydown:'+ne(e),e)}destroy(){this._listener.stopListening()}}class Db extends Nb{constructor(e){super(),this.editor=e}set(e,t,n={}){if('string'==typeof t){const e=t;t=(t,n)=>{this.editor.execute(e),n()}}super.set(e,t,n)}}class Bb{constructor(e){const t=this.constructor.build&&this.constructor.build.plugins;this.config=new Id(e,this.constructor.build&&this.constructor.build.config),this.config.define('plugins',t),this.plugins=new Lg(this,t),this.commands=new zg,this.locale=new jg(this.config.get('language')),this.t=this.locale.t,this.set('isReadOnly',!1),this.model=new Fb,this.data=new Kg(this.model),this.editing=new Mg(this.model),this.editing.view.document.bind('isReadOnly').to(this),this.conversion=new Gg,this.conversion.register('downcast',[this.editing.downcastDispatcher,this.data.downcastDispatcher]),this.conversion.register('editingDowncast',[this.editing.downcastDispatcher]),this.conversion.register('dataDowncast',[this.data.downcastDispatcher]),this.conversion.register('upcast',[this.data.upcastDispatcher]),this.keystrokes=new Db(this),this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){function e(e,t){return e.reduce((e,n)=>n[t]?e.then(n[t].bind(n)):e,Promise.resolve())}const t=this,n=this.config;return function(){const e=n.get('plugins')||[],o=n.get('removePlugins')||[];return t.plugins.load(e,o)}().then((t)=>e(t,'init').then(()=>e(t,'afterInit'))).then(()=>this.fire('pluginsReady'))}destroy(){return this.fire('destroy'),this.stopListening(),this.commands.destroy(),this.plugins.destroy().then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()})}execute(...e){this.commands.execute(...e)}static create(e){return new Promise((t)=>{const n=new this(e);t(n.initPlugins().then(()=>{n.fire('dataReady'),n.fire('ready')}).then(()=>n))})}}h(Bb,Xp);class Mb{getHtml(e){const t=document.implementation.createHTMLDocument(''),n=t.createElement('div');return n.appendChild(e),n.innerHTML}}class Lb{constructor(){this._domParser=new DOMParser,this._domConverter=new Rm({blockFiller:Cm}),this._htmlWriter=new Mb}toData(e){const t=this._domConverter.viewToDom(e,document);return this._htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this._domConverter.domToView(t)}_toDom(e){const t=this._domParser.parseFromString(e,'text/html'),n=t.createDocumentFragment(),o=t.body.childNodes;for(;0{t.isRendered||t.render(),t.element&&this._parentElement&&this._parentElement.insertBefore(t.element,this._parentElement.children[n])}),this.on('remove',(e,t)=>{t.element&&this._parentElement&&t.element.remove()}),this.locale=e,this._parentElement=null}destroy(){this.map((e)=>e.destroy())}setParent(e){this._parentElement=e}delegate(...e){if(!e.length||!Ho(e))throw new Fd('ui-viewcollection-delegate-wrong-events: All event names must be strings.');return{to:(t)=>{for(const n of this)for(const o of e)n.delegate(o).to(t);this.on('add',(n,o)=>{for(const i of e)o.delegate(i).to(t)}),this.on('remove',(n,o)=>{for(const i of e)o.stopDelegating(i,t)})}}}}h(lm,Xp);var qb=function(e,t){return lp(e,!0,!0,t)};class Wb{constructor(e){Object.assign(this,Xo(Yo(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData=ui(),this._renderNode({node:e,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new Fd('ui-template-revert-not-applied: Attempting to revert a template which has not been applied yet.');this._revertTemplateFromNode(e,this._revertData)}*getViews(){function*e(t){if(t.children)for(const n of t.children)li(n)?yield n:di(n)&&(yield*e(n))}yield*e(this)}static bind(e,t){return{to(n,o){return new Ub({eventNameOrFunction:n,attribute:n,observable:e,emitter:t,callback:o})},if(n,o,i){return new $b({observable:e,emitter:t,attribute:n,valueIfTrue:o,callback:i})}}}static extend(e,t){e._isRendered&&mg.warn('template-extend-render: Attempting to extend a template which has already been rendered.'),ai(e,Xo(Yo(t)))}_renderNode(e){let t;if(t=e.node?this.tag&&this.text:this.tag?this.text:!this.text,t)throw new Fd('ui-template-wrong-syntax: Node definition must have either "tag" or "text" when rendering a new Node.');return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||'http://www.w3.org/1999/xhtml',this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(''),Uo(this.text)?this._bindToObservable({schema:this.text,updater:Go(t),data:e}):t.textContent=this.text.join(''),t}_renderAttributes(e){let t,n,o,i;if(this.attributes){const r=e.node,a=e.revertData;for(t in this.attributes)if(o=r.getAttribute(t),n=this.attributes[t],a&&(a.attributes[t]=o),i=Gd(n[0])&&n[0].ns?n[0].ns:null,Uo(n)){const s=i?n[0].value:n;a&&pi(t)&&s.unshift(o),this._bindToObservable({schema:s,updater:Jo(r,t,i),data:e})}else'style'==t&&'string'!=typeof n[0]?this._renderStyleAttribute(n[0],e):(a&&o&&pi(t)&&n.unshift(o),n=n.map((e)=>e?e.value||e:e).reduce((e,t)=>e.concat(t),[]).reduce(ii,''),si(n)||r.setAttributeNS(i,t,n))}}_renderStyleAttribute(e,t){const n=t.node;for(const o in e){const i=e[o];Uo(i)?this._bindToObservable({schema:[i],updater:Qo(n,o),data:t}):n.style[o]=i}}_renderElementChildren(e){const t=e.node,n=e.intoFragment?document.createDocumentFragment():t,o=e.isApplying;let i=0;for(const r of this.children)if(ci(r)){if(!o){r.setParent(t);for(const e of r)n.appendChild(e.element)}}else if(li(r))o||(!r.isRendered&&r.render(),n.appendChild(r.element));else if(Re(r))n.appendChild(r);else if(o){const t=e.revertData,o=ui();t.children.push(o),r._renderNode({node:n.childNodes[i++],isApplying:!0,revertData:o})}else n.appendChild(r.render());e.intoFragment&&t.appendChild(n)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const n=this.eventListeners[t].map((n)=>{const[o,i]=t.split('@');return n.activateDomEventListener(o,i,e)});e.revertData&&e.revertData.bindings.push(n)}}_bindToObservable({schema:e,updater:t,data:n}){const o=n.revertData;Ko(e,t,n);const i=e.filter((e)=>!si(e)).filter((e)=>e.observable).map((o)=>o.activateAttributeListener(e,t,n));o&&o.bindings.push(i)}_revertTemplateFromNode(e,t){for(const n of t.bindings)for(const e of n)e();if(t.text)return void(e.textContent=t.text);for(const n in t.attributes){const o=t.attributes[n];null===o?e.removeAttribute(n):e.setAttribute(n,o)}for(let n=0;nKo(e,t,n);return this.emitter.listenTo(this.observable,'change:'+this.attribute,o),()=>{this.emitter.stopListening(this.observable,'change:'+this.attribute,o)}}}class Ub extends Hb{activateDomEventListener(e,t,n){const o=(e,n)=>{(!t||n.target.matches(t))&&('function'==typeof this.eventNameOrFunction?this.eventNameOrFunction(n):this.observable.fire(this.eventNameOrFunction,n))};return this.emitter.listenTo(n.node,e,o),()=>{this.emitter.stopListening(n.node,e,o)}}}class $b extends Hb{getValue(e){const t=super.getValue(e);return!si(t)&&(this.valueIfTrue||!0)}}var Kb=o(12),Gb=o.n(Kb);class Jb{constructor(e){this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new lm,this._unboundChildren=this.createCollection(),this._viewCollections.on('add',(t,n)=>{n.locale=e}),this.decorate('render')}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=Wb.bind(this,this)}createCollection(){const e=new jb;return this._viewCollections.add(e),e}registerChild(e){E(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){E(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new Wb(e)}extendTemplate(e){Wb.extend(this.template,e)}render(){if(this.isRendered)throw new Fd('ui-view-render-already-rendered: This View has already been rendered.');this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map((e)=>e.destroy())}}h(Jb,Vm),h(Jb,Xp);var Qb=o(15),Yb=o.n(Qb);const Xb=ki('px'),Zb=Sm.document.body;class ek extends Jb{constructor(e){super(e);const t=this.bindTemplate;this.set('top',0),this.set('left',0),this.set('position','arrow_nw'),this.set('isVisible',!1),this.set('withArrow',!0),this.set('className'),this.content=this.createCollection(),this.setTemplate({tag:'div',attributes:{class:['ck','ck-balloon-panel',t.to('position',(e)=>`ck-balloon-panel_${e}`),t.if('isVisible','ck-balloon-panel_visible'),t.if('withArrow','ck-balloon-panel_with-arrow'),t.to('className')],style:{top:t.to('top',Xb),left:t.to('left',Xb)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){this.show();const t=ek.defaultPositions,n=Object.assign({},{element:this.element,positions:[t.southArrowNorth,t.southArrowNorthWest,t.southArrowNorthEast,t.northArrowSouth,t.northArrowSouthWest,t.northArrowSouthEast],limiter:Zb,fitInViewport:!0},e),{top:o,left:i,name:r}=gi(n);Object.assign(this,{top:o,left:i,position:r})}pin(e){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},this._startPinning(e),this.listenTo(this,'change:isVisible',this._pinWhenIsVisibleCallback)}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,'change:isVisible',this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(e){this.attachTo(e);const t=_i(e.target),n=e.limiter?_i(e.limiter):Zb;this.listenTo(Sm.document,'scroll',(o,i)=>{const r=i.target,a=t&&r.contains(t),s=n&&r.contains(n);(a||s||!t||!n)&&this.attachTo(e)},{useCapture:!0}),this.listenTo(Sm.window,'resize',()=>{this.attachTo(e)})}_stopPinning(){this.stopListening(Sm.document,'scroll'),this.stopListening(Sm.window,'resize')}}ek.arrowHorizontalOffset=25,ek.arrowVerticalOffset=10,ek.defaultPositions={northArrowSouth:(e,t)=>({top:wi(e,t),left:e.left+e.width/2-t.width/2,name:'arrow_s'}),northArrowSouthEast:(e,t)=>({top:wi(e,t),left:e.left+e.width/2-t.width+ek.arrowHorizontalOffset,name:'arrow_se'}),northArrowSouthWest:(e,t)=>({top:wi(e,t),left:e.left+e.width/2-ek.arrowHorizontalOffset,name:'arrow_sw'}),northWestArrowSouth:(e,t)=>({top:wi(e,t),left:e.left-t.width/2,name:'arrow_s'}),northWestArrowSouthWest:(e,t)=>({top:wi(e,t),left:e.left-ek.arrowHorizontalOffset,name:'arrow_sw'}),northWestArrowSouthEast:(e,t)=>({top:wi(e,t),left:e.left-t.width+ek.arrowHorizontalOffset,name:'arrow_se'}),northEastArrowSouth:(e,t)=>({top:wi(e,t),left:e.right-t.width/2,name:'arrow_s'}),northEastArrowSouthEast:(e,t)=>({top:wi(e,t),left:e.right-t.width+ek.arrowHorizontalOffset,name:'arrow_se'}),northEastArrowSouthWest:(e,t)=>({top:wi(e,t),left:e.right-ek.arrowHorizontalOffset,name:'arrow_sw'}),southArrowNorth:(e,t)=>({top:vi(e,t),left:e.left+e.width/2-t.width/2,name:'arrow_n'}),southArrowNorthEast:(e,t)=>({top:vi(e,t),left:e.left+e.width/2-t.width+ek.arrowHorizontalOffset,name:'arrow_ne'}),southArrowNorthWest:(e,t)=>({top:vi(e,t),left:e.left+e.width/2-ek.arrowHorizontalOffset,name:'arrow_nw'}),southWestArrowNorth:(e,t)=>({top:vi(e,t),left:e.left-t.width/2,name:'arrow_n'}),southWestArrowNorthWest:(e,t)=>({top:vi(e,t),left:e.left-ek.arrowHorizontalOffset,name:'arrow_nw'}),southWestArrowNorthEast:(e,t)=>({top:vi(e,t),left:e.left-t.width+ek.arrowHorizontalOffset,name:'arrow_ne'}),southEastArrowNorth:(e,t)=>({top:vi(e,t),left:e.right-t.width/2,name:'arrow_n'}),southEastArrowNorthEast:(e,t)=>({top:vi(e,t),left:e.right-t.width+ek.arrowHorizontalOffset,name:'arrow_ne'}),southEastArrowNorthWest:(e,t)=>({top:vi(e,t),left:e.right-ek.arrowHorizontalOffset,name:'arrow_nw'})};class tk extends zb{static get pluginName(){return'ContextualBalloon'}init(){this.view=new ek,this.positionLimiter=()=>{const e=this.editor.editing.view,t=e.document,n=t.selection.editableElement;return n?e.domConverter.mapViewToDom(n.root):null},this._stack=new Map,this.editor.ui.view.body.add(this.view),this.editor.ui.focusTracker.add(this.view.element)}get visibleView(){const e=this._stack.get(this.view.content.get(0));return e?e.view:null}hasView(e){return this._stack.has(e)}add(e){if(this.hasView(e.view))throw new Fd('contextualballoon-add-view-exist: Cannot add configuration of the same view twice.');this.visibleView&&this.view.content.remove(this.visibleView),this._stack.set(e.view,e),this._show(e)}remove(e){if(!this.hasView(e))throw new Fd('contextualballoon-remove-view-not-exist: Cannot remove configuration of not existing view.');if(this.visibleView===e){this.view.content.remove(e),this._stack.delete(e);const t=Array.from(this._stack.values()).pop();t?this._show(t):this.view.hide()}else this._stack.delete(e)}updatePosition(e){e&&(this._stack.get(this.visibleView).position=e),this.view.pin(this._getBalloonPosition())}_show({view:e,balloonClassName:t=''}){this.view.className=t,this.view.content.add(e),this.view.pin(this._getBalloonPosition())}_getBalloonPosition(){let e=Array.from(this._stack.values()).pop().position;return e&&!e.limiter&&(e=Object.assign({},e,{limiter:this.positionLimiter})),e}}class nk{constructor(){this.set('isFocused',!1),this.focusedElement=null,this._elements=new Set,this._nextEventLoopTimeout=null}add(e){if(this._elements.has(e))throw new Fd('focusTracker-add-element-already-exist');this.listenTo(e,'focus',()=>this._focus(e),{useCapture:!0}),this.listenTo(e,'blur',()=>this._blur(),{useCapture:!0}),this._elements.add(e)}remove(e){e===this.focusedElement&&this._blur(e),this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e))}_focus(e){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=e,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}h(nk,Vm),h(nk,Xp);class ok{constructor(e){if(Object.assign(this,e),e.actions&&e.keystrokeHandler)for(const t in e.actions){let n=e.actions[t];'string'==typeof n&&(n=[n]);for(const o of n)e.keystrokeHandler.set(o,(e,n)=>{this[t](),n()})}}get first(){return this.focusables.find(yi)||null}get last(){return this.focusables.filter(yi).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let e=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((t,n)=>{const o=t.element===this.focusTracker.focusedElement;return o&&(e=n),o}),e)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(e){e&&e.focus()}_getFocusableItem(e){const t=this.current,n=this.focusables.length;if(!n)return null;if(null===t)return this[1===e?'first':'last'];let o=(t+n+e)%n;do{const t=this.focusables.get(o);if(yi(t))return t;o=(o+n+e)%n}while(o!==t);return null}}class ik extends Jb{constructor(e){super(e),this.setTemplate({tag:'span',attributes:{class:['ck','ck-toolbar__separator']}})}}var rk=o(17),ak=o.n(rk);class sk extends Jb{constructor(e){super(e);const t=this.bindTemplate;this.items=this.createCollection(),this.focusTracker=new nk,this.keystrokes=new Nb,this.set('isVertical',!1),this.set('className'),this._focusCycler=new ok({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:['arrowleft','arrowup'],focusNext:['arrowright','arrowdown']}}),this.setTemplate({tag:'div',attributes:{class:['ck','ck-toolbar',t.if('isVertical','ck-toolbar_vertical'),t.to('className')]},children:this.items,on:{mousedown:xi(this)}})}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on('add',(e,t)=>{this.focusTracker.add(t.element)}),this.items.on('remove',(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t){e.map((e)=>{'|'==e?this.items.add(new ik):t.has(e)?this.items.add(t.create(e)):mg.warn('toolbarview-item-unavailable: The requested toolbar item is unavailable.',{name:e})})}}class lk extends zb{static get pluginName(){return'BalloonToolbar'}static get requires(){return[tk]}init(){const e=this.editor;this.toolbarView=new sk(e.locale),this.toolbarView.extendTemplate({attributes:{class:['ck-toolbar_floating']}}),this.toolbarView.render(),this._balloon=e.plugins.get(tk),this._fireSelectionChangeDebounced=cg(()=>this.fire('_selectionChangeDebounced'),200),this._handleSelectionChange(),this._handleFocusChange(),this.decorate('show')}afterInit(){const e=Ci(this.editor.config.get('balloonToolbar')),t=this.editor.ui.componentFactory;this.toolbarView.fillFromConfig(e.items,t)}_handleFocusChange(){const e=this.editor;this.listenTo(e.ui.focusTracker,'change:isFocused',(e,t,n)=>{this._balloon.visibleView!==this.toolbarView||n||this.hide()})}_handleSelectionChange(){const e=this.editor.model.document.selection,t=this.editor.editing.view.document;this.listenTo(e,'change:range',(t,n)=>{(n.directChange||e.isCollapsed)&&this.hide(),this._fireSelectionChangeDebounced()}),this.listenTo(this,'_selectionChangeDebounced',()=>{t.isFocused&&!t.selection.isCollapsed&&this.show()})}show(){this._balloon.hasView(this.toolbarView)||Array.from(this.toolbarView.items).every((e)=>void 0!==e.isEnabled&&!e.isEnabled)||(this.listenTo(this.editor.editing.view,'render',()=>{this._balloon.updatePosition(this._getBalloonPositionData())}),this._balloon.add({view:this.toolbarView,position:this._getBalloonPositionData(),balloonClassName:'ck-toolbar-container'}))}hide(){this._balloon.hasView(this.toolbarView)&&(this.stopListening(this.editor.editing.view,'render'),this._balloon.remove(this.toolbarView))}_getBalloonPositionData(){const e=this.editor,t=e.editing.view,n=t.document,o=n.selection,i=n.selection.isBackward;return{target:()=>{const e=i?o.getFirstRange():o.getLastRange(),n=bg.getDomRangeRects(t.domConverter.viewRangeToDom(e));return i?n[0]:(1e?'ck-focused':'ck-blurred')],contenteditable:n.to('isReadOnly',(e)=>!e)}}),this.set('isReadOnly',!1),this.set('isFocused',!1),this.externalElement=t}render(){super.render(),this.externalElement?this.template.apply(this.element=this.externalElement):this.editableElement=this.element}destroy(){this.externalElement&&this.template.revert(this.externalElement),super.destroy()}}class fk extends gk{constructor(e,n){super(e,n);const o=this.bindTemplate,i=this.t;this.set('name',null);this.extendTemplate({attributes:{role:'textbox',"aria-label":o.to('name',(e)=>i('bb',[e])),class:'ck-editor__editable_inline'}})}}class hk extends mk{constructor(e,t){super(e),this.editable=new fk(e,t),this.registerChild(this.editable)}get editableElement(){return this.editable.element}}const bk={setData(e){this.data.set(e)},getData(){return this.data.get()}};var kk=bk;const _k={updateElement(){Ei(this.element,this.data.get())}};var wk=_k;class vk extends Bb{constructor(e,t){super(t),this.element=e,this.config.get('plugins').push(lk),this.config.define('balloonToolbar',this.config.get('toolbar')),this.data.processor=new Lb,this.model.document.createRoot(),this.ui=new ck(this,new hk(this.locale,e)),Oi(this)}destroy(){const e=this.getData();return this.ui.destroy(),super.destroy().then(()=>Ei(this.element,e))}static create(e,t){return new Promise((n)=>{const o=new this(e,t);n(o.initPlugins().then(()=>{o.ui.init(),o.fire('uiReady')}).then(()=>o.data.init(Si(e))).then(()=>{o.fire('dataReady'),o.fire('ready')}).then(()=>o))})}}h(vk,kk),h(vk,wk);class yk{constructor(e,t){this.editor=e,this.view=t,this.componentFactory=new dk(e),this.focusTracker=new nk,this._toolbarConfig=Ci(e.config.get('toolbar'))}init(){const e=this.editor,t=this.view;t.render(),t.stickyPanel.bind('isActive').to(this.focusTracker,'isFocused'),t.stickyPanel.limiterElement=t.element,this._toolbarConfig.viewportTopOffset&&(t.stickyPanel.viewportTopOffset=this._toolbarConfig.viewportTopOffset);const n=e.editing.view.document.getRoot();t.editable.bind('isReadOnly').to(n),t.editable.bind('isFocused').to(e.editing.view.document),t.editable.name=n.rootName,this.focusTracker.add(this.view.editableElement),this.view.toolbar.fillFromConfig(this._toolbarConfig.items,this.componentFactory),Pi({origin:e.editing.view,originFocusTracker:this.focusTracker,originKeystrokeHandler:e.keystrokes,toolbar:this.view.toolbar})}destroy(){this.view.destroy()}}var xk=o(21),Ck=o.n(xk);class Ak extends Jb{constructor(e){super(e),this.set('text'),this.set('for');const t=this.bindTemplate;this.setTemplate({tag:'label',attributes:{class:['ck','ck-label'],for:t.to('for')},children:[{text:t.to('text')}]})}}class Tk extends mk{constructor(e){super(e);const t=r();this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(t),this.setTemplate({tag:'div',attributes:{class:['ck','ck-reset','ck-editor','ck-rounded-corners'],role:'application',dir:'ltr',lang:e.language,"aria-labelledby":`ck-editor__aria-label_${t}`},children:[this._voiceLabelView,{tag:'div',attributes:{class:['ck','ck-editor__top','ck-reset_all'],role:'presentation'},children:this.top},{tag:'div',attributes:{class:['ck','ck-editor__main'],role:'presentation'},children:this.main}]})}_createVoiceLabel(e){const n=this.t,t=new Ak;return t.text=n('bc'),t.extendTemplate({attributes:{id:`ck-editor__aria-label_${e}`,class:'ck-voice-label'}}),t}}var Pk=o(23),Ek=o.n(Pk);const Sk=ki('px');class Ok extends Jb{constructor(e){super(e);const t=this.bindTemplate;this.set('isActive',!1),this.set('isSticky',!1),this.set('limiterElement',null),this.set('limiterBottomOffset',50),this.set('viewportTopOffset',0),this.set('_marginLeft',null),this.set('_isStickyToTheLimiter',!1),this.set('_hasViewportTopOffset',!1),this.content=this.createCollection(),this._contentPanelPlaceholder=new Wb({tag:'div',attributes:{class:['ck','ck-sticky-panel__placeholder'],style:{display:t.to('isSticky',(e)=>e?'block':'none'),height:t.to('isSticky',(e)=>e?Sk(this._panelRect.height):null)}}}).render(),this._contentPanel=new Wb({tag:'div',attributes:{class:['ck','ck-sticky-panel__content',t.if('isSticky','ck-sticky-panel__content_sticky'),t.if('_isStickyToTheLimiter','ck-sticky-panel__content_sticky_bottom-limit')],style:{width:t.to('isSticky',(e)=>e?Sk(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to('_hasViewportTopOffset',(e)=>e?Sk(this.viewportTopOffset):null),bottom:t.to('_isStickyToTheLimiter',(e)=>e?Sk(this.limiterBottomOffset):null),marginLeft:t.to('_marginLeft')}},children:this.content}).render(),this.setTemplate({tag:'div',attributes:{class:['ck','ck-sticky-panel']},children:[this._contentPanelPlaceholder,this._contentPanel]})}render(){super.render(),this._checkIfShouldBeSticky(),this.listenTo(Sm.window,'scroll',()=>{this._checkIfShouldBeSticky()}),this.listenTo(this,'change:isActive',()=>{this._checkIfShouldBeSticky()})}_checkIfShouldBeSticky(){const e=this._panelRect=this._contentPanel.getBoundingClientRect();let t;this.limiterElement?(t=this._limiterRect=this.limiterElement.getBoundingClientRect(),this.isSticky=this.isActive&&t.top{e.style.display='',t&&t.remove()}),this._replacedElements=[]}}class Nk extends Bb{constructor(e,t){super(t),this._elementReplacer=new Fk,this.element=e,this.data.processor=new Lb,this.model.document.createRoot(),this.ui=new yk(this,new Vk(this.locale)),Oi(this)}destroy(){return this.updateElement(),this._elementReplacer.restore(),this.ui.destroy(),super.destroy()}static create(e,t){return new Promise((n)=>{const o=new this(e,t);n(o.initPlugins().then(()=>o.ui.init()).then(()=>{o._elementReplacer.replace(e,o.ui.view.element),o.fire('uiReady')}).then(()=>o.editing.view.attachDomRoot(o.ui.view.editableElement)).then(()=>o.data.init(Si(e))).then(()=>{o.fire('dataReady'),o.fire('ready')}).then(()=>o))})}}h(Nk,kk),h(Nk,wk);class Dk{constructor(e){this.files=Ri(e),this._native=e}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,t){this._native.setData(e,t)}}class Bk extends og{constructor(e){function t(e,t){t.preventDefault();const o=t.dropRange?[t.dropRange]:Array.from(n.selection.getRanges());n.fire('clipboardInput',{dataTransfer:t.dataTransfer,targetRanges:o})}super(e);const n=this.document;this.domEventType=['paste','copy','cut','drop','dragover'],this.listenTo(n,'paste',t,{priority:'low'}),this.listenTo(n,'drop',t,{priority:'low'})}onDomEvent(e){const t={dataTransfer:new Dk(e.clipboardData?e.clipboardData:e.dataTransfer)};'drop'==e.type&&(t.dropRange=Ii(this.view,e)),this.fire(e.type,e,t)}}const Mk=['figcaption','li'];class Lk extends zb{static get pluginName(){return'Clipboard'}init(){function e(e,o){const r=o.dataTransfer;o.preventDefault();const a=t.data.toView(t.model.getSelectedContent(n.selection));i.fire('clipboardOutput',{dataTransfer:r,content:a,method:e.name})}const t=this.editor,n=t.model.document,o=t.editing.view,i=o.document;this._htmlDataProcessor=new Lb,o.addObserver(Bk),this.listenTo(i,'clipboardInput',(e)=>{t.isReadOnly&&e.stop()},{priority:'highest'}),this.listenTo(i,'clipboardInput',(e,t)=>{const n=t.dataTransfer;let i='';n.getData('text/html')?i=Fi(n.getData('text/html')):n.getData('text/plain')&&(i=Vi(n.getData('text/plain'))),i=this._htmlDataProcessor.toView(i),this.fire('inputTransformation',{content:i}),o.scrollToTheSelection()},{priority:'low'}),this.listenTo(this,'inputTransformation',(e,t)=>{if(!t.content.isEmpty){const e=this.editor.data,o=this.editor.model,i=e.toModel(t.content,'$clipboardHolder');if(0==i.childCount)return;o.insertContent(i,n.selection)}},{priority:'low'}),this.listenTo(i,'copy',e,{priority:'low'}),this.listenTo(i,'cut',(n,o)=>{t.isReadOnly?o.preventDefault():e(n,o)},{priority:'low'}),this.listenTo(i,'clipboardOutput',(e,o)=>{o.content.isEmpty||(o.dataTransfer.setData('text/html',this._htmlDataProcessor.toData(o.content)),o.dataTransfer.setData('text/plain',Ni(o.content))),'cut'==o.method&&t.model.deleteContent(n.selection)},{priority:'low'})}}class zk{constructor(e){this.editor=e,this.set('value',void 0),this.set('isEnabled',!1),this.decorate('execute'),this.listenTo(this.editor.model.document,'change',()=>{this.refresh()}),this.on('execute',(e)=>{this.isEnabled||e.stop()},{priority:'high'}),this.listenTo(e,'change:isReadOnly',(e,t,n)=>{n?(this.on('set:isEnabled',Di,{priority:'highest'}),this.isEnabled=!1):(this.off('set:isEnabled',Di),this.refresh())})}refresh(){this.isEnabled=!0}execute(){}destroy(){this.stopListening()}}h(zk,Xp);class jk extends zk{execute(){const e=this.editor.model,t=e.document;e.change((n)=>{Bi(this.editor.model,n,t.selection,e.schema),this.fire('afterExecute',{writer:n})})}}class qk extends Nm{constructor(e){super(e);const t=this.document;t.on('keydown',(e,n)=>{if(this.isEnabled&&n.keyCode==km.enter){let o;t.once('enter',(e)=>o=e,{priority:'highest'}),t.fire('enter',new ng(t,n.domEvent,{isSoft:n.shiftKey})),o&&o.stop.called&&e.stop()}})}observe(){}}class Wk extends zb{static get pluginName(){return'Enter'}init(){const e=this.editor,t=e.editing.view,n=t.document;t.addObserver(qk),e.commands.add('enter',new jk(e)),this.listenTo(n,'enter',(n,o)=>{o.isSoft||(e.execute('enter'),o.preventDefault(),t.scrollToTheSelection())},{priority:'low'})}}class Hk extends zk{execute(){const e=this.editor.model,t=e.document;e.change((n)=>{zi(e,n,t.selection),this.fire('afterExecute',{writer:n})})}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=Li(e.schema,t.selection)}}class Uk extends zb{static get pluginName(){return'ShiftEnter'}init(){const e=this.editor,t=e.model.schema,n=e.conversion,o=e.editing.view,i=o.document;t.register('softBreak',{allowWhere:'$text'}),n.for('upcast').add(an({model:'softBreak',view:'br'})),n.for('downcast').add(Ct({model:'softBreak',view:(e,t)=>t.createEmptyElement('br')})),o.addObserver(qk),e.commands.add('shiftEnter',new Hk(e)),this.listenTo(i,'enter',(t,n)=>{n.isSoft&&(e.execute('shiftEnter'),n.preventDefault(),o.scrollToTheSelection())},{priority:'low'})}}class $k{constructor(e,t=20){this.model=e,this.size=0,this.limit=t,this.isLocked=!1,this._changeCallback=(e,t)=>{'transparent'!=t.type&&t!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on('change',this._changeCallback),this.model.document.selection.on('change:range',this._selectionChangeCallback),this.model.document.selection.on('change:attribute',this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=new wb),this._batch}input(e){this.size+=e,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}destroy(){this.model.document.off('change',this._changeCallback),this.model.document.selection.off('change:range',this._selectionChangeCallback),this.model.document.selection.off('change:attribute',this._selectionChangeCallback)}_reset(e){(!this.isLocked||e)&&(this._batch=null,this.size=0)}}class Kk extends zk{constructor(e,t){super(e),this._buffer=new $k(e.model,t)}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,n=t.document,o=e.text||'',i=o.length,r=e.range||n.selection.getFirstRange(),a=e.resultRange;t.enqueueChange(this._buffer.batch,(e)=>{const t=r.isCollapsed;this._buffer.lock(),t||e.remove(r),o&&e.insertText(o,n.selection.getAttributes(),r.start),a?e.setSelection(a):t&&e.setSelection(r.start.getShiftedBy(i)),this._buffer.unlock(),this._buffer.input(i)})}}class Gk extends zb{static get pluginName(){return'Input'}init(){const e=this.editor,t=e.editing.view,n=new Kk(e,e.config.get('typing.undoStep')||20);e.commands.add('input',n),this.listenTo(t.document,'keydown',(e,t)=>{this._handleKeydown(t,n)},{priority:'lowest'}),this.listenTo(t.document,'mutations',(e,t,n)=>{this._handleMutations(t,n)})}_handleKeydown(e,t){const n=this.editor.model,o=n.document,i=t.buffer;!t.isEnabled||Hi(e)||o.selection.isCollapsed||(i.lock(),n.enqueueChange(i.batch,()=>{this.editor.model.deleteContent(o.selection)}),i.unlock())}_handleMutations(e,t){new Jk(this.editor).handle(e,t)}}class Jk{constructor(e){this.editor=e,this.editing=this.editor.editing}handle(e,t){if(Gi(e))this._handleContainerChildrenMutations(e,t);else for(const n of e)this._handleTextMutation(n,t),this._handleTextNodeInsertion(n)}_handleContainerChildrenMutations(e,t){const n=Ki(e);if(!n)return;const o=this.editor.editing.view.domConverter,i=o.mapViewToDom(n),r=new Rm,a=this.editor.data.toModel(r.domToView(i)).getChild(0),s=this.editor.editing.mapper.toModelElement(n);if(!s)return;const l=Array.from(a.getChildren()),d=Array.from(s.getChildren()),c=l[l.length-1],u=d[d.length-1];if(c&&c.is('softBreak')&&u&&!u.is('softBreak')&&l.pop(),!Ji(l)||!Ji(d))return;const p=l.map((e)=>e.is('text')?e.data:'@').join('').replace(/\u00A0/g,' '),m=d.map((e)=>e.is('text')?e.data:'@').join('');if(m===p)return;const g=Pe(m,p),{firstChangeAt:f,insertions:h,deletions:b}=Qi(g);let k=null;t&&(k=this.editing.mapper.toModelRange(t.getFirstRange()));const _=p.substr(f,h),w=Eg.createFromParentsAndOffsets(s,f,s,f+b);this.editor.execute('input',{text:_,range:w,resultRange:k})}_handleTextMutation(e,t){if('text'!=e.type)return;const n=e.newText.replace(/\u00A0/g,' '),o=e.oldText.replace(/\u00A0/g,' '),i=Pe(o,n),{firstChangeAt:r,insertions:a,deletions:s}=Qi(i);let l=null;t&&(l=this.editing.mapper.toModelRange(t.getFirstRange()));const d=new im(e.node,r),c=this.editing.mapper.toModelPosition(d),u=Eg.createFromPositionAndShift(c,s),p=n.substr(r,a);this.editor.execute('input',{text:p,range:u,resultRange:l})}_handleTextNodeInsertion(e){if('children'==e.type){const t=$i(e),n=new im(e.node,t.index),o=this.editing.mapper.toModelPosition(n),i=t.values[0].data;this.editor.execute('input',{text:i.replace(/\u00A0/g,' '),range:new Eg(o)})}}}const Qk=[ne('arrowUp'),ne('arrowRight'),ne('arrowDown'),ne('arrowLeft'),9,16,17,18,20,27,33,34,35,36,229];for(let e=112;135>=e;e++)Qk.push(e);class Yk extends zk{constructor(e,t){super(e),this.direction=t,this._buffer=new $k(e.model,e.config.get('typing.undoStep'))}execute(e={}){const t=this.editor.model,n=t.document;t.enqueueChange(this._buffer.batch,(o)=>{this._buffer.lock();const i=new Ig(n.selection),r=i.isCollapsed;if(i.isCollapsed&&t.modifySelection(i,{direction:this.direction,unit:e.unit}),this._shouldEntireContentBeReplacedWithParagraph(e.sequence||1))return void this._replaceEntireContentWithParagraph(o);if(i.isCollapsed)return;let a=0;i.getFirstRange().getMinimalFlatRanges().forEach((e)=>{a+=X(e.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),t.deleteContent(i,{doNotResetEntireContent:r}),this._buffer.input(a),o.setSelection(i),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(1{(t.keyCode==km.delete||t.keyCode==km.backspace)&&(n=0)}),t.on('keydown',(e,o)=>{const i={};if(o.keyCode==km.delete)i.direction='forward',i.unit='character';else if(o.keyCode==km.backspace)i.direction='backward',i.unit='codePoint';else return;const r=fm.isMac?o.altKey:o.ctrlKey;i.unit=r?'word':i.unit,i.sequence=++n;let a;t.once('delete',(e)=>a=e,{priority:'highest'}),t.fire('delete',new ng(t,o.domEvent,i)),a&&a.stop.called&&e.stop()})}observe(){}}class Zk extends zb{static get pluginName(){return'Delete'}init(){const e=this.editor,t=e.editing.view,n=t.document;t.addObserver(Xk),e.commands.add('forwardDelete',new Yk(e,'forward')),e.commands.add('delete',new Yk(e,'backward')),this.listenTo(n,'delete',(n,o)=>{e.execute('forward'==o.direction?'forwardDelete':'delete',{unit:o.unit,sequence:o.sequence}),o.preventDefault(),t.scrollToTheSelection()})}}class e_ extends zb{static get requires(){return[Gk,Zk]}static get pluginName(){return'Typing'}}class t_ extends zk{constructor(e){super(e),this._stack=[],this._createdBatches=new WeakSet,this.refresh()}refresh(){this.isEnabled=0e.start.root!=i.graveyard);t&&r.push(t)}r.length&&o.change((e)=>{e.setSelection(r,{backward:t})})}_undo(e,t){const n=this.editor.model,o=n.document;this._createdBatches.add(t);const i=e.deltas.slice();i.reverse();for(const r of i)if(r.operations.some((e)=>e.isDocumentOperation)){const e=r.baseVersion+r.operations.length,i=Array.from(o.history.getDeltas(e)),a=n.transformDeltas([r.getReversed()],i,!0),s=a.deltasA;for(const e of s){e.baseVersion=o.version,t.addDelta(e);for(const t of e.operations)n.applyOperation(t);o.history.setDeltaAsUndone(r,e)}}}}class n_ extends t_{execute(e=null){const t=e?this._stack.findIndex((t)=>t.batch==e):this._stack.length-1,n=this._stack.splice(t,1)[0],o=new wb;this.editor.model.enqueueChange(o,()=>{this._undo(n.batch,o);const e=this.editor.model.document.history.getDeltas(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,e),this.fire('revert',n.batch,o)}),this.refresh()}}class o_ extends t_{execute(){const e=this._stack.pop(),t=new wb;this.editor.model.enqueueChange(t,()=>{const n=e.batch.deltas[e.batch.deltas.length-1],o=n.baseVersion+n.operations.length,i=this.editor.model.document.history.getDeltas(o);this._restoreSelection(e.selection.ranges,e.selection.isBackward,i),this._undo(e.batch,t)}),this.refresh()}}class i_ extends zb{constructor(e){super(e),this._batchRegistry=new WeakSet}init(){const e=this.editor;this._undoCommand=new n_(e),this._redoCommand=new o_(e),e.commands.add('undo',this._undoCommand),e.commands.add('redo',this._redoCommand),this.listenTo(e.model,'applyOperation',(e,t)=>{const n=t[0];if(n.isDocumentOperation){const e=n.delta.batch;this._batchRegistry.has(e)||'transparent'==e.type||(this._redoCommand._createdBatches.has(e)?this._undoCommand.addBatch(e):!this._undoCommand._createdBatches.has(e)&&(this._undoCommand.addBatch(e),this._redoCommand.clearStack()),this._batchRegistry.add(e))}},{priority:'highest'}),this.listenTo(this._undoCommand,'revert',(e,t,n)=>{this._redoCommand.addBatch(n)}),e.keystrokes.set('CTRL+Z','undo'),e.keystrokes.set('CTRL+Y','redo'),e.keystrokes.set('CTRL+SHIFT+Z','redo')}}var r_=o(27),a_=o.n(r_);class s_ extends Jb{constructor(){super();const e=this.bindTemplate;this.set('content',''),this.set('viewBox','0 0 20 20'),this.set('fillColor',''),this.setTemplate({tag:'svg',ns:'http://www.w3.org/2000/svg',attributes:{class:['ck','ck-icon'],viewBox:e.to('viewBox')}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on('change:content',()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on('change:fillColor',()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const e=new DOMParser().parseFromString(this.content.trim(),'image/svg+xml'),t=e.querySelector('svg'),n=t.getAttribute('viewBox');for(n&&(this.viewBox=n),this.element.innerHTML='';0{e.style.fill=this.fillColor})}}var l_=o(29),d_=o.n(l_);class c_ extends Jb{constructor(e){super(e),this.set('text',''),this.set('position','s');const t=this.bindTemplate;this.setTemplate({tag:'span',attributes:{class:['ck','ck-tooltip',t.to('position',(e)=>'ck-tooltip_'+e),t.if('text','ck-hidden',(e)=>!e.trim())]},children:[{tag:'span',attributes:{class:['ck','ck-tooltip__text']},children:[{text:t.to('text')}]}]})}}var u_=o(31),p_=o.n(u_);class m_ extends Jb{constructor(e){super(e);const t=this.bindTemplate,n=r();this.set('icon'),this.set('isEnabled',!0),this.set('isOn',!1),this.set('isVisible',!0),this.set('keystroke'),this.set('label'),this.set('tabindex',-1),this.set('tooltip'),this.set('tooltipPosition','s'),this.set('type','button'),this.set('withText',!1),this.children=this.createCollection(),this.tooltipView=this._createTooltipView(),this.labelView=this._createLabelView(n),this.iconView=new s_,this.iconView.extendTemplate({attributes:{class:'ck-button__icon'}}),this.bind('_tooltipString').to(this,'tooltip',this,'label',this,'keystroke',this._getTooltipString.bind(this)),this.setTemplate({tag:'button',attributes:{class:['ck','ck-button',t.if('isEnabled','ck-disabled',(e)=>!e),t.if('isVisible','ck-hidden',(e)=>!e),t.to('isOn',(e)=>e?'ck-on':'ck-off'),t.if('withText','ck-button_with-text')],type:t.to('type',(e)=>e?e:'button'),tabindex:t.to('tabindex'),"aria-labelledby":`ck-editor__aria-label_${n}`,"aria-disabled":t.if('isEnabled',!0,(e)=>!e),"aria-pressed":t.if('isOn',!0)},children:this.children,on:{mousedown:t.to((e)=>{e.preventDefault()}),click:t.to((e)=>{this.isEnabled?this.fire('execute'):e.preventDefault()})}})}render(){super.render(),this.icon&&(this.iconView.bind('content').to(this,'icon'),this.children.add(this.iconView)),this.children.add(this.tooltipView),this.children.add(this.labelView)}focus(){this.element.focus()}_createTooltipView(){const e=new c_;return e.bind('text').to(this,'_tooltipString'),e.bind('position').to(this,'tooltipPosition'),e}_createLabelView(e){const t=new Jb;return t.setTemplate({tag:'span',attributes:{class:['ck','ck-button__label'],id:`ck-editor__aria-label_${e}`},children:[{text:this.bindTemplate.to('label')}]}),t}_getTooltipString(e,t,n){return e?'string'==typeof e?e:(n&&(n=ie(n)),e instanceof Function?e(t,n):`${t}${n?` (${n})`:''}`):''}}var g_=o(33),f_=o.n(g_),h_=o(34),b_=o.n(h_);class k_ extends zb{init(){const e=this.editor,n=e.t;this._addButton('undo',n('am'),'CTRL+Z',f_.a),this._addButton('redo',n('an'),'CTRL+Y',b_.a)}_addButton(e,t,n,o){const i=this.editor;i.ui.componentFactory.add(e,(r)=>{const a=i.commands.get(e),s=new m_(r);return s.set({label:t,icon:o,keystroke:n,tooltip:!0}),s.bind('isEnabled').to(a,'isEnabled'),this.listenTo(s,'execute',()=>i.execute(e)),s})}}class __ extends zb{static get requires(){return[i_,k_]}static get pluginName(){return'Undo'}}class w_ extends zb{static get requires(){return[Lk,Wk,Uk,e_,__]}static get pluginName(){return'Essentials'}}class v_ extends zb{static get pluginName(){return'PendingActions'}init(){this.set('isPending',!1),this._actions=new lm({idProperty:'_id'}),this._actions.delegate('add','remove').to(this)}add(e){if('string'!=typeof e)throw new Fd('pendingactions-add-invalid-message: The message must be a string.');const t=Object.create(Xp);return t.set('message',e),this._actions.add(t),this.isPending=!0,t}remove(e){this._actions.remove(e),this.isPending=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}class y_{constructor(){const e=new window.FileReader;this._reader=e,this.set('loaded',0),e.onprogress=(e)=>{this.loaded=e.loaded}}get error(){return this._reader.error}read(e){const t=this._reader;return this.total=e.size,new Promise((n,o)=>{t.onload=()=>{n(t.result)},t.onerror=()=>{o('error')},t.onabort=()=>{o('aborted')},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}h(y_,Xp);class x_ extends zb{static get pluginName(){return'FileRepository'}static get requires(){return[v_]}init(){this.loaders=new lm,this.loaders.on('add',()=>this._updatePendingAction()),this.loaders.on('remove',()=>this._updatePendingAction()),this._pendingAction=null,this.set('uploaded',0),this.set('uploadTotal',null),this.bind('uploadedPercent').to(this,'uploaded',this,'uploadTotal',(e,t)=>t?100*(e/t):0)}getLoader(e){for(const t of this.loaders)if(t.file==e)return t;return null}createLoader(e){if(!this.createUploadAdapter)return mg.error('filerepository-no-upload-adapter: Upload adapter is not defined.'),null;const t=new C_(e);return t._adapter=this.createUploadAdapter(t),this.loaders.add(t),t.on('change:uploaded',()=>{let e=0;for(const t of this.loaders)e+=t.uploaded;this.uploaded=e}),t.on('change:uploadTotal',()=>{let e=0;for(const t of this.loaders)t.uploadTotal&&(e+=t.uploadTotal);this.uploadTotal=e}),t}destroyLoader(e){const t=e instanceof C_?e:this.getLoader(e);t._destroy(),this.loaders.remove(t)}_updatePendingAction(){const e=this.editor.plugins.get(v_);if(!this.loaders.length)e.remove(this._pendingAction),this._pendingAction=null;else if(!this._pendingAction){const n=this.editor.t,t=(e)=>`${n('aj')} ${parseInt(e)}%.`;this._pendingAction=e.add(t(this.uploadedPercent)),this._pendingAction.bind('message').to(this,'uploadedPercent',t)}}}h(x_,Xp);class C_{constructor(e,t){this.id=r(),this.file=e,this._adapter=t,this._reader=new y_,this.set('status','idle'),this.set('uploaded',0),this.set('uploadTotal',null),this.bind('uploadedPercent').to(this,'uploaded',this,'uploadTotal',(e,t)=>t?100*(e/t):0),this.set('uploadResponse',null)}read(){if('idle'!=this.status)throw new Fd('filerepository-read-wrong-status: You cannot call read if the status is different than idle.');return this.status='reading',this._reader.read(this.file).then((e)=>(this.status='idle',e)).catch((e)=>{if('aborted'===e)throw this.status='aborted','aborted';throw this.status='error',this._reader.error})}upload(){if('idle'!=this.status)throw new Fd('filerepository-upload-wrong-status: You cannot call upload if the status is different than idle.');return this.status='uploading',this._adapter.upload().then((e)=>(this.uploadResponse=e,this.status='idle',e)).catch((e)=>{if('aborted'===this.status)throw'aborted';throw this.status='error',e})}abort(){const e=this.status;this.status='aborted','reading'==e&&this._reader.abort(),'uploading'==e&&this._adapter.abort&&this._adapter.abort(),this._destroy()}_destroy(){this._reader=void 0,this._adapter=void 0,this.data=void 0,this.uploadResponse=void 0,this.file=void 0}}h(C_,Xp);const A_='ckCsrfToken',T_=40,P_='abcdefghijklmnopqrstuvwxyz0123456789';class E_ extends zb{static get requires(){return[x_]}static get pluginName(){return'CKFinderUploadAdapter'}init(){const e=this.editor.config.get('ckfinder.uploadUrl');e&&(this.editor.plugins.get(x_).createUploadAdapter=(t)=>new S_(t,e,this.editor.t))}}class S_{constructor(e,n,o){this.loader=e,this.url=n,this.t=o}upload(){return new Promise((e,t)=>{this._initRequest(),this._initListeners(e,t),this._sendRequest()})}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open('POST',this.url,!0),e.responseType='json'}_initListeners(e,n){const o=this.xhr,i=this.loader,r=this.t,t=r('a')+` ${i.file.name}.`;o.addEventListener('error',()=>n(t)),o.addEventListener('abort',()=>n()),o.addEventListener('load',()=>{const i=o.response;return i&&i.uploaded?void e({default:i.url}):n(i&&i.error&&i.error.message?i.error.message:t)}),o.upload&&o.upload.addEventListener('progress',(e)=>{e.lengthComputable&&(i.uploadTotal=e.total,i.uploaded=e.loaded)})}_sendRequest(){const e=new FormData;e.append('upload',this.loader.file),e.append('ckCsrfToken',Zi()),this.xhr.send(e)}}class O_{constructor(e,t,n){let o;if('function'==typeof n)o=n;else{o=()=>{e.execute(n)}}e.model.document.on('change',(n,i)=>{if('transparent'==i.type)return;const r=Array.from(e.model.document.differ.getChanges()),a=r[0];if(1!=r.length||'insert'!==a.type||'$text'!=a.name||1!=a.length)return;const s=a.position.textNode||a.position.nodeAfter;if(!s.parent.is('paragraph'))return;const l=t.exec(s.data);l&&e.model.enqueueChange((e)=>{const t=Eg.createFromParentsAndOffsets(s.parent,0,s.parent,l[0].length);e.remove(t),o({match:l})})})}}class R_{constructor(e,t,n){let o,i,r,a;t instanceof RegExp?o=t:r=t,'string'==typeof n?i=n:a=n,r=r||((e)=>{let t;const n=[],i=[];for(;null!==(t=o.exec(e))&&!(t&&4>t.length);){let{index:e,1:o,2:r,3:a}=t;e+=t[0].length-(o+r+a).length;const s=[e,e+o.length],l=[e+o.length+r.length,e+o.length+r.length+a.length];n.push(s),n.push(l),i.push([e+o.length,e+o.length+r.length])}return{remove:n,format:i}}),a=a||((e,t)=>{for(const n of t)e.setAttribute(i,!0,n);e.removeSelectionAttribute(i)}),e.model.document.on('change',(t,n)=>{if('transparent'==n.type)return;const o=e.model.document.selection;if(!o.isCollapsed)return;const s=Array.from(e.model.document.differ.getChanges()),l=s[0];if(1!=s.length||'insert'!==l.type||'$text'!=l.name||1!=l.length)return;const d=o.focus.parent,c=or(d).slice(0,o.focus.offset),u=r(c),p=ir(d,u.format),m=ir(d,u.remove);p.length&&m.length&&e.model.enqueueChange((t)=>{const n=e.model.schema.getValidRanges(p,i);a(t,n);for(const e of m.reverse())t.remove(e)})})}}class I_ extends zb{static get pluginName(){return'Autoformat'}afterInit(){this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats()}_addListAutoformats(){const e=this.editor.commands;e.get('bulletedList')&&new O_(this.editor,/^[*-]\s$/,'bulletedList'),e.get('numberedList')&&new O_(this.editor,/^\d+[.|)]\s$/,'numberedList')}_addBasicStylesAutoformats(){const e=this.editor.commands;e.get('bold')&&(new R_(this.editor,/(\*\*)([^*]+)(\*\*)$/g,'bold'),new R_(this.editor,/(__)([^_]+)(__)$/g,'bold')),e.get('italic')&&(new R_(this.editor,/(?:^|[^*])(\*)([^*_]+)(\*)$/g,'italic'),new R_(this.editor,/(?:^|[^_])(_)([^_]+)(_)$/g,'italic')),e.get('code')&&new R_(this.editor,/(`)([^`]+)(`)$/g,'code')}_addHeadingAutoformats(){const e=this.editor.commands.get('heading');e&&e.modelElements.filter((e)=>e.match(/^heading[1-6]$/)).forEach((e)=>{const t=e[7],n=new RegExp(`^(#{${t}})\\s$`);new O_(this.editor,n,()=>{this.editor.execute('heading',{value:e})})})}_addBlockQuoteAutoformats(){this.editor.commands.get('blockQuote')&&new O_(this.editor,/^>\s$/,'blockQuote')}}class V_ extends zk{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=t.selection.hasAttribute(this.attributeKey),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,n=t.document,o=n.selection,i=e.forceValue===void 0?!this.value:e.forceValue;t.change((e)=>{if(o.isCollapsed)i?e.setSelectionAttribute(this.attributeKey,!0):e.removeSelectionAttribute(this.attributeKey);else{const n=t.schema.getValidRanges(o.getRanges(),this.attributeKey);for(const t of n)i?e.setAttribute(this.attributeKey,i,t):e.removeAttribute(this.attributeKey,t)}})}}const F_='bold';class N_ extends zb{init(){const e=this.editor;e.model.schema.extend('$text',{allowAttributes:F_}),e.conversion.attributeToElement({model:F_,view:'strong',upcastAlso:['b',{styles:{"font-weight":'bold'}}]}),e.commands.add(F_,new V_(e,F_)),e.keystrokes.set('CTRL+B',F_)}}var D_=o(35),B_=o.n(D_);const M_='bold';class L_ extends zb{init(){const e=this.editor,n=e.t;e.ui.componentFactory.add(M_,(t)=>{const o=e.commands.get(M_),i=new m_(t);return i.set({label:n('c'),icon:B_.a,keystroke:'CTRL+B',tooltip:!0}),i.bind('isOn','isEnabled').to(o,'value','isEnabled'),this.listenTo(i,'execute',()=>e.execute(M_)),i})}}class z_ extends zb{static get requires(){return[N_,L_]}static get pluginName(){return'Bold'}}const j_='code';class q_ extends zb{init(){const e=this.editor;e.model.schema.extend('$text',{allowAttributes:j_}),e.conversion.attributeToElement({model:j_,view:'code',upcastAlso:{styles:{"word-wrap":'break-word'}}}),e.commands.add(j_,new V_(e,j_))}}var W_=o(36),H_=o.n(W_),U_=o(4),$_=o.n(U_);const K_='code';class G_ extends zb{init(){const e=this.editor,n=e.t;e.ui.componentFactory.add(K_,(t)=>{const o=e.commands.get(K_),i=new m_(t);return i.set({label:n('d'),icon:H_.a,tooltip:!0}),i.bind('isOn','isEnabled').to(o,'value','isEnabled'),this.listenTo(i,'execute',()=>e.execute(K_)),i})}}class J_ extends zb{static get requires(){return[q_,G_]}static get pluginName(){return'Code'}}const Q_='italic';class Y_ extends zb{init(){const e=this.editor;e.model.schema.extend('$text',{allowAttributes:Q_}),e.conversion.attributeToElement({model:Q_,view:'i',upcastAlso:['em',{styles:{"font-style":'italic'}}]}),e.commands.add(Q_,new V_(e,Q_)),e.keystrokes.set('CTRL+I',Q_)}}var X_=o(38),Z_=o.n(X_);const ew='italic';class tw extends zb{init(){const e=this.editor,n=e.t;e.ui.componentFactory.add(ew,(t)=>{const o=e.commands.get(ew),i=new m_(t);return i.set({label:n('b'),icon:Z_.a,keystroke:'CTRL+I',tooltip:!0}),i.bind('isOn','isEnabled').to(o,'value','isEnabled'),this.listenTo(i,'execute',()=>e.execute(ew)),i})}}class nw extends zb{static get requires(){return[Y_,tw]}static get pluginName(){return'Italic'}}class ow extends zk{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=e.document,n=e.schema,o=Array.from(t.selection.getSelectedBlocks());e.change((e)=>{if(this.value)this._removeQuote(e,o.filter(ar));else{const t=o.filter((e)=>ar(e)||lr(n,e));this._applyQuote(e,t)}})}_getValue(){const e=rr(this.editor.model.document.selection.getSelectedBlocks());return!!(e&&ar(e))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,n=rr(e.getSelectedBlocks());return!!n&&lr(t,n)}_removeQuote(e,t){sr(t).reverse().forEach((t)=>{if(t.start.isAtStart&&t.end.isAtEnd)return void e.unwrap(t.start.parent);if(t.start.isAtStart){const n=Pg.createBefore(t.start.parent);return void e.move(t,n)}t.end.isAtEnd||e.split(t.end);const n=Pg.createAfter(t.end.parent);e.move(t,n)})}_applyQuote(e,t){const n=[];sr(t).reverse().forEach((t)=>{let o=ar(t.start);o||(o=new Cg('blockQuote'),e.wrap(t,o)),n.push(o)}),n.reverse().reduce((t,n)=>t.nextSibling==n?(e.merge(Pg.createAfter(t)),t):n)}}class iw extends zb{init(){const e=this.editor,t=e.model.schema;e.commands.add('blockQuote',new ow(e)),t.register('blockQuote',{allowWhere:'$block',allowContentOf:'$root'}),t.addChildCheck((e,t)=>{if(e.endsWith('blockQuote')&&'blockQuote'==t.name)return!1}),e.conversion.elementToElement({model:'blockQuote',view:'blockquote'})}afterInit(){const e=this.editor,t=e.commands.get('blockQuote');this.listenTo(this.editor.editing.view.document,'enter',(e,n)=>{const o=this.editor.model.document,i=o.selection.getLastPosition().parent;o.selection.isCollapsed&&i.isEmpty&&t.value&&(this.editor.execute('blockQuote'),this.editor.editing.view.scrollToTheSelection(),n.preventDefault(),e.stop())})}}var rw=o(39),aw=o.n(rw),sw=o(40),lw=o.n(sw);class dw extends zb{init(){const e=this.editor,n=e.t;e.ui.componentFactory.add('blockQuote',(t)=>{const o=e.commands.get('blockQuote'),i=new m_(t);return i.set({label:n('g'),icon:aw.a,tooltip:!0}),i.bind('isOn','isEnabled').to(o,'value','isEnabled'),this.listenTo(i,'execute',()=>e.execute('blockQuote')),i})}}class cw extends zb{static get requires(){return[iw,dw]}static get pluginName(){return'BlockQuote'}}class uw extends zk{refresh(){const e=this.editor.model,t=e.document,n=rr(t.selection.getSelectedBlocks());this.value=!!n&&n.is('paragraph'),this.isEnabled=!!n&&dr(n,e.schema)}execute(e={}){const t=this.editor.model,n=t.document;t.change((o)=>{const i=(e.selection||n.selection).getSelectedBlocks();for(const e of i)!e.is('paragraph')&&dr(e,t.schema)&&o.rename(e,'paragraph')})}}class pw extends zb{static get pluginName(){return'Paragraph'}init(){const e=this.editor,t=e.model,n=e.data;e.commands.add('paragraph',new uw(e)),t.schema.register('paragraph',{inheritAllFrom:'$block'}),e.conversion.elementToElement({model:'paragraph',view:'p'}),n.upcastDispatcher.on('element',(e,t,n)=>{if(n.consumable.test(t.viewItem,{name:t.viewItem.name}))if(pw.paragraphLikeElements.has(t.viewItem.name)){if(t.viewItem.isEmpty)return;const e=n.writer.createElement('paragraph'),o=n.splitToAllowedParent(e,t.modelCursor);if(!o)return;n.writer.insert(e,o.position);const{modelRange:i}=n.convertChildren(t.viewItem,Pg.createAt(e));t.modelRange=new Eg(Pg.createBefore(e),i.end),t.modelCursor=t.modelRange.end}else ur(t.viewItem,t.modelCursor,n.schema)&&(t=Object.assign(t,cr(t.viewItem,t.modelCursor,n)))},{priority:'low'}),n.upcastDispatcher.on('text',(e,t,n)=>{t.modelRange||ur(t.viewItem,t.modelCursor,n.schema)&&(t=Object.assign(t,cr(t.viewItem,t.modelCursor,n)))},{priority:'lowest'}),t.document.registerPostFixer((e)=>this._autoparagraphEmptyRoots(e)),e.on('dataReady',()=>{t.enqueueChange('transparent',(e)=>this._autoparagraphEmptyRoots(e))},{priority:'lowest'})}_autoparagraphEmptyRoots(e){const t=this.editor.model;for(const n of t.document.getRootNames()){const o=t.document.getRoot(n);if(o.isEmpty&&'$graveyard'!=o.rootName&&t.schema.checkChild(o,'paragraph'))return e.insertElement('paragraph',o),!0}}}pw.paragraphLikeElements=new Set(['blockquote','dd','div','dt','h1','h2','h3','h4','h5','h6','li','p','td']);class mw extends zk{constructor(e,t){super(e),this.modelElements=t}refresh(){const e=rr(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some((t)=>pr(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model,n=t.document,o=e.value;t.change((e)=>{const i=Array.from(n.selection.getSelectedBlocks()).filter((e)=>pr(e,o,t.schema));for(const t of i)t.is(o)||e.rename(t,o)})}}const gw='paragraph';class fw extends zb{constructor(e){super(e),e.config.define('heading',{options:[{model:'paragraph',title:'Paragraph',class:'ck-heading_paragraph'},{model:'heading1',view:'h2',title:'Heading 1',class:'ck-heading_heading1'},{model:'heading2',view:'h3',title:'Heading 2',class:'ck-heading_heading2'},{model:'heading3',view:'h4',title:'Heading 3',class:'ck-heading_heading3'}]})}static get requires(){return[pw]}init(){const e=this.editor,t=e.config.get('heading.options'),n=[];for(const o of t)o.model!==gw&&(e.model.schema.register(o.model,{inheritAllFrom:'$block'}),e.conversion.elementToElement(o),n.push(o.model));e.commands.add('heading',new mw(e,n))}afterInit(){const e=this.editor,t=e.commands.get('enter'),n=e.config.get('heading.options');t&&this.listenTo(t,'afterExecute',(t,o)=>{const i=e.model.document.selection.getFirstPosition().parent,r=n.some((e)=>i.is(e.model));r&&!i.is(gw)&&0===i.childCount&&o.writer.rename(i,gw)})}}class hw{constructor(e,t){t&&Kp(this,t),e&&this.set(e)}}h(hw,Xp);class bw extends Jb{constructor(e){super(e);const t=this.bindTemplate;this.set('isVisible',!1),this.children=this.createCollection(),this.setTemplate({tag:'div',attributes:{class:['ck','ck-reset','ck-dropdown__panel',t.if('isVisible','ck-dropdown__panel-visible')]},children:this.children,on:{selectstart:t.to((e)=>e.preventDefault())}})}focus(){this.children.length&&this.children.first.focus()}focusLast(){if(this.children.length){const e=this.children.last;'function'==typeof e.focusLast?e.focusLast():e.focus()}}}var kw=o(42),_w=o.n(kw);class ww extends Jb{constructor(e,t,n){super(e);const o=this.bindTemplate;this.buttonView=t,this.panelView=n,this.set('isOpen',!1),this.set('isEnabled',!0),this.focusTracker=new nk,this.keystrokes=new Nb,this.setTemplate({tag:'div',attributes:{class:['ck','ck-dropdown',o.if('isEnabled','ck-disabled',(e)=>!e)]},children:[t,n]}),t.extendTemplate({attributes:{class:['ck-dropdown__button']}})}render(){super.render(),this.listenTo(this.buttonView,'open',()=>{this.isOpen=!this.isOpen}),this.panelView.bind('isVisible').to(this,'isOpen'),this.keystrokes.listenTo(this.element),this.focusTracker.add(this.element);const e=(e,t)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,t())};this.keystrokes.set('arrowdown',(e,t)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,t())}),this.keystrokes.set('arrowright',(e,t)=>{this.isOpen&&t()}),this.keystrokes.set('arrowleft',e),this.keystrokes.set('esc',e)}focus(){this.buttonView.focus()}}var vw=o(44),yw=o.n(vw);class xw extends m_{constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0}}),this.delegate('execute').to(this,'open')}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new s_;return e.content=yw.a,e.extendTemplate({attributes:{class:'ck-dropdown__arrow'}}),e}}var Cw=o(45),Aw=o.n(Cw);class Tw extends Jb{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new nk,this.keystrokes=new Nb,this._focusCycler=new ok({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:'arrowup',focusNext:'arrowdown'}}),this.setTemplate({tag:'ul',attributes:{class:['ck','ck-reset','ck-list']},children:this.items})}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on('add',(e,t)=>{this.focusTracker.add(t.element)}),this.items.on('remove',(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class Pw extends Jb{constructor(){super(),this.set('tabindex',-1),this.keystrokes=new Nb;const e=this.bindTemplate;this.setTemplate({tag:'li',attributes:{class:['ck','ck-list__item',e.to('class'),e.if('isActive','ck-list__item_active'),e.if('isEnabled','ck-disabled',(e)=>!e)],style:e.to('style'),tabindex:e.to('tabindex')},children:[{text:e.to('label')}],on:{click:e.to((e)=>{this.isEnabled?this.fire('execute'):e.preventDefault()})}}),this.set('isEnabled',!0)}render(){super.render();const e=(e,t)=>{this.fire('execute'),t()};this.keystrokes.listenTo(this.element),this.keystrokes.set('Enter',e),this.keystrokes.set('Space',e)}focus(){this.element.focus()}}class Ew extends Jb{constructor(e){super(e),this.setTemplate({tag:'li',attributes:{class:['ck','ck-list__separator']}})}}var Sw=o(47),Ow=o.n(Sw),Rw=o(49),Iw=o.n(Rw),Vw=o(5),Fw=o.n(Vw);class Nw extends zb{init(){const e=this.editor,n=e.t,t=vr(e),o=n('m'),i=n('n');e.ui.componentFactory.add('heading',(n)=>{const r={},a=new lm,s=e.commands.get('heading'),l=e.commands.get('paragraph'),d=[s];for(const e of t){const t=new hw({label:e.title,class:e.class});'paragraph'===e.model?(t.bind('isActive').to(l,'value'),t.set('commandName','paragraph'),d.push(l)):(t.bind('isActive').to(s,'value',(t)=>t===e.model),t.set({commandName:'heading',commandValue:e.model})),a.add(t),r[e.model]=e.title}const c=gr(n);return hr(c,a),c.buttonView.set({isOn:!1,withText:!0,tooltip:i}),c.extendTemplate({attributes:{class:['ck-heading-dropdown']}}),c.bind('isEnabled').toMany(d,'isEnabled',(...e)=>e.some((e)=>e)),c.buttonView.bind('label').to(s,'value',l,'value',(e,t)=>{const n=e||t&&'paragraph';return r[n]?r[n]:o}),this.listenTo(c,'execute',(t)=>{e.execute(t.source.commandName,t.source.commandValue?{value:t.source.commandValue}:void 0),e.editing.view.focus()}),c})}}class Dw extends zb{static get requires(){return[fw,Nw]}static get pluginName(){return'Heading'}}class Bw{constructor(){this._stack=[]}add(e,t){const n=this._stack,o=n[0];this._insertDescriptor(e);const i=n[0];o===i||Ar(o,i)||this.fire('change:top',{oldDescriptor:o,newDescriptor:i,writer:t})}remove(e,t){const n=this._stack,o=n[0];this._removeDescriptor(e);const i=n[0];o===i||Ar(o,i)||this.fire('change:top',{oldDescriptor:o,newDescriptor:i,writer:t})}_insertDescriptor(e){const t=this._stack,n=t.findIndex((t)=>t.id===e.id);if(!Ar(e,t[n])){-1t.id===e);-1Lr(t)})),t.for('editingDowncast').add(Ct({model:'image',view:(e,t)=>Nr(Lr(t),t,o('f'))})),t.for('downcast').add(Cr('src')).add(Cr('alt')).add(xr()),t.for('upcast').add(an({view:{name:'img',attributes:{src:!0}},model:(e,t)=>t.createElement('image',{src:e.getAttribute('src')})})).add(ln({view:{name:'img',key:'alt'},model:'alt'})).add(ln({view:{name:'img',key:'srcset'},model:{key:'srcset',value:(e)=>{const t={data:e.getAttribute('srcset')};return e.hasAttribute('width')&&(t.width=e.getAttribute('width')),t}}})).add(yr())}}class Hw extends og{constructor(e){super(e),this.domEventType='mousedown'}onDomEvent(e){this.fire(e.type,e)}}var Uw=o(52),$w=o.n(Uw);const Kw=oe('Ctrl+A');class Gw extends zb{static get pluginName(){return'Widget'}init(){const e=this.editor.editing.view,t=e.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on('selection',(e,t,n)=>{this._clearPreviouslySelectedWidgets(n.writer);const o=n.writer,i=o.document.selection,r=i.getSelectedElement();for(const a of i.getRanges())for(const e of a){const t=e.item;t.is('element')&&Er(t)&&(o.addClass(jw,t),this._previouslySelected.add(t),t==r&&o.setSelection(i.getRanges(),{fake:!0,label:Ir(r)}))}},{priority:'low'}),e.addObserver(Hw),this.listenTo(t,'mousedown',(...e)=>this._onMousedown(...e)),this.listenTo(t,'keydown',(...e)=>this._onKeydown(...e),{priority:'high'}),this.listenTo(t,'delete',(e,t)=>{this._handleDelete('forward'==t.direction)&&(t.preventDefault(),e.stop())},{priority:'high'})}_onMousedown(e,t){const n=this.editor,o=n.editing.view,i=o.document;let r=t.target;if(!qr(r)&&(Er(r)||(r=r.findAncestor(Er),!!r))){t.preventDefault(),i.isFocused||o.focus();const e=n.editing.mapper.toModelElement(r);this._setSelectionOverElement(e)}}_onKeydown(e,t){const n=t.keyCode,o=n==km.delete||n==km.arrowdown||n==km.arrowright;let i=!1;zr(n)?i=this._handleArrowKeys(o):jr(t)?i=this._selectAllNestedEditableContent()||this._selectAllContent():n===km.enter&&(i=this._handleEnterKey(t.shiftKey)),i&&(t.preventDefault(),e.stop())}_handleDelete(e){if(this.editor.isReadOnly)return;const t=this.editor.model.document,n=t.selection;if(!n.isCollapsed)return;const o=this._getObjectElementNextToSelection(e);if(o)return this.editor.model.change((e)=>{for(let t=n.anchor.parent;t.isEmpty;){const n=t;t=n.parent,e.remove(n)}this._setSelectionOverElement(o)}),!0}_handleArrowKeys(e){const t=this.editor.model,n=t.schema,o=t.document,i=o.selection,r=i.getSelectedElement();if(r&&n.isObject(r)){const o=e?i.getLastPosition():i.getFirstPosition(),r=n.getNearestSelectionRange(o,e?'forward':'backward');return r&&t.change((e)=>{e.setSelection(r)}),!0}if(i.isCollapsed){const t=this._getObjectElementNextToSelection(e);if(t instanceof Cg&&n.isObject(t))return this._setSelectionOverElement(t),!0}}_handleEnterKey(e){const t=this.editor.model,n=t.document.selection,o=n.getSelectedElement();if(o&&t.schema.isObject(o))return t.change((t)=>{const n=t.createElement('paragraph');t.insert(n,o,e?'before':'after'),t.setSelection(n,'in')}),!0}_selectAllNestedEditableContent(){const e=this.editor.model,t=e.document.selection,n=e.schema.getLimitElement(t);return t.getFirstRange().root!=n&&(e.change((e)=>{e.setSelection(Eg.createIn(n))}),!0)}_selectAllContent(){const e=this.editor.model,t=this.editor.editing,n=t.view,o=n.document,i=o.selection,r=i.getSelectedElement();if(r&&Er(r)){const n=t.mapper.toModelElement(r.parent);return e.change((e)=>{e.setSelection(Eg.createIn(n))}),!0}return!1}_setSelectionOverElement(e){this.editor.model.change((t)=>{t.setSelection(Eg.createOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model,n=t.schema,o=t.document.selection,i=new Ig(o);t.modifySelection(i,{direction:e?'forward':'backward'});const r=e?i.focus.nodeBefore:i.focus.nodeAfter;return r instanceof Cg&&n.isObject(r)?r:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass(jw,t);this._previouslySelected.clear()}}class Jw extends zk{refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=Mr(e),this.value=!!(Mr(e)&&e.hasAttribute('alt'))&&e.getAttribute('alt')}execute(e){const t=this.editor.model,n=t.document.selection.getSelectedElement();t.change((t)=>{t.setAttribute('alt',e.newValue,n)})}}class Qw extends zb{init(){this.editor.commands.add('imageTextAlternative',new Jw(this.editor))}}class Yw extends Jb{constructor(e,t){super(e);const n=`ck-input-${r()}`;this.set('label'),this.set('value'),this.set('isReadOnly',!1),this.labelView=this._createLabelView(n),this.inputView=this._createInputView(t,n);const o=this.bindTemplate;this.setTemplate({tag:'div',attributes:{class:['ck','ck-labeled-input',o.if('isReadOnly','ck-disabled')]},children:[this.labelView,this.inputView]})}_createLabelView(e){const t=new Ak(this.locale);return t.for=e,t.bind('text').to(this,'label'),t}_createInputView(e,t){const n=new e(this.locale);return n.id=t,n.bind('value').to(this),n.bind('isReadOnly').to(this),n}select(){this.inputView.select()}focus(){this.inputView.focus()}}var Xw=o(54),Zw=o.n(Xw);class ev extends Jb{constructor(e){super(e),this.set('value'),this.set('id'),this.set('placeholder'),this.set('isReadOnly',!1);const t=this.bindTemplate;this.setTemplate({tag:'input',attributes:{type:'text',class:['ck','ck-input','ck-input-text'],id:t.to('id'),placeholder:t.to('placeholder'),readonly:t.to('isReadOnly')}})}render(){super.render();const e=(e)=>{this.element.value=e||0===e?e:''};e(this.value),this.on('change:value',(t,n,o)=>{e(o)})}select(){this.element.select()}focus(){this.element.focus()}}var tv=o(6),nv=o.n(tv),ov=o(7),iv=o.n(ov),rv=o(56),av=o.n(rv);class sv extends Jb{constructor(e){super(e);const n=this.locale.t;this.focusTracker=new nk,this.keystrokes=new Nb,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(n('ao'),nv.a,'ck-button-save'),this.saveButtonView.type='submit',this.cancelButtonView=this._createButton(n('ap'),iv.a,'ck-button-cancel','cancel'),this._focusables=new jb,this._focusCycler=new ok({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:'shift + tab',focusNext:'tab'}}),this.setTemplate({tag:'form',attributes:{class:['ck','ck-text-alternative-form'],tabindex:'-1'},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),this.keystrokes.listenTo(this.element),Wr({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach((e)=>{this._focusables.add(e),this.focusTracker.add(e.element)})}_createButton(e,t,n,o){const i=new m_(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i.extendTemplate({attributes:{class:n}}),o&&i.delegate('execute').to(this,o),i}_createLabeledInputView(){const e=this.locale.t,t=new Yw(this.locale,ev);return t.label=e('aq'),t.inputView.placeholder=e('aq'),t}}var lv=o(58),dv=o.n(lv);class cv extends zb{static get requires(){return[tk]}init(){this._createButton(),this._createForm()}_createButton(){const e=this.editor,n=e.t;e.ui.componentFactory.add('imageTextAlternative',(t)=>{const o=e.commands.get('imageTextAlternative'),i=new m_(t);return i.set({label:n('ak'),icon:dv.a,tooltip:!0}),i.bind('isEnabled').to(o,'isEnabled'),this.listenTo(i,'execute',()=>this._showForm()),i})}_createForm(){const e=this.editor,t=e.editing.view,n=t.document;this._balloon=this.editor.plugins.get('ContextualBalloon'),this._form=new sv(e.locale),this._form.render(),this.listenTo(this._form,'submit',()=>{e.execute('imageTextAlternative',{newValue:this._form.labeledInput.inputView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,'cancel',()=>{this._hideForm(!0)}),this._form.keystrokes.set('Esc',(e,t)=>{this._hideForm(!0),t()}),this.listenTo(t,'render',()=>{Br(n.selection)?this._isVisible&&Hr(e):this._hideForm(!0)}),mr({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._form.element],callback:()=>this._hideForm()})}_showForm(){if(!this._isVisible){const e=this.editor,t=e.commands.get('imageTextAlternative'),n=this._form.labeledInput;this._balloon.hasView(this._form)||this._balloon.add({view:this._form,position:Ur(e)}),n.value=n.inputView.element.value=t.value||'',this._form.labeledInput.select()}}_hideForm(e){this._isVisible&&(this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView==this._form}}class uv extends zb{static get requires(){return[Qw,cv]}static get pluginName(){return'ImageTextAlternative'}}var pv=o(59),mv=o.n(pv);class gv extends zb{static get requires(){return[Ww,Gw,uv]}static get pluginName(){return'Image'}}var fv=o(61),hv=o.n(fv);const bv=new WeakMap,kv=Symbol('imageCaption');class _v extends zb{init(){const e=this.editor,n=e.editing.view,o=e.model.schema,i=e.data,r=e.editing,a=e.t;o.register('caption',{allowIn:'image',allowContentOf:'$block',isLimit:!0}),e.model.document.registerPostFixer((e)=>this._insertMissingModelCaptionElement(e)),e.conversion.for('upcast').add(an({view:Yr,model:'caption'}));i.downcastDispatcher.on('insert:caption',Xr((e)=>e.createContainerElement('figcaption'),!1));const t=Jr(n,a('e'));r.downcastDispatcher.on('insert:caption',Xr(t)),r.downcastDispatcher.on('insert',this._fixCaptionVisibility((e)=>e.item),{priority:'high'}),r.downcastDispatcher.on('remove',this._fixCaptionVisibility((e)=>e.position.parent),{priority:'high'}),n.document.registerPostFixer((e)=>this._updateCaptionVisibility(e))}_updateCaptionVisibility(e){const t=this.editor.editing.mapper,n=this._lastSelectedCaption;let o;const i=this.editor.model.document.selection,r=i.getSelectedElement();if(r&&r.is('image')){const e=Qr(r);o=t.toViewElement(e)}const a=i.getFirstPosition(),s=ea(a.parent);if(s&&(o=t.toViewElement(s)),o)return n?n===o?na(o,e):(ta(n,e),this._lastSelectedCaption=o,na(o,e)):(this._lastSelectedCaption=o,na(o,e));if(n){const t=ta(n,e);return this._lastSelectedCaption=null,t}return!1}_fixCaptionVisibility(e){return(t,n,o)=>{const i=e(n),r=ea(i),a=this.editor.editing.mapper,s=o.writer;if(r){const e=a.toViewElement(r);e&&(r.childCount?s.removeClass('ck-hidden',e):s.addClass('ck-hidden',e))}}}_insertMissingModelCaptionElement(e){const t=this.editor.model,n=t.document.differ.getChanges();for(const t of n)if('insert'==t.type&&'image'==t.name){const n=t.position.nodeAfter;if(!Qr(n))return e.appendElement('caption',n),!0}}}var wv=o(63),vv=o.n(wv);class yv extends zb{static get requires(){return[_v]}static get pluginName(){return'ImageCaption'}}class xv extends zk{constructor(e,t){super(e),this._defaultStyle=!1,this.styles=t.reduce((e,t)=>(e[t.name]=t,t.isDefault&&(this._defaultStyle=t.name),e),{})}refresh(){const e=this.editor.model.document.selection.getSelectedElement();if(this.isEnabled=Mr(e),!e)this.value=!1;else if(e.hasAttribute('imageStyle')){const t=e.getAttribute('imageStyle');this.value=!!this.styles[t]&&t}else this.value=this._defaultStyle}execute(e){const t=e.value,n=this.editor.model,o=n.document.selection.getSelectedElement();n.change((e)=>{this.styles[t].isDefault?e.removeAttribute('imageStyle',o):e.setAttribute('imageStyle',t,o)})}}var Cv=o(65),Av=o.n(Cv),Tv=o(66),Pv=o.n(Tv),Ev=o(67),Sv=o.n(Ev),Ov=o(68),Rv=o.n(Ov);const Iv={full:{name:'full',title:'Full size image',icon:Av.a,isDefault:!0},side:{name:'side',title:'Side image',icon:Rv.a,className:'image-style-side'},alignLeft:{name:'alignLeft',title:'Left aligned image',icon:Pv.a,className:'image-style-align-left'},alignCenter:{name:'alignCenter',title:'Centered image',icon:Sv.a,className:'image-style-align-center'},alignRight:{name:'alignRight',title:'Right aligned image',icon:Rv.a,className:'image-style-align-right'}},Vv={full:Av.a,left:Pv.a,right:Rv.a,center:Sv.a};class Fv extends zb{static get requires(){return[Ww]}static get pluginName(){return'ImageStyleEditing'}init(){const e=this.editor,t=e.model.schema,n=e.data,o=e.editing;e.config.define('image.styles',['full','side']);const i=aa(e.config.get('image.styles'));t.extend('image',{allowAttributes:'imageStyle'});const r=oa(i);o.downcastDispatcher.on('attribute:imageStyle:image',r),n.downcastDispatcher.on('attribute:imageStyle:image',r),n.upcastDispatcher.on('element:figure',ia(i),{priority:'low'}),e.commands.add('imageStyle',new xv(e,i))}}var Nv=o(69),Dv=o.n(Nv);class Bv extends zb{get localizedDefaultStylesTitles(){const e=this.editor.t;return{"Full size image":e('h'),"Side image":e('i'),"Left aligned image":e('j'),"Centered image":e('k'),"Right aligned image":e('l')}}init(){const e=this.editor,t=e.config.get('image.styles'),n=la(aa(t),this.localizedDefaultStylesTitles);for(const e of n)this._createButton(e)}_createButton(e){const t=this.editor,n=`imageStyle:${e.name}`;t.ui.componentFactory.add(n,(n)=>{const o=t.commands.get('imageStyle'),i=new m_(n);return i.set({label:e.title,icon:e.icon,tooltip:!0}),i.bind('isEnabled').to(o,'isEnabled'),i.bind('isOn').to(o,'value',(t)=>t===e.name),this.listenTo(i,'execute',()=>t.execute('imageStyle',{value:e.name})),i})}}class Mv extends zb{static get requires(){return[Fv,Bv]}static get pluginName(){return'ImageStyle'}}class Lv extends zb{static get requires(){return[tk]}static get pluginName(){return'ImageToolbar'}init(){const e=this.editor,t=e.plugins.get('BalloonToolbar');t&&this.listenTo(t,'show',(t)=>{Br(e.editing.view.document.selection)&&t.stop()},{priority:'high'})}afterInit(){const e=this.editor,t=e.config.get('image.toolbar');t&&t.length&&(this._balloon=this.editor.plugins.get('ContextualBalloon'),this._toolbar=new sk,this._toolbar.fillFromConfig(t,e.ui.componentFactory),this.listenTo(e.editing.view,'render',()=>{this._checkIsVisible()}),this.listenTo(e.ui.focusTracker,'change:isFocused',()=>{this._checkIsVisible()},{priority:'low'}))}_checkIsVisible(){const e=this.editor;e.ui.focusTracker.isFocused?Br(e.editing.view.document.selection)?this._showToolbar():this._hideToolbar():this._hideToolbar()}_showToolbar(){const e=this.editor;this._isVisible?Hr(e):!this._balloon.hasView(this._toolbar)&&this._balloon.add({view:this._toolbar,position:Ur(e),balloonClassName:'ck-toolbar-container'})}_hideToolbar(){this._isVisible&&this._balloon.remove(this._toolbar)}get _isVisible(){return this._balloon.visibleView==this._toolbar}}class zv extends zk{refresh(){const e=this.editor.model,t=e.document;this.value=t.selection.getAttribute('linkHref'),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,'linkHref')}execute(e){const t=this.editor.model,n=t.document.selection;t.change((o)=>{if(n.isCollapsed){const t=n.getFirstPosition();if(n.hasAttribute('linkHref')){const t=da(n.getFirstPosition(),n.getAttribute('linkHref'));o.setAttribute('linkHref',e,t),o.setSelection(t)}else if(''!==e){const i=mt(n.getAttributes());i.set('linkHref',e);const r=o.createText(e,i);o.insert(r,t),o.setSelection(Eg.createOn(r))}}else{const i=t.schema.getValidRanges(n.getRanges(),'linkHref');for(const t of i)o.setAttribute('linkHref',e,t)}})}}class jv extends zk{refresh(){this.isEnabled=this.editor.model.document.selection.hasAttribute('linkHref')}execute(){const e=this.editor.model,t=e.document.selection;e.change((e)=>{const n=t.isCollapsed?[da(t.getFirstPosition(),t.getAttribute('linkHref'))]:t.getRanges();for(const t of n)e.removeAttribute('linkHref',t)})}}const qv=Symbol('linkElement'),Wv=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Hv=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;class Uv{constructor(e,t,n){this.model=e,this.attribute=n,this._modelSelection=e.document.selection,this._overrideUid=null,this._isNextGravityRestorationSkipped=!1,t.listenTo(this._modelSelection,'change:range',(e,t)=>this._isNextGravityRestorationSkipped?void(this._isNextGravityRestorationSkipped=!1):void(!this._isGravityOverridden||!t.directChange&&ha(this._modelSelection.getFirstPosition(),n)||this._restoreGravity()))}handleForwardMovement(e,t){const n=this.attribute;return this._isGravityOverridden||e.isAtStart&&this._hasSelectionAttribute?void 0:_a(e,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(t),this._removeSelectionAttribute(),!0):ba(e,n)?(this._preventCaretMovement(t),this._overrideGravity(),!0):ka(e,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(t),this._overrideGravity(),!0):void 0}handleBackwardMovement(e,t){const n=this.attribute;if(this._isGravityOverridden)return _a(e,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(t),this._restoreGravity(),this._removeSelectionAttribute(),!0):(this._preventCaretMovement(t),this._restoreGravity(),e.isAtStart&&this._removeSelectionAttribute(),!0);return _a(e,n)&&!this._hasSelectionAttribute?(this._preventCaretMovement(t),this._setSelectionAttributeFromTheNodeBefore(e),!0):e.isAtEnd&&ka(e,n)?this._hasSelectionAttribute?void(wa(e,n)&&(this._skipNextAutomaticGravityRestoration(),this._overrideGravity())):(this._preventCaretMovement(t),this._setSelectionAttributeFromTheNodeBefore(e),!0):e.isAtStart?this._hasSelectionAttribute?(this._removeSelectionAttribute(),this._preventCaretMovement(t),!0):void 0:void(wa(e,n)&&(this._skipNextAutomaticGravityRestoration(),this._overrideGravity()))}get _isGravityOverridden(){return!!this._overrideUid}get _hasSelectionAttribute(){return this._modelSelection.hasAttribute(this.attribute)}_overrideGravity(){this._overrideUid=this.model.change((e)=>e.overrideSelectionGravity())}_restoreGravity(){this.model.change((e)=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}_preventCaretMovement(e){e.preventDefault()}_removeSelectionAttribute(){this.model.change((e)=>{e.removeSelectionAttribute(this.attribute)})}_setSelectionAttributeFromTheNodeBefore(e){const t=this.attribute;this.model.change((n)=>{n.setSelectionAttribute(this.attribute,e.nodeBefore.getAttribute(t))})}_skipNextAutomaticGravityRestoration(){this._isNextGravityRestorationSkipped=!0}}var $v=o(71),Kv=o.n($v);const Gv='ck-link_selected';class Jv extends zb{init(){const e=this.editor;e.model.schema.extend('$text',{allowAttributes:'linkHref'}),e.conversion.for('dataDowncast').add(At({model:'linkHref',view:pa})),e.conversion.for('editingDowncast').add(At({model:'linkHref',view:(e,t)=>pa(ma(e),t)})),e.conversion.for('upcast').add(sn({view:{name:'a',attributes:{href:!0}},model:{key:'linkHref',value:(e)=>e.getAttribute('href')}})),e.commands.add('link',new zv(e)),e.commands.add('unlink',new jv(e)),fa(e.editing.view,e.model,this,'linkHref'),this._setupLinkHighlight()}_setupLinkHighlight(){const e=this.editor,t=e.editing.view,n=new Set;t.document.registerPostFixer((t)=>{const o=e.model.document.selection;if(o.hasAttribute('linkHref')){const i=da(o.getFirstPosition(),o.getAttribute('linkHref')),r=e.editing.mapper.toViewRange(i);for(const e of r.getItems())e.is('a')&&(t.addClass(Gv,e),n.add(e))}}),e.conversion.for('editingDowncast').add((e)=>{function o(){t.change((e)=>{for(const t of n.values())e.removeClass(Gv,t),n.delete(t)})}e.on('insert',o,{priority:'highest'}),e.on('remove',o,{priority:'highest'}),e.on('attribute',o,{priority:'highest'}),e.on('selection',o,{priority:'highest'})})}}class Qv extends og{constructor(e){super(e),this.domEventType='click'}onDomEvent(e){this.fire(e.type,e)}}var Yv=o(73),Xv=o.n(Yv);class Zv extends Jb{constructor(e){super(e);const n=e.t;this.focusTracker=new nk,this.keystrokes=new Nb,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n('ao'),nv.a,'ck-button-save'),this.saveButtonView.type='submit',this.cancelButtonView=this._createButton(n('ap'),iv.a,'ck-button-cancel','cancel'),this._focusables=new jb,this._focusCycler=new ok({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:'shift + tab',focusNext:'tab'}}),this.setTemplate({tag:'form',attributes:{class:['ck','ck-link-form'],tabindex:'-1'},children:[this.urlInputView,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),Wr({view:this});const e=[this.urlInputView,this.saveButtonView,this.cancelButtonView];e.forEach((e)=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const e=this.locale.t,t=new Yw(this.locale,ev);return t.label=e('ba'),t.inputView.placeholder='https://example.com',t}_createButton(e,t,n,o){const i=new m_(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i.extendTemplate({attributes:{class:n}}),o&&i.delegate('execute').to(this,o),i}}var ey=o(75),ty=o.n(ey),ny=o(76),oy=o.n(ny),iy=o(77),ry=o.n(iy);class ay extends Jb{constructor(e){super(e);const n=e.t;this.focusTracker=new nk,this.keystrokes=new Nb,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(n('aw'),ty.a,'unlink'),this.editButtonView=this._createButton(n('ax'),oy.a,'edit'),this.set('href'),this._focusables=new jb,this._focusCycler=new ok({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:'shift + tab',focusNext:'tab'}}),this.setTemplate({tag:'div',attributes:{class:['ck','ck-link-actions'],tabindex:'-1'},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render();const e=[this.previewButtonView,this.editButtonView,this.unlinkButtonView];e.forEach((e)=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createButton(e,t,n){const o=new m_(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.delegate('execute').to(this,n),o}_createPreviewButton(){const e=new m_(this.locale),n=this.bindTemplate,o=this.t;return e.set({withText:!0,tooltip:o('ay')}),e.extendTemplate({attributes:{class:['ck','ck-link-actions__preview'],href:n.to('href',(e)=>e&&ma(e)),target:'_blank'}}),e.bind('label').to(this,'href',(e)=>e||o('az')),e.bind('isEnabled').to(this,'href',(e)=>!!e),e.template.tag='a',e.template.eventListeners={},e}}var sy=o(79),ly=o.n(sy);const dy='Ctrl+K';class cy extends zb{static get requires(){return[tk]}init(){const e=this.editor;e.editing.view.addObserver(Qv),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=e.plugins.get(tk),this._createToolbarLinkButton(),this._enableUserBalloonInteractions()}_createActionsView(){const e=this.editor,t=new ay(e.locale),n=e.commands.get('link'),o=e.commands.get('unlink');return t.bind('href').to(n,'value'),t.editButtonView.bind('isEnabled').to(n),t.unlinkButtonView.bind('isEnabled').to(o),this.listenTo(t,'edit',()=>{this._addFormView()}),this.listenTo(t,'unlink',()=>{e.execute('unlink'),this._hideUI()}),t.keystrokes.set('Esc',(e,t)=>{this._hideUI(),t()}),t.keystrokes.set(dy,(e,t)=>{this._addFormView(),t()}),t}_createFormView(){const e=this.editor,t=new Zv(e.locale),n=e.commands.get('link');return t.urlInputView.bind('value').to(n,'value'),t.urlInputView.bind('isReadOnly').to(n,'isEnabled',(e)=>!e),t.saveButtonView.bind('isEnabled').to(n),this.listenTo(t,'submit',()=>{e.execute('link',t.urlInputView.inputView.element.value),this._removeFormView()}),this.listenTo(t,'cancel',()=>{this._removeFormView()}),t.keystrokes.set('Esc',(e,t)=>{this._removeFormView(),t()}),t}_createToolbarLinkButton(){const e=this.editor,n=e.commands.get('link'),o=e.t;e.keystrokes.set(dy,(e,t)=>{t(),n.isEnabled&&this._showUI()}),e.ui.componentFactory.add('link',(e)=>{const t=new m_(e);return t.isEnabled=!0,t.label=o('o'),t.icon=ly.a,t.keystroke=dy,t.tooltip=!0,t.bind('isEnabled').to(n,'isEnabled'),this.listenTo(t,'execute',()=>this._showUI()),t})}_enableUserBalloonInteractions(){const e=this.editor.editing.view.document;this.listenTo(e,'click',()=>{const e=this._getSelectedLinkElement();e&&this._showUI()}),this.editor.keystrokes.set('Tab',(e,t)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),t())},{priority:'high'}),this.editor.keystrokes.set('Esc',(e,t)=>{this._isUIVisible&&(this._hideUI(),t())}),mr({emitter:this.formView,activator:()=>this._isUIVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(!this._isFormInPanel){const e=this.editor,t=e.commands.get('link');this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.formView.urlInputView.select(),this.formView.urlInputView.inputView.element.value=t.value||''}}_removeFormView(){this._isFormInPanel&&(this._balloon.remove(this.formView),this.editor.editing.view.focus())}_showUI(){const e=this.editor,t=e.commands.get('link');t.isEnabled&&(this._getSelectedLinkElement()?this._areActionsVisible?this._addFormView():this._addActionsView():(this._addActionsView(),this._addFormView()),this._startUpdatingUIOnViewRender())}_hideUI(){if(this._isUIInPanel){const e=this.editor.editing.view;this.stopListening(e,'render'),this._removeFormView(),this._balloon.remove(this.actionsView),e.focus()}}_startUpdatingUIOnViewRender(){function e(){return o.document.selection.focus.getAncestors().reverse().find((e)=>e.is('element'))}const t=this.editor,n=t.editing,o=n.view;let i=this._getSelectedLinkElement(),r=e();this.listenTo(o,'render',()=>{const t=this._getSelectedLinkElement(),n=e();(!i||t)&&(i||n===r)?this._balloon.updatePosition(this._getBalloonPositionData()):this._hideUI(),i=t,r=n})}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){const e=this._balloon.visibleView;return e==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=e.document,n=this._getSelectedLinkElement(),o=n?e.domConverter.mapViewToDom(n):e.domConverter.viewRangeToDom(t.selection.getFirstRange());return{target:o}}_getSelectedLinkElement(){const e=this.editor.editing.view.document.selection;if(e.isCollapsed)return va(e.getFirstPosition());else{const t=e.getFirstRange().getTrimmed(),n=va(t.start),o=va(t.end);return n&&n==o?rm.createIn(n).getTrimmed().isEqual(t)?n:null:null}}}class uy extends zb{static get requires(){return[Jv,cy]}static get pluginName(){return'Link'}}class py extends zk{constructor(e,t){super(e),this.type='bulleted'==t?'bulleted':'numbered'}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=e.document,n=Array.from(t.selection.getSelectedBlocks()).filter((t)=>xa(t,e.schema)),o=!0===this.value;e.change((e)=>{if(o){let t=n[n.length-1].nextSibling,o=kd,i=[];for(;t&&'listItem'==t.name&&0!==t.getAttribute('listIndent');){const e=t.getAttribute('listIndent');e{const t=n[n.length-1];for(let o=t.nextSibling;o&&'listItem'==o.name&&o.getAttribute('listIndent')>t.getAttribute('listIndent');)n.push(o),o=o.nextSibling;0>this._indentBy&&(n=n.reverse());for(const t of n){const n=t.getAttribute('listIndent')+this._indentBy;0>n?e.rename(t,'paragraph'):e.setAttribute('listIndent',n,t)}})}_checkEnabled(){const e=rr(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is('listItem'))return!1;if(0=t;){if(o.getAttribute('listIndent')==t)return o.getAttribute('listType')==n;o=o.previousSibling}return!1}return!0}}class gy extends zb{static get requires(){return[pw]}init(){const e=this.editor;e.model.schema.register('listItem',{inheritAllFrom:'$block',allowAttributes:['listType','listIndent']});const t=e.data,n=e.editing;e.model.document.registerPostFixer((t)=>Ba(e.model,t)),n.mapper.registerViewToModelLength('li',Ua),t.mapper.registerViewToModelLength('li',Ua),n.mapper.on('modelToViewPosition',Na),n.mapper.on('viewToModelPosition',Da),t.mapper.on('modelToViewPosition',Na),n.downcastDispatcher.on('insert',Oa,{priority:'high'}),n.downcastDispatcher.on('insert:listItem',Ta),t.downcastDispatcher.on('insert',Oa,{priority:'high'}),t.downcastDispatcher.on('insert:listItem',Ta),n.downcastDispatcher.on('attribute:listType:listItem',Ea),t.downcastDispatcher.on('attribute:listType:listItem',Ea),n.downcastDispatcher.on('attribute:listIndent:listItem',Sa),t.downcastDispatcher.on('attribute:listIndent:listItem',Sa),n.downcastDispatcher.on('remove:listItem',Pa),n.downcastDispatcher.on('remove',Ra,{priority:'low'}),t.downcastDispatcher.on('remove:listItem',Pa),t.downcastDispatcher.on('remove',Ra,{priority:'low'}),t.upcastDispatcher.on('element:ul',Va,{priority:'high'}),t.upcastDispatcher.on('element:ol',Va,{priority:'high'}),t.upcastDispatcher.on('element:li',Fa,{priority:'high'}),t.upcastDispatcher.on('element:li',Ia),e.model.on('insertContent',Ma,{priority:'high'}),e.commands.add('numberedList',new py(e,'numbered')),e.commands.add('bulletedList',new py(e,'bulleted')),e.commands.add('indentList',new my(e,'forward')),e.commands.add('outdentList',new my(e,'backward'));const o=this.editor.editing.view.document;this.listenTo(o,'enter',(e,t)=>{const n=this.editor.model.document,o=n.selection.getLastPosition().parent;n.selection.isCollapsed&&'listItem'==o.name&&o.isEmpty&&(this.editor.execute('outdentList'),t.preventDefault(),e.stop())}),this.listenTo(o,'delete',(e,t)=>{if('backward'===t.direction){const n=this.editor.model.document.selection;if(n.isCollapsed){const o=n.getFirstPosition();if(o.isAtStart){const n=o.parent;if('listItem'===n.name){const o=n.previousSibling&&'listItem'===n.previousSibling.name;o||(this.editor.execute('outdentList'),t.preventDefault(),e.stop())}}}}},{priority:'high'});const i=(e)=>(t,n)=>{const o=this.editor.commands.get(e);o.isEnabled&&(this.editor.execute(e),n())};this.editor.keystrokes.set('Tab',i('indentList')),this.editor.keystrokes.set('Shift+Tab',i('outdentList'))}}var fy=o(80),hy=o.n(fy),by=o(81),ky=o.n(by);class _y extends zb{init(){const e=this.editor.t;this._addButton('numberedList',e('ah'),hy.a),this._addButton('bulletedList',e('ai'),ky.a)}_addButton(e,t,n){const o=this.editor;o.ui.componentFactory.add(e,(i)=>{const r=o.commands.get(e),a=new m_(i);return a.set({label:t,icon:n,tooltip:!0}),a.bind('isOn','isEnabled').to(r,'value','isEnabled'),this.listenTo(a,'execute',()=>o.execute(e)),a})}}class wy extends zb{static get requires(){return[gy,_y]}static get pluginName(){return'List'}}class vy{constructor(e,t={}){this.table=e,this.startRow=t.startRow||0,this.endRow='number'==typeof t.endRow?t.endRow:void 0,this.includeSpanned=!!t.includeSpanned,this.column='number'==typeof t.column?t.column:void 0,this._skipRows=new Set,this._row=0,this._column=0,this._cell=0,this._spannedCells=new Map}[Symbol.iterator](){return this}next(){const e=this.table.getChild(this._row);if(!e||this._isOverEndRow())return{done:!0};if(this._isSpanned(this._row,this._column)){const e=this._column,t=this._formatOutValue(void 0,e);this._column++;const n=!this.includeSpanned||this._shouldSkipRow()||this._shouldSkipColumn(e,1);return n?this.next():t}const t=e.getChild(this._cell);if(!t)return this._row++,this._column=0,this._cell=0,this.next();const n=parseInt(t.getAttribute('colspan')||1),o=parseInt(t.getAttribute('rowspan')||1);(1this.endRow}_formatOutValue(e,t,n=1,o=1){return{done:!1,value:{cell:e,row:this._row,column:t,rowspan:n,colspan:o,cellIndex:this._cell}}}_shouldSkipRow(){const e=this._rowthis.column;return!n&&!o}_isSpanned(e,t){if(!this._spannedCells.has(e))return!1;const n=this._spannedCells.get(e);return n.has(t)}_recordSpans(e,t,n,o){for(let i=t+1;i<=t+o-1;i++)this._markSpannedCell(e,i);for(let i=e+1;i{const i=o.createElement('table');return o.insert(i,e),ks(o,i,0,t,n),i})}insertRows(e,t={}){const n=this.editor.model,o=t.at||0,i=t.rows||1;n.change((t)=>{const n=e.getAttribute('headingRows')||0;if(n>o&&t.setAttribute('headingRows',n+i,e),0===o||o===e.childCount)return void ks(t,e,o,i,this.getColumns(e));const r=new vy(e,{endRow:o});let a=0;for(const{row:e,rowspan:n,colspan:s,cell:l}of r){eo&&t.setAttribute('rowspan',n+i,l),e===o&&(a+=s)}ks(t,e,o,i,a)})}insertColumns(e,t={}){const n=this.editor.model,o=t.at||0,i=t.columns||1;n.change((t)=>{const n=e.getAttribute('headingColumns');o{if(1t?t-1:r-1;_s(l,n,Pg.createAfter(e),s)}if(rt===e),d=s.filter(({cell:t,colspan:n,column:o})=>{return t!==e&&o===l||ol});for(const{cell:e,colspan:t}of d)n.setAttribute('colspan',t+a,e);const c={};1l&&Qa('headingColumns',u+a,o,n)}})}splitCellHorizontally(e,t=2){const n=this.editor.model,o=Ja(e),i=o.getChildIndex(e.parent),r=parseInt(e.getAttribute('rowspan')||1),a=parseInt(e.getAttribute('colspan')||1);n.change((n)=>{if(1t===e),u={};1=i+d&&e===c&&0==(t+i+d)%l){const e=Pg.createFromParentAndOffset(o.getChild(t),r);n.insertElement('tableCell',u,e)}}}if(ri){n.setAttribute('rowspan',o+s,t)}const d={};1i&&Qa('headingRows',c+s,o,n)}})}getColumns(e){const t=e.getChild(0);return[...t.getChildren()].reduce((e,t)=>{const n=parseInt(t.getAttribute('colspan')||1);return e+n},0)}}class Cy extends zk{refresh(){const e=this.editor.model,t=e.document.selection,n=e.schema,o=vs(t.getFirstPosition());this.isEnabled=n.checkChild(o,'table')}execute(e={}){const t=this.editor.model,n=t.document.selection,o=this.editor.plugins.get(xy),i=parseInt(e.rows)||2,r=parseInt(e.columns)||2,a=n.getFirstPosition(),s=a.parent===a.root,l=s?Pg.createAt(a):Pg.createAfter(a.parent);t.change((e)=>{const t=o.createTable(l,i,r);e.setSelection(Pg.createAt(t.getChild(0).getChild(0)))})}}class Ay extends zk{constructor(e,t={}){super(e),this.order=t.order||'below'}refresh(){const e=this.editor.model.document.selection,t=Ja(e.getFirstPosition());this.isEnabled=!!t}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get(xy),o=t.getFirstPosition().parent,i=Ja(t.getFirstPosition()),r=i.getChildIndex(o.parent),a='below'===this.order?r+1:r;n.insertRows(i,{rows:1,at:a})}}class Ty extends zk{constructor(e,t={}){super(e),this.order=t.order||'after'}refresh(){const e=this.editor.model.document.selection,t=Ja(e.getFirstPosition());this.isEnabled=!!t}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get(xy),o=Ja(t.getFirstPosition()),i=t.getFirstPosition().parent,{column:r}=n.getCellLocation(i),a='after'===this.order?r+1:r;n.insertColumns(o,{columns:1,at:a})}}class Py extends zk{constructor(e,t={}){super(e),this.direction=t.direction||'horizontally'}refresh(){const e=this.editor.model,t=e.document,n=t.selection.getFirstPosition().parent;this.isEnabled=n.is('tableCell')}execute(){const e=this.editor.model,t=e.document,n=t.selection,o=n.getFirstPosition(),i=o.parent,r='horizontally'===this.direction,a=this.editor.plugins.get(xy);r?a.splitCellHorizontally(i,2):a.splitCellVertically(i,2)}}class Ey extends zk{constructor(e,t){super(e),this.direction=t.direction,this.isHorizontal='right'==this.direction||'left'==this.direction}refresh(){const e=this._getMergeableCell();this.isEnabled=!!e,this.value=e}execute(){const e=this.editor.model,t=e.document,n=t.selection.getFirstPosition().parent,o=this.value,i=this.direction;e.change((e)=>{const t='right'==i||'down'==i,r=t?n:o,a=t?o:n;e.move(Eg.createIn(a),Pg.createAt(r,'end')),e.remove(a);const s=this.isHorizontal?'colspan':'rowspan',l=parseInt(n.getAttribute(s)||1),d=parseInt(o.getAttribute(s)||1);e.setAttribute(s,l+d,r),e.setSelection(Eg.createIn(r))})}_getMergeableCell(){const e=this.editor.model,t=e.document,n=t.selection.getFirstPosition().parent;if(n.is('tableCell')){const e=this.isHorizontal?ys(n,this.direction):xs(n,this.direction);if(e){const t=this.isHorizontal?'rowspan':'colspan',o=parseInt(n.getAttribute(t)||1),i=parseInt(e.getAttribute(t)||1);if(i===o)return e}}}}class Sy extends zk{refresh(){const e=this.editor.model,t=e.document,n=t.selection.getFirstPosition().parent;this.isEnabled=n.is('tableCell')&&1{s&&a<=s&&Qa('headingRows',s-1,r,e,0);const t=[...new vy(r,{endRow:a})],n=new Map;t.filter(({row:e,rowspan:t})=>e===a&&1n.set(e,{cell:t,rowspanToSet:o-1})),t.filter(({row:e,rowspan:t})=>e<=a-1&&e+t>a).forEach(({cell:t,rowspan:n})=>Qa('rowspan',n-1,t,e));const o=a+1,l=new vy(r,{includeSpanned:!0,startRow:o,endRow:o});let d;for(const{row:t,column:o,cell:i}of[...l])if(n.has(o)){const{cell:i,rowspanToSet:a}=n.get(o),s=d?Pg.createAfter(d):Pg.createAt(r.getChild(t));e.move(Eg.createOn(i),s),Qa('rowspan',a,i,e),d=i}else d=i;e.remove(i)})}}class Oy extends zk{refresh(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get(xy),o=t.getFirstPosition().parent;this.isEnabled=o.is('tableCell')&&1e.cell===o),c=d.column;e.change((e)=>{a&&s<=a&&e.setAttribute('headingColumns',a-1,r);for(const{cell:t,column:n,colspan:o}of l)n<=c&&1c?Qa('colspan',o-1,t,e):n===c&&e.remove(t)})}}class Ry extends zk{refresh(){const e=this.editor.model,t=e.document,n=t.selection,o=n.getFirstPosition(),i=Ja(o),r=!!i;this.isEnabled=r,this.value=r&&this._isInHeading(o.parent,i)}execute(){const e=this.editor.model,t=e.document,n=t.selection,o=n.getFirstPosition(),i=o.parent,r=i.parent,a=r.parent,s=a.getAttribute('headingRows')||0;let l=r.index;l+1!==s&&l++,e.change((e)=>{if(l){const t=Cs(a,l,s);for(const n of t)As(n,l,e)}Qa('headingRows',l,a,e,0)})}_isInHeading(e,t){const n=parseInt(t.getAttribute('headingRows')||0);return!!n&&e.parent.index{Qa('headingColumns',d,s,e,0)})}_isInHeading(e,t){const n=parseInt(t.getAttribute('headingColumns')||0),o=this.editor.plugins.get('TableUtils'),{column:i}=o.getCellLocation(e);return!!n&&ithis._handleTabOnSelectedTable(...e)),this.listenTo(e.editing.view.document,'keydown',(...e)=>this._handleTabInsideTable(...e))}static get requires(){return[xy]}_handleTabOnSelectedTable(e,t){const n=t.keyCode==km.tab;if(n&&!t.ctrlKey){const n=this.editor,o=n.model.document.selection;if(!o.isCollapsed&&1===o.rangeCount&&o.getFirstRange().isFlat){const i=o.getSelectedElement();if(!i||'table'!=i.name)return;e.stop(),t.preventDefault(),t.stopPropagation(),n.model.change((e)=>{e.setSelection(Eg.createIn(i.getChild(0).getChild(0)))})}}}_handleTabInsideTable(e,t){const n=t.keyCode==km.tab;if(!n||t.ctrlKey)return;const o=this.editor,i=o.model.document.selection,r=Ja(i.getFirstPosition());if(!r)return;t.preventDefault(),t.stopPropagation();const a=i.focus.parent,s=a.parent,l=r.getChildIndex(s),d=s.getChildIndex(a),c=!t.shiftKey,u=0===d;if(!c&&u&&0===l)return;const p=d===s.childCount-1,m=l===r.childCount-1;c&&m&&p&&o.plugins.get(xy).insertRows(r,{at:r.childCount});let g;if(c&&p){const e=r.getChild(l+1);g=e.getChild(0)}else if(!c&&u){const e=r.getChild(l-1);g=e.getChild(e.childCount-1)}else g=s.getChild(d+(c?1:-1));o.model.change((e)=>{e.setSelection(Eg.createIn(g))})}}var Dy=o(84),By=o.n(Dy);class My extends Jb{constructor(e){super(e);const t=this.bindTemplate;this.items=this.createCollection(),this.set('rows',0),this.set('columns',0),this.bind('label').to(this,'columns',this,'rows',(e,t)=>`${t} x ${e}`),this.setTemplate({tag:'div',attributes:{class:['ck']},children:[{tag:'div',attributes:{class:['ck-insert-table-dropdown__grid']},children:this.items},{tag:'div',attributes:{class:['ck-insert-table-dropdown__label']},children:[{text:t.to('label')}]}],on:{mousedown:t.to((e)=>{e.preventDefault()}),click:t.to(()=>{this.fire('execute')})}});for(let t=0;100>t;t++){const e=new Ly;e.on('over',()=>{const e=vd(t/10),n=t%10;this.set('rows',e+1),this.set('columns',n+1)}),this.items.add(e)}this.on('change:columns',()=>{this._highlightGridBoxes()}),this.on('change:rows',()=>{this._highlightGridBoxes()})}focus(){}focusLast(){}_highlightGridBoxes(){const e=this.rows,t=this.columns;this.items.map((n,o)=>{const i=vd(o/10);n.set('isOn',i{const o=e.commands.get('insertTable'),i=gr(t);i.bind('isEnabled').to(o),i.buttonView.set({icon:jy.a,label:n('p'),tooltip:!0});const r=new My(t);return i.panelView.children.add(r),r.delegate('execute').to(i),i.buttonView.on('open',()=>{r.rows=0,r.columns=0}),i.on('execute',()=>{e.execute('insertTable',{rows:r.rows,columns:r.columns}),e.editing.view.focus()}),i}),e.ui.componentFactory.add('tableColumn',(e)=>{const t=[{commandName:'setTableColumnHeader',label:n('q'),bindIsActive:!0},'|',{commandName:'insertTableColumnBefore',label:n('r')},{commandName:'insertTableColumnAfter',label:n('s')},{commandName:'removeTableColumn',label:n('t')}];return this._prepareDropdown(n('u'),Wy.a,t,e)}),e.ui.componentFactory.add('tableRow',(e)=>{const t=[{commandName:'setTableRowHeader',label:n('v'),bindIsActive:!0},'|',{commandName:'insertTableRowBelow',label:n('w')},{commandName:'insertTableRowAbove',label:n('x')},{commandName:'removeTableRow',label:n('y')}];return this._prepareDropdown(n('z'),Uy.a,t,e)}),e.ui.componentFactory.add('mergeTableCells',(e)=>{const t=[{commandName:'mergeTableCellUp',label:n('aa')},{commandName:'mergeTableCellRight',label:n('ab')},{commandName:'mergeTableCellDown',label:n('ac')},{commandName:'mergeTableCellLeft',label:n('ad')},'|',{commandName:'splitTableCellVertically',label:n('ae')},{commandName:'splitTableCellHorizontally',label:n('af')}];return this._prepareDropdown(n('ag'),Ky.a,t,e)})}_prepareDropdown(e,t,n,o){const i=this.editor,r=gr(o),a=[],s=new lm;for(const r of n)Ts(r,i,a,s);return hr(r,s),r.buttonView.set({label:e,icon:t,tooltip:!0}),r.bind('isEnabled').toMany(a,'isEnabled',(...e)=>e.some((e)=>e)),this.listenTo(r,'execute',(e)=>{i.execute(e.source.commandName),i.editing.view.focus()}),r}}var Jy=o(90),Qy=o.n(Jy);class Yy extends zb{static get requires(){return[Ny,Gy,Gw]}static get pluginName(){return'Table'}}class Xy extends zb{static get requires(){return[tk]}static get pluginName(){return'TableToolbar'}init(){const e=this.editor,t=e.plugins.get('BalloonToolbar');t&&this.listenTo(t,'show',(t)=>{Za(e.editing.view.document.selection)&&t.stop()},{priority:'high'})}afterInit(){const e=this.editor,t=e.config.get('table.toolbar');t&&t.length&&(this._balloon=this.editor.plugins.get('ContextualBalloon'),this._toolbar=new sk,this._toolbar.fillFromConfig(t,e.ui.componentFactory),this.listenTo(e.editing.view,'render',()=>{this._checkIsVisible()}),this.listenTo(e.ui.focusTracker,'change:isFocused',()=>{this._checkIsVisible()},{priority:'low'}))}_checkIsVisible(){const e=this.editor;if(!e.ui.focusTracker.isFocused)this._hideToolbar();else{const t=e.editing.view.document.selection;es(t)?this._showToolbar():this._hideToolbar()}}_showToolbar(){const e=this.editor;this._isVisible?Ps(e):!this._balloon.hasView(this._toolbar)&&this._balloon.add({view:this._toolbar,position:Es(e),balloonClassName:'ck-toolbar-container'})}_hideToolbar(){this._isVisible&&this._balloon.remove(this._toolbar)}get _isVisible(){return this._balloon.visibleView==this._toolbar}}class Zy{getHtml(e){const t=document.implementation.createHTMLDocument(''),n=t.createElement('div');return n.appendChild(e),n.innerHTML}}class ex{constructor(){this.parent=null}get index(){let e;if(!this.parent)return null;if(-1==(e=this.parent.getChildIndex(this)))throw new Fd('view-node-not-found-in-parent: The node\'s parent does not contain this node.');return e}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}get document(){return this.parent instanceof ex?this.parent.document:null}getPath(){const e=[];for(let t=this;t.parent;)e.unshift(t.index),t=t.parent;return e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];for(let n=e.includeSelf?this:this.parent;n;)t[e.parentFirst?'push':'unshift'](n),n=n.parent;return t}getCommonAncestor(e,t={}){const n=this.getAncestors(t),o=e.getAncestors(t);let r=0;for(;n[r]==o[r]&&n[r];)r++;return 0==r?null:n[r-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),n=e.getPath(),o=T(t,n);return!('prefix'!==o)||'extension'!==o&&t[o]t||t>e.data.length)throw new Fd('view-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.');if(0>n||t+n>e.data.length)throw new Fd('view-textproxy-wrong-length: Given length value is incorrect.');this.data=e.data.substring(t,t+n),this.offsetInText=t}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(e){return'textProxy'==e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];for(let n=e.includeSelf?this.textNode:this.parent;null!==n;)t[e.parentFirst?'push':'unshift'](n),n=n.parent;return t}}class ox{constructor(...e){this._patterns=[],this.add(...e)}add(...e){for(let t of e)('string'==typeof t||t instanceof RegExp)&&(t={name:t}),t.classes&&('string'==typeof t.classes||t.classes instanceof RegExp)&&(t.classes=[t.classes]),this._patterns.push(t)}match(...e){for(const t of e)for(const e of this._patterns){const n=Ss(t,e);if(n)return{element:t,pattern:e,match:n}}return null}matchAll(...e){const t=[];for(const n of e)for(const e of this._patterns){const o=Ss(n,e);o&&t.push({element:n,pattern:e,match:o})}return 0`${e[0]}:${e[1]}`).sort().join(';'),n=Array.from(this._attrs).map((e)=>`${e[0]}="${e[1]}"`).sort().join(' ');return this.name+(''==e?'':` class="${e}"`)+(''==t?'':` style="${t}"`)+(''==n?'':` ${n}`)}_clone(e=!1){const t=[];if(e)for(const n of this.getChildren())t.push(n._clone(e));const n=new this.constructor(this.name,this._attrs,t);return n._classes=new Set(this._classes),n._styles=new Map(this._styles),n._customProperties=new Map(this._customProperties),n.getFillerOffset=this.getFillerOffset,n}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange('children',this);let n=0;const o=Bs(t);for(const i of o)null!==i.parent&&i._remove(),i.parent=this,this._children.splice(e,0,i),e++,n++;return n}_removeChildren(e,t=1){this._fireChange('children',this);for(let n=e;nthis._classes.add(e))}_removeClass(e){this._fireChange('attributes',this),e=Array.isArray(e)?e:[e],e.forEach((e)=>this._classes.delete(e))}_setStyle(e,t){if(this._fireChange('attributes',this),Rd(e)){const t=Object.keys(e);for(const n of t)this._styles.set(n,e[n])}else this._styles.set(e,t)}_removeStyle(e){this._fireChange('attributes',this),e=Array.isArray(e)?e:[e],e.forEach((e)=>this._styles.delete(e))}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}class rx{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new Fd('view-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.');if(e.direction&&'forward'!=e.direction&&'backward'!=e.direction)throw new Fd('view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.',{direction:e.direction});this.boundaries=e.boundaries||null,this.position=e.startPosition?dx.createFromPosition(e.startPosition):dx.createFromPosition(e.boundaries['backward'==e.direction?'end':'start']),this.direction=e.direction||'forward',this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(e){let t,n,o;do o=this.position,({done:t,value:n}=this.next());while(!t&&e(n));t||(this.position=o)}next(){return'forward'==this.direction?this._next():this._previous()}_next(){let e=dx.createFromPosition(this.position);const t=this.position,n=e.parent;if(null===n.parent&&e.offset===n.childCount)return{done:!0};if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0};let o;if(n instanceof tx){if(e.isAtEnd)return this.position=dx.createAfter(n),this._next();o=n.data[e.offset]}else o=n.getChild(e.offset);if(o instanceof ix)return this.shallow?e.offset++:e=new dx(o,0),this.position=e,this._formatReturnValue('elementStart',o,t,e,1);if(!(o instanceof tx)){if('string'==typeof o){let o;if(this.singleCharacters)o=1;else{const t=n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length;o=t-e.offset}const i=new nx(n,e.offset,o);return e.offset+=o,this.position=e,this._formatReturnValue('text',i,t,e,o)}return e=dx.createAfter(n),this.position=e,this.ignoreElementEnd?this._next():this._formatReturnValue('elementEnd',n,t,e)}if(this.singleCharacters)return e=new dx(o,0),this.position=e,this._next();else{let n=o.data.length,i;return o==this._boundaryEndParent?(n=this.boundaries.end.offset,i=new nx(o,0,n),e=dx.createAfter(i)):(i=new nx(o,0,o.data.length),e.offset++),this.position=e,this._formatReturnValue('text',i,t,e,n)}}_previous(){let e=dx.createFromPosition(this.position);const t=this.position,n=e.parent;if(null===n.parent&&0===e.offset)return{done:!0};if(n==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0};let o;if(n instanceof tx){if(e.isAtStart)return this.position=dx.createBefore(n),this._previous();o=n.data[e.offset-1]}else o=n.getChild(e.offset-1);if(o instanceof ix)return this.shallow?(e.offset--,this.position=e,this._formatReturnValue('elementStart',o,t,e,1)):(e=new dx(o,o.childCount),this.position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue('elementEnd',o,t,e));if(!(o instanceof tx)){if('string'==typeof o){let o;if(!this.singleCharacters){const t=n===this._boundaryStartParent?this.boundaries.start.offset:0;o=e.offset-t}else o=1;e.offset-=o;const i=new nx(n,e.offset,o);return this.position=e,this._formatReturnValue('text',i,t,e,o)}return e=dx.createBefore(n),this.position=e,this._formatReturnValue('elementStart',n,t,e,1)}if(this.singleCharacters)return e=new dx(o,o.data.length),this.position=e,this._previous();else{let n=o.data.length,i;if(o==this._boundaryStartParent){const t=this.boundaries.start.offset;i=new nx(o,t,o.data.length-t),n=i.data.length,e=dx.createBefore(i)}else i=new nx(o,0,o.data.length),e.offset--;return this.position=e,this._formatReturnValue('text',i,t,e,n)}}_formatReturnValue(e,t,n,o,i){return t instanceof nx&&(t.offsetInText+t.data.length==t.textNode.data.length&&('forward'!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=dx.createAfter(t.textNode):(o=dx.createAfter(t.textNode),this.position=o)),0===t.offsetInText&&('backward'!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=dx.createBefore(t.textNode):(o=dx.createBefore(t.textNode),this.position=o))),{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:o,length:i}}}}class ax extends ix{constructor(e,t,n){super(e,t,n),this.getFillerOffset=Ms}is(e,t=null){return t?'containerElement'==e&&t==this.name||super.is(e,t):'containerElement'==e||super.is(e)}}const sx=Symbol('document');class lx extends ax{constructor(e,t,n){super(e,t,n),this.set('isReadOnly',!1),this.set('isFocused',!1)}get document(){return this.getCustomProperty(sx)}set _document(e){if(this.getCustomProperty(sx))throw new Fd('view-editableelement-document-already-set: View document is already set.');this._setCustomProperty(sx,e),this.bind('isReadOnly').to(e),this.bind('isFocused').to(e,'isFocused',(t)=>t&&e.selection.editableElement==this),this.listenTo(e.selection,'change',()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this})}}h(lx,Xp);class dx{constructor(e,t){this.parent=e,this.offset=t}get nodeAfter(){return this.parent.is('text')?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is('text')?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){const e=this.parent.is('text')?this.parent.data.length:this.parent.childCount;return this.offset===e}get root(){return this.parent.root}get editableElement(){let e=this.parent;for(;!(e instanceof lx);)if(e.parent)e=e.parent;else return null;return e}getShiftedBy(e){const t=dx.createFromPosition(this),n=t.offset+e;return t.offset=0>n?0:n,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const n=new rx(t);return n.skip(e),n.position}getAncestors(){return this.parent.is('documentFragment')?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){const t=this.getAncestors(),n=e.getAncestors();let o=0;for(;t[o]==n[o]&&t[o];)o++;return 0==o?null:t[o-1]}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return'before'==this.compareWith(e)}isAfter(e){return'after'==this.compareWith(e)}compareWith(e){if(this.root!==e.root)return'different';if(this.isEqual(e))return'same';const t=this.parent.is('node')?this.parent.getPath():[],n=e.parent.is('node')?e.parent.getPath():[];t.push(this.offset),n.push(e.offset);const o=T(t,n);return'prefix'===o?'before':'extension'===o?'after':t[o]{const t=e.createElement('br');return t.dataset.ckeFiller=!0,t},fx=(e)=>e.createTextNode('\xA0'),hx=7;let bx='';for(let e=0;eo?0:o),new dx(n,o)):null}if(0===t){const t=this.mapDomToView(e);if(t)return new dx(t,0)}else{const n=e.childNodes[t-1],o=Oe(n)?this.findCorrespondingViewText(n):this.mapDomToView(n);if(o&&o.parent)return new dx(o.parent,o.index+1)}return null}mapDomToView(e){return this.getParentUIElement(e)||this._domToViewMapping.get(e)}findCorrespondingViewText(e){if(qs(e))return null;const t=this.getParentUIElement(e);if(t)return t;const n=e.previousSibling;if(n){if(!this.isElement(n))return null;const e=this.mapDomToView(n);if(e){const t=e.nextSibling;return t instanceof tx?e.nextSibling:null}}else{const t=this.mapDomToView(e.parentNode);if(t){const e=t.getChild(0);return e instanceof tx?e:null}}return null}mapViewToDom(e){return this._viewToDomMapping.get(e)}findCorrespondingDomText(e){const t=e.previousSibling;return t&&this.mapViewToDom(t)?this.mapViewToDom(t).nextSibling:!t&&e.parent&&this.mapViewToDom(e.parent)?this.mapViewToDom(e.parent).childNodes[0]:null}focus(e){const t=this.mapViewToDom(e);if(t&&t.ownerDocument.activeElement!==t){const{scrollX:e,scrollY:n}=Sm.window,o=[];$s(t,(e)=>{const{scrollLeft:t,scrollTop:n}=e;o.push([t,n])}),t.focus(),$s(t,(e)=>{const[t,n]=o.shift();e.scrollLeft=t,e.scrollTop=n}),Sm.window.scrollTo(e,n)}}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isComment(e){return e&&e.nodeType==Node.COMMENT_NODE}isDomSelectionBackward(e){if(e.isCollapsed)return!1;const t=document.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset);const n=t.collapsed;return t.detach(),n}getParentUIElement(e){const t=je(e);for(t.pop();t.length;){const e=t.pop(),n=this._domToViewMapping.get(e);if(n&&n.is('uiElement'))return n}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}_isDomSelectionPositionCorrect(e,t){if(Oe(e)&&js(e)&&tthis.preElements.includes(e.name)))return t;if(' '==t.charAt(0)){const n=this._getTouchingViewTextNode(e,!1),o=n&&this._nodeEndsWithSpace(n);(o||!n)&&(t='\xA0'+t.substr(1))}if(' '==t.charAt(t.length-1)){const n=this._getTouchingViewTextNode(e,!0);n||(t=t.substr(0,t.length-1)+'\xA0')}return t.replace(/ {2}/g,' \xA0')}_nodeEndsWithSpace(e){if(e.getAncestors().some((e)=>this.preElements.includes(e.name)))return!1;const t=this._processDataFromViewText(e);return' '==t.charAt(t.length-1)}_processDataFromDomText(e){let t=e.data;if(Us(e,this.preElements))return Ws(e);t=t.replace(/[ \n\t\r]{1,}/g,' ');const n=this._getTouchingDomTextNode(e,!1),o=this._getTouchingDomTextNode(e,!0);return(!n||/[^\S\u00A0]/.test(n.data.charAt(n.data.length-1)))&&(t=t.replace(/^ /,'')),o||js(e)||(t=t.replace(/ $/,'')),t=Ws(new Text(t)),t=t.replace(/ \u00A0/g,' '),(!n||/[^\S\u00A0]/.test(n.data.charAt(n.data.length-1)))&&(t=t.replace(/^\u00A0/,' ')),o&&'\xA0'!=o.data.charAt(0)||(t=t.replace(/\u00A0( *)$/,' $1')),t}_getTouchingViewTextNode(e,t){const n=new rx({startPosition:t?dx.createAfter(e):dx.createBefore(e),direction:t?'forward':'backward'});for(const o of n){if(o.item.is('containerElement'))return null;if(o.item.is('textProxy'))return o.item}return null}_getTouchingDomTextNode(e,t){if(!e.parentNode)return null;const n=t?'nextNode':'previousNode',o=e.ownerDocument,i=je(e)[0],r=o.createTreeWalker(i,NodeFilter.SHOW_TEXT);r.currentNode=e;const a=r[n]();if(null!==a){const t=qe(e,a);if(t&&!Us(e,this.blockElements,t)&&!Us(a,this.blockElements,t))return a}return null}}class wx{constructor(){this._domParser=new DOMParser,this._domConverter=new _x({blockFiller:fx}),this._htmlWriter=new Zy}toData(e){const t=this._domConverter.viewToDom(e,document);return this._htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this._domConverter.domToView(t)}_toDom(e){const t=this._domParser.parseFromString(e,'text/html'),n=t.createDocumentFragment(),o=t.body.childNodes;for(;0o){var i=ol(1==o?'=':'-',e.length);return'\n\n'+e+'\n'+i+'\n\n'}return'\n\n'+ol('#',o)+' '+e+'\n\n'}},Ex.blockquote={filter:'blockquote',replacement:function(e){return e=e.replace(/^\n+|\n+$/g,''),e=e.replace(/^/gm,'> '),'\n\n'+e+'\n\n'}},Ex.list={filter:['ul','ol'],replacement:function(e,t){var n=t.parentNode;return'LI'===n.nodeName&&n.lastElementChild===t?'\n'+e:'\n\n'+e+'\n\n'}},Ex.listItem={filter:'li',replacement:function(e,t,n){e=e.replace(/^\n+/,'').replace(/\n+$/,'\n').replace(/\n/gm,'\n ');var o=n.bulletListMarker+' ',i=t.parentNode;if('OL'===i.nodeName){var r=i.getAttribute('start'),a=Array.prototype.indexOf.call(i.children,t);o=(r?+r+a:a+1)+'. '}return o+e+(t.nextSibling&&!/\n$/.test(e)?'\n':'')}},Ex.indentedCodeBlock={filter:function(e,t){return'indented'===t.codeBlockStyle&&'PRE'===e.nodeName&&e.firstChild&&'CODE'===e.firstChild.nodeName},replacement:function(e,t){return'\n\n '+t.firstChild.textContent.replace(/\n/g,'\n ')+'\n\n'}},Ex.fencedCodeBlock={filter:function(e,t){return'fenced'===t.codeBlockStyle&&'PRE'===e.nodeName&&e.firstChild&&'CODE'===e.firstChild.nodeName},replacement:function(e,t,n){var o=t.firstChild.className||'',i=(o.match(/language-(\S+)/)||[null,''])[1];return'\n\n'+n.fence+i+'\n'+t.firstChild.textContent+'\n'+n.fence+'\n\n'}},Ex.horizontalRule={filter:'hr',replacement:function(e,t,n){return'\n\n'+n.hr+'\n\n'}},Ex.inlineLink={filter:function(e,t){return'inlined'===t.linkStyle&&'A'===e.nodeName&&e.getAttribute('href')},replacement:function(e,t){var n=t.getAttribute('href'),o=t.title?' "'+t.title+'"':'';return'['+e+']('+n+o+')'}},Ex.referenceLink={filter:function(e,t){return'referenced'===t.linkStyle&&'A'===e.nodeName&&e.getAttribute('href')},replacement:function(e,t,n){var o=t.getAttribute('href'),i=t.title?' "'+t.title+'"':'',r,a;switch(n.linkReferenceStyle){case'collapsed':r='['+e+'][]',a='['+e+']: '+o+i;break;case'shortcut':r='['+e+']',a='['+e+']: '+o+i;break;default:var s=this.references.length+1;r='['+e+']['+s+']',a='['+s+']: '+o+i;}return this.references.push(a),r},references:[],append:function(){var e='';return this.references.length&&(e='\n\n'+this.references.join('\n')+'\n\n',this.references=[]),e}},Ex.emphasis={filter:['em','i'],replacement:function(e,t,n){return e.trim()?n.emDelimiter+e+n.emDelimiter:''}},Ex.strong={filter:['strong','b'],replacement:function(e,t,n){return e.trim()?n.strongDelimiter+e+n.strongDelimiter:''}},Ex.code={filter:function(e){var t=e.previousSibling||e.nextSibling,n='PRE'===e.parentNode.nodeName&&!t;return'CODE'===e.nodeName&&!n},replacement:function(e){if(!e.trim())return'';var t='`',n='',o='',i=e.match(/`+/gm);if(i)for(/^`/.test(e)&&(n=' '),/`$/.test(e)&&(o=' ');-1!==i.indexOf(t);)t+='`';return t+n+e+o+t}},Ex.image={filter:'img',replacement:function(e,t){var n=t.alt||'',o=t.getAttribute('src')||'',i=t.title||'',r=i?' "'+i+'"':'';return o?'!['+n+']('+o+r+')':''}},sl.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return''}})},forNode:function(e){if(e.isBlank)return this.blankRule;var t;return(t=ll(this.array,e,this.options))?t:(t=ll(this._keep,e,this.options))?t:(t=ll(this._remove,e,this.options))?t:this.defaultRule},forEach:function(e){for(var t=0;t /gm,'$1\\> ').replace(/\*+(?![*\s\W]).+?\*+/g,function(e){return e.replace(/\*/g,'\\*')}).replace(/_+(?![_\s\W]).+?_+/g,function(e){return e.replace(/_/g,'\\_')}).replace(/`+(?![`\s\W]).+?`+/g,function(e){return e.replace(/`/g,'\\`')}).replace(/[\[\]]/g,'\\$&')}};var Nx=o(93),Dx=o.n(Nx);Tl.prototype.code=function(e,t,n){if(this.options.highlight){const o=this.options.highlight(e,t);null!==o&&o!==e&&(n=!0,e=o)}if(!t)return`
    ${n?e:Pl(e,!0)}
    `;const o=this.options.langPrefix+Pl(t,!0);return`
    ${n?e:Pl(e,!0)}
    `},Tl.prototype.blockquote=function(e){return`
    ${e}
    `},Tl.prototype.html=function(e){return e},Tl.prototype.heading=function(e,t){return`${e}`},Tl.prototype.hr=function(){return this.options.xhtml?'
    ':'
    '},Tl.prototype.list=function(e,t){const n=t?'ol':'ul';return`<${n}>${e}`},Tl.prototype.listitem=function(e){return`
  • ${e}
  • `},Tl.prototype.paragraph=function(e){return`

    ${e}

    `},Tl.prototype.table=function(e,t){return`${e}${t}
    `},Tl.prototype.tablerow=function(e){return''+e+''},Tl.prototype.tablecell=function(e,t){const n=t.header?'th':'td',o=t.align?`<${n} align="${t.align}">`:`<${n}>`;return o+e+``},Tl.prototype.strong=function(e){return`${e}`},Tl.prototype.em=function(e){return`${e}`},Tl.prototype.codespan=function(e){return`${e.trim()}`},Tl.prototype.br=function(){return this.options.xhtml?'
    ':'
    '},Tl.prototype.del=function(e){return`${e}`},Tl.prototype.link=function(e,t,n){if(this.options.sanitize){let t;try{t=decodeURIComponent(El(e)).replace(/[^\w:]/g,'').toLowerCase()}catch(t){return''}if(0===t.indexOf('javascript:')||0===t.indexOf('vbscript:'))return''}let o='',o},Tl.prototype.image=function(e,t,n){let o=''+n+'':'>',o},Tl.prototype.text=function(e){return e};class Bx{constructor(){this._htmlDP=new wx,this._domConverter=new _x}toView(e){const t=Dx.a.parse(e,{gfm:!0,breaks:!0,tables:!0,xhtml:!0,renderer:new Tl});return this._htmlDP.toView(t)}toData(e){const t=this._domConverter.viewToDom(e,document),n=new _l({headingStyle:'atx'});return n.use(tl),n.keep(['macro']),n.turndown(t).replace(/().+?(<\/macro>)/g,'$1$2')}}var Mx=o(94),Lx=o.n(Mx);class zx extends zb{static get pluginName(){return'OPHelpLinkPlugin'}init(){const e=this.editor,t=e.model,n=e.config.get('openProject.helpURL');e.ui.componentFactory.add('openProjectShowFormattingHelp',(e)=>{const t=new m_(e);return t.set({label:window.I18n.t('js.inplace.link_formatting_help'),icon:Lx.a,tooltip:!0}),t.on('execute',()=>{window.open(n,'_blank')}),t})}}var jx=o(95),qx=o.n(jx);const Wx=Symbol('isOPCodeBlock');class Hx extends og{constructor(e){super(e),this.domEventType='dblclick'}onDomEvent(e){this.fire(e.type,e)}}class Ux extends zb{static get pluginName(){return'CodeBlockEditing'}init(){const e=this.editor,t=e.model.schema,n=e.conversion,o=e.editing.view,i=o.document,r=e.config.get('openProject.pluginContext');t.register('codeblock',{isObject:!0,isBlock:!0,allowContentOf:'$block',allowWhere:['$root','$block'],allowIn:['$root'],allowAttributes:['opCodeblockLanguage','opCodeblockContent']}),n.for('upcast').add(Dl()),n.for('editingDowncast').add(Ct({model:'codeblock',view:(e,t)=>Il(e,t,'Code block')})).add(Bl()),n.for('dataDowncast').add(Nl()),o.addObserver(Hx),this.listenTo(i,'dblclick',(t,n)=>{let o=n.target,i=n.domEvent;if(i.shiftKey||i.altKey||i.metaKey)return;if(!Ol(o)&&(o=o.findAncestor(Ol),!o))return;n.preventDefault(),n.stopPropagation();const a=e.editing.mapper.toModelElement(o),s=r.services.macros,l=a.getAttribute('opCodeblockLanguage'),d=a.getAttribute('opCodeblockContent');s.editCodeBlock(d,l).then((t)=>e.model.change((e)=>{e.setAttribute('opCodeblockLanguage',t.languageClass,a),e.setAttribute('opCodeblockContent',t.content,a)}))}),e.ui.componentFactory.add('insertCodeBlock',(t)=>{const n=new m_(t);return n.set({label:window.I18n.t('js.editor.macro.code_block.button'),icon:qx.a,tooltip:!0}),n.on('execute',()=>{r.services.macros.editCodeBlock().then((t)=>e.model.change((n)=>{const o=n.createElement('codeblock');n.setAttribute('opCodeblockLanguage',t.languageClass,o),n.setAttribute('opCodeblockContent',t.content,o),e.model.insertContent(o,e.model.document.selection)}))}),n})}}var $x=o(96),Kx=o.n($x);const Gx='ck-toolbar-container';class Jx extends zb{static get requires(){return[tk]}static get pluginName(){return'CodeBlockToolbar'}init(){const e=this.editor,t=this.editor.model,n=e.config.get('openProject.pluginContext');Ml(e,'opEditCodeBlock',(e)=>{const o=n.services.macros,i=e.getAttribute('opCodeblockLanguage'),r=e.getAttribute('opCodeblockContent');o.editCodeBlock(r,i).then((n)=>t.change((t)=>{t.setAttribute('opCodeblockLanguage',n.languageClass,e),t.setAttribute('opCodeblockContent',n.content,e)}))})}afterInit(){Ll(this,this.editor,'OPCodeBlock',Rl)}}class Qx extends zb{static get pluginName(){return'CodeBlock'}static get requires(){return[Ux,Jx]}}var Yx=o(97),Xx=o.n(Yx);class Zx extends Jb{constructor(e){super(e),this.buttonView=new m_(e),this._fileInputView=new eC(e),this._fileInputView.bind('acceptedType').to(this),this._fileInputView.bind('allowMultipleFiles').to(this),this._fileInputView.delegate('done').to(this),this.setTemplate({tag:'span',attributes:{class:'ck-file-dialog-button'},children:[this.buttonView,this._fileInputView]}),this.buttonView.on('execute',()=>{this._fileInputView.open()})}focus(){this.buttonView.focus()}}class eC extends Jb{constructor(e){super(e),this.set('acceptedType'),this.set('allowMultipleFiles',!1);const t=this.bindTemplate;this.setTemplate({tag:'input',attributes:{class:['ck-hidden'],type:'file',tabindex:'-1',accept:t.to('acceptedType'),multiple:t.to('allowMultipleFiles')},on:{change:t.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire('done',this.element.files),this.element.value=''})}})}open(){this.element.click()}}class tC extends zb{static get pluginName(){return'OPPreview'}init(){const e=this.editor;let t=!1,n=null,o=[];e.ui.componentFactory.add('preview',(i)=>{const r=new m_(i);r.set({label:this.label,icon:Xx.a,tooltip:!0});let a=function(){return e.ui.view.toolbar?e.ui.view.toolbar.items._items:[]},s=function(){jQuery.each(a(),function(e,t){let n=t;t instanceof Zx?n=t.buttonView:(t===r||!t.hasOwnProperty('isEnabled'))&&(n=null),n&&(n.isEnabled?n.isEnabled=!1:o.push(n))})},l=function(){jQuery.each(a(),function(e,t){let n=t;t instanceof Zx&&(n=t.buttonView),0>o.indexOf(n)&&(n.isEnabled=!0)}),o.length=0},d=function(t){let o=jQuery(e.element),i=o.siblings('.ck-editor').find('.ck-editor__main'),r;r=i.length?i:o;let a=jQuery('
    ');r.siblings('.ck-editor__preview').remove();const l=ql(e,'ckEditorPreview');n=l.render(a[0],t),r.hide(),r.after(a),s()},c=function(){let t=Hl(e),n=Ul(e).api.v3.previewMarkup(t);jQuery.ajax({data:e.getData(),url:n,response_type:'text',contentType:'text/plain; charset=UTF-8',method:'POST'}).done(d)},u=function(){let t=jQuery(e.element),o=t.siblings('.ck-editor').find('.ck-editor__main');n(),o.siblings('.ck-editor__preview').remove(),o.show(),l()};return r.on('execute',()=>{t?(t=!1,u()):(t=!0,c())}),r})}get label(){return window.I18n.t('js.editor.preview')}}class nC extends zb{static get pluginName(){return'OPMacroToc'}static get buttonName(){return'insertToc'}init(){const e=this.editor,t=e.model,n=e.conversion;t.schema.register('op-macro-toc',{allowWhere:'$block',isBlock:!1,isLimit:!1}),n.for('upcast').add(an({view:{name:'macro',classes:'toc'},model:'op-macro-toc'})),n.for('editingDowncast').add(Ct({model:'op-macro-toc',view:(e,t)=>Sr(this.createTocViewElement(t),t,{label:this.label})})),n.for('dataDowncast').add(Ct({model:'op-macro-toc',view:(e,t)=>this.createTocDataElement(t)})),e.ui.componentFactory.add(nC.buttonName,(t)=>{const n=new m_(t);return n.set({label:this.label,withText:!0}),n.on('execute',()=>{e.model.change((t)=>{const n=t.createElement('op-macro-toc',{});e.model.insertContent(n,e.model.document.selection)})}),n})}get label(){return window.I18n.t('js.editor.macro.toc')}createTocViewElement(e){const t=e.createText(this.label),n=e.createContainerElement('div',{class:'macro -toc'});return e.insert(im.createAt(n),t),n}createTocDataElement(e){return e.createContainerElement('macro',{class:'toc'})}}const oC=Symbol('isOPEmbeddedTable');class iC extends zb{static get pluginName(){return'EmbeddedTableEditing'}static get buttonName(){return'insertEmbeddedTable'}init(){const e=this.editor,t=e.model,n=e.conversion,o=e.config.get('openProject.pluginContext');this.text={button:window.I18n.t('js.editor.macro.embedded_table.button'),macro_text:window.I18n.t('js.editor.macro.embedded_table.text')},t.schema.register('op-macro-embedded-table',{allowWhere:'$block',allowAttributes:['opEmbeddedTableQuery'],isBlock:!0,isObject:!0}),n.for('upcast').add(an({view:{name:'macro',classes:'embedded-table'},model:(e,t)=>{const n=e.getAttribute('data-query-props');return t.createElement('op-macro-embedded-table',{opEmbeddedTableQuery:n?JSON.parse(n):{}})}})),n.for('editingDowncast').add(Ct({model:'op-macro-embedded-table',view:(e,t)=>$l(this.createEmbeddedTableView(t),t,{label:this.label})})),n.for('dataDowncast').add(Ct({model:'op-macro-embedded-table',view:(e,t)=>this.createEmbeddedTableDataElement(e,t)})),e.ui.componentFactory.add(iC.buttonName,(t)=>{const n=new m_(t);return n.set({label:this.text.button,withText:!0}),n.on('execute',()=>{const t=o.services.externalQueryConfiguration;t.show({},(t)=>e.model.change((n)=>{const o=n.createElement('op-macro-embedded-table',{opEmbeddedTableQuery:t});e.model.insertContent(o,e.model.document.selection)}))}),n})}createEmbeddedTableView(e){const t=e.createText(this.text.macro_text),n=e.createContainerElement('div',{class:'macro -embedded-table'});return e.insert(im.createAt(n),t),n}createEmbeddedTableDataElement(e,t){const n=e.getAttribute('opEmbeddedTableQuery')||{},o=t.createContainerElement('macro',{class:'embedded-table',"data-query-props":JSON.stringify(n)});return o}}class rC extends zb{static get requires(){return[tk]}static get pluginName(){return'EmbeddedTableToolbar'}init(){const e=this.editor,t=this.editor.model,n=e.config.get('openProject.pluginContext');Ml(e,'opEditEmbeddedTableQuery',(e)=>{const o=n.services.externalQueryConfiguration,i=e.getAttribute('opEmbeddedTableQuery')||{};o.show(i,(n)=>t.change((t)=>{t.setAttribute('opEmbeddedTableQuery',n,e)}))})}afterInit(){Ll(this,this.editor,'OPMacroEmbeddedTable',Gl)}}class aC extends zb{static get requires(){return[iC,Gw,rC]}static get pluginName(){return'OPMacroEmbeddedTable'}static get buttonName(){return iC.buttonName}}const sC=Symbol('isWpButtonMacroSymbol');class lC extends zb{static get pluginName(){return'OPMacroWpButtonEditing'}static get buttonName(){return'insertWorkPackageButton'}init(){const e=this.editor,t=e.model,n=e.conversion,o=e.config.get('openProject.pluginContext');t.schema.register('op-macro-wp-button',{allowWhere:['$block'],allowAttributes:['type','classes'],isBlock:!0,isLimit:!1}),n.for('upcast').add(an({view:{name:'macro',classes:'create_work_package_link'},model:(e,t)=>{const n=e.getAttribute('data-type')||'',o=e.getAttribute('data-classes')||'';return t.createElement('op-macro-wp-button',{type:n,classes:o})}})),n.for('editingDowncast').add(Ct({model:'op-macro-wp-button',view:(e,t)=>this.createMacroViewElement(e,t)})),n.for('dataDowncast').add(Ct({model:'op-macro-wp-button',view:(e,t)=>{const n=t.createContainerElement('macro',{class:'create_work_package_link',"data-type":e.getAttribute('type')||'',"data-classes":e.getAttribute('classes')||''});return n}})),e.ui.componentFactory.add(lC.buttonName,(t)=>{const n=new m_(t);return n.set({label:window.I18n.t('js.editor.macro.work_package_button.button'),withText:!0}),n.on('execute',()=>{const t=o.services.macros;t.configureWorkPackageButton().then((t)=>e.model.change((n)=>{const o=n.createElement('op-macro-wp-button',{});n.setAttribute('type',t.type,o),n.setAttribute('classes',t.classes,o),e.model.insertContent(o,e.model.document.selection)})),e.model.change(()=>{})}),n})}macroLabel(e){return e?window.I18n.t('js.editor.macro.work_package_button.with_type',{typename:e}):window.I18n.t('js.editor.macro.work_package_button.without_type')}createMacroViewElement(e,t){const n=e.getAttribute('type'),o=e.getAttribute('classes')||'',i=this.macroLabel(),r=t.createText(i),a=t.createContainerElement('span',{class:'macro -create_work_package_link '+o});return t.insert(im.createAt(a),r),Jl(a,t,{label:i})}}class dC extends zb{static get requires(){return[tk]}static get pluginName(){return'OPMacroWpButtonToolbar'}init(){const e=this.editor,t=this.editor.model,n=e.config.get('openProject.pluginContext');Ml(e,'opEditWpMacroButton',(t)=>{const o=n.services.macros,i=t.getAttribute('type'),r=t.getAttribute('classes');o.configureWorkPackageButton(i,r).then((n)=>e.model.change((e)=>{e.setAttribute('classes',n.classes,t),e.setAttribute('type',n.type,t)}))})}afterInit(){Ll(this,this.editor,'OPMacroWpButton',Yl)}}class cC extends zb{static get requires(){return[lC,Gw,dC]}static get pluginName(){return'OPMacroWpButton'}static get buttonName(){return lC.buttonName}}const uC=Symbol('isWpButtonMacroSymbol');class pC extends zb{static get pluginName(){return'OPWikiIncludePageEditing'}static get buttonName(){return'insertWikiPageInclude'}init(){const e=this.editor,t=e.model,n=e.conversion,o=e.config.get('openProject.pluginContext');t.schema.register('op-macro-wiki-page-include',{allowWhere:['$block'],allowAttributes:['page'],isBlock:!0,isLimit:!0}),n.for('upcast').add(an({view:{name:'macro',classes:'include_wiki_page'},model:(e,t)=>{const n=e.getAttribute('data-page')||'';return t.createElement('op-macro-wiki-page-include',{page:n})}})),n.for('editingDowncast').add(Ct({model:'op-macro-wiki-page-include',view:(e,t)=>this.createMacroViewElement(e,t)})).add((e)=>e.on('attribute:page',this.modelAttributeToView.bind(this))),n.for('dataDowncast').add(Ct({model:'op-macro-wiki-page-include',view:(e,t)=>{const n=t.createContainerElement('macro',{class:'include_wiki_page',"data-page":e.getAttribute('page')||''});return n}})),e.ui.componentFactory.add(pC.buttonName,(t)=>{const n=new m_(t);return n.set({label:window.I18n.t('js.editor.macro.wiki_page_include.button'),withText:!0}),n.on('execute',()=>{const t=o.services.macros;t.configureWikiPageInclude().then((t)=>e.model.change((n)=>{const o=n.createElement('op-macro-wiki-page-include',{});n.setAttribute('page',t,o),e.model.insertContent(o,e.model.document.selection)}))}),n})}modelAttributeToView(e,t,n){const o=t.item;if(o.is('op-macro-wiki-page-include')){n.consumable.consume(t.item,e.name);const i=n.mapper.toViewElement(o);n.writer.remove(rm.createIn(i)),this.setPlaceholderContent(n.writer,o,i)}}macroLabel(){return window.I18n.t('js.editor.macro.wiki_page_include.text')}pageLabel(e){return e&&0{const o=n.services.macros,i=t.getAttribute('page');o.configureWikiPageInclude(i).then((n)=>e.model.change((e)=>{e.setAttribute('page',n,t)}))})}afterInit(){Ll(this,this.editor,'OPWikiIncludePage',ed)}}class gC extends zb{static get requires(){return[pC,Gw,mC]}static get pluginName(){return'OPWikiIncludePage'}static get buttonName(){return pC.buttonName}}class fC extends jk{execute(){this.atJsOpen||super.execute()}get isAtJsOpen(){return this.atJsOpen}set isAtJsOpen(e){this.atJsOpen=e}}class hC extends zb{static get pluginName(){return'atjs'}static get requires(){return[fC]}init(){const e=this.editor;e.commands.get('enter').destroy(),e.commands.add('enter',new fC(e))}}class bC extends zb{static get pluginName(){return'OPLinkingWp'}init(){const e=this.editor;td(e,{remoteUrl:function(e,t){let n=window.OpenProject.urlRoot+`/work_packages/auto_complete.json`;jQuery.getJSON(n,{q:e,scope:'all'},t)},remoteDataPreparation:function(e){for(let t=e.length-1;0<=t;t--)e[t].id_subject=e[t].id.toString()+' '+e[t].subject;return e}})}}class kC extends zb{static get pluginName(){return'OPMentioning'}init(){const e=this.editor;td(e,{searchKey:'id_principal',displayTpl:'
  • ${name}
  • ',insertTpl:'${typePrefix}#${id}',startWithSpace:!0,suffix:'',acceptSpaceBar:!0,highlightFirst:!0,at:'@',remoteDataPreparation:function(t){const n=t._embedded.elements,o=ql(e,'htmlSanitizeService');for(let e=n.length-1;0<=e;e--)n[e].id_principal=o.sanitize(n[e].id.toString()+' '+n[e].name),n[e].typePrefix=n[e]._type.toLowerCase();return n},isSupportedContext:function(){let t=Wl(e);return t&&'WorkPackage'===t._type},remoteUrl:function(t,n){const o=Ul(e).api.v3.principals(Wl(e).project.id,t);jQuery.getJSON(o,n)}})}}class _C{constructor(e,t){this.loader=e,this.resource=t}upload(){const e=this.resource;if(!(e&&e.uploadAttachments)){const t=e?e.name:'Missing context';return console.warn(`uploadAttachments not present on context: ${t}`),Promise.reject('You\'re not allowed to upload attachments on this resource.')}return e.uploadAttachments([this.loader.file]).then((e)=>this.buildResponse(e[0]))}buildResponse(e){return{default:e.uploadUrl}}abort(){return!1}}var wC=o(98),vC=o.n(wC);class yC extends zb{init(){const e=this.editor,n=e.t;e.ui.componentFactory.add('imageUpload',(t)=>{const o=new Zx(t),i=e.commands.get('imageUpload');return o.set({acceptedType:'image/*',allowMultipleFiles:!0}),o.buttonView.set({label:n('ar'),icon:vC.a,tooltip:!0}),o.buttonView.bind('isEnabled').to(i),o.on('done',(t,n)=>{for(const o of Array.from(n)){const t=od(e.model.document.selection);nd(o)&&e.execute('imageUpload',{file:o,insertAt:t})}}),o})}}var xC=o(99),CC=o.n(xC),AC=o(100),TC=o.n(AC),PC=o(102),EC=o.n(PC);class SC extends zb{constructor(e){super(e),this.placeholder='data:image/svg+xml;utf8,'+encodeURIComponent(CC.a)}init(){const e=this.editor;e.editing.downcastDispatcher.on('attribute:uploadStatus:image',(...e)=>this.uploadStatusChange(...e))}uploadStatusChange(e,t,n){const o=this.editor,i=t.item,r=i.getAttribute('uploadId');if(n.consumable.consume(t.item,e.name)){const e=o.plugins.get(x_),a=r?t.attributeNewValue:null,s=this.placeholder,l=o.editing.mapper.toViewElement(i),d=n.writer;if('reading'==a)return id(l,d),void ad(s,l,d);if('uploading'==a){const t=e.loaders.get(r);return id(l,d),void(t?(sd(l,d),ld(l,d,t,o.editing.view)):ad(s,l,d))}'complete'==a&&e.loaders.get(r)&&cd(l,d,o.editing.view),dd(l,d),sd(l,d),rd(l,d)}}}const OC=Symbol('progress-bar');class RC extends zk{execute(e){const t=this.editor,n=t.model.document,o=e.file,i=t.plugins.get(x_);t.model.change((r)=>{const a=i.createLoader(o);if(!a)return;const s=r.createElement('image',{uploadId:a.id});let l;l=e.insertAt?new Ig([new Eg(e.insertAt)]):n.selection,t.model.insertContent(s,l),s.parent&&r.setSelection(s,'on')})}}class IC extends zb{static get pluginName(){return'Notification'}init(){this.on('show:warning',(e,t)=>{window.alert(t.message)},{priority:'lowest'})}showSuccess(e,t={}){this._showNotification({message:e,type:'success',namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:'info',namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:'warning',namespace:t.namespace,title:t.title})}_showNotification(e){const t=`show:${e.type}`+(e.namespace?`:${e.namespace}`:'');this.fire(t,{message:e.message,type:e.type,title:e.title||''})}}class VC extends zb{static get requires(){return[x_,IC]}init(){const e=this.editor,t=e.model.document,n=e.model.schema,o=e.plugins.get(x_);n.extend('image',{allowAttributes:['uploadId','uploadStatus']}),e.commands.add('imageUpload',new RC(e)),this.listenTo(e.editing.view.document,'clipboardInput',(n,i)=>{if(md(i.dataTransfer))return;let r=new Ig(i.targetRanges.map((t)=>e.editing.mapper.toModelRange(t)));for(const a of i.dataTransfer.files){if(nd(a)){const t=od(r);e.model.change((n)=>{const i=o.createLoader(a);if(i){const o=n.createElement('image',{uploadId:i.id}),r=new Ig([new Eg(t)]);e.model.insertContent(o,r),o.parent&&n.setSelection(o,'on')}}),n.stop()}r=t.selection}}),e.editing.view.document.on('dragover',(e,t)=>{t.preventDefault()}),t.on('change',()=>{const e=t.differ.getChanges({includeChangesInGraveyard:!0});for(const t of e)if('insert'==t.type&&'image'==t.name){const e=t.position.nodeAfter,n='$graveyard'==t.position.root.rootName,i=e.getAttribute('uploadId');if(!i)continue;const r=o.loaders.get(i);if(!r)continue;n?r.abort():'idle'==r.status&&this._load(r,e)}})}_load(e,n){function o(){r.enqueueChange('transparent',(e)=>{e.removeAttribute('uploadId',n),e.removeAttribute('uploadStatus',n)}),t.destroyLoader(e)}const i=this.editor,r=i.model,a=i.locale.t,t=i.plugins.get(x_),s=i.plugins.get(IC);return r.enqueueChange('transparent',(e)=>{e.setAttribute('uploadStatus','reading',n)}),e.read().then((t)=>{const o=i.editing.mapper.toViewElement(n),a=o.getChild(0),s=e.upload();return i.editing.view.change((e)=>{e.setAttribute('src',t,a)}),r.enqueueChange('transparent',(e)=>{e.setAttribute('uploadStatus','uploading',n)}),s}).then((e)=>{r.enqueueChange('transparent',(t)=>{t.setAttributes({uploadStatus:'complete',src:e.default},n);let o=0;const i=Object.keys(e).filter((e)=>{const t=parseInt(e,10);if(!isNaN(t))return o=_d(o,t),!0}).map((t)=>`${e[t]} ${t}w`).join(', ');''!=i&&t.setAttribute('srcset',{data:i,width:o},n)}),o()}).catch((t)=>{if('error'!==e.status&&'aborted'!==e.status)throw t;'error'==e.status&&s.showWarning(t,{title:a('al'),namespace:'upload'}),o(),r.enqueueChange('transparent',(e)=>{e.remove(n)})})}}class FC extends zb{static get pluginName(){return'ImageUpload'}static get requires(){return[VC,yC,SC]}}class NC extends zb{static get requires(){return[x_,FC]}static get pluginName(){return'OpUploadPlugin'}init(){this.editor.plugins.get('FileRepository').createUploadAdapter=(e)=>{const t=Wl(this.editor);return new _C(e,t)}}}const DC=Symbol('isWpButtonMacroSymbol');class BC extends zb{static get pluginName(){return'OPChildPagesEditing'}static get buttonName(){return'insertChildPages'}init(){const e=this.editor,t=e.model,n=e.conversion;t.schema.register('op-macro-child-pages',{allowWhere:['$block'],allowAttributes:['page'],isBlock:!0,isLimit:!0}),n.for('upcast').add(an({view:{name:'macro',classes:'child_pages'},model:(e,t)=>{const n=e.getAttribute('data-page')||'',o='true'==e.getAttribute('data-include-parent');return t.createElement('op-macro-child-pages',{page:n,includeParent:o})}})),n.for('editingDowncast').add(Ct({model:'op-macro-child-pages',view:(e,t)=>this.createMacroViewElement(e,t)})).add((e)=>e.on('attribute:page',this.modelAttributeToView.bind(this))).add((e)=>e.on('attribute:includeParent',this.modelAttributeToView.bind(this))),n.for('dataDowncast').add(Ct({model:'op-macro-child-pages',view:(e,t)=>{const n=t.createContainerElement('macro',{class:'child_pages',"data-page":e.getAttribute('page')||'',"data-include-parent":e.getAttribute('includeParent')||''});return n}})),e.ui.componentFactory.add(BC.buttonName,(t)=>{const n=new m_(t);return n.set({label:window.I18n.t('js.editor.macro.child_pages.button'),withText:!0}),n.on('execute',()=>{e.model.change((t)=>{const n=t.createElement('op-macro-child-pages',{});e.model.insertContent(n,e.model.document.selection)})}),n})}modelAttributeToView(e,t,n){const o=t.item;if(o.is('op-macro-child-pages')){n.consumable.consume(t.item,e.name);const i=n.mapper.toViewElement(o);n.writer.remove(rm.createIn(i)),this.setPlaceholderContent(n.writer,o,i)}}macroLabel(){return window.I18n.t('js.editor.macro.child_pages.text')}pageLabel(e){return e&&0{const o=n.services.macros,i=e.getAttribute('page'),r=e.getAttribute('includeParent'),a=i&&0t.change((t)=>{t.setAttribute('page',n.page,e),t.setAttribute('includeParent',n.includeParent,e)}))})}afterInit(){Ll(this,this.editor,'OPChildPages',hd)}}class LC extends zb{static get requires(){return[BC,Gw,MC]}static get pluginName(){return'OPChildPages'}static get buttonName(){return BC.buttonName}}const zC=[nC,aC,cC,gC,LC],jC=[NC];class qC extends vk{}n.BalloonEditor=qC;class WC extends Nk{}n.ClassicEditor=WC,window.OPBalloonEditor=qC,window.OPClassicEditor=WC;const HC={plugins:[w_,E_,I_,z_,J_,nw,cw,Dw,gv,yv,Mv,Lv,uy,wy,pw,e_,zx,Qx,tC,function(e){e.data.processor=new Bx},Yy,Xy,class extends zb{init(){const e=this.editor,t=window.I18n.t('js.editor.macro.dropdown.chose_macro');e.ui.componentFactory.add('macroList',(n)=>{const o=[];for(const t of zC){const n=e.ui.componentFactory.create(t.buttonName);o.push(n)}const i=gr(n);return fr(i,o),i.buttonView.set({isOn:!1,withText:!0,tooltip:t,label:window.I18n.t('js.editor.macro.dropdown.macros')}),i.toolbarView.isVertical=!0,i.toolbarView.className='op-macro-list-button',i})}}].concat(zC,[hC,bC,kC],jC),config:{heading:{options:[{model:'paragraph',title:'Paragraph',class:'ck-heading_paragraph'},{model:'heading1',view:'h1',title:'Heading 1',class:'ck-heading_heading1'},{model:'heading2',view:'h2',title:'Heading 2',class:'ck-heading_heading2'},{model:'heading3',view:'h3',title:'Heading 3',class:'ck-heading_heading3'},{model:'heading4',view:'h4',title:'Heading 4',class:'ck-heading_heading4'},{model:'heading5',view:'h5',title:'Heading 5',class:'ck-heading_heading5'}]},toolbar:{items:['heading','|','bold','italic','code','insertCodeBlock','link','bulletedList','numberedList','imageUpload','blockQuote','|','insertTable','|','macroList','|','undo','redo','openProjectShowFormattingHelp','|','preview']},OPMacroEmbeddedTable:{toolbar:['opEditEmbeddedTableQuery']},OPMacroWpButton:{toolbar:['opEditWpMacroButton']},OPWikiIncludePage:{toolbar:['opEditWikiIncludeMacroButton']},OPCodeBlock:{toolbar:['opEditCodeBlock']},OPChildPages:{toolbar:['opEditChildPagesMacroButton']},image:{toolbar:['imageStyle:full','|','imageTextAlternative']},table:{toolbar:['tableColumn','tableRow']},language:'en'}};WC.build=HC,qC.build=HC,WC.createCustomized=bd(WC),qC.createCustomized=bd(qC)},function(e,t){'use strict';t.a=function(e){return e&&e.Object===Object?e:null}},function(e,t,n){'use strict';(function(e){var o=n(11),i=n(1),r={function:!0,object:!0},a=r[typeof exports]&&exports&&!exports.nodeType?exports:void 0,s=r[typeof e]&&e&&!e.nodeType?e:void 0,l=s&&s.exports===a?a:void 0,d=l?i.a.Buffer:void 0,c=d?function(e){return e instanceof d}:Object(o.a)(!1);t.a=c}).call(t,n(2)(e))},function(e,t){'use strict';t.a=function(e){return function(){return e}}},function(e,t,n){var o=n(13);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck-hidden{display:none!important}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{box-sizing:border-box;width:auto;height:auto;position:static}:root{--ck-z-default:1;--ck-z-modal:999;--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#c4c4c4;--ck-color-base-action:#61b045;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#198cf0;--ck-color-base-active-focus:#0e7fe1;--ck-color-focus-border:#47a4f5;--ck-color-focus-shadow:#77baf8;--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,.15);--ck-color-shadow-inner:rgba(0,0,0,.1);--ck-color-button-default-background:transparent;--ck-color-button-default-focus-background:#e6e6e6;--ck-color-button-default-active-background:#d9d9d9;--ck-color-button-default-active-shadow:#bfbfbf;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#dedede;--ck-color-button-on-focus-background:#c4c4c4;--ck-color-button-on-active-background:#bababa;--ck-color-button-on-active-shadow:#a1a1a1;--ck-color-button-on-disabled-background:#dedede;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-focus-background:#579e3d;--ck-color-button-action-active-background:#53973b;--ck-color-button-action-active-shadow:#498433;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:#c7c7c7;--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:#c7c7c7;--ck-color-input-disabled-text:#5c5c5c;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-item-background-hover:var(--ck-color-base-foreground);--ck-color-list-item-background-active:var(--ck-color-base-active);--ck-color-list-item-background-active-focus:var(--ck-color-base-active-focus);--ck-color-list-item-text-active:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-foreground);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#c2c2c2;--ck-color-upload-bar-background:#6cb5f9;--ck-color-upload-infinite-background:rgba(0,0,0,.1);--ck-color-link-default:#0000f0;--ck-color-link-selected-background:#ebf8ff;--ck-disabled-opacity:.5;--ck-focus-outer-shadow:0 0 3px var(--ck-color-focus-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{margin:0;padding:0;border:0;background:transparent;text-decoration:none;vertical-align:middle;transition:none;word-wrap:break-word}.ck.ck-reset_all,.ck.ck-reset_all *{border-collapse:collapse;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);color:var(--ck-color-text);text-align:left;white-space:nowrap;cursor:auto;float:none}.ck.ck-reset_all .ck-rtl *{text-align:right}.ck.ck-reset_all iframe{vertical-align:inherit}.ck.ck-reset_all textarea{white-space:pre-wrap}.ck.ck-reset_all input[type=password],.ck.ck-reset_all input[type=text],.ck.ck-reset_all textarea{cursor:text}.ck.ck-reset_all input[type=password][disabled],.ck.ck-reset_all input[type=text][disabled],.ck.ck-reset_all textarea[disabled]{cursor:default}.ck.ck-reset_all fieldset{padding:10px;border:2px groove #dfdee3}.ck.ck-reset_all button::-moz-focus-inner{padding:0;border:0}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit) * 1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit) * 0.8);--ck-spacing-small:calc(var(--ck-spacing-unit) * 0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit) * 0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit) * 0.16)}'},function(e){e.exports=function(e){var t='undefined'!=typeof window&&window.location;if(!t)throw new Error('fixUrls requires window.location');if(!e||'string'!=typeof e)return e;var n=t.protocol+'//'+t.host,o=n+t.pathname.replace(/\/[^\/]*$/,'/'),i=e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var i=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});if(/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i))return e;var r;return r=0===i.indexOf('//')?i:0===i.indexOf('/')?n+i:o+i.replace(/^\.\//,''),'url('+JSON.stringify(r)+')'});return i}},function(e,t,n){var o=n(16);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:"";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-z-default)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-z-default)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-z-default)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px}.ck.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{width:0;height:0;border-style:solid}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-width:0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_n]:before{border-color:transparent transparent var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_n]:after{border-color:transparent transparent var(--ck-color-panel-background);margin-top:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-width:var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0}.ck.ck-balloon-panel[class*=arrow_s]:before{border-color:var(--ck-color-panel-border) transparent transparent}.ck.ck-balloon-panel[class*=arrow_s]:after{border-color:var(--ck-color-panel-background) transparent transparent;margin-bottom:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(-1 * var(--ck-balloon-arrow-half-width));top:calc(-1 * var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(2 * var(--ck-balloon-arrow-half-width));top:calc(-1 * var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(2 * var(--ck-balloon-arrow-half-width));top:calc(-1 * var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{left:50%;margin-left:calc(-1 * var(--ck-balloon-arrow-half-width));bottom:calc(-1 * var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{left:calc(2 * var(--ck-balloon-arrow-half-width));bottom:calc(-1 * var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{right:calc(2 * var(--ck-balloon-arrow-half-width));bottom:calc(-1 * var(--ck-balloon-arrow-height))}'},function(e,t,n){var o=n(18);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck.ck-toolbar{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-flow:row wrap;align-items:center}.ck.ck-toolbar.ck-toolbar_vertical{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating{flex-wrap:nowrap}.ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar__newline{display:block;width:100%}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);padding:0 var(--ck-spacing-small);border:1px solid var(--ck-color-toolbar-border)}.ck.ck-toolbar>*{margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>*{width:100%;margin:0;border-radius:0;border:0}.ck.ck-toolbar>:last-child{margin-right:0}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar__separator{align-self:stretch;width:1px;margin-top:0;margin-bottom:0;background:var(--ck-color-toolbar-border)}.ck.ck-toolbar__newline{margin:0}'},function(e,t,n){var o=n(20);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0}.ck-rounded-corners .ck.ck-editor__editable:not(.ck-editor__nested-editable),.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-focused{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0}.ck.ck-editor__editable_inline{overflow:auto;padding:0 var(--ck-spacing-standard);border:1px solid transparent}.ck.ck-editor__editable_inline>:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}'},function(e,t,n){var o=n(22);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}'},function(e,t,n){var o=n(24);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{z-index:var(--ck-z-modal);position:fixed;top:0}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{top:auto;position:absolute}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{box-shadow:var(--ck-drop-shadow),0 0;border-width:0 1px 1px;border-top-left-radius:0;border-top-right-radius:0}'},function(e,t,n){var o=n(26);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}'},function(e,t,n){var o=n(28);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base) * var(--ck-font-size-normal))}.ck.ck-icon{width:var(--ck-icon-size);height:var(--ck-icon-size);font-size:.8333350694em;will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon *{fill:currentColor}'},function(e,t,n){var o=n(30);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck-tooltip{visibility:hidden;opacity:0;display:none;z-index:var(--ck-z-modal)}.ck-tooltip .ck-tooltip__text{display:inline-block}.ck-tooltip .ck-tooltip__text:after{content:"";width:0;height:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%}.ck.ck-tooltip.ck-tooltip_s{bottom:calc(-1 * var(--ck-tooltip-arrow-size));transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after{top:calc(-1 * var(--ck-tooltip-arrow-size));transform:translateX(-50%);border-color:transparent transparent var(--ck-color-tooltip-background);border-width:0 var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_n{top:calc(-1 * var(--ck-tooltip-arrow-size));transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(-1 * var(--ck-tooltip-arrow-size));transform:translateX(-50%);border-color:var(--ck-color-tooltip-background) transparent transparent;border-width:var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size) 0}.ck.ck-tooltip .ck-tooltip__text{border-radius:0}.ck-rounded-corners .ck.ck-tooltip .ck-tooltip__text,.ck.ck-tooltip .ck-tooltip__text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-tooltip .ck-tooltip__text{font-size:.9em;line-height:1.5;color:var(--ck-color-tooltip-text);padding:var(--ck-spacing-small) var(--ck-spacing-medium);background:var(--ck-color-tooltip-background);position:relative;left:-50%}.ck.ck-tooltip .ck-tooltip__text:after{border-style:solid;left:50%}.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{transition:opacity .2s ease-in-out .2s}'},function(e,t,n){var o=n(32);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck.ck-button,a.ck.ck-button{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:block}@media (hover:none){.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:none}}.ck.ck-button,a.ck.ck-button{position:relative}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:hover .ck-tooltip,a.ck.ck-button:hover .ck-tooltip{visibility:visible;opacity:1}.ck.ck-button .ck-button__label,.ck.ck-button:focus:not(:hover) .ck-tooltip,a.ck.ck-button .ck-button__label,a.ck.ck-button:focus:not(:hover) .ck-tooltip{display:none}.ck.ck-button,a.ck.ck-button{background:var(--ck-color-button-default-background)}.ck.ck-button:not(.ck-disabled):focus,.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):focus,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-focus-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-default-active-shadow)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck.ck-button,a.ck.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button,a.ck.ck-button{white-space:nowrap;cursor:default;vertical-align:middle;padding:var(--ck-spacing-tiny);text-align:center;min-width:var(--ck-ui-component-min-height);min-height:var(--ck-ui-component-min-height);line-height:1;font-size:inherit;border:1px solid transparent}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;border-color:transparent}.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__icon{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}.ck.ck-button.ck-button_with-text .ck-button__icon,a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:calc(-1 * var(--ck-spacing-small));margin-right:var(--ck-spacing-small)}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background)}.ck.ck-button.ck-on:not(.ck-disabled):focus,.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):focus,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-focus-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-on-active-shadow)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{font-size:inherit;font-weight:inherit;color:inherit;cursor:inherit;vertical-align:middle}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background)}.ck.ck-button-action:not(.ck-disabled):focus,.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):focus,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-focus-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-action-active-shadow)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-action,a.ck.ck-button-action{color:var(--ck-color-button-action-text)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}'},function(e){e.exports=''},function(e){e.exports=''},function(e){e.exports='\n'},function(e){e.exports=''},function(e){e.exports='.ck-content code{background-color:hsla(0,0%,78%,.3);padding:.15em;border-radius:2px}'},function(e){e.exports=''},function(e){e.exports='\n'},function(e,t,n){var o=n(41);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;font-style:italic;border-left:5px solid #ccc}'},function(e,t,n){var o=n(43);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default);position:absolute;top:50%;transform:translate3d(0,-50%,0)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on .ck-tooltip{display:none}.ck.ck-dropdown .ck-dropdown__panel{-webkit-backface-visibility:hidden;display:none;z-index:var(--ck-z-modal);position:absolute;left:0;transform:translate3d(0,100%,0)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block;will-change:transform}:root{--ck-dropdown-arrow-size:calc(0.5 * var(--ck-icon-size))}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{right:var(--ck-spacing-standard);width:var(--ck-dropdown-arrow-size)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button{padding-right:calc(2.5 * var(--ck-spacing-standard))}.ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{width:7em;overflow:hidden;text-overflow:ellipsis}.ck.ck-dropdown__panel{border-radius:0;box-shadow:var(--ck-drop-shadow),0 0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;min-width:100%}'},function(e){e.exports=''},function(e,t,n){var o=n(46);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck.ck-list{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{list-style-type:none;background:var(--ck-color-list-background)}.ck.ck-list__item{padding:var(--ck-spacing-medium);cursor:default;min-width:12em}.ck.ck-list__item:focus,.ck.ck-list__item:hover{background:var(--ck-color-list-item-background-hover)}.ck.ck-list__item:focus{box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-list__item.ck-disabled{opacity:var(--ck-disabled-opacity)}.ck.ck-list__item_active{background:var(--ck-color-list-item-background-active);color:var(--ck-color-list-item-text-active)}.ck.ck-list__item_active:focus,.ck.ck-list__item_active:hover{background:var(--ck-color-list-item-background-active-focus)}.ck.ck-list__separator{height:1px;width:100%;background:var(--ck-color-base-border)}'},function(e,t,n){var o=n(48);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck.ck-toolbar-dropdown .ck-toolbar{flex-wrap:nowrap}.ck.ck-toolbar-dropdown .ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}'},function(e,t,n){var o=n(50);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list>.ck-list__item{line-height:calc(.8*var(--ck-line-height-base)*var(--ck-font-size-base));padding:calc(.4*var(--ck-line-height-base)*var(--ck-font-size-base))}'},function(e){e.exports='.ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}'},function(e,t,n){var o=n(53);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports=':root{--ck-widget-outline-thickness:3px;--ck-color-widget-border-blurred:#dedede;--ck-color-widget-border-hover:#ffd15c;--ck-color-widget-editable-focused-background:var(--ck-color-base-background),}.ck .ck-widget{margin:var(--ck-spacing-standard) 0;padding:0}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck-editor__editable.ck-blurred .ck .ck-widget.ck-widget_selected{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-widget-border-blurred)}.ck .ck-widget:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-widget-border-hover)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;background-color:var(--ck-color-widget-editable-focused-background)}'},function(e,t,n){var o=n(55);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports=':root{--ck-input-text-width:18em}.ck.ck-input-text{border-radius:0}.ck-rounded-corners .ck.ck-input-text,.ck.ck-input-text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-text{box-shadow:var(--ck-inner-shadow),0 0;background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);min-width:var(--ck-input-text-width);min-height:var(--ck-ui-component-min-height);transition-property:box-shadow,border;transition:.2s ease-in-out}.ck.ck-input-text:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),var(--ck-inner-shadow)}.ck.ck-input-text[readonly]{border:1px solid var(--ck-color-input-disabled-border);background:var(--ck-color-input-disabled-background);color:var(--ck-color-input-disabled-text)}'},function(e,t,n){var o=n(57);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck.ck-text-alternative-form .ck-labeled-input{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}.ck.ck-text-alternative-form{padding:var(--ck-spacing-standard)}.ck.ck-text-alternative-form:focus{outline:none}.ck.ck-text-alternative-form>:not(:first-child){margin-left:var(--ck-spacing-standard)}'},function(e){e.exports=''},function(e,t,n){var o=n(60);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck-content .image{clear:both;text-align:center}.ck-content .image>img{display:block;margin:0 auto;max-width:100%}'},function(e,t,n){var o=n(62);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck.ck-placeholder:before,.ck .ck-placeholder:before{content:attr(data-placeholder);pointer-events:none;cursor:text;color:var(--ck-color-engine-placeholder-text)}'},function(e,t,n){var o=n(64);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck-content .image>figcaption{color:#333;background-color:#f7f7f7;padding:.6em;font-size:.75em;outline-offset:-1px}'},function(e){e.exports='\n'},function(e){e.exports=''},function(e){e.exports='\n'},function(e){e.exports='\n'},function(e,t,n){var o=n(70);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports=':root{--ck-image-style-spacing:1.5em}.ck-content .image-style-align-center,.ck-content .image-style-align-left,.ck-content .image-style-align-right,.ck-content .image-style-side{max-width:50%}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing)}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}'},function(e,t,n){var o=n(72);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck .ck-link_selected{background:var(--ck-color-link-selected-background)}'},function(e,t,n){var o=n(74);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck.ck-link-form .ck-labeled-input{display:inline-block}.ck.ck-link-form .ck-label{display:none}.ck.ck-link-form{padding:var(--ck-spacing-standard)}.ck.ck-link-form:focus{outline:none}.ck.ck-link-form>:not(:first-child){margin-left:var(--ck-spacing-standard)}'},function(e){e.exports=''},function(e){e.exports='\n'},function(e,t,n){var o=n(78);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}.ck.ck-link-actions{padding:var(--ck-spacing-standard)}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{padding:0 var(--ck-spacing-medium);color:var(--ck-color-link-default);text-overflow:ellipsis;cursor:pointer;max-width:var(--ck-input-text-width);min-width:3em;text-align:center}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions:focus{outline:none}.ck.ck-link-actions>:not(:first-child){margin-left:var(--ck-spacing-standard)}'},function(e){e.exports=''},function(e){e.exports=''},function(e){e.exports=''},function(e,t,n){var o=n(83);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports=':root{--ck-color-table-focused-cell-background:#f5fafe}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused{background:var(--ck-color-table-focused-cell-background);border-style:double}'},function(e,t,n){var o=n(85);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports=':root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px;--ck-insert-table-dropdown-box-border-color:#bfbfbf;--ck-insert-table-dropdown-box-border-active-color:#53a0e4;--ck-insert-table-dropdown-box-active-background:#c7e5ff}.ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap;width:calc(var(--ck-insert-table-dropdown-box-width) * 10 + var(--ck-insert-table-dropdown-box-margin) * 20 + var(--ck-insert-table-dropdown-padding) * 2);padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0}.ck .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{width:var(--ck-insert-table-dropdown-box-width);height:var(--ck-insert-table-dropdown-box-height);margin:var(--ck-insert-table-dropdown-box-margin);border:1px solid var(--ck-insert-table-dropdown-box-border-color);border-radius:1px}.ck .ck-insert-table-dropdown-grid-box.ck-on{border-color:var(--ck-insert-table-dropdown-box-border-active-color);background:var(--ck-insert-table-dropdown-box-active-background)}'},function(e){e.exports=''},function(e){e.exports=''},function(e){e.exports=''},function(e){e.exports=''},function(e,t,n){var o=n(91);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck-content .table{margin:1em auto;display:table}.ck-content .table table{border-collapse:collapse;border-spacing:0;border:1px double #b3b3b3}.ck-content .table table td,.ck-content .table table th{min-width:2em;padding:.4em;text-align:center;border-color:#d9d9d9}.ck-content .table table th{font-weight:700;background:#fafafa}'},function(){},function(t,n,o){(function(n){(function(){function n(e){this.tokens=[],this.tokens.links={},this.options=e||u.defaults,this.rules=p.normal,this.options.gfm&&(this.options.tables?this.rules=p.tables:this.rules=p.gfm)}function o(e,t){if(this.options=t||u.defaults,this.links=e,this.rules=m.normal,this.renderer=this.options.renderer||new i,this.renderer.options=this.options,!this.links)throw new Error('Tokens array requires a `links` property.');this.options.gfm?this.options.breaks?this.rules=m.breaks:this.rules=m.gfm:this.options.pedantic&&(this.rules=m.pedantic)}function i(e){this.options=e||{}}function r(e){this.tokens=[],this.token=null,this.options=e||u.defaults,this.options.renderer=this.options.renderer||new i,this.renderer=this.options.renderer,this.renderer.options=this.options}function a(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,'&').replace(//g,'>').replace(/"/g,'"').replace(/'/g,''')}function s(t){return t.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(t,o){return o=o.toLowerCase(),'colon'===o?':':'#'===o.charAt(0)?'x'===o.charAt(1)?e(parseInt(o.substring(2),16)):e(+o.substring(1)):''})}function l(e,t){return e=e.source,t=t||'',function n(o,i){return o?(i=i.source||i,i=i.replace(/(^|[^\[])\^/g,'$1'),e=e.replace(o,i),n):new RegExp(e,t)}}function d(){}function c(e){for(var t=1,n,o;ts.length)return p();if(delete t.highlight,!d)return p();for(;lAn error occured:

    '+a(n.message+'',!0)+'
    ';throw n}}var p={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:d,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:d,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:d,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};p.bullet=/(?:[*+-]|\d+\.)/,p.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,p.item=l(p.item,'gm')(/bull/g,p.bullet)(),p.list=l(p.list)(/bull/g,p.bullet)('hr','\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))')('def','\\n+(?='+p.def.source+')')(),p.blockquote=l(p.blockquote)('def',p.def)(),p._tag='(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b',p.html=l(p.html)('comment',//)('closed',/<(tag)[\s\S]+?<\/\1>/)('closing',/])*?>/)(/tag/g,p._tag)(),p.paragraph=l(p.paragraph)('hr',p.hr)('heading',p.heading)('lheading',p.lheading)('blockquote',p.blockquote)('tag','<'+p._tag)('def',p.def)(),p.normal=c({},p),p.gfm=c({},p.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),p.gfm.paragraph=l(p.paragraph)('(?!','(?!'+p.gfm.fences.source.replace('\\1','\\2')+'|'+p.list.source.replace('\\1','\\3')+'|')(),p.tables=c({},p.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),n.rules=p,n.lex=function(e,t){var o=new n(t);return o.lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,'\n').replace(/\t/g,' ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n'),this.token(e,!0)},n.prototype.token=function(e,t,n){for(var e=e.replace(/^ +$/gm,''),o,r,a,s,d,c,u,m,i;e;){if((a=this.rules.newline.exec(e))&&(e=e.substring(a[0].length),1 ?/gm,''),this.token(a,t,!0),this.tokens.push({type:'blockquote_end'});continue}if(a=this.rules.list.exec(e)){for(e=e.substring(a[0].length),s=a[2],this.tokens.push({type:'list_start',ordered:1])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:d,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:d,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,m.link=l(m.link)('inside',m._inside)('href',m._href)(),m.reflink=l(m.reflink)('inside',m._inside)(),m.normal=c({},m),m.pedantic=c({},m.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),m.gfm=c({},m.normal,{escape:l(m.escape)('])','~|])')(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:l(m.text)(']|','~]|')('|','|https?://|')()}),m.breaks=c({},m.gfm,{br:l(m.br)('{2,}','*')(),text:l(m.gfm.text)('{2,}','*')()}),o.rules=m,o.output=function(e,t,n){var i=new o(t,n);return i.output(e)},o.prototype.output=function(e){for(var t='',n,o,i,r;e;){if(r=this.rules.escape.exec(e)){e=e.substring(r[0].length),t+=r[1];continue}if(r=this.rules.autolink.exec(e)){e=e.substring(r[0].length),'@'===r[2]?(o=':'===r[1].charAt(6)?this.mangle(r[1].substring(7)):this.mangle(r[1]),i=this.mangle('mailto:')+o):(o=a(r[1]),i=o),t+=this.renderer.link(i,null,o);continue}if(!this.inLink&&(r=this.rules.url.exec(e))){e=e.substring(r[0].length),o=a(r[1]),i=o,t+=this.renderer.link(i,null,o);continue}if(r=this.rules.tag.exec(e)){!this.inLink&&/^
    /i.test(r[0])&&(this.inLink=!1),e=e.substring(r[0].length),t+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):a(r[0]):r[0];continue}if(r=this.rules.link.exec(e)){e=e.substring(r[0].length),this.inLink=!0,t+=this.outputLink(r,{href:r[2],title:r[3]}),this.inLink=!1;continue}if((r=this.rules.reflink.exec(e))||(r=this.rules.nolink.exec(e))){if(e=e.substring(r[0].length),n=(r[2]||r[1]).replace(/\s+/g,' '),n=this.links[n.toLowerCase()],!n||!n.href){t+=r[0].charAt(0),e=r[0].substring(1)+e;continue}this.inLink=!0,t+=this.outputLink(r,n),this.inLink=!1;continue}if(r=this.rules.strong.exec(e)){e=e.substring(r[0].length),t+=this.renderer.strong(this.output(r[2]||r[1]));continue}if(r=this.rules.em.exec(e)){e=e.substring(r[0].length),t+=this.renderer.em(this.output(r[2]||r[1]));continue}if(r=this.rules.code.exec(e)){e=e.substring(r[0].length),t+=this.renderer.codespan(a(r[2],!0));continue}if(r=this.rules.br.exec(e)){e=e.substring(r[0].length),t+=this.renderer.br();continue}if(r=this.rules.del.exec(e)){e=e.substring(r[0].length),t+=this.renderer.del(this.output(r[1]));continue}if(r=this.rules.text.exec(e)){e=e.substring(r[0].length),t+=this.renderer.text(a(this.smartypants(r[0])));continue}if(e)throw new Error('Infinite loop on byte: '+e.charCodeAt(0))}return t},o.prototype.outputLink=function(e,t){var n=a(t.href),o=t.title?a(t.title):null;return'!'===e[0].charAt(0)?this.renderer.image(n,o,a(e[1])):this.renderer.link(n,o,this.output(e[1]))},o.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,'\u2014').replace(/--/g,'\u2013').replace(/(^|[-\u2014/(\[{"\s])'/g,'$1\u2018').replace(/'/g,'\u2019').replace(/(^|[-\u2014/(\[{\u2018\s])"/g,'$1\u201C').replace(/"/g,'\u201D').replace(/\.{3}/g,'\u2026'):e},o.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t='',n=e.length,o=0,i;o'+(n?e:a(e,!0))+'\n\n':'
    '+(n?e:a(e,!0))+'\n
    '},i.prototype.blockquote=function(e){return'
    \n'+e+'
    \n'},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return''+e+'\n'},i.prototype.hr=function(){return this.options.xhtml?'
    \n':'
    \n'},i.prototype.list=function(e,t){var n=t?'ol':'ul';return'<'+n+'>\n'+e+'\n'},i.prototype.listitem=function(e){return'
  • '+e+'
  • \n'},i.prototype.paragraph=function(e){return'

    '+e+'

    \n'},i.prototype.table=function(e,t){return'\n\n'+e+'\n\n'+t+'\n
    \n'},i.prototype.tablerow=function(e){return'\n'+e+'\n'},i.prototype.tablecell=function(e,t){var n=t.header?'th':'td',o=t.align?'<'+n+' style="text-align:'+t.align+'">':'<'+n+'>';return o+e+'\n'},i.prototype.strong=function(e){return''+e+''},i.prototype.em=function(e){return''+e+''},i.prototype.codespan=function(e){return''+e+''},i.prototype.br=function(){return this.options.xhtml?'
    ':'
    '},i.prototype.del=function(e){return''+e+''},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var o=decodeURIComponent(s(e)).replace(/[^\w:]/g,'').toLowerCase()}catch(t){return''}if(0===o.indexOf('javascript:')||0===o.indexOf('vbscript:'))return''}var i='
    ',i},i.prototype.image=function(e,t,n){var o=''+n+'':'>',o},i.prototype.text=function(e){return e},r.parse=function(e,t,n){var o=new r(t,n);return o.parse(e)},r.prototype.parse=function(e){this.inline=new o(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var t='';this.next();)t+=this.tok();return t},r.prototype.next=function(){return this.token=this.tokens.pop()},r.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},r.prototype.parseText=function(){for(var e=this.token.text;'text'===this.peek().type;)e+='\n'+this.next().text;return this.inline.output(e)},r.prototype.tok=function(){switch(this.token.type){case'space':return'';case'hr':return this.renderer.hr();case'heading':return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case'code':return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case'table':{var e='',t='',n,o,i,r,a;for(i='',n=0;nimg{width:100%}.ck-content .image .ck-progress-bar{height:2px;width:0;background:var(--ck-color-upload-bar-background);transition:width .1s}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes readingProgressAnimation{0%{width:var(--ck-image-upload-progress-line-width);right:0}50%{width:calc(var(--ck-image-upload-progress-line-width) * 1.5)}to{right:100%}}'},function(e,t,n){var o=n(103);'string'==typeof o&&(o=[[e.i,o,'']]);var i={singleton:!0,hmr:!0},r;i.transform=r,i.insertInto=void 0;n(0)(o,i);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck-image-upload-complete-icon{display:block;position:absolute;top:10px;right:10px;border-radius:50%}.ck-image-upload-complete-icon:after{content:"";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:1.25em;--ck-image-upload-icon-width:2px}.ck-image-upload-complete-icon{width:var(--ck-image-upload-icon-size);height:var(--ck-image-upload-icon-size);opacity:0;background:var(--ck-color-image-upload-icon-background);animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;animation-fill-mode:forwards,forwards;animation-duration:.5s,.5s;animation-delay:0ms,3s}.ck-image-upload-complete-icon:after{left:25%;top:50%;opacity:0;height:0;width:0;transform:scaleX(-1) rotate(135deg);transform-origin:left top;border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);animation-name:ck-upload-complete-icon-check;animation-duration:.5s;animation-delay:.5s;animation-fill-mode:forwards}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{opacity:1;height:0;width:0}33%{width:.25em;height:0}to{width:.25em;height:.416em;opacity:1}}'}])['default']}); //# sourceMappingURL=ckeditor.js.map