From 5d0e62a5ac0887570e78d2411c900f0964c041e2 Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Mon, 25 Jun 2018 13:10:36 +0200 Subject: [PATCH] bump ckeditor to 10.1.0 --- app/assets/javascripts/vendor/ckeditor/ckeditor.js | 3 ++- app/assets/javascripts/vendor/ckeditor/ckeditor.js.map | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/vendor/ckeditor/ckeditor.js b/app/assets/javascripts/vendor/ckeditor/ckeditor.js index 76796419b3..f53b46dcaa 100644 --- a/app/assets/javascripts/vendor/ckeditor/ckeditor.js +++ b/app/assets/javascripts/vendor/ckeditor/ckeditor.js @@ -2,4 +2,5 @@ * @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:'Bold',c:'image widget',d:'Block quote',e:'Italic',f:'Enter image caption',g:'Choose heading',h:'Heading',i:'Full size image',j:'Side image',k:'Left aligned image',l:'Centered image',m:'Right aligned image',n:'Insert image',o:'Upload failed',p:'Link',q:'Numbered List',r:'Bulleted List',s:'Upload in progress',t:'Change image text alternative',u:'Rich Text Editor',v:'Rich Text Editor, %0',w:'Undo',x:'Redo',y:'Save',z:'Cancel',aa:'Text alternative',ab:'Unlink',ac:'Edit link',ad:'Open link in new tab',ae:'This link has no URL',af:'Link URL',ag:'Paragraph',ah:'Heading 1',ai:'Heading 2',aj:'Heading 3'})})(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=Math.min,t=Math.floor,n=String.fromCharCode;return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.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=23)}([function(e,t,o){'use strict';function r(e){return Object.prototype.toString.call(e)}function i(e,t){return c.call(e,t)}function a(e){return!(55296<=e&&57343>=e)&&!(64976<=e&&65007>=e)&&65535!=(65535&e)&&65534!=(65535&e)&&!(0<=e&&8>=e)&&11!==e&&!(14<=e&&31>=e)&&!(127<=e&&159>=e)&&!(1114111>10),o=56320+(1023&e);return n(t,o)}return n(e)}function l(e,t){var n=0;return i(h,t)?h[t]:35===t.charCodeAt(0)&&g.test(t)&&(n='x'===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10),a(n))?s(n):e}function d(e){return _[e]}var c=Object.prototype.hasOwnProperty,p=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,u=/&([a-z#][a-z0-9]{1,31});/gi,m=new RegExp(p.source+'|'+u.source,'gi'),g=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,h=o(15),f=/[&<>"]/,b=/[&<>"]/g,_={"&":'&',"<":'<',">":'>','"':'"'},k=/[.?*+^$[\]\\(){}|-]/g,w=o(6);t.lib={},t.lib.mdurl=o(16),t.lib.ucmicro=o(111),t.assign=function(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach(function(t){if(t){if('object'!=typeof t)throw new TypeError(t+'must be object');Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e},t.isString=function(e){return'[object String]'===r(e)},t.has=i,t.unescapeMd=function(e){return 0>e.indexOf('\\')?e:e.replace(p,'$1')},t.unescapeAll=function(e){return 0>e.indexOf('\\')&&0>e.indexOf('&')?e:e.replace(m,function(e,t,n){return t?t:l(e,n)})},t.isValidEntityCode=a,t.fromCodePoint=s,t.escapeHtml=function(e){return f.test(e)?e.replace(b,d):e},t.arrayReplaceAt=function(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))},t.isSpace=function(e){return!(9!==e&&32!==e)},t.isWhiteSpace=function(e){if(8192<=e&&8202>=e)return!0;return!(9!==e&&10!==e&&11!==e&&12!==e&&13!==e&&32!==e&&160!==e&&5760!==e&&8239!==e&&8287!==e&&12288!==e)},t.isMdAsciiPunct=function(e){return!(33!==e&&34!==e&&35!==e&&36!==e&&37!==e&&38!==e&&39!==e&&40!==e&&41!==e&&42!==e&&43!==e&&44!==e&&45!==e&&46!==e&&47!==e&&58!==e&&59!==e&&60!==e&&61!==e&&62!==e&&63!==e&&64!==e&&91!==e&&92!==e&&93!==e&&94!==e&&95!==e&&96!==e&&123!==e&&124!==e&&125!==e&&126!==e)},t.isPunctChar=function(e){return w.test(e)},t.escapeRE=function(e){return e.replace(k,'\\$&')},t.normalizeReference=function(e){return e.trim().replace(/\s+/g,' ').toUpperCase()}},function(e,t,n){function o(e,t){for(var n=0;nt.indexOf(e)&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){!n.enabled||t&&0>n.alt.indexOf(t)||e.__cache__[t].push(n.fn)})})},t.prototype.at=function(e,t,n){var o=this.__find__(e);if(-1===o)throw new Error('Parser rule not found: '+e);this.__rules__[o].fn=t,this.__rules__[o].alt=(n||{}).alt||[],this.__cache__=null},t.prototype.before=function(e,t,n,o){var r=this.__find__(e);if(-1===r)throw new Error('Parser rule not found: '+e);this.__rules__.splice(r,0,{name:t,enabled:!0,fn:n,alt:(o||{}).alt||[]}),this.__cache__=null},t.prototype.after=function(e,t,n,o){var r=this.__find__(e);if(-1===r)throw new Error('Parser rule not found: '+e);this.__rules__.splice(r+1,0,{name:t,enabled:!0,fn:n,alt:(o||{}).alt||[]}),this.__cache__=null},t.prototype.push=function(e,t,n){this.__rules__.push({name:e,enabled:!0,fn:t,alt:(n||{}).alt||[]}),this.__cache__=null},t.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);var n=[];return e.forEach(function(e){var o=this.__find__(e);if(0>o){if(t)return;throw new Error('Rules manager: invalid rule name '+e)}this.__rules__[o].enabled=!0,n.push(e)},this),this.__cache__=null,n},t.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},t.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);var n=[];return e.forEach(function(e){var o=this.__find__(e);if(0>o){if(t)return;throw new Error('Rules manager: invalid rule name '+e)}this.__rules__[o].enabled=!1,n.push(e)},this),this.__cache__=null,n},t.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},e.exports=t},function(e){'use strict';function t(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content='',this.markup='',this.info='',this.meta=null,this.block=!1,this.hidden=!1}t.prototype.attrIndex=function(e){var t,n,o;if(!this.attrs)return-1;for(t=this.attrs,n=0,o=t.length;nn?this.attrPush(o):this.attrs[n]=o},t.prototype.attrGet=function(e){var t=this.attrIndex(e),n=null;return 0<=t&&(n=this.attrs[t][1]),n},t.prototype.attrJoin=function(e,t){var n=this.attrIndex(e);0>n?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+' '+t},e.exports=t},function(e){e.exports=''},function(e){e.exports=''},function(e,t,n){var o=n(79);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);o.locals&&(e.exports=o.locals),!1},function(e){e.exports=''},function(e){e.exports='\n'},function(e){e.exports='\n'},function(e,t,n){'use strict';e.exports=n(106)},function(e,t,n){'use strict';e.exports.encode=n(107),e.exports.decode=n(108),e.exports.format=n(109),e.exports.parse=n(110)},function(e){e.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/},function(e){e.exports=/[\0-\x1F\x7F-\x9F]/},function(e){e.exports=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/},function(e){'use strict';var t=/^(?:<[A-Za-z][A-Za-z0-9\-]*(?:\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\s*=\s*(?:[^"'=<>`\x00-\x20]+|'[^']*'|"[^"]*"))?)*\s*\/?>|<\/[A-Za-z][A-Za-z0-9\-]*\s*>|||<[?].*?[?]>|]*>|)/,n=/^(?:<[A-Za-z][A-Za-z0-9\-]*(?:\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\s*=\s*(?:[^"'=<>`\x00-\x20]+|'[^']*'|"[^"]*"))?)*\s*\/?>|<\/[A-Za-z][A-Za-z0-9\-]*\s*>)/;e.exports.HTML_TAG_RE=t,e.exports.HTML_OPEN_CLOSE_TAG_RE=n},function(e){'use strict';e.exports.tokenize=function(e,t){var o=e.pos,r=e.src.charCodeAt(o),a,s,l,d,c;if(t)return!1;if(126!==r)return!1;if(s=e.scanDelims(e.pos,!0),d=s.length,c=n(r),2>d)return!1;for(d%2&&(l=e.push('text','',0),l.content=c,d--),a=0;an;n++)e+=t(65536*(1+Math.random())).toString(16).substring(1);return e}function l(e,t){return e[vd]&&e[vd][t]?e[vd][t].emitter:null}function d(e,t){e[xd]||(e[xd]=t||s())}function c(e){return e[xd]}function p(e){return e._events||Object.defineProperty(e,'_events',{value:{}}),e._events}function u(){return{callbacks:[],childEvents:[]}}function m(e,t){const n=p(e);if(n[t])return;let o=t,r=null;const i=[];for(;''!==o&&!n[o];)n[o]=u(),i.push(n[o]),r&&n[o].childEvents.push(r),r=o,o=o.substr(0,o.lastIndexOf(':'));if(''!==o){for(const e of i)e.callbacks=n[o].callbacks.slice();n[o].childEvents.push(r)}}function g(e,t){const n=p(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 k(e){var t=-1,n=e?e.length:0;for(this.clear();++te.add(t))}function B(e){return'string'==typeof e?[new Kp(e)]:(R(e)||(e=[e]),Array.from(e).map((e)=>'string'==typeof e?new Kp(e):e instanceof Zp?new Kp(e.data):e))}function q(){for(const e of this.getChildren())if(!e.is('uiElement'))return null;return this.childCount}function z(e,t,n){if(!Od(n))return!1;var o=typeof t;return!('number'==o?!(kc(n)&&Nc(t,n.length)):!('string'==o&&t in n))&&Td(n[t],e)}function j(e){e=null==e?e:Object(e);var t=[];for(var n in e)t.push(n);return t}function U(e){Ou in e||(Object.defineProperty(e,Ou,{value:new Map}),Object.defineProperty(e,Iu,{value:new Map}),Object.defineProperty(e,Nu,{value:new Map}))}function H(...e){const t=K(...e),n=Array.from(this._bindings.keys()),o=n.length;if(!t.callback&&1{if(e.properties.length&&e.properties.length!==o)throw new bd('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),J(this),this._bindProperties.forEach((e)=>{Y(this._observable,e)})}function W(e,t,n){if(1[e,t]);return Array.prototype.concat.apply([],n)}function $(e){return e.every((e)=>'string'==typeof e)}function K(...e){if(!e.length)throw new bd('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 bd('observable-bind-to-parse-error: Invalid argument syntax in `to()`.')}),t}function Z(e,t,n,o){const r=e[Iu],i=r.get(n),a=i||{};a[o]||(a[o]=new Set),a[o].add(t),i||r.set(n,a)}function J(e){let t;e._bindings.forEach((n,o)=>{e._to.forEach((r)=>{t=r.properties[n.callback?0:e._bindProperties.indexOf(o)],n.to.push([r.observable,t]),Z(e._observable,n,r.observable,t)})})}function Y(e,t){const n=e[Nu],o=n.get(t);let r;o.callback?r=o.callback.apply(e,o.to.map((e)=>e[0][e[1]])):(r=o.to[0],r=r[0][r[1]]),e.hasOwnProperty(t)?e[t]=r:e.set(t,r)}function Q(e,t){t.forEach((t)=>{const n=e[Iu];let o;n.get(t.observable)||e.listenTo(t.observable,'change',(r,i)=>{o=n.get(t.observable)[i],o&&o.forEach((t)=>{Y(e,t.property)})})})}function X(e){return!!(e.item.is('attributeElement')||e.item.is('uiElement'))}function ee(e){let t=0;for(const n of e)t++;return t}function te(){if(ne(this))return null;let e=this.parent;for(;e&&e.is('attributeElement');){if(1!e.is('uiElement')).length}function oe(){return null}function re(e){let t;if('string'!=typeof e)t=e.keyCode+(e.altKey?tm.alt:0)+(e.ctrlKey?tm.ctrl:0)+(e.shiftKey?tm.shift:0);else if(t=tm[e.toLowerCase()],!t)throw new bd('keyboard-unknown-key: Unknown key name.',{key:e});return t}function ie(e){return'string'==typeof e&&(e=se(e)),e.map((e)=>'string'==typeof e?re(e):e).reduce((e,t)=>t+e,0)}function ae(e){return Qu.isMac?se(e).map((e)=>em[e.toLowerCase()]||e).reduce((e,t)=>e.slice(-1)in Xu?e+t:e+'+'+t):e}function se(e){return e.split(/\s*\+\s*/)}function le(e){e.document.on('keydown',(t,n)=>ce(t,n,e.domConverter))}function de(){return null}function ce(e,t,n){if(t.keyCode==tm.arrowright){const e=t.domTarget.ownerDocument.defaultView.getSelection(),o=1==e.rangeCount&&e.getRangeAt(0).collapsed;if(o||t.shiftKey){const t=e.focusNode,r=e.focusOffset,i=n.domPositionToView(t,r);if(null===i)return;let a=!1;const s=i.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 pe(e){return'string'==typeof e?[new Kp(e)]:(R(e)||(e=[e]),Array.from(e).map((e)=>'string'==typeof e?new Kp(e):e instanceof Zp?new Kp(e.data):e))}function ue(e){return Array.from(e.getChildren()).some((e)=>!e.is('uiElement'))}function me(e){let t=e.parent;for(;!we(t);){if(!t)return;t=t.parent}return t}function ge(e,t){if(e.priorityt.priority)&&e.getIdentity()t instanceof e))throw new bd('view-writer-insert-invalid-node');t.is('text')||ke(t.getChildren())}}function we(e){return e&&(e.is('containerElement')||e.is('documentFragment'))}function ye(e){const t=me(e.start),n=me(e.end);if(!t||!n||t!==n)throw new bd('view-writer-invalid-range-container')}function ve(e,t){return null===e.id&&null===t.id}function xe(e){return e instanceof Text&&e.data.substr(0,lm)===dm}function Ce(e){return e.data.length==lm&&xe(e)}function Ae(e){return xe(e)?e.data.slice(lm):e.data}function Te(e,t){let n=cm.get(t);return n||(n=t(window.document),cm.set(t,n)),e.isEqualNode(n)}function Ee(e){e.document.on('keydown',Pe)}function Pe(e,t){if(t.keyCode==tm.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;xe(t)&&n<=lm&&e.collapse(t,0)}}}function Se(e,t,o){function r(n){const r=(c[n-1]===void 0?-1:c[n-1])+1,p=c[n+1]===void 0?-1:c[n+1],u=r>p?-1:1;d[n+u]&&(d[n]=d[n+u].slice(0)),d[n]||(d[n]=[]),d[n].push(r>p?i:a);let m=rd(r,p),g=m-n;for(;gn;m--)c[m]=r(m);c[n]=r(n),u++}while(c[n]!==l);return d[n].slice(1)}function Re(e,t,n){e.insertBefore(n,e.childNodes[t]||null)}function Oe(e){const t=e.parentNode;t&&t.removeChild(e)}function Ie(e){return'[object Text]'==Object.prototype.toString.call(e)}function Ne(e){if('false'==e.getAttribute('contenteditable'))return!1;const t=e.findAncestor((e)=>e.hasAttribute('contenteditable'));return!t||'true'==t.getAttribute('contenteditable')}function Ve(e){let t=0;for(;e.previousSibling;)e=e.previousSibling,t++;return t}function Le(e){const t=[];for(;e&&e.nodeType!=Node.DOCUMENT_NODE;)t.unshift(e),e=e.parentNode;return t}function De(e,t){const n=Le(e),o=Le(t);let r=0;for(;n[r]==o[r]&&n[r];)r++;return 0==r?null:n[r-1]}function Fe(e,t,n){let o=Le(e);return n&&(o=o.slice(o.indexOf(n)+1)),o.some((e)=>e.tagName&&t.includes(e.tagName.toLowerCase()))}function Me(e,t){for(;e&&e!=um.document;)t(e),e=e.parentNode}function Be(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 qe(e){return'[object Window]'==Object.prototype.toString.apply(e)}function ze(e){return e['data-ck-expando']||(e['data-ck-expando']=s())}function je(e){var t=-1,n=e?e.length:0;for(this.__data__=new oc;++t=t||0>n||h&&o>=k}function s(){var e=jm();return a(e)?l(e):void(y=setTimeout(s,i(e)))}function l(e){return(clearTimeout(y),y=void 0,f&&b)?o(e):(b=_=void 0,w)}function d(){void 0!==y&&clearTimeout(y),u=m=0,b=_=y=void 0}function c(){return void 0===y?w:l(jm())}function p(){var e=jm(),n=a(e);if(b=arguments,_=this,u=e,n){if(void 0===y)return r(u);if(h)return clearTimeout(y),y=setTimeout(s,t),o(u)}return void 0===y&&(y=setTimeout(s,t)),w}var u=0,m=0,g=!1,h=!1,f=!0,b,_,k,w,y;if('function'!=typeof e)throw new TypeError(Um);return t=cu(t)||0,Od(n)&&(g=!!n.leading,h='maxWait'in n,k=h?Hm(cu(n.maxWait)||0,t):k,f='trailing'in n?!!n.trailing:f),p.cancel=d,p.flush=c,p}function Ge(e){return e==tm.arrowright||e==tm.arrowleft||e==tm.arrowup||e==tm.arrowdown}function $e(e){return'[object Range]'==Object.prototype.toString.apply(e)}function Ke(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 Ze(e,t){for(const n of tg)e[n]=t[n]}function Je(e){return!!Xm(e)&&e===e.ownerDocument.body}function Ye({target:e,viewportOffset:t=0}){const n=it(e);for(let o=n,r=null;o;){let i;i=o==n?at(e):at(r),Xe(i,()=>st(e,o));const a=st(e,o);Qe(o,a,t),o.parent==o?o=null:(r=o.frameElement,o=o.parent)}}function Qe(e,t,n){const o=t.clone().moveBy(0,n),r=t.clone().moveBy(0,-n),i=new eg(e).excludeScrollbarsAndBorders();if(![r,o].every((e)=>i.contains(e))){let{scrollX:a,scrollY:s}=e;tt(r,i)?s-=i.top-t.top+n:et(o,i)&&(s+=t.bottom-i.bottom+n),nt(t,i)?a-=i.left-t.left+n:rt(t,i)&&(a+=t.right-i.right+n),e.scrollTo(a,s)}}function Xe(e,t){const n=it(e);for(let o,r;e!=n.document.body;)r=t(),o=new eg(e).excludeScrollbarsAndBorders(),o.contains(r)||(tt(r,o)?e.scrollTop-=o.top-r.top:et(r,o)&&(e.scrollTop+=r.bottom-o.bottom),nt(r,o)?e.scrollLeft-=o.left-r.left:rt(r,o)&&(e.scrollLeft+=r.right-o.right)),e=e.parentNode}function et(e,t){return e.bottom>t.bottom}function tt(e,t){return e.topt.right}function it(e){return $e(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function at(e){if($e(e)){let t=e.commonAncestorContainer;return Ie(t)&&(t=t.parentNode),t}return e.parentNode}function st(e,t){const n=it(e),o=new eg(e);if(n===t)return o;for(let r=n;r!=t;){const e=r.frameElement,t=new eg(e).excludeScrollbarsAndBorders();o.moveBy(t.left,t.top),r=r.parent}return o}function lt(e){return gd(e)?S(e):new Map(e)}function dt(e){return'string'==typeof e?[new rg(e)]:(R(e)||(e=[e]),Array.from(e).map((e)=>'string'==typeof e?new rg(e):e instanceof ig?new rg(e.data,e.getAttributes()):e))}function ct(e,t,n,o,r){return{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:o,length:r}}}function pt(e){const t=e.split(':');return 1{if(o.containsItem(e)){const t=n.toViewElement(e);return!!t.getCustomProperty('addHighlight')}});return!i}function mt(e,t){return!t.has(e)&&(t.add(e),e.document.model.schema.isBlock(e)&&e.parent)}function gt(e,t){const n=e.parent.getAncestors({parentFirst:!0,includeSelf:!0}),o=n.find((e)=>mt(e,t));return n.forEach((e)=>t.add(e)),o}function ht(){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)&&ft.call(this,o)},{priority:'low'})}function ft(e){const t=e.type,n=e.delta.batch;let o,r;'insert'==t?o=pg.createFromPositionAndShift(e.position,e.nodes.maxOffset):(o=pg.createFromPositionAndShift(e.getMovedRangeStart(),e.howMany),r=e.sourcePosition);const i=o.end.offset-o.start.offset;let a=o.start;('move'==t||'remove'==t||'reinsert'==t)&&(a=a._getTransformedByInsertion(r,i));const s=this._getTransformedByDocumentChange(t,e.delta.type,a,i,r);('move'==t||'remove'==t||'reinsert'==t)&&3==s.length&&(s[2]=o);const l=pg.createFromRanges(s),d=!l.isEqual(this),c=this.containsPosition(a),p=r&&(this.containsPosition(r)||this.start.isEqual(r));if(d){const e=pg.createFromRange(this);this.start=l.start,this.end=l.end,this.fire('change:range',e,{type:t,batch:n,range:o,sourcePosition:r})}else(c||p)&&this.fire('change:content',pg.createFromRange(this),{type:t,batch:n,range:o,sourcePosition:r})}function bt(e){return e instanceof ig||e instanceof rg?e.getAttributes():null}function _t(e,t){const n=e.document.differ;for(const o of n.getChanges()){if('insert'!=o.type)continue;const n=o.position.parent,r=o.length===n.maxOffset;r&&e.enqueueChange(t,(e)=>{const t=Array.from(n.getAttributeKeys()).filter((e)=>e.startsWith(bg));for(const o of t)e.removeAttribute(o,n)})}}function kt(e){return e=wg(e),e.view=vt(e.view,'container'),(t)=>{t.on('insert:'+e.model,Tt(e.view),{priority:e.priority||'normal'})}}function wt(e){e=wg(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]=vt(e.view[t],'attribute');else e.view=vt(e.view,'attribute');const o=Ct(e);return(t)=>{t.on(n,Rt(o),{priority:e.priority||'normal'})}}function yt(e){e=wg(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]=At(e.view[t]);else e.view=At(e.view);const o=Ct(e);return(t)=>{t.on(n,St(o),{priority:e.priority||'normal'})}}function vt(e,t){return'function'==typeof e?e:(n,o)=>xt(e,o,t)}function xt(e,t,n){'string'==typeof e&&(e={name:e});let o;if(o='container'==n?t.createContainerElement(e.name,Object.assign({},e.attributes)):'attribute'==n?t.createAttributeElement(e.name,Object.assign({},e.attributes)):t.createUIElement(e.name,Object.assign({},e.attributes)),e.styles){const n=Object.keys(e.styles);for(const r of n)t.setStyle(r,e.styles[r],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 Ct(e){return e.model.values?(t,n)=>{const o=e.view[t];return o?o(t,n):null}:e.view}function At(e){return'string'==typeof e?(t)=>({key:e,value:t}):'object'==typeof e?e.value?()=>e:(t)=>({key:e.key,value:t}):e}function Tt(e){return(t,n,o)=>{const r=e(n.item,o.writer);if(r&&o.consumable.consume(n.item,'insert')){const e=o.mapper.toViewPosition(n.range.start);o.mapper.bindElements(n.item,r),o.writer.insert(e,r)}}}function Et(){return(e,t,n)=>{if(n.consumable.consume(t.item,'insert')){const e=n.writer,o=n.mapper.toViewPosition(t.range.start),r=e.createText(t.item.data);e.insert(o,r)}}}function Pt(){return(e,t,n)=>{const o=n.mapper.toViewPosition(t.position),r=t.position.getShiftedBy(t.length),i=n.mapper.toViewPosition(r,{isPhantom:!0}),a=new ju(o,i),s=n.writer.remove(a.getTrimmed());for(const o of ju.createIn(s).getItems())n.mapper.unbindViewElement(o)}}function St(e){return e=e||((e,t)=>({value:e,key:t.attributeKey})),(t,n,o)=>{const r=e(n.attributeOldValue,n),i=e(n.attributeNewValue,n);if((r||i)&&o.consumable.consume(n.item,t.name)){const e=o.mapper.toViewElement(n.item),t=o.writer;if(null!==n.attributeOldValue&&r)if('class'==r.key){const n=Array.isArray(r.value)?r.value:[r.value];for(const o of n)t.removeClass(o,e)}else if('style'==r.key){const n=Object.keys(r.value);for(const o of n)t.removeStyle(o,e)}else t.removeAttribute(r.key,e);if(null!==n.attributeNewValue&&i)if('class'==i.key){const n=Array.isArray(i.value)?i.value:[i.value];for(const o of n)t.addClass(o,e)}else if('style'==i.key){const n=Object.keys(i.value);for(const o of n)t.setStyle(o,i.value[o],e)}else t.setAttribute(i.key,i.value,e)}}}function Rt(e){return(t,n,o)=>{const r=e(n.attributeOldValue,o.writer),i=e(n.attributeNewValue,o.writer);if((r||i)&&o.consumable.consume(n.item,t.name)){const e=o.writer,t=e.document.selection;if(n.item instanceof hg||n.item instanceof _g)e.wrap(t.getFirstRange(),i);else{let t=o.mapper.toViewRange(n.range);null!==n.attributeOldValue&&r&&(t=e.unwrap(t,r)),null!==n.attributeNewValue&&i&&e.wrap(t,i)}}}}function Ot(e,t){return(n,o)=>{const r=o.newSelection,i=new hg,a=[];for(const e of r.getRanges())a.push(t.toModelRange(e));i.setTo(a,{backward:r.isBackward}),i.isEqual(e.document.selection)||e.change((e)=>{e.setSelection(i)})}}function It(){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 Nt(){return(e,t,n)=>{const o=t.selection;if(o.isCollapsed&&n.consumable.consume(o,'selection')){const e=n.writer,t=o.getFirstPosition(),r=n.mapper.toViewPosition(t),i=e.breakAttributes(r);e.setSelection(i)}}}function Vt(){return(e,t,n)=>{const o=n.writer,r=o.document.selection;for(const o of r.getRanges())o.isCollapsed&&o.end.parent.document&&n.writer.mergeAttributes(o.start);o.setSelection(null)}}function Lt(e,t){const n=Ft();if(1===n&&(e=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]),0===n||!Dt(e,t))return t.replace(/ \[context: [^\]]+\]$/,'');const o=window.CKEDITOR_TRANSLATIONS[e];return o[t].replace(/ \[context: [^\]]+\]$/,'')}function Dt(e,t){return e in window.CKEDITOR_TRANSLATIONS&&t in window.CKEDITOR_TRANSLATIONS[e]}function Ft(){return Object.keys(window.CKEDITOR_TRANSLATIONS).length}function Mt(e,t){const n={name:t,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};return Wt(e,n),Gt(e,n,'allowIn'),Gt(e,n,'allowContentOf'),Gt(e,n,'allowWhere'),Gt(e,n,'allowAttributes'),Gt(e,n,'allowAttributesOf'),Gt(e,n,'inheritTypesFrom'),$t(e,n),n}function Bt(e,t){for(const n of e[t].allowContentOf)if(e[n]){const o=Kt(e,n);o.forEach((e)=>{e.allowIn.push(t)})}delete e[t].allowContentOf}function qt(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 zt(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 jt(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 Ut(e,t){const n=e[t],o=n.allowIn.filter((t)=>e[t]);n.allowIn=Array.from(new Set(o))}function Ht(e,t){const n=e[t];n.allowAttributes=Array.from(new Set(n.allowAttributes))}function Wt(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 Gt(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 $t(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 Kt(e,t){const n=e[t];return Zt(e).filter((e)=>e.allowIn.includes(n.name))}function Zt(e){return Object.keys(e).map((t)=>e[t])}function Jt(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*Yt(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 Qt(e,t){const n=new Set,o=new Map,r=pg.createIn(e).getItems();for(const o of r)'$marker'==o.name&&n.add(o);for(const r of n){const e=r.getAttribute('data-name'),n=cg.createBefore(r);o.has(e)?o.get(e).end=cg.createFromPosition(n):o.set(e,new pg(cg.createFromPosition(n))),t.remove(r)}return o}function Xt(e,t){let n;for(const o of new Pg(e)){const e={};for(const t of o.getAttributeKeys())e[t]=o.getAttribute(t);const r=t.createElement(o.name,e);n&&t.append(r,n),n=cg.createAt(r)}return n}function en(e){e=wg(e);const t=rn(e),n=on(e),o=n?'element:'+n:'element';return(n)=>{n.on(o,t,{priority:e.priority||'normal'})}}function tn(e){e=wg(e),ln(e);const t=dn(e),n=on(e),o=n?'element:'+n:'element';return(n)=>{n.on(o,t,{priority:e.priority||'normal'})}}function nn(e){e=wg(e);let t=null;('string'==typeof e.view||e.view.key)&&(t=sn(e)),ln(e,t);const n=dn(e);return(t)=>{t.on('element',n,{priority:e.priority||'low'})}}function on(e){return'string'==typeof e.view?e.view:'object'==typeof e.view&&'string'==typeof e.view.name?e.view.name:null}function rn(e){const t=new Jp(e.view);return(n,o,r)=>{const i=t.match(o.viewItem);if(i){i.match.name=!0;const t=an(e.model,o.viewItem,r.writer);if(t&&r.consumable.test(o.viewItem,i.match)){const e=r.splitToAllowedParent(t,o.modelCursor);if(e){r.writer.insert(t,e.position);const n=r.convertChildren(o.viewItem,cg.createAt(t));r.consumable.consume(o.viewItem,i.match),o.modelRange=new pg(cg.createBefore(t),cg.createAfter(n.modelCursor.parent)),o.modelCursor=e.cursorParent?cg.createAt(e.cursorParent):o.modelRange.end}}}}}function an(e,t,n){return e instanceof Function?e(t,n):n.createElement(e)}function sn(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 ln(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 dn(e){const t=new Jp(e.view);return(n,o,r)=>{const i=t.match(o.viewItem);if(i){const t=e.model.key,n='function'==typeof e.model.value?e.model.value(o.viewItem):e.model.value;if(null!==n&&(cn(e)?i.match.name=!0:delete i.match.name,!!r.consumable.test(o.viewItem,i.match))){o.modelRange||(o=Object.assign(o,r.convertChildren(o.viewItem,o.modelCursor)));const e=pn(o.modelRange,{key:t,value:n},r);e&&r.consumable.consume(o.viewItem,i.match)}}}}function cn(e){return!!('object'!=typeof e.view||on(e))&&!e.view.classes&&!e.view.attributes&&!e.view.styles}function pn(e,t,n){let o=!1;for(const r of Array.from(e.getItems()))n.schema.checkAttribute(r,t.key)&&(n.writer.setAttribute(t.key,t.value,r),o=!0);return o}function un(){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 mn(){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=pg.createFromPositionAndShift(t.modelCursor,e.offsetSize),t.modelCursor=t.modelRange.end}}}function gn(e){const t=[],n=e.root.document;if(!n)return[];const o=pg.createIn(e);for(const r of n.model.markers){const e=o.getIntersection(r.getRange());e&&t.push([r.name,e])}return t}function hn(e,t){for(const n of e)t(n)}function*fn(e){if(e.model.values)for(const t of e.model.values){const n={key:e.model.key,value:t},o=e.view[t],r=e.upcastAlso?e.upcastAlso[t]:void 0;yield*bn(n,o,r)}else yield*bn(e.model,e.view,e.upcastAlso)}function*bn(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 _n(e){return'string'==typeof e?[new rg(e)]:(R(e)||(e=[e]),Array.from(e).map((e)=>'string'==typeof e?new rg(e):e instanceof ig?new rg(e.data,e.getAttributes()):e))}function kn(e,t){t=xn(t);const n=t.reduce((e,t)=>e+t.offsetSize,0),o=e.parent;An(e);const r=e.index;return o._insertChild(r,t),Cn(o,r+t.length),Cn(o,r),new pg(e,e.getShiftedBy(n))}function wn(e){if(!e.isFlat)throw new bd('operation-utils-remove-range-not-flat: Trying to remove a range which starts and ends in different element.');const t=e.start.parent;An(e.start),An(e.end);const n=t._removeChildren(e.start.index,e.end.index-e.start.index);return Cn(t,e.start.index),n}function yn(e,t){if(!e.isFlat)throw new bd('operation-utils-move-range-not-flat: Trying to move a range which starts and ends in different element.');const n=wn(e);return t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset),kn(t,n)}function vn(e,t,n){An(e.start),An(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),Cn(e.parent,e.index)}Cn(e.end.parent,e.end.index)}function xn(e){const t=[];e instanceof Array||(e=[e]);for(let n=0;ne+t.operations.length,0)}function qn(e,t){const n=e[e.length-1];let o=n.operations.length+n.baseVersion;const r=new Kg;for(let n=0;no&&(n.push(...'e'.repeat(i.offset-o).split('')),r+=i.offset-o),'insert'==i.type?(n.push(...'i'.repeat(i.howMany).split('')),o=i.offset+i.howMany):'remove'==i.type?(n.push(...'r'.repeat(i.howMany).split('')),o=i.offset,r+=i.howMany):(n.push(...'a'.repeat(i.howMany).split('')),o=i.offset+i.howMany,r+=i.howMany);return r{const o=n[0];!o.isDocumentOperation||e.has(o.type)&&go.call(this,o)},{priority:'low'})}function go(e){let t,n;'insert'==e.type?t=pg.createFromPositionAndShift(e.position,e.nodes.maxOffset):(t=pg.createFromPositionAndShift(e.getMovedRangeStart(),e.howMany),n=e.sourcePosition);const o=t.end.offset-t.start.offset;let r;switch(e.type){case'insert':const i='sticksToNext'==this.stickiness;r=this._getTransformedByInsertion(t.start,o,i);break;case'move':case'remove':case'reinsert':const a=pg.createFromPositionAndShift(n,o),s=a.containsPosition(this)||a.start.isEqual(this)&&'sticksToNext'==this.stickiness||a.end.isEqual(this)&&'sticksToPrevious'==this.stickiness;if(s)r=this._getCombined(n,t.start);else{const e='sticksToNext'==this.stickiness,i=t.start._getTransformedByInsertion(n,o);r=this._getTransformedByMove(n,i,o,e)}}if(!this.isEqual(r)){const e=cg.createFromPosition(this);this.path=r.path,this.root=r.root,this.fire('change',e)}}function ho(e,t,n){e.change((o)=>{n.isCollapsed||e.deleteContent(n);const r=new hb(e,o,n.anchor);let i;i=t.is('documentFragment')?t.getChildren():[t],r.handleNodes(i,{isFirst:!0,isLast:!0});const a=r.getSelectionRange();a?n instanceof _g?o.setSelection(a):n.setTo(a):Zm.warn('insertcontent-no-range: Cannot determine a proper selection range after insertion.')})}function fo(e,t,n={}){if(t.isCollapsed)return;const o=e.schema;e.change((e)=>{if(!n.doNotResetEntireContent&&vo(o,t))return void yo(e,t,o);const r=t.getFirstRange(),i=r.start,a=gb.createFromPosition(r.end);r.start.isTouching(r.end)||e.remove(r),n.leaveUnmerged||(bo(e,i,a),o.removeDisallowedAttributes(i.parent.getChildren(),e)),t instanceof _g?e.setSelection(i):t.setTo(i),_o(o,i)&&wo(e,i,t),a.detach()})}function bo(e,t,n){const o=t.parent,r=n.parent;if(o!=r&&o.parent&&r.parent&&ko(t,n,e.model.schema)){for(t=cg.createAfter(o),n=cg.createBefore(r),n.isEqual(t)||e.insert(r,t),e.merge(t);n.parent.isEmpty;){const t=n.parent;n=cg.createBefore(t),e.remove(t)}bo(e,t,n)}}function _o(e,t){const n=e.checkChild(t,'$text'),o=e.checkChild(t,'paragraph');return!n&&o}function ko(e,t,n){const o=new pg(e,t);for(const r of o.getWalker())if(n.isObject(r.item)||n.isLimit(r.item))return!1;return!0}function wo(e,t,n){const o=e.createElement('paragraph');e.insert(o,t),n instanceof _g?e.setSelection(o,0):n.setTo(o,0)}function yo(e,t){const n=e.model.schema.getLimitElement(t);e.remove(pg.createIn(n)),wo(e,cg.createAt(n),t)}function vo(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 xo(e,t,n={}){const o=e.schema,r='backward'!=n.direction,i=n.unit?n.unit:'character',a=t.focus,s=new lg({boundaries:Eo(a,r),singleCharacters:!0,direction:r?'forward':'backward'}),l={walker:s,schema:o,isForward:r,unit:i};for(let o;o=s.next();){if(o.done)return;const n=Co(l,o.value);if(n)return void(t instanceof _g?e.change((e)=>{e.setSelectionFocus(n)}):t.setFocus(n))}}function Co(e,t){if('text'==t.type)return'word'===e.unit?To(e.walker,e.isForward):Ao(e.walker,e.unit,e.isForward);if(t.type==(e.isForward?'elementStart':'elementEnd')){if(e.schema.isObject(t.item))return cg.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 Ao(e,t){const n=e.position.textNode;if(n){const o=n.data;for(let r=e.position.offset-n.startOffset;co(o,r)||'character'==t&&po(o,r);)e.next(),r=e.position.offset-n.startOffset}return e.position}function To(e,t){let n=e.position.textNode;if(n)for(let o=e.position.offset-n.startOffset;!Po(n.data,o,t)&&!So(n,o,t);){e.next();const r=t?e.position.nodeAfter:e.position.nodeBefore;if(r){const o=r.data.charAt(t?0:r.data.length-1);fb.includes(o)||(e.next(),n=e.position.textNode)}o=e.position.offset-n.startOffset}return e.position}function Eo(e,t){const n=e.root,o=cg.createAt(n,t?'end':0);return t?new pg(e,o):new pg(o,e)}function Po(e,t,n){const o=t+(n?0:-1);return fb.includes(e.charAt(o))}function So(e,t,n){return t===(n?e.endOffset:0)}function Ro(e,t){return e.change((e)=>{const n=e.createDocumentFragment(),o=t.getFirstRange();if(!o||o.isCollapsed)return n;const r=o.start.root,i=o.start.getCommonPath(o.end),a=r.getNodeByPath(i);let s=o.start.parent==o.end.parent?o:pg.createFromParentsAndOffsets(a,o.start.path[i.length],a,o.end.path[i.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,cg.createAt(n,0),l)[0],r=new pg(cg.createAt(n),t.start),i=new pg(t.end,cg.createAt(n,'end'));Oo(i,e),Oo(r,e)}return n})}function Oo(e,t){const n=[];Array.from(e.getItems({direction:'backward'})).map((e)=>pg.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=pg.createOn(n);n=n.parent,t.remove(e)}})}function Io(e){return e.every((e)=>'string'==typeof e)}function No(e){return!!e&&((e.value&&(e=e.value),Array.isArray(e))?e.some(No):!!(e instanceof Eb))}function Vo(e,t){return e.map((e)=>e instanceof Eb?e.getValue(t):e)}function Lo(e,t,{node:n}){let o=Vo(e,n);o=1==e.length&&e[0]instanceof Sb?o[0]:o.reduce(Go,''),Zo(o)?t.remove():t.set(o)}function Do(e){return{set(t){e.textContent=t},remove(){e.textContent=''}}}function Fo(e,t,n){return{set(o){e.setAttributeNS(n,t,o)},remove(){e.removeAttributeNS(n,t)}}}function Mo(e,t){return{set(n){e.style[t]=n},remove(){e.style[t]=null}}}function Bo(e){const t=Ab(e,(e)=>{if(e&&(e instanceof Eb||Yo(e)||Jo(e)||Qo(e)))return e});return t}function qo(e){if('string'==typeof e?e=Uo(e):e.text&&Ho(e),e.on&&(e.eventListeners=jo(e.on),delete e.on),!e.text){e.attributes&&zo(e.attributes);const t=[];if(e.children)if(Qo(e.children))t.push(e.children);else for(const n of e.children)Yo(n)||Jo(n)||Be(n)?t.push(n):t.push(new Tb(n));e.children=t}return e}function zo(e){for(const t in e)e[t].value&&(e[t].value=[].concat(e[t].value)),Wo(e,t)}function jo(e){for(const t in e)Wo(e,t);return e}function Uo(e){return{text:[e]}}function Ho(e){Array.isArray(e.text)||(e.text=[e.text])}function Wo(e,t){Array.isArray(e[t])||(e[t]=[e[t]])}function Go(e,t){return Zo(t)?e:Zo(e)?t:`${e} ${t}`}function $o(e,t){for(const n in t)e[n]?e[n].push(...t[n]):e[n]=t[n]}function Ko(e,t){if(t.attributes&&(!e.attributes&&(e.attributes={}),$o(e.attributes,t.attributes)),t.eventListeners&&(!e.eventListeners&&(e.eventListeners={}),$o(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 bd('ui-template-extend-children-mismatch: The number of children in extended definition does not match.');let n=0;for(const o of t.children)Ko(e.children[n++],o)}}function Zo(e){return!e&&0!==e}function Jo(e){return e instanceof Ib}function Yo(e){return e instanceof Tb}function Qo(e){return e instanceof Cb}function Xo(){return{children:[],bindings:[],attributes:{}}}function er(e){return'class'==e||'style'==e}function tr(e){for(;e&&'html'!=e.tagName.toLowerCase();){if('static'!=um.window.getComputedStyle(e).position)return e;e=e.parentElement}return null}function nr({element:e,target:t,positions:n,limiter:o,fitInViewport:r}){Vd(t)&&(t=t()),Vd(o)&&(o=o());const i=tr(e.parentElement),a=new eg(e),s=new eg(t);let l,d;if(!o&&!r)[d,l]=or(n[0],s,a);else{const e=o&&new eg(o).getVisible(),t=r&&new eg(um.window);[d,l]=rr(n,s,a,e,t)||or(n[0],s,a)}let{left:c,top:p}=ir(l);if(i){const e=ir(new eg(i)),t=Ke(i);c-=e.left,p-=e.top,c+=i.scrollLeft,p+=i.scrollTop,c-=t.left,p-=t.top}return{left:c,top:p,name:d}}function or(e,t,n){const{left:o,top:r,name:i}=e(t,n);return[i,n.clone().moveTo(o,r)]}function rr(e,t,n,o,r){let i=0,a=0,s,l;const d=n.getArea();return e.some((e)=>{function c(){a=g,i=m,s=u,l=p}const[p,u]=or(e,t,n);let m,g;if(o)if(r){const e=o.getIntersection(r);m=e?e.getIntersectionArea(u):0}else m=o.getIntersectionArea(u);return r&&(g=r.getIntersectionArea(u)),r&&!o?g>a&&c():!r&&o?m>i&&c():g>a&&m>=i?c():g>=a&&m>i&&c(),m===d}),s?[l,s]:null}function ir({left:e,top:t}){const{scrollX:n,scrollY:o}=um.window;return{left:e+n,top:t+o}}function ar(e){return(t)=>t+e}function sr(e){return Xm(e)?e:$e(e)?e.commonAncestorContainer:'function'==typeof e?sr(e()):null}function lr(e,t){return e.top-t.height-Fb.arrowVerticalOffset}function dr(e){return e.bottom+Fb.arrowVerticalOffset}function cr(e){const t=e.next();return t.done?null:t.value}function pr(e){return!!(e.focus&&'none'!=um.window.getComputedStyle(e.element).display)}function ur(e){return e.bindTemplate.to((t)=>{t.target===e.element&&t.preventDefault()})}function mr(e){return Array.isArray(e)?{items:e}:e?Object.assign({items:[]},e):{items:[]}}function gr(e){const t=Fb.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 hr(e){return(e+'').toLowerCase()}function fr({origin:e,originKeystrokeHandler:t,originFocusTracker:n,toolbar:o,beforeFocus:r,afterBlur:i}){n.add(o.element),t.set('Alt+F10',(e,t)=>{n.isFocused&&!o.focusTracker.isFocused&&(r&&r(),o.focus(),t())}),o.keystrokes.set('Esc',(t,n)=>{o.focusTracker.isFocused&&(e.focus(),i&&i(),n())})}function br(e,t){e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=t}function _r(e){return e instanceof HTMLTextAreaElement?e.value:e.innerHTML}function kr(e){if(!Vd(e.updateElement))throw new bd('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,r=()=>e.updateElement();Vd(o.submit)&&(n=o.submit,o.submit=()=>{r(),n.apply(o)}),o.addEventListener('submit',r),e.on('destroy',()=>{o.removeEventListener('submit',r),n&&(o.submit=n)})}}function wr(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 yr(e,t){const n=t.target.ownerDocument,o=t.clientX,r=t.clientY;let i;return n.caretRangeFromPoint&&n.caretRangeFromPoint(o,r)?i=n.caretRangeFromPoint(o,r):t.rangeParent&&(i=n.createRange(),i.setStart(t.rangeParent,t.rangeOffset),i.collapse(!0)),i?e.domConverter.domRangeToView(i):e.document.selection.getFirstRange()}function vr(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 xr(e){return e.replace(/(\s+)<\/span>/g,(e,t)=>1==t.length?' ':t)}function Cr(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=Cr(o);n&&(n.is('containerElement')||o.is('containerElement'))&&(y_.includes(n.name)||y_.includes(o.name)?t+='\n':t+='\n\n'),t+=e,n=o}}return t}function Ar(e){e.return=!1,e.stop()}function Tr(e,t,n,o){const r=n.isCollapsed,i=n.getFirstRange(),a=i.start.parent,s=i.end.parent;if(o.isLimit(a)||o.isLimit(s))return void(r||a!=s||e.deleteContent(n));if(r)Er(t,n,i.start);else{const o=!(i.start.isAtStart&&i.end.isAtEnd);e.deleteContent(n,{leaveUnmerged:o}),o&&(a==s?Er(t,n,n.focus):t.setSelection(s,0))}}function Er(e,t,n){const o=n.parent,r=new o.constructor(o.name,o.getAttributes());n.isAtEnd?e.insert(r,n.parent,'after'):n.isAtStart?e.insert(r,n.parent,'before'):e.split(n),e.setSelection(n.parent.nextSibling,0)}function Pr(e,t){function n(){a&&(r.push(a),a=null)}function o(e){return a&&a.type==e}const r=[];let i=0,a;return e.forEach((e)=>{'equal'==e?(n(),i++):'insert'==e?(o('insert')?a.values.push(t[i]):(n(),a={type:'insert',index:i,values:[t[i]]}),i++):o('delete')?a.howMany++:(n(),a={type:'delete',index:i,howMany:1})}),n(),r}function Sr(e){return!!e.ctrlKey||O_.includes(e.keyCode)}function Rr(e,t){return e instanceof Kp&&t instanceof Kp?e.data===t.data:e===t}function Or(e){if(1==e.newChildren.length-e.oldChildren.length){const t=Se(e.oldChildren,e.newChildren,Rr),n=Pr(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 Nr(e){if(0==e.length)return!1;for(const t of e)if('children'===t.type&&!Or(t))return!0;return!1}function Vr(e){return e.every((e)=>e.is('text'))}function Lr(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 Ur(e,t){return t.filter((e)=>e[0]!==void 0&&e[1]!==void 0).map((t)=>pg.createFromParentsAndOffsets(e,t[0],e,t[1]))}function Hr(e){return'blockQuote'==e.parent.name?e.parent:null}function Wr(e){let t=0,n;const o=[];for(;te.is('img'));if(e&&e.hasAttribute('src')&&n.consumable.test(e,{name:!0})){const o=n.convertItem(e,t.modelCursor),r=cr(o.modelRange.getItems());r&&(n.convertChildren(t.viewItem,cg.createAt(r)),t.modelRange=o.modelRange,t.modelCursor=o.modelCursor)}}}return(t)=>{t.on('element:figure',e)}}function Jr(){function e(e,t,n){if(n.consumable.consume(t.item,e.name)){const e=n.writer,o=n.mapper.toViewElement(t.item),r=o.getChild(0);if(null===t.attributeNewValue){const n=t.attributeOldValue;n.data&&(e.removeAttribute('srcset',r),e.removeAttribute('sizes',r),n.width&&e.removeAttribute('width',r))}else{const n=t.attributeNewValue;n.data&&(e.setAttribute('srcset',n.data,r),e.setAttribute('sizes','100vw',r),n.width&&e.setAttribute('width',n.width,r))}}}return(t)=>{t.on('attribute:srcset:image',e)}}function Yr(e){function t(e,t,n){if(n.consumable.consume(t.item,e.name)){const e=n.writer,o=n.mapper.toViewElement(t.item),r=o.getChild(0);null===t.attributeNewValue?e.removeAttribute(t.attributeKey,r):e.setAttribute(t.attributeKey,t.attributeNewValue,r)}}return(n)=>{n.on(`attribute:${e}:image`,t)}}function Qr(e,t){return e&&t&&e.priority==t.priority&&ei(e.classes)==ei(t.classes)}function Xr(e,t){if(e.priority>t.priority)return!0;return!(e.priorityei(t.classes)}function ei(e){return Array.isArray(e)?e.sort().join(','):e}function ti(e){return!!e.getCustomProperty(Wk)}function ni(e,t,n={}){function o(e){return Array.isArray(e)?e:[e]}return t.setAttribute('contenteditable','false',e),t.addClass($k,e),t.setCustomProperty(Wk,!0,e),e.getFillerOffset=si,n.label&&ri(e,n.label,t),oi(e,t,(e,t,n)=>n.addClass(o(t.classes),e),(e,t,n)=>n.removeClass(o(t.classes),e)),e}function oi(e,t,n,o){const r=new Hk;r.on('change:top',(t,r)=>{r.oldDescriptor&&o(e,r.oldDescriptor,r.writer),r.newDescriptor&&n(e,r.newDescriptor,r.writer)}),t.setCustomProperty('addHighlight',(e,t,n)=>r.add(t,n),e),t.setCustomProperty('removeHighlight',(e,t,n)=>r.remove(t,n),e)}function ri(e,t,n){n.setCustomProperty(Gk,t,e)}function ii(e){const t=e.getCustomProperty(Gk);return t?'function'==typeof t?t():t:''}function ai(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,r)=>{t.setAttribute('contenteditable',r?'false':'true',e)}),e.on('change:isFocused',(n,o,r)=>{r?t.addClass('ck-editor__nested-editable_focused',e):t.removeClass('ck-editor__nested-editable_focused',e)}),e}function si(){return null}function li(e,t,n){return t.setCustomProperty(Zk,!0,e),ni(e,t,{label:function(){const t=e.getChild(0),o=t.getAttribute('alt');return o?`${o} ${n}`:n}})}function di(e){return!!e.getCustomProperty(Zk)&&ti(e)}function ci(e){const t=e.getSelectedElement();return!!(t&&di(t))}function pi(e){return e instanceof sg&&'image'==e.name}function ui(e){const t=e.createEmptyElement('img'),n=e.createContainerElement('figure',{class:'image'});return e.insert(zu.createAt(n),t),n}function mi(e){return e==tm.arrowright||e==tm.arrowleft||e==tm.arrowup||e==tm.arrowdown}function gi(e){return re(e)==ew}function hi(e){for(;e;){if(e instanceof Fu&&!(e instanceof Bu))return!0;e=e.parent}return!1}function fi({emitter:e,activator:t,callback:n,contextElements:o}){e.listenTo(document,'mousedown',(e,{target:r})=>{if(t()){for(const e of o)if(e.contains(r))return;n()}})}function bi({view:e}){e.listenTo(e.element,'submit',(t,n)=>{n.preventDefault(),e.fire('submit')},{useCapture:!0})}function _i(e){const t=e.plugins.get('ContextualBalloon');if(ci(e.editing.view.document.selection)){const n=ki(e);t.updatePosition(n)}}function ki(e){const t=e.editing.view,n=Fb.defaultPositions;return{target:t.domConverter.viewToDom(t.document.selection.getSelectedElement()),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}}function wi(e){const t=/^image\/(jpeg|png|gif|bmp)$/;return t.test(e.type)}function yi(e){const t=e.getSelectedElement();if(t)return cg.createAfter(t);const n=e.getSelectedBlocks().next().value;if(n){if(n.isEmpty)return cg.createAt(n);const t=cg.createAfter(n);return e.focus.isTouching(t)?t:cg.createBefore(n)}return e.focus}function vi(e,t){e.hasClass('ck-appear')||t.addClass('ck-appear',e)}function xi(e,t){t.removeClass('ck-appear',e)}function Ci(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 Ai(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 Ti(e,t,n,o){const r=Si(t);t.insert(zu.createAt(e,'end'),r),n.on('change:uploadedPercent',(e,t,n)=>{o.change((e)=>{e.setStyle('width',n+'%',r)})})}function Ei(e,t){const n=Ri(e);n&&t.remove(ju.createOn(n))}function Pi(e,t,n){const o=new nm('div',{class:'ck-image-upload-complete-icon'});t.insert(zu.createAt(e,'end'),o),setTimeout(()=>{n.change((e)=>e.remove(ju.createOn(o)))},3e3)}function Si(e){const t=e.createUIElement('div',{class:'ck-progress-bar'});return e.setCustomProperty(Vw,!0,t),t}function Ri(e){for(const t of e.getChildren())if(t.getCustomProperty(Vw))return t}function Oi(e){return Array.from(e.types).includes('text/html')&&''!==e.getData('text/html')}function Ii(e,t){return t.checkChild(e.parent,'paragraph')&&!t.isObject(e)}function Ni(e,t,n){const o=n.writer.createElement('paragraph');return n.writer.insert(o,t),n.convertItem(e,cg.createAt(o))}function Vi(e,t,n){const o=new Pg(t);return!!n.checkChild(o,'paragraph')&&!!n.checkChild(o.push('paragraph'),e)}function Li(e,t,n){return n.checkChild(e.parent,t)&&!n.isObject(e)}function Di(e,t=Qw){const n=new t(e),o=new Gw(e),r=new Zw(e,n,o);return n.bind('isEnabled').to(r),n instanceof Qw?n.bind('isOn').to(r,'isOpen'):n.arrowView.bind('isOn').to(r,'isOpen'),Mi(r),r}function Fi(e,t){const n=e.locale,o=e.listView=new ty(n);o.items.bindTo(t).using((e)=>{const t=new ny(n);return t.bind(...Object.keys(e)).to(e),t}),e.panelView.children.add(o),o.items.delegate('execute').to(e)}function Mi(e){Bi(e),qi(e),zi(e)}function Bi(e){e.on('render',()=>{fi({emitter:e,activator:()=>e.isOpen,callback:()=>{e.isOpen=!1},contextElements:[e.element]})})}function qi(e){e.on('execute',()=>{e.isOpen=!1})}function zi(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 ji(e){const n=e.t,t={Paragraph:n('ag'),"Heading 1":n('ah'),"Heading 2":n('ai'),"Heading 3":n('aj')};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 Ui(e,t,n,o){const r=e.document;my.has(r)||(my.set(r,new Map),r.registerPostFixer((e)=>Hi(r,e))),my.get(r).set(t,{placeholderText:n,checkFunction:o}),e.render()}function Hi(e,t){const n=my.get(e);let o=!1;for(const[r,i]of n)Wi(t,r,i)&&(o=!0);return o}function Wi(e,t,n){const o=t.document,r=n.placeholderText;let i=!1;if(!o)return!1;t.getAttribute('data-placeholder')!==r&&(e.setAttribute('data-placeholder',r,t),i=!0);const a=o.selection,s=a.anchor,l=n.checkFunction;if(l&&!l())return t.hasClass('ck-placeholder')&&(e.removeClass('ck-placeholder',t),i=!0),i;const d=!Array.from(t.getChildren()).some((e)=>!e.is('uiElement'));return!o.isFocused&&d?(t.hasClass('ck-placeholder')||(e.addClass('ck-placeholder',t),i=!0),i):(d&&s&&s.parent!==t?!t.hasClass('ck-placeholder')&&(e.addClass('ck-placeholder',t),i=!0):t.hasClass('ck-placeholder')&&(e.removeClass('ck-placeholder',t),i=!0),i)}function Gi(e,t){return(n)=>{const o=n.createEditableElement('figcaption');return n.setCustomProperty(gy,!0,o),Ui(e,o,t),ai(o,n)}}function $i(e){for(const t of e.getChildren())if(t instanceof sg&&'caption'==t.name)return t;return null}function Ki(e){const t=e.parent;return'figcaption'==e.name&&t&&'figure'==t.name&&t.hasClass('image')?{name:!0}:null}function Zi(e,t=!0){return(n,o,r)=>{const i=o.item;if((i.childCount||t)&&pi(i.parent)){if(!r.consumable.consume(o.item,'insert'))return;const t=r.mapper.toViewElement(o.range.start.parent),n=e(r.writer),a=r.writer;i.childCount||a.addClass('ck-hidden',n),Ji(n,o.item,t,r)}}}function Ji(e,t,n,o){const r=zu.createAt(n,'end');o.writer.insert(r,e),o.mapper.bindElements(t,e)}function Yi(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 Qi(e,t){return!(e.childCount||e.hasClass('ck-hidden'))&&(t.addClass('ck-hidden',e),!0)}function Xi(e,t){return!!e.hasClass('ck-hidden')&&(t.removeClass('ck-hidden',e),!0)}function ea(e){return(t,n,o)=>{if(o.consumable.consume(n.item,t.name)){const t=na(n.attributeNewValue,e),r=na(n.attributeOldValue,e),i=o.mapper.toViewElement(n.item),a=o.writer;r&&a.removeClass(r.className,i),t&&a.addClass(t.className,i)}}}function ta(e){const t=e.filter((e)=>!e.isDefault);return(e,n,o)=>{if(n.modelRange){const e=n.viewItem,r=cr(n.modelRange.getItems());if(o.schema.checkAttribute(r,'imageStyle'))for(const n of t)o.consumable.consume(e,{classes:n.className})&&o.writer.setAttribute('imageStyle',n.name,r)}}}function na(e,t){for(const n of t)if(n.name===e)return n}function oa(e=[]){return e.map(ra).map((e)=>Object.assign({},e))}function ra(e){if('string'==typeof e){const t=e;Py[t]?e=Object.assign({},Py[t]):(Zm.warn('image-style-not-found: There is no such image style of given name.',{name:t}),e={name:t})}else if(Py[e.name]){const t=Py[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&&Sy[e.icon]&&(e.icon=Sy[e.icon]),e}function ia(e,t){for(const n of e)t[n.title]&&(n.title=t[n.title]);return e}function aa(e,t){return new pg(sa(e,t,!0),sa(e,t,!1))}function sa(e,t,n){let o=e.textNode||(n?e.nodeBefore:e.nodeAfter),r=null;for(;o&&o.getAttribute('linkHref')==t;)r=o,o=n?o.previousSibling:o.nextSibling;return r?cg.createAt(r,n?'before':'after'):e}function la(e){return e.is('attributeElement')&&!!e.getCustomProperty(My)}function da(e,t){const n=t.createAttributeElement('a',{href:e},{priority:5});return t.setCustomProperty(My,!0,n),n}function ca(e){return e+='',pa(e)?e:'#'}function pa(e){const t=e.replace(By,'');return t.match(qy)}function ua(e,t,n,o){const r=new zy(t,n,o),i=t.document.selection;n.listenTo(e.document,'keydown',(e,t)=>{if(!i.isCollapsed)return;if(t.shiftKey||t.altKey||t.ctrlKey)return;const n=t.keyCode==tm.arrowright,o=t.keyCode==tm.arrowleft;if(!n&&!o)return;const a=i.getFirstPosition();let s;s=n?r.handleForwardMovement(a,t):r.handleBackwardMovement(a,t),s&&e.stop()},{priority:yd.get('high')+1})}function ma(e,t){return ga(e,t)||ha(e,t)}function ga(e,t){const{nodeBefore:n,nodeAfter:o}=e,r=!!n&&n.hasAttribute(t),i=!!o&&o.hasAttribute(t);return i&&(!r||n.getAttribute(t)!==o.getAttribute(t))}function ha(e,t){const{nodeBefore:n,nodeAfter:o}=e,r=!!n&&n.hasAttribute(t),i=!!o&&o.hasAttribute(t);return r&&(!i||n.getAttribute(t)!==o.getAttribute(t))}function fa(e,t){const{nodeBefore:n,nodeAfter:o}=e,r=!!n&&n.hasAttribute(t),i=!!o&&o.hasAttribute(t);return i&&r?o.getAttribute(t)!==n.getAttribute(t):void 0}function ba(e,t){return ma(e.getShiftedBy(-1),t)}function _a(e){return e.getAncestors().find((e)=>la(e))}function ka(e,t,n){const o=t?e[0]:e[e.length-1];if(o.is('listItem'))for(let r=o[t?'previousSibling':'nextSibling'],i=o.getAttribute('indent');r&&r.is('listItem')&&r.getAttribute('indent')>=n;)i>r.getAttribute('indent')&&(i=r.getAttribute('indent')),r.getAttribute('indent')==i&&e[t?'unshift':'push'](r),r=r[t?'previousSibling':'nextSibling']}function wa(e,t){return t.checkChild(e.parent,'listItem')&&!t.isObject(e)}function ya(e){const t=e.createContainerElement('li');return t.getFillerOffset=va,t}function va(){const e=!this.isEmpty&&('ul'==this.getChild(0).name||'ol'==this.getChild(0).name);return this.isEmpty||e?0:null}function xa(e,t,n){const o=n.consumable;if(o.test(t.item,'insert')&&o.test(t.item,'attribute:type')&&o.test(t.item,'attribute:indent')){o.consume(t.item,'insert'),o.consume(t.item,'attribute:type'),o.consume(t.item,'attribute:indent');const e=t.item,r=Da(e,n);Ba(e,r,n)}}function Ca(e,t,n){const o=n.mapper.toViewPosition(t.position).getLastMatchingPosition((e)=>!e.item.is('li')),r=o.nodeAfter,i=n.writer;i.breakContainer(zu.createBefore(r)),i.breakContainer(zu.createAfter(r));const a=r.parent,s=a.previousSibling,l=ju.createOn(a),d=i.remove(l);s&&s.nextSibling&&Ma(i,s,s.nextSibling);const c=n.mapper.toModelElement(r);qa(c.getAttribute('indent')+1,t.position,l.start,r,n);for(const o of ju.createIn(d).getItems())n.mapper.unbindViewElement(o);e.stop()}function Aa(e,t,n){if(!n.consumable.consume(t.item,'attribute:type'))return;const o=n.mapper.toViewElement(t.item),r=n.writer;r.breakContainer(zu.createBefore(o)),r.breakContainer(zu.createAfter(o));let i=o.parent;const a='numbered'==t.attributeNewValue?'ol':'ul';i=r.rename(i,a),Ma(r,i,i.nextSibling),Ma(r,i.previousSibling,i);for(const o of t.item.getChildren())n.consumable.consume(o,'insert')}function Ta(e,t,n){if(n.consumable.consume(t.item,'attribute:indent')){const e=n.mapper.toViewElement(t.item),o=n.writer;o.breakContainer(zu.createBefore(e)),o.breakContainer(zu.createAfter(e));const r=e.parent,i=r.previousSibling,a=ju.createOn(r);o.remove(a),i&&i.nextSibling&&Ma(o,i,i.nextSibling),qa(t.attributeOldValue+1,t.range.start,a.start,e,n),Ba(t.item,e,n);for(const e of t.item.getChildren())n.consumable.consume(e,'insert')}}function Ea(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=zu.createAt(e.parent,'end');if(!t.isEqual(n)){const e=o.remove(new ju(t,n));r.push(e)}e=zu.createAfter(e.parent)}if(0e.is('ul')||e.is('ol')),r=new qu({startPosition:zu.createAt(n,0)});for(const e of r)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 Na(e,t){const n=t.viewPosition,o=n.parent,r=t.mapper;if('ul'==o.name||'ol'==o.name){if(!n.isAtEnd){const e=r.toModelElement(n.nodeAfter);t.modelPosition=cg.createBefore(e)}else{const e=r.toModelElement(n.nodeBefore),o=r.getModelLength(n.nodeBefore);t.modelPosition=cg.createBefore(e).getShiftedBy(o)}e.stop()}else if('li'==o.name&&n.nodeBefore&&('ul'==n.nodeBefore.name||'ol'==n.nodeBefore.name)){const i=r.toModelElement(o);let a=1,s=n.nodeBefore;for(;s&&(s.is('ul')||s.is('ol'));)a+=r.getModelLength(s),s=s.previousSibling;t.modelPosition=cg.createBefore(i).getShiftedBy(a),e.stop()}}function Va(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 r=e.getAttribute('indent');if(r>n){let i;null===o?(o=r-n,i=n):(o>r&&(o=r),i=r-o),t.setAttribute('indent',i,e),s=!0}else o=null,n=e.getAttribute('indent')+1;e=e.nextSibling}}function r(e){for(let n=[],o=null;e&&e.is('listItem');){const r=e.getAttribute('indent');if(o&&o.getAttribute('indent')>r&&(n=n.slice(0,r+1)),0!=r)if(n[r]){const o=n[r];e.getAttribute('type')!=o&&(t.setAttribute('type',o,e),s=!0)}else n[r]=e.getAttribute('type');o=e,e=e.nextSibling}}const i=e.document.differ.getChanges(),a=new Map;let s=!1;for(const o of i)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('indent')&&(t.removeAttribute('indent',e),s=!0),e.hasAttribute('type')&&(t.removeAttribute('type',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&&'indent'==o.attributeKey?n(o.range.start):'attribute'==o.type&&'type'==o.attributeKey&&n(o.range.start);for(const n of a.values())o(n),r(n);return s}function La(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('indent');if(0e)return i;i=i.previousSibling}return null}function Ma(e,t,n){return t&&n&&('ul'==t.name||'ol'==t.name)&&t.name==n.name?e.mergeContainers(zu.createAfter(t)):null}function Ba(e,t,n){const o=t.parent,r=n.mapper,i=n.writer;let a=r.toViewPosition(cg.createBefore(e));const s=Fa(e,{sameIndent:!0,smallerIndent:!0}),l=e.previousSibling;if(s&&s.getAttribute('indent')==e.getAttribute('indent')){const e=r.toViewElement(s);a=i.breakContainer(zu.createAfter(e))}else a=l&&'listItem'==l.name?r.toViewPosition(cg.createAt(l,'end')):r.toViewPosition(cg.createBefore(e));if(a=za(a),i.insert(a,o),l&&'listItem'==l.name){const e=r.toViewElement(l),n=new qu({boundaries:new ju(zu.createAt(e,0),a),ignoreElementEnd:!0});for(const e of n)if(e.item.is('li')){const o=i.breakContainer(zu.createBefore(e.item)),r=e.item.parent,a=zu.createAt(t,'end');Ma(i,a.nodeBefore,a.nodeAfter),i.move(ju.createOn(r),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=r.toModelElement(t);if(n&&n.getAttribute('indent')>e.getAttribute('indent'))o=t;else break}o&&(i.breakContainer(zu.createAfter(o)),i.move(ju.createOn(o.parent),zu.createAt(t,'end')))}}Ma(i,o,o.nextSibling),Ma(i,o.previousSibling,o)}function qa(e,t,n,o,r){const i=Fa(t,{sameIndent:!0,smallerIndent:!0,indent:e}),a=r.mapper,s=r.writer,l=i?i.getAttribute('indent'):null;let d;if(!i)d=n;else if(l==e){const e=a.toViewElement(i).parent;d=zu.createAfter(e)}else{const e=cg.createAt(i,'end');d=a.toViewPosition(e)}d=za(d);for(const i of[...o.getChildren()])(i.is('ul')||i.is('ol'))&&(d=s.move(ju.createOn(i),d).end,Ma(s,i,i.nextSibling),Ma(s,i.previousSibling,i))}function za(e){return e.getLastMatchingPosition((e)=>e.item.is('uiElement'))}function ja(e){let t=1;for(const n of e.getChildren())if('ul'==n.name||'ol'==n.name)for(const e of n.getChildren())t+=ja(e);return t}function Ua(){return(e)=>{e.on('element:table',(e,t,n)=>{const o=t.viewItem;if(!n.consumable.test(o,{name:!0}))return;const{rows:r,headingRows:i,headingColumns:a}=Ha(o),s={};a&&(s.headingColumns=a),i&&(s.headingRows=i);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}),r.length)r.forEach((e)=>n.convertItem(e,cg.createAt(l,'end')));else{const e=n.writer.createElement('tableRow');n.writer.insert(e,cg.createAt(l,'end')),n.writer.insertElement('tableCell',cg.createAt(e,'end'))}t.modelRange=new pg(cg.createBefore(l),cg.createAfter(l)),t.modelCursor=d.cursorParent?cg.createAt(d.cursorParent):t.modelRange.end},{priority:'normal'})}}function Ha(e){const t={headingRows:0,headingColumns:0},n=[],o=[];let r;for(const i of Array.from(e.getChildren()))if('tbody'===i.name||'thead'===i.name||'tfoot'===i.name){'thead'!==i.name||r||(r=i);for(const e of Array.from(i.getChildren()))if('thead'===e.parent.name&&e.parent===r)t.headingRows++,n.push(e);else{o.push(e);const n=Wa(e,t,r);n>t.headingColumns&&(t.headingColumns=n)}}return t.rows=[...n,...o],t}function Wa(e){let t=0,n=0;for(const o=Array.from(e.getChildren()).filter((e)=>'th'===e.name||'td'===e.name);nt.on('insert:table',(t,n,o)=>{const r=n.item;if(!o.consumable.consume(r,'insert'))return;o.consumable.consume(r,'attribute:headingRows:table'),o.consumable.consume(r,'attribute:headingColumns:table');const i=e&&e.asWidget,a=o.writer.createContainerElement('table');let s;i&&(s=ni(a,o.writer));const l=new bv(r),d={headingRows:r.getAttribute('headingRows')||0,headingColumns:r.getAttribute('headingColumns')||0};for(const i of l){const{row:t,cell:n}=i,s=rs(os(t,d),a,o),l=r.getChild(t),c=ts(l,t,s,o);o.consumable.consume(n,'insert');const p=zu.createAt(c,'end');es(i,d,p,o,e)}const c=o.mapper.toViewPosition(n.range.start);o.mapper.bindElements(r,i?s:a),o.writer.insert(c,i?s:a)},{priority:'normal'})}function $a(e={}){return(t)=>t.on('insert:tableRow',(t,n,o)=>{const r=n.item;if(o.consumable.consume(r,'insert')){const t=r.parent,n=o.mapper.toViewElement(t),i=t.getChildIndex(r),a=new bv(t,{startRow:i,endRow:i}),s={headingRows:t.getAttribute('headingRows')||0,headingColumns:t.getAttribute('headingColumns')||0};for(const t of a){const a=rs(os(i,s),n,o),l=ts(r,i,a,o);o.consumable.consume(t.cell,'insert');const d=zu.createAt(l,'end');es(t,s,d,o,e)}}},{priority:'normal'})}function Ka(e={}){return(t)=>t.on('insert:tableCell',(t,n,o)=>{const r=n.item;if(o.consumable.consume(r,'insert')){const t=r.parent,n=t.parent,i=n.getChildIndex(t),a=new bv(n,{startRow:i,endRow:i}),s={headingRows:n.getAttribute('headingRows')||0,headingColumns:n.getAttribute('headingColumns')||0};for(const n of a)if(n.cell===r){const i=o.mapper.toViewElement(t),a=zu.createAt(i,t.getChildIndex(r));return void es(n,s,a,o,e)}}},{priority:'normal'})}function Za(e={}){const t=!!e.asWidget;return(e)=>e.on('attribute:headingRows:table',(e,n,o)=>{function r(e,t,n){return e>t&&es){const e=Array.from(i.getChildren()).filter(({index:e})=>r(e,s-1,l)),n=rs('thead',a,o);ls(e,n,o,'end');for(const n of e)for(const e of n.getChildren())Qa(e,'th',o,t);ss('tbody',a,o)}else{const e=Array.from(i.getChildren()).filter(({index:e})=>r(e,l-1,s)).reverse(),n=rs('tbody',a,o);ls(e,n,o);const d=new bv(i,{startRow:l?l-1:l,endRow:s-1}),c={headingRows:i.getAttribute('headingRows')||0,headingColumns:i.getAttribute('headingColumns')||0};for(const e of d)Xa(e,c,o,t);ss('thead',a,o)}},{priority:'normal'})}function Ja(e={}){const t=!!e.asWidget;return(e)=>e.on('attribute:headingColumns:table',(e,n,o)=>{const r=n.item;if(o.consumable.consume(n.item,e.name)){const e={headingRows:r.getAttribute('headingRows')||0,headingColumns:r.getAttribute('headingColumns')||0},i=n.attributeOldValue,a=n.attributeNewValue,s=(i>a?i:a)-1;for(const n of new bv(r))n.column>s||Xa(n,e,o,t)}},{priority:'normal'})}function Ya(){return(e)=>e.on('remove:tableRow',(e,t,n)=>{e.stop();const o=n.mapper.toViewPosition(t.position).getLastMatchingPosition((e)=>!e.item.is('tr')),r=o.nodeAfter,i=r.parent,a=ju.createOn(r),s=n.writer.remove(a);for(const o of ju.createIn(s).getItems())n.mapper.unbindViewElement(o);i.childCount||n.writer.remove(ju.createOn(i))},{priority:'higher'})}function Qa(e,t,n,o){const r=n.mapper.toViewElement(e);let i;if(o){const e=n.writer.createEditableElement(t,r.getAttributes());i=ai(e,n.writer),n.writer.insert(zu.createAfter(r),i),n.writer.move(ju.createIn(r),zu.createAt(i)),n.writer.remove(ju.createOn(r))}else i=n.writer.rename(r,t);n.mapper.bindElements(e,i)}function Xa(e,t,n,o){const{cell:r}=e,i=ns(e,t),a=n.mapper.toViewElement(r);a&&a.name!==i&&Qa(r,i,n,o)}function es(e,t,n,o,r){const i=r&&r.asWidget,a=ns(e,t),s=i?ai(o.writer.createEditableElement(a),o.writer):o.writer.createContainerElement(a),l=e.cell;o.mapper.bindElements(l,s),o.writer.insert(n,s)}function ts(e,t,n,o){let r=o.mapper.toViewElement(e);if(!r){o.consumable.consume(e,'insert'),r=o.writer.createContainerElement('tr'),o.mapper.bindElements(e,r);const i=e.parent.getAttribute('headingRows')||0,a=0=i?t-i:t,s=zu.createAt(n,a);o.writer.insert(s,r)}return r}function ns(e,t){const{row:n,column:o}=e,{headingColumns:r,headingRows:i}=t;if(i&&i>n)return'th';return r&&r>o?'th':'td'}function os(e,t){return er?o.setAttribute(e,t,n):o.removeAttribute(e,n)}function ps(e,t,n,o,r,i={}){for(let a=0;at.cell===e),c=d.column,p=l.find(({row:e,column:n})=>n===c&&('down'==t?s===e:s===a+e));return p&&p.cell}function bs(e,t,n){const o=[],r=t>n?n:0,i=new bv(e,{startRow:r,endRow:t});for(const{row:r,rowspan:a,cell:s}of i)1t&&o.push(s);return o}function _s(e,t,n,o){const r=e.getAttribute(t)||0;n!==r&&cs(t,n,e,o,0)}function ks(e,t,n){const o=e.parent,r=o.parent,i=o.index,a=parseInt(e.getAttribute('rowspan')),s=t-i,l={},d=a-s;1n;n++)e+=t(65536*(1+Math.random())).toString(16).substring(1);return e}function vs(e,t){e[Bv]||(e[Bv]=t||ys())}function xs(e){return e[Bv]}function Cs(e){return e._events||Object.defineProperty(e,'_events',{value:{}}),e._events}function As(){return{callbacks:[],childEvents:[]}}function Ts(e,t){const n=Cs(e);if(n[t])return;let o=t,r=null;const i=[];for(;''!==o&&!n[o];)n[o]=As(),i.push(n[o]),r&&n[o].childEvents.push(r),r=o,o=o.substr(0,o.lastIndexOf(':'));if(''!==o){for(const e of i)e.callbacks=n[o].callbacks.slice();n[o].childEvents.push(r)}}function Es(e,t){const n=Cs(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 Is(e){var t=-1,n=e?e.length:0;for(this.clear();++te.add(t))}function Qs(e){return'string'==typeof e?[new cA(e)]:(Us(e)||(e=[e]),Array.from(e).map((e)=>'string'==typeof e?new cA(e):e instanceof pA?new cA(e.data):e))}function Xs(){for(const e of this.getChildren())if(!e.is('uiElement'))return null;return this.childCount}function el(e,t,n){if(!$v(n))return!1;var o=typeof t;return!('number'==o?!(Lx(n)&&Jx(t,n.length)):!('string'==o&&t in n))&&jv(n[t],e)}function tl(e){e=null==e?e:Object(e);var t=[];for(var n in e)t.push(n);return t}function nl(e){QA in e||(Object.defineProperty(e,QA,{value:new Map}),Object.defineProperty(e,XA,{value:new Map}),Object.defineProperty(e,eT,{value:new Map}))}function ol(...e){const t=sl(...e),n=Array.from(this._bindings.keys()),o=n.length;if(!t.callback&&1{if(e.properties.length&&e.properties.length!==o)throw new Vv('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),pl(this._observable,this._to),dl(this),this._bindProperties.forEach((e)=>{cl(this._observable,e)})}function rl(e,t,n){if(1[e,t]);return Array.prototype.concat.apply([],n)}function al(e){return e.every((e)=>'string'==typeof e)}function sl(...e){if(!e.length)throw new Vv('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 Vv('observable-bind-to-parse-error: Invalid argument syntax in `to()`.')}),t}function ll(e,t,n,o){const r=e[XA],i=r.get(n),a=i||{};a[o]||(a[o]=new Set),a[o].add(t),i||r.set(n,a)}function dl(e){let t;e._bindings.forEach((n,o)=>{e._to.forEach((r)=>{t=r.properties[n.callback?0:e._bindProperties.indexOf(o)],n.to.push([r.observable,t]),ll(e._observable,n,r.observable,t)})})}function cl(e,t){const n=e[eT],o=n.get(t);let r;o.callback?r=o.callback.apply(e,o.to.map((e)=>e[0][e[1]])):(r=o.to[0],r=r[0][r[1]]),e.hasOwnProperty(t)?e[t]=r:e.set(t,r)}function pl(e,t){t.forEach((t)=>{const n=e[XA];let o;n.get(t.observable)||e.listenTo(t.observable,'change',(r,i)=>{o=n.get(t.observable)[i],o&&o.forEach((t)=>{cl(e,t.property)})})})}function ul(e){return!!(e.item.is('attributeElement')||e.item.is('uiElement'))}function ml(e){let t=0;for(const n of e)t++;return t}function gl(e){return'string'==typeof e?[new cA(e)]:(Us(e)||(e=[e]),Array.from(e).map((e)=>'string'==typeof e?new cA(e):e instanceof pA?new cA(e.data):e))}function hl(e){return e instanceof Text&&e.data.substr(0,fT)===bT}function fl(e){return e.data.length==fT&&hl(e)}function bl(e){return hl(e)?e.data.slice(fT):e.data}function _l(e,t){let n=_T.get(t);return n||(n=t(window.document),_T.set(t,n)),e.isEqualNode(n)}function kl(e){let t=0;for(;e.previousSibling;)e=e.previousSibling,t++;return t}function wl(e){const t=[];for(;e&&e.nodeType!=Node.DOCUMENT_NODE;)t.unshift(e),e=e.parentNode;return t}function yl(e,t){const n=wl(e),o=wl(t);let r=0;for(;n[r]==o[r]&&n[r];)r++;return 0==r?null:n[r-1]}function vl(e){return'[object Text]'==Object.prototype.toString.call(e)}function xl(e,t,n){let o=wl(e);return n&&(o=o.slice(o.indexOf(n)+1)),o.some((e)=>e.tagName&&t.includes(e.tagName.toLowerCase()))}function Cl(e,t){for(;e&&e!=kT.document;)t(e),e=e.parentNode}function Al(e){e.addRule('highlightedCodeBlock',{filter:function(e){var t=e.firstChild;return'DIV'===e.nodeName&&vT.test(e.className)&&t&&'PRE'===t.nodeName},replacement:function(e,t,n){var o=t.className||'',r=(o.match(vT)||[null,''])[1];return'\n\n'+n.fence+r+'\n'+t.firstChild.textContent+'\n'+n.fence+'\n\n'}})}function Tl(e){e.addRule('strikethrough',{filter:['del','s','strike'],replacement:function(e){return'~'+e+'~'}})}function El(e){var t=e.parentNode;return'THEAD'===t.nodeName||t.firstChild===e&&('TABLE'===t.nodeName||Pl(t))&&CT.call(e.childNodes,function(e){return'TH'===e.nodeName})}function Pl(e){var t=e.previousSibling;return'TBODY'===e.nodeName&&(!t||'THEAD'===t.nodeName&&/^\s*$/i.test(t.textContent))}function Sl(e,t){var n=xT.call(t.parentNode.childNodes,t),o=' ';return 0===n&&(o='| '),o+e+' |'}function Rl(e){for(var t in e.keep(function(e){return'TABLE'===e.nodeName&&!El(e.rows[0])}),AT)e.addRule(t,AT[t])}function Ol(e){e.addRule('taskListItems',{filter:function(e){return'checkbox'===e.type&&'LI'===e.parentNode.nodeName},replacement:function(e,t){return(t.checked?'[x]':'[ ]')+' '}})}function Il(e){e.use([Al,Tl,Rl,Ol])}function Nl(e){for(var t=1,n;t'+e+'','text/html');t=n.getElementById('turndown-root')}else t=e.cloneNode(!0);return zl({element:t,isBlock:Ll,isVoid:Dl}),t}function Wl(){return LT=LT||new OT,LT}function Gl(e){return e.isBlock=Ll(e),e.isCode='code'===e.nodeName.toLowerCase()||e.parentNode.isCode,e.isBlank=$l(e),e.flankingWhitespace=Kl(e),e}function $l(e){return-1===['A','TH','TD'].indexOf(e.nodeName)&&/^\s*$/i.test(e.textContent)&&!Dl(e)&&!Fl(e)}function Kl(e){var t='',n='';if(!e.isBlock){var o=/^[ \r\n\t]/.test(e.textContent),r=/[ \r\n\t]$/.test(e.textContent);o&&!Zl('left',e)&&(t=' '),r&&!Zl('right',e)&&(n=' ')}return{leading:t,trailing:n}}function Zl(e,t){var n,o,r;return'left'===e?(n=t.previousSibling,o=/ $/):(n=t.nextSibling,o=/^ /),n&&(3===n.nodeType?r=o.test(n.nodeValue):1===n.nodeType&&!Ll(n)&&(r=o.test(n.textContent))),r}function Jl(e){if(!(this instanceof Jl))return new Jl(e);this.options=Nl({},{rules:ST,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 Ml(this.options)}function Yl(e){var t=this;return IT.call(e.childNodes,function(e,n){n=new Gl(n);var o='';return 3===n.nodeType?o=n.isCode?n.nodeValue:t.escape(n.nodeValue):1===n.nodeType&&(o=Xl.call(t,n)),td(e,o)},'')}function Ql(e){var t=this;return this.rules.forEach(function(n){'function'==typeof n.append&&(e=td(e,n.append(t.options)))}),e.replace(/^[\t\r\n]+/,'').replace(/[\t\r\n\s]+$/,'')}function Xl(e){var t=this.rules.forNode(e),n=Yl.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 ed(e,t){var n=[e.match(VT)[0],t.match(NT)[0]].sort(),o=n[n.length-1];return 2>o.length?o:'\n\n'}function td(e,t){var n=ed(e,t);return e=e.replace(VT,''),t=t.replace(NT,''),e+n+t}function nd(e){return null!=e&&('string'==typeof e||e.nodeType&&(1===e.nodeType||9===e.nodeType||11===e.nodeType))}var od=Number.POSITIVE_INFINITY,rd=Math.max;Object.defineProperty(r,'__esModule',{value:!0});var id=Object.getPrototypeOf,ad=function(e){return id(Object(e))},sd=function(e){var t=!1;if(null!=e&&'function'!=typeof e.toString)try{t=!!(e+'')}catch(t){}return t},ld=function(e){return!!e&&'object'==typeof e},dd=Object.prototype,cd=Function.prototype.toString,pd=dd.hasOwnProperty,ud=cd.call(Object),md=dd.toString,gd=function(e){if(!ld(e)||md.call(e)!='[object Object]'||sd(e))return!1;var t=ad(e);if(null===t)return!0;var n=pd.call(t,'constructor')&&t.constructor;return'function'==typeof n&&n instanceof n&&cd.call(n)==ud};class hd{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(gd(t))return void this._setObjectToTarget(e,t,o);const r=t.split('.');t=r.pop();for(const i of r)gd(e[i])||(e[i]={}),e=e[i];return gd(n)?(gd(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(!gd(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 fd='https://docs.ckeditor.com/ckeditor5/latest/framework/guides/support/error-codes.html';class bd extends Error{constructor(e,t){e=a(e),t&&(e+=' '+JSON.stringify(t)),super(e),this.name='CKEditorError',this.data=t}static isCKEditorError(e){return e instanceof bd}}var _d=function(){return function e(){e.called=!0}};class kd{constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=_d(),this.off=_d()}}const wd={get(e){return'number'==typeof e?e:this[e]||this.normal},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};var yd=wd;const vd=Symbol('listeningTo'),xd=Symbol('emitterId'),Cd={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 r,i;this[vd]||(this[vd]={});const a=this[vd];c(e)||d(e);const s=c(e);(r=a[s])||(r=a[s]={emitter:e,callbacks:{}}),(i=r.callbacks[t])||(i=r.callbacks[t]=[]),i.push(n),m(e,t);const l=g(e,t),p=yd.get(o.priority),u={callback:n,priority:p};for(const r of l){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 Ad=Cd,Td=function(e,t){return e===t||e!==e&&t!==t},Ed=function(e,t){for(var n=e.length;n--;)if(Td(e[n][0],t))return n;return-1},Pd=Array.prototype,Sd=Pd.splice;k.prototype.clear=function(){this.__data__=[]},k.prototype['delete']=function(e){var t=this.__data__,n=Ed(t,e);if(0>n)return!1;var o=t.length-1;return n==o?t.pop():Sd.call(t,n,1),!0},k.prototype.get=function(e){var t=this.__data__,n=Ed(t,e);return 0>n?void 0:t[n][1]},k.prototype.has=function(e){return-1o?n.push([e,t]):n[o][1]=t,this};var Rd=k,Od=function(e){var t=typeof e;return!!e&&('object'==t||'function'==t)},Id=Object.prototype,Nd=Id.toString,Vd=function(e){var t=Od(e)?Nd.call(e):'';return t=='[object Function]'||t=='[object GeneratorFunction]'},Ld=Function.prototype.toString,Dd=function(e){if(null!=e){try{return Ld.call(e)}catch(t){}try{return e+''}catch(t){}}return''},Fd=/[\\^$.*+?()[\]{}|]/g,Md=/^\[object .+?Constructor\]$/,Bd=Object.prototype,qd=Function.prototype.toString,zd=Bd.hasOwnProperty,jd=RegExp('^'+qd.call(zd).replace(Fd,'\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,'$1.*?')+'$'),Ud=function(e){if(!Od(e))return!1;var t=Vd(e)||sd(e)?jd:Md;return t.test(Dd(e))},Hd=function(e,t){var n=e[t];return Ud(n)?n:void 0},Wd=Hd(Object,'create'),Gd=Wd,$d=Object.prototype,Kd=$d.hasOwnProperty,Zd=Object.prototype,Jd=Zd.hasOwnProperty;w.prototype.clear=function(){this.__data__=Gd?Gd(null):{}},w.prototype['delete']=function(e){return this.has(e)&&delete this.__data__[e]},w.prototype.get=function(e){var t=this.__data__;if(Gd){var n=t[e];return n==='__lodash_hash_undefined__'?void 0:n}return Kd.call(t,e)?t[e]:void 0},w.prototype.has=function(e){var t=this.__data__;return Gd?t[e]!==void 0:Jd.call(t,e)},w.prototype.set=function(e,t){var n=this.__data__;return n[e]=Gd&&void 0===t?'__lodash_hash_undefined__':t,this};var Yd=w,Qd=i(2),Xd=Hd(Qd.a,'Map'),ec=Xd,tc=function(e){var t=typeof e;return'string'==t||'number'==t||'symbol'==t||'boolean'==t?'__proto__'!==e:null===e},nc=function(e,t){var n=e.__data__;return tc(t)?n['string'==typeof t?'string':'hash']:n.map};y.prototype.clear=function(){this.__data__={hash:new Yd,map:new(ec||Rd),string:new Yd}},y.prototype['delete']=function(e){return nc(this,e)['delete'](e)},y.prototype.get=function(e){return nc(this,e).get(e)},y.prototype.has=function(e){return nc(this,e).has(e)},y.prototype.set=function(e,t){return nc(this,e).set(e,t),this};var oc=y;v.prototype.clear=function(){this.__data__=new Rd},v.prototype['delete']=function(e){return this.__data__['delete'](e)},v.prototype.get=function(e){return this.__data__.get(e)},v.prototype.has=function(e){return this.__data__.has(e)},v.prototype.set=function(e,t){var n=this.__data__;return n instanceof Rd&&n.__data__.length==200&&(n=this.__data__=new oc(n.__data__)),n.set(e,t),this};var rc=v,ic=function(e,t){for(var n=-1,o=e.length;++nt||t>e.data.length)throw new bd('view-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.');if(0>n||t+n>e.data.length)throw new bd('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 Jp{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=O(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=O(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 r of o)null!==r.parent&&r._remove(),r.parent=this,this._children.splice(e,0,r),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),gd(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 Qp extends Yp{constructor(e,t,n){super(e,t,n),this.getFillerOffset=q}is(e,t=null){return t?'containerElement'==e&&t==this.name||super.is(e,t):'containerElement'==e||super.is(e)}}var Xp=z,eu=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)},tu=Object.prototype,nu=tu.toString,ou=function(e){return'symbol'==typeof e||ld(e)&&nu.call(e)=='[object Symbol]'},ru=0/0,iu=/^\s+|\s+$/g,au=/^[-+]0x[0-9a-f]+$/i,su=/^0b[01]+$/i,lu=/^0o[0-7]+$/i,du=parseInt,cu=function(e){if('number'==typeof e)return e;if(ou(e))return ru;if(Od(e)){var t=Vd(e.valueOf)?e.valueOf():e;e=Od(t)?t+'':t}if('string'!=typeof e)return 0===e?e:+e;e=e.replace(iu,'');var n=su.test(e);return n||lu.test(e)?du(e.slice(2),n?2:8):au.test(e)?ru:+e},pu=1/0,uu=function(e){if(!e)return 0===e?e:0;if(e=cu(e),e===pu||e===-pu){var t=0>e?-1:1;return t*17976931348623157e292}return e===e?e:0},mu=function(e){var t=uu(e),n=t%1;return t===t?n?t-n:t:0},gu=rd,hu=function(e,t){if('function'!=typeof e)throw new TypeError('Expected a function');return t=gu(void 0===t?e.length-1:mu(t),0),function(){for(var n=arguments,o=-1,r=gu(n.length-t,0),i=Array(r);++or?void 0:i,r=1),t=Object(t);++o{this.set(t,e[t])},this);U(this);const n=this[Ou];if(e in this&&!n.has(e))throw new bd('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);o===t&&n.has(e)||(n.set(e,t),this.fire('change:'+e,e,t,o))}}),this[e]=t},bind(...e){if(!e.length||!$(e))throw new bd('observable-bind-wrong-properties: All properties must be strings.');if(new Set(e).size!==e.length)throw new bd('observable-bind-duplicate-properties: Properties must be unique.');U(this);const t=this[Nu];e.forEach((e)=>{if(t.has(e))throw new bd('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:H,toMany:W,_observable:this,_bindProperties:e,_to:[],_bindings:n}},unbind(...e){if(!(Ou in this))return;const t=this[Nu],n=this[Iu];if(e.length){if(!$(e))throw new bd('observable-unbind-wrong-properties: Properties must be strings.');e.forEach((e)=>{const o=t.get(e);if(!o)return;let r,i,a,s;o.to.forEach((e)=>{r=e[0],i=e[1],a=n.get(r),s=a[i],s.delete(o),s.size||delete a[i],Object.keys(a).length||(n.delete(r),this.stopListening(r,'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 bd('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)}}};Ru(Vu,Ad);var Lu=Vu;const Du=Symbol('document');class Fu extends Qp{constructor(e,t,n){super(e,t,n),this.set('isReadOnly',!1),this.set('isFocused',!1)}get document(){return this.getCustomProperty(Du)}set _document(e){if(this.getCustomProperty(Du))throw new bd('view-editableelement-document-already-set: View document is already set.');this._setCustomProperty(Du,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})}}_(Fu,Lu);const Mu=Symbol('rootName');class Bu extends Fu{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(Mu)}set rootName(e){this._setCustomProperty(Mu,e)}set _name(e){this.name=e}}class qu{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new bd('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 bd('view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.',{direction:e.direction});this.boundaries=e.boundaries||null,this.position=e.startPosition?zu.createFromPosition(e.startPosition):zu.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=zu.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 Kp){if(e.isAtEnd)return this.position=zu.createAfter(n),this._next();o=n.data[e.offset]}else o=n.getChild(e.offset);if(o instanceof Yp)return this.shallow?e.offset++:e=new zu(o,0),this.position=e,this._formatReturnValue('elementStart',o,t,e,1);if(!(o instanceof Kp)){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 r=new Zp(n,e.offset,o);return e.offset+=o,this.position=e,this._formatReturnValue('text',r,t,e,o)}return e=zu.createAfter(n),this.position=e,this.ignoreElementEnd?this._next():this._formatReturnValue('elementEnd',n,t,e)}if(this.singleCharacters)return e=new zu(o,0),this.position=e,this._next();else{let n=o.data.length,r;return o==this._boundaryEndParent?(n=this.boundaries.end.offset,r=new Zp(o,0,n),e=zu.createAfter(r)):(r=new Zp(o,0,o.data.length),e.offset++),this.position=e,this._formatReturnValue('text',r,t,e,n)}}_previous(){let e=zu.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 Kp){if(e.isAtStart)return this.position=zu.createBefore(n),this._previous();o=n.data[e.offset-1]}else o=n.getChild(e.offset-1);if(o instanceof Yp)return this.shallow?(e.offset--,this.position=e,this._formatReturnValue('elementStart',o,t,e,1)):(e=new zu(o,o.childCount),this.position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue('elementEnd',o,t,e));if(!(o instanceof Kp)){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 r=new Zp(n,e.offset,o);return this.position=e,this._formatReturnValue('text',r,t,e,o)}return e=zu.createBefore(n),this.position=e,this._formatReturnValue('elementStart',n,t,e,1)}if(this.singleCharacters)return e=new zu(o,o.data.length),this.position=e,this._previous();else{let n=o.data.length,r;if(o==this._boundaryStartParent){const t=this.boundaries.start.offset;r=new Zp(o,t,o.data.length-t),n=r.data.length,e=zu.createBefore(r)}else r=new Zp(o,0,o.data.length),e.offset--;return this.position=e,this._formatReturnValue('text',r,t,e,n)}}_formatReturnValue(e,t,n,o,r){return t instanceof Zp&&(t.offsetInText+t.data.length==t.textNode.data.length&&('forward'!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=zu.createAfter(t.textNode):(o=zu.createAfter(t.textNode),this.position=o)),0===t.offsetInText&&('backward'!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=zu.createBefore(t.textNode):(o=zu.createBefore(t.textNode),this.position=o))),{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:o,length:r}}}}class zu{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 Fu);)if(e.parent)e=e.parent;else return null;return e}getShiftedBy(e){const t=zu.createFromPosition(this),n=t.offset+e;return t.offset=0>n?0:n,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const n=new qu(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=P(t,n);return'prefix'===o?'before':'extension'===o?'after':t[o]this._items.length||0>t)throw new bd('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 bd('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,r;const i=this._idProperty;if('string'==typeof e?(o=e,r=this._itemMap.get(o),t=!r,r&&(n=this._items.indexOf(r))):'number'==typeof e?(n=e,r=this._items[n],t=!r,r&&(o=r[i])):(r=e,o=r[i],n=this._items.indexOf(r),t=-1==n||!this._itemMap.get(o)),t)throw new bd('collection-remove-404: Item not found.');this._items.splice(n,1),this._itemMap.delete(o);const a=this._bindToInternalToExternalMap.get(r);return this._bindToInternalToExternalMap.delete(r),this._bindToExternalToInternalMap.delete(a),this.fire('remove',r,n),r}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 bd('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,r)=>{const i=t._bindToCollection==this,a=t._bindToInternalToExternalMap.get(o);if(i&&a)this._bindToExternalToInternalMap.set(o,a),this._bindToInternalToExternalMap.set(a,o);else{const n=e(o);if(!n)return void this._skippedIndexesFromExternal.push(r);let a=r;for(const e of this._skippedIndexesFromExternal)r>e&&a--;for(const e of t._skippedIndexesFromExternal)a>=e&&a++;this._bindToExternalToInternalMap.set(o,n),this._bindToInternalToExternalMap.set(n,o),this.add(n,a);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]()}}_(Wu,Ad);class Gu{constructor(){this.selection=new Hu,this.roots=new Wu({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)}}_(Gu,Lu);const $u=10;class Ku extends Yp{constructor(e,t,n){super(e,t,n),this.getFillerOffset=te,this._priority=$u,this._id=null,this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new bd('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}}Ku.DEFAULT_PRIORITY=$u;class Zu extends Yp{constructor(e,t,n){super(e,t,n),this.getFillerOffset=oe}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 $p||0=t;t++){const o=n(t);e[o.toLowerCase()]=t}for(let t=48;57>=t;t++)e[t-48]=t;for(let t=112;123>=t;t++)e['f'+(t-111)]=t;return e}();class nm extends Yp{constructor(e,t,n){super(e,t,n),this.getFillerOffset=de}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 $p||0e.is('element')&&t.isSimilar(e));e&&(r=ju.createIn(e))}r&&(r.end.isAfter(e.end)&&(r.end=e.end),r.start.isBefore(e.start)&&(r.start=e.start),this.remove(r))}}move(e,t){let n;if(t.isAfter(e.end)){t=this._breakAttributes(t,!0);const o=t.parent,r=o.childCount;e=this._breakAttributesRange(e,!0),n=this.remove(e),t.offset+=o.childCount-r}else n=this.remove(e);return this.insert(t,n)}wrap(e,t){if(!(t instanceof Ku))throw new bd('view-writer-wrap-invalid-attribute');if(ye(e),!e.isCollapsed)return this._wrapRange(e,t);else{let n=e.start;n.parent.is('element')&&!ue(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 ju(n)}}unwrap(e,t){if(!(t instanceof Ku))throw new bd('view-writer-unwrap-invalid-attribute');if(ye(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 Ku&&this._unwrapAttributeElement(t,e)){const e=this.mergeAttributes(n);e.isEqual(n)||o.offset--;const t=this.mergeAttributes(o);return new ju(e,t)}}const r=n.parent,i=this._unwrapChildren(r,n.offset,o.offset,t),a=this.mergeAttributes(i.start);a.isEqual(i.start)||i.end.offset--;const s=this.mergeAttributes(i.end);return new ju(a,s)}rename(e,t){const n=new Qp(t,e.getAttributes());return this.insert(zu.createAfter(e),n),this.move(ju.createIn(e),zu.createAt(n)),this.remove(ju.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 ju(e,e.getShiftedBy(1));this.wrap(o,t);const r=new zu(n.parent,n.index);n._remove();const i=r.nodeBefore,a=r.nodeAfter;return i instanceof Kp&&a instanceof Kp?be(i,a):he(r)}_wrapAttributeElement(e,t){if(!ve(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(!ve(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(ye(e),e.isCollapsed){const n=this._breakAttributes(e.start,t);return new ju(n,n)}const r=this._breakAttributes(o,t),i=r.parent.childCount,a=this._breakAttributes(n,t);return r.offset+=r.parent.childCount-i,new ju(a,r)}_breakAttributes(e,t=!1){const n=e.offset,o=e.parent;if(e.parent.is('emptyElement'))throw new bd('view-writer-cannot-break-empty-element');if(e.parent.is('uiElement'))throw new bd('view-writer-cannot-break-ui-element');if(!t&&o.is('text')&&we(o.parent))return zu.createFromPosition(e);if(we(o))return zu.createFromPosition(e);if(o.is('text'))return this._breakAttributes(fe(e),t);const r=o.childCount;if(n==r){const e=new zu(o.parent,o.index+1);return this._breakAttributes(e,t)}if(0===n){const e=new zu(o.parent,o.index);return this._breakAttributes(e,t)}else{const e=o.index+1,r=o._clone();o.parent._insertChild(e,r),this._addToClonedElementsGroup(r);const i=o.childCount-n,a=o._removeChildren(n,i);r._appendChild(a);const s=new zu(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 im=[Kp,Ku,Qp,Zu,nm],am=(e)=>{const t=e.createElement('br');return t.dataset.ckeFiller=!0,t},sm=(e)=>e.createTextNode('\xA0'),lm=7;let dm='';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){function n(e,t){if(e===t)return!0;return Ie(e)&&Ie(t)?e.data===t.data:!!(Te(e,o.blockFiller)&&Te(t,o.blockFiller))}const o=this.domConverter,r=o.mapViewToDom(e);if(r){const a=r.ownerDocument,s=t.inlineFillerPosition,l=r.childNodes,d=Array.from(o.viewChildrenToDom(e,a,{bind:!0}));s&&s.parent==e&&this._addInlineFiller(a,d,s.offset);const c=Se(l,d,n);let p=0;const i=new Set;for(const e of c)'insert'===e?(Re(r,p,d[p]),p++):'delete'===e?(i.add(l[p]),Oe(l[p])):(this._markDescendantTextToSync(o.domToView(d[p])),p++);for(const e of i)e.parentNode||this.domConverter.unbindDomElement(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(),r=t.createRange();o.removeAllRanges(),r.selectNodeContents(n),o.addRange(r),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)}}}_(pm,Lu);var um={window,document};class mm{constructor(e={}){this.blockFiller=e.blockFiller||am,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 Uu(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 r of this.viewChildrenToDom(e,t,n))o.appendChild(r);return o}}*viewChildrenToDom(e,t,n={}){const o=e.getFillerOffset&&e.getFillerOffset();let r=0;for(const i of e.getChildren())o===r&&(yield this.blockFiller(t)),yield this.viewToDom(i,t,n),r++;o===r&&(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 xe(n)&&(o+=lm),{parent:n,offset:o}}else{let n,o,r;if(0===e.offset){if(n=this.mapViewToDom(t),!n)return null;r=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,r=o.nextSibling}if(Ie(r)&&xe(r))return{parent:r,offset:lm};const i=o?Ve(o)+1:0;return{parent:n,offset:i}}}domToView(e,t={}){if(Te(e,this.blockFiller))return null;const n=this.getParentUIElement(e,this._domToViewMapping);if(n)return n;if(Ie(e)){if(Ce(e))return null;else{const t=this._processDataFromDomText(e);return''===t?null:new Kp(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 om,t.bind&&this.bindDocumentFragments(e,n);else{const o=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();n=new Yp(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 zu(n,o)):null}if(0===t){const t=this.mapDomToView(e);if(t)return new zu(t,0)}else{const n=e.childNodes[t-1],o=Ie(n)?this.findCorrespondingViewText(n):this.mapDomToView(n);if(o&&o.parent)return new zu(o.parent,o.index+1)}return null}mapDomToView(e){return this.getParentUIElement(e)||this._domToViewMapping.get(e)}findCorrespondingViewText(e){if(Ce(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 Kp?e.nextSibling:null}}else{const t=this.mapDomToView(e.parentNode);if(t){const e=t.getChild(0);return e instanceof Kp?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}=um.window,o=[];Me(t,(e)=>{const{scrollLeft:t,scrollTop:n}=e;o.push([t,n])}),t.focus(),Me(t,(e)=>{const[t,n]=o.shift();e.scrollLeft=t,e.scrollTop=n}),um.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=Le(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(Ie(e)&&xe(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(Fe(e,this.preElements))return Ae(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||xe(e)||(t=t.replace(/ $/,'')),t=Ae(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 qu({startPosition:t?zu.createAfter(e):zu.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,r=Le(e)[0],i=o.createTreeWalker(r,NodeFilter.SHOW_TEXT);i.currentNode=e;const a=i[n]();if(null!==a){const t=De(e,a);if(t&&!Fe(e,this.blockElements,t)&&!Fe(a,this.blockElements,t))return a}return null}}const gm=Ru({},Ad,{listenTo(e,...t){if(Be(e)||qe(e)){const n=this._getProxyEmitter(e)||new fm(e);n.attach(...t),e=n}Ad.listenTo.call(this,e,...t)},stopListening(e,t,n){if(Be(e)||qe(e)){const t=this._getProxyEmitter(e);if(!t)return;e=t}Ad.stopListening.call(this,e,t,n),e instanceof fm&&e.detach(t)},_getProxyEmitter(e){return l(this,ze(e))}});var hm=gm;class fm{constructor(e){d(this,ze(e)),this._domNode=e}}Ru(fm.prototype,Ad,{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 bm{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()}}_(bm,hm);je.prototype.add=je.prototype.push=function(e){return this.__data__.set(e,'__lodash_hash_undefined__'),this},je.prototype.has=function(e){return this.__data__.has(e)};var _m=je,km=function(e,t){for(var n=-1,o=e.length;++ns))return!1;var d=i.get(e);if(d)return d==t;var c=-1,p=!0,u=r&1?new _m:void 0;for(i.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 Mm(this.view,t,n))}}class qm extends Bm{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 re(this)}})}}var zm=Date.now,jm=zm,Um='Expected a function',Hm=rd,Wm=e,Gm=We;class $m extends bm{constructor(e){super(e),this._fireSelectionChangeDoneDebounced=Gm((e)=>this.document.fire('selectionChangeDone',e),200)}observe(){const e=this.document;e.on('keydown',(t,n)=>{const o=e.selection;o.isFake&&Ge(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 Uu(t.getRanges(),{backward:t.isBackward,fake:!1});(e==tm.arrowleft||e==tm.arrowup)&&n.setTo(n.getFirstPosition()),(e==tm.arrowright||e==tm.arrowdown)&&n.setTo(n.getLastPosition());const o={oldSelection:t,newSelection:n,domSelection:null};this.document.fire('selectionChange',o),this._fireSelectionChangeDoneDebounced(o)}}const Km={error(e,t){console.error(a(e),t)},warn(e,t){console.warn(a(e),t)}};var Zm=Km;class Jm extends bm{constructor(e){super(e),this.mutationObserver=e.getObserver(Fm),this.selection=this.document.selection,this.domConverter=e.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=Gm((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 Zm.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 Ym extends Bm{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 r=t.selection.editableElement;(null===r||r===o.target)&&(t.isFocused=!1,e.render())})}onDomEvent(e){this.fire(e.type,e)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class Qm extends Bm{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)}}var Xm=function(e){return!!e&&1===e.nodeType&&ld(e)&&!gd(e)};class eg{constructor(e){const t=$e(e);if(Object.defineProperty(this,'_source',{value:e._source||e,writable:!0,enumerable:!1}),Xm(e)||t){const n=t?e.startContainer:e;n.ownerDocument&&n.ownerDocument.body.contains(n)||Zm.warn('rect-source-not-in-dom: The source of this rect does not belong to any rendered DOM tree.',{source:e}),t?Ze(this,eg.getDomRangeRects(e)[0]):Ze(this,e.getBoundingClientRect())}else if(qe(e)){const{innerWidth:t,innerHeight:n}=e;Ze(this,{top:0,right:t,bottom:n,left:0,width:t,height:n})}else Ze(this,e)}clone(){return new eg(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(t){const n={top:rd(this.top,t.top),right:e(this.right,t.right),bottom:e(this.bottom,t.bottom),left:rd(this.left,t.left)};return n.width=n.right-n.left,n.height=n.bottom-n.top,0>n.width||0>n.height?null:new eg(n)}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(!Je(e))for(let n=e.parentNode||e.commonAncestorContainer;n&&!Je(n);){const e=new eg(n),o=t.getIntersection(e);if(o)o.getArea()new eg(e))}});class ng{constructor(){this.document=new Gu,this.domConverter=new mm,this._renderer=new pm(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 rm(this.document),this.addObserver(Fm),this.addObserver(Jm),this.addObserver(Ym),this.addObserver(qm),this.addObserver($m),this.addObserver(Qm),Ee(this),le(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&&Ye({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()):Zm.warn('view-focus-no-selection: There is no selection in any editable to focus.')}}change(e){if(this._renderingInProgress||this._postFixersInProgress)throw new bd('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}}_(ng,Lu);class og{constructor(e){this.parent=null,this._attrs=lt(e)}get index(){let e;if(!this.parent)return null;if(null===(e=this.parent.getChildIndex(this)))throw new bd('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 bd('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=P(t,n);return!('prefix'!==o)||'extension'!==o&&t[o]t||t>e.offsetSize)throw new bd('model-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.');if(0>n||t+n>e.offsetSize)throw new bd('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 bd('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 sg extends og{constructor(e,t,n){super(t),this.name=e,this._children=new ag,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 sg(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=dt(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(sg.fromJSON(n)):t.push(rg.fromJSON(n))}return new sg(e.name,e.attributes,t)}}class lg{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new bd('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 bd('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?cg.createFromPosition(e.startPosition):cg.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,r;do o=this.position,r=this._visitedParent,({done:t,value:n}=this.next());while(!t&&e(n));t||(this.position=o,this._visitedParent=r)}next(){return'forward'==this.direction?this._next():this._previous()}_next(){const e=this.position,t=cg.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 sg)return this.shallow?t.offset++:(t.path.push(0),this._visitedParent=o),this.position=t,ct('elementStart',o,e,t,1);if(o instanceof rg){let r;if(this.singleCharacters)r=1;else{let e=o.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offsete&&(e=this.boundaries.start.offset),r=t.offset-e}const i=t.offset-o.startOffset,a=new ig(o,i-r,r);return t.offset-=r,this.position=t,ct('text',a,e,t,r)}return t.path.pop(),this.position=t,this._visitedParent=n.parent,ct('elementStart',n,e,t,1)}}var dg=function(e){var t=e?e.length:0;return t?e[t-1]:void 0};class cg{constructor(e,t){if(!e.is('element')&&!e.is('documentFragment'))throw new bd('model-position-root-invalid: Position root invalid.');if(!(t instanceof Array)||0===t.length)throw new bd('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 dg(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=cg.createFromPosition(this),n=cg.createFromPosition(e);break;case'after':t=cg.createFromPosition(e),n=cg.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=cg.createFromPosition(this);if(this.root!=e.root)return n;if('same'==P(e.getParentPath(),this.getParentPath())){if(e.offsetthis.offset)return null;n.offset-=t}}else if('prefix'==P(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=cg.createFromPosition(this);if(this.root!=e.root)return o;if('same'==P(e.getParentPath(),this.getParentPath()))(e.offsett+1;){const t=o.maxOffset-n.offset;0!=t&&e.push(new pg(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 pg(n,n.getShiftedBy(o))),n.offset=t,n.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new lg(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new lg(e);for(const n of t)yield n.item}*getPositions(e={}){e.boundaries=this;const t=new lg(e);yield t.position;for(const n of t)yield n.nextPosition}getTransformedByDelta(e){const t=[pg.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=cg.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 r=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,n);t.modelPosition=cg.createFromParentAndOffset(o,r)},{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 pg(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new ju(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),r=this._toModelOffset(e,t,e);return o+r}if(e.is('text'))return t;let o=0;for(let r=0;r{if(!(e instanceof pg))throw new bd('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 bd('model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.');const n=cg.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 pg(n,e)),this._lastRangeBackward=!0):(this._pushRange(new pg(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 sg&&t==n?t:null}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const n=gt(t.start,e);n&&(yield n);for(const n of t.getWalker())'elementEnd'==n.type&&mt(n.item,e)&&(yield n.item);const o=gt(t.end,e);o&&!t.end.isTouching(cg.createAt(o))&&(yield o)}}containsEntireContent(e=this.anchor.root){const t=cg.createAt(e),n=cg.createAt(e,'end');return t.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e),this._ranges.push(pg.createFromRange(e))}_checkRange(e){for(let t=0;t{for(const e of this.getRanges())if(!this._document._validateSelectionRange(e))throw new bd('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),_t(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=lt(this._getSurroundingAttributes()),n=lt(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,r]of this.getAttributes())n.has(t)&&n.get(t)===r||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',Ot(this.model,this.mapper)),this.downcastDispatcher.on('insert:$text',Et(),{priority:'lowest'}),this.downcastDispatcher.on('remove',Pt(),{priority:'low'}),this.downcastDispatcher.on('selection',Vt(),{priority:'low'}),this.downcastDispatcher.on('selection',It(),{priority:'low'}),this.downcastDispatcher.on('selection',Nt(),{priority:'low'}),this.view.document.roots.bindTo(this.model.document.roots).using((e)=>{if('$graveyard'==e.rootName)return null;const t=new Bu(e.name);return t.rootName=e.rootName,t._document=this.view.document,this.mapper.bindElements(e,t),t})}destroy(){this.view.destroy(),this.stopListening()}}_(yg,Lu);class vg{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 p.includes(e)||a.get(e)||l.has(e)?void 0:o(e).catch((t)=>{throw Zm.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 i=r(o);if(t.includes(i))throw new bd('plugincollection-required: Cannot load a plugin because one of its dependencies is listed inthe `removePlugins` option.',{plugin:i,requiredBy:e});n(i)});const i=new e(s);a._add(e,i),d.push(i),o()})}function r(e){return'function'==typeof e?e:a._availablePlugins.get(e)}function i(e){return e.map((e)=>r(e)).filter((e)=>!!e)}const a=this,s=this._editor,l=new Set,d=[],c=i(e),p=i(t),u=function(e){const t=[];for(const n of e)r(n)||t.push(n);return t.length?t:null}(e);if(u){const e='plugincollection-plugin-not-found: Some plugins are not available and could not be loaded.';return Zm.error(e,{plugins:u}),Promise.reject(new bd(e,{plugins:u}))}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)?Zm.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 xg{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 bd('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 Cg{constructor(e){this.language=e||'en',this.t=(...e)=>this._t(...e)}_t(e,t){let n=Lt(this.language,e);return t&&(n=n.replace(/%(\d+)/g,(e,n)=>n{t[0]=new Pg(t[0])},{priority:'highest'}),this.on('checkChild',(e,t)=>{t[0]=new Pg(t[0]),t[1]=this.getDefinition(t[1])},{priority:'highest'})}register(e,t){if(this._sourceDefinitions[e])throw new bd('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 bd('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)}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 cg){const t=e.nodeBefore,n=e.nodeAfter;if(!(t instanceof sg))throw new bd('schema-check-merge-no-element-before: The node before the merge position must be an element.');if(!(n instanceof sg))throw new bd('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 r=e(n,o);'boolean'==typeof r&&(t.stop(),t.return=r)}},{priority:'high'})}addAttributeCheck(e){this.on('checkAttribute',(t,[n,o])=>{const r=e(n,o);'boolean'==typeof r&&(t.stop(),t.return=r)},{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,r=o.start;const i=o.end;for(const i of o.getWalker())this.checkAttribute(i.item,t)||(!r.isEqual(e)&&n.push(new pg(r,e)),r=i.nextPosition),e=i.nextPosition;r&&!r.isEqual(i)&&n.push(new pg(r,i))}return n}getNearestSelectionRange(e,t='both'){if(this.checkChild(e,'$text'))return new pg(e);let n,o;('both'==t||'backward'==t)&&(n=new lg({startPosition:e,direction:'backward'})),('both'==t||'forward'==t)&&(o=new lg({startPosition:e}));for(const r of Yt(n,o)){const e=r.walker==n?'elementEnd':'elementStart',t=r.value;if(t.type==e&&this.isObject(t.item))return pg.createOn(t.item);if(this.checkChild(t.nextPosition,'$text'))return new pg(t.nextPosition)}return null}findAllowedParent(e,t){for(let n=t.parent;n;){if(this.checkChild(n,e))return n;if(this.isLimit(n)||this.isObject(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]=Mt(t[o],o);for(const t of n)Bt(e,t);for(const t of n)qt(e,t);for(const t of n)zt(e,t),jt(e,t);for(const t of n)Ut(e,t),Ht(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)}}}_(Eg,Lu);class Pg{constructor(e){return e instanceof Pg?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(Jt))}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 Pg([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 Sg{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=Xt(n,t),this.conversionApi.writer=t,this.conversionApi.consumable=Ag.createFrom(e),this.conversionApi.store={};const{modelRange:o}=this._convertItem(e,this._modelCursor),r=t.createDocumentFragment();if(o){this._removeEmptyElements();for(const e of Array.from(this._modelCursor.parent.getChildren()))t.append(e,r);r.markers=Qt(r,t)}return this._modelCursor=null,this._removeIfEmpty.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,r}_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 pg))throw new bd('view-conversion-dispatcher-incorrect-result: Incorrect conversion result was dropped.');return{modelRange:n.modelRange,modelCursor:n.modelCursor}}_convertChildren(e,t){const n=new pg(t);let o=t;for(const r of Array.from(e.getChildren())){const e=this._convertItem(r,o);e.modelRange instanceof pg&&(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()}}_(Sg,Ad);class Rg{constructor(e,t){this.model=e,this.processor=t,this.mapper=new ug,this.downcastDispatcher=new gg({mapper:this.mapper}),this.downcastDispatcher.on('insert:$text',Et(),{priority:'lowest'}),this.upcastDispatcher=new Sg({schema:e.schema}),this.upcastDispatcher.on('text',mn(),{priority:'lowest'}),this.upcastDispatcher.on('element',un(),{priority:'lowest'}),this.upcastDispatcher.on('documentFragment',un(),{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=pg.createIn(e),n=new om,o=new rm(new Gu());if(this.mapper.bindElements(e,n),this.downcastDispatcher.convertInsert(t,o),!e.is('documentFragment')){const t=gn(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 bd('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(pg.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(){}}_(Rg,Lu);class Og{constructor(){this._dispatchersGroups=new Map}register(e,t){if(this._dispatchersGroups.has(e))throw new bd('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 hn(t,e),this}}}elementToElement(e){this.for('downcast').add(kt(e));for(const{model:t,view:n}of fn(e))this.for('upcast').add(en({model:t,view:n,priority:e.priority}))}attributeToElement(e){this.for('downcast').add(wt(e));for(const{model:t,view:n}of fn(e))this.for('upcast').add(tn({view:n,model:t,priority:e.priority}))}attributeToAttribute(e){this.for('downcast').add(yt(e));for(const{model:t,view:n}of fn(e))this.for('upcast').add(nn({view:n,model:t}))}_getDispatchers(e){const t=this._dispatchersGroups.get(e);if(!t)throw new bd('conversion-for-unknown-group: Trying to add a converter to an unknown dispatchers group.');return t}}class Ig{constructor(e){this.baseVersion=e,this.isDocumentOperation=null!==this.baseVersion}_validate(){}toJSON(){const e=Gp(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 Ng{constructor(e){this.markers=new Map,this._children=new ag,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(sg.fromJSON(n)):t.push(rg.fromJSON(n));return new Ng(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=_n(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 Vg=function(e,t){return Lm(e,t)};class Lg extends Ig{constructor(e,t,n,o,r){super(r),this.range=pg.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 Lg(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Lg(this.range,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){for(const e of this.range.getItems()){if(null!==this.oldValue&&!Vg(e.getAttribute(this.key),this.oldValue))throw new bd('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 bd('attribute-operation-attribute-exists: The attribute with given key already exists.',{node:e,key:this.key})}}_execute(){Vg(this.oldValue,this.newValue)||vn(this.range,this.key,this.newValue)}static get className(){return'engine.model.operation.AttributeOperation'}static fromJSON(e,t){return new Lg(pg.fromJSON(e.range,t),e.key,e.oldValue,e.newValue,e.baseVersion)}}class Dg extends Ig{constructor(e,t,n,o){super(o),this.sourcePosition=cg.createFromPosition(e),this.howMany=t,this.targetPosition=cg.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 bd('move-operation-position-invalid: Source position or target position is invalid.');else if(n+this.howMany>e.maxOffset)throw new bd('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 Bg(this.position,e,this.baseVersion)}getReversed(){const e=this.position.root.document.graveyard,t=new cg(e,[0]);return new Mg(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffsete._clone(!0))),kn(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(sg.fromJSON(o)):n.push(rg.fromJSON(o));return new Bg(cg.fromJSON(e.position,t),n,e.baseVersion)}}class qg extends Ig{constructor(e,t,n,o,r){super(r),this.name=e,this.oldRange=t?pg.createFromRange(t):null,this.newRange=n?pg.createFromRange(n):null,this._markers=o}get type(){return'marker'}clone(){return new qg(this.name,this.oldRange,this.newRange,this._markers,this.baseVersion)}getReversed(){return new qg(this.name,this.newRange,this.oldRange,this._markers,this.baseVersion+1)}_execute(){const e=this.newRange?'_set':'_remove';this._markers[e](this.name,this.newRange,!0)}toJSON(){const e=super.toJSON();return delete e._markers,e}static get className(){return'engine.model.operation.MarkerOperation'}static fromJSON(e,t){return new qg(e.name,e.oldRange?pg.fromJSON(e.oldRange,t):null,e.newRange?pg.fromJSON(e.newRange,t):null,t.model.markers,e.baseVersion)}}class zg extends Ig{get type(){return'noop'}clone(){return new zg(this.baseVersion)}getReversed(){return new zg(this.baseVersion+1)}_execute(){}static get className(){return'engine.model.operation.NoOperation'}}class jg extends Ig{constructor(e,t,n,o){super(o),this.position=e,this.oldName=t,this.newName=n}get type(){return'rename'}clone(){return new jg(cg.createFromPosition(this.position),this.oldName,this.newName,this.baseVersion)}getReversed(){return new jg(cg.createFromPosition(this.position),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(!(e instanceof sg))throw new bd('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 bd('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 jg(cg.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class Ug extends Ig{constructor(e,t,n,o,r){super(r),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 Ug(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Ug(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is('documentFragment'))throw new bd('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 bd('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 bd('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 bd('rootattribute-operation-fromjson-no-root: Cannot create RootAttributeOperation. Root with specified name does not exist.',{rootName:e});return new Ug(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}const Hg={};Hg[Lg.className]=Lg,Hg[Bg.className]=Bg,Hg[qg.className]=qg,Hg[Dg.className]=Dg,Hg[zg.className]=zg,Hg[Ig.className]=Ig,Hg[Fg.className]=Fg,Hg[Mg.className]=Mg,Hg[jg.className]=jg,Hg[Ug.className]=Ug;class Wg{static fromJSON(e,t){return Hg[e.__className].fromJSON(e,t)}}const Gg=new Map;class $g{static fromJSON(e,t){if(!Gg.has(e.__className))throw new bd('delta-fromjson-no-deserializer: This delta has no defined deserializer',{name:e.__className});const n=Gg.get(e.__className),o=new n;for(const n of e.operations)o.addOperation(Wg.fromJSON(n,t));for(const n in e)'__className'!=n&&void 0===o[n]&&(o[n]=e[n]);return o}static register(e){Gg.set(e.className,e)}}class Kg{constructor(){this.batch=null,this.operations=[]}get baseVersion(){return 0new Lg(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 Lg(t,e.key,e.oldValue,e.newValue,e.baseVersion)),r=e.range.getIntersection(t.range);return r&&(n.isStrong?o.push(new Lg(r,t.key,t.newValue,e.newValue,e.baseVersion)):0===o.length&&o.push(new zg(0))),o}return[e.clone()]},RootAttributeOperation:En,RenameOperation:En,MarkerOperation:En,MoveOperation(e,t){const n=pg.createFromPositionAndShift(t.sourcePosition,t.howMany);let o=[];const r=Rn(e.range.getDifference(n)),i=e.range.getIntersection(n);return null!==r&&(r.start=r.start._getTransformedByDeletion(t.sourcePosition,t.howMany),r.end=r.end._getTransformedByDeletion(t.sourcePosition,t.howMany),o=r._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,!0,!1).reverse()),null!==i&&(i.start=i.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),i.end=i.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),o.push(i)),o.map((t)=>new Lg(t,e.key,e.oldValue,e.newValue,e.baseVersion))}},RootAttributeOperation:{InsertOperation:En,AttributeOperation:En,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 zg(e.baseVersion)]},RenameOperation:En,MarkerOperation:En,MoveOperation:En},RenameOperation:{InsertOperation(e,t){const n=e.clone();return n.position=n.position._getTransformedByInsertion(t.position,t.nodes.maxOffset,!0),[n]},AttributeOperation:En,RootAttributeOperation:En,RenameOperation(e,t,n){const o=e.clone();if(e.position.isEqual(t.position))if(n.isStrong)o.oldName=t.newName;else return[new zg(e.baseVersion)];return[o]},MarkerOperation:En,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:En,RootAttributeOperation:En,RenameOperation:En,MarkerOperation(e,t,n){const o=e.clone();if(e.name==t.name)if(n.isStrong)o.oldRange=t.newRange;else return[new zg(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=pg.createFromRanges(e)}if(n.newRange){const e=n.newRange._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);n.newRange=pg.createFromRanges(e)}return[n]}},MoveOperation:{InsertOperation(e,t,n){let o=pg.createFromPositionAndShift(e.sourcePosition,e.howMany);const r=e.isSticky&&!n.forceNotSticky;o=o._getTransformedByInsertion(t.position,t.nodes.maxOffset,!1,r)[0];const i=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,i),e.baseVersion);return a.isSticky=e.isSticky,[a]},AttributeOperation:En,RootAttributeOperation:En,RenameOperation:En,MarkerOperation:En,MoveOperation(e,t,n){const o=pg.createFromPositionAndShift(e.sourcePosition,e.howMany),r=pg.createFromPositionAndShift(t.sourcePosition,t.howMany);let i=n.isStrong;const a=e.isSticky&&!n.forceNotSticky,s=void 0===n.insertBefore?!i:n.insertBefore,l=e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,s,t.isSticky&&!n.forceNotSticky);if(Sn(e,t)&&Sn(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(r,!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),On([o],l,e);const c=r.containsPosition(e.targetPosition)||r.start.isEqual(e.targetPosition)&&t.isSticky&&!n.forceNotSticky||r.end.isEqual(e.targetPosition)&&t.isSticky&&!n.forceNotSticky;if(c&&r.containsRange(o,!0))return o.start=o.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),o.end=o.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),On([o],l,e);const p=P(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if('prefix'==p||'extension'==p)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),On([o],l,e);n.forceWeakRemove||(e instanceof Mg&&!(t instanceof Mg)?i=!0:!(e instanceof Mg)&&t instanceof Mg&&(i=!1));const u=[],m=o.getDifference(r);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'==P(o.start.getParentPath(),t.getMovedRangeStart().getParentPath()),n=o._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,e,a);u.push(...n)}const g=o.getIntersection(r);return null!==g&&i&&!d&&(g.start=g.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),g.end=g.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),0===u.length?u.push(g):1==u.length?r.start.isBefore(o.start)||r.start.isEqual(o.start)?u.unshift(g):u.push(g):u.splice(1,0,g)),0===u.length?[new zg(e.baseVersion)]:On(u,l,e)}}};var ot=function(e,t,n){var o=-1,r=e.length;0>t&&(t=-t>r?0:r+t),n=n>r?r:n,0>n&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(r);++o=200&&(i=fh,a=!1,t=new _m(t));outer:for(;++rt?0:t,o)):[]},Xh=function(e,t,n){var o=e?e.length:0;return o?(t=n||void 0===t?1:mu(t),t=o-t,ot(e,0,0>t?0:t)):[]},ef=function(e,t,n,o){for(var r=e.length,i=o?r:-1;(o?i--:++i=t?e:t)),e},nf=function(e){return e?tf(mu(e),0,4294967295):0},of=function(e,t,n,o){var r=e.length;for(n=mu(n),0>n&&(n=-n>r?0:r+n),o=void 0===o||o>r?r:mu(o),0>o&&(o+=r),o=n>o?0:nf(o);nt?n:0,Nc(t,n)?e[t]:void 0},hf=function(e,t,n,o){for(var r=n-1,i=e.length;++rt||i&&a&&l&&!s&&!d||o&&a&&l||!n&&l||!r)return 1;if(!o&&!i&&!d&&e>>1){for(;o>>1,a=e[i];null!==a&&!ou(a)&&(n?a<=t:a=200){var d=t?null:Nf(e);if(d)return Ep(d);a=!1,r=fh,l=new _m}else l=t?[]:s;outer:for(;++ot)return[];for(var r=0,i=0,a=Array(sh(o/t));rn&&(n=rd(o+n,0)),ph(e,t,n)):-1},initial:function(e){return Xh(e,1)},intersection:df,intersectionBy:cf,intersectionWith:pf,join:function(e,t){return e?mf.call(e,t):''},last:dg,lastIndexOf:function(t,n,o){var r=t?t.length:0;if(!r)return-1;var i=r;if(void 0!==o&&(i=mu(o),i=(0>i?rd(r+i,0):e(i,r-1))+1),n!==n)return ch(t,i,!0);for(;i--;)if(t[i]===n)return i;return-1},nth:function(e,t){return e&&e.length?gf(e,mu(t)):void 0},pull:wf,pullAll:kf,pullAllBy:function(e,t,n){return e&&e.length&&t&&t.length?_f(e,t,Zh(n)):e},pullAllWith:function(e,t,n){return e&&e.length&&t&&t.length?_f(e,t,void 0,n):e},pullAt:Ef,remove:function(e,t){var n=[];if(!(e&&e.length))return n;var o=-1,r=[],i=e.length;for(t=Zh(t,3);++ot?0:t)):[]},takeRight:function(e,t,n){var o=e?e.length:0;return o?(t=n||void 0===t?1:mu(t),t=o-t,ot(e,0>t?0:t,o)):[]},takeRightWhile:function(e,t){return e&&e.length?ef(e,Zh(t,3),!1,!0):[]},takeWhile:function(e,t){return e&&e.length?ef(e,Zh(t,3)):[]},union:Lf,unionBy:Df,unionWith:Ff,uniq:function(e){return e&&e.length?Vf(e):[]},uniqBy:function(e,t){return e&&e.length?Vf(e,Zh(t)):[]},uniqWith:function(e,t){return e&&e.length?Vf(e,void 0,t):[]},unzip:Bf,unzipWith:qf,without:zf,xor:Uf,xorBy:Hf,xorWith:Wf,zip:Gf,zipObject:function(e,t){return $f(e||[],t||[],lc)},zipObjectDeep:function(e,t){return $f(e||[],t||[],Kf)},zipWith:Zf};const Yf=new Map,Qf={transform(e,t,n){const o=Qf.getTransformationCase(e,t)||Qf.defaultTransform,r=o(e,t,Object.assign({},n)),i=Jf.last(t.operations).baseVersion;return Mn(i,r)},defaultTransform(e,t,n){const o=[];let r=t.operations,a=[];for(const i of e.operations){const e=[i];for(const t of r)for(let o=0;o{const o=nb(e,t,n);return e.range.containsPosition(t.position)&&o.push(Jn(t,e)),o}),tb(Zg,Jg,(e,t,n)=>{if(!t.position)return nb(e,t,n);const o=n.undoMode,r=new cg(t.position.root,t.position.path.slice(0,-1)),i=nb(e,t,n);if(o||!(t._cloneOperation instanceof Bg))return i;for(const o of e.operations)if(o.range.containsPosition(r)||o.range.start.isEqual(r)){const e=new Zg,n=r.getShiftedBy(1),a=cg.createFromPosition(n);a.path.push(0);const s=t._cloneOperation.nodes.getNode(0).getAttribute(o.key);e.addOperation(new Lg(new pg(n,a),o.key,s===void 0?null:s,o.newValue,0)),i.push(e);break}return i}),tb(oh,Yg,(e,t,n)=>{if(!t.position)return nb(e,t,n);const o=n.undoMode;return!o&&e.position.isEqual(t.position)?[t.getReversed(),e.clone()]:nb(e,t,n)}),tb(eb,Jg,Zn),tb(eb,Yg,Zn),tb(eb,th,Zn),tb(eb,nh,Zn),tb(eb,Qg,Zn),tb(eb,eh,Zn),tb(Qg,Yg,(e,t,n)=>{const o=n.undoMode;if(o||!t.position)return nb(e,t,n);const r=e.sourcePosition.root==t.position.root&&'same'===P(e.sourcePosition.getParentPath(),t.position.getParentPath()),i=e.sourcePosition.offset<=t.position.offset&&e.sourcePosition.offset+e.howMany>t.position.offset;return r&&i?[t.getReversed(),e.clone()]:nb(e,t,n)}),tb(Yg,oh,(e,t,n)=>{if(!e.position)return nb(e,t,n);const o=n.undoMode;return!o&&e.position.isEqual(t.position)?[Yn()]:nb(e,t,n)}),tb(Yg,Qg,(e,t,n)=>{const o=n.undoMode;if(o||!e.position)return nb(e,t,n);const r=e.position.root==t.sourcePosition.root&&'same'===P(e.position.getParentPath(),t.sourcePosition.getParentPath()),i=t.sourcePosition.offset<=e.position.offset&&t.sourcePosition.offset+t.howMany>e.position.offset;return r&&i?[Yn()]:nb(e,t,n)}),tb(Jg,Jg,(e,t,n)=>{const o=n.undoMode;if(o)return nb(e,t,n);if(!e.position||!t.position)return nb(e,t,n);const r=e.position.getParentPath(),i=t.position.getParentPath();if(e.position.root==t.position.root&&'same'==P(r,i))if(e=e.clone(),e.position.offsett._cloneOperation.sourcePosition.offset&&e._cloneOperation.sourcePosition.offset--;const n=pg.createFromPositionAndShift(e.position,e._moveOperation.howMany),o=pg.createFromPositionAndShift(t.position,t._moveOperation.howMany),r=n.getDifference(o);let i=0;for(const e of r)i+=e.end.offset-e.start.offset;return 0==i?(e.operations.pop(),e.addOperation(new zg(e.operations[0].baseVersion+1))):e.operations[1].howMany=i,[e]}else{const o=Object.assign({},n);return o.isStrong=!0,o.insertBefore=!0,nb(e,t,o)}return nb(e,t,n)}),tb(Jg,nh,(e,t,n)=>e.position?e.position.root==t.position.root&&'same'===P(t.position.path,e.position.getParentPath())?[Yn()]:nb(e,t,n):nb(e,t,n)),tb(Jg,th,(e,t,n)=>{if(!e.position)return nb(e,t,n);const o=e.position.root==t.range.start.root,r=o&&'same'===P(e.position.getParentPath(),t.range.start.getParentPath()),i=t.range.start.offset=e.position.offset;if(r&&i)return[Yn()];if(o&&'same'===P(e.position.getParentPath(),t.range.end.getShiftedBy(-1).path)){const n=e.clone(),o=cg.createFromPosition(t.range.start);o.path.push(t.howMany-1);const r=o.getShiftedBy(1);n._cloneOperation.position=r;const i=cg.createFromPosition(o);i.path.push(e.position.offset),n._moveOperation.sourcePosition=i;const a=cg.createFromPosition(r);return a.path.push(0),n._moveOperation.targetPosition=a,[n]}return nb(e,t,n)}),tb(Jg,Zg,(e,t,n)=>{if(!e.position)return nb(e,t,n);e=e.clone();const o=n.undoMode,r=new cg(e.position.root,e.position.path.slice(0,-1));if(o||!(e._cloneOperation instanceof Bg))return[e];for(const o of t.operations)if(o.range.containsPosition(r)||o.range.start.isEqual(r)){null===o.newValue?e._cloneOperation.nodes.getNode(0)._removeAttribute(o.key):e._cloneOperation.nodes.getNode(0)._setAttribute(o.key,o.newValue);break}return[e]}),tb(nh,Jg,(e,t,n)=>t.position?e.position.root==t.position.root&&'same'===P(e.position.path,t.position.getParentPath())?[t.getReversed(),e.clone()]:nb(e,t,n):nb(e,t,n)),tb(rh,Zg,(e,t)=>{const n=[e.clone()];return t.range.containsPosition(e.position)&&n.push(Jn(e,t)),n}),tb(th,Jg,(e,t,n)=>{if(!t.position)return nb(e,t,n);const o=e.range.start.root==t.position.root,r=o&&'same'===P(e.range.start.getParentPath(),t.position.getParentPath()),i=e.range.start.offset=t.position.offset;if(r&&i)return[t.getReversed(),e.clone()];if(o&&'same'===P(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 nb(e,t,n)}),tb(eh,Jg,(e,t,n)=>{const o=n.undoMode,r=nb(e,t,n);if(o||!(t._cloneOperation instanceof Bg))return r;const i=t._cloneOperation.position.getShiftedBy(-1);if(i&&e.operations[0].position.isEqual(i)){const t=e.clone();t.operations[0].position=i.getShiftedBy(1),r.push(t)}return r}),tb(Jg,eh,(e,t,n)=>{e=e.clone();const o=n.undoMode;if(o||!(e._cloneOperation instanceof Bg))return[e];const r=e._cloneOperation.position.getShiftedBy(-1);if(r&&!o&&t.operations[0].position.isEqual(r)){const n=t.clone();return n.operations[0].position=r.getShiftedBy(1),n.operations[0].oldName=e._cloneOperation.nodes.getNode(0).name,[e,n]}return[e]}),tb(Xg,Jg,(e,t,n)=>{const o=nb(e,t,n),r=t._cloneOperation.position||t._cloneOperation.targetPosition;if(!r)return nb(e,t,n);const i=n.undoMode;if(i)return o;for(const i of o)if(i instanceof Xg){const e=i._moveOperation,t=e.sourcePosition.getShiftedBy(e.howMany);t.isEqual(r)&&(e.howMany+=1)}return o}),tb(Jg,Xg,(e,t,n)=>{const o=n.undoMode;if(o)return nb(e,t,n);const r=e._cloneOperation.position||e._cloneOperation.targetPosition;if(!r)return nb(e,t,n);t=t.clone();const i=t._moveOperation,a=i.sourcePosition.getShiftedBy(i.howMany);return a.isEqual(r)&&(i.howMany+=1),nb(e,t,n)});class ob{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 rb extends Kg{static get className(){return'engine.model.delta.RootAttributeDelta'}}$g.register(rb);class ib extends Ig{constructor(e,t){super(null),this.sourcePosition=cg.createFromPosition(e),this.howMany=t}get type(){return'detach'}_validate(){if(this.sourcePosition.root.document)throw new bd('detach-operation-on-document-node: Cannot detach document node.')}_execute(){wn(pg.createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return'engine.model.operation.DetachOperation'}}class ab extends sg{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 sb{constructor(e,t){this.model=e,this.batch=t}createText(e,t){return new rg(e,t)}createElement(e,t){return new sg(e,t)}createDocumentFragment(){return new Ng}insert(e,t,n){this._assertWriterUsedCorrectly();const o=cg.createAt(t,n),r=e instanceof rg&&!e.parent?new rh:new oh;if(e.parent){if(no(e.root,o.root))return void this.move(pg.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 i=o.root.document?o.root.document.version:null,a=new Bg(o,e,i);if(this.batch.addDelta(r),r.addOperation(a),this.model.applyOperation(a),e instanceof Ng)for(const[t,n]of e.markers){const e=cg.createAt(n.root),r=new pg(n.start._getCombined(e,o),n.end._getCombined(e,o));this.addMarker(t,{range:r,usingOperation:!0})}}insertText(e,t,n,o){t instanceof Ng||t instanceof sg||t instanceof cg?this.insert(this.createText(e),t,n):this.insert(this.createText(e,t),n,o)}insertElement(e,t,n,o){t instanceof Ng||t instanceof sg||t instanceof cg?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 Ng||t instanceof sg?this.insert(this.createText(e),t,'end'):this.insert(this.createText(e,t),n,'end')}appendElement(e,t,n){t instanceof Ng||t instanceof sg?this.insert(this.createElement(e),t,'end'):this.insert(this.createElement(e,t),n,'end')}setAttribute(e,t,n){this._assertWriterUsedCorrectly(),n instanceof pg?Qn(this,e,t,n):Xn(this,e,t,n)}setAttributes(e,t){for(const[n,o]of lt(e))this.setAttribute(n,o,t)}removeAttribute(e,t){this._assertWriterUsedCorrectly(),t instanceof pg?Qn(this,e,null,t):Xn(this,e,null,t)}clearAttributes(e){this._assertWriterUsedCorrectly();const t=(e)=>{for(const t of e.getAttributeKeys())this.removeAttribute(t,e)};if(!(e instanceof pg))t(e);else for(const n of e.getItems())t(n)}move(e,t,n){if(this._assertWriterUsedCorrectly(),!(e instanceof pg))throw new bd('writer-move-invalid-range: Invalid range to move.');if(!e.isFlat)throw new bd('writer-move-range-not-flat: Range to move is not flat.');const o=cg.createAt(t,n);if(!no(e.root,o.root))throw new bd('writer-move-different-document: Range is going to be moved between different documents.');const r=new Qg;this.batch.addDelta(r);const i=e.root.document?e.root.document.version:null,a=new Dg(e.start,e.end.offset-e.start.offset,o,i);r.addOperation(a),this.model.applyOperation(a)}remove(e){this._assertWriterUsedCorrectly();const t=(e,t)=>{const n=new Xg;this.batch.addDelta(n),to(e,t,n,this.model)};if(e instanceof pg){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(cg.createBefore(e),n)}}merge(e){this._assertWriterUsedCorrectly();const t=new Yg;this.batch.addDelta(t);const n=e.nodeBefore,o=e.nodeAfter;if(!(n instanceof sg))throw new bd('writer-merge-no-element-before: Node before merge position must be an element.');if(!(o instanceof sg))throw new bd('writer-merge-no-element-after: Node after merge position must be an element.');const r=cg.createFromParentAndOffset(o,0),i=cg.createFromParentAndOffset(n,n.maxOffset),a=e.root.document?e.root.document.version:null,s=new Dg(r,o.maxOffset,i,a);s.isSticky=!0,t.addOperation(s),this.model.applyOperation(s),to(e,1,t,this.model)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof sg))throw new bd('writer-rename-not-element-instance: Trying to rename an object which is not an instance of Element.');const n=new eh;this.batch.addDelta(n);const o=e.root.document?e.root.document.version:null,r=new jg(cg.createBefore(e),e.name,t,o);n.addOperation(r),this.model.applyOperation(r)}split(e,t){this._assertWriterUsedCorrectly();let n=e.parent;if(!n.parent)throw new bd('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 bd('writer-split-invalid-limit-element: Limit element is not a position ancestor.');let o,r;do{const t=new Jg;this.batch.addDelta(t);const i=new sg(n.name,n.getAttributes()),a=n.root.document?n.root.document.version:null,s=new Bg(cg.createAfter(n),i,a);t.addOperation(s),this.model.applyOperation(s);const l=null===a?null:a+1,d=new Dg(e,n.maxOffset-e.offset,cg.createFromParentAndOffset(i,0),l);d.isSticky=!0,t.addOperation(d),this.model.applyOperation(d),o||r||(o=n,r=i),e=cg.createBefore(i),n=e.parent}while(n!==t);return{position:e,range:new pg(cg.createAt(o,'end'),cg.createAt(r))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new bd('writer-wrap-range-not-flat: Range to wrap is not flat.');const n=t instanceof sg?t:new sg(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,oo(e.getChildren()))}_handleChange(e,t){e.nodesToHandle=e.howMany;for(const n of t){const o=e.offset+e.howMany,r=n.offset+n.howMany;if('insert'==e.type&&('insert'==n.type&&(e.offset<=n.offset?n.offset+=e.howMany:e.offsetn.offset){if(o>r){const e={type:'attribute',offset:r,howMany:o-r,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.offsetr?(e.nodesToHandle=o-r,e.offset=r):e.nodesToHandle=0);'attribute'==n.type&&(e.offset>=n.offset&&o<=r?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=n.offset&&o>=r&&(n.howMany=0))}}e.howMany=e.nodesToHandle,delete e.nodesToHandle}_getInsertDiff(e,t,n){return{type:'insert',position:cg.createFromParentAndOffset(e,t),name:n,length:1,changeCount:this._changeCount++}}_getRemoveDiff(e,t,n){return{type:'remove',position:cg.createFromParentAndOffset(e,t),name:n,length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,n){const o=[];n=new Map(n);for(const[r,i]of t){const t=n.has(r)?n.get(r):null;t!==i&&o.push({type:'attribute',position:e.start,range:pg.createFromRange(e),length:1,attributeKey:r,attributeOldValue:i,attributeNewValue:t,changeCount:this._changeCount++}),n.delete(r)}for(const[r,i]of n)o.push({type:'attribute',position:e.start,range:pg.createFromRange(e),length:1,attributeKey:r,attributeOldValue:null,attributeNewValue:i,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 bd('model-history-wrong-version: Given base version points to the middle of a delta.')}return t}}const cb='$graveyard';class pb{constructor(e){this.model=e,this.version=0,this.history=new db(this),this.selection=new _g(this),this.roots=new Wu({idProperty:'rootName'}),this.differ=new lb(e.markers),this._postFixers=new Set,this.createRoot('$root',cb),this.listenTo(e,'applyOperation',(e,t)=>{const n=t[0];if(n.isDocumentOperation&&n.baseVersion!==this.version)throw new bd('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.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),null===n&&t.on('change',(e,n)=>{this.differ.bufferMarkerChange(t.name,n,t.getRange())})})}get graveyard(){return this.getRoot(cb)}createRoot(e='$root',t='main'){if(this.roots.get(t))throw new bd('model-document-createRoot-name-exists: Root with specified name already exists.',{name:t});const n=new ab(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!=cb)}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=Gp(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 cg(e,[0]),o=t.getNearestSelectionRange(n);return o||new pg(n)}_validateSelectionRange(e){return uo(e.start)&&uo(e.end)}_callPostFixers(e){let t=!1;do for(const n of this._postFixers)if(t=n(e),t)break;while(t)}}_(pb,Ad);class ub{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){const o=e instanceof mb?e.name:e,r=this._markers.get(o);if(r){const e=r.getRange();let i=!1;return e.isEqual(t)||(r._attachLiveRange(fg.createFromRange(t)),i=!0),n!=r.managedUsingOperations&&(r._managedUsingOperations=n,i=!0),i&&this.fire('update:'+o,r,e,t),r}const i=fg.createFromRange(t),a=new mb(o,i,n);return this._markers.set(o,a),this.fire('update:'+o,a,null,t),a}_remove(e){const t=e instanceof mb?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()}}_(ub,Ad);class mb{constructor(e,t,n){this.name=e,this._managedUsingOperations=n,this._liveRange=this._attachLiveRange(t)}get managedUsingOperations(){if(!this._liveRange)throw new bd('marker-destroyed: Cannot use a destroyed marker instance.');return this._managedUsingOperations}getStart(){if(!this._liveRange)throw new bd('marker-destroyed: Cannot use a destroyed marker instance.');return cg.createFromPosition(this._liveRange.start)}getEnd(){if(!this._liveRange)throw new bd('marker-destroyed: Cannot use a destroyed marker instance.');return cg.createFromPosition(this._liveRange.end)}getRange(){if(!this._liveRange)throw new bd('marker-destroyed: Cannot use a destroyed marker instance.');return pg.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}}_(mb,Ad);class gb extends cg{constructor(e,t,n){if(super(e,t),!this.root.is('rootElement'))throw new bd('model-liveposition-root-not-rootelement: LivePosition\'s root has to be an instance of RootElement.');this.stickiness=n||'sticksToNext',mo.call(this)}detach(){this.stopListening()}}_(gb,Ad);class hb{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']})}change(e){return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new ob,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}enqueueChange(e,t){'string'==typeof e?e=new ob(e):'function'==typeof e&&(t=e,e=new ob),this._pendingChanges.push({batch:e,callback:t}),1==this._pendingChanges.length&&this._runPendingChanges()}applyOperation(e){e._execute()}transformDeltas(e,t,n=!1){return Xf.transformDeltaSets(e,t,n?this.document:null)}insertContent(e,t){ho(this,e,t)}deleteContent(e,t){fo(this,e,t)}modifySelection(e,t){xo(this,e,t)}getSelectedContent(e){return Ro(this,e)}hasContent(e){if(e instanceof sg&&(e=pg.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 sb(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}}_(bb,Lu);class _b{constructor(){this._listener=Object.create(hm)}listenTo(e){this._listener.listenTo(e,'keydown',(e,t)=>{this._listener.fire('_keydown:'+re(t),t)})}set(e,t,n={}){const o=ie(e),r=n.priority;this._listener.listenTo(this._listener,'_keydown:'+o,(e,n)=>{t(n,()=>{n.preventDefault(),n.stopPropagation(),e.stop()}),e.return=!0},{priority:r})}press(e){return!!this._listener.fire('_keydown:'+re(e),e)}destroy(){this._listener.stopListening()}}class kb extends _b{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 wb{constructor(e){const t=this.constructor.build&&this.constructor.build.plugins;this.config=new hd(e,this.constructor.build&&this.constructor.build.config),this.config.define('plugins',t),this.plugins=new vg(this,t),this.commands=new xg,this.locale=new Cg(this.config.get('language')),this.t=this.locale.t,this.set('isReadOnly',!1),this.model=new bb,this.data=new Rg(this.model),this.editing=new yg(this.model),this.editing.view.document.bind('isReadOnly').to(this),this.conversion=new Og,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 kb(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))})}}_(wb,Lu);class yb{getHtml(e){const t=document.implementation.createHTMLDocument(''),n=t.createElement('div');return n.appendChild(e),n.innerHTML}}class vb{constructor(){this._domParser=new DOMParser,this._domConverter=new mm({blockFiller:sm}),this._htmlWriter=new yb}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||!Io(e))throw new bd('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 r of e)o.delegate(r).to(t)}),this.on('remove',(n,o)=>{for(const r of e)o.stopDelegating(r,t)})}}}}_(Wu,Lu);var Ab=function(e,t){return Wp(e,!0,!0,t)};class Tb{constructor(e){Object.assign(this,qo(Bo(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData=Xo(),this._renderNode({node:e,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new bd('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)Jo(n)?yield n:Yo(n)&&(yield*e(n))}yield*e(this)}static bind(e,t){return{to(n,o){return new Pb({eventNameOrFunction:n,attribute:n,observable:e,emitter:t,callback:o})},if(n,o,r){return new Sb({observable:e,emitter:t,attribute:n,valueIfTrue:o,callback:r})}}}static extend(e,t){e._isRendered&&Zm.warn('template-extend-render: Attempting to extend a template which has already been rendered.'),Ko(e,qo(Bo(t)))}_renderNode(e){let t;if(t=e.node?this.tag&&this.text:this.tag?this.text:!this.text,t)throw new bd('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(''),No(this.text)?this._bindToObservable({schema:this.text,updater:Do(t),data:e}):t.textContent=this.text.join(''),t}_renderAttributes(e){let t,n,o,r;if(this.attributes){const i=e.node,a=e.revertData;for(t in this.attributes)if(o=i.getAttribute(t),n=this.attributes[t],a&&(a.attributes[t]=o),r=Od(n[0])&&n[0].ns?n[0].ns:null,No(n)){const s=r?n[0].value:n;a&&er(t)&&s.unshift(o),this._bindToObservable({schema:s,updater:Fo(i,t,r),data:e})}else'style'==t&&'string'!=typeof n[0]?this._renderStyleAttribute(n[0],e):(a&&o&&er(t)&&n.unshift(o),n=n.map((e)=>e?e.value||e:e).reduce((e,t)=>e.concat(t),[]).reduce(Go,''),Zo(n)||i.setAttributeNS(r,t,n))}}_renderStyleAttribute(e,t){const n=t.node;for(const o in e){const r=e[o];No(r)?this._bindToObservable({schema:[r],updater:Mo(n,o),data:t}):n.style[o]=r}}_renderElementChildren(e){const t=e.node,n=e.intoFragment?document.createDocumentFragment():t,o=e.isApplying;let r=0;for(const i of this.children)if(Qo(i)){if(!o){i.setParent(t);for(const e of i)n.appendChild(e.element)}}else if(Jo(i))o||(!i.isRendered&&i.render(),n.appendChild(i.element));else if(Be(i))n.appendChild(i);else if(o){const t=e.revertData,o=Xo();t.children.push(o),i._renderNode({node:n.childNodes[r++],isApplying:!0,revertData:o})}else n.appendChild(i.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,r]=t.split('@');return n.activateDomEventListener(o,r,e)});e.revertData&&e.revertData.bindings.push(n)}}_bindToObservable({schema:e,updater:t,data:n}){const o=n.revertData;Lo(e,t,n);const r=e.filter((e)=>!Zo(e)).filter((e)=>e.observable).map((o)=>o.activateAttributeListener(e,t,n));o&&o.bindings.push(r)}_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;nLo(e,t,n);return this.emitter.listenTo(this.observable,'change:'+this.attribute,o),()=>{this.emitter.stopListening(this.observable,'change:'+this.attribute,o)}}}class Pb extends Eb{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 Sb extends Eb{getValue(e){const t=super.getValue(e);return!Zo(t)&&(this.valueIfTrue||!0)}}var Rb=i(27),Ob=i.n(Rb);class Ib{constructor(e){this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new Wu,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=Tb.bind(this,this)}createCollection(){const e=new Cb;return this._viewCollections.add(e),e}registerChild(e){R(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){R(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new Tb(e)}extendTemplate(e){Tb.extend(this.template,e)}render(){if(this.isRendered)throw new bd('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())}}_(Ib,hm),_(Ib,Lu);var Nb=i(30),Vb=i.n(Nb);const Lb=ar('px'),Db=um.document.body;class Fb extends Ib{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',Lb),left:t.to('left',Lb)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){this.show();const t=Fb.defaultPositions,n=Object.assign({},{element:this.element,positions:[t.southArrowNorth,t.southArrowNorthWest,t.southArrowNorthEast,t.northArrowSouth,t.northArrowSouthWest,t.northArrowSouthEast],limiter:Db,fitInViewport:!0},e),{top:o,left:r,name:i}=nr(n);Object.assign(this,{top:o,left:r,position:i})}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=sr(e.target),n=e.limiter?sr(e.limiter):Db;this.listenTo(um.document,'scroll',(o,r)=>{const i=r.target,a=t&&i.contains(t),s=n&&i.contains(n);(a||s||!t||!n)&&this.attachTo(e)},{useCapture:!0}),this.listenTo(um.window,'resize',()=>{this.attachTo(e)})}_stopPinning(){this.stopListening(um.document,'scroll'),this.stopListening(um.window,'resize')}}Fb.arrowHorizontalOffset=25,Fb.arrowVerticalOffset=10,Fb.defaultPositions={northArrowSouth:(e,t)=>({top:lr(e,t),left:e.left+e.width/2-t.width/2,name:'arrow_s'}),northArrowSouthEast:(e,t)=>({top:lr(e,t),left:e.left+e.width/2-t.width+Fb.arrowHorizontalOffset,name:'arrow_se'}),northArrowSouthWest:(e,t)=>({top:lr(e,t),left:e.left+e.width/2-Fb.arrowHorizontalOffset,name:'arrow_sw'}),northWestArrowSouth:(e,t)=>({top:lr(e,t),left:e.left-t.width/2,name:'arrow_s'}),northWestArrowSouthWest:(e,t)=>({top:lr(e,t),left:e.left-Fb.arrowHorizontalOffset,name:'arrow_sw'}),northWestArrowSouthEast:(e,t)=>({top:lr(e,t),left:e.left-t.width+Fb.arrowHorizontalOffset,name:'arrow_se'}),northEastArrowSouth:(e,t)=>({top:lr(e,t),left:e.right-t.width/2,name:'arrow_s'}),northEastArrowSouthEast:(e,t)=>({top:lr(e,t),left:e.right-t.width+Fb.arrowHorizontalOffset,name:'arrow_se'}),northEastArrowSouthWest:(e,t)=>({top:lr(e,t),left:e.right-Fb.arrowHorizontalOffset,name:'arrow_sw'}),southArrowNorth:(e,t)=>({top:dr(e,t),left:e.left+e.width/2-t.width/2,name:'arrow_n'}),southArrowNorthEast:(e,t)=>({top:dr(e,t),left:e.left+e.width/2-t.width+Fb.arrowHorizontalOffset,name:'arrow_ne'}),southArrowNorthWest:(e,t)=>({top:dr(e,t),left:e.left+e.width/2-Fb.arrowHorizontalOffset,name:'arrow_nw'}),southWestArrowNorth:(e,t)=>({top:dr(e,t),left:e.left-t.width/2,name:'arrow_n'}),southWestArrowNorthWest:(e,t)=>({top:dr(e,t),left:e.left-Fb.arrowHorizontalOffset,name:'arrow_nw'}),southWestArrowNorthEast:(e,t)=>({top:dr(e,t),left:e.left-t.width+Fb.arrowHorizontalOffset,name:'arrow_ne'}),southEastArrowNorth:(e,t)=>({top:dr(e,t),left:e.right-t.width/2,name:'arrow_n'}),southEastArrowNorthEast:(e,t)=>({top:dr(e,t),left:e.right-t.width+Fb.arrowHorizontalOffset,name:'arrow_ne'}),southEastArrowNorthWest:(e,t)=>({top:dr(e,t),left:e.right-Fb.arrowHorizontalOffset,name:'arrow_nw'})};class Mb extends xb{static get pluginName(){return'ContextualBalloon'}init(){this.view=new Fb,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 bd('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 bd('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=cr(this._stack.values()).position;return e&&!e.limiter&&(e=Object.assign({},e,{limiter:this.positionLimiter})),e}}class Bb{constructor(){this.set('isFocused',!1),this.focusedElement=null,this._elements=new Set,this._nextEventLoopTimeout=null}add(e){if(this._elements.has(e))throw new bd('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)}}_(Bb,hm),_(Bb,Lu);class qb{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(pr)||null}get last(){return this.focusables.filter(pr).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(pr(t))return t;o=(o+n+e)%n}while(o!==t);return null}}class zb extends Ib{constructor(e){super(e),this.setTemplate({tag:'span',attributes:{class:['ck','ck-toolbar__separator']}})}}var jb=i(32),Ub=i.n(jb);class Hb extends Ib{constructor(e){super(e);const t=this.bindTemplate;this.items=this.createCollection(),this.focusTracker=new Bb,this.keystrokes=new _b,this.set('isVertical',!1),this.set('className'),this._focusCycler=new qb({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:ur(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 zb):t.has(e)?this.items.add(t.create(e)):Zm.warn('toolbarview-item-unavailable: The requested toolbar item is unavailable.',{name:e})})}}class Wb extends xb{static get pluginName(){return'BalloonToolbar'}static get requires(){return[Mb]}init(){const e=this.editor;this.toolbarView=new Hb(e.locale),this.toolbarView.extendTemplate({attributes:{class:['ck-toolbar_floating']}}),this.toolbarView.render(),this._balloon=e.plugins.get(Mb),this._fireSelectionChangeDebounced=Gm(()=>this.fire('_selectionChangeDebounced'),200),this._handleSelectionChange(),this._handleFocusChange(),this.decorate('show')}afterInit(){const e=mr(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.isBackward;return{target:()=>{const e=n.selection.getFirstRange(),r=eg.getDomRangeRects(t.domConverter.viewRangeToDom(e));return o?r[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 Qb extends Yb{constructor(e,n){super(e,n);const o=this.bindTemplate,r=this.t;this.set('name',null);this.extendTemplate({attributes:{role:'textbox',"aria-label":o.to('name',(e)=>r('v',[e])),class:'ck-editor__editable_inline'}})}}class Xb extends Jb{constructor(e,t){super(e),this.editable=new Qb(e,t),this.registerChild(this.editable)}get editableElement(){return this.editable.element}}const e_={setData(e){this.data.set(e)},getData(){return this.data.get()}};var t_=e_;const n_={updateElement(){br(this.element,this.data.get())}};var o_=n_;class r_ extends wb{constructor(e,t){super(t),this.element=e,this.config.get('plugins').push(Wb),this.config.define('balloonToolbar',this.config.get('toolbar')),this.data.processor=new vb,this.model.document.createRoot(),this.ui=new $b(this,new Xb(this.locale,e)),kr(this)}destroy(){const e=this.getData();return this.ui.destroy(),super.destroy().then(()=>br(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(_r(e))).then(()=>{o.fire('dataReady'),o.fire('ready')}).then(()=>o))})}}_(r_,t_),_(r_,o_);class i_{constructor(e,t){this.editor=e,this.view=t,this.componentFactory=new Gb(e),this.focusTracker=new Bb,this._toolbarConfig=mr(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),fr({origin:e.editing.view,originFocusTracker:this.focusTracker,originKeystrokeHandler:e.keystrokes,toolbar:this.view.toolbar})}destroy(){this.view.destroy()}}var a_=i(36),s_=i.n(a_);class l_ extends Ib{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 d_ extends Jb{constructor(e){super(e);const t=s();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 l_;return t.text=n('u'),t.extendTemplate({attributes:{id:`ck-editor__aria-label_${e}`,class:'ck-voice-label'}}),t}}var c_=i(38),p_=i.n(c_);const u_=ar('px');class m_ extends Ib{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 Tb({tag:'div',attributes:{class:['ck','ck-sticky-panel__placeholder'],style:{display:t.to('isSticky',(e)=>e?'block':'none'),height:t.to('isSticky',(e)=>e?u_(this._panelRect.height):null)}}}).render(),this._contentPanel=new Tb({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?u_(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to('_hasViewportTopOffset',(e)=>e?u_(this.viewportTopOffset):null),bottom:t.to('_isStickyToTheLimiter',(e)=>e?u_(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(um.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 __ extends wb{constructor(e,t){super(t),this._elementReplacer=new b_,this.element=e,this.data.processor=new vb,this.model.document.createRoot(),this.ui=new i_(this,new f_(this.locale)),kr(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(_r(e))).then(()=>{o.fire('dataReady'),o.fire('ready')}).then(()=>o))})}}_(__,t_),_(__,o_);class k_{constructor(e){this.files=wr(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 w_ extends Bm{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 k_(e.clipboardData?e.clipboardData:e.dataTransfer)};'drop'==e.type&&(t.dropRange=yr(this.view,e)),this.fire(e.type,e,t)}}const y_=['figcaption','li'];class v_ extends xb{static get pluginName(){return'Clipboard'}init(){function e(e,o){const i=o.dataTransfer;o.preventDefault();const a=t.data.toView(t.model.getSelectedContent(n.selection));r.fire('clipboardOutput',{dataTransfer:i,content:a,method:e.name})}const t=this.editor,n=t.model.document,o=t.editing.view,r=o.document;this._htmlDataProcessor=new vb,o.addObserver(w_),this.listenTo(r,'clipboardInput',(e,n)=>{if(t.isReadOnly)return;const r=n.dataTransfer;let i='';r.getData('text/html')?i=xr(r.getData('text/html')):r.getData('text/plain')&&(i=vr(r.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,r=e.toModel(t.content,'$clipboardHolder');if(0==r.childCount)return;o.insertContent(r,n.selection)}},{priority:'low'}),this.listenTo(r,'copy',e,{priority:'low'}),this.listenTo(r,'cut',(n,o)=>{t.isReadOnly?o.preventDefault():e(n,o)},{priority:'low'}),this.listenTo(r,'clipboardOutput',(e,o)=>{o.content.isEmpty||(o.dataTransfer.setData('text/html',this._htmlDataProcessor.toData(o.content)),o.dataTransfer.setData('text/plain',Cr(o.content))),'cut'==o.method&&t.model.deleteContent(n.selection)},{priority:'low'})}}class x_{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('beforeChange:isEnabled',Ar,{priority:'highest'}),this.isEnabled=!1):(this.off('beforeChange:isEnabled',Ar),this.refresh())})}refresh(){this.isEnabled=!0}execute(){}destroy(){this.stopListening()}}_(x_,Lu);class C_ extends x_{execute(){const e=this.editor.model,t=e.document;e.change((n)=>{Tr(this.editor.model,n,t.selection,e.schema),this.fire('afterExecute',{writer:n})})}}class A_ extends bm{constructor(e){super(e);const t=this.document;t.on('keydown',(e,n)=>{if(this.isEnabled&&n.keyCode==tm.enter){let o;t.once('enter',(e)=>o=e,{priority:'highest'}),t.fire('enter',new Mm(t,n.domEvent)),o&&o.stop.called&&e.stop()}})}observe(){}}class T_ extends xb{static get pluginName(){return'Enter'}init(){const e=this.editor,t=e.editing.view,n=t.document;t.addObserver(A_),e.commands.add('enter',new C_(e)),this.listenTo(n,'enter',(n,o)=>{e.execute('enter'),o.preventDefault(),t.scrollToTheSelection()},{priority:'low'})}}class E_{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 ob),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 P_ extends x_{constructor(e,t){super(e),this._buffer=new E_(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||'',r=o.length,i=e.range||n.selection.getFirstRange(),a=e.resultRange;t.enqueueChange(this._buffer.batch,(e)=>{const t=i.isCollapsed;this._buffer.lock(),t||e.remove(i),o&&e.insertText(o,n.selection.getAttributes(),i.start),a?e.setSelection(a):t&&e.setSelection(i.start.getShiftedBy(r)),this._buffer.unlock(),this._buffer.input(r)})}}class S_ extends xb{static get pluginName(){return'Input'}init(){const e=this.editor,t=e.editing.view,n=new P_(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,r=t.buffer;!t.isEnabled||Sr(e)||o.selection.isCollapsed||(r.lock(),n.enqueueChange(r.batch,()=>{this.editor.model.deleteContent(o.selection)}),r.unlock())}_handleMutations(e,t){new R_(this.editor).handle(e,t)}}class R_{constructor(e){this.editor=e,this.editing=this.editor.editing}handle(e,t){if(Nr(e))this._handleContainerChildrenMutations(e,t);else for(const n of e)this._handleTextMutation(n,t),this._handleTextNodeInsertion(n)}_handleContainerChildrenMutations(e,t){const n=Ir(e);if(!n)return;const o=this.editor.editing.view.domConverter,r=o.mapViewToDom(n),i=new mm,a=this.editor.data.toModel(i.domToView(r)).getChild(0),s=this.editor.editing.mapper.toModelElement(n);if(!s)return;const l=Array.from(a.getChildren()),d=Array.from(s.getChildren());if(!Vr(l)||!Vr(d))return;const c=l.map((e)=>e.data).join('').replace(/\u00A0/g,' '),p=d.map((e)=>e.data).join('');if(p===c)return;const u=Se(p,c),{firstChangeAt:m,insertions:g,deletions:h}=Lr(u);let f=null;t&&(f=this.editing.mapper.toModelRange(t.getFirstRange()));const b=c.substr(m,g),_=pg.createFromParentsAndOffsets(s,m,s,m+h);this.editor.execute('input',{text:b,range:_,resultRange:f})}_handleTextMutation(e,t){if('text'!=e.type)return;const n=e.newText.replace(/\u00A0/g,' '),o=e.oldText.replace(/\u00A0/g,' '),r=Se(o,n),{firstChangeAt:i,insertions:a,deletions:s}=Lr(r);let l=null;t&&(l=this.editing.mapper.toModelRange(t.getFirstRange()));const d=new zu(e.node,i),c=this.editing.mapper.toModelPosition(d),p=pg.createFromPositionAndShift(c,s),u=n.substr(i,a);this.editor.execute('input',{text:u,range:p,resultRange:l})}_handleTextNodeInsertion(e){if('children'==e.type){const t=Or(e),n=new zu(e.node,t.index),o=this.editing.mapper.toModelPosition(n),r=t.values[0].data;this.editor.execute('input',{text:r.replace(/\u00A0/g,' '),range:new pg(o)})}}}const O_=[re('arrowUp'),re('arrowRight'),re('arrowDown'),re('arrowLeft'),9,16,17,18,20,27,33,34,35,36,229];for(let e=112;135>=e;e++)O_.push(e);class I_ extends x_{constructor(e,t){super(e),this.direction=t,this._buffer=new E_(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 r=new hg(n.selection),i=r.isCollapsed;if(r.isCollapsed&&t.modifySelection(r,{direction:this.direction,unit:e.unit}),this._shouldEntireContentBeReplacedWithParagraph(e.sequence||1))return void this._replaceEntireContentWithParagraph(o);if(r.isCollapsed)return;let a=0;r.getFirstRange().getMinimalFlatRanges().forEach((e)=>{a+=ee(e.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),t.deleteContent(r,{doNotResetEntireContent:i}),this._buffer.input(a),o.setSelection(r),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(1{(t.keyCode==tm.delete||t.keyCode==tm.backspace)&&(n=0)}),t.on('keydown',(e,o)=>{const r={};if(o.keyCode==tm.delete)r.direction='forward',r.unit='character';else if(o.keyCode==tm.backspace)r.direction='backward',r.unit='codePoint';else return;const i=Qu.isMac?o.altKey:o.ctrlKey;r.unit=i?'word':r.unit,r.sequence=++n;let a;t.once('delete',(e)=>a=e,{priority:'highest'}),t.fire('delete',new Mm(t,o.domEvent,r)),a&&a.stop.called&&e.stop()})}observe(){}}class V_ extends xb{static get pluginName(){return'Delete'}init(){const e=this.editor,t=e.editing.view,n=t.document;t.addObserver(N_),e.commands.add('forwardDelete',new I_(e,'forward')),e.commands.add('delete',new I_(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 L_ extends xb{static get requires(){return[S_,V_]}static get pluginName(){return'Typing'}}class D_ extends x_{constructor(e){super(e),this._stack=[],this._createdBatches=new WeakSet,this.refresh()}refresh(){this.isEnabled=0e.start.root!=r.graveyard);t&&i.push(t)}i.length&&o.change((e)=>{e.setSelection(i,{backward:t})})}_undo(e,t){const n=this.editor.model,o=n.document;this._createdBatches.add(t);const r=e.deltas.slice();r.reverse();for(const i of r)if(i.operations.some((e)=>e.isDocumentOperation)){const e=i.baseVersion+i.operations.length,r=Array.from(o.history.getDeltas(e)),a=n.transformDeltas([i.getReversed()],r,!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(i,e)}}}}class F_ extends D_{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 ob;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 M_ extends D_{execute(){const e=this._stack.pop(),t=new ob;this.editor.model.enqueueChange(t,()=>{const n=e.batch.deltas[e.batch.deltas.length-1],o=n.baseVersion+n.operations.length,r=this.editor.model.document.history.getDeltas(o);this._restoreSelection(e.selection.ranges,e.selection.isBackward,r),this._undo(e.batch,t)}),this.refresh()}}class B_ extends xb{constructor(e){super(e),this._batchRegistry=new WeakSet}init(){const e=this.editor;this._undoCommand=new F_(e),this._redoCommand=new M_(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 q_=i(42),z_=i.n(q_);class j_ extends Ib{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 U_=i(44),H_=i.n(U_);class W_ extends Ib{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 G_=i(46),$_=i.n(G_);class K_ extends Ib{constructor(e){super(e);const t=this.bindTemplate;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(),this.iconView=new j_,this.iconView.extendTemplate({attributes:{class:'ck-button__icon'}}),this.bind('_tooltipString').to(this,'tooltip',this,'label',this,'keystroke',this._getTooltipString.bind(this)),this.setTemplate({tag:'button',attributes:{class:['ck','ck-button',t.to('isEnabled',(e)=>e?'ck-enabled':'ck-disabled'),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')},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 W_;return e.bind('text').to(this,'_tooltipString'),e.bind('position').to(this,'tooltipPosition'),e}_createLabelView(){const e=new Ib;return e.setTemplate({tag:'span',attributes:{class:['ck','ck-button__label']},children:[{text:this.bindTemplate.to('label')}]}),e}_getTooltipString(e,t,n){return e?'string'==typeof e?e:(n&&(n=ae(n)),e instanceof Function?e(t,n):`${t}${n?` (${n})`:''}`):''}}var Z_=i(48),J_=i.n(Z_),Y_=i(49),Q_=i.n(Y_);class X_ extends xb{init(){const e=this.editor,n=e.t;this._addButton('undo',n('w'),'CTRL+Z',J_.a),this._addButton('redo',n('x'),'CTRL+Y',Q_.a)}_addButton(e,t,n,o){const r=this.editor;r.ui.componentFactory.add(e,(i)=>{const a=r.commands.get(e),s=new K_(i);return s.set({label:t,icon:o,keystroke:n,tooltip:!0}),s.bind('isEnabled').to(a,'isEnabled'),this.listenTo(s,'execute',()=>r.execute(e)),s})}}class ek extends xb{static get requires(){return[B_,X_]}static get pluginName(){return'Undo'}}class tk extends xb{static get requires(){return[v_,T_,L_,ek]}static get pluginName(){return'Essentials'}}class nk extends xb{static get pluginName(){return'PendingActions'}init(){this.set('isPending',!1),this._actions=new Wu({idProperty:'_id'}),this._actions.delegate('add','remove').to(this)}add(e){if('string'!=typeof e)throw new bd('pendingactions-add-invalid-message: Message has to be a string.');const t=Object.create(Lu);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 ok{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()}}_(ok,Lu);class rk extends xb{static get pluginName(){return'FileRepository'}static get requires(){return[nk]}init(){this.loaders=new Wu,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 Zm.error('filerepository-no-upload-adapter: Upload adapter is not defined.'),null;const t=new ik(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 ik?e:this.getLoader(e);t._destroy(),this.loaders.remove(t)}_updatePendingAction(){const e=this.editor.plugins.get(nk);if(!this.loaders.length)e.remove(this._pendingAction),this._pendingAction=null;else if(!this._pendingAction){const n=this.editor.t,t=(e)=>`${n('s')} ${parseInt(e)}%.`;this._pendingAction=e.add(t(this.uploadedPercent)),this._pendingAction.bind('message').to(this,'uploadedPercent',t)}}}_(rk,Lu);class ik{constructor(e,t){this.id=s(),this.file=e,this._adapter=t,this._reader=new ok,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 bd('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 bd('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}}_(ik,Lu);const ak='ckCsrfToken',sk=40,lk='abcdefghijklmnopqrstuvwxyz0123456789';class dk extends xb{static get requires(){return[rk]}static get pluginName(){return'CKFinderUploadAdapter'}init(){const e=this.editor.config.get('ckfinder.uploadUrl');e&&(this.editor.plugins.get(rk).createUploadAdapter=(t)=>new ck(t,e,this.editor.t))}}class ck{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,r=this.loader,i=this.t,t=i('a')+` ${r.file.name}.`;o.addEventListener('error',()=>n(t)),o.addEventListener('abort',()=>n()),o.addEventListener('load',()=>{const r=o.response;return r&&r.uploaded?void e({default:r.url}):n(r&&r.error&&r.error.message?r.error.message:t)}),o.upload&&o.upload.addEventListener('progress',(e)=>{e.lengthComputable&&(r.uploadTotal=e.total,r.uploaded=e.loaded)})}_sendRequest(){const e=new FormData;e.append('upload',this.loader.file),e.append('ckCsrfToken',Mr()),this.xhr.send(e)}}class pk{constructor(e,t,n){let o;if('function'==typeof n)o=n;else{o=()=>{e.execute(n)}}e.model.document.on('change',(n,r)=>{if('transparent'==r.type)return;const i=Array.from(e.model.document.differ.getChanges()),a=i[0];if(1!=i.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=pg.createFromParentsAndOffsets(s.parent,0,s.parent,l[0].length);e.remove(t),o({match:l})})})}}class uk{constructor(e,t,n){let o,r,i,a;t instanceof RegExp?o=t:i=t,'string'==typeof n?r=n:a=n,i=i||((e)=>{let t;const n=[],r=[];for(;null!==(t=o.exec(e))&&!(t&&4>t.length);){let{index:e,1:o,2:i,3:a}=t;e+=t[0].length-(o+i+a).length;const s=[e,e+o.length],l=[e+o.length+i.length,e+o.length+i.length+a.length];n.push(s),n.push(l),r.push([e+o.length,e+o.length+i.length])}return{remove:n,format:r}}),a=a||((e,t)=>{for(const n of t)e.setAttribute(r,!0,n);e.removeSelectionAttribute(r)}),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=jr(d).slice(0,o.focus.offset),p=i(c),u=Ur(d,p.format),m=Ur(d,p.remove);u.length&&m.length&&e.model.enqueueChange((t)=>{const n=e.model.schema.getValidRanges(u,r);a(t,n);for(const e of m.reverse())t.remove(e)})})}}class mk extends xb{static get pluginName(){return'Autoformat'}afterInit(){this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats()}_addListAutoformats(){const e=this.editor.commands;e.get('bulletedList')&&new pk(this.editor,/^[*-]\s$/,'bulletedList'),e.get('numberedList')&&new pk(this.editor,/^\d+[.|)]\s$/,'numberedList')}_addBasicStylesAutoformats(){const e=this.editor.commands;e.get('bold')&&(new uk(this.editor,/(\*\*)([^*]+)(\*\*)$/g,'bold'),new uk(this.editor,/(__)([^_]+)(__)$/g,'bold')),e.get('italic')&&(new uk(this.editor,/(?:^|[^*])(\*)([^*_]+)(\*)$/g,'italic'),new uk(this.editor,/(?:^|[^_])(_)([^_]+)(_)$/g,'italic')),e.get('code')&&new uk(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 pk(this.editor,n,()=>{this.editor.execute('heading',{value:e})})})}_addBlockQuoteAutoformats(){this.editor.commands.get('blockQuote')&&new pk(this.editor,/^>\s$/,'blockQuote')}}class gk extends x_{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,r=e.forceValue===void 0?!this.value:e.forceValue;t.change((e)=>{if(o.isCollapsed)r?e.setSelectionAttribute(this.attributeKey,!0):e.removeSelectionAttribute(this.attributeKey);else{const n=t.schema.getValidRanges(o.getRanges(),this.attributeKey);for(const t of n)r?e.setAttribute(this.attributeKey,r,t):e.removeAttribute(this.attributeKey,t)}})}}const hk='bold';class fk extends xb{init(){const e=this.editor;e.model.schema.extend('$text',{allowAttributes:hk}),e.conversion.attributeToElement({model:hk,view:'strong',upcastAlso:['b',{styles:{"font-weight":'bold'}}]}),e.commands.add(hk,new gk(e,hk)),e.keystrokes.set('CTRL+B',hk)}}var bk=i(50),_k=i.n(bk);const kk='bold';class wk extends xb{init(){const e=this.editor,n=e.t;e.ui.componentFactory.add(kk,(t)=>{const o=e.commands.get(kk),r=new K_(t);return r.set({label:n('b'),icon:_k.a,keystroke:'CTRL+B',tooltip:!0}),r.bind('isOn','isEnabled').to(o,'value','isEnabled'),this.listenTo(r,'execute',()=>e.execute(kk)),r})}}class yk extends xb{static get requires(){return[fk,wk]}static get pluginName(){return'Bold'}}const vk='italic';class xk extends xb{init(){const e=this.editor;e.model.schema.extend('$text',{allowAttributes:vk}),e.conversion.attributeToElement({model:vk,view:'i',upcastAlso:['em',{styles:{"font-style":'italic'}}]}),e.commands.add(vk,new gk(e,vk)),e.keystrokes.set('CTRL+I',vk)}}var Ck=i(51),Ak=i.n(Ck);const Tk='italic';class Ek extends xb{init(){const e=this.editor,n=e.t;e.ui.componentFactory.add(Tk,(t)=>{const o=e.commands.get(Tk),r=new K_(t);return r.set({label:n('e'),icon:Ak.a,keystroke:'CTRL+I',tooltip:!0}),r.bind('isOn','isEnabled').to(o,'value','isEnabled'),this.listenTo(r,'execute',()=>e.execute(Tk)),r})}}class Pk extends xb{static get requires(){return[xk,Ek]}static get pluginName(){return'Italic'}}class Sk extends x_{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(Hr));else{const t=o.filter((e)=>Hr(e)||Gr(n,e));this._applyQuote(e,t)}})}_getValue(){const e=cr(this.editor.model.document.selection.getSelectedBlocks());return!!(e&&Hr(e))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,n=cr(e.getSelectedBlocks());return!!n&&Gr(t,n)}_removeQuote(e,t){Wr(t).reverse().forEach((t)=>{if(t.start.isAtStart&&t.end.isAtEnd)return void e.unwrap(t.start.parent);if(t.start.isAtStart){const n=cg.createBefore(t.start.parent);return void e.move(t,n)}t.end.isAtEnd||e.split(t.end);const n=cg.createAfter(t.end.parent);e.move(t,n)})}_applyQuote(e,t){const n=[];Wr(t).reverse().forEach((t)=>{let o=Hr(t.start);o||(o=new sg('blockQuote'),e.wrap(t,o)),n.push(o)}),n.reverse().reduce((t,n)=>t.nextSibling==n?(e.merge(cg.createAfter(t)),t):n)}}class Rk extends xb{init(){const e=this.editor,t=e.model.schema;e.commands.add('blockQuote',new Sk(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,r=o.selection.getLastPosition().parent;o.selection.isCollapsed&&r.isEmpty&&t.value&&(this.editor.execute('blockQuote'),this.editor.editing.view.scrollToTheSelection(),n.preventDefault(),e.stop())})}}var Ok=i(52),Ik=i.n(Ok),Nk=i(53),Vk=i.n(Nk);class Lk extends xb{init(){const e=this.editor,n=e.t;e.ui.componentFactory.add('blockQuote',(t)=>{const o=e.commands.get('blockQuote'),r=new K_(t);return r.set({label:n('d'),icon:Ik.a,tooltip:!0}),r.bind('isOn','isEnabled').to(o,'value','isEnabled'),this.listenTo(r,'execute',()=>e.execute('blockQuote')),r})}}class Dk extends xb{static get requires(){return[Rk,Lk]}static get pluginName(){return'BlockQuote'}}const Fk=/^data:(\S*?);base64,/;class Mk{constructor(e,t,n){if(!e)throw new Error('File must be provided');if(!t)throw new Error('Token must be provided');if(!n)throw new Error('Api address must be provided');this.file=Kr(e)?$r(e):e,this._token=t,this._apiAddress=n}onProgress(e){return this.on('progress',(t,n)=>e(n)),this}onError(e){return this.once('error',(t,n)=>e(n)),this}abort(){this.xhr.abort()}send(){return this._prepareRequest(),this._attachXHRListeners(),this._sendRequest()}_prepareRequest(){const e=new XMLHttpRequest;e.open('POST',this._apiAddress),e.setRequestHeader('Authorization',this._token.value),e.responseType='json',this.xhr=e}_attachXHRListeners(){function e(e){return()=>t.fire('error',e)}const t=this,n=this.xhr;n.addEventListener('error',e('Network Error')),n.addEventListener('abort',e('Abort')),n.upload&&n.upload.addEventListener('progress',(e)=>{e.lengthComputable&&this.fire('progress',{total:e.total,uploaded:e.loaded})}),n.addEventListener('load',()=>{const e=n.status,t=n.response;if(200>e||299{t.addEventListener('load',()=>{const e=t.status,r=t.response;return 200>e||299o('Network Error')),t.addEventListener('abort',()=>o('Abort')),t.send(e)})}}_(Mk,Ad);const Bk={refreshInterval:36e5,autoRefresh:!0};class qk{constructor(e,t=Bk){if(!e)throw new Error('`tokenUrl` must be provided');this.set('value',t.initValue),this._tokenUrl=e,this._options=Object.assign({},Bk,t)}init(){return new Promise((e,t)=>(this._options.autoRefresh&&this._startRefreshing(),this.value?void e(this):void this._refreshToken().then(e).catch(t)))}_refreshToken(){return new Promise((e,t)=>{const n=new XMLHttpRequest;n.open('GET',this._tokenUrl),n.addEventListener('load',()=>{const o=n.status,r=n.response;return 200>o||299t('Network Error')),n.addEventListener('abort',()=>t('Abort')),n.send()})}_startRefreshing(){this._refreshInterval=setInterval(this._refreshToken.bind(this),this._options.refreshInterval)}_stopRefreshing(){clearInterval(this._refreshInterval)}static create(e,t=Bk){const n=new qk(e,t);return n.init()}}_(qk,Lu);class zk extends xb{init(){const e=this.editor,t=e.config,n=t.get('cloudServices')||{};for(const e in n)this[e]=n[e];return this.tokenUrl?(this.token=new zk.Token(this.tokenUrl),this.token.init()):void(this.token=null)}}zk.Token=qk;class jk extends xb{static get requires(){return[rk,zk]}init(){const e=this.editor,t=e.plugins.get(zk),n=t.token,o=t.uploadUrl;n&&(this._uploadGateway=new jk._UploadGateway(n,o),e.plugins.get(rk).createUploadAdapter=(e)=>new Uk(this._uploadGateway,e))}}class Uk{constructor(e,t){this.uploadGateway=e,this.loader=t}upload(){return this.fileUploader=this.uploadGateway.upload(this.loader.file),this.fileUploader.on('progress',(e,t)=>{this.loader.uploadTotal=t.total,this.loader.uploaded=t.uploaded}),this.fileUploader.send()}abort(){this.fileUploader.abort()}}jk._UploadGateway=class{constructor(e,t){if(!e)throw new Error('Token must be provided');if(!t)throw new Error('Api address must be provided');this._token=e,this._apiAddress=t}upload(e){return new Mk(e,this._token,this._apiAddress)}};class Hk{constructor(){this._stack=[]}add(e,t){const n=this._stack,o=n[0];this._insertDescriptor(e);const r=n[0];o===r||Qr(o,r)||this.fire('change:top',{oldDescriptor:o,newDescriptor:r,writer:t})}remove(e,t){const n=this._stack,o=n[0];this._removeDescriptor(e);const r=n[0];o===r||Qr(o,r)||this.fire('change:top',{oldDescriptor:o,newDescriptor:r,writer:t})}_insertDescriptor(e){const t=this._stack,n=t.findIndex((t)=>t.id===e.id);if(!Qr(e,t[n])){-1t.id===e);-1ui(t)})),t.for('editingDowncast').add(kt({model:'image',view:(e,t)=>li(ui(t),t,o('c'))})),t.for('downcast').add(Yr('src')).add(Yr('alt')).add(Jr()),t.for('upcast').add(en({view:{name:'img',attributes:{src:!0}},model:(e,t)=>t.createElement('image',{src:e.getAttribute('src')})})).add(nn({view:{name:'img',key:'alt'},model:'alt'})).add(nn({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(Zr())}}class Yk extends Bm{constructor(e){super(e),this.domEventType='mousedown'}onDomEvent(e){this.fire(e.type,e)}}var Qk=i(55),Xk=i.n(Qk);const ew=ie('Ctrl+A');class tw extends xb{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,r=o.document.selection,i=r.getSelectedElement();for(const a of r.getRanges())for(const e of a){const t=e.item;t.is('element')&&ti(t)&&(o.addClass(Kk,t),this._previouslySelected.add(t),t==i&&o.setSelection(r.getRanges(),{fake:!0,label:ii(i)}))}},{priority:'low'}),e.addObserver(Yk),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,r=o.document;let i=t.target;if(!hi(i)&&(ti(i)||(i=i.findAncestor(ti),!!i))){t.preventDefault(),r.isFocused||o.focus();const e=n.editing.mapper.toModelElement(i);this._setSelectionOverElement(e)}}_onKeydown(e,t){const n=t.keyCode,o=n==tm.delete||n==tm.arrowdown||n==tm.arrowright;let r=!1;mi(n)?r=this._handleArrowKeys(o):gi(t)&&(r=this._selectAllNestedEditableContent()||this._selectAllContent()),r&&(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,r=o.selection,i=r.getSelectedElement();if(i&&n.isObject(i)){const o=e?r.getLastPosition():r.getFirstPosition(),i=n.getNearestSelectionRange(o,e?'forward':'backward');return i&&t.change((e)=>{e.setSelection(i)}),!0}if(r.isCollapsed){const t=this._getObjectElementNextToSelection(e);if(t instanceof sg&&n.isObject(t))return this._setSelectionOverElement(t),!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(pg.createIn(n))}),!0)}_selectAllContent(){const e=this.editor.model,t=this.editor.editing,n=t.view,o=n.document,r=o.selection,i=r.getSelectedElement();if(i&&ti(i)){const n=t.mapper.toModelElement(i.parent);return e.change((e)=>{e.setSelection(pg.createIn(n))}),!0}return!1}_setSelectionOverElement(e){this.editor.model.change((t)=>{t.setSelection(pg.createOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model,n=t.schema,o=t.document.selection,r=new hg(o);t.modifySelection(r,{direction:e?'forward':'backward'});const i=e?r.focus.nodeBefore:r.focus.nodeAfter;return i instanceof sg&&n.isObject(i)?i:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass(Kk,t);this._previouslySelected.clear()}}class nw extends x_{refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=pi(e),this.value=!!(pi(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 ow extends xb{init(){this.editor.commands.add('imageTextAlternative',new nw(this.editor))}}class rw extends Ib{constructor(e,t){super(e);const n=`ck-input-${s()}`;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 l_(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 iw=i(57),aw=i.n(iw);class sw extends Ib{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 lw=i(9),dw=i.n(lw),cw=i(10),pw=i.n(cw),uw=i(59),mw=i.n(uw);class gw extends Ib{constructor(e){super(e);const n=this.locale.t;this.focusTracker=new Bb,this.keystrokes=new _b,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(n('y'),dw.a,'ck-button-save'),this.saveButtonView.type='submit',this.cancelButtonView=this._createButton(n('z'),pw.a,'ck-button-cancel','cancel'),this._focusables=new Cb,this._focusCycler=new qb({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),bi({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 r=new K_(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),o&&r.delegate('execute').to(this,o),r}_createLabeledInputView(){const e=this.locale.t,t=new rw(this.locale,sw);return t.label=e('aa'),t.inputView.placeholder=e('aa'),t}}var hw=i(61),fw=i.n(hw);class bw extends xb{static get requires(){return[Mb]}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'),r=new K_(t);return r.set({label:n('t'),icon:fw.a,tooltip:!0}),r.bind('isEnabled').to(o,'isEnabled'),this.listenTo(r,'execute',()=>this._showForm()),r})}_createForm(){const e=this.editor,t=e.editing.view,n=t.document;this._balloon=this.editor.plugins.get('ContextualBalloon'),this._form=new gw(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',()=>{ci(n.selection)?this._isVisible&&_i(e):this._hideForm(!0)}),fi({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:ki(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 _w extends xb{static get requires(){return[ow,bw]}static get pluginName(){return'ImageTextAlternative'}}var kw=i(62),ww=i.n(kw);class yw extends xb{static get requires(){return[Jk,tw,_w]}static get pluginName(){return'Image'}}class vw extends Ib{constructor(e){super(e),this.buttonView=new K_(e),this._fileInputView=new xw(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 xw extends Ib{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()}}var Cw=i(64),Aw=i.n(Cw);class Tw extends xb{init(){const e=this.editor,n=e.t;e.ui.componentFactory.add('imageUpload',(t)=>{const o=new vw(t),r=e.commands.get('imageUpload');return o.set({acceptedType:'image/*',allowMultipleFiles:!0}),o.buttonView.set({label:n('n'),icon:Aw.a,tooltip:!0}),o.buttonView.bind('isEnabled').to(r),o.on('done',(t,n)=>{for(const o of Array.from(n)){const t=yi(e.model.document.selection);wi(o)&&e.execute('imageUpload',{file:o,insertAt:t})}}),o})}}var Ew=i(65),Pw=i.n(Ew),Sw=i(66),Rw=i.n(Sw),Ow=i(68),Iw=i.n(Ow);class Nw extends xb{constructor(e){super(e),this.placeholder='data:image/svg+xml;utf8,'+encodeURIComponent(Pw.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,r=t.item,i=r.getAttribute('uploadId');if(n.consumable.consume(t.item,e.name)){const e=o.plugins.get(rk),a=i?t.attributeNewValue:null,s=this.placeholder,l=o.editing.mapper.toViewElement(r),d=n.writer;if('reading'==a)return vi(l,d),void Ci(s,l,d);if('uploading'==a){const t=e.loaders.get(i);return vi(l,d),void(t?(Ai(l,d),Ti(l,d,t,o.editing.view)):Ci(s,l,d))}'complete'==a&&e.loaders.get(i)&&Pi(l,d,o.editing.view),Ei(l,d),Ai(l,d),xi(l,d)}}}const Vw=Symbol('progress-bar');class Lw extends x_{execute(e){const t=this.editor,n=t.model.document,o=e.file,r=t.plugins.get(rk);t.model.change((i)=>{const a=r.createLoader(o);if(!a)return;const s=new sg('image',{uploadId:a.id});let l;l=e.insertAt?new hg([new pg(e.insertAt)]):n.selection,t.model.insertContent(s,l),s.parent&&i.setSelection(pg.createOn(s))})}}class Dw extends xb{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 Fw extends xb{static get requires(){return[rk,Dw]}init(){const e=this.editor,t=e.model.document,n=e.model.schema,o=e.plugins.get(rk);n.extend('image',{allowAttributes:['uploadId','uploadStatus']}),e.commands.add('imageUpload',new Lw(e)),e.editing.view.document.on('clipboardInput',(n,o)=>{if(Oi(o.dataTransfer))return;let r=new hg(o.targetRanges.map((t)=>e.editing.mapper.toModelRange(t)));for(const i of o.dataTransfer.files){const o=yi(r);wi(i)&&(e.execute('imageUpload',{file:i,insertAt:o}),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,r=e.getAttribute('uploadId');if(!r)continue;const i=o.loaders.get(r);if(!i)continue;n?i.abort():'idle'==i.status&&this._load(i,e)}})}_load(e,n){function o(){i.enqueueChange('transparent',(e)=>{e.removeAttribute('uploadId',n),e.removeAttribute('uploadStatus',n)}),t.destroyLoader(e)}const r=this.editor,i=r.model,a=r.locale.t,t=r.plugins.get(rk),s=r.plugins.get(Dw);return i.enqueueChange('transparent',(e)=>{e.setAttribute('uploadStatus','reading',n)}),e.read().then((t)=>{const o=r.editing.mapper.toViewElement(n),a=o.getChild(0),s=e.upload();return r.editing.view.change((e)=>{e.setAttribute('src',t,a)}),i.enqueueChange('transparent',(e)=>{e.setAttribute('uploadStatus','uploading',n)}),s}).then((e)=>{i.enqueueChange('transparent',(t)=>{t.setAttributes({uploadStatus:'complete',src:e.default},n);let o=0;const r=Object.keys(e).filter((e)=>{const t=parseInt(e,10);if(!isNaN(t))return o=rd(o,t),!0}).map((t)=>`${e[t]} ${t}w`).join(', ');''!=r&&t.setAttribute('srcset',{data:r,width:o},n)}),o()}).catch((t)=>{if('error'!==e.status&&'aborted'!==e.status)throw t;'error'==e.status&&s.showWarning(t,{title:a('o'),namespace:'upload'}),o(),i.enqueueChange('transparent',(e)=>{e.remove(n)})})}}class Mw extends xb{static get pluginName(){return'ImageUpload'}static get requires(){return[Fw,Tw,Nw]}}class Bw extends xb{static get requires(){return[jk,yw,Mw]}static get pluginName(){return'EasyImage'}}class qw extends x_{refresh(){const e=this.editor.model,t=e.document,n=cr(t.selection.getSelectedBlocks());this.value=!!n&&n.is('paragraph'),this.isEnabled=!!n&&Ii(n,e.schema)}execute(e={}){const t=this.editor.model,n=t.document;t.change((o)=>{const r=(e.selection||n.selection).getSelectedBlocks();for(const e of r)!e.is('paragraph')&&Ii(e,t.schema)&&o.rename(e,'paragraph')})}}class zw extends xb{static get pluginName(){return'Paragraph'}init(){const e=this.editor,t=e.model,n=e.data;e.commands.add('paragraph',new qw(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(zw.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:r}=n.convertChildren(t.viewItem,cg.createAt(e));t.modelRange=new pg(cg.createBefore(e),r.end),t.modelCursor=t.modelRange.end}else Vi(t.viewItem,t.modelCursor,n.schema)&&(t=Object.assign(t,Ni(t.viewItem,t.modelCursor,n)))},{priority:'low'}),n.upcastDispatcher.on('text',(e,t,n)=>{t.modelRange||Vi(t.viewItem,t.modelCursor,n.schema)&&(t=Object.assign(t,Ni(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}}}zw.paragraphLikeElements=new Set(['blockquote','dd','div','dt','h1','h2','h3','h4','h5','h6','li','p','td']);class jw extends x_{constructor(e,t){super(e),this.modelElements=t}refresh(){const e=cr(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some((t)=>Li(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model,n=t.document,o=e.value;t.change((e)=>{const r=Array.from(n.selection.getSelectedBlocks()).filter((e)=>Li(e,o,t.schema));for(const t of r)t.is(o)||e.rename(t,o)})}}const Uw='paragraph';class Hw extends xb{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[zw]}init(){const e=this.editor,t=e.config.get('heading.options'),n=[];for(const o of t)o.model!==Uw&&(e.model.schema.register(o.model,{inheritAllFrom:'$block'}),e.conversion.elementToElement(o),n.push(o.model));e.commands.add('heading',new jw(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 r=e.model.document.selection.getFirstPosition().parent,i=n.some((e)=>r.is(e.model));i&&!r.is(Uw)&&0===r.childCount&&o.writer.rename(r,Uw)})}}class Ww{constructor(e,t){t&&Ru(this,t),e&&this.set(e)}}_(Ww,Lu);class Gw extends Ib{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 $w=i(70),Kw=i.n($w);class Zw extends Ib{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 Bb,this.keystrokes=new _b,this.setTemplate({tag:'div',attributes:{class:['ck','ck-dropdown',o.to('isEnabled',(e)=>e?'':'ck-disabled')]},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 Jw=i(72),Yw=i.n(Jw);class Qw extends K_{constructor(e){super(e),this.arrowView=this._createArrowView(),this.delegate('execute').to(this,'open')}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new j_;return e.content=Yw.a,e.extendTemplate({attributes:{class:'ck-dropdown__arrow'}}),e}}var Xw=i(73),ey=i.n(Xw);class ty extends Ib{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new Bb,this.keystrokes=new _b,this._focusCycler=new qb({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 ny extends Ib{constructor(){super(),this.set('tabindex',-1),this.keystrokes=new _b;const e=this.bindTemplate;this.setTemplate({tag:'li',attributes:{class:['ck','ck-list__item',e.to('class'),e.if('isActive','ck-list__item_active')],style:e.to('style'),tabindex:e.to('tabindex')},children:[{text:e.to('label')}],on:{click:e.to('execute')}})}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()}}var oy=i(75),ry=i.n(oy),iy=i(77),ay=i.n(iy),sy=i(11),ly=i.n(sy);class dy extends xb{init(){const e=this.editor,n=e.t,t=ji(e),o=n('g'),r=n('h');e.ui.componentFactory.add('heading',(n)=>{const i={},a=new Wu,s=e.commands.get('heading'),l=e.commands.get('paragraph'),d=[s];for(const e of t){const t=new Ww({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),i[e.model]=e.title}const c=Di(n);return Fi(c,a),c.buttonView.set({isOn:!1,withText:!0,tooltip:r}),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 i[n]?i[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 cy extends xb{static get requires(){return[Hw,dy]}static get pluginName(){return'Heading'}}var py=i(80),uy=i.n(py);const my=new WeakMap,gy=Symbol('imageCaption');class hy extends xb{init(){const e=this.editor,n=e.editing.view,o=e.model.schema,r=e.data,i=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(en({view:Ki,model:'caption'}));r.downcastDispatcher.on('insert:caption',Zi((e)=>e.createContainerElement('figcaption'),!1));const t=Gi(n,a('f'));i.downcastDispatcher.on('insert:caption',Zi(t)),i.downcastDispatcher.on('insert',this._fixCaptionVisibility((e)=>e.item),{priority:'high'}),i.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 r=this.editor.model.document.selection,i=r.getSelectedElement();if(i&&i.is('image')){const e=$i(i);o=t.toViewElement(e)}const a=r.getFirstPosition(),s=Yi(a.parent);if(s&&(o=t.toViewElement(s)),o)return n?n===o?Xi(o,e):(Qi(n,e),this._lastSelectedCaption=o,Xi(o,e)):(this._lastSelectedCaption=o,Xi(o,e));if(n){const t=Qi(n,e);return this._lastSelectedCaption=null,t}return!1}_fixCaptionVisibility(e){return(t,n,o)=>{const r=e(n),i=Yi(r),a=this.editor.editing.mapper,s=o.writer;if(i){const e=a.toViewElement(i);e&&(i.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(!$i(n))return e.appendElement('caption',n),!0}}}var fy=i(82),by=i.n(fy);class _y extends xb{static get requires(){return[hy]}static get pluginName(){return'ImageCaption'}}class ky extends x_{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=pi(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 wy=i(84),yy=i.n(wy),vy=i(12),xy=i.n(vy),Cy=i(13),Ay=i.n(Cy),Ty=i(14),Ey=i.n(Ty);const Py={full:{name:'full',title:'Full size image',icon:yy.a,isDefault:!0},side:{name:'side',title:'Side image',icon:Ey.a,className:'image-style-side'},alignLeft:{name:'alignLeft',title:'Left aligned image',icon:xy.a,className:'image-style-align-left'},alignCenter:{name:'alignCenter',title:'Centered image',icon:Ay.a,className:'image-style-align-center'},alignRight:{name:'alignRight',title:'Right aligned image',icon:Ey.a,className:'image-style-align-right'}},Sy={full:yy.a,left:xy.a,right:Ey.a,center:Ay.a};class Ry extends xb{static get requires(){return[Jk]}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 r=oa(e.config.get('image.styles'));t.extend('image',{allowAttributes:'imageStyle'});const i=ea(r);o.downcastDispatcher.on('attribute:imageStyle:image',i),n.downcastDispatcher.on('attribute:imageStyle:image',i),n.upcastDispatcher.on('element:figure',ta(r),{priority:'low'}),e.commands.add('imageStyle',new ky(e,r))}}var Oy=i(85),Iy=i.n(Oy);class Ny extends xb{get localizedDefaultStylesTitles(){const e=this.editor.t;return{"Full size image":e('i'),"Side image":e('j'),"Left aligned image":e('k'),"Centered image":e('l'),"Right aligned image":e('m')}}init(){const e=this.editor,t=e.config.get('image.styles'),n=ia(oa(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'),r=new K_(n);return r.set({label:e.title,icon:e.icon,tooltip:!0}),r.bind('isEnabled').to(o,'isEnabled'),r.bind('isOn').to(o,'value',(t)=>t===e.name),this.listenTo(r,'execute',()=>t.execute('imageStyle',{value:e.name})),r})}}class Vy extends xb{static get requires(){return[Ry,Ny]}static get pluginName(){return'ImageStyle'}}class Ly extends xb{static get requires(){return[Mb]}static get pluginName(){return'ImageToolbar'}init(){const e=this.editor,t=e.plugins.get('BalloonToolbar');t&&this.listenTo(t,'show',(t)=>{ci(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 Hb,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?ci(e.editing.view.document.selection)?this._showToolbar():this._hideToolbar():this._hideToolbar()}_showToolbar(){const e=this.editor;this._isVisible?_i(e):!this._balloon.hasView(this._toolbar)&&this._balloon.add({view:this._toolbar,position:ki(e),balloonClassName:'ck-toolbar-container'})}_hideToolbar(){this._isVisible&&this._balloon.remove(this._toolbar)}get _isVisible(){return this._balloon.visibleView==this._toolbar}}class Dy extends x_{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=aa(n.getFirstPosition(),n.getAttribute('linkHref'));o.setAttribute('linkHref',e,t),o.setSelection(t)}else if(''!==e){const r=lt(n.getAttributes());r.set('linkHref',e);const i=o.createText(e,r);o.insert(i,t),o.setSelection(pg.createOn(i))}}else{const r=t.schema.getValidRanges(n.getRanges(),'linkHref');for(const t of r)o.setAttribute('linkHref',e,t)}})}}class Fy extends x_{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?[aa(t.getFirstPosition(),t.getAttribute('linkHref'))]:t.getRanges();for(const t of n)e.removeAttribute('linkHref',t)})}}const My=Symbol('linkElement'),By=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,qy=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;class zy{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&&ma(this._modelSelection.getFirstPosition(),n)||this._restoreGravity()))}handleForwardMovement(e,t){const n=this.attribute;return this._isGravityOverridden||e.isAtStart&&this._hasSelectionAttribute?void 0:fa(e,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(t),this._removeSelectionAttribute(),!0):ga(e,n)?(this._preventCaretMovement(t),this._overrideGravity(),!0):ha(e,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(t),this._overrideGravity(),!0):void 0}handleBackwardMovement(e,t){const n=this.attribute;if(this._isGravityOverridden)return fa(e,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(t),this._restoreGravity(),this._removeSelectionAttribute(),!0):(this._preventCaretMovement(t),this._restoreGravity(),e.isAtStart&&this._removeSelectionAttribute(),!0);return fa(e,n)&&!this._hasSelectionAttribute?(this._preventCaretMovement(t),this._setSelectionAttributeFromTheNodeBefore(e),!0):e.isAtEnd&&ha(e,n)?this._hasSelectionAttribute?void(ba(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(ba(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 jy=i(87),Uy=i.n(jy);const Hy='ck-link_selected';class Wy extends xb{init(){const e=this.editor;e.model.schema.extend('$text',{allowAttributes:'linkHref'}),e.conversion.for('dataDowncast').add(wt({model:'linkHref',view:da})),e.conversion.for('editingDowncast').add(wt({model:'linkHref',view:(e,t)=>da(ca(e),t)})),e.conversion.for('upcast').add(tn({view:{name:'a',attributes:{href:!0}},model:{key:'linkHref',value:(e)=>e.getAttribute('href')}})),e.commands.add('link',new Dy(e)),e.commands.add('unlink',new Fy(e)),ua(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 r=aa(o.getFirstPosition(),o.getAttribute('linkHref')),i=e.editing.mapper.toViewRange(r);for(const e of i.getItems())e.is('a')&&(t.addClass(Hy,e),n.add(e))}}),e.conversion.for('editingDowncast').add((e)=>{function o(){t.change((e)=>{for(const t of n.values())e.removeClass(Hy,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 Gy extends Bm{constructor(e){super(e),this.domEventType='click'}onDomEvent(e){this.fire(e.type,e)}}var $y=i(89),Ky=i.n($y);class Zy extends Ib{constructor(e){super(e);const n=e.t;this.focusTracker=new Bb,this.keystrokes=new _b,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n('y'),dw.a,'ck-button-save'),this.saveButtonView.type='submit',this.cancelButtonView=this._createButton(n('z'),pw.a,'ck-button-cancel','cancel'),this._focusables=new Cb,this._focusCycler=new qb({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(),bi({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 rw(this.locale,sw);return t.label=e('af'),t.inputView.placeholder='https://example.com',t}_createButton(e,t,n,o){const r=new K_(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),o&&r.delegate('execute').to(this,o),r}}var Jy=i(91),Yy=i.n(Jy),Qy=i(92),Xy=i.n(Qy),ev=i(93),tv=i.n(ev);class nv extends Ib{constructor(e){super(e);const n=e.t;this.focusTracker=new Bb,this.keystrokes=new _b,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(n('ab'),Yy.a,'unlink'),this.editButtonView=this._createButton(n('ac'),Xy.a,'edit'),this.set('href'),this._focusables=new Cb,this._focusCycler=new qb({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 K_(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.delegate('execute').to(this,n),o}_createPreviewButton(){const e=new K_(this.locale),n=this.bindTemplate,o=this.t;return e.set({withText:!0,tooltip:o('ad')}),e.extendTemplate({attributes:{class:['ck','ck-link-actions__preview'],href:n.to('href',(e)=>e&&ca(e)),target:'_blank'}}),e.bind('label').to(this,'href',(e)=>e||o('ae')),e.bind('isEnabled').to(this,'href',(e)=>!!e),e.template.tag='a',e.template.eventListeners={},e}}var ov=i(95),rv=i.n(ov);const iv='Ctrl+K';class av extends xb{static get requires(){return[Mb]}init(){const e=this.editor;e.editing.view.addObserver(Gy),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=e.plugins.get(Mb),this._createToolbarLinkButton(),this._enableUserBalloonInteractions()}_createActionsView(){const e=this.editor,t=new nv(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(iv,(e,t)=>{this._addFormView(),t()}),t}_createFormView(){const e=this.editor,t=new Zy(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(iv,(e,t)=>{t(),n.isEnabled&&this._showUI()}),e.ui.componentFactory.add('link',(e)=>{const t=new K_(e);return t.isEnabled=!0,t.label=o('p'),t.icon=rv.a,t.keystroke=iv,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())}),fi({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 r=this._getSelectedLinkElement(),i=e();this.listenTo(o,'render',()=>{const t=this._getSelectedLinkElement(),n=e();(!r||t)&&(r||n===i)?this._balloon.updatePosition(this._getBalloonPositionData()):this._hideUI(),r=t,i=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 _a(e.getFirstPosition());else{const t=e.getFirstRange().getTrimmed(),n=_a(t.start),o=_a(t.end);return n&&n==o?ju.createIn(n).getTrimmed().isEqual(t)?n:null:null}}}class sv extends xb{static get requires(){return[Wy,av]}static get pluginName(){return'Link'}}class lv extends x_{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)=>wa(t,e.schema)),o=!0===this.value;e.change((e)=>{if(o){let t=n[n.length-1].nextSibling,o=od,r=[];for(;t&&'listItem'==t.name&&0!==t.getAttribute('indent');){const e=t.getAttribute('indent');e{const t=n[n.length-1];for(let o=t.nextSibling;o&&'listItem'==o.name&&o.getAttribute('indent')>t.getAttribute('indent');)n.push(o),o=o.nextSibling;0>this._indentBy&&(n=n.reverse());for(const t of n){const n=t.getAttribute('indent')+this._indentBy;0>n?e.rename(t,'paragraph'):e.setAttribute('indent',n,t)}})}_checkEnabled(){const e=cr(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is('listItem'))return!1;if(0=t;){if(o.getAttribute('indent')==t)return o.getAttribute('type')==n;o=o.previousSibling}return!1}return!0}}class cv extends xb{static get requires(){return[zw]}init(){const e=this.editor;e.model.schema.register('listItem',{inheritAllFrom:'$block',allowAttributes:['type','indent']});const t=e.data,n=e.editing;e.model.document.registerPostFixer((t)=>Va(e.model,t)),n.mapper.registerViewToModelLength('li',ja),t.mapper.registerViewToModelLength('li',ja),n.mapper.on('modelToViewPosition',Ia),n.mapper.on('viewToModelPosition',Na),t.mapper.on('modelToViewPosition',Ia),n.downcastDispatcher.on('insert',Ea,{priority:'high'}),n.downcastDispatcher.on('insert:listItem',xa),t.downcastDispatcher.on('insert',Ea,{priority:'high'}),t.downcastDispatcher.on('insert:listItem',xa),n.downcastDispatcher.on('attribute:type:listItem',Aa),t.downcastDispatcher.on('attribute:type:listItem',Aa),n.downcastDispatcher.on('attribute:indent:listItem',Ta),t.downcastDispatcher.on('attribute:indent:listItem',Ta),n.downcastDispatcher.on('remove:listItem',Ca),n.downcastDispatcher.on('remove',Pa,{priority:'low'}),t.downcastDispatcher.on('remove:listItem',Ca),t.downcastDispatcher.on('remove',Pa,{priority:'low'}),t.upcastDispatcher.on('element:ul',Ra,{priority:'high'}),t.upcastDispatcher.on('element:ol',Ra,{priority:'high'}),t.upcastDispatcher.on('element:li',Oa,{priority:'high'}),t.upcastDispatcher.on('element:li',Sa),e.model.on('insertContent',La,{priority:'high'}),e.commands.add('numberedList',new lv(e,'numbered')),e.commands.add('bulletedList',new lv(e,'bulleted')),e.commands.add('indentList',new dv(e,'forward')),e.commands.add('outdentList',new dv(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 r=(e)=>(t,n)=>{const o=this.editor.commands.get(e);o.isEnabled&&(this.editor.execute(e),n())};this.editor.keystrokes.set('Tab',r('indentList')),this.editor.keystrokes.set('Shift+Tab',r('outdentList'))}}var pv=i(96),uv=i.n(pv),mv=i(97),gv=i.n(mv);class hv extends xb{init(){const e=this.editor.t;this._addButton('numberedList',e('q'),uv.a),this._addButton('bulletedList',e('r'),gv.a)}_addButton(e,t,n){const o=this.editor;o.ui.componentFactory.add(e,(r)=>{const i=o.commands.get(e),a=new K_(r);return a.set({label:t,icon:n,tooltip:!0}),a.bind('isOn','isEnabled').to(i,'value','isEnabled'),this.listenTo(a,'execute',()=>o.execute(e)),a})}}class fv extends xb{static get requires(){return[cv,hv]}static get pluginName(){return'List'}}class bv{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 r=t+1;r<=t+o-1;r++)this._markSpannedCell(e,r);for(let r=e+1;r{const r=o.createElement('table');o.insert(r,e),ps(o,r,0,t,n)})}insertRows(e,t={}){const n=this.editor.model,o=t.at||0,r=t.rows||1;n.change((t)=>{const n=e.getAttribute('headingRows')||0;if(n>o&&t.setAttribute('headingRows',n+r,e),0===o||o===e.childCount)return void ps(t,e,o,r,this.getColumns(e));const i=new bv(e,{endRow:o});let a=0;for(const{row:e,rowspan:n,colspan:s,cell:l}of i){eo&&t.setAttribute('rowspan',n+r,l),e===o&&(a+=s)}ps(t,e,o,r,a)})}insertColumns(e,t={}){const n=this.editor.model,o=t.at||0,r=t.columns||1;n.change((t)=>{const n=e.getAttribute('headingColumns');o{if(1t?t-1:i-1;us(l,n,cg.createAfter(e),s)}if(it===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&&cs('headingColumns',p+a,o,n)}})}splitCellHorizontally(e,t=2){const n=this.editor.model,o=ds(e),r=o.getChildIndex(e.parent),i=parseInt(e.getAttribute('rowspan')||1),a=parseInt(e.getAttribute('colspan')||1);n.change((n)=>{if(1t===e),p={};1=r+d&&e===c&&0==(t+r+d)%l){const e=cg.createFromParentAndOffset(o.getChild(t),i);n.insertElement('tableCell',p,e)}}}if(ir){n.setAttribute('rowspan',o+s,t)}const d={};1r&&cs('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 kv extends x_{refresh(){const e=this.editor.model,t=e.document.selection,n=e.schema,o=gs(t.getFirstPosition());this.isEnabled=n.checkChild(o,'table')}execute(e={}){const t=this.editor.model,n=t.document.selection,o=this.editor.plugins.get(_v),r=parseInt(e.rows)||2,i=parseInt(e.columns)||2,a=n.getFirstPosition(),s=a.parent===a.root,l=s?cg.createAt(a):cg.createAfter(a.parent);o.createTable(l,r,i)}}class wv extends x_{constructor(e,t={}){super(e),this.order=t.order||'below'}refresh(){const e=this.editor.model.document.selection,t=ds(e.getFirstPosition());this.isEnabled=!!t}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get(_v),o=t.getFirstPosition().parent,r=ds(t.getFirstPosition()),i=r.getChildIndex(o.parent),a='below'===this.order?i+1:i;n.insertRows(r,{rows:1,at:a})}}class yv extends x_{constructor(e,t={}){super(e),this.order=t.order||'after'}refresh(){const e=this.editor.model.document.selection,t=ds(e.getFirstPosition());this.isEnabled=!!t}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get(_v),o=ds(t.getFirstPosition()),r=t.getFirstPosition().parent,{column:i}=n.getCellLocation(r),a='after'===this.order?i+1:i;n.insertColumns(o,{columns:1,at:a})}}class vv extends x_{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(),r=o.parent,i='horizontally'===this.direction,a=this.editor.plugins.get(_v);i?a.splitCellHorizontally(r,2):a.splitCellVertically(r,2)}}class xv extends x_{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,r=this.direction;e.change((e)=>{const t='right'==r||'down'==r,i=t?n:o,a=t?o:n;e.move(pg.createIn(a),cg.createAt(i,'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,i),e.setSelection(pg.createIn(i))})}_getMergeableCell(){const e=this.editor.model,t=e.document,n=t.selection.getFirstPosition().parent;if(n.is('tableCell')){const e=this.isHorizontal?hs(n,this.direction):fs(n,this.direction);if(e){const t=this.isHorizontal?'rowspan':'colspan',o=parseInt(n.getAttribute(t)||1),r=parseInt(e.getAttribute(t)||1);if(r===o)return e}}}}class Cv extends x_{refresh(){const e=this.editor.model,t=e.document,n=t.selection.getFirstPosition().parent;this.isEnabled=n.is('tableCell')&&1{s&&a<=s&&cs('headingRows',s-1,i,e,0);const t=[...new bv(i,{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})=>cs('rowspan',n-1,t,e));const o=a+1,l=new bv(i,{includeSpanned:!0,startRow:o,endRow:o});let d;for(const{row:t,column:o,cell:r}of[...l])if(n.has(o)){const{cell:r,rowspanToSet:a}=n.get(o),s=d?cg.createAfter(d):cg.createAt(i.getChild(t));e.move(pg.createOn(r),s),cs('rowspan',a,r,e),d=r}else d=r;e.remove(r)})}}class Av extends x_{refresh(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get(_v),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,i);for(const{cell:t,column:n,colspan:o}of l)n<=c&&1c?cs('colspan',o-1,t,e):n===c&&e.remove(t)})}}class Tv extends x_{refresh(){const e=this.editor.model,t=e.document,n=t.selection,o=ds(n.getFirstPosition());this.isEnabled=!!o}execute(e={}){const t=this.editor.model,n=t.document,o=n.selection,r=parseInt(e.rows)||0,i=ds(o.getFirstPosition());t.change((t)=>{const n=i.getAttribute('headingRows')||0;if(n!==r&&0this._handleTabOnSelectedTable(...e)),this.listenTo(e.editing.view.document,'keydown',(...e)=>this._handleTabInsideTable(...e))}static get requires(){return[_v]}_handleTabOnSelectedTable(e,t){const n=t.keyCode==tm.tab;if(n&&!t.ctrlKey){const n=this.editor,o=n.model.document.selection;if(!o.isCollapsed&&1===o.rangeCount&&o.getFirstRange().isFlat){const r=o.getSelectedElement();if(!r||'table'!=r.name)return;e.stop(),t.preventDefault(),t.stopPropagation(),n.model.change((e)=>{e.setSelection(pg.createIn(r.getChild(0).getChild(0)))})}}}_handleTabInsideTable(e,t){const n=t.keyCode==tm.tab;if(!n||t.ctrlKey)return;const o=this.editor,r=o.model.document.selection,i=ds(r.getFirstPosition());if(!i)return;t.preventDefault(),t.stopPropagation();const a=r.focus.parent,s=a.parent,l=i.getChildIndex(s),d=s.getChildIndex(a),c=!t.shiftKey,p=0===d;if(!c&&p&&0===l)return;const u=d===s.childCount-1,m=l===i.childCount-1;c&&m&&u&&o.plugins.get(_v).insertRows(i,{at:i.childCount});let g;if(c&&u){const e=i.getChild(l+1);g=e.getChild(0)}else if(!c&&p){const e=i.getChild(l-1);g=e.getChild(e.childCount-1)}else g=s.getChild(d+(c?1:-1));o.model.change((e)=>{e.setSelection(pg.createIn(g))})}}class Rv extends xb{init(){const e=this.editor;e.ui.componentFactory.add('insertTable',(t)=>{const n=e.commands.get('insertTable'),o=new K_(t);return o.bind('isEnabled').to(n),o.set({icon:Ay.a,label:'Insert table',tooltip:!0}),o.on('execute',()=>{e.execute('insertTable'),e.editing.view.focus()}),o}),e.ui.componentFactory.add('insertRowBelow',(t)=>{const n=e.commands.get('insertRowBelow'),o=new K_(t);return o.bind('isEnabled').to(n),o.set({icon:xy.a,label:'Insert row',tooltip:!0}),o.on('execute',()=>{e.execute('insertRowBelow'),e.editing.view.focus()}),o}),e.ui.componentFactory.add('insertColumnAfter',(t)=>{const n=e.commands.get('insertColumnAfter'),o=new K_(t);return o.bind('isEnabled').to(n),o.set({icon:Ey.a,label:'Insert column',tooltip:!0}),o.on('execute',()=>{e.execute('insertColumnAfter'),e.editing.view.focus()}),o})}}class Ov extends xb{static get requires(){return[Sv,Rv,tw]}static get pluginName(){return'Table'}}class Iv{getHtml(e){const t=document.implementation.createHTMLDocument(''),n=t.createElement('div');return n.appendChild(e),n.innerHTML}}const Nv='https://docs.ckeditor.com/ckeditor5/latest/framework/guides/support/error-codes.html';class Vv extends Error{constructor(e,t){e=ws(e),t&&(e+=' '+JSON.stringify(t)),super(e),this.name='CKEditorError',this.data=t}static isCKEditorError(e){return e instanceof Vv}}var Lv=function(){return function e(){e.called=!0}};class Dv{constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=Lv(),this.off=Lv()}}const Fv={get(e){return'number'==typeof e?e:this[e]||this.normal},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};const Mv=Symbol('listeningTo'),Bv=Symbol('emitterId'),qv={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 r,i;this[Mv]||(this[Mv]={});const a=this[Mv];xs(e)||vs(e);const s=xs(e);(r=a[s])||(r=a[s]={emitter:e,callbacks:{}}),(i=r.callbacks[t])||(i=r.callbacks[t]=[]),i.push(n),Ts(e,t);const l=Es(e,t),d=Fv.get(o.priority),c={callback:n,priority:d};for(const r of l){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 zv=qv,jv=function(e,t){return e===t||e!==e&&t!==t},Uv=function(e,t){for(var n=e.length;n--;)if(jv(e[n][0],t))return n;return-1},Hv=Array.prototype,Wv=Hv.splice;Is.prototype.clear=function(){this.__data__=[]},Is.prototype['delete']=function(e){var t=this.__data__,n=Uv(t,e);if(0>n)return!1;var o=t.length-1;return n==o?t.pop():Wv.call(t,n,1),!0},Is.prototype.get=function(e){var t=this.__data__,n=Uv(t,e);return 0>n?void 0:t[n][1]},Is.prototype.has=function(e){return-1o?n.push([e,t]):n[o][1]=t,this};var Gv=Is,$v=function(e){var t=typeof e;return!!e&&('object'==t||'function'==t)},Kv=Object.prototype,Zv=Kv.toString,Jv=function(e){var t=$v(e)?Zv.call(e):'';return t=='[object Function]'||t=='[object GeneratorFunction]'},Yv=function(e){var t=!1;if(null!=e&&'function'!=typeof e.toString)try{t=!!(e+'')}catch(t){}return t},Qv=Function.prototype.toString,Xv=function(e){if(null!=e){try{return Qv.call(e)}catch(t){}try{return e+''}catch(t){}}return''},ex=/[\\^$.*+?()[\]{}|]/g,tx=/^\[object .+?Constructor\]$/,nx=Object.prototype,ox=Function.prototype.toString,rx=nx.hasOwnProperty,ix=RegExp('^'+ox.call(rx).replace(ex,'\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,'$1.*?')+'$'),ax=function(e){if(!$v(e))return!1;var t=Jv(e)||Yv(e)?ix:tx;return t.test(Xv(e))},sx=function(e,t){var n=e[t];return ax(n)?n:void 0},lx=sx(Object,'create'),dx=lx,cx=Object.prototype,px=cx.hasOwnProperty,ux=Object.prototype,mx=ux.hasOwnProperty;Ns.prototype.clear=function(){this.__data__=dx?dx(null):{}},Ns.prototype['delete']=function(e){return this.has(e)&&delete this.__data__[e]},Ns.prototype.get=function(e){var t=this.__data__;if(dx){var n=t[e];return n==='__lodash_hash_undefined__'?void 0:n}return px.call(t,e)?t[e]:void 0},Ns.prototype.has=function(e){var t=this.__data__;return dx?t[e]!==void 0:mx.call(t,e)},Ns.prototype.set=function(e,t){var n=this.__data__;return n[e]=dx&&void 0===t?'__lodash_hash_undefined__':t,this};var gx=Ns,hx=i(3),fx=sx(hx.a,'Map'),bx=fx,_x=function(e){var t=typeof e;return'string'==t||'number'==t||'symbol'==t||'boolean'==t?'__proto__'!==e:null===e},kx=function(e,t){var n=e.__data__;return _x(t)?n['string'==typeof t?'string':'hash']:n.map};Vs.prototype.clear=function(){this.__data__={hash:new gx,map:new(bx||Gv),string:new gx}},Vs.prototype['delete']=function(e){return kx(this,e)['delete'](e)},Vs.prototype.get=function(e){return kx(this,e).get(e)},Vs.prototype.has=function(e){return kx(this,e).has(e)},Vs.prototype.set=function(e,t){return kx(this,e).set(e,t),this};Ls.prototype.clear=function(){this.__data__=new Gv},Ls.prototype['delete']=function(e){return this.__data__['delete'](e)},Ls.prototype.get=function(e){return this.__data__.get(e)},Ls.prototype.has=function(e){return this.__data__.has(e)},Ls.prototype.set=function(e,t){var n=this.__data__;return n instanceof Gv&&n.__data__.length==200&&(n=this.__data__=new Vs(n.__data__)),n.set(e,t),this};var wx=Ls,yx=function(e,t){for(var n=-1,o=e.length;++nt||t>e.data.length)throw new Vv('view-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.');if(0>n||t+n>e.data.length)throw new Vv('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}}var uA=Object.prototype,mA=Function.prototype.toString,gA=uA.hasOwnProperty,hA=mA.call(Object),fA=uA.toString,bA=function(e){if(!Dx(e)||fA.call(e)!='[object Object]'||Yv(e))return!1;var t=Ex(e);if(null===t)return!0;var n=gA.call(t,'constructor')&&t.constructor;return'function'==typeof n&&n instanceof n&&mA.call(n)==hA};class _A{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=Hs(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=Hs(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=Qs(t);for(const r of o)null!==r.parent&&r._remove(),r.parent=this,this._children.splice(e,0,r),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),bA(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 wA{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new Vv('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 Vv('view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.',{direction:e.direction});this.boundaries=e.boundaries||null,this.position=e.startPosition?rT.createFromPosition(e.startPosition):rT.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=rT.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 cA){if(e.isAtEnd)return this.position=rT.createAfter(n),this._next();o=n.data[e.offset]}else o=n.getChild(e.offset);if(o instanceof kA)return this.shallow?e.offset++:e=new rT(o,0),this.position=e,this._formatReturnValue('elementStart',o,t,e,1);if(!(o instanceof cA)){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 r=new pA(n,e.offset,o);return e.offset+=o,this.position=e,this._formatReturnValue('text',r,t,e,o)}return e=rT.createAfter(n),this.position=e,this.ignoreElementEnd?this._next():this._formatReturnValue('elementEnd',n,t,e)}if(this.singleCharacters)return e=new rT(o,0),this.position=e,this._next();else{let n=o.data.length,r;return o==this._boundaryEndParent?(n=this.boundaries.end.offset,r=new pA(o,0,n),e=rT.createAfter(r)):(r=new pA(o,0,o.data.length),e.offset++),this.position=e,this._formatReturnValue('text',r,t,e,n)}}_previous(){let e=rT.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 cA){if(e.isAtStart)return this.position=rT.createBefore(n),this._previous();o=n.data[e.offset-1]}else o=n.getChild(e.offset-1);if(o instanceof kA)return this.shallow?(e.offset--,this.position=e,this._formatReturnValue('elementStart',o,t,e,1)):(e=new rT(o,o.childCount),this.position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue('elementEnd',o,t,e));if(!(o instanceof cA)){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 r=new pA(n,e.offset,o);return this.position=e,this._formatReturnValue('text',r,t,e,o)}return e=rT.createBefore(n),this.position=e,this._formatReturnValue('elementStart',n,t,e,1)}if(this.singleCharacters)return e=new rT(o,o.data.length),this.position=e,this._previous();else{let n=o.data.length,r;if(o==this._boundaryStartParent){const t=this.boundaries.start.offset;r=new pA(o,t,o.data.length-t),n=r.data.length,e=rT.createBefore(r)}else r=new pA(o,0,o.data.length),e.offset--;return this.position=e,this._formatReturnValue('text',r,t,e,n)}}_formatReturnValue(e,t,n,o,r){return t instanceof pA&&(t.offsetInText+t.data.length==t.textNode.data.length&&('forward'!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=rT.createAfter(t.textNode):(o=rT.createAfter(t.textNode),this.position=o)),0===t.offsetInText&&('backward'!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=rT.createBefore(t.textNode):(o=rT.createBefore(t.textNode),this.position=o))),{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:o,length:r}}}}class yA extends kA{constructor(e,t,n){super(e,t,n),this.getFillerOffset=Xs}is(e,t=null){return t?'containerElement'==e&&t==this.name||super.is(e,t):'containerElement'==e||super.is(e)}}var vA=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)},xA=Object.prototype,CA=xA.toString,AA=function(e){return'symbol'==typeof e||Dx(e)&&CA.call(e)=='[object Symbol]'},TA=0/0,EA=/^\s+|\s+$/g,PA=/^[-+]0x[0-9a-f]+$/i,SA=/^0b[01]+$/i,RA=/^0o[0-7]+$/i,OA=parseInt,IA=function(e){if('number'==typeof e)return e;if(AA(e))return TA;if($v(e)){var t=Jv(e.valueOf)?e.valueOf():e;e=$v(t)?t+'':t}if('string'!=typeof e)return 0===e?e:+e;e=e.replace(EA,'');var n=SA.test(e);return n||RA.test(e)?OA(e.slice(2),n?2:8):PA.test(e)?TA:+e},NA=1/0,VA=function(e){if(!e)return 0===e?e:0;if(e=IA(e),e===NA||e===-NA){var t=0>e?-1:1;return t*17976931348623157e292}return e===e?e:0},LA=function(e){var t=VA(e),n=t%1;return t===t?n?t-n:t:0},DA=rd,FA=function(e,t){if('function'!=typeof e)throw new TypeError('Expected a function');return t=DA(void 0===t?e.length-1:LA(t),0),function(){for(var n=arguments,o=-1,r=DA(n.length-t,0),i=Array(r);++or?void 0:i,r=1),t=Object(t);++o{this.set(t,e[t])},this);nl(this);const n=this[QA];if(e in this&&!n.has(e))throw new Vv('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);o===t&&n.has(e)||(n.set(e,t),this.fire('change:'+e,e,t,o))}}),this[e]=t},bind(...e){if(!e.length||!al(e))throw new Vv('observable-bind-wrong-properties: All properties must be strings.');if(new Set(e).size!==e.length)throw new Vv('observable-bind-duplicate-properties: Properties must be unique.');nl(this);const t=this[eT];e.forEach((e)=>{if(t.has(e))throw new Vv('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:ol,toMany:rl,_observable:this,_bindProperties:e,_to:[],_bindings:n}},unbind(...e){if(!(QA in this))return;const t=this[eT],n=this[XA];if(e.length){if(!al(e))throw new Vv('observable-unbind-wrong-properties: Properties must be strings.');e.forEach((e)=>{const o=t.get(e);if(!o)return;let r,i,a,s;o.to.forEach((e)=>{r=e[0],i=e[1],a=n.get(r),s=a[i],s.delete(o),s.size||delete a[i],Object.keys(a).length||(n.delete(r),this.stopListening(r,'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 Vv('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)}}};YA(tT,zv);const nT=Symbol('document');class oT extends yA{constructor(e,t,n){super(e,t,n),this.set('isReadOnly',!1),this.set('isFocused',!1)}get document(){return this.getCustomProperty(nT)}set _document(e){if(this.getCustomProperty(nT))throw new Vv('view-editableelement-document-already-set: View document is already set.');this._setCustomProperty(nT,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})}}Os(oT,tT);class rT{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 oT);)if(e.parent)e=e.parent;else return null;return e}getShiftedBy(e){const t=rT.createFromPosition(this),n=t.offset+e;return t.offset=0>n?0:n,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const n=new wA(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=zs(t,n);return'prefix'===o?'before':'extension'===o?'after':t[o]=t;t++){const o=n(t);e[o.toLowerCase()]=t}for(let t=48;57>=t;t++)e[t-48]=t;for(let t=112;123>=t;t++)e['f'+(t-111)]=t;return e}(),gT=(e)=>{const t=e.createElement('br');return t.dataset.ckeFiller=!0,t},hT=(e)=>e.createTextNode('\xA0'),fT=7;let bT='';for(let e=0;eo?0:o),new rT(n,o)):null}if(0===t){const t=this.mapDomToView(e);if(t)return new rT(t,0)}else{const n=e.childNodes[t-1],o=vl(n)?this.findCorrespondingViewText(n):this.mapDomToView(n);if(o&&o.parent)return new rT(o.parent,o.index+1)}return null}mapDomToView(e){return this.getParentUIElement(e)||this._domToViewMapping.get(e)}findCorrespondingViewText(e){if(fl(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 cA?e.nextSibling:null}}else{const t=this.mapDomToView(e.parentNode);if(t){const e=t.getChild(0);return e instanceof cA?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}=kT.window,o=[];Cl(t,(e)=>{const{scrollLeft:t,scrollTop:n}=e;o.push([t,n])}),t.focus(),Cl(t,(e)=>{const[t,n]=o.shift();e.scrollLeft=t,e.scrollTop=n}),kT.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=wl(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(vl(e)&&hl(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(xl(e,this.preElements))return bl(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||hl(e)||(t=t.replace(/ $/,'')),t=bl(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 wA({startPosition:t?rT.createAfter(e):rT.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,r=wl(e)[0],i=o.createTreeWalker(r,NodeFilter.SHOW_TEXT);i.currentNode=e;const a=i[n]();if(null!==a){const t=yl(e,a);if(t&&!xl(e,this.blockElements,t)&&!xl(a,this.blockElements,t))return a}return null}}class yT{constructor(){this._domParser=new DOMParser,this._domConverter=new wT({blockFiller:hT}),this._htmlWriter=new Iv}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 r=Vl(1==o?'=':'-',e.length);return'\n\n'+e+'\n'+r+'\n\n'}return'\n\n'+Vl('#',o)+' '+e+'\n\n'}},ST.blockquote={filter:'blockquote',replacement:function(e){return e=e.replace(/^\n+|\n+$/g,''),e=e.replace(/^/gm,'> '),'\n\n'+e+'\n\n'}},ST.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'}},ST.listItem={filter:'li',replacement:function(e,t,n){e=e.replace(/^\n+/,'').replace(/\n+$/,'\n').replace(/\n/gm,'\n ');var o=n.bulletListMarker+' ',r=t.parentNode;if('OL'===r.nodeName){var i=r.getAttribute('start'),a=Array.prototype.indexOf.call(r.children,t);o=(i?+i+a:a+1)+'. '}return o+e+(t.nextSibling&&!/\n$/.test(e)?'\n':'')}},ST.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'}},ST.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||'',r=(o.match(/language-(\S+)/)||[null,''])[1];return'\n\n'+n.fence+r+'\n'+t.firstChild.textContent+'\n'+n.fence+'\n\n'}},ST.horizontalRule={filter:'hr',replacement:function(e,t,n){return'\n\n'+n.hr+'\n\n'}},ST.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+')'}},ST.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'),r=t.title?' "'+t.title+'"':'',i,a;switch(n.linkReferenceStyle){case'collapsed':i='['+e+'][]',a='['+e+']: '+o+r;break;case'shortcut':i='['+e+']',a='['+e+']: '+o+r;break;default:var s=this.references.length+1;i='['+e+']['+s+']',a='['+s+']: '+o+r;}return this.references.push(a),i},references:[],append:function(){var e='';return this.references.length&&(e='\n\n'+this.references.join('\n')+'\n\n',this.references=[]),e}},ST.emphasis={filter:['em','i'],replacement:function(e,t,n){return e.trim()?n.emDelimiter+e+n.emDelimiter:''}},ST.strong={filter:['strong','b'],replacement:function(e,t,n){return e.trim()?n.strongDelimiter+e+n.strongDelimiter:''}},ST.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='',r=e.match(/`+/gm);if(r)for(/^`/.test(e)&&(n=' '),/`$/.test(e)&&(o=' ');-1!==r.indexOf(t);)t+='`';return t+n+e+o+t}},ST.image={filter:'img',replacement:function(e,t){var n=t.alt||'',o=t.getAttribute('src')||'',r=t.title||'',i=r?' "'+r+'"':'';return o?'!['+n+']('+o+i+')':''}},Ml.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=Bl(this.array,e,this.options))?t:(t=Bl(this._keep,e,this.options))?t:(t=Bl(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 DT=i(104),FT=i.n(DT);class MT{constructor(){this._htmlDP=new yT,this._domConverter=new wT}toView(e){const t=new FT.a({html:!0}),n=t.render(e);return this._htmlDP.toView(n)}toData(e){const t=this._domConverter.viewToDom(e,document),n=new Jl({headingStyle:'atx'});n.use(Il);const o=n.turndown(t);return o}}class BT{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 uplod 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}}class qT extends xb{static get requires(){return[rk]}static get pluginName(){return'OpUploadPlugin'}init(){this.editor.plugins.get('FileRepository').createUploadAdapter=(e)=>{const t=this.editor.config.openProject,n=t.context;return new BT(e,n)}}}class zT extends r_{}r.BalloonEditor=zT;class jT extends __{}r.ClassicEditor=jT,window.OPBalloonEditor=zT,window.OPClassicEditor=jT;const UT={plugins:[function(e){e.data.processor=new MT},tk,dk,mk,yk,Pk,Dk,Bw,cy,yw,_y,Vy,Ly,Mw,sv,fv,zw,Mw,Ov,qT],config:{toolbar:{items:['heading','|','bold','italic','link','bulletedList','numberedList','imageUpload','blockQuote','|','insertTable','insertRowBelow','insertColumnAfter','|','undo','redo']},image:{toolbar:['imageStyle:full','|','imageTextAlternative']},language:'en'}};jT.build=UT,zT.build=UT},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(26),r=n(2),i={function:!0,object:!0},a=i[typeof exports]&&exports&&!exports.nodeType?exports:void 0,s=i[typeof e]&&e&&!e.nodeType?e:void 0,l=s&&s.exports===a?a:void 0,d=l?r.a.Buffer:void 0,c=d?function(e){return e instanceof d}:Object(o.a)(!1);t.a=c}).call(t,n(4)(e))},function(e,t){'use strict';t.a=function(e){return function(){return e}}},function(e,t,n){var o=n(28);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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(/\/[^\/]*$/,'/'),r=e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var r=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});if(/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(r))return e;var i;return i=0===r.indexOf('//')?r:0===r.indexOf('/')?n+r:o+r.replace(/^\.\//,''),'url('+JSON.stringify(i)+')'});return r}},function(e,t,n){var o=n(31);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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(33);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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(35);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}'},function(e,t,n){var o=n(37);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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(39);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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(41);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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(43);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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(45);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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(47);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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}.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='\n'},function(e,t,n){var o=n(54);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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(56);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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-widget .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-widget .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-widget .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(58);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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(60);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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(63);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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){e.exports='\n'},function(e){e.exports='Uploading image\u2026\n'},function(e,t,n){var o=n(67);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck-content .image{position:relative;overflow:hidden}.ck-content .image.ck-infinite-progress:before{content:"";position:absolute;top:0;right:0}.ck-content .image .ck-progress-bar{position:absolute;top:0;left:0}:root{--ck-image-upload-progress-line-width:30px}.ck-content .image.ck-appear{animation:a .7s}.ck-content .image.ck-infinite-progress:before{width:var(--ck-image-upload-progress-line-width);height:2px;background:var(--ck-color-upload-infinite-background);animation-name:b;animation-duration:1.5s;animation-iteration-count:infinite;transition-timing-function:linear}.ck-content .image.ck-image-upload-placeholder>img{width:100%}.ck-content .image .ck-progress-bar{height:2px;width:0;background:var(--ck-color-upload-bar-background);transition:width .1s}@keyframes a{0%{opacity:0}to{opacity:1}}@keyframes b{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(69);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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:a,b;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:c;animation-duration:.5s;animation-delay:.5s;animation-fill-mode:forwards}@keyframes a{0%{opacity:0}to{opacity:1}}@keyframes b{0%{opacity:1}to{opacity:0}}@keyframes c{0%{opacity:1;height:0;width:0}33%{width:.25em;height:0}to{width:.25em;height:.416em;opacity:1}}'},function(e,t,n){var o=n(71);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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(74);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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{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_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)}'},function(e,t,n){var o=n(76);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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(78);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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(81);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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(83);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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,t,n){var o=n(86);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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(88);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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(90);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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(94);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);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(99);'string'==typeof o&&(o=[[e.i,o,'']]);var r={singleton:!0,hmr:!0},i;r.transform=i,r.insertInto=void 0;n(1)(o,r);o.locals&&(e.exports=o.locals),!1},function(e){e.exports='.ck table.ck-widget td.ck-editor__nested-editable,.ck table.ck-widget th.ck-editor__nested-editable{border-color:inherit;border-style:inset}.ck table.ck-widget td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck table.ck-widget td.ck-editor__nested-editable:focus,.ck table.ck-widget th.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck table.ck-widget th.ck-editor__nested-editable:focus{background-color:inherit;color:inherit}'},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(102),r=n(3),i={function:!0,object:!0},a=i[typeof exports]&&exports&&!exports.nodeType?exports:void 0,s=i[typeof e]&&e&&!e.nodeType?e:void 0,l=s&&s.exports===a?a:void 0,d=l?r.a.Buffer:void 0,c=d?function(e){return e instanceof d}:Object(o.a)(!1);t.a=c}).call(t,n(4)(e))},function(e,t){'use strict';t.a=function(e){return function(){return e}}},function(){},function(e,t,n){'use strict';e.exports=n(105)},function(e,t,n){'use strict';function o(e){var t=e.trim().toLowerCase();return!b.test(t)||!!_.test(t)}function r(e){var t=g.parse(e,!0);if(t.hostname&&(!t.protocol||0<=k.indexOf(t.protocol)))try{t.hostname=h.toASCII(t.hostname)}catch(e){}return g.encode(g.format(t))}function i(e){var t=g.parse(e,!0);if(t.hostname&&(!t.protocol||0<=k.indexOf(t.protocol)))try{t.hostname=h.toUnicode(t.hostname)}catch(e){}return g.decode(g.format(t))}function a(e,t){return this instanceof a?void(!t&&!s.isString(e)&&(t=e||{},e='default'),this.inline=new u,this.block=new p,this.core=new c,this.renderer=new d,this.linkify=new m,this.validateLink=o,this.normalizeLink=r,this.normalizeLinkText=i,this.utils=s,this.helpers=s.assign({},l),this.options={},this.configure(e),t&&this.set(t)):new a(e,t)}var s=n(0),l=n(113),d=n(117),c=n(118),p=n(126),u=n(140),m=n(153),g=n(16),h=n(155),f={default:n(157),zero:n(158),commonmark:n(159)},b=/^(vbscript|javascript|file|data):/,_=/^data:image\/(gif|png|jpeg|webp);/,k=['http:','https:','mailto:'];a.prototype.set=function(e){return s.assign(this.options,e),this},a.prototype.configure=function(e){var t=this,n;if(s.isString(e)&&(n=e,e=f[n],!e))throw new Error('Wrong `markdown-it` preset "'+n+'", check name');if(!e)throw new Error('Wrong `markdown-it` preset, can\'t be empty');return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},a.prototype.enable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),['core','block','inline'].forEach(function(t){n=n.concat(this[t].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));var o=e.filter(function(e){return 0>n.indexOf(e)});if(o.length&&!t)throw new Error('MarkdownIt. Failed to enable unknown rule(s): '+o);return this},a.prototype.disable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),['core','block','inline'].forEach(function(t){n=n.concat(this[t].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));var o=e.filter(function(e){return 0>n.indexOf(e)});if(o.length&&!t)throw new Error('MarkdownIt. Failed to disable unknown rule(s): '+o);return this},a.prototype.use=function(e){var t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},a.prototype.parse=function(e,t){if('string'!=typeof e)throw new Error('Input data should be a String');var n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},a.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},a.prototype.parseInline=function(e,t){var n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},a.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)},e.exports=a},function(e){e.exports={Aacute:'\xC1',aacute:'\xE1',Abreve:'\u0102',abreve:'\u0103',ac:'\u223E',acd:'\u223F',acE:'\u223E\u0333',Acirc:'\xC2',acirc:'\xE2',acute:'\xB4',Acy:'\u0410',acy:'\u0430',AElig:'\xC6',aelig:'\xE6',af:'\u2061',Afr:'\uD835\uDD04',afr:'\uD835\uDD1E',Agrave:'\xC0',agrave:'\xE0',alefsym:'\u2135',aleph:'\u2135',Alpha:'\u0391',alpha:'\u03B1',Amacr:'\u0100',amacr:'\u0101',amalg:'\u2A3F',amp:'&',AMP:'&',andand:'\u2A55',And:'\u2A53',and:'\u2227',andd:'\u2A5C',andslope:'\u2A58',andv:'\u2A5A',ang:'\u2220',ange:'\u29A4',angle:'\u2220',angmsdaa:'\u29A8',angmsdab:'\u29A9',angmsdac:'\u29AA',angmsdad:'\u29AB',angmsdae:'\u29AC',angmsdaf:'\u29AD',angmsdag:'\u29AE',angmsdah:'\u29AF',angmsd:'\u2221',angrt:'\u221F',angrtvb:'\u22BE',angrtvbd:'\u299D',angsph:'\u2222',angst:'\xC5',angzarr:'\u237C',Aogon:'\u0104',aogon:'\u0105',Aopf:'\uD835\uDD38',aopf:'\uD835\uDD52',apacir:'\u2A6F',ap:'\u2248',apE:'\u2A70',ape:'\u224A',apid:'\u224B',apos:'\'',ApplyFunction:'\u2061',approx:'\u2248',approxeq:'\u224A',Aring:'\xC5',aring:'\xE5',Ascr:'\uD835\uDC9C',ascr:'\uD835\uDCB6',Assign:'\u2254',ast:'*',asymp:'\u2248',asympeq:'\u224D',Atilde:'\xC3',atilde:'\xE3',Auml:'\xC4',auml:'\xE4',awconint:'\u2233',awint:'\u2A11',backcong:'\u224C',backepsilon:'\u03F6',backprime:'\u2035',backsim:'\u223D',backsimeq:'\u22CD',Backslash:'\u2216',Barv:'\u2AE7',barvee:'\u22BD',barwed:'\u2305',Barwed:'\u2306',barwedge:'\u2305',bbrk:'\u23B5',bbrktbrk:'\u23B6',bcong:'\u224C',Bcy:'\u0411',bcy:'\u0431',bdquo:'\u201E',becaus:'\u2235',because:'\u2235',Because:'\u2235',bemptyv:'\u29B0',bepsi:'\u03F6',bernou:'\u212C',Bernoullis:'\u212C',Beta:'\u0392',beta:'\u03B2',beth:'\u2136',between:'\u226C',Bfr:'\uD835\uDD05',bfr:'\uD835\uDD1F',bigcap:'\u22C2',bigcirc:'\u25EF',bigcup:'\u22C3',bigodot:'\u2A00',bigoplus:'\u2A01',bigotimes:'\u2A02',bigsqcup:'\u2A06',bigstar:'\u2605',bigtriangledown:'\u25BD',bigtriangleup:'\u25B3',biguplus:'\u2A04',bigvee:'\u22C1',bigwedge:'\u22C0',bkarow:'\u290D',blacklozenge:'\u29EB',blacksquare:'\u25AA',blacktriangle:'\u25B4',blacktriangledown:'\u25BE',blacktriangleleft:'\u25C2',blacktriangleright:'\u25B8',blank:'\u2423',blk12:'\u2592',blk14:'\u2591',blk34:'\u2593',block:'\u2588',bne:'=\u20E5',bnequiv:'\u2261\u20E5',bNot:'\u2AED',bnot:'\u2310',Bopf:'\uD835\uDD39',bopf:'\uD835\uDD53',bot:'\u22A5',bottom:'\u22A5',bowtie:'\u22C8',boxbox:'\u29C9',boxdl:'\u2510',boxdL:'\u2555',boxDl:'\u2556',boxDL:'\u2557',boxdr:'\u250C',boxdR:'\u2552',boxDr:'\u2553',boxDR:'\u2554',boxh:'\u2500',boxH:'\u2550',boxhd:'\u252C',boxHd:'\u2564',boxhD:'\u2565',boxHD:'\u2566',boxhu:'\u2534',boxHu:'\u2567',boxhU:'\u2568',boxHU:'\u2569',boxminus:'\u229F',boxplus:'\u229E',boxtimes:'\u22A0',boxul:'\u2518',boxuL:'\u255B',boxUl:'\u255C',boxUL:'\u255D',boxur:'\u2514',boxuR:'\u2558',boxUr:'\u2559',boxUR:'\u255A',boxv:'\u2502',boxV:'\u2551',boxvh:'\u253C',boxvH:'\u256A',boxVh:'\u256B',boxVH:'\u256C',boxvl:'\u2524',boxvL:'\u2561',boxVl:'\u2562',boxVL:'\u2563',boxvr:'\u251C',boxvR:'\u255E',boxVr:'\u255F',boxVR:'\u2560',bprime:'\u2035',breve:'\u02D8',Breve:'\u02D8',brvbar:'\xA6',bscr:'\uD835\uDCB7',Bscr:'\u212C',bsemi:'\u204F',bsim:'\u223D',bsime:'\u22CD',bsolb:'\u29C5',bsol:'\\',bsolhsub:'\u27C8',bull:'\u2022',bullet:'\u2022',bump:'\u224E',bumpE:'\u2AAE',bumpe:'\u224F',Bumpeq:'\u224E',bumpeq:'\u224F',Cacute:'\u0106',cacute:'\u0107',capand:'\u2A44',capbrcup:'\u2A49',capcap:'\u2A4B',cap:'\u2229',Cap:'\u22D2',capcup:'\u2A47',capdot:'\u2A40',CapitalDifferentialD:'\u2145',caps:'\u2229\uFE00',caret:'\u2041',caron:'\u02C7',Cayleys:'\u212D',ccaps:'\u2A4D',Ccaron:'\u010C',ccaron:'\u010D',Ccedil:'\xC7',ccedil:'\xE7',Ccirc:'\u0108',ccirc:'\u0109',Cconint:'\u2230',ccups:'\u2A4C',ccupssm:'\u2A50',Cdot:'\u010A',cdot:'\u010B',cedil:'\xB8',Cedilla:'\xB8',cemptyv:'\u29B2',cent:'\xA2',centerdot:'\xB7',CenterDot:'\xB7',cfr:'\uD835\uDD20',Cfr:'\u212D',CHcy:'\u0427',chcy:'\u0447',check:'\u2713',checkmark:'\u2713',Chi:'\u03A7',chi:'\u03C7',circ:'\u02C6',circeq:'\u2257',circlearrowleft:'\u21BA',circlearrowright:'\u21BB',circledast:'\u229B',circledcirc:'\u229A',circleddash:'\u229D',CircleDot:'\u2299',circledR:'\xAE',circledS:'\u24C8',CircleMinus:'\u2296',CirclePlus:'\u2295',CircleTimes:'\u2297',cir:'\u25CB',cirE:'\u29C3',cire:'\u2257',cirfnint:'\u2A10',cirmid:'\u2AEF',cirscir:'\u29C2',ClockwiseContourIntegral:'\u2232',CloseCurlyDoubleQuote:'\u201D',CloseCurlyQuote:'\u2019',clubs:'\u2663',clubsuit:'\u2663',colon:':',Colon:'\u2237',Colone:'\u2A74',colone:'\u2254',coloneq:'\u2254',comma:',',commat:'@',comp:'\u2201',compfn:'\u2218',complement:'\u2201',complexes:'\u2102',cong:'\u2245',congdot:'\u2A6D',Congruent:'\u2261',conint:'\u222E',Conint:'\u222F',ContourIntegral:'\u222E',copf:'\uD835\uDD54',Copf:'\u2102',coprod:'\u2210',Coproduct:'\u2210',copy:'\xA9',COPY:'\xA9',copysr:'\u2117',CounterClockwiseContourIntegral:'\u2233',crarr:'\u21B5',cross:'\u2717',Cross:'\u2A2F',Cscr:'\uD835\uDC9E',cscr:'\uD835\uDCB8',csub:'\u2ACF',csube:'\u2AD1',csup:'\u2AD0',csupe:'\u2AD2',ctdot:'\u22EF',cudarrl:'\u2938',cudarrr:'\u2935',cuepr:'\u22DE',cuesc:'\u22DF',cularr:'\u21B6',cularrp:'\u293D',cupbrcap:'\u2A48',cupcap:'\u2A46',CupCap:'\u224D',cup:'\u222A',Cup:'\u22D3',cupcup:'\u2A4A',cupdot:'\u228D',cupor:'\u2A45',cups:'\u222A\uFE00',curarr:'\u21B7',curarrm:'\u293C',curlyeqprec:'\u22DE',curlyeqsucc:'\u22DF',curlyvee:'\u22CE',curlywedge:'\u22CF',curren:'\xA4',curvearrowleft:'\u21B6',curvearrowright:'\u21B7',cuvee:'\u22CE',cuwed:'\u22CF',cwconint:'\u2232',cwint:'\u2231',cylcty:'\u232D',dagger:'\u2020',Dagger:'\u2021',daleth:'\u2138',darr:'\u2193',Darr:'\u21A1',dArr:'\u21D3',dash:'\u2010',Dashv:'\u2AE4',dashv:'\u22A3',dbkarow:'\u290F',dblac:'\u02DD',Dcaron:'\u010E',dcaron:'\u010F',Dcy:'\u0414',dcy:'\u0434',ddagger:'\u2021',ddarr:'\u21CA',DD:'\u2145',dd:'\u2146',DDotrahd:'\u2911',ddotseq:'\u2A77',deg:'\xB0',Del:'\u2207',Delta:'\u0394',delta:'\u03B4',demptyv:'\u29B1',dfisht:'\u297F',Dfr:'\uD835\uDD07',dfr:'\uD835\uDD21',dHar:'\u2965',dharl:'\u21C3',dharr:'\u21C2',DiacriticalAcute:'\xB4',DiacriticalDot:'\u02D9',DiacriticalDoubleAcute:'\u02DD',DiacriticalGrave:'`',DiacriticalTilde:'\u02DC',diam:'\u22C4',diamond:'\u22C4',Diamond:'\u22C4',diamondsuit:'\u2666',diams:'\u2666',die:'\xA8',DifferentialD:'\u2146',digamma:'\u03DD',disin:'\u22F2',div:'\xF7',divide:'\xF7',divideontimes:'\u22C7',divonx:'\u22C7',DJcy:'\u0402',djcy:'\u0452',dlcorn:'\u231E',dlcrop:'\u230D',dollar:'$',Dopf:'\uD835\uDD3B',dopf:'\uD835\uDD55',Dot:'\xA8',dot:'\u02D9',DotDot:'\u20DC',doteq:'\u2250',doteqdot:'\u2251',DotEqual:'\u2250',dotminus:'\u2238',dotplus:'\u2214',dotsquare:'\u22A1',doublebarwedge:'\u2306',DoubleContourIntegral:'\u222F',DoubleDot:'\xA8',DoubleDownArrow:'\u21D3',DoubleLeftArrow:'\u21D0',DoubleLeftRightArrow:'\u21D4',DoubleLeftTee:'\u2AE4',DoubleLongLeftArrow:'\u27F8',DoubleLongLeftRightArrow:'\u27FA',DoubleLongRightArrow:'\u27F9',DoubleRightArrow:'\u21D2',DoubleRightTee:'\u22A8',DoubleUpArrow:'\u21D1',DoubleUpDownArrow:'\u21D5',DoubleVerticalBar:'\u2225',DownArrowBar:'\u2913',downarrow:'\u2193',DownArrow:'\u2193',Downarrow:'\u21D3',DownArrowUpArrow:'\u21F5',DownBreve:'\u0311',downdownarrows:'\u21CA',downharpoonleft:'\u21C3',downharpoonright:'\u21C2',DownLeftRightVector:'\u2950',DownLeftTeeVector:'\u295E',DownLeftVectorBar:'\u2956',DownLeftVector:'\u21BD',DownRightTeeVector:'\u295F',DownRightVectorBar:'\u2957',DownRightVector:'\u21C1',DownTeeArrow:'\u21A7',DownTee:'\u22A4',drbkarow:'\u2910',drcorn:'\u231F',drcrop:'\u230C',Dscr:'\uD835\uDC9F',dscr:'\uD835\uDCB9',DScy:'\u0405',dscy:'\u0455',dsol:'\u29F6',Dstrok:'\u0110',dstrok:'\u0111',dtdot:'\u22F1',dtri:'\u25BF',dtrif:'\u25BE',duarr:'\u21F5',duhar:'\u296F',dwangle:'\u29A6',DZcy:'\u040F',dzcy:'\u045F',dzigrarr:'\u27FF',Eacute:'\xC9',eacute:'\xE9',easter:'\u2A6E',Ecaron:'\u011A',ecaron:'\u011B',Ecirc:'\xCA',ecirc:'\xEA',ecir:'\u2256',ecolon:'\u2255',Ecy:'\u042D',ecy:'\u044D',eDDot:'\u2A77',Edot:'\u0116',edot:'\u0117',eDot:'\u2251',ee:'\u2147',efDot:'\u2252',Efr:'\uD835\uDD08',efr:'\uD835\uDD22',eg:'\u2A9A',Egrave:'\xC8',egrave:'\xE8',egs:'\u2A96',egsdot:'\u2A98',el:'\u2A99',Element:'\u2208',elinters:'\u23E7',ell:'\u2113',els:'\u2A95',elsdot:'\u2A97',Emacr:'\u0112',emacr:'\u0113',empty:'\u2205',emptyset:'\u2205',EmptySmallSquare:'\u25FB',emptyv:'\u2205',EmptyVerySmallSquare:'\u25AB',emsp13:'\u2004',emsp14:'\u2005',emsp:'\u2003',ENG:'\u014A',eng:'\u014B',ensp:'\u2002',Eogon:'\u0118',eogon:'\u0119',Eopf:'\uD835\uDD3C',eopf:'\uD835\uDD56',epar:'\u22D5',eparsl:'\u29E3',eplus:'\u2A71',epsi:'\u03B5',Epsilon:'\u0395',epsilon:'\u03B5',epsiv:'\u03F5',eqcirc:'\u2256',eqcolon:'\u2255',eqsim:'\u2242',eqslantgtr:'\u2A96',eqslantless:'\u2A95',Equal:'\u2A75',equals:'=',EqualTilde:'\u2242',equest:'\u225F',Equilibrium:'\u21CC',equiv:'\u2261',equivDD:'\u2A78',eqvparsl:'\u29E5',erarr:'\u2971',erDot:'\u2253',escr:'\u212F',Escr:'\u2130',esdot:'\u2250',Esim:'\u2A73',esim:'\u2242',Eta:'\u0397',eta:'\u03B7',ETH:'\xD0',eth:'\xF0',Euml:'\xCB',euml:'\xEB',euro:'\u20AC',excl:'!',exist:'\u2203',Exists:'\u2203',expectation:'\u2130',exponentiale:'\u2147',ExponentialE:'\u2147',fallingdotseq:'\u2252',Fcy:'\u0424',fcy:'\u0444',female:'\u2640',ffilig:'\uFB03',fflig:'\uFB00',ffllig:'\uFB04',Ffr:'\uD835\uDD09',ffr:'\uD835\uDD23',filig:'\uFB01',FilledSmallSquare:'\u25FC',FilledVerySmallSquare:'\u25AA',fjlig:'fj',flat:'\u266D',fllig:'\uFB02',fltns:'\u25B1',fnof:'\u0192',Fopf:'\uD835\uDD3D',fopf:'\uD835\uDD57',forall:'\u2200',ForAll:'\u2200',fork:'\u22D4',forkv:'\u2AD9',Fouriertrf:'\u2131',fpartint:'\u2A0D',frac12:'\xBD',frac13:'\u2153',frac14:'\xBC',frac15:'\u2155',frac16:'\u2159',frac18:'\u215B',frac23:'\u2154',frac25:'\u2156',frac34:'\xBE',frac35:'\u2157',frac38:'\u215C',frac45:'\u2158',frac56:'\u215A',frac58:'\u215D',frac78:'\u215E',frasl:'\u2044',frown:'\u2322',fscr:'\uD835\uDCBB',Fscr:'\u2131',gacute:'\u01F5',Gamma:'\u0393',gamma:'\u03B3',Gammad:'\u03DC',gammad:'\u03DD',gap:'\u2A86',Gbreve:'\u011E',gbreve:'\u011F',Gcedil:'\u0122',Gcirc:'\u011C',gcirc:'\u011D',Gcy:'\u0413',gcy:'\u0433',Gdot:'\u0120',gdot:'\u0121',ge:'\u2265',gE:'\u2267',gEl:'\u2A8C',gel:'\u22DB',geq:'\u2265',geqq:'\u2267',geqslant:'\u2A7E',gescc:'\u2AA9',ges:'\u2A7E',gesdot:'\u2A80',gesdoto:'\u2A82',gesdotol:'\u2A84',gesl:'\u22DB\uFE00',gesles:'\u2A94',Gfr:'\uD835\uDD0A',gfr:'\uD835\uDD24',gg:'\u226B',Gg:'\u22D9',ggg:'\u22D9',gimel:'\u2137',GJcy:'\u0403',gjcy:'\u0453',gla:'\u2AA5',gl:'\u2277',glE:'\u2A92',glj:'\u2AA4',gnap:'\u2A8A',gnapprox:'\u2A8A',gne:'\u2A88',gnE:'\u2269',gneq:'\u2A88',gneqq:'\u2269',gnsim:'\u22E7',Gopf:'\uD835\uDD3E',gopf:'\uD835\uDD58',grave:'`',GreaterEqual:'\u2265',GreaterEqualLess:'\u22DB',GreaterFullEqual:'\u2267',GreaterGreater:'\u2AA2',GreaterLess:'\u2277',GreaterSlantEqual:'\u2A7E',GreaterTilde:'\u2273',Gscr:'\uD835\uDCA2',gscr:'\u210A',gsim:'\u2273',gsime:'\u2A8E',gsiml:'\u2A90',gtcc:'\u2AA7',gtcir:'\u2A7A',gt:'>',GT:'>',Gt:'\u226B',gtdot:'\u22D7',gtlPar:'\u2995',gtquest:'\u2A7C',gtrapprox:'\u2A86',gtrarr:'\u2978',gtrdot:'\u22D7',gtreqless:'\u22DB',gtreqqless:'\u2A8C',gtrless:'\u2277',gtrsim:'\u2273',gvertneqq:'\u2269\uFE00',gvnE:'\u2269\uFE00',Hacek:'\u02C7',hairsp:'\u200A',half:'\xBD',hamilt:'\u210B',HARDcy:'\u042A',hardcy:'\u044A',harrcir:'\u2948',harr:'\u2194',hArr:'\u21D4',harrw:'\u21AD',Hat:'^',hbar:'\u210F',Hcirc:'\u0124',hcirc:'\u0125',hearts:'\u2665',heartsuit:'\u2665',hellip:'\u2026',hercon:'\u22B9',hfr:'\uD835\uDD25',Hfr:'\u210C',HilbertSpace:'\u210B',hksearow:'\u2925',hkswarow:'\u2926',hoarr:'\u21FF',homtht:'\u223B',hookleftarrow:'\u21A9',hookrightarrow:'\u21AA',hopf:'\uD835\uDD59',Hopf:'\u210D',horbar:'\u2015',HorizontalLine:'\u2500',hscr:'\uD835\uDCBD',Hscr:'\u210B',hslash:'\u210F',Hstrok:'\u0126',hstrok:'\u0127',HumpDownHump:'\u224E',HumpEqual:'\u224F',hybull:'\u2043',hyphen:'\u2010',Iacute:'\xCD',iacute:'\xED',ic:'\u2063',Icirc:'\xCE',icirc:'\xEE',Icy:'\u0418',icy:'\u0438',Idot:'\u0130',IEcy:'\u0415',iecy:'\u0435',iexcl:'\xA1',iff:'\u21D4',ifr:'\uD835\uDD26',Ifr:'\u2111',Igrave:'\xCC',igrave:'\xEC',ii:'\u2148',iiiint:'\u2A0C',iiint:'\u222D',iinfin:'\u29DC',iiota:'\u2129',IJlig:'\u0132',ijlig:'\u0133',Imacr:'\u012A',imacr:'\u012B',image:'\u2111',ImaginaryI:'\u2148',imagline:'\u2110',imagpart:'\u2111',imath:'\u0131',Im:'\u2111',imof:'\u22B7',imped:'\u01B5',Implies:'\u21D2',incare:'\u2105',in:'\u2208',infin:'\u221E',infintie:'\u29DD',inodot:'\u0131',intcal:'\u22BA',int:'\u222B',Int:'\u222C',integers:'\u2124',Integral:'\u222B',intercal:'\u22BA',Intersection:'\u22C2',intlarhk:'\u2A17',intprod:'\u2A3C',InvisibleComma:'\u2063',InvisibleTimes:'\u2062',IOcy:'\u0401',iocy:'\u0451',Iogon:'\u012E',iogon:'\u012F',Iopf:'\uD835\uDD40',iopf:'\uD835\uDD5A',Iota:'\u0399',iota:'\u03B9',iprod:'\u2A3C',iquest:'\xBF',iscr:'\uD835\uDCBE',Iscr:'\u2110',isin:'\u2208',isindot:'\u22F5',isinE:'\u22F9',isins:'\u22F4',isinsv:'\u22F3',isinv:'\u2208',it:'\u2062',Itilde:'\u0128',itilde:'\u0129',Iukcy:'\u0406',iukcy:'\u0456',Iuml:'\xCF',iuml:'\xEF',Jcirc:'\u0134',jcirc:'\u0135',Jcy:'\u0419',jcy:'\u0439',Jfr:'\uD835\uDD0D',jfr:'\uD835\uDD27',jmath:'\u0237',Jopf:'\uD835\uDD41',jopf:'\uD835\uDD5B',Jscr:'\uD835\uDCA5',jscr:'\uD835\uDCBF',Jsercy:'\u0408',jsercy:'\u0458',Jukcy:'\u0404',jukcy:'\u0454',Kappa:'\u039A',kappa:'\u03BA',kappav:'\u03F0',Kcedil:'\u0136',kcedil:'\u0137',Kcy:'\u041A',kcy:'\u043A',Kfr:'\uD835\uDD0E',kfr:'\uD835\uDD28',kgreen:'\u0138',KHcy:'\u0425',khcy:'\u0445',KJcy:'\u040C',kjcy:'\u045C',Kopf:'\uD835\uDD42',kopf:'\uD835\uDD5C',Kscr:'\uD835\uDCA6',kscr:'\uD835\uDCC0',lAarr:'\u21DA',Lacute:'\u0139',lacute:'\u013A',laemptyv:'\u29B4',lagran:'\u2112',Lambda:'\u039B',lambda:'\u03BB',lang:'\u27E8',Lang:'\u27EA',langd:'\u2991',langle:'\u27E8',lap:'\u2A85',Laplacetrf:'\u2112',laquo:'\xAB',larrb:'\u21E4',larrbfs:'\u291F',larr:'\u2190',Larr:'\u219E',lArr:'\u21D0',larrfs:'\u291D',larrhk:'\u21A9',larrlp:'\u21AB',larrpl:'\u2939',larrsim:'\u2973',larrtl:'\u21A2',latail:'\u2919',lAtail:'\u291B',lat:'\u2AAB',late:'\u2AAD',lates:'\u2AAD\uFE00',lbarr:'\u290C',lBarr:'\u290E',lbbrk:'\u2772',lbrace:'{',lbrack:'[',lbrke:'\u298B',lbrksld:'\u298F',lbrkslu:'\u298D',Lcaron:'\u013D',lcaron:'\u013E',Lcedil:'\u013B',lcedil:'\u013C',lceil:'\u2308',lcub:'{',Lcy:'\u041B',lcy:'\u043B',ldca:'\u2936',ldquo:'\u201C',ldquor:'\u201E',ldrdhar:'\u2967',ldrushar:'\u294B',ldsh:'\u21B2',le:'\u2264',lE:'\u2266',LeftAngleBracket:'\u27E8',LeftArrowBar:'\u21E4',leftarrow:'\u2190',LeftArrow:'\u2190',Leftarrow:'\u21D0',LeftArrowRightArrow:'\u21C6',leftarrowtail:'\u21A2',LeftCeiling:'\u2308',LeftDoubleBracket:'\u27E6',LeftDownTeeVector:'\u2961',LeftDownVectorBar:'\u2959',LeftDownVector:'\u21C3',LeftFloor:'\u230A',leftharpoondown:'\u21BD',leftharpoonup:'\u21BC',leftleftarrows:'\u21C7',leftrightarrow:'\u2194',LeftRightArrow:'\u2194',Leftrightarrow:'\u21D4',leftrightarrows:'\u21C6',leftrightharpoons:'\u21CB',leftrightsquigarrow:'\u21AD',LeftRightVector:'\u294E',LeftTeeArrow:'\u21A4',LeftTee:'\u22A3',LeftTeeVector:'\u295A',leftthreetimes:'\u22CB',LeftTriangleBar:'\u29CF',LeftTriangle:'\u22B2',LeftTriangleEqual:'\u22B4',LeftUpDownVector:'\u2951',LeftUpTeeVector:'\u2960',LeftUpVectorBar:'\u2958',LeftUpVector:'\u21BF',LeftVectorBar:'\u2952',LeftVector:'\u21BC',lEg:'\u2A8B',leg:'\u22DA',leq:'\u2264',leqq:'\u2266',leqslant:'\u2A7D',lescc:'\u2AA8',les:'\u2A7D',lesdot:'\u2A7F',lesdoto:'\u2A81',lesdotor:'\u2A83',lesg:'\u22DA\uFE00',lesges:'\u2A93',lessapprox:'\u2A85',lessdot:'\u22D6',lesseqgtr:'\u22DA',lesseqqgtr:'\u2A8B',LessEqualGreater:'\u22DA',LessFullEqual:'\u2266',LessGreater:'\u2276',lessgtr:'\u2276',LessLess:'\u2AA1',lesssim:'\u2272',LessSlantEqual:'\u2A7D',LessTilde:'\u2272',lfisht:'\u297C',lfloor:'\u230A',Lfr:'\uD835\uDD0F',lfr:'\uD835\uDD29',lg:'\u2276',lgE:'\u2A91',lHar:'\u2962',lhard:'\u21BD',lharu:'\u21BC',lharul:'\u296A',lhblk:'\u2584',LJcy:'\u0409',ljcy:'\u0459',llarr:'\u21C7',ll:'\u226A',Ll:'\u22D8',llcorner:'\u231E',Lleftarrow:'\u21DA',llhard:'\u296B',lltri:'\u25FA',Lmidot:'\u013F',lmidot:'\u0140',lmoustache:'\u23B0',lmoust:'\u23B0',lnap:'\u2A89',lnapprox:'\u2A89',lne:'\u2A87',lnE:'\u2268',lneq:'\u2A87',lneqq:'\u2268',lnsim:'\u22E6',loang:'\u27EC',loarr:'\u21FD',lobrk:'\u27E6',longleftarrow:'\u27F5',LongLeftArrow:'\u27F5',Longleftarrow:'\u27F8',longleftrightarrow:'\u27F7',LongLeftRightArrow:'\u27F7',Longleftrightarrow:'\u27FA',longmapsto:'\u27FC',longrightarrow:'\u27F6',LongRightArrow:'\u27F6',Longrightarrow:'\u27F9',looparrowleft:'\u21AB',looparrowright:'\u21AC',lopar:'\u2985',Lopf:'\uD835\uDD43',lopf:'\uD835\uDD5D',loplus:'\u2A2D',lotimes:'\u2A34',lowast:'\u2217',lowbar:'_',LowerLeftArrow:'\u2199',LowerRightArrow:'\u2198',loz:'\u25CA',lozenge:'\u25CA',lozf:'\u29EB',lpar:'(',lparlt:'\u2993',lrarr:'\u21C6',lrcorner:'\u231F',lrhar:'\u21CB',lrhard:'\u296D',lrm:'\u200E',lrtri:'\u22BF',lsaquo:'\u2039',lscr:'\uD835\uDCC1',Lscr:'\u2112',lsh:'\u21B0',Lsh:'\u21B0',lsim:'\u2272',lsime:'\u2A8D',lsimg:'\u2A8F',lsqb:'[',lsquo:'\u2018',lsquor:'\u201A',Lstrok:'\u0141',lstrok:'\u0142',ltcc:'\u2AA6',ltcir:'\u2A79',lt:'<',LT:'<',Lt:'\u226A',ltdot:'\u22D6',lthree:'\u22CB',ltimes:'\u22C9',ltlarr:'\u2976',ltquest:'\u2A7B',ltri:'\u25C3',ltrie:'\u22B4',ltrif:'\u25C2',ltrPar:'\u2996',lurdshar:'\u294A',luruhar:'\u2966',lvertneqq:'\u2268\uFE00',lvnE:'\u2268\uFE00',macr:'\xAF',male:'\u2642',malt:'\u2720',maltese:'\u2720',Map:'\u2905',map:'\u21A6',mapsto:'\u21A6',mapstodown:'\u21A7',mapstoleft:'\u21A4',mapstoup:'\u21A5',marker:'\u25AE',mcomma:'\u2A29',Mcy:'\u041C',mcy:'\u043C',mdash:'\u2014',mDDot:'\u223A',measuredangle:'\u2221',MediumSpace:'\u205F',Mellintrf:'\u2133',Mfr:'\uD835\uDD10',mfr:'\uD835\uDD2A',mho:'\u2127',micro:'\xB5',midast:'*',midcir:'\u2AF0',mid:'\u2223',middot:'\xB7',minusb:'\u229F',minus:'\u2212',minusd:'\u2238',minusdu:'\u2A2A',MinusPlus:'\u2213',mlcp:'\u2ADB',mldr:'\u2026',mnplus:'\u2213',models:'\u22A7',Mopf:'\uD835\uDD44',mopf:'\uD835\uDD5E',mp:'\u2213',mscr:'\uD835\uDCC2',Mscr:'\u2133',mstpos:'\u223E',Mu:'\u039C',mu:'\u03BC',multimap:'\u22B8',mumap:'\u22B8',nabla:'\u2207',Nacute:'\u0143',nacute:'\u0144',nang:'\u2220\u20D2',nap:'\u2249',napE:'\u2A70\u0338',napid:'\u224B\u0338',napos:'\u0149',napprox:'\u2249',natural:'\u266E',naturals:'\u2115',natur:'\u266E',nbsp:'\xA0',nbump:'\u224E\u0338',nbumpe:'\u224F\u0338',ncap:'\u2A43',Ncaron:'\u0147',ncaron:'\u0148',Ncedil:'\u0145',ncedil:'\u0146',ncong:'\u2247',ncongdot:'\u2A6D\u0338',ncup:'\u2A42',Ncy:'\u041D',ncy:'\u043D',ndash:'\u2013',nearhk:'\u2924',nearr:'\u2197',neArr:'\u21D7',nearrow:'\u2197',ne:'\u2260',nedot:'\u2250\u0338',NegativeMediumSpace:'\u200B',NegativeThickSpace:'\u200B',NegativeThinSpace:'\u200B',NegativeVeryThinSpace:'\u200B',nequiv:'\u2262',nesear:'\u2928',nesim:'\u2242\u0338',NestedGreaterGreater:'\u226B',NestedLessLess:'\u226A',NewLine:'\n',nexist:'\u2204',nexists:'\u2204',Nfr:'\uD835\uDD11',nfr:'\uD835\uDD2B',ngE:'\u2267\u0338',nge:'\u2271',ngeq:'\u2271',ngeqq:'\u2267\u0338',ngeqslant:'\u2A7E\u0338',nges:'\u2A7E\u0338',nGg:'\u22D9\u0338',ngsim:'\u2275',nGt:'\u226B\u20D2',ngt:'\u226F',ngtr:'\u226F',nGtv:'\u226B\u0338',nharr:'\u21AE',nhArr:'\u21CE',nhpar:'\u2AF2',ni:'\u220B',nis:'\u22FC',nisd:'\u22FA',niv:'\u220B',NJcy:'\u040A',njcy:'\u045A',nlarr:'\u219A',nlArr:'\u21CD',nldr:'\u2025',nlE:'\u2266\u0338',nle:'\u2270',nleftarrow:'\u219A',nLeftarrow:'\u21CD',nleftrightarrow:'\u21AE',nLeftrightarrow:'\u21CE',nleq:'\u2270',nleqq:'\u2266\u0338',nleqslant:'\u2A7D\u0338',nles:'\u2A7D\u0338',nless:'\u226E',nLl:'\u22D8\u0338',nlsim:'\u2274',nLt:'\u226A\u20D2',nlt:'\u226E',nltri:'\u22EA',nltrie:'\u22EC',nLtv:'\u226A\u0338',nmid:'\u2224',NoBreak:'\u2060',NonBreakingSpace:'\xA0',nopf:'\uD835\uDD5F',Nopf:'\u2115',Not:'\u2AEC',not:'\xAC',NotCongruent:'\u2262',NotCupCap:'\u226D',NotDoubleVerticalBar:'\u2226',NotElement:'\u2209',NotEqual:'\u2260',NotEqualTilde:'\u2242\u0338',NotExists:'\u2204',NotGreater:'\u226F',NotGreaterEqual:'\u2271',NotGreaterFullEqual:'\u2267\u0338',NotGreaterGreater:'\u226B\u0338',NotGreaterLess:'\u2279',NotGreaterSlantEqual:'\u2A7E\u0338',NotGreaterTilde:'\u2275',NotHumpDownHump:'\u224E\u0338',NotHumpEqual:'\u224F\u0338',notin:'\u2209',notindot:'\u22F5\u0338',notinE:'\u22F9\u0338',notinva:'\u2209',notinvb:'\u22F7',notinvc:'\u22F6',NotLeftTriangleBar:'\u29CF\u0338',NotLeftTriangle:'\u22EA',NotLeftTriangleEqual:'\u22EC',NotLess:'\u226E',NotLessEqual:'\u2270',NotLessGreater:'\u2278',NotLessLess:'\u226A\u0338',NotLessSlantEqual:'\u2A7D\u0338',NotLessTilde:'\u2274',NotNestedGreaterGreater:'\u2AA2\u0338',NotNestedLessLess:'\u2AA1\u0338',notni:'\u220C',notniva:'\u220C',notnivb:'\u22FE',notnivc:'\u22FD',NotPrecedes:'\u2280',NotPrecedesEqual:'\u2AAF\u0338',NotPrecedesSlantEqual:'\u22E0',NotReverseElement:'\u220C',NotRightTriangleBar:'\u29D0\u0338',NotRightTriangle:'\u22EB',NotRightTriangleEqual:'\u22ED',NotSquareSubset:'\u228F\u0338',NotSquareSubsetEqual:'\u22E2',NotSquareSuperset:'\u2290\u0338',NotSquareSupersetEqual:'\u22E3',NotSubset:'\u2282\u20D2',NotSubsetEqual:'\u2288',NotSucceeds:'\u2281',NotSucceedsEqual:'\u2AB0\u0338',NotSucceedsSlantEqual:'\u22E1',NotSucceedsTilde:'\u227F\u0338',NotSuperset:'\u2283\u20D2',NotSupersetEqual:'\u2289',NotTilde:'\u2241',NotTildeEqual:'\u2244',NotTildeFullEqual:'\u2247',NotTildeTilde:'\u2249',NotVerticalBar:'\u2224',nparallel:'\u2226',npar:'\u2226',nparsl:'\u2AFD\u20E5',npart:'\u2202\u0338',npolint:'\u2A14',npr:'\u2280',nprcue:'\u22E0',nprec:'\u2280',npreceq:'\u2AAF\u0338',npre:'\u2AAF\u0338',nrarrc:'\u2933\u0338',nrarr:'\u219B',nrArr:'\u21CF',nrarrw:'\u219D\u0338',nrightarrow:'\u219B',nRightarrow:'\u21CF',nrtri:'\u22EB',nrtrie:'\u22ED',nsc:'\u2281',nsccue:'\u22E1',nsce:'\u2AB0\u0338',Nscr:'\uD835\uDCA9',nscr:'\uD835\uDCC3',nshortmid:'\u2224',nshortparallel:'\u2226',nsim:'\u2241',nsime:'\u2244',nsimeq:'\u2244',nsmid:'\u2224',nspar:'\u2226',nsqsube:'\u22E2',nsqsupe:'\u22E3',nsub:'\u2284',nsubE:'\u2AC5\u0338',nsube:'\u2288',nsubset:'\u2282\u20D2',nsubseteq:'\u2288',nsubseteqq:'\u2AC5\u0338',nsucc:'\u2281',nsucceq:'\u2AB0\u0338',nsup:'\u2285',nsupE:'\u2AC6\u0338',nsupe:'\u2289',nsupset:'\u2283\u20D2',nsupseteq:'\u2289',nsupseteqq:'\u2AC6\u0338',ntgl:'\u2279',Ntilde:'\xD1',ntilde:'\xF1',ntlg:'\u2278',ntriangleleft:'\u22EA',ntrianglelefteq:'\u22EC',ntriangleright:'\u22EB',ntrianglerighteq:'\u22ED',Nu:'\u039D',nu:'\u03BD',num:'#',numero:'\u2116',numsp:'\u2007',nvap:'\u224D\u20D2',nvdash:'\u22AC',nvDash:'\u22AD',nVdash:'\u22AE',nVDash:'\u22AF',nvge:'\u2265\u20D2',nvgt:'>\u20D2',nvHarr:'\u2904',nvinfin:'\u29DE',nvlArr:'\u2902',nvle:'\u2264\u20D2',nvlt:'<\u20D2',nvltrie:'\u22B4\u20D2',nvrArr:'\u2903',nvrtrie:'\u22B5\u20D2',nvsim:'\u223C\u20D2',nwarhk:'\u2923',nwarr:'\u2196',nwArr:'\u21D6',nwarrow:'\u2196',nwnear:'\u2927',Oacute:'\xD3',oacute:'\xF3',oast:'\u229B',Ocirc:'\xD4',ocirc:'\xF4',ocir:'\u229A',Ocy:'\u041E',ocy:'\u043E',odash:'\u229D',Odblac:'\u0150',odblac:'\u0151',odiv:'\u2A38',odot:'\u2299',odsold:'\u29BC',OElig:'\u0152',oelig:'\u0153',ofcir:'\u29BF',Ofr:'\uD835\uDD12',ofr:'\uD835\uDD2C',ogon:'\u02DB',Ograve:'\xD2',ograve:'\xF2',ogt:'\u29C1',ohbar:'\u29B5',ohm:'\u03A9',oint:'\u222E',olarr:'\u21BA',olcir:'\u29BE',olcross:'\u29BB',oline:'\u203E',olt:'\u29C0',Omacr:'\u014C',omacr:'\u014D',Omega:'\u03A9',omega:'\u03C9',Omicron:'\u039F',omicron:'\u03BF',omid:'\u29B6',ominus:'\u2296',Oopf:'\uD835\uDD46',oopf:'\uD835\uDD60',opar:'\u29B7',OpenCurlyDoubleQuote:'\u201C',OpenCurlyQuote:'\u2018',operp:'\u29B9',oplus:'\u2295',orarr:'\u21BB',Or:'\u2A54',or:'\u2228',ord:'\u2A5D',order:'\u2134',orderof:'\u2134',ordf:'\xAA',ordm:'\xBA',origof:'\u22B6',oror:'\u2A56',orslope:'\u2A57',orv:'\u2A5B',oS:'\u24C8',Oscr:'\uD835\uDCAA',oscr:'\u2134',Oslash:'\xD8',oslash:'\xF8',osol:'\u2298',Otilde:'\xD5',otilde:'\xF5',otimesas:'\u2A36',Otimes:'\u2A37',otimes:'\u2297',Ouml:'\xD6',ouml:'\xF6',ovbar:'\u233D',OverBar:'\u203E',OverBrace:'\u23DE',OverBracket:'\u23B4',OverParenthesis:'\u23DC',para:'\xB6',parallel:'\u2225',par:'\u2225',parsim:'\u2AF3',parsl:'\u2AFD',part:'\u2202',PartialD:'\u2202',Pcy:'\u041F',pcy:'\u043F',percnt:'%',period:'.',permil:'\u2030',perp:'\u22A5',pertenk:'\u2031',Pfr:'\uD835\uDD13',pfr:'\uD835\uDD2D',Phi:'\u03A6',phi:'\u03C6',phiv:'\u03D5',phmmat:'\u2133',phone:'\u260E',Pi:'\u03A0',pi:'\u03C0',pitchfork:'\u22D4',piv:'\u03D6',planck:'\u210F',planckh:'\u210E',plankv:'\u210F',plusacir:'\u2A23',plusb:'\u229E',pluscir:'\u2A22',plus:'+',plusdo:'\u2214',plusdu:'\u2A25',pluse:'\u2A72',PlusMinus:'\xB1',plusmn:'\xB1',plussim:'\u2A26',plustwo:'\u2A27',pm:'\xB1',Poincareplane:'\u210C',pointint:'\u2A15',popf:'\uD835\uDD61',Popf:'\u2119',pound:'\xA3',prap:'\u2AB7',Pr:'\u2ABB',pr:'\u227A',prcue:'\u227C',precapprox:'\u2AB7',prec:'\u227A',preccurlyeq:'\u227C',Precedes:'\u227A',PrecedesEqual:'\u2AAF',PrecedesSlantEqual:'\u227C',PrecedesTilde:'\u227E',preceq:'\u2AAF',precnapprox:'\u2AB9',precneqq:'\u2AB5',precnsim:'\u22E8',pre:'\u2AAF',prE:'\u2AB3',precsim:'\u227E',prime:'\u2032',Prime:'\u2033',primes:'\u2119',prnap:'\u2AB9',prnE:'\u2AB5',prnsim:'\u22E8',prod:'\u220F',Product:'\u220F',profalar:'\u232E',profline:'\u2312',profsurf:'\u2313',prop:'\u221D',Proportional:'\u221D',Proportion:'\u2237',propto:'\u221D',prsim:'\u227E',prurel:'\u22B0',Pscr:'\uD835\uDCAB',pscr:'\uD835\uDCC5',Psi:'\u03A8',psi:'\u03C8',puncsp:'\u2008',Qfr:'\uD835\uDD14',qfr:'\uD835\uDD2E',qint:'\u2A0C',qopf:'\uD835\uDD62',Qopf:'\u211A',qprime:'\u2057',Qscr:'\uD835\uDCAC',qscr:'\uD835\uDCC6',quaternions:'\u210D',quatint:'\u2A16',quest:'?',questeq:'\u225F',quot:'"',QUOT:'"',rAarr:'\u21DB',race:'\u223D\u0331',Racute:'\u0154',racute:'\u0155',radic:'\u221A',raemptyv:'\u29B3',rang:'\u27E9',Rang:'\u27EB',rangd:'\u2992',range:'\u29A5',rangle:'\u27E9',raquo:'\xBB',rarrap:'\u2975',rarrb:'\u21E5',rarrbfs:'\u2920',rarrc:'\u2933',rarr:'\u2192',Rarr:'\u21A0',rArr:'\u21D2',rarrfs:'\u291E',rarrhk:'\u21AA',rarrlp:'\u21AC',rarrpl:'\u2945',rarrsim:'\u2974',Rarrtl:'\u2916',rarrtl:'\u21A3',rarrw:'\u219D',ratail:'\u291A',rAtail:'\u291C',ratio:'\u2236',rationals:'\u211A',rbarr:'\u290D',rBarr:'\u290F',RBarr:'\u2910',rbbrk:'\u2773',rbrace:'}',rbrack:']',rbrke:'\u298C',rbrksld:'\u298E',rbrkslu:'\u2990',Rcaron:'\u0158',rcaron:'\u0159',Rcedil:'\u0156',rcedil:'\u0157',rceil:'\u2309',rcub:'}',Rcy:'\u0420',rcy:'\u0440',rdca:'\u2937',rdldhar:'\u2969',rdquo:'\u201D',rdquor:'\u201D',rdsh:'\u21B3',real:'\u211C',realine:'\u211B',realpart:'\u211C',reals:'\u211D',Re:'\u211C',rect:'\u25AD',reg:'\xAE',REG:'\xAE',ReverseElement:'\u220B',ReverseEquilibrium:'\u21CB',ReverseUpEquilibrium:'\u296F',rfisht:'\u297D',rfloor:'\u230B',rfr:'\uD835\uDD2F',Rfr:'\u211C',rHar:'\u2964',rhard:'\u21C1',rharu:'\u21C0',rharul:'\u296C',Rho:'\u03A1',rho:'\u03C1',rhov:'\u03F1',RightAngleBracket:'\u27E9',RightArrowBar:'\u21E5',rightarrow:'\u2192',RightArrow:'\u2192',Rightarrow:'\u21D2',RightArrowLeftArrow:'\u21C4',rightarrowtail:'\u21A3',RightCeiling:'\u2309',RightDoubleBracket:'\u27E7',RightDownTeeVector:'\u295D',RightDownVectorBar:'\u2955',RightDownVector:'\u21C2',RightFloor:'\u230B',rightharpoondown:'\u21C1',rightharpoonup:'\u21C0',rightleftarrows:'\u21C4',rightleftharpoons:'\u21CC',rightrightarrows:'\u21C9',rightsquigarrow:'\u219D',RightTeeArrow:'\u21A6',RightTee:'\u22A2',RightTeeVector:'\u295B',rightthreetimes:'\u22CC',RightTriangleBar:'\u29D0',RightTriangle:'\u22B3',RightTriangleEqual:'\u22B5',RightUpDownVector:'\u294F',RightUpTeeVector:'\u295C',RightUpVectorBar:'\u2954',RightUpVector:'\u21BE',RightVectorBar:'\u2953',RightVector:'\u21C0',ring:'\u02DA',risingdotseq:'\u2253',rlarr:'\u21C4',rlhar:'\u21CC',rlm:'\u200F',rmoustache:'\u23B1',rmoust:'\u23B1',rnmid:'\u2AEE',roang:'\u27ED',roarr:'\u21FE',robrk:'\u27E7',ropar:'\u2986',ropf:'\uD835\uDD63',Ropf:'\u211D',roplus:'\u2A2E',rotimes:'\u2A35',RoundImplies:'\u2970',rpar:')',rpargt:'\u2994',rppolint:'\u2A12',rrarr:'\u21C9',Rrightarrow:'\u21DB',rsaquo:'\u203A',rscr:'\uD835\uDCC7',Rscr:'\u211B',rsh:'\u21B1',Rsh:'\u21B1',rsqb:']',rsquo:'\u2019',rsquor:'\u2019',rthree:'\u22CC',rtimes:'\u22CA',rtri:'\u25B9',rtrie:'\u22B5',rtrif:'\u25B8',rtriltri:'\u29CE',RuleDelayed:'\u29F4',ruluhar:'\u2968',rx:'\u211E',Sacute:'\u015A',sacute:'\u015B',sbquo:'\u201A',scap:'\u2AB8',Scaron:'\u0160',scaron:'\u0161',Sc:'\u2ABC',sc:'\u227B',sccue:'\u227D',sce:'\u2AB0',scE:'\u2AB4',Scedil:'\u015E',scedil:'\u015F',Scirc:'\u015C',scirc:'\u015D',scnap:'\u2ABA',scnE:'\u2AB6',scnsim:'\u22E9',scpolint:'\u2A13',scsim:'\u227F',Scy:'\u0421',scy:'\u0441',sdotb:'\u22A1',sdot:'\u22C5',sdote:'\u2A66',searhk:'\u2925',searr:'\u2198',seArr:'\u21D8',searrow:'\u2198',sect:'\xA7',semi:';',seswar:'\u2929',setminus:'\u2216',setmn:'\u2216',sext:'\u2736',Sfr:'\uD835\uDD16',sfr:'\uD835\uDD30',sfrown:'\u2322',sharp:'\u266F',SHCHcy:'\u0429',shchcy:'\u0449',SHcy:'\u0428',shcy:'\u0448',ShortDownArrow:'\u2193',ShortLeftArrow:'\u2190',shortmid:'\u2223',shortparallel:'\u2225',ShortRightArrow:'\u2192',ShortUpArrow:'\u2191',shy:'\xAD',Sigma:'\u03A3',sigma:'\u03C3',sigmaf:'\u03C2',sigmav:'\u03C2',sim:'\u223C',simdot:'\u2A6A',sime:'\u2243',simeq:'\u2243',simg:'\u2A9E',simgE:'\u2AA0',siml:'\u2A9D',simlE:'\u2A9F',simne:'\u2246',simplus:'\u2A24',simrarr:'\u2972',slarr:'\u2190',SmallCircle:'\u2218',smallsetminus:'\u2216',smashp:'\u2A33',smeparsl:'\u29E4',smid:'\u2223',smile:'\u2323',smt:'\u2AAA',smte:'\u2AAC',smtes:'\u2AAC\uFE00',SOFTcy:'\u042C',softcy:'\u044C',solbar:'\u233F',solb:'\u29C4',sol:'/',Sopf:'\uD835\uDD4A',sopf:'\uD835\uDD64',spades:'\u2660',spadesuit:'\u2660',spar:'\u2225',sqcap:'\u2293',sqcaps:'\u2293\uFE00',sqcup:'\u2294',sqcups:'\u2294\uFE00',Sqrt:'\u221A',sqsub:'\u228F',sqsube:'\u2291',sqsubset:'\u228F',sqsubseteq:'\u2291',sqsup:'\u2290',sqsupe:'\u2292',sqsupset:'\u2290',sqsupseteq:'\u2292',square:'\u25A1',Square:'\u25A1',SquareIntersection:'\u2293',SquareSubset:'\u228F',SquareSubsetEqual:'\u2291',SquareSuperset:'\u2290',SquareSupersetEqual:'\u2292',SquareUnion:'\u2294',squarf:'\u25AA',squ:'\u25A1',squf:'\u25AA',srarr:'\u2192',Sscr:'\uD835\uDCAE',sscr:'\uD835\uDCC8',ssetmn:'\u2216',ssmile:'\u2323',sstarf:'\u22C6',Star:'\u22C6',star:'\u2606',starf:'\u2605',straightepsilon:'\u03F5',straightphi:'\u03D5',strns:'\xAF',sub:'\u2282',Sub:'\u22D0',subdot:'\u2ABD',subE:'\u2AC5',sube:'\u2286',subedot:'\u2AC3',submult:'\u2AC1',subnE:'\u2ACB',subne:'\u228A',subplus:'\u2ABF',subrarr:'\u2979',subset:'\u2282',Subset:'\u22D0',subseteq:'\u2286',subseteqq:'\u2AC5',SubsetEqual:'\u2286',subsetneq:'\u228A',subsetneqq:'\u2ACB',subsim:'\u2AC7',subsub:'\u2AD5',subsup:'\u2AD3',succapprox:'\u2AB8',succ:'\u227B',succcurlyeq:'\u227D',Succeeds:'\u227B',SucceedsEqual:'\u2AB0',SucceedsSlantEqual:'\u227D',SucceedsTilde:'\u227F',succeq:'\u2AB0',succnapprox:'\u2ABA',succneqq:'\u2AB6',succnsim:'\u22E9',succsim:'\u227F',SuchThat:'\u220B',sum:'\u2211',Sum:'\u2211',sung:'\u266A',sup1:'\xB9',sup2:'\xB2',sup3:'\xB3',sup:'\u2283',Sup:'\u22D1',supdot:'\u2ABE',supdsub:'\u2AD8',supE:'\u2AC6',supe:'\u2287',supedot:'\u2AC4',Superset:'\u2283',SupersetEqual:'\u2287',suphsol:'\u27C9',suphsub:'\u2AD7',suplarr:'\u297B',supmult:'\u2AC2',supnE:'\u2ACC',supne:'\u228B',supplus:'\u2AC0',supset:'\u2283',Supset:'\u22D1',supseteq:'\u2287',supseteqq:'\u2AC6',supsetneq:'\u228B',supsetneqq:'\u2ACC',supsim:'\u2AC8',supsub:'\u2AD4',supsup:'\u2AD6',swarhk:'\u2926',swarr:'\u2199',swArr:'\u21D9',swarrow:'\u2199',swnwar:'\u292A',szlig:'\xDF',Tab:'\t',target:'\u2316',Tau:'\u03A4',tau:'\u03C4',tbrk:'\u23B4',Tcaron:'\u0164',tcaron:'\u0165',Tcedil:'\u0162',tcedil:'\u0163',Tcy:'\u0422',tcy:'\u0442',tdot:'\u20DB',telrec:'\u2315',Tfr:'\uD835\uDD17',tfr:'\uD835\uDD31',there4:'\u2234',therefore:'\u2234',Therefore:'\u2234',Theta:'\u0398',theta:'\u03B8',thetasym:'\u03D1',thetav:'\u03D1',thickapprox:'\u2248',thicksim:'\u223C',ThickSpace:'\u205F\u200A',ThinSpace:'\u2009',thinsp:'\u2009',thkap:'\u2248',thksim:'\u223C',THORN:'\xDE',thorn:'\xFE',tilde:'\u02DC',Tilde:'\u223C',TildeEqual:'\u2243',TildeFullEqual:'\u2245',TildeTilde:'\u2248',timesbar:'\u2A31',timesb:'\u22A0',times:'\xD7',timesd:'\u2A30',tint:'\u222D',toea:'\u2928',topbot:'\u2336',topcir:'\u2AF1',top:'\u22A4',Topf:'\uD835\uDD4B',topf:'\uD835\uDD65',topfork:'\u2ADA',tosa:'\u2929',tprime:'\u2034',trade:'\u2122',TRADE:'\u2122',triangle:'\u25B5',triangledown:'\u25BF',triangleleft:'\u25C3',trianglelefteq:'\u22B4',triangleq:'\u225C',triangleright:'\u25B9',trianglerighteq:'\u22B5',tridot:'\u25EC',trie:'\u225C',triminus:'\u2A3A',TripleDot:'\u20DB',triplus:'\u2A39',trisb:'\u29CD',tritime:'\u2A3B',trpezium:'\u23E2',Tscr:'\uD835\uDCAF',tscr:'\uD835\uDCC9',TScy:'\u0426',tscy:'\u0446',TSHcy:'\u040B',tshcy:'\u045B',Tstrok:'\u0166',tstrok:'\u0167',twixt:'\u226C',twoheadleftarrow:'\u219E',twoheadrightarrow:'\u21A0',Uacute:'\xDA',uacute:'\xFA',uarr:'\u2191',Uarr:'\u219F',uArr:'\u21D1',Uarrocir:'\u2949',Ubrcy:'\u040E',ubrcy:'\u045E',Ubreve:'\u016C',ubreve:'\u016D',Ucirc:'\xDB',ucirc:'\xFB',Ucy:'\u0423',ucy:'\u0443',udarr:'\u21C5',Udblac:'\u0170',udblac:'\u0171',udhar:'\u296E',ufisht:'\u297E',Ufr:'\uD835\uDD18',ufr:'\uD835\uDD32',Ugrave:'\xD9',ugrave:'\xF9',uHar:'\u2963',uharl:'\u21BF',uharr:'\u21BE',uhblk:'\u2580',ulcorn:'\u231C',ulcorner:'\u231C',ulcrop:'\u230F',ultri:'\u25F8',Umacr:'\u016A',umacr:'\u016B',uml:'\xA8',UnderBar:'_',UnderBrace:'\u23DF',UnderBracket:'\u23B5',UnderParenthesis:'\u23DD',Union:'\u22C3',UnionPlus:'\u228E',Uogon:'\u0172',uogon:'\u0173',Uopf:'\uD835\uDD4C',uopf:'\uD835\uDD66',UpArrowBar:'\u2912',uparrow:'\u2191',UpArrow:'\u2191',Uparrow:'\u21D1',UpArrowDownArrow:'\u21C5',updownarrow:'\u2195',UpDownArrow:'\u2195',Updownarrow:'\u21D5',UpEquilibrium:'\u296E',upharpoonleft:'\u21BF',upharpoonright:'\u21BE',uplus:'\u228E',UpperLeftArrow:'\u2196',UpperRightArrow:'\u2197',upsi:'\u03C5',Upsi:'\u03D2',upsih:'\u03D2',Upsilon:'\u03A5',upsilon:'\u03C5',UpTeeArrow:'\u21A5',UpTee:'\u22A5',upuparrows:'\u21C8',urcorn:'\u231D',urcorner:'\u231D',urcrop:'\u230E',Uring:'\u016E',uring:'\u016F',urtri:'\u25F9',Uscr:'\uD835\uDCB0',uscr:'\uD835\uDCCA',utdot:'\u22F0',Utilde:'\u0168',utilde:'\u0169',utri:'\u25B5',utrif:'\u25B4',uuarr:'\u21C8',Uuml:'\xDC',uuml:'\xFC',uwangle:'\u29A7',vangrt:'\u299C',varepsilon:'\u03F5',varkappa:'\u03F0',varnothing:'\u2205',varphi:'\u03D5',varpi:'\u03D6',varpropto:'\u221D',varr:'\u2195',vArr:'\u21D5',varrho:'\u03F1',varsigma:'\u03C2',varsubsetneq:'\u228A\uFE00',varsubsetneqq:'\u2ACB\uFE00',varsupsetneq:'\u228B\uFE00',varsupsetneqq:'\u2ACC\uFE00',vartheta:'\u03D1',vartriangleleft:'\u22B2',vartriangleright:'\u22B3',vBar:'\u2AE8',Vbar:'\u2AEB',vBarv:'\u2AE9',Vcy:'\u0412',vcy:'\u0432',vdash:'\u22A2',vDash:'\u22A8',Vdash:'\u22A9',VDash:'\u22AB',Vdashl:'\u2AE6',veebar:'\u22BB',vee:'\u2228',Vee:'\u22C1',veeeq:'\u225A',vellip:'\u22EE',verbar:'|',Verbar:'\u2016',vert:'|',Vert:'\u2016',VerticalBar:'\u2223',VerticalLine:'|',VerticalSeparator:'\u2758',VerticalTilde:'\u2240',VeryThinSpace:'\u200A',Vfr:'\uD835\uDD19',vfr:'\uD835\uDD33',vltri:'\u22B2',vnsub:'\u2282\u20D2',vnsup:'\u2283\u20D2',Vopf:'\uD835\uDD4D',vopf:'\uD835\uDD67',vprop:'\u221D',vrtri:'\u22B3',Vscr:'\uD835\uDCB1',vscr:'\uD835\uDCCB',vsubnE:'\u2ACB\uFE00',vsubne:'\u228A\uFE00',vsupnE:'\u2ACC\uFE00',vsupne:'\u228B\uFE00',Vvdash:'\u22AA',vzigzag:'\u299A',Wcirc:'\u0174',wcirc:'\u0175',wedbar:'\u2A5F',wedge:'\u2227',Wedge:'\u22C0',wedgeq:'\u2259',weierp:'\u2118',Wfr:'\uD835\uDD1A',wfr:'\uD835\uDD34',Wopf:'\uD835\uDD4E',wopf:'\uD835\uDD68',wp:'\u2118',wr:'\u2240',wreath:'\u2240',Wscr:'\uD835\uDCB2',wscr:'\uD835\uDCCC',xcap:'\u22C2',xcirc:'\u25EF',xcup:'\u22C3',xdtri:'\u25BD',Xfr:'\uD835\uDD1B',xfr:'\uD835\uDD35',xharr:'\u27F7',xhArr:'\u27FA',Xi:'\u039E',xi:'\u03BE',xlarr:'\u27F5',xlArr:'\u27F8',xmap:'\u27FC',xnis:'\u22FB',xodot:'\u2A00',Xopf:'\uD835\uDD4F',xopf:'\uD835\uDD69',xoplus:'\u2A01',xotime:'\u2A02',xrarr:'\u27F6',xrArr:'\u27F9',Xscr:'\uD835\uDCB3',xscr:'\uD835\uDCCD',xsqcup:'\u2A06',xuplus:'\u2A04',xutri:'\u25B3',xvee:'\u22C1',xwedge:'\u22C0',Yacute:'\xDD',yacute:'\xFD',YAcy:'\u042F',yacy:'\u044F',Ycirc:'\u0176',ycirc:'\u0177',Ycy:'\u042B',ycy:'\u044B',yen:'\xA5',Yfr:'\uD835\uDD1C',yfr:'\uD835\uDD36',YIcy:'\u0407',yicy:'\u0457',Yopf:'\uD835\uDD50',yopf:'\uD835\uDD6A',Yscr:'\uD835\uDCB4',yscr:'\uD835\uDCCE',YUcy:'\u042E',yucy:'\u044E',yuml:'\xFF',Yuml:'\u0178',Zacute:'\u0179',zacute:'\u017A',Zcaron:'\u017D',zcaron:'\u017E',Zcy:'\u0417',zcy:'\u0437',Zdot:'\u017B',zdot:'\u017C',zeetrf:'\u2128',ZeroWidthSpace:'\u200B',Zeta:'\u0396',zeta:'\u03B6',zfr:'\uD835\uDD37',Zfr:'\u2128',ZHcy:'\u0416',zhcy:'\u0436',zigrarr:'\u21DD',zopf:'\uD835\uDD6B',Zopf:'\u2124',Zscr:'\uD835\uDCB5',zscr:'\uD835\uDCCF',zwj:'\u200D',zwnj:'\u200C'}},function(e){'use strict';function t(e){var t=r[e],o,i;if(t)return t;for(t=r[e]=[],o=0;128>o;o++)i=n(o),/^[0-9a-z]$/i.test(i)?t.push(i):t.push('%'+('0'+o.toString(16).toUpperCase()).slice(-2));for(o=0;ol){a+=c[l];continue}if(55296<=l&&57343>=l){if(55296<=l&&56319>=l&&s+1=d)){a+=encodeURIComponent(e[s]+e[s+1]),s++;continue}a+='%EF%BF%BD';continue}a+=encodeURIComponent(e[s])}return a}var r={};o.defaultChars=';/?:@&=+$,-_.!~*\'()#',o.componentChars='-_.!~*\'()',e.exports=o},function(e){'use strict';function t(e){var t=r[e],o,i;if(t)return t;for(t=r[e]=[],o=0;128>o;o++)i=n(o),t.push(i);for(o=0;oa){t+=i[a];continue}if(192==(224&a)&&o+3c?'\uFFFD\uFFFD':n(c),o+=3;continue}if(224==(240&a)&&o+6c||55296<=c&&57343>=c?'\uFFFD\uFFFD\uFFFD':n(c),o+=6;continue}if(240==(248&a)&&o+9c||1114111>10),56320+(1023&c))),o+=9;continue}t+='\uFFFD'}return t})}var r={};o.defaultChars=';/?:@&=+$,#',o.componentChars='',e.exports=o},function(e){'use strict';e.exports=function(e){var t='';return t+=e.protocol||'',t+=e.slashes?'//':'',t+=e.auth?e.auth+'@':'',t+=e.hostname&&-1!==e.hostname.indexOf(':')?'['+e.hostname+']':e.hostname||'',t+=e.port?':'+e.port:'',t+=e.pathname||'',t+=e.search||'',t+=e.hash||'',t}},function(e){'use strict';function t(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var n=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,r=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,i=['{','}','|','\\','^','`'].concat(['<','>','"','`',' ','\r','\n','\t']),a=['\''].concat(i),s=['%','/','?',';','#'].concat(a),l=['/','?','#'],d=/^[+a-z0-9A-Z_-]{0,63}$/,c=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},u={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};t.prototype.parse=function(e,t){var o=e,a,i,m,g,h;if(o=o.trim(),!t&&1===e.split('#').length){var f=r.exec(o);if(f)return this.pathname=f[1],f[2]&&(this.search=f[2]),this}var b=n.exec(o);if(b&&(b=b[0],m=b.toLowerCase(),this.protocol=b,o=o.substr(b.length)),(t||b||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(h='//'===o.substr(0,2),h&&!(b&&p[b])&&(o=o.substr(2),this.slashes=!0)),!p[b]&&(h||b&&!u[b])){var _=-1;for(a=0;a255&&(this.hostname=''),x&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var O=o.indexOf('#');-1!==O&&(this.hash=o.substr(O),o=o.slice(0,O));var I=o.indexOf('?');return-1!==I&&(this.search=o.substr(I),o=o.slice(0,I)),o&&(this.pathname=o),u[m]&&this.hostname&&!this.pathname&&(this.pathname=''),this},t.prototype.parseHost=function(e){var t=o.exec(e);t&&(t=t[0],':'!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},e.exports=function(e,n){if(e&&e instanceof t)return e;var o=new t;return o.parse(e,n),o}},function(e,t,n){'use strict';t.Any=n(17),t.Cc=n(18),t.Cf=n(112),t.P=n(6),t.Z=n(19)},function(e){e.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804\uDCBD|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/},function(e,t,n){'use strict';t.parseLinkLabel=n(114),t.parseLinkDestination=n(115),t.parseLinkTitle=n(116)},function(e){'use strict';e.exports=function(e,t,n){var o=-1,r=e.posMax,i=e.pos,a,s,l,d;for(e.pos=t+1,a=1;e.poss||127===s);){if(92===s&&t+1=n)return a;if(l=e.charCodeAt(t),34!==l&&39!==l&&40!==l)return a;for(t++,40===l&&(l=41);t'+s(e[t].content)+''},i.code_block=function(e,t,n,o,r){var i=e[t];return''+s(e[t].content)+'\n'},i.fence=function(e,t,n,o,r){var l=e[t],d=l.info?a(l.info).trim():'',c='',p,u,i,m;return d&&(c=d.split(/\s+/g)[0]),p=n.highlight?n.highlight(l.content,c)||s(l.content):s(l.content),0===p.indexOf('u?i.push(['class',n.langPrefix+c]):i[u][1]+=' '+n.langPrefix+c,m={attrs:i},'
'+p+'
\n'):'
'+p+'
\n'},i.image=function(e,t,n,o,r){var i=e[t];return i.attrs[i.attrIndex('alt')][1]=r.renderInlineAsText(i.children,n,o),r.renderToken(e,t,n)},i.hardbreak=function(e,t,n){return n.xhtmlOut?'
\n':'
\n'},i.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?'
\n':'
\n':'\n'},i.text=function(e,t){return s(e[t].content)},i.html_block=function(e,t){return e[t].content},i.html_inline=function(e,t){return e[t].content},o.prototype.renderAttrs=function(e){var t,n,o;if(!e.attrs)return'';for(o='',t=0,n=e.attrs.length;t\n':'>',o)},o.prototype.renderInline=function(e,t,n){for(var o='',r=this.rules,a=0,i=e.length,s;a\s]/i.test(e)}function r(e){return /^<\/a\s*>/i.test(e)}var a=n(0).arrayReplaceAt;e.exports=function(e){var t=e.tokens,n,i,s,l,d,c,p,u,m,g,h,f,b,_,k,w,y;if(e.md.options.linkify)for(i=0,s=t.length;ih&&(d=new e.Token('text','',0),d.content=m.slice(h,g),d.level=f,p.push(d)),d=new e.Token('link_open','a',1),d.attrs=[['href',k]],d.level=f++,d.markup='linkify',d.info='auto',p.push(d),d=new e.Token('text','',0),d.content=w,d.level=f,p.push(d),d=new e.Token('link_close','a',-1),d.level=--f,d.markup='linkify',d.info='auto',p.push(d),h=y[u].lastIndex);h=k&&(T=A=!1),A&&T&&(A=!1,T=v),!A&&!T){P&&(u.content=r(u.content,g.index,p));continue}if(T)for(E=S.length-1;0<=E&&(_=S[E],!(S[E].level=n))&&!(e.sCount[a]=l){e.line=n;break}for(c=0;ca)return!1;if(u=n+1,e.sCount[u]=e.eMarks[u])return!1;if(l=e.src.charCodeAt(c++),124!==l&&45!==l&&58!==l)return!1;for(;cf.length)return!1;if(s)return!0;for(h=e.push('table_open','table',1),h.map=_=[n,0],h=e.push('thead_open','thead',1),h.map=[n,n+1],h=e.push('tr_open','tr',1),h.map=[n,n+1],p=0;pe.sCount[t]-e.blkIndent)return!1;for(r=o=t+1;os)return!1;if(l=e.src.charCodeAt(a),126!==l&&96!==l)return!1;if(u=a,a=e.skipChars(a,l),d=a-u,3>d)return!1;if(g=e.src.slice(u,a),c=e.src.slice(a,s),0<=c.indexOf(n(l)))return!1;if(r)return!0;for(p=t;;){if(p++,p>=o)break;if(a=u=e.bMarks[p]+e.tShift[p],s=e.eMarks[p],a=d,y=[e.sCount[t]],e.sCount[t]=f-i,v=[e.tShift[t]],e.tShift[t]=s-e.bMarks[t],A=e.md.block.ruler.getRules('blockquote'),w=e.parentType,e.parentType='blockquote',E=!1,h=t+1;h=d));h++){if(62===e.src.charCodeAt(s++)&&!E){for(i=f=e.sCount[h]+s-(e.bMarks[h]+e.tShift[h]),32===e.src.charCodeAt(s)?(s++,i++,f++,c=!1,x=!0):9===e.src.charCodeAt(s)?(x=!0,3==(e.bsCount[h]+f)%4?(s++,i++,f++,c=!1):c=!0):x=!1,b.push(e.bMarks[h]),e.bMarks[h]=s;s=d,_.push(e.bsCount[h]),e.bsCount[h]=e.sCount[h]+1+(x?1:0),y.push(e.sCount[h]),e.sCount[h]=f-i,v.push(e.tShift[h]),e.tShift[h]=s-e.bMarks[h];continue}if(l)break;for(C=!1,u=0,m=A.length;u',T.map=g=[t,0],e.md.block.tokenize(e,t,h),T=e.push('blockquote_close','blockquote',-1),T.markup='>',e.lineMax=a,e.parentType=w,g[1]=e.line,u=0;ud)&&(!!i||(e.line=t+1,p=e.push('hr','hr',0),p.map=[t,e.line],p.markup=Array(d+1).join(n(l)),!0))}},function(t,o,r){'use strict';function a(e,t){var n,o,r,a;return o=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],n=e.src.charCodeAt(o++),42!==n&&45!==n&&43!==n?-1:o=r)return-1;if(a=e.src.charCodeAt(o++),48>a||57=r)return-1;if(a=e.src.charCodeAt(o++),48<=a&&57>=a){if(10<=o-n)return-1;continue}if(41===a||46===a)break;return-1}return o=t.blkIndent&&(p=!0),0<=(N=s(t,o))){if(_=!0,L=t.bMarks[o]+t.tShift[o],x=+t.src.substr(L,N-L-1),p&&1!==x)return!1;}else if(0<=(N=a(t,o)))_=!1;else return!1;if(p&&t.skipSpaces(N)>=t.eMarks[o])return!1;if(v=t.src.charCodeAt(N-1),c)return!0;for(y=t.tokens.length,_?(M=t.push('ordered_list_open','ol',1),1!==x&&(M.attrs=[['start',x]])):M=t.push('bullet_list_open','ul',1),M.map=l=[o,0],M.markup=n(v),A=o,V=!1,F=t.md.block.ruler.getRules('list'),S=t.parentType,t.parentType='list';A=C?1:T-b,4=C&&t.isEmpty(o+1)?t.line=e(t.line+2,r):t.md.block.tokenize(t,o,r,!0),(!t.tight||V)&&(u=!1),V=1=r)break;if(t.sCount[A]N)break;}else if(N=a(t,A),0>N)break;if(v!==t.src.charCodeAt(N-1))break}return M=_?t.push('ordered_list_close','ol',-1):t.push('bullet_list_close','ul',-1),M.markup=n(v),l[1]=A,t.line=A,t.parentType=S,u&&d(t,y),!0}},function(e,t,n){'use strict';var o=n(0).normalizeReference,r=n(0).isSpace;e.exports=function(e,t,n,a){var s=0,d=e.bMarks[t]+e.tShift[t],c=e.eMarks[t],p=t+1,u,m,g,h,f,b,i,l,_,k,w,y,v,x,C,A;if(4<=e.sCount[t]-e.blkIndent)return!1;if(91!==e.src.charCodeAt(d))return!1;for(;++de.sCount[p])){for(x=!1,b=0,i=C.length;b_||58!==v.charCodeAt(_+1))return!1;for(d=_+2;d=a)return!1;for(l=1,s=e.src.charCodeAt(++i);35===s&&i=l;)l++,s=e.src.charCodeAt(++i);return!(6i&&o(e.src.charCodeAt(d-1))&&(a=d),e.line=t+1,c=e.push('heading_open','h'+(l+''),1),c.markup='########'.slice(0,l),c.map=[t,e.line],c=e.push('inline','',0),c.content=e.src.slice(i,a).trim(),c.map=[t,e.line],c.children=[],c=e.push('heading_close','h'+(l+''),-1),c.markup='########'.slice(0,l),!0))}},function(e){'use strict';e.exports=function(e,t,o){var r=t+1,a=e.md.block.ruler.getRules('paragraph'),s,d,c,i,l,p,u,m,g,h;if(4<=e.sCount[t]-e.blkIndent)return!1;for(h=e.parentType,e.parentType='paragraph';r=e.blkIndent&&(p=e.bMarks[r]+e.tShift[r],u=e.eMarks[r],p=u)))){m=61===g?1:2;break}if(!(0>e.sCount[r])){for(d=!1,c=0,i=a.length;c|$))/i,/<\/(script|pre|style)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp('^|$))','i'),/^$/,!0],[new RegExp(r.source+'\\s*$'),/^$/,!1]];e.exports=function(e,t,n,o){var r=e.bMarks[t]+e.tShift[t],s=e.eMarks[t],l,i,d,c;if(4<=e.sCount[t]-e.blkIndent)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(r))return!1;for(c=e.src.slice(r,s),l=0;le.sCount[n])){for(s=!1,d=0,i=o.length;dn&&this.level--,o.level=this.level,0=this.eMarks[e]},o.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;et;)if(!i(this.src.charCodeAt(--e)))return e+1;return e},o.prototype.skipChars=function(e,t){for(var n=this.src.length;en;)if(t!==this.src.charCodeAt(--e))return e+1;return e},o.prototype.getLines=function(e,t,n,o){var r=e,a,s,l,d,c,p,u;if(e>=t)return'';for(p=Array(t-e),a=0;rn?Array(s-n+1).join(' ')+this.src.slice(d,c):this.src.slice(d,c)}return p.join('')},o.prototype.Token=r,e.exports=o},function(e,t,n){'use strict';function o(){var e;for(this.ruler=new r,e=0;e=o)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},o.prototype.parse=function(e,t,n,o){var r=new this.State(e,t,n,o),a,i,s;for(this.tokenize(r),i=this.ruler2.getRules(''),s=i.length,a=0;aa;a++)r.push(0);['\\','!','"','#','$','%','&','\'','(',')','*','+',',','.','/',':',';','<','=','>','?','@','[',']','^','_','`','{','|','}','~','-'].forEach(function(e){r[e.charCodeAt(0)]=1}),e.exports=function(e,t){var n=e.pos,i=e.posMax,a;if(92!==e.src.charCodeAt(n))return!1;if(n++,na&&0!==r[a])return t||(e.pending+=e.src[n]),e.pos+=2,!0;if(10===a){for(t||e.push('hardbreak','br',0),n++;nu)return!1;if(g=u+1,g=a)return!1;for(s=g,h=e.md.helpers.parseLinkDestination(e.src,g,e.posMax),h.ok&&(n=e.md.normalizeLink(h.str),e.md.validateLink(n)?g=h.pos:n=''),s=g;g=a||41!==e.src.charCodeAt(g))&&(l=!0),g++}if(l){if('undefined'==typeof e.env.references)return!1;if(gp)return!1;if(m=p+1,m=a)return!1;for(k=m,h=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),h.ok&&(n=e.md.normalizeLink(h.str),e.md.validateLink(n)?m=h.pos:n=''),k=m;m=a||41!==e.src.charCodeAt(m))return e.pos=i,!1;m++}else{if('undefined'==typeof e.env.references)return!1;if(m/,n=/^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/;e.exports=function(e,o){var r=e.pos,i,a,s,l,d,c;return!(60!==e.src.charCodeAt(r))&&(i=e.src.slice(r),!(0>i.indexOf('>'))&&(n.test(i)?(a=i.match(n),l=a[0].slice(1,-1),d=e.md.normalizeLink(l),!!e.md.validateLink(d))&&(o||(c=e.push('link_open','a',1),c.attrs=[['href',d]],c.markup='autolink',c.info='auto',c=e.push('text','',0),c.content=e.md.normalizeLinkText(l),c=e.push('link_close','a',-1),c.markup='autolink',c.info='auto'),e.pos+=a[0].length,!0):!!t.test(i)&&(s=i.match(t),l=s[0].slice(1,-1),d=e.md.normalizeLink('mailto:'+l),!!e.md.validateLink(d))&&(o||(c=e.push('link_open','a',1),c.attrs=[['href',d]],c.markup='autolink',c.info='auto',c=e.push('text','',0),c.content=e.md.normalizeLinkText(l),c=e.push('link_close','a',-1),c.markup='autolink',c.info='auto'),e.pos+=s[0].length,!0)))}},function(e,t,n){'use strict';function o(e){var t=32|e;return 97<=t&&122>=t}var r=n(20).HTML_TAG_RE;e.exports=function(e,t){var n=e.pos,i,a,s,l;return!!e.md.options.html&&(s=e.posMax,!(60!==e.src.charCodeAt(n)||n+2>=s))&&(i=e.src.charCodeAt(n+1),33===i||63===i||47===i||o(i))&&(a=e.src.slice(n).match(r),!!a)&&(t||(l=e.push('html_inline','',0),l.content=e.src.slice(n,n+a[0].length)),e.pos+=a[0].length,!0)}},function(e,t,n){'use strict';var o=n(15),r=n(0).has,i=n(0).isValidEntityCode,a=n(0).fromCodePoint,s=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,l=/^&([a-z][a-z0-9]{1,31});/i;e.exports=function(e,t){var n=e.pos,d=e.posMax,c,p,u;if(38!==e.src.charCodeAt(n))return!1;if(n+1a.end&&a.level===i.level){var s=(a.close||i.open)&&'undefined'!=typeof a.length&&'undefined'!=typeof i.length&&0==(a.length+i.length)%3;if(!s){i.jump=o-r,i.open=!1,a.end=o,a.jump=0;break}}r-=a.jump+1}}},function(e){'use strict';e.exports=function(e){var t=0,n=e.tokens,o=e.tokens.length,r,i;for(r=i=0;rn&&this.level--,o.level=this.level,0<\uFF5C]|'+r.src_ZPCc+'))('+h+')','i'),e.re.schema_search=RegExp('(^|(?!_)(?:[><\uFF5C]|'+r.src_ZPCc+'))('+h+')','ig'),e.re.pretest=RegExp('('+e.re.schema_test.source+')|('+e.re.host_fuzzy_test.source+')|@','i'),p(e)}function h(e,t){var n=e.__index__,o=e.__last_index__,r=e.__text_cache__.slice(n,o);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=o+t,this.raw=r,this.text=r,this.url=r}function f(e,t){var n=new h(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function b(e,t){return this instanceof b?void(!t&&c(e)&&(t=e,e={}),this.__opts__=o({},_,t),this.__index__=-1,this.__last_index__=-1,this.__schema__='',this.__text_cache__='',this.__schemas__=o({},k,e),this.__compiled__={},this.__tlds__=y,this.__tlds_replaced__=!1,this.re={},g(this)):new b(e,t)}var _={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1},k={"http:":{validate:function(e,t,n){var o=e.slice(t);return n.re.http||(n.re.http=new RegExp('^\\/\\/'+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,'i')),n.re.http.test(o)?o.match(n.re.http)[0].length:0}},"https:":'http:',"ftp:":'http:',"//":{validate:function(e,t,n){var o=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp('^'+n.re.src_auth+'(?:localhost|(?:(?:'+n.re.src_domain+')\\.)+'+n.re.src_domain_root+')'+n.re.src_port+n.re.src_host_terminator+n.re.src_path,'i')),n.re.no_http.test(o)?3<=t&&':'===e[t-3]?0:3<=t&&'/'===e[t-3]?0:o.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){var o=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp('^'+n.re.src_email_name+'@'+n.re.src_host_strict,'i')),n.re.mailto.test(o)?o.match(n.re.mailto)[0].length:0}}},w='a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]',y=['biz','com','edu','gov','net','org','pro','web','xxx','aero','asia','coop','info','museum','name','shop','\u0440\u0444'];b.prototype.add=function(e,t){return this.__schemas__[e]=t,g(this),this},b.prototype.set=function(e){return this.__opts__=o(this.__opts__,e),this},b.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var t,n,o,r,i,a,s,l,d;if(this.re.schema_test.test(e))for(s=this.re.schema_search,s.lastIndex=0;null!==(t=s.exec(e));)if(r=this.testSchemaAt(e,t[2],s.lastIndex),r){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+r;break}return this.__opts__.fuzzyLink&&this.__compiled__['http:']&&(l=e.search(this.re.host_fuzzy_test),0<=l&&(0>this.__index__||lthis.__index__||ithis.__index__||ithis.__last_index__)&&(this.__schema__='mailto:',this.__index__=i,this.__last_index__=a))),0<=this.__index__},b.prototype.pretest=function(e){return this.re.pretest.test(e)},b.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},b.prototype.match=function(e){var t=0,n=[];0<=this.__index__&&this.__text_cache__===e&&(n.push(f(this,t)),t=this.__last_index__);for(var o=t?e.slice(t):e;this.test(o);)n.push(f(this,t)),o=o.slice(this.__last_index__),t+=this.__last_index__;return n.length?n:null},b.prototype.tlds=function(e,t){return(e=Array.isArray(e)?e:[e],!t)?(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,g(this),this):(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),g(this),this)},b.prototype.normalize=function(e){e.schema||(e.url='http://'+e.url),'mailto:'!==e.schema||/^mailto:/i.test(e.url)||(e.url='mailto:'+e.url)},b.prototype.onCompile=function(){},e.exports=b},function(e,t,n){'use strict';e.exports=function(e){var t={};t.src_Any=n(17).source,t.src_Cc=n(18).source,t.src_Z=n(19).source,t.src_P=n(6).source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join('|'),t.src_ZCc=[t.src_Z,t.src_Cc].join('|');var o='[><\uFF5C]';return t.src_pseudo_letter='(?:(?!'+o+'|'+t.src_ZPCc+')'+t.src_Any+')',t.src_ip4='(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)',t.src_auth='(?:(?:(?!'+t.src_ZCc+'|[@/\\[\\]()]).)+@)?',t.src_port='(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?',t.src_host_terminator='(?=$|'+o+'|'+t.src_ZPCc+')(?!-|_|:\\d|\\.-|\\.(?!$|'+t.src_ZPCc+'))',t.src_path='(?:[/?#](?:(?!'+t.src_ZCc+'|'+o+'|[()[\\]{}.,"\'?!\\-]).|\\[(?:(?!'+t.src_ZCc+'|\\]).)*\\]|\\((?:(?!'+t.src_ZCc+'|[)]).)*\\)|\\{(?:(?!'+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+t.src_ZCc+'|[\']).)+\\\'|\\\'(?='+t.src_pseudo_letter+'|[-]).|\\.{2,3}[a-zA-Z0-9%/]|\\.(?!'+t.src_ZCc+'|[.]).|'+(e&&e['---']?'\\-(?!--(?:[^-]|$))(?:-*)|':'\\-+|')+'\\,(?!'+t.src_ZCc+').|\\!(?!'+t.src_ZCc+'|[!]).|\\?(?!'+t.src_ZCc+'|[?]).)+|\\/)?',t.src_email_name='[\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]+',t.src_xn='xn--[a-z0-9\\-]{1,59}',t.src_domain_root='(?:'+t.src_xn+'|'+t.src_pseudo_letter+'{1,63})',t.src_domain='(?:'+t.src_xn+'|(?:'+t.src_pseudo_letter+')|(?:'+t.src_pseudo_letter+'(?:-(?!-)|'+t.src_pseudo_letter+'){0,61}'+t.src_pseudo_letter+'))',t.src_host='(?:(?:(?:(?:'+t.src_domain+')\\.)*'+t.src_domain+'))',t.tpl_host_fuzzy='(?:'+t.src_ip4+'|(?:(?:(?:'+t.src_domain+')\\.)+(?:%TLDS%)))',t.tpl_host_no_ip_fuzzy='(?:(?:(?:'+t.src_domain+')\\.)+(?:%TLDS%))',t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test='localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:'+t.src_ZPCc+'|>|$))',t.tpl_email_fuzzy='(^|'+o+'|\\(|'+t.src_ZCc+')('+t.src_email_name+'@'+t.tpl_host_fuzzy_strict+')',t.tpl_link_fuzzy='(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|'+t.src_ZPCc+'))((?![$+<=>^`|\uFF5C])'+t.tpl_host_port_fuzzy_strict+t.src_path+')',t.tpl_link_no_ip_fuzzy='(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|'+t.src_ZPCc+'))((?![$+<=>^`|\uFF5C])'+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+')',t}},function(e,o,r){(function(e,i){var a;(function(s){function l(e){throw new RangeError(N[e])}function d(e,t){for(var n=e.length,o=[];n--;)o[n]=t(e[n]);return o}function c(e,t){var n=e.split('@'),o='';1=r&&n>>10),e=56320|1023&e),t+=D(e),t}).join('')}function m(e){return 10>e-48?e-22:26>e-65?e-65:26>e-97?e-97:v}function g(e,t){return e+22+75*(26>e)-((0!=t)<<5)}function h(e,t,n){var o=0;for(e=n?L(e/T):e>>1,e+=L(e/t);e>V*C>>1;o+=v)e=L(e/V);return L(o+(V+1)*e/(e+A))}function f(e){var o=[],r=e.length,a=0,i=P,n=E,s,d,c,p,g,f,b,_,k,t;for(d=e.lastIndexOf(S),0>d&&(d=0),c=0;c=r&&l('invalid-input'),_=m(e.charCodeAt(p++)),(_>=v||_>L((y-a)/f))&&l('overflow'),a+=_*f,k=b<=n?x:b>=n+C?C:b-n,_L(y/t)&&l('overflow'),f*=t}s=o.length+1,n=h(a-g,s,0==g),L(a/s)>y-i&&l('overflow'),i+=L(a/s),a%=s,o.splice(a++,0,i)}return u(o)}function b(e){var o=[],r,n,i,a,s,d,c,u,m,f,t,b,_,k,w;for(e=p(e),b=e.length,r=P,n=0,s=E,d=0;dt&&o.push(D(t));for(i=a=o.length,a&&o.push(S);i=r&&tL((y-n)/_)&&l('overflow'),n+=(c-r)*_,r=c,d=0;dy&&l('overflow'),t==r){for(u=n,m=v;;m+=v){if(f=m<=s?x:m>=s+C?C:m-s,u= 0x80 (not a basic code point)',"invalid-input":'Invalid input'},V=v-x,L=t,D=n,F;F={version:'1.4.1',ucs2:{decode:p,encode:u},decode:f,encode:b,toASCII:function(e){return c(e,function(e){return O.test(e)?'xn--'+b(e):e})},toUnicode:function(e){return c(e,function(e){return R.test(e)?f(e.slice(4).toLowerCase()):e})}};a=function(){return F}.call(o,r,o,e),!(void 0!==a&&(e.exports=a))})(this)}).call(o,r(156)(e),r(5))},function(e){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],!e.children&&(e.children=[]),Object.defineProperty(e,'loaded',{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,'id',{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e){'use strict';e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:'language-',linkify:!1,typographer:!1,quotes:'\u201C\u201D\u2018\u2019',highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}}},function(e){'use strict';e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:'language-',linkify:!1,typographer:!1,quotes:'\u201C\u201D\u2018\u2019',highlight:null,maxNesting:20},components:{core:{rules:['normalize','block','inline']},block:{rules:['paragraph']},inline:{rules:['text'],rules2:['balance_pairs','text_collapse']}}}},function(e){'use strict';e.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:'language-',linkify:!1,typographer:!1,quotes:'\u201C\u201D\u2018\u2019',highlight:null,maxNesting:20},components:{core:{rules:['normalize','block','inline']},block:{rules:['blockquote','code','fence','heading','hr','html_block','lheading','list','reference','paragraph']},inline:{rules:['autolink','backticks','emphasis','entity','escape','html_inline','image','link','newline','text'],rules2:['balance_pairs','emphasis','text_collapse']}}}}])['default']}); \ No newline at end of file +(function(e){e.en=Object.assign(e.en||{},{a:'Cannot upload file:',b:'Bold',c:'Italic',d:'Block quote',e:'Choose heading',f:'Heading',g:'image widget',h:'Full size image',i:'Side image',j:'Left aligned image',k:'Centered image',l:'Right aligned image',m:'Insert image',n:'Upload failed',o:'Numbered List',p:'Bulleted List',q:'Insert table',r:'Header column',s:'Insert column before',t:'Insert column after',u:'Delete column',v:'Column',w:'Header row',x:'Insert row below',y:'Insert row above',z:'Delete row',aa:'Row',ab:'Merge cell up',ac:'Merge cell right',ad:'Merge cell down',ae:'Merge cell left',af:'Split cell vertically',ag:'Split cell horizontally',ah:'Merge cells',ai:'Enter image caption',aj:'Link',ak:'Upload in progress',al:'Rich Text Editor',am:'Rich Text Editor, %0',an:'Undo',ao:'Redo',ap:'Unlink',aq:'Edit link',ar:'Open link in new tab',as:'This link has no URL',at:'Save',au:'Cancel',av:'Link URL',aw:'Change image text alternative',ax:'Paragraph',ay:'Heading 1',az:'Heading 2',ba:'Heading 3',bb:'Text alternative'})})(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=7)}([function(e,t,n){function o(e,t){for(var n=0;n'},function(e){e.exports=''},function(e,t,n){var o=n(63);'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(t,n,o){'use strict';function i(e){const t=e.match(/^([^:]+):/);return t?e+` Read more: ${al}#error-${t[1]}\n`:e}function r(){let e='e';for(let t=0;8>t;t++)e+=$s(65536*(1+Math.random())).toString(16).substring(1);return e}function a(e,t){return e[ul]&&e[ul][t]?e[ul][t].emitter:null}function s(e,t){e[ml]||(e[ml]=t||r())}function l(e){return e[ml]}function d(e){return e._events||Object.defineProperty(e,'_events',{value:{}}),e._events}function c(){return{callbacks:[],childEvents:[]}}function p(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 u(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 M(e){return'string'==typeof e?[new Bc(e)]:(E(e)||(e=[e]),Array.from(e).map((e)=>'string'==typeof e?new Bc(e):e instanceof Lc?new Bc(e.data):e))}function B(){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(!vl(n))return!1;var o=typeof t;return!('number'==o?!(dd(n)&&xd(t,n.length)):!('string'==o&&t in n))&&fl(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){vp in e||(Object.defineProperty(e,vp,{value:new Map}),Object.defineProperty(e,yp,{value:new Map}),Object.defineProperty(e,xp,{value:new Map}))}function q(...e){const t=K(...e),n=Array.from(this._bindings.keys()),o=n.length;if(!t.callback&&1{if(e.properties.length&&e.properties.length!==o)throw new sl('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),$(this),this._bindProperties.forEach((e)=>{J(this._observable,e)})}function H(e,t,n){if(1[e,t]);return Array.prototype.concat.apply([],n)}function U(e){return e.every((e)=>'string'==typeof e)}function K(...e){if(!e.length)throw new sl('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 sl('observable-bind-to-parse-error: Invalid argument syntax in `to()`.')}),t}function G(e,t,n,o){const i=e[yp],r=i.get(n),a=r||{};a[o]||(a[o]=new Set),a[o].add(t),r||i.set(n,a)}function $(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]),G(e._observable,n,i.observable,t)})})}function J(e,t){const n=e[xp],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[yp];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?Up.alt:0)+(e.ctrlKey?Up.ctrl:0)+(e.shiftKey?Up.shift:0);else if(t=Up[e.toLowerCase()],!t)throw new sl('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 qp.isMac?re(e).map((e)=>Wp[e.toLowerCase()]||e).reduce((e,t)=>e.slice(-1)in Hp?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==Up.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 Bc(e)]:(E(e)||(e=[e]),Array.from(e).map((e)=>'string'==typeof e?new Bc(e):e instanceof Lc?new Bc(e.data):e))}function ce(e){return Array.from(e.getChildren()).some((e)=>!e.is('uiElement'))}function pe(e){let t=e.parent;for(;!ke(t);){if(!t)return;t=t.parent}return t}function ue(e,t){if(e.priorityt.priority)&&e.getIdentity()t instanceof e))throw new sl('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=pe(e.start),n=pe(e.end);if(!t||!n||t!==n)throw new sl('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,Xp)===Zp}function ye(e){return e.data.length==Xp&&ve(e)}function xe(e){return ve(e)?e.data.slice(Xp):e.data}function Ce(e,t){let n=eu.get(t);return n||(n=t(window.document),eu.set(t,n)),e.isEqualNode(n)}function Ae(e){e.document.on('keydown',Te)}function Te(e,t){if(t.keyCode==Up.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<=Xp&&e.collapse(t,0)}}}function Pe(e,t,o){function i(n){const i=(c[n-1]===void 0?-1:c[n-1])+1,p=c[n+1]===void 0?-1:c[n+1],u=i>p?-1:1;d[n+u]&&(d[n]=d[n+u].slice(0)),d[n]||(d[n]=[]),d[n].push(i>p?r:a);let m=Ks(i,p),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=Ne(e,t),o=Fe(e,n),i=Fe(t,n),r=Ne(o,i),a=e.length-r,s=t.length-r;return{firstIndex:n,lastIndexOld:a,lastIndexNew:s}}function Ne(e,t){for(let n=0;ne.hasAttribute('contenteditable'));return!t||'true'==t.getAttribute('contenteditable')}function Be(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 He(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 We(e,t){for(;e&&e!=nu.document;)t(e),e=e.parentNode}function Ue(e){return'[object Window]'==Object.prototype.toString.apply(e)}function Ke(e){return e['data-ck-expando']||(e['data-ck-expando']=r())}function Ge(e){var t=-1,n=e?e.length:0;for(this.__data__=new Gl;++t=t||0>n||h&&o>=_}function s(){var e=Vu();return a(e)?l(e):void(v=setTimeout(s,r(e)))}function l(e){return(clearTimeout(v),v=void 0,f&&b)?o(e):(b=k=void 0,w)}function d(){void 0!==v&&clearTimeout(v),u=m=0,b=k=v=void 0}function c(){return void 0===v?w:l(Vu())}function p(){var e=Vu(),n=a(e);if(b=arguments,k=this,u=e,n){if(void 0===v)return i(u);if(h)return clearTimeout(v),v=setTimeout(s,t),o(u)}return void 0===v&&(v=setTimeout(s,t)),w}var u=0,m=0,g=!1,h=!1,f=!0,b,k,_,w,v;if('function'!=typeof e)throw new TypeError(Nu);return t=ep(t)||0,vl(n)&&(g=!!n.leading,h='maxWait'in n,_=h?Fu(ep(n.maxWait)||0,t):_,f='trailing'in n?!!n.trailing:f),p.cancel=d,p.flush=c,p}function Ye(e){return e==Up.arrowright||e==Up.arrowleft||e==Up.arrowup||e==Up.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 Uu)e[n]=t[n]}function tt(e){return!!ou(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?pt(e):pt(i),rt(r,()=>ut(e,o));const a=ut(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 Wu(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 Wu(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 pt(e){if(Xe(e)){let t=e.commonAncestorContainer;return Oe(t)&&(t=t.parentNode),t}return e.parentNode}function ut(e,t){const n=ct(e),o=new Wu(e);if(n===t)return o;for(let i=n;i!=t;){const e=i.frameElement,t=new Wu(e).excludeScrollbarsAndBorders();o.moveBy(t.left,t.top),i=i.parent}return o}function mt(e){return il(e)?P(e):new Map(e)}function gt(e){return'string'==typeof e?[new $u(e)]:(E(e)||(e=[e]),Array.from(e).map((e)=>'string'==typeof e?new $u(e):e instanceof Ju?new $u(e.data,e.getAttributes()):e))}function ht(e,t,n,o,i){return{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:o,length:i}}}function ft(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=tm.createFromPositionAndShift(e.position,e.nodes.maxOffset):(o=tm.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=tm.createFromRanges(s),d=!l.isEqual(this),c=this.containsPosition(a),p=i&&(this.containsPosition(i)||this.start.isEqual(i));if(d){const e=tm.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||p)&&this.fire('change:content',tm.createFromRange(this),{type:t,batch:n,range:o,sourcePosition:i})}function yt(e){return e instanceof Ju||e instanceof $u?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(sm));for(const o of t)e.removeAttribute(o,n)})}}function Ct(e){return e=cm(e),e.view=Pt(e.view,'container'),(t)=>{t.on('insert:'+e.model,Rt(e.view),{priority:e.converterPriority||'normal'})}}function At(e){e=cm(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,Ft(o),{priority:e.converterPriority||'normal'})}}function Tt(e){e=cm(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,Nt(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||Bp.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 Ip(o,r),s=n.writer.remove(a.getTrimmed());for(const o of Ip.createIn(s).getItems())n.mapper.unbindViewElement(o)}}function Nt(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 Ft(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 rm||n.item instanceof lm)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 rm,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 Mt(){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 Bt(){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 Ht(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 Wt(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 Kt(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 Gt(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 $t(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=tm.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=em.createBefore(i);o.has(e)?o.get(e).end=em.createFromPosition(n):o.set(e,new tm(em.createFromPosition(n))),t.remove(i)}return o}function rn(e,t){let n;for(const o of new km(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=em.createAt(i)}return n}function an(e){e=cm(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=cm(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=cm(e);let t=null;('string'==typeof e.view||e.view.key)&&(t=un(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 zc(e.view);return(n,o,i)=>{const r=t.match(o.viewItem);if(r){r.match.name=!0;const t=pn(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,em.createAt(t));i.consumable.consume(o.viewItem,r.match),o.modelRange=new tm(em.createBefore(t),em.createAfter(n.modelCursor.parent)),o.modelCursor=e.cursorParent?em.createAt(e.cursorParent):o.modelRange.end}}}}}function pn(e,t,n){return e instanceof Function?e(t,n):n.createElement(e)}function un(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 zc(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&&(hn(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=fn(o.modelRange,{key:t,value:n},i);e&&i.consumable.consume(o.viewItem,r.match)}}}}function hn(e){return!!('object'!=typeof e.view||dn(e))&&!e.view.classes&&!e.view.attributes&&!e.view.styles}function fn(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=tm.createFromPositionAndShift(t.modelCursor,e.offsetSize),t.modelCursor=t.modelRange.end}}}function _n(e){const t=[],n=e.root.document;if(!n)return[];const o=tm.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 $u(e)]:(E(e)||(e=[e]),Array.from(e).map((e)=>'string'==typeof e?new $u(e):e instanceof Ju?new $u(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 tm(e,e.getShiftedBy(n))}function An(e){if(!e.isFlat)throw new sl('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 sl('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 Bm;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=tm.createFromPositionAndShift(e.position,e.nodes.maxOffset):(t=tm.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=tm.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=em.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 rf(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 lm?o.setSelection(a):n.setTo(a):zu.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=of.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 lm?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=em.createAfter(o),n=em.createBefore(i),n.isEqual(t)||e.insert(i,t),e.merge(t);n.parent.isEmpty;){const t=n.parent;n=em.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 tm(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 lm?e.setSelection(o,0):n.setTo(o,0)}function To(e,t){const n=e.model.schema.getLimitElement(t);e.remove(tm.createIn(n)),Ao(e,em.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 Xu({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 lm?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 em.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;ho(o,i)||'character'==t&&fo(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)&&!No(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);af.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=em.createAt(n,t?'end':0);return t?new tm(e,o):new tm(o,e)}function Vo(e,t,n){const o=t+(n?0:-1);return af.includes(e.charAt(o))}function No(e,t,n){return t===(n?e.endOffset:0)}function Fo(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:tm.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,em.createAt(n,0),l)[0],i=new tm(em.createAt(n),t.start),r=new tm(t.end,em.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)=>tm.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=tm.createOn(n);n=n.parent,t.remove(e)}})}function Mo(e){e.document.registerPostFixer((t)=>Bo(t,e))}function Bo(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=Ho(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 tm(i,em.createAfter(i.nodeAfter)):new tm(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 tm(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?em.createBefore(o):em.createAfter(o)}function Ho(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 tm(e,i);t.splice(t.indexOf(n),1,r),n=r;continue}n=o,t.push(o)}return t}function Wo(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 bf))}function Ko(e,t){return e.map((e)=>e instanceof bf?e.getValue(t):e)}function Go(e,t,{node:n}){let o=Ko(e,n);o=1==e.length&&e[0]instanceof _f?o[0]:o.reduce(ii,''),si(o)?t.remove():t.set(o)}function $o(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=hf(e,(e)=>{if(e&&(e instanceof bf||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 ff(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 sl('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 yf}function di(e){return e instanceof ff}function ci(e){return e instanceof gf}function pi(){return{children:[],bindings:[],attributes:{}}}function ui(e){return'class'==e||'style'==e}function mi(e){for(;e&&'html'!=e.tagName.toLowerCase();){if('static'!=nu.window.getComputedStyle(e).position)return e;e=e.parentElement}return null}function gi({element:e,target:t,positions:n,limiter:o,fitInViewport:i}){Cl(t)&&(t=t()),Cl(o)&&(o=o());const r=mi(e.parentElement),a=new Wu(e),s=new Wu(t);let l,d;if(!o&&!i)[d,l]=hi(n[0],s,a);else{const e=o&&new Wu(o).getVisible(),t=i&&new Wu(nu.window);[d,l]=fi(n,s,a,e,t)||hi(n[0],s,a)}let{left:c,top:p}=bi(l);if(r){const e=bi(new Wu(r)),t=Ze(r);c-=e.left,p-=e.top,c+=r.scrollLeft,p+=r.scrollTop,c-=t.left,p-=t.top}return{left:c,top:p,name:d}}function hi(e,t,n){const{left:o,top:i,name:r}=e(t,n);return[r,n.clone().moveTo(o,i)]}function fi(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=u,l=p}const[p,u]=hi(e,t,n);let m,g;if(o)if(i){const e=o.getIntersection(i);m=e?e.getIntersectionArea(u):0}else m=o.getIntersectionArea(u);return i&&(g=i.getIntersectionArea(u)),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}=nu.window;return{left:e+n,top:t+o}}function ki(e){return(t)=>t+e}function _i(e){return ou(e)?e:Xe(e)?e.commonAncestorContainer:'function'==typeof e?_i(e()):null}function wi(e,t){return e.top-t.height-Pf.arrowVerticalOffset}function vi(e){return e.bottom+Pf.arrowVerticalOffset}function yi(e){return!!(e.focus&&'none'!=nu.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=Pf.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(!Cl(e.updateElement))throw new sl('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();Cl(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 Ni(e){return e.replace(/(\s+)<\/span>/g,(e,t)=>1==t.length?' ':t)}function Fi(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=Fi(o);n&&(n.is('containerElement')||o.is('containerElement'))&&(pb.includes(n.name)||pb.includes(o.name)?t+='\n':t+='\n\n'),t+=e,n=o}}return t}function Di(e){e.return=!1,e.stop()}function Mi(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)Bi(t,n,r.start);else{const o=!(r.start.isAtStart&&r.end.isAtEnd);e.deleteContent(n,{leaveUnmerged:o}),o&&(a==s?Bi(t,n,n.focus):t.setSelection(s,0))}}function Bi(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 Wi(e){return!!e.ctrlKey||xb.includes(e.keyCode)}function Ui(e,t){return e instanceof Bc&&t instanceof Bc?e.data===t.data:e===t}function Ki(e){if(1==e.newChildren.length-e.oldChildren.length){const t=Pe(e.oldChildren,e.newChildren,Ui),n=Hi(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 $i(e){if(0==e.length)return!1;for(const t of e)if('children'===t.type&&!Ki(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)=>tm.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(;te.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,em.createAt(i)),t.modelRange=o.modelRange,t.modelCursor=o.modelCursor)}}}return(t)=>{t.on('element:figure',e)}}function ur(){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 mr(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 gr(e,t){return e&&t&&e.priority==t.priority&&fr(e.classes)==fr(t.classes)}function hr(e,t){if(e.priority>t.priority)return!0;return!(e.priorityfr(t.classes)}function fr(e){return Array.isArray(e)?e.sort().join(','):e}function br(e){return!!e.getCustomProperty(Mk)}function kr(e,t,n={}){function o(e){return Array.isArray(e)?e:[e]}return t.setAttribute('contenteditable','false',e),t.addClass(Lk,e),t.setCustomProperty(Mk,!0,e),e.getFillerOffset=xr,n.label&&wr(e,n.label,t),_r(e,t,(e,t,n)=>n.addClass(o(t.classes),e),(e,t,n)=>n.removeClass(o(t.classes),e)),e}function _r(e,t,n,o){const i=new Dk;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 wr(e,t,n){n.setCustomProperty(Bk,t,e)}function vr(e){const t=e.getCustomProperty(Bk);return t?'function'==typeof t?t():t:''}function yr(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 xr(){return null}function Cr(e,t,n){return t.setCustomProperty(jk,!0,e),kr(e,t,{label:function(){const t=e.getChild(0),o=t.getAttribute('alt');return o?`${o} ${n}`:n}})}function Ar(e){return!!e.getCustomProperty(jk)&&br(e)}function Tr(e){const t=e.getSelectedElement();return!!(t&&Ar(t))}function Pr(e){return e instanceof Yu&&'image'==e.name}function Er(e){const t=e.createEmptyElement('img'),n=e.createContainerElement('figure',{class:'image'});return e.insert(Rp.createAt(n),t),n}function Sr(e){return e==Up.arrowright||e==Up.arrowleft||e==Up.arrowup||e==Up.arrowdown}function Or(e){return ne(e)==Kk}function Rr(e){for(;e;){if(e instanceof Pp&&!(e instanceof Sp))return!0;e=e.parent}return!1}function Ir({emitter:e,activator:t,callback:n,contextElements:o}){e.listenTo(document,'mousedown',(e,{target:i})=>{if(t()){for(const e of o)if(e.contains(i))return;n()}})}function Vr({view:e}){e.listenTo(e.element,'submit',(t,n)=>{n.preventDefault(),e.fire('submit')},{useCapture:!0})}function Nr(e){const t=e.plugins.get('ContextualBalloon');if(Tr(e.editing.view.document.selection)){const n=Fr(e);t.updatePosition(n)}}function Fr(e){const t=e.editing.view,n=Pf.defaultPositions;return{target:t.domConverter.viewToDom(t.document.selection.getSelectedElement()),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}}function Dr(e){const t=/^image\/(jpeg|png|gif|bmp)$/;return t.test(e.type)}function Mr(e){const t=e.getSelectedElement();if(t)return em.createAfter(t);const n=e.getSelectedBlocks().next().value;if(n){if(n.isEmpty)return em.createAt(n);const t=em.createAfter(n);return e.focus.isTouching(t)?t:em.createBefore(n)}return e.focus}function Br(e,t){e.hasClass('ck-appear')||t.addClass('ck-appear',e)}function Lr(e,t){t.removeClass('ck-appear',e)}function zr(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 jr(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 qr(e,t,n,o){const i=Ur(t);t.insert(Rp.createAt(e,'end'),i),n.on('change:uploadedPercent',(e,t,n)=>{o.change((e)=>{e.setStyle('width',n+'%',i)})})}function Hr(e,t){const n=Kr(e);n&&t.remove(Ip.createOn(n))}function Wr(e,t,n){const o=new Kp('div',{class:'ck-image-upload-complete-icon'});t.insert(Rp.createAt(e,'end'),o),setTimeout(()=>{n.change((e)=>e.remove(Ip.createOn(o)))},3e3)}function Ur(e){const t=e.createUIElement('div',{class:'ck-progress-bar'});return e.setCustomProperty(T_,!0,t),t}function Kr(e){for(const t of e.getChildren())if(t.getCustomProperty(T_))return t}function Gr(e){return Array.from(e.types).includes('text/html')&&''!==e.getData('text/html')}function $r(e,t){return t.checkChild(e.parent,'paragraph')&&!t.isObject(e)}function Jr(e,t,n){const o=n.writer.createElement('paragraph');return n.writer.insert(o,t),n.convertItem(e,em.createAt(o))}function Qr(e,t,n){const o=new km(t);return!!n.checkChild(o,'paragraph')&&!!n.checkChild(o.push('paragraph'),e)}function Yr(e,t,n){return n.checkChild(e.parent,t)&&!n.isObject(e)}function Xr(e,t=W_){const n=new t(e),o=new B_(e),i=new j_(e,n,o);return n.bind('isEnabled').to(i),n instanceof W_?n.bind('isOn').to(i,'isOpen'):n.arrowView.bind('isOn').to(i,'isOpen'),ea(i),i}function Zr(e,t){const n=e.locale,o=e.listView=new G_(n);o.items.bindTo(t).using((e)=>{let t;return e.isSeparator?t=new J_(n):(t=new $_(n),t.bind(...Object.keys(e)).to(e)),t}),e.panelView.children.add(o),o.items.delegate('execute').to(e)}function ea(e){ta(e),na(e),oa(e)}function ta(e){e.on('render',()=>{Ir({emitter:e,activator:()=>e.isOpen,callback:()=>{e.isOpen=!1},contextElements:[e.element]})})}function na(e){e.on('execute',()=>{e.isOpen=!1})}function oa(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 ia(e){const n=e.t,t={Paragraph:n('ax'),"Heading 1":n('ay'),"Heading 2":n('az'),"Heading 3":n('ba')};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 ra(e,t,n,o){const i=e.document;aw.has(i)||(aw.set(i,new Map),i.registerPostFixer((e)=>aa(i,e))),aw.get(i).set(t,{placeholderText:n,checkFunction:o}),e.render()}function aa(e,t){const n=aw.get(e);let o=!1;for(const[i,r]of n)sa(t,i,r)&&(o=!0);return o}function sa(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 la(e,t){return(n)=>{const o=n.createEditableElement('figcaption');return n.setCustomProperty(sw,!0,o),ra(e,o,t),yr(o,n)}}function da(e){for(const t of e.getChildren())if(t instanceof Yu&&'caption'==t.name)return t;return null}function ca(e){const t=e.parent;return'figcaption'==e.name&&t&&'figure'==t.name&&t.hasClass('image')?{name:!0}:null}function pa(e,t=!0){return(n,o,i)=>{const r=o.item;if((r.childCount||t)&&Pr(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),ua(n,o.item,t,i)}}}function ua(e,t,n,o){const i=Rp.createAt(n,'end');o.writer.insert(i,e),o.mapper.bindElements(t,e)}function ma(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 ga(e,t){return!(e.childCount||e.hasClass('ck-hidden'))&&(t.addClass('ck-hidden',e),!0)}function ha(e,t){return!!e.hasClass('ck-hidden')&&(t.removeClass('ck-hidden',e),!0)}function fa(e){return(t,n,o)=>{if(o.consumable.consume(n.item,t.name)){const t=ka(n.attributeNewValue,e),i=ka(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 ba(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 ka(e,t){for(const n of t)if(n.name===e)return n}function _a(e=[]){return e.map(wa).map((e)=>Object.assign({},e))}function wa(e){if('string'==typeof e){const t=e;vw[t]?e=Object.assign({},vw[t]):(zu.warn('image-style-not-found: There is no such image style of given name.',{name:t}),e={name:t})}else if(vw[e.name]){const t=vw[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&&yw[e.icon]&&(e.icon=yw[e.icon]),e}function va(e,t){for(const n of e)t[n.title]&&(n.title=t[n.title]);return e}function ya(e,t){return new tm(xa(e,t,!0),xa(e,t,!1))}function xa(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?em.createAt(i,n?'before':'after'):e}function Ca(e){return e.is('attributeElement')&&!!e.getCustomProperty(Rw)}function Aa(e,t){const n=t.createAttributeElement('a',{href:e},{priority:5});return t.setCustomProperty(Rw,!0,n),n}function Ta(e){return e+='',Pa(e)?e:'#'}function Pa(e){const t=e.replace(Iw,'');return t.match(Vw)}function Ea(e,t,n,o){const i=new Nw(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==Up.arrowright,o=t.keyCode==Up.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:pl.get('high')+1})}function Sa(e,t){return Oa(e,t)||Ra(e,t)}function Oa(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 Ra(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 Ia(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 Va(e,t){return Sa(e.getShiftedBy(-1),t)}function Na(e){return e.getAncestors().find((e)=>Ca(e))}function Fa(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 Da(e,t){return t.checkChild(e.parent,'listItem')&&!t.isObject(e)}function Ma(e){const t=e.createContainerElement('li');return t.getFillerOffset=Ba,t}function Ba(){const e=!this.isEmpty&&('ul'==this.getChild(0).name||'ol'==this.getChild(0).name);return this.isEmpty||e?0:null}function La(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=Xa(e,n);ts(e,i,n)}}function za(e,t,n){const o=n.mapper.toViewPosition(t.position).getLastMatchingPosition((e)=>!e.item.is('li')),i=o.nodeAfter,r=n.writer;r.breakContainer(Rp.createBefore(i)),r.breakContainer(Rp.createAfter(i));const a=i.parent,s=a.previousSibling,l=Ip.createOn(a),d=r.remove(l);s&&s.nextSibling&&es(r,s,s.nextSibling);const c=n.mapper.toModelElement(i);ns(c.getAttribute('listIndent')+1,t.position,l.start,i,n);for(const o of Ip.createIn(d).getItems())n.mapper.unbindViewElement(o);e.stop()}function ja(e,t,n){if(!n.consumable.consume(t.item,'attribute:listType'))return;const o=n.mapper.toViewElement(t.item),i=n.writer;i.breakContainer(Rp.createBefore(o)),i.breakContainer(Rp.createAfter(o));let r=o.parent;const a='numbered'==t.attributeNewValue?'ol':'ul';r=i.rename(r,a),es(i,r,r.nextSibling),es(i,r.previousSibling,r);for(const o of t.item.getChildren())n.consumable.consume(o,'insert')}function qa(e,t,n){if(n.consumable.consume(t.item,'attribute:listIndent')){const e=n.mapper.toViewElement(t.item),o=n.writer;o.breakContainer(Rp.createBefore(e)),o.breakContainer(Rp.createAfter(e));const i=e.parent,r=i.previousSibling,a=Ip.createOn(i);o.remove(a),r&&r.nextSibling&&es(o,r,r.nextSibling),ns(t.attributeOldValue+1,t.range.start,a.start,e,n),ts(t.item,e,n);for(const e of t.item.getChildren())n.consumable.consume(e,'insert')}}function Ha(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=Rp.createAt(e.parent,'end');if(!t.isEqual(n)){const e=o.remove(new Ip(t,n));r.push(e)}e=Rp.createAfter(e.parent)}if(0e.is('ul')||e.is('ol')),i=new Op({startPosition:Rp.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 Ja(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=em.createBefore(e)}else{const e=i.toModelElement(n.nodeBefore),o=i.getModelLength(n.nodeBefore);t.modelPosition=em.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=em.createBefore(r).getShiftedBy(a),e.stop()}}function Qa(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 Ya(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 es(e,t,n){return t&&n&&('ul'==t.name||'ol'==t.name)&&t.name==n.name?e.mergeContainers(Rp.createAfter(t)):null}function ts(e,t,n){const o=t.parent,i=n.mapper,r=n.writer;let a=i.toViewPosition(em.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(Rp.createAfter(e))}else a=l&&'listItem'==l.name?i.toViewPosition(em.createAt(l,'end')):i.toViewPosition(em.createBefore(e));if(a=os(a),r.insert(a,o),l&&'listItem'==l.name){const e=i.toViewElement(l),n=new Op({boundaries:new Ip(Rp.createAt(e,0),a),ignoreElementEnd:!0});for(const e of n)if(e.item.is('li')){const o=r.breakContainer(Rp.createBefore(e.item)),i=e.item.parent,a=Rp.createAt(t,'end');es(r,a.nodeBefore,a.nodeAfter),r.move(Ip.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(Rp.createAfter(o)),r.move(Ip.createOn(o.parent),Rp.createAt(t,'end')))}}es(r,o,o.nextSibling),es(r,o.previousSibling,o)}function ns(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=Rp.createAfter(e)}else{const e=em.createAt(r,'end');d=a.toViewPosition(e)}d=os(d);for(const r of[...o.getChildren()])(r.is('ul')||r.is('ol'))&&(d=s.move(Ip.createOn(r),d).end,es(s,r,r.nextSibling),es(s,r.previousSibling,r))}function os(e){return e.getLastMatchingPosition((e)=>e.item.is('uiElement'))}function is(e){let t=1;for(const n of e.getChildren())if('ul'==n.name||'ol'==n.name)for(const e of n.getChildren())t+=is(e);return t}function rs(){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}=as(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,em.createAt(l,'end')));else{const e=n.writer.createElement('tableRow');n.writer.insert(e,em.createAt(l,'end')),n.writer.insertElement('tableCell',em.createAt(e,'end'))}t.modelRange=new tm(em.createBefore(l),em.createAfter(l)),t.modelCursor=d.cursorParent?em.createAt(d.cursorParent):t.modelRange.end},{priority:'normal'})}}function as(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=ss(e,t,i);n>t.headingColumns&&(t.headingColumns=n)}}return t.rows=[...n,...o],t}function ss(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 cs(e,t){return t.setCustomProperty(pv,!0,e),kr(e,t)}function ps(e){return!!e.getCustomProperty(pv)&&br(e)}function us(e){const t=e.getSelectedElement();return!!(t&&ps(t))}function ms(e){const t=ls(e.getFirstPosition());return!!(t&&ps(t.parent))}function gs(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(Rp.createAt(a),s);let l;r&&(l=cs(a,o.writer));const d=new cv(i),c={headingRows:i.getAttribute('headingRows')||0,headingColumns:i.getAttribute('headingColumns')||0};for(const r of d){const{row:t,cell:n}=r,a=Ts(As(t,c),s,o),l=i.getChild(t),d=xs(l,t,a,o);o.consumable.consume(n,'insert');const p=Rp.createAt(d,'end');ys(r,c,p,o,e)}const p=o.mapper.toViewPosition(n.range.start);o.mapper.bindElements(i,r?l:a),o.writer.insert(p,r?l:a)},{priority:'normal'})}function hs(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 cv(t,{startRow:a,endRow:a}),l={headingRows:t.getAttribute('headingRows')||0,headingColumns:t.getAttribute('headingColumns')||0};for(const t of s){const n=Ts(As(a,l),r,o),s=xs(i,a,n,o);o.consumable.consume(t.cell,'insert');const d=Rp.createAt(s,'end');ys(t,l,d,o,e)}}},{priority:'normal'})}function fs(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 cv(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=Rp.createAt(r,t.getChildIndex(i));return void ys(n,s,a,o,e)}}},{priority:'normal'})}function bs(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=Ts('thead',s,o);Os(e,n,o,'end');for(const n of e)for(const e of n.getChildren())ws(e,'th',o,t);Ss('tbody',s,o)}else{const e=Array.from(r.getChildren()).filter(({index:e})=>i(e,d-1,l)).reverse(),n=Ts('tbody',s,o);Os(e,n,o);const a=new cv(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)vs(e,c,o,t);Ss('thead',s,o)}},{priority:'normal'})}function ks(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 cv(i))n.column>s||vs(n,e,o,t)}},{priority:'normal'})}function _s(){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=Ip.createOn(i),s=n.writer.remove(a);for(const o of Ip.createIn(s).getItems())n.mapper.unbindViewElement(o);r.childCount||n.writer.remove(Ip.createOn(r))},{priority:'higher'})}function ws(e,t,n,o){const i=n.mapper.toViewElement(e);let r;if(o){const e=n.writer.createEditableElement(t,i.getAttributes());r=yr(e,n.writer),n.writer.insert(Rp.createAfter(i),r),n.writer.move(Ip.createIn(i),Rp.createAt(r)),n.writer.remove(Ip.createOn(i))}else r=n.writer.rename(i,t);n.mapper.bindElements(e,r)}function vs(e,t,n,o){const{cell:i}=e,r=Cs(e,t),a=n.mapper.toViewElement(i);a&&a.name!==r&&ws(i,r,n,o)}function ys(e,t,n,o,i){const r=i&&i.asWidget,a=Cs(e,t),s=r?yr(o.writer.createEditableElement(a),o.writer):o.writer.createContainerElement(a),l=e.cell;o.mapper.bindElements(l,s),o.writer.insert(n,s)}function xs(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=Rp.createAt(n,a);o.writer.insert(s,i)}return i}function Cs(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 As(e,t){return et.cell===e),c=d.column,p=l.find(({row:e,rowspan:n,column:o})=>o===c&&('down'==t?e===s:s===e+n));return p&&p.cell}function Ms(e,t,n){const o=[],i=t>n?n:0,r=new cv(e,{startRow:i,endRow:t-1});for(const{row:i,rowspan:a,cell:s}of r)1t&&o.push(s);return o}function Bs(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;1/g,'>').replace(/"/g,'"').replace(/'/g,''')}function Ws(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)):''})}var Us=Number.POSITIVE_INFINITY,Ks=Math.max,Gs=Math.min,$s=Math.floor;Object.defineProperty(n,'__esModule',{value:!0});var Js=Object.getPrototypeOf,Qs=function(e){return Js(Object(e))},Ys=function(e){var t=!1;if(null!=e&&'function'!=typeof e.toString)try{t=!!(e+'')}catch(t){}return t},Xs=function(e){return!!e&&'object'==typeof e},Zs=Object.prototype,el=Function.prototype.toString,tl=Zs.hasOwnProperty,nl=el.call(Object),ol=Zs.toString,il=function(e){if(!Xs(e)||ol.call(e)!='[object Object]'||Ys(e))return!1;var t=Qs(e);if(null===t)return!0;var n=tl.call(t,'constructor')&&t.constructor;return'function'==typeof n&&n instanceof n&&el.call(n)==nl};class rl{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(il(t))return void this._setObjectToTarget(e,t,o);const i=t.split('.');t=i.pop();for(const r of i)il(e[r])||(e[r]={}),e=e[r];return il(n)?(il(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(!il(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 al='https://docs.ckeditor.com/ckeditor5/latest/framework/guides/support/error-codes.html';class sl 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 sl}}var ll=function(){return function e(){e.called=!0}};class dl{constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=ll(),this.off=ll()}}const cl={get(e){return'number'==typeof e?e:this[e]||this.normal},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};var pl=cl;const ul=Symbol('listeningTo'),ml=Symbol('emitterId'),gl={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[ul]||(this[ul]={});const a=this[ul];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),p(e,t);const c=u(e,t),m=pl.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 hl=gl,fl=function(e,t){return e===t||e!==e&&t!==t},bl=function(e,t){for(var n=e.length;n--;)if(fl(e[n][0],t))return n;return-1},kl=Array.prototype,_l=kl.splice;b.prototype.clear=function(){this.__data__=[]},b.prototype['delete']=function(e){var t=this.__data__,n=bl(t,e);if(0>n)return!1;var o=t.length-1;return n==o?t.pop():_l.call(t,n,1),!0},b.prototype.get=function(e){var t=this.__data__,n=bl(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 wl=b,vl=function(e){var t=typeof e;return!!e&&('object'==t||'function'==t)},yl=Object.prototype,xl=yl.toString,Cl=function(e){var t=vl(e)?xl.call(e):'';return t=='[object Function]'||t=='[object GeneratorFunction]'},Al=Function.prototype.toString,Tl=function(e){if(null!=e){try{return Al.call(e)}catch(t){}try{return e+''}catch(t){}}return''},Pl=/[\\^$.*+?()[\]{}|]/g,El=/^\[object .+?Constructor\]$/,Sl=Object.prototype,Ol=Function.prototype.toString,Rl=Sl.hasOwnProperty,Il=RegExp('^'+Ol.call(Rl).replace(Pl,'\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,'$1.*?')+'$'),Vl=function(e){if(!vl(e))return!1;var t=Cl(e)||Ys(e)?Il:El;return t.test(Tl(e))},Nl=function(e,t){var n=e[t];return Vl(n)?n:void 0},Fl=Nl(Object,'create'),Dl=Fl,Ml=Object.prototype,Bl=Ml.hasOwnProperty,Ll=Object.prototype,zl=Ll.hasOwnProperty;k.prototype.clear=function(){this.__data__=Dl?Dl(null):{}},k.prototype['delete']=function(e){return this.has(e)&&delete this.__data__[e]},k.prototype.get=function(e){var t=this.__data__;if(Dl){var n=t[e];return n==='__lodash_hash_undefined__'?void 0:n}return Bl.call(t,e)?t[e]:void 0},k.prototype.has=function(e){var t=this.__data__;return Dl?t[e]!==void 0:zl.call(t,e)},k.prototype.set=function(e,t){var n=this.__data__;return n[e]=Dl&&void 0===t?'__lodash_hash_undefined__':t,this};var jl=k,ql=o(1),Hl=Nl(ql.a,'Map'),Wl=Hl,Ul=function(e){var t=typeof e;return'string'==t||'number'==t||'symbol'==t||'boolean'==t?'__proto__'!==e:null===e},Kl=function(e,t){var n=e.__data__;return Ul(t)?n['string'==typeof t?'string':'hash']:n.map};_.prototype.clear=function(){this.__data__={hash:new jl,map:new(Wl||wl),string:new jl}},_.prototype['delete']=function(e){return Kl(this,e)['delete'](e)},_.prototype.get=function(e){return Kl(this,e).get(e)},_.prototype.has=function(e){return Kl(this,e).has(e)},_.prototype.set=function(e,t){return Kl(this,e).set(e,t),this};var Gl=_;w.prototype.clear=function(){this.__data__=new wl},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 wl&&n.__data__.length==200&&(n=this.__data__=new Gl(n.__data__)),n.set(e,t),this};var $l=w,Jl=function(e,t){for(var n=-1,o=e.length;++nt||t>e.data.length)throw new sl('view-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.');if(0>n||t+n>e.data.length)throw new sl('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 zc{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=M(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),il(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 qc extends jc{constructor(e,t,n){super(e,t,n),this.getFillerOffset=B}is(e,t=null){return t?'containerElement'==e&&t==this.name||super.is(e,t):'containerElement'==e||super.is(e)}}var Hc=L,Wc=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)},Uc=Object.prototype,Kc=Uc.toString,Gc=function(e){return'symbol'==typeof e||Xs(e)&&Kc.call(e)=='[object Symbol]'},$c=0/0,Jc=/^\s+|\s+$/g,Qc=/^[-+]0x[0-9a-f]+$/i,Yc=/^0b[01]+$/i,Xc=/^0o[0-7]+$/i,Zc=parseInt,ep=function(e){if('number'==typeof e)return e;if(Gc(e))return $c;if(vl(e)){var t=Cl(e.valueOf)?e.valueOf():e;e=vl(t)?t+'':t}if('string'!=typeof e)return 0===e?e:+e;e=e.replace(Jc,'');var n=Yc.test(e);return n||Xc.test(e)?Zc(e.slice(2),n?2:8):Qc.test(e)?$c:+e},tp=1/0,np=function(e){if(!e)return 0===e?e:0;if(e=ep(e),e===tp||e===-tp){var t=0>e?-1:1;return t*17976931348623157e292}return e===e?e:0},op=function(e){var t=np(e),n=t%1;return t===t?n?t-n:t:0},ip=Ks,rp=function(e,t){if('function'!=typeof e)throw new TypeError('Expected a function');return t=ip(void 0===t?e.length-1:op(t),0),function(){for(var n=arguments,o=-1,i=ip(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[vp];if(e in this&&!n.has(e))throw new sl('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 sl('observable-bind-wrong-properties: All properties must be strings.');if(new Set(e).size!==e.length)throw new sl('observable-bind-duplicate-properties: Properties must be unique.');j(this);const t=this[xp];e.forEach((e)=>{if(t.has(e))throw new sl('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:H,_observable:this,_bindProperties:e,_to:[],_bindings:n}},unbind(...e){if(!(vp in this))return;const t=this[xp],n=this[yp];if(e.length){if(!U(e))throw new sl('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 sl('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)}}};wp(Cp,hl);var Ap=Cp;const Tp=Symbol('document');class Pp extends qc{constructor(e,t,n){super(e,t,n),this.set('isReadOnly',!1),this.set('isFocused',!1)}get document(){return this.getCustomProperty(Tp)}set _document(e){if(this.getCustomProperty(Tp))throw new sl('view-editableelement-document-already-set: View document is already set.');this._setCustomProperty(Tp,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})}}f(Pp,Ap);const Ep=Symbol('rootName');class Sp extends Pp{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(Ep)}set rootName(e){this._setCustomProperty(Ep,e)}set _name(e){this.name=e}}class Op{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new sl('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 sl('view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.',{direction:e.direction});this.boundaries=e.boundaries||null,this.position=e.startPosition?Rp.createFromPosition(e.startPosition):Rp.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=Rp.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 Bc){if(e.isAtEnd)return this.position=Rp.createAfter(n),this._next();o=n.data[e.offset]}else o=n.getChild(e.offset);if(o instanceof jc)return this.shallow?e.offset++:e=new Rp(o,0),this.position=e,this._formatReturnValue('elementStart',o,t,e,1);if(!(o instanceof Bc)){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 Lc(n,e.offset,o);return e.offset+=o,this.position=e,this._formatReturnValue('text',i,t,e,o)}return e=Rp.createAfter(n),this.position=e,this.ignoreElementEnd?this._next():this._formatReturnValue('elementEnd',n,t,e)}if(this.singleCharacters)return e=new Rp(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 Lc(o,0,n),e=Rp.createAfter(i)):(i=new Lc(o,0,o.data.length),e.offset++),this.position=e,this._formatReturnValue('text',i,t,e,n)}}_previous(){let e=Rp.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 Bc){if(e.isAtStart)return this.position=Rp.createBefore(n),this._previous();o=n.data[e.offset-1]}else o=n.getChild(e.offset-1);if(o instanceof jc)return this.shallow?(e.offset--,this.position=e,this._formatReturnValue('elementStart',o,t,e,1)):(e=new Rp(o,o.childCount),this.position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue('elementEnd',o,t,e));if(!(o instanceof Bc)){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 Lc(n,e.offset,o);return this.position=e,this._formatReturnValue('text',i,t,e,o)}return e=Rp.createBefore(n),this.position=e,this._formatReturnValue('elementStart',n,t,e,1)}if(this.singleCharacters)return e=new Rp(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 Lc(o,t,o.data.length-t),n=i.data.length,e=Rp.createBefore(i)}else i=new Lc(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 Lc&&(t.offsetInText+t.data.length==t.textNode.data.length&&('forward'!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=Rp.createAfter(t.textNode):(o=Rp.createAfter(t.textNode),this.position=o)),0===t.offsetInText&&('backward'!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=Rp.createBefore(t.textNode):(o=Rp.createBefore(t.textNode),this.position=o))),{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:o,length:i}}}}class Rp{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 Pp);)if(e.parent)e=e.parent;else return null;return e}getShiftedBy(e){const t=Rp.createFromPosition(this),n=t.offset+e;return t.offset=0>n?0:n,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const n=new Op(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 sl('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 sl('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 sl('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 sl('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]()}}f(Fp,hl);class Dp{constructor(){this.selection=new Np,this.roots=new Fp({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)}}f(Dp,Ap);const Mp=10;class Bp extends jc{constructor(e,t,n){super(e,t,n),this.getFillerOffset=Z,this._priority=Mp,this._id=null,this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new sl('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}}Bp.DEFAULT_PRIORITY=Mp;class Lp extends jc{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 Mc||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 Kp extends jc{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 Mc||0e.is('element')&&t.isSimilar(e));e&&(i=Ip.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 Bp))throw new sl('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 Ip(n)}}unwrap(e,t){if(!(t instanceof Bp))throw new sl('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 Bp&&this._unwrapAttributeElement(t,e)){const e=this.mergeAttributes(n);e.isEqual(n)||o.offset--;const t=this.mergeAttributes(o);return new Ip(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 Ip(a,s)}rename(e,t){const n=new qc(t,e.getAttributes());return this.insert(Rp.createAfter(e),n),this.move(Ip.createIn(e),Rp.createAt(n)),this.remove(Ip.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 Ip(e,e.getShiftedBy(1));this.wrap(o,t);const i=new Rp(n.parent,n.index);n._remove();const r=i.nodeBefore,a=i.nodeAfter;return r instanceof Bc&&a instanceof Bc?he(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 Ip(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 Ip(a,i)}_breakAttributes(e,t=!1){const n=e.offset,o=e.parent;if(e.parent.is('emptyElement'))throw new sl('view-writer-cannot-break-empty-element');if(e.parent.is('uiElement'))throw new sl('view-writer-cannot-break-ui-element');if(!t&&o.is('text')&&ke(o.parent))return Rp.createFromPosition(e);if(ke(o))return Rp.createFromPosition(e);if(o.is('text'))return this._breakAttributes(ge(e),t);const i=o.childCount;if(n==i){const e=new Rp(o.parent,o.index+1);return this._breakAttributes(e,t)}if(0===n){const e=new Rp(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 Rp(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 Jp=[Bc,Bp,qc,Lp,Kp],Qp=(e)=>{const t=e.createElement('br');return t.dataset.ckeFiller=!0,t},Yp=(e)=>e.createTextNode('\xA0'),Xp=7;let Zp='';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,Be).map((e)=>'equal'===e?'replace':e)),o.push('equal'),i=[],r=[]),a[s]++;return o.concat(Pe(i,r,Be).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)}}}f(tu,Ap);var nu={window,document},ou=function(e){return!!e&&1===e.nodeType&&Xs(e)&&!il(e)};class iu{constructor(e={}){this.blockFiller=e.blockFiller||Qp,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 Vp(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+=Xp),{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:Xp};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 Bc(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 Gp,t.bind&&this.bindDocumentFragments(e,n);else{const o=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();n=new jc(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 Rp(n,o)):null}if(0===t){const t=this.mapDomToView(e);if(t)return new Rp(t,0)}else{const n=e.childNodes[t-1],o=Oe(n)?this.findCorrespondingViewText(n):this.mapDomToView(n);if(o&&o.parent)return new Rp(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 Bc?e.nextSibling:null}}else{const t=this.mapDomToView(e.parentNode);if(t){const e=t.getChild(0);return e instanceof Bc?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}=nu.window,o=[];We(t,(e)=>{const{scrollLeft:t,scrollTop:n}=e;o.push([t,n])}),t.focus(),We(t,(e)=>{const[t,n]=o.shift();e.scrollLeft=t,e.scrollTop=n}),nu.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(He(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||!!ou(e)||/[^\S\u00A0]/.test(e.data.charAt(e.data.length-1))}_checkShouldRightTrimDomText(e,t){return!t&&!ve(e)}_getTouchingViewTextNode(e,t){const n=new Op({startPosition:t?Rp.createAfter(e):Rp.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&&!He(e,this.blockElements,t)&&!He(a,this.blockElements,t))return a}return null}}const ru=wp({},hl,{listenTo(e,...t){if(Re(e)||Ue(e)){const n=this._getProxyEmitter(e)||new su(e);n.attach(...t),e=n}hl.listenTo.call(this,e,...t)},stopListening(e,t,n){if(Re(e)||Ue(e)){const t=this._getProxyEmitter(e);if(!t)return;e=t}hl.stopListening.call(this,e,t,n),e instanceof su&&e.detach(t)},_getProxyEmitter(e){return a(this,Ke(e))}});var au=ru;class su{constructor(e){s(this,Ke(e)),this._domNode=e}}wp(su.prototype,hl,{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 lu{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()}}f(lu,au);Ge.prototype.add=Ge.prototype.push=function(e){return this.__data__.set(e,'__lodash_hash_undefined__'),this},Ge.prototype.has=function(e){return this.__data__.has(e)};var du=Ge,cu=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,p=!0,u=i&1?new du: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 Su(this.view,t,n))}}class Ru extends Ou{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 Iu=Date.now,Vu=Iu,Nu='Expected a function',Fu=Ks,Du=Gs,Mu=Qe;class Bu extends lu{constructor(e){super(e),this._fireSelectionChangeDoneDebounced=Mu((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 Vp(t.getRanges(),{backward:t.isBackward,fake:!1});(e==Up.arrowleft||e==Up.arrowup)&&n.setTo(n.getFirstPosition()),(e==Up.arrowright||e==Up.arrowdown)&&n.setTo(n.getLastPosition());const o={oldSelection:t,newSelection:n,domSelection:null};this.document.fire('selectionChange',o),this._fireSelectionChangeDoneDebounced(o)}}const Lu={error(e,t){console.error(i(e),t)},warn(e,t){console.warn(i(e),t)}};var zu=Lu;class ju extends lu{constructor(e){super(e),this.mutationObserver=e.getObserver(Eu),this.selection=this.document.selection,this.domConverter=e.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=Mu((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 zu.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 qu extends Ou{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 Hu extends Ou{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 Wu{constructor(e){const t=Xe(e);if(Object.defineProperty(this,'_source',{value:e._source||e,writable:!0,enumerable:!1}),ou(e)||t){const n=t?e.startContainer:e;n.ownerDocument&&n.ownerDocument.body.contains(n)||zu.warn('rect-source-not-in-dom: The source of this rect does not belong to any rendered DOM tree.',{source:e}),t?et(this,Wu.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 Wu(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:Ks(this.top,e.top),right:Gs(this.right,e.right),bottom:Gs(this.bottom,e.bottom),left:Ks(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 Wu(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 Wu(n),o=t.getIntersection(e);if(o)o.getArea()new Wu(e))}});class Ku{constructor(){this.document=new Dp,this.domConverter=new iu,this._renderer=new tu(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 $p(this.document),this.addObserver(Eu),this.addObserver(ju),this.addObserver(qu),this.addObserver(Ru),this.addObserver(Bu),this.addObserver(Hu),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()):zu.warn('view-focus-no-selection: There is no selection in any editable to focus.')}}change(e){if(this._renderingInProgress||this._postFixersInProgress)throw new sl('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}}f(Ku,Ap);class Gu{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 sl('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 sl('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 sl('model-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.');if(0>n||t+n>e.offsetSize)throw new sl('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 sl('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 Yu extends Gu{constructor(e,t,n){super(t),this.name=e,this._children=new Qu,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 Yu(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(Yu.fromJSON(n)):t.push($u.fromJSON(n))}return new Yu(e.name,e.attributes,t)}}class Xu{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new sl('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 sl('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?em.createFromPosition(e.startPosition):em.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=em.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 Yu)return this.shallow?t.offset++:(t.path.push(0),this._visitedParent=o),this.position=t,ht('elementStart',o,e,t,1);if(o instanceof $u){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 Ju(o,r-i,i);return t.offset-=i,this.position=t,ht('text',a,e,t,i)}return t.path.pop(),this.position=t,this._visitedParent=n.parent,ht('elementStart',n,e,t,1)}}var Zu=function(e){var t=e?e.length:0;return t?e[t-1]:void 0};class em{constructor(e,t){if(!e.is('element')&&!e.is('documentFragment'))throw new sl('model-position-root-invalid: Position root invalid.');if(!(t instanceof Array)||0===t.length)throw new sl('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 Zu(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=em.createFromPosition(this),n=em.createFromPosition(e);break;case'after':t=em.createFromPosition(e),n=em.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=em.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=em.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 tm(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 tm(n,n.getShiftedBy(o))),n.offset=t,n.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new Xu(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new Xu(e);for(const n of t)yield n.item}*getPositions(e={}){e.boundaries=this;const t=new Xu(e);yield t.position;for(const n of t)yield n.nextPosition}getTransformedByDelta(e){const t=[tm.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=em.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=em.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 tm(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new Ip(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 tm))throw new sl('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 sl('model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.');const n=em.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 tm(n,e)),this._lastRangeBackward=!0):(this._pushRange(new tm(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 Yu&&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(em.createAt(o))&&(yield o)}}containsEntireContent(e=this.anchor.root){const t=em.createAt(e),n=em.createAt(e,'end');return t.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e),this._ranges.push(tm.createFromRange(e))}_checkRange(e){for(let t=0;t{for(const e of this.getRanges())if(!this._document._validateSelectionRange(e))throw new sl('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',Mt(),{priority:'low'}),this.downcastDispatcher.on('selection',Bt(),{priority:'low'}),this.view.document.roots.bindTo(this.model.document.roots).using((e)=>{if('$graveyard'==e.rootName)return null;const t=new Sp(e.name);return t.rootName=e.rootName,t._document=this.view.document,this.mapper.bindElements(e,t),t})}destroy(){this.view.destroy(),this.stopListening()}}f(pm,Ap);class um{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 p.includes(e)||a.get(e)||l.has(e)?void 0:o(e).catch((t)=>{throw zu.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 sl('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),p=r(t),u=function(e){const t=[];for(const n of e)i(n)||t.push(n);return t.length?t:null}(e);if(u){const e='plugincollection-plugin-not-found: Some plugins are not available and could not be loaded.';return zu.error(e,{plugins:u}),Promise.reject(new sl(e,{plugins:u}))}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)?zu.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 mm{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 sl('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 gm{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 km(t[0])},{priority:'highest'}),this.on('checkChild',(e,t)=>{t[0]=new km(t[0]),t[1]=this.getDefinition(t[1])},{priority:'highest'})}register(e,t){if(this._sourceDefinitions[e])throw new sl('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 sl('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 em){const t=e.nodeBefore,n=e.nodeAfter;if(!(t instanceof Yu))throw new sl('schema-check-merge-no-element-before: The node before the merge position must be an element.');if(!(n instanceof Yu))throw new sl('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 tm(i,e)),i=r.nextPosition),e=r.nextPosition;i&&!i.isEqual(r)&&n.push(new tm(i,r))}return n}getNearestSelectionRange(e,t='both'){if(this.checkChild(e,'$text'))return new tm(e);let n,o;('both'==t||'backward'==t)&&(n=new Xu({startPosition:e,direction:'backward'})),('both'==t||'forward'==t)&&(o=new Xu({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 tm.createOn(t.item);if(this.checkChild(t.nextPosition,'$text'))return new tm(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]=Ht(t[o],o);for(const t of n)Wt(e,t);for(const t of n)Ut(e,t);for(const t of n)Kt(e,t),Gt(e,t);for(const t of n)$t(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)}}}f(bm,Ap);class km{constructor(e){return e instanceof km?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 km([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 _m{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=hm.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 tm))throw new sl('view-conversion-dispatcher-incorrect-result: Incorrect conversion result was dropped.');return{modelRange:n.modelRange,modelCursor:n.modelCursor}}_convertChildren(e,t){const n=new tm(t);let o=t;for(const i of Array.from(e.getChildren())){const e=this._convertItem(i,o);e.modelRange instanceof tm&&(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()}}f(_m,hl);class wm{constructor(e,t){this.model=e,this.processor=t,this.mapper=new nm,this.downcastDispatcher=new im({mapper:this.mapper}),this.downcastDispatcher.on('insert:$text',It(),{priority:'lowest'}),this.upcastDispatcher=new _m({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=tm.createIn(e),n=new Gp,o=new $p(new Dp());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 sl('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(tm.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(){}}f(wm,Ap);class vm{constructor(){this._dispatchersGroups=new Map}register(e,t){if(this._dispatchersGroups.has(e))throw new sl('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 sl('conversion-for-unknown-group: Trying to add a converter to an unknown dispatchers group.');return t}}class ym{constructor(e){this.baseVersion=e,this.isDocumentOperation=null!==this.baseVersion}_validate(){}toJSON(){const e=Dc(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 xm{constructor(e){this.markers=new Map,this._children=new Qu,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(Yu.fromJSON(n)):t.push($u.fromJSON(n));return new xm(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 Cm=function(e,t){return Tu(e,t)};class Am extends ym{constructor(e,t,n,o,i){super(i),this.range=tm.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 Am(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Am(this.range,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){for(const e of this.range.getItems()){if(null!==this.oldValue&&!Cm(e.getAttribute(this.key),this.oldValue))throw new sl('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 sl('attribute-operation-attribute-exists: The attribute with given key already exists.',{node:e,key:this.key})}}_execute(){Cm(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 Am(tm.fromJSON(e.range,t),e.key,e.oldValue,e.newValue,e.baseVersion)}}class Tm extends ym{constructor(e,t,n,o){super(o),this.sourcePosition=em.createFromPosition(e),this.howMany=t,this.targetPosition=em.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 sl('move-operation-position-invalid: Source position or target position is invalid.');else if(n+this.howMany>e.maxOffset)throw new sl('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 Sm(this.position,e,this.baseVersion)}getReversed(){const e=this.position.root.document.graveyard,t=new em(e,[0]);return new Em(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(Yu.fromJSON(o)):n.push($u.fromJSON(o));return new Sm(em.fromJSON(e.position,t),n,e.baseVersion)}}class Om extends ym{constructor(e,t,n,o,i,r){super(i),this.name=e,this.oldRange=t?tm.createFromRange(t):null,this.newRange=n?tm.createFromRange(n):null,this.affectsData=r,this._markers=o}get type(){return'marker'}clone(){return new Om(this.name,this.oldRange,this.newRange,this._markers,this.baseVersion,this.affectsData)}getReversed(){return new Om(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 Om(e.name,e.oldRange?tm.fromJSON(e.oldRange,t):null,e.newRange?tm.fromJSON(e.newRange,t):null,t.model.markers,e.baseVersion,e.affectsData)}}class Rm extends ym{get type(){return'noop'}clone(){return new Rm(this.baseVersion)}getReversed(){return new Rm(this.baseVersion+1)}_execute(){}static get className(){return'engine.model.operation.NoOperation'}}class Im extends ym{constructor(e,t,n,o){super(o),this.position=e,this.oldName=t,this.newName=n}get type(){return'rename'}clone(){return new Im(em.createFromPosition(this.position),this.oldName,this.newName,this.baseVersion)}getReversed(){return new Im(em.createFromPosition(this.position),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(!(e instanceof Yu))throw new sl('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 sl('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 Im(em.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class Vm extends ym{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 Vm(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Vm(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is('documentFragment'))throw new sl('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 sl('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 sl('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 sl('rootattribute-operation-fromjson-no-root: Cannot create RootAttributeOperation. Root with specified name does not exist.',{rootName:e});return new Vm(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}const Nm={};Nm[Am.className]=Am,Nm[Sm.className]=Sm,Nm[Om.className]=Om,Nm[Tm.className]=Tm,Nm[Rm.className]=Rm,Nm[ym.className]=ym,Nm[Pm.className]=Pm,Nm[Em.className]=Em,Nm[Im.className]=Im,Nm[Vm.className]=Vm;class Fm{static fromJSON(e,t){return Nm[e.__className].fromJSON(e,t)}}const Dm=new Map;class Mm{static fromJSON(e,t){if(!Dm.has(e.__className))throw new sl('delta-fromjson-no-deserializer: This delta has no defined deserializer',{name:e.__className});const n=Dm.get(e.__className),o=new n;for(const n of e.operations)o.addOperation(Fm.fromJSON(n,t));for(const n in e)'__className'!=n&&void 0===o[n]&&(o[n]=e[n]);return o}static register(e){Dm.set(e.className,e)}}class Bm{constructor(){this.batch=null,this.operations=[]}get baseVersion(){return 0new Am(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 Am(t,e.key,e.oldValue,e.newValue,e.baseVersion)),i=e.range.getIntersection(t.range);return i&&(n.isStrong?o.push(new Am(i,t.key,t.newValue,e.newValue,e.baseVersion)):0===o.length&&o.push(new Rm(0))),o}return[e.clone()]},RootAttributeOperation:In,RenameOperation:In,MarkerOperation:In,MoveOperation(e,t){const n=tm.createFromPositionAndShift(t.sourcePosition,t.howMany);let o=[];const i=Fn(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 Am(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 Rm(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 Rm(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 Rm(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=tm.createFromRanges(e)}if(n.newRange){const e=n.newRange._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);n.newRange=tm.createFromRanges(e)}return[n]}},MoveOperation:{InsertOperation(e,t,n){let o=tm.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=tm.createFromPositionAndShift(e.sourcePosition,e.howMany),i=tm.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(Nn(e,t)&&Nn(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 p=T(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if('prefix'==p||'extension'==p)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 Em&&!(t instanceof Em)?r=!0:!(e instanceof Em)&&t instanceof Em&&(r=!1));const u=[],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);u.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===u.length?u.push(g):1==u.length?i.start.isBefore(o.start)||i.start.isEqual(o.start)?u.unshift(g):u.push(g):u.splice(1,0,g)),0===u.length?[new Rm(e.baseVersion)]:Dn(u,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=ag,a=!1,t=new du(t));outer:for(;++it?0:t,o)):[]},Hg=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)):[]},Wg=function(e,t,n,o){for(var i=e.length,r=o?i:-1;(o?r--:++r=t?e:t)),e},Kg=function(e){return e?Ug(op(e),0,4294967295):0},Gg=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:Kg(o);nt?n:0,xd(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&&!Gc(a)&&(n?a<=t:a=200){var d=t?null:yh(e);if(d)return bc(d);a=!1,i=ag,l=new du}else l=t?[]:s;outer:for(;++ot)return[];for(var i=0,r=0,a=Array(Ym(o/t));in&&(n=Ks(o+n,0)),tg(e,t,n)):-1},initial:function(e){return Hg(e,1)},intersection:Xg,intersectionBy:Zg,intersectionWith:eh,join:function(e,t){return e?nh.call(e,t):''},last:Zu,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?Ks(o+i,0):Gs(i,o-1))+1),t!==t)return eg(e,i,!0);for(;i--;)if(e[i]===t)return i;return-1},nth:function(e,t){return e&&e.length?oh(e,op(t)):void 0},pull:dh,pullAll:lh,pullAllBy:function(e,t,n){return e&&e.length&&t&&t.length?sh(e,t,Lg(n)):e},pullAllWith:function(e,t,n){return e&&e.length&&t&&t.length?sh(e,t,void 0,n):e},pullAt:fh,remove:function(e,t){var n=[];if(!(e&&e.length))return n;var o=-1,i=[],r=e.length;for(t=Lg(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?Wg(e,Lg(t,3),!1,!0):[]},takeWhile:function(e,t){return e&&e.length?Wg(e,Lg(t,3)):[]},union:Ch,unionBy:Ah,unionWith:Th,uniq:function(e){return e&&e.length?xh(e):[]},uniqBy:function(e,t){return e&&e.length?xh(e,Lg(t)):[]},uniqWith:function(e,t){return e&&e.length?xh(e,void 0,t):[]},unzip:Eh,unzipWith:Sh,without:Oh,xor:Ih,xorBy:Vh,xorWith:Nh,zip:Fh,zipObject:function(e,t){return Dh(e||[],t||[],Xl)},zipObjectDeep:function(e,t){return Dh(e||[],t||[],Mh)},zipWith:Bh};const zh=new Map,jh={transform(e,t,n){const o=jh.getTransformationCase(e,t)||jh.defaultTransform,i=o(e,t,Object.assign({},n)),r=Lh.last(t.operations).baseVersion;return Hn(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=Uh(e,t,n);return e.range.containsPosition(t.position)&&o.push(to(t,e)),o}),Wh(Lm,zm,(e,t,n)=>{if(!t.position)return Uh(e,t,n);const o=n.undoMode,i=new em(t.position.root,t.position.path.slice(0,-1)),r=Uh(e,t,n);if(o||!(t._cloneOperation instanceof Sm))return r;for(const o of e.operations)if(o.range.containsPosition(i)||o.range.start.isEqual(i)){const e=new Lm,n=i.getShiftedBy(1),a=em.createFromPosition(n);a.path.push(0);const s=t._cloneOperation.nodes.getNode(0).getAttribute(o.key);e.addOperation(new Am(new tm(n,a),o.key,s===void 0?null:s,o.newValue,0)),r.push(e);break}return r}),Wh(Gm,jm,(e,t,n)=>{if(!t.position)return Uh(e,t,n);const o=n.undoMode;return!o&&e.position.isEqual(t.position)?[t.getReversed(),e.clone()]:Uh(e,t,n)}),Wh(Hh,zm,eo),Wh(Hh,jm,eo),Wh(Hh,Um,eo),Wh(Hh,Km,eo),Wh(Hh,qm,eo),Wh(Hh,Wm,eo),Wh(qm,jm,(e,t,n)=>{const o=n.undoMode;if(o||!t.position)return Uh(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()]:Uh(e,t,n)}),Wh(jm,Gm,(e,t,n)=>{if(!e.position)return Uh(e,t,n);const o=n.undoMode;return!o&&e.position.isEqual(t.position)?[no()]:Uh(e,t,n)}),Wh(jm,qm,(e,t,n)=>{const o=n.undoMode;if(o||!e.position)return Uh(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()]:Uh(e,t,n)}),Wh(zm,zm,(e,t,n)=>{const o=n.undoMode;if(o)return Uh(e,t,n);if(!e.position||!t.position)return Uh(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=tm.createFromPositionAndShift(e.position,e._moveOperation.howMany),o=tm.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 Rm(e.operations[0].baseVersion+1))):e.operations[1].howMany=r,[e]}else{const o=Object.assign({},n);return o.isStrong=!0,o.insertBefore=!0,Uh(e,t,o)}return Uh(e,t,n)}),Wh(zm,Km,(e,t,n)=>e.position?e.position.root==t.position.root&&'same'===T(t.position.path,e.position.getParentPath())?[no()]:Uh(e,t,n):Uh(e,t,n)),Wh(zm,Um,(e,t,n)=>{if(!e.position)return Uh(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=em.createFromPosition(t.range.start);o.path.push(t.howMany-1);const i=o.getShiftedBy(1);n._cloneOperation.position=i;const r=em.createFromPosition(o);r.path.push(e.position.offset),n._moveOperation.sourcePosition=r;const a=em.createFromPosition(i);return a.path.push(0),n._moveOperation.targetPosition=a,[n]}return Uh(e,t,n)}),Wh(zm,Lm,(e,t,n)=>{if(!e.position)return Uh(e,t,n);e=e.clone();const o=n.undoMode,i=new em(e.position.root,e.position.path.slice(0,-1));if(o||!(e._cloneOperation instanceof Sm))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]}),Wh(Km,zm,(e,t,n)=>t.position?e.position.root==t.position.root&&'same'===T(e.position.path,t.position.getParentPath())?[t.getReversed(),e.clone()]:Uh(e,t,n):Uh(e,t,n)),Wh($m,Lm,(e,t)=>{const n=[e.clone()];return t.range.containsPosition(e.position)&&n.push(to(e,t)),n}),Wh(Um,zm,(e,t,n)=>{if(!t.position)return Uh(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 Uh(e,t,n)}),Wh(Wm,zm,(e,t,n)=>{const o=n.undoMode,i=Uh(e,t,n);if(o||!(t._cloneOperation instanceof Sm))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}),Wh(zm,Wm,(e,t,n)=>{e=e.clone();const o=n.undoMode;if(o||!(e._cloneOperation instanceof Sm))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]}),Wh(Hm,zm,(e,t,n)=>{const o=Uh(e,t,n),i=t._cloneOperation.position||t._cloneOperation.targetPosition;if(!i)return Uh(e,t,n);const r=n.undoMode;if(r)return o;for(const r of o)if(r instanceof Hm){const e=r._moveOperation,t=e.sourcePosition.getShiftedBy(e.howMany);t.isEqual(i)&&(e.howMany+=1)}return o}),Wh(zm,Hm,(e,t,n)=>{const o=n.undoMode;if(o)return Uh(e,t,n);const i=e._cloneOperation.position||e._cloneOperation.targetPosition;if(!i)return Uh(e,t,n);t=t.clone();const r=t._moveOperation,a=r.sourcePosition.getShiftedBy(r.howMany);return a.isEqual(i)&&(r.howMany+=1),Uh(e,t,n)});class Kh{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 Gh extends Bm{static get className(){return'engine.model.delta.RootAttributeDelta'}}Mm.register(Gh);class $h extends ym{constructor(e,t){super(null),this.sourcePosition=em.createFromPosition(e),this.howMany=t}get type(){return'detach'}_validate(){if(this.sourcePosition.root.document)throw new sl('detach-operation-on-document-node: Cannot detach document node.')}_execute(){An(tm.createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return'engine.model.operation.DetachOperation'}}class Jh extends Yu{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 Qh{constructor(e,t){this.model=e,this.batch=t}createText(e,t){return new $u(e,t)}createElement(e,t){return new Yu(e,t)}createDocumentFragment(){return new xm}insert(e,t,n){this._assertWriterUsedCorrectly();const o=em.createAt(t,n),i=e instanceof $u&&!e.parent?new $m:new Gm;if(e.parent){if(so(e.root,o.root))return void this.move(tm.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 Sm(o,e,r);if(this.batch.addDelta(i),i.addOperation(a),this.model.applyOperation(a),e instanceof xm)for(const[t,n]of e.markers){const e=em.createAt(n.root),i=new tm(n.start._getCombined(e,o),n.end._getCombined(e,o));this.addMarker(t,{range:i,usingOperation:!0})}}insertText(e,t,n,o){t instanceof xm||t instanceof Yu||t instanceof em?this.insert(this.createText(e),t,n):this.insert(this.createText(e,t),n,o)}insertElement(e,t,n,o){t instanceof xm||t instanceof Yu||t instanceof em?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 xm||t instanceof Yu?this.insert(this.createText(e),t,'end'):this.insert(this.createText(e,t),n,'end')}appendElement(e,t,n){t instanceof xm||t instanceof Yu?this.insert(this.createElement(e),t,'end'):this.insert(this.createElement(e,t),n,'end')}setAttribute(e,t,n){this._assertWriterUsedCorrectly(),n instanceof tm?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 tm?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 tm))t(e);else for(const n of e.getItems())t(n)}move(e,t,n){if(this._assertWriterUsedCorrectly(),!(e instanceof tm))throw new sl('writer-move-invalid-range: Invalid range to move.');if(!e.isFlat)throw new sl('writer-move-range-not-flat: Range to move is not flat.');const o=em.createAt(t,n);if(!so(e.root,o.root))throw new sl('writer-move-different-document: Range is going to be moved between different documents.');const i=new qm;this.batch.addDelta(i);const r=e.root.document?e.root.document.version:null,a=new Tm(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 Hm;this.batch.addDelta(n),ao(e,t,n,this.model)};if(e instanceof tm){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(em.createBefore(e),n)}}merge(e){this._assertWriterUsedCorrectly();const t=new jm;this.batch.addDelta(t);const n=e.nodeBefore,o=e.nodeAfter;if(!(n instanceof Yu))throw new sl('writer-merge-no-element-before: Node before merge position must be an element.');if(!(o instanceof Yu))throw new sl('writer-merge-no-element-after: Node after merge position must be an element.');const i=em.createFromParentAndOffset(o,0),r=em.createFromParentAndOffset(n,n.maxOffset),a=e.root.document?e.root.document.version:null,s=new Tm(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 Yu))throw new sl('writer-rename-not-element-instance: Trying to rename an object which is not an instance of Element.');const n=new Wm;this.batch.addDelta(n);const o=e.root.document?e.root.document.version:null,i=new Im(em.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 sl('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 sl('writer-split-invalid-limit-element: Limit element is not a position ancestor.');let o,i;do{const t=new zm;this.batch.addDelta(t);const r=new Yu(n.name,n.getAttributes()),a=n.root.document?n.root.document.version:null,s=new Sm(em.createAfter(n),r,a);t.addOperation(s),this.model.applyOperation(s);const l=null===a?null:a+1,d=new Tm(e,n.maxOffset-e.offset,em.createFromParentAndOffset(r,0),l);d.isSticky=!0,t.addOperation(d),this.model.applyOperation(d),o||i||(o=n,i=r),e=em.createBefore(r),n=e.parent}while(n!==t);return{position:e,range:new tm(em.createAt(o,'end'),em.createAt(i))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new sl('writer-wrap-range-not-flat: Range to wrap is not flat.');const n=t instanceof Yu?t:new Yu(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:em.createFromParentAndOffset(e,t),name:n,length:1,changeCount:this._changeCount++}}_getRemoveDiff(e,t,n){return{type:'remove',position:em.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:tm.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:tm.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 sl('model-history-wrong-version: Given base version points to the middle of a delta.')}return t}}const Zh='$graveyard';class ef{constructor(e){this.model=e,this.version=0,this.history=new Xh(this),this.selection=new lm(this),this.roots=new Fp({idProperty:'rootName'}),this.differ=new Yh(e.markers),this._postFixers=new Set,this.createRoot('$root',Zh),this.listenTo(e,'applyOperation',(e,t)=>{const n=t[0];if(n.isDocumentOperation&&n.baseVersion!==this.version)throw new sl('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(Zh)}createRoot(e='$root',t='main'){if(this.roots.get(t))throw new sl('model-document-createRoot-name-exists: Root with specified name already exists.',{name:t});const n=new Jh(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!=Zh)}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=Dc(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 em(e,[0]),o=t.getNearestSelectionRange(n);return o||new tm(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)}}f(ef,hl);class tf{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 nf?e.name:e,r=this._markers.get(i);if(r){const e=r.getRange();let a=!1;return e.isEqual(t)||(r._attachLiveRange(am.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=am.createFromRange(t),s=new nf(i,a,n,o);return this._markers.set(i,s),this.fire('update:'+i,s,null,t),s}_remove(e){const t=e instanceof nf?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()}}f(tf,hl);class nf{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 sl('marker-destroyed: Cannot use a destroyed marker instance.');return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new sl('marker-destroyed: Cannot use a destroyed marker instance.');return this._affectsData}getStart(){if(!this._liveRange)throw new sl('marker-destroyed: Cannot use a destroyed marker instance.');return em.createFromPosition(this._liveRange.start)}getEnd(){if(!this._liveRange)throw new sl('marker-destroyed: Cannot use a destroyed marker instance.');return em.createFromPosition(this._liveRange.end)}getRange(){if(!this._liveRange)throw new sl('marker-destroyed: Cannot use a destroyed marker instance.');return tm.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}}f(nf,hl);class of extends em{constructor(e,t,n){if(super(e,t),!this.root.is('rootElement'))throw new sl('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()}}f(of,hl);class rf{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']}),Mo(this)}change(e){return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new Kh,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}enqueueChange(e,t){'string'==typeof e?e=new Kh(e):'function'==typeof e&&(t=e,e=new Kh),this._pendingChanges.push({batch:e,callback:t}),1==this._pendingChanges.length&&this._runPendingChanges()}applyOperation(e){e._execute()}transformDeltas(e,t,n=!1){return qh.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 Fo(this,e)}hasContent(e){if(e instanceof Yu&&(e=tm.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 Qh(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}}f(sf,Ap);class lf{constructor(){this._listener=Object.create(au)}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 df extends lf{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 cf{constructor(e){const t=this.constructor.build&&this.constructor.build.plugins;this.config=new rl(e,this.constructor.build&&this.constructor.build.config),this.config.define('plugins',t),this.plugins=new um(this,t),this.commands=new mm,this.locale=new gm(this.config.get('language')),this.t=this.locale.t,this.set('isReadOnly',!1),this.model=new sf,this.data=new wm(this.model),this.editing=new pm(this.model),this.editing.view.document.bind('isReadOnly').to(this),this.conversion=new vm,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 df(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))})}}f(cf,Ap);class pf{getHtml(e){const t=document.implementation.createHTMLDocument(''),n=t.createElement('div');return n.appendChild(e),n.innerHTML}}class uf{constructor(){this._domParser=new DOMParser,this._domConverter=new iu({blockFiller:Yp}),this._htmlWriter=new pf}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||!Wo(e))throw new sl('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)})}}}}f(Fp,Ap);var hf=function(e,t){return Fc(e,!0,!0,t)};class ff{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=pi(),this._renderNode({node:e,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new sl('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 kf({eventNameOrFunction:n,attribute:n,observable:e,emitter:t,callback:o})},if(n,o,i){return new _f({observable:e,emitter:t,attribute:n,valueIfTrue:o,callback:i})}}}static extend(e,t){e._isRendered&&zu.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 sl('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:$o(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=vl(n[0])&&n[0].ns?n[0].ns:null,Uo(n)){const s=i?n[0].value:n;a&&ui(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&&ui(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=pi();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;Go(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;nGo(e,t,n);return this.emitter.listenTo(this.observable,'change:'+this.attribute,o),()=>{this.emitter.stopListening(this.observable,'change:'+this.attribute,o)}}}class kf extends bf{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 _f extends bf{getValue(e){const t=super.getValue(e);return!si(t)&&(this.valueIfTrue||!0)}}var wf=o(11),vf=o.n(wf);class yf{constructor(e){this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new Fp,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=ff.bind(this,this)}createCollection(){const e=new gf;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 ff(e)}extendTemplate(e){ff.extend(this.template,e)}render(){if(this.isRendered)throw new sl('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())}}f(yf,au),f(yf,Ap);var xf=o(14),Cf=o.n(xf);const Af=ki('px'),Tf=nu.document.body;class Pf extends yf{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',Af),left:t.to('left',Af)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){this.show();const t=Pf.defaultPositions,n=Object.assign({},{element:this.element,positions:[t.southArrowNorth,t.southArrowNorthWest,t.southArrowNorthEast,t.northArrowSouth,t.northArrowSouthWest,t.northArrowSouthEast],limiter:Tf,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):Tf;this.listenTo(nu.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(nu.window,'resize',()=>{this.attachTo(e)})}_stopPinning(){this.stopListening(nu.document,'scroll'),this.stopListening(nu.window,'resize')}}Pf.arrowHorizontalOffset=25,Pf.arrowVerticalOffset=10,Pf.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+Pf.arrowHorizontalOffset,name:'arrow_se'}),northArrowSouthWest:(e,t)=>({top:wi(e,t),left:e.left+e.width/2-Pf.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-Pf.arrowHorizontalOffset,name:'arrow_sw'}),northWestArrowSouthEast:(e,t)=>({top:wi(e,t),left:e.left-t.width+Pf.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+Pf.arrowHorizontalOffset,name:'arrow_se'}),northEastArrowSouthWest:(e,t)=>({top:wi(e,t),left:e.right-Pf.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+Pf.arrowHorizontalOffset,name:'arrow_ne'}),southArrowNorthWest:(e,t)=>({top:vi(e,t),left:e.left+e.width/2-Pf.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-Pf.arrowHorizontalOffset,name:'arrow_nw'}),southWestArrowNorthEast:(e,t)=>({top:vi(e,t),left:e.left-t.width+Pf.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+Pf.arrowHorizontalOffset,name:'arrow_ne'}),southEastArrowNorthWest:(e,t)=>({top:vi(e,t),left:e.right-Pf.arrowHorizontalOffset,name:'arrow_nw'})};class Ef extends mf{static get pluginName(){return'ContextualBalloon'}init(){this.view=new Pf,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 sl('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 sl('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 Sf{constructor(){this.set('isFocused',!1),this.focusedElement=null,this._elements=new Set,this._nextEventLoopTimeout=null}add(e){if(this._elements.has(e))throw new sl('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)}}f(Sf,au),f(Sf,Ap);class Of{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 Rf extends yf{constructor(e){super(e),this.setTemplate({tag:'span',attributes:{class:['ck','ck-toolbar__separator']}})}}var If=o(16),Vf=o.n(If);class Nf extends yf{constructor(e){super(e);const t=this.bindTemplate;this.items=this.createCollection(),this.focusTracker=new Sf,this.keystrokes=new lf,this.set('isVertical',!1),this.set('className'),this._focusCycler=new Of({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 Rf):t.has(e)?this.items.add(t.create(e)):zu.warn('toolbarview-item-unavailable: The requested toolbar item is unavailable.',{name:e})})}}class Ff extends mf{static get pluginName(){return'BalloonToolbar'}static get requires(){return[Ef]}init(){const e=this.editor;this.toolbarView=new Nf(e.locale),this.toolbarView.extendTemplate({attributes:{class:['ck-toolbar_floating']}}),this.toolbarView.render(),this._balloon=e.plugins.get(Ef),this._fireSelectionChangeDebounced=Mu(()=>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=Wu.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 qf extends jf{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('am',[e])),class:'ck-editor__editable_inline'}})}}class Hf extends zf{constructor(e,t){super(e),this.editable=new qf(e,t),this.registerChild(this.editable)}get editableElement(){return this.editable.element}}const Wf={setData(e){this.data.set(e)},getData(){return this.data.get()}};var Uf=Wf;const Kf={updateElement(){Ei(this.element,this.data.get())}};var Gf=Kf;class $f extends cf{constructor(e,t){super(t),this.element=e,this.config.get('plugins').push(Ff),this.config.define('balloonToolbar',this.config.get('toolbar')),this.data.processor=new uf,this.model.document.createRoot(),this.ui=new Mf(this,new Hf(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))})}}f($f,Uf),f($f,Gf);class Jf{constructor(e,t){this.editor=e,this.view=t,this.componentFactory=new Df(e),this.focusTracker=new Sf,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 Qf=o(20),Yf=o.n(Qf);class Xf extends yf{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 Zf extends zf{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 Xf;return t.text=n('al'),t.extendTemplate({attributes:{id:`ck-editor__aria-label_${e}`,class:'ck-voice-label'}}),t}}var eb=o(22),tb=o.n(eb);const nb=ki('px');class ob extends yf{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 ff({tag:'div',attributes:{class:['ck','ck-sticky-panel__placeholder'],style:{display:t.to('isSticky',(e)=>e?'block':'none'),height:t.to('isSticky',(e)=>e?nb(this._panelRect.height):null)}}}).render(),this._contentPanel=new ff({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?nb(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to('_hasViewportTopOffset',(e)=>e?nb(this.viewportTopOffset):null),bottom:t.to('_isStickyToTheLimiter',(e)=>e?nb(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(nu.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 lb extends cf{constructor(e,t){super(t),this._elementReplacer=new sb,this.element=e,this.data.processor=new uf,this.model.document.createRoot(),this.ui=new Jf(this,new ab(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))})}}f(lb,Uf),f(lb,Gf);class db{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 cb extends Ou{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 db(e.clipboardData?e.clipboardData:e.dataTransfer)};'drop'==e.type&&(t.dropRange=Ii(this.view,e)),this.fire(e.type,e,t)}}const pb=['figcaption','li'];class ub extends mf{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 uf,o.addObserver(cb),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=Ni(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',Fi(o.content))),'cut'==o.method&&t.model.deleteContent(n.selection)},{priority:'low'})}}class mb{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()}}f(mb,Ap);class gb extends mb{execute(){const e=this.editor.model,t=e.document;e.change((n)=>{Mi(this.editor.model,n,t.selection,e.schema),this.fire('afterExecute',{writer:n})})}}class hb extends lu{constructor(e){super(e);const t=this.document;t.on('keydown',(e,n)=>{if(this.isEnabled&&n.keyCode==Up.enter){let o;t.once('enter',(e)=>o=e,{priority:'highest'}),t.fire('enter',new Su(t,n.domEvent,{isSoft:n.shiftKey})),o&&o.stop.called&&e.stop()}})}observe(){}}class fb extends mf{static get pluginName(){return'Enter'}init(){const e=this.editor,t=e.editing.view,n=t.document;t.addObserver(hb),e.commands.add('enter',new gb(e)),this.listenTo(n,'enter',(n,o)=>{o.isSoft||(e.execute('enter'),o.preventDefault(),t.scrollToTheSelection())},{priority:'low'})}}class bb extends mb{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 kb extends mf{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(hb),e.commands.add('shiftEnter',new bb(e)),this.listenTo(i,'enter',(t,n)=>{n.isSoft&&(e.execute('shiftEnter'),n.preventDefault(),o.scrollToTheSelection())},{priority:'low'})}}class _b{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 Kh),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 wb extends mb{constructor(e,t){super(e),this._buffer=new _b(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 vb extends mf{static get pluginName(){return'Input'}init(){const e=this.editor,t=e.editing.view,n=new wb(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||Wi(e)||o.selection.isCollapsed||(i.lock(),n.enqueueChange(i.batch,()=>{this.editor.model.deleteContent(o.selection)}),i.unlock())}_handleMutations(e,t){new yb(this.editor).handle(e,t)}}class yb{constructor(e){this.editor=e,this.editing=this.editor.editing}handle(e,t){if($i(e))this._handleContainerChildrenMutations(e,t);else for(const n of e)this._handleTextMutation(n,t),this._handleTextNodeInsertion(n)}_handleContainerChildrenMutations(e,t){const n=Gi(e);if(!n)return;const o=this.editor.editing.view.domConverter,i=o.mapViewToDom(n),r=new iu,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],p=d[d.length-1];if(c&&c.is('softBreak')&&p&&!p.is('softBreak')&&l.pop(),!Ji(l)||!Ji(d))return;const u=l.map((e)=>e.is('text')?e.data:'@').join('').replace(/\u00A0/g,' '),m=d.map((e)=>e.is('text')?e.data:'@').join('');if(m===u)return;const g=Pe(m,u),{firstChangeAt:h,insertions:f,deletions:b}=Qi(g);let k=null;t&&(k=this.editing.mapper.toModelRange(t.getFirstRange()));const _=u.substr(h,f),w=tm.createFromParentsAndOffsets(s,h,s,h+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 Rp(e.node,r),c=this.editing.mapper.toModelPosition(d),p=tm.createFromPositionAndShift(c,s),u=n.substr(r,a);this.editor.execute('input',{text:u,range:p,resultRange:l})}_handleTextNodeInsertion(e){if('children'==e.type){const t=Ki(e),n=new Rp(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 tm(o)})}}}const xb=[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++)xb.push(e);class Cb extends mb{constructor(e,t){super(e),this.direction=t,this._buffer=new _b(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 rm(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==Up.delete||t.keyCode==Up.backspace)&&(n=0)}),t.on('keydown',(e,o)=>{const i={};if(o.keyCode==Up.delete)i.direction='forward',i.unit='character';else if(o.keyCode==Up.backspace)i.direction='backward',i.unit='codePoint';else return;const r=qp.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 Su(t,o.domEvent,i)),a&&a.stop.called&&e.stop()})}observe(){}}class Tb extends mf{static get pluginName(){return'Delete'}init(){const e=this.editor,t=e.editing.view,n=t.document;t.addObserver(Ab),e.commands.add('forwardDelete',new Cb(e,'forward')),e.commands.add('delete',new Cb(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 Pb extends mf{static get requires(){return[vb,Tb]}static get pluginName(){return'Typing'}}class Eb extends mb{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 Sb extends Eb{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 Kh;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 Ob extends Eb{execute(){const e=this._stack.pop(),t=new Kh;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 Rb extends mf{constructor(e){super(e),this._batchRegistry=new WeakSet}init(){const e=this.editor;this._undoCommand=new Sb(e),this._redoCommand=new Ob(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 Ib=o(26),Vb=o.n(Ib);class Nb extends yf{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 Fb=o(28),Db=o.n(Fb);class Mb extends yf{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 Bb=o(30),Lb=o.n(Bb);class zb extends yf{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 Nb,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 Mb;return e.bind('text').to(this,'_tooltipString'),e.bind('position').to(this,'tooltipPosition'),e}_createLabelView(e){const t=new yf;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 jb=o(32),qb=o.n(jb),Hb=o(33),Wb=o.n(Hb);class Ub extends mf{init(){const e=this.editor,n=e.t;this._addButton('undo',n('an'),'CTRL+Z',qb.a),this._addButton('redo',n('ao'),'CTRL+Y',Wb.a)}_addButton(e,t,n,o){const i=this.editor;i.ui.componentFactory.add(e,(r)=>{const a=i.commands.get(e),s=new zb(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 Kb extends mf{static get requires(){return[Rb,Ub]}static get pluginName(){return'Undo'}}class Gb extends mf{static get requires(){return[ub,fb,kb,Pb,Kb]}static get pluginName(){return'Essentials'}}class $b extends mf{static get pluginName(){return'PendingActions'}init(){this.set('isPending',!1),this._actions=new Fp({idProperty:'_id'}),this._actions.delegate('add','remove').to(this)}add(e){if('string'!=typeof e)throw new sl('pendingactions-add-invalid-message: The message must be a string.');const t=Object.create(Ap);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 Jb{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()}}f(Jb,Ap);class Qb extends mf{static get pluginName(){return'FileRepository'}static get requires(){return[$b]}init(){this.loaders=new Fp,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 zu.error('filerepository-no-upload-adapter: Upload adapter is not defined.'),null;const t=new Yb(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 Yb?e:this.getLoader(e);t._destroy(),this.loaders.remove(t)}_updatePendingAction(){const e=this.editor.plugins.get($b);if(!this.loaders.length)e.remove(this._pendingAction),this._pendingAction=null;else if(!this._pendingAction){const n=this.editor.t,t=(e)=>`${n('ak')} ${parseInt(e)}%.`;this._pendingAction=e.add(t(this.uploadedPercent)),this._pendingAction.bind('message').to(this,'uploadedPercent',t)}}}f(Qb,Ap);class Yb{constructor(e,t){this.id=r(),this.file=e,this._adapter=t,this._reader=new Jb,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 sl('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 sl('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}}f(Yb,Ap);const Xb='ckCsrfToken',Zb=40,ek='abcdefghijklmnopqrstuvwxyz0123456789';class tk extends mf{static get requires(){return[Qb]}static get pluginName(){return'CKFinderUploadAdapter'}init(){const e=this.editor.config.get('ckfinder.uploadUrl');e&&(this.editor.plugins.get(Qb).createUploadAdapter=(t)=>new nk(t,e,this.editor.t))}}class nk{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 ok{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=tm.createFromParentsAndOffsets(s.parent,0,s.parent,l[0].length);e.remove(t),o({match:l})})})}}class ik{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),p=r(c),u=ir(d,p.format),m=ir(d,p.remove);u.length&&m.length&&e.model.enqueueChange((t)=>{const n=e.model.schema.getValidRanges(u,i);a(t,n);for(const e of m.reverse())t.remove(e)})})}}class rk extends mf{static get pluginName(){return'Autoformat'}afterInit(){this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats()}_addListAutoformats(){const e=this.editor.commands;e.get('bulletedList')&&new ok(this.editor,/^[*-]\s$/,'bulletedList'),e.get('numberedList')&&new ok(this.editor,/^\d+[.|)]\s$/,'numberedList')}_addBasicStylesAutoformats(){const e=this.editor.commands;e.get('bold')&&(new ik(this.editor,/(\*\*)([^*]+)(\*\*)$/g,'bold'),new ik(this.editor,/(__)([^_]+)(__)$/g,'bold')),e.get('italic')&&(new ik(this.editor,/(?:^|[^*])(\*)([^*_]+)(\*)$/g,'italic'),new ik(this.editor,/(?:^|[^_])(_)([^_]+)(_)$/g,'italic')),e.get('code')&&new ik(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 ok(this.editor,n,()=>{this.editor.execute('heading',{value:e})})})}_addBlockQuoteAutoformats(){this.editor.commands.get('blockQuote')&&new ok(this.editor,/^>\s$/,'blockQuote')}}class ak extends mb{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 sk='bold';class lk extends mf{init(){const e=this.editor;e.model.schema.extend('$text',{allowAttributes:sk}),e.conversion.attributeToElement({model:sk,view:'strong',upcastAlso:['b',{styles:{"font-weight":'bold'}}]}),e.commands.add(sk,new ak(e,sk)),e.keystrokes.set('CTRL+B',sk)}}var dk=o(34),ck=o.n(dk);const pk='bold';class uk extends mf{init(){const e=this.editor,n=e.t;e.ui.componentFactory.add(pk,(t)=>{const o=e.commands.get(pk),i=new zb(t);return i.set({label:n('b'),icon:ck.a,keystroke:'CTRL+B',tooltip:!0}),i.bind('isOn','isEnabled').to(o,'value','isEnabled'),this.listenTo(i,'execute',()=>e.execute(pk)),i})}}class mk extends mf{static get requires(){return[lk,uk]}static get pluginName(){return'Bold'}}const gk='italic';class hk extends mf{init(){const e=this.editor;e.model.schema.extend('$text',{allowAttributes:gk}),e.conversion.attributeToElement({model:gk,view:'i',upcastAlso:['em',{styles:{"font-style":'italic'}}]}),e.commands.add(gk,new ak(e,gk)),e.keystrokes.set('CTRL+I',gk)}}var fk=o(35),bk=o.n(fk);const kk='italic';class _k extends mf{init(){const e=this.editor,n=e.t;e.ui.componentFactory.add(kk,(t)=>{const o=e.commands.get(kk),i=new zb(t);return i.set({label:n('c'),icon:bk.a,keystroke:'CTRL+I',tooltip:!0}),i.bind('isOn','isEnabled').to(o,'value','isEnabled'),this.listenTo(i,'execute',()=>e.execute(kk)),i})}}class wk extends mf{static get requires(){return[hk,_k]}static get pluginName(){return'Italic'}}class vk extends mb{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=em.createBefore(t.start.parent);return void e.move(t,n)}t.end.isAtEnd||e.split(t.end);const n=em.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 Yu('blockQuote'),e.wrap(t,o)),n.push(o)}),n.reverse().reduce((t,n)=>t.nextSibling==n?(e.merge(em.createAfter(t)),t):n)}}class yk extends mf{init(){const e=this.editor,t=e.model.schema;e.commands.add('blockQuote',new vk(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 xk=o(36),Ck=o.n(xk),Ak=o(37),Tk=o.n(Ak);class Pk extends mf{init(){const e=this.editor,n=e.t;e.ui.componentFactory.add('blockQuote',(t)=>{const o=e.commands.get('blockQuote'),i=new zb(t);return i.set({label:n('d'),icon:Ck.a,tooltip:!0}),i.bind('isOn','isEnabled').to(o,'value','isEnabled'),this.listenTo(i,'execute',()=>e.execute('blockQuote')),i})}}class Ek extends mf{static get requires(){return[yk,Pk]}static get pluginName(){return'BlockQuote'}}const Sk=/^data:(\S*?);base64,/;class Ok{constructor(e,t,n){if(!e)throw new Error('File must be provided');if(!t)throw new Error('Token must be provided');if(!n)throw new Error('Api address must be provided');this.file=cr(e)?dr(e):e,this._token=t,this._apiAddress=n}onProgress(e){return this.on('progress',(t,n)=>e(n)),this}onError(e){return this.once('error',(t,n)=>e(n)),this}abort(){this.xhr.abort()}send(){return this._prepareRequest(),this._attachXHRListeners(),this._sendRequest()}_prepareRequest(){const e=new XMLHttpRequest;e.open('POST',this._apiAddress),e.setRequestHeader('Authorization',this._token.value),e.responseType='json',this.xhr=e}_attachXHRListeners(){function e(e){return()=>t.fire('error',e)}const t=this,n=this.xhr;n.addEventListener('error',e('Network Error')),n.addEventListener('abort',e('Abort')),n.upload&&n.upload.addEventListener('progress',(e)=>{e.lengthComputable&&this.fire('progress',{total:e.total,uploaded:e.loaded})}),n.addEventListener('load',()=>{const e=n.status,t=n.response;if(200>e||299{t.addEventListener('load',()=>{const e=t.status,i=t.response;return 200>e||299o('Network Error')),t.addEventListener('abort',()=>o('Abort')),t.send(e)})}}f(Ok,hl);const Rk={refreshInterval:36e5,autoRefresh:!0};class Ik{constructor(e,t=Rk){if(!e)throw new Error('`tokenUrl` must be provided');this.set('value',t.initValue),this._tokenUrl=e,this._options=Object.assign({},Rk,t)}init(){return new Promise((e,t)=>(this._options.autoRefresh&&this._startRefreshing(),this.value?void e(this):void this._refreshToken().then(e).catch(t)))}_refreshToken(){return new Promise((e,t)=>{const n=new XMLHttpRequest;n.open('GET',this._tokenUrl),n.addEventListener('load',()=>{const o=n.status,i=n.response;return 200>o||299t('Network Error')),n.addEventListener('abort',()=>t('Abort')),n.send()})}_startRefreshing(){this._refreshInterval=setInterval(this._refreshToken.bind(this),this._options.refreshInterval)}_stopRefreshing(){clearInterval(this._refreshInterval)}static create(e,t=Rk){const n=new Ik(e,t);return n.init()}}f(Ik,Ap);class Vk extends mf{init(){const e=this.editor,t=e.config,n=t.get('cloudServices')||{};for(const e in n)this[e]=n[e];return this.tokenUrl?(this.token=new Vk.Token(this.tokenUrl),this.token.init()):void(this.token=null)}}Vk.Token=Ik;class Nk extends mf{static get requires(){return[Qb,Vk]}init(){const e=this.editor,t=e.plugins.get(Vk),n=t.token,o=t.uploadUrl;n&&(this._uploadGateway=new Nk._UploadGateway(n,o),e.plugins.get(Qb).createUploadAdapter=(e)=>new Fk(this._uploadGateway,e))}}class Fk{constructor(e,t){this.uploadGateway=e,this.loader=t}upload(){return this.fileUploader=this.uploadGateway.upload(this.loader.file),this.fileUploader.on('progress',(e,t)=>{this.loader.uploadTotal=t.total,this.loader.uploaded=t.uploaded}),this.fileUploader.send()}abort(){this.fileUploader.abort()}}Nk._UploadGateway=class{constructor(e,t){if(!e)throw new Error('Token must be provided');if(!t)throw new Error('Api address must be provided');this._token=e,this._apiAddress=t}upload(e){return new Ok(e,this._token,this._apiAddress)}};class Dk{constructor(){this._stack=[]}add(e,t){const n=this._stack,o=n[0];this._insertDescriptor(e);const i=n[0];o===i||gr(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||gr(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(!gr(e,t[n])){-1t.id===e);-1Er(t)})),t.for('editingDowncast').add(Ct({model:'image',view:(e,t)=>Cr(Er(t),t,o('g'))})),t.for('downcast').add(mr('src')).add(mr('alt')).add(ur()),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(pr())}}class Hk extends Ou{constructor(e){super(e),this.domEventType='mousedown'}onDomEvent(e){this.fire(e.type,e)}}var Wk=o(39),Uk=o.n(Wk);const Kk=oe('Ctrl+A');class Gk extends mf{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')&&br(t)&&(o.addClass(zk,t),this._previouslySelected.add(t),t==r&&o.setSelection(i.getRanges(),{fake:!0,label:vr(r)}))}},{priority:'low'}),e.addObserver(Hk),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(!Rr(r)&&(br(r)||(r=r.findAncestor(br),!!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==Up.delete||n==Up.arrowdown||n==Up.arrowright;let i=!1;Sr(n)?i=this._handleArrowKeys(o):Or(t)?i=this._selectAllNestedEditableContent()||this._selectAllContent():n===Up.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 Yu&&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(tm.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&&br(r)){const n=t.mapper.toModelElement(r.parent);return e.change((e)=>{e.setSelection(tm.createIn(n))}),!0}return!1}_setSelectionOverElement(e){this.editor.model.change((t)=>{t.setSelection(tm.createOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model,n=t.schema,o=t.document.selection,i=new rm(o);t.modifySelection(i,{direction:e?'forward':'backward'});const r=e?i.focus.nodeBefore:i.focus.nodeAfter;return r instanceof Yu&&n.isObject(r)?r:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass(zk,t);this._previouslySelected.clear()}}class $k extends mb{refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=Pr(e),this.value=!!(Pr(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 Jk extends mf{init(){this.editor.commands.add('imageTextAlternative',new $k(this.editor))}}class Qk extends yf{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 Xf(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 Yk=o(41),Xk=o.n(Yk);class Zk extends yf{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 e_=o(4),t_=o.n(e_),n_=o(5),o_=o.n(n_),i_=o(43),r_=o.n(i_);class a_ extends yf{constructor(e){super(e);const n=this.locale.t;this.focusTracker=new Sf,this.keystrokes=new lf,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(n('at'),t_.a,'ck-button-save'),this.saveButtonView.type='submit',this.cancelButtonView=this._createButton(n('au'),o_.a,'ck-button-cancel','cancel'),this._focusables=new gf,this._focusCycler=new Of({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),Vr({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 zb(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 Qk(this.locale,Zk);return t.label=e('bb'),t.inputView.placeholder=e('bb'),t}}var s_=o(45),l_=o.n(s_);class d_ extends mf{static get requires(){return[Ef]}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 zb(t);return i.set({label:n('aw'),icon:l_.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 a_(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',()=>{Tr(n.selection)?this._isVisible&&Nr(e):this._hideForm(!0)}),Ir({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:Fr(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 c_ extends mf{static get requires(){return[Jk,d_]}static get pluginName(){return'ImageTextAlternative'}}var p_=o(46),u_=o.n(p_);class m_ extends mf{static get requires(){return[qk,Gk,c_]}static get pluginName(){return'Image'}}class g_ extends yf{constructor(e){super(e),this.buttonView=new zb(e),this._fileInputView=new h_(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 h_ extends yf{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()}}var f_=o(48),b_=o.n(f_);class k_ extends mf{init(){const e=this.editor,n=e.t;e.ui.componentFactory.add('imageUpload',(t)=>{const o=new g_(t),i=e.commands.get('imageUpload');return o.set({acceptedType:'image/*',allowMultipleFiles:!0}),o.buttonView.set({label:n('m'),icon:b_.a,tooltip:!0}),o.buttonView.bind('isEnabled').to(i),o.on('done',(t,n)=>{for(const o of Array.from(n)){const t=Mr(e.model.document.selection);Dr(o)&&e.execute('imageUpload',{file:o,insertAt:t})}}),o})}}var __=o(49),w_=o.n(__),v_=o(50),y_=o.n(v_),x_=o(52),C_=o.n(x_);class A_ extends mf{constructor(e){super(e),this.placeholder='data:image/svg+xml;utf8,'+encodeURIComponent(w_.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(Qb),a=r?t.attributeNewValue:null,s=this.placeholder,l=o.editing.mapper.toViewElement(i),d=n.writer;if('reading'==a)return Br(l,d),void zr(s,l,d);if('uploading'==a){const t=e.loaders.get(r);return Br(l,d),void(t?(jr(l,d),qr(l,d,t,o.editing.view)):zr(s,l,d))}'complete'==a&&e.loaders.get(r)&&Wr(l,d,o.editing.view),Hr(l,d),jr(l,d),Lr(l,d)}}}const T_=Symbol('progress-bar');class P_ extends mb{execute(e){const t=this.editor,n=t.model.document,o=e.file,i=t.plugins.get(Qb);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 rm([new tm(e.insertAt)]):n.selection,t.model.insertContent(s,l),s.parent&&r.setSelection(s,'on')})}}class E_ extends mf{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 S_ extends mf{static get requires(){return[Qb,E_]}init(){const e=this.editor,t=e.model.document,n=e.model.schema,o=e.plugins.get(Qb);n.extend('image',{allowAttributes:['uploadId','uploadStatus']}),e.commands.add('imageUpload',new P_(e)),this.listenTo(e.editing.view.document,'clipboardInput',(n,i)=>{if(Gr(i.dataTransfer))return;let r=new rm(i.targetRanges.map((t)=>e.editing.mapper.toModelRange(t)));for(const a of i.dataTransfer.files){if(Dr(a)){const t=Mr(r);e.model.change((n)=>{const i=o.createLoader(a);if(i){const o=n.createElement('image',{uploadId:i.id}),r=new rm([new tm(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(Qb),s=i.plugins.get(E_);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=Ks(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('n'),namespace:'upload'}),o(),r.enqueueChange('transparent',(e)=>{e.remove(n)})})}}class O_ extends mf{static get pluginName(){return'ImageUpload'}static get requires(){return[S_,k_,A_]}}class R_ extends mf{static get requires(){return[Nk,m_,O_]}static get pluginName(){return'EasyImage'}}class I_ extends mb{refresh(){const e=this.editor.model,t=e.document,n=rr(t.selection.getSelectedBlocks());this.value=!!n&&n.is('paragraph'),this.isEnabled=!!n&&$r(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')&&$r(e,t.schema)&&o.rename(e,'paragraph')})}}class V_ extends mf{static get pluginName(){return'Paragraph'}init(){const e=this.editor,t=e.model,n=e.data;e.commands.add('paragraph',new I_(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(V_.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,em.createAt(e));t.modelRange=new tm(em.createBefore(e),i.end),t.modelCursor=t.modelRange.end}else Qr(t.viewItem,t.modelCursor,n.schema)&&(t=Object.assign(t,Jr(t.viewItem,t.modelCursor,n)))},{priority:'low'}),n.upcastDispatcher.on('text',(e,t,n)=>{t.modelRange||Qr(t.viewItem,t.modelCursor,n.schema)&&(t=Object.assign(t,Jr(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}}}V_.paragraphLikeElements=new Set(['blockquote','dd','div','dt','h1','h2','h3','h4','h5','h6','li','p','td']);class N_ extends mb{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)=>Yr(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)=>Yr(e,o,t.schema));for(const t of i)t.is(o)||e.rename(t,o)})}}const F_='paragraph';class D_ extends mf{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[V_]}init(){const e=this.editor,t=e.config.get('heading.options'),n=[];for(const o of t)o.model!==F_&&(e.model.schema.register(o.model,{inheritAllFrom:'$block'}),e.conversion.elementToElement(o),n.push(o.model));e.commands.add('heading',new N_(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(F_)&&0===i.childCount&&o.writer.rename(i,F_)})}}class M_{constructor(e,t){t&&wp(this,t),e&&this.set(e)}}f(M_,Ap);class B_ extends yf{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 L_=o(54),z_=o.n(L_);class j_ extends yf{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 Sf,this.keystrokes=new lf,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 q_=o(56),H_=o.n(q_);class W_ extends zb{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 Nb;return e.content=H_.a,e.extendTemplate({attributes:{class:'ck-dropdown__arrow'}}),e}}var U_=o(57),K_=o.n(U_);class G_ extends yf{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new Sf,this.keystrokes=new lf,this._focusCycler=new Of({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 $_ extends yf{constructor(){super(),this.set('tabindex',-1),this.keystrokes=new lf;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 J_ extends yf{constructor(e){super(e),this.setTemplate({tag:'li',attributes:{class:['ck','ck-list__separator']}})}}var Q_=o(59),Y_=o.n(Q_),X_=o(61),Z_=o.n(X_),ew=o(6),tw=o.n(ew);class nw extends mf{init(){const e=this.editor,n=e.t,t=ia(e),o=n('e'),i=n('f');e.ui.componentFactory.add('heading',(n)=>{const r={},a=new Fp,s=e.commands.get('heading'),l=e.commands.get('paragraph'),d=[s];for(const e of t){const t=new M_({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=Xr(n);return Zr(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 ow extends mf{static get requires(){return[D_,nw]}static get pluginName(){return'Heading'}}var iw=o(64),rw=o.n(iw);const aw=new WeakMap,sw=Symbol('imageCaption');class lw extends mf{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:ca,model:'caption'}));i.downcastDispatcher.on('insert:caption',pa((e)=>e.createContainerElement('figcaption'),!1));const t=la(n,a('ai'));r.downcastDispatcher.on('insert:caption',pa(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=da(r);o=t.toViewElement(e)}const a=i.getFirstPosition(),s=ma(a.parent);if(s&&(o=t.toViewElement(s)),o)return n?n===o?ha(o,e):(ga(n,e),this._lastSelectedCaption=o,ha(o,e)):(this._lastSelectedCaption=o,ha(o,e));if(n){const t=ga(n,e);return this._lastSelectedCaption=null,t}return!1}_fixCaptionVisibility(e){return(t,n,o)=>{const i=e(n),r=ma(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(!da(n))return e.appendElement('caption',n),!0}}}var dw=o(66),cw=o.n(dw);class pw extends mf{static get requires(){return[lw]}static get pluginName(){return'ImageCaption'}}class uw extends mb{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=Pr(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 mw=o(68),gw=o.n(mw),hw=o(69),fw=o.n(hw),bw=o(70),kw=o.n(bw),_w=o(71),ww=o.n(_w);const vw={full:{name:'full',title:'Full size image',icon:gw.a,isDefault:!0},side:{name:'side',title:'Side image',icon:ww.a,className:'image-style-side'},alignLeft:{name:'alignLeft',title:'Left aligned image',icon:fw.a,className:'image-style-align-left'},alignCenter:{name:'alignCenter',title:'Centered image',icon:kw.a,className:'image-style-align-center'},alignRight:{name:'alignRight',title:'Right aligned image',icon:ww.a,className:'image-style-align-right'}},yw={full:gw.a,left:fw.a,right:ww.a,center:kw.a};class xw extends mf{static get requires(){return[qk]}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=_a(e.config.get('image.styles'));t.extend('image',{allowAttributes:'imageStyle'});const r=fa(i);o.downcastDispatcher.on('attribute:imageStyle:image',r),n.downcastDispatcher.on('attribute:imageStyle:image',r),n.upcastDispatcher.on('element:figure',ba(i),{priority:'low'}),e.commands.add('imageStyle',new uw(e,i))}}var Cw=o(72),Aw=o.n(Cw);class Tw extends mf{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=va(_a(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 zb(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 Pw extends mf{static get requires(){return[xw,Tw]}static get pluginName(){return'ImageStyle'}}class Ew extends mf{static get requires(){return[Ef]}static get pluginName(){return'ImageToolbar'}init(){const e=this.editor,t=e.plugins.get('BalloonToolbar');t&&this.listenTo(t,'show',(t)=>{Tr(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 Nf,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?Tr(e.editing.view.document.selection)?this._showToolbar():this._hideToolbar():this._hideToolbar()}_showToolbar(){const e=this.editor;this._isVisible?Nr(e):!this._balloon.hasView(this._toolbar)&&this._balloon.add({view:this._toolbar,position:Fr(e),balloonClassName:'ck-toolbar-container'})}_hideToolbar(){this._isVisible&&this._balloon.remove(this._toolbar)}get _isVisible(){return this._balloon.visibleView==this._toolbar}}class Sw extends mb{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=ya(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(tm.createOn(r))}}else{const i=t.schema.getValidRanges(n.getRanges(),'linkHref');for(const t of i)o.setAttribute('linkHref',e,t)}})}}class Ow extends mb{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?[ya(t.getFirstPosition(),t.getAttribute('linkHref'))]:t.getRanges();for(const t of n)e.removeAttribute('linkHref',t)})}}const Rw=Symbol('linkElement'),Iw=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Vw=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;class Nw{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&&Sa(this._modelSelection.getFirstPosition(),n)||this._restoreGravity()))}handleForwardMovement(e,t){const n=this.attribute;return this._isGravityOverridden||e.isAtStart&&this._hasSelectionAttribute?void 0:Ia(e,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(t),this._removeSelectionAttribute(),!0):Oa(e,n)?(this._preventCaretMovement(t),this._overrideGravity(),!0):Ra(e,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(t),this._overrideGravity(),!0):void 0}handleBackwardMovement(e,t){const n=this.attribute;if(this._isGravityOverridden)return Ia(e,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(t),this._restoreGravity(),this._removeSelectionAttribute(),!0):(this._preventCaretMovement(t),this._restoreGravity(),e.isAtStart&&this._removeSelectionAttribute(),!0);return Ia(e,n)&&!this._hasSelectionAttribute?(this._preventCaretMovement(t),this._setSelectionAttributeFromTheNodeBefore(e),!0):e.isAtEnd&&Ra(e,n)?this._hasSelectionAttribute?void(Va(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(Va(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 Fw=o(74),Dw=o.n(Fw);const Mw='ck-link_selected';class Bw extends mf{init(){const e=this.editor;e.model.schema.extend('$text',{allowAttributes:'linkHref'}),e.conversion.for('dataDowncast').add(At({model:'linkHref',view:Aa})),e.conversion.for('editingDowncast').add(At({model:'linkHref',view:(e,t)=>Aa(Ta(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 Sw(e)),e.commands.add('unlink',new Ow(e)),Ea(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=ya(o.getFirstPosition(),o.getAttribute('linkHref')),r=e.editing.mapper.toViewRange(i);for(const e of r.getItems())e.is('a')&&(t.addClass(Mw,e),n.add(e))}}),e.conversion.for('editingDowncast').add((e)=>{function o(){t.change((e)=>{for(const t of n.values())e.removeClass(Mw,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 Lw extends Ou{constructor(e){super(e),this.domEventType='click'}onDomEvent(e){this.fire(e.type,e)}}var zw=o(76),jw=o.n(zw);class qw extends yf{constructor(e){super(e);const n=e.t;this.focusTracker=new Sf,this.keystrokes=new lf,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n('at'),t_.a,'ck-button-save'),this.saveButtonView.type='submit',this.cancelButtonView=this._createButton(n('au'),o_.a,'ck-button-cancel','cancel'),this._focusables=new gf,this._focusCycler=new Of({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(),Vr({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 Qk(this.locale,Zk);return t.label=e('av'),t.inputView.placeholder='https://example.com',t}_createButton(e,t,n,o){const i=new zb(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 Hw=o(78),Ww=o.n(Hw),Uw=o(79),Kw=o.n(Uw),Gw=o(80),$w=o.n(Gw);class Jw extends yf{constructor(e){super(e);const n=e.t;this.focusTracker=new Sf,this.keystrokes=new lf,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(n('ap'),Ww.a,'unlink'),this.editButtonView=this._createButton(n('aq'),Kw.a,'edit'),this.set('href'),this._focusables=new gf,this._focusCycler=new Of({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 zb(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.delegate('execute').to(this,n),o}_createPreviewButton(){const e=new zb(this.locale),n=this.bindTemplate,o=this.t;return e.set({withText:!0,tooltip:o('ar')}),e.extendTemplate({attributes:{class:['ck','ck-link-actions__preview'],href:n.to('href',(e)=>e&&Ta(e)),target:'_blank'}}),e.bind('label').to(this,'href',(e)=>e||o('as')),e.bind('isEnabled').to(this,'href',(e)=>!!e),e.template.tag='a',e.template.eventListeners={},e}}var Qw=o(82),Yw=o.n(Qw);const Xw='Ctrl+K';class Zw extends mf{static get requires(){return[Ef]}init(){const e=this.editor;e.editing.view.addObserver(Lw),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=e.plugins.get(Ef),this._createToolbarLinkButton(),this._enableUserBalloonInteractions()}_createActionsView(){const e=this.editor,t=new Jw(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(Xw,(e,t)=>{this._addFormView(),t()}),t}_createFormView(){const e=this.editor,t=new qw(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(Xw,(e,t)=>{t(),n.isEnabled&&this._showUI()}),e.ui.componentFactory.add('link',(e)=>{const t=new zb(e);return t.isEnabled=!0,t.label=o('aj'),t.icon=Yw.a,t.keystroke=Xw,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())}),Ir({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 Na(e.getFirstPosition());else{const t=e.getFirstRange().getTrimmed(),n=Na(t.start),o=Na(t.end);return n&&n==o?Ip.createIn(n).getTrimmed().isEqual(t)?n:null:null}}}class ev extends mf{static get requires(){return[Bw,Zw]}static get pluginName(){return'Link'}}class tv extends mb{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)=>Da(t,e.schema)),o=!0===this.value;e.change((e)=>{if(o){let t=n[n.length-1].nextSibling,o=Us,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 ov extends mf{static get requires(){return[V_]}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)=>Qa(e.model,t)),n.mapper.registerViewToModelLength('li',is),t.mapper.registerViewToModelLength('li',is),n.mapper.on('modelToViewPosition',$a),n.mapper.on('viewToModelPosition',Ja),t.mapper.on('modelToViewPosition',$a),n.downcastDispatcher.on('insert',Ha,{priority:'high'}),n.downcastDispatcher.on('insert:listItem',La),t.downcastDispatcher.on('insert',Ha,{priority:'high'}),t.downcastDispatcher.on('insert:listItem',La),n.downcastDispatcher.on('attribute:listType:listItem',ja),t.downcastDispatcher.on('attribute:listType:listItem',ja),n.downcastDispatcher.on('attribute:listIndent:listItem',qa),t.downcastDispatcher.on('attribute:listIndent:listItem',qa),n.downcastDispatcher.on('remove:listItem',za),n.downcastDispatcher.on('remove',Wa,{priority:'low'}),t.downcastDispatcher.on('remove:listItem',za),t.downcastDispatcher.on('remove',Wa,{priority:'low'}),t.upcastDispatcher.on('element:ul',Ka,{priority:'high'}),t.upcastDispatcher.on('element:ol',Ka,{priority:'high'}),t.upcastDispatcher.on('element:li',Ga,{priority:'high'}),t.upcastDispatcher.on('element:li',Ua),e.model.on('insertContent',Ya,{priority:'high'}),e.commands.add('numberedList',new tv(e,'numbered')),e.commands.add('bulletedList',new tv(e,'bulleted')),e.commands.add('indentList',new nv(e,'forward')),e.commands.add('outdentList',new nv(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 iv=o(83),rv=o.n(iv),av=o(84),sv=o.n(av);class lv extends mf{init(){const e=this.editor.t;this._addButton('numberedList',e('o'),rv.a),this._addButton('bulletedList',e('p'),sv.a)}_addButton(e,t,n){const o=this.editor;o.ui.componentFactory.add(e,(i)=>{const r=o.commands.get(e),a=new zb(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 dv extends mf{static get requires(){return[ov,lv]}static get pluginName(){return'List'}}class cv{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),Rs(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 Rs(t,e,o,i,this.getColumns(e));const r=new cv(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)}Rs(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;Is(l,n,em.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&&ds('headingColumns',p+a,o,n)}})}splitCellHorizontally(e,t=2){const n=this.editor.model,o=ls(e),i=o.getChildIndex(e.parent),r=parseInt(e.getAttribute('rowspan')||1),a=parseInt(e.getAttribute('colspan')||1);n.change((n)=>{if(1t===e),p={};1=i+d&&e===c&&0==(t+i+d)%l){const e=em.createFromParentAndOffset(o.getChild(t),r);n.insertElement('tableCell',p,e)}}}if(ri){n.setAttribute('rowspan',o+s,t)}const d={};1i&&ds('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 mv extends mb{refresh(){const e=this.editor.model,t=e.document.selection,n=e.schema,o=Ns(t.getFirstPosition());this.isEnabled=n.checkChild(o,'table')}execute(e={}){const t=this.editor.model,n=t.document.selection,o=this.editor.plugins.get(uv),i=parseInt(e.rows)||2,r=parseInt(e.columns)||2,a=n.getFirstPosition(),s=a.parent===a.root,l=s?em.createAt(a):em.createAfter(a.parent);t.change((e)=>{const t=o.createTable(l,i,r);e.setSelection(em.createAt(t.getChild(0).getChild(0)))})}}class gv extends mb{constructor(e,t={}){super(e),this.order=t.order||'below'}refresh(){const e=this.editor.model.document.selection,t=ls(e.getFirstPosition());this.isEnabled=!!t}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get(uv),o=t.getFirstPosition().parent,i=ls(t.getFirstPosition()),r=i.getChildIndex(o.parent),a='below'===this.order?r+1:r;n.insertRows(i,{rows:1,at:a})}}class hv extends mb{constructor(e,t={}){super(e),this.order=t.order||'after'}refresh(){const e=this.editor.model.document.selection,t=ls(e.getFirstPosition());this.isEnabled=!!t}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get(uv),o=ls(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 fv extends mb{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(uv);r?a.splitCellHorizontally(i,2):a.splitCellVertically(i,2)}}class bv extends mb{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(tm.createIn(a),em.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(tm.createIn(r))})}_getMergeableCell(){const e=this.editor.model,t=e.document,n=t.selection.getFirstPosition().parent;if(n.is('tableCell')){const e=this.isHorizontal?Fs(n,this.direction):Ds(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 kv extends mb{refresh(){const e=this.editor.model,t=e.document,n=t.selection.getFirstPosition().parent;this.isEnabled=n.is('tableCell')&&1{s&&a<=s&&ds('headingRows',s-1,r,e,0);const t=[...new cv(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})=>ds('rowspan',n-1,t,e));const o=a+1,l=new cv(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?em.createAfter(d):em.createAt(r.getChild(t));e.move(tm.createOn(i),s),ds('rowspan',a,i,e),d=i}else d=i;e.remove(i)})}}class _v extends mb{refresh(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get(uv),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?ds('colspan',o-1,t,e):n===c&&e.remove(t)})}}class wv extends mb{refresh(){const e=this.editor.model,t=e.document,n=t.selection,o=n.getFirstPosition(),i=ls(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=Ms(a,l,s);for(const n of t)Bs(n,l,e)}ds('headingRows',l,a,e,0)})}_isInHeading(e,t){const n=parseInt(t.getAttribute('headingRows')||0);return!!n&&e.parent.index{ds('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[uv]}_handleTabOnSelectedTable(e,t){const n=t.keyCode==Up.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(tm.createIn(i.getChild(0).getChild(0)))})}}}_handleTabInsideTable(e,t){const n=t.keyCode==Up.tab;if(!n||t.ctrlKey)return;const o=this.editor,i=o.model.document.selection,r=ls(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,p=0===d;if(!c&&p&&0===l)return;const u=d===s.childCount-1,m=l===r.childCount-1;c&&m&&u&&o.plugins.get(uv).insertRows(r,{at:r.childCount});let g;if(c&&u){const e=r.getChild(l+1);g=e.getChild(0)}else if(!c&&p){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(tm.createIn(g))})}}var Av=o(87),Tv=o.n(Av);class Pv extends yf{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 Ev;e.on('over',()=>{const e=$s(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=$s(o/10);n.set('isOn',i{const o=e.commands.get('insertTable'),i=Xr(t);i.bind('isEnabled').to(o),i.buttonView.set({icon:Ov.a,label:n('q'),tooltip:!0});const r=new Pv(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('r'),bindIsActive:!0},'|',{commandName:'insertTableColumnBefore',label:n('s')},{commandName:'insertTableColumnAfter',label:n('t')},{commandName:'removeTableColumn',label:n('u')}];return this._prepareDropdown(n('v'),Iv.a,t,e)}),e.ui.componentFactory.add('tableRow',(e)=>{const t=[{commandName:'setTableRowHeader',label:n('w'),bindIsActive:!0},'|',{commandName:'insertTableRowBelow',label:n('x')},{commandName:'insertTableRowAbove',label:n('y')},{commandName:'removeTableRow',label:n('z')}];return this._prepareDropdown(n('aa'),Nv.a,t,e)}),e.ui.componentFactory.add('mergeTableCells',(e)=>{const t=[{commandName:'mergeTableCellUp',label:n('ab')},{commandName:'mergeTableCellRight',label:n('ac')},{commandName:'mergeTableCellDown',label:n('ad')},{commandName:'mergeTableCellLeft',label:n('ae')},'|',{commandName:'splitTableCellVertically',label:n('af')},{commandName:'splitTableCellHorizontally',label:n('ag')}];return this._prepareDropdown(n('ah'),Dv.a,t,e)})}_prepareDropdown(e,t,n,o){const i=this.editor,r=Xr(o),a=[],s=new Fp;for(const r of n)Ls(r,i,a,s);return Zr(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 Bv=o(93),Lv=o.n(Bv);class zv extends mf{static get requires(){return[Cv,Mv,Gk]}static get pluginName(){return'Table'}}class jv extends mf{static get requires(){return[Ef]}static get pluginName(){return'TableToolbar'}init(){const e=this.editor,t=e.plugins.get('BalloonToolbar');t&&this.listenTo(t,'show',(t)=>{us(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 Nf,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;ms(t)?this._showToolbar():this._hideToolbar()}}_showToolbar(){const e=this.editor;this._isVisible?zs(e):!this._balloon.hasView(this._toolbar)&&this._balloon.add({view:this._toolbar,position:js(e),balloonClassName:'ck-toolbar-container'})}_hideToolbar(){this._isVisible&&this._balloon.remove(this._toolbar)}get _isVisible(){return this._balloon.visibleView==this._toolbar}}var qv=o(95),Hv=o.n(qv),Wv=o(96),Uv=o.n(Wv);qs.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:Hs(e,!0)}
`;const o=this.options.langPrefix+Hs(t,!0);return`
${n?e:Hs(e,!0)}
`},qs.prototype.blockquote=function(e){return`
${e}
`},qs.prototype.html=function(e){return e},qs.prototype.heading=function(e,t){return`${e}`},qs.prototype.hr=function(){return this.options.xhtml?'
':'
'},qs.prototype.list=function(e,t){const n=t?'ol':'ul';return`<${n}>${e}`},qs.prototype.listitem=function(e){return`
  • ${e}
  • `},qs.prototype.paragraph=function(e){return`

    ${e}

    `},qs.prototype.table=function(e,t){return`${e}${t}
    `},qs.prototype.tablerow=function(e){return''+e+''},qs.prototype.tablecell=function(e,t){const n=t.header?'th':'td',o=t.align?`<${n} align="${t.align}">`:`<${n}>`;return o+e+``},qs.prototype.strong=function(e){return`${e}`},qs.prototype.em=function(e){return`${e}`},qs.prototype.codespan=function(e){return`${e.trim()}`},qs.prototype.br=function(){return this.options.xhtml?'
    ':'
    '},qs.prototype.del=function(e){return`${e}`},qs.prototype.link=function(e,t,n){if(this.options.sanitize){let t;try{t=decodeURIComponent(Ws(e)).replace(/[^\w:]/g,'').toLowerCase()}catch(t){return''}if(0===t.indexOf('javascript:')||0===t.indexOf('vbscript:'))return''}let o='',o},qs.prototype.image=function(e,t,n){let o=''+n+'':'>',o},qs.prototype.text=function(e){return e};var Kv=[{filter:(e)=>{const t=/lang-(.+)/;return'PRE'===e.nodeName&&e.firstChild&&'CODE'===e.firstChild.nodeName&&t.test(e.firstChild.className)},replacement:(e,t)=>{const n=/lang-(.+)/,o=n.exec(t.firstChild.className)[1];return'\n\n``` '+o+'\n'+t.firstChild.textContent+'\n```\n\n'}},{filter:(e)=>'A'===e.nodeName&&!e.getAttribute('href'),replacement:(e,t)=>{const n=t.title?`"${t.title}"`:'';return`[${e}](${n})`}},{filter:['h1','h2','h3','h4','h5','h6'],replacement:(e,t)=>{const n=t.nodeName.charAt(1);let o='';for(let r=0;r{const t=e.previousSibling||e.nextSibling,n='PRE'===e.parentNode.nodeName&&!t;return'CODE'===e.nodeName&&!n},replacement:(e)=>-1this.buildResponse(e[0]))}buildResponse(e){return{default:e.uploadUrl}}abort(){return!1}}class Jv extends mf{static get requires(){return[Qb]}static get pluginName(){return'OpUploadPlugin'}init(){this.editor.plugins.get('FileRepository').createUploadAdapter=(e)=>{const t=this.editor.config.openProject,n=t.context;return new $v(e,n)}}}class Qv extends $f{}n.BalloonEditor=Qv;class Yv extends lb{}n.ClassicEditor=Yv,window.OPBalloonEditor=Qv,window.OPClassicEditor=Yv;const Xv={plugins:[Gb,tk,rk,mk,wk,Ek,R_,ow,m_,pw,Pw,Ew,O_,ev,dv,V_,function(e){e.data.processor=new Gv},zv,jv,Jv],config:{toolbar:{items:['heading','|','bold','italic','link','bulletedList','numberedList','imageUpload','blockQuote','|','insertTable','|','undo','redo']},image:{toolbar:['imageStyle:full','|','imageTextAlternative']},table:{toolbar:['tableColumn','tableRow','mergeTableCells']},language:'en'}};Yv.build=Xv,Qv.build=Xv},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(10),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(12);'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(15);'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(17);'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(19);'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(21);'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(23);'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(25);'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(27);'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(29);'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(31);'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='\n'},function(e,t,n){var o=n(38);'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(40);'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(42);'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(44);'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(47);'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){e.exports='\n'},function(e){e.exports='Uploading image\u2026\n'},function(e,t,n){var o=n(51);'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{position:relative;overflow:hidden}.ck-content .image.ck-infinite-progress:before{content:"";position:absolute;top:0;right:0}.ck-content .image .ck-progress-bar{position:absolute;top:0;left:0}:root{--ck-image-upload-progress-line-width:30px}.ck-content .image.ck-appear{animation:fadeIn .7s}.ck-content .image.ck-infinite-progress:before{width:var(--ck-image-upload-progress-line-width);height:2px;background:var(--ck-color-upload-infinite-background);animation-name:readingProgressAnimation;animation-duration:1.5s;animation-iteration-count:infinite;transition-timing-function:linear}.ck-content .image.ck-image-upload-placeholder>img{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(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='.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}}'},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='.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(58);'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(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.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(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-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(65);'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(67);'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(73);'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(75);'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(77);'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(81);'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(86);'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(88);'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(94);'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(t,n,o){(function(n){(function(){function n(e){this.tokens=[],this.tokens.links={},this.options=e||p.defaults,this.rules=u.normal,this.options.gfm&&(this.options.tables?this.rules=u.tables:this.rules=u.gfm)}function o(e,t){if(this.options=t||p.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||p.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 u();if(delete t.highlight,!d)return u();for(;lAn error occured:

    '+a(n.message+'',!0)+'
    ';throw n}}var u={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]+/};u.bullet=/(?:[*+-]|\d+\.)/,u.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,u.item=l(u.item,'gm')(/bull/g,u.bullet)(),u.list=l(u.list)(/bull/g,u.bullet)('hr','\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))')('def','\\n+(?='+u.def.source+')')(),u.blockquote=l(u.blockquote)('def',u.def)(),u._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',u.html=l(u.html)('comment',//)('closed',/<(tag)[\s\S]+?<\/\1>/)('closing',/])*?>/)(/tag/g,u._tag)(),u.paragraph=l(u.paragraph)('hr',u.hr)('heading',u.heading)('lheading',u.lheading)('blockquote',u.blockquote)('tag','<'+u._tag)('def',u.def)(),u.normal=c({},u),u.gfm=c({},u.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),u.gfm.paragraph=l(u.paragraph)('(?!','(?!'+u.gfm.fences.source.replace('\\1','\\2')+'|'+u.list.source.replace('\\1','\\3')+'|')(),u.tables=c({},u.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),n.rules=u,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,p,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;n<','>'+t+'<')},t.exports=b},{"./lib/gfm-converters":2,"./lib/html-parser":3,"./lib/md-converters":4,"collapse-whitespace":7}],2:[function(e,t){'use strict';function n(e,t){var n=Array.prototype.indexOf.call(t.parentNode.childNodes,t),o=' ';return 0===n&&(o='| '),o+e+' |'}var o=/highlight highlight-(\S+)/;t.exports=[{filter:'br',replacement:function(){return'\n'}},{filter:['del','s','strike'],replacement:function(e){return'~~'+e+'~~'}},{filter:function(e){return'checkbox'===e.type&&'LI'===e.parentNode.nodeName},replacement:function(e,t){return(t.checked?'[x]':'[ ]')+' '}},{filter:['th','td'],replacement:function(e,t){return n(e,t)}},{filter:'tr',replacement:function(e,t){var o='',r={left:':--',right:'--:',center:':-:'};if('THEAD'===t.parentNode.nodeName)for(var a=0;a '),'\n\n'+e+'\n\n'}},{filter:'li',replacement:function(e,t){e=e.replace(/^\s+/,'').replace(/\n/gm,'\n ');var n='* ',o=t.parentNode,i=Array.prototype.indexOf.call(o.children,t)+1;return n=/ol/i.test(o.nodeName)?i+'. ':'* ',n+e}},{filter:['ul','ol'],replacement:function(e,t){for(var n=[],o=0;o keyCode` pairs for a set of known keys.\n *\n * Contains:\n *\n * * `a-z`,\n * * `0-9`,\n * * `f1-f12`,\n * * `arrow(left|up|right|bottom)`,\n * * `backspace`, `delete`, `enter`, `esc`, `tab`,\n * * `ctrl`, `cmd`, `shift`, `alt`.\n */\nexport const keyCodes = generateKnownKeyCodes();\n\n/**\n * Converts a key name or a {@link module:utils/keyboard~KeystrokeInfo keystroke info} into a key code.\n *\n * Note: Key names are matched with {@link module:utils/keyboard~keyCodes} in a case-insensitive way.\n *\n * @param {String|module:utils/keyboard~KeystrokeInfo} Key name (see {@link module:utils/keyboard~keyCodes})\n * or a keystroke data object.\n * @returns {Number} Key or keystroke code.\n */\nexport function getCode( key ) {\n\tlet keyCode;\n\n\tif ( typeof key == 'string' ) {\n\t\tkeyCode = keyCodes[ key.toLowerCase() ];\n\n\t\tif ( !keyCode ) {\n\t\t\t/**\n\t\t\t * Unknown key name. Only key names contained by the {@link module:utils/keyboard~keyCodes} can be used.\n\t\t\t *\n\t\t\t * @errror keyboard-unknown-key\n\t\t\t * @param {String} key\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'keyboard-unknown-key: Unknown key name.', { key } );\n\t\t}\n\t} else {\n\t\tkeyCode = key.keyCode +\n\t\t\t( key.altKey ? keyCodes.alt : 0 ) +\n\t\t\t( key.ctrlKey ? keyCodes.ctrl : 0 ) +\n\t\t\t( key.shiftKey ? keyCodes.shift : 0 );\n\t}\n\n\treturn keyCode;\n}\n\n/**\n * Parses keystroke and returns a keystroke code that will match the code returned by\n * link {@link module:utils/keyboard.getCode} for a corresponding {@link module:utils/keyboard~KeystrokeInfo keystroke info}.\n *\n * The keystroke can be passed in two formats:\n *\n * * as a single string – e.g. `ctrl + A`,\n * * as an array of {@link module:utils/keyboard~keyCodes known key names} and key codes – e.g.:\n * * `[ 'ctrl', 32 ]` (ctrl + space),\n * * `[ 'ctrl', 'a' ]` (ctrl + A).\n *\n * Note: Key names are matched with {@link module:utils/keyboard~keyCodes} in a case-insensitive way.\n *\n * Note: Only keystrokes with a single non-modifier key are supported (e.g. `ctrl+A` is OK, but `ctrl+A+B` is not).\n *\n * @param {String|Array.} keystroke Keystroke definition.\n * @returns {Number} Keystroke code.\n */\nexport function parseKeystroke( keystroke ) {\n\tif ( typeof keystroke == 'string' ) {\n\t\tkeystroke = splitKeystrokeText( keystroke );\n\t}\n\n\treturn keystroke\n\t\t.map( key => ( typeof key == 'string' ) ? getCode( key ) : key )\n\t\t.reduce( ( key, sum ) => sum + key, 0 );\n}\n\n/**\n * It translates any keystroke string text like `\"CTRL+A\"` to an\n * environment–specific keystroke, i.e. `\"⌘A\"` on Mac OSX.\n *\n * @param {String} keystroke Keystroke text.\n * @returns {String} Keystroke text specific for the environment.\n */\nexport function getEnvKeystrokeText( keystroke ) {\n\tif ( !env.isMac ) {\n\t\treturn keystroke;\n\t}\n\n\treturn splitKeystrokeText( keystroke )\n\t\t// Replace modifiers (e.g. \"ctrl\") with Mac glyphs (e.g. \"⌘\") first.\n\t\t.map( key => modifiersToMacGlyphs[ key.toLowerCase() ] || key )\n\n\t\t// Decide whether to put \"+\" between keys in the keystroke or not.\n\t\t.reduce( ( value, key ) => {\n\t\t\tif ( value.slice( -1 ) in macGlyphsToModifiers ) {\n\t\t\t\treturn value + key;\n\t\t\t} else {\n\t\t\t\treturn value + '+' + key;\n\t\t\t}\n\t\t} );\n}\n\nfunction generateKnownKeyCodes() {\n\tconst keyCodes = {\n\t\tarrowleft: 37,\n\t\tarrowup: 38,\n\t\tarrowright: 39,\n\t\tarrowdown: 40,\n\t\tbackspace: 8,\n\t\tdelete: 46,\n\t\tenter: 13,\n\t\tspace: 32,\n\t\tesc: 27,\n\t\ttab: 9,\n\n\t\t// The idea about these numbers is that they do not collide with any real key codes, so we can use them\n\t\t// like bit masks.\n\t\tctrl: 0x110000,\n\t\t// Has the same code as ctrl, because their behaviour should be unified across the editor.\n\t\t// See http://ckeditor.github.io/editor-recommendations/general-policies#ctrl-vs-cmd\n\t\tcmd: 0x110000,\n\t\tshift: 0x220000,\n\t\talt: 0x440000\n\t};\n\n\t// a-z\n\tfor ( let code = 65; code <= 90; code++ ) {\n\t\tconst letter = String.fromCharCode( code );\n\n\t\tkeyCodes[ letter.toLowerCase() ] = code;\n\t}\n\n\t// 0-9\n\tfor ( let code = 48; code <= 57; code++ ) {\n\t\tkeyCodes[ code - 48 ] = code;\n\t}\n\n\t// F1-F12\n\tfor ( let code = 112; code <= 123; code++ ) {\n\t\tkeyCodes[ 'f' + ( code - 111 ) ] = code;\n\t}\n\n\treturn keyCodes;\n}\n\nfunction splitKeystrokeText( keystroke ) {\n\treturn keystroke.split( /\\s*\\+\\s*/ );\n}\n\n/**\n * Information about a keystroke.\n *\n * @interface module:utils/keyboard~KeystrokeInfo\n */\n\n/**\n * The [key code](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode).\n *\n * @member {Number} module:utils/keyboard~KeystrokeInfo#keyCode\n */\n\n/**\n * Whether the Alt modifier was pressed.\n *\n * @member {Bolean} module:utils/keyboard~KeystrokeInfo#altKey\n */\n\n/**\n * Whether the Ctrl or Cmd modifier was pressed.\n *\n * @member {Bolean} module:utils/keyboard~KeystrokeInfo#ctrlKey\n */\n\n/**\n * Whether the Shift modifier was pressed.\n *\n * @member {Bolean} module:utils/keyboard~KeystrokeInfo#shiftKey\n */\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js\n// module id = null\n// module chunks = "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 14);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 13cc763ef23467db87e2","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(selector) {\n\t\tif (typeof memo[selector] === \"undefined\") {\n\t\t\tvar styleTarget = fn.call(this, selector);\n\t\t\t// Special case to return head of iframe instead of iframe itself\n\t\t\tif (styleTarget instanceof window.HTMLIFrameElement) {\n\t\t\t\ttry {\n\t\t\t\t\t// This will throw an exception if access to iframe is blocked\n\t\t\t\t\t// due to cross-origin restrictions\n\t\t\t\t\tstyleTarget = styleTarget.contentDocument.head;\n\t\t\t\t} catch(e) {\n\t\t\t\t\tstyleTarget = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmemo[selector] = styleTarget;\n\t\t}\n\t\treturn memo[selector]\n\t};\n})(function (target) {\n\treturn document.querySelector(target)\n});\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = require(\"./urls\");\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== \"undefined\" && DEBUG) {\n\t\tif (typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === \"object\" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of