8
0

ckeditor.js 408 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  1. var _NumberPOSITIVE_INFINITY=Number.POSITIVE_INFINITY,_Mathfloor=Math.floor,_Mathmax=Math.max,_Mathmin=Math.min;(function(r,s){if('object'==typeof exports&&'object'==typeof module)module.exports=s();else if('function'==typeof define&&define.amd)define([],s);else{var d=s();for(var u in d)('object'==typeof exports?exports:r)[u]=d[u]}})(this,function(){return function(o){function r(d){if(s[d])return s[d].exports;var u=s[d]={i:d,l:!1,exports:{}};return o[d].call(u.exports,u,u.exports,r),u.l=!0,u.exports}var s={};return r.m=o,r.c=s,r.i=function(d){return d},r.d=function(d,u,f){r.o(d,u)||Object.defineProperty(d,u,{configurable:!1,enumerable:!0,get:f})},r.n=function(d){var u=d&&d.__esModule?function(){return d['default']}:function(){return d};return r.d(u,'a',u),u},r.o=function(d,u){return Object.prototype.hasOwnProperty.call(d,u)},r.p='',r(r.s=526)}([function(o,r){'use strict';/**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */class d extends Error{constructor(u,f){f&&(u+=' '+JSON.stringify(f)),super(u),this.name='CKEditorError',this.data=f}static isCKEditorError(u){return u instanceof d}}r.a=d},function(o,r,s){'use strict';var d=s(34),u=s(19),f=s(52),h=s(0),w=s(24);/**
  5. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  6. * For licensing, see LICENSE.md.
  7. */class C{constructor(T,P){if(!T.is('element')&&!T.is('documentFragment'))throw new h.a('model-position-root-invalid: Position root invalid.');if(!(P instanceof Array)||0===P.length)throw new h.a('model-position-path-incorrect: Position path must be an Array with at least one item.',{path:P});P=T.getPath().concat(P),T=T.root,this.root=T,this.path=P}get offset(){return s.i(u.a)(this.path)}set offset(T){this.path[this.path.length-1]=T}get parent(){let T=this.root;for(let P=0;P<this.path.length-1;P++)T=T.getChild(T.offsetToIndex(this.path[P]));return T}get index(){return this.parent.offsetToIndex(this.offset)}get textNode(){let T=this.parent.getChild(this.index);return T instanceof w.a&&T.startOffset<this.offset?T:null}get nodeAfter(){return null===this.textNode?this.parent.getChild(this.index):null}get nodeBefore(){return null===this.textNode?this.parent.getChild(this.index-1):null}get isAtStart(){return 0===this.offset}get isAtEnd(){return this.offset==this.parent.maxOffset}compareWith(T){if(this.root!=T.root)return'different';const P=s.i(f.a)(this.path,T.path);return'same'===P?'same':'prefix'===P?'before':'extension'===P?'after':this.path[P]<T.path[P]?'before':'after'}getLastMatchingPosition(T,P={}){P.startPosition=this;const S=new d.a(P);return S.skip(T),S.position}getParentPath(){return this.path.slice(0,-1)}getAncestors(){return this.parent.is('documentFragment')?[this.parent]:this.parent.getAncestors({includeNode:!0})}getCommonPath(T){if(this.root!=T.root)return[];let P=s.i(f.a)(this.path,T.path),S='string'==typeof P?_Mathmin(this.path.length,T.path.length):P;return this.path.slice(0,S)}getShiftedBy(T){let P=C.createFromPosition(this),S=P.offset+T;return P.offset=0>S?0:S,P}isAfter(T){return'after'==this.compareWith(T)}isBefore(T){return'before'==this.compareWith(T)}isEqual(T){return'same'==this.compareWith(T)}isTouching(T){let P=null,S=null,E=this.compareWith(T);switch(E){case'same':return!0;case'before':P=C.createFromPosition(this),S=C.createFromPosition(T);break;case'after':P=C.createFromPosition(T),S=C.createFromPosition(this);break;default:return!1;}for(let O=P.parent;P.path.length+S.path.length;){if(P.isEqual(S))return!0;if(P.path.length>S.path.length){if(P.offset!==O.maxOffset)return!1;P.path=P.path.slice(0,-1),O=O.parent,P.offset++}else{if(0!==S.offset)return!1;S.path=S.path.slice(0,-1)}}}_getTransformedByDeletion(T,P){let S=C.createFromPosition(this);if(this.root!=T.root)return S;if('same'==s.i(f.a)(T.getParentPath(),this.getParentPath())){if(T.offset<this.offset){if(T.offset+P>this.offset)return null;S.offset-=P}}else if('prefix'==s.i(f.a)(T.getParentPath(),this.getParentPath())){const E=T.path.length-1;if(T.offset<=this.path[E]){if(T.offset+P>this.path[E])return null;S.path[E]-=P}}return S}_getTransformedByInsertion(T,P,S){let E=C.createFromPosition(this);if(this.root!=T.root)return E;if('same'==s.i(f.a)(T.getParentPath(),this.getParentPath()))(T.offset<this.offset||T.offset==this.offset&&S)&&(E.offset+=P);else if('prefix'==s.i(f.a)(T.getParentPath(),this.getParentPath())){const O=T.path.length-1;T.offset<=this.path[O]&&(E.path[O]+=P)}return E}_getTransformedByMove(T,P,S,E,O){let V=this._getTransformedByDeletion(T,S);return P=P._getTransformedByDeletion(T,S),V=null===V||O&&V.isEqual(T)?this._getCombined(T,P):V._getTransformedByInsertion(P,S,E),V}_getCombined(T,P){const S=T.path.length-1;let E=C.createFromPosition(P);return E.offset=E.offset+this.path[S]-T.offset,E.path=E.path.concat(this.path.slice(S+1)),E}static createAt(T,P){if(T instanceof C)return this.createFromPosition(T);const S=T;if('end'==P)P=S.maxOffset;else{if('before'==P)return this.createBefore(S);if('after'==P)return this.createAfter(S);P||(P=0)}return this.createFromParentAndOffset(S,P)}static createAfter(T){if(!T.parent)throw new h.a('model-position-after-root: You can not make position after root.',{root:T});return this.createFromParentAndOffset(T.parent,T.endOffset)}static createBefore(T){if(!T.parent)throw new h.a('model-position-before-root: You can not make position before root.',{root:T});return this.createFromParentAndOffset(T.parent,T.startOffset)}static createFromParentAndOffset(T,P){if(!T.is('element')&&!T.is('documentFragment'))throw new h.a('model-position-parent-incorrect: Position parent have to be a element or document fragment.');const S=T.getPath();return S.push(P),new this(T.root,S)}static createFromPosition(T){return new this(T.root,T.path.slice())}static fromJSON(T,P){if('$graveyard'===T.root)return new C(P.graveyard,T.path);if(!P.hasRoot(T.root))throw new h.a('model-position-fromjson-no-root: Cannot create position for document. Root with specified name does not exist.',{rootName:T.root});return new C(P.getRoot(T.root),T.path)}}r.a=C},function(o,r,s){'use strict';var d=s(1),u=s(34),f=s(0);/**
  8. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  9. * For licensing, see LICENSE.md.
  10. */class h{constructor(w,C=null){this.start=d.a.createFromPosition(w),this.end=C?d.a.createFromPosition(C):d.a.createFromPosition(w)}*[Symbol.iterator](){yield*new u.a({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return this.start.parent===this.end.parent}get root(){return this.start.root}containsPosition(w){return w.isAfter(this.start)&&w.isBefore(this.end)}containsRange(w){return this.containsPosition(w.start)&&this.containsPosition(w.end)}isEqual(w){return this.start.isEqual(w.start)&&this.end.isEqual(w.end)}isIntersecting(w){return this.start.isBefore(w.end)&&this.end.isAfter(w.start)}getDifference(w){const C=[];return this.isIntersecting(w)?(this.containsPosition(w.start)&&C.push(new h(this.start,w.start)),this.containsPosition(w.end)&&C.push(new h(w.end,this.end))):C.push(h.createFromRange(this)),C}getIntersection(w){if(this.isIntersecting(w)){let C=this.start,T=this.end;return this.containsPosition(w.start)&&(C=w.start),this.containsPosition(w.end)&&(T=w.end),new h(C,T)}return null}getMinimalFlatRanges(){const w=[],C=this.start.getCommonPath(this.end).length;let T=d.a.createFromPosition(this.start),P=T.parent;for(;T.path.length>C+1;){let S=P.maxOffset-T.offset;0!=S&&w.push(new h(T,T.getShiftedBy(S))),T.path=T.path.slice(0,-1),T.offset++,P=P.parent}for(;T.path.length<=this.end.path.length;){let S=this.end.path[T.path.length-1],E=S-T.offset;0!=E&&w.push(new h(T,T.getShiftedBy(E))),T.offset=S,T.path.push(0)}return w}getWalker(w={}){return w.boundaries=this,new u.a(w)}*getItems(w={}){w.boundaries=this,w.ignoreElementEnd=!0;const C=new u.a(w);for(let T of C)yield T.item}*getPositions(w={}){w.boundaries=this;const C=new u.a(w);yield C.position;for(let T of C)yield T.nextPosition}getTransformedByDelta(w){let C=[h.createFromRange(this)];const T=new Set(['insert','move','remove','reinsert']);for(let P of w.operations)if(T.has(P.type))for(let S=0;S<C.length;S++){const E=C[S]._getTransformedByDocumentChange(P.type,w.type,P.targetPosition||P.position,P.howMany||P.nodes.maxOffset,P.sourcePosition);C.splice(S,1,...E),S+=E.length-1}return C}getTransformedByDeltas(w){let C=[h.createFromRange(this)];for(let T of w)for(let P=0,S;P<C.length;P++)S=C[P].getTransformedByDelta(T),C.splice(P,1,...S),P+=S.length-1;for(let T=0;T<C.length;T++){const P=C[T];for(let S=T+1;S<C.length;S++){const E=C[S];(P.containsRange(E)||E.containsRange(P)||P.isEqual(E))&&C.splice(S,1)}}return C}_getTransformedByDocumentChange(w,C,T,P,S){if('insert'==w)return this._getTransformedByInsertion(T,P,!1,!1);const E=h.createFromPositionAndShift(S,P);if('merge'==C&&this.isCollapsed&&(this.start.isEqual(E.start)||this.start.isEqual(E.end)))return[new h(T.getShiftedBy(this.start.offset))];if('move'==w){if(E.containsPosition(this.start)&&this.containsPosition(E.end)&&this.end.isAfter(T)){let O=this.start._getCombined(S,T._getTransformedByDeletion(S,P));const V=this.end._getTransformedByMove(S,T,P,!1,!1);return[new h(O,V)]}if(E.containsPosition(this.end)&&this.containsPosition(E.start)&&this.start.isBefore(T)){const O=this.start._getTransformedByMove(S,T,P,!0,!1);let V=this.end._getCombined(S,T._getTransformedByDeletion(S,P));return[new h(O,V)]}}return this._getTransformedByMove(S,T,P)}_getTransformedByInsertion(w,C,T=!1,P=!1){if(T&&this.containsPosition(w))return[new h(this.start,w),new h(w._getTransformedByInsertion(w,C,!0),this.end._getTransformedByInsertion(w,C,this.isCollapsed))];const S=h.createFromRange(this);let E=!!S.isCollapsed||!P,O=!!S.isCollapsed||P;return S.start=S.start._getTransformedByInsertion(w,C,E),S.end=S.end._getTransformedByInsertion(w,C,O),[S]}_getTransformedByMove(w,C,T){if(this.isCollapsed){const F=this.start._getTransformedByMove(w,C,T,!0,!1);return[new h(F)]}let P;const S=new h(w,w.getShiftedBy(T)),E=this.getDifference(S);let O=null;const V=this.getIntersection(S);1==E.length?O=new h(E[0].start._getTransformedByDeletion(w,T),E[0].end._getTransformedByDeletion(w,T)):2==E.length&&(O=new h(this.start,this.end._getTransformedByDeletion(w,T)));const R=C._getTransformedByDeletion(w,T);return P=O?O._getTransformedByInsertion(R,T,null!==V):[],V&&P.push(new h(V.start._getCombined(S.start,R),V.end._getCombined(S.start,R))),P}static createFromPositionAndShift(w,C){const T=w,P=w.getShiftedBy(C);return 0<C?new this(T,P):new this(P,T)}static createFromParentsAndOffsets(w,C,T,P){return new this(d.a.createFromParentAndOffset(w,C),d.a.createFromParentAndOffset(T,P))}static createFromRange(w){return new this(w.start,w.end)}static createIn(w){return this.createFromParentsAndOffsets(w,0,w,w.maxOffset)}static createOn(w){return this.createFromPositionAndShift(d.a.createBefore(w),w.offsetSize)}static createFromRanges(w){if(0===w.length)throw new f.a('range-create-from-ranges-empty-array: At least one range has to be passed.');else if(1==w.length)return this.createFromRange(w[0]);const C=w[0];w.sort((S,E)=>S.start.isAfter(E.start));const T=w.indexOf(C),P=new this(C.start,C.end);for(let S=T-1;0<=S&&w[S].end.isEqual(P.start);S++)P.start=d.a.createFromPosition(w[S].start);for(let S=T+1;S<w.length&&w[S].start.isEqual(P.end);S++)P.end=d.a.createFromPosition(w[S].end);return P}static fromJSON(w,C){return new this(d.a.fromJSON(w.start,C),d.a.fromJSON(w.end,C))}}r.a=h},function(o,r,s){'use strict';var d=s(32),u=s(4);/**
  11. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  12. * For licensing, see LICENSE.md.
  13. */class f{constructor(h){this.editor=h}init(){}afterInit(){}destroy(){}}r.a=f,s.i(u.a)(f,d.a)},function(o,r){'use strict';r.a=/**
  14. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  15. * For licensing, see LICENSE.md.
  16. */function(u,...f){f.forEach((h)=>{Object.getOwnPropertyNames(h).concat(Object.getOwnPropertySymbols(h)).forEach((w)=>{if(!(w in u.prototype)){const C=Object.getOwnPropertyDescriptor(h,w);C.enumerable=!1,Object.defineProperty(u.prototype,w,C)}})})}},function(o,r,s){'use strict';function d(T){return'string'==typeof T?[new h.a(T)]:(s.i(w.a)(T)||(T=[T]),Array.from(T).map((P)=>'string'==typeof P?new h.a(P):P))}var u=s(59),f=s(72),h=s(24),w=s(41);/**
  17. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  18. * For licensing, see LICENSE.md.
  19. */class C extends u.a{constructor(T,P,S){super(P),this.name=T,this._children=new f.a,S&&this.insertChildren(0,S)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}is(T,P=null){return P?'element'==T&&P==this.name:'element'==T||T==this.name}getChild(T){return this._children.getNode(T)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(T){return this._children.getNodeIndex(T)}getChildStartOffset(T){return this._children.getNodeStartOffset(T)}clone(T=!1){const P=T?Array.from(this._children).map((S)=>S.clone()):Array.from(this._children);return new C(this.name,this.getAttributes(),P)}offsetToIndex(T){return this._children.offsetToIndex(T)}appendChildren(T){this.insertChildren(this.childCount,T)}insertChildren(T,P){P=d(P);for(let S of P)S.parent=this;this._children.insertNodes(T,P)}removeChildren(T,P=1){const S=this._children.removeNodes(T,P);for(let E of S)E.parent=null;return S}getNodeByPath(T){let P=this;for(const S of T)P=P.getChild(S);return P}toJSON(){let T=super.toJSON();if(T.name=this.name,0<this._children.length){T.children=[];for(let P of this._children)T.children.push(P.toJSON())}return T}static fromJSON(T){let P=null;if(T.children){P=[];for(let S of T.children)S.name?P.push(C.fromJSON(S)):P.push(h.a.fromJSON(S))}return new C(T.name,T.attributes,P)}}r.a=C},function(o,r,s){'use strict';function d(oe){return!!oe&&((oe.value&&(oe=oe.value),Array.isArray(oe))?oe.some(d):!!(oe instanceof te))}function u(oe,ie){return oe.map((re)=>{return re instanceof te?re.getValue(ie):re})}function f(oe,ie,{node:re}){let se=u(oe,re);se=1==oe.length&&oe[0]instanceof ne?se[0]:se.reduce(F,''),I(se)?ie.remove():ie.set(se)}function h(oe){return{set(ie){oe.textContent=ie},remove(){oe.textContent=''}}}function w(oe,ie,re){return{set(se){oe.setAttributeNS(re,ie,se)},remove(){oe.removeAttributeNS(re,ie)}}}function C(oe,ie){return{set(re){oe.style[ie]=re},remove(){oe.style[ie]=null}}}function T(oe){const ie=s.i(J.a)(oe,(re)=>{if(re&&(re instanceof te||D(re)||L(re)||q(re)))return re});return ie}function P(oe){if('string'==typeof oe?oe=O(oe):oe.text&&V(oe),oe.on&&(oe.eventListeners=E(oe.on),delete oe.on),!oe.text){oe.attributes&&S(oe.attributes);const ie=new W.a;if(oe.children)if(q(oe.children))ie.add(oe.children);else for(let re of oe.children)D(re)||L(re)?ie.add(re):ie.add(new ee(re));oe.children=ie}return oe}function S(oe){for(let ie in oe)oe[ie].value&&(oe[ie].value=[].concat(oe[ie].value)),R(oe,ie)}function E(oe){for(let ie in oe)R(oe,ie);return oe}function O(oe){return{text:[oe]}}function V(oe){Array.isArray(oe.text)||(oe.text=[oe.text])}function R(oe,ie){Array.isArray(oe[ie])||(oe[ie]=[oe[ie]])}function F(oe,ie){return I(ie)?oe:I(oe)?ie:`${oe} ${ie}`}function N(oe,ie){for(let re in ie)oe[re]?oe[re].push(...ie[re]):oe[re]=ie[re]}function M(oe,ie){if(ie.attributes&&(!oe.attributes&&(oe.attributes={}),N(oe.attributes,ie.attributes)),ie.eventListeners&&(!oe.eventListeners&&(oe.eventListeners={}),N(oe.eventListeners,ie.eventListeners)),ie.text&&oe.text.push(...ie.text),ie.children&&ie.children.length){if(oe.children.length!=ie.children.length)throw new K.a('ui-template-extend-children-mismatch: The number of children in extended definition does not match.');let re=0;for(let se of ie.children)M(oe.children.get(re++),se)}}function I(oe){return!oe&&0!==oe}function L(oe){return oe instanceof Z.a}function D(oe){return oe instanceof ee}function q(oe){return oe instanceof G.a}function z(){return{children:[],bindings:[],attributes:{}}}function $(oe){return'class'==oe||'style'==oe}var K=s(0),H=s(4),U=s(7),W=s(79),Z=s(9),G=s(120),J=s(504),Y=s(15),X=s(58);/**
  20. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  21. * For licensing, see LICENSE.md.
  22. */class ee{constructor(oe){Object.assign(this,P(T(oe))),this._isRendered=!1,this._revertData=null}render(){const oe=this._renderNode({intoFragment:!0});return this._isRendered=!0,oe}apply(oe){return this._revertData=z(),this._renderNode({node:oe,isApplying:!0,revertData:this._revertData}),oe}revert(oe){if(!this._revertData)throw new K.a('ui-template-revert-not-applied: Attempting reverting a template which has not been applied yet.');this._revertTemplateFromNode(oe,this._revertData)}static bind(oe,ie){return{to(re,se){return new ae({eventNameOrFunction:re,attribute:re,observable:oe,emitter:ie,callback:se})},if(re,se,le){return new ne({observable:oe,emitter:ie,attribute:re,valueIfTrue:se,callback:le})}}}static extend(oe,ie){oe._isRendered&&X.a.warn('template-extend-render: Attempting to extend a template which has already been rendered.'),M(oe,P(T(ie)))}_renderNode(oe){let ie;if(ie=oe.node?this.tag&&this.text:this.tag?this.text:!this.text,ie)throw new K.a('ui-template-wrong-syntax: Node definition must have either "tag" or "text" when rendering new Node.');return this.text?this._renderText(oe):this._renderElement(oe)}_renderElement(oe){let ie=oe.node;return ie||(ie=oe.node=document.createElementNS(this.ns||'http://www.w3.org/1999/xhtml',this.tag)),this._renderAttributes(oe),this._renderElementChildren(oe),this._setUpListeners(oe),ie}_renderText(oe){let ie=oe.node;return ie?oe.revertData.text=ie.textContent:ie=oe.node=document.createTextNode(''),d(this.text)?this._bindToObservable({schema:this.text,updater:h(ie),data:oe}):ie.textContent=this.text.join(''),ie}_renderAttributes(oe){let ie,re,se,le;if(this.attributes){const de=oe.node,ce=oe.revertData;for(ie in this.attributes)if(se=de.getAttribute(ie),re=this.attributes[ie],ce&&(ce.attributes[ie]=se),le=s.i(Y.a)(re[0])&&re[0].ns?re[0].ns:null,d(re)){const ue=le?re[0].value:re;ce&&$(ie)&&ue.unshift(se),this._bindToObservable({schema:ue,updater:w(de,ie,le),data:oe})}else'style'==ie&&'string'!=typeof re[0]?this._renderStyleAttribute(re[0],oe):(ce&&se&&$(ie)&&re.unshift(se),re=re.map((ue)=>ue?ue.value||ue:ue).reduce((ue,me)=>ue.concat(me),[]).reduce(F,''),I(re)||de.setAttributeNS(le,ie,re))}}_renderStyleAttribute(oe,ie){const re=ie.node;for(let se in oe){const le=oe[se];d(le)?this._bindToObservable({schema:[le],updater:C(re,se),data:ie}):re.style[se]=le}}_renderElementChildren(oe){const ie=oe.node,re=oe.intoFragment?document.createDocumentFragment():ie,se=oe.isApplying;let le=0;for(let de of this.children)if(q(de)){if(!se){de.setParent(ie);for(let ce of de)re.appendChild(ce.element)}}else if(L(de))se||re.appendChild(de.element);else if(se){const ce=oe.revertData,ue=z();ce.children.push(ue),de._renderNode({node:re.childNodes[le++],isApplying:!0,revertData:ue})}else re.appendChild(de.render());oe.intoFragment&&ie.appendChild(re)}_setUpListeners(oe){if(this.eventListeners)for(let ie in this.eventListeners){const re=this.eventListeners[ie].map((se)=>{const[le,de]=ie.split('@');return se.activateDomEventListener(le,de,oe)});oe.revertData&&oe.revertData.bindings.push(re)}}_bindToObservable({schema:oe,updater:ie,data:re}){const se=re.revertData;f(oe,ie,re);const le=oe.filter((de)=>!I(de)).filter((de)=>de.observable).map((de)=>de.activateAttributeListener(oe,ie,re));se&&se.bindings.push(le)}_revertTemplateFromNode(oe,ie){for(let re of ie.bindings)for(let se of re)se();if(ie.text)return void(oe.textContent=ie.text);for(let re in ie.attributes){const se=ie.attributes[re];null===se?oe.removeAttribute(re):oe.setAttribute(re,se)}for(let re=0;re<ie.children.length;++re)this._revertTemplateFromNode(oe.childNodes[re],ie.children[re])}}r.a=ee,s.i(H.a)(ee,U.a);class te{constructor(oe){Object.assign(this,oe)}getValue(oe){const ie=this.observable[this.attribute];return this.callback?this.callback(ie,oe):ie}activateAttributeListener(oe,ie,re){const se=()=>f(oe,ie,re);return this.emitter.listenTo(this.observable,'change:'+this.attribute,se),()=>{this.emitter.stopListening(this.observable,'change:'+this.attribute,se)}}}class ae extends te{activateDomEventListener(oe,ie,re){const se=(le,de)=>{(!ie||de.target.matches(ie))&&('function'==typeof this.eventNameOrFunction?this.eventNameOrFunction(de):this.observable.fire(this.eventNameOrFunction,de))};return this.emitter.listenTo(re.node,oe,se),()=>{this.emitter.stopListening(re.node,oe,se)}}}class ne extends te{getValue(oe){const ie=super.getValue(oe);return!I(ie)&&(this.valueIfTrue||!0)}}},function(o,r,s){'use strict';function u(M,I){M[F]||(M[F]=I||s.i(O.a)())}function f(M){return M[F]}function h(M){return M._events||Object.defineProperty(M,'_events',{value:{}}),M._events}function w(){return{callbacks:[],childEvents:[]}}function C(M,I){const L=h(M);if(L[I])return;let D=I,q=null;const z=[];for(;''!==D&&!L[D];)L[D]=w(),z.push(L[D]),q&&L[D].childEvents.push(q),q=D,D=D.substr(0,D.lastIndexOf(':'));if(''!==D){for(let $ of z)$.callbacks=L[D].callbacks.slice();L[D].childEvents.push(q)}}function T(M,I){const L=h(M)[I];if(!L)return[];let D=[L.callbacks];for(let q=0,z;q<L.childEvents.length;q++)z=T(M,L.childEvents[q]),D=D.concat(z);return D}function P(M,I){let L;return M._events&&(L=M._events[I])&&L.callbacks.length?L.callbacks:-1<I.indexOf(':')?P(M,I.substr(0,I.lastIndexOf(':'))):null}function S(M,I,L){for(let[D,q]of M){q?'function'==typeof q&&(q=q(I.name)):q=I.name;const z=new E.a(I.source,q);z.path=[...I.path],D.fire(z,...L)}}var E=s(422),O=s(70),V=s(523);r.b=function(M,I){return M[R]&&M[R][I]?M[R][I].emitter:null},r.c=u;/**
  23. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  24. * For licensing, see LICENSE.md.
  25. */const R=Symbol('listeningTo'),F=Symbol('emitterId'),N={on(M,I,L={}){C(this,M);const D=T(this,M),q=V.a.get(L.priority);I={callback:I,context:L.context||this,priority:q};for(let z of D){let $=!1;for(let K=0;K<z.length;K++)if(z[K].priority<q){z.splice(K,0,I),$=!0;break}$||z.push(I)}},once(M,I,L){this.on(M,function(q){q.off(),I.apply(this,arguments)},L)},off(M,I,L){const D=T(this,M);for(let q of D)for(let z=0;z<q.length;z++)q[z].callback==I&&(L&&L!=q[z].context||(q.splice(z,1),z--))},listenTo(M,I,L,D){let q,z,$,K;this[R]||(this[R]={}),q=this[R],f(M)||u(M),z=f(M),($=q[z])||($=q[z]={emitter:M,callbacks:{}}),(K=$.callbacks[I])||(K=$.callbacks[I]=[]),K.push(L),M.on(I,L,D)},stopListening(M,I,L){let D=this[R],q=M&&f(M),z=D&&q&&D[q],$=z&&I&&z.callbacks[I];if(D&&(!M||z)&&(!I||$))if(L)M.off(I,L);else if($){for(;L=$.pop();)M.off(I,L);delete z.callbacks[I]}else if(z){for(I in z.callbacks)this.stopListening(M,I);delete D[q]}else{for(q in D)this.stopListening(D[q].emitter);delete this[R]}},fire(M,...I){const L=M instanceof E.a?M:new E.a(this,M),D=L.name;let q=P(this,D);if(L.path.push(this),q){const z=[L,...I];q=Array.from(q);for(let $=0;$<q.length&&(q[$].callback.apply(q[$].context,z),L.off.called&&(delete L.off.called,this.off(D,q[$].callback,q[$].context)),!L.stop.called);$++);}if(this._delegations){const z=this._delegations.get(D),$=this._delegations.get('*');z&&S(z,L,I),$&&S($,L,I)}},delegate(...M){return{to:(I,L)=>{this._delegations||(this._delegations=new Map);for(let D of M){let q=this._delegations.get(D);q?q.set(I,L):this._delegations.set(D,new Map([[I,L]]))}}}},stopDelegating(M,I){if(this._delegations)if(!M)this._delegations.clear();else if(!I)this._delegations.delete(M);else{const L=this._delegations.get(M);L&&L.delete(I)}}};r.a=N},function(o,r,s){'use strict';var u=s(195),f=s(16),w=_Mathmax;r.a=function(C,T){if('function'!=typeof C)throw new TypeError('Expected a function');return T=w(void 0===T?C.length-1:s.i(f.a)(T),0),function(){for(var P=arguments,S=-1,E=w(P.length-T,0),O=Array(E);++S<E;)O[S]=P[T+S];switch(T){case 0:return C.call(this,O);case 1:return C.call(this,P[0],O);case 2:return C.call(this,P[0],P[1],O);}var V=Array(T+1);for(S=-1;++S<T;)V[S]=P[S];return V[T]=O,s.i(u.a)(C,this,V)}}},function(o,r,s){'use strict';var d=s(0),u=s(120),f=s(6),h=s(80),w=s(32),C=s(79),T=s(4),P=s(41);/**
  26. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  27. * For licensing, see LICENSE.md.
  28. */class S{constructor(E){this.locale=E,this.t=E&&E.t,this.set('ready',!1),this._viewCollections=new C.a,this._unboundChildren=this.createCollection(),this._viewCollections.on('add',(O,V)=>{V.locale=E})}get element(){return this._element?this._element:this.template?(this._addTemplateChildren(),this._element=this.template.render()):null}set element(E){this._element=E}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=f.a.bind(this,this)}createCollection(){const E=new u.a;return this._viewCollections.add(E),E}addChildren(E){s.i(P.a)(E)||(E=[E]);for(let O of E)this._unboundChildren.add(O)}init(){if(this.ready)throw new d.a('ui-view-init-reinit: This View has already been initialized.');return Promise.resolve().then(()=>{return Promise.all(this._viewCollections.map((E)=>E.init()))}).then(()=>{this.ready=!0})}destroy(){this.stopListening();const E=this._viewCollections.map((O)=>O.destroy());return this._unboundChildren.clear(),this._viewCollections.clear(),this.element=this.template=this.locale=this.t=this._viewCollections=this._unboundChildren=null,Promise.all(E)}_addTemplateChildren(){const E=(O)=>{if(O.children)for(let V of O.children)V instanceof S?this.addChildren(V):E(V)};E(this.template)}}r.a=S,s.i(T.a)(S,h.a),s.i(T.a)(S,w.a)},function(o,r,s){'use strict';var u=s(444),f=s(445),h=s(229),w=s(11),C=s(515);r.a=function(T){return'function'==typeof T?T:null==T?h.a:'object'==typeof T?s.i(w.a)(T)?s.i(f.a)(T[0],T[1]):s.i(u.a)(T):s.i(C.a)(T)}},function(o,r){'use strict';var d=Array.isArray;r.a=d},function(o,r,s){'use strict';function d(w,C){C.isEnabled=!1}var u=s(32),f=s(4);/**
  29. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  30. * For licensing, see LICENSE.md.
  31. */class h{constructor(w){this.editor=w,this.set('isEnabled',!0),this._checkEnabled&&this.on('refreshState',(C,T)=>{T.isEnabled=this._checkEnabled()})}destroy(){this.stopListening()}refreshState(){const w={isEnabled:!0};this.fire('refreshState',w),this.isEnabled=w.isEnabled}_execute(w){this.isEnabled&&this._doExecute(w)}_disable(){this.on('refreshState',d),this.refreshState()}_enable(){this.off('refreshState',d),this.refreshState()}_doExecute(){}}r.a=h,s.i(f.a)(h,u.a)},function(o,r,s){'use strict';function u(L){if(!L.isFlat)throw new M.a('model-writer-remove-range-not-flat: Trying to remove a range that starts and ends in different element.');const D=L.start.parent;P(L.start),P(L.end);const q=D.removeChildren(L.start.index,L.end.index-L.start.index);return T(D,L.start.index),q}function C(L){const D=[];L instanceof Array||(L=[L]);for(let q=0;q<L.length;q++)if('string'==typeof L[q])D.push(new O.a(L[q]));else if(L[q]instanceof V.a)D.push(new O.a(L[q].data,L[q].getAttributes()));else if(L[q]instanceof F.a||L[q]instanceof N.a)for(let z of L[q])D.push(z);else L[q]instanceof E.a&&D.push(L[q]);for(let q=1;q<D.length;q++){const z=D[q],$=D[q-1];z instanceof O.a&&$ instanceof O.a&&S(z,$)&&(D.splice(q-1,2,new O.a($.data+z.data,$.getAttributes())),q--)}return D}function T(L,D){const q=L.getChild(D-1),z=L.getChild(D);if(q&&z&&q.is('text')&&z.is('text')&&S(q,z)){const $=new O.a(q.data+z.data,q.getAttributes());L.removeChildren(D-1,2),L.insertChildren(D-1,$)}}function P(L){const D=L.textNode,q=L.parent;if(D){const z=L.offset-D.startOffset,$=D.index;q.removeChildren($,1);const K=new O.a(D.data.substr(0,z),D.getAttributes()),H=new O.a(D.data.substr(z),D.getAttributes());q.insertChildren($,[K,H])}}function S(L,D){const q=L.getAttributes(),z=D.getAttributes();for(let $ of q){if($[1]!==D.getAttribute($[0]))return!1;z.next()}return z.next().done}var E=s(59),O=s(24),V=s(61),R=s(2),F=s(49),N=s(72),M=s(0);r.c=u,r.b=C;/**
  32. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  33. * For licensing, see LICENSE.md.
  34. */r.a={insert:function(L,D){D=C(D);const q=D.reduce((K,H)=>K+H.offsetSize,0),z=L.parent;P(L);const $=L.index;return z.insertChildren($,D),T(z,$+D.length),T(z,$),new R.a(L,L.getShiftedBy(q))},remove:u,move:function(L,D){if(!L.isFlat)throw new M.a('model-writer-move-range-not-flat: Trying to move a range that starts and ends in different element.');const q=this.remove(L);return D=D._getTransformedByDeletion(L.start,L.end.offset-L.start.offset),this.insert(D,q)},setAttribute:function(L,D,q){P(L.start),P(L.end);for(let z of L.getItems()){let $=z.is('textProxy')?z.textNode:z;null===q?$.removeAttribute(D):$.setAttribute(D,q),T($.parent,$.index)}T(L.end.parent,L.end.index)},removeAttribute:function(L,D){this.setAttribute(L,D,null)},normalizeNodes:C}},function(o,r,s){'use strict';var u=s(96),f=s(43);r.a=function(h){return s.i(f.a)(h)&&s.i(u.a)(h)}},function(o,r){'use strict';r.a=function(u){var f=typeof u;return!!u&&('object'==f||'function'==f)}},function(o,r,s){'use strict';var u=s(517);r.a=function(f){var h=s.i(u.a)(f),w=h%1;return h===h?w?h-w:h:0}},function(o,r,s){'use strict';var u=s(0);r.b=function(h,w){if(f.prototype[h])throw new u.a('model-batch-register-taken: This batch method name is already taken.',{name:h});f.prototype[h]=w};/**
  35. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  36. * For licensing, see LICENSE.md.
  37. */class f{constructor(h,w='default'){this.document=h,this.deltas=[],this.type=w}get baseVersion(){return 0<this.deltas.length?this.deltas[0].baseVersion:null}addDelta(h){return h.batch=this,this.deltas.push(h),h}*getOperations(){for(let h of this.deltas)yield*h.operations}}r.a=f},function(o,r,s){'use strict';var d=s(0),u=s(346);/**
  38. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  39. * For licensing, see LICENSE.md.
  40. */const f=new Map;r.a=class{static fromJSON(w,C){if(!f.has(w.__className))throw new d.a('delta-fromjson-no-deserializer: This delta has no defined deserializer',{name:w.__className});let T=f.get(w.__className),P=new T;for(let S of w.operations)P.addOperation(u.a.fromJSON(S,C));return P}static register(w){f.set(w.className,w)}}},function(o,r){'use strict';r.a=function(u){var f=u?u.length:0;return f?u[f-1]:void 0}},function(o,r,s){'use strict';var d=s(95),u=s(18);/**
  41. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  42. * For licensing, see LICENSE.md.
  43. */class f{constructor(){this.batch=null,this.operations=[]}get baseVersion(){return 0<this.operations.length?this.operations[0].baseVersion:null}set baseVersion(h){for(let w of this.operations)w.baseVersion=h++}get _reverseDeltaClass(){return f}addOperation(h){return h.delta=this,this.operations.push(h),h}clone(){let h=new this.constructor;for(let w of this.operations)h.addOperation(w.clone());return h}getReversed(){let h=new this._reverseDeltaClass;for(let w of this.operations)h.addOperation(w.getReversed());h.operations.reverse();for(let w=0;w<h.operations.length;w++)h.operations[w].baseVersion=this.operations[this.operations.length-1].baseVersion+w+1;return h}toJSON(){let h=s.i(d.a)(this);return h.__className=this.constructor.className,delete h.batch,h}static get className(){return'engine.model.delta.Delta'}static get _priority(){return 0}}r.a=f,u.a.register(f)},function(o,r,s){'use strict';function d(O,V){const R=/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g;let F;for(O.clear();null!==(F=R.exec(V));)O.set(F[1],F[2].trim())}function u(O,V){const R=V.split(/\s+/);O.clear(),R.forEach((F)=>O.add(F))}function f(O){return'string'==typeof O?[new w.a(O)]:(s.i(T.a)(O)||(O=[O]),Array.from(O).map((V)=>'string'==typeof V?new w.a(V):V))}var h=s(76),w=s(30),C=s(274),T=s(41),P=s(98),S=s(169);/**
  44. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  45. * For licensing, see LICENSE.md.
  46. */class E extends h.a{constructor(O,V,R){if(super(),this.name=O,this._attrs=s.i(P.a)(V)?s.i(C.a)(V):new Map(V),this._children=[],R&&this.insertChildren(0,R),this._classes=new Set,this._attrs.has('class')){const F=this._attrs.get('class');u(this._classes,F),this._attrs.delete('class')}this._styles=new Map,this._attrs.has('style')&&(d(this._styles,this._attrs.get('style')),this._attrs.delete('style')),this._customProperties=new Map}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}is(O,V=null){return V?'element'==O&&V==this.name:'element'==O||O==this.name}clone(O){const V=[];if(O)for(let F of this.getChildren())V.push(F.clone(O));const R=new this.constructor(this.name,this._attrs,V);return R._classes=new Set(this._classes),R._styles=new Map(this._styles),R._customProperties=new Map(this._customProperties),R.getFillerOffset=this.getFillerOffset,R}appendChildren(O){return this.insertChildren(this.childCount,O)}getChild(O){return this._children[O]}getChildIndex(O){return this._children.indexOf(O)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){0<this._classes.size&&(yield'class'),0<this._styles.size&&(yield'style');for(let O of this._attrs.keys())yield O}*getAttributes(){yield*this._attrs.entries(),0<this._classes.size&&(yield['class',this.getAttribute('class')]),0<this._styles.size&&(yield['style',this.getAttribute('style')])}getAttribute(O){if('class'==O)return 0<this._classes.size?[...this._classes].join(' '):void 0;if('style'==O){if(0<this._styles.size){let V='';for(let[R,F]of this._styles)V+=`${R}:${F};`;return V}return}return this._attrs.get(O)}hasAttribute(O){return'class'==O?0<this._classes.size:'style'==O?0<this._styles.size:this._attrs.has(O)}setAttribute(O,V){this._fireChange('attributes',this),'class'==O?u(this._classes,V):'style'==O?d(this._styles,V):this._attrs.set(O,V)}insertChildren(O,V){this._fireChange('children',this);let R=0;V=f(V);for(let F of V)F.parent=this,this._children.splice(O,0,F),O++,R++;return R}removeAttribute(O){return this._fireChange('attributes',this),'class'==O?!!(0<this._classes.size)&&(this._classes.clear(),!0):'style'==O?!!(0<this._styles.size)&&(this._styles.clear(),!0):this._attrs.delete(O)}removeChildren(O,V=1){this._fireChange('children',this);for(let R=O;R<O+V;R++)this._children[R].parent=null;return this._children.splice(O,V)}isSimilar(O){if(!(O instanceof E))return!1;if(this===O)return!0;if(this.name!=O.name)return!1;if(this._attrs.size!==O._attrs.size||this._classes.size!==O._classes.size||this._styles.size!==O._styles.size)return!1;for(let[V,R]of this._attrs)if(!O._attrs.has(V)||O._attrs.get(V)!==R)return!1;for(let V of this._classes)if(!O._classes.has(V))return!1;for(let[V,R]of this._styles)if(!O._styles.has(V)||O._styles.get(V)!==R)return!1;return!0}addClass(...O){this._fireChange('attributes',this),O.forEach((V)=>this._classes.add(V))}removeClass(...O){this._fireChange('attributes',this),O.forEach((V)=>this._classes.delete(V))}hasClass(...O){for(let V of O)if(!this._classes.has(V))return!1;return!0}getClassNames(){return this._classes.keys()}setStyle(O,V){if(this._fireChange('attributes',this),s.i(P.a)(O)){const R=Object.keys(O);for(let F of R)this._styles.set(F,O[F])}else this._styles.set(O,V)}getStyle(O){return this._styles.get(O)}getStyleNames(){return this._styles.keys()}hasStyle(...O){for(let V of O)if(!this._styles.has(V))return!1;return!0}removeStyle(...O){this._fireChange('attributes',this),O.forEach((V)=>this._styles.delete(V))}findAncestor(...O){const V=new S.a(...O);for(let R=this.parent;R;){if(V.match(R))return R;R=R.parent}return null}setCustomProperty(O,V){this._customProperties.set(O,V)}getCustomProperty(O){return this._customProperties.get(O)}removeCustomProperty(O){return this._customProperties.delete(O)}*getCustomProperties(){yield*this._customProperties.entries()}}r.a=E},function(o,r,s){'use strict';function d(S){let E;if('string'!=typeof S)E=S.keyCode+(S.altKey?P.alt:0)+(S.ctrlKey?P.ctrl:0)+(S.shiftKey?P.shift:0);else if(E=P[S.toLowerCase()],!E)throw new C.a('keyboard-unknown-key: Unknown key name.',{key:S});return E}function w(S){return S.split(/\s*\+\s*/)}var C=s(0),T=s(421);r.c=d,r.d=function(S){return'string'==typeof S&&(S=w(S)),S.map((E)=>'string'==typeof E?d(E):E).reduce((E,O)=>O+E,0)},r.a=function(S){const E=w(S);return T.a.mac&&'ctrl'==E[0].toLowerCase()?'\u2318'+(E[1]||''):S};/**
  47. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  48. * For licensing, see LICENSE.md.
  49. */const P=function(){const S={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,esc:27,tab:9,ctrl:1114112,cmd:1114112,shift:2228224,alt:4456448};for(let E=65;90>=E;E++){const O=String.fromCharCode(E);S[O.toLowerCase()]=E}for(let E=48;57>=E;E++)S[E-48]=E;for(let E=112;123>=E;E++)S['f'+(E-111)]=E;return S}();r.b=P},function(o,r,s){'use strict';function d(h,w,C,T,P){var S=-1,E=h.length;for(C||(C=f.a),P||(P=[]);++S<E;){var O=h[S];0<w&&C(O)?1<w?d(O,w-1,C,T,P):s.i(u.a)(P,O):!T&&(P[P.length]=O)}return P}var u=s(84),f=s(478);r.a=d},function(o,r,s){'use strict';var d=s(59);/**
  50. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  51. * For licensing, see LICENSE.md.
  52. */class u extends d.a{constructor(f,h){super(h),this.data=f||''}get offsetSize(){return this.data.length}is(f){return'text'==f}clone(){return new u(this.data,this.getAttributes())}toJSON(){let f=super.toJSON();return f.data=this.data,f}static fromJSON(f){return new u(f.data,f.attributes)}}r.a=u},function(o,r,s){'use strict';var d=s(51),u=s(52),f=s(0),h=s(75);/**
  53. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  54. * For licensing, see LICENSE.md.
  55. */class w{constructor(C,T){this.parent=C,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 C=this.parent.is('text')?this.parent.data.length:this.parent.childCount;return this.offset===C}get root(){return this.parent.root}get editableElement(){let C=this.parent;for(;!(C instanceof h.a);)if(C.parent)C=C.parent;else return null;return C}getShiftedBy(C){let T=w.createFromPosition(this),P=T.offset+C;return T.offset=0>P?0:P,T}getLastMatchingPosition(C,T={}){T.startPosition=this;const P=new d.a(T);return P.skip(C),P.position}getAncestors(){return this.parent.is('documentFragment')?[this.parent]:this.parent.getAncestors({includeNode:!0})}isEqual(C){return this.parent==C.parent&&this.offset==C.offset}isBefore(C){return'before'==this.compareWith(C)}isAfter(C){return'after'==this.compareWith(C)}compareWith(C){if(this.isEqual(C))return'same';if(this.parent===C.parent)return 0>this.offset-C.offset?'before':'after';const T=this.getAncestors(),P=C.getAncestors(),S=s.i(u.a)(T,P);let E;switch(S){case 0:return'different';case'prefix':E=T.length-1;break;case'extension':E=P.length-1;break;default:E=S-1;}const O=T[E],V=T[E+1],R=P[E+1];if(O===this.parent){const N=this.offset-R.index;return 0>=N?'before':'after'}if(O===C.parent){const N=V.index-C.offset;return 0>N?'before':'after'}const F=V.index-R.index;return 0>F?'before':'after'}static createAt(C,T){if(C instanceof w)return this.createFromPosition(C);let P=C;if('end'==T)T=P.is('text')?P.data.length:P.childCount;else{if('before'==T)return this.createBefore(P);if('after'==T)return this.createAfter(P);T||(T=0)}return new w(P,T)}static createAfter(C){if(C.is('textProxy'))return new w(C.textNode,C.offsetInText+C.data.length);if(!C.parent)throw new f.a('view-position-after-root: You can not make position after root.',{root:C});return new w(C.parent,C.index+1)}static createBefore(C){if(C.is('textProxy'))return new w(C.textNode,C.offsetInText);if(!C.parent)throw new f.a('view-position-before-root: You can not make position before root.',{root:C});return new w(C.parent,C.index)}static createFromPosition(C){return new this(C.parent,C.offset)}}r.a=w},function(o,r,s){'use strict';var d=s(9),u=s(6),f=s(397),h=s(22);/**
  56. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  57. * For licensing, see LICENSE.md.
  58. */class w extends d.a{constructor(C){super(C),this.set('label'),this.set('keystroke'),this.set('tooltip'),this.set('type','button'),this.set('isOn',!1),this.set('isEnabled',!0),this.set('withText',!1),this.set('icon'),this.set('tabindex',-1),this.bind('_tooltipString').to(this,'tooltip',this,'label',this,'keystroke',this._getTooltipString.bind(this));const T=this.bindTemplate;this.template=new u.a({tag:'button',attributes:{class:['ck-button',T.if('_tooltipString','ck-tooltip_s'),T.to('isEnabled',(P)=>P?'ck-enabled':'ck-disabled'),T.to('isOn',(P)=>P?'ck-on':'ck-off'),T.if('withText','ck-button_with-text')],type:T.to('type',(P)=>P?P:'button'),'data-ck-tooltip':[T.to('_tooltipString')],tabindex:T.to('tabindex')},children:[{tag:'span',attributes:{class:['ck-button__label']},children:[{text:T.to('label')}]}],on:{mousedown:T.to((P)=>{P.preventDefault()}),click:T.to((P)=>{this.isEnabled?this.fire('execute'):P.preventDefault()})}})}init(){let C=Promise.resolve();if(this.icon&&!this.iconView){const T=this.iconView=new f.a;T.bind('content').to(this,'icon'),this.element.insertBefore(T.element,this.element.firstChild),C=C.then(()=>this.addChildren(T))}return C.then(()=>super.init())}focus(){this.element.focus()}_getTooltipString(C,T,P){if(C){if('string'==typeof C)return C;if(P&&(P=s.i(h.a)(P)),C instanceof Function)return C(T,P);if(!0===C)return`${T}${P?` (${P})`:''}`}return!1}}r.a=w},function(o,r){'use strict';r.a=function(u,f){for(var h=-1,w=u.length,C=Array(w);++h<w;)C[h]=f(u[h],h,u);return C}},function(o,r,s){'use strict';var d=s(33),u=s(1),f=s(2),h=s(0),w=s(52),C=s(13);/**
  59. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  60. * For licensing, see LICENSE.md.
  61. */class T extends d.a{constructor(P,S,E,O){super(O),this.sourcePosition=u.a.createFromPosition(P),this.howMany=S,this.targetPosition=u.a.createFromPosition(E),this.isSticky=!1}get type(){return'move'}clone(){const P=new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.baseVersion);return P.isSticky=this.isSticky,P}getMovedRangeStart(){return this.targetPosition._getTransformedByDeletion(this.sourcePosition,this.howMany)}getReversed(){let P=this.sourcePosition._getTransformedByInsertion(this.targetPosition,this.howMany);const S=new this.constructor(this.getMovedRangeStart(),this.howMany,P,this.baseVersion+1);return S.isSticky=this.isSticky,S}_execute(){let P=this.sourcePosition.parent,S=this.targetPosition.parent,E=this.sourcePosition.offset,O=this.targetPosition.offset;if(!P||!S)throw new h.a('move-operation-position-invalid: Source position or target position is invalid.');else if(E+this.howMany>P.maxOffset)throw new h.a('move-operation-nodes-do-not-exist: The nodes which should be moved do not exist.');else if(P===S&&E<O&&O<E+this.howMany)throw new h.a('move-operation-range-into-itself: Trying to move a range of nodes to the inside of that range.');else if(this.sourcePosition.root==this.targetPosition.root&&'prefix'==s.i(w.a)(this.sourcePosition.getParentPath(),this.targetPosition.getParentPath())){let R=this.sourcePosition.path.length-1;if(this.targetPosition.path[R]>=E&&this.targetPosition.path[R]<E+this.howMany)throw new h.a('move-operation-node-into-itself: Trying to move a range of nodes into one of nodes from that range.')}const V=C.a.move(f.a.createFromPositionAndShift(this.sourcePosition,this.howMany),this.targetPosition);return{sourcePosition:this.sourcePosition,range:V}}static get className(){return'engine.model.operation.MoveOperation'}static fromJSON(P,S){let E=u.a.fromJSON(P.sourcePosition,S),O=u.a.fromJSON(P.targetPosition,S);const V=new this(E,P.howMany,O,P.baseVersion);return P.isSticky&&(V.isSticky=!0),V}}r.a=T},function(o,r,s){'use strict';function d(w){return w.item.is('attributeElement')||w.item.is('uiElement')}var u=s(25),f=s(51);/**
  62. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  63. * For licensing, see LICENSE.md.
  64. */class h{constructor(w,C=null){this.start=u.a.createFromPosition(w),this.end=C?u.a.createFromPosition(C):u.a.createFromPosition(w)}*[Symbol.iterator](){yield*new f.a({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return this.start.parent===this.end.parent}get root(){return this.start.root}getEnlarged(){let w=this.start.getLastMatchingPosition(d,{direction:'backward'}),C=this.end.getLastMatchingPosition(d);return w.parent.is('text')&&w.isAtStart&&(w=u.a.createBefore(w.parent)),C.parent.is('text')&&C.isAtEnd&&(C=u.a.createAfter(C.parent)),new h(w,C)}getTrimmed(){let w=this.start.getLastMatchingPosition(d),C=this.end.getLastMatchingPosition(d,{direction:'backward'}),T=w.nodeAfter,P=C.nodeBefore;return T&&T.is('text')&&(w=new u.a(T,0)),P&&P.is('text')&&(C=new u.a(P,P.data.length)),new h(w,C)}isEqual(w){return this==w||this.start.isEqual(w.start)&&this.end.isEqual(w.end)}containsPosition(w){return w.isAfter(this.start)&&w.isBefore(this.end)}containsRange(w){return this.containsPosition(w.start)&&this.containsPosition(w.end)}getDifference(w){const C=[];return this.isIntersecting(w)?(this.containsPosition(w.start)&&C.push(new h(this.start,w.start)),this.containsPosition(w.end)&&C.push(new h(w.end,this.end))):C.push(h.createFromRange(this)),C}getIntersection(w){if(this.isIntersecting(w)){let C=this.start,T=this.end;return this.containsPosition(w.start)&&(C=w.start),this.containsPosition(w.end)&&(T=w.end),new h(C,T)}return null}getWalker(w={}){return w.boundaries=this,new f.a(w)}*getItems(w={}){w.boundaries=this,w.ignoreElementEnd=!0;const C=new f.a(w);for(let T of C)yield T.item}*getPositions(w={}){w.boundaries=this;const C=new f.a(w);yield C.position;for(let T of C)yield T.nextPosition}isIntersecting(w){return this.start.isBefore(w.end)&&this.end.isAfter(w.start)}static createFromParentsAndOffsets(w,C,T,P){return new this(new u.a(w,C),new u.a(T,P))}static createFromRange(w){return new this(w.start,w.end)}static createFromPositionAndShift(w,C){const T=w,P=w.getShiftedBy(C);return 0<C?new this(T,P):new this(P,T)}static createIn(w){return this.createFromParentsAndOffsets(w,0,w,w.childCount)}static createOn(w){return this.createFromPositionAndShift(u.a.createBefore(w),1)}}r.a=h},function(o,r,s){'use strict';var d=s(76);/**
  65. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  66. * For licensing, see LICENSE.md.
  67. */class u extends d.a{constructor(f){super(),this._data=f}clone(){return new u(this.data)}is(f){return'text'==f}get data(){return this._data}set data(f){this._fireChange('text',this),this._data=f}isSimilar(f){return!!(f instanceof u)&&(this===f||this.data===f.data)}}r.a=u},function(o,r,s){'use strict';(function(d,u){var f=s(451),h={'function':!0,object:!0},w=h[typeof exports]&&exports&&!exports.nodeType?exports:void 0,C=h[typeof d]&&d&&!d.nodeType?d:void 0,T=s.i(f.a)(w&&C&&'object'==typeof u&&u),P=s.i(f.a)(h[typeof self]&&self),S=s.i(f.a)(h[typeof window]&&window),E=s.i(f.a)(h[typeof this]&&this),O=T||S!==(E&&E.window)&&S||P||E||Function('return this')();r.a=O}).call(r,s(154)(o),s(314))},function(o,r,s){'use strict';function d(I){R in I||(Object.defineProperty(I,R,{value:new Map}),Object.defineProperty(I,F,{value:new Map}),Object.defineProperty(I,N,{value:new Map}))}function u(...I){const L=h(...I),D=Array.from(this._bindings.keys()),q=D.length;if(!L.callback&&1<L.to.length)throw new E.a('observable-bind-to-no-callback: Binding multiple observables only possible with callback.');if(1<q&&L.callback)throw new E.a('observable-bind-to-extra-callback: Cannot bind multiple attributes and use a callback in one binding.');L.to.forEach((z)=>{if(z.attrs.length&&z.attrs.length!==q)throw new E.a('observable-bind-to-attrs-length: The number of attributes must match.');z.attrs.length||(z.attrs=this._bindAttrs)}),this._to=L.to,L.callback&&(this._bindings.get(D[0]).callback=L.callback),P(this._observable,this._to),C(this),this._bindAttrs.forEach((z)=>{T(this._observable,z)})}function f(I){return I.every((L)=>'string'==typeof L)}function h(...I){if(!I.length)throw new E.a('observable-bind-to-parse-error: Invalid argument syntax in `to()`.');const L={to:[]};let D;return'function'==typeof I[I.length-1]&&(L.callback=I.pop()),I.forEach((q)=>{if('string'==typeof q)D.attrs.push(q);else if('object'==typeof q)D={observable:q,attrs:[]},L.to.push(D);else throw new E.a('observable-bind-to-parse-error: Invalid argument syntax in `to()`.')}),L}function w(I,L,D,q){const z=I[F],$=z.get(D),K=$||{};K[q]||(K[q]=new Set),K[q].add(L),$||z.set(D,K)}function C(I){let L;I._bindings.forEach((D,q)=>{I._to.forEach((z)=>{L=z.attrs[D.callback?0:I._bindAttrs.indexOf(q)],D.to.push([z.observable,L]),w(I._observable,D,z.observable,L)})})}function T(I,L){const D=I[N],q=D.get(L);let z;q.callback?z=q.callback.apply(I,q.to.map(($)=>$[0][$[1]])):(z=q.to[0],z=z[0][z[1]]),I.hasOwnProperty(L)?I[L]=z:I.set(L,z)}function P(I,L){L.forEach((D)=>{const q=I[F];let z;q.get(D.observable)||I.listenTo(D.observable,'change',($,K)=>{z=q.get(D.observable)[K],z&&z.forEach((H)=>{T(I,H.attr)})})})}var S=s(7),E=s(0),O=s(57),V=s(15);/**
  68. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  69. * For licensing, see LICENSE.md.
  70. */const R=Symbol('attributes'),F=Symbol('boundObservables'),N=Symbol('boundAttributes'),M={set(I,L){if(s.i(V.a)(I))return void Object.keys(I).forEach((q)=>{this.set(q,I[q])},this);d(this);const D=this[R];if(I in this&&!D.has(I))throw new E.a('observable-set-cannot-override: Cannot override an existing property.');Object.defineProperty(this,I,{enumerable:!0,configurable:!0,get(){return D.get(I)},set(q){const z=D.get(I);z===q&&D.has(I)||(D.set(I,q),this.fire('change:'+I,I,q,z))}}),this[I]=L},bind(...I){if(!I.length||!f(I))throw new E.a('observable-bind-wrong-attrs: All attributes must be strings.');if(new Set(I).size!==I.length)throw new E.a('observable-bind-duplicate-attrs: Attributes must be unique.');d(this);const L=this[N];I.forEach((q)=>{if(L.has(q))throw new E.a('observable-bind-rebind: Cannot bind the same attribute more that once.')});const D=new Map;return I.forEach((q)=>{const z={attr:q,to:[]};L.set(q,z),D.set(q,z)}),{to:u,_observable:this,_bindAttrs:I,_to:[],_bindings:D}},unbind(...I){if(!(R in this))return;const L=this[N],D=this[F];if(I.length){if(!f(I))throw new E.a('observable-unbind-wrong-attrs: Attributes must be strings.');I.forEach((q)=>{const z=L.get(q);let $,K,H,U;z.to.forEach((W)=>{$=W[0],K=W[1],H=D.get($),U=H[K],U.delete(z),U.size||delete H[K],Object.keys(H).length||(D.delete($),this.stopListening($,'change'))}),L.delete(q)})}else D.forEach((q,z)=>{this.stopListening(z,'change')}),D.clear(),L.clear()}};r.a=M,s.i(O.a)(M,S.a)},function(o,r,s){'use strict';var d=s(95);/**
  71. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  72. * For licensing, see LICENSE.md.
  73. */class u{constructor(f){this.baseVersion=f}toJSON(){const f=s.i(d.a)(this,!0);return f.__className=this.constructor.className,delete f.delta,f}static get className(){return'engine.model.operation.Operation'}static fromJSON(f){return new this(f.baseVersion)}}r.a=u},function(o,r,s){'use strict';function d(P,S,E,O,V){return{done:!1,value:{type:P,item:S,previousPosition:E,nextPosition:O,length:V}}}var u=s(24),f=s(61),h=s(5),w=s(1),C=s(0);/**
  74. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  75. * For licensing, see LICENSE.md.
  76. */class T{constructor(P={}){if(!P.boundaries&&!P.startPosition)throw new C.a('model-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.');const S=P.direction||'forward';if('forward'!=S&&'backward'!=S)throw new C.a('model-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.',{direction:S});this.direction=S,this.boundaries=P.boundaries||null,this.position=P.startPosition?w.a.createFromPosition(P.startPosition):w.a.createFromPosition(this.boundaries['backward'==this.direction?'end':'start']),this.singleCharacters=!!P.singleCharacters,this.shallow=!!P.shallow,this.ignoreElementEnd=!!P.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(P){let S,E,O,V;do O=this.position,V=this._visitedParent,({done:S,value:E}=this.next());while(!S&&P(E));S||(this.position=O,this._visitedParent=V)}next(){return'forward'==this.direction?this._next():this._previous()}_next(){const P=this.position,S=w.a.createFromPosition(this.position),E=this._visitedParent;if(null===E.parent&&S.offset===E.maxOffset)return{done:!0};if(E===this._boundaryEndParent&&S.offset==this.boundaries.end.offset)return{done:!0};const O=S.textNode?S.textNode:S.nodeAfter;if(O instanceof h.a)return this.shallow?S.offset++:(S.path.push(0),this._visitedParent=O),this.position=S,d('elementStart',O,P,S,1);if(O instanceof u.a){let V,R;if(this.singleCharacters)V=1;else{let N=O.endOffset;this._boundaryEndParent==E&&this.boundaries.end.offset<N&&(N=this.boundaries.end.offset),V=N-S.offset}R=S.offset-O.startOffset;const F=new f.a(O,R,V);return S.offset+=V,this.position=S,d('text',F,P,S,V)}return S.path.pop(),S.offset++,this.position=S,this._visitedParent=E.parent,this.ignoreElementEnd?this._next():d('elementEnd',E,P,S)}_previous(){const P=this.position,S=w.a.createFromPosition(this.position),E=this._visitedParent;if(null===E.parent&&0===S.offset)return{done:!0};if(E==this._boundaryStartParent&&S.offset==this.boundaries.start.offset)return{done:!0};const O=S.textNode?S.textNode:S.nodeBefore;if(O instanceof h.a)return S.offset--,this.shallow?(this.position=S,d('elementStart',O,P,S,1)):(S.path.push(O.maxOffset),this.position=S,this._visitedParent=O,this.ignoreElementEnd?this._previous():d('elementEnd',O,P,S));if(O instanceof u.a){let V,R;if(this.singleCharacters)V=1;else{let N=O.startOffset;this._boundaryStartParent==E&&this.boundaries.start.offset>N&&(N=this.boundaries.start.offset),V=S.offset-N}R=S.offset-O.startOffset;const F=new f.a(O,R-V,V);return S.offset-=V,this.position=S,d('text',F,P,S,V)}return S.path.pop(),this.position=S,this._visitedParent=E.parent,d('elementStart',E,P,S,1)}}r.a=T},function(o,r){'use strict';r.a=function(u,f,h){var w=-1,C=u.length;0>f&&(f=-f>C?0:C+f),h=h>C?C:h,0>h&&(h+=C),C=f>h?0:h-f>>>0,f>>>=0;for(var T=Array(C);++w<C;)T[w]=u[w+f];return T}},function(o,r){'use strict';var f=/^(?:0|[1-9]\d*)$/;r.a=function(h,w){return w=null==w?9007199254740991:w,!!w&&('number'==typeof h||f.test(h))&&-1<h&&0==h%1&&h<w}},function(o,r,s){'use strict';var d=s(33),u=s(1),f=s(72),h=s(38),w=s(13),C=s(24),T=s(5);/**
  77. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  78. * For licensing, see LICENSE.md.
  79. */class P extends d.a{constructor(S,E,O){super(O),this.position=u.a.createFromPosition(S),this.nodes=new f.a(s.i(w.b)(E))}get type(){return'insert'}clone(){const S=new f.a([...this.nodes].map((E)=>E.clone(!0)));return new P(this.position,S,this.baseVersion)}getReversed(){return new h.a(this.position,this.nodes.maxOffset,this.baseVersion+1)}_execute(){const S=this.nodes;this.nodes=new f.a([...S].map((O)=>O.clone(!0)));const E=w.a.insert(this.position,S);return{range:E}}static get className(){return'engine.model.operation.InsertOperation'}static fromJSON(S,E){let O=[];for(let V of S.nodes)V.name?O.push(T.a.fromJSON(V)):O.push(C.a.fromJSON(V));return new P(u.a.fromJSON(S.position,E),O,S.baseVersion)}}r.a=P},function(o,r,s){'use strict';var d=s(28),u=s(1),f=s(5),h=s(112);/**
  80. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  81. * For licensing, see LICENSE.md.
  82. */class w extends d.a{constructor(C,T,P){const S=C.root.document.graveyard,E=new u.a(S,[S.maxOffset,0]);super(C,T,E,P)}get type(){return'remove'}get _holderElementOffset(){return this.targetPosition.path[0]}set _holderElementOffset(C){this.targetPosition.path[0]=C}get _needsHolderElement(){if(this.delta)for(let C of this.delta.operations)if(C instanceof w){if(C==this)return!0;if(C._holderElementOffset==this._holderElementOffset)return!1}return!0}getReversed(){return new h.a(this.targetPosition,this.howMany,this.sourcePosition,this.baseVersion+1)}clone(){let C=new w(this.sourcePosition,this.howMany,this.baseVersion);return C.targetPosition=u.a.createFromPosition(this.targetPosition),C}_execute(){if(this._needsHolderElement){const C=this.targetPosition.root,T=new f.a('$graveyardHolder');C.insertChildren(this._holderElementOffset,T),this.sourcePosition.root==C&&this.sourcePosition.path[0]>=this._holderElementOffset&&this.sourcePosition.path[0]++}return super._execute()}static get className(){return'engine.model.operation.RemoveOperation'}static fromJSON(C,T){let P=u.a.fromJSON(C.sourcePosition,T);const S=new w(P,C.howMany,C.baseVersion);return S.targetPosition=u.a.fromJSON(C.targetPosition,T),S}}r.a=w},function(o,r,s){'use strict';function d(){return 0===this.childCount?0:null}var u=s(21);/**
  83. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  84. * For licensing, see LICENSE.md.
  85. */class f extends u.a{constructor(h,w,C){super(h,w,C),this.getFillerOffset=d}is(h,w=null){return w?'containerElement'==h&&w==this.name||super.is(h,w):'containerElement'==h||super.is(h)}}r.a=f},function(o,r,s){'use strict';var h=s(118),w=s(5);r.c=function(T,P){return T.setCustomProperty(C,!0),s.i(h.a)(T,{label:function(){const E=T.getChild(0),O=E.getAttribute('alt');return O?`${O} ${P}`:P}})},r.a=function(T){return!!T.getCustomProperty(C)&&s.i(h.b)(T)},r.b=function(T){return T instanceof w.a&&'image'==T.name};/**
  86. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  87. * For licensing, see LICENSE.md.
  88. */const C=Symbol('isImage')},function(o,r){'use strict';r.a=/**
  89. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  90. * For licensing, see LICENSE.md.
  91. */function(u){return!!(u&&u[Symbol.iterator])}},function(o,r,s){'use strict';var u=s(82),f=s(125),h=s(126),w=s(136),C=s(462),T=s(94);r.a=function(S,E,O){var V=-1,R=f.a,F=S.length,N=!0,M=[],I=M;if(O)N=!1,R=h.a;else if(F>=200){var L=E?null:s.i(C.a)(S);if(L)return s.i(T.a)(L);N=!1,R=w.a,I=new u.a}else I=E?[]:M;outer:for(;++V<F;){var D=S[V],q=E?E(D):D;if(D=O||0!==D?D:0,N&&q===q){for(var z=I.length;z--;)if(I[z]===q)continue outer;E&&I.push(q),M.push(D)}else R(I,q,O)||(I!==M&&I.push(q),M.push(D))}return M}},function(o,r){'use strict';r.a=function(u){return!!u&&'object'==typeof u}},function(o,r,s){'use strict';var u=s(43),h=Object.prototype,w=h.toString;r.a=function(C){return'symbol'==typeof C||s.i(u.a)(C)&&w.call(C)=='[object Symbol]'}},function(o){o.exports=function(){var s=[];return s.toString=function(){for(var u=[],f=0,h;f<this.length;f++)h=this[f],h[2]?u.push('@media '+h[2]+'{'+h[1]+'}'):u.push(h[1]);return u.join('')},s.i=function(d,u){'string'==typeof d&&(d=[[null,d,'']]);for(var f={},h=0,w;h<this.length;h++)w=this[h][0],'number'==typeof w&&(f[w]=!0);for(h=0;h<d.length;h++){var C=d[h];'number'==typeof C[0]&&f[C[0]]||(u&&!C[2]?C[2]=u:u&&(C[2]='('+C[2]+') and ('+u+')'),s.push(C))}},s}},function(o){function s(L,D){for(var q=0;q<L.length;q++){var z=L[q],$=E[z.id];if($){$.refs++;for(var K=0;K<$.parts.length;K++)$.parts[K](z.parts[K]);for(;K<z.parts.length;K++)$.parts.push(C(z.parts[K],D))}else{for(var H=[],K=0;K<z.parts.length;K++)H.push(C(z.parts[K],D));E[z.id]={id:z.id,refs:1,parts:H}}}}function d(L){for(var D=[],q={},z=0;z<L.length;z++){var $=L[z],K=$[0],H=$[1],U=$[2],W=$[3],Z={css:H,media:U,sourceMap:W};q[K]?q[K].parts.push(Z):D.push(q[K]={id:K,parts:[Z]})}return D}function u(L,D){var q=R(),z=M[M.length-1];if('top'===L.insertAt)z?z.nextSibling?q.insertBefore(D,z.nextSibling):q.appendChild(D):q.insertBefore(D,q.firstChild),M.push(D);else if('bottom'===L.insertAt)q.appendChild(D);else throw new Error('Invalid value for parameter \'insertAt\'. Must be \'top\' or \'bottom\'.')}function f(L){L.parentNode.removeChild(L);var D=M.indexOf(L);0<=D&&M.splice(D,1)}function h(L){var D=document.createElement('style');return D.type='text/css',u(L,D),D}function w(L){var D=document.createElement('link');return D.rel='stylesheet',u(L,D),D}function C(L,D){var q,z,$;if(D.singleton){var K=N++;q=F||(F=h(D)),z=T.bind(null,q,K,!1),$=T.bind(null,q,K,!0)}else L.sourceMap&&'function'==typeof URL&&'function'==typeof URL.createObjectURL&&'function'==typeof URL.revokeObjectURL&&'function'==typeof Blob&&'function'==typeof btoa?(q=w(D),z=S.bind(null,q),$=function(){f(q),q.href&&URL.revokeObjectURL(q.href)}):(q=h(D),z=P.bind(null,q),$=function(){f(q)});return z(L),function(U){if(U){if(U.css===L.css&&U.media===L.media&&U.sourceMap===L.sourceMap)return;z(L=U)}else $()}}function T(L,D,q,z){var $=q?'':z.css;if(L.styleSheet)L.styleSheet.cssText=I(D,$);else{var K=document.createTextNode($),H=L.childNodes;H[D]&&L.removeChild(H[D]),H.length?L.insertBefore(K,H[D]):L.appendChild(K)}}function P(L,D){var q=D.css,z=D.media;if(z&&L.setAttribute('media',z),L.styleSheet)L.styleSheet.cssText=q;else{for(;L.firstChild;)L.removeChild(L.firstChild);L.appendChild(document.createTextNode(q))}}function S(L,D){var q=D.css,z=D.sourceMap;z&&(q+='\n/*# sourceMappingURL=data:application/json;base64,'+btoa(unescape(encodeURIComponent(JSON.stringify(z))))+' */');var $=new Blob([q],{type:'text/css'}),K=L.href;L.href=URL.createObjectURL($),K&&URL.revokeObjectURL(K)}var E={},O=function(L){var D;return function(){return'undefined'==typeof D&&(D=L.apply(this,arguments)),D}},V=O(function(){return /msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase())}),R=O(function(){return document.head||document.getElementsByTagName('head')[0]}),F=null,N=0,M=[];o.exports=function(L,D){if('undefined'!=typeof DEBUG&&DEBUG&&'object'!=typeof document)throw new Error('The style-loader cannot be used in a non-browser environment');D=D||{},'undefined'==typeof D.singleton&&(D.singleton=V()),'undefined'==typeof D.insertAt&&(D.insertAt='bottom');var q=d(L);return s(q,D),function($){for(var K=[],H=0;H<q.length;H++){var U=q[H],W=E[U.id];W.refs--,K.push(W)}if($){var Z=d($);s(Z,D)}for(var H=0,W;H<K.length;H++)if(W=K[H],0===W.refs){for(var G=0;G<W.parts.length;G++)W.parts[G]();delete E[W.id]}}};var I=function(){var L=[];return function(D,q){return L[D]=q,L.filter(Boolean).join('\n')}}()},function(o,r,s){'use strict';var u=s(101),f=s(160),h=s(115),w=s(39),C=s(172),T=s(0);r.a=function(){return new P};/**
  92. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  93. * For licensing, see LICENSE.md.
  94. */class P{constructor(){this._dispatchers=[],this._from=null}for(...S){return this._dispatchers=S,this}fromElement(S){return this._from={type:'element',name:S,priority:null},this}fromAttribute(S){return this._from={type:'attribute',key:S,priority:null},this}fromMarker(S){return this._from={type:'marker',name:S,priority:null},this}withPriority(S){return this._from.priority=S,this}toElement(S){const E=null===this._from.priority?'normal':this._from.priority;for(let O of this._dispatchers)'element'==this._from.type?(S='string'==typeof S?new w.a(S):S,O.on('insert:'+this._from.name,s.i(u.a)(S),{priority:E})):'attribute'==this._from.type?(S='string'==typeof S?new h.a(S):S,O.on('addAttribute:'+this._from.key,s.i(u.b)(S),{priority:E}),O.on('changeAttribute:'+this._from.key,s.i(u.b)(S),{priority:E}),O.on('removeAttribute:'+this._from.key,s.i(u.c)(S),{priority:E}),O.on('selectionAttribute:'+this._from.key,s.i(f.a)(S),{priority:E})):(S='string'==typeof S?new h.a(S):S,O.on('addMarker:'+this._from.name,s.i(u.d)(S),{priority:E}),O.on('removeMarker:'+this._from.name,s.i(u.e)(S),{priority:E}),O.on('selectionMarker:'+this._from.name,s.i(f.b)(S),{priority:E}))}toStamp(S){for(let E of this._dispatchers){if('marker'!=this._from.type)throw new T.a('build-model-converter-non-marker-to-stamp: To-stamp conversion is supported only from model markers.');const O=null===this._from.priority?'normal':this._from.priority;S='string'==typeof S?new C.a(S):S,E.on('addMarker:'+this._from.name,s.i(u.f)(S),{priority:O}),E.on('removeMarker:'+this._from.name,s.i(u.g)(S),{priority:O})}}toAttribute(S,E){if('attribute'!=this._from.type)throw new T.a('build-model-converter-non-attribute-to-attribute: To-attribute conversion is supported only from model attributes.');let O=S?'string'==typeof S?E?function(){return{key:S,value:E}}:function(V){return{key:S,value:V}}:S:void 0;for(let V of this._dispatchers){const R={priority:this._from.priority||'normal'};V.on('addAttribute:'+this._from.key,s.i(u.h)(O),R),V.on('changeAttribute:'+this._from.key,s.i(u.h)(O),R),V.on('removeAttribute:'+this._from.key,s.i(u.i)(O),R)}}}},function(o,r,s){'use strict';function d(E,O,V,R){if(s.i(P.a)(E)){for(let M of E)d(M,O,V,R);return}const F=Array.from(E.getAttributeKeys());F.push(O.key);const N={name:E.name||'$text',attributes:F,inside:V.context};R.schema.check(N)&&E.setAttribute(O.key,O.value)}var f=s(169),h=s(5),w=s(1),C=s(13),T=s(0),P=s(41);r.a=function(){return new S};/**
  95. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  96. * For licensing, see LICENSE.md.
  97. */class S{constructor(){this._dispatchers=[],this._from=[]}for(...E){return this._dispatchers=E,this}fromElement(E){return this.from({name:E})}fromAttribute(E,O=/.*/){let V={};return V[E]=O,this.from(V)}from(E){return E instanceof f.a||(E=new f.a(E)),this._from.push({matcher:E,consume:!1,priority:null}),this}consuming(E){let O=this._from[this._from.length-1];return O.consume=E,this}withPriority(E){let O=this._from[this._from.length-1];return O.priority=E,this}toElement(E){this._setCallback(function(V){return(R,F,N,M)=>{let I=V.matcher.matchAll(F.input);if(I)for(let L of I){const D=E instanceof Function?E(F.input):new h.a(E),q=Array.from(D.getAttributeKeys());if(!M.schema.check({name:D.name,attributes:q,inside:F.context}))continue;if(!N.consume(F.input,V.consume||L.match))continue;F.context.push(D);const z=M.convertChildren(F.input,N,F),$=w.a.createAt(D,'end');C.a.insert($,z),F.context.pop(),F.output=D;break}}},'normal')}toAttribute(E,O){this._setCallback(function(R){return(F,N,M,I)=>{let L=R.matcher.matchAll(N.input);if(L)for(let D of L){if(!M.consume(N.input,R.consume||D.match))continue;N.output||(N.output=I.convertChildren(N.input,M,N));let q=E instanceof Function?E(N.input):{key:E,value:O};d(N.output,q,N,I);break}}},'low')}toMarker(E){this._setCallback(function(V){return(R,F,N)=>{const M=V.matcher.matchAll(F.input);if(!M)return;let I;if(I=E instanceof Function?E(F.input):new h.a('$marker',{'data-name':F.input.getAttribute('data-name')}),'$marker'!=I.name||'string'!=typeof I.getAttribute('data-name'))throw new T.a('build-view-converter-invalid-marker: Invalid model element to mark marker range.');for(const L of M)if(N.consume(F.input,V.consume||L.match)){F.output=I;break}}},'normal')}_setCallback(E,O){for(let V of this._from){const R=V.matcher.getElementName(),F=R?'element:'+R:'element',N=E(V),M=null===V.priority?O:V.priority;for(let I of this._dispatchers)I.on(F,N,{priority:M})}}}},function(o,r,s){'use strict';function d(T){return'string'==typeof T?[new h.a(T)]:(s.i(w.a)(T)||(T=[T]),Array.from(T).map((P)=>'string'==typeof P?new h.a(P):P))}var u=s(72),f=s(5),h=s(24),w=s(41);/**
  98. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  99. * For licensing, see LICENSE.md.
  100. */class C{constructor(T){this.markers=new Map,this._children=new u.a,T&&this.insertChildren(0,T)}[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(T){return'documentFragment'==T}getChild(T){return this._children.getNode(T)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(T){return this._children.getNodeIndex(T)}getChildStartOffset(T){return this._children.getNodeStartOffset(T)}getPath(){return[]}offsetToIndex(T){return this._children.offsetToIndex(T)}appendChildren(T){this.insertChildren(this.childCount,T)}insertChildren(T,P){P=d(P);for(let S of P)S.parent=this;this._children.insertNodes(T,P)}removeChildren(T,P=1){const S=this._children.removeNodes(T,P);for(let E of S)E.parent=null;return S}toJSON(){let T=[];for(let P of this._children)T.push(P.toJSON());return T}static fromJSON(T){let P=[];for(let S of T)S.name?P.push(f.a.fromJSON(S)):P.push(h.a.fromJSON(S));return new C(P)}}r.a=C},function(o,r,s){'use strict';var d=s(80),u=s(4);/**
  101. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  102. * For licensing, see LICENSE.md.
  103. */class f{constructor(h){this.document=h,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}}r.a=f,s.i(u.a)(f,d.a)},function(o,r,s){'use strict';var d=s(21),u=s(30),f=s(358),h=s(25),w=s(0);/**
  104. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  105. * For licensing, see LICENSE.md.
  106. */class C{constructor(T={}){if(!T.boundaries&&!T.startPosition)throw new w.a('view-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.');if(T.direction&&'forward'!=T.direction&&'backward'!=T.direction)throw new w.a('view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.',{direction:T.direction});this.boundaries=T.boundaries||null,this.position=T.startPosition?h.a.createFromPosition(T.startPosition):h.a.createFromPosition(T.boundaries['backward'==T.direction?'end':'start']),this.direction=T.direction||'forward',this.singleCharacters=!!T.singleCharacters,this.shallow=!!T.shallow,this.ignoreElementEnd=!!T.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(T){let P,S,E;do E=this.position,({done:P,value:S}=this.next());while(!P&&T(S));P||(this.position=E)}next(){return'forward'==this.direction?this._next():this._previous()}_next(){let T=h.a.createFromPosition(this.position);const P=this.position,S=T.parent;if(null===S.parent&&T.offset===S.childCount)return{done:!0};if(S===this._boundaryEndParent&&T.offset==this.boundaries.end.offset)return{done:!0};let E;if(S instanceof u.a){if(T.isAtEnd)return this.position=h.a.createAfter(S),this._next();E=S.data[T.offset]}else E=S.getChild(T.offset);if(E instanceof d.a)return this.shallow?T.offset++:T=new h.a(E,0),this.position=T,this._formatReturnValue('elementStart',E,P,T,1);if(E instanceof u.a){if(this.singleCharacters)return T=new h.a(E,0),this.position=T,this._next();let O=E.data.length,V=E;return E==this._boundaryEndParent?(O=this.boundaries.end.offset,V=new f.a(E,0,O),T=h.a.createAfter(V)):T.offset++,this.position=T,this._formatReturnValue('text',V,P,T,O)}if('string'==typeof E){let O;if(this.singleCharacters)O=1;else{const R=S===this._boundaryEndParent?this.boundaries.end.offset:S.data.length;O=R-T.offset}const V=new f.a(S,T.offset,O);return T.offset+=O,this.position=T,this._formatReturnValue('text',V,P,T,O)}return T=h.a.createAfter(S),this.position=T,this.ignoreElementEnd?this._next():this._formatReturnValue('elementEnd',S,P,T)}_previous(){let T=h.a.createFromPosition(this.position);const P=this.position,S=T.parent;if(null===S.parent&&0===T.offset)return{done:!0};if(S==this._boundaryStartParent&&T.offset==this.boundaries.start.offset)return{done:!0};let E;if(S instanceof u.a){if(T.isAtStart)return this.position=h.a.createBefore(S),this._previous();E=S.data[T.offset-1]}else E=S.getChild(T.offset-1);if(E instanceof d.a)return this.shallow?(T.offset--,this.position=T,this._formatReturnValue('elementStart',E,P,T,1)):(T=new h.a(E,E.childCount),this.position=T,this.ignoreElementEnd?this._previous():this._formatReturnValue('elementEnd',E,P,T));if(E instanceof u.a){if(this.singleCharacters)return T=new h.a(E,E.data.length),this.position=T,this._previous();let O=E.data.length,V=E;if(E==this._boundaryStartParent){const R=this.boundaries.start.offset;V=new f.a(E,R,E.data.length-R),O=V.data.length,T=h.a.createBefore(V)}else T.offset--;return this.position=T,this._formatReturnValue('text',V,P,T,O)}if('string'==typeof E){let O;if(!this.singleCharacters){const R=S===this._boundaryStartParent?this.boundaries.start.offset:0;O=T.offset-R}else O=1;T.offset-=O;const V=new f.a(S,T.offset,O);return this.position=T,this._formatReturnValue('text',V,P,T,O)}return T=h.a.createBefore(S),this.position=T,this._formatReturnValue('elementStart',S,P,T,1)}_formatReturnValue(T,P,S,E,O){return P instanceof f.a&&(P.offsetInText+P.data.length==P.textNode.data.length&&('forward'!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?S=h.a.createAfter(P.textNode):(E=h.a.createAfter(P.textNode),this.position=E)),0===P.offsetInText&&('backward'!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?S=h.a.createBefore(P.textNode):(E=h.a.createBefore(P.textNode),this.position=E))),{done:!1,value:{type:T,item:P,previousPosition:S,nextPosition:E,length:O}}}}r.a=C},function(o,r){'use strict';r.a=/**
  107. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  108. * For licensing, see LICENSE.md.
  109. */function(u,f){const h=_Mathmin(u.length,f.length);for(let w=0;w<h;w++)if(u[w]!=f[w])return w;return u.length==f.length?'same':u.length<f.length?'prefix':'extension'}},function(o,r,s){'use strict';var u=s(235);r.a=function(f,h){var w=f[h];return s.i(u.a)(w)?w:void 0}},function(o,r,s){'use strict';var u=s(11),f=s(44),h=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,w=/^\w*$/;r.a=function(C,T){if(s.i(u.a)(C))return!1;var P=typeof C;return'number'==P||'symbol'==P||'boolean'==P||null==C||s.i(f.a)(C)||w.test(C)||!h.test(C)||null!=T&&C in Object(T)}},function(o,r,s){'use strict';var u=s(44);r.a=function(h){if('string'==typeof h||s.i(u.a)(h))return h;var w=h+'';return'0'==w&&1/h==-(1/0)?'-0':w}},function(o,r){'use strict';r.a=function(u,f){return u===f||u!==u&&f!==f}},function(o,r,s){'use strict';var d=s(503);s.d(r,'a',function(){return d.a})},function(o,r){'use strict';/**
  110. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  111. * For licensing, see LICENSE.md.
  112. */const d={error(u,f){console.error(u,f)},warn(u,f){console.warn(u,f)}};r.a=d},function(o,r,s){'use strict';var d=s(152),u=s(0);/**
  113. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  114. * For licensing, see LICENSE.md.
  115. */class f{constructor(h){this.parent=null,this._attrs=s.i(d.a)(h)}get index(){let h;if(!this.parent)return null;if(null===(h=this.parent.getChildIndex(this)))throw new u.a('model-node-not-found-in-parent: The node\'s parent does not contain this node.');return h}get startOffset(){let h;if(!this.parent)return null;if(null===(h=this.parent.getChildStartOffset(this)))throw new u.a('model-node-not-found-in-parent: The node\'s parent does not contain this node.');return h}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const h=this.index;return null!==h&&this.parent.getChild(h+1)||null}get previousSibling(){const h=this.index;return null!==h&&this.parent.getChild(h-1)||null}get root(){let h=this;for(;h.parent;)h=h.parent;return h}get document(){return this.root==this?null:this.root.document||null}clone(){return new f(this._attrs)}getPath(){const h=[];for(let w=this;w.parent;)h.unshift(w.startOffset),w=w.parent;return h}getAncestors(h={includeNode:!1,parentFirst:!1}){const w=[];for(let C=h.includeNode?this:this.parent;C;)w[h.parentFirst?'push':'unshift'](C),C=C.parent;return w}remove(){this.parent.removeChildren(this.index)}hasAttribute(h){return this._attrs.has(h)}getAttribute(h){return this._attrs.get(h)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}setAttribute(h,w){this._attrs.set(h,w)}setAttributesTo(h){this._attrs=s.i(d.a)(h)}removeAttribute(h){return this._attrs.delete(h)}clearAttributes(){this._attrs.clear()}toJSON(){let h={};return this._attrs.size&&(h.attributes=[...this._attrs]),h}}r.a=f},function(o,r,s){'use strict';function d(V,R){return!R.has(V)&&(R.add(V),V.document.schema.itemExtends(V.name,'$block')&&V.parent)}function u(V,R){const F=V.parent.getAncestors({parentFirst:!0,includeNode:!0}),N=F.find((M)=>d(M,R));return F.forEach((M)=>R.add(M)),N}var f=s(1),h=s(5),w=s(2),C=s(7),T=s(0),P=s(4),S=s(152),E=s(522);/**
  116. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  117. * For licensing, see LICENSE.md.
  118. */class O{constructor(){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map}get anchor(){if(0<this._ranges.length){const V=this._ranges[this._ranges.length-1];return this._lastRangeBackward?V.end:V.start}return null}get focus(){if(0<this._ranges.length){const V=this._ranges[this._ranges.length-1];return this._lastRangeBackward?V.start:V.end}return null}get isCollapsed(){const V=this._ranges.length;return!(1!==V)&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(V){if(this.rangeCount!=V.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(V.anchor)||!this.focus.isEqual(V.focus))return!1;for(let R of this._ranges){let F=!1;for(let N of V._ranges)if(R.isEqual(N)){F=!0;break}if(!F)return!1}return!0}*getRanges(){for(let V of this._ranges)yield w.a.createFromRange(V)}getFirstRange(){let V=null;for(let R of this._ranges)(!V||R.start.isBefore(V.start))&&(V=R);return V?w.a.createFromRange(V):null}getLastRange(){let V=null;for(let R of this._ranges)(!V||R.end.isAfter(V.end))&&(V=R);return V?w.a.createFromRange(V):null}getFirstPosition(){const V=this.getFirstRange();return V?f.a.createFromPosition(V.start):null}getLastPosition(){const V=this.getLastRange();return V?f.a.createFromPosition(V.end):null}addRange(V,R=!1){this._pushRange(V),this._lastRangeBackward=!!R,this.fire('change:range',{directChange:!0})}removeAllRanges(){0<this._ranges.length&&(this._removeAllRanges(),this.fire('change:range',{directChange:!0}))}setRanges(V,R=!1){V=Array.from(V);const F=V.some((N)=>{if(!(N instanceof w.a))throw new T.a('model-selection-added-not-range: Trying to add an object that is not an instance of Range.');return this._ranges.every((M)=>{return!M.isEqual(N)})});if(V.length!==this._ranges.length||F){this._removeAllRanges();for(let N of V)this._pushRange(N);this._lastRangeBackward=!!R,this.fire('change:range',{directChange:!0})}}setTo(V){this.setRanges(V.getRanges(),V.isBackward)}collapse(V,R){const F=f.a.createAt(V,R),N=new w.a(F,F);this.setRanges([N])}collapseToStart(){const V=this.getFirstPosition();null!==V&&this.setRanges([new w.a(V,V)])}collapseToEnd(){const V=this.getLastPosition();null!==V&&this.setRanges([new w.a(V,V)])}setFocus(V,R){if(null===this.anchor)throw new T.a('model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.');const F=f.a.createAt(V,R);if('same'!=F.compareWith(this.focus)){const N=this.anchor;this._ranges.length&&this._popRange(),'before'==F.compareWith(N)?this.addRange(new w.a(F,N),!0):this.addRange(new w.a(N,F))}}getAttribute(V){return this._attrs.get(V)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(V){return this._attrs.has(V)}clearAttributes(){if(0<this._attrs.size){const V=Array.from(this._attrs.keys());this._attrs.clear(),this.fire('change:attribute',{attributeKeys:V,directChange:!0})}}removeAttribute(V){this.hasAttribute(V)&&(this._attrs.delete(V),this.fire('change:attribute',{attributeKeys:[V],directChange:!0}))}setAttribute(V,R){this.getAttribute(V)!==R&&(this._attrs.set(V,R),this.fire('change:attribute',{attributeKeys:[V],directChange:!0}))}setAttributesTo(V){if(V=s.i(S.a)(V),!s.i(E.a)(V,this._attrs)){const R=new Set(Array.from(V.keys()).concat(Array.from(this._attrs.keys())));for(let[F,N]of V)this._attrs.get(F)===N&&R.delete(F);this._attrs=V,this.fire('change:attribute',{attributeKeys:Array.from(R),directChange:!0})}}getSelectedElement(){if(1!==this.rangeCount)return null;const V=this.getFirstRange(),R=V.start.nodeAfter,F=V.end.nodeBefore;return R instanceof h.a&&R==F?R:null}*getSelectedBlocks(){const V=new WeakSet;for(const R of this.getRanges()){const F=u(R.start,V);F&&(yield F);for(const M of R.getWalker())'elementEnd'==M.type&&d(M.item,V)&&(yield M.item);const N=u(R.end,V);N&&(yield N)}}static createFromSelection(V){const R=new this;return R.setTo(V),R}_pushRange(V){if(!(V instanceof w.a))throw new T.a('model-selection-added-not-range: Trying to add an object that is not an instance of Range.');this._checkRange(V),this._ranges.push(w.a.createFromRange(V))}_checkRange(V){for(let R=0;R<this._ranges.length;R++)if(V.isIntersecting(this._ranges[R]))throw new T.a('model-selection-range-intersects: Trying to add a range that intersects with another range from selection.',{addedRange:V,intersectingRange:this._ranges[R]})}_popRange(){this._ranges.pop()}_removeAllRanges(){for(;0<this._ranges.length;)this._popRange()}}r.a=O,s.i(P.a)(O,C.a)},function(o,r,s){'use strict';var d=s(0);/**
  119. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  120. * For licensing, see LICENSE.md.
  121. */class u{constructor(f,h,w){if(this.textNode=f,0>h||h>f.offsetSize)throw new d.a('model-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.');if(0>w||h+w>f.offsetSize)throw new d.a('model-textproxy-wrong-length: Given length value is incorrect.');this.data=f.data.substring(h,h+w),this.offsetInText=h}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(f){return'textProxy'==f}getPath(){const f=this.textNode.getPath();return 0<f.length&&(f[f.length-1]+=this.offsetInText),f}getAncestors(f={includeNode:!1,parentFirst:!1}){const h=[];for(let w=f.includeNode?this:this.parent;w;)h[f.parentFirst?'push':'unshift'](w),w=w.parent;return h}hasAttribute(f){return this.textNode.hasAttribute(f)}getAttribute(f){return this.textNode.getAttribute(f)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}r.a=u},function(o,r,s){'use strict';function d(R){return R instanceof Text&&R.data.substr(0,E)===O}function C(R,F){if(F.keyCode==T.b.arrowleft){const N=F.domTarget.ownerDocument.defaultView.getSelection();if(1==N.rangeCount&&N.getRangeAt(0).collapsed){const M=N.getRangeAt(0).startContainer,I=N.getRangeAt(0).startOffset;if(d(M)&&I<=E){const L=new Range;L.setStart(M,0),L.collapse(!0),N.removeAllRanges(),N.addRange(L)}}}}var T=s(22);s.d(r,'i',function(){return O}),r.c=d,r.f=function(R){return R.data.length==E&&d(R)},r.g=function(R){return d(R)?R.data.slice(E):R.data},r.e=function(R,F){let N=V.get(F);return N||(N=F(window.document),V.set(F,N)),R.isEqualNode(N)},r.h=function(R){R.on('keydown',C)};/**
  122. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  123. * For licensing, see LICENSE.md.
  124. */r.b=(R)=>{const F=R.createElement('br');return F.dataset.ckeFiller=!0,F};r.a=(R)=>R.createTextNode('\xA0');const E=7;r.d=E;let O='';for(let R=0;R<E;R++)O+='\u200B';const V=new WeakMap},function(o,r,s){'use strict';var d=s(50),u=s(117);/**
  125. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  126. * For licensing, see LICENSE.md.
  127. */class f extends d.a{constructor(h){super(h),this.useCapture=!1}observe(h){const w='string'==typeof this.domEventType?[this.domEventType]:this.domEventType;w.forEach((C)=>{this.listenTo(h,C,(T,P)=>{this.isEnabled&&this.onDomEvent(P)},{useCapture:this.useCapture})})}fire(h,w,C){this.isEnabled&&this.document.fire(h,new u.a(this.document,w,C))}}r.a=f},function(o,r){'use strict';/**
  128. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  129. * For licensing, see LICENSE.md.
  130. */r.a={window,document}},function(o,r,s){'use strict';var d=s(80),u=s(32),f=s(0),h=s(4);/**
  131. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  132. * For licensing, see LICENSE.md.
  133. */class w{constructor(){this.set('isFocused',!1),this.focusedElement=null,this._elements=new Set,this._nextEventLoopTimeout=null}add(C){if(this._elements.has(C))throw new f.a('focusTracker-add-element-already-exist');this.listenTo(C,'focus',()=>this._focus(C),{useCapture:!0}),this.listenTo(C,'blur',()=>this._blur(),{useCapture:!0}),this._elements.add(C)}remove(C){C===this.focusedElement&&this._blur(C),this._elements.has(C)&&(this.stopListening(C),this._elements.delete(C))}_focus(C){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=C,this.isFocused=!0}_blur(){this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}r.a=w,s.i(h.a)(w,d.a),s.i(h.a)(w,u.a)},function(o,r,s){'use strict';var d=s(80),u=s(22);/**
  134. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  135. * For licensing, see LICENSE.md.
  136. */r.a=class{constructor(){this._listener=Object.create(d.a),this._keystrokes=new Map}listenTo(h){this._listener.listenTo(h,'keydown',(w,C)=>{this.press(C)})}set(h,w){const C=s.i(u.d)(h),T=this._keystrokes.get(C);T?T.push(w):this._keystrokes.set(C,[w])}press(h){const w=s.i(u.c)(h),C=this._keystrokes.get(w);if(!C)return!1;for(let T of C)T(h,()=>{h.preventDefault(),h.stopPropagation()});return!0}destroy(){this._keystrokes=new Map,this._listener.stopListening()}}},function(o,r,s){'use strict';var u=s(56),f=Object.prototype,h=f.hasOwnProperty;r.a=function(w,C,T){var P=w[C];h.call(w,C)&&s.i(u.a)(P,T)&&(T!==void 0||C in w)||(w[C]=T)}},function(o,r,s){'use strict';var u=s(82),f=s(125),h=s(126),w=s(27),C=s(134),T=s(136);r.a=function(S,E,O,V){var R=-1,F=f.a,N=!0,M=S.length,I=[],L=E.length;if(!M)return I;O&&(E=s.i(w.a)(E,s.i(C.a)(O))),V?(F=h.a,N=!1):E.length>=200&&(F=T.a,N=!1,E=new u.a(E));outer:for(;++R<M;){var D=S[R],q=O?O(D):D;if(D=V||0!==D?D:0,N&&q===q){for(var z=L;z--;)if(E[z]===q)continue outer;I.push(D)}else F(E,q,V)||I.push(D)}return I}},function(o,r,s){'use strict';var u=s(199),f=s(442),h=s(207),w=s(96),C=s(36),T=s(92);r.a=function(P){var S=s.i(T.a)(P);if(!(S||s.i(w.a)(P)))return s.i(f.a)(P);var E=s.i(h.a)(P),V=E||[],R=V.length;for(var F in P)!s.i(u.a)(P,F)||!!E&&('length'==F||s.i(C.a)(F,R))||S&&'constructor'==F||V.push(F);return V}},function(o,r){'use strict';r.a=/**
  137. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  138. * For licensing, see LICENSE.md.
  139. */function(){let u='e';for(let f=0;8>f;f++)u+=_Mathfloor(65536*(1+Math.random())).toString(16).substring(1);return u}},function(o,r,s){'use strict';function d(L,D,q,z,$){if(z.test(q.input)&&L.schema.check({name:'paragraph',inside:q.context})){const K=new T.a('paragraph');I.add(K),q.context.push(K);const H=$.convertItem(q.input,z,q);H&&(q.output=K,K.appendChildren(H)),q.context.pop()}}function u(L,D,q,z,$){if(M.paragraphLikeElements.has(q.input.name)&&z.test(q.input,{name:!0})&&!h(q.input)&&L.schema.check({name:'paragraph',inside:q.context})){z.consume(q.input,{name:!0});const K=new T.a('paragraph');q.context.push(K);const H=$.convertChildren(q.input,z,q);K.appendChildren(V.a.normalizeNodes(H)),q.context.pop(),q.output=K}}function f(L,D){if(!D.output)return;let q;for(q=s.i(N.a)(D.output)?D.output[0]:D.output.getChild(0);q&&q.nextSibling;){const z=q.nextSibling;I.has(q)&&I.has(z)?(V.a.insert(P.a.createAt(q,'end'),Array.from(z.getChildren())),V.a.remove(S.a.createOn(z))):q=q.nextSibling}}function h(L){const D=O.a.createIn(L);for(const q of D)if(q.item instanceof E.a&&M.paragraphLikeElements.has(q.item.name))return!0;return!1}var w=s(381),C=s(3),T=s(5),P=s(1),S=s(2),E=s(21),O=s(29),V=s(13),R=s(47),F=s(48),N=s(11);/**
  140. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  141. * For licensing, see LICENSE.md.
  142. */class M extends C.a{init(){const L=this.editor,D=L.document,q=L.data,z=L.editing;D.schema.registerItem('paragraph','$block'),s.i(R.a)().for(q.modelToView,z.modelToView).fromElement('paragraph').toElement('p'),s.i(F.a)().for(q.viewToModel).fromElement('p').toElement('paragraph'),q.viewToModel.on('text',($,K,H,U)=>{d(D,$,K,H,U)},{priority:'lowest'}),q.viewToModel.on('element',f,{priority:'lowest'}),q.viewToModel.on('documentFragment',f,{priority:'lowest'}),q.viewToModel.on('element',($,K,H,U)=>{u(D,$,K,H,U)},{priority:'low'}),L.commands.set('paragraph',new w.a(L))}}r.a=M,M.paragraphLikeElements=new Set(['blockquote','dd','div','dt','h1','h2','h3','h4','h5','h6','li','p','td']);const I=new WeakSet},function(o,r,s){'use strict';var d=s(59),u=s(0);/**
  143. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  144. * For licensing, see LICENSE.md.
  145. */class f{constructor(h){this._nodes=[],h&&this.insertNodes(0,h)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((h,w)=>h+w.offsetSize,0)}getNode(h){return this._nodes[h]||null}getNodeIndex(h){const w=this._nodes.indexOf(h);return-1==w?null:w}getNodeStartOffset(h){const w=this.getNodeIndex(h);return null===w?null:this._nodes.slice(0,w).reduce((C,T)=>C+T.offsetSize,0)}indexToOffset(h){if(h==this._nodes.length)return this.maxOffset;const w=this._nodes[h];if(!w)throw new u.a('model-nodelist-index-out-of-bounds: Given index cannot be found in the node list.');return this.getNodeStartOffset(w)}offsetToIndex(h){let w=0;for(let C of this._nodes){if(h>=w&&h<w+C.offsetSize)return this.getNodeIndex(C);w+=C.offsetSize}if(w!=h)throw new u.a('model-nodelist-offset-out-of-bounds: Given offset cannot be found in the node list.');return this.length}insertNodes(h,w){for(let C of w)if(!(C instanceof d.a))throw new u.a('model-nodelist-insertNodes-not-node: Trying to insert an object which is not a Node instance.');this._nodes.splice(h,0,...w)}removeNodes(h,w=1){return this._nodes.splice(h,w)}toJSON(){return this._nodes.map((h)=>h.toJSON())}}r.a=f},function(o,r,s){'use strict';var d=s(33),u=s(2),f=s(0),h=s(13),w=s(509);/**
  146. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  147. * For licensing, see LICENSE.md.
  148. */class C extends d.a{constructor(T,P,S,E,O){super(O),this.range=u.a.createFromRange(T),this.key=P,this.oldValue=S===void 0?null:S,this.newValue=E===void 0?null:E}get type(){return null===this.oldValue?'addAttribute':null===this.newValue?'removeAttribute':'changeAttribute'}clone(){return new C(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new C(this.range,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_execute(){for(let T of this.range.getItems()){if(null!==this.oldValue&&!s.i(w.a)(T.getAttribute(this.key),this.oldValue))throw new f.a('attribute-operation-wrong-old-value: Changed node has different attribute value than operation\'s old attribute value.',{item:T,key:this.key,value:this.oldValue});if(null===this.oldValue&&null!==this.newValue&&T.hasAttribute(this.key))throw new f.a('attribute-operation-attribute-exists: The attribute with given key already exists.',{node:T,key:this.key});if(s.i(w.a)(this.oldValue,this.newValue))return}return h.a.setAttribute(this.range,this.key,this.newValue),{range:this.range,key:this.key,oldValue:this.oldValue,newValue:this.newValue}}static get className(){return'engine.model.operation.AttributeOperation'}static fromJSON(T,P){return new C(u.a.fromJSON(T.range,P),T.key,T.oldValue,T.newValue,T.baseVersion)}}r.a=C},function(o,r,s){'use strict';var d=s(33);/**
  149. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  150. * For licensing, see LICENSE.md.
  151. */class u extends d.a{clone(){return new u(this.baseVersion)}getReversed(){return new u(this.baseVersion+1)}_execute(){}static get className(){return'engine.model.operation.NoOperation'}}r.a=u},function(o,r,s){'use strict';var d=s(39),u=s(0),f=s(4),h=s(32);/**
  152. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  153. * For licensing, see LICENSE.md.
  154. */const w=Symbol('document');class C extends d.a{constructor(T,P,S){super(T,P,S),this.set('isReadOnly',!1),this.set('isFocused',!1)}get document(){return this.getCustomProperty(w)}set document(T){if(this.getCustomProperty(w))throw new u.a('view-editableelement-document-already-set: View document is already set.');this.setCustomProperty(w,T),this.bind('isFocused').to(T,'isFocused',(P)=>P&&T.selection.editableElement==this),this.listenTo(T,'render',()=>{this.isFocused=T.isFocused&&T.selection.editableElement==this},{priority:'high'})}}r.a=C,s.i(f.a)(C,h.a)},function(o,r,s){'use strict';var d=s(0),u=s(7),f=s(4);/**
  155. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  156. * For licensing, see LICENSE.md.
  157. */class h{constructor(){this.parent=null}get index(){let w;if(!this.parent)return null;if(-1==(w=this.parent.getChildIndex(this)))throw new d.a('view-node-not-found-in-parent: The node\'s parent does not contain this node.');return w}get nextSibling(){const w=this.index;return null!==w&&this.parent.getChild(w+1)||null}get previousSibling(){const w=this.index;return null!==w&&this.parent.getChild(w-1)||null}get root(){let w=this;for(;w.parent;)w=w.parent;return w}get document(){return this.parent instanceof h?this.parent.document:null}getAncestors(w={includeNode:!1,parentFirst:!1}){const C=[];for(let T=w.includeNode?this:this.parent;T;)C[w.parentFirst?'push':'unshift'](T),T=T.parent;return C}remove(){this.parent.removeChildren(this.index)}_fireChange(w,C){this.fire('change:'+w,C),this.parent&&this.parent._fireChange(w,C)}}r.a=h,s.i(f.a)(h,u.a)},function(o,r,s){'use strict';var d=s(0),u=s(29),f=s(25),h=s(4),w=s(7),C=s(21);/**
  158. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  159. * For licensing, see LICENSE.md.
  160. */class T{constructor(){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel=''}setFake(P=!0,S={}){this._isFake=P,this._fakeSelectionLabel=P?S.label||'':'',this.fire('change')}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const P=this._ranges[this._ranges.length-1],S=this._lastRangeBackward?P.end:P.start;return f.a.createFromPosition(S)}get focus(){if(!this._ranges.length)return null;const P=this._ranges[this._ranges.length-1],S=this._lastRangeBackward?P.start:P.end;return f.a.createFromPosition(S)}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}addRange(P,S){if(!(P instanceof u.a))throw new d.a('view-selection-invalid-range: Invalid Range.');this._pushRange(P),this._lastRangeBackward=!!S,this.fire('change')}*getRanges(){for(let P of this._ranges)yield u.a.createFromRange(P)}getFirstRange(){let P=null;for(let S of this._ranges)(!P||S.start.isBefore(P.start))&&(P=S);return P?u.a.createFromRange(P):null}getLastRange(){let P=null;for(let S of this._ranges)(!P||S.end.isAfter(P.end))&&(P=S);return P?u.a.createFromRange(P):null}getFirstPosition(){const P=this.getFirstRange();return P?f.a.createFromPosition(P.start):null}getLastPosition(){const P=this.getLastRange();return P?f.a.createFromPosition(P.end):null}isEqual(P){if(this.isFake!=P.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=P.fakeSelectionLabel)return!1;if(this.rangeCount!=P.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(P.anchor)||!this.focus.isEqual(P.focus))return!1;for(let S of this._ranges){let E=!1;for(let O of P._ranges)if(S.isEqual(O)){E=!0;break}if(!E)return!1}return!0}removeAllRanges(){this._ranges.length&&(this._ranges=[],this.fire('change'))}setRanges(P,S){this._ranges=[];for(let E of P){if(!(E instanceof u.a))throw new d.a('view-selection-invalid-range: Invalid Range.');this._pushRange(E)}this._lastRangeBackward=!!S,this.fire('change')}setTo(P){this._isFake=P._isFake,this._fakeSelectionLabel=P._fakeSelectionLabel,this.setRanges(P.getRanges(),P.isBackward)}collapse(P,S){const E=f.a.createAt(P,S),O=new u.a(E,E);this.setRanges([O])}collapseToStart(){const P=this.getFirstPosition();null!==P&&this.setRanges([new u.a(P,P)])}collapseToEnd(){const P=this.getLastPosition();null!==P&&this.setRanges([new u.a(P,P)])}setFocus(P,S){if(null===this.anchor)throw new d.a('view-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.');const E=f.a.createAt(P,S);if('same'!=E.compareWith(this.focus)){const O=this.anchor;this._ranges.pop(),'before'==E.compareWith(O)?this.addRange(new u.a(E,O),!0):this.addRange(new u.a(O,E))}}getSelectedElement(){if(1!==this.rangeCount)return null;const P=this.getFirstRange(),S=P.start.nodeAfter,E=P.end.nodeBefore;return S instanceof C.a&&S==E?S:null}static createFromSelection(P){const S=new T;return S.setTo(P),S}_pushRange(P){for(let S of this._ranges)if(P.isIntersecting(S))throw new d.a('view-selection-range-intersects: Trying to add a range that intersects with another range from selection.',{addedRange:P,intersectingRange:S});this._ranges.push(u.a.createFromRange(P))}}r.a=T,s.i(h.a)(T,w.a)},function(o,r,s){'use strict';function f(le){const de=le.offset,ce=le.parent;if(ce.is('text'))return le;if(ce.is('attributeElement')&&0===ce.childCount){const pe=ce.parent,ge=ce.index;return ce.remove(),f(new G.a(pe,ge))}const ue=ce.getChild(de-1),me=ce.getChild(de);if(!ue||!me)return le;if(ue.is('text')&&me.is('text'))return z(ue,me);if(ue.is('attributeElement')&&me.is('attributeElement')&&ue.isSimilar(me)){const pe=ue.childCount;return ue.appendChildren(me.getChildren()),me.remove(),f(new G.a(ue,pe))}return le}function C(le,de){de=s.i(ie.a)(de)?[...de]:[de],U(de);const ce=F(le);if(!ce)throw new ne.a('view-writer-invalid-position-container');const ue=M(le,!0),me=ce.insertChildren(ue.offset,de),pe=ue.getShiftedBy(me),ge=f(ue);if(0===me)return new te.a(ge,ge);ge.isEqual(ue)||pe.offset--;const fe=f(pe);return new te.a(ge,fe)}function T(le){if(Z(le),le.isCollapsed)return new oe.a;const{start:de,end:ce}=N(le,!0),ue=de.parent,me=ce.offset-de.offset,pe=ue.removeChildren(de.offset,me),ge=f(de);return le.start=ge,le.end=G.a.createFromPosition(ge),new oe.a(pe)}function S(le,de){let ce;if(de.isAfter(le.end)){de=M(de,!0);const ue=de.parent,me=ue.childCount;le=N(le,!0),ce=T(le),de.offset+=ue.childCount-me}else ce=T(le);return C(de,ce)}function E(le,de){if(!(de instanceof Y.a))throw new ne.a('view-writer-wrap-invalid-attribute');if(Z(le),le.isCollapsed)return le;if(le.end.isEqual(le.start.getShiftedBy(1))){const be=le.start.nodeAfter;if(be instanceof Y.a&&$(de,be))return le}if(H(le)&&$(de,le.start.parent)){const be=le.start.parent.parent,_e=le.start.parent.index;return te.a.createFromParentsAndOffsets(be,_e,be,_e+1)}const{start:ce,end:ue}=N(le,!0),me=ce.parent,pe=I(me,ce.offset,ue.offset,de),ge=L(me,pe.start.offset,pe.end.offset,de),fe=f(ge.start);fe.isEqual(ge.start)||ge.end.offset--;const he=f(ge.end);return new te.a(fe,he)}function F(le){let de=le.parent;for(;!W(de);){if(!de)return;de=de.parent}return de}function N(le,de=!1){const ce=le.start,ue=le.end;if(Z(le),le.isCollapsed){const fe=M(le.start,de);return new te.a(fe,fe)}const me=M(ue,de),pe=me.parent.childCount,ge=M(ce,de);return me.offset+=me.parent.childCount-pe,new te.a(ge,me)}function M(le,de=!1){const ce=le.offset,ue=le.parent;if(le.parent.is('emptyElement'))throw new ne.a('view-writer-cannot-break-empty-element');if(le.parent.is('uiElement'))throw new ne.a('view-writer-cannot-break-ui-element');if(!de&&ue.is('text')&&W(ue.parent))return G.a.createFromPosition(le);if(W(ue))return G.a.createFromPosition(le);if(ue.is('text'))return M(q(le),de);const me=ue.childCount;if(ce==me){const pe=new G.a(ue.parent,ue.index+1);return M(pe,de)}if(0===ce){const pe=new G.a(ue.parent,ue.index);return M(pe,de)}const pe=ue.index+1,ge=ue.clone();ue.parent.insertChildren(pe,ge);const fe=ue.childCount-ce,he=ue.removeChildren(ce,fe);ge.appendChildren(he);const be=new G.a(ue.parent,pe);return M(be,de)}function I(le,de,ce,ue){let me=de;const pe=[];for(;me<ce;){const fe=le.getChild(me);if(fe.isSimilar(ue)){const he=fe.getChildren(),be=fe.childCount;fe.remove(),le.insertChildren(me,he),pe.push(new G.a(le,me),new G.a(le,me+be)),me+=be,ce+=be-1}else fe.is('attributeElement')&&I(fe,0,fe.childCount,ue),me++}let ge=0;for(let fe of pe){if(fe.offset-=ge,fe.offset==de||fe.offset==ce)continue;const he=f(fe);he.isEqual(fe)||(ge++,ce--)}return te.a.createFromParentsAndOffsets(le,de,le,ce)}function L(le,de,ce,ue){let me=de;const pe=[];for(;me<ce;){const fe=le.getChild(me),he=fe.is('text'),be=fe.is('attributeElement'),_e=fe.is('emptyElement'),ke=fe.is('uiElement');if(he||_e||ke||be&&ue.priority<=fe.priority){const ye=ue.clone();fe.remove(),ye.appendChildren(fe),le.insertChildren(me,ye),pe.push(new G.a(le,me))}else be&&L(fe,0,fe.childCount,ue);me++}let ge=0;for(let fe of pe){if(fe.offset-=ge,fe.offset==de)continue;const he=f(fe);he.isEqual(fe)||(ge++,ce--)}return te.a.createFromParentsAndOffsets(le,de,le,ce)}function D(le){const de=le.nodeBefore;if(de&&de.is('text'))return new G.a(de,de.data.length);const ce=le.nodeAfter;return ce&&ce.is('text')?new G.a(ce,0):le}function q(le){if(le.offset==le.parent.data.length)return new G.a(le.parent.parent,le.parent.index+1);if(0===le.offset)return new G.a(le.parent.parent,le.parent.index);const de=le.parent.data.slice(le.offset);return le.parent.data=le.parent.data.slice(0,le.offset),le.parent.parent.insertChildren(le.parent.index+1,new ee.a(de)),new G.a(le.parent.parent,le.parent.index+1)}function z(le,de){const ce=le.data.length;return le.data+=de.data,de.remove(),new G.a(le,ce)}function $(le,de){if(le.name!==de.name||le.priority!==de.priority)return!1;for(let ce of le.getAttributeKeys())if('class'!==ce&&'style'!==ce&&de.hasAttribute(ce)&&de.getAttribute(ce)!==le.getAttribute(ce))return!1;for(let ce of le.getStyleNames())if(de.hasStyle(ce)&&de.getStyle(ce)!==le.getStyle(ce))return!1;for(let ce of le.getAttributeKeys())'class'!==ce&&'style'!==ce&&(de.hasAttribute(ce)||de.setAttribute(ce,le.getAttribute(ce)));for(let ce of le.getStyleNames())de.hasStyle(ce)||de.setStyle(ce,le.getStyle(ce));for(let ce of le.getClassNames())de.hasClass(ce)||de.addClass(ce);return!0}function K(le,de){if(le.name!==de.name||le.priority!==de.priority)return!1;for(let ce of le.getAttributeKeys())if('class'!==ce&&'style'!==ce&&(!de.hasAttribute(ce)||de.getAttribute(ce)!==le.getAttribute(ce)))return!1;if(!de.hasClass(...le.getClassNames()))return!1;for(let ce of le.getStyleNames())if(!de.hasStyle(ce)||de.getStyle(ce)!==le.getStyle(ce))return!1;for(let ce of le.getAttributeKeys())'class'!==ce&&'style'!==ce&&de.removeAttribute(ce);return de.removeClass(...le.getClassNames()),de.removeStyle(...le.getStyleNames()),!0}function H(le){return le.start.parent==le.end.parent&&le.start.parent.is('attributeElement')&&0===le.start.offset&&le.end.offset===le.start.parent.childCount}function U(le){for(let de of le){if(!se.some((ce)=>de instanceof ce))throw new ne.a('view-writer-insert-invalid-node');de.is('text')||U(de.getChildren())}}function W(le){return le&&(le.is('containerElement')||le.is('documentFragment'))}function Z(le){const de=F(le.start),ce=F(le.end);if(!de||!ce||de!==ce)throw new ne.a('view-writer-invalid-range-container')}var G=s(25),J=s(39),Y=s(115),X=s(168),Q=s(172),ee=s(30),te=s(29),ae=s(51),ne=s(0),oe=s(116),ie=s(41);/**
  161. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  162. * For licensing, see LICENSE.md.
  163. */r.a={breakAttributes:function(le){return le instanceof G.a?M(le):N(le)},breakContainer:function(le){const de=le.parent;if(!de.is('containerElement'))throw new ne.a('view-writer-break-non-container-element: Trying to break an element which is not a container element.');if(!de.parent)throw new ne.a('view-writer-break-root: Trying to break root element.');if(le.isAtStart)return G.a.createBefore(de);if(!le.isAtEnd){const ce=de.clone(!1);C(G.a.createAfter(de),ce);const ue=new te.a(le,G.a.createAt(de,'end')),me=new G.a(ce,0);S(ue,me)}return G.a.createAfter(de)},mergeAttributes:f,mergeContainers:function(le){const de=le.nodeBefore,ce=le.nodeAfter;if(!de||!ce||!de.is('containerElement')||!ce.is('containerElement'))throw new ne.a('view-writer-merge-containers-invalid-position: Element before and after given position cannot be merged.');const ue=de.getChild(de.childCount-1),me=ue instanceof ee.a?G.a.createAt(ue,'end'):G.a.createAt(de,'end');return S(te.a.createIn(ce),G.a.createAt(de,'end')),T(te.a.createOn(ce)),me},insert:C,remove:T,clear:function(le,de){Z(le);const ce=le.getWalker({direction:'backward',ignoreElementEnd:!0});for(const ue of ce){const me=ue.item;let pe;if(me.is('element')&&de.isSimilar(me))pe=te.a.createOn(me);else if(!ue.nextPosition.isAfter(le.start)&&(me.is('text')||me.is('textProxy'))){const ge=me.getAncestors().find((fe)=>{return fe.is('element')&&de.isSimilar(fe)});ge&&(pe=te.a.createIn(ge))}pe&&(pe.end.isAfter(le.end)&&(pe.end=le.end),pe.start.isBefore(le.start)&&(pe.start=le.start),T(pe))}},move:S,wrap:E,wrapPosition:function(le,de){if(!(de instanceof Y.a))throw new ne.a('view-writer-wrap-invalid-attribute');if(de.isSimilar(le.parent))return D(G.a.createFromPosition(le));le.parent.is('text')&&(le=q(le));const ce=new Y.a;ce.priority=_NumberPOSITIVE_INFINITY,ce.isSimilar=()=>!1,le.parent.insertChildren(le.offset,ce);const ue=new te.a(le,le.getShiftedBy(1));E(ue,de);const me=new G.a(ce.parent,ce.index);ce.remove();const pe=me.nodeBefore,ge=me.nodeAfter;return pe instanceof ee.a&&ge instanceof ee.a?z(pe,ge):D(me)},unwrap:function(le,de){if(!(de instanceof Y.a))throw new ne.a('view-writer-unwrap-invalid-attribute');if(Z(le),le.isCollapsed)return le;if(le.end.isEqual(le.start.getShiftedBy(1))){const he=le.start.nodeAfter;if(!de.isSimilar(he)&&he instanceof Y.a&&K(de,he))return le}const{start:ce,end:ue}=N(le,!0),me=ce.parent,pe=I(me,ce.offset,ue.offset,de),ge=f(pe.start);ge.isEqual(pe.start)||pe.end.offset--;const fe=f(pe.end);return new te.a(ge,fe)},rename:function(le,de){const ce=new J.a(de,le.getAttributes());return C(G.a.createAfter(le),ce),S(te.a.createIn(le),G.a.createAt(ce)),T(te.a.createOn(le)),ce},breakViewRangePerContainer:function(le){const de=[],ce=new ae.a({boundaries:le});let ue=le.start;for(let me of ce)me.item.is('containerElement')&&(ue.isEqual(me.previousPosition)||de.push(new te.a(ue,me.previousPosition)),ue=me.nextPosition);return de.push(new te.a(ue,le.end)),de}};const se=[ee.a,Y.a,J.a,X.a,Q.a]},function(o,r,s){'use strict';var d=s(7),u=s(0),f=s(70),h=s(4);/**
  164. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  165. * For licensing, see LICENSE.md.
  166. */class w{constructor(C){this._items=[],this._itemMap=new Map,this._idProperty=C&&C.idProperty||'id',this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap}get length(){return this._items.length}add(C,T){let P;const S=this._idProperty;if(S in C){if(P=C[S],'string'!=typeof P)throw new u.a('collection-add-invalid-id');if(this.get(P))throw new u.a('collection-add-item-already-exists')}else C[S]=P=s.i(f.a)();if(void 0===T)T=this._items.length;else if(T>this._items.length||0>T)throw new u.a('collection-add-item-invalid-index');return this._items.splice(T,0,C),this._itemMap.set(P,C),this.fire('add',C,T),this}get(C){let T;if('string'==typeof C)T=this._itemMap.get(C);else if('number'==typeof C)T=this._items[C];else throw new u.a('collection-get-invalid-arg: Index or id must be given.');return T||null}getIndex(C){let T;return T='string'==typeof C?this._itemMap.get(C):C,this._items.indexOf(T)}remove(C){let E=!1,T,P,S;const O=this._idProperty;if('string'==typeof C?(P=C,S=this._itemMap.get(P),E=!S,S&&(T=this._items.indexOf(S))):'number'==typeof C?(T=C,S=this._items[T],E=!S,S&&(P=S[O])):(S=C,P=S[O],T=this._items.indexOf(S),E=-1==T||!this._itemMap.get(P)),E)throw new u.a('collection-remove-404: Item not found.');this._items.splice(T,1),this._itemMap.delete(P);const V=this._bindToInternalToExternalMap.get(S);return this._bindToInternalToExternalMap.delete(S),this._bindToExternalToInternalMap.delete(V),this.fire('remove',S),S}map(C,T){return this._items.map(C,T)}find(C,T){return this._items.find(C,T)}filter(C,T){return this._items.filter(C,T)}clear(){for(this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);this.length;)this.remove(0)}bindTo(C){if(this._bindToCollection)throw new u.a('collection-bind-to-rebind: The collection cannot be bound more than once.');return this._bindToCollection=C,{as:(T)=>{this._setUpBindToBinding((P)=>new T(P))},using:(T)=>{'function'==typeof T?this._setUpBindToBinding((P)=>T(P)):this._setUpBindToBinding((P)=>P[T])}}}_setUpBindToBinding(C){const T=this._bindToCollection,P=(S,E,O)=>{const V=T._bindToCollection==this,R=T._bindToInternalToExternalMap.get(E);if(V&&R)this._bindToExternalToInternalMap.set(E,R),this._bindToInternalToExternalMap.set(R,E);else{const F=C(E);this._bindToExternalToInternalMap.set(E,F),this._bindToInternalToExternalMap.set(F,E),this.add(F,O)}};for(let S of T)P(null,S);this.listenTo(T,'add',P),this.listenTo(T,'remove',(S,E)=>{const O=this._bindToExternalToInternalMap.get(E);O&&this.remove(O)})}[Symbol.iterator](){return this._items[Symbol.iterator]()}}r.a=w,s.i(h.a)(w,d.a)},function(o,r,s){'use strict';function d(S){return S['data-ck-expando']||(S['data-ck-expando']=s.i(h.a)())}function u(S){return S&&s.i(C.a)(S.addEventListener)}var f=s(7),h=s(70),w=s(57),C=s(235);/**
  167. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  168. * For licensing, see LICENSE.md.
  169. */const T=s.i(w.a)({},f.a,{listenTo(...S){const E=S[0];u(E)&&(S[0]=this._getProxyEmitter(E)||new P(E)),f.a.listenTo.apply(this,S)},stopListening(...S){const E=S[0];if(u(E)){let O=this._getProxyEmitter(E);if(!O)return;S[0]=O}f.a.stopListening.apply(this,S)},_getProxyEmitter(S){return s.i(f.b)(this,d(S))}});r.a=T;class P{constructor(S){s.i(f.c)(this,d(S)),this._domNode=S}}s.i(w.a)(P.prototype,f.a,{on(S,E,O={}){if(f.a.on.apply(this,arguments),!(this._domListeners&&this._domListeners[S])){const V=this._createDomListener(S);this._domNode.addEventListener(S,V,!!O.useCapture),this._domListeners||(this._domListeners={}),this._domListeners[S]=V}},off(S){f.a.off.apply(this,arguments);let E;!this._domListeners[S]||(E=this._events[S])&&E.callbacks.length||this._domListeners[S].removeListener()},_createDomListener(S){const E=(O)=>{this.fire(S,O)};return E.removeListener=()=>{this._domNode.removeEventListener(S,E),delete this._domListeners[S]},E}})},function(o,r,s){'use strict';function d(T){var P=-1,S=T?T.length:0;for(this.clear();++P<S;){var E=T[P];this.set(E[0],E[1])}}var u=s(481),f=s(482),h=s(483),w=s(484),C=s(485);d.prototype.clear=u.a,d.prototype['delete']=f.a,d.prototype.get=h.a,d.prototype.has=w.a,d.prototype.set=C.a,r.a=d},function(o,r,s){'use strict';function d(w){var C=-1,T=w?w.length:0;for(this.__data__=new u.a;++C<T;)this.add(w[C])}var u=s(122),f=s(492),h=s(493);d.prototype.add=d.prototype.push=f.a,d.prototype.has=h.a,r.a=d},function(o,r){'use strict';r.a=function(u,f){for(var h=-1,w=u.length,C=0,T=[],P;++h<w;)P=u[h],f(P,h,u)&&(T[C++]=P);return T}},function(o,r){'use strict';r.a=function(u,f){for(var h=-1,w=f.length,C=u.length;++h<w;)u[C+h]=f[h];return u}},function(o,r,s){'use strict';var u=s(56);r.a=function(f,h){for(var w=f.length;w--;)if(s.i(u.a)(f[w][0],h))return w;return-1}},function(o,r,s){'use strict';var u=s(133),f=s(229),h=s(44);r.a=function(T,P,S){var E=0,O=T?T.length:E;if('number'==typeof P&&P===P&&O<=4294967295>>>1){for(;E<O;){var V=E+O>>>1,R=T[V];null!==R&&!s.i(h.a)(R)&&(S?R<=P:R<P)?E=V+1:O=V}return O}return s.i(u.a)(T,P,f.a,S)}},function(o,r,s){'use strict';var u=s(35);r.a=function(f,h,w,C){for(var T=f.length,P=C?T:-1;(C?P--:++P<T)&&h(f[P],P,f););return w?s.i(u.a)(f,C?0:P,C?P+1:T):s.i(u.a)(f,C?P+1:0,C?T:P)}},function(o,r,s){'use strict';var u=s(11),f=s(500);r.a=function(h){return s.i(u.a)(h)?h:s.i(f.a)(h)}},function(o,r,s){'use strict';var u=s(479);r.a=function(f,h){var w=f.__data__;return s.i(u.a)(h)?w['string'==typeof h?'string':'hash']:w.map}},function(o,r){'use strict';r.a=function(u){var f=!1;if(null!=u&&'function'!=typeof u.toString)try{f=!!(u+'')}catch(h){}return f}},function(o,r,s){'use strict';var u=s(56),f=s(96),h=s(36),w=s(15);r.a=function(C,T,P){if(!s.i(w.a)(P))return!1;var S=typeof T;return!('number'==S?!(s.i(f.a)(P)&&s.i(h.a)(T,P.length)):!('string'==S&&T in P))&&s.i(u.a)(P[T],C)}},function(o,r){'use strict';var u=Object.prototype;r.a=function(f){var h=f&&f.constructor,w='function'==typeof h&&h.prototype||u;return f===w}},function(o,r,s){'use strict';var d=s(53),u=s.i(d.a)(Object,'create');r.a=u},function(o,r){'use strict';r.a=function(u){var f=-1,h=Array(u.size);return u.forEach(function(w){h[++f]=w}),h}},function(o,r,s){'use strict';var u=s(197);r.a=function(f){return s.i(u.a)(f,!1,!0)}},function(o,r,s){'use strict';var u=s(467),f=s(148),h=s(97);r.a=function(w){return null!=w&&s.i(h.a)(s.i(u.a)(w))&&!s.i(f.a)(w)}},function(o,r){'use strict';r.a=function(f){return'number'==typeof f&&-1<f&&0==f%1&&f<=9007199254740991}},function(o,r,s){'use strict';var u=s(140),f=s(90),h=s(43),C=Object.prototype,T=Function.prototype.toString,P=C.hasOwnProperty,S=T.call(Object),E=C.toString;r.a=function(O){if(!s.i(h.a)(O)||E.call(O)!='[object Object]'||s.i(f.a)(O))return!1;var V=s.i(u.a)(O);if(null===V)return!0;var R=P.call(V,'constructor')&&V.constructor;return'function'==typeof R&&R instanceof R&&T.call(R)==S}},function(o,r,s){'use strict';var u=s(83),f=s(27),h=s(131),w=s(202),C=s(14);r.a=function(P){if(!(P&&P.length))return[];var S=0;return P=s.i(u.a)(P,function(E){if(s.i(C.a)(E))return S=_Mathmax(E.length,S),!0}),s.i(w.a)(S,function(E){return s.i(f.a)(P,s.i(h.a)(E))})}},function(o,r,s){'use strict';var u=s(34),f=s(2),h=s(1);/**
  170. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  171. * For licensing, see LICENSE.md.
  172. */r.a=function(w,C,T){const P=[];for(let S of C){const E=new u.a({boundaries:S,mergeCharacters:!0});let O=E.next(),V=S.start,R=S.start,F=S.end;for(;!O.done;){const N=O.value.item.name||'$text',M=h.a.createBefore(O.value.item);T.check({name:N,inside:M,attributes:w})||(!R.isEqual(V)&&P.push(new f.a(R,V)),R=E.position),V=E.position,O=E.next()}R&&!R.isEqual(F)&&P.push(new f.a(R,F))}return P}},function(o,r,s){'use strict';/**
  173. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  174. * For licensing, see LICENSE.md.
  175. */function O(D,q){const z=new I.a({startPosition:D,singleCharacters:!0});let $=0;for(let K of z)if('text'==K.type&&($++,$==q))return z.position}function R(D){const q=D.split(':');return q[0]+':'+q[1]}var F=s(21),N=s(30),M=s(29),I=s(51),L=s(78);r.a=function(D){return(q,z,$,K)=>{const H=D instanceof F.a?D.clone(!0):D(z,$,K);if(H&&$.consume(z.item,'insert')){const U=K.mapper.toViewPosition(z.range.start);K.mapper.bindElements(z.item,H),L.a.insert(U,H)}}},r.j=function(){return(D,q,z,$)=>{if(z.consume(q.item,'insert')){const K=$.mapper.toViewPosition(q.range.start),H=new N.a(q.item.data);L.a.insert(K,H)}}},r.f=function(D){return(q,z,$,K)=>{let H,U;if((D instanceof F.a?(H=D.clone(!0),U=D.clone(!0)):(z.isOpening=!0,H=D(z,$,K),z.isOpening=!1,U=D(z,$,K)),H&&U)&&$.consume(z.range,'addMarker')){const W=K.mapper;L.a.insert(W.toViewPosition(z.range.start),H),z.range.isCollapsed||L.a.insert(W.toViewPosition(z.range.end),U)}}},r.h=function(D){return D=D||((q,z)=>({value:q,key:z})),(q,z,$,K)=>{if($.consume(z.item,R(q.name))){const{key:H,value:U}=D(z.attributeNewValue,z.attributeKey,z,$,K);K.mapper.toViewElement(z.item).setAttribute(H,U)}}},r.i=function(D){return D=D||((q,z)=>({key:z})),(q,z,$,K)=>{if($.consume(z.item,R(q.name))){const{key:H}=D(z.attributeOldValue,z.attributeKey,z,$,K);K.mapper.toViewElement(z.item).removeAttribute(H)}}},r.b=function(D){return(q,z,$,K)=>{const H=D instanceof F.a?D.clone(!0):D(z.attributeNewValue,z,$,K);if(!H)return;if(!$.consume(z.item,R(q.name)))return;let U=K.mapper.toViewRange(z.range);if(null!==z.attributeOldValue&&!(D instanceof F.a)){const W=D(z.attributeOldValue,z,$,K);U=L.a.unwrap(U,W)}L.a.wrap(U,H)}},r.c=function(D){return(q,z,$,K)=>{const H=D instanceof F.a?D.clone(!0):D(z.attributeOldValue,z,$,K);if(H&&$.consume(z.item,R(q.name))){const U=K.mapper.toViewRange(z.range);L.a.unwrap(U,H)}}},r.d=function(D){return(q,z,$,K)=>{const H=D instanceof F.a?D.clone(!0):D(z,$,K);if(H&&$.consume(z.range,'addMarker')){const U=K.mapper.toViewRange(z.range),W=L.a.breakViewRangePerContainer(U);for(let Z of W)L.a.wrap(Z,H)}}},r.e=function(D){return(q,z,$,K)=>{const H=D instanceof F.a?D.clone(!0):D(z,$,K);if(H&&$.consume(z.range,'removeMarker')){const U=K.mapper.toViewRange(z.range),W=L.a.breakViewRangePerContainer(U);for(let Z of W)L.a.unwrap(Z,H)}}},r.k=function(){return(D,q,z,$)=>{if(!z.consume(q.item,'remove'))return;const K=$.mapper.toViewPosition(q.sourcePosition);let H;if(q.item.is('element'))H=M.a.createOn(K.nodeAfter);else{const U=O(K,q.item.offsetSize);H=new M.a(K,U)}L.a.remove(H.getTrimmed()),'$graveyard'==q.item.root.rootName&&$.mapper.unbindModelElement(q.item)}},r.g=function(D){return(q,z,$,K)=>{let H,U;if((D instanceof F.a?(H=D.clone(!0),U=D.clone(!0)):(z.isOpening=!0,H=D(z,$,K),z.isOpening=!1,U=D(z,$,K)),H&&U)&&$.consume(z.range,'removeMarker')){const W=K.mapper.toViewRange(z.range);L.a.clear(W.getEnlarged(),U),H.isSimilar(U)||L.a.clear(W.getEnlarged(),H)}}}},function(o,r,s){'use strict';var d=s(20),u=s(105),f=s(18),h=s(37),w=s(17),C=s(13),T=s(49),P=s(2),S=s(1);/**
  176. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  177. * For licensing, see LICENSE.md.
  178. */class E extends d.a{get type(){return'insert'}get position(){return this._insertOperation?this._insertOperation.position:null}get nodes(){return this._insertOperation?this._insertOperation.nodes:null}get _insertOperation(){return this.operations[0]||null}get _reverseDeltaClass(){return u.a}static get className(){return'engine.model.delta.InsertDelta'}static get _priority(){return 20}}r.a=E,s.i(w.b)('insert',function(O,V){const R=s.i(C.b)(V);if(0===R.length)return this;const F=new E,N=new h.a(O,R,this.document.version);if(this.addDelta(F),F.addOperation(N),this.document.applyOperation(N),V instanceof T.a)for(const[M,I]of V.markers){const L=S.a.createAt(I.root),D=new P.a(I.start._getCombined(L,O),I.end._getCombined(L,O));this.setMarker(M,D)}return this}),f.a.register(E)},function(o,r,s){'use strict';var d=s(20),u=s(18),f=s(106),h=s(17),w=s(1),C=s(5),T=s(38),P=s(28),S=s(0);/**
  179. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  180. * For licensing, see LICENSE.md.
  181. */class E extends d.a{get type(){return'merge'}get position(){return this._removeOperation?this._removeOperation.sourcePosition:null}getReversed(){let O=super.getReversed();return 0<O.operations.length&&(O.operations[1].isSticky=!1),O}get _removeOperation(){return this.operations[1]||null}get _reverseDeltaClass(){return f.a}static get className(){return'engine.model.delta.MergeDelta'}}r.a=E,s.i(h.b)('merge',function(O){const V=new E;this.addDelta(V);const R=O.nodeBefore,F=O.nodeAfter;if(!(R instanceof C.a))throw new S.a('batch-merge-no-element-before: Node before merge position must be an element.');if(!(F instanceof C.a))throw new S.a('batch-merge-no-element-after: Node after merge position must be an element.');const N=w.a.createFromParentAndOffset(F,0),M=w.a.createFromParentAndOffset(R,R.maxOffset),I=new P.a(N,F.maxOffset,M,this.document.version);I.isSticky=!0,V.addOperation(I),this.document.applyOperation(I);const L=new T.a(O,1,this.document.version);return V.addOperation(L),this.document.applyOperation(L),this}),u.a.register(E)},function(o,r,s){'use strict';function d(E,O,V,R,F){const N=new w.a(V,R,F,E.document.version);O.addOperation(N),E.document.applyOperation(N)}var u=s(20),f=s(18),h=s(17),w=s(28),C=s(1),T=s(2),P=s(0);/**
  182. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  183. * For licensing, see LICENSE.md.
  184. */class S extends u.a{get type(){return'move'}get howMany(){return this._moveOperation?this._moveOperation.howMany:null}get sourcePosition(){return this._moveOperation?this._moveOperation.sourcePosition:null}get targetPosition(){return this._moveOperation?this._moveOperation.targetPosition:null}get _moveOperation(){return this.operations[0]||null}get _reverseDeltaClass(){return S}static get className(){return'engine.model.delta.MoveDelta'}static get _priority(){return 20}}r.a=S,s.i(h.b)('move',function(E,O){const V=new S;if(this.addDelta(V),E instanceof T.a){if(!E.isFlat)throw new P.a('batch-move-range-not-flat: Range to move is not flat.');d(this,V,E.start,E.end.offset-E.start.offset,O)}else d(this,V,C.a.createBefore(E),1,O);return this}),f.a.register(S)},function(o,r,s){'use strict';function d(S,E,O,V){const R=new w.a(O,V,S.document.version);E.addOperation(R),S.document.applyOperation(R)}var u=s(104),f=s(17),h=s(18),w=s(38),C=s(1),T=s(2);/**
  185. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  186. * For licensing, see LICENSE.md.
  187. */class P extends u.a{static get className(){return'engine.model.delta.RemoveDelta'}}r.a=P,s.i(f.b)('remove',function(S){const E=new P;if(this.addDelta(E),S instanceof T.a){let O=S.getMinimalFlatRanges().reverse();for(let V of O)d(this,E,V.start,V.end.offset-V.start.offset)}else d(this,E,C.a.createBefore(S),1);return this}),h.a.register(P)},function(o,r,s){'use strict';var d=s(20),u=s(18),f=s(17),h=s(1),w=s(5),C=s(37),T=s(28),P=s(0),S=s(103);/**
  188. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  189. * For licensing, see LICENSE.md.
  190. */class E extends d.a{get type(){return'split'}get position(){return this._moveOperation?this._moveOperation.sourcePosition:null}getReversed(){let O=super.getReversed();return 0<O.operations.length&&(O.operations[0].isSticky=!0),O}get _cloneOperation(){return this.operations[0]||null}get _moveOperation(){return this.operations[1]||null}get _reverseDeltaClass(){return S.a}static get className(){return'engine.model.delta.SplitDelta'}static get _priority(){return 5}}r.a=E,s.i(f.b)('split',function(O){const V=new E;this.addDelta(V);const R=O.parent;if(!R.parent)throw new P.a('batch-split-root: Root element can not be split.');const F=new w.a(R.name,R.getAttributes()),N=new C.a(h.a.createAfter(R),F,this.document.version);V.addOperation(N),this.document.applyOperation(N);const M=new T.a(O,R.maxOffset-O.offset,h.a.createFromParentAndOffset(F,0),this.document.version);return M.isSticky=!0,V.addOperation(M),this.document.applyOperation(M),this}),u.a.register(E)},function(o,r,s){'use strict';function d(N,M,I){const L=w(N,M)||f,D=L(N,M,I),q=R.a.last(M.operations).baseVersion;return u(q,D)}function u(N,M){for(let I of M)for(let L of I.operations)L.baseVersion=++N;return M}function f(N,M,I){I=C(N.constructor,M.constructor,I);const L=new N.constructor;let D=M.operations,q=[];for(let z of N.operations){const $=[z];for(let K of D)for(let H=0;H<$.length;H++){const U=$[H];Array.prototype.push.apply(q,s.i(O.a)(K,U,!I));const W=s.i(O.a)(U,K,I);Array.prototype.splice.apply($,[H,1].concat(W)),H+=W.length-1}D=q,q=[];for(let K of $)L.addOperation(K)}return[L]}function w(N,M){let I=F.get(N.constructor);if(!I||!I.get(M.constructor)){const L=F.keys();for(let D of L)if(N instanceof D&&F.get(D).get(M.constructor)){I=F.get(D);break}}return I?I.get(M.constructor):void 0}function C(N,M,I){return!!(N._priority>M._priority)||!(N._priority<M._priority)&&I}function P(N){return N.reduce((M,I)=>{return M+I.operations.length},0)}function S(N,M){const I=N[N.length-1];let L=I.operations.length+I.baseVersion,D=new E.a;for(let q=0;q<M;q++)D.addOperation(new V.a(L++));N.push(D)}var E=s(20),O=s(347),V=s(74),R=s(502);r.c=f,r.b=function(N,M,I){let L=F.get(N);L||(L=new Map,F.set(N,L)),L.set(M,I)},r.a=function(N,M,I){let L=Array.from(N),D=Array.from(M);for(let $=0,K;$<L.length;$++){K=[L[$]];for(let H=0,U;H<D.length;H++){U=[D[H]];for(let W=0;W<K.length;W++)for(let Z=0;Z<U.length;Z++){let G=d(K[W],U[Z],I),J=d(U[Z],K[W],!I);K.splice(W,1,...G),W+=G.length-1,U.splice(Z,1,...J),Z+=J.length-1}D.splice(H,1,...U),H+=U.length-1}L.splice($,1,...K),$+=K.length-1}const q=P(L)-P(N),z=P(D)-P(M);return z<q?S(D,q-z):q<z&&S(L,z-q),{deltasA:L,deltasB:D}};/**
  191. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  192. * For licensing, see LICENSE.md.
  193. */const F=new Map},function(o,r,s){'use strict';var d=s(20),u=s(18),f=s(109),h=s(17),w=s(1),C=s(38),T=s(28),P=s(0);/**
  194. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  195. * For licensing, see LICENSE.md.
  196. */class S extends d.a{get type(){return'unwrap'}get position(){return this._moveOperation?this._moveOperation.targetPosition:null}get _moveOperation(){return this.operations[0]||null}get _reverseDeltaClass(){return f.a}static get className(){return'engine.model.delta.UnwrapDelta'}static get _priority(){return 10}}r.a=S,s.i(h.b)('unwrap',function(E){if(null===E.parent)throw new P.a('batch-unwrap-element-no-parent: Trying to unwrap an element which has no parent.');const O=new S;this.addDelta(O);let V=w.a.createFromParentAndOffset(E,0);const R=new T.a(V,E.maxOffset,w.a.createBefore(E),this.document.version);R.isSticky=!0,O.addOperation(R),this.document.applyOperation(R);const F=new C.a(w.a.createBefore(E),1,this.document.version);return O.addOperation(F),this.document.applyOperation(F),this}),u.a.register(S)},function(o,r,s){'use strict';var d=s(20),u=s(18),f=s(108),h=s(17),w=s(1),C=s(2),T=s(5),P=s(37),S=s(28),E=s(0);/**
  197. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  198. * For licensing, see LICENSE.md.
  199. */class O extends d.a{get type(){return'wrap'}get range(){let V=this._moveOperation;return V?C.a.createFromPositionAndShift(V.sourcePosition,V.howMany):null}get howMany(){let V=this.range;return V?V.end.offset-V.start.offset:0}get _insertOperation(){return this.operations[0]||null}get _moveOperation(){return this.operations[1]||null}get _reverseDeltaClass(){return f.a}static get className(){return'engine.model.delta.WrapDelta'}static get _priority(){return 10}}r.a=O,s.i(h.b)('wrap',function(V,R){if(!V.isFlat)throw new E.a('batch-wrap-range-not-flat: Range to wrap is not flat.');let F=R instanceof T.a?R:new T.a(R);if(0<F.childCount)throw new E.a('batch-wrap-element-not-empty: Element to wrap with is not empty.');if(null!==F.parent)throw new E.a('batch-wrap-element-attached: Element to wrap with is already attached to tree model.');const N=new O;this.addDelta(N);let M=new P.a(V.end,F,this.document.version);N.addOperation(M),this.document.applyOperation(M);let I=w.a.createFromParentAndOffset(F,0),L=new S.a(V.start,V.end.offset-V.start.offset,I,this.document.version);return N.addOperation(L),this.document.applyOperation(L),this}),u.a.register(O)},function(o,r,s){'use strict';function d(){const T=new Set(['insert','move','remove','reinsert']);this.listenTo(this.root.document,'change',(P,S,E,O,V)=>{T.has(S)&&u.call(this,S,V,E.range,E.sourcePosition)},{priority:'high'})}function u(T,P,S,E){const O=S.end.offset-S.start.offset;let V=S.start;'move'==T&&(V=V._getTransformedByInsertion(E,O));const R=this._getTransformedByDocumentChange(T,P,V,O,E);'move'==T&&3==R.length&&(R[2]=S);const F=f.a.createFromRanges(R);if(!F.isEqual(this)){const N=f.a.createFromRange(this);this.start=F.start,this.end=F.end,this.fire('change',N)}}var f=s(2),h=s(7),w=s(4);/**
  200. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  201. * For licensing, see LICENSE.md.
  202. */class C extends f.a{constructor(T,P){super(T,P),d.call(this)}detach(){this.stopListening()}}r.a=C,s.i(w.a)(C,h.a)},function(o,r,s){'use strict';var d=s(33),u=s(2);/**
  203. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  204. * For licensing, see LICENSE.md.
  205. */class f extends d.a{constructor(h,w,C,T,P){super(P),this.name=h,this.oldRange=w?u.a.createFromRange(w):null,this.newRange=C?u.a.createFromRange(C):null,this._markers=T}get type(){return'marker'}clone(){return new f(this.name,this.oldRange,this.newRange,this._markers,this.baseVersion)}getReversed(){return new f(this.name,this.newRange,this.oldRange,this._markers,this.baseVersion+1)}_execute(){const h=this.newRange?'set':'remove';return this._markers[h](this.name,this.newRange),{name:this.name,type:h}}toJSON(){const h=super.toJSON();return delete h._markers,h}static get className(){return'engine.model.operation.MarkerOperation'}static fromJSON(h,w){return new f(h.name,h.oldRange?u.a.fromJSON(h.oldRange,w):null,h.newRange?u.a.fromJSON(h.newRange,w):null,w.markers,h.baseVersion)}}r.a=f},function(o,r,s){'use strict';var d=s(28),u=s(38);/**
  206. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  207. * For licensing, see LICENSE.md.
  208. */class f extends d.a{get position(){return this.targetPosition}set position(h){this.targetPosition=h}get type(){return'reinsert'}getReversed(){return new u.a(this.targetPosition,this.howMany,this.baseVersion+1)}static get className(){return'engine.model.operation.ReinsertOperation'}}r.a=f},function(o,r,s){'use strict';var d=s(33),u=s(5),f=s(0),h=s(1);/**
  209. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  210. * For licensing, see LICENSE.md.
  211. */class w extends d.a{constructor(C,T,P,S){super(S),this.position=C,this.oldName=T,this.newName=P}get type(){return'rename'}clone(){return new w(h.a.createFromPosition(this.position),this.oldName,this.newName,this.baseVersion)}getReversed(){return new w(h.a.createFromPosition(this.position),this.newName,this.oldName,this.baseVersion+1)}_execute(){const C=this.position.nodeAfter;if(!(C instanceof u.a))throw new f.a('rename-operation-wrong-position: Given position is invalid or node after it is not an instance of Element.');else if(C.name!==this.oldName)throw new f.a('rename-operation-wrong-name: Element to change has different name than operation\'s old name.');return this.oldName==this.newName?void 0:(C.name=this.newName,{element:C,oldName:this.oldName})}static get className(){return'engine.model.operation.RenameOperation'}static fromJSON(C,T){return new w(h.a.fromJSON(C.position,T),C.oldName,C.newName,C.baseVersion)}}r.a=w},function(o,r,s){'use strict';var d=s(33),u=s(0);/**
  212. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  213. * For licensing, see LICENSE.md.
  214. */class f extends d.a{constructor(h,w,C,T,P){super(P),this.root=h,this.key=w,this.oldValue=C,this.newValue=T}get type(){return null===this.oldValue?'addRootAttribute':null===this.newValue?'removeRootAttribute':'changeRootAttribute'}clone(){return new f(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new f(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_execute(){if(null!==this.oldValue&&this.root.getAttribute(this.key)!==this.oldValue)throw new u.a('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 u.a('rootattribute-operation-attribute-exists: The attribute with given key already exists.',{root:this.root,key:this.key});return null===this.newValue?this.root.removeAttribute(this.key):this.root.setAttribute(this.key,this.newValue),{root:this.root,key:this.key,oldValue:this.oldValue,newValue:this.newValue}}static get className(){return'engine.model.operation.RootAttributeOperation'}static fromJSON(h,w){if(!w.hasRoot(h.root))throw new u.a('rootattribute-operation-fromjson-no-root: Cannot create RootAttributeOperation. Root with specified name does not exist.',{rootName:h});return new f(w.getRoot(h.root),h.key,h.oldValue,h.newValue,h.baseVersion)}}r.a=f},function(o,r,s){'use strict';function d(){if(this.childCount)return null;let w=this.parent;for(;w&&w.is('attributeElement');){if(1<w.childCount)return null;w=w.parent}return!w||1<w.childCount?null:0}var u=s(21);/**
  215. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  216. * For licensing, see LICENSE.md.
  217. */const f=10;class h extends u.a{constructor(w,C,T){super(w,C,T),this.priority=f,this.getFillerOffset=d}is(w,C=null){return C?'attributeElement'==w&&C==this.name||super.is(w,C):'attributeElement'==w||super.is(w)}clone(w){const C=super.clone(w);return C.priority=this.priority,C}isSimilar(w){return super.isSimilar(w)&&this.priority==w.priority}}r.a=h,h.DEFAULT_PRIORITY=f},function(o,r,s){'use strict';function d(T){return'string'==typeof T?[new u.a(T)]:(s.i(h.a)(T)||(T=[T]),Array.from(T).map((P)=>'string'==typeof P?new u.a(P):P))}var u=s(30),f=s(4),h=s(41),w=s(7);/**
  218. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  219. * For licensing, see LICENSE.md.
  220. */class C{constructor(T){this._children=[],T&&this.insertChildren(0,T)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(T){return'documentFragment'==T}appendChildren(T){return this.insertChildren(this.childCount,T)}getChild(T){return this._children[T]}getChildIndex(T){return this._children.indexOf(T)}getChildren(){return this._children[Symbol.iterator]()}insertChildren(T,P){this._fireChange('children',this);let S=0;P=d(P);for(let E of P)E.parent=this,this._children.splice(T,0,E),T++,S++;return S}removeChildren(T,P=1){this._fireChange('children',this);for(let S=T;S<T+P;S++)this._children[S].parent=null;return this._children.splice(T,P)}_fireChange(T,P){this.fire('change:'+T,P)}}r.a=C,s.i(f.a)(C,w.a)},function(o,r,s){'use strict';var d=s(57);/**
  221. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  222. * For licensing, see LICENSE.md.
  223. */class u{constructor(f,h,w){this.document=f,this.domEvent=h,this.domTarget=h.target,s.i(d.a)(this,w)}get target(){return this.document.domConverter.getCorrespondingViewElement(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}r.a=u},function(o,r){'use strict';function f(E,O){E.setCustomProperty(T,O)}function w(){return null}r.b=function(E){return!!E.getCustomProperty(C)},r.a=function(E,O){return O=O||{},E.setAttribute('contenteditable',!1),E.getFillerOffset=w,E.addClass(P),E.setCustomProperty(C,!0),O.label&&f(E,O.label),E},r.d=function(E){const O=E.getCustomProperty(T);return O?'function'==typeof O?O():O:''};/**
  224. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  225. * For licensing, see LICENSE.md.
  226. */const C=Symbol('isWidget'),T=Symbol('label'),P='ck-widget';r.c='ck-widget_selected'},function(o,r){'use strict';/**
  227. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  228. * For licensing, see LICENSE.md.
  229. */function d(f){return f.focus}class u{constructor(f){if(Object.assign(this,f),f.actions&&f.keystrokeHandler)for(let h in f.actions){let w=f.actions[h];'string'==typeof w&&(w=[w]);for(let C of w)f.keystrokeHandler.set(C,(T,P)=>{this[h](),P()})}}get first(){return this.focusables.find(d)||null}get last(){return this.focusables.filter(d).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let f=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((h,w)=>{const C=h.element===this.focusTracker.focusedElement;return C&&(f=w),C}),f)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(f){f&&f.focus()}_getFocusableItem(f){const h=this.current,w=this.focusables.length;if(!w||null===h)return null;let C=(h+w+f)%w;do{let T=this.focusables.get(C);if(d(T))return T;C=(C+w+f)%w}while(C!==h);return null}}r.a=u},function(o,r,s){'use strict';function d(T){return T.every((P)=>'string'==typeof P)}var u=s(0),f=s(32),h=s(79),w=s(4);/**
  230. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  231. * For licensing, see LICENSE.md.
  232. */class C extends h.a{constructor(T){super({idProperty:'viewUid'}),this.on('add',(P,S,E)=>{S.element&&this._parentElement&&this._parentElement.insertBefore(S.element,this._parentElement.children[E])}),this.on('remove',(P,S)=>{S.element&&this._parentElement&&S.element.remove()}),this.locale=T,this.set('ready',!1),this._parentElement=null}init(){if(this.ready)throw new u.a('ui-viewcollection-init-reinit: This ViewCollection has already been initialized.');return Promise.all(this.map((T)=>T.init())).then(()=>{this.ready=!0})}destroy(){let T=[];for(let P of this)T.push(P.destroy());return Promise.all(T)}add(T,P){super.add(T,P);let S=Promise.resolve();return this.ready&&!T.ready&&(S=S.then(()=>{return T.init()})),S}setParent(T){this._parentElement=T}delegate(...T){if(!T.length||!d(T))throw new u.a('ui-viewcollection-delegate-wrong-events: All event names must be strings.');return{to:(P)=>{for(let S of this)for(let E of T)S.delegate(E).to(P);this.on('add',(S,E)=>{for(let O of T)E.delegate(O).to(P)}),this.on('remove',(S,E)=>{for(let O of T)E.stopDelegating(O,P)})}}}}r.a=C,s.i(w.a)(h.a,f.a)},function(o,r,s){'use strict';function d(w,C){let T=u([w],C);T.sort((P,S)=>P.start.isBefore(S.start)?-1:1);for(let P=1;P<T.length;P++){let S=T[P-1],E=T[P];S.end.isTouching(E.start)&&(S.end=E.end,T.splice(P,1),P--)}return T}function u(w,C){for(let T of C)for(let P of T.operations)for(let S=0;S<w.length;S++){let E;switch(P.type){case'insert':E=w[S]._getTransformedByInsertion(P.position,P.nodes.maxOffset,!0);break;case'move':case'remove':case'reinsert':E=w[S]._getTransformedByMove(P.sourcePosition,P.targetPosition,P.howMany,!0);}E&&(w.splice(S,1,...E),S=S+E.length-1)}return w}var f=s(12);r.b=u;/**
  233. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  234. * For licensing, see LICENSE.md.
  235. */class h extends f.a{constructor(w){super(w),this._stack=[],this._createdBatches=new WeakSet,this.refreshState()}addBatch(w){const C={ranges:Array.from(this.editor.document.selection.getRanges()),isBackward:this.editor.document.selection.isBackward};this._stack.push({batch:w,selection:C}),this.refreshState()}clearStack(){this._stack=[],this.refreshState()}_checkEnabled(){return 0<this._stack.length}_restoreSelection(w,C,T){const P=this.editor.document,S=[];for(let E of w){const O=d(E,T),V=O.find((R)=>R.start.root!=P.graveyard);V&&S.push(V)}S.length&&P.selection.setRanges(S,C)}}r.a=h},function(o,r,s){'use strict';function d(T){var P=-1,S=T?T.length:0;for(this.clear();++P<S;){var E=T[P];this.set(E[0],E[1])}}var u=s(486),f=s(487),h=s(488),w=s(489),C=s(490);d.prototype.clear=u.a,d.prototype['delete']=f.a,d.prototype.get=h.a,d.prototype.has=w.a,d.prototype.set=C.a,r.a=d},function(o,r,s){'use strict';function d(P){this.__data__=new u.a(P)}var u=s(81),f=s(495),h=s(496),w=s(497),C=s(498),T=s(499);d.prototype.clear=f.a,d.prototype['delete']=h.a,d.prototype.get=w.a,d.prototype.has=C.a,d.prototype.set=T.a,r.a=d},function(o,r,s){'use strict';var d=s(31),u=d.a.Symbol;r.a=u},function(o,r,s){'use strict';var u=s(128);r.a=function(f,h){return!!f.length&&-1<s.i(u.a)(f,h,0)}},function(o,r){'use strict';r.a=function(u,f,h){for(var w=-1,C=u.length;++w<C;)if(h(f,u[w]))return!0;return!1}},function(o,r,s){'use strict';var u=s(88),f=s(54),h=s(55);r.a=function(w,C){C=s.i(f.a)(C,w)?[C]:s.i(u.a)(C);for(var T=0,P=C.length;null!=w&&T<P;)w=w[s.i(h.a)(C[T++])];return T&&T==P?w:void 0}},function(o,r,s){'use strict';var u=s(208);r.a=function(f,h,w){if(h!==h)return s.i(u.a)(f,w);for(var C=w-1,T=f.length;++C<T;)if(f[C]===h)return C;return-1}},function(o,r,s){'use strict';var u=s(82),f=s(125),h=s(126),w=s(27),C=s(134),T=s(136);r.a=function(S,E,O){for(var V=O?h.a:f.a,R=S[0].length,F=S.length,N=F,M=Array(F),I=Infinity,L=[],D;N--;)D=S[N],N&&E&&(D=s.i(w.a)(D,s.i(C.a)(E))),I=_Mathmin(D.length,I),M[N]=!O&&(E||120<=R&&120<=D.length)?new u.a(N&&D):void 0;D=S[0];var q=-1,z=M[0];outer:for(;++q<R&&L.length<I;){var $=D[q],K=E?E($):$;if($=O||0!==$?$:0,z?!s.i(T.a)(z,K):!V(L,K,O)){for(N=F;--N;){var H=M[N];if(H?!s.i(T.a)(H,K):!V(S[N],K,O))continue outer}z&&z.push(K),L.push($)}}return L}},function(o,r,s){'use strict';function d(w,C,T,P,S){return!(w!==C)||(null!=w&&null!=C&&(s.i(f.a)(w)||s.i(h.a)(C))?s.i(u.a)(w,C,d,T,P,S):w!==w&&C!==C)}var u=s(440),f=s(15),h=s(43);r.a=d},function(o,r){'use strict';r.a=function(u){return function(f){return null==f?void 0:f[u]}}},function(o,r,s){'use strict';var u=s(27),f=s(128),h=s(439),w=s(134),C=Array.prototype,T=C.splice;r.a=function(P,S,E,O){var V=O?h.a:f.a,R=-1,F=S.length,N=P;for(E&&(N=s.i(u.a)(P,s.i(w.a)(E)));++R<F;)for(var M=0,I=S[R],L=E?E(I):I;-1<(M=V(N,L,M,O));)N!==P&&T.call(N,M,1),T.call(P,M,1);return P}},function(o,r,s){'use strict';var u=s(44);r.a=function(T,P,S,E){P=S(P);for(var O=0,V=T?T.length:0,R=P!==P,F=null===P,N=s.i(u.a)(P),M=void 0===P;O<V;){var I=_Mathfloor((O+V)/2),L=S(T[I]),D=L!==void 0,q=null===L,z=L===L,$=s.i(u.a)(L);if(R)var K=E||z;else K=M?z&&(E||D):F?z&&D&&(E||!q):N?z&&D&&!q&&(E||!$):q||$?!1:E?L<=P:L<P;K?O=I+1:V=I}return _Mathmin(V,4294967295-1)}},function(o,r){'use strict';r.a=function(u){return function(f){return u(f)}}},function(o,r,s){'use strict';var u=s(84),f=s(68),h=s(42);r.a=function(w,C,T){for(var P=-1,S=w.length,E;++P<S;)E=E?s.i(u.a)(s.i(f.a)(E,w[P],C,T),s.i(f.a)(w[P],E,C,T)):w[P];return E&&E.length?s.i(h.a)(E,C,T):[]}},function(o,r){'use strict';r.a=function(u,f){return u.has(f)}},function(o,r,s){'use strict';var u=s(14);r.a=function(f){return s.i(u.a)(f)?f:[]}},function(o,r,s){'use strict';var u=s(194);r.a=function(f){var h=new f.constructor(f.byteLength);return new u.a(h).set(new u.a(f)),h}},function(o,r,s){'use strict';var u=s(67);r.a=function(f,h,w,C){w||(w={});for(var T=-1,P=h.length;++T<P;){var S=h[T],E=C?C(w[S],f[S],S,w,f):f[S];s.i(u.a)(w,S,E)}return w}},function(o,r){'use strict';var u=Object.getPrototypeOf;r.a=function(f){return u(Object(f))}},function(o,r,s){'use strict';function d(z){return N.call(z)}var u=s(423),f=s(192),h=s(425),w=s(193),C=s(427),T=s(211),P='[object Map]',E='[object Promise]',O='[object Set]',V='[object WeakMap]',R='[object DataView]',F=Object.prototype,N=F.toString,M=s.i(T.a)(u.a),I=s.i(T.a)(f.a),L=s.i(T.a)(h.a),D=s.i(T.a)(w.a),q=s.i(T.a)(C.a);(u.a&&d(new u.a(new ArrayBuffer(1)))!=R||f.a&&d(new f.a)!=P||h.a&&d(h.a.resolve())!=E||w.a&&d(new w.a)!=O||C.a&&d(new C.a)!=V)&&(d=function(z){var $=N.call(z),K=$=='[object Object]'?z.constructor:void 0,H=K?s.i(T.a)(K):void 0;if(H)switch(H){case M:return R;case I:return P;case L:return E;case D:return O;case q:return V;}return $}),r.a=d},function(o,r){'use strict';r.a=function(u){var f=-1,h=Array(u.size);return u.forEach(function(w,C){h[++f]=[C,w]}),h}},function(o,r,s){'use strict';var u=s(15),f=s(514),h=s(259);r.a=function(P,S,E){function O(Y){var X=q,Q=z;return q=z=void 0,W=Y,K=P.apply(Q,X),K}function V(Y){return W=Y,H=setTimeout(N,S),Z?O(Y):K}function R(Y){var X=Y-U,Q=Y-W,ee=S-X;return G?_Mathmin(ee,$-Q):ee}function F(Y){var X=Y-U,Q=Y-W;return!U||X>=S||0>X||G&&Q>=$}function N(){var Y=s.i(f.a)();return F(Y)?M(Y):void(H=setTimeout(N,R(Y)))}function M(Y){return(clearTimeout(H),H=void 0,J&&q)?O(Y):(q=z=void 0,K)}function D(){var Y=s.i(f.a)(),X=F(Y);if(q=arguments,z=this,U=Y,X){if(void 0===H)return V(U);if(G)return clearTimeout(H),H=setTimeout(N,S),O(U)}return void 0===H&&(H=setTimeout(N,S)),K}var U=0,W=0,Z=!1,G=!1,J=!0,q,z,$,K,H;if('function'!=typeof P)throw new TypeError('Expected a function');return S=s.i(h.a)(S)||0,s.i(u.a)(E)&&(Z=!!E.leading,G='maxWait'in E,$=G?_Mathmax(s.i(h.a)(E.maxWait)||0,S):$,J='trailing'in E?!!E.trailing:J),D.cancel=function(){void 0!==H&&clearTimeout(H),U=W=0,q=z=H=void 0},D.flush=function(){return void 0===H?K:M(s.i(f.a)())},D}},function(o,r,s){'use strict';var u=s(35),f=s(16);r.a=function(h,w,C){var T=h?h.length:0;return T?(w=C||void 0===w?1:s.i(f.a)(w),s.i(u.a)(h,0>w?0:w,T)):[]}},function(o,r,s){'use strict';var u=s(35),f=s(16);r.a=function(h,w,C){var T=h?h.length:0;return T?(w=C||void 0===w?1:s.i(f.a)(w),w=T-w,s.i(u.a)(h,0,0>w?0:w)):[]}},function(o,r){'use strict';r.a=function(u){return u&&u.length?u[0]:void 0}},function(o,r,s){'use strict';var u=s(14),h=Object.prototype,w=h.hasOwnProperty,C=h.toString,T=h.propertyIsEnumerable;r.a=function(P){return s.i(u.a)(P)&&w.call(P,'callee')&&(!T.call(P,'callee')||C.call(P)=='[object Arguments]')}},function(o,r,s){'use strict';var u=s(15),w=Object.prototype,C=w.toString;r.a=function(T){var P=s.i(u.a)(T)?C.call(T):'';return P=='[object Function]'||P=='[object GeneratorFunction]'}},function(o,r,s){'use strict';var u=s(11),f=s(43),w=Object.prototype,C=w.toString;r.a=function(T){return'string'==typeof T||!s.i(u.a)(T)&&s.i(f.a)(T)&&C.call(T)=='[object String]'}},function(o,r,s){'use strict';var u=s(132);r.a=function(f,h){return f&&f.length&&h&&h.length?s.i(u.a)(f,h):f}},function(o,r,s){'use strict';var u=s(195),f=s(27),h=s(99);r.a=function(w,C){if(!(w&&w.length))return[];var T=s.i(h.a)(w);return null==C?T:s.i(f.a)(T,function(P){return s.i(u.a)(C,void 0,P)})}},function(o,r,s){'use strict';var u=s(98),f=s(274);/**
  236. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  237. * For licensing, see LICENSE.md.
  238. */r.a=function(h){return s.i(u.a)(h)?s.i(f.a)(h):new Map(h)}},function(o,r,s){'use strict';var d=s(6),u=s(3),f=s(186),h=s(40),w=s(175);/**
  239. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  240. * For licensing, see LICENSE.md.
  241. */class C extends u.a{constructor(T){super(T),T.config.set('image.defaultToolbar',[]),this.isEnabled=!0}afterInit(){const T=this.editor,P=T.config.get('image.toolbar')||T.config.get('image.defaultToolbar');if(P.length){const S=this._panel=new w.a(T),E=[],O=new f.a;return d.a.extend(S.template,{attributes:{class:['ck-toolbar__container']}}),E.push(S.content.add(O)),E.push(O.fillFromConfig(P,T.ui.componentFactory)),E.push(T.ui.view.body.add(S)),this.listenTo(this.editor.editing.view,'render',()=>{this.isEnabled&&this.show()},{priority:'low'}),this.listenTo(T.ui.focusTracker,'change:isFocused',(V,R,F,N)=>{!N&&F&&this.isEnabled&&this.show()}),Promise.all(E)}}show(){const T=this.editor.editing.view.selection.getSelectedElement();T&&s.i(h.a)(T)&&this._panel.attach()}hide(){this._panel.detach()}}r.a=C},function(o){o.exports=function(s){if(!s.webpackPolyfill){var d=Object.create(s);d.children||(d.children=[]),Object.defineProperty(d,'loaded',{enumerable:!0,get:function(){return d.l}}),Object.defineProperty(d,'id',{enumerable:!0,get:function(){return d.i}}),Object.defineProperty(d,'exports',{enumerable:!0}),d.webpackPolyfill=1}return d}},function(o,r,s){'use strict';var d=s(3),u=s(47),f=s(48),h=s(158);/**
  242. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  243. * For licensing, see LICENSE.md.
  244. */const w='bold';class C extends d.a{init(){const T=this.editor,P=T.data,S=T.editing;T.document.schema.allow({name:'$inline',attributes:[w]}),s.i(u.a)().for(P.modelToView,S.modelToView).fromAttribute(w).toElement('strong'),s.i(f.a)().for(P.viewToModel).fromElement('strong').fromElement('b').fromAttribute('style',{'font-weight':'bold'}).toAttribute(w,!0),T.commands.set(w,new h.a(T,w))}}r.a=C},function(o,r,s){'use strict';var d=s(3),u=s(47),f=s(48),h=s(158);/**
  245. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  246. * For licensing, see LICENSE.md.
  247. */const w='italic';class C extends d.a{init(){const T=this.editor,P=T.data,S=T.editing;T.document.schema.allow({name:'$inline',attributes:[w]}),s.i(u.a)().for(P.modelToView,S.modelToView).fromAttribute(w).toElement('em'),s.i(f.a)().for(P.viewToModel).fromElement('em').fromElement('i').fromAttribute('style',{'font-style':'italic'}).toAttribute(w,!0),T.commands.set(w,new h.a(T,w))}}r.a=C},function(o,r,s){'use strict';var u=s(34);/**
  248. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  249. * For licensing, see LICENSE.md.
  250. */r.a=function(f,h,w){if(h.isCollapsed)return w.check({name:'$text',inside:h.getFirstPosition(),attributes:f});const C=h.getRanges();for(let T of C){const P=new u.a({boundaries:T,mergeCharacters:!0});for(let S=P.position,E=P.next();!E.done;){const O=E.value.item.name||'$text';if(w.check({name:O,inside:S,attributes:f}))return!0;S=P.position,E=P.next()}}return!1}},function(o,r,s){'use strict';var d=s(12),u=s(100),f=s(157);/**
  251. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  252. * For licensing, see LICENSE.md.
  253. */class h extends d.a{constructor(w,C){super(w),this.attributeKey=C,this.set('value',!1),this.listenTo(this.editor.document.selection,'change:attribute',()=>{this.value=this.editor.document.selection.hasAttribute(this.attributeKey)})}_checkEnabled(){const w=this.editor.document;return s.i(f.a)(this.attributeKey,w.selection,w.schema)}_doExecute(w={}){const C=this.editor.document,T=C.selection,P=w.forceValue===void 0?!this.value:w.forceValue;C.enqueueChanges(()=>{if(T.isCollapsed)P?T.setAttribute(this.attributeKey,!0):T.removeAttribute(this.attributeKey);else{const S=s.i(u.a)(this.attributeKey,T.getRanges(),C.schema),E=w.batch||C.batch();for(let O of S)P?E.setAttribute(O,this.attributeKey,P):E.removeAttribute(O,this.attributeKey)}})}}r.a=h},function(o,r,s){'use strict';var d=s(1),u=s(2),f=s(25),h=s(29),w=s(30),C=s(7),T=s(4);/**
  254. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  255. * For licensing, see LICENSE.md.
  256. */class P{constructor(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._viewToModelLengthCallbacks=new Map,this.on('modelToViewPosition',(S,E)=>{if(!E.viewPosition){let O=this._modelToViewMapping.get(E.modelPosition.parent);E.viewPosition=this._findPositionIn(O,E.modelPosition.offset)}},{priority:'low'}),this.on('viewToModelPosition',(S,E)=>{if(E.modelPosition)return;let O=E.viewPosition.parent,V=this._viewToModelMapping.get(O);for(;!V;)O=O.parent,V=this._viewToModelMapping.get(O);let R=this._toModelOffset(E.viewPosition.parent,E.viewPosition.offset,O);E.modelPosition=d.a.createFromParentAndOffset(V,R)},{priority:'low'})}bindElements(S,E){this._modelToViewMapping.set(S,E),this._viewToModelMapping.set(E,S)}unbindViewElement(S){const E=this.toModelElement(S);this._unbindElements(E,S)}unbindModelElement(S){const E=this.toViewElement(S);this._unbindElements(S,E)}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap}toModelElement(S){return this._viewToModelMapping.get(S)}toViewElement(S){return this._modelToViewMapping.get(S)}toModelRange(S){return new u.a(this.toModelPosition(S.start),this.toModelPosition(S.end))}toViewRange(S){return new h.a(this.toViewPosition(S.start),this.toViewPosition(S.end))}toModelPosition(S){const E={viewPosition:S,mapper:this};return this.fire('viewToModelPosition',E),E.modelPosition}toViewPosition(S){const E={modelPosition:S,mapper:this};return this.fire('modelToViewPosition',E),E.viewPosition}registerViewToModelLength(S,E){this._viewToModelLengthCallbacks.set(S,E)}_toModelOffset(S,E,O){if(O!=S){const R=this._toModelOffset(S.parent,S.index,O),F=this._toModelOffset(S,E,S);return R+F}if(S.is('text'))return E;let V=0;for(let R=0;R<E;R++)V+=this.getModelLength(S.getChild(R));return V}_unbindElements(S,E){this._viewToModelMapping.delete(E),this._modelToViewMapping.delete(S)}getModelLength(S){if(this._viewToModelLengthCallbacks.get(S.name)){const E=this._viewToModelLengthCallbacks.get(S.name);return E(S)}if(this._viewToModelMapping.has(S))return 1;if(S.is('text'))return S.data.length;if(S.is('uiElement'))return 0;let E=0;for(let O of S.getChildren())E+=this.getModelLength(O);return E}_findPositionIn(S,E){let O,V=0,R=0,F=0;if(S.is('text'))return new f.a(S,E);for(;R<E;)O=S.getChild(F),V=this.getModelLength(O),R+=V,F++;return R==E?this._moveViewPositionToTextNode(new f.a(S,F)):this._findPositionIn(O,E-(R-V))}_moveViewPositionToTextNode(S){const E=S.nodeBefore,O=S.nodeAfter;if(E instanceof w.a)return new f.a(E,E.data.length);return O instanceof w.a?new f.a(O,0):S}}r.a=P,s.i(T.a)(P,C.a)},function(o,r,s){'use strict';/**
  257. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  258. * For licensing, see LICENSE.md.
  259. */function w(O,V,R,F,N){if(!O.isCollapsed)return;if(!F.consume(O,N))return;let M=V.getFirstPosition();M=E.a.wrapPosition(M,R),V.removeAllRanges(),V.addRange(new S.a(M,M))}var P=s(21),S=s(29),E=s(78);r.e=function(){return(O,V,R,F)=>{const N=V.selection;if(!N.isCollapsed&&R.consume(N,'selection')){F.viewSelection.removeAllRanges();for(let M of N.getRanges()){const I=F.mapper.toViewRange(M);F.viewSelection.addRange(I,N.isBackward)}}}},r.f=function(){return(O,V,R,F)=>{const N=V.selection;if(N.isCollapsed&&R.consume(N,'selection')){const M=N.getFirstPosition(),I=F.mapper.toViewPosition(M),L=E.a.breakAttributes(I);F.viewSelection.removeAllRanges(),F.viewSelection.addRange(new S.a(L,L))}}},r.a=function(O){return(V,R,F,N)=>{const M=O instanceof P.a?O.clone(!0):O(R.value,R,R.selection,F,N);if(M){const I='selectionAttribute:'+R.key;w(R.selection,N.viewSelection,M,F,I)}}},r.b=function(O){return(V,R,F,N)=>{const M=O instanceof P.a?O.clone(!0):O(R,F,N);if(M){const I='selectionMarker:'+R.name;w(R.selection,N.viewSelection,M,F,I)}}},r.c=function(){return(O,V,R,F)=>{for(let N of F.viewSelection.getRanges())N.isCollapsed&&N.end.parent.document&&E.a.mergeAttributes(N.start);F.viewSelection.removeAllRanges()}},r.d=function(){return(O,V,R,F)=>F.viewSelection.setFake(!1)}},function(o,r,s){'use strict';var d=s(333),u=s(2),f=s(1),h=s(49),w=s(7),C=s(4),T=s(57);/**
  260. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  261. * For licensing, see LICENSE.md.
  262. */class P{constructor(S,E={}){this._modelDocument=S,this.conversionApi=s.i(T.a)({dispatcher:this},E)}convertChange(S,E){'remove'!==S&&E.range&&'$graveyard'==E.range.root.rootName||'remove'==S&&'$graveyard'==E.sourcePosition.root.rootName||'rename'==S&&'$graveyard'==E.element.root.rootName||('insert'==S||'reinsert'==S?this.convertInsertion(E.range):'move'==S?this.convertMove(E.sourcePosition,E.range):'remove'==S?this.convertRemove(E.sourcePosition,E.range):'addAttribute'==S||'removeAttribute'==S||'changeAttribute'==S?this.convertAttribute(S,E.range,E.key,E.oldValue,E.newValue):'rename'==S&&this.convertRename(E.element,E.oldName))}convertInsertion(S){const E=this._createInsertConsumable(S);for(let O of S){const V=O.item,R=u.a.createFromPositionAndShift(O.previousPosition,O.length),F={item:V,range:R};this._testAndFire('insert',F,E);for(let N of V.getAttributeKeys())F.attributeKey=N,F.attributeOldValue=null,F.attributeNewValue=V.getAttribute(N),this._testAndFire(`addAttribute:${N}`,F,E)}for(let O of this._modelDocument.markers){const V=O.getRange();V.containsPosition(S.start)&&this.convertMarker('addMarker',O.name,V.getIntersection(S)),(S.containsRange(V)||S.isEqual(V))&&this.convertMarker('addMarker',O.name,V)}}convertMove(S,E){if(E.start.isBefore(S)){this.convertInsertion(E);const O=S._getTransformedByInsertion(E.start,E.end.offset-E.start.offset);this.convertRemove(O,E)}else this.convertRemove(S,E),this.convertInsertion(E)}convertRemove(S,E){const O=this._createConsumableForRange(E,'remove');for(let V of E.getItems({shallow:!0})){this._testAndFire(`remove`,{sourcePosition:S,item:V},O)}}convertAttribute(S,E,O,V,R){const F=this._createConsumableForRange(E,S+':'+O);for(let N of E){const M=N.item,I=u.a.createFromPositionAndShift(N.previousPosition,N.length);this._testAndFire(`${S}:${O}`,{item:M,range:I,attributeKey:O,attributeOldValue:V,attributeNewValue:R},F)}}convertRename(S,E){const O=S.clone(!0);O.name=E,this.conversionApi.mapper.bindElements(O,this.conversionApi.mapper.toViewElement(S));const V=new h.a;V.appendChildren(O),this.convertRemove(f.a.createBefore(S),u.a.createOn(O)),this.convertInsertion(u.a.createOn(S))}convertSelection(S){const E=Array.from(this._modelDocument.markers.getMarkersAtPosition(S.getFirstPosition())),O=this._createSelectionConsumable(S,E);this.fire('selection',{selection:S},O,this.conversionApi);for(let V of E){const R={selection:S,name:V.name};O.test(S,'selectionMarker:'+V.name)&&this.fire('selectionMarker:'+V.name,R,O,this.conversionApi)}for(let V of S.getAttributeKeys()){const R={selection:S,key:V,value:S.getAttribute(V)};O.test(S,'selectionAttribute:'+R.key)&&this.fire('selectionAttribute:'+R.key,R,O,this.conversionApi)}}convertMarker(S,E,O){if(O.root.document&&'$graveyard'!=O.root.rootName){const V=this._createMarkerConsumable(S,O);this.fire(S+':'+E,{name:E,range:O},V,this.conversionApi)}}_createInsertConsumable(S){const E=new d.a;for(let O of S){const V=O.item;E.add(V,'insert');for(let R of V.getAttributeKeys())E.add(V,'addAttribute:'+R)}return E}_createConsumableForRange(S,E){const O=new d.a;for(let V of S.getItems())O.add(V,E);return O}_createSelectionConsumable(S,E){const O=new d.a;O.add(S,'selection');for(let V of E)O.add(S,'selectionMarker:'+V.name);for(let V of S.getAttributeKeys())O.add(S,'selectionAttribute:'+V);return O}_createMarkerConsumable(S,E){const O=new d.a;return O.add(E,S),O}_testAndFire(S,E,O){if(O.test(E.item,S)){const V=E.item.name||'$text';this.fire(S+':'+V,E,O,this.conversionApi)}}}r.a=P,s.i(C.a)(P,w.a)},function(o,r,s){'use strict';var d=s(338),u=s(167),f=s(62);/**
  263. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  264. * For licensing, see LICENSE.md.
  265. */r.a=class{constructor(){this._domParser=new DOMParser,this._domConverter=new u.a({blockFiller:f.a}),this._htmlWriter=new d.a}toData(w){const C=this._domConverter.viewToDom(w,document);return this._htmlWriter.getHtml(C)}toView(w){const C=this._toDom(w);return this._domConverter.domToView(C)}_toDom(w){const C=this._domParser.parseFromString(w,'text/html'),T=C.createDocumentFragment(),P=C.body.childNodes;for(;0<P.length;)T.appendChild(P[0]);return T}}},function(o,r,s){'use strict';function d(R,F,N,M){M instanceof E.a?f(R,R.document,F,N,M):u(R,R.document,F,N,M)}function u(R,F,N,M,I){const L=I.getAttribute(N);let D,q;const z=I.is('rootElement')?new V:new O;L!=M&&(R.addDelta(z),I.is('rootElement')?q=new P.a(I,N,L,M,F.version):(D=I.is('element')?new E.a(S.a.createBefore(I),S.a.createFromParentAndOffset(I,0)):new E.a(S.a.createBefore(I),S.a.createAfter(I)),q=new T.a(D,N,L,M,F.version)),z.addOperation(q),F.applyOperation(q))}function f(R,F,N,M,I){function L(){0===D.operations.length&&R.addDelta(D);let H=new E.a(q,z);const U=new T.a(H,N,$,M,F.version);D.addOperation(U),F.applyOperation(U)}const D=new O;let q=I.start,z,$,K;for(let H of I)K=H.item.getAttribute(N),z&&$!=K&&($!=M&&L(),q=z),z=H.nextPosition,$=K;z instanceof S.a&&z!=q&&$!=M&&L()}var h=s(20),w=s(18),C=s(17),T=s(73),P=s(114),S=s(1),E=s(2);/**
  266. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  267. * For licensing, see LICENSE.md.
  268. */class O extends h.a{get type(){return'attribute'}get key(){return this.operations[0]?this.operations[0].key:null}get value(){return this.operations[0]?this.operations[0].newValue:null}get range(){if(this._range)return this._range;let R=null,F=null;for(let N of this.operations)(null==R||R.isAfter(N.range.start))&&(R=N.range.start),(null==F||F.isBefore(N.range.end))&&(F=N.range.end);return R&&F?(this._range=new E.a(R,F),this._range):null}get _reverseDeltaClass(){return O}static get className(){return'engine.model.delta.AttributeDelta'}static get _priority(){return 20}}r.a=O;class V extends h.a{static get className(){return'engine.model.delta.RootAttributeDelta'}}s.i(C.b)('setAttribute',function(R,F,N){return d(this,F,N,R),this}),s.i(C.b)('removeAttribute',function(R,F){return d(this,F,null,R),this}),w.a.register(O),w.a.register(V)},function(o,r,s){'use strict';function d(E,O,V){O.addOperation(V),E.document.applyOperation(V)}var u=s(20),f=s(18),h=s(17),w=s(113),C=s(5),T=s(1),P=s(0);/**
  269. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  270. * For licensing, see LICENSE.md.
  271. */class S extends u.a{get type(){return'rename'}get _reverseDeltaClass(){return S}static get className(){return'engine.model.delta.RenameDelta'}}r.a=S,s.i(h.b)('rename',function(E,O){if(!(E instanceof C.a))throw new P.a('batch-rename-not-element-instance: Trying to rename an object which is not an instance of Element.');const V=new S;return this.addDelta(V),d(this,V,new w.a(T.a.createBefore(E),E.name,O,this.document.version)),this}),f.a.register(S)},function(o,r,s){'use strict';var d=s(102),u=s(17),f=s(18),h=s(37),w=s(13);/**
  272. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  273. * For licensing, see LICENSE.md.
  274. */class C extends d.a{static get className(){return'engine.model.delta.WeakInsertDelta'}}r.a=C,s.i(u.b)('weakInsert',function(T,P){const S=new C;this.addDelta(S),P=s.i(w.b)(P);for(let O of P)O.setAttributesTo(this.document.selection.getAttributes());const E=new h.a(T,P,this.document.version);return S.addOperation(E),this.document.applyOperation(E),this}),f.a.register(C)},function(o,r,s){'use strict';function d(){const S=new Set(['insert','move','remove','reinsert']);this.listenTo(this.root.document,'change',(E,O,V)=>{S.has(O)&&u.call(this,O,V.range,V.sourcePosition)},{priority:'high'})}function u(S,E,O){let V=E.end.offset-E.start.offset,R;switch(S){case'insert':let F='sticksToNext'==this.stickiness;R=this._getTransformedByInsertion(E.start,V,F);break;case'move':case'remove':case'reinsert':let N=h.a.createFromPositionAndShift(O,V),M=N.containsPosition(this)||N.start.isEqual(this)&&'sticksToNext'==this.stickiness||N.end.isEqual(this)&&'sticksToPrevious'==this.stickiness;if(M)R=this._getCombined(O,E.start);else{let I='sticksToNext'==this.stickiness;R=this._getTransformedByMove(O,E.start,V,I)}}if(!this.isEqual(R)){const F=f.a.createFromPosition(this);this.path=R.path,this.root=R.root,this.fire('change',F)}}var f=s(1),h=s(2),w=s(7),C=s(4),T=s(0);/**
  275. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  276. * For licensing, see LICENSE.md.
  277. */class P extends f.a{constructor(S,E,O){if(super(S,E),!this.root.is('rootElement'))throw new T.a('model-liveposition-root-not-rootelement: LivePosition root has to be an instance of RootElement.');this.stickiness=O||'sticksToNext',d.call(this)}detach(){this.stopListening()}}r.a=P,s.i(C.a)(P,w.a)},function(o,r,s){'use strict';function d(F,N,M){let I=s.i(O.a)(F);return M&&(I=I.slice(I.indexOf(M)+1)),I.some((L)=>L.tagName&&N.includes(L.tagName.toLowerCase()))}var u=s(30),f=s(21),h=s(25),w=s(29),C=s(77),T=s(116),P=s(51),S=s(62),E=s(413),O=s(189),V=s(410);/**
  278. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  279. * For licensing, see LICENSE.md.
  280. */r.a=class{constructor(F={}){this.blockFiller=F.blockFiller||S.b,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(F,N){this._fakeSelectionMapping.set(F,C.a.createFromSelection(N))}fakeSelectionToView(F){return this._fakeSelectionMapping.get(F)}bindElements(F,N){this._domToViewMapping.set(F,N),this._viewToDomMapping.set(N,F)}unbindDomElement(F){const N=this._domToViewMapping.get(F);this._domToViewMapping.delete(F),this._viewToDomMapping.delete(N)}bindDocumentFragments(F,N){this._domToViewMapping.set(F,N),this._viewToDomMapping.set(N,F)}viewToDom(F,N,M={}){if(F.is('text')){const I=this._processDataFromViewText(F);return N.createTextNode(I)}if(this.getCorrespondingDom(F))return this.getCorrespondingDom(F);let I;if(F.is('documentFragment'))I=N.createDocumentFragment(),M.bind&&this.bindDocumentFragments(I,F);else{I=N.createElement(F.name),M.bind&&this.bindElements(I,F);for(let L of F.getAttributeKeys())I.setAttribute(L,F.getAttribute(L))}if(M.withChildren||void 0===M.withChildren)for(let L of this.viewChildrenToDom(F,N,M))I.appendChild(L);return I}*viewChildrenToDom(F,N,M={}){let I=F.getFillerOffset&&F.getFillerOffset(),L=0;for(let D of F.getChildren())I===L&&(yield this.blockFiller(N)),yield this.viewToDom(D,N,M),L++;I===L&&(yield this.blockFiller(N))}viewRangeToDom(F){const N=this.viewPositionToDom(F.start),M=this.viewPositionToDom(F.end),I=new Range;return I.setStart(N.parent,N.offset),I.setEnd(M.parent,M.offset),I}viewPositionToDom(F){const N=F.parent;if(N.is('text')){const M=this.getCorrespondingDomText(N);if(!M)return null;let I=F.offset;return s.i(S.c)(M)&&(I+=S.d),{parent:M,offset:I}}let M,I,L;if(0===F.offset){if(M=this.getCorrespondingDom(F.parent),!M)return null;L=M.childNodes[0]}else{if(I=this.getCorrespondingDom(F.nodeBefore),!I)return null;M=I.parentNode,L=I.nextSibling}if(this.isText(L)&&s.i(S.c)(L))return{parent:L,offset:S.d};const D=I?s.i(E.a)(I)+1:0;return{parent:M,offset:D}}domToView(F,N={}){if(s.i(S.e)(F,this.blockFiller))return null;if(this.isText(F)){if(s.i(S.f)(F))return null;const M=this._processDataFromDomText(F);return''===M?null:new u.a(M)}if(this.getCorrespondingView(F))return this.getCorrespondingView(F);let M;if(this.isDocumentFragment(F))M=new T.a,N.bind&&this.bindDocumentFragments(F,M);else{const I=N.keepOriginalCase?F.tagName:F.tagName.toLowerCase();M=new f.a(I),N.bind&&this.bindElements(F,M);const L=F.attributes;for(let D=L.length-1;0<=D;D--)M.setAttribute(L[D].name,L[D].value)}if(N.withChildren||void 0===N.withChildren)for(let I of this.domChildrenToView(F,N))M.appendChildren(I);return M}*domChildrenToView(F,N={}){for(let M=0;M<F.childNodes.length;M++){const I=F.childNodes[M],L=this.domToView(I,N);null!==L&&(yield L)}}domSelectionToView(F){if(1===F.rangeCount){let I=F.getRangeAt(0).startContainer;this.isText(I)&&(I=I.parentNode);const L=this.fakeSelectionToView(I);if(L)return L}const N=new C.a,M=this.isDomSelectionBackward(F);for(let I=0;I<F.rangeCount;I++){const L=F.getRangeAt(I),D=this.domRangeToView(L);D&&N.addRange(D,M)}return N}domRangeToView(F){const N=this.domPositionToView(F.startContainer,F.startOffset),M=this.domPositionToView(F.endContainer,F.endOffset);return N&&M?new w.a(N,M):null}domPositionToView(F,N){if(s.i(S.e)(F,this.blockFiller))return this.domPositionToView(F.parentNode,s.i(E.a)(F));if(this.isText(F)){if(s.i(S.f)(F))return this.domPositionToView(F.parentNode,s.i(E.a)(F));const M=this.getCorrespondingViewText(F);let I=N;return M?(s.i(S.c)(F)&&(I-=S.d,I=0>I?0:I),new h.a(M,I)):null}if(0===N){const M=this.getCorrespondingView(F);if(M)return new h.a(M,0)}else{const M=this.getCorrespondingView(F.childNodes[N-1]);if(M&&M.parent)return new h.a(M.parent,M.index+1)}return null}getCorrespondingView(F){if(this.isElement(F))return this.getCorrespondingViewElement(F);return this.isDocumentFragment(F)?this.getCorrespondingViewDocumentFragment(F):this.isText(F)?this.getCorrespondingViewText(F):null}getCorrespondingViewElement(F){return this._domToViewMapping.get(F)}getCorrespondingViewDocumentFragment(F){return this._domToViewMapping.get(F)}getCorrespondingViewText(F){if(s.i(S.f)(F))return null;const N=F.previousSibling;if(N){if(!this.isElement(N))return null;const M=this.getCorrespondingViewElement(N);if(M){const I=M.nextSibling;return I instanceof u.a?M.nextSibling:null}}else{const M=this.getCorrespondingViewElement(F.parentNode);if(M){const I=M.getChild(0);return I instanceof u.a?I:null}}return null}getCorrespondingDom(F){if(F instanceof f.a)return this.getCorrespondingDomElement(F);return F instanceof T.a?this.getCorrespondingDomDocumentFragment(F):F instanceof u.a?this.getCorrespondingDomText(F):null}getCorrespondingDomElement(F){return this._viewToDomMapping.get(F)}getCorrespondingDomDocumentFragment(F){return this._viewToDomMapping.get(F)}getCorrespondingDomText(F){const N=F.previousSibling;return N&&this.getCorrespondingDom(N)?this.getCorrespondingDom(N).nextSibling:!N&&F.parent&&this.getCorrespondingDom(F.parent)?this.getCorrespondingDom(F.parent).childNodes[0]:null}focus(F){const N=this.getCorrespondingDomElement(F);N&&N.ownerDocument.activeElement!==N&&N.focus()}isText(F){return F&&F.nodeType==Node.TEXT_NODE}isElement(F){return F&&F.nodeType==Node.ELEMENT_NODE}isDocumentFragment(F){return F&&F.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isDomSelectionBackward(F){if(F.isCollapsed)return!1;const N=new Range;N.setStart(F.anchorNode,F.anchorOffset),N.setEnd(F.focusNode,F.focusOffset);const M=N.collapsed;return N.detach(),M}_processDataFromViewText(F){let N=F.data;if(F.getAncestors().some((q)=>this.preElements.includes(q.name)))return N;const M=this._getTouchingViewTextNode(F,!1),I=this._getTouchingViewTextNode(F,!0);let L=N.match(/ *$/)[0],D=N.substr(0,N.length-L.length);if(M&&' '!=M.data.charAt(M.data.length-1)||(D=D.replace(/^ /,'\xA0')),D=D.replace(/ /g,' \xA0'),0<L.length){let q=!1;I?(' '==I.data.charAt(0)||'\xA0'==I.data.charAt(0))&&0==L.length%2&&(q=!0):L.length%2&&(q=!0),q&&(L='\xA0'+L.substr(0,L.length-1)),L=L.replace(/ /g,' \xA0')}return D+L}_getTouchingViewTextNode(F,N){if(!F.parent)return null;const M=new P.a({startPosition:N?h.a.createAfter(F):h.a.createBefore(F),direction:N?'forward':'backward'});for(let I of M){if(I.item.is('containerElement'))return null;if(I.item.is('text'))return I.item}return null}_processDataFromDomText(F){let N=s.i(S.g)(F);if(d(F,this.preElements))return N;N=N.replace(/[^\S\u00A0]{2,}/g,' ');const M=this._getTouchingDomTextNode(F,!1),I=this._getTouchingDomTextNode(F,!0);return(!M||/[^\S\u00A0]/.test(M.data.charAt(M.data.length-1)))&&(N=N.replace(/^ /,'')),I||(N=N.replace(/ $/,'')),N=N.replace(/ \u00A0/g,' '),(!M||/[^\S\u00A0]/.test(M.data.charAt(M.data.length-1)))&&(N=N.replace(/^\u00A0/,' ')),I&&'\xA0'!=I.data.charAt(0)||(N=N.replace(/\u00A0( *)$/,' $1')),N}_getTouchingDomTextNode(F,N){if(!F.parentNode)return null;const M=N?'nextNode':'previousNode',I=F.ownerDocument,L=I.createTreeWalker(I.childNodes[0],NodeFilter.SHOW_TEXT);L.currentNode=F;const D=L[M]();if(null!==D){const q=s.i(V.a)(F,D);if(q&&!d(F,this.blockElements,q)&&!d(D,this.blockElements,q))return D}return null}}},function(o,r,s){'use strict';function d(){return null}var u=s(21),f=s(0),h=s(76);/**
  281. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  282. * For licensing, see LICENSE.md.
  283. */class w extends u.a{constructor(C,T,P){super(C,T,P),this.getFillerOffset=d}is(C,T=null){return T?'emptyElement'==C&&T==this.name||super.is(C,T):'emptyElement'==C||super.is(C)}insertChildren(C,T){if(T&&(T instanceof h.a||0<Array.from(T).length))throw new f.a('view-emptyelement-cannot-add: Cannot add child nodes to EmptyElement instance.')}}r.a=w},function(o,r){'use strict';/**
  284. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  285. * For licensing, see LICENSE.md.
  286. */function d(T,P){if('function'==typeof P)return P(T);const S={};return P.name&&(S.name=u(P.name,T.name),!S.name)?null:P.attribute&&(S.attribute=f(P.attribute,T),!S.attribute)?null:P.class&&(S.class=h(P.class,T),!S.class)?!1:P.style&&(S.style=w(P.style,T),!S.style)?!1:S}function u(T,P){return T instanceof RegExp?T.test(P):T===P}function f(T,P){const S=[];for(let E in T){const O=T[E];if(P.hasAttribute(E)){const V=P.getAttribute(E);if(O instanceof RegExp){if(O.test(V))S.push(E);else return null;}else if(V===O)S.push(E);else return null}else return null}return S}function h(T,P){const S=[];for(let E of T)if(E instanceof RegExp){const O=P.getClassNames();for(let V of O)E.test(V)&&S.push(V);if(0===S.length)return null}else if(P.hasClass(E))S.push(E);else return null;return S}function w(T,P){const S=[];for(let E in T){const O=T[E];if(P.hasStyle(E)){const V=P.getStyle(E);if(O instanceof RegExp){if(O.test(V))S.push(E);else return null;}else if(V===O)S.push(E);else return null}else return null}return S}r.a=class{constructor(...T){this._patterns=[],this.add(...T)}add(...T){for(let P of T)('string'==typeof P||P instanceof RegExp)&&(P={name:P}),P.class&&('string'==typeof P.class||P.class instanceof RegExp)&&(P.class=[P.class]),this._patterns.push(P)}match(...T){for(let P of T)for(let S of this._patterns){const E=d(P,S);if(E)return{element:P,pattern:S,match:E}}return null}matchAll(...T){const P=[];for(let S of T)for(let E of this._patterns){const O=d(S,E);O&&P.push({element:S,pattern:E,match:O})}return 0<P.length?P:null}getElementName(){if(1!==this._patterns.length)return null;const T=this._patterns[0],P=T.name;return'function'!=typeof T&&P&&!(P instanceof RegExp)?P:null}}},function(o,r,s){'use strict';var d=s(50),u=s(77),f=s(62);/**
  287. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  288. * For licensing, see LICENSE.md.
  289. */class h extends d.a{constructor(w){super(w),this._config={childList:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},this.domConverter=w.domConverter,this.renderer=w.renderer,this._domElements=[],this._mutationObserver=new window.MutationObserver(this._onMutations.bind(this))}flush(){this._onMutations(this._mutationObserver.takeRecords())}observe(w){this._domElements.push(w),this.isEnabled&&this._mutationObserver.observe(w,this._config)}enable(){super.enable();for(let w of this._domElements)this._mutationObserver.observe(w,this._config)}disable(){super.disable(),this._mutationObserver.disconnect()}destroy(){super.destroy(),this._mutationObserver.disconnect()}_onMutations(w){if(0===w.length)return;const C=this.domConverter,T=new Map,P=new Set;for(let V of w)if('childList'===V.type){const R=C.getCorrespondingViewElement(V.target);R&&!this._isBogusBrMutation(V)&&P.add(R)}for(let V of w)if('characterData'===V.type){const R=C.getCorrespondingViewText(V.target);R&&!P.has(R.parent)?T.set(R,{type:'text',oldText:R.data,newText:s.i(f.g)(V.target),node:R}):!R&&s.i(f.c)(V.target)&&P.add(C.getCorrespondingViewElement(V.target.parentNode))}const S=[];for(let V of T.values())this.renderer.markToSync('text',V.node),S.push(V);for(let V of P){const R=C.getCorrespondingDomElement(V),F=V.getChildren(),N=C.domChildrenToView(R);this.renderer.markToSync('children',V),S.push({type:'children',oldChildren:Array.from(F),newChildren:Array.from(N),node:V})}const E=w[0].target.ownerDocument.getSelection();let O=null;if(E&&E.anchorNode){const V=C.domPositionToView(E.anchorNode,E.anchorOffset),R=C.domPositionToView(E.focusNode,E.focusOffset);V&&R&&(O=new u.a,O.collapse(V),O.setFocus(R))}this.document.fire('mutations',S,O),this.document.render()}_isBogusBrMutation(w){let C=null;return null===w.nextSibling&&0===w.removedNodes.length&&1==w.addedNodes.length&&(C=this.domConverter.domToView(w.addedNodes[0],{withChildren:!1})),C&&C.is('element','br')}}r.a=h},function(o,r,s){'use strict';var d=s(75);/**
  290. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  291. * For licensing, see LICENSE.md.
  292. */const u=Symbol('rootName');class f extends d.a{constructor(h){super(h),this.rootName='main'}is(h,w=null){return w?'rootElement'==h&&w==this.name||super.is(h,w):'rootElement'==h||super.is(h)}get rootName(){return this.getCustomProperty(u)}set rootName(h){this.setCustomProperty(u,h)}}r.a=f},function(o,r,s){'use strict';function d(){return null}var u=s(21),f=s(0),h=s(76);/**
  293. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  294. * For licensing, see LICENSE.md.
  295. */class w extends u.a{constructor(C,T,P){super(C,T,P),this.getFillerOffset=d}is(C,T=null){return T?'uiElement'==C&&T==this.name||super.is(C,T):'uiElement'==C||super.is(C)}insertChildren(C,T){if(T&&(T instanceof h.a||0<Array.from(T).length))throw new f.a('view-uielement-cannot-add: Cannot add child nodes to UIElement instance.')}}r.a=w},function(o,r,s){'use strict';var d=s(3),u=s(47),f=s(48),h=s(71),w=s(361);/**
  296. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  297. * For licensing, see LICENSE.md.
  298. */const C='paragraph';class T extends d.a{constructor(P){super(P),P.config.define('heading',{options:[{modelElement:'paragraph',title:'Paragraph',class:'ck-heading_paragraph'},{modelElement:'heading1',viewElement:'h2',title:'Heading 1',class:'ck-heading_heading1'},{modelElement:'heading2',viewElement:'h3',title:'Heading 2',class:'ck-heading_heading2'},{modelElement:'heading3',viewElement:'h4',title:'Heading 3',class:'ck-heading_heading3'}]})}static get requires(){return[h.a]}init(){const P=this.editor,S=P.data,E=P.editing,O=P.config.get('heading.options');for(let V of O)V.modelElement!==C&&(P.document.schema.registerItem(V.modelElement,'$block'),s.i(u.a)().for(S.modelToView,E.modelToView).fromElement(V.modelElement).toElement(V.viewElement),s.i(f.a)().for(S.viewToModel).fromElement(V.viewElement).toElement(V.modelElement),P.commands.set(V.modelElement,new w.a(P,V)))}afterInit(){const P=this.editor,S=P.commands.get('enter'),E=P.config.get('heading.options');S&&this.listenTo(S,'afterExecute',(O,V)=>{const R=P.document.selection.getFirstPosition().parent,F=V.batch,N=E.some((M)=>R.is(M.modelElement));N&&!R.is(C)&&0===R.childCount&&F.rename(R,C)})}}r.a=T},function(o,r,s){'use strict';function d(){return new T.a('figure',{class:'image'},new P.a('img'))}var u=s(3),f=s(47),h=s(176),w=s(362),C=s(40),T=s(39),P=s(168);/**
  299. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  300. * For licensing, see LICENSE.md.
  301. */class S extends u.a{static get requires(){return[h.a]}init(){const E=this.editor,O=E.document,V=O.schema,R=E.data,F=E.editing,N=E.t;V.registerItem('image'),V.requireAttributes('image',['src']),V.allow({name:'image',attributes:['alt','src'],inside:'$root'}),V.objects.add('image'),s.i(f.a)().for(R.modelToView).fromElement('image').toElement(()=>d()),s.i(f.a)().for(F.modelToView).fromElement('image').toElement(()=>s.i(C.c)(d(),N('image widget'))),s.i(w.a)([F.modelToView,R.modelToView],'src'),s.i(w.a)([F.modelToView,R.modelToView],'alt'),R.viewToModel.on('element:figure',s.i(w.b)())}}r.a=S},function(o,r,s){'use strict';var d=s(516),u=s(64),f=s(185),h=s(40);/**
  302. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  303. * For licensing, see LICENSE.md.
  304. */const w=f.a.arrowVerticalOffset,C={south(P,S){return{top:P.bottom+w,left:P.left+P.width/2-S.width/2,name:'s'}},north(P,S){return{top:P.top-S.height-w,left:P.left+P.width/2-S.width/2,name:'n'}}};class T extends f.a{constructor(P){super(P.locale),this.editor=P;const S=P.editing.view;this.listenTo(P.ui.focusTracker,'change:isFocused',(E,O,V,R)=>{R&&!V&&this.detach()}),P.listenTo(S,'render',()=>{const E=S.selection.getSelectedElement();E&&s.i(h.a)(E)||this.detach()},{priority:'low'}),this._throttledAttach=s.i(d.a)(()=>{this._attach()},100)}init(){return this.editor.ui.focusTracker.add(this.element),super.init()}attach(){this._attach(),this.editor.ui.view.listenTo(u.a.window,'scroll',this._throttledAttach),this.editor.ui.view.listenTo(u.a.window,'resize',this._throttledAttach)}detach(){this.hide(),this.editor.ui.view.stopListening(u.a.window,'scroll',this._throttledAttach),this.editor.ui.view.stopListening(u.a.window,'resize',this._throttledAttach)}_attach(){const P=this.editor.editing.view;this.attachTo({target:P.domConverter.viewRangeToDom(P.selection.getFirstRange()),positions:[C.north,C.south]})}}r.a=T},function(o,r,s){'use strict';var d=s(3),u=s(118);/**
  305. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  306. * For licensing, see LICENSE.md.
  307. */class f extends d.a{init(){let h;this.editor.editing.modelToView.on('selection',(w,C,T,P)=>{h&&h.hasClass(u.c)&&h.removeClass(u.c);const S=P.viewSelection,E=S.getSelectedElement();E&&s.i(u.b)(E)&&(S.setFake(!0,{label:s.i(u.d)(E)}),E.addClass(u.c),h=E)},{priority:'low'})}}r.a=f},function(o,r,s){'use strict';function u(w,C,T){let P=w.textNode||(T?w.nodeBefore:w.nodeAfter),S=null;for(;P&&P.getAttribute('linkHref')==C;)S=P,P=T?P.previousSibling:P.nextSibling;return S?h.a.createAt(S,T?'before':'after'):w}/**
  308. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  309. * For licensing, see LICENSE.md.
  310. */var f=s(2),h=s(1);r.a=function(w,C){return new f.a(u(w,C,!0),u(w,C,!1))}},function(o,r,s){'use strict';var d=s(115);/**
  311. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  312. * For licensing, see LICENSE.md.
  313. */class u extends d.a{}r.a=u},function(o,r,s){'use strict';function d(P){let S=1;for(let E of P.getChildren())if('ul'==E.name||'ol'==E.name)for(let O of E.getChildren())S+=d(O);return S}var u=s(379),f=s(378),h=s(3),w=s(71),C=s(377);/**
  314. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  315. * For licensing, see LICENSE.md.
  316. */class T extends h.a{static get requires(){return[w.a]}init(){const P=this.editor,S=P.document.schema;S.registerItem('listItem','$block'),S.allow({name:'listItem',inside:'$root',attributes:['type','indent']}),S.requireAttributes('listItem',['type','indent']);const E=P.data,O=P.editing;this.editor.document.on('change',s.i(C.a)(this.editor.document),{priority:'high'}),this.editor.document.on('change',(V,R,F)=>{if('move'==R)for(let N of F.range.getItems())N.is('listItem')&&O.mapper.unbindModelElement(N)},{priority:'high'}),O.mapper.registerViewToModelLength('li',d),E.mapper.registerViewToModelLength('li',d),O.mapper.on('modelToViewPosition',C.b),O.mapper.on('viewToModelPosition',C.c),E.mapper.on('modelToViewPosition',C.b),O.modelToView.on('insert',C.d,{priority:'high'}),O.modelToView.on('insert:listItem',C.e),E.modelToView.on('insert',C.d,{priority:'high'}),E.modelToView.on('insert:listItem',C.e),O.modelToView.on('changeAttribute:type:listItem',C.f),E.modelToView.on('changeAttribute:type:listItem',C.f),O.modelToView.on('remove:listItem',C.g),O.modelToView.on('remove',C.h,{priority:'low'}),E.modelToView.on('remove:listItem',C.g),E.modelToView.on('remove',C.h,{priority:'low'}),O.modelToView.on('changeAttribute:indent:listItem',C.i),E.modelToView.on('changeAttribute:indent:listItem',C.i),E.viewToModel.on('element:ul',C.j,{priority:'high'}),E.viewToModel.on('element:ol',C.j,{priority:'high'}),E.viewToModel.on('element:li',C.k,{priority:'high'}),E.viewToModel.on('element:li',C.l),P.commands.set('numberedList',new u.a(P,'numbered')),P.commands.set('bulletedList',new u.a(P,'bulleted')),P.commands.set('indentList',new f.a(P,'forward')),P.commands.set('outdentList',new f.a(P,'backward'))}}r.a=T},function(o,r,s){'use strict';var d=s(187);/**
  317. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  318. * For licensing, see LICENSE.md.
  319. */class u{constructor(f,h=20){this.document=f,this.size=0,this.limit=h,this.isLocked=!1,this._changeCallback=(w,C,T,P)=>{this._onBatch(P)},this._selectionChangeCallback=()=>{this._reset()},f.on('change',this._changeCallback),f.selection.on('change:range',this._selectionChangeCallback),f.selection.on('change:attribute',this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.document.batch()),this._batch}input(f){this.size+=f,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}destroy(){this.document.off('change',this._changeCallback),this.document.selection.off('change:range',this._selectionChangeCallback),this.document.selection.off('change:attribute',this._selectionChangeCallback)}_onBatch(f){'transparent'!=f.type&&f!==this._batch&&1>=s.i(d.a)(f.getOperations())&&this._reset(!0)}_reset(f){(!this.isLocked||f)&&(this._batch=null,this.size=0)}}r.a=u},function(o,r){'use strict';r.a=/**
  320. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  321. * For licensing, see LICENSE.md.
  322. */function({emitter:u,activator:f,callback:h,contextElement:w}){u.listenTo(document,'mouseup',(C,{target:T})=>{f()&&!w.contains(T)&&h()})}},function(o,r){'use strict';r.a=/**
  323. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  324. * For licensing, see LICENSE.md.
  325. */function({view:u}){u.listenTo(u.element,'submit',(f,h)=>{h.preventDefault(),u.fire('submit')},{useCapture:!0})}},function(o,r,s){'use strict';var d=s(9),u=s(6);/**
  326. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  327. * For licensing, see LICENSE.md.
  328. */class f extends d.a{constructor(h){super(h),this.set('value'),this.set('id');const w=this.bindTemplate;this.template=new u.a({tag:'input',attributes:{type:'text',class:['ck-input','ck-input-text'],id:w.to('id')}}),this.on('change:value',(C,T,P)=>this.element.value=P||'')}select(){this.element.select()}focus(){this.element.focus()}}r.a=f},function(o,r,s){'use strict';var d=s(9),u=s(6),f=s(70),h=s(398);/**
  329. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  330. * For licensing, see LICENSE.md.
  331. */class w extends d.a{constructor(C,T){super(C);const P=`ck-input-${s.i(f.a)()}`;this.set('label'),this.set('value'),this.labelView=this._createLabelView(P),this.inputView=this._createInputView(T,P),this.template=new u.a({tag:'div',children:[this.labelView,this.inputView]})}_createLabelView(C){const T=new h.a(this.locale);return T.for=C,T.bind('text').to(this,'label'),T}_createInputView(C,T){const P=new C(this.locale);return P.id=T,P.bind('value').to(this),P}select(){this.inputView.select()}focus(){this.inputView.focus()}}r.a=w},function(o,r,s){'use strict';var d=s(9),u=s(6),f=s(416),h=s(190);/**
  332. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  333. * For licensing, see LICENSE.md.
  334. */const w=s.i(h.a)('px');class C extends d.a{constructor(T){super(T);const P=this.bindTemplate;this.set('top',0),this.set('left',0),this.set('position','se'),this.set('isVisible',!1),this.content=this.createCollection(),this.template=new u.a({tag:'div',attributes:{class:['ck-balloon-panel',P.to('position',(S)=>`ck-balloon-panel_arrow_${S}`),P.if('isVisible','ck-balloon-panel_visible')],style:{top:P.to('top',w),left:P.to('left',w),maxWidth:P.to('maxWidth',w)},tabindex:-1},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(T){this.show();const P=C.defaultPositions,S=Object.assign({},{element:this.element,positions:[P.se,P.sw,P.ne,P.nw],limiter:document.body,fitInViewport:!0},T),{top:E,left:O,name:V}=s.i(f.a)(S);Object.assign(this,{top:E,left:O,position:V})}}r.a=C,C.arrowHorizontalOffset=30,C.arrowVerticalOffset=15,C.defaultPositions={se:(T)=>({top:T.bottom+C.arrowVerticalOffset,left:T.left+T.width/2-C.arrowHorizontalOffset,name:'se'}),sw:(T,P)=>({top:T.bottom+C.arrowVerticalOffset,left:T.left+T.width/2-P.width+C.arrowHorizontalOffset,name:'sw'}),ne:(T,P)=>({top:T.top-P.height-C.arrowVerticalOffset,left:T.left+T.width/2-C.arrowHorizontalOffset,name:'ne'}),nw:(T,P)=>({top:T.top-P.height-C.arrowVerticalOffset,left:T.left+T.width/2-P.width+C.arrowHorizontalOffset,name:'nw'})}},function(o,r,s){'use strict';var d=s(9),u=s(6),f=s(65),h=s(119),w=s(66),C=s(404);/**
  335. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  336. * For licensing, see LICENSE.md.
  337. */class T extends d.a{constructor(P){super(P),this.items=this.createCollection(),this.focusTracker=new f.a,this.keystrokes=new w.a,this._focusCycler=new h.a({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:['arrowleft','arrowup'],focusNext:['arrowright','arrowdown']}}),this.template=new u.a({tag:'div',attributes:{class:['ck-toolbar']},children:this.items}),this.items.on('add',(S,E)=>{this.focusTracker.add(E.element)}),this.items.on('remove',(S,E)=>{this.focusTracker.remove(E.element)})}init(){return this.keystrokes.listenTo(this.element),super.init()}focus(){this._focusCycler.focusFirst()}fillFromConfig(P,S){return P?Promise.all(P.map((E)=>{const O='|'==E?new C.a:S.create(E);return this.items.add(O)})):Promise.resolve()}}r.a=T},function(o,r){'use strict';r.a=/**
  338. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  339. * For licensing, see LICENSE.md.
  340. */function(u){let f=0;for(let h of u)f++;return f}},function(o,r){'use strict';r.a=/**
  341. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  342. * For licensing, see LICENSE.md.
  343. */function(u,f,h){function w(N){const M=(V[N-1]===void 0?-1:V[N-1])+1,I=V[N+1]===void 0?-1:V[N+1],L=M>I?-1:1;O[N+L]&&(O[N]=O[N+L].slice(0)),O[N]||(O[N]=[]),O[N].push(M>I?C:T);let D=_Mathmax(M,I),q=D-N;for(;q<P&&D<S&&h(u[q],f[D]);)q++,D++,O[N].push('equal');return D}h=h||function(N,M){return N===M};let C,T;if(f.length<u.length){let N=u;u=f,f=N,C='delete',T='insert'}else C='insert',T='delete';const P=u.length,S=f.length,E=S-P,O={},V={};let R=0,F;do{for(F=-R;F<E;F++)V[F]=w(F);for(F=E+R;F>E;F--)V[F]=w(F);V[E]=w(E),R++}while(V[E]!==S);return O[E].slice(1)}},function(o,r){'use strict';r.a=/**
  344. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  345. * For licensing, see LICENSE.md.
  346. */function(u){const f=[];for(;u&&u.nodeType!=Node.DOCUMENT_NODE;)f.unshift(u),u=u.parentNode;return f}},function(o,r){'use strict';r.a=/**
  347. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  348. * For licensing, see LICENSE.md.
  349. */function(u){return(f)=>f+u}},function(o,r){'use strict';r.a=/**
  350. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  351. * For licensing, see LICENSE.md.
  352. */function(u){const f=u.next();return f.done?null:f.value}},function(o,r,s){'use strict';var d=s(53),u=s(31),f=s.i(d.a)(u.a,'Map');r.a=f},function(o,r,s){'use strict';var d=s(53),u=s(31),f=s.i(d.a)(u.a,'Set');r.a=f},function(o,r,s){'use strict';var d=s(31),u=d.a.Uint8Array;r.a=u},function(o,r){'use strict';r.a=function(u,f,h){var w=h.length;return 0===w?u.call(f):1===w?u.call(f,h[0]):2===w?u.call(f,h[0],h[1]):3===w?u.call(f,h[0],h[1],h[2]):u.apply(f,h)}},function(o,r){'use strict';r.a=function(u,f,h,w){var C=-1,T=u.length;for(w&&T&&(h=u[++C]);++C<T;)h=f(h,u[C],C,u);return h}},function(o,r,s){'use strict';function d(pe,ge,fe,he,be,_e,ke){var ye;if(he&&(ye=_e?he(pe,be,_e,ke):he(pe)),void 0!==ye)return ye;if(!s.i(I.a)(pe))return pe;var we=s.i(F.a)(pe);if(!we){var ve=s.i(E.a)(pe),xe=ve==H||ve==U;if(s.i(N.a)(pe))return s.i(C.a)(pe,ge);if(ve==G||ve==D||xe&&!_e){if(s.i(M.a)(pe))return _e?pe:{};if(ye=s.i(R.a)(xe?{}:pe),!ge)return s.i(P.a)(pe,s.i(w.a)(ye,pe))}else{if(!me[ve])return _e?pe:{};ye=s.i(V.a)(pe,ve,d,ge)}}else if(ye=s.i(O.a)(pe),!ge)return s.i(T.a)(pe,ye);ke||(ke=new u.a);var Ce=ke.get(pe);if(Ce)return Ce;if(ke.set(pe,ye),!we)var Te=fe?s.i(S.a)(pe):s.i(L.a)(pe);return s.i(f.a)(Te||pe,function(Ae,Pe){Te&&(Pe=Ae,Ae=pe[Pe]),s.i(h.a)(ye,Pe,d(Ae,ge,fe,he,Pe,pe,ke))}),ye}var u=s(123),f=s(430),h=s(67),w=s(432),C=s(452),T=s(204),P=s(460),S=s(466),E=s(141),O=s(475),V=s(476),R=s(477),F=s(11),N=s(507),M=s(90),I=s(15),L=s(69),D='[object Arguments]',H='[object Function]',U='[object GeneratorFunction]',G='[object Object]',me={};me[D]=me['[object Array]']=me['[object ArrayBuffer]']=me['[object DataView]']=me['[object Boolean]']=me['[object Date]']=me['[object Float32Array]']=me['[object Float64Array]']=me['[object Int8Array]']=me['[object Int16Array]']=me['[object Int32Array]']=me['[object Map]']=me['[object Number]']=me[G]=me['[object RegExp]']=me['[object Set]']=me['[object String]']=me['[object Symbol]']=me['[object Uint8Array]']=me['[object Uint8ClampedArray]']=me['[object Uint16Array]']=me['[object Uint32Array]']=!0,me['[object Error]']=me[H]=me['[object WeakMap]']=!1,r.a=d},function(o,r){'use strict';r.a=function(u,f,h){for(var w=u.length,C=h?w:-1;h?C--:++C<w;)if(f(u[C],C,u))return C;return-1}},function(o,r,s){'use strict';var u=s(140),f=Object.prototype,h=f.hasOwnProperty;r.a=function(w,C){return h.call(w,C)||'object'==typeof w&&C in w&&null===s.i(u.a)(w)}},function(o,r,s){'use strict';var u=s(88),f=s(36),h=s(54),w=s(19),C=s(491),T=s(55),P=Array.prototype,S=P.splice;r.a=function(E,O){for(var V=E?O.length:0,R=V-1,F;V--;)if(F=O[V],V==R||F!==N){var N=F;if(s.i(f.a)(F))S.call(E,F,1);else if(!s.i(h.a)(F,E)){var M=s.i(u.a)(F),I=s.i(C.a)(E,M);null!=I&&delete I[s.i(T.a)(s.i(w.a)(M))]}else delete E[s.i(T.a)(F)]}return E}},function(o,r,s){'use strict';var u=s(56);r.a=function(f,h){for(var w=-1,C=f.length,T=0,P=[];++w<C;){var S=f[w],E=h?h(S):S;if(!w||!s.i(u.a)(E,O)){var O=E;P[T++]=0===S?0:S}}return P}},function(o,r){'use strict';r.a=function(u,f){for(var h=-1,w=Array(u);++h<u;)w[h]=f(h);return w}},function(o,r){'use strict';r.a=function(u,f,h){for(var w=-1,C=u.length,T=f.length,P={},S;++w<C;)S=w<T?f[w]:void 0,h(P,u[w],S);return P}},function(o,r){'use strict';r.a=function(u,f){var h=-1,w=u.length;for(f||(f=Array(w));++h<w;)f[h]=u[h];return f}},function(o,r,s){'use strict';var u=s(82),f=s(431);r.a=function(C,T,P,S,E,O){var V=E&2,R=C.length,F=T.length;if(R!=F&&!(V&&F>R))return!1;var N=O.get(C);if(N)return N==T;var M=-1,I=!0,L=E&1?new u.a:void 0;for(O.set(C,T);++M<R;){var D=C[M],q=T[M];if(S)var z=V?S(q,D,M,T,C,O):S(D,q,M,C,T,O);if(void 0!==z){if(z)continue;I=!1;break}if(L){if(!s.i(f.a)(T,function($,K){if(!L.has(K)&&(D===$||P(D,$,S,E,O)))return L.add(K)})){I=!1;break}}else if(!(D===q||P(D,q,S,E,O))){I=!1;break}}return O['delete'](C),I}},function(o,r){'use strict';function d(f){return u(Object(f))}var u=Object.getOwnPropertySymbols;u||(d=function(){return[]}),r.a=d},function(o,r,s){'use strict';var u=s(202),f=s(147),h=s(11),w=s(97),C=s(149);r.a=function(T){var P=T?T.length:void 0;return s.i(w.a)(P)&&(s.i(h.a)(T)||s.i(C.a)(T)||s.i(f.a)(T))?s.i(u.a)(P,String):null}},function(o,r){'use strict';r.a=function(u,f,h){for(var w=u.length,C=f+(h?0:-1),T;h?C--:++C<w;)if(T=u[C],T!==T)return C;return-1}},function(o,r,s){'use strict';var u=s(15);r.a=function(f){return f===f&&!s.i(u.a)(f)}},function(o,r){'use strict';r.a=function(u,f){return function(h){return null!=h&&h[u]===f&&(f!==void 0||u in Object(h))}}},function(o,r){'use strict';var u=Function.prototype.toString;r.a=function(f){if(null!=f){try{return u.call(f)}catch(h){}try{return f+''}catch(h){}}return''}},function(o,r,s){'use strict';var u=s(35),f=s(91),h=s(16),w=Math.ceil;r.a=function(T,P,S){P=(S?s.i(f.a)(T,P,S):void 0===P)?1:_Mathmax(s.i(h.a)(P),0);var E=T?T.length:0;if(!E||1>P)return[];for(var O=0,V=0,R=Array(w(E/P));O<E;)R[V++]=s.i(u.a)(T,O,O+=P);return R}},function(o,r){'use strict';r.a=function(u){for(var f=-1,h=u?u.length:0,w=0,C=[],T;++f<h;)T=u[f],T&&(C[w++]=T);return C}},function(o,r,s){'use strict';var u=s(84),f=s(23),h=s(204),w=s(11);r.a=function(){for(var C=arguments.length,T=Array(C?C-1:0),P=arguments[0],S=C;S--;)T[S-1]=arguments[S];return C?s.i(u.a)(s.i(w.a)(P)?s.i(h.a)(P):[P],s.i(f.a)(T,1)):[]}},function(o,r,s){'use strict';var d=s(68),u=s(23),f=s(14),h=s(8),w=s.i(h.a)(function(C,T){return s.i(f.a)(C)?s.i(d.a)(C,s.i(u.a)(T,1,f.a,!0)):[]});r.a=w},function(o,r,s){'use strict';var d=s(68),u=s(23),f=s(10),h=s(14),w=s(19),C=s(8),T=s.i(C.a)(function(P,S){var E=s.i(w.a)(S);return s.i(h.a)(E)&&(E=void 0),s.i(h.a)(P)?s.i(d.a)(P,s.i(u.a)(S,1,h.a,!0),s.i(f.a)(E)):[]});r.a=T},function(o,r,s){'use strict';var d=s(68),u=s(23),f=s(14),h=s(19),w=s(8),C=s.i(w.a)(function(T,P){var S=s.i(h.a)(P);return s.i(f.a)(S)&&(S=void 0),s.i(f.a)(T)?s.i(d.a)(T,s.i(u.a)(P,1,f.a,!0),void 0,S):[]});r.a=C},function(o,r,s){'use strict';var u=s(10),f=s(87);r.a=function(h,w){return h&&h.length?s.i(f.a)(h,s.i(u.a)(w,3),!0,!0):[]}},function(o,r,s){'use strict';var u=s(10),f=s(87);r.a=function(h,w){return h&&h.length?s.i(f.a)(h,s.i(u.a)(w,3),!0):[]}},function(o,r,s){'use strict';var u=s(436),f=s(91);r.a=function(h,w,C,T){var P=h?h.length:0;return P?(C&&'number'!=typeof C&&s.i(f.a)(h,w,C)&&(C=0,T=P),s.i(u.a)(h,w,C,T)):[]}},function(o,r,s){'use strict';var u=s(198),f=s(10);r.a=function(h,w){return h&&h.length?s.i(u.a)(h,s.i(f.a)(w,3)):-1}},function(o,r,s){'use strict';var u=s(198),f=s(10);r.a=function(h,w){return h&&h.length?s.i(u.a)(h,s.i(f.a)(w,3),!0):-1}},function(o,r,s){'use strict';var d=s(146);s.d(r,'a',function(){return d.a})},function(o,r,s){'use strict';var u=s(23);r.a=function(f){var h=f?f.length:0;return h?s.i(u.a)(f,1):[]}},function(o,r,s){'use strict';var u=s(23);r.a=function(h){var w=h?h.length:0;return w?s.i(u.a)(h,1/0):[]}},function(o,r,s){'use strict';var u=s(23),f=s(16);r.a=function(h,w){var C=h?h.length:0;return C?(w=void 0===w?1:s.i(f.a)(w),s.i(u.a)(h,w)):[]}},function(o,r){'use strict';r.a=function(u){for(var f=-1,h=u?u.length:0,w={},C;++f<h;)C=u[f],w[C[0]]=C[1];return w}},function(o,r,s){'use strict';var u=s(127);r.a=function(f,h,w){var C=null==f?void 0:s.i(u.a)(f,h);return C===void 0?w:C}},function(o,r){'use strict';r.a=function(u){return u}},function(o,r,s){'use strict';var u=s(128),f=s(16);r.a=function(w,C,T){var P=w?w.length:0;return P?(T=s.i(f.a)(T),0>T&&(T=_Mathmax(P+T,0)),s.i(u.a)(w,C,T)):-1}},function(o,r,s){'use strict';var u=s(145);r.a=function(f){return s.i(u.a)(f,1)}},function(o,r,s){'use strict';var d=s(27),u=s(129),f=s(137),h=s(8),w=s.i(h.a)(function(C){var T=s.i(d.a)(C,f.a);return T.length&&T[0]===C[0]?s.i(u.a)(T):[]});r.a=w},function(o,r,s){'use strict';var d=s(27),u=s(129),f=s(10),h=s(137),w=s(19),C=s(8),T=s.i(C.a)(function(P){var S=s.i(w.a)(P),E=s.i(d.a)(P,h.a);return S===s.i(w.a)(E)?S=void 0:E.pop(),E.length&&E[0]===P[0]?s.i(u.a)(E,s.i(f.a)(S)):[]});r.a=T},function(o,r,s){'use strict';var d=s(27),u=s(129),f=s(137),h=s(19),w=s(8),C=s.i(w.a)(function(T){var P=s.i(h.a)(T),S=s.i(d.a)(T,f.a);return P===s.i(h.a)(S)?P=void 0:S.pop(),S.length&&S[0]===T[0]?s.i(u.a)(S,void 0,P):[]});r.a=C},function(o,r,s){'use strict';var u=s(148),f=s(90),h=s(15),w=s(211),C=/[\\^$.*+?()[\]{}|]/g,T=/^\[object .+?Constructor\]$/,P=Object.prototype,S=Function.prototype.toString,E=P.hasOwnProperty,O=RegExp('^'+S.call(E).replace(C,'\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,'$1.*?')+'$');r.a=function(V){if(!s.i(h.a)(V))return!1;var R=s.i(u.a)(V)||s.i(f.a)(V)?O:T;return R.test(s.i(w.a)(V))}},function(o,r){'use strict';var u=Array.prototype,f=u.join;r.a=function(h,w){return h?f.call(h,w):''}},function(o,r,s){'use strict';var u=s(208),f=s(16);r.a=function(C,T,P){var S=C?C.length:0;if(!S)return-1;var E=S;if(void 0!==P&&(E=s.i(f.a)(P),E=(0>E?_Mathmax(S+E,0):_Mathmin(E,S-1))+1),T!==T)return s.i(u.a)(C,E,!0);for(;E--;)if(C[E]===T)return E;return-1}},function(o,r,s){'use strict';var u=s(446),f=s(16);r.a=function(h,w){return h&&h.length?s.i(u.a)(h,s.i(f.a)(w)):void 0}},function(o,r,s){'use strict';var d=s(150),u=s(8),f=s.i(u.a)(d.a);r.a=f},function(o,r,s){'use strict';var u=s(10),f=s(132);r.a=function(h,w,C){return h&&h.length&&w&&w.length?s.i(f.a)(h,w,s.i(u.a)(C)):h}},function(o,r,s){'use strict';var u=s(132);r.a=function(f,h,w){return f&&f.length&&h&&h.length?s.i(u.a)(f,h,void 0,w):f}},function(o,r,s){'use strict';var d=s(27),u=s(433),f=s(23),h=s(200),w=s(459),C=s(36),T=s(8),P=s.i(T.a)(function(S,E){E=s.i(f.a)(E,1);var O=S?S.length:0,V=s.i(u.a)(S,E);return s.i(h.a)(S,s.i(d.a)(E,function(R){return s.i(C.a)(R,O)?+R:R}).sort(w.a)),V});r.a=P},function(o,r,s){'use strict';var u=s(10),f=s(200);r.a=function(h,w){var C=[];if(!(h&&h.length))return C;var T=-1,P=[],S=h.length;for(w=s.i(u.a)(w,3);++T<S;){var E=h[T];w(E,T,h)&&(C.push(E),P.push(T))}return s.i(f.a)(h,P),C}},function(o,r){'use strict';var u=Array.prototype,f=u.reverse;r.a=function(h){return h?f.call(h):h}},function(o,r,s){'use strict';var u=s(35),f=s(91),h=s(16);r.a=function(w,C,T){var P=w?w.length:0;return P?(T&&'number'!=typeof T&&s.i(f.a)(w,C,T)?(C=0,T=P):(C=null==C?0:s.i(h.a)(C),T=void 0===T?P:s.i(h.a)(T)),s.i(u.a)(w,C,T)):[]}},function(o,r,s){'use strict';var u=s(86);r.a=function(f,h){return s.i(u.a)(f,h)}},function(o,r,s){'use strict';var u=s(10),f=s(133);r.a=function(h,w,C){return s.i(f.a)(h,w,s.i(u.a)(C))}},function(o,r,s){'use strict';var u=s(86),f=s(56);r.a=function(h,w){var C=h?h.length:0;if(C){var T=s.i(u.a)(h,w);if(T<C&&s.i(f.a)(h[T],w))return T}return-1}},function(o,r,s){'use strict';var u=s(86);r.a=function(f,h){return s.i(u.a)(f,h,!0)}},function(o,r,s){'use strict';var u=s(10),f=s(133);r.a=function(h,w,C){return s.i(f.a)(h,w,s.i(u.a)(C),!0)}},function(o,r,s){'use strict';var u=s(86),f=s(56);r.a=function(h,w){var C=h?h.length:0;if(C){var T=s.i(u.a)(h,w,!0)-1;if(s.i(f.a)(h[T],w))return T}return-1}},function(o,r,s){'use strict';var u=s(201);r.a=function(f){return f&&f.length?s.i(u.a)(f):[]}},function(o,r,s){'use strict';var u=s(10),f=s(201);r.a=function(h,w){return h&&h.length?s.i(f.a)(h,s.i(u.a)(w)):[]}},function(o,r,s){'use strict';var u=s(144);r.a=function(f){return s.i(u.a)(f,1)}},function(o,r,s){'use strict';var u=s(35),f=s(16);r.a=function(h,w,C){return h&&h.length?(w=C||void 0===w?1:s.i(f.a)(w),s.i(u.a)(h,0,0>w?0:w)):[]}},function(o,r,s){'use strict';var u=s(35),f=s(16);r.a=function(h,w,C){var T=h?h.length:0;return T?(w=C||void 0===w?1:s.i(f.a)(w),w=T-w,s.i(u.a)(h,0>w?0:w,T)):[]}},function(o,r,s){'use strict';var u=s(10),f=s(87);r.a=function(h,w){return h&&h.length?s.i(f.a)(h,s.i(u.a)(w,3),!1,!0):[]}},function(o,r,s){'use strict';var u=s(10),f=s(87);r.a=function(h,w){return h&&h.length?s.i(f.a)(h,s.i(u.a)(w,3)):[]}},function(o,r,s){'use strict';var u=s(148),f=s(15),h=s(44),w=0/0,C=/^\s+|\s+$/g,T=/^[-+]0x[0-9a-f]+$/i,P=/^0b[01]+$/i,S=/^0o[0-7]+$/i,E=parseInt;r.a=function(O){if('number'==typeof O)return O;if(s.i(h.a)(O))return w;if(s.i(f.a)(O)){var V=s.i(u.a)(O.valueOf)?O.valueOf():O;O=s.i(f.a)(V)?V+'':V}if('string'!=typeof O)return 0===O?O:+O;O=O.replace(C,'');var R=P.test(O);return R||S.test(O)?E(O.slice(2),R?2:8):T.test(O)?w:+O}},function(o,r,s){'use strict';var d=s(23),u=s(42),f=s(14),h=s(8),w=s.i(h.a)(function(C){return s.i(u.a)(s.i(d.a)(C,1,f.a,!0))});r.a=w},function(o,r,s){'use strict';var d=s(23),u=s(10),f=s(42),h=s(14),w=s(19),C=s(8),T=s.i(C.a)(function(P){var S=s.i(w.a)(P);return s.i(h.a)(S)&&(S=void 0),s.i(f.a)(s.i(d.a)(P,1,h.a,!0),s.i(u.a)(S))});r.a=T},function(o,r,s){'use strict';var d=s(23),u=s(42),f=s(14),h=s(19),w=s(8),C=s.i(w.a)(function(T){var P=s.i(h.a)(T);return s.i(f.a)(P)&&(P=void 0),s.i(u.a)(s.i(d.a)(T,1,f.a,!0),void 0,P)});r.a=C},function(o,r,s){'use strict';var u=s(42);r.a=function(f){return f&&f.length?s.i(u.a)(f):[]}},function(o,r,s){'use strict';var u=s(10),f=s(42);r.a=function(h,w){return h&&h.length?s.i(f.a)(h,s.i(u.a)(w)):[]}},function(o,r,s){'use strict';var u=s(42);r.a=function(f,h){return f&&f.length?s.i(u.a)(f,void 0,h):[]}},function(o,r,s){'use strict';var d=s(68),u=s(14),f=s(8),h=s.i(f.a)(function(w,C){return s.i(u.a)(w)?s.i(d.a)(w,C):[]});r.a=h},function(o,r,s){'use strict';var d=s(83),u=s(135),f=s(14),h=s(8),w=s.i(h.a)(function(C){return s.i(u.a)(s.i(d.a)(C,f.a))});r.a=w},function(o,r,s){'use strict';var d=s(83),u=s(10),f=s(135),h=s(14),w=s(19),C=s(8),T=s.i(C.a)(function(P){var S=s.i(w.a)(P);return s.i(h.a)(S)&&(S=void 0),s.i(f.a)(s.i(d.a)(P,h.a),s.i(u.a)(S))});r.a=T},function(o,r,s){'use strict';var d=s(83),u=s(135),f=s(14),h=s(19),w=s(8),C=s.i(w.a)(function(T){var P=s.i(h.a)(T);return s.i(f.a)(P)&&(P=void 0),s.i(u.a)(s.i(d.a)(T,f.a),void 0,P)});r.a=C},function(o,r,s){'use strict';var d=s(8),u=s(99),f=s.i(d.a)(u.a);r.a=f},function(o,r,s){'use strict';var u=s(67),f=s(203);r.a=function(h,w){return s.i(f.a)(h||[],w||[],u.a)}},function(o,r,s){'use strict';var u=s(448),f=s(203);r.a=function(h,w){return s.i(f.a)(h||[],w||[],u.a)}},function(o,r,s){'use strict';var d=s(8),u=s(151),f=s.i(d.a)(function(h){var w=h.length,C=1<w?h[w-1]:void 0;return C='function'==typeof C?(h.pop(),C):void 0,s.i(u.a)(h,C)});r.a=f},function(o,r){'use strict';r.a=/**
  353. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  354. * For licensing, see LICENSE.md.
  355. */function(u){const f=new Map;for(let h in u)f.set(h,u[h]);return f}},function(o,r){'use strict';/**
  356. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  357. * For licensing, see LICENSE.md.
  358. */function d(C){return!!C&&1==C.length&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(C)}function u(C){return!!C&&1==C.length&&/[\ud800-\udbff]/.test(C)}function f(C){return!!C&&1==C.length&&/[\udc00-\udfff]/.test(C)}r.a=function(C,T){return u(C.charAt(T-1))&&f(C.charAt(T))},r.b=function(C,T){return d(C.charAt(T))}},function(o,r,s){'use strict';var d=s(315),u=s(316),f=s(3),h=s(173),w=s(179),C=s(155),T=s(156);/**
  359. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  360. * For licensing, see LICENSE.md.
  361. */class P extends f.a{static get requires(){return[h.a,w.a,C.a,T.a]}init(){this._addListAutoformats(),this._addHeadingAutoformats(),this._addInlineAutoformats()}_addListAutoformats(){new d.a(this.editor,/^[\*\-]\s$/,'bulletedList'),new d.a(this.editor,/^\d+[\.|)]?\s$/,'numberedList')}_addHeadingAutoformats(){new d.a(this.editor,/^(#{1,3})\s$/,(S)=>{const{batch:E,match:O}=S,V=O[1].length;this.editor.execute(`heading${V}`,{batch:E})})}_addInlineAutoformats(){new u.a(this.editor,/(\*\*)([^\*]+)(\*\*)$/g,'bold'),new u.a(this.editor,/(__)([^_]+)(__)$/g,'bold'),new u.a(this.editor,/(?:^|[^\*])(\*)([^\*_]+)(\*)$/g,'italic'),new u.a(this.editor,/(?:^|[^_])(_)([^_]+)(_)$/g,'italic')}}r.a=P},function(o,r,s){'use strict';var d=s(3),u=s(155),f=s(26),h=s(297),w=s.n(h);/**
  362. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  363. * For licensing, see LICENSE.md.
  364. */class C extends d.a{static get requires(){return[u.a]}init(){const T=this.editor,P=T.t,S=T.commands.get('bold'),E='CTRL+B';T.ui.componentFactory.add('bold',(O)=>{const V=new f.a(O);return V.set({label:P('Bold'),icon:w.a,keystroke:E,tooltip:!0}),V.bind('isOn','isEnabled').to(S,'value','isEnabled'),this.listenTo(V,'execute',()=>T.execute('bold')),V}),T.keystrokes.set(E,'bold')}}r.a=C},function(o,r,s){'use strict';var d=s(3),u=s(156),f=s(26),h=s(298),w=s.n(h);/**
  365. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  366. * For licensing, see LICENSE.md.
  367. */class C extends d.a{static get requires(){return[u.a]}init(){const T=this.editor,P=T.t,S=T.commands.get('italic'),E='CTRL+I';T.ui.componentFactory.add('italic',(O)=>{const V=new f.a(O);return V.set({label:P('Italic'),icon:w.a,keystroke:E,tooltip:!0}),V.bind('isOn','isEnabled').to(S,'value','isEnabled'),this.listenTo(V,'execute',()=>T.execute('italic')),V}),T.keystrokes.set(E,'italic')}}r.a=C},function(o){'use strict';/**
  368. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  369. * For licensing, see LICENSE.md.
  370. */o.exports={toolbar:['headings','bold','italic','link','unlink','bulletedList','numberedList','undo','redo']}},function(o,r,s){'use strict';var d=s(3),u=s(317),f=s(320),h=s(319),w=s(162);/**
  371. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  372. * For licensing, see LICENSE.md.
  373. */class C extends d.a{init(){const T=this.editor,P=T.document,S=T.editing.view;this._htmlDataProcessor=new w.a,S.addObserver(u.a),this.listenTo(S,'paste',(O,V)=>{const R=V.dataTransfer;let F='';R.getData('text/html')?F=s.i(h.a)(R.getData('text/html')):R.getData('text/plain')&&(F=s.i(f.a)(R.getData('text/plain'))),F=this._htmlDataProcessor.toView(F),V.preventDefault(),S.fire('clipboardInput',{dataTransfer:R,content:F})},{priority:'low'}),this.listenTo(S,'clipboardInput',(O,V)=>{if(!V.content.isEmpty){const R=this.editor.data,F=R.toModel(V.content,'$clipboardHolder');P.enqueueChanges(()=>{R.insertContent(F,P.selection)})}},{priority:'low'});const E=(O,V)=>{const R=V.dataTransfer,F=T.data.toView(T.data.getSelectedContent(P.selection));V.preventDefault(),S.fire('clipboardOutput',{dataTransfer:R,content:F,method:O.name})};this.listenTo(S,'copy',E,{priority:'low'}),this.listenTo(S,'cut',E,{priority:'low'}),this.listenTo(S,'clipboardOutput',(O,V)=>{V.content.isEmpty||V.dataTransfer.setData('text/html',this._htmlDataProcessor.toData(V.content)),'cut'==V.method&&P.enqueueChanges(()=>{T.data.deleteContent(P.selection,P.batch(),{merge:!0})})},{priority:'low'})}}r.a=C},function(o,r,s){'use strict';var d=s(323),u=s(162),f=s(325),h=s(326),w=s(420),C=s(308),T=s.n(C);/**
  374. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  375. * For licensing, see LICENSE.md.
  376. */class P extends d.a{constructor(S,E){super(S,E),this.document.createRoot(),this.data.processor=new u.a,this.ui=new f.a(this,new h.a(this.locale)),this._elementReplacer=new w.a}destroy(){return this.updateEditorElement(),this._elementReplacer.restore(),this.ui.destroy().then(()=>super.destroy())}static create(S,E){return new Promise((O)=>{const V=new this(S,E);O(V.initPlugins().then(()=>V._elementReplacer.replace(S,V.ui.view.element)).then(()=>V.ui.init()).then(()=>V.fire('uiReady')).then(()=>V.editing.view.attachDomRoot(V.ui.view.editableElement)).then(()=>V.loadDataFromEditorElement()).then(()=>{V.fire('dataReady'),V.fire('ready')}).then(()=>V))})}}r.a=P},function(o,r,s){'use strict';var d=s(3),u=s(359),f=s(360);/**
  377. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  378. * For licensing, see LICENSE.md.
  379. */class h extends d.a{init(){const w=this.editor,C=w.editing.view;C.addObserver(f.a),w.commands.set('enter',new u.a(w)),this.listenTo(C,'enter',(T,P)=>{w.execute('enter'),P.preventDefault()},{priority:'low'})}}r.a=h},function(o,r,s){'use strict';function d(O,V){return Array.prototype.concat(...O.map((R)=>[R,V]))}var u=s(71),f=s(173),h=s(3),w=s(401),C=s(392),T=s(79),P=s(309),S=s.n(P);/**
  380. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  381. * For licensing, see LICENSE.md.
  382. */class E extends h.a{static get requires(){return[u.a,f.a]}init(){const O=this.editor,V=new T.a,R=this._getLocalizedOptions(),F=[],N=O.t,M=N('Heading');for(let L of R){const D=O.commands.get(L.modelElement),q=new w.a({commandName:L.modelElement,label:L.title,class:L.class});q.bind('isActive').to(D,'value'),V.add(q),F.push(D)}const I=new w.a({withText:!0,items:V,tooltip:M});I.bind('isEnabled').to(...d(F,'isEnabled'),(...L)=>L.some((D)=>D)),I.bind('label').to(...d(F,'value'),(...L)=>{const D=L.findIndex((q)=>q);return R[D]?R[D].title:M}),O.ui.componentFactory.add('headings',(L)=>{const D=s.i(C.a)(I,L);return this.listenTo(D,'execute',(q)=>{O.execute(q.source.commandName),O.editing.view.focus()}),D})}_getLocalizedOptions(){const O=this.editor,V=O.t,R={Paragraph:V('Paragraph'),'Heading 1':V('Heading 1'),'Heading 2':V('Heading 2'),'Heading 3':V('Heading 3')};return O.config.get('heading.options').map((F)=>{const N=R[F.title];return N&&N!=F.title&&(F=Object.assign({},F,{title:N})),F})}}r.a=E},function(o,r,s){'use strict';var d=s(3),u=s(174),f=s(372),h=s(368),w=s(312),C=s.n(w);/**
  383. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  384. * For licensing, see LICENSE.md.
  385. */class T extends d.a{static get requires(){return[u.a,f.a,h.a]}}r.a=T},function(o,r,s){'use strict';var d=s(3),u=s(363),f=s(310),h=s.n(f);/**
  386. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  387. * For licensing, see LICENSE.md.
  388. */class w extends d.a{static get requires(){return[u.a]}}r.a=w},function(o,r,s){'use strict';var d=s(3),u=s(367),f=s(26);/**
  389. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  390. * For licensing, see LICENSE.md.
  391. */class h extends d.a{static get requires(){return[u.a]}init(){const w=this.editor.config.get('image.styles');for(let T of w)this._createButton(T);const C=this.editor.config.get('image.defaultToolbar');C&&(C.length&&C.push('|'),w.forEach((T)=>C.push(T.name)))}_createButton(w){const C=this.editor,T=C.commands.get(w.name);C.ui.componentFactory.add(w.name,(P)=>{const S=new f.a(P);return S.set({label:w.title,icon:w.icon,tooltip:!0}),S.bind('isEnabled').to(T,'isEnabled'),S.bind('isOn').to(T,'value'),this.listenTo(S,'execute',()=>C.execute(w.name)),S})}}r.a=h},function(o,r,s){'use strict';function d(I){return I.parent.getAncestors().find((L)=>L instanceof w.a)}var u=s(3),f=s(351),h=s(374),w=s(178),C=s(181),T=s(26),P=s(185),S=s(375),E=s(302),O=s.n(E),V=s(303),R=s.n(V),F=s(313),N=s.n(F);/**
  392. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  393. * For licensing, see LICENSE.md.
  394. */class M extends u.a{static get requires(){return[h.a]}init(){this.editor.editing.view.addObserver(f.a),this.balloonPanelView=this._createBalloonPanel(),this.formView=this._createForm(),this._createToolbarLinkButton(),this._createToolbarUnlinkButton()}_createToolbarLinkButton(){const I=this.editor,L=I.commands.get('link'),D=I.t;I.keystrokes.set('CTRL+K',()=>this._showPanel()),I.ui.componentFactory.add('link',(q)=>{const z=new T.a(q);return z.isEnabled=!0,z.label=D('Link'),z.icon=O.a,z.keystroke='CTRL+K',z.tooltip=!0,z.bind('isEnabled').to(L,'isEnabled'),this.listenTo(z,'execute',()=>this._showPanel()),z})}_createToolbarUnlinkButton(){const I=this.editor,L=I.t,D=I.commands.get('unlink');I.ui.componentFactory.add('unlink',(q)=>{const z=new T.a(q);return z.isEnabled=!1,z.label=L('Unlink'),z.icon=R.a,z.tooltip=!0,z.bind('isEnabled').to(D,'isEnabled'),this.listenTo(z,'execute',()=>I.execute('unlink')),z})}_createBalloonPanel(){const I=this.editor,L=I.editing.view,D=new P.a(I.locale);return D.maxWidth=300,I.ui.focusTracker.add(D.element),this.listenTo(L,'click',()=>{const q=L.selection,z=d(q.getFirstPosition());q.isCollapsed&&z&&(this._attachPanelToElement(),this.listenTo(L,'render',()=>{const $=d(q.getFirstPosition());q.isCollapsed&&z===$?this._attachPanelToElement(z):this._hidePanel()}),this.listenTo(D,'change:isVisible',()=>this.stopListening(L,'render')))}),I.keystrokes.set('Tab',(q,z)=>{D.isVisible&&!this.formView.focusTracker.isFocused&&(this.formView.focus(),z())}),I.keystrokes.set('Esc',(q,z)=>{D.isVisible&&(this._hidePanel(!0),z())}),s.i(C.a)({emitter:D,activator:()=>D.isVisible,contextElement:D.element,callback:()=>this._hidePanel()}),I.ui.view.body.add(D),D}_createForm(){const I=this.editor,L=new S.a(I.locale);return L.urlInputView.bind('value').to(I.commands.get('link'),'value'),this.listenTo(L,'submit',()=>{I.execute('link',L.urlInputView.inputView.element.value),this._hidePanel(!0)}),this.listenTo(L,'unlink',()=>{I.execute('unlink'),this._hidePanel(!0)}),L.keystrokes.set('Esc',(D,q)=>{this._hidePanel(!0),q()}),this.listenTo(L,'cancel',()=>this._hidePanel(!0)),this.balloonPanelView.content.add(L),L}_attachPanelToElement(I){const L=this.editor.editing.view,D=I||d(L.selection.getFirstPosition()),q=D?L.domConverter.getCorrespondingDomElement(D):L.domConverter.viewRangeToDom(L.selection.getFirstRange());this.balloonPanelView.attachTo({target:q,limiter:L.domConverter.getCorrespondingDomElement(L.selection.editableElement)})}_hidePanel(I){this.balloonPanelView.hide(),I&&this.editor.editing.view.focus()}_showPanel(){this._attachPanelToElement(),this.formView.urlInputView.select()}}r.a=M},function(o,r,s){'use strict';var d=s(179),u=s(305),f=s.n(u),h=s(304),w=s.n(h),C=s(3),T=s(22),P=s(26);/**
  395. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  396. * For licensing, see LICENSE.md.
  397. */class S extends C.a{static get requires(){return[d.a]}init(){const E=this.editor.t;this._addButton('numberedList',E('Numbered List'),f.a),this._addButton('bulletedList',E('Bulleted List'),w.a),this.listenTo(this.editor.editing.view,'enter',(O,V)=>{const R=this.editor.document,F=R.selection.getLastPosition().parent;R.selection.isCollapsed&&'listItem'==F.name&&F.isEmpty&&(this.editor.execute('outdentList'),V.preventDefault(),O.stop())}),this.listenTo(this.editor.editing.view,'keydown',(O,V)=>{let R;if(V.keystroke==s.i(T.d)('Tab')?R='indentList':V.keystroke==s.i(T.d)('Shift+Tab')&&(R='outdentList'),R){const F=this.editor.commands.get(R);F.isEnabled&&(this.editor.execute(R),V.preventDefault(),O.stop())}})}_addButton(E,O,V){const R=this.editor,F=R.commands.get(E);R.ui.componentFactory.add(E,(N)=>{const M=new P.a(N);return M.set({label:O,icon:V,tooltip:!0}),M.bind('isOn','isEnabled').to(F,'value','isEnabled'),this.listenTo(M,'execute',()=>R.execute(E)),M})}}r.a=S},function(o,r,s){'use strict';var d=s(3),u=s(385),f=s(382);/**
  398. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  399. * For licensing, see LICENSE.md.
  400. */class h extends d.a{static get requires(){return[u.a,f.a]}}r.a=h},function(o,r,s){'use strict';var d=s(3),u=s(407),f=s(26),h=s(307),w=s.n(h),C=s(306),T=s.n(C);/**
  401. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  402. * For licensing, see LICENSE.md.
  403. */class P extends d.a{static get requires(){return[u.a]}init(){const S=this.editor,E=S.t;this._addButton('undo',E('Undo'),'CTRL+Z',w.a),this._addButton('redo',E('Redo'),'CTRL+Y',T.a),S.keystrokes.set('CTRL+Z','undo'),S.keystrokes.set('CTRL+Y','redo'),S.keystrokes.set('CTRL+SHIFT+Z','redo')}_addButton(S,E,O,V){const R=this.editor,F=R.commands.get(S);R.ui.componentFactory.add(S,(N)=>{const M=new f.a(N);return M.set({label:E,icon:V,keystroke:O,tooltip:!0}),M.bind('isEnabled').to(F,'isEnabled'),this.listenTo(M,'execute',()=>R.execute(S)),M})}}r.a=P},function(o,r,s){r=o.exports=s(45)(),r.push([o.i,'@charset "UTF-8";\n/**\n * Makes element unselectable.\n */\n/**\n * A class which hides an element in DOM.\n */\n.ck-hidden {\n display: none; }\n\n/**\n * Wraps (S)CSS into .ck-editor namespace.\n */\n/**\n * Resets an element, ignoring its children.\n */\n.ck-reset, .ck-reset_all, .ck-reset_all *, .ck-reset_all a, .ck-reset_all textarea {\n box-sizing: border-box;\n width: auto;\n height: auto;\n position: static; }\n\n/**\n * Resets an element AND its children.\n */\n/**\n * Default width/height of an icon.\n */\nsvg.ck-icon {\n min-width: 20px;\n min-height: 20px;\n font-size: 1em;\n vertical-align: middle;\n color: inherit;\n cursor: inherit; }\n svg.ck-icon * {\n cursor: inherit;\n color: inherit;\n fill: currentColor; }\n\n/**\n * Applies styles to the main part of the tooltip.\n */\n/**\n * Applies styles to the arrow part of the tooltip.\n */\n/**\n * Applies styles to both arrow and main part of the tooltip.\n */\n/**\n * Enables the tooltip, which is the tooltip is in DOM but\n * not yet displayed.\n */\n/**\n * Disables the tooltip making it disappear from DOM.\n */\n/**\n * Shows the tooltip, which is already in DOM.\n * Requires `ck-tooltip_enabled` first.\n */\n[data-ck-tooltip]::after {\n visibility: hidden;\n opacity: 0;\n display: none;\n position: absolute;\n z-index: 999;\n pointer-events: none;\n -webkit-backface-visibility: hidden; }\n\n[data-ck-tooltip]::before {\n visibility: hidden;\n opacity: 0;\n display: none;\n position: absolute;\n z-index: 999;\n pointer-events: none;\n -webkit-backface-visibility: hidden; }\n\n[data-ck-tooltip]::after {\n content: attr(data-ck-tooltip); }\n\n[data-ck-tooltip]::before {\n content: "";\n width: 0;\n height: 0; }\n\n.ck-button,\na.ck-button {\n display: inline-block;\n position: relative;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none; }\n .ck-button::after,\n a.ck-button::after {\n display: block; }\n .ck-button::before,\n a.ck-button::before {\n display: block; }\n .ck-button.ck-button_with-text .ck-button__label,\n a.ck-button.ck-button_with-text .ck-button__label {\n display: block; }\n .ck-button:hover::after,\n a.ck-button:hover::after {\n visibility: visible;\n opacity: 1; }\n .ck-button:hover::before,\n a.ck-button:hover::before {\n visibility: visible;\n opacity: 1; }\n .ck-button:focus:not(:hover)::after,\n a.ck-button:focus:not(:hover)::after {\n display: none; }\n .ck-button:focus:not(:hover)::before,\n a.ck-button:focus:not(:hover)::before {\n display: none; }\n .ck-button .ck-button__label,\n a.ck-button .ck-button__label {\n display: none; }\n\n.ck-toolbar {\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none; }\n .ck-toolbar__separator {\n display: inline-block; }\n .ck-toolbar__newline {\n display: block;\n clear: left; }\n\n.ck-dropdown {\n display: inline-block;\n position: relative; }\n .ck-dropdown::after {\n content: \'\';\n width: 0;\n height: 0;\n pointer-events: none;\n z-index: 1;\n position: absolute;\n top: 50%;\n transform: translate(0, -50%); }\n\n.ck-dropdown__panel {\n -webkit-backface-visibility: hidden;\n display: none;\n z-index: 999;\n position: absolute;\n left: 0px;\n transform: translateY(100%); }\n .ck-dropdown__panel-visible {\n display: inline-block; }\n\n.ck-list {\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none; }\n .ck-list__item {\n display: block; }\n\n.ck-label {\n display: block; }\n\n.cke-voice-label {\n display: none; }\n\n.ck-balloon-panel {\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n display: none;\n position: absolute;\n z-index: 999; }\n .ck-balloon-panel:before, .ck-balloon-panel:after {\n content: "";\n position: absolute; }\n .ck-balloon-panel:before {\n z-index: 1; }\n .ck-balloon-panel:after {\n z-index: 2; }\n .ck-balloon-panel_arrow_s:before, .ck-balloon-panel_arrow_se:before, .ck-balloon-panel_arrow_sw:before {\n z-index: 1; }\n .ck-balloon-panel_arrow_s:after, .ck-balloon-panel_arrow_se:after, .ck-balloon-panel_arrow_sw:after {\n z-index: 2; }\n .ck-balloon-panel_arrow_n:before, .ck-balloon-panel_arrow_ne:before, .ck-balloon-panel_arrow_nw:before {\n z-index: 1; }\n .ck-balloon-panel_arrow_n:after, .ck-balloon-panel_arrow_ne:after, .ck-balloon-panel_arrow_nw:after {\n z-index: 2; }\n .ck-balloon-panel_visible {\n display: block; }\n\n.ck-floating-panel {\n position: absolute;\n display: none; }\n .ck-floating-panel_active {\n display: block; }\n\n.ck-editor .ck-toolbar.ck-toolbar_sticky {\n position: fixed;\n top: 0; }\n .ck-editor .ck-toolbar.ck-toolbar_sticky.ck-toolbar_sticky_bottom-limit {\n top: auto;\n position: absolute; }\n\n/**\n * Colors configured by the user.\n *\n * @type Map\n * @example\n *\t\t$ck-colors: ( \'foreground\': red );\n * @see $_ck-colors\n */\n/**\n * Internal map with default colors.\n *\n * @type Map\n * @see ck-color-add\n */\n/**\n * Returns a color of given name and lightness offset.\n *\n * @param {String} $name [ \'background\' ] - Name of the color.\n * @param {Number} $offset [ 0 ] - Offset of the lightness.\n * @return {String}\n * @see $_ck-colors\n */\n/**\n * Returns a border\u2013color for a given name and lightness offset.\n *\n * @param {String} $name [ \'background\' ] - Name of the color.\n * @param {Number} $offset [ 0 ] - Offset of the lightness.\n * @return {String}\n * @see $ck-color\n */\n/**\n * Adds a color to internal color map.\n *\n * @example\n *\t\t@include ck-color-add( ( \'special\': yellow, \'hover\': #00FF00 ) );\n * @param {Map} $map - A map with new colors.\n * @see $_ck-colors\n */\n/**\n * Base font size.\n *\n * @see $ck-font-sizes\n */\n/**\n * Base font face.\n *\n */\n/**\n * Base font sizes for scaling.\n *\n * @see ck-font-size\n */\n/**\n * Returns font-size in units for given level.\n *\n * @param {Number} $level [ 0 ] - Size of the font.\n * @return {String}\n * @see $ck-font-sizes\n * @see $ck-font-size-base\n */\n/**\n * Default border-radius value.\n *\n */\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n/**\n * Default spacing value ("unit").\n *\n */\n/**\n * Internal map with default spacings.\n *\n * @type Map\n * @see ck-spacing\n */\n/**\n * Returns a spacing value with units for given name.\n *\n * @param {String} $spacing [ \'standard\' ] - Spacing level.\n * @return {String}\n * @see $ck-def-spacing\n * @see $ck-def-spacings\n */\n/**\n * A visual style of focused element\'s outer shadow.\n */\n/**\n * A visual style of focused element\'s border or outline.\n */\n/**\n * A class which indicates that an element holding it is disabled.\n */\n.ck-disabled {\n opacity: .5; }\n\n/**\n * A visual style of focused element\'s border or outline.\n */\n/**\n * Brings visual styling for :focus state.\n */\n/**\n * A visual style of element\'s inner shadow (i.e. input).\n */\n/**\n * A visual style of element\'s drop shadow (i.e. panel).\n */\n/**\n * A helper to combine multiple shadows.\n */\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n/**\n * Resets an element, ignoring its children.\n */\n.ck-reset, .ck-reset_all, .ck-reset_all *, .ck-reset_all a, .ck-reset_all textarea {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n text-decoration: none;\n vertical-align: middle;\n transition: none; }\n\n/**\n * Resets an element AND its children.\n */\n.ck-reset_all, .ck-reset_all *, .ck-reset_all a, .ck-reset_all textarea {\n border-collapse: collapse;\n font: normal normal normal 12px Helvetica, Arial, Tahoma, Verdana, Sans-Serif;\n color: #333333;\n text-align: left;\n white-space: nowrap;\n cursor: auto;\n float: none; }\n\n.ck-reset_all .ck-rtl * {\n text-align: right; }\n\n.ck-reset_all iframe {\n vertical-align: inherit; }\n\n.ck-reset_all textarea {\n white-space: pre-wrap; }\n\n.ck-reset_all textarea,\n.ck-reset_all input[type="text"],\n.ck-reset_all input[type="password"] {\n cursor: text; }\n\n.ck-reset_all textarea[disabled],\n.ck-reset_all input[type="text"][disabled],\n.ck-reset_all input[type="password"][disabled] {\n cursor: default; }\n\n.ck-reset_all fieldset {\n padding: 10px;\n border: 2px groove #E0DFE3; }\n\n.ck-reset_all button::-moz-focus-inner {\n padding: 0;\n border: 0; }\n\nsvg.ck-icon {\n width: 1.66667em;\n height: 1.66667em; }\n\n[data-ck-tooltip]::after {\n left: 50%;\n transition: opacity .2s ease-in-out .2s; }\n\n[data-ck-tooltip]::before {\n left: 50%;\n transition: opacity .2s ease-in-out .2s; }\n\n[data-ck-tooltip]::after {\n border-radius: 2px;\n color: white;\n font-size: 0.7rem;\n background: #333333;\n padding: 0.4em 0.64em; }\n\n[data-ck-tooltip]::before {\n border-style: solid; }\n\n/**\n * A class once applied displays the tooltip south of the element.\n *\n * [element]\n * ^\n * +-----------+\n * | Tooltip |\n * +-----------+\n */\n.ck-tooltip_s::after {\n bottom: -4px;\n transform: translate(-50%, 100%); }\n\n.ck-tooltip_s::before {\n bottom: 0;\n transform: translate(-50%, 100%);\n border-color: transparent transparent #333333 transparent;\n border-width: 0 5px 5px 5px; }\n\n/**\n * A class once applied displays the tooltip north of the element.\n *\n * +-----------+\n * | Tooltip |\n * +-----------+\n * V\n * [element]\n */\n.ck-tooltip_n::after {\n top: -4px;\n transform: translate(-50%, -100%); }\n\n.ck-tooltip_n::before {\n top: 0;\n transform: translate(-50%, -100%);\n border-color: #333333 transparent transparent transparent;\n border-width: 5px 5px 0 5px; }\n\n/**\n * Implements a button of given background color.\n *\n * @param {String} $color - Background color of the button.\n */\n/**\n * Implements button states.\n *\n * @param {String} $color - Background color of the button.\n */\n/**\n * A helper to define button\u2013specific icon styles.\n *\n */\n.ck-button,\na.ck-button {\n background: white;\n border-color: #bfbfbf;\n border-width: 1px;\n border-style: solid;\n white-space: nowrap;\n cursor: default;\n vertical-align: middle;\n padding: 0.4em;\n line-height: 1.66667; }\n .ck-button:not(.ck-disabled):hover, .ck-button:not(.ck-disabled):focus,\n a.ck-button:not(.ck-disabled):hover,\n a.ck-button:not(.ck-disabled):focus {\n background: #e6e6e6;\n border-color: #a6a6a6; }\n .ck-button:not(.ck-disabled):active,\n a.ck-button:not(.ck-disabled):active {\n background: #d9d9d9;\n border-color: #999999;\n box-shadow: inset 0 2px 2px #bfbfbf; }\n .ck-button.ck-rounded-corners,\n .ck-rounded-corners .ck-button,\n a.ck-button.ck-rounded-corners,\n .ck-rounded-corners\n a.ck-button {\n border-radius: 2px; }\n .ck-button:focus,\n a.ck-button:focus {\n outline: none;\n border: 1px solid #6ab5f9;\n box-shadow: 0 0 3px 2px #9bcdfb; }\n .ck-button .ck-icon,\n a.ck-button .ck-icon {\n float: left; }\n .ck-button.ck-button_with-text,\n a.ck-button.ck-button_with-text {\n padding: 0.4em 0.8em; }\n .ck-button.ck-button_with-text .ck-icon,\n a.ck-button.ck-button_with-text .ck-icon {\n margin-left: -0.4em;\n margin-right: 0.4em; }\n .ck-button.ck-button_with-text .ck-button__label,\n a.ck-button.ck-button_with-text .ck-button__label {\n display: block; }\n .ck-button.ck-on,\n a.ck-button.ck-on {\n background: #f7f7f7;\n border-color: #b9b9b9; }\n .ck-button.ck-on:not(.ck-disabled):hover, .ck-button.ck-on:not(.ck-disabled):focus,\n a.ck-button.ck-on:not(.ck-disabled):hover,\n a.ck-button.ck-on:not(.ck-disabled):focus {\n background: #dedede;\n border-color: #a1a1a1; }\n .ck-button.ck-on:not(.ck-disabled):active,\n a.ck-button.ck-on:not(.ck-disabled):active {\n background: #d2d2d2;\n border-color: #949494;\n box-shadow: inset 0 2px 2px #b9b9b9; }\n .ck-button-action,\n a.ck-button-action {\n background: #61b145;\n border-color: #498534;\n text-shadow: 0 -1px #4e8e37;\n color: white; }\n .ck-button-action:not(.ck-disabled):hover, .ck-button-action:not(.ck-disabled):focus,\n a.ck-button-action:not(.ck-disabled):hover,\n a.ck-button-action:not(.ck-disabled):focus {\n background: #579f3e;\n border-color: #3f732d; }\n .ck-button-action:not(.ck-disabled):active,\n a.ck-button-action:not(.ck-disabled):active {\n background: #52963b;\n border-color: #3a6a29;\n box-shadow: inset 0 2px 2px #498534; }\n .ck-button-action:hover, .ck-button-action:focus, .ck-button-action:active,\n a.ck-button-action:hover,\n a.ck-button-action:focus,\n a.ck-button-action:active {\n text-shadow: 0 -1px #3a6a29; }\n .ck-button-bold,\n a.ck-button-bold {\n font-weight: bold; }\n .ck-button .ck-icon use,\n .ck-button .ck-icon use *,\n a.ck-button .ck-icon use,\n a.ck-button .ck-icon use * {\n color: inherit; }\n .ck-button .ck-button__label,\n a.ck-button .ck-button__label {\n float: left;\n line-height: inherit;\n font-size: inherit;\n font-weight: inherit;\n color: inherit;\n cursor: inherit; }\n\n.ck-toolbar {\n line-height: 1;\n padding: 0.4em;\n border: 1px solid #bfbfbf;\n white-space: initial;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none; }\n .ck-toolbar.ck-rounded-corners,\n .ck-rounded-corners .ck-toolbar {\n border-radius: 2px; }\n .ck-toolbar__separator {\n width: 1px;\n height: calc( 1em + 2 * 0.64em);\n vertical-align: middle;\n background: #bfbfbf; }\n .ck-toolbar__newline {\n height: 0.4em; }\n .ck-toolbar > * {\n margin-right: 0.4em; }\n .ck-toolbar > *:last-child {\n margin-right: 0; }\n\n.ck-dropdown::after {\n border-style: solid;\n border-width: .4em .4em 0 .4em;\n border-color: #707070 transparent;\n right: 0.8em; }\n\n.ck-dropdown .ck-button.ck-dropdown__button {\n padding-right: 1.6em; }\n .ck-dropdown .ck-button.ck-dropdown__button .ck-button__label {\n width: 7em;\n overflow: hidden;\n text-overflow: ellipsis; }\n\n.ck-dropdown__panel {\n border: 1px solid #b9b9b9;\n bottom: 1px;\n background: white;\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2); }\n .ck-dropdown__panel.ck-rounded-corners,\n .ck-rounded-corners .ck-dropdown__panel {\n border-radius: 2px; }\n\n.ck-list {\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n list-style-type: none;\n background: white; }\n .ck-list.ck-rounded-corners,\n .ck-rounded-corners .ck-list {\n border-radius: 2px; }\n .ck-list__item {\n padding: 0.64em;\n cursor: default;\n min-width: 12em; }\n .ck-list__item:hover, .ck-list__item:focus {\n background: #f7f7f7; }\n .ck-list__item:focus {\n box-shadow: 0 0 3px 2px #9bcdfb;\n position: relative;\n z-index: 1;\n outline: none; }\n .ck-list__item:last-of-type {\n border: none; }\n .ck-list__item_active {\n background: #1a8bf1;\n color: white; }\n .ck-list__item_active:hover, .ck-list__item_active:focus {\n background: #0e7ee2; }\n\n.ck-label {\n font-weight: bold; }\n\n.ck-input-text {\n box-shadow: 2px 2px 3px #e6e6e6 inset;\n border: 1px solid #b9b9b9;\n padding: 0.64em;\n min-width: 250px; }\n .ck-input-text.ck-rounded-corners,\n .ck-rounded-corners .ck-input-text {\n border-radius: 2px; }\n .ck-input-text:focus {\n outline: none;\n border: 1px solid #6ab5f9;\n box-shadow: 0 0 3px 2px #9bcdfb, 2px 2px 3px #e6e6e6 inset; }\n\n.ck-balloon-panel {\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);\n min-width: 50px;\n min-height: 15px;\n background: white;\n border: 1px solid #b9b9b9; }\n .ck-balloon-panel.ck-rounded-corners,\n .ck-rounded-corners .ck-balloon-panel {\n border-radius: 2px; }\n .ck-balloon-panel:before, .ck-balloon-panel:after {\n width: 0;\n height: 0;\n border-style: solid; }\n .ck-balloon-panel_arrow_s:before, .ck-balloon-panel_arrow_s:after, .ck-balloon-panel_arrow_se:before, .ck-balloon-panel_arrow_se:after, .ck-balloon-panel_arrow_sw:before, .ck-balloon-panel_arrow_sw:after {\n border-width: 0 10px 15px 10px; }\n .ck-balloon-panel_arrow_s:before, .ck-balloon-panel_arrow_se:before, .ck-balloon-panel_arrow_sw:before {\n border-color: transparent transparent #b9b9b9 transparent; }\n .ck-balloon-panel_arrow_s:after, .ck-balloon-panel_arrow_se:after, .ck-balloon-panel_arrow_sw:after {\n border-color: transparent transparent white transparent;\n margin-top: 2px; }\n .ck-balloon-panel_arrow_n:before, .ck-balloon-panel_arrow_n:after, .ck-balloon-panel_arrow_ne:before, .ck-balloon-panel_arrow_ne:after, .ck-balloon-panel_arrow_nw:before, .ck-balloon-panel_arrow_nw:after {\n border-width: 15px 10px 0 10px; }\n .ck-balloon-panel_arrow_n:before, .ck-balloon-panel_arrow_ne:before, .ck-balloon-panel_arrow_nw:before {\n border-color: #b9b9b9 transparent transparent; }\n .ck-balloon-panel_arrow_n:after, .ck-balloon-panel_arrow_ne:after, .ck-balloon-panel_arrow_nw:after {\n border-color: white transparent transparent transparent;\n margin-bottom: 2px; }\n .ck-balloon-panel_arrow_s:before, .ck-balloon-panel_arrow_s:after {\n left: 50%;\n margin-left: -10px;\n top: -15px; }\n .ck-balloon-panel_arrow_se:before, .ck-balloon-panel_arrow_se:after {\n left: 20px;\n top: -15px; }\n .ck-balloon-panel_arrow_sw:before, .ck-balloon-panel_arrow_sw:after {\n right: 20px;\n top: -15px; }\n .ck-balloon-panel_arrow_n:before, .ck-balloon-panel_arrow_n:after {\n left: 50%;\n margin-left: -10px;\n bottom: -15px; }\n .ck-balloon-panel_arrow_ne:before, .ck-balloon-panel_arrow_ne:after {\n left: 20px;\n bottom: -15px; }\n .ck-balloon-panel_arrow_nw:before, .ck-balloon-panel_arrow_nw:after {\n right: 20px;\n bottom: -15px; }\n\n.ck-floating-panel {\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #bfbfbf;\n background: #f7f7f7; }\n .ck-floating-panel.ck-rounded-corners,\n .ck-rounded-corners .ck-floating-panel {\n border-radius: 2px; }\n\n.ck-toolbar__container {\n background: #f7f7f7; }\n .ck-toolbar__container .ck-toolbar {\n border-radius: 0;\n border: 0; }\n .ck-toolbar__container .ck-toolbar .ck-button {\n border-width: 0; }\n .ck-toolbar__container .ck-toolbar .ck-button:not(:hover):not(:focus):not(.ck-on), .ck-toolbar__container .ck-toolbar .ck-button.ck-disabled {\n background: #f7f7f7; }\n .ck-toolbar__container .ck-toolbar .ck-button.ck-on {\n background: #dedede;\n border-color: #a1a1a1; }\n .ck-toolbar__container .ck-toolbar .ck-button.ck-on:not(.ck-disabled):hover, .ck-toolbar__container .ck-toolbar .ck-button.ck-on:not(.ck-disabled):focus {\n background: #c6c6c6;\n border-color: #888888; }\n .ck-toolbar__container .ck-toolbar .ck-button.ck-on:not(.ck-disabled):active {\n background: #b9b9b9;\n border-color: #7c7c7c;\n box-shadow: inset 0 2px 2px #a1a1a1; }\n .ck-toolbar__container .ck-toolbar .ck-dropdown__button {\n border-width: 1px; }\n .ck-toolbar__container .ck-toolbar .ck-dropdown__button:not(:hover):not(:focus):not(.ck-on) {\n background: white; }\n .ck-toolbar__container.ck-balloon-panel_arrow_s:after, .ck-toolbar__container.ck-balloon-panel_arrow_se:after, .ck-toolbar__container.ck-balloon-panel_arrow_sw:after {\n border-bottom-color: #f7f7f7; }\n .ck-toolbar__container.ck-balloon-panel_arrow_n:after, .ck-toolbar__container.ck-balloon-panel_arrow_ne:after, .ck-toolbar__container.ck-balloon-panel_arrow_nw:after {\n border-top-color: #f7f7f7; }\n\n.ck-editor .ck-toolbar.ck-toolbar_sticky {\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #bfbfbf;\n border-width: 0 0 1px;\n background: #f7f7f7; }\n\n.ck-editor {\n position: relative; }\n .ck-editor.ck-rounded-corners,\n .ck-rounded-corners .ck-editor {\n border-radius: 2px; }\n .ck-editor .ck-editor__top .ck-toolbar {\n border-radius: 0;\n border-top: 0;\n border-left: 0;\n border-right: 0; }\n .ck-editor .ck-editor__top .ck-toolbar .ck-button {\n border-width: 0; }\n .ck-editor .ck-editor__top .ck-toolbar .ck-button:not(:hover):not(:focus):not(.ck-on), .ck-editor .ck-editor__top .ck-toolbar .ck-button.ck-disabled {\n background: #f7f7f7; }\n .ck-editor .ck-editor__top .ck-toolbar .ck-button.ck-on {\n background: #dedede;\n border-color: #a1a1a1; }\n .ck-editor .ck-editor__top .ck-toolbar .ck-button.ck-on:not(.ck-disabled):hover, .ck-editor .ck-editor__top .ck-toolbar .ck-button.ck-on:not(.ck-disabled):focus {\n background: #c6c6c6;\n border-color: #888888; }\n .ck-editor .ck-editor__top .ck-toolbar .ck-button.ck-on:not(.ck-disabled):active {\n background: #b9b9b9;\n border-color: #7c7c7c;\n box-shadow: inset 0 2px 2px #a1a1a1; }\n .ck-editor .ck-editor__top .ck-toolbar .ck-dropdown__button {\n border-width: 1px; }\n .ck-editor .ck-editor__top .ck-toolbar .ck-dropdown__button:not(:hover):not(:focus):not(.ck-on) {\n background: white; }\n .ck-editor .ck-editor__main {\n background: white; }\n .ck-editor .ck-editor__bottom {\n border-bottom: 0;\n border-left: 0;\n border-right: 0;\n padding: 0.8em; }\n .ck-editor .ck-editor__editable.ck-focused {\n outline: 1px solid #6ab5f9;\n box-shadow: 2px 2px 3px #e6e6e6 inset; }\n .ck-editor .ck-editor__editable_inline {\n overflow: auto;\n padding: 0 0.8em; }\n\n.ck-editor,\n.ck-editor-bottom {\n background: #f7f7f7;\n border: 1px solid #b9b9b9; }\n',''])},function(o,r,s){r=o.exports=s(45)(),r.push([o.i,'/**\n * Default spacing value ("unit").\n *\n */\n/**\n * Internal map with default spacings.\n *\n * @type Map\n * @see ck-spacing\n */\n/**\n * Returns a spacing value with units for given name.\n *\n * @param {String} $spacing [ \'standard\' ] - Spacing level.\n * @return {String}\n * @see $ck-def-spacing\n * @see $ck-def-spacings\n */\n/**\n * Base font size.\n *\n * @see $ck-font-sizes\n */\n/**\n * Base font face.\n *\n */\n/**\n * Base font sizes for scaling.\n *\n * @see ck-font-size\n */\n/**\n * Returns font-size in units for given level.\n *\n * @param {Number} $level [ 0 ] - Size of the font.\n * @return {String}\n * @see $ck-font-sizes\n * @see $ck-font-size-base\n */\n.ck-heading_heading1 {\n font-size: 1.5em; }\n\n.ck-heading_heading2 {\n font-size: 1.3em; }\n\n.ck-heading_heading3 {\n font-size: 1.1em; }\n\n[class*="ck-heading_"] {\n line-height: 21.6px;\n padding: 9.6px; }\n\n[class*="ck-heading_heading"] {\n font-weight: bold; }\n',''])},function(o,r,s){r=o.exports=s(45)(),r.push([o.i,'@charset "UTF-8";\n/**\n * Colors configured by the user.\n *\n * @type Map\n * @example\n *\t\t$ck-colors: ( \'foreground\': red );\n * @see $_ck-colors\n */\n/**\n * Internal map with default colors.\n *\n * @type Map\n * @see ck-color-add\n */\n/**\n * Returns a color of given name and lightness offset.\n *\n * @param {String} $name [ \'background\' ] - Name of the color.\n * @param {Number} $offset [ 0 ] - Offset of the lightness.\n * @return {String}\n * @see $_ck-colors\n */\n/**\n * Returns a border\u2013color for a given name and lightness offset.\n *\n * @param {String} $name [ \'background\' ] - Name of the color.\n * @param {Number} $offset [ 0 ] - Offset of the lightness.\n * @return {String}\n * @see $ck-color\n */\n/**\n * Adds a color to internal color map.\n *\n * @example\n *\t\t@include ck-color-add( ( \'special\': yellow, \'hover\': #00FF00 ) );\n * @param {Map} $map - A map with new colors.\n * @see $_ck-colors\n */\n/**\n * A visual style of element\'s inner shadow (i.e. input).\n */\n/**\n * A visual style of element\'s drop shadow (i.e. panel).\n */\n/**\n * A helper to combine multiple shadows.\n */\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n/**\n * A visual style of focused element\'s outer shadow.\n */\n/**\n * A visual style of focused element\'s border or outline.\n */\n/**\n * A class which indicates that an element holding it is disabled.\n */\n.ck-disabled {\n opacity: .5; }\n\n/**\n * A visual style of focused element\'s border or outline.\n */\n/**\n * Brings visual styling for :focus state.\n */\n.ck-widget.image figcaption {\n background-color: #f7f7f7;\n padding: 10px;\n font-size: .8em;\n color: #858585; }\n .ck-widget.image figcaption:focus {\n outline: none;\n box-shadow: none; }\n .ck-widget.image figcaption.focused {\n outline: 1px solid #6ab5f9;\n box-shadow: 2px 2px 3px #e6e6e6 inset;\n background-color: white; }\n',''])},function(o,r,s){r=o.exports=s(45)(),r.push([o.i,'/**\n * Default spacing value ("unit").\n *\n */\n/**\n * Internal map with default spacings.\n *\n * @type Map\n * @see ck-spacing\n */\n/**\n * Returns a spacing value with units for given name.\n *\n * @param {String} $spacing [ \'standard\' ] - Spacing level.\n * @return {String}\n * @see $ck-def-spacing\n * @see $ck-def-spacings\n */\n.cke-text-alternative-form {\n padding: 1.2em;\n overflow: hidden; }\n .cke-text-alternative-form .ck-label {\n margin-bottom: 0.4em; }\n .cke-text-alternative-form__actions {\n clear: both;\n padding-top: 1.2em; }\n .cke-text-alternative-form__actions .ck-button {\n float: right; }\n .cke-text-alternative-form__actions .ck-button + .ck-button {\n margin-right: 0.64em; }\n .cke-text-alternative-form__actions .ck-button + .ck-button + .ck-button {\n float: left; }\n',''])},function(o,r,s){r=o.exports=s(45)(),r.push([o.i,'.ck-widget {\n margin: 10px 0;\n padding: 0; }\n .ck-widget.ck-widget_selected, .ck-widget.ck-widget_selected:hover {\n outline: 2px solid #ace; }\n .ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected {\n outline: 2px solid #ddd; }\n .ck-widget:hover {\n outline: 2px solid yellow; }\n\n.image {\n text-align: center;\n clear: both; }\n .image.image-style-side {\n float: right;\n margin-left: 0.8em;\n max-width: 50%; }\n\n.image > img {\n display: block;\n margin: 0 auto;\n max-width: 100%; }\n',''])},function(o,r,s){r=o.exports=s(45)(),r.push([o.i,'/**\n * Default spacing value ("unit").\n *\n */\n/**\n * Internal map with default spacings.\n *\n * @type Map\n * @see ck-spacing\n */\n/**\n * Returns a spacing value with units for given name.\n *\n * @param {String} $spacing [ \'standard\' ] - Spacing level.\n * @return {String}\n * @see $ck-def-spacing\n * @see $ck-def-spacings\n */\n.ck-link-form {\n padding: 1.2em;\n overflow: hidden; }\n .ck-link-form .ck-label {\n margin-bottom: 0.4em; }\n .ck-link-form__actions {\n clear: both;\n padding-top: 1.2em; }\n .ck-link-form__actions .ck-button {\n float: right; }\n .ck-link-form__actions .ck-button + .ck-button {\n margin-right: 0.64em; }\n .ck-link-form__actions .ck-button + .ck-button + .ck-button {\n float: left; }\n',''])},function(o){o.exports='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <!-- Generator: Sketch 3.5.2 (25235) - http://www.bohemiancoding.com/sketch -->\n <title>bold</title>\n <desc>Created with Sketch.</desc>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <g id="bold" sketch:type="MSArtboardGroup" fill="#454545">\n <g id="icon:bold" sketch:type="MSLayerGroup" transform="translate(4.000000, 3.000000)">\n <path d="M11.135257,7.40877709 C11.4960763,7.65684034 11.7892376,7.96832419 12.0147496,8.34323798 C12.2402617,8.71815176 12.353016,9.15930309 12.353016,9.66670521 C12.353016,10.2755877 12.2247579,10.7900294 11.968238,11.2100456 C11.711718,11.6300618 11.343857,11.9612776 10.8646439,12.2037031 C10.3572418,12.463042 9.77232867,12.6462677 9.10988702,12.753386 C8.44744538,12.8605042 7.66803104,12.9140625 6.77162064,12.9140625 L0.5390625,12.9140625 L0.5390625,12.254443 C0.713834339,12.2375296 0.933705291,12.2121599 1.19868195,12.1783331 C1.46365861,12.1445063 1.64970326,12.1050423 1.75682149,12.0599399 C1.96542013,11.9753729 2.10777248,11.864028 2.1838828,11.7259018 C2.25999311,11.5877757 2.2980477,11.4087782 2.2980477,11.1889039 L2.2980477,2.73224432 C2.2980477,2.52928347 2.26704026,2.36015197 2.20502445,2.22484474 C2.14300863,2.08953751 1.99360914,1.97114546 1.75682149,1.86966504 C1.58204965,1.79637362 1.37909184,1.73576817 1.14794199,1.68784686 C0.916792141,1.63992554 0.713834339,1.60187096 0.5390625,1.57368195 L0.5390625,0.9140625 L7.05914707,0.9140625 C8.69974724,0.9140625 9.88366774,1.13957117 10.6109441,1.59059527 C11.3382205,2.04161937 11.7018532,2.70686994 11.7018532,3.58636694 C11.7018532,3.99228863 11.6201063,4.34887421 11.4566101,4.65613438 C11.2931138,4.96339455 11.0591486,5.22977666 10.7547073,5.45528872 C10.4784551,5.66388736 10.1486486,5.8442943 9.76527814,5.99651493 C9.38190766,6.14873557 8.97035434,6.27558419 8.53060584,6.37706461 L8.53060584,6.53774115 C8.97035434,6.58284356 9.42700939,6.68009417 9.9005847,6.8294959 C10.37416,6.97889764 10.7857133,7.17198943 11.135257,7.40877709 L11.135257,7.40877709 Z M8.41221261,3.79778343 C8.41221261,3.13252288 8.22475853,2.61385294 7.84984474,2.24175806 C7.47493096,1.86966318 6.91256872,1.68361853 6.16274115,1.68361853 C6.05562292,1.68361853 5.91608943,1.68784681 5.7441365,1.69630351 C5.57218356,1.70476022 5.42419349,1.71180736 5.30016187,1.71744516 L5.30016187,6.16564812 L5.73990817,6.16564812 C6.65323197,6.16564812 7.32693912,5.95282432 7.76104982,5.52717032 C8.19516051,5.10151633 8.41221261,4.52505979 8.41221261,3.79778343 L8.41221261,3.79778343 Z M9.00417878,9.55676863 C9.00417878,8.72237404 8.75611924,8.0824932 8.25999273,7.6371069 C7.76386622,7.1917206 7.05069506,6.96903079 6.12045785,6.96903079 C6.01333962,6.96903079 5.87098728,6.97325908 5.69339654,6.98171578 C5.5158058,6.99017248 5.38472888,6.99721962 5.30016187,7.00285743 L5.30016187,11.3918638 C5.35090208,11.6004624 5.50875814,11.7766411 5.7737348,11.920405 C6.03871146,12.0641689 6.36006132,12.1360498 6.737794,12.1360498 C7.40869235,12.1360498 7.95414144,11.9105411 8.37415764,11.459517 C8.79417383,11.0084929 9.00417878,10.3742498 9.00417878,9.55676863 L9.00417878,9.55676863 Z" id="B" sketch:type="MSShapeGroup"></path>\n </g>\n </g>\n </g>\n</svg>'},function(o){o.exports='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <!-- Generator: Sketch 3.5.2 (25235) - http://www.bohemiancoding.com/sketch -->\n <title>italic</title>\n <desc>Created with Sketch.</desc>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <g id="italic" sketch:type="MSArtboardGroup" fill="#454545">\n <g id="icon:italic" sketch:type="MSLayerGroup" transform="translate(5.000000, 3.000000)">\n <path d="M8.82538319,0.9140625 L8.6985333,1.47220203 C8.52376146,1.47783984 8.29543393,1.50320956 8.01354387,1.54831197 C7.73165381,1.59341438 7.52305829,1.63569726 7.38775106,1.67516187 C7.1509634,1.74845328 6.9818319,1.86120762 6.88035148,2.01342825 C6.77887106,2.16564888 6.70558074,2.33196153 6.66047833,2.51237117 L4.63088002,11.2819272 C4.61960442,11.3213918 4.61114784,11.3664935 4.60551004,11.4172337 C4.59987224,11.467974 4.59705338,11.5130757 4.59705338,11.5525403 C4.59705338,11.6822097 4.62524197,11.7921452 4.68161998,11.88235 C4.73799799,11.9725548 4.83947689,12.0514829 4.98605973,12.1191365 C5.07062674,12.1586011 5.2566714,12.2051123 5.54419926,12.2586714 C5.83172712,12.3122305 6.04596036,12.3446474 6.18690539,12.355923 L6.0600555,12.9140625 L0.65625,12.9140625 L0.783099894,12.355923 C0.94095833,12.3446474 1.166467,12.3277342 1.45963266,12.305183 C1.75279833,12.2826318 1.96139385,12.2488055 2.08542548,12.2037031 C2.30529973,12.1247739 2.47161237,12.0162478 2.58436839,11.8781217 C2.69712442,11.7399956 2.77323359,11.5722735 2.8126982,11.3749504 L4.83383985,2.59693776 C4.84511545,2.54619755 4.85357203,2.4954581 4.85920983,2.44471789 C4.86484763,2.39397768 4.86766649,2.34323823 4.86766649,2.29249802 C4.86766649,2.17974199 4.84370619,2.08108195 4.79578488,1.99651493 C4.74786357,1.91194791 4.6477941,1.83583874 4.49557347,1.76818512 C4.34335283,1.70053151 4.13616674,1.63710719 3.87400899,1.57791028 C3.61185123,1.51871337 3.41875943,1.48347764 3.2947278,1.47220203 L3.4215777,0.9140625 L8.82538319,0.9140625 Z" id="I" sketch:type="MSShapeGroup"></path>\n </g>\n </g>\n </g>\n</svg>'},function(o){o.exports='<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg width="100%" height="100%" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><path d="M5.414,6.749l-2.511,-2.512c-0.192,-0.191 -0.192,-0.502 0,-0.694c0.192,-0.192 0.503,-0.192 0.694,0l2.797,2.797c0.695,-0.251 1.407,-0.428 2.127,-0.53c0.366,-0.051 0.734,-0.081 1.103,-0.095c0.137,-0.003 0.275,-0.005 0.412,-0.004c0.371,0.006 0.742,0.029 1.112,0.074c1.109,0.134 2.204,0.449 3.243,0.936c0.743,0.347 1.464,0.782 2.12,1.331c0.276,0.231 0.542,0.484 0.784,0.766c0.18,0.211 0.349,0.439 0.488,0.692c0.169,0.307 0.301,0.664 0.301,1.039c0,0.375 -0.132,0.732 -0.301,1.039c-0.139,0.252 -0.308,0.481 -0.488,0.691c-0.242,0.283 -0.508,0.535 -0.784,0.767c-0.647,0.542 -1.359,0.973 -2.092,1.318l2.196,2.197c0.192,0.191 0.192,0.503 0,0.694c-0.191,0.192 -0.503,0.192 -0.694,0l-2.485,-2.484l-0.008,0.003l-0.931,-0.931l0.009,-0.003l-6.215,-6.215c-0.321,0.131 -0.636,0.278 -0.945,0.444l6.239,6.24l-0.006,0.005l0.78,0.78c-0.388,0.094 -0.78,0.166 -1.174,0.215l-1.11,-1.11l0.011,0l-5.603,-5.603c-0.229,0.157 -0.452,0.328 -0.665,0.514c-0.038,0.032 -0.075,0.065 -0.112,0.098l4.897,4.897l-0.005,0.006l1.276,1.276c-0.494,-0.003 -0.987,-0.042 -1.477,-0.117l-0.479,-0.479l-0.009,0.009l-4.863,-4.863c-0.007,0.01 -0.015,0.021 -0.022,0.031c-0.044,0.065 -0.086,0.131 -0.124,0.2c-0.026,0.047 -0.05,0.095 -0.071,0.145c-0.014,0.031 -0.026,0.063 -0.037,0.096c-0.013,0.042 -0.026,0.087 -0.028,0.133c-0.001,0.024 0.003,0.049 0.008,0.072c0.009,0.041 0.022,0.082 0.036,0.12c0.014,0.036 0.029,0.072 0.046,0.106c0.031,0.065 0.066,0.126 0.103,0.186c0.041,0.067 0.085,0.131 0.131,0.193l3.463,3.594c-0.281,-0.097 -0.56,-0.206 -0.835,-0.326c-0.44,-0.193 -0.872,-0.417 -1.29,-0.674c-0.35,-0.215 -0.69,-0.454 -1.015,-0.721c-0.281,-0.23 -0.551,-0.482 -0.798,-0.764c-0.184,-0.21 -0.357,-0.438 -0.502,-0.69c-0.184,-0.319 -0.329,-0.693 -0.329,-1.089c0,-0.375 0.131,-0.732 0.301,-1.039c0.139,-0.253 0.307,-0.481 0.488,-0.692c0.225,-0.263 0.471,-0.5 0.728,-0.719c0.647,-0.552 1.36,-0.99 2.096,-1.341l0.019,-0.009l0,0Zm6.674,0.401c1.069,0.849 1.755,2.16 1.755,3.63c0,0.833 -0.224,1.648 -0.647,2.362l0.345,0.344c0.015,-0.006 0.03,-0.012 0.046,-0.018c0.695,-0.285 1.372,-0.649 2,-1.112c0.252,-0.186 0.497,-0.388 0.727,-0.613c0.137,-0.134 0.27,-0.277 0.392,-0.431c0.072,-0.091 0.141,-0.185 0.203,-0.286c0.037,-0.06 0.072,-0.121 0.103,-0.186c0.016,-0.034 0.032,-0.07 0.045,-0.106c0.015,-0.039 0.028,-0.079 0.036,-0.12c0.005,-0.023 0.009,-0.048 0.008,-0.072c-0.002,-0.046 -0.014,-0.091 -0.028,-0.133c-0.01,-0.033 -0.023,-0.065 -0.036,-0.096c-0.022,-0.05 -0.046,-0.098 -0.071,-0.145c-0.039,-0.069 -0.081,-0.135 -0.125,-0.2c-0.081,-0.118 -0.17,-0.229 -0.263,-0.335c-0.166,-0.19 -0.345,-0.362 -0.53,-0.523c-0.333,-0.29 -0.689,-0.543 -1.054,-0.768c-0.601,-0.369 -1.232,-0.664 -1.879,-0.891c-0.338,-0.119 -0.681,-0.219 -1.027,-0.301Zm-2.85,0.21c-0.023,0 -0.046,0.001 -0.069,0.002c-0.092,0.01 -0.18,0.041 -0.254,0.097c-0.163,0.123 -0.234,0.34 -0.175,0.535c0.016,0.051 0.04,0.1 0.071,0.144c0.036,0.05 0.082,0.093 0.133,0.126c0.059,0.038 0.124,0.061 0.193,0.073c0.023,0.003 0.022,0.003 0.045,0.005c0.091,0.003 0.181,0.003 0.272,0.012c0.158,0.016 0.315,0.048 0.467,0.094c0.496,0.151 0.937,0.462 1.246,0.878c0.124,0.167 0.224,0.349 0.304,0.541c0.024,0.061 0.043,0.125 0.069,0.185c0.038,0.077 0.089,0.144 0.159,0.194c0.085,0.062 0.188,0.093 0.291,0.093l0.008,0c0.077,-0.002 0.154,-0.021 0.224,-0.059c0.047,-0.026 0.09,-0.059 0.126,-0.099c0.042,-0.045 0.075,-0.098 0.097,-0.155c0.022,-0.057 0.034,-0.119 0.033,-0.18c0,-0.077 -0.022,-0.147 -0.048,-0.219c-0.015,-0.043 -0.031,-0.085 -0.048,-0.127c-0.084,-0.209 -0.189,-0.409 -0.312,-0.596c-0.436,-0.664 -1.102,-1.164 -1.862,-1.395c-0.214,-0.066 -0.434,-0.11 -0.657,-0.132c-0.09,-0.009 -0.181,-0.014 -0.272,-0.016c-0.009,0 -0.018,0 -0.028,-0.001l-0.013,0Z" style="fill:#3a3a3a;"/></svg>\n'},function(o){o.exports='<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg width="100%" height="100%" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"><path d="M2,16l16,0l0,1l-16,0l0,-1Zm15,-2l-14,0l0,-8l14,0l0,8Zm-1,-7l-12,0l0,6l12,0l0,-6Zm-14,-4l16,0l0,1l-16,0l0,-1Z" style="fill:#343434;"/></svg>\n'},function(o){o.exports='<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg width="100%" height="100%" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"><path id="_-Curves-" d="M18,16l-16,0l0,-1l16,0l0,1Zm-11.022,-3l-4.978,0l0,-1l4.978,0l0,1Zm11.022,-7l0,7l-9,0l0,-7l9,0Zm-1,6l0,-5l-7,0l0,5l7,0Zm-10.022,-2l-4.978,0l0,-1l4.978,0l0,1Zm0,-3l-4.978,0l0,-1l4.978,0l0,1Zm11.022,-3l-16,0l0,-1l16,0l0,1Z" style="fill:#343434;"/></svg>\n'},function(o){o.exports='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <!-- Generator: Sketch 3.5.2 (25235) - http://www.bohemiancoding.com/sketch -->\n <title>link</title>\n <desc>Created with Sketch.</desc>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <g id="link" sketch:type="MSArtboardGroup" fill="#222222">\n <g id="icon:link" sketch:type="MSLayerGroup">\n <g id="Rectangle-18-+-Rectangle-18-Copy-+-Path-28" transform="translate(9.646447, 9.853553) rotate(-315.000000) translate(-9.646447, -9.853553) translate(5.646447, 0.853553)" sketch:type="MSShapeGroup">\n <path d="M8,6.55919636 L8,4.82450549 C8,2.61334348 6.2104719,0.828427125 4,0.828427125 C1.79353398,0.828427125 -3.20810045e-12,2.61822724 -3.20810045e-12,4.82450549 L-3.20810045e-12,7.75542568 C-3.20810045e-12,9.96658769 1.7895281,11.751504 4,11.751504 C4.5511606,11.751504 5.07655559,11.6398264 5.55466651,11.437876 L5.12132034,11.437876 L5.12132034,10.5346402 C4.77469964,10.6745028 4.39616036,10.751504 4,10.751504 C2.34314575,10.751504 1,9.41562927 1,7.75542568 L1,4.82450549 C1,3.1698171 2.34651712,1.82842712 4,1.82842712 C5.65685425,1.82842712 7,3.1643019 7,4.82450549 L7,6.55919636 L8,6.55919636 Z" id="Shape"></path>\n <path d="M2.63603897,6.90151354 C3.06184352,6.74698845 3.52119959,6.66270951 4,6.66270951 C6.2104719,6.66270951 8,8.44762587 8,10.6587879 L8,13.5897081 C8,15.7959863 6.20646602,17.5857864 4,17.5857864 C1.7895281,17.5857864 -2.32347475e-12,15.8008701 -2.32347475e-12,13.5897081 L-2.32347475e-12,11.6627095 L1,11.6627095 L1,13.5897081 C1,15.2499117 2.34314575,16.5857864 4,16.5857864 C5.65348288,16.5857864 7,15.2443965 7,13.5897081 L7,10.6587879 C7,8.99858429 5.65685425,7.66270951 4,7.66270951 C3.5092458,7.66270951 3.04553235,7.78087311 2.63603897,7.99032058 L2.63603897,6.90151354 Z" id="Shape"></path>\n </g>\n </g>\n </g>\n </g>\n</svg>'},function(o){o.exports='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <!-- Generator: Sketch 3.5.2 (25235) - http://www.bohemiancoding.com/sketch -->\n <title>unlink</title>\n <desc>Created with Sketch.</desc>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <g id="unlink" sketch:type="MSArtboardGroup" fill="#222222">\n <g id="icon:unlink" sketch:type="MSLayerGroup">\n <g id="Rectangle-18-+-Rectangle-18-Copy-+-Path-28-Copy" transform="translate(12.828427, 13.035534) rotate(-315.000000) translate(-12.828427, -13.035534) translate(4.328427, 4.035534)" sketch:type="MSShapeGroup">\n <path d="M8,6.55919636 L8,4.82450549 C8,2.61334348 6.2104719,0.828427125 4,0.828427125 C1.79353398,0.828427125 -3.20454774e-12,2.61822724 -3.20454774e-12,4.82450549 L-3.20454774e-12,7.75542568 C-3.20454774e-12,9.96658769 1.7895281,11.751504 4,11.751504 C4.5511606,11.751504 5.07655559,11.6398264 5.55466651,11.437876 L5.12132034,11.437876 L5.12132034,10.5346402 C4.77469964,10.6745028 4.39616036,10.751504 4,10.751504 C2.34314575,10.751504 1,9.41562927 1,7.75542568 L1,4.82450549 C1,3.1698171 2.34651712,1.82842712 4,1.82842712 C5.65685425,1.82842712 7,3.1643019 7,4.82450549 L7,6.55919636 L8,6.55919636 Z" id="Shape"></path>\n <path d="M12.1301896,9.691731 L12.1301896,6.07623654 L11.1099103,6.07623654 L11.1099103,9.691731 L7.79324873,9.691731 L7.79324873,10.7120103 L11.1099103,10.7120103 L11.1099103,14.3275047 L12.1301896,14.3275047 L12.1301896,10.7120103 L16.0445169,10.7120103 L16.0445169,9.691731 L12.1301896,9.691731 Z M7.52584209,8.6418508 C6.80172121,7.49371533 5.53005392,6.73384534 4.08111717,6.73384534 C3.59260703,6.73384534 3.12393555,6.82077136 2.68949598,6.98014985 L2.68949598,8.10315471 C3.10729359,7.8871288 3.58041083,7.76525387 4.08111717,7.76525387 C5.2472836,7.76525387 6.26112906,8.4209623 6.77783518,9.38985772 L7.52584209,8.6418508 Z M8.16223435,12.3942945 L8.16223435,13.8784107 C8.16223435,16.1539849 6.33232877,18 4.08111717,18 C1.82581847,18 -8.17124146e-14,16.1590221 -8.17124146e-14,13.8784107 L-8.17124146e-14,11.890888 L1.02027929,11.890888 L1.02027929,13.8784107 C1.02027929,15.5907588 2.39066309,16.9685915 4.08111717,16.9685915 C5.76813152,16.9685915 7.14195505,15.5850704 7.14195505,13.8784107 L7.14195505,11.3740152 L8.16223435,12.3942945 Z" id="Shape"></path>\n </g>\n </g>\n </g>\n </g>\n</svg>'},function(o){o.exports='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <!-- Generator: Sketch 3.5.2 (25235) - http://www.bohemiancoding.com/sketch -->\n <title>bulletedlist</title>\n <desc>Created with Sketch.</desc>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <g id="bulletedlist" sketch:type="MSArtboardGroup" fill="#454545">\n <g id="icon:bulletedlist" sketch:type="MSLayerGroup" transform="translate(1.000000, 3.000000)">\n <path d="M5,13 L5,14 L15,14 L15,13 L5,13 L5,13 Z M5,1 L5,2 L17,2 L17,1 L5,1 L5,1 Z M5,7 L5,8 L16,8 L16,7 L5,7 L5,7 Z M0,1.5 C0,0.671572875 0.665797234,0 1.5,0 L1.5,0 C2.32842712,0 3,0.665797234 3,1.5 L3,1.5 C3,2.32842712 2.33420277,3 1.5,3 L1.5,3 C0.671572875,3 0,2.33420277 0,1.5 L0,1.5 Z M0,7.5 C0,6.67157288 0.665797234,6 1.5,6 L1.5,6 C2.32842712,6 3,6.66579723 3,7.5 L3,7.5 C3,8.32842712 2.33420277,9 1.5,9 L1.5,9 C0.671572875,9 0,8.33420277 0,7.5 L0,7.5 Z M0,13.5 C0,12.6715729 0.665797234,12 1.5,12 L1.5,12 C2.32842712,12 3,12.6657972 3,13.5 L3,13.5 C3,14.3284271 2.33420277,15 1.5,15 L1.5,15 C0.671572875,15 0,14.3342028 0,13.5 L0,13.5 Z" id="path4634" sketch:type="MSShapeGroup"></path>\n </g>\n </g>\n </g>\n</svg>'},function(o){o.exports='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <!-- Generator: Sketch 3.5.2 (25235) - http://www.bohemiancoding.com/sketch -->\n <title>numberedlist</title>\n <desc>Created with Sketch.</desc>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <g id="numberedlist" sketch:type="MSArtboardGroup" fill="#454545">\n <g id="icon:numberedlist" sketch:type="MSLayerGroup" transform="translate(2.000000, 2.000000)">\n <path d="M5,15 L15,15 L15,14 L5,14 L5,15 Z M4,2 L4,3 L17,3 L17,2 L4,2 L4,2 Z M5,8 L5,9 L16,9 L16,8 L5,8 L5,8 Z" id="path4634" sketch:type="MSShapeGroup"></path>\n <g id="path4712-path-+-path4712-path-+-path4712-path-copy" sketch:type="MSShapeGroup">\n <path d="M0,0.5 C0,0.77699 0.223,1 0.5,1 L1,1 L1,4.5 C1,4.77699 1.223,5 1.5,5 C1.777,5 2,4.77699 2,4.5 L2,0.5 C2,0.223 1.777,0 1.5,0 L0.5,0 C0.223,0 0,0.223 0,0.5 Z" id="path4712-path"></path>\n <path d="M0.5,6 C0.223,6 0,6.223 0,6.5 C0,6.77699 0.223,7 0.5,7 L2,7 L2,8 L0.5,8 C0.223,8 0,8.223 0,8.5 L0,10.5 C0,10.77699 0.223,11 0.5,11 L2.5,11 C2.777,11 3,10.77699 3,10.5 C3,10.223 2.777,10 2.5,10 L1,10 L1,9 L2.5,9 C2.5693,9 2.62764,8.994 2.6875,8.9688 C2.81468,8.9278 2.9182,8.82667 2.96875,8.68755 C2.99395,8.62765 2.99995,8.5693 2.99995,8.50005 L2.99995,6.50005 C2.99995,6.43075 2.99395,6.3724 2.96875,6.31255 C2.91825,6.17342 2.81468,6.07227 2.6875,6.0313 C2.6471,6.0142 2.6076,6.006 2.5625,6.0001 L2.5,6.0001 L0.5,6.0001 L0.5,6 Z" id="path4712-path"></path>\n <path d="M2.85209534,16.8526748 C2.94267961,16.7627344 3,16.6389489 3,16.5023012 L3,12.4976988 C3,12.3570579 2.94465639,12.2332311 2.85505992,12.1442682 C2.76454727,12.057652 2.64101746,12 2.50461102,12 L0.495388985,12 C0.215752602,12 0,12.2238576 0,12.5 C0,12.7680664 0.221793203,13 0.495388985,13 L2,13 L2,14 L0.495388985,14 C0.215752602,14 0,14.2238576 0,14.5 C0,14.7680664 0.221793203,15 0.495388985,15 L2,15 L2,16 L0.495388985,16 C0.215752602,16 0,16.2238576 0,16.5 C0,16.7680664 0.221793203,17 0.495388985,17 L2.50461102,17 C2.6440432,17 2.76759251,16.9443442 2.85643212,16.854302 Z" id="Rectangle-403"></path>\n </g>\n </g>\n </g>\n </g>\n</svg>'},function(o){o.exports='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <!-- Generator: Sketch 3.8.2 (29753) - http://www.bohemiancoding.com/sketch -->\n <title>redo</title>\n <desc>Created with Sketch.</desc>\n <defs></defs>\n <g id="Mockups" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="redo" fill="#454545">\n <g id="undo">\n <path d="M10.00002,15.99998 L11,12.0184937 C7.58334,12.0184937 2.38444,12.88666 1,16 C1,10.01667 7.60112,8.03985596 11,8.03985596 C10.99998,7.18907596 9.99999,4.71945 10,4 L18,10 L10.00002,15.99998 Z"></path>\n </g>\n </g>\n </g>\n</svg>'},function(o){o.exports='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <!-- Generator: Sketch 3.8.2 (29753) - http://www.bohemiancoding.com/sketch -->\n <title>undo</title>\n <desc>Created with Sketch.</desc>\n <defs></defs>\n <g id="Mockups" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="undo" fill="#454545">\n <g>\n <path d="M2,10 L9.99998,15.99998 L9,12.0184937 C12.41666,12.0184937 17.61556,12.88666 19,16 C19,10.01667 12.39888,8.03985596 9,8.03985596 C9.00002,7.18907596 10.00001,4.71945 10,4 L2,10 Z"></path>\n </g>\n </g>\n </g>\n</svg>'},function(o,r,s){var d=s(291);'string'==typeof d&&(d=[[o.i,d,'']]);s(46)(d,{});d.locals&&(o.exports=d.locals),!1},function(o,r,s){var d=s(292);'string'==typeof d&&(d=[[o.i,d,'']]);s(46)(d,{});d.locals&&(o.exports=d.locals),!1},function(o,r,s){var d=s(293);'string'==typeof d&&(d=[[o.i,d,'']]);s(46)(d,{});d.locals&&(o.exports=d.locals),!1},function(o,r,s){var d=s(294);'string'==typeof d&&(d=[[o.i,d,'']]);s(46)(d,{});d.locals&&(o.exports=d.locals),!1},function(o,r,s){var d=s(295);'string'==typeof d&&(d=[[o.i,d,'']]);s(46)(d,{});d.locals&&(o.exports=d.locals),!1},function(o,r,s){var d=s(296);'string'==typeof d&&(d=[[o.i,d,'']]);s(46)(d,{});d.locals&&(o.exports=d.locals),!1},function(o){var s=function(){return this}();try{s=s||Function('return this')()||(1,eval)('this')}catch(d){'object'==typeof window&&(s=window)}o.exports=s},function(o,r,s){'use strict';var d=s(2),u=s(61);/**
  404. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  405. * For licensing, see LICENSE.md.
  406. */r.a=class{constructor(h,w,C){let T;if('function'==typeof C)T=C;else{T=(S)=>{const{batch:E}=S;h.execute(C,{batch:E})}}h.document.on('change',(P,S,E)=>{if('insert'!=S)return;const O=E.range.getItems().next().value;if(!(O instanceof u.a))return;const V=O.textNode,R=V.data;if('paragraph'!==V.parent.name||!R)return;const F=w.exec(R);F&&h.document.enqueueChanges(()=>{const N=h.document.batch(),M=d.a.createFromParentsAndOffsets(V.parent,0,V.parent,F[0].length);N.remove(M),T({batch:N,match:F})})})}}},function(o,r,s){'use strict';function d(w){return Array.from(w.getChildren()).reduce((C,T)=>C+T.data,'')}var u=s(110),f=s(100);/**
  407. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  408. * For licensing, see LICENSE.md.
  409. */r.a=class{constructor(w,C,T){this.editor=w;let P,S,E,O;C instanceof RegExp?P=C:E=C,'string'==typeof T?S=T:O=T,E=E||((V)=>{let R,F=[],N=[];for(;null!==(R=P.exec(V))&&!(R&&4>R.length);){let{index:M,1:I,2:L,3:D}=R;M+=R[0].length-(I+L+D).length;const z=[M,M+I.length],$=[M+I.length+L.length,M+I.length+L.length+D.length];F.push(z),F.push($),N.push([M+I.length,M+I.length+L.length])}return{remove:F,format:N}}),O=O||((V,R)=>{for(let F of R)V.setAttribute(F,S,!0)}),w.document.on('change',(V,R)=>{if('insert'!==R)return;const F=this.editor.document.selection;if(!F.isCollapsed||!F.focus||!F.focus.parent)return;const N=F.focus.parent,M=d(N).slice(0,F.focus.offset),I=E(M),L=[];I.format.forEach((z)=>{void 0===z[0]||void 0===z[1]||L.push(u.a.createFromParentsAndOffsets(N,z[0],N,z[1]))});const D=[];if(I.remove.slice().reverse().forEach((z)=>{void 0===z[0]||void 0===z[1]||D.push(u.a.createFromParentsAndOffsets(N,z[0],N,z[1]))}),!(L.length&&D.length))return;const q=w.document.batch();w.document.enqueueChanges(()=>{const z=s.i(f.a)(S,L,w.document.schema);O(q,z);for(let $ of D)q.remove($)})})}}},function(o,r,s){'use strict';var d=s(63),u=s(318);/**
  410. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  411. * For licensing, see LICENSE.md.
  412. */class f extends d.a{constructor(h){super(h),this.domEventType=['paste','copy','cut']}onDomEvent(h){this.fire(h.type,h,{dataTransfer:new u.a(h.clipboardData)})}}r.a=f},function(o,r){'use strict';/**
  413. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  414. * For licensing, see LICENSE.md.
  415. */r.a=class{constructor(u){this._native=u}getData(u){return this._native.getData(u)}setData(u,f){this._native.setData(u,f)}}},function(o,r){'use strict';r.a=/**
  416. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  417. * For licensing, see LICENSE.md.
  418. */function(u){return u.replace(/<span class="Apple-converted-space">(\s+)<\/span>/g,(f,h)=>{return 1==h.length?' ':h})}},function(o,r){'use strict';r.a=/**
  419. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  420. * For licensing, see LICENSE.md.
  421. */function(u){return u=u.replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/\n\n/g,'</p><p>').replace(/\n/g,' ').replace(/^\s/,'&nbsp;').replace(/\s$/,'&nbsp;').replace(/\s\s/g,' &nbsp;'),-1<u.indexOf('</p><p>')&&(u=`<p>${u}</p>`),u}},function(o,r,s){'use strict';var d=s(66);/**
  422. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  423. * For licensing, see LICENSE.md.
  424. */class u extends d.a{constructor(f){super(),this.editor=f}set(f,h){if('string'==typeof h){const w=h;h=()=>{this.editor.execute(w)}}super.set(f,h)}listenTo(f){this._listener.listenTo(f,'keydown',(h,w)=>{const C=this.press(w);C&&w.preventDefault()})}}r.a=u},function(o,r,s){'use strict';var d=s(7),u=s(408),f=s(324),h=s(521),w=s(327),C=s(342),T=s(0),P=s(4);/**
  425. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  426. * For licensing, see LICENSE.md.
  427. */class S{constructor(E){const O=this.constructor.build&&this.constructor.build.plugins;this.config=new u.a(E,this.constructor.build&&this.constructor.build.config),this.config.define('plugins',O),this.plugins=new f.a(this,O),this.commands=new Map,this.locale=new h.a(this.config.get('lang')),this.t=this.locale.t,this.document=new C.a,this.data=new w.a(this.document)}initPlugins(){function O(F,N){return F.reduce((M,I)=>{return M.then(I[N].bind(I))},Promise.resolve())}const V=this,R=this.config;return function(){return V.plugins.load(R.get('plugins')||[])}().then((F)=>{return O(F,'init').then(()=>O(F,'afterInit'))}).then(()=>this.fire('pluginsReady'))}destroy(){return this.fire('destroy'),this.stopListening(),Promise.resolve().then(()=>{this.document.destroy(),this.data.destroy()})}execute(E,O){let V=this.commands.get(E);if(!V)throw new T.a('editor-command-not-found: Specified command has not been added to the editor.');V._execute(O)}static create(E){return new Promise((O)=>{const V=new this(E);O(V.initPlugins().then(()=>{V.fire('dataReady'),V.fire('ready')}).then(()=>V))})}}r.a=S,s.i(P.a)(S,d.a)},function(o,r,s){'use strict';var d=s(322),u=s(321),f=s(329),h=s(411),w=s(419);/**
  428. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  429. * For licensing, see LICENSE.md.
  430. */class C extends d.a{constructor(T,P){super(P),this.element=T,this.editing=new f.a(this.document),this.keystrokes=new u.a(this),this.keystrokes.listenTo(this.editing.view)}destroy(){return Promise.resolve().then(()=>this.keystrokes.destroy()).then(()=>this.editing.destroy()).then(super.destroy())}setData(T){this.data.set(T)}getData(){return this.data.get()}updateEditorElement(){s.i(w.a)(this.element,this.getData())}loadDataFromEditorElement(){this.setData(s.i(h.a)(this.element))}static create(T,P){return new Promise((S)=>{const E=new this(T,P);S(E.initPlugins().then(()=>{E.fire('dataReady'),E.fire('ready')}).then(()=>E))})}}r.a=C},function(o,r,s){'use strict';var d=s(3),u=s(0),f=s(58);/**
  431. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  432. * For licensing, see LICENSE.md.
  433. */class h{constructor(w,C=[]){this._editor=w,this._availablePlugins=new Map,this._plugins=new Map;for(const T of C)this._availablePlugins.set(T,T),T.pluginName&&this._availablePlugins.set(T.pluginName,T)}*[Symbol.iterator](){for(const w of this._plugins)'function'==typeof w[0]&&(yield w)}get(w){return this._plugins.get(w)}load(w,C=[]){function T(q){return L.includes(q)||R.get(q)||N.has(q)?void 0:P(q).catch((z)=>{throw f.a.error('plugincollection-load: It was not possible to load the plugin.',{plugin:q}),z})}function P(q){return new Promise((z)=>{N.add(q),E(q),q.requires&&q.requires.forEach((K)=>{const H=S(K);if(C.includes(H))throw new u.a('plugincollection-required: Cannot load a plugin because one of its dependencies is listed inthe `removePlugins` option.',{plugin:H,requiredBy:q});T(H)});const $=new q(F);R._add(q,$),M.push($),z()})}function S(q){return'function'==typeof q?q:R._availablePlugins.get(q)}function E(q){if(!(q.prototype instanceof d.a))throw new u.a('plugincollection-instance: The loaded plugin module is not an instance of Plugin.',{plugin:q})}function V(q){return q.map((z)=>S(z)).filter((z)=>!!z)}const R=this,F=this._editor,N=new Set,M=[],I=V(w),L=V(C),D=function(q){const z=[];for(const $ of q)S($)||z.push($);return z.length?z:null}(w);if(D){const q='plugincollection-plugin-not-found: Some plugins are not available and could not be loaded.';return f.a.error(q,{plugins:D}),Promise.reject(new u.a(q,{plugins:D}))}return Promise.all(I.map(T)).then(()=>M)}_add(w,C){this._plugins.set(w,C),w.pluginName&&this._plugins.set(w.pluginName,C)}}r.a=h},function(o,r,s){'use strict';var d=s(388),u=s(65),f=s(402);/**
  434. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  435. * For licensing, see LICENSE.md.
  436. */r.a=class{constructor(w,C){this.editor=w,this.view=C,this.componentFactory=new d.a(w),this.focusTracker=new u.a,C.set('width',w.config.get('ui.width')),C.set('height',w.config.get('ui.height')),C.toolbar.bind('isActive').to(this.focusTracker,'isFocused'),C.toolbar.limiterElement=C.element;const T=w.editing.createRoot('div');C.editable.bind('isReadOnly').to(T),C.editable.bind('isFocused').to(w.editing.view),C.editable.name=T.rootName,this.focusTracker.add(C.editableElement)}init(){const w=this.editor;return this.view.init().then(()=>{return this.view.toolbar.fillFromConfig(w.config.get('toolbar'),this.componentFactory)}).then(()=>{s.i(f.a)({origin:w.editing.view,originFocusTracker:this.focusTracker,originKeystrokeHandler:w.keystrokes,toolbar:this.view.toolbar})})}destroy(){return this.view.destroy()}}},function(o,r,s){'use strict';var d=s(395),u=s(394),f=s(403);/**
  437. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  438. * For licensing, see LICENSE.md.
  439. */class h extends d.a{constructor(w){super(w),this.toolbar=new f.a(w),this.editable=new u.a(w),this.top.add(this.toolbar),this.main.add(this.editable)}get editableElement(){return this.editable.element}}r.a=h},function(o,r,s){'use strict';var d=s(4),u=s(7),f=s(159),h=s(161),w=s(101),C=s(337),T=s(335),P=s(116),S=s(2),E=s(1),O=s(331),V=s(328),R=s(332),F=s(330);/**
  440. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  441. * For licensing, see LICENSE.md.
  442. */class N{constructor(M,I){this.model=M,this.processor=I,this.mapper=new f.a,this.modelToView=new h.a(this.model,{mapper:this.mapper}),this.modelToView.on('insert:$text',s.i(w.j)(),{priority:'lowest'}),this.viewToModel=new C.a({schema:M.schema}),this.viewToModel.on('text',s.i(T.a)(),{priority:'lowest'}),this.viewToModel.on('element',s.i(T.b)(),{priority:'lowest'}),this.viewToModel.on('documentFragment',s.i(T.b)(),{priority:'lowest'}),this.on('insertContent',(L,D)=>s.i(O.a)(this,D.content,D.selection,D.batch)),this.on('deleteContent',(L,D)=>s.i(V.a)(D.selection,D.batch,D.options)),this.on('modifySelection',(L,D)=>s.i(R.a)(this,D.selection,D.options)),this.on('getSelectedContent',(L,D)=>{D.content=s.i(F.a)(D.selection)})}get(M='main'){return this.stringify(this.model.getRoot(M))}stringify(M){const I=this.toView(M);return this.processor.toData(I)}toView(M){const I=S.a.createIn(M),L=new P.a;return this.mapper.bindElements(M,L),this.modelToView.convertInsertion(I),this.mapper.clearBindings(),L}set(M,I='main'){const L=this.model.getRoot(I);this.model.enqueueChanges(()=>{this.model.selection.removeAllRanges(),this.model.selection.clearAttributes(),this.model.batch('transparent').remove(S.a.createIn(L)).insert(E.a.createAt(L,0),this.parse(M))})}parse(M,I='$root'){const L=this.processor.toView(M);return this.toModel(L,I)}toModel(M,I='$root'){return this.viewToModel.convert(M,{context:[I]})}destroy(){}insertContent(M,I,L){this.fire('insertContent',{content:M,selection:I,batch:L})}deleteContent(M,I,L){this.fire('deleteContent',{batch:I,selection:M,options:L})}modifySelection(M,I){this.fire('modifySelection',{selection:M,options:I})}getSelectedContent(M){const I={selection:M};return this.fire('getSelectedContent',I),I.content}}r.a=N,s.i(d.a)(N,u.a)},function(o,r,s){'use strict';function u(S,E,O){const V=O.path,R=_Mathmin(E.path.length-1,V.length-1);let F=s.i(P.a)(E.path,V);if('number'==typeof F)for(;F<R;F++){const N=E.path.slice(0,F);N.push(E.path[F]+1);const M=new C.a(O.root,N),I=M.nodeBefore,L=M.nodeAfter;if(!h(I)||!h(L))return;0<L.childCount?S.merge(M):S.remove(L)}}/**
  443. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  444. * For licensing, see LICENSE.md.
  445. */function f(S,E){const O=S.schema.check({name:'$text',inside:E}),V=S.schema.check({name:'paragraph',inside:E});return!O&&V}function h(S){const E=S.document.schema;return!E.objects.has(S.name)&&!E.limits.has(S.name)}var w=s(166),C=s(1),T=s(5),P=s(52);r.a=function(S,E,O={}){if(!S.isCollapsed){const V=S.getFirstRange(),R=V.start,F=w.a.createFromPosition(V.end);if(V.start.isTouching(V.end)||E.remove(V),O.merge&&u(E,R,F),S.collapse(R),f(E.document,R)){const N=new T.a('paragraph');E.insert(R,N),S.collapse(N)}F.detach()}}},function(o,r,s){'use strict';var d=s(350),u=s(159),f=s(161),h=s(101),w=s(334),C=s(160),T=s(7);/**
  446. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  447. * For licensing, see LICENSE.md.
  448. */r.a=class{constructor(S){this.model=S,this.view=new d.a,this.mapper=new u.a,this.modelToView=new f.a(this.model,{mapper:this.mapper,viewSelection:this.view.selection}),this._listener=Object.create(T.a),this._listener.listenTo(this.model,'change',(E,O,V)=>{this.modelToView.convertChange(O,V)},{priority:'low'}),this._listener.listenTo(this.model,'changesDone',()=>{const E=this.model.selection;this.modelToView.convertSelection(E),this.view.render()},{priority:'low'}),this._listener.listenTo(this.model.markers,'add',(E,O)=>{this.modelToView.convertMarker('addMarker',O.name,O.getRange())}),this._listener.listenTo(this.model.markers,'remove',(E,O)=>{this.modelToView.convertMarker('removeMarker',O.name,O.getRange())}),this._listener.listenTo(this.view,'selectionChange',s.i(w.a)(this.model,this.mapper)),this.modelToView.on('insert:$text',s.i(h.j)(),{priority:'lowest'}),this.modelToView.on('remove',s.i(h.k)(),{priority:'low'}),this.modelToView.on('selection',s.i(C.c)(),{priority:'low'}),this.modelToView.on('selection',s.i(C.d)(),{priority:'low'}),this.modelToView.on('selection',s.i(C.e)(),{priority:'low'}),this.modelToView.on('selection',s.i(C.f)(),{priority:'low'})}createRoot(S,E='main'){const O=this.view.createRoot(S,E),V=this.model.getRoot(E);return this.mapper.bindElements(V,O),O}destroy(){this.view.destroy(),this._listener.stopListening()}}},function(o,r,s){'use strict';function u(P){const S=[];Array.from(P.getItems({direction:'backward'})).map((E)=>h.a.createOn(E)).filter((E)=>{const O=(E.start.isAfter(P.start)||E.start.isEqual(P.start))&&(E.end.isBefore(P.end)||E.end.isEqual(P.end));return O}).forEach((E)=>{S.push(E.start.parent),s.i(T.c)(E)}),S.forEach((E)=>{for(let O=E;O.parent&&O.isEmpty;){const V=h.a.createOn(O);O=O.parent,s.i(T.c)(V)}})}/**
  449. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  450. * For licensing, see LICENSE.md.
  451. */var f=s(49),h=s(2),w=s(1),C=s(24),T=s(13);r.a=function(P){const S=new f.a,E=P.getFirstRange();if(!E||E.isCollapsed)return S;const O=E.start.root,V=E.start.getCommonPath(E.end),R=O.getNodeByPath(V);let F=E.start.parent==E.end.parent?E:h.a.createFromParentsAndOffsets(R,E.start.path[V.length],R,E.end.path[V.length]+1);const N=F.end.offset-F.start.offset;for(const M of F.getItems({shallow:!0}))M.is('textProxy')?S.appendChildren(new C.a(M.data,M.getAttributes())):S.appendChildren(M.clone(!0));if(F!=E){const M=E._getTransformedByMove(F.start,w.a.createAt(S,0),N)[0],I=new h.a(w.a.createAt(S),M.start),L=new h.a(M.end,w.a.createAt(S,'end'));u(L),u(I)}return S}},function(o,r,s){'use strict';var u=s(1),f=s(166),h=s(5),w=s(2),C=s(58);/**
  452. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  453. * For licensing, see LICENSE.md.
  454. */r.a=function(P,S,E,O){O||(O=P.model.batch()),E.isCollapsed||P.deleteContent(E,O,{merge:!0});const V=new T(P,O,E.anchor);let R;R=S.is('documentFragment')?S.getChildren():[S],V.handleNodes(R,{isFirst:!0,isLast:!0});const F=V.getSelectionRange();F?E.setRanges([F]):C.a.warn('insertcontent-no-range: Cannot determine a proper selection range after insertion.')};class T{constructor(P,S,E){this.dataController=P,this.batch=S,this.position=E,this.canMergeWith=new Set([this.position.parent]),this.schema=P.model.schema}handleNodes(P,S){P=Array.from(P);for(let E=0;E<P.length;E++){const O=P[E];this._handleNode(O,{isFirst:0===E&&S.isFirst,isLast:E===P.length-1&&S.isLast})}}getSelectionRange(){return this.nodeToSelect?w.a.createOn(this.nodeToSelect):this.dataController.model.getNearestSelectionRange(this.position)}_handleNode(P,S){if(this._checkIsObject(P))return void this._handleObject(P,S);const E=this._checkAndSplitToAllowedPosition(P,S);return E?void(this._insert(P),this._mergeSiblingsOf(P,S)):void this._handleDisallowedNode(P,S)}_handleObject(P,S){this._checkAndSplitToAllowedPosition(P)?this._insert(P):this._tryAutoparagraphing(P,S)}_handleDisallowedNode(P,S){P.is('element')?this.handleNodes(P.getChildren(),S):this._tryAutoparagraphing(P,S)}_insert(P){if(!this._checkIsAllowed(P,[this.position.parent]))return void C.a.error('insertcontent-wrong-position: The node cannot be inserted on the given position.',{node:P,position:this.position});const S=f.a.createFromPosition(this.position);this.batch.insert(this.position,P),this.position=u.a.createFromPosition(S),S.detach(),this.nodeToSelect=this._checkIsObject(P)&&!this.schema.check({name:'$text',inside:[this.position.parent]})?P:null}_mergeSiblingsOf(P,S){if(P instanceof h.a){const E=S.isFirst&&P.previousSibling instanceof h.a&&this.canMergeWith.has(P.previousSibling),O=S.isLast&&P.nextSibling instanceof h.a&&this.canMergeWith.has(P.nextSibling),V=f.a.createBefore(P),R=f.a.createAfter(P);if(E){const F=f.a.createFromPosition(this.position);this.batch.merge(V),this.position=u.a.createFromPosition(F),F.detach()}if(O){let F;this.position.isEqual(R)||C.a.error('insertcontent-wrong-position-on-merge: The insertion position should equal the merge position'),this.position=u.a.createAt(R.nodeBefore,'end'),F=new f.a(this.position.root,this.position.path,'sticksToPrevious'),this.batch.merge(R),this.position=u.a.createFromPosition(F),F.detach()}V.detach(),R.detach()}}_tryAutoparagraphing(P,S){const E=new h.a('paragraph');this._getAllowedIn(E,this.position.parent)&&this._checkIsAllowed(P,[E])&&(E.appendChildren(P),this._handleNode(E,S))}_checkAndSplitToAllowedPosition(P){const S=this._getAllowedIn(P,this.position.parent);if(!S)return!1;for(;S!=this.position.parent;){if(this.schema.limits.has(this.position.parent.name))return!1;if(this.position.isAtStart){const E=this.position.parent;this.position=u.a.createBefore(E),E.isEmpty&&this.batch.remove(E)}else if(this.position.isAtEnd)this.position=u.a.createAfter(this.position.parent);else{const E=u.a.createAfter(this.position.parent);this.batch.split(this.position),this.position=E,this.canMergeWith.add(this.position.nodeAfter)}}return!0}_getAllowedIn(P,S){return this._checkIsAllowed(P,[S])?S:S.parent?this._getAllowedIn(P,S.parent):null}_checkIsAllowed(P,S){return this.schema.check({name:this._getNodeSchemaName(P),attributes:Array.from(P.getAttributeKeys()),inside:S})}_checkIsObject(P){return this.schema.objects.has(this._getNodeSchemaName(P))}_getNodeSchemaName(P){return P.is('text')?'$text':P.name}}},function(o,r,s){'use strict';function u(S,E){if('text'==E.type)return f(S.walker,S.unit);if(E.type==(S.isForward?'elementStart':'elementEnd')){if(S.schema.objects.has(E.item.name))return w.a.createAt(E.item,S.isForward?'after':'before');if(S.schema.check({name:'$text',inside:E.nextPosition}))return E.nextPosition}else{if(S.schema.limits.has(E.item.name))return void S.walker.skip(()=>!0);if(S.schema.check({name:'$text',inside:E.nextPosition}))return E.nextPosition}}/**
  455. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  456. * For licensing, see LICENSE.md.
  457. */function f(S,E){const O=S.position.textNode;if(O){const V=O.data;for(let R=S.position.offset-O.startOffset;s.i(P.a)(V,R)||'character'==E&&s.i(P.b)(V,R);)S.next(),R=S.position.offset-O.startOffset}return S.position}function h(S,E){const O=S.root,V=w.a.createAt(O,E?'end':0);return E?new T.a(S,V):new T.a(V,S)}var w=s(1),C=s(34),T=s(2),P=s(275);r.a=function(S,E,O={}){const V=S.model.schema,R='backward'!=O.direction,F=O.unit?O.unit:'character',N=E.focus,M=new C.a({boundaries:h(N,R),singleCharacters:!0,direction:R?'forward':'backward'}),I={walker:M,schema:V,isForward:R,unit:F};for(let L;L=M.next();){if(L.done)return;const D=u(I,L.value);if(D)return void E.setFocus(D)}}},function(o,r,s){'use strict';var d=s(61);/**
  458. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  459. * For licensing, see LICENSE.md.
  460. */r.a=class{constructor(){this._consumable=new Map,this._textProxyRegistry=new Map}add(f,h){f instanceof d.a&&(f=this._getSymbolForTextProxy(f)),this._consumable.has(f)||this._consumable.set(f,new Map),this._consumable.get(f).set(h,!0)}consume(f,h){return f instanceof d.a&&(f=this._getSymbolForTextProxy(f)),!!this.test(f,h)&&(this._consumable.get(f).set(h,!1),!0)}test(f,h){f instanceof d.a&&(f=this._getSymbolForTextProxy(f));const w=this._consumable.get(f);if(w===void 0)return null;const C=w.get(h);return void 0===C?null:C}revert(f,h){f instanceof d.a&&(f=this._getSymbolForTextProxy(f));const w=this.test(f,h);return!1===w?(this._consumable.get(f).set(h,!0),!0):!0!==w&&null}_getSymbolForTextProxy(f){let h=null;const w=this._textProxyRegistry.get(f.startOffset);if(w){const C=w.get(f.endOffset);C&&(h=C.get(f.parent))}return h||(h=this._addSymbolForTextProxy(f.startOffset,f.endOffset,f.parent)),h}_addSymbolForTextProxy(f,h,w){const C=Symbol();let T,P;return T=this._textProxyRegistry.get(f),T||(T=new Map,this._textProxyRegistry.set(f,T)),P=T.get(h),P||(P=new Map,T.set(h,P)),P.set(w,C),C}}},function(o,r,s){'use strict';var u=s(60);/**
  461. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  462. * For licensing, see LICENSE.md.
  463. */r.a=function(f,h){return(w,C)=>{const T=C.newSelection,P=new u.a,S=[];for(let E of T.getRanges())S.push(h.toModelRange(E));P.setRanges(S,T.isBackward),P.isEqual(f.selection)||f.enqueueChanges(()=>{f.selection.setTo(P)})}}},function(o,r,s){'use strict';/**
  464. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  465. * For licensing, see LICENSE.md.
  466. */var f=s(49),h=s(24),w=s(13);r.b=function(){return(C,T,P,S)=>{if(!T.output&&P.consume(T.input,{name:!0})){const E=S.convertChildren(T.input,P,T);T.output=new f.a(s.i(w.b)(E))}}},r.a=function(){return(C,T,P,S)=>{const E={name:'$text',inside:T.context};S.schema.check(E)&&P.consume(T.input)&&(T.output=new h.a(T.input.data))}}},function(o,r,s){'use strict';var d=s(11),u=s(0);/**
  467. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  468. * For licensing, see LICENSE.md.
  469. */class f{constructor(){this._consumables=new Map}add(w,C){let T;return w.is('text')||w.is('documentFragment')?void this._consumables.set(w,!0):void(this._consumables.has(w)?T=this._consumables.get(w):(T=new h,this._consumables.set(w,T)),T.add(C))}test(w,C){const T=this._consumables.get(w);return void 0===T?null:w.is('text')||w.is('documentFragment')?T:T.test(C)}consume(w,C){return!!this.test(w,C)&&(w.is('text')||w.is('documentFragment')?this._consumables.set(w,!1):this._consumables.get(w).consume(C),!0)}revert(w,C){const T=this._consumables.get(w);T!==void 0&&(w.is('text')||w.is('documentFragment')?this._consumables.set(w,!0):T.revert(C))}static consumablesFromElement(w){const C={name:!0,attribute:[],class:[],style:[]},T=w.getAttributeKeys();for(let E of T)'style'!=E&&'class'!=E&&C.attribute.push(E);const P=w.getClassNames();for(let E of P)C.class.push(E);const S=w.getStyleNames();for(let E of S)C.style.push(E);return C}static createFrom(w,C){if(C||(C=new f),w.is('text'))return C.add(w),C;w.is('element')&&C.add(w,f.consumablesFromElement(w)),w.is('documentFragment')&&C.add(w);for(let T of w.getChildren())C=f.createFrom(T,C);return C}}r.a=f;class h{constructor(){this._canConsumeName=null,this._consumables={attribute:new Map,style:new Map,class:new Map}}add(w){for(let C in w.name&&(this._canConsumeName=!0),this._consumables)C in w&&this._add(C,w[C])}test(w){if(w.name&&!this._canConsumeName)return this._canConsumeName;for(let C in this._consumables)if(C in w){const T=this._test(C,w[C]);if(!0!==T)return T}return!0}consume(w){for(let C in w.name&&(this._canConsumeName=!1),this._consumables)C in w&&this._consume(C,w[C])}revert(w){for(let C in w.name&&(this._canConsumeName=!0),this._consumables)C in w&&this._revert(C,w[C])}_add(w,C){const T=s.i(d.a)(C)?C:[C],P=this._consumables[w];for(let S of T){if('attribute'===w&&('class'===S||'style'===S))throw new u.a('viewconsumable-invalid-attribute: Classes and styles should be handled separately.');P.set(S,!0)}}_test(w,C){const T=s.i(d.a)(C)?C:[C],P=this._consumables[w];for(let S of T)if('attribute'===w&&('class'===S||'style'===S)){const E=this._test(S,[...this._consumables[S].keys()]);if(!0!==E)return E}else{const E=P.get(S);if(E===void 0)return null;if(!E)return!1}return!0}_consume(w,C){const T=s.i(d.a)(C)?C:[C],P=this._consumables[w];for(let S of T)'attribute'===w&&('class'===S||'style'===S)?this._consume(S,[...this._consumables[S].keys()]):P.set(S,!1)}_revert(w,C){const T=s.i(d.a)(C)?C:[C],P=this._consumables[w];for(let S of T)if('attribute'===w&&('class'===S||'style'===S))this._revert(S,[...this._consumables[S].keys()]);else{const E=P.get(S);!1===E&&P.set(S,!0)}}}},function(o,r,s){'use strict';function d(R){const F=new Set,N=new Map,M=new P.a({startPosition:T.a.createAt(R,0),ignoreElementEnd:!0});for(const I of M)'$marker'==I.item.name&&F.add(I.item);for(const I of F){const L=I.getAttribute('data-name'),D=T.a.createBefore(I);N.has(L)?N.get(L).end=T.a.createFromPosition(D):N.set(L,new C.a(T.a.createFromPosition(D))),s.i(O.c)(C.a.createOn(I))}return N}var u=s(336),f=s(7),h=s(4),w=s(57),C=s(2),T=s(1),P=s(34),S=s(59),E=s(49),O=s(13);/**
  470. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  471. * For licensing, see LICENSE.md.
  472. */class V{constructor(R={}){this.conversionApi=s.i(w.a)({},R),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this)}convert(R,F={}){this.fire('viewCleanup',R);const N=u.a.createFrom(R),M=this._convertItem(R,N,F);if(!(M instanceof S.a||M instanceof E.a))return M;let I=M;return I.is('documentFragment')||(I=new E.a([I])),I.markers=d(I),I}_convertItem(R,F,N={}){const M=s.i(w.a)({},N,{input:R,output:null});return R.is('element')?this.fire('element:'+R.name,M,F,this.conversionApi):R.is('text')?this.fire('text',M,F,this.conversionApi):this.fire('documentFragment',M,F,this.conversionApi),M.output}_convertChildren(R,F,N={}){const M=Array.from(R.getChildren()),I=M.map((L)=>this._convertItem(L,F,N));return I.reduce((L,D)=>D?L.concat(D):L,[])}}r.a=V,s.i(h.a)(V,f.a)},function(o,r){'use strict';/**
  473. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  474. * For licensing, see LICENSE.md.
  475. */r.a=class{getHtml(u){const f=document.implementation.createHTMLDocument(''),h=f.createElement('div');return h.appendChild(u),h.innerHTML}}},function(o,r,s){'use strict';/**
  476. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  477. * For licensing, see LICENSE.md.
  478. */var d=s(163),u=s(102),f=s(103),h=s(104),w=s(105),C=s(164),T=s(106),P=s(108),S=s(165),E=s(109)},function(o,r,s){'use strict';function d(H,U){const W=H.clone(),Z=W.operations[0];return Z.oldRange=Z.oldRange.getTransformedByDelta(U)[0],Z.newRange=Z.newRange.getTransformedByDelta(U)[0],[W]}function u(H,U){function W(){const Q=new w.a(H.position.getShiftedBy(Y),H.position.getShiftedBy(X)),ee=new P.a(Q,U.key,J,U.value,0);Z.addOperation(ee)}const Z=new V.a,G=H.nodes;let J=G.getNode(0).getAttribute(U.key),Y=0,X=G.getNode(0).offsetSize;for(let Q=1;Q<G.length;Q++){const ee=G.getNode(Q),te=ee.getAttribute(U.key);te!=J&&(J!=U.value&&W(),J=te,Y=X),X+=ee.offsetSize}return W(),Z}function f(){let H=new O.a;return H.addOperation(new T.a(0)),H}var h=s(107),w=s(2),C=s(1),T=s(74),P=s(73),S=s(37),E=s(112),O=s(20),V=s(163),R=s(102),F=s(341),N=s(103),M=s(104),I=s(106),L=s(165),D=s(109),q=s(108),z=s(164),$=s(105),K=s(52);/**
  479. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  480. * For licensing, see LICENSE.md.
  481. */s.i(h.b)(V.a,L.a,(H,U,W)=>{const Z=s.i(h.c)(H,U,W);return H.range.containsPosition(U.position)&&Z.push(u(U,H)),Z}),s.i(h.b)(V.a,I.a,(H,U,W)=>{const Z=new C.a(U.position.root,U.position.path.slice(0,-1)),G=s.i(h.c)(H,U,W);for(let J of H.operations)if(J.range.containsPosition(Z)||J.range.start.isEqual(Z)){const Y=new V.a,X=Z.getShiftedBy(1),Q=C.a.createFromPosition(X);Q.path.push(0);const ee=U._cloneOperation.nodes.getNode(0).getAttribute(J.key);Y.addOperation(new P.a(new w.a(X,Q),J.key,ee===void 0?null:ee,J.newValue,0)),G.push(Y);break}return G}),s.i(h.b)(R.a,N.a,(H,U,W)=>{return H.position.isEqual(U.position)?[U.getReversed(),H.clone()]:s.i(h.c)(H,U,W)}),s.i(h.b)(F.a,I.a,d),s.i(h.b)(F.a,N.a,d),s.i(h.b)(F.a,D.a,d),s.i(h.b)(F.a,q.a,d),s.i(h.b)(F.a,M.a,d),s.i(h.b)(F.a,z.a,d),s.i(h.b)(M.a,N.a,(H,U,W)=>{const Z=H.sourcePosition.root==U.position.root&&'same'===s.i(K.a)(H.sourcePosition.getParentPath(),U.position.getParentPath()),G=H.sourcePosition.offset<=U.position.offset&&H.sourcePosition.offset+H.howMany>U.position.offset;return Z&&G?[U.getReversed(),H.clone()]:s.i(h.c)(H,U,W)}),s.i(h.b)(N.a,R.a,(H,U,W)=>{return H.position.isEqual(U.position)?[f()]:s.i(h.c)(H,U,W)}),s.i(h.b)(N.a,M.a,(H,U,W)=>{const Z=H.position.root==U.sourcePosition.root&&'same'===s.i(K.a)(H.position.getParentPath(),U.sourcePosition.getParentPath()),G=U.sourcePosition.offset<=H.position.offset&&U.sourcePosition.offset+U.howMany>H.position.offset;return Z&&G?[f()]:s.i(h.c)(H,U,W)}),s.i(h.b)(I.a,I.a,(H,U,W)=>{const Z=H.position.getParentPath(),G=U.position.getParentPath();if('same'==s.i(K.a)(Z,G)){if(H.position.offset==U.position.offset)return[f()];if(H.position.offset<U.position.offset){const J=H.clone();return J._moveOperation.howMany=U.position.offset-H.position.offset,H._cloneOperation instanceof E.a&&U._cloneOperation instanceof E.a&&H._cloneOperation.sourcePosition.offset>U._cloneOperation.sourcePosition.offset&&J._cloneOperation.sourcePosition.offset--,[J]}const J=H.clone();return J._cloneOperation.position.offset++,J._moveOperation.sourcePosition.path[J._moveOperation.sourcePosition.path.length-2]++,J._moveOperation.targetPosition.path[J._moveOperation.targetPosition.path.length-2]++,J._moveOperation.sourcePosition.offset=H.position.offset-U.position.offset,H._cloneOperation instanceof E.a&&U._cloneOperation instanceof E.a&&H._cloneOperation.sourcePosition.offset>U._cloneOperation.sourcePosition.offset&&J._cloneOperation.sourcePosition.offset--,[J]}return s.i(h.c)(H,U,W)}),s.i(h.b)(I.a,q.a,(H,U,W)=>{return'same'===s.i(K.a)(U.position.path,H.position.getParentPath())?[f()]:s.i(h.c)(H,U,W)}),s.i(h.b)(I.a,D.a,(H,U,W)=>{const Z='same'===s.i(K.a)(H.position.getParentPath(),U.range.start.getParentPath()),G=U.range.start.offset<H.position.offset&&U.range.end.offset>=H.position.offset;if(Z&&G)return[f()];if('same'===s.i(K.a)(H.position.getParentPath(),U.range.end.getShiftedBy(-1).path)){const J=H.clone(),Y=C.a.createFromPosition(U.range.start);Y.path.push(U.howMany-1);const X=Y.getShiftedBy(1);J._cloneOperation.position=X;const Q=C.a.createFromPosition(Y);Q.path.push(H.position.offset),J._moveOperation.sourcePosition=Q;const ee=C.a.createFromPosition(X);return ee.path.push(0),J._moveOperation.targetPosition=ee,[J]}return s.i(h.c)(H,U,W)}),s.i(h.b)(I.a,V.a,(H,U)=>{H=H.clone();const W=new C.a(H.position.root,H.position.path.slice(0,-1));if(H._cloneOperation instanceof S.a)for(let Z of U.operations)if(Z.range.containsPosition(W)||Z.range.start.isEqual(W)){null===Z.newValue?H._cloneOperation.nodes.getNode(0).removeAttribute(Z.key):H._cloneOperation.nodes.getNode(0).setAttribute(Z.key,Z.newValue);break}return[H]}),s.i(h.b)(q.a,I.a,(H,U,W)=>{if('same'===s.i(K.a)(H.position.path,U.position.getParentPath())){const Z=[U.getReversed(),H.clone()];return Z[1].operations[1].targetPosition.path[0]++,Z}return s.i(h.c)(H,U,W)}),s.i(h.b)(L.a,V.a,(H,U)=>{const W=[H.clone()];return U.range.containsPosition(H.position)&&W.push(u(H,U)),W}),s.i(h.b)(D.a,I.a,(H,U,W)=>{const Z='same'===s.i(K.a)(H.range.start.getParentPath(),U.position.getParentPath()),G=H.range.start.offset<U.position.offset&&H.range.end.offset>=U.position.offset;if(Z&&G)return[U.getReversed(),H.clone()];if('same'===s.i(K.a)(U.position.getParentPath(),H.range.end.getShiftedBy(-1).path)){const J=H.clone();return J._insertOperation.position.offset++,J._moveOperation.howMany++,J._moveOperation.targetPosition.path[J._moveOperation.targetPosition.path.length-2]++,[J]}return s.i(h.c)(H,U,W)}),s.i(h.b)(z.a,I.a,(H,U,W)=>{const Z=new C.a(U.position.root,U.position.path.slice(0,-1)),G=s.i(h.c)(H,U,W);if(H.operations[0].position.isEqual(Z)){const J=H.clone();J.operations[0].position=H.operations[0].position.getShiftedBy(1),G.push(J)}return G}),s.i(h.b)(I.a,z.a,(H,U)=>{H=H.clone();const W=new C.a(H.position.root,H.position.path.slice(0,-1));return H._cloneOperation instanceof S.a&&U.operations[0].position.isEqual(W)&&(H._cloneOperation.nodes.getNode(0).name=U.operations[0].newName),[H]}),s.i(h.b)($.a,I.a,(H,U,W)=>{const Z=s.i(h.c)(H,U,W),G=U._cloneOperation.position;for(let J of Z)for(let Y of J.operations){const X=Y.sourcePosition.getShiftedBy(Y.howMany);X.isEqual(G)&&(Y.howMany+=1)}return Z}),s.i(h.b)(I.a,$.a,(H,U,W)=>{U=U.clone();const Z=H._cloneOperation.position;for(let G of U.operations){const J=G.sourcePosition.getShiftedBy(G.howMany);J.isEqual(Z)&&(G.howMany+=1)}return s.i(h.c)(H,U,W)})},function(o,r,s){'use strict';function d(P,S,E,O){const V=P.document,R=new T,F=new w.a(S,E,O,V.markers,V.version);P.addDelta(R),R.addOperation(F),V.applyOperation(F)}var u=s(20),f=s(18),h=s(17),w=s(111),C=s(0);/**
  482. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  483. * For licensing, see LICENSE.md.
  484. */class T extends u.a{get type(){return'marker'}get _reverseDeltaClass(){return T}static get className(){return'engine.model.delta.MarkerDelta'}}r.a=T,s.i(h.b)('setMarker',function(P,S){const E='string'==typeof P?P:P.name,O=this.document.markers.get(E);if(!S&&!O)throw new C.a('batch-setMarker-no-range: Range parameter is required when adding a new marker.');const V=O?O.getRange():null;return S?d(this,E,V,S):d(this,E,null,V),this}),s.i(h.b)('removeMarker',function(P){const S='string'==typeof P?P:P.name;if(!this.document.markers.has(S))throw new C.a('batch-removeMarker-no-marker: Trying to remove marker that does not exist.');const E=this.document.markers.get(S).getRange();return d(this,S,E,null),this}),f.a.register(T)},function(o,r,s){'use strict';function d(z){const $=z.textNode;if($){const K=$.data,H=z.offset-$.startOffset;return!s.i(L.a)(K,H)&&!s.i(L.b)(K,H)}return!0}function*u(z,$){for(let K=!1;!K;){if(K=!0,z){const H=z.next();H.done||(K=!1,yield{walker:z,value:H.value})}if($){const H=$.next();H.done||(K=!1,yield{walker:$,value:H.value})}}}var f=s(339),h=s(340),w=s(2),C=s(1),T=s(348),P=s(17),S=s(343),E=s(344),O=s(349),V=s(34),R=s(345),F=s(95),N=s(7),M=s(0),I=s(4),L=s(275);/**
  485. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  486. * For licensing, see LICENSE.md.
  487. */const D='$graveyard';class q{constructor(){this.version=0,this.schema=new O.a,this.history=new S.a(this),this.markers=new R.a,this.selection=new E.a(this),this._pendingChanges=[],this.roots=new Map,this.selection.on('change:range',()=>{for(let z of this.selection.getRanges())if(!this._validateSelectionRange(z))throw new M.a('document-selection-wrong-position: Range from document selection starts or ends at incorrect position.',{range:z})}),this.createRoot('$root',D)}get graveyard(){return this.getRoot(D)}applyOperation(z){if(z.baseVersion!==this.version)throw new M.a('model-document-applyOperation-wrong-version: Only operations with matching versions can be applied.',{operation:z});let $=z._execute();this.version++,this.history.addDelta(z.delta),$&&this.fire('change',z.type,$,z.delta.batch,z.delta.type)}batch(z){return new P.a(this,z)}createRoot(z='$root',$='main'){if(this.roots.has($))throw new M.a('model-document-createRoot-name-exists: Root with specified name already exists.',{name:$});const K=new T.a(this,z,$);return this.roots.set($,K),K}destroy(){this.selection.destroy(),this.stopListening()}enqueueChanges(z){if(this._pendingChanges.push(z),1==this._pendingChanges.length){for(;this._pendingChanges.length;)this._pendingChanges[0](),this._pendingChanges.shift();this.fire('changesDone')}}getRoot(z='main'){if(!this.roots.has(z))throw new M.a('model-document-getRoot-root-not-exist: Root with specified name does not exist.',{name:z});return this.roots.get(z)}hasRoot(z){return this.roots.has(z)}getRootNames(){return Array.from(this.roots.keys()).filter((z)=>z!=D)}getNearestSelectionRange(z,$='both'){if(this.schema.check({name:'$text',inside:z}))return new w.a(z);let K,H;('both'==$||'backward'==$)&&(K=new V.a({startPosition:z,direction:'backward'})),('both'==$||'forward'==$)&&(H=new V.a({startPosition:z}));for(let U of u(K,H)){const W=U.walker==K?'elementEnd':'elementStart',Z=U.value;if(Z.type==W&&this.schema.objects.has(Z.item.name))return w.a.createOn(Z.item);if(this.schema.check({name:'$text',inside:Z.nextPosition}))return new w.a(Z.nextPosition)}return null}toJSON(){const z=s.i(F.a)(this);return z.selection='[engine.model.LiveSelection]',z}_getDefaultRoot(){for(let z of this.roots.values())if(z!==this.graveyard)return z;return this.graveyard}_getDefaultRange(){const z=this._getDefaultRoot(),$=new C.a(z,[0]),K=this.getNearestSelectionRange($);return K||new w.a($)}_validateSelectionRange(z){return d(z.start)&&d(z.end)}}r.a=q,s.i(I.a)(q,N.a)},function(o,r,s){'use strict';var d=s(0);/**
  488. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  489. * For licensing, see LICENSE.md.
  490. */r.a=class{constructor(){this._deltas=[],this._historyPoints=new Map}addDelta(f){if(0<f.operations.length&&!this._historyPoints.has(f.baseVersion)){const h=this._deltas.length;this._deltas[h]=f,this._historyPoints.set(f.baseVersion,h)}}*getDeltas(f=0,h=_NumberPOSITIVE_INFINITY){if(0!==this._deltas.length){let w=this._getIndex(f);if(-1!=w)for(;w<this._deltas.length;){const C=this._deltas[w++];if(C.baseVersion>=h)break;yield C}}}getDelta(f){let h=this._historyPoints.get(f);if(h===void 0)return null;const w=[];for(h;h<this._deltas.length;h++){const C=this._deltas[h];if(C.baseVersion!=f)break;w.push(C)}return 0===w.length?null:w}removeDelta(f){this.updateDelta(f,[])}updateDelta(f,h){const w=this.getDelta(f);if(null!==w){for(let T of h)T.baseVersion=f;this._deltas.splice(this._getIndex(f),w.length,...h);const C=h.length-w.length;for(let T of this._historyPoints.keys())T>f&&this._historyPoints.set(T,this._historyPoints.get(T)+C)}}_getIndex(f){let h=this._historyPoints.get(f);if(h===void 0){const w=this._deltas[this._deltas.length-1],C=w.baseVersion+w.operations.length;if(0>f||f>=C)return-1;throw new d.a('model-history-wrong-version: Given base version points to the middle of a delta.')}return h}}},function(o,r,s){'use strict';function d(F){return F instanceof C.a||F instanceof w.a?F.getAttributes():null}var u=s(1),f=s(2),h=s(110),w=s(24),C=s(61),T=s(152),P=s(0),S=s(58),E=s(60);/**
  491. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  492. * For licensing, see LICENSE.md.
  493. */const O='selection:',V=new Set(['addAttribute','removeAttribute','changeAttribute','addRootAttribute','removeRootAttribute','changeRootAttribute']);class R extends E.a{constructor(F){super(),this._document=F,this._attributePriority=new Map,this.listenTo(this._document,'change',(N,M)=>{V.has(M)&&this._updateAttributes(!1)})}get isCollapsed(){const F=this._ranges.length;return!(0!==F)||super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().start}get rangeCount(){return this._ranges.length?this._ranges.length:1}destroy(){for(let F=0;F<this._ranges.length;F++)this._ranges[F].detach();this.stopListening()}*getRanges(){this._ranges.length?yield*super.getRanges():yield this._document._getDefaultRange()}getFirstRange(){return super.getFirstRange()||this._document._getDefaultRange()}getLastRange(){return super.getLastRange()||this._document._getDefaultRange()}addRange(F,N=!1){super.addRange(F,N),this.refreshAttributes()}removeAllRanges(){super.removeAllRanges(),this.refreshAttributes()}setRanges(F,N=!1){super.setRanges(F,N),this.refreshAttributes()}setAttribute(F,N){if(this.isCollapsed&&0===this.anchor.parent.childCount&&this._storeAttribute(F,N),this._setAttribute(F,N)){this.fire('change:attribute',{attributeKeys:[F],directChange:!0})}}removeAttribute(F){if(this.isCollapsed&&0===this.anchor.parent.childCount&&this._removeStoredAttribute(F),this._removeAttribute(F)){this.fire('change:attribute',{attributeKeys:[F],directChange:!0})}}setAttributesTo(F){F=s.i(T.a)(F),this.isCollapsed&&0===this.anchor.parent.childCount&&this._setStoredAttributesTo(F);const N=this._setAttributesTo(F);if(0<N.size){const M=Array.from(N);this.fire('change:attribute',{attributeKeys:M,directChange:!0})}}clearAttributes(){this.setAttributesTo([])}refreshAttributes(){this._updateAttributes(!0)}static createFromSelection(F){const N=new this(F._document);return N.setTo(F),N}_popRange(){this._ranges.pop().detach()}_pushRange(F){const N=this._prepareRange(F);N&&this._ranges.push(N)}_prepareRange(F){if(!(F instanceof f.a))throw new P.a('model-selection-added-not-range: Trying to add an object that is not an instance of Range.');if(F.root==this._document.graveyard)return void S.a.warn('model-selection-range-in-graveyard: Trying to add a Range that is in the graveyard root. Range rejected.');this._checkRange(F);const N=h.a.createFromRange(F);return this.listenTo(N,'change',(M,I)=>{N.root==this._document.graveyard&&this._fixGraveyardSelection(N,I),this.fire('change:range',{directChange:!1})}),N}_updateAttributes(F){const N=s.i(T.a)(this._getSurroundingAttributes()),M=s.i(T.a)(this.getAttributes());if(F)this._attributePriority=new Map,this._attrs=new Map;else for(let[L,D]of this._attributePriority)'low'==D&&(this._attrs.delete(L),this._attributePriority.delete(L));this._setAttributesTo(N,!1);const I=[];for(let[L,D]of this.getAttributes())M.has(L)&&M.get(L)===D||I.push(L);for(let[L]of M)this.hasAttribute(L)||I.push(L);0<I.length&&this.fire('change:attribute',{attributeKeys:I,directChange:!1})}static _getStoreAttributeKey(F){return O+F}_setAttribute(F,N,M=!0){const I=M?'normal':'low';if('low'==I&&'normal'==this._attributePriority.get(F))return!1;const L=super.getAttribute(F);return L!==N&&(this._attrs.set(F,N),this._attributePriority.set(F,I),!0)}_removeAttribute(F,N=!0){const M=N?'normal':'low';return'low'==M&&'normal'==this._attributePriority.get(F)?!1:!!super.hasAttribute(F)&&(this._attrs.delete(F),this._attributePriority.set(F,M),!0)}_setAttributesTo(F,N=!0){const M=new Set;for(let[I,L]of this.getAttributes())F.get(I)!==L&&this._removeAttribute(I,N)&&M.add(I);for(let[I,L]of F){const D=this._setAttribute(I,L,N);D&&M.add(I)}return M}*_getStoredAttributes(){const F=this.getFirstPosition().parent;if(this.isCollapsed&&0===F.childCount)for(let N of F.getAttributeKeys())if(0===N.indexOf(O)){const M=N.substr(O.length);yield[M,F.getAttribute(N)]}}_removeStoredAttribute(F){const N=R._getStoreAttributeKey(F);this._document.batch().removeAttribute(this.anchor.parent,N)}_storeAttribute(F,N){const M=R._getStoreAttributeKey(F);this._document.batch().setAttribute(this.anchor.parent,M,N)}_setStoredAttributesTo(F){const N=this.anchor.parent,M=this._document.batch();for(let[I]of this._getStoredAttributes()){const L=R._getStoreAttributeKey(I);M.removeAttribute(N,L)}for(let[I,L]of F){const D=R._getStoreAttributeKey(I);M.setAttribute(N,D,L)}}_getSurroundingAttributes(){const F=this.getFirstPosition();let N=null;if(!this.isCollapsed){const M=this.getFirstRange();for(let I of M)'text'==I.type&&null==N&&(N=I.item.getAttributes())}else{const M=F.textNode?F.textNode:F.nodeBefore,I=F.textNode?F.textNode:F.nodeAfter;if(N=d(M),N||(N=d(I)),!N)for(let L=M;L&&!N;)L=L.previousSibling,N=d(L);if(!N)for(let L=I;L&&!N;)L=L.nextSibling,N=d(L);N||(N=this._getStoredAttributes())}return N}_fixGraveyardSelection(F,N){const M=F.start.path,I=N.start.path.length-(M.length-2),L=N.start.path.slice(0,I);L[L.length-1]-=M[1];const D=new u.a(N.root,L);let q=this._document.getNearestSelectionRange(D);q||(q=new f.a(new u.a(D.root,[0])));const z=this._prepareRange(q),$=this._ranges.indexOf(F);F.detach(),this._ranges.splice($,1,z)}}r.a=R},function(o,r,s){'use strict';var d=s(110),u=s(1),f=s(2),h=s(7),w=s(0),C=s(4);/**
  494. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  495. * For licensing, see LICENSE.md.
  496. */class T{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(S){return this._markers.has(S)}get(S){return this._markers.get(S)||null}set(S,E){const O=S instanceof P?S.name:S,V=this._markers.get(O);if(V){const N=V.getRange();if(N.isEqual(E))return V;this.remove(O)}const R=d.a.createFromRange(E),F=new P(O,R);return this._markers.set(O,F),this.fire('add',F),F}remove(S){const E=S instanceof P?S.name:S,O=this._markers.get(E);return!!O&&(this._markers.delete(E),this.fire('remove',O),this._destroyMarker(O),!0)}*getMarkersAtPosition(S){for(let E of this)E.getRange().containsPosition(S)&&(yield E)}destroy(){for(let S of this._markers.values())this._destroyMarker(S);this._markers=null,this.stopListening()}*getMarkersGroup(S){for(let E of this._markers.values())E.name.startsWith(S+':')&&(yield E)}_destroyMarker(S){S.stopListening(),S._liveRange.detach(),S._liveRange=null}}r.a=T,s.i(C.a)(T,h.a);class P{constructor(S,E){this.name=S,this._liveRange=E,this._liveRange.delegate('change').to(this)}getStart(){if(!this._liveRange)throw new w.a('marker-destroyed: Operating on destroyed marker instance.');return u.a.createFromPosition(this._liveRange.start)}getEnd(){if(!this._liveRange)throw new w.a('marker-destroyed: Operating on destroyed marker instance.');return u.a.createFromPosition(this._liveRange.end)}getRange(){if(!this._liveRange)throw new w.a('marker-destroyed: Operating on destroyed marker instance.');return f.a.createFromRange(this._liveRange)}}s.i(C.a)(P,h.a)},function(o,r,s){'use strict';var d=s(73),u=s(37),f=s(111),h=s(28),w=s(74),C=s(33),T=s(112),P=s(38),S=s(113),E=s(114);/**
  497. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  498. * For licensing, see LICENSE.md.
  499. */const O={};O[d.a.className]=d.a,O[u.a.className]=u.a,O[f.a.className]=f.a,O[h.a.className]=h.a,O[w.a.className]=w.a,O[C.a.className]=C.a,O[T.a.className]=T.a,O[P.a.className]=P.a,O[S.a.className]=S.a,O[E.a.className]=E.a;r.a=class{static fromJSON(R,F){return O[R.__className].fromJSON(R,F)}}},function(o,r,s){'use strict';function u(I){return[I.clone()]}function f(I,L){for(let D=0;D<L.length;D++)L[D].baseVersion=I+D+1;return L}function h(I,L){return null===I.targetPosition._getTransformedByDeletion(L.sourcePosition,L.howMany)}function w(I){return 0===I.length?null:1==I.length?I[0]:(I[0].end=I[I.length-1].end,I[0])}var C=s(37),T=s(73),P=s(114),S=s(113),E=s(111),O=s(28),V=s(38),R=s(74),F=s(2),N=s(52);/**
  500. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  501. * For licensing, see LICENSE.md.
  502. */r.a=function(I,L,D){let q,z;I instanceof C.a?q=M.InsertOperation:I instanceof T.a?q=M.AttributeOperation:I instanceof P.a?q=M.RootAttributeOperation:I instanceof S.a?q=M.RenameOperation:I instanceof E.a?q=M.MarkerOperation:I instanceof O.a?q=M.MoveOperation:z=u,q&&(L instanceof C.a?z=q.InsertOperation:L instanceof T.a?z=q.AttributeOperation:L instanceof P.a?z=q.RootAttributeOperation:L instanceof S.a?z=q.RenameOperation:L instanceof E.a?z=q.MarkerOperation:L instanceof O.a?z=q.MoveOperation:z=u);let $=z(I,L,D);return f(I.baseVersion,$)};const M={InsertOperation:{InsertOperation(I,L,D){const q=I.clone();return q.position=q.position._getTransformedByInsertion(L.position,L.nodes.maxOffset,!D),[q]},AttributeOperation:u,RootAttributeOperation:u,RenameOperation:u,MarkerOperation:u,MoveOperation(I,L,D){const q=I.clone();return q.position=I.position._getTransformedByMove(L.sourcePosition,L.targetPosition,L.howMany,!D,L.isSticky),[q]}},AttributeOperation:{InsertOperation(I,L){const D=I.range._getTransformedByInsertion(L.position,L.nodes.maxOffset,!0,!1);return D.reverse().map((q)=>{return new T.a(q,I.key,I.oldValue,I.newValue,I.baseVersion)})},AttributeOperation(I,L,D){if(I.key===L.key){let q=I.range.getDifference(L.range).map(($)=>{return new T.a($,I.key,I.oldValue,I.newValue,I.baseVersion)});const z=I.range.getIntersection(L.range);return z&&(D?q.push(new T.a(z,L.key,L.newValue,I.newValue,I.baseVersion)):0===q.length&&q.push(new R.a(0))),q}return[I.clone()]},RootAttributeOperation:u,RenameOperation:u,MarkerOperation:u,MoveOperation(I,L){const D=F.a.createFromPositionAndShift(L.sourcePosition,L.howMany);let q=[];L instanceof V.a&&L._needsHolderElement&&I.range.root==L.targetPosition.root&&I.range.start.path[0]>=L._holderElementOffset&&(I=I.clone(),I.range.start.path[0]++,I.range.end.path[0]++);const z=w(I.range.getDifference(D)),$=I.range.getIntersection(D);return null!==z&&(z.start=z.start._getTransformedByDeletion(L.sourcePosition,L.howMany),z.end=z.end._getTransformedByDeletion(L.sourcePosition,L.howMany),q=z._getTransformedByInsertion(L.getMovedRangeStart(),L.howMany,!0,!1).reverse()),null!==$&&($.start=$.start._getCombined(L.sourcePosition,L.getMovedRangeStart()),$.end=$.end._getCombined(L.sourcePosition,L.getMovedRangeStart()),q.push($)),q.map((K)=>{return new T.a(K,I.key,I.oldValue,I.newValue,I.baseVersion)})}},RootAttributeOperation:{InsertOperation:u,AttributeOperation:u,RootAttributeOperation(I,L,D){return I.root!==L.root||I.key!==L.key||(I.newValue===L.newValue||D)&&I.newValue!==L.newValue?[I.clone()]:[new R.a(I.baseVersion)]},RenameOperation:u,MarkerOperation:u,MoveOperation:u},RenameOperation:{InsertOperation(I,L){const D=I.clone();return D.position=D.position._getTransformedByInsertion(L.position,L.nodes.maxOffset,!0),[D]},AttributeOperation:u,RootAttributeOperation:u,RenameOperation(I,L,D){const q=I.clone();if(I.position.isEqual(L.position))if(D)q.oldName=L.newName;else return[new R.a(I.baseVersion)];return[q]},MarkerOperation:u,MoveOperation(I,L){const D=I.clone(),q=D.position.isEqual(L.sourcePosition);return D.position=D.position._getTransformedByMove(L.sourcePosition,L.targetPosition,L.howMany,!0,q),[D]}},MarkerOperation:{InsertOperation(I,L){const D=I.clone();return D.oldRange&&(D.oldRange=D.oldRange._getTransformedByInsertion(L.position,L.nodes.maxOffset,!1,!1)[0]),D.newRange&&(D.newRange=D.newRange._getTransformedByInsertion(L.position,L.nodes.maxOffset,!1,!1)[0]),[D]},AttributeOperation:u,RootAttributeOperation:u,RenameOperation:u,MarkerOperation(I,L,D){const q=I.clone();if(I.name==L.name)if(D)q.oldRange=L.newRange;else return[new R.a(I.baseVersion)];return[q]},MoveOperation(I,L){const D=I.clone();if(D.oldRange){const q=D.oldRange._getTransformedByMove(L.sourcePosition,L.targetPosition,L.howMany);D.oldRange=F.a.createFromRanges(q)}if(D.newRange){const q=D.newRange._getTransformedByMove(L.sourcePosition,L.targetPosition,L.howMany);D.newRange=F.a.createFromRanges(q)}return[D]}},MoveOperation:{InsertOperation(I,L,D){let q=F.a.createFromPositionAndShift(I.sourcePosition,I.howMany);q=q._getTransformedByInsertion(L.position,L.nodes.maxOffset,!1,I.isSticky)[0];let z=new I.constructor(q.start,q.end.offset-q.start.offset,I instanceof V.a?I.baseVersion:I.targetPosition._getTransformedByInsertion(L.position,L.nodes.maxOffset,!D),I instanceof V.a?void 0:I.baseVersion);return z.isSticky=I.isSticky,z._holderElementOffset=I._holderElementOffset,[z]},AttributeOperation:u,RootAttributeOperation:u,RenameOperation:u,MarkerOperation:u,MoveOperation(I,L,D){if(h(I,L)&&h(L,I))return[L.getReversed()];if(I instanceof V.a&&L instanceof V.a){const J=I.targetPosition.path[0],Y=L.targetPosition.path[0];J>=Y&&D&&(I=I.clone(),I.targetPosition.path[0]++)}I instanceof V.a&&!(L instanceof V.a)?D=!0:!(I instanceof V.a)&&L instanceof V.a&&(D=!1);const q=F.a.createFromPositionAndShift(I.sourcePosition,I.howMany),z=F.a.createFromPositionAndShift(L.sourcePosition,L.howMany);let $=[],K=w(q.getDifference(z));K&&(K.start=K.start._getTransformedByMove(L.sourcePosition,L.targetPosition,L.howMany,!I.isSticky,!1),K.end=K.end._getTransformedByMove(L.sourcePosition,L.targetPosition,L.howMany,I.isSticky,!1),$.push(K));const H=q.getIntersection(z);let U=s.i(N.a)(I.sourcePosition.getParentPath(),L.sourcePosition.getParentPath()),W=q.containsPosition(L.targetPosition)||q.start.isEqual(L.targetPosition)&&I.isSticky||q.end.isEqual(L.targetPosition)&&I.isSticky,Z=z.containsRange(q)&&(z.containsPosition(I.targetPosition)||z.start.isEqual(I.targetPosition)||z.end.isEqual(I.targetPosition));if(null!==H&&('extension'===U||'same'===U&&D||Z)&&!W&&(H.start=H.start._getCombined(L.sourcePosition,L.getMovedRangeStart()),H.end=H.end._getCombined(L.sourcePosition,L.getMovedRangeStart()),K&&q.start.isBefore(z.start)?$.push(H):$.unshift(H)),0===$.length)return I instanceof V.a?(I=I.clone(),I.howMany=0,I.sourcePosition=L.targetPosition,[I]):[new R.a(I.baseVersion)];let G=I.targetPosition._getTransformedByMove(L.sourcePosition,L.targetPosition,L.howMany,!D,L.isSticky||Z);return $.reverse().map((J)=>{let Y=new I.constructor(J.start,J.end.offset-J.start.offset,I instanceof V.a?I.baseVersion:G,I instanceof V.a?void 0:I.baseVersion);return Y.isSticky=I.isSticky,Y._holderElementOffset=I._holderElementOffset,Y})}}}},function(o,r,s){'use strict';var d=s(5);/**
  503. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  504. * For licensing, see LICENSE.md.
  505. */class u extends d.a{constructor(f,h,w='main'){super(h),this._doc=f,this.rootName=w}get document(){return this._doc}is(f,h){return h?'rootElement'==f&&h==this.name||super.is(f,h):'rootElement'==f||super.is(f)}toJSON(){return this.rootName}}r.a=u},function(o,r,s){'use strict';function d(E,O,V){for(let R=V.length-1,F=O.length-1;0<=R&&0<=F;){const N=O[F];if(!E.hasItem(N))return!1;const M=E._extensionChains.get(N);if(M.includes(V[R]))R--,F--;else return!1}return!0}var u=s(1),f=s(5),h=s(95),w=s(11),C=s(149),T=s(0);/**
  506. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  507. * For licensing, see LICENSE.md.
  508. */class P{constructor(){this.objects=new Set,this.limits=new Set,this._items=new Map,this._extensionChains=new Map,this.registerItem('$root'),this.registerItem('$block'),this.registerItem('$inline'),this.registerItem('$text','$inline'),this.allow({name:'$block',inside:'$root'}),this.allow({name:'$inline',inside:'$block'}),this.registerItem('$clipboardHolder','$root'),this.allow({name:'$inline',inside:'$clipboardHolder'})}allow(E){this._getItem(E.name).allow(P._normalizeQueryPath(E.inside),E.attributes)}disallow(E){this._getItem(E.name).disallow(P._normalizeQueryPath(E.inside),E.attributes)}requireAttributes(E,O){this._getItem(E).requireAttributes(O)}check(E){if(!this.hasItem(E.name))return!1;s.i(w.a)(E.attributes)?0===E.attributes.length&&E.attributes.push(void 0):E.attributes=[E.attributes];const O=P._normalizeQueryPath(E.inside),V=this._extensionChains.get(E.name).map((R)=>{return this._getItem(R)});if(!this._getItem(E.name)._checkRequiredAttributes(E.attributes))return!1;for(let R of E.attributes)for(let F of V)if(F._hasMatchingPath('disallow',O,R))return!1;for(let R of E.attributes){let F=!1;for(let N of V)if(N._hasMatchingPath('allow',O,R)){F=!0;break}if(!F)return!1}return!0}hasItem(E){return this._items.has(E)}registerItem(E,O){if(this.hasItem(E))throw new T.a('model-schema-item-exists: Item with specified name already exists in schema.');if(!!O&&!this.hasItem(O))throw new T.a('model-schema-no-item: Item with specified name does not exist in schema.');this._items.set(E,new S(this));const V=this.hasItem(O)?this._extensionChains.get(O).concat(E):[E];this._extensionChains.set(E,V)}itemExtends(E,O){if(!this.hasItem(E)||!this.hasItem(O))throw new T.a('model-schema-no-item: Item with specified name does not exist in schema.');const V=this._extensionChains.get(E);return V.some((R)=>R==O)}_getItem(E){if(!this.hasItem(E))throw new T.a('model-schema-no-item: Item with specified name does not exist in schema.');return this._items.get(E)}static _normalizeQueryPath(E){let O=[];if(s.i(w.a)(E))for(let V of E)V instanceof f.a?O.push(V.name):s.i(C.a)(V)&&O.push(V);else if(E instanceof u.a){for(let V=E.parent;null!==V;)O.push(V.name),V=V.parent;O.reverse()}else s.i(C.a)(E)&&(O=E.split(' '));return O}}r.a=P;class S{constructor(E){this._schema=E,this._allowed=[],this._disallowed=[],this._requiredAttributes=[]}allow(E,O){this._addPath('_allowed',E,O)}disallow(E,O){this._addPath('_disallowed',E,O)}requireAttributes(E){this._requiredAttributes.push(E)}_addPath(E,O,V){O=O.slice(),s.i(w.a)(V)||(V=[V]);for(let R of V)this[E].push({path:O,attribute:R})}_getPaths(E,O){const V='allow'===E?this._allowed:this._disallowed,R=[];for(let F of V)F.attribute===O&&R.push(F.path);return R}_checkRequiredAttributes(E){let O=!0;for(let V of this._requiredAttributes){O=!0;for(let R of V)if(-1==E.indexOf(R)){O=!1;break}if(O)break}return O}_hasMatchingPath(E,O,V){const R=this._getPaths(E,V);for(const F of R)if(d(this._schema,O,F))return!0;return!1}toJSON(){const E=s.i(h.a)(this);return E._schema='[model.Schema]',E}}},function(o,r,s){'use strict';var d=s(77),u=s(357),f=s(167),h=s(171),w=s(62),C=s(58),T=s(170),P=s(356),S=s(353),E=s(354),O=s(352),V=s(4),R=s(32);/**
  509. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  510. * For licensing, see LICENSE.md.
  511. */class F{constructor(){this.domRoots=new Map,this.selection=new d.a,this.domConverter=new f.a,this.roots=new Map,this.set('isFocused',!1),this.renderer=new u.a(this.domConverter,this.selection),this.renderer.bind('isFocused').to(this,'isFocused'),this._observers=new Map,this.addObserver(T.a),this.addObserver(P.a),this.addObserver(S.a),this.addObserver(E.a),this.addObserver(O.a),s.i(w.h)(this),this.on('render',()=>{this.disableObservers(),this.renderer.render(),this.enableObservers()})}addObserver(N){let M=this._observers.get(N);if(M)return M;M=new N(this),this._observers.set(N,M);for(let[I,L]of this.domRoots)M.observe(L,I);return M.enable(),M}getObserver(N){return this._observers.get(N)}createRoot(N,M='main'){const I='string'==typeof N?N:N.tagName,L=new h.a(I.toLowerCase(),M);return L.document=this,this.roots.set(M,L),L.on('change:children',(D,q)=>this.renderer.markToSync('children',q)),L.on('change:attributes',(D,q)=>this.renderer.markToSync('attributes',q)),L.on('change:text',(D,q)=>this.renderer.markToSync('text',q)),this.domConverter.isElement(N)&&this.attachDomRoot(N,M),L}attachDomRoot(N,M='main'){const I=this.getRoot(M);this.domRoots.set(M,N),this.domConverter.bindElements(N,I),this.renderer.markToSync('children',I),this.renderer.domDocuments.add(N.ownerDocument);for(let L of this._observers.values())L.observe(N,M)}getRoot(N='main'){return this.roots.get(N)}getDomRoot(N='main'){return this.domRoots.get(N)}render(){this.fire('render')}focus(){if(!this.isFocused){const N=this.selection.editableElement;N?(this.domConverter.focus(N),this.render()):C.a.warn('view-focus-no-selection: There is no selection in any editable to focus.')}}disableObservers(){for(let N of this._observers.values())N.disable()}enableObservers(){for(let N of this._observers.values())N.enable()}destroy(){for(let N of this._observers.values())N.destroy()}}r.a=F,s.i(V.a)(F,R.a)},function(o,r,s){'use strict';var d=s(63);/**
  512. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  513. * For licensing, see LICENSE.md.
  514. */class u extends d.a{constructor(f){super(f),this.domEventType='click'}onDomEvent(f){this.fire(f.type,f)}}r.a=u},function(o,r,s){'use strict';function d(T){return T==h.b.arrowright||T==h.b.arrowleft||T==h.b.arrowup||T==h.b.arrowdown}var u=s(50),f=s(77),h=s(22),w=s(143);/**
  515. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  516. * For licensing, see LICENSE.md.
  517. */class C extends u.a{constructor(T){super(T),this._fireSelectionChangeDoneDebounced=s.i(w.a)((P)=>this.document.fire('selectionChangeDone',P),200)}observe(){const T=this.document;T.on('keydown',(P,S)=>{const E=T.selection;E.isFake&&d(S.keyCode)&&this.isEnabled&&(S.preventDefault(),this._handleSelectionMove(S.keyCode))},{priority:'lowest'})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(T){const P=this.document.selection,S=f.a.createFromSelection(P);S.setFake(!1),(T==h.b.arrowleft||T==h.b.arrowup)&&S.collapseToStart(),(T==h.b.arrowright||T==h.b.arrowdown)&&S.collapseToEnd();const E={oldSelection:P,newSelection:S,domSelection:null};this.document.fire('selectionChange',E),this._fireSelectionChangeDoneDebounced(E)}}r.a=C},function(o,r,s){'use strict';var d=s(63);/**
  518. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  519. * For licensing, see LICENSE.md.
  520. */class u extends d.a{constructor(f){super(f),this.domEventType=['focus','blur'],this.useCapture=!0,f.on('focus',()=>{f.isFocused=!0,this._renderTimeoutId=setTimeout(()=>f.render(),0)}),f.on('blur',(h,w)=>{const C=f.selection.editableElement;(null===C||C===w.target)&&(f.isFocused=!1,f.render())})}onDomEvent(f){this.fire(f.type,f)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}r.a=u},function(o,r,s){'use strict';var d=s(63),u=s(22);/**
  521. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  522. * For licensing, see LICENSE.md.
  523. */class f extends d.a{constructor(h){super(h),this.domEventType='keydown'}onDomEvent(h){this.fire('keydown',h,{keyCode:h.keyCode,altKey:h.altKey,ctrlKey:h.ctrlKey||h.metaKey,shiftKey:h.shiftKey,get keystroke(){return s.i(u.c)(this)}})}}r.a=f},function(o,r,s){'use strict';var d=s(63);/**
  524. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  525. * For licensing, see LICENSE.md.
  526. */class u extends d.a{constructor(f){super(f),this.domEventType='mousedown'}onDomEvent(f){this.fire(f.type,f)}}r.a=u},function(o,r,s){'use strict';var d=s(50),u=s(170),f=s(58),h=s(143);/**
  527. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  528. * For licensing, see LICENSE.md.
  529. */class w extends d.a{constructor(C){super(C),this.mutationObserver=C.getObserver(u.a),this.document=C,this.selection=C.selection,this.domConverter=C.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=s.i(h.a)((T)=>this.document.fire('selectionChangeDone',T),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),2e3)}observe(C){const T=C.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(C){if(this.isEnabled&&this.document.isFocused){this.mutationObserver.flush();const T=C.defaultView.getSelection(),P=this.domConverter.domSelectionToView(T);if(!this.selection.isEqual(P)){if(this._isInfiniteLoop(P))return void f.a.warn('selectionchange-infinite-loop: Selection change observer detected an infinite rendering loop.');const S={oldSelection:this.selection,newSelection:P,domSelection:T};this.document.fire('selectionChange',S),this._fireSelectionChangeDoneDebounced(S)}}}_isInfiniteLoop(C){return this._lastSelection&&this._lastButOneSelection&&(C.isEqual(this._lastSelection)||C.isEqual(this._lastButOneSelection))?this._loopbackCounter++:(this._lastButOneSelection=this._lastSelection,this._lastSelection=C,this._loopbackCounter=0),!!(50<this._loopbackCounter)}_clearInfiniteLoop(){this._lastSelection=null,this._lastButOneSelection=null,this._loopbackCounter=0}}r.a=w},function(o,r,s){'use strict';var d=s(30),u=s(25),f=s(62),h=s(4),w=s(188),C=s(414),T=s(418),P=s(32),S=s(0);/**
  530. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  531. * For licensing, see LICENSE.md.
  532. */class E{constructor(O,V){this.domDocuments=new Set,this.domConverter=O,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=V,this._inlineFiller=null,this.isFocused=!1,this._fakeSelectionContainer=null}markToSync(O,V){if('text'===O)this.domConverter.getCorrespondingDom(V.parent)&&this.markedTexts.add(V);else{if(!this.domConverter.getCorrespondingDom(V))return;if('attributes'===O)this.markedAttributes.add(V);else if('children'===O)this.markedChildren.add(V);else throw new S.a('view-renderer-unknown-type: Unknown type passed to Renderer.markToSync.')}}render(){let O;this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?O=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(O=this.selection.getFirstPosition(),this.markedChildren.add(O.parent));for(let V of this.markedTexts)!this.markedChildren.has(V.parent)&&this.domConverter.getCorrespondingDom(V.parent)&&this._updateText(V,{inlineFillerPosition:O});for(let V of this.markedAttributes)this._updateAttrs(V);for(let V of this.markedChildren)this._updateChildren(V,{inlineFillerPosition:O});this._updateSelection(),this._updateFocus(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear(),this._inlineFiller=this._getInlineFillerNode(O)}_getInlineFillerNode(O){if(!O)return void(this._inlineFiller=null);const V=this.domConverter.viewPositionToDom(O);if(!V||!s.i(f.c)(V.parent))throw new S.a('view-renderer-cannot-find-filler: Cannot find filler node by its position.');return V.parent}_getInlineFillerPosition(){const O=this.selection.getFirstPosition();return O.parent.is('text')?u.a.createBefore(this.selection.getFirstPosition().parent):O}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const O=this.selection.getFirstPosition(),V=this.domConverter.viewPositionToDom(O);return V&&this.domConverter.isText(V.parent)&&s.i(f.c)(V.parent)}_removeInlineFiller(){const O=this._inlineFiller;if(!s.i(f.c)(O))throw new S.a('view-renderer-filler-was-lost: The inline filler node was lost.');s.i(f.f)(O)?O.parentNode.removeChild(O):O.data=O.data.substr(f.d),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const O=this.selection.getFirstPosition(),V=O.parent,R=O.offset;if(!this.domConverter.getCorrespondingDomElement(V.root))return!1;if(!V.is('element'))return!1;if(R===V.getFillerOffset())return!1;const F=O.nodeBefore,N=O.nodeAfter;return F instanceof d.a||N instanceof d.a?!1:!0}_updateText(O,V){const R=this.domConverter.getCorrespondingDom(O),F=this.domConverter.viewToDom(O,R.ownerDocument),N=R.data;let M=F.data;const I=V.inlineFillerPosition;I&&I.parent==O.parent&&I.offset==O.index&&(M=f.i+M),N!=M&&(R.data=M)}_updateAttrs(O){const V=this.domConverter.getCorrespondingDom(O),R=Array.from(V.attributes).map((N)=>N.name),F=O.getAttributeKeys();for(let N of F)V.setAttribute(N,O.getAttribute(N));for(let N of R)O.hasAttribute(N)||V.removeAttribute(N)}_updateChildren(O,V){function R($,K){if($===K)return!0;return F.isText($)&&F.isText(K)?$.data===K.data:s.i(f.e)($,F.blockFiller)&&s.i(f.e)(K,F.blockFiller)}const F=this.domConverter,N=F.getCorrespondingDom(O);if(N){const M=N.ownerDocument,I=V.inlineFillerPosition,L=N.childNodes,D=Array.from(F.viewChildrenToDom(O,M,{bind:!0}));if(I&&I.parent==O){const $=D[I.offset];this.domConverter.isText($)?$.data=f.i+$.data:D.splice(I.offset,0,M.createTextNode(f.i))}const q=s.i(w.a)(L,D,R);let z=0;for(let $ of q)'insert'===$?(s.i(C.a)(N,z,D[z]),z++):'delete'===$?(this.domConverter.unbindDomElement(L[z]),s.i(T.a)(L[z])):z++}}_updateSelection(){if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const O=this.domConverter.getCorrespondingDomElement(this.selection.editableElement);this.isFocused&&O&&(this.selection.isFake?this._updateFakeSelection(O):(this._removeFakeSelection(),this._updateDomSelection(O)))}_updateFakeSelection(O){const V=O.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=V.createElement('div'),this._fakeSelectionContainer.style.position='fixed',this._fakeSelectionContainer.style.top=0,this._fakeSelectionContainer.style.left='-9999px',this._fakeSelectionContainer.appendChild(V.createTextNode('\xA0'))),this._fakeSelectionContainer.parentElement||O.appendChild(this._fakeSelectionContainer);const R=this.selection.fakeSelectionLabel||'\xA0';this._fakeSelectionContainer.firstChild.data=R;const F=V.getSelection();F.removeAllRanges();const N=new Range;N.selectNodeContents(this._fakeSelectionContainer),F.addRange(N),this.domConverter.bindFakeSelection(this._fakeSelectionContainer,this.selection)}_updateDomSelection(O){const V=O.ownerDocument.defaultView.getSelection(),R=V&&this.domConverter.domSelectionToView(V);if(!(R&&this.selection.isEqual(R))){const F=this.domConverter.viewPositionToDom(this.selection.anchor),N=this.domConverter.viewPositionToDom(this.selection.focus);V.collapse(F.parent,F.offset),V.extend(N.parent,N.offset)}}_removeDomSelection(){for(let O of this.domDocuments){const V=O.getSelection();if(V.rangeCount){const R=O.activeElement,F=this.domConverter.getCorrespondingViewElement(R);R&&F&&O.getSelection().removeAllRanges()}}}_removeFakeSelection(){const O=this._fakeSelectionContainer;O&&O.remove()}_updateFocus(){if(this.isFocused){const O=this.selection.editableElement;O&&this.domConverter.focus(O)}}}r.a=E,s.i(h.a)(E,P.a)},function(o,r,s){'use strict';var d=s(0);/**
  533. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  534. * For licensing, see LICENSE.md.
  535. */class u{constructor(f,h,w){if(this.textNode=f,0>h||h>f.data.length)throw new d.a('view-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.');if(0>w||h+w>f.data.length)throw new d.a('view-textproxy-wrong-length: Given length value is incorrect.');this.data=f.data.substring(h,h+w),this.offsetInText=h}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(f){return'textProxy'==f}getAncestors(f={includeNode:!1,parentFirst:!1}){const h=[];for(let w=f.includeNode?this.textNode:this.parent;null!==w;)h[f.parentFirst?'push':'unshift'](w),w=w.parent;return h}}r.a=u},function(o,r,s){'use strict';function d(C,T,P,S){const E=P.isCollapsed,O=P.getFirstRange(),V=O.start.parent,R=O.end.parent;if(!(S.limits.has(V.name)||S.limits.has(R.name))){if(V.root==V)return void(E||C.deleteContent(P,T));if(E)u(T,P,O.start);else{const F=O.start.isAtStart&&O.end.isAtEnd;C.deleteContent(P,T,{merge:F}),F||(V==R?u(T,P,P.focus):P.collapse(R))}}}function u(C,T,P){if(P.isAtEnd){const S=P.parent,E=new S.constructor(S.name,S.getAttributes());C.insert(h.a.createAfter(P.parent),E)}else C.split(P);T.collapse(P.parent.nextSibling)}var f=s(12),h=s(1);/**
  536. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  537. * For licensing, see LICENSE.md.
  538. */class w extends f.a{_doExecute(){const C=this.editor.document,T=C.batch();C.enqueueChanges(()=>{d(this.editor.data,T,C.selection,C.schema),this.fire('afterExecute',{batch:T})})}}r.a=w},function(o,r,s){'use strict';var d=s(50),u=s(117),f=s(22);/**
  539. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  540. * For licensing, see LICENSE.md.
  541. */class h extends d.a{constructor(w){super(w),w.on('keydown',(C,T)=>{this.isEnabled&&T.keyCode==f.b.enter&&w.fire('enter',new u.a(w,T.domEvent))})}observe(){}}r.a=h},function(o,r,s){'use strict';var d=s(2),u=s(12),f=s(60);/**
  542. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  543. * For licensing, see LICENSE.md.
  544. */class h extends u.a{constructor(w,C){super(w),Object.assign(this,C),this.set('value',!1),this.listenTo(w.document,'changesDone',()=>this._updateValue())}_doExecute(w={}){const C=this.editor,T=C.document,P=this.value;T.enqueueChanges(()=>{const S=w.batch||T.batch();for(let E of T.selection.getSelectedBlocks())if(!P)E.is(this.modelElement)||S.rename(E,this.modelElement);else if(E.is(this.modelElement)){const O=new f.a;O.addRange(d.a.createIn(E)),C.execute('paragraph',{selection:O,batch:S})}})}_updateValue(){const w=this.editor.document.selection.getSelectedBlocks().next().value;w&&(this.value=w.is(this.modelElement))}}r.a=h},function(o,r,s){'use strict';/**
  545. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  546. * For licensing, see LICENSE.md.
  547. */function f(T,P,S,E){const O=T.name.split(':'),V=O[0]+':'+O[1];if(S.consume(P.item,V)){const R=E.mapper.toViewElement(P.item),F=R.getChild(0);'removeAttribute'==O[0]?F.removeAttribute(P.attributeKey):F.setAttribute(P.attributeKey,P.attributeNewValue)}}var h=s(5),w=s(1),C=s(13);r.b=function(){return(T,P,S,E)=>{const O=P.input;if(S.test(O,{name:!0,class:'image'})&&E.schema.check({name:'image',inside:P.context,attributes:'src'})){const V=O.getChild(0);if(V&&'img'==V.name&&S.test(V,{name:!0,attribute:'src'})){S.consume(O,{name:!0,class:'image'}),S.consume(V,{name:!0,attribute:'src'});const R=new h.a('image',{src:V.getAttribute('src')});S.consume(V,{attribute:['alt']})&&R.setAttribute('alt',V.getAttribute('alt')),P.context.push(R);const F=E.convertChildren(O,S,P),N=w.a.createAt(R,'end');C.a.insert(N,F),P.context.pop(),P.output=R}}}},r.a=function(T,P){for(let S of T)S.on(`addAttribute:${P}:image`,f),S.on(`changeAttribute:${P}:image`,f),S.on(`removeAttribute:${P}:image`,f)}},function(o,r,s){'use strict';function d(D,q,z,$){if('insert'===q){const K=new T.a({boundaries:z.range,ignoreElementEnd:!0});for(let H of K){const U=H.item;'elementStart'==H.type&&s.i(M.b)(U)&&!s.i(I.c)(U)&&$.document.enqueueChanges(()=>{$.insert(R.a.createAt(U,'end'),new P.a('caption'))})}}}function u(D,q){return(z,$)=>{if(h($.item)){const K=$.item.parent,H=K.parent,U=q.toViewElement(H);let W=q.toViewElement(K);U&&!W&&(W=D(),w(W,K,U,q))}}}function f(D){return(q,z,$,K)=>{const H=z.item;if(s.i(M.b)(H.parent)&&0<H.childCount){if(!$.consume(z.item,'insert'))return;const U=K.mapper.toViewElement(z.range.start.parent),W=D instanceof E.a?D.clone(!0):D();w(W,z.item,U,K.mapper)}}}function h(D){return!!(D.parent&&'caption'==D.parent.name&&D.parent.parent&&'image'==D.parent.parent.name)}function w(D,q,z,$){const K=F.a.createAt(z,'end');V.a.insert(K,D),$.bindElements(q,D)}var C=s(3),T=s(34),P=s(5),S=s(39),E=s(21),O=s(29),V=s(78),R=s(1),F=s(25),N=s(48),M=s(40),I=s(364);/**
  548. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  549. * For licensing, see LICENSE.md.
  550. */class L extends C.a{init(){const D=this.editor,q=D.document,z=D.editing.view,$=q.schema,K=D.data,H=D.editing,U=H.mapper;this._createCaption=s.i(I.a)(z),$.registerItem('caption'),$.allow({name:'$inline',inside:'caption'}),$.allow({name:'caption',inside:'image'}),$.limits.add('caption'),q.on('change',d),s.i(N.a)().for(K.viewToModel).from(I.b).toElement('caption'),K.modelToView.on('insert:caption',f(new S.a('figcaption'))),H.modelToView.on('insert:caption',f(this._createCaption)),H.modelToView.on('insert',u(this._createCaption,U),{priority:'high'}),this.listenTo(z,'render',()=>this._updateView(),{priority:'high'})}_removeEmptyCaption(){const D=this.editor.editing.view.selection,q=this._lastSelectedEditable;if(!q)return;if(D.editableElement===q)return;const z=D.getSelectedElement();if(z&&s.i(M.a)(z)){const $=q.findAncestor((K)=>K==z);if($)return}if(0===q.childCount){const $=this.editor.editing.mapper;V.a.remove(O.a.createOn(q)),$.unbindViewElement(q)}}_addCaptionWhenSelected(){const D=this.editor.editing,q=D.view.selection,z=q.getSelectedElement(),$=D.mapper;if(z&&s.i(M.a)(z)){const K=$.toModelElement(z),H=s.i(I.c)(K);let U=$.toViewElement(H);U||(U=this._createCaption(),w(U,H,z,$)),this._lastSelectedEditable=U}}_updateView(){const D=this.editor.editing.view.selection;this._removeEmptyCaption(),this._addCaptionWhenSelected();const q=D.editableElement;q&&s.i(I.d)(D.editableElement)&&(this._lastSelectedEditable=D.editableElement)}}r.a=L},function(o,r,s){'use strict';var w=s(75),C=s(5);r.a=function(P){return()=>{const S=new w.a('figcaption',{contenteditable:!0});return S.document=P,S.setCustomProperty(T,!0),S.on('change:isFocused',(E,O,V)=>{V?S.addClass('focused'):S.removeClass('focused')}),S}},r.d=function(P){return!!P.getCustomProperty(T)},r.c=function(P){for(let S of P.getChildren())if(S instanceof C.a&&'caption'==S.name)return S;return null},r.b=function(P){const S=P.parent;return'figcaption'==P.name&&S&&'figure'==S.name&&S.hasClass('image')?{name:!0}:null};/**
  551. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  552. * For licensing, see LICENSE.md.
  553. */const T=Symbol('imageCaption')},function(o,r,s){'use strict';/**
  554. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  555. * For licensing, see LICENSE.md.
  556. */function f(P,S,E,O){const V=S.input,R=S.output;if(E.test(V,{class:P.className})&&s.i(T.b)(R)){const F=[...R.getAttributeKeys(),'imageStyle'];O.schema.check({name:'image',inside:S.context,attributes:F})&&(E.consume(V,{class:P.className}),R.setAttribute('imageStyle',P.value))}}function h(P,S){for(let E of S)if(E.value===P)return E}function w(P,S,E){return S&&('changeAttribute'==P||'removeAttribute'==P)&&(E.removeClass(S.className),!0)}function C(P,S,E){return S&&('addAttribute'==P||'changeAttribute'==P)&&(E.addClass(S.className),!0)}var T=s(40);r.a=function(P){return(S,E,O,V)=>{const R=S.name.split(':')[0],F=R+':imageStyle';if(O.test(E.item,F)){const N=h(E.attributeNewValue,P),M=h(E.attributeOldValue,P),I=V.mapper.toViewElement(E.item);(w(R,M,I)||C(R,N,I))&&O.consume(E.item,F)}}},r.b=function(P){const S=P.filter((E)=>null!==E.value);return(E,O,V,R)=>{for(let F of S)f(F,O,V,R)}}},function(o,r,s){'use strict';var d=s(12),u=s(40);/**
  557. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  558. * For licensing, see LICENSE.md.
  559. */class f extends d.a{constructor(h,w){super(h),this.set('value',!1),this.style=w,this.listenTo(h.document,'changesDone',()=>{this._updateValue(),this.refreshState()})}_updateValue(){const h=this.editor.document,w=h.selection.getSelectedElement();return w?void(null===this.style.value?this.value=!w.hasAttribute('imageStyle'):this.value=w.getAttribute('imageStyle')==this.style.value):void(this.value=!1)}_checkEnabled(){const h=this.editor.document.selection.getSelectedElement();return s.i(u.b)(h)}_doExecute(h={}){if(this.value)return;const w=this.editor,C=w.document,T=C.selection,P=T.getSelectedElement();C.enqueueChanges(()=>{const S=h.batch||C.batch();S.setAttribute(P,'imageStyle',this.style.value)})}}r.a=f},function(o,r,s){'use strict';var d=s(3),u=s(366),f=s(174),h=s(365),w=s(300),C=s.n(w),T=s(301),P=s.n(T);/**
  560. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  561. * For licensing, see LICENSE.md.
  562. */class S extends d.a{static get requires(){return[f.a]}init(){const E=this.editor,O=E.t,V=E.document,R=V.schema,F=E.data,N=E.editing;E.config.define('image.styles',[{name:'imageStyleFull',title:O('Full size image'),icon:C.a,value:null},{name:'imageStyleSide',title:O('Side image'),icon:P.a,value:'side',className:'image-style-side'}]);const M=E.config.get('image.styles');R.allow({name:'image',attributes:'imageStyle',inside:'$root'});const I=s.i(h.a)(M);N.modelToView.on('addAttribute:imageStyle:image',I),F.modelToView.on('addAttribute:imageStyle:image',I),N.modelToView.on('changeAttribute:imageStyle:image',I),F.modelToView.on('changeAttribute:imageStyle:image',I),N.modelToView.on('removeAttribute:imageStyle:image',I),F.modelToView.on('removeAttribute:imageStyle:image',I),F.viewToModel.on('element:figure',s.i(h.b)(M),{priority:'low'});for(let L of M)E.commands.set(L.name,new u.a(E,L))}}r.a=S},function(o,r,s){'use strict';var d=s(3),u=s(26),f=s(370),h=s(387),w=s(181),C=s(153),T=s(371),P=s(175),S=s(299),E=s.n(S),O=s(311),V=s.n(O);/**
  563. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  564. * For licensing, see LICENSE.md.
  565. */class R extends d.a{static get requires(){return[f.a]}init(){this._createButton();const F=this.editor.config.get('image.defaultToolbar');return F&&(F.length&&F.push('|'),F.push('imageTextAlternative')),this._createBalloonPanel().then((N)=>{this.balloonPanel=N,this.form=N.content.get(0)})}_createButton(){const F=this.editor,N=F.commands.get('imageTextAlternative'),M=F.t;F.ui.componentFactory.add('imageTextAlternative',(I)=>{const L=new u.a(I);return L.set({label:M('Change image text alternative'),icon:E.a,tooltip:!0}),L.bind('isEnabled').to(N,'isEnabled'),this.listenTo(L,'execute',()=>this._showBalloonPanel()),L})}_createBalloonPanel(){const F=this.editor,N=new P.a(F),M=new T.a(F.locale);this.listenTo(M,'submit',()=>{F.execute('imageTextAlternative',{newValue:M.lebeledInput.inputView.element.value}),this._hideBalloonPanel()});const I=F.plugins.get(C.a);return I&&this.listenTo(N,'change:isVisible',()=>{N.isVisible?(I.hide(),I.isEnabled=!1):(I.show(),I.isEnabled=!0)}),this.listenTo(M,'cancel',()=>this._hideBalloonPanel()),s.i(h.a)({emitter:N,activator:()=>N.isVisible,callback:()=>this._hideBalloonPanel()}),s.i(w.a)({emitter:N,activator:()=>N.isVisible,contextElement:N.element,callback:()=>this._hideBalloonPanel()}),Promise.all([N.content.add(M),F.ui.view.body.add(N)]).then(()=>N)}_showBalloonPanel(){const F=this.editor,N=F.commands.get('imageTextAlternative');this.form.lebeledInput.value=N.value||'',this.balloonPanel.attach(),this.form.lebeledInput.select()}_hideBalloonPanel(){const F=this.editor;this.balloonPanel.detach(),F.editing.view.focus()}}r.a=R},function(o,r,s){'use strict';var d=s(12),u=s(40);/**
  566. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  567. * For licensing, see LICENSE.md.
  568. */class f extends d.a{constructor(h){super(h),this.set('value',!1),this.listenTo(h.document,'changesDone',()=>{this._updateValue(),this.refreshState()})}_updateValue(){const h=this.editor.document,w=h.selection.getSelectedElement();this.value=s.i(u.b)(w)&&w.hasAttribute('alt')&&w.getAttribute('alt')}_checkEnabled(){const h=this.editor.document.selection.getSelectedElement();return s.i(u.b)(h)}_doExecute(h){const w=this.editor,C=w.document,T=C.selection.getSelectedElement();C.enqueueChanges(()=>{const P=h.batch||C.batch();P.setAttribute(T,'alt',h.newValue)})}}r.a=f},function(o,r,s){'use strict';var d=s(369),u=s(3);/**
  569. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  570. * For licensing, see LICENSE.md.
  571. */class f extends u.a{init(){this.editor.commands.set('imageTextAlternative',new d.a(this.editor))}}r.a=f},function(o,r,s){'use strict';var d=s(9),u=s(26),f=s(6),h=s(184),w=s(183),C=s(182);/**
  572. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  573. * For licensing, see LICENSE.md.
  574. */class T extends d.a{constructor(P){super(P);const S=this.locale.t;this.lebeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(S('Save')),this.saveButtonView.type='submit',this.cancelButtonView=this._createButton(S('Cancel'),'cancel'),f.a.extend(this.saveButtonView.template,{attributes:{class:['ck-button-action']}}),this.template=new f.a({tag:'form',attributes:{class:['cke-text-alternative-form']},children:[this.lebeledInput,{tag:'div',attributes:{class:['cke-text-alternative-form__actions']},children:[this.saveButtonView,this.cancelButtonView]}]}),s.i(C.a)({view:this})}_createButton(P,S){const E=new u.a(this.locale);return E.label=P,E.withText=!0,S&&E.delegate('execute').to(this,S),E}_createLabeledInputView(){const P=this.locale.t,S=new h.a(this.locale,w.a);return S.label=P('Text alternative'),S}}r.a=T},function(o,r,s){'use strict';function d(N){return N==R.b.arrowright||N==R.b.arrowleft||N==R.b.arrowup||N==R.b.arrowdown}function u(N){return N==R.b.delete||N==R.b.backspace}function f(N){for(;N;){if(N instanceof E.a&&!(N instanceof O.a))return!0;N=N.parent}return!1}var h=s(3),w=s(176),C=s(355),T=s(2),P=s(60),S=s(5),E=s(75),O=s(171),V=s(118),R=s(22);/**
  575. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  576. * For licensing, see LICENSE.md.
  577. */class F extends h.a{static get requires(){return[w.a]}init(){const N=this.editor.editing.view;N.addObserver(C.a),this.listenTo(N,'mousedown',(...M)=>this._onMousedown(...M)),this.listenTo(N,'keydown',(...M)=>this._onKeydown(...M),{priority:'high'})}_onMousedown(N,M){const I=this.editor,L=I.editing.view;let D=M.target;if(f(D))return;if(!s.i(V.b)(D)&&(D=D.findAncestor(V.b),!D))return;M.preventDefault(),L.isFocused||L.focus();const q=I.editing.mapper.toModelElement(D);I.document.enqueueChanges(()=>{this._setSelectionOverElement(q)})}_onKeydown(N,M){const I=M.keyCode,L=I==R.b.delete||I==R.b.arrowdown||I==R.b.arrowright;(u(I)&&this._handleDelete(L)||d(I)&&this._handleArrowKeys(L))&&(M.preventDefault(),N.stop())}_handleDelete(N){const M=this.editor.document,I=M.selection;if(!I.isCollapsed)return;const L=this._getObjectElementNextToSelection(N);if(L)return M.enqueueChanges(()=>{const D=I.anchor.parent;if(D.isEmpty){const q=M.batch();q.remove(D)}this._setSelectionOverElement(L)}),!0}_handleArrowKeys(N){const M=this.editor.document,I=M.schema,L=M.selection,D=L.getSelectedElement();if(D&&I.objects.has(D.name)){const z=N?L.getLastPosition():L.getFirstPosition(),$=M.getNearestSelectionRange(z,N?'forward':'backward');return $&&M.enqueueChanges(()=>{L.setRanges([$])}),!0}if(!L.isCollapsed)return;const q=this._getObjectElementNextToSelection(N);if(q instanceof S.a&&M.schema.objects.has(q.name))return M.enqueueChanges(()=>{this._setSelectionOverElement(q)}),!0}_setSelectionOverElement(N){this.editor.document.selection.setRanges([T.a.createOn(N)])}_getObjectElementNextToSelection(N){const M=this.editor.document,I=M.schema,L=M.selection,D=this.editor.data,q=P.a.createFromSelection(L);D.modifySelection(q,{direction:N?'forward':'backward'});const z=N?q.focus.nodeBefore:q.focus.nodeAfter;return z instanceof S.a&&I.objects.has(z.name)?z:null}}r.a=F},function(o,r,s){'use strict';var d=s(12),u=s(24),f=s(2),h=s(100),w=s(157),C=s(177);/**
  578. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  579. * For licensing, see LICENSE.md.
  580. */class T extends d.a{constructor(P){super(P),this.set('value',void 0),this.listenTo(this.editor.document.selection,'change:attribute',()=>{this.value=this.editor.document.selection.getAttribute('linkHref')})}_checkEnabled(){const P=this.editor.document;return s.i(w.a)('linkHref',P.selection,P.schema)}_doExecute(P){const S=this.editor.document,E=S.selection;S.enqueueChanges(()=>{const O=S.batch();if(E.isCollapsed){const V=E.getFirstPosition(),R=V.parent;if(E.hasAttribute('linkHref')){const F=s.i(C.a)(E.getFirstPosition(),E.getAttribute('linkHref'));O.setAttribute(F,'linkHref',P),E.setRanges([F])}else if(S.schema.check({name:'$text',attributes:'linkHref',inside:R.name})){const F=new u.a(P,{linkHref:P});O.insert(V,F),E.setRanges([f.a.createOn(F)])}}else{const V=s.i(h.a)('linkHref',E.getRanges(),S.schema);for(let R of V)O.setAttribute(R,'linkHref',P)}})}}r.a=T},function(o,r,s){'use strict';var d=s(3),u=s(47),f=s(48),h=s(178),w=s(373),C=s(376);/**
  581. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  582. * For licensing, see LICENSE.md.
  583. */class T extends d.a{init(){const P=this.editor,S=P.data,E=P.editing;P.document.schema.allow({name:'$inline',attributes:'linkHref'}),s.i(u.a)().for(S.modelToView,E.modelToView).fromAttribute('linkHref').toElement((O)=>new h.a('a',{href:O})),s.i(f.a)().for(S.viewToModel).fromElement('a').toAttribute((O)=>({key:'linkHref',value:O.getAttribute('href')})),P.commands.set('link',new w.a(P)),P.commands.set('unlink',new C.a(P))}}r.a=T},function(o,r,s){'use strict';var d=s(9),u=s(6),f=s(120),h=s(26),w=s(184),C=s(183),T=s(182),P=s(65),S=s(119),E=s(66);/**
  584. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  585. * For licensing, see LICENSE.md.
  586. */class O extends d.a{constructor(V){super(V);const R=V.t;this.focusTracker=new P.a,this.keystrokes=new E.a,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(R('Save')),this.saveButtonView.type='submit',this.cancelButtonView=this._createButton(R('Cancel'),'cancel'),this.unlinkButtonView=this._createButton(R('Unlink'),'unlink'),this._focusables=new f.a,this._focusCycler=new S.a({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:'shift + tab',focusNext:'tab'}}),u.a.extend(this.saveButtonView.template,{attributes:{class:['ck-button-action']}}),this.template=new u.a({tag:'form',attributes:{class:['ck-link-form']},children:[this.urlInputView,{tag:'div',attributes:{class:['ck-link-form__actions']},children:[this.saveButtonView,this.cancelButtonView,this.unlinkButtonView]}]}),s.i(T.a)({view:this});const F=[this.urlInputView,this.saveButtonView,this.cancelButtonView,this.unlinkButtonView];F.forEach((N)=>{this._focusables.add(N),this.focusTracker.add(N.element)})}init(){return this.keystrokes.listenTo(this.element),super.init()}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const V=this.locale.t,R=new w.a(this.locale,C.a);return R.label=V('Link URL'),R}_createButton(V,R){const F=new h.a(this.locale);return F.label=V,F.withText=!0,R&&F.delegate('execute').to(this,R),F}}r.a=O},function(o,r,s){'use strict';var d=s(12),u=s(177);/**
  587. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  588. * For licensing, see LICENSE.md.
  589. */class f extends d.a{constructor(h){super(h),this.listenTo(h.document.selection,'change:attribute',()=>this.refreshState())}_doExecute(){const h=this.editor.document,w=h.selection;h.enqueueChanges(()=>{const C=w.isCollapsed?[s.i(u.a)(w.getFirstPosition(),w.getAttribute('linkHref'))]:w.getRanges(),T=h.batch();for(let P of C)T.removeAttribute(P,'linkHref')})}_checkEnabled(){return this.editor.document.selection.hasAttribute('linkHref')}}r.a=f},function(o,r,s){'use strict';/**
  590. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  591. * For licensing, see LICENSE.md.
  592. */function R(Y,X,Q){const ee=Y.nodeBefore;let te=Y.nodeAfter;if(te&&'listItem'==te.name){const ae=ee&&ee.is('listItem')?ee.getAttribute('indent')+1:0;let ne=te.getAttribute('indent')-ae;const oe=[];for(;te&&'listItem'==te.name&&te.getAttribute('indent')>ae;){ne>te.getAttribute('indent')&&(ne=te.getAttribute('indent'));const ie=te.getAttribute('indent')-ne;oe.push({item:te,indent:ie}),te=te.nextSibling}0<oe.length&&X.enqueueChanges(()=>{for(let ie of oe.reverse())Q.setAttribute(ie.item,'indent',ie.indent)})}}function F(Y,X,Q,ee){let te=Y[X?'nodeBefore':'nodeAfter'];if(!te)return;const ae=M(te,{checkAllSiblings:!0,getNext:X,sameIndent:!0});if(!ae)return;const ne=ae.getAttribute('indent'),oe=ae.getAttribute('type');0===ne||Q.enqueueChanges(()=>{for(;te&&te.is('listItem')&&te.getAttribute('indent')>=ne;)te.getAttribute('type')!=oe&&te.getAttribute('indent')==ne&&ee.setAttribute(te,'type',oe),te=te[X?'previousSibling':'nextSibling']})}function N(Y,X){const Q='numbered'==Y.getAttribute('type')?'ol':'ul',ee=new z.a,te=new U.a(Q,null);return te.appendChildren(ee),X.bindElements(Y,ee),ee}function M(Y,X){const Q=X.getNext?'nextSibling':'previousSibling',ee=X.getNext?'nodeAfter':'nodeBefore',te=!!X.checkAllSiblings,ae=!!X.sameIndent,ne=!!X.biggerIndent,oe=!!X.smallerIndent,ie=!!X.isMapped,re=Y instanceof $.a?Y.getAttribute('indent'):X.indent;for(let se=Y instanceof $.a?Y[Q]:Y[ee],le;se&&'listItem'==se.name;){if(le=se.getAttribute('indent'),ae&&re==le||ne&&re<le||oe&&re>le){if(!ie||X.mapper.toViewElement(se))return se;se=se[Q];continue}if(!te)return null;se=se[Q]}return null}function I(Y,X){return Y&&X&&('ul'==Y.name||'ol'==Y.name)&&Y.name==X.name?J.a.mergeContainers(W.a.createAfter(Y)):null}function L(Y,X,Q,ee){const te=X.parent;let ae,ne=M(Y,{sameIndent:!0,smallerIndent:!0,checkAllSiblings:!0});if(ne&&ne.getAttribute('indent')==Y.getAttribute('indent')){let ie=Q.toViewElement(ne);ae=J.a.breakContainer(W.a.createAfter(ie))}else ne=Y.previousSibling,ae=ne&&'listItem'==ne.name?ne.getAttribute('indent')<Y.getAttribute('indent')?Q.toViewPosition(K.a.createAt(ne,'end')):ee.parent.is('ul')||ee.parent.is('ol')?J.a.breakContainer(ee):ee:Q.toViewPosition(K.a.createBefore(Y));J.a.insert(ae,te);const oe=M(Y,{biggerIndent:!0,getNext:!0,isMapped:!0,mapper:Q});if(oe){let ie=Q.toViewElement(oe);J.a.breakContainer(W.a.createBefore(ie));const re=W.a.createBefore(ie.parent),se=q(oe),le=Q.toViewElement(se),de=J.a.breakContainer(W.a.createAfter(le)),ce=new Z.a(re,de),ue=W.a.createAt(X,'end');J.a.move(ce,ue)}I(te,te.nextSibling),I(te.previousSibling,te)}function D(Y,X,Q,ee,te){const ae=M(X,{sameIndent:!0,smallerIndent:!0,checkAllSiblings:!0,indent:Y}),ne=ae?ae.getAttribute('indent'):null;let oe;if(!ae)oe=Q;else if(ne==Y){const ie=te.toViewElement(ae).parent;oe=W.a.createAfter(ie)}else{const ie=K.a.createAt(ae,'end');oe=te.toViewPosition(ie)}for(let ie of[...ee.getChildren()])(ie.is('ul')||ie.is('ol'))&&(oe=J.a.move(Z.a.createOn(ie),oe).end,I(ie,ie.nextSibling),I(ie.previousSibling,ie))}function q(Y){const X=Y.getAttribute('indent');let Q=Y;for(;Y.nextSibling&&Y.nextSibling.is('listItem')&&Y.nextSibling.getAttribute('indent')>=X;)Y=Y.nextSibling,Y.getAttribute('indent')==X&&(Q=Y);return Q}var z=s(380),$=s(5),K=s(1),H=s(13),U=s(39),W=s(25),Z=s(29),G=s(51),J=s(78);r.e=function(Y,X,Q,ee){if(Q.test(X.item,'insert')&&Q.test(X.item,'addAttribute:type')&&Q.test(X.item,'addAttribute:indent')){Q.consume(X.item,'insert'),Q.consume(X.item,'addAttribute:type'),Q.consume(X.item,'addAttribute:indent');const te=X.item,ae=N(te,ee.mapper);L(te,ae,ee.mapper)}},r.f=function(Y,X,Q,ee){if(!Q.consume(X.item,'changeAttribute:type'))return;const te=ee.mapper.toViewElement(X.item);J.a.breakContainer(W.a.createBefore(te)),J.a.breakContainer(W.a.createAfter(te));let ae=te.parent;const ne='numbered'==X.attributeNewValue?'ol':'ul';ae=J.a.rename(ae,ne),I(ae,ae.nextSibling),I(ae.previousSibling,ae)},r.g=function(Y,X,Q,ee){if(Q.consume(X.item,'remove')){const te=ee.mapper.toViewPosition(X.sourcePosition),ae=te.nodeAfter.is('li')?te.nodeAfter:te.nodeAfter.getChild(0);J.a.breakContainer(W.a.createBefore(ae)),J.a.breakContainer(W.a.createAfter(ae));const ne=ae.parent,oe=ne.previousSibling,ie=Z.a.createOn(ne);J.a.remove(ie),oe&&oe.nextSibling&&I(oe,oe.nextSibling),D(X.item.getAttribute('indent')+1,X.sourcePosition,ie.start,ae,ee.mapper),'$graveyard'==X.item.root.rootName&&ee.mapper.unbindModelElement(X.item)}},r.i=function(Y,X,Q,ee){if(!Q.consume(X.item,'changeAttribute:indent'))return;const te=ee.mapper.toViewElement(X.item);J.a.breakContainer(W.a.createBefore(te)),J.a.breakContainer(W.a.createAfter(te));const ae=te.parent,ne=ae.previousSibling,oe=Z.a.createOn(ae);J.a.remove(oe);let ie;ne&&ne.nextSibling&&(ie=I(ne,ne.nextSibling)),ie||(ie=oe.start),D(X.attributeOldValue+1,X.range.start,oe.start,te,ee.mapper),L(X.item,te,ee.mapper,ie)},r.d=function(Y,X,Q,ee){if('listItem'!=X.item.name){let te=ee.mapper.toViewPosition(X.range.start);const ae=[];for(;('ul'==te.parent.name||'ol'==te.parent.name)&&(te=J.a.breakContainer(te),'li'==te.parent.name);){const ne=te,oe=W.a.createAt(te.parent,'end');if(!ne.isEqual(oe)){const ie=J.a.remove(new Z.a(ne,oe));ae.push(ie)}te=W.a.createAfter(te.parent)}if(0<ae.length){for(let ne=0;ne<ae.length;ne++){const oe=te.nodeBefore,ie=J.a.insert(te,ae[ne]);if(te=ie.end,0<ne){let re=I(oe,oe.nextSibling);re&&re.parent==oe&&te.offset--}}I(te.nodeBefore,te.nodeAfter)}}},r.h=function(Y,X,Q,ee){if(!X.item.is('listItem')){const te=ee.mapper.toViewPosition(X.sourcePosition),ae=te.nodeBefore,ne=te.nodeAfter;I(ae,ne)}},r.l=function(Y,X,Q,ee){if(Q.consume(X.input,{name:!0})){const te=new $.a('listItem');X.indent=X.indent?X.indent:0;const ae='ul'==X.input.parent.name?'bulleted':'numbered';te.setAttribute('type',ae),te.setAttribute('indent',X.indent),X.context.push(te),X.indent++;let ne=[te];for(let oe of X.input.getChildren()){const ie=ee.convertItem(oe,Q,X);'ul'==oe.name||'ol'==oe.name?ne=ne.concat(Array.from(ie.getChildren())):H.a.insert(K.a.createAt(te,'end'),ie)}X.indent--,X.context.pop(),X.output=ne}},r.j=function(Y,X,Q){if(Q.test(X.input,{name:!0})){const ee=Array.from(X.input.getChildren());for(let te of ee)te.is('li')||te.remove()}},r.k=function(Y,X,Q){if(Q.test(X.input,{name:!0})){if(0===X.input.childCount)return;const ee=[...X.input.getChildren()];let te=!1,ae=!0;for(let ne of ee)!te||ne.is('ul')||ne.is('ol')||ne.remove(),ne.is('text')?(ae&&(ne.data=ne.data.replace(/^\s+/,'')),(!ne.nextSibling||ne.nextSibling.is('ul')||ne.nextSibling.is('ol'))&&(ne.data=ne.data.replace(/\s+$/,''))):(ne.is('ul')||ne.is('ol'))&&(te=!0),ae=!1}},r.b=function(Y,X){const Q=X.modelPosition.nodeBefore;if(Q&&Q.is('listItem')){const ee=X.mapper.toViewElement(Q),te=ee.getAncestors().find((ne)=>ne.is('ul')||ne.is('ol')),ae=new G.a({startPosition:W.a.createAt(ee,0)});for(let ne of ae)if('elementStart'==ne.type&&ne.item.is('li')){X.viewPosition=ne.previousPosition;break}else if('elementEnd'==ne.type&&ne.item==te){X.viewPosition=ne.nextPosition;break}}},r.c=function(Y,X){const Q=X.viewPosition,ee=Q.parent,te=X.mapper;if('ul'==ee.name||'ol'==ee.name){if(!Q.isAtEnd){const ae=te.toModelElement(Q.nodeAfter);X.modelPosition=K.a.createBefore(ae)}else{const ae=te.toModelElement(Q.nodeBefore),ne=te.getModelLength(Q.nodeBefore);X.modelPosition=K.a.createBefore(ae).getShiftedBy(ne)}Y.stop()}else if('li'==ee.name&&Q.nodeBefore&&('ul'==Q.nodeBefore.name||'ol'==Q.nodeBefore.name)){const ae=te.toModelElement(ee);let ne=1,oe=Q.nodeBefore;for(;oe&&(oe.is('ul')||oe.is('ol'));)ne+=te.getModelLength(oe),oe=oe.previousSibling;X.modelPosition=K.a.createBefore(ae).getShiftedBy(ne),Y.stop()}},r.a=function(Y){return(X,Q,ee,te)=>{if('remove'==Q)R(ee.sourcePosition,Y,te),F(ee.sourcePosition,!1,Y,te);else if('move'==Q)R(ee.sourcePosition,Y,te),F(ee.sourcePosition,!1,Y,te),R(ee.range.start,Y,te),F(ee.range.start,!1,Y,te),R(ee.range.end,Y,te),F(ee.range.end,!0,Y,te);else if('rename'==Q&&'listItem'==ee.oldName&&'listItem'!=ee.newName){const ae=ee.element;Y.enqueueChanges(()=>{te.removeAttribute(ae,'indent').removeAttribute(ae,'type')});const ne=K.a.createAfter(ee.element);R(ne,Y,te)}else'insert'==Q&&(R(ee.range.start,Y,te),F(ee.range.start,!1,Y,te),R(ee.range.end,Y,te),F(ee.range.end,!0,Y,te))}}},function(o,r,s){'use strict';var d=s(12),u=s(191);/**
  593. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  594. * For licensing, see LICENSE.md.
  595. */class f extends d.a{constructor(h,w){super(h),this._indentBy='forward'==w?1:-1,this.listenTo(h.document.selection,'change:range',()=>{this.refreshState()}),this.listenTo(h.document,'changesDone',()=>{this.refreshState()})}_doExecute(){const h=this.editor.document,w=h.batch();let C=Array.from(h.selection.getSelectedBlocks());h.enqueueChanges(()=>{const T=C[C.length-1];for(let P=T.nextSibling;P&&'listItem'==P.name&&P.getAttribute('indent')>T.getAttribute('indent');)C.push(P),P=P.nextSibling;0>this._indentBy&&(C=C.reverse());for(let S of C){const E=S.getAttribute('indent')+this._indentBy;if(0>E)w.rename(S,'paragraph');else{if(0<E&&0>this._indentBy){let O=S.previousSibling;for(;O.getAttribute('indent')>E;)O=O.previousSibling;O.getAttribute('type')!=S.getAttribute('type')&&w.setAttribute(S,'type',O.getAttribute('type'))}w.setAttribute(S,'indent',E)}}})}_checkEnabled(){const h=s.i(u.a)(this.editor.document.selection.getSelectedBlocks());if(!h||!h.is('listItem'))return!1;const w=h.previousSibling,C=h.getAttribute('indent'),T=C+this._indentBy;if(0<this._indentBy){if(!w||'listItem'!=w.name)return!1;if(w.getAttribute('indent')+1<T)return!1}return!0}}r.a=f},function(o,r,s){'use strict';function d(C,T,P){const S=T?C[0]:C[C.length-1];if(S.is('listItem'))for(let E=S[T?'previousSibling':'nextSibling'],O=S.getAttribute('indent');E&&E.is('listItem')&&E.getAttribute('indent')>=P;)O>E.getAttribute('indent')&&(O=E.getAttribute('indent')),E.getAttribute('indent')==O&&C[T?'unshift':'push'](E),E=E[T?'previousSibling':'nextSibling']}var u=s(12),f=s(1),h=s(191);/**
  596. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  597. * For licensing, see LICENSE.md.
  598. */class w extends u.a{constructor(C,T){super(C),this.type='bulleted'==T?'bulleted':'numbered',this.set('value',!1);const P=()=>{this.refreshValue(),this.refreshState()};this.listenTo(C.document.selection,'change:range',P),this.listenTo(C.document,'changesDone',P)}refreshValue(){const C=s.i(h.a)(this.editor.document.selection.getSelectedBlocks());this.value=null!==C&&C.getAttribute('type')==this.type}_doExecute(C={}){const T=this.editor.document,P=Array.from(T.selection.getSelectedBlocks()),S=!0===this.value;T.enqueueChanges(()=>{const E=C.batch||T.batch();if(S){let O=P[P.length-1].nextSibling,V=_NumberPOSITIVE_INFINITY,R=[];for(;O&&'listItem'==O.name&&0!==O.getAttribute('indent');){const F=O.getAttribute('indent');F<V&&(V=F);const N=F-V;R.push({element:O,indent:N}),O=O.nextSibling}R=R.reverse();for(let F of R)E.setAttribute(F.element,'indent',F.indent)}if(!S){let O=_NumberPOSITIVE_INFINITY;for(let V of P)V.is('listItem')&&V.getAttribute('indent')<O&&(O=V.getAttribute('indent'));O=0===O?1:O,d(P,!0,O),d(P,!1,O)}for(let O of P.reverse())S&&'listItem'==O.name?E.rename(O,'paragraph'):S||'listItem'==O.name?S||'listItem'!=O.name||O.getAttribute('type')==this.type||E.setAttribute(O,'type',this.type):E.setAttribute(O,'type',this.type).setAttribute(O,'indent',0).rename(O,'listItem')})}_checkEnabled(){if(this.value)return!0;const C=this.editor.document.selection,T=this.editor.document.schema,P=s.i(h.a)(C.getSelectedBlocks());return!!P&&T.check({name:'listItem',attributes:['type','indent'],inside:f.a.createBefore(P)})}}r.a=w},function(o,r,s){'use strict';function d(){const h=!this.isEmpty&&('ul'==this.getChild(0).name||'ol'==this.getChild(0).name);return this.isEmpty||h?0:null}var u=s(39);/**
  599. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  600. * For licensing, see LICENSE.md.
  601. */class f extends u.a{constructor(h,w){super('li',h,w),this.getFillerOffset=d}}r.a=f},function(o,r,s){'use strict';var d=s(12);/**
  602. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  603. * For licensing, see LICENSE.md.
  604. */class u extends d.a{constructor(f){super(f),this.set('value',!1),this.listenTo(f.document,'changesDone',()=>this._updateValue())}_doExecute(f={}){const h=this.editor.document;h.enqueueChanges(()=>{const w=f.batch||h.batch(),C=(f.selection||h.selection).getSelectedBlocks();for(let T of C)T.is('paragraph')||w.rename(T,'paragraph')})}_updateValue(){const f=this.editor.document.selection.getSelectedBlocks().next().value;f&&(this.value=f.is('paragraph'))}}r.a=u},function(o,r,s){'use strict';var d=s(3),u=s(383),f=s(384);/**
  605. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  606. * For licensing, see LICENSE.md.
  607. */class h extends d.a{init(){const w=this.editor,C=w.editing.view;C.addObserver(f.a),w.commands.set('forwardDelete',new u.a(w,'forward')),w.commands.set('delete',new u.a(w,'backward')),this.listenTo(C,'delete',(T,P)=>{w.execute('forward'==P.direction?'forwardDelete':'delete',{unit:P.unit}),P.preventDefault()})}}r.a=h},function(o,r,s){'use strict';var d=s(12),u=s(60),f=s(180),h=s(187);/**
  608. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  609. * For licensing, see LICENSE.md.
  610. */class w extends d.a{constructor(C,T){super(C),this.direction=T,this._buffer=new f.a(C.document,C.config.get('typing.undoStep'))}_doExecute(C={}){const T=this.editor.document,P=this.editor.data;T.enqueueChanges(()=>{this._buffer.lock();const S=u.a.createFromSelection(T.selection);if(S.isCollapsed&&P.modifySelection(S,{direction:this.direction,unit:C.unit}),S.isCollapsed)return;let E=0;S.getFirstRange().getMinimalFlatRanges().forEach((O)=>{E+=s.i(h.a)(O.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),P.deleteContent(S,this._buffer.batch,{merge:!0}),this._buffer.input(E),T.selection.setRanges(S.getRanges(),S.isBackward),this._buffer.unlock()})}}r.a=w},function(o,r,s){'use strict';var d=s(50),u=s(117),f=s(22);/**
  611. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  612. * For licensing, see LICENSE.md.
  613. */class h extends d.a{constructor(w){super(w),w.on('keydown',(C,T)=>{const P={};if(T.keyCode==f.b.delete)P.direction='forward',P.unit='character';else if(T.keyCode==f.b.backspace)P.direction='backward',P.unit='codePoint';else return;P.unit=T.altKey?'word':P.unit,w.fire('delete',new u.a(w,T.domEvent,P))})}observe(){}}r.a=h},function(o,r,s){'use strict';function d(F){return!!F.ctrlKey||R.includes(F.keyCode)}function u(F,N){return F instanceof C.a&&N instanceof C.a?F.data===N.data:F===N}var f=s(3),h=s(2),w=s(25),C=s(30),T=s(188),P=s(409),S=s(22),E=s(386);/**
  614. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  615. * For licensing, see LICENSE.md.
  616. */class O extends f.a{init(){const F=this.editor,N=F.editing.view,M=new E.a(F,F.config.get('typing.undoStep')||20);F.commands.set('input',M),this.listenTo(N,'keydown',(I,L)=>{this._handleKeydown(L,M.buffer)},{priority:'lowest'}),this.listenTo(N,'mutations',(I,L,D)=>{this._handleMutations(L,D)})}_handleKeydown(F,N){const M=this.editor.document;d(F)||M.selection.isCollapsed||(N.lock(),M.enqueueChanges(()=>{this.editor.data.deleteContent(M.selection,N.batch)}),N.unlock())}_handleMutations(F,N){new V(this.editor).handle(F,N)}}r.a=O;class V{constructor(F){this.editor=F,this.editing=this.editor.editing}handle(F,N){for(let M of F)this._handleTextMutation(M,N),this._handleTextNodeInsertion(M)}_handleTextMutation(F,N){if('text'!=F.type)return;const M=F.newText.replace(/\u00A0/g,' '),I=F.oldText.replace(/\u00A0/g,' '),L=s.i(T.a)(I,M);let D=null,q=null;for(let G=0;G<L.length;G++){const J=L[G];'equal'!=J&&(D=null==D?G:D,q=G)}let z=0,$=0;for(let G=D;G<=q;G++)'insert'!=L[G]&&z++,'delete'!=L[G]&&$++;let K=null;N&&(K=this.editing.mapper.toModelRange(N.getFirstRange()));const H=new w.a(F.node,D),U=this.editing.mapper.toModelPosition(H),W=h.a.createFromPositionAndShift(U,z),Z=M.substr(D,$);this.editor.execute('input',{text:Z,range:W,resultRange:K})}_handleTextNodeInsertion(F){if('children'==F.type&&1==F.newChildren.length-F.oldChildren.length){const N=s.i(T.a)(F.oldChildren,F.newChildren,u),M=s.i(P.a)(N,F.newChildren);if(!(1<M.length)){const I=M[0];if(I.values[0]instanceof C.a){const L=new w.a(F.node,I.index),D=this.editing.mapper.toModelPosition(L),q=I.values[0].data;this.editor.execute('input',{text:q.replace(/\u00A0/g,' '),range:new h.a(D)})}}}}}const R=[s.i(S.c)('arrowUp'),s.i(S.c)('arrowRight'),s.i(S.c)('arrowDown'),s.i(S.c)('arrowLeft'),9,16,17,18,20,27,33,34,35,36,229];for(let F=112;135>=F;F++)R.push(F)},function(o,r,s){'use strict';var d=s(12),u=s(180);/**
  617. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  618. * For licensing, see LICENSE.md.
  619. */class f extends d.a{constructor(h,w){super(h),this._buffer=new u.a(h.document,w)}destroy(){super.destroy(),this._buffer.destroy(),this._buffer=null}get buffer(){return this._buffer}_doExecute(h={}){const w=this.editor.document,C=h.text||'',T=C.length,P=h.range||w.selection.getFirstRange(),S=h.resultRange;w.enqueueChanges(()=>{const E=P.isCollapsed;this._buffer.lock(),E||this._buffer.batch.remove(P),this._buffer.batch.weakInsert(P.start,C),S?this.editor.data.model.selection.setRanges([S]):E&&this.editor.data.model.selection.collapse(P.start.getShiftedBy(T)),this._buffer.unlock(),this._buffer.input(T)})}}r.a=f},function(o,r,s){'use strict';var u=s(22);/**
  620. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  621. * For licensing, see LICENSE.md.
  622. */r.a=function({emitter:f,activator:h,callback:w}){f.listenTo(document,'keydown',(C,{keyCode:T})=>{T==u.b.esc&&h()&&w()})}},function(o,r,s){'use strict';var d=s(0);/**
  623. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  624. * For licensing, see LICENSE.md.
  625. */r.a=class{constructor(f){this.editor=f,this._components=new Map}add(f,h){if(this._components.get(f))throw new d.a('componentfactory-item-exists: The item already exists in the component factory.',{name:f});this._components.set(f,h)}create(f){return this._components.get(f)(this.editor.locale)}}},function(o,r,s){'use strict';var u=s(26),f=s(391),h=s(390);/**
  626. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  627. * For licensing, see LICENSE.md.
  628. */r.a=function(w,C){const T=new u.a(C);T.bind('label','isOn','isEnabled','withText','keystroke','tooltip').to(w);const P=new h.a(C);return new f.a(C,T,P)}},function(o,r,s){'use strict';var d=s(9),u=s(6);/**
  629. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  630. * For licensing, see LICENSE.md.
  631. */class f extends d.a{constructor(h){super(h);const w=this.bindTemplate;this.set('isVisible',!1),this.children=this.createCollection(),this.template=new u.a({tag:'div',attributes:{class:['ck-reset','ck-dropdown__panel',w.if('isVisible','ck-dropdown__panel-visible')]},children:this.children})}}r.a=f},function(o,r,s){'use strict';var d=s(9),u=s(6),f=s(65),h=s(66);/**
  632. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  633. * For licensing, see LICENSE.md.
  634. */class w extends d.a{constructor(C,T,P){super(C),u.a.extend(T.template,{attributes:{class:['ck-dropdown__button']}}),this.buttonView=T,this.panelView=P,this.set('isOpen',!1),this.focusTracker=new f.a,this.keystrokes=new h.a,this.template=new u.a({tag:'div',attributes:{class:['ck-dropdown']},children:[T,P]}),this.listenTo(T,'execute',()=>this.isOpen=!this.isOpen),P.bind('isVisible').to(this,'isOpen')}init(){this.keystrokes.listenTo(this.element),this.focusTracker.add(this.element);const C=(T,P)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,P())};return this.keystrokes.set('arrowdown',(T,P)=>{this.isOpen||(this.isOpen=!0,P())}),this.keystrokes.set('arrowright',(T,P)=>{this.isOpen&&P()}),this.keystrokes.set('arrowleft',C),this.keystrokes.set('esc',C),super.init()}focus(){this.buttonView.focus()}}r.a=w},function(o,r,s){'use strict';function u(C){C.listenTo(document,'click',(T,{target:P})=>{C.element==P||C.element.contains(P)||(C.isOpen=!1)})}/**
  635. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  636. * For licensing, see LICENSE.md.
  637. */var f=s(400),h=s(399),w=s(389);r.a=function(C,T){const P=s.i(w.a)(C,T),S=P.listView=new f.a(T);return S.items.bindTo(C.items).using((E)=>{const O=new h.a(T);return O.bind(...Object.keys(E)).to(E),O}),S.items.delegate('execute').to(P),P.panelView.children.add(S),P.on('change:isOpen',(E,O,V)=>{V?u(P):P.stopListening(document)}),P.on('execute',()=>{P.isOpen=!1}),P.keystrokes.set('arrowdown',(E,O)=>{P.isOpen&&(S.focus(),O())}),P.keystrokes.set('arrowup',(E,O)=>{P.isOpen&&(S.focusLast(),O())}),P}},function(o,r,s){'use strict';var d=s(9),u=s(6);/**
  638. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  639. * For licensing, see LICENSE.md.
  640. */class f extends d.a{constructor(h,w){super(h);const C=this.bindTemplate;w&&(this.element=this.editableElement=w),this.template=new u.a({tag:'div',attributes:{class:[C.to('isFocused',(T)=>T?'ck-focused':'ck-blurred'),'ck-editor__editable'],contenteditable:C.to('isReadOnly',(T)=>!T)}}),this.set('isReadOnly',!1),this.set('isFocused',!1),this.externalElement=w}init(){return this.externalElement?this.template.apply(this.externalElement):this.editableElement=this.element,super.init()}destroy(){return this.externalElement&&this.template.revert(this.externalElement),super.destroy()}}r.a=f},function(o,r,s){'use strict';var d=s(393),u=s(6);/**
  641. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  642. * For licensing, see LICENSE.md.
  643. */class f extends d.a{constructor(h,w){super(h,w);const C=this.bindTemplate,T=this.t;this.set('name',null);u.a.extend(this.template,{attributes:{role:'textbox','aria-label':C.to('name',(S)=>{return T('Rich Text Editor, %0',[S])}),class:'ck-editor__editable_inline'}})}}r.a=f},function(o,r,s){'use strict';var d=s(396),u=s(70),f=s(6);/**
  644. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  645. * For licensing, see LICENSE.md.
  646. */class h extends d.a{constructor(w){super(w);const C=this.t,T=s.i(u.a)();this.set('width',null),this.set('height',null),this.top=this.createCollection(),this.main=this.createCollection(),this.template=new f.a({tag:'div',attributes:{class:['ck-reset','ck-editor','ck-rounded-corners'],role:'application',dir:'ltr',lang:w.lang,'aria-labelledby':`cke-editor__aria-label_${T}`},children:[{tag:'span',attributes:{id:`cke-editor__aria-label_${T}`,class:'cke-voice-label'},children:[C('Rich Text Editor')]},{tag:'div',attributes:{class:'ck-editor__top ck-reset_all',role:'presentation'},children:this.top},{tag:'div',attributes:{class:'ck-editor__main',role:'presentation'},children:this.main}]})}}r.a=h},function(o,r,s){'use strict';var d=s(9),u=s(6);/**
  647. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  648. * For licensing, see LICENSE.md.
  649. */class f extends d.a{constructor(h){super(h),this.body=this.createCollection()}init(){return Promise.resolve().then(()=>this._renderBodyCollection()).then(()=>super.init())}destroy(){return this._bodyCollectionContainer.remove(),super.destroy()}_renderBodyCollection(){const h=this._bodyCollectionContainer=new u.a({tag:'div',attributes:{class:['ck-body','ck-rounded-corners','ck-reset_all']},children:this.body}).render();document.body.appendChild(h)}}r.a=f},function(o,r,s){'use strict';var d=s(9),u=s(6);/**
  650. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  651. * For licensing, see LICENSE.md.
  652. */class f extends d.a{constructor(){super();const h=this.bindTemplate;this.set('content'),this.set('viewBox','0 0 20 20'),this.template=new u.a({tag:'svg',ns:'http://www.w3.org/2000/svg',attributes:{class:'ck-icon',viewBox:h.to('viewBox')}}),this.on('change:content',(w,C,T)=>{for(const P=new DOMParser().parseFromString(T.trim(),'image/svg+xml').firstChild;0<P.childNodes.length;)this.element.appendChild(P.childNodes[0])})}}r.a=f},function(o,r,s){'use strict';var d=s(9),u=s(6);/**
  653. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  654. * For licensing, see LICENSE.md.
  655. */class f extends d.a{constructor(h){super(h),this.set('text'),this.set('for');const w=this.bindTemplate;this.template=new u.a({tag:'label',attributes:{class:['ck-label'],for:w.to('for')},children:[{text:w.to('text')}]})}}r.a=f},function(o,r,s){'use strict';var d=s(9),u=s(6);/**
  656. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  657. * For licensing, see LICENSE.md.
  658. */class f extends d.a{constructor(){super(),this.set('tabindex',-1);const h=this.bindTemplate;this.template=new u.a({tag:'li',attributes:{class:['ck-list__item',h.to('class'),h.if('isActive','ck-list__item_active')],style:h.to('style'),tabindex:h.to('tabindex')},children:[{text:h.to('label')}],on:{click:h.to('execute')}})}focus(){this.element.focus()}}r.a=f},function(o,r,s){'use strict';var d=s(9),u=s(6),f=s(65),h=s(119),w=s(66);/**
  659. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  660. * For licensing, see LICENSE.md.
  661. */class C extends d.a{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new f.a,this.keystrokes=new w.a,this._focusCycler=new h.a({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:'arrowup',focusNext:'arrowdown'}}),this.template=new u.a({tag:'ul',attributes:{class:['ck-reset','ck-list']},children:this.items}),this.items.on('add',(T,P)=>{this.focusTracker.add(P.element)}),this.items.on('remove',(T,P)=>{this.focusTracker.remove(P.element)})}init(){return this.keystrokes.listenTo(this.element),super.init()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}r.a=C},function(o,r,s){'use strict';var d=s(57),u=s(4),f=s(32);/**
  662. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  663. * For licensing, see LICENSE.md.
  664. */class h{constructor(w,C){C&&s.i(d.a)(this,C),w&&this.set(w)}}r.a=h,s.i(u.a)(h,f.a)},function(o,r){'use strict';r.a=/**
  665. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  666. * For licensing, see LICENSE.md.
  667. */function({origin:u,originKeystrokeHandler:f,originFocusTracker:h,toolbar:w}){h.add(w.element),f.set('Alt+F10',(C,T)=>{h.isFocused&&!w.focusTracker.isFocused&&(w.focus(),T())}),w.keystrokes.set('Esc',(C,T)=>{w.focusTracker.isFocused&&(u.focus(),T())})}},function(o,r,s){'use strict';var d=s(64),u=s(6),f=s(186),h=s(190);/**
  668. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  669. * For licensing, see LICENSE.md.
  670. */const w=s.i(h.a)('px');class C extends f.a{constructor(T){super(T);const P=this.bindTemplate;this.set('isActive',!1),this.set('isSticky',!1),this.set('limiterElement',null),this.set('limiterOffset',50),this.set('_marginLeft',null),this.set('_isStickyToTheLimiter',!1),u.a.extend(this.template,{attributes:{class:[P.if('isSticky','ck-toolbar_sticky'),P.if('_isStickyToTheLimiter','ck-toolbar_sticky_bottom-limit')],style:{width:P.to('isSticky',(S)=>{return S?w(this._elementPlaceholder.getBoundingClientRect().width):null}),bottom:P.to('_isStickyToTheLimiter',(S)=>{return S?w(this.limiterOffset):null}),marginLeft:P.to('_marginLeft')}}}),this._elementPlaceholder=new u.a({tag:'div',attributes:{class:['ck-toolbar__placeholder'],style:{display:P.to('isSticky',(S)=>S?'block':'none'),height:P.to('isSticky',(S)=>{return S?w(this._toolbarRect.height):null})}}}).render()}init(){super.init(),this.element.parentNode.insertBefore(this._elementPlaceholder,this.element),this.listenTo(d.a.window,'scroll',()=>{this._checkIfShouldBeSticky()}),this.listenTo(this,'change:isActive',()=>{this._checkIfShouldBeSticky()})}destroy(){return super.destroy().then(()=>{this._elementPlaceholder.remove()})}_checkIfShouldBeSticky(){const T=this._limiterRect=this.limiterElement.getBoundingClientRect(),P=this._toolbarRect=this.element.getBoundingClientRect();this.isSticky=this.isActive&&0>T.top&&this._toolbarRect.height+this.limiterOffset<T.height,this.isSticky?(this._isStickyToTheLimiter=T.bottom<P.height+this.limiterOffset,this._marginLeft=this._isStickyToTheLimiter?null:w(-d.a.window.scrollX)):(this._isStickyToTheLimiter=!1,this._marginLeft=null)}}r.a=C},function(o,r,s){'use strict';var d=s(9),u=s(6);/**
  671. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  672. * For licensing, see LICENSE.md.
  673. */class f extends d.a{constructor(h){super(h),this.template=new u.a({tag:'span',attributes:{class:['ck-toolbar__separator']}})}}r.a=f},function(o,r,s){'use strict';var d=s(121),u=s(107);/**
  674. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  675. * For licensing, see LICENSE.md.
  676. */class f extends d.a{_doExecute(){const h=this._stack.pop();this.editor.document.enqueueChanges(()=>{const w=h.batch.deltas[h.batch.deltas.length-1],C=w.baseVersion+w.operations.length,T=Array.from(this.editor.document.history.getDeltas(C)).filter((P)=>{return!this._createdBatches.has(P.batch)});this._restoreSelection(h.selection.ranges,h.selection.isBackward,T),this._redo(h.batch)}),this.refreshState()}_redo(h){const w=this.editor.document,C=w.batch();this._createdBatches.add(C);const T=h.deltas.slice();T.reverse();for(let P of T){const S=P.baseVersion+P.operations.length;let E=[P.getReversed()];for(let O of w.history.getDeltas(S))this._createdBatches.has(O.batch)||(E=s.i(u.a)(E,[O],!0).deltasA);for(let O of E){O.baseVersion=w.version,C.addDelta(O);for(let V of O.operations)w.applyOperation(V)}}}}r.a=f},function(o,r,s){'use strict';var d=s(121),u=s(107);/**
  677. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  678. * For licensing, see LICENSE.md.
  679. */class f extends d.a{_doExecute(h=null){let w=h?this._stack.findIndex((T)=>T.batch==h):this._stack.length-1;const C=this._stack.splice(w,1)[0];this.editor.document.enqueueChanges(()=>{const T=this._undo(C.batch),P=this.editor.document.history.getDeltas(C.batch.baseVersion);this._restoreSelection(C.selection.ranges,C.selection.isBackward,P),this.fire('revert',C.batch,T)}),this.refreshState()}_getItemIndexFromBaseVersion(h){for(let w=0;w<this._stack.length;w++)if(this._stack[w].batch.baseVersion==h)return w;return null}_undo(h){const w=this.editor.document,C=w.batch();this._createdBatches.add(C);const T=w.history,P=h.deltas.slice();P.reverse();for(let S of P){const E=S.baseVersion,O=E+S.operations.length,V=T.getDelta(E);if(null===V)continue;V.reverse();let R=[];for(let N of V)R.push(N.getReversed());const F={};for(let N of T.getDeltas(O)){const M=this._getItemIndexFromBaseVersion(N.baseVersion);null!==M&&(this._stack[M].selection.ranges=s.i(d.b)(this._stack[M].selection.ranges,R));const I=s.i(u.a)(R,[N],!0);R=I.deltasA;const L=I.deltasB;F[N.baseVersion]||(F[N.baseVersion]=[]),F[N.baseVersion]=F[N.baseVersion].concat(L)}for(let N of R){N.baseVersion=w.version,C.addDelta(N);for(let M of N.operations)w.applyOperation(M)}T.removeDelta(E);for(let N of R)T.removeDelta(N.baseVersion);for(let N in F)T.updateDelta(+N,F[N])}return C}}r.a=f},function(o,r,s){'use strict';var d=s(3),u=s(406),f=s(405);/**
  680. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  681. * For licensing, see LICENSE.md.
  682. */class h extends d.a{constructor(w){super(w),this._batchRegistry=new WeakSet}init(){this._undoCommand=new u.a(this.editor),this._redoCommand=new f.a(this.editor),this.editor.commands.set('undo',this._undoCommand),this.editor.commands.set('redo',this._redoCommand),this.listenTo(this.editor.document,'change',(w,C,T,P)=>{this._batchRegistry.has(P)||'transparent'==P.type||(this._redoCommand._createdBatches.has(P)?this._undoCommand.addBatch(P):!this._undoCommand._createdBatches.has(P)&&(this._undoCommand.addBatch(P),this._redoCommand.clearStack()),this._batchRegistry.add(P))},{priority:'highest'}),this.listenTo(this._undoCommand,'revert',(w,C,T)=>{this._redoCommand.addBatch(T)})}}r.a=h},function(o,r,s){'use strict';var d=s(98);/**
  683. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  684. * For licensing, see LICENSE.md.
  685. */r.a=class{constructor(f,h){this._config={},h&&this.define(h),f&&this._setObjectToTarget(this._config,f)}set(f,h){this._setToTarget(this._config,f,h)}define(f,h){this._setToTarget(this._config,f,h,!0)}get(f){return this._getFromSource(this._config,f)}_setToTarget(f,h,w,C=!1){if(s.i(d.a)(h))return void this._setObjectToTarget(f,h,C);const T=h.split('.');h=T.pop();for(let P of T)s.i(d.a)(f[P])||(f[P]={}),f=f[P];return s.i(d.a)(w)?(s.i(d.a)(f[h])||(f[h]={}),f=f[h],void this._setObjectToTarget(f,w,C)):void(C&&'undefined'!=typeof f[h]||(f[h]=w))}_getFromSource(f,h){const w=h.split('.');h=w.pop();for(let C of w){if(!s.i(d.a)(f[C])){f=null;break}f=f[C]}return f?f[h]:void 0}_setObjectToTarget(f,h,w){Object.keys(h).forEach((C)=>{this._setToTarget(f,C,h[C],w)})}}},function(o,r){'use strict';r.a=/**
  686. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  687. * For licensing, see LICENSE.md.
  688. */function(u,f){function h(){P&&(C.push(P),P=null)}function w(S){return P&&P.type==S}const C=[];let T=0,P;return u.forEach((S)=>{'equal'==S?(h(),T++):'insert'==S?(w('insert')?P.values.push(f[T]):(h(),P={type:'insert',index:T,values:[f[T]]}),T++):w('delete')?P.howMany++:(h(),P={type:'delete',index:T,howMany:1})}),h(),C}},function(o,r,s){'use strict';var u=s(189);/**
  689. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  690. * For licensing, see LICENSE.md.
  691. */r.a=function(f,h){const w=s.i(u.a)(f),C=s.i(u.a)(h);let T=0;for(;w[T]==C[T]&&w[T];)T++;return 0==T?null:w[T-1]}},function(o,r){'use strict';r.a=/**
  692. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  693. * For licensing, see LICENSE.md.
  694. */function(u){return u instanceof HTMLTextAreaElement?u.value:u.innerHTML}},function(o,r,s){'use strict';var u=s(64);/**
  695. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  696. * For licensing, see LICENSE.md.
  697. */r.a=function(f){for(;f&&'html'!=f.tagName.toLowerCase();){if('static'!=u.a.window.getComputedStyle(f).position)return f;f=f.parentElement}return null}},function(o,r){'use strict';r.a=/**
  698. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  699. * For licensing, see LICENSE.md.
  700. */function(u){let f=0;for(;u.previousSibling;)u=u.previousSibling,f++;return f}},function(o,r){'use strict';r.a=/**
  701. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  702. * For licensing, see LICENSE.md.
  703. */function(u,f,h){u.insertBefore(h,u.childNodes[f]||null)}},function(o,r){'use strict';r.a=/**
  704. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  705. * For licensing, see LICENSE.md.
  706. */function(u){return'[object Range]'==Object.prototype.toString.apply(u)}},function(o,r,s){'use strict';function u(P,S,E){const{left:O,top:V,name:R}=P(S,E);return[R,E.clone().moveTo(O,V)]}/**
  707. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  708. * For licensing, see LICENSE.md.
  709. */function f(P,S,E,O,V){let R=0,F=0,N,M;const I=E.getArea();return P.some((L)=>{function D(){F=K,R=$,N=z,M=q}const[q,z]=u(L,S,E);let $,K;if(O)if(V){const H=O.getIntersection(V);$=H?H.getIntersectionArea(z):0}else $=O.getIntersectionArea(z);return V&&(K=V.getIntersectionArea(z)),V&&!O?K>F&&D():!V&&O?$>R&&D():K>F&&$>=R?D():K>=F&&$>R&&D(),$===I}),N?[M,N]:null}function h({left:P,top:S}){const{scrollX:E,scrollY:O}=w.a.window;return{left:P+E,top:S+O}}var w=s(64),C=s(417),T=s(412);r.a=function({element:P,target:S,positions:E,limiter:O,fitInViewport:V}){const R=s.i(T.a)(P.parentElement),F=new C.a(P),N=new C.a(S);let M,I;if(!O&&!V)[I,M]=u(E[0],N,F);else{const q=O&&new C.a(O),z=V&&C.a.getViewportRect();[I,M]=f(E,N,F,q,z)||u(E[0],N,F)}let{left:L,top:D}=h(M);if(R){const q=h(new C.a(R)),z=w.a.window.getComputedStyle(R);L-=q.left,D-=q.top,L+=R.scrollLeft,D+=R.scrollTop,L-=parseInt(z.borderLeftWidth,10),D-=parseInt(z.borderTopWidth,10)}return{left:L,top:D,name:I}}},function(o,r,s){'use strict';var d=s(64),u=s(415),f=s(508);/**
  710. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  711. * For licensing, see LICENSE.md.
  712. */const h=['top','right','bottom','left','width','height'];class w{constructor(C){(s.i(f.a)(C)||s.i(u.a)(C))&&(C=C.getBoundingClientRect()),h.forEach((T)=>this[T]=C[T])}clone(){return new w(this)}moveTo(C,T){return this.top=T,this.right=C+this.width,this.bottom=T+this.height,this.left=C,this}moveBy(C,T){return this.top+=T,this.right+=C,this.left+=C,this.bottom+=T,this}getIntersection(C){const T={top:_Mathmax(this.top,C.top),right:_Mathmin(this.right,C.right),bottom:_Mathmin(this.bottom,C.bottom),left:_Mathmax(this.left,C.left)};return T.width=T.right-T.left,T.height=T.bottom-T.top,0>T.width||0>T.height?null:new w(T)}getIntersectionArea(C){const T=this.getIntersection(C);return T?T.getArea():0}getArea(){return this.width*this.height}static getViewportRect(){const{innerWidth:C,innerHeight:T}=d.a.window;return new w({top:0,right:C,bottom:T,left:0,width:C,height:T})}}r.a=w},function(o,r){'use strict';r.a=/**
  713. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  714. * For licensing, see LICENSE.md.
  715. */function(u){const f=u.parentNode;f&&f.removeChild(u)}},function(o,r){'use strict';r.a=/**
  716. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  717. * For licensing, see LICENSE.md.
  718. */function(u,f){u instanceof HTMLTextAreaElement&&(u.value=f),u.innerHTML=f}},function(o,r){'use strict';/**
  719. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  720. * For licensing, see LICENSE.md.
  721. */r.a=class{constructor(){this._replacedElements=[]}replace(u,f){this._replacedElements.push({element:u,newElement:f}),u.style.display='none',f&&u.parentNode.insertBefore(f,u.nextSibling)}restore(){this._replacedElements.forEach(({element:u,newElement:f})=>{u.style.display='',f&&f.remove()}),this._replacedElements=[]}}},function(o,r){'use strict';/**
  722. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  723. * For licensing, see LICENSE.md.
  724. */const u=navigator.userAgent.toLowerCase(),f={mac:function(h){return-1<h.indexOf('macintosh')}(u)};r.a=f},function(o,r,s){'use strict';var d=s(524);/**
  725. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  726. * For licensing, see LICENSE.md.
  727. */r.a=class{constructor(f,h){this.source=f,this.name=h,this.path=[],this.stop=s.i(d.a)(),this.off=s.i(d.a)()}}},function(o,r,s){'use strict';var d=s(53),u=s(31),f=s.i(d.a)(u.a,'DataView');r.a=f},function(o,r,s){'use strict';function d(T){var P=-1,S=T?T.length:0;for(this.clear();++P<S;){var E=T[P];this.set(E[0],E[1])}}var u=s(470),f=s(471),h=s(472),w=s(473),C=s(474);d.prototype.clear=u.a,d.prototype['delete']=f.a,d.prototype.get=h.a,d.prototype.has=w.a,d.prototype.set=C.a,r.a=d},function(o,r,s){'use strict';var d=s(53),u=s(31),f=s.i(d.a)(u.a,'Promise');r.a=f},function(o,r,s){'use strict';var d=s(31),u=d.a.Reflect;r.a=u},function(o,r,s){'use strict';var d=s(53),u=s(31),f=s.i(d.a)(u.a,'WeakMap');r.a=f},function(o,r){'use strict';r.a=function(u,f){return u.set(f[0],f[1]),u}},function(o,r){'use strict';r.a=function(u,f){return u.add(f),u}},function(o,r){'use strict';r.a=function(u,f){for(var h=-1,w=u.length;++h<w&&!(!1===f(u[h],h,u)););return u}},function(o,r){'use strict';r.a=function(u,f){for(var h=-1,w=u.length;++h<w;)if(f(u[h],h,u))return!0;return!1}},function(o,r,s){'use strict';var u=s(139),f=s(69);r.a=function(h,w){return h&&s.i(u.a)(w,s.i(f.a)(w),h)}},function(o,r,s){'use strict';var u=s(228);r.a=function(f,h){for(var w=-1,T=h.length,P=Array(T);++w<T;)P[w]=null==f?void 0:s.i(u.a)(f,h[w]);return P}},function(o,r){'use strict';r.a=function(u,f,h){return u===u&&(void 0!==h&&(u=u<=h?u:h),void 0!==f&&(u=u>=f?u:f)),u}},function(o,r,s){'use strict';var u=s(15),f=Object.create;r.a=function(h){return s.i(u.a)(h)?f(h):{}}},function(o,r,s){'use strict';var u=s(16),f=s(518);r.a=function(h,w,C,T){var P=h.length;for(C=s.i(u.a)(C),0>C&&(C=-C>P?0:P+C),T=void 0===T||T>P?P:s.i(u.a)(T),0>T&&(T+=P),T=C>T?0:s.i(f.a)(T);C<T;)h[C++]=w;return h}},function(o,r,s){'use strict';var u=s(84),f=s(11);r.a=function(h,w,C){var T=w(h);return s.i(f.a)(h)?T:s.i(u.a)(T,C(h))}},function(o,r){'use strict';r.a=function(u,f){return f in Object(u)}},function(o,r){'use strict';r.a=function(u,f,h,w){for(var C=h-1,T=u.length;++C<T;)if(w(u[C],f))return C;return-1}},function(o,r,s){'use strict';var u=s(123),f=s(205),h=s(464),w=s(465),C=s(141),T=s(11),P=s(90),S=s(510),O='[object Arguments]',V='[object Array]',R='[object Object]',F=Object.prototype,N=F.hasOwnProperty;r.a=function(M,I,L,D,q,z){var $=s.i(T.a)(M),K=s.i(T.a)(I),H=V,U=V;$||(H=s.i(C.a)(M),H=H==O?R:H),K||(U=s.i(C.a)(I),U=U==O?R:U);var W=H==R&&!s.i(P.a)(M),Z=U==R&&!s.i(P.a)(I),G=H==U;if(G&&!W)return z||(z=new u.a),$||s.i(S.a)(M)?s.i(f.a)(M,I,L,D,q,z):s.i(h.a)(M,I,H,L,D,q,z);if(!(q&2)){var J=W&&N.call(M,'__wrapped__'),Y=Z&&N.call(I,'__wrapped__');if(J||Y){var X=J?M.value():M,Q=Y?I.value():I;return z||(z=new u.a),L(X,Q,D,q,z)}}return!!G&&(z||(z=new u.a),s.i(w.a)(M,I,L,D,q,z))}},function(o,r,s){'use strict';var u=s(123),f=s(130);r.a=function(C,T,P,S){var E=P.length,O=E,V=!S;if(null==C)return!O;for(C=Object(C);E--;){var R=P[E];if(V&&R[2]?R[1]!==C[R[0]]:!(R[0]in C))return!1}for(;++E<O;){R=P[E];var F=R[0],N=C[F],M=R[1];if(!(V&&R[2])){var I=new u.a;if(S)var L=S(N,M,F,C,T,I);if(void 0===L?!s.i(f.a)(M,N,S,1|2,I):!L)return!1}else if(void 0===N&&!(F in C))return!1}return!0}},function(o,r){'use strict';var u=Object.keys;r.a=function(f){return u(Object(f))}},function(o,r,s){'use strict';function d(T){T=null==T?T:Object(T);var P=[];for(var S in T)P.push(S);return P}var u=s(426),f=s(480),h=Object.prototype,w=u.a?u.a.enumerate:void 0,C=h.propertyIsEnumerable;w&&!C.call({valueOf:1},'valueOf')&&(d=function(T){return s.i(f.a)(w(T))}),r.a=d},function(o,r,s){'use strict';var u=s(441),f=s(468),h=s(210);r.a=function(w){var C=s.i(f.a)(w);return 1==C.length&&C[0][2]?s.i(h.a)(C[0][0],C[0][1]):function(T){return T===w||s.i(u.a)(T,w,C)}}},function(o,r,s){'use strict';var u=s(130),f=s(228),h=s(506),w=s(54),C=s(209),T=s(210),P=s(55);r.a=function(O,V){return s.i(w.a)(O)&&s.i(C.a)(V)?s.i(T.a)(s.i(P.a)(O),V):function(R){var F=s.i(f.a)(R,O);return F===void 0&&F===V?s.i(h.a)(R,O):s.i(u.a)(V,F,void 0,1|2)}}},function(o,r,s){'use strict';var u=s(36);r.a=function(f,h){var w=f.length;if(w)return h+=0>h?w:0,s.i(u.a)(h,w)?f[h]:void 0}},function(o,r,s){'use strict';var u=s(127);r.a=function(f){return function(h){return s.i(u.a)(h,f)}}},function(o,r,s){'use strict';var u=s(67),f=s(88),h=s(36),w=s(54),C=s(15),T=s(55);r.a=function(P,S,E,O){S=s.i(w.a)(S,P)?[S]:s.i(f.a)(S);for(var V=-1,R=S.length,N=P,M;null!=N&&++V<R;){if(M=s.i(T.a)(S[V]),s.i(C.a)(N)){var I=E;if(V!=R-1){var L=N[M];I=O?O(L,M,N):void 0,void 0===I&&(I=null==L?s.i(h.a)(S[V+1])?[]:{}:L)}s.i(u.a)(N,M,I)}N=N[M]}return P}},function(o,r,s){'use strict';var u=s(27);r.a=function(f,h){return s.i(u.a)(h,function(w){return[w,f[w]]})}},function(o,r,s){'use strict';var u=s(124),f=s(44),w=u.a?u.a.prototype:void 0,C=w?w.toString:void 0;r.a=function(T){if('string'==typeof T)return T;if(s.i(f.a)(T))return C?C.call(T):'';var P=T+'';return'0'==P&&1/T==-(1/0)?'-0':P}},function(o,r){'use strict';r.a=function(u){return u&&u.Object===Object?u:null}},function(o,r){'use strict';r.a=function(u,f){if(f)return u.slice();var h=new u.constructor(u.length);return u.copy(h),h}},function(o,r,s){'use strict';var u=s(138);r.a=function(f,h){var w=h?s.i(u.a)(f.buffer):f.buffer;return new f.constructor(w,f.byteOffset,f.byteLength)}},function(o,r,s){'use strict';var u=s(428),f=s(196),h=s(142);r.a=function(w,C,T){var P=C?T(s.i(h.a)(w),!0):s.i(h.a)(w);return s.i(f.a)(P,u.a,new w.constructor)}},function(o,r){'use strict';var u=/\w*$/;r.a=function(f){var h=new f.constructor(f.source,u.exec(f));return h.lastIndex=f.lastIndex,h}},function(o,r,s){'use strict';var u=s(429),f=s(196),h=s(94);r.a=function(w,C,T){var P=C?T(s.i(h.a)(w),!0):s.i(h.a)(w);return s.i(f.a)(P,u.a,new w.constructor)}},function(o,r,s){'use strict';var u=s(124),f=u.a?u.a.prototype:void 0,h=f?f.valueOf:void 0;r.a=function(w){return h?Object(h.call(w)):{}}},function(o,r,s){'use strict';var u=s(138);r.a=function(f,h){var w=h?s.i(u.a)(f.buffer):f.buffer;return new f.constructor(w,f.byteOffset,f.length)}},function(o,r,s){'use strict';var u=s(44);r.a=function(f,h){if(f!==h){var w=f!==void 0,C=null===f,T=f===f,P=s.i(u.a)(f),S=h!==void 0,E=null===h,O=h===h,V=s.i(u.a)(h);if(!E&&!V&&!P&&f>h||P&&S&&O&&!E&&!V||C&&S&&O||!w&&O||!T)return 1;if(!C&&!P&&!V&&f<h||V&&w&&T&&!C&&!P||E&&w&&T||!S&&T||!O)return-1}return 0}},function(o,r,s){'use strict';var u=s(139),f=s(206);r.a=function(h,w){return s.i(u.a)(h,s.i(f.a)(h),w)}},function(o,r,s){'use strict';var u=s(91),f=s(8);r.a=function(h){return s.i(f.a)(function(w,C){var T=-1,P=C.length,S=1<P?C[P-1]:void 0,E=2<P?C[2]:void 0;for(S=3<h.length&&'function'==typeof S?(P--,S):void 0,E&&s.i(u.a)(C[0],C[1],E)&&(S=3>P?void 0:S,P=1),w=Object(w);++T<P;){var O=C[T];O&&h(w,O,T,S)}return w})}},function(o,r,s){'use strict';var d=s(193),u=s(513),f=s(94),w=d.a&&1/s.i(f.a)(new d.a([,-0]))[1]==1/0?function(C){return new d.a(C)}:u.a;r.a=w},function(o,r,s){'use strict';var u=s(449),f=s(141),h=s(142),w=s(494);r.a=function(P){return function(S){var E=s.i(f.a)(S);return E=='[object Map]'?s.i(h.a)(S):E=='[object Set]'?s.i(w.a)(S):s.i(u.a)(S,P(S))}}},function(o,r,s){'use strict';var u=s(124),f=s(194),h=s(205),w=s(142),C=s(94),q=u.a?u.a.prototype:void 0,z=q?q.valueOf:void 0;r.a=function($,K,H,U,W,Z,G){switch(H){case'[object DataView]':if($.byteLength!=K.byteLength||$.byteOffset!=K.byteOffset)return!1;$=$.buffer,K=K.buffer;case'[object ArrayBuffer]':return $.byteLength==K.byteLength&&U(new f.a($),new f.a(K));case'[object Boolean]':case'[object Date]':return+$==+K;case'[object Error]':return $.name==K.name&&$.message==K.message;case'[object Number]':return $==+$?$==+K:K!=+K;case'[object RegExp]':case'[object String]':return $==K+'';case'[object Map]':var J=w.a;case'[object Set]':var Y=Z&2;if(J||(J=C.a),$.size!=K.size&&!Y)return!1;var X=G.get($);return X?X==K:(Z|=1,G.set($,K),s.i(h.a)(J($),J(K),U,W,Z,G));case'[object Symbol]':if(z)return z.call($)==z.call(K);}return!1}},function(o,r,s){'use strict';var u=s(199),f=s(69);r.a=function(w,C,T,P,S,E){var O=S&2,V=s.i(f.a)(w),R=V.length,F=s.i(f.a)(C),N=F.length;if(R!=N&&!O)return!1;for(var M=R,I;M--;)if(I=V[M],O?!(I in C):!s.i(u.a)(C,I))return!1;var L=E.get(w);if(L)return L==C;var D=!0;E.set(w,C);for(var q=O;++M<R;){I=V[M];var z=w[I],$=C[I];if(P)var K=O?P($,z,I,C,w,E):P(z,$,I,w,C,E);if(void 0===K?!(z===$||T(z,$,P,S,E)):!K){D=!1;break}q||(q='constructor'==I)}if(D&&!q){var H=w.constructor,U=C.constructor;H!=U&&'constructor'in w&&'constructor'in C&&!('function'==typeof H&&H instanceof H&&'function'==typeof U&&U instanceof U)&&(D=!1)}return E['delete'](w),D}},function(o,r,s){'use strict';var u=s(437),f=s(206),h=s(69);r.a=function(w){return s.i(u.a)(w,h.a,f.a)}},function(o,r,s){'use strict';var d=s(131),u=s.i(d.a)('length');r.a=u},function(o,r,s){'use strict';var u=s(209),f=s(519);r.a=function(h){for(var w=s.i(f.a)(h),C=w.length;C--;)w[C][2]=s.i(u.a)(w[C][1]);return w}},function(o,r,s){'use strict';var u=s(88),f=s(147),h=s(11),w=s(36),C=s(54),T=s(97),P=s(149),S=s(55);r.a=function(E,O,V){O=s.i(C.a)(O,E)?[O]:s.i(u.a)(O);for(var F=-1,N=O.length,R,M;++F<N&&(M=s.i(S.a)(O[F]),!!(R=null!=E&&V(E,M)));)E=E[M];if(R)return R;var N=E?E.length:0;return!!N&&s.i(T.a)(N)&&s.i(w.a)(M,N)&&(s.i(h.a)(E)||s.i(P.a)(E)||s.i(f.a)(E))}},function(o,r,s){'use strict';var u=s(93);r.a=function(){this.__data__=u.a?s.i(u.a)(null):{}}},function(o,r){'use strict';r.a=function(u){return this.has(u)&&delete this.__data__[u]}},function(o,r,s){'use strict';var u=s(93),h=Object.prototype,w=h.hasOwnProperty;r.a=function(C){var T=this.__data__;if(u.a){var P=T[C];return P==='__lodash_hash_undefined__'?void 0:P}return w.call(T,C)?T[C]:void 0}},function(o,r,s){'use strict';var u=s(93),f=Object.prototype,h=f.hasOwnProperty;r.a=function(w){var C=this.__data__;return u.a?C[w]!==void 0:h.call(C,w)}},function(o,r,s){'use strict';var u=s(93);r.a=function(h,w){var C=this.__data__;return C[h]=u.a&&void 0===w?'__lodash_hash_undefined__':w,this}},function(o,r){'use strict';var u=Object.prototype,f=u.hasOwnProperty;r.a=function(h){var w=h.length,C=h.constructor(w);return w&&'string'==typeof h[0]&&f.call(h,'index')&&(C.index=h.index,C.input=h.input),C}},function(o,r,s){'use strict';var u=s(138),f=s(453),h=s(454),w=s(455),C=s(456),T=s(457),P=s(458);r.a=function(G,J,Y,X){var Q=G.constructor;return J==='[object ArrayBuffer]'?s.i(u.a)(G):J==='[object Boolean]'||J==='[object Date]'?new Q(+G):J==='[object DataView]'?s.i(f.a)(G,X):J==='[object Float32Array]'||J==='[object Float64Array]'||J==='[object Int8Array]'||J==='[object Int16Array]'||J==='[object Int32Array]'||J==='[object Uint8Array]'||J==='[object Uint8ClampedArray]'||J==='[object Uint16Array]'||J==='[object Uint32Array]'?s.i(P.a)(G,X):J==='[object Map]'?s.i(h.a)(G,X,Y):J==='[object Number]'||J==='[object String]'?new Q(G):J==='[object RegExp]'?s.i(w.a)(G):J==='[object Set]'?s.i(C.a)(G,X,Y):J==='[object Symbol]'?s.i(T.a)(G):void 0}},function(o,r,s){'use strict';var u=s(435),f=s(140),h=s(92);r.a=function(w){return'function'!=typeof w.constructor||s.i(h.a)(w)?{}:s.i(u.a)(s.i(f.a)(w))}},function(o,r,s){'use strict';var u=s(147),f=s(11);r.a=function(h){return s.i(f.a)(h)||s.i(u.a)(h)}},function(o,r){'use strict';r.a=function(u){var f=typeof u;return'string'==f||'number'==f||'symbol'==f||'boolean'==f?'__proto__'!==u:null===u}},function(o,r){'use strict';r.a=function(u){for(var h=[],f;!(f=u.next()).done;)h.push(f.value);return h}},function(o,r){'use strict';r.a=function(){this.__data__=[]}},function(o,r,s){'use strict';var u=s(85),f=Array.prototype,h=f.splice;r.a=function(w){var C=this.__data__,T=s.i(u.a)(C,w);if(0>T)return!1;var P=C.length-1;return T==P?C.pop():h.call(C,T,1),!0}},function(o,r,s){'use strict';var u=s(85);r.a=function(f){var h=this.__data__,w=s.i(u.a)(h,f);return 0>w?void 0:h[w][1]}},function(o,r,s){'use strict';var u=s(85);r.a=function(f){return-1<s.i(u.a)(this.__data__,f)}},function(o,r,s){'use strict';var u=s(85);r.a=function(f,h){var w=this.__data__,C=s.i(u.a)(w,f);return 0>C?w.push([f,h]):w[C][1]=h,this}},function(o,r,s){'use strict';var u=s(424),f=s(81),h=s(192);r.a=function(){this.__data__={hash:new u.a,map:new(h.a||f.a),string:new u.a}}},function(o,r,s){'use strict';var u=s(89);r.a=function(f){return s.i(u.a)(this,f)['delete'](f)}},function(o,r,s){'use strict';var u=s(89);r.a=function(f){return s.i(u.a)(this,f).get(f)}},function(o,r,s){'use strict';var u=s(89);r.a=function(f){return s.i(u.a)(this,f).has(f)}},function(o,r,s){'use strict';var u=s(89);r.a=function(f,h){return s.i(u.a)(this,f).set(f,h),this}},function(o,r,s){'use strict';var u=s(127),f=s(35);r.a=function(h,w){return 1==w.length?h:s.i(u.a)(h,s.i(f.a)(w,0,-1))}},function(o,r){'use strict';r.a=function(f){return this.__data__.set(f,'__lodash_hash_undefined__'),this}},function(o,r){'use strict';r.a=function(u){return this.__data__.has(u)}},function(o,r){'use strict';r.a=function(u){var f=-1,h=Array(u.size);return u.forEach(function(w){h[++f]=[w,w]}),h}},function(o,r,s){'use strict';var u=s(81);r.a=function(){this.__data__=new u.a}},function(o,r){'use strict';r.a=function(u){return this.__data__['delete'](u)}},function(o,r){'use strict';r.a=function(u){return this.__data__.get(u)}},function(o,r){'use strict';r.a=function(u){return this.__data__.has(u)}},function(o,r,s){'use strict';var u=s(81),f=s(122);r.a=function(w,C){var T=this.__data__;return T instanceof u.a&&T.__data__.length==200&&(T=this.__data__=new f.a(T.__data__)),T.set(w,C),this}},function(o,r,s){'use strict';var d=s(512),u=s(520),f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,h=/\\(\\)?/g,w=s.i(d.a)(function(C){var T=[];return s.i(u.a)(C).replace(f,function(P,S,E,O){T.push(E?O.replace(h,'$1'):S||P)}),T});r.a=w},function(o,r,s){'use strict';var d=s(212),u=s(213),f=s(214),h=s(215),w=s(216),C=s(217),T=s(144),P=s(145),S=s(218),E=s(219),O=s(220),V=s(221),R=s(222),F=s(223),N=s(224),M=s(225),I=s(226),L=s(227),D=s(146),q=s(230),z=s(231),$=s(232),K=s(233),H=s(234),U=s(236),W=s(19),Z=s(237),G=s(238),J=s(239),Y=s(150),X=s(240),Q=s(241),ee=s(242),te=s(243),ae=s(244),ne=s(245),oe=s(246),ie=s(247),re=s(248),se=s(249),le=s(250),de=s(251),ce=s(252),ue=s(253),me=s(254),pe=s(255),ge=s(256),fe=s(257),he=s(258),be=s(260),_e=s(261),ke=s(262),ye=s(263),we=s(264),ve=s(265),xe=s(99),Ce=s(151),Te=s(266),Ae=s(267),Pe=s(268),Se=s(269),Ee=s(270),Oe=s(271),Ve=s(272),Re=s(273);r.a={chunk:d.a,compact:u.a,concat:f.a,difference:h.a,differenceBy:w.a,differenceWith:C.a,drop:T.a,dropRight:P.a,dropRightWhile:S.a,dropWhile:E.a,fill:O.a,findIndex:V.a,findLastIndex:R.a,first:F.a,flatten:N.a,flattenDeep:M.a,flattenDepth:I.a,fromPairs:L.a,head:D.a,indexOf:q.a,initial:z.a,intersection:$.a,intersectionBy:K.a,intersectionWith:H.a,join:U.a,last:W.a,lastIndexOf:Z.a,nth:G.a,pull:J.a,pullAll:Y.a,pullAllBy:X.a,pullAllWith:Q.a,pullAt:ee.a,remove:te.a,reverse:ae.a,slice:ne.a,sortedIndex:oe.a,sortedIndexBy:ie.a,sortedIndexOf:re.a,sortedLastIndex:se.a,sortedLastIndexBy:le.a,sortedLastIndexOf:de.a,sortedUniq:ce.a,sortedUniqBy:ue.a,tail:me.a,take:pe.a,takeRight:ge.a,takeRightWhile:fe.a,takeWhile:he.a,union:be.a,unionBy:_e.a,unionWith:ke.a,uniq:ye.a,uniqBy:we.a,uniqWith:ve.a,unzip:xe.a,unzipWith:Ce.a,without:Te.a,xor:Ae.a,xorBy:Pe.a,xorWith:Se.a,zip:Ee.a,zipObject:Oe.a,zipObjectDeep:Ve.a,zipWith:Re.a}},function(o,r,s){'use strict';var d=s(212),u=s(213),f=s(214),h=s(215),w=s(216),C=s(217),T=s(144),P=s(145),S=s(218),E=s(219),O=s(220),V=s(221),R=s(222),F=s(223),N=s(224),M=s(225),I=s(226),L=s(227),D=s(146),q=s(230),z=s(231),$=s(232),K=s(233),H=s(234),U=s(236),W=s(19),Z=s(237),G=s(238),J=s(239),Y=s(150),X=s(240),Q=s(241),ee=s(242),te=s(243),ae=s(244),ne=s(245),oe=s(246),ie=s(247),re=s(248),se=s(249),le=s(250),de=s(251),ce=s(252),ue=s(253),me=s(254),pe=s(255),ge=s(256),fe=s(257),he=s(258),be=s(260),_e=s(261),ke=s(262),ye=s(263),we=s(264),ve=s(265),xe=s(99),Ce=s(151),Te=s(266),Ae=s(267),Pe=s(268),Se=s(269),Ee=s(270),Oe=s(271),Ve=s(272),Re=s(273),Fe=s(501);s.d(r,'a',function(){return Fe.a})},function(o,r,s){'use strict';var d=s(67),u=s(139),f=s(461),h=s(96),w=s(92),C=s(511),T=Object.prototype,P=T.propertyIsEnumerable,S=!P.call({valueOf:1},'valueOf'),E=s.i(f.a)(function(O,V){if(S||s.i(w.a)(V)||s.i(h.a)(V))return void s.i(u.a)(V,s.i(C.a)(V),O);for(var R in V)s.i(d.a)(O,R,V[R])});r.a=E},function(o,r,s){'use strict';var u=s(197);r.a=function(f,h){return s.i(u.a)(f,!0,!0,h)}},function(o,r){'use strict';r.a=function(u){return function(){return u}}},function(o,r,s){'use strict';var u=s(438),f=s(469);r.a=function(h,w){return null!=h&&s.i(f.a)(h,w,u.a)}},function(o,r,s){'use strict';(function(d){var u=s(505),f=s(31),h={'function':!0,object:!0},w=h[typeof exports]&&exports&&!exports.nodeType?exports:void 0,C=h[typeof d]&&d&&!d.nodeType?d:void 0,T=C&&C.exports===w?w:void 0,P=T?f.a.Buffer:void 0,S=P?function(E){return E instanceof P}:s.i(u.a)(!1);r.a=S}).call(r,s(154)(o))},function(o,r,s){'use strict';var u=s(43),f=s(98);r.a=function(h){return!!h&&1===h.nodeType&&s.i(u.a)(h)&&!s.i(f.a)(h)}},function(o,r,s){'use strict';var u=s(130);r.a=function(f,h){return s.i(u.a)(f,h)}},function(o,r,s){'use strict';var u=s(97),f=s(43),G={};G['[object Float32Array]']=G['[object Float64Array]']=G['[object Int8Array]']=G['[object Int16Array]']=G['[object Int32Array]']=G['[object Uint8Array]']=G['[object Uint8ClampedArray]']=G['[object Uint16Array]']=G['[object Uint32Array]']=!0,G['[object Arguments]']=G['[object Array]']=G['[object ArrayBuffer]']=G['[object Boolean]']=G['[object DataView]']=G['[object Date]']=G['[object Error]']=G['[object Function]']=G['[object Map]']=G['[object Number]']=G['[object Object]']=G['[object RegExp]']=G['[object Set]']=G['[object String]']=G['[object WeakMap]']=!1;var J=Object.prototype,Y=J.toString;r.a=function(X){return s.i(f.a)(X)&&s.i(u.a)(X.length)&&!!G[Y.call(X)]}},function(o,r,s){'use strict';var u=s(443),f=s(207),h=s(36),w=s(92),C=Object.prototype,T=C.hasOwnProperty;r.a=function(P){for(var S=-1,E=s.i(w.a)(P),O=s.i(u.a)(P),V=O.length,R=s.i(f.a)(P),N=R||[],M=N.length,I;++S<V;)I=O[S],!!R&&('length'==I||s.i(h.a)(I,M))||'constructor'==I&&(E||!T.call(P,I))||N.push(I);return N}},function(o,r,s){'use strict';function d(h,w){if('function'!=typeof h||w&&'function'!=typeof w)throw new TypeError(f);var C=function(){var T=arguments,P=w?w.apply(this,T):T[0],S=C.cache;if(S.has(P))return S.get(P);var E=h.apply(this,T);return C.cache=S.set(P,E),E};return C.cache=new(d.Cache||u.a),C}var u=s(122),f='Expected a function';d.Cache=u.a,r.a=d},function(o,r){'use strict';r.a=function(){}},function(o,r){'use strict';var d=Date.now;r.a=d},function(o,r,s){'use strict';var u=s(131),f=s(447),h=s(54),w=s(55);r.a=function(C){return s.i(h.a)(C)?s.i(u.a)(s.i(w.a)(C)):s.i(f.a)(C)}},function(o,r,s){'use strict';var u=s(143),f=s(15);r.a=function(w,C,T){var P=!0,S=!0;if('function'!=typeof w)throw new TypeError('Expected a function');return s.i(f.a)(T)&&(P='leading'in T?!!T.leading:P,S='trailing'in T?!!T.trailing:S),s.i(u.a)(w,C,{leading:P,maxWait:C,trailing:S})}},function(o,r,s){'use strict';var u=s(259),f=1/0;r.a=function(w){if(!w)return 0===w?w:0;if(w=s.i(u.a)(w),w===f||w===-f){var C=0>w?-1:1;return C*1.7976931348623157e308}return w===w?w:0}},function(o,r,s){'use strict';var u=s(434),f=s(16);r.a=function(w){return w?s.i(u.a)(s.i(f.a)(w),0,4294967295):0}},function(o,r,s){'use strict';var d=s(463),u=s(69),f=s.i(d.a)(u.a);r.a=f},function(o,r,s){'use strict';var u=s(450);r.a=function(f){return null==f?'':s.i(u.a)(f)}},function(o,r,s){'use strict';var d=s(525);/**
  728. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  729. * For licensing, see LICENSE.md.
  730. */r.a=class{constructor(f){this.lang=f||'en',this.t=(...h)=>this._t(...h)}_t(f,h){let w=s.i(d.a)(this.lang,f);return h&&(w=w.replace(/\%(\d+)/g,(C,T)=>{return T<h.length?h[T]:C})),w}}},function(o,r){'use strict';r.a=/**
  731. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  732. * For licensing, see LICENSE.md.
  733. */function(u,f){if(u.size!=f.size)return!1;for(let h of u.entries()){let w=JSON.stringify(h[1]),C=JSON.stringify(f.get(h[0]));if(w!==C)return!1}return!0}},function(o,r){'use strict';/**
  734. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  735. * For licensing, see LICENSE.md.
  736. */const d={get(u){return'number'==typeof u?u:this[u]||this.normal},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};r.a=d},function(o,r){'use strict';/**
  737. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  738. * For licensing, see LICENSE.md.
  739. */r.a=function(){return function u(){u.called=!0}}},function(o,r){'use strict';function f(C,T){return C in w&&T in w[C]}r.a=function(C,T){return f(C,T)?w[C][T]:T.replace(/ \[context: [^\]]+\]$/,'')};/**
  740. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  741. * For licensing, see LICENSE.md.
  742. */let w={}},function(o,r,s){'use strict';Object.defineProperty(r,'__esModule',{value:!0});var d=s(281),u=s(276),f=s(280),h=s(277),w=s(278),C=s(282),T=s(283),P=s(284),S=s(285),E=s(286),O=s(153),V=s(287),R=s(288),F=s(71),N=s(289),M=s(290);/**
  743. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  744. * For licensing, see LICENSE.md.
  745. */class I extends d.a{}r.ClassicEditor=I,I.build={plugins:[u.a,f.a,h.a,w.a,C.a,T.a,P.a,S.a,E.a,O.a,V.a,R.a,F.a,N.a,M.a],config:s(279)}}])});
  746. //# sourceMappingURL=ckeditor.js.map