OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/app/assets/javascripts/vendor/ckeditor/ckeditor.js

6 lines
672 KiB

This file contains unexpected Bidirectional Unicode characters!

This file contains unexpected Bidirectional Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

/*!
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/
!function(e){e.en=Object.assign(e.en||{},{a:"Cannot upload file:",b:"Bold",c:"Code",d:"Upload in progress",e:"Block quote",f:"Insert table",g:"Header column",h:"Insert column left",i:"Insert column right",j:"Delete column",k:"Column",l:"Header row",m:"Insert row below",n:"Insert row above",o:"Delete row",p:"Row",q:"Merge cell up",r:"Merge cell right",s:"Merge cell down",t:"Merge cell left",u:"Split cell vertically",v:"Split cell horizontally",w:"Merge cells",x:"Rich Text Editor",y:"Full size image",z:"Side image",aa:"Left aligned image",ab:"Centered image",ac:"Right aligned image",ad:"Rich Text Editor, %0",ae:"Undo",af:"Redo",ag:"Upload failed",ah:"Insert image",ai:"Enter image caption",aj:"image widget",ak:"Link",al:"Numbered List",am:"Bulleted List",an:"Choose heading",ao:"Heading",ap:"Italic",aq:"Strikethrough",ar:"Change image text alternative",as:"Paragraph",at:"Heading 1",au:"Heading 2",av:"Heading 3",aw:"Heading 4",ax:"Heading 5",ay:"Heading 6",az:"Save",ba:"Cancel",bb:"Link URL",bc:"Unlink",bd:"Edit link",be:"Open link in new tab",bf:"This link has no URL",bg:"Text alternative"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.OPEditor=t():e.OPEditor=t()}(window,function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=193)}([function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"a",function(){return r});const o="https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html";class i extends Error{constructor(e,t){e=r(e),t&&(e+=" "+JSON.stringify(t)),super(e),this.name="CKEditorError",this.data=t}static isCKEditorError(e){return e instanceof i}}function r(e){const t=e.match(/^([^:]+):/);return t?e+` Read more: ${o}#error-${t[1]}\n`:e}},function(e,t,n){var o={},i=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}}(function(){return window&&document&&document.all&&!window.atob}),r=function(e){var t={};return function(e,n){if("function"==typeof e)return e();if(void 0===t[e]){var o=function(e,t){return t?t.querySelector(e):document.querySelector(e)}.call(this,e,n);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(e){o=null}t[e]=o}return t[e]}}(),s=null,a=0,c=[],l=n(65);function d(e,t){for(var n=0;n<e.length;n++){var i=e[n],r=o[i.id];if(r){r.refs++;for(var s=0;s<r.parts.length;s++)r.parts[s](i.parts[s]);for(;s<i.parts.length;s++)r.parts.push(g(i.parts[s],t))}else{var a=[];for(s=0;s<i.parts.length;s++)a.push(g(i.parts[s],t));o[i.id]={id:i.id,refs:1,parts:a}}}}function u(e,t){for(var n=[],o={},i=0;i<e.length;i++){var r=e[i],s=t.base?r[0]+t.base:r[0],a={css:r[1],media:r[2],sourceMap:r[3]};o[s]?o[s].parts.push(a):n.push(o[s]={id:s,parts:[a]})}return n}function h(e,t){var n=r(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var o=c[c.length-1];if("top"===e.insertAt)o?o.nextSibling?n.insertBefore(t,o.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),c.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var i=r(e.insertAt.before,n);n.insertBefore(t,i)}}function f(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=c.indexOf(e);t>=0&&c.splice(t,1)}function p(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var o=function(){0;return n.nc}();o&&(e.attrs.nonce=o)}return m(t,e.attrs),h(e,t),t}function m(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function g(e,t){var n,o,i,r;if(t.transform&&e.css){if(!(r="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=r}if(t.singleton){var c=a++;n=s||(s=p(t)),o=w.bind(null,n,c,!1),i=w.bind(null,n,c,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",m(t,e.attrs),h(e,t),t}(t),o=function(e,t,n){var o=n.css,i=n.sourceMap,r=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||r)&&(o=l(o));i&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var s=new Blob([o],{type:"text/css"}),a=e.href;e.href=URL.createObjectURL(s),a&&URL.revokeObjectURL(a)}.bind(null,n,t),i=function(){f(n),n.href&&URL.revokeObjectURL(n.href)}):(n=p(t),o=function(e,t){var n=t.css,o=t.media;o&&e.setAttribute("media",o);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),i=function(){f(n)});return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else i()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=i()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=u(e,t);return d(n,t),function(e){for(var i=[],r=0;r<n.length;r++){var s=n[r];(a=o[s.id]).refs--,i.push(a)}e&&d(u(e,t),t);for(r=0;r<i.length;r++){var a;if(0===(a=i[r]).refs){for(var c=0;c<a.parts.length;c++)a.parts[c]();delete o[a.id]}}}};var b=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}();function w(e,t,n,o){var i=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=b(t,i);else{var r=document.createTextNode(i),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(r,s[t]):e.appendChild(r)}}},function(e,t,n){"use strict";var o=n(0);const i={error(e,t){console.error(Object(o.a)(e),t)},warn(e,t){console.warn(Object(o.a)(e),t)}};t.a=i},function(e,t,n){"use strict";var o=Object.prototype.hasOwnProperty;function i(e,t){return o.call(e,t)}function r(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function s(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var a=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,c=new RegExp(a.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),l=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,d=n(22);var u=/[&<>"]/,h=/[&<>"]/g,f={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function p(e){return f[e]}var m=/[.?*+^$[\]\\(){}|-]/g;var g=n(13);t.lib={},t.lib.mdurl=n(23),t.lib.ucmicro=n(140),t.assign=function(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e},t.isString=function(e){return"[object String]"===function(e){return Object.prototype.toString.call(e)}(e)},t.has=i,t.unescapeMd=function(e){return e.indexOf("\\")<0?e:e.replace(a,"$1")},t.unescapeAll=function(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(c,function(e,t,n){return t||function(e,t){var n=0;return i(d,t)?d[t]:35===t.charCodeAt(0)&&l.test(t)&&r(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?s(n):e}(e,n)})},t.isValidEntityCode=r,t.fromCodePoint=s,t.escapeHtml=function(e){return u.test(e)?e.replace(h,p):e},t.arrayReplaceAt=function(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))},t.isSpace=function(e){switch(e){case 9:case 32:return!0}return!1},t.isWhiteSpace=function(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1},t.isMdAsciiPunct=function(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}},t.isPunctChar=function(e){return g.test(e)},t.escapeRE=function(e){return e.replace(m,"\\$&")},t.normalizeReference=function(e){return e.trim().replace(/\s+/g," ").toUpperCase()}},,function(e,t,n){"use strict";var o=n(9),i="object"==typeof self&&self&&self.Object===Object&&self,r=o.a||i||Function("return this")();t.a=r},function(e,t,n){"use strict";(function(e){var o=n(9),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,r=i&&"object"==typeof e&&e&&!e.nodeType&&e,s=r&&r.exports===i&&o.a.process,a=function(){try{var e=r&&r.require&&r.require("util").types;return e||s&&s.binding&&s.binding("util")}catch(e){}}();t.a=a}).call(this,n(12)(e))},function(e,t,n){"use strict";(function(e){var o=n(5),i=n(30),r="object"==typeof exports&&exports&&!exports.nodeType&&exports,s=r&&"object"==typeof e&&e&&!e.nodeType&&e,a=s&&s.exports===r?o.a.Buffer:void 0,c=(a?a.isBuffer:void 0)||i.a;t.a=c}).call(this,n(12)(e))},function(e,t,n){"use strict";(function(e){var t=n(2),o=n(32);const i="object"==typeof window?window:e;i.CKEDITOR_VERSION?t.a.error("ckeditor-duplicated-modules: Some CKEditor 5 modules are duplicated."):i.CKEDITOR_VERSION=o.a}).call(this,n(11))},function(e,t,n){"use strict";(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.a=n}).call(this,n(11))},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5V3h16v1.5zm0 3V6h5.674v1.5zm0 3V9h5.674v1.5zm0 3V12h5.674v1.5zm8.5-6V12h6V7.5h-6zM9.682 6h7.636c.377 0 .682.407.682.91v5.68c0 .503-.305.91-.682.91H9.682c-.377 0-.682-.407-.682-.91V6.91c0-.503.305-.91.682-.91zM2 16.5V15h16v1.5z"/></svg>'},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t){e.exports=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/},function(e,t,n){"use strict";function o(){this.__rules__=[],this.__cache__=null}o.prototype.__find__=function(e){for(var t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},o.prototype.__compile__=function(){var e=this,t=[""];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))})})},o.prototype.at=function(e,t,n){var o=this.__find__(e),i=n||{};if(-1===o)throw new Error("Parser rule not found: "+e);this.__rules__[o].fn=t,this.__rules__[o].alt=i.alt||[],this.__cache__=null},o.prototype.before=function(e,t,n,o){var i=this.__find__(e),r=o||{};if(-1===i)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null},o.prototype.after=function(e,t,n,o){var i=this.__find__(e),r=o||{};if(-1===i)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null},o.prototype.push=function(e,t,n){var o=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:o.alt||[]}),this.__cache__=null},o.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);var n=[];return e.forEach(function(e){var o=this.__find__(e);if(o<0){if(t)return;throw new Error("Rules manager: invalid rule name "+e)}this.__rules__[o].enabled=!0,n.push(e)},this),this.__cache__=null,n},o.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},o.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);var n=[];return e.forEach(function(e){var o=this.__find__(e);if(o<0){if(t)return;throw new Error("Rules manager: invalid rule name "+e)}this.__rules__[o].enabled=!1,n.push(e)},this),this.__cache__=null,n},o.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},e.exports=o},function(e,t,n){"use strict";function o(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}o.prototype.attrIndex=function(e){var t,n,o;if(!this.attrs)return-1;for(n=0,o=(t=this.attrs).length;n<o;n++)if(t[n][0]===e)return n;return-1},o.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},o.prototype.attrSet=function(e,t){var n=this.attrIndex(e),o=[e,t];n<0?this.attrPush(o):this.attrs[n]=o},o.prototype.attrGet=function(e){var t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n},o.prototype.attrJoin=function(e,t){var n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+" "+t},e.exports=o},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5V3h16v1.5zm2.5 3V12h11V7.5h-11zM4.061 6H15.94c.586 0 1.061.407 1.061.91v5.68c0 .503-.475.91-1.061.91H4.06c-.585 0-1.06-.407-1.06-.91V6.91C3 6.406 3.475 6 4.061 6zM2 16.5V15h16v1.5z"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M18 4.5V3H2v1.5h16zm0 3V6h-5.674v1.5H18zm0 3V9h-5.674v1.5H18zm0 3V12h-5.674v1.5H18zm-8.5-6V12h-6V7.5h6zm.818-1.5H2.682C2.305 6 2 6.407 2 6.91v5.68c0 .503.305.91.682.91h7.636c.377 0 .682-.407.682-.91V6.91c0-.503-.305-.91-.682-.91zM18 16.5V15H2v1.5h16z"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5V3h16v1.5zm4.5 3V12h7V7.5h-7zM5.758 6h8.484c.419 0 .758.407.758.91v5.681c0 .502-.34.909-.758.909H5.758c-.419 0-.758-.407-.758-.91V6.91c0-.503.34-.91.758-.91zM2 16.5V15h16v1.5z"/></svg>'},function(e,t){e.exports='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n xmlns:dc="http://purl.org/dc/elements/1.1/"\n xmlns:cc="http://creativecommons.org/ns#"\n xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n xmlns:svg="http://www.w3.org/2000/svg"\n xmlns="http://www.w3.org/2000/svg"\n xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"\n xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"\n class="ck ck-icon ck-button__icon"\n viewBox="0 0 20 20"\n version="1.1"\n id="svg10"\n sodipodi:docname="source.svg"\n inkscape:version="0.92.3 (2405546, 2018-03-11)">\n <defs\n id="defs14" />\n <sodipodi:namedview\n pagecolor="#ffffff"\n bordercolor="#666666"\n borderopacity="1"\n objecttolerance="10"\n gridtolerance="10"\n guidetolerance="10"\n inkscape:pageopacity="0"\n inkscape:pageshadow="2"\n inkscape:window-width="640"\n inkscape:window-height="480"\n id="namedview12"\n showgrid="false"\n inkscape:zoom="33.37544"\n inkscape:cx="10.656564"\n inkscape:cy="13.670445"\n inkscape:current-layer="svg10" />\n <g\n id="g8"\n style="fill:#000000;fill-rule:evenodd"\n transform="matrix(0.8751128,0,0,0.8751128,4.2423992,5.525391)">\n <g\n id="g6"\n style="fill:#000000">\n <g\n transform="translate(2,5.6)"\n id="g4"\n style="fill:#000000">\n <path\n d="M 10.5,0.1 15.7,4 v 1.3 l -5.6,4 C 10,9.5 9.8,9.5 9.6,9.5 9.3,9.4 9,8.8 9,8.5 L 9.3,8.1 14,4.6 9.5,1.4 9.3,1.2 C 9.2,0.9 9.2,0.6 9.3,0.4 9.5,0.2 9.8,0 10.1,0 a 0.8,0.8 0 0 1 0.4,0.1 z M 5.3,0.1 0,4 v 1.3 l 5.6,4 C 5.7,9.5 5.9,9.5 6.1,9.5 6.4,9.4 6.8,8.8 6.7,8.5 6.7,8.4 6.7,8.2 6.5,8.1 L 1.5,4.6 6.2,1.4 6.4,1.2 C 6.5,0.9 6.5,0.6 6.4,0.4 6.2,0.2 5.9,0 5.6,0 A 0.8,0.8 0 0 0 5.3,0.1 Z"\n id="path2"\n inkscape:connector-curvature="0"\n style="fill:#000000" />\n </g>\n </g>\n </g>\n <metadata\n id="metadata4596">\n <rdf:RDF>\n <cc:Work\n rdf:about="">\n <dc:title></dc:title>\n <dc:format>image/svg+xml</dc:format>\n <dc:type\n rdf:resource="http://purl.org/dc/dcmitype/StillImage" />\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <path\n style="stroke-width:0.0390625"\n d="M 1.2772336,0.02277222 V 20.022772 H 6.2381712 V 18.225897 H 3.0741087 V 1.8196472 h 8.2031253 l 3.554687,3.59375 v 3.5546875 h 1.796875 V 4.6712097 L 12.019421,0.02277222 Z"\n id="path2-3"\n inkscape:connector-curvature="0" />\n</svg>\n'},function(e,t,n){var o=n(94);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t,n){var o=n(107);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t,n){"use strict";e.exports=n(135)},function(e,t,n){"use strict";e.exports.encode=n(136),e.exports.decode=n(137),e.exports.format=n(138),e.exports.parse=n(139)},function(e,t){e.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/},function(e,t){e.exports=/[\0-\x1F\x7F-\x9F]/},function(e,t){e.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/},function(e,t,n){"use strict";var o="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",i="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",r=new RegExp("^(?:"+o+"|"+i+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|<[?].*?[?]>|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),s=new RegExp("^(?:"+o+"|"+i+")");e.exports.HTML_TAG_RE=r,e.exports.HTML_OPEN_CLOSE_TAG_RE=s},function(e,t,n){"use strict";e.exports.tokenize=function(e,t){var n,o,i,r,s=e.pos,a=e.src.charCodeAt(s);if(t)return!1;if(126!==a)return!1;if(i=(o=e.scanDelims(e.pos,!0)).length,r=String.fromCharCode(a),i<2)return!1;for(i%2&&(e.push("text","",0).content=r,i--),n=0;n<i;n+=2)e.push("text","",0).content=r+r,e.delimiters.push({marker:a,jump:n,token:e.tokens.length-1,level:e.level,end:-1,open:o.can_open,close:o.can_close});return e.pos+=o.length,!0},e.exports.postProcess=function(e){var t,n,o,i,r,s=[],a=e.delimiters,c=e.delimiters.length;for(t=0;t<c;t++)126===(o=a[t]).marker&&-1!==o.end&&(i=a[o.end],(r=e.tokens[o.token]).type="s_open",r.tag="s",r.nesting=1,r.markup="~~",r.content="",(r=e.tokens[i.token]).type="s_close",r.tag="s",r.nesting=-1,r.markup="~~",r.content="","text"===e.tokens[i.token-1].type&&"~"===e.tokens[i.token-1].content&&s.push(i.token-1));for(;s.length;){for(n=(t=s.pop())+1;n<e.tokens.length&&"s_close"===e.tokens[n].type;)n++;t!==--n&&(r=e.tokens[n],e.tokens[n]=e.tokens[t],e.tokens[t]=r)}}},function(e,t,n){"use strict";e.exports.tokenize=function(e,t){var n,o,i=e.pos,r=e.src.charCodeAt(i);if(t)return!1;if(95!==r&&42!==r)return!1;for(o=e.scanDelims(e.pos,42===r),n=0;n<o.length;n++)e.push("text","",0).content=String.fromCharCode(r),e.delimiters.push({marker:r,length:o.length,jump:n,token:e.tokens.length-1,level:e.level,end:-1,open:o.can_open,close:o.can_close});return e.pos+=o.length,!0},e.exports.postProcess=function(e){var t,n,o,i,r,s,a=e.delimiters;for(t=e.delimiters.length-1;t>=0;t--)95!==(n=a[t]).marker&&42!==n.marker||-1!==n.end&&(o=a[n.end],s=t>0&&a[t-1].end===n.end+1&&a[t-1].token===n.token-1&&a[n.end+1].token===o.token+1&&a[t-1].marker===n.marker,r=String.fromCharCode(n.marker),(i=e.tokens[n.token]).type=s?"strong_open":"em_open",i.tag=s?"strong":"em",i.nesting=1,i.markup=s?r+r:r,i.content="",(i=e.tokens[o.token]).type=s?"strong_close":"em_close",i.tag=s?"strong":"em",i.nesting=-1,i.markup=s?r+r:r,i.content="",s&&(e.tokens[a[t-1].token].content="",e.tokens[a[n.end+1].token].content="",t--))}},function(e,t,n){"use strict";t.a=function(){return!1}},function(e,t,n){"use strict";(function(e){var o=n(5),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,r=i&&"object"==typeof e&&e&&!e.nodeType&&e,s=r&&r.exports===i?o.a.Buffer:void 0,a=s?s.allocUnsafe:void 0;t.a=function(e,t){if(t)return e.slice();var n=e.length,o=a?a(n):new e.constructor(n);return e.copy(o),o}}).call(this,n(12)(e))},function(e){e.exports={a:"12.1.0"}},function(e,t){e.exports='<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M4 0v1H1v3H0V.5A.5.5 0 0 1 .5 0H4zm8 0h3.5a.5.5 0 0 1 .5.5V4h-1V1h-3V0zM4 16H.5a.5.5 0 0 1-.5-.5V12h1v3h3v1zm8 0v-1h3v-3h1v3.5a.5.5 0 0 1-.5.5H12z"/><path fill-opacity=".256" d="M1 1h14v14H1z"/><g class="ck-icon__selected-indicator"><path d="M7 0h2v1H7V0zM0 7h1v2H0V7zm15 0h1v2h-1V7zm-8 8h2v1H7v-1z"/><path fill-opacity=".254" d="M1 1h14v14H1z"/></g></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" width="20" height="20"><path d="M1.586 18.227l.398-2.753.398-2.753 2.355 2.388 2.355 2.355-2.753.365zM14.954 8.01l-7.099 7.065-.763-.796 7.065-7.066-1.592-1.559L5.5 12.721l-.763-.796 7.065-7.066-.796-.796-7.861 7.862 4.71 4.71 7.861-7.828zm3.25-1.56c.398-.397.398-1.094-.033-1.525L15.02 1.775c-.431-.432-1.128-.465-1.526-.034l-.1.1-1.525 1.493 4.71 4.71 1.526-1.493-.033-.033c.033-.033.099-.033.132-.066z"/></svg>\n'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.91 10.54c.26-.23.64-.21.88.03l3.36 3.14 2.23-2.06a.64.64 0 0 1 .87 0l2.52 2.97V4.5H3.2v10.12l3.71-4.08zm10.27-7.51c.6 0 1.09.47 1.09 1.05v11.84c0 .59-.49 1.06-1.09 1.06H2.79c-.6 0-1.09-.47-1.09-1.06V4.08c0-.58.49-1.05 1.1-1.05h14.38zm-5.22 5.56a1.96 1.96 0 1 1 3.4-1.96 1.96 1.96 0 0 1-3.4 1.96z"/></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 250"><rect rx="4"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5.042 9.367l2.189 1.837a.75.75 0 0 1-.965 1.149l-3.788-3.18a.747.747 0 0 1-.21-.284.75.75 0 0 1 .17-.945L6.23 4.762a.75.75 0 1 1 .964 1.15L4.863 7.866h8.917A.75.75 0 0 1 14 7.9a4 4 0 1 1-1.477 7.718l.344-1.489a2.5 2.5 0 1 0 1.094-4.73l.008-.032H5.042z"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M14.958 9.367l-2.189 1.837a.75.75 0 0 0 .965 1.149l3.788-3.18a.747.747 0 0 0 .21-.284.75.75 0 0 0-.17-.945L13.77 4.762a.75.75 0 1 0-.964 1.15l2.331 1.955H6.22A.75.75 0 0 0 6 7.9a4 4 0 1 0 1.477 7.718l-.344-1.489A2.5 2.5 0 1 1 6.039 9.4l-.008-.032h8.927z"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.187 17H5.773c-.637 0-1.092-.138-1.364-.415-.273-.277-.409-.718-.409-1.323V4.738c0-.617.14-1.062.419-1.332.279-.27.73-.406 1.354-.406h4.68c.69 0 1.288.041 1.793.124.506.083.96.242 1.36.478.341.197.644.447.906.75a3.262 3.262 0 0 1 .808 2.162c0 1.401-.722 2.426-2.167 3.075C15.05 10.175 16 11.315 16 13.01a3.756 3.756 0 0 1-2.296 3.504 6.1 6.1 0 0 1-1.517.377c-.571.073-1.238.11-2 .11zm-.217-6.217H7v4.087h3.069c1.977 0 2.965-.69 2.965-2.072 0-.707-.256-1.22-.768-1.537-.512-.319-1.277-.478-2.296-.478zM7 5.13v3.619h2.606c.729 0 1.292-.067 1.69-.2a1.6 1.6 0 0 0 .91-.765c.165-.267.247-.566.247-.897 0-.707-.26-1.176-.778-1.409-.519-.232-1.31-.348-2.375-.348H7z"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M12.5 5.7l5.2 3.9v1.3l-5.6 4c-.1.2-.3.2-.5.2-.3-.1-.6-.7-.6-1l.3-.4 4.7-3.5L11.5 7l-.2-.2c-.1-.3-.1-.6 0-.8.2-.2.5-.4.8-.4a.8.8 0 0 1 .4.1zm-5.2 0L2 9.6v1.3l5.6 4c.1.2.3.2.5.2.3-.1.7-.7.6-1 0-.1 0-.3-.2-.4l-5-3.5L8.2 7l.2-.2c.1-.3.1-.6 0-.8-.2-.2-.5-.4-.8-.4a.8.8 0 0 0-.3.1z"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 16.4c-.8-.4-1.5-.9-2.2-1.5a.6.6 0 0 1-.2-.5l.3-.6h1c1 1.2 2.1 1.7 3.7 1.7 1 0 1.8-.3 2.3-.6.6-.4.6-1.2.6-1.3.2-1.2-.9-2.1-.9-2.1h2.1c.3.7.4 1.2.4 1.7v.8l-.6 1.2c-.6.8-1.1 1-1.6 1.2a6 6 0 0 1-2.4.6c-1 0-1.8-.3-2.5-.6zM6.8 9L6 8.3c-.4-.5-.5-.8-.5-1.6 0-.7.1-1.3.5-1.8.4-.6 1-1 1.6-1.3a6.3 6.3 0 0 1 4.7 0 4 4 0 0 1 1.7 1l.3.7c0 .1.2.4-.2.7-.4.2-.9.1-1 0a3 3 0 0 0-1.2-1c-.4-.2-1-.3-2-.4-.7 0-1.4.2-2 .6-.8.6-1 .8-1 1.5 0 .8.5 1 1.2 1.5.6.4 1.1.7 1.9 1H6.8z"/><path d="M3 10.5V9h14v1.5z"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9.586 14.633l.021.004c-.036.335.095.655.393.962.082.083.173.15.274.201h1.474a.6.6 0 1 1 0 1.2H5.304a.6.6 0 0 1 0-1.2h1.15c.474-.07.809-.182 1.005-.334.157-.122.291-.32.404-.597l2.416-9.55a1.053 1.053 0 0 0-.281-.823 1.12 1.12 0 0 0-.442-.296H8.15a.6.6 0 0 1 0-1.2h6.443a.6.6 0 1 1 0 1.2h-1.195c-.376.056-.65.155-.823.296-.215.175-.423.439-.623.79l-2.366 9.347z"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 10.423a6.5 6.5 0 0 1 6.056-6.408l.038.67C6.448 5.423 5.354 7.663 5.22 10H9c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574zm8 0a6.5 6.5 0 0 1 6.056-6.408l.038.67c-2.646.739-3.74 2.979-3.873 5.315H17c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574z"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"><path d="M.941 4.523a.75.75 0 1 1 1.06-1.06l3.006 3.005 3.005-3.005a.75.75 0 1 1 1.06 1.06l-3.549 3.55a.75.75 0 0 1-1.168-.136L.941 4.523z"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.972 16.615a.997.997 0 0 1-.744-.292l-4.596-4.596a1 1 0 1 1 1.414-1.414l3.926 3.926 9.937-9.937a1 1 0 0 1 1.414 1.415L7.717 16.323a.997.997 0 0 1-.745.292z"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.591 10.177l4.243 4.242a1 1 0 0 1-1.415 1.415l-4.242-4.243-4.243 4.243a1 1 0 0 1-1.414-1.415l4.243-4.242L4.52 5.934A1 1 0 0 1 5.934 4.52l4.243 4.243 4.242-4.243a1 1 0 1 1 1.415 1.414l-4.243 4.243z"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5.085 6.22L2.943 4.078a.75.75 0 1 1 1.06-1.06l2.592 2.59A11.094 11.094 0 0 1 10 5.068c4.738 0 8.578 3.101 8.578 5.083 0 1.197-1.401 2.803-3.555 3.887l1.714 1.713a.75.75 0 0 1-.09 1.138.488.488 0 0 1-.15.084.75.75 0 0 1-.821-.16L6.17 7.304c-.258.11-.51.233-.757.365l6.239 6.24-.006.005.78.78c-.388.094-.78.166-1.174.215l-1.11-1.11h.011L4.55 8.197a7.2 7.2 0 0 0-.665.514l-.112.098 4.897 4.897-.005.006 1.276 1.276a10.164 10.164 0 0 1-1.477-.117l-.479-.479-.009.009-4.863-4.863-.022.031a2.563 2.563 0 0 0-.124.2c-.043.077-.08.158-.108.241a.534.534 0 0 0-.028.133.29.29 0 0 0 .008.072.927.927 0 0 0 .082.226c.067.133.145.26.234.379l3.242 3.365.025.01.59.623c-3.265-.918-5.59-3.155-5.59-4.668 0-1.194 1.448-2.838 3.663-3.93zm7.07.531a4.632 4.632 0 0 1 1.108 5.992l.345.344.046-.018a9.313 9.313 0 0 0 2-1.112c.256-.187.5-.392.727-.613.137-.134.27-.277.392-.431.072-.091.141-.185.203-.286.057-.093.107-.19.148-.292a.72.72 0 0 0 .036-.12.29.29 0 0 0 .008-.072.492.492 0 0 0-.028-.133.999.999 0 0 0-.036-.096 2.165 2.165 0 0 0-.071-.145 2.917 2.917 0 0 0-.125-.2 3.592 3.592 0 0 0-.263-.335 5.444 5.444 0 0 0-.53-.523 7.955 7.955 0 0 0-1.054-.768 9.766 9.766 0 0 0-1.879-.891c-.337-.118-.68-.219-1.027-.301zm-2.85.21l-.069.002a.508.508 0 0 0-.254.097.496.496 0 0 0-.104.679.498.498 0 0 0 .326.199l.045.005c.091.003.181.003.272.012a2.45 2.45 0 0 1 2.017 1.513c.024.061.043.125.069.185a.494.494 0 0 0 .45.287h.008a.496.496 0 0 0 .35-.158.482.482 0 0 0 .13-.335.638.638 0 0 0-.048-.219 3.379 3.379 0 0 0-.36-.723 3.438 3.438 0 0 0-2.791-1.543l-.028-.001h-.013z"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.972 16.615a.997.997 0 0 1-.744-.292l-4.596-4.596a1 1 0 1 1 1.414-1.414l3.926 3.926 9.937-9.937a1 1 0 0 1 1.414 1.415L7.717 16.323a.997.997 0 0 1-.745.292z"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.591 10.177l4.243 4.242a1 1 0 0 1-1.415 1.415l-4.242-4.243-4.243 4.243a1 1 0 0 1-1.414-1.415l4.243-4.242L4.52 5.934A1 1 0 0 1 5.934 4.52l4.243 4.243 4.242-4.243a1 1 0 1 1 1.415 1.414l-4.243 4.243z"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.077 15l.991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184zm4.919 10.562l-1.414 1.414a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.061-1.06l1.414 1.414 1.414-1.415a.75.75 0 0 1 1.061 1.061l-1.414 1.414 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414z"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7.3 17.37l-.061.088a1.518 1.518 0 0 1-.934.535l-4.178.663-.806-4.153a1.495 1.495 0 0 1 .187-1.058l.056-.086L8.77 2.639c.958-1.351 2.803-1.076 4.296-.03 1.497 1.047 2.387 2.693 1.433 4.055L7.3 17.37zM9.14 4.728l-5.545 8.346 3.277 2.294 5.544-8.346L9.14 4.728zM6.07 16.512l-3.276-2.295.53 2.73 2.746-.435zM9.994 3.506L13.271 5.8c.316-.452-.16-1.333-1.065-1.966-.905-.634-1.895-.78-2.212-.328zM8 18.5L9.375 17H19v1.5H8z"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.077 15l.991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184z"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM3.5 3v5H2V3.7H1v-1h2.5V3zM.343 17.857l2.59-3.257H2.92a.6.6 0 1 0-1.04 0H.302a2 2 0 1 1 3.995 0h-.001c-.048.405-.16.734-.333.988-.175.254-.59.692-1.244 1.312H4.3v1h-4l.043-.043zM7 14.75a.75.75 0 0 1 .75-.75h9.5a.75.75 0 1 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75z"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0C1 4.784 1.777 4 2.75 4c.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75C1.784 7.5 1 6.723 1 5.75zm6 9c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0c0-.966.777-1.75 1.75-1.75.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75-.966 0-1.75-.777-1.75-1.75z"/></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M415.462 96.978c-88.1-88.1-230.824-88.1-318.924 0-87.22 87.22-87.22 229.943 0 318.044 88.1 88.1 230.824 88.1 318.924 0 87.22-88.1 87.22-230.824 0-318.044zM246.31 437.047c-24.668 0-44.05-20.263-44.05-44.05 0-24.669 19.382-44.05 44.05-44.05 24.668 0 44.05 19.381 44.05 44.05 0 23.787-20.263 44.05-44.05 44.05zm30.835-154.176v23.787c0 12.334-4.405 16.74-15.858 16.74h-32.597c-11.453 0-15.858-4.406-15.858-16.74v-53.742c0-14.096 14.096-18.5 26.43-22.025 2.643-.88 6.167-1.762 8.81-2.643 16.74-6.167 26.43-13.215 26.43-30.835 0-6.167 0-23.787-29.073-23.787-17.62 0-33.478 7.048-43.17 10.572-5.285 2.643-7.929 3.524-11.453 3.524-5.286 0-10.572-4.405-11.453-9.691L167.9 148.958c-.88-2.643-.88-5.286-.88-7.048 0-21.145 66.075-33.479 88.1-33.479 55.503 0 93.387 36.122 93.387 88.982 0 58.146-44.05 75.767-71.362 85.458z"/></svg>'},function(e,t){e.exports='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n xmlns:dc="http://purl.org/dc/elements/1.1/"\n xmlns:cc="http://creativecommons.org/ns#"\n xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n xmlns:svg="http://www.w3.org/2000/svg"\n xmlns="http://www.w3.org/2000/svg"\n xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"\n xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"\n class="ck ck-icon ck-button__icon"\n viewBox="0 0 20 20"\n version="1.1"\n id="svg10"\n sodipodi:docname="code-block.svg"\n inkscape:version="0.92.3 (2405546, 2018-03-11)">\n <defs\n id="defs14" />\n <sodipodi:namedview\n pagecolor="#ffffff"\n bordercolor="#666666"\n borderopacity="1"\n objecttolerance="10"\n gridtolerance="10"\n guidetolerance="10"\n inkscape:pageopacity="0"\n inkscape:pageshadow="2"\n inkscape:window-width="640"\n inkscape:window-height="480"\n id="namedview12"\n showgrid="false"\n inkscape:zoom="33.37544"\n inkscape:cx="10.656564"\n inkscape:cy="13.670445"\n inkscape:current-layer="svg10" />\n <g\n id="g8"\n style="fill:none;fill-rule:evenodd"\n transform="matrix(0.8751128,0,0,0.8751128,1.3360704,0.91121972)">\n <g\n id="g6"\n style="fill:#353535">\n <g\n transform="translate(2,5.6)"\n id="g4">\n <path\n d="M 10.5,0.1 15.7,4 v 1.3 l -5.6,4 C 10,9.5 9.8,9.5 9.6,9.5 9.3,9.4 9,8.8 9,8.5 L 9.3,8.1 14,4.6 9.5,1.4 9.3,1.2 C 9.2,0.9 9.2,0.6 9.3,0.4 9.5,0.2 9.8,0 10.1,0 a 0.8,0.8 0 0 1 0.4,0.1 z M 5.3,0.1 0,4 v 1.3 l 5.6,4 C 5.7,9.5 5.9,9.5 6.1,9.5 6.4,9.4 6.8,8.8 6.7,8.5 6.7,8.4 6.7,8.2 6.5,8.1 L 1.5,4.6 6.2,1.4 6.4,1.2 C 6.5,0.9 6.5,0.6 6.4,0.4 6.2,0.2 5.9,0 5.6,0 A 0.8,0.8 0 0 0 5.3,0.1 Z"\n id="path2"\n inkscape:connector-curvature="0" />\n </g>\n </g>\n </g>\n <path\n style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#353535;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.09228408;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"\n d="M 0.22004104,0.22004104 V 0.76600468 19.779959 H 19.779959 V 0.22004104 Z M 1.3119682,1.3119682 H 18.688032 V 18.688032 H 1.3119682 Z"\n id="rect3722"\n inkscape:connector-curvature="0" />\n <metadata\n id="metadata4596">\n <rdf:RDF>\n <cc:Work\n rdf:about="">\n <dc:title></dc:title>\n <dc:format>image/svg+xml</dc:format>\n <dc:type\n rdf:resource="http://purl.org/dc/dcmitype/StillImage" />\n </cc:Work>\n </rdf:RDF>\n </metadata>\n</svg>\n'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="20"><path d="M124 334v14c84 139 279 139 362 0v-14c-83-139-278-139-362 0zm181 91c-46 0-83-38-83-84s37-83 83-83c47 0 84 37 84 83s-37 84-84 84zm42-84c0 23-19 42-42 42s-41-19-41-42 18-42 41-42 42 19 42 42zm83-254L312-32H37v512h127v-46H83V14h210l91 92v91h46V87z"/></svg>\n'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 6v3h4V6H3zm0 4v3h4v-3H3zm0 4v3h4v-3H3zm5 3h4v-3H8v3zm5 0h4v-3h-4v3zm4-4v-3h-4v3h4zm0-4V6h-4v3h4zm1.5 8a1.5 1.5 0 0 1-1.5 1.5H3A1.5 1.5 0 0 1 1.5 17V4c.222-.863 1.068-1.5 2-1.5h13c.932 0 1.778.637 2 1.5v13zM12 13v-3H8v3h4zm0-4V6H8v3h4z"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M18 7v1H2V7h16zm0 5v1H2v-1h16z" opacity=".6"/><path d="M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1zm-2 1H8v4h4V2zm0 6H8v4h4V8zm0 6H8v4h4v-4z"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v16h-1V2z" opacity=".6"/><path d="M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1 2v4h4V8H2zm6 0v4h4V8H8zm6 0v4h4V8h-4z"/></svg>'},function(e,t){e.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v7h-1V2zm6 5v1H2V7h16zM8 12v1H2v-1h6z" opacity=".6"/><path d="M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1 2v9h10V9H8z"/></svg>'},function(e,t){e.exports='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n xmlns:dc="http://purl.org/dc/elements/1.1/"\n xmlns:cc="http://creativecommons.org/ns#"\n xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n xmlns:svg="http://www.w3.org/2000/svg"\n xmlns="http://www.w3.org/2000/svg"\n xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"\n xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"\n viewBox="0 0 512 512"\n version="1.1"\n id="svg4"\n sodipodi:docname="wysiwyg.svg"\n inkscape:version="0.92.3 (2405546, 2018-03-11)">\n <metadata\n id="metadata10">\n <rdf:RDF>\n <cc:Work\n rdf:about="">\n <dc:format>image/svg+xml</dc:format>\n <dc:type\n rdf:resource="http://purl.org/dc/dcmitype/StillImage" />\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <defs\n id="defs8" />\n <sodipodi:namedview\n pagecolor="#ffffff"\n bordercolor="#666666"\n borderopacity="1"\n objecttolerance="10"\n gridtolerance="10"\n guidetolerance="10"\n inkscape:pageopacity="0"\n inkscape:pageshadow="2"\n inkscape:window-width="640"\n inkscape:window-height="480"\n id="namedview6"\n showgrid="false"\n inkscape:zoom="1.3037281"\n inkscape:cx="252.52639"\n inkscape:cy="155.86537"\n inkscape:current-layer="svg4" />\n <path\n d="m 166.9714,230.61312 h 185 v 31 h -185 z m 1,-61 h 185 v 32 h -185 z m 0,-61 h 185 v 32 h -185 z m 289,5 -118,-118.0000009 H 63.971404 V 507.61312 H 457.9714 v -394 z m -347,348 V 41.613119 h 210 l 92,92.000001 v 328 z"\n id="path2"\n inkscape:connector-curvature="0"\n sodipodi:nodetypes="cccccccccccccccccccccccccccc" />\n <rect\n style="fill:#000000;fill-opacity:1;stroke:#353535;stroke-opacity:1"\n id="rect832"\n width="184.08746"\n height="112.75357"\n x="169.51387"\n y="313.33896" />\n</svg>\n'},function(e,t,n){var o=n(64);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck.ck-placeholder:before,.ck .ck-placeholder:before{content:attr(data-placeholder);pointer-events:none;cursor:text;color:var(--ck-color-engine-placeholder-text)}"},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,o=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var i,r=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(r)?e:(i=0===r.indexOf("//")?r:0===r.indexOf("/")?n+r:o+r.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")})}},function(e,t,n){var o=n(67);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck-hidden{display:none!important}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{box-sizing:border-box;width:auto;height:auto;position:static}:root{--ck-z-default:1;--ck-z-modal:calc(var(--ck-z-default) + 999);--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#c4c4c4;--ck-color-base-action:#61b045;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#198cf0;--ck-color-base-active-focus:#0e7fe1;--ck-color-base-error:#db3700;--ck-color-focus-border:#47a4f5;--ck-color-focus-shadow:rgba(119,186,248,0.5);--ck-color-focus-disabled-shadow:rgba(119,186,248,0.3);--ck-color-focus-error-shadow:rgba(255,64,31,0.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,0.15);--ck-color-shadow-drop-active:rgba(0,0,0,0.2);--ck-color-shadow-inner:rgba(0,0,0,0.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#e6e6e6;--ck-color-button-default-active-background:#d9d9d9;--ck-color-button-default-active-shadow:#bfbfbf;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#dedede;--ck-color-button-on-hover-background:#c4c4c4;--ck-color-button-on-active-background:#bababa;--ck-color-button-on-active-shadow:#a1a1a1;--ck-color-button-on-disabled-background:#dedede;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#579e3d;--ck-color-button-action-active-background:#53973b;--ck-color-button-action-active-shadow:#498433;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#b0b0b0;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:#c7c7c7;--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:#c7c7c7;--ck-color-input-disabled-text:#5c5c5c;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-base-active);--ck-color-list-button-on-background-focus:var(--ck-color-base-active-focus);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-foreground);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-upload-infinite-background:rgba(0,0,0,0.1);--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,177,255,0.1);--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{margin:0;padding:0;border:0;background:transparent;text-decoration:none;vertical-align:middle;transition:none;word-wrap:break-word}.ck.ck-reset_all,.ck.ck-reset_all *{border-collapse:collapse;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);color:var(--ck-color-text);text-align:left;white-space:nowrap;cursor:auto;float:none}.ck.ck-reset_all .ck-rtl *{text-align:right}.ck.ck-reset_all iframe{vertical-align:inherit}.ck.ck-reset_all textarea{white-space:pre-wrap}.ck.ck-reset_all input[type=password],.ck.ck-reset_all input[type=text],.ck.ck-reset_all textarea{cursor:text}.ck.ck-reset_all input[type=password][disabled],.ck.ck-reset_all input[type=text][disabled],.ck.ck-reset_all textarea[disabled]{cursor:default}.ck.ck-reset_all fieldset{padding:10px;border:2px groove #dfdee3}.ck.ck-reset_all button::-moz-focus-inner{padding:0;border:0}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}"},function(e,t,n){var o=n(69);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0}.ck-rounded-corners .ck.ck-editor__editable:not(.ck-editor__nested-editable),.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-focused{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0}.ck.ck-editor__editable_inline{overflow:auto;padding:0 var(--ck-spacing-standard);border:1px solid transparent}.ck.ck-editor__editable_inline>:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}"},function(e,t,n){var o=n(71);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"},function(e,t,n){var o=n(73);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{z-index:var(--ck-z-modal);position:fixed;top:0}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{top:auto;position:absolute}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{box-shadow:var(--ck-drop-shadow),0 0;border-width:0 1px 1px;border-top-left-radius:0;border-top-right-radius:0}"},function(e,t,n){var o=n(75);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck.ck-toolbar{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-flow:row wrap;align-items:center}.ck.ck-toolbar.ck-toolbar_vertical{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating{flex-wrap:nowrap}.ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar__newline{display:block;width:100%}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);padding:0 var(--ck-spacing-small);border:1px solid var(--ck-color-toolbar-border)}.ck.ck-toolbar>*{margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>*{width:100%;margin:0;border-radius:0;border:0}.ck.ck-toolbar>:last-child{margin-right:0}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar__separator{align-self:stretch;width:1px;margin-top:0;margin-bottom:0;background:var(--ck-color-toolbar-border)}.ck.ck-toolbar__newline{margin:0}"},function(e,t,n){var o=n(77);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}"},function(e,t,n){var o=n(79);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{width:var(--ck-icon-size);height:var(--ck-icon-size);font-size:.8333350694em;will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon :not([fill]){fill:currentColor}"},function(e,t,n){var o=n(81);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports='.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck-tooltip{visibility:hidden;opacity:0;display:none;z-index:var(--ck-z-modal)}.ck-tooltip .ck-tooltip__text{display:inline-block}.ck-tooltip .ck-tooltip__text:after{content:"";width:0;height:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%}.ck.ck-tooltip.ck-tooltip_s{bottom:calc(-1*var(--ck-tooltip-arrow-size));transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after{top:calc(-1*var(--ck-tooltip-arrow-size));transform:translateX(-50%);border-left-color:transparent;border-bottom-color:var(--ck-color-tooltip-background);border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:0}.ck.ck-tooltip.ck-tooltip_n{top:calc(-1*var(--ck-tooltip-arrow-size));transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(-1*var(--ck-tooltip-arrow-size));transform:translateX(-50%);border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;border-top-color:var(--ck-color-tooltip-background);border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:0;border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip .ck-tooltip__text{border-radius:0}.ck-rounded-corners .ck.ck-tooltip .ck-tooltip__text,.ck.ck-tooltip .ck-tooltip__text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-tooltip .ck-tooltip__text{font-size:.9em;line-height:1.5;color:var(--ck-color-tooltip-text);padding:var(--ck-spacing-small) var(--ck-spacing-medium);background:var(--ck-color-tooltip-background);position:relative;left:-50%}.ck.ck-tooltip .ck-tooltip__text:after{border-style:solid;left:50%}.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{transition:opacity .2s ease-in-out .2s}'},function(e,t,n){var o=n(83);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck.ck-button,a.ck.ck-button{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:block}@media (hover:none){.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:none}}.ck.ck-button,a.ck.ck-button{position:relative;display:inline-flex;align-items:center;justify-content:left}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button:hover .ck-tooltip,a.ck.ck-button:hover .ck-tooltip{visibility:visible;opacity:1}.ck.ck-button .ck-button__label,.ck.ck-button:focus:not(:hover) .ck-tooltip,a.ck.ck-button .ck-button__label,a.ck.ck-button:focus:not(:hover) .ck-tooltip{display:none}.ck.ck-button,a.ck.ck-button{background:var(--ck-color-button-default-background)}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-default-active-shadow)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck.ck-button,a.ck.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button,a.ck.ck-button{white-space:nowrap;cursor:default;vertical-align:middle;padding:var(--ck-spacing-tiny);text-align:center;min-width:var(--ck-ui-component-min-height);min-height:var(--ck-ui-component-min-height);line-height:1;font-size:inherit;border:1px solid transparent;transition:box-shadow .2s ease-in-out;-webkit-appearance:none}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;border-color:transparent}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__icon{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}.ck.ck-button.ck-button_with-text .ck-button__icon,a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:calc(-1*var(--ck-spacing-small));margin-right:var(--ck-spacing-small)}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-on-active-shadow)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{font-size:inherit;font-weight:inherit;color:inherit;cursor:inherit;vertical-align:middle}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-action-active-shadow)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-action,a.ck.ck-button-action{color:var(--ck-color-button-action-text)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}"},function(e,t,n){var o=n(85);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck .ck-widget.ck-widget_with-selection-handler{position:relative}.ck .ck-widget.ck-widget_with-selection-handler .ck-widget__selection-handler{visibility:hidden;position:absolute}.ck .ck-widget.ck-widget_with-selection-handler .ck-widget__selection-handler .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handler.ck-widget_selected .ck-widget__selection-handler,.ck .ck-widget.ck-widget_with-selection-handler:hover .ck-widget__selection-handler{visibility:visible}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{outline-width:var(--ck-widget-outline-thickness);outline-style:solid;outline-color:transparent;transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;background-color:var(--ck-color-widget-editable-focus-background)}.ck-editor__editable>.ck-widget.ck-widget_with-selection-handler:first-child,.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handler:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}.ck .ck-widget.ck-widget_with-selection-handler .ck-widget__selection-handler{padding:4px;box-sizing:border-box;background-color:transparent;opacity:0;transition:background-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),visibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;transform:translateY(-100%);left:calc(0px - var(--ck-widget-outline-thickness))}.ck .ck-widget.ck-widget_with-selection-handler .ck-widget__selection-handler:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handler .ck-widget__selection-handler .ck-icon{width:var(--ck-widget-handler-icon-size);height:var(--ck-widget-handler-icon-size);color:var(--ck-color-widget-drag-handler-icon-color)}.ck .ck-widget.ck-widget_with-selection-handler .ck-widget__selection-handler .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handler.ck-widget_selected .ck-widget__selection-handler,.ck .ck-widget.ck-widget_with-selection-handler.ck-widget_selected:hover .ck-widget__selection-handler{opacity:1;background-color:var(--ck-color-focus-border)}.ck .ck-widget.ck-widget_with-selection-handler.ck-widget_selected .ck-widget__selection-handler .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handler.ck-widget_selected:hover .ck-widget__selection-handler .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handler:hover .ck-widget__selection-handler{opacity:1;background-color:var(--ck-color-widget-hover-border)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected .ck-widget__selection-handler,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected .ck-widget__selection-handler:hover,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover .ck-widget__selection-handler,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover .ck-widget__selection-handler:hover{background:var(--ck-color-widget-blurred-border)}.ck-editor__editable.ck-read-only .ck-widget{--ck-widget-outline-thickness:0}"},function(e,t,n){var o=n(87);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=':root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:"";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px}.ck.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{width:0;height:0;border-style:solid}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:var(--ck-balloon-arrow-height);border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:0}.ck.ck-balloon-panel[class*=arrow_n]:before{border-bottom-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-color:transparent;border-right-color:transparent;border-top-color:transparent}.ck.ck-balloon-panel[class*=arrow_n]:after{border-bottom-color:var(--ck-color-panel-background);margin-top:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:0;border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-top-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent}.ck.ck-balloon-panel[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background);margin-bottom:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(-1*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{left:50%;margin-left:calc(-1*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{left:calc(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{right:calc(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}'},function(e,t,n){var o=n(89);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck-content .image{position:relative;overflow:hidden}.ck-content .image .ck-progress-bar{position:absolute;top:0;left:0}:root{--ck-image-upload-progress-line-width:30px}.ck-content .image.ck-appear{animation:fadeIn .7s}.ck-content .image .ck-progress-bar{height:2px;width:0;background:var(--ck-color-upload-bar-background);transition:width .1s}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}"},function(e,t,n){var o=n(91);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports='.ck-image-upload-complete-icon{display:block;position:absolute;top:10px;right:10px;border-radius:50%}.ck-image-upload-complete-icon:after{content:"";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20px;--ck-image-upload-icon-width:2px}.ck-image-upload-complete-icon{width:var(--ck-image-upload-icon-size);height:var(--ck-image-upload-icon-size);opacity:0;background:var(--ck-color-image-upload-icon-background);animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;animation-fill-mode:forwards,forwards;animation-duration:.5s,.5s;font-size:var(--ck-image-upload-icon-size);animation-delay:0ms,3s}.ck-image-upload-complete-icon:after{left:25%;top:50%;opacity:0;height:0;width:0;transform:scaleX(-1) rotate(135deg);transform-origin:left top;border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);animation-name:ck-upload-complete-icon-check;animation-duration:.5s;animation-delay:.5s;animation-fill-mode:forwards;box-sizing:border-box}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{opacity:1;width:0;height:0}33%{width:.3em;height:0}to{opacity:1;width:.3em;height:.45em}}'},function(e,t,n){var o=n(93);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports='.ck .ck-upload-placeholder-loader{position:absolute;display:flex;align-items:center;justify-content:center;top:0;left:0}.ck .ck-upload-placeholder-loader:before{content:"";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px}.ck .ck-image-upload-placeholder{width:100%;margin:0}.ck .ck-upload-placeholder-loader{width:100%;height:100%}.ck .ck-upload-placeholder-loader:before{width:var(--ck-upload-placeholder-loader-size);height:var(--ck-upload-placeholder-loader-size);border-radius:50%;border-top:3px solid var(--ck-color-upload-placeholder-loader);border-right:2px solid transparent;animation:ck-upload-placeholder-loader 1s linear infinite}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}'},function(e,t){e.exports=".ck-content code{background-color:hsla(0,0%,78%,.3);padding:.15em;border-radius:2px}"},function(e,t,n){var o=n(96);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;font-style:italic;border-left:5px solid #ccc}"},function(e,t,n){var o=n(98);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on .ck-tooltip{display:none}.ck.ck-dropdown .ck-dropdown__panel{-webkit-backface-visibility:hidden;display:none;z-index:var(--ck-z-modal);position:absolute}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block;will-change:transform}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{transform:translate3d(0,100%,0)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}:root{--ck-dropdown-arrow-size:calc(0.5*var(--ck-icon-size))}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{right:var(--ck-spacing-standard);width:var(--ck-dropdown-arrow-size);margin-left:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{width:7em;overflow:hidden;text-overflow:ellipsis}.ck.ck-dropdown__panel{box-shadow:var(--ck-drop-shadow),0 0;border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;min-width:100%}"},function(e,t,n){var o=n(100);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck.ck-list{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:column}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{list-style-type:none;background:var(--ck-color-list-background)}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{min-height:unset;width:100%;text-align:left;border-radius:0;border:0;padding:calc(0.2*var(--ck-line-height-base)*var(--ck-font-size-base)) calc(0.4*var(--ck-line-height-base)*var(--ck-font-size-base))}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(1.2*var(--ck-line-height-base)*var(--ck-font-size-base))}.ck.ck-list__item .ck-button:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on{background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item .ck-button.ck-on:hover:not(ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item .ck-button.ck-on:active{box-shadow:none}.ck.ck-list__item .ck-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item .ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item .ck-switchbutton.ck-on:hover:not(ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck.ck-list__separator{height:1px;width:100%;background:var(--ck-color-base-border)}"},function(e,t,n){var o=n(102);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:1.0769230769em;--ck-switch-button-toggle-spacing:1px}.ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(2*var(--ck-spacing-large))}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton .ck-button__toggle{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto;transition:background .4s ease;width:var(--ck-switch-button-toggle-width);background:var(--ck-color-switch-button-off-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:calc(0.5*var(--ck-border-radius))}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{margin:var(--ck-switch-button-toggle-spacing);width:var(--ck-switch-button-toggle-inner-size);height:var(--ck-switch-button-toggle-inner-size);background:var(--ck-color-switch-button-inner-background);transition:transform .3s ease}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle{background:var(--ck-color-switch-button-on-background)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(1.3846153847em)}"},function(e,t,n){var o=n(104);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck.ck-toolbar-dropdown .ck-toolbar{flex-wrap:nowrap}.ck.ck-toolbar-dropdown .ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}"},function(e,t,n){var o=n(106);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}"},function(e,t){e.exports=".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}"},function(e,t,n){var o=n(109);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck.ck-labeled-input .ck-labeled-input__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-input .ck-labeled-input__status_error{color:var(--ck-color-base-error)}"},function(e,t,n){var o=n(111);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=":root{--ck-input-text-width:18em}.ck.ck-input-text{border-radius:0}.ck-rounded-corners .ck.ck-input-text,.ck.ck-input-text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-text{box-shadow:var(--ck-inner-shadow),0 0;background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);min-width:var(--ck-input-text-width);min-height:var(--ck-ui-component-min-height);transition-property:box-shadow,border;transition:.2s ease-in-out}.ck.ck-input-text:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),var(--ck-inner-shadow)}.ck.ck-input-text[readonly]{border:1px solid var(--ck-color-input-disabled-border);background:var(--ck-color-input-disabled-background);color:var(--ck-color-input-disabled-text)}.ck.ck-input-text[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),var(--ck-inner-shadow)}.ck.ck-input-text.ck-error{border-color:var(--ck-color-input-error-border);animation:ck-text-input-shake .3s ease both}.ck.ck-input-text.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),var(--ck-inner-shadow)}@keyframes ck-text-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}"},function(e,t,n){var o=n(113);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-input{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-input{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}.ck.ck-text-alternative-form{padding:var(--ck-spacing-standard)}.ck.ck-text-alternative-form:focus{outline:none}.ck.ck-text-alternative-form>:not(:first-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-text-alternative-form{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-text-alternative-form .ck-labeled-input{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-text-alternative-form .ck-labeled-input .ck-input-text{min-width:0;width:100%}.ck.ck-text-alternative-form .ck-button{padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);margin-left:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}.ck.ck-text-alternative-form .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}}"},function(e,t,n){var o=n(115);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck-content .image{clear:both;text-align:center;margin:1em 0}.ck-content .image>img{display:block;margin:0 auto;max-width:100%}"},function(e,t,n){var o=n(117);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck-content .image>figcaption{color:#333;background-color:#f7f7f7;padding:.6em;font-size:.75em;outline-offset:-1px}"},function(e,t,n){var o=n(119);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=":root{--ck-image-style-spacing:1.5em}.ck-content .image-style-align-center,.ck-content .image-style-align-left,.ck-content .image-style-align-right,.ck-content .image-style-side{max-width:50%}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing)}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}"},function(e,t,n){var o=n(121);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}"},function(e,t,n){var o=n(123);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck.ck-link-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-input{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form{padding:var(--ck-spacing-standard)}.ck.ck-link-form:focus{outline:none}.ck.ck-link-form>:not(:first-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-form{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-link-form .ck-labeled-input{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-form .ck-labeled-input .ck-input-text{min-width:0;width:100%}.ck.ck-link-form .ck-button{padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);margin-left:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}.ck.ck-link-form .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}}"},function(e,t,n){var o=n(125);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions{padding:var(--ck-spacing-standard)}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{padding:0 var(--ck-spacing-medium);color:var(--ck-color-link-default);text-overflow:ellipsis;cursor:pointer;max-width:var(--ck-input-text-width);min-width:3em;text-align:center}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions:focus{outline:none}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{min-width:0;max-width:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);margin-left:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview):first-of-type{border-right:1px solid var(--ck-color-base-border)}}"},function(e,t,n){var o=n(127);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=":root{--ck-color-table-focused-cell-background:#f5fafe}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused{background:var(--ck-color-table-focused-cell-background);border-style:none;outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}"},function(e,t,n){var o=n(129);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=":root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px;--ck-insert-table-dropdown-box-border-color:#bfbfbf;--ck-insert-table-dropdown-box-border-active-color:#53a0e4;--ck-insert-table-dropdown-box-active-background:#c7e5ff}.ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap;width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2);padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0}.ck .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{width:var(--ck-insert-table-dropdown-box-width);height:var(--ck-insert-table-dropdown-box-height);margin:var(--ck-insert-table-dropdown-box-margin);border:1px solid var(--ck-insert-table-dropdown-box-border-color);border-radius:1px}.ck .ck-insert-table-dropdown-grid-box.ck-on{border-color:var(--ck-insert-table-dropdown-box-border-active-color);background:var(--ck-insert-table-dropdown-box-active-background)}"},function(e,t,n){var o=n(131);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=".ck-content .table{margin:1em auto;display:table}.ck-content .table table{border-collapse:collapse;border-spacing:0;border:1px double #b3b3b3}.ck-content .table table td,.ck-content .table table th{min-width:2em;padding:.4em;border-color:#d9d9d9}.ck-content .table table th{font-weight:700;background:#fafafa}"},function(e,t){},function(e,t,n){"use strict";e.exports=n(134)},function(e,t,n){"use strict";var o=n(3),i=n(142),r=n(146),s=n(147),a=n(155),c=n(169),l=n(182),d=n(23),u=n(184),h={default:n(186),zero:n(187),commonmark:n(188)},f=/^(vbscript|javascript|file|data):/,p=/^data:image\/(gif|png|jpeg|webp);/;function m(e){var t=e.trim().toLowerCase();return!f.test(t)||!!p.test(t)}var g=["http:","https:","mailto:"];function b(e){var t=d.parse(e,!0);if(t.hostname&&(!t.protocol||g.indexOf(t.protocol)>=0))try{t.hostname=u.toASCII(t.hostname)}catch(e){}return d.encode(d.format(t))}function w(e){var t=d.parse(e,!0);if(t.hostname&&(!t.protocol||g.indexOf(t.protocol)>=0))try{t.hostname=u.toUnicode(t.hostname)}catch(e){}return d.decode(d.format(t))}function _(e,t){if(!(this instanceof _))return new _(e,t);t||o.isString(e)||(t=e||{},e="default"),this.inline=new c,this.block=new a,this.core=new s,this.renderer=new r,this.linkify=new l,this.validateLink=m,this.normalizeLink=b,this.normalizeLinkText=w,this.utils=o,this.helpers=o.assign({},i),this.options={},this.configure(e),t&&this.set(t)}_.prototype.set=function(e){return o.assign(this.options,e),this},_.prototype.configure=function(e){var t,n=this;if(o.isString(e)&&!(e=h[t=e]))throw new Error('Wrong `markdown-it` preset "'+t+'", check name');if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&n.set(e.options),e.components&&Object.keys(e.components).forEach(function(t){e.components[t].rules&&n[t].ruler.enableOnly(e.components[t].rules),e.components[t].rules2&&n[t].ruler2.enableOnly(e.components[t].rules2)}),this},_.prototype.enable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(t){n=n.concat(this[t].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));var o=e.filter(function(e){return n.indexOf(e)<0});if(o.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+o);return this},_.prototype.disable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(t){n=n.concat(this[t].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));var o=e.filter(function(e){return n.indexOf(e)<0});if(o.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+o);return this},_.prototype.use=function(e){var t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},_.prototype.parse=function(e,t){if("string"!=typeof e)throw new Error("Input data should be a String");var n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},_.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},_.prototype.parseInline=function(e,t){var n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},_.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)},e.exports=_},function(e){e.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=",bnequiv:"≡",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:"",emsp14:"",emsp:"",ENG:"Ŋ",eng:"ŋ",ensp:"",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩",gvnE:"≩",Hacek:"ˇ",hairsp:"",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅",in:"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺",int:"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨",lvnE:"≨",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:"",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:"",nvap:"≍",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥",nvgt:">",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤",nvlt:"<",nvltrie:"⊴",nvrArr:"⤃",nvrtrie:"⊵",nvsim:"∼",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:"",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓",sqcup:"⊔",sqcups:"⊔",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"",ThinSpace:"",thinsp:"",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊",varsubsetneqq:"⫋",varsupsetneq:"⊋",varsupsetneqq:"⫌",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:"",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂",vnsup:"⊃",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋",vsubne:"⊊",vsupnE:"⫌",vsupne:"⊋",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""}},function(e,t,n){"use strict";var o={};function i(e,t,n){var r,s,a,c,l,d="";for("string"!=typeof t&&(n=t,t=i.defaultChars),void 0===n&&(n=!0),l=function(e){var t,n,i=o[e];if(i)return i;for(i=o[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),/^[0-9a-z]$/i.test(n)?i.push(n):i.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2));for(t=0;t<e.length;t++)i[e.charCodeAt(t)]=e[t];return i}(t),r=0,s=e.length;r<s;r++)if(a=e.charCodeAt(r),n&&37===a&&r+2<s&&/^[0-9a-f]{2}$/i.test(e.slice(r+1,r+3)))d+=e.slice(r,r+3),r+=2;else if(a<128)d+=l[a];else if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&r+1<s&&(c=e.charCodeAt(r+1))>=56320&&c<=57343){d+=encodeURIComponent(e[r]+e[r+1]),r++;continue}d+="%EF%BF%BD"}else d+=encodeURIComponent(e[r]);return d}i.defaultChars=";/?:@&=+$,-_.!~*'()#",i.componentChars="-_.!~*'()",e.exports=i},function(e,t,n){"use strict";var o={};function i(e,t){var n;return"string"!=typeof t&&(t=i.defaultChars),n=function(e){var t,n,i=o[e];if(i)return i;for(i=o[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),i.push(n);for(t=0;t<e.length;t++)i[n=e.charCodeAt(t)]="%"+("0"+n.toString(16).toUpperCase()).slice(-2);return i}(t),e.replace(/(%[a-f0-9]{2})+/gi,function(e){var t,o,i,r,s,a,c,l="";for(t=0,o=e.length;t<o;t+=3)(i=parseInt(e.slice(t+1,t+3),16))<128?l+=n[i]:192==(224&i)&&t+3<o&&128==(192&(r=parseInt(e.slice(t+4,t+6),16)))?(l+=(c=i<<6&1984|63&r)<128?"<EFBFBD><EFBFBD>":String.fromCharCode(c),t+=3):224==(240&i)&&t+6<o&&(r=parseInt(e.slice(t+4,t+6),16),s=parseInt(e.slice(t+7,t+9),16),128==(192&r)&&128==(192&s))?(l+=(c=i<<12&61440|r<<6&4032|63&s)<2048||c>=55296&&c<=57343?"<EFBFBD><EFBFBD><EFBFBD>":String.fromCharCode(c),t+=6):240==(248&i)&&t+9<o&&(r=parseInt(e.slice(t+4,t+6),16),s=parseInt(e.slice(t+7,t+9),16),a=parseInt(e.slice(t+10,t+12),16),128==(192&r)&&128==(192&s)&&128==(192&a))?((c=i<<18&1835008|r<<12&258048|s<<6&4032|63&a)<65536||c>1114111?l+="<EFBFBD><EFBFBD><EFBFBD><EFBFBD>":(c-=65536,l+=String.fromCharCode(55296+(c>>10),56320+(1023&c))),t+=9):l+="<EFBFBD>";return l})}i.defaultChars=";/?:@&=+$,#",i.componentChars="",e.exports=i},function(e,t,n){"use strict";e.exports=function(e){var t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||""}},function(e,t,n){"use strict";function o(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var i=/^([a-z0-9.+-]+:)/i,r=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,a=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(a),l=["%","/","?",";","#"].concat(c),d=["/","?","#"],u=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},p={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};o.prototype.parse=function(e,t){var n,o,r,a,c,m=e;if(m=m.trim(),!t&&1===e.split("#").length){var g=s.exec(m);if(g)return this.pathname=g[1],g[2]&&(this.search=g[2]),this}var b=i.exec(m);if(b&&(r=(b=b[0]).toLowerCase(),this.protocol=b,m=m.substr(b.length)),(t||b||m.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(c="//"===m.substr(0,2))||b&&f[b]||(m=m.substr(2),this.slashes=!0)),!f[b]&&(c||b&&!p[b])){var w,_,k=-1;for(n=0;n<d.length;n++)-1!==(a=m.indexOf(d[n]))&&(-1===k||a<k)&&(k=a);for(-1!==(_=-1===k?m.lastIndexOf("@"):m.lastIndexOf("@",k))&&(w=m.slice(0,_),m=m.slice(_+1),this.auth=w),k=-1,n=0;n<l.length;n++)-1!==(a=m.indexOf(l[n]))&&(-1===k||a<k)&&(k=a);-1===k&&(k=m.length),":"===m[k-1]&&k--;var v=m.slice(0,k);m=m.slice(k),this.parseHost(v),this.hostname=this.hostname||"";var y="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!y){var x=this.hostname.split(/\./);for(n=0,o=x.length;n<o;n++){var C=x[n];if(C&&!C.match(u)){for(var A="",P=0,E=C.length;P<E;P++)C.charCodeAt(P)>127?A+="x":A+=C[P];if(!A.match(u)){var T=x.slice(0,n),S=x.slice(n+1),R=C.match(h);R&&(T.push(R[1]),S.unshift(R[2])),S.length&&(m=S.join(".")+m),this.hostname=T.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var O=m.indexOf("#");-1!==O&&(this.hash=m.substr(O),m=m.slice(0,O));var I=m.indexOf("?");return-1!==I&&(this.search=m.substr(I),m=m.slice(0,I)),m&&(this.pathname=m),p[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this},o.prototype.parseHost=function(e){var t=r.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},e.exports=function(e,t){if(e&&e instanceof o)return e;var n=new o;return n.parse(e,t),n}},function(e,t,n){"use strict";t.Any=n(24),t.Cc=n(25),t.Cf=n(141),t.P=n(13),t.Z=n(26)},function(e,t){e.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/},function(e,t,n){"use strict";t.parseLinkLabel=n(143),t.parseLinkDestination=n(144),t.parseLinkTitle=n(145)},function(e,t,n){"use strict";e.exports=function(e,t,n){var o,i,r,s,a=-1,c=e.posMax,l=e.pos;for(e.pos=t+1,o=1;e.pos<c;){if(93===(r=e.src.charCodeAt(e.pos))&&0===--o){i=!0;break}if(s=e.pos,e.md.inline.skipToken(e),91===r)if(s===e.pos-1)o++;else if(n)return e.pos=l,-1}return i&&(a=e.pos),e.pos=l,a}},function(e,t,n){"use strict";var o=n(3).isSpace,i=n(3).unescapeAll;e.exports=function(e,t,n){var r,s,a=t,c={ok:!1,pos:0,lines:0,str:""};if(60===e.charCodeAt(t)){for(t++;t<n;){if(10===(r=e.charCodeAt(t))||o(r))return c;if(62===r)return c.pos=t+1,c.str=i(e.slice(a+1,t)),c.ok=!0,c;92===r&&t+1<n?t+=2:t++}return c}for(s=0;t<n&&32!==(r=e.charCodeAt(t))&&!(r<32||127===r);)if(92===r&&t+1<n)t+=2;else{if(40===r&&s++,41===r){if(0===s)break;s--}t++}return a===t?c:0!==s?c:(c.str=i(e.slice(a,t)),c.lines=0,c.pos=t,c.ok=!0,c)}},function(e,t,n){"use strict";var o=n(3).unescapeAll;e.exports=function(e,t,n){var i,r,s=0,a=t,c={ok:!1,pos:0,lines:0,str:""};if(t>=n)return c;if(34!==(r=e.charCodeAt(t))&&39!==r&&40!==r)return c;for(t++,40===r&&(r=41);t<n;){if((i=e.charCodeAt(t))===r)return c.pos=t+1,c.lines=s,c.str=o(e.slice(a+1,t)),c.ok=!0,c;10===i?s++:92===i&&t+1<n&&(t++,10===e.charCodeAt(t)&&s++),t++}return c}},function(e,t,n){"use strict";var o=n(3).assign,i=n(3).unescapeAll,r=n(3).escapeHtml,s={};function a(){this.rules=o({},s)}s.code_inline=function(e,t,n,o,i){var s=e[t];return"<code"+i.renderAttrs(s)+">"+r(e[t].content)+"</code>"},s.code_block=function(e,t,n,o,i){var s=e[t];return"<pre"+i.renderAttrs(s)+"><code>"+r(e[t].content)+"</code></pre>\n"},s.fence=function(e,t,n,o,s){var a,c,l,d,u=e[t],h=u.info?i(u.info).trim():"",f="";return h&&(f=h.split(/\s+/g)[0]),0===(a=n.highlight&&n.highlight(u.content,f)||r(u.content)).indexOf("<pre")?a+"\n":h?(c=u.attrIndex("class"),l=u.attrs?u.attrs.slice():[],c<0?l.push(["class",n.langPrefix+f]):l[c][1]+=" "+n.langPrefix+f,d={attrs:l},"<pre><code"+s.renderAttrs(d)+">"+a+"</code></pre>\n"):"<pre><code"+s.renderAttrs(u)+">"+a+"</code></pre>\n"},s.image=function(e,t,n,o,i){var r=e[t];return r.attrs[r.attrIndex("alt")][1]=i.renderInlineAsText(r.children,n,o),i.renderToken(e,t,n)},s.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n"},s.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},s.text=function(e,t){return r(e[t].content)},s.html_block=function(e,t){return e[t].content},s.html_inline=function(e,t){return e[t].content},a.prototype.renderAttrs=function(e){var t,n,o;if(!e.attrs)return"";for(o="",t=0,n=e.attrs.length;t<n;t++)o+=" "+r(e.attrs[t][0])+'="'+r(e.attrs[t][1])+'"';return o},a.prototype.renderToken=function(e,t,n){var o,i="",r=!1,s=e[t];return s.hidden?"":(s.block&&-1!==s.nesting&&t&&e[t-1].hidden&&(i+="\n"),i+=(-1===s.nesting?"</":"<")+s.tag,i+=this.renderAttrs(s),0===s.nesting&&n.xhtmlOut&&(i+=" /"),s.block&&(r=!0,1===s.nesting&&t+1<e.length&&("inline"===(o=e[t+1]).type||o.hidden?r=!1:-1===o.nesting&&o.tag===s.tag&&(r=!1))),i+=r?">\n":">")},a.prototype.renderInline=function(e,t,n){for(var o,i="",r=this.rules,s=0,a=e.length;s<a;s++)void 0!==r[o=e[s].type]?i+=r[o](e,s,t,n,this):i+=this.renderToken(e,s,t);return i},a.prototype.renderInlineAsText=function(e,t,n){for(var o="",i=0,r=e.length;i<r;i++)"text"===e[i].type?o+=e[i].content:"image"===e[i].type&&(o+=this.renderInlineAsText(e[i].children,t,n));return o},a.prototype.render=function(e,t,n){var o,i,r,s="",a=this.rules;for(o=0,i=e.length;o<i;o++)"inline"===(r=e[o].type)?s+=this.renderInline(e[o].children,t,n):void 0!==a[r]?s+=a[e[o].type](e,o,t,n,this):s+=this.renderToken(e,o,t,n);return s},e.exports=a},function(e,t,n){"use strict";var o=n(14),i=[["normalize",n(148)],["block",n(149)],["inline",n(150)],["linkify",n(151)],["replacements",n(152)],["smartquotes",n(153)]];function r(){this.ruler=new o;for(var e=0;e<i.length;e++)this.ruler.push(i[e][0],i[e][1])}r.prototype.process=function(e){var t,n,o;for(t=0,n=(o=this.ruler.getRules("")).length;t<n;t++)o[t](e)},r.prototype.State=n(154),e.exports=r},function(e,t,n){"use strict";var o=/\r[\n\u0085]?|[\u2424\u2028\u0085]/g,i=/\u0000/g;e.exports=function(e){var t;t=(t=e.src.replace(o,"\n")).replace(i,"<EFBFBD>"),e.src=t}},function(e,t,n){"use strict";e.exports=function(e){var t;e.inlineMode?((t=new e.Token("inline","",0)).content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}},function(e,t,n){"use strict";e.exports=function(e){var t,n,o,i=e.tokens;for(n=0,o=i.length;n<o;n++)"inline"===(t=i[n]).type&&e.md.inline.parse(t.content,e.md,e.env,t.children)}},function(e,t,n){"use strict";var o=n(3).arrayReplaceAt;function i(e){return/^<a[>\s]/i.test(e)}function r(e){return/^<\/a\s*>/i.test(e)}e.exports=function(e){var t,n,s,a,c,l,d,u,h,f,p,m,g,b,w,_,k,v=e.tokens;if(e.md.options.linkify)for(n=0,s=v.length;n<s;n++)if("inline"===v[n].type&&e.md.linkify.pretest(v[n].content))for(g=0,t=(a=v[n].children).length-1;t>=0;t--)if("link_close"!==(l=a[t]).type){if("html_inline"===l.type&&(i(l.content)&&g>0&&g--,r(l.content)&&g++),!(g>0)&&"text"===l.type&&e.md.linkify.test(l.content)){for(h=l.content,k=e.md.linkify.match(h),d=[],m=l.level,p=0,u=0;u<k.length;u++)b=k[u].url,w=e.md.normalizeLink(b),e.md.validateLink(w)&&(_=k[u].text,_=k[u].schema?"mailto:"!==k[u].schema||/^mailto:/i.test(_)?e.md.normalizeLinkText(_):e.md.normalizeLinkText("mailto:"+_).replace(/^mailto:/,""):e.md.normalizeLinkText("http://"+_).replace(/^http:\/\//,""),(f=k[u].index)>p&&((c=new e.Token("text","",0)).content=h.slice(p,f),c.level=m,d.push(c)),(c=new e.Token("link_open","a",1)).attrs=[["href",w]],c.level=m++,c.markup="linkify",c.info="auto",d.push(c),(c=new e.Token("text","",0)).content=_,c.level=m,d.push(c),(c=new e.Token("link_close","a",-1)).level=--m,c.markup="linkify",c.info="auto",d.push(c),p=k[u].lastIndex);p<h.length&&((c=new e.Token("text","",0)).content=h.slice(p),c.level=m,d.push(c)),v[n].children=a=o(a,t,d)}}else for(t--;a[t].level!==l.level&&"link_open"!==a[t].type;)t--}},function(e,t,n){"use strict";var o=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,i=/\((c|tm|r|p)\)/i,r=/\((c|tm|r|p)\)/gi,s={c:"©",r:"®",p:"§",tm:"™"};function a(e,t){return s[t.toLowerCase()]}function c(e){var t,n,o=0;for(t=e.length-1;t>=0;t--)"text"!==(n=e[t]).type||o||(n.content=n.content.replace(r,a)),"link_open"===n.type&&"auto"===n.info&&o--,"link_close"===n.type&&"auto"===n.info&&o++}function l(e){var t,n,i=0;for(t=e.length-1;t>=0;t--)"text"!==(n=e[t]).type||i||o.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),"link_open"===n.type&&"auto"===n.info&&i--,"link_close"===n.type&&"auto"===n.info&&i++}e.exports=function(e){var t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&(i.test(e.tokens[t].content)&&c(e.tokens[t].children),o.test(e.tokens[t].content)&&l(e.tokens[t].children))}},function(e,t,n){"use strict";var o=n(3).isWhiteSpace,i=n(3).isPunctChar,r=n(3).isMdAsciiPunct,s=/['"]/,a=/['"]/g,c="’";function l(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}function d(e,t){var n,s,d,u,h,f,p,m,g,b,w,_,k,v,y,x,C,A,P,E,T;for(P=[],n=0;n<e.length;n++){for(s=e[n],p=e[n].level,C=P.length-1;C>=0&&!(P[C].level<=p);C--);if(P.length=C+1,"text"===s.type){h=0,f=(d=s.content).length;e:for(;h<f&&(a.lastIndex=h,u=a.exec(d));){if(y=x=!0,h=u.index+1,A="'"===u[0],g=32,u.index-1>=0)g=d.charCodeAt(u.index-1);else for(C=n-1;C>=0&&("softbreak"!==e[C].type&&"hardbreak"!==e[C].type);C--)if("text"===e[C].type){g=e[C].content.charCodeAt(e[C].content.length-1);break}if(b=32,h<f)b=d.charCodeAt(h);else for(C=n+1;C<e.length&&("softbreak"!==e[C].type&&"hardbreak"!==e[C].type);C++)if("text"===e[C].type){b=e[C].content.charCodeAt(0);break}if(w=r(g)||i(String.fromCharCode(g)),_=r(b)||i(String.fromCharCode(b)),k=o(g),(v=o(b))?y=!1:_&&(k||w||(y=!1)),k?x=!1:w&&(v||_||(x=!1)),34===b&&'"'===u[0]&&g>=48&&g<=57&&(x=y=!1),y&&x&&(y=!1,x=_),y||x){if(x)for(C=P.length-1;C>=0&&(m=P[C],!(P[C].level<p));C--)if(m.single===A&&P[C].level===p){m=P[C],A?(E=t.md.options.quotes[2],T=t.md.options.quotes[3]):(E=t.md.options.quotes[0],T=t.md.options.quotes[1]),s.content=l(s.content,u.index,T),e[m.token].content=l(e[m.token].content,m.pos,E),h+=T.length-1,m.token===n&&(h+=E.length-1),f=(d=s.content).length,P.length=C;continue e}y?P.push({token:n,pos:u.index,single:A,level:p}):x&&A&&(s.content=l(s.content,u.index,c))}else A&&(s.content=l(s.content,u.index,c))}}}}e.exports=function(e){var t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&s.test(e.tokens[t].content)&&d(e.tokens[t].children,e)}},function(e,t,n){"use strict";var o=n(15);function i(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}i.prototype.Token=o,e.exports=i},function(e,t,n){"use strict";var o=n(14),i=[["table",n(156),["paragraph","reference"]],["code",n(157)],["fence",n(158),["paragraph","reference","blockquote","list"]],["blockquote",n(159),["paragraph","reference","blockquote","list"]],["hr",n(160),["paragraph","reference","blockquote","list"]],["list",n(161),["paragraph","reference","blockquote"]],["reference",n(162)],["heading",n(163),["paragraph","reference","blockquote"]],["lheading",n(164)],["html_block",n(165),["paragraph","reference","blockquote"]],["paragraph",n(167)]];function r(){this.ruler=new o;for(var e=0;e<i.length;e++)this.ruler.push(i[e][0],i[e][1],{alt:(i[e][2]||[]).slice()})}r.prototype.tokenize=function(e,t,n){for(var o,i=this.ruler.getRules(""),r=i.length,s=t,a=!1,c=e.md.options.maxNesting;s<n&&(e.line=s=e.skipEmptyLines(s),!(s>=n))&&!(e.sCount[s]<e.blkIndent);){if(e.level>=c){e.line=n;break}for(o=0;o<r&&!i[o](e,s,n,!1);o++);e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),(s=e.line)<n&&e.isEmpty(s)&&(a=!0,s++,e.line=s)}},r.prototype.parse=function(e,t,n,o){var i;e&&(i=new this.State(e,t,n,o),this.tokenize(i,i.line,i.lineMax))},r.prototype.State=n(168),e.exports=r},function(e,t,n){"use strict";var o=n(3).isSpace;function i(e,t){var n=e.bMarks[t]+e.blkIndent,o=e.eMarks[t];return e.src.substr(n,o-n)}function r(e){var t,n=[],o=0,i=e.length,r=0,s=0,a=!1,c=0;for(t=e.charCodeAt(o);o<i;)96===t?a?(a=!1,c=o):r%2==0&&(a=!0,c=o):124!==t||r%2!=0||a||(n.push(e.substring(s,o)),s=o+1),92===t?r++:r=0,++o===i&&a&&(a=!1,o=c+1),t=e.charCodeAt(o);return n.push(e.substring(s)),n}e.exports=function(e,t,n,s){var a,c,l,d,u,h,f,p,m,g,b,w;if(t+2>n)return!1;if(u=t+1,e.sCount[u]<e.blkIndent)return!1;if(e.sCount[u]-e.blkIndent>=4)return!1;if((l=e.bMarks[u]+e.tShift[u])>=e.eMarks[u])return!1;if(124!==(a=e.src.charCodeAt(l++))&&45!==a&&58!==a)return!1;for(;l<e.eMarks[u];){if(124!==(a=e.src.charCodeAt(l))&&45!==a&&58!==a&&!o(a))return!1;l++}for(h=(c=i(e,t+1)).split("|"),m=[],d=0;d<h.length;d++){if(!(g=h[d].trim())){if(0===d||d===h.length-1)continue;return!1}if(!/^:?-+:?$/.test(g))return!1;58===g.charCodeAt(g.length-1)?m.push(58===g.charCodeAt(0)?"center":"right"):58===g.charCodeAt(0)?m.push("left"):m.push("")}if(-1===(c=i(e,t).trim()).indexOf("|"))return!1;if(e.sCount[t]-e.blkIndent>=4)return!1;if((f=(h=r(c.replace(/^\||\|$/g,""))).length)>m.length)return!1;if(s)return!0;for((p=e.push("table_open","table",1)).map=b=[t,0],(p=e.push("thead_open","thead",1)).map=[t,t+1],(p=e.push("tr_open","tr",1)).map=[t,t+1],d=0;d<h.length;d++)(p=e.push("th_open","th",1)).map=[t,t+1],m[d]&&(p.attrs=[["style","text-align:"+m[d]]]),(p=e.push("inline","",0)).content=h[d].trim(),p.map=[t,t+1],p.children=[],p=e.push("th_close","th",-1);for(p=e.push("tr_close","tr",-1),p=e.push("thead_close","thead",-1),(p=e.push("tbody_open","tbody",1)).map=w=[t+2,0],u=t+2;u<n&&!(e.sCount[u]<e.blkIndent)&&-1!==(c=i(e,u).trim()).indexOf("|")&&!(e.sCount[u]-e.blkIndent>=4);u++){for(h=r(c.replace(/^\||\|$/g,"")),p=e.push("tr_open","tr",1),d=0;d<f;d++)p=e.push("td_open","td",1),m[d]&&(p.attrs=[["style","text-align:"+m[d]]]),(p=e.push("inline","",0)).content=h[d]?h[d].trim():"",p.children=[],p=e.push("td_close","td",-1);p=e.push("tr_close","tr",-1)}return p=e.push("tbody_close","tbody",-1),p=e.push("table_close","table",-1),b[1]=w[1]=u,e.line=u,!0}},function(e,t,n){"use strict";e.exports=function(e,t,n){var o,i,r;if(e.sCount[t]-e.blkIndent<4)return!1;for(i=o=t+1;o<n;)if(e.isEmpty(o))o++;else{if(!(e.sCount[o]-e.blkIndent>=4))break;i=++o}return e.line=i,(r=e.push("code_block","code",0)).content=e.getLines(t,i,4+e.blkIndent,!0),r.map=[t,e.line],!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,o){var i,r,s,a,c,l,d,u=!1,h=e.bMarks[t]+e.tShift[t],f=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(h+3>f)return!1;if(126!==(i=e.src.charCodeAt(h))&&96!==i)return!1;if(c=h,(r=(h=e.skipChars(h,i))-c)<3)return!1;if(d=e.src.slice(c,h),(s=e.src.slice(h,f)).indexOf(String.fromCharCode(i))>=0)return!1;if(o)return!0;for(a=t;!(++a>=n)&&!((h=c=e.bMarks[a]+e.tShift[a])<(f=e.eMarks[a])&&e.sCount[a]<e.blkIndent);)if(e.src.charCodeAt(h)===i&&!(e.sCount[a]-e.blkIndent>=4||(h=e.skipChars(h,i))-c<r||(h=e.skipSpaces(h))<f)){u=!0;break}return r=e.sCount[t],e.line=a+(u?1:0),(l=e.push("fence","code",0)).info=s,l.content=e.getLines(t+1,a,r,!0),l.markup=d,l.map=[t,e.line],!0}},function(e,t,n){"use strict";var o=n(3).isSpace;e.exports=function(e,t,n,i){var r,s,a,c,l,d,u,h,f,p,m,g,b,w,_,k,v,y,x,C,A=e.lineMax,P=e.bMarks[t]+e.tShift[t],E=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(62!==e.src.charCodeAt(P++))return!1;if(i)return!0;for(c=f=e.sCount[t]+P-(e.bMarks[t]+e.tShift[t]),32===e.src.charCodeAt(P)?(P++,c++,f++,r=!1,k=!0):9===e.src.charCodeAt(P)?(k=!0,(e.bsCount[t]+f)%4==3?(P++,c++,f++,r=!1):r=!0):k=!1,p=[e.bMarks[t]],e.bMarks[t]=P;P<E&&(s=e.src.charCodeAt(P),o(s));)9===s?f+=4-(f+e.bsCount[t]+(r?1:0))%4:f++,P++;for(m=[e.bsCount[t]],e.bsCount[t]=e.sCount[t]+1+(k?1:0),d=P>=E,w=[e.sCount[t]],e.sCount[t]=f-c,_=[e.tShift[t]],e.tShift[t]=P-e.bMarks[t],y=e.md.block.ruler.getRules("blockquote"),b=e.parentType,e.parentType="blockquote",C=!1,h=t+1;h<n&&(e.sCount[h]<e.blkIndent&&(C=!0),!((P=e.bMarks[h]+e.tShift[h])>=(E=e.eMarks[h])));h++)if(62!==e.src.charCodeAt(P++)||C){if(d)break;for(v=!1,a=0,l=y.length;a<l;a++)if(y[a](e,h,n,!0)){v=!0;break}if(v){e.lineMax=h,0!==e.blkIndent&&(p.push(e.bMarks[h]),m.push(e.bsCount[h]),_.push(e.tShift[h]),w.push(e.sCount[h]),e.sCount[h]-=e.blkIndent);break}p.push(e.bMarks[h]),m.push(e.bsCount[h]),_.push(e.tShift[h]),w.push(e.sCount[h]),e.sCount[h]=-1}else{for(c=f=e.sCount[h]+P-(e.bMarks[h]+e.tShift[h]),32===e.src.charCodeAt(P)?(P++,c++,f++,r=!1,k=!0):9===e.src.charCodeAt(P)?(k=!0,(e.bsCount[h]+f)%4==3?(P++,c++,f++,r=!1):r=!0):k=!1,p.push(e.bMarks[h]),e.bMarks[h]=P;P<E&&(s=e.src.charCodeAt(P),o(s));)9===s?f+=4-(f+e.bsCount[h]+(r?1:0))%4:f++,P++;d=P>=E,m.push(e.bsCount[h]),e.bsCount[h]=e.sCount[h]+1+(k?1:0),w.push(e.sCount[h]),e.sCount[h]=f-c,_.push(e.tShift[h]),e.tShift[h]=P-e.bMarks[h]}for(g=e.blkIndent,e.blkIndent=0,(x=e.push("blockquote_open","blockquote",1)).markup=">",x.map=u=[t,0],e.md.block.tokenize(e,t,h),(x=e.push("blockquote_close","blockquote",-1)).markup=">",e.lineMax=A,e.parentType=b,u[1]=e.line,a=0;a<_.length;a++)e.bMarks[a+t]=p[a],e.tShift[a+t]=_[a],e.sCount[a+t]=w[a],e.bsCount[a+t]=m[a];return e.blkIndent=g,!0}},function(e,t,n){"use strict";var o=n(3).isSpace;e.exports=function(e,t,n,i){var r,s,a,c,l=e.bMarks[t]+e.tShift[t],d=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(42!==(r=e.src.charCodeAt(l++))&&45!==r&&95!==r)return!1;for(s=1;l<d;){if((a=e.src.charCodeAt(l++))!==r&&!o(a))return!1;a===r&&s++}return!(s<3)&&(!!i||(e.line=t+1,(c=e.push("hr","hr",0)).map=[t,e.line],c.markup=Array(s+1).join(String.fromCharCode(r)),!0))}},function(e,t,n){"use strict";var o=n(3).isSpace;function i(e,t){var n,i,r,s;return i=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],42!==(n=e.src.charCodeAt(i++))&&45!==n&&43!==n?-1:i<r&&(s=e.src.charCodeAt(i),!o(s))?-1:i}function r(e,t){var n,i=e.bMarks[t]+e.tShift[t],r=i,s=e.eMarks[t];if(r+1>=s)return-1;if((n=e.src.charCodeAt(r++))<48||n>57)return-1;for(;;){if(r>=s)return-1;if(!((n=e.src.charCodeAt(r++))>=48&&n<=57)){if(41===n||46===n)break;return-1}if(r-i>=10)return-1}return r<s&&(n=e.src.charCodeAt(r),!o(n))?-1:r}e.exports=function(e,t,n,o){var s,a,c,l,d,u,h,f,p,m,g,b,w,_,k,v,y,x,C,A,P,E,T,S,R,O,I,D,M=!1,N=!0;if(e.sCount[t]-e.blkIndent>=4)return!1;if(o&&"paragraph"===e.parentType&&e.tShift[t]>=e.blkIndent&&(M=!0),(T=r(e,t))>=0){if(h=!0,R=e.bMarks[t]+e.tShift[t],w=Number(e.src.substr(R,T-R-1)),M&&1!==w)return!1}else{if(!((T=i(e,t))>=0))return!1;h=!1}if(M&&e.skipSpaces(T)>=e.eMarks[t])return!1;if(b=e.src.charCodeAt(T-1),o)return!0;for(g=e.tokens.length,h?(D=e.push("ordered_list_open","ol",1),1!==w&&(D.attrs=[["start",w]])):D=e.push("bullet_list_open","ul",1),D.map=m=[t,0],D.markup=String.fromCharCode(b),k=t,S=!1,I=e.md.block.ruler.getRules("list"),C=e.parentType,e.parentType="list";k<n;){for(E=T,_=e.eMarks[k],u=v=e.sCount[k]+T-(e.bMarks[t]+e.tShift[t]);E<_;){if(9===(s=e.src.charCodeAt(E)))v+=4-(v+e.bsCount[k])%4;else{if(32!==s)break;v++}E++}if((d=(a=E)>=_?1:v-u)>4&&(d=1),l=u+d,(D=e.push("list_item_open","li",1)).markup=String.fromCharCode(b),D.map=f=[t,0],y=e.blkIndent,P=e.tight,A=e.tShift[t],x=e.sCount[t],e.blkIndent=l,e.tight=!0,e.tShift[t]=a-e.bMarks[t],e.sCount[t]=v,a>=_&&e.isEmpty(t+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,t,n,!0),e.tight&&!S||(N=!1),S=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=y,e.tShift[t]=A,e.sCount[t]=x,e.tight=P,(D=e.push("list_item_close","li",-1)).markup=String.fromCharCode(b),k=t=e.line,f[1]=k,a=e.bMarks[t],k>=n)break;if(e.sCount[k]<e.blkIndent)break;for(O=!1,c=0,p=I.length;c<p;c++)if(I[c](e,k,n,!0)){O=!0;break}if(O)break;if(h){if((T=r(e,k))<0)break}else if((T=i(e,k))<0)break;if(b!==e.src.charCodeAt(T-1))break}return(D=h?e.push("ordered_list_close","ol",-1):e.push("bullet_list_close","ul",-1)).markup=String.fromCharCode(b),m[1]=k,e.line=k,e.parentType=C,N&&function(e,t){var n,o,i=e.level+2;for(n=t+2,o=e.tokens.length-2;n<o;n++)e.tokens[n].level===i&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].hidden=!0,e.tokens[n].hidden=!0,n+=2)}(e,g),!0}},function(e,t,n){"use strict";var o=n(3).normalizeReference,i=n(3).isSpace;e.exports=function(e,t,n,r){var s,a,c,l,d,u,h,f,p,m,g,b,w,_,k,v,y=0,x=e.bMarks[t]+e.tShift[t],C=e.eMarks[t],A=t+1;if(e.sCount[t]-e.blkIndent>=4)return!1;if(91!==e.src.charCodeAt(x))return!1;for(;++x<C;)if(93===e.src.charCodeAt(x)&&92!==e.src.charCodeAt(x-1)){if(x+1===C)return!1;if(58!==e.src.charCodeAt(x+1))return!1;break}for(l=e.lineMax,k=e.md.block.ruler.getRules("reference"),m=e.parentType,e.parentType="reference";A<l&&!e.isEmpty(A);A++)if(!(e.sCount[A]-e.blkIndent>3||e.sCount[A]<0)){for(_=!1,u=0,h=k.length;u<h;u++)if(k[u](e,A,l,!0)){_=!0;break}if(_)break}for(C=(w=e.getLines(t,A,e.blkIndent,!1).trim()).length,x=1;x<C;x++){if(91===(s=w.charCodeAt(x)))return!1;if(93===s){p=x;break}10===s?y++:92===s&&++x<C&&10===w.charCodeAt(x)&&y++}if(p<0||58!==w.charCodeAt(p+1))return!1;for(x=p+2;x<C;x++)if(10===(s=w.charCodeAt(x)))y++;else if(!i(s))break;if(!(g=e.md.helpers.parseLinkDestination(w,x,C)).ok)return!1;if(d=e.md.normalizeLink(g.str),!e.md.validateLink(d))return!1;for(a=x=g.pos,c=y+=g.lines,b=x;x<C;x++)if(10===(s=w.charCodeAt(x)))y++;else if(!i(s))break;for(g=e.md.helpers.parseLinkTitle(w,x,C),x<C&&b!==x&&g.ok?(v=g.str,x=g.pos,y+=g.lines):(v="",x=a,y=c);x<C&&(s=w.charCodeAt(x),i(s));)x++;if(x<C&&10!==w.charCodeAt(x)&&v)for(v="",x=a,y=c;x<C&&(s=w.charCodeAt(x),i(s));)x++;return!(x<C&&10!==w.charCodeAt(x))&&(!!(f=o(w.slice(1,p)))&&(!!r||(void 0===e.env.references&&(e.env.references={}),void 0===e.env.references[f]&&(e.env.references[f]={title:v,href:d}),e.parentType=m,e.line=t+y+1,!0)))}},function(e,t,n){"use strict";var o=n(3).isSpace;e.exports=function(e,t,n,i){var r,s,a,c,l=e.bMarks[t]+e.tShift[t],d=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(35!==(r=e.src.charCodeAt(l))||l>=d)return!1;for(s=1,r=e.src.charCodeAt(++l);35===r&&l<d&&s<=6;)s++,r=e.src.charCodeAt(++l);return!(s>6||l<d&&!o(r))&&(!!i||(d=e.skipSpacesBack(d,l),(a=e.skipCharsBack(d,35,l))>l&&o(e.src.charCodeAt(a-1))&&(d=a),e.line=t+1,(c=e.push("heading_open","h"+String(s),1)).markup="########".slice(0,s),c.map=[t,e.line],(c=e.push("inline","",0)).content=e.src.slice(l,d).trim(),c.map=[t,e.line],c.children=[],(c=e.push("heading_close","h"+String(s),-1)).markup="########".slice(0,s),!0))}},function(e,t,n){"use strict";e.exports=function(e,t,n){var o,i,r,s,a,c,l,d,u,h,f=t+1,p=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;for(h=e.parentType,e.parentType="paragraph";f<n&&!e.isEmpty(f);f++)if(!(e.sCount[f]-e.blkIndent>3)){if(e.sCount[f]>=e.blkIndent&&(c=e.bMarks[f]+e.tShift[f])<(l=e.eMarks[f])&&(45===(u=e.src.charCodeAt(c))||61===u)&&(c=e.skipChars(c,u),(c=e.skipSpaces(c))>=l)){d=61===u?1:2;break}if(!(e.sCount[f]<0)){for(i=!1,r=0,s=p.length;r<s;r++)if(p[r](e,f,n,!0)){i=!0;break}if(i)break}}return!!d&&(o=e.getLines(t,f,e.blkIndent,!1).trim(),e.line=f+1,(a=e.push("heading_open","h"+String(d),1)).markup=String.fromCharCode(u),a.map=[t,e.line],(a=e.push("inline","",0)).content=o,a.map=[t,e.line-1],a.children=[],(a=e.push("heading_close","h"+String(d),-1)).markup=String.fromCharCode(u),e.parentType=h,!0)}},function(e,t,n){"use strict";var o=n(166),i=n(27).HTML_OPEN_CLOSE_TAG_RE,r=[[/^<(script|pre|style)(?=(\s|>|$))/i,/<\/(script|pre|style)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+o.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(i.source+"\\s*$"),/^$/,!1]];e.exports=function(e,t,n,o){var i,s,a,c,l=e.bMarks[t]+e.tShift[t],d=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(l))return!1;for(c=e.src.slice(l,d),i=0;i<r.length&&!r[i][0].test(c);i++);if(i===r.length)return!1;if(o)return r[i][2];if(s=t+1,!r[i][1].test(c))for(;s<n&&!(e.sCount[s]<e.blkIndent);s++)if(l=e.bMarks[s]+e.tShift[s],d=e.eMarks[s],c=e.src.slice(l,d),r[i][1].test(c)){0!==c.length&&s++;break}return e.line=s,(a=e.push("html_block","",0)).map=[t,s],a.content=e.getLines(t,s,e.blkIndent,!0),!0}},function(e,t,n){"use strict";e.exports=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","meta","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]},function(e,t,n){"use strict";e.exports=function(e,t){var n,o,i,r,s,a,c=t+1,l=e.md.block.ruler.getRules("paragraph"),d=e.lineMax;for(a=e.parentType,e.parentType="paragraph";c<d&&!e.isEmpty(c);c++)if(!(e.sCount[c]-e.blkIndent>3||e.sCount[c]<0)){for(o=!1,i=0,r=l.length;i<r;i++)if(l[i](e,c,d,!0)){o=!0;break}if(o)break}return n=e.getLines(t,c,e.blkIndent,!1).trim(),e.line=c,(s=e.push("paragraph_open","p",1)).map=[t,e.line],(s=e.push("inline","",0)).content=n,s.map=[t,e.line],s.children=[],s=e.push("paragraph_close","p",-1),e.parentType=a,!0}},function(e,t,n){"use strict";var o=n(15),i=n(3).isSpace;function r(e,t,n,o){var r,s,a,c,l,d,u,h;for(this.src=e,this.md=t,this.env=n,this.tokens=o,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.parentType="root",this.level=0,this.result="",h=!1,a=c=d=u=0,l=(s=this.src).length;c<l;c++){if(r=s.charCodeAt(c),!h){if(i(r)){d++,9===r?u+=4-u%4:u++;continue}h=!0}10!==r&&c!==l-1||(10!==r&&c++,this.bMarks.push(a),this.eMarks.push(c),this.tShift.push(d),this.sCount.push(u),this.bsCount.push(0),h=!1,d=0,u=0,a=c+1)}this.bMarks.push(s.length),this.eMarks.push(s.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}r.prototype.push=function(e,t,n){var i=new o(e,t,n);return i.block=!0,n<0&&this.level--,i.level=this.level,n>0&&this.level++,this.tokens.push(i),i},r.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},r.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},r.prototype.skipSpaces=function(e){for(var t,n=this.src.length;e<n&&(t=this.src.charCodeAt(e),i(t));e++);return e},r.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!i(this.src.charCodeAt(--e)))return e+1;return e},r.prototype.skipChars=function(e,t){for(var n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},r.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},r.prototype.getLines=function(e,t,n,o){var r,s,a,c,l,d,u,h=e;if(e>=t)return"";for(d=new Array(t-e),r=0;h<t;h++,r++){for(s=0,u=c=this.bMarks[h],l=h+1<t||o?this.eMarks[h]+1:this.eMarks[h];c<l&&s<n;){if(a=this.src.charCodeAt(c),i(a))9===a?s+=4-(s+this.bsCount[h])%4:s++;else{if(!(c-u<this.tShift[h]))break;s++}c++}d[r]=s>n?new Array(s-n+1).join(" ")+this.src.slice(c,l):this.src.slice(c,l)}return d.join("")},r.prototype.Token=o,e.exports=r},function(e,t,n){"use strict";var o=n(14),i=[["text",n(170)],["newline",n(171)],["escape",n(172)],["backticks",n(173)],["strikethrough",n(28).tokenize],["emphasis",n(29).tokenize],["link",n(174)],["image",n(175)],["autolink",n(176)],["html_inline",n(177)],["entity",n(178)]],r=[["balance_pairs",n(179)],["strikethrough",n(28).postProcess],["emphasis",n(29).postProcess],["text_collapse",n(180)]];function s(){var e;for(this.ruler=new o,e=0;e<i.length;e++)this.ruler.push(i[e][0],i[e][1]);for(this.ruler2=new o,e=0;e<r.length;e++)this.ruler2.push(r[e][0],r[e][1])}s.prototype.skipToken=function(e){var t,n,o=e.pos,i=this.ruler.getRules(""),r=i.length,s=e.md.options.maxNesting,a=e.cache;if(void 0===a[o]){if(e.level<s)for(n=0;n<r&&(e.level++,t=i[n](e,!0),e.level--,!t);n++);else e.pos=e.posMax;t||e.pos++,a[o]=e.pos}else e.pos=a[o]},s.prototype.tokenize=function(e){for(var t,n,o=this.ruler.getRules(""),i=o.length,r=e.posMax,s=e.md.options.maxNesting;e.pos<r;){if(e.level<s)for(n=0;n<i&&!(t=o[n](e,!1));n++);if(t){if(e.pos>=r)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},s.prototype.parse=function(e,t,n,o){var i,r,s,a=new this.State(e,t,n,o);for(this.tokenize(a),s=(r=this.ruler2.getRules("")).length,i=0;i<s;i++)r[i](a)},s.prototype.State=n(181),e.exports=s},function(e,t,n){"use strict";function o(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}e.exports=function(e,t){for(var n=e.pos;n<e.posMax&&!o(e.src.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}},function(e,t,n){"use strict";var o=n(3).isSpace;e.exports=function(e,t){var n,i,r=e.pos;if(10!==e.src.charCodeAt(r))return!1;for(n=e.pending.length-1,i=e.posMax,t||(n>=0&&32===e.pending.charCodeAt(n)?n>=1&&32===e.pending.charCodeAt(n-1)?(e.pending=e.pending.replace(/ +$/,""),e.push("hardbreak","br",0)):(e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0)):e.push("softbreak","br",0)),r++;r<i&&o(e.src.charCodeAt(r));)r++;return e.pos=r,!0}},function(e,t,n){"use strict";for(var o=n(3).isSpace,i=[],r=0;r<256;r++)i.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){i[e.charCodeAt(0)]=1}),e.exports=function(e,t){var n,r=e.pos,s=e.posMax;if(92!==e.src.charCodeAt(r))return!1;if(++r<s){if((n=e.src.charCodeAt(r))<256&&0!==i[n])return t||(e.pending+=e.src[r]),e.pos+=2,!0;if(10===n){for(t||e.push("hardbreak","br",0),r++;r<s&&(n=e.src.charCodeAt(r),o(n));)r++;return e.pos=r,!0}}return t||(e.pending+="\\"),e.pos++,!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,o,i,r,s,a,c=e.pos;if(96!==e.src.charCodeAt(c))return!1;for(n=c,c++,o=e.posMax;c<o&&96===e.src.charCodeAt(c);)c++;for(i=e.src.slice(n,c),r=s=c;-1!==(r=e.src.indexOf("`",s));){for(s=r+1;s<o&&96===e.src.charCodeAt(s);)s++;if(s-r===i.length)return t||((a=e.push("code_inline","code",0)).markup=i,a.content=e.src.slice(c,r).replace(/[ \n]+/g," ").trim()),e.pos=s,!0}return t||(e.pending+=i),e.pos+=i.length,!0}},function(e,t,n){"use strict";var o=n(3).normalizeReference,i=n(3).isSpace;e.exports=function(e,t){var n,r,s,a,c,l,d,u,h,f="",p=e.pos,m=e.posMax,g=e.pos,b=!0;if(91!==e.src.charCodeAt(e.pos))return!1;if(c=e.pos+1,(a=e.md.helpers.parseLinkLabel(e,e.pos,!0))<0)return!1;if((l=a+1)<m&&40===e.src.charCodeAt(l)){for(b=!1,l++;l<m&&(r=e.src.charCodeAt(l),i(r)||10===r);l++);if(l>=m)return!1;for(g=l,(d=e.md.helpers.parseLinkDestination(e.src,l,e.posMax)).ok&&(f=e.md.normalizeLink(d.str),e.md.validateLink(f)?l=d.pos:f=""),g=l;l<m&&(r=e.src.charCodeAt(l),i(r)||10===r);l++);if(d=e.md.helpers.parseLinkTitle(e.src,l,e.posMax),l<m&&g!==l&&d.ok)for(h=d.str,l=d.pos;l<m&&(r=e.src.charCodeAt(l),i(r)||10===r);l++);else h="";(l>=m||41!==e.src.charCodeAt(l))&&(b=!0),l++}if(b){if(void 0===e.env.references)return!1;if(l<m&&91===e.src.charCodeAt(l)?(g=l+1,(l=e.md.helpers.parseLinkLabel(e,l))>=0?s=e.src.slice(g,l++):l=a+1):l=a+1,s||(s=e.src.slice(c,a)),!(u=e.env.references[o(s)]))return e.pos=p,!1;f=u.href,h=u.title}return t||(e.pos=c,e.posMax=a,e.push("link_open","a",1).attrs=n=[["href",f]],h&&n.push(["title",h]),e.md.inline.tokenize(e),e.push("link_close","a",-1)),e.pos=l,e.posMax=m,!0}},function(e,t,n){"use strict";var o=n(3).normalizeReference,i=n(3).isSpace;e.exports=function(e,t){var n,r,s,a,c,l,d,u,h,f,p,m,g,b="",w=e.pos,_=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;if(l=e.pos+2,(c=e.md.helpers.parseLinkLabel(e,e.pos+1,!1))<0)return!1;if((d=c+1)<_&&40===e.src.charCodeAt(d)){for(d++;d<_&&(r=e.src.charCodeAt(d),i(r)||10===r);d++);if(d>=_)return!1;for(g=d,(h=e.md.helpers.parseLinkDestination(e.src,d,e.posMax)).ok&&(b=e.md.normalizeLink(h.str),e.md.validateLink(b)?d=h.pos:b=""),g=d;d<_&&(r=e.src.charCodeAt(d),i(r)||10===r);d++);if(h=e.md.helpers.parseLinkTitle(e.src,d,e.posMax),d<_&&g!==d&&h.ok)for(f=h.str,d=h.pos;d<_&&(r=e.src.charCodeAt(d),i(r)||10===r);d++);else f="";if(d>=_||41!==e.src.charCodeAt(d))return e.pos=w,!1;d++}else{if(void 0===e.env.references)return!1;if(d<_&&91===e.src.charCodeAt(d)?(g=d+1,(d=e.md.helpers.parseLinkLabel(e,d))>=0?a=e.src.slice(g,d++):d=c+1):d=c+1,a||(a=e.src.slice(l,c)),!(u=e.env.references[o(a)]))return e.pos=w,!1;b=u.href,f=u.title}return t||(s=e.src.slice(l,c),e.md.inline.parse(s,e.md,e.env,m=[]),(p=e.push("image","img",0)).attrs=n=[["src",b],["alt",""]],p.children=m,p.content=s,f&&n.push(["title",f])),e.pos=d,e.posMax=_,!0}},function(e,t,n){"use strict";var o=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,i=/^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/;e.exports=function(e,t){var n,r,s,a,c,l,d=e.pos;return 60===e.src.charCodeAt(d)&&(!((n=e.src.slice(d)).indexOf(">")<0)&&(i.test(n)?(a=(r=n.match(i))[0].slice(1,-1),c=e.md.normalizeLink(a),!!e.md.validateLink(c)&&(t||((l=e.push("link_open","a",1)).attrs=[["href",c]],l.markup="autolink",l.info="auto",(l=e.push("text","",0)).content=e.md.normalizeLinkText(a),(l=e.push("link_close","a",-1)).markup="autolink",l.info="auto"),e.pos+=r[0].length,!0)):!!o.test(n)&&(a=(s=n.match(o))[0].slice(1,-1),c=e.md.normalizeLink("mailto:"+a),!!e.md.validateLink(c)&&(t||((l=e.push("link_open","a",1)).attrs=[["href",c]],l.markup="autolink",l.info="auto",(l=e.push("text","",0)).content=e.md.normalizeLinkText(a),(l=e.push("link_close","a",-1)).markup="autolink",l.info="auto"),e.pos+=s[0].length,!0))))}},function(e,t,n){"use strict";var o=n(27).HTML_TAG_RE;e.exports=function(e,t){var n,i,r,s=e.pos;return!!e.md.options.html&&(r=e.posMax,!(60!==e.src.charCodeAt(s)||s+2>=r)&&(!(33!==(n=e.src.charCodeAt(s+1))&&63!==n&&47!==n&&!function(e){var t=32|e;return t>=97&&t<=122}(n))&&(!!(i=e.src.slice(s).match(o))&&(t||(e.push("html_inline","",0).content=e.src.slice(s,s+i[0].length)),e.pos+=i[0].length,!0))))}},function(e,t,n){"use strict";var o=n(22),i=n(3).has,r=n(3).isValidEntityCode,s=n(3).fromCodePoint,a=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,c=/^&([a-z][a-z0-9]{1,31});/i;e.exports=function(e,t){var n,l,d=e.pos,u=e.posMax;if(38!==e.src.charCodeAt(d))return!1;if(d+1<u)if(35===e.src.charCodeAt(d+1)){if(l=e.src.slice(d).match(a))return t||(n="x"===l[1][0].toLowerCase()?parseInt(l[1].slice(1),16):parseInt(l[1],10),e.pending+=r(n)?s(n):s(65533)),e.pos+=l[0].length,!0}else if((l=e.src.slice(d).match(c))&&i(o,l[1]))return t||(e.pending+=o[l[1]]),e.pos+=l[0].length,!0;return t||(e.pending+="&"),e.pos++,!0}},function(e,t,n){"use strict";e.exports=function(e){var t,n,o,i,r=e.delimiters,s=e.delimiters.length;for(t=0;t<s;t++)if((o=r[t]).close)for(n=t-o.jump-1;n>=0;){if((i=r[n]).open&&i.marker===o.marker&&i.end<0&&i.level===o.level)if(!((i.close||o.open)&&void 0!==i.length&&void 0!==o.length&&(i.length+o.length)%3==0)){o.jump=t-n,o.open=!1,i.end=t,i.jump=0;break}n-=i.jump+1}}},function(e,t,n){"use strict";e.exports=function(e){var t,n,o=0,i=e.tokens,r=e.tokens.length;for(t=n=0;t<r;t++)o+=i[t].nesting,i[t].level=o,"text"===i[t].type&&t+1<r&&"text"===i[t+1].type?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}},function(e,t,n){"use strict";var o=n(15),i=n(3).isWhiteSpace,r=n(3).isPunctChar,s=n(3).isMdAsciiPunct;function a(e,t,n,o){this.src=e,this.env=n,this.md=t,this.tokens=o,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[]}a.prototype.pushPending=function(){var e=new o("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},a.prototype.push=function(e,t,n){this.pending&&this.pushPending();var i=new o(e,t,n);return n<0&&this.level--,i.level=this.level,n>0&&this.level++,this.pendingLevel=this.level,this.tokens.push(i),i},a.prototype.scanDelims=function(e,t){var n,o,a,c,l,d,u,h,f,p=e,m=!0,g=!0,b=this.posMax,w=this.src.charCodeAt(e);for(n=e>0?this.src.charCodeAt(e-1):32;p<b&&this.src.charCodeAt(p)===w;)p++;return a=p-e,o=p<b?this.src.charCodeAt(p):32,u=s(n)||r(String.fromCharCode(n)),f=s(o)||r(String.fromCharCode(o)),d=i(n),(h=i(o))?m=!1:f&&(d||u||(m=!1)),d?g=!1:u&&(h||f||(g=!1)),t?(c=m,l=g):(c=m&&(!g||u),l=g&&(!m||f)),{can_open:c,can_close:l,length:a}},a.prototype.Token=o,e.exports=a},function(e,t,n){"use strict";function o(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function i(e){return Object.prototype.toString.call(e)}function r(e){return"[object Function]"===i(e)}function s(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var a={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};var c={"http:":{validate:function(e,t,n){var o=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(o)?o.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){var o=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(o)?t>=3&&":"===e[t-3]?0:t>=3&&"/"===e[t-3]?0:o.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){var o=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(o)?o.match(n.re.mailto)[0].length:0}}},l="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",d="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function u(e){var t=e.re=n(183)(e.__opts__),o=e.__tlds__.slice();function a(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||o.push(l),o.push(t.src_xn),t.src_tlds=o.join("|"),t.email_fuzzy=RegExp(a(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(a(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(a(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(a(t.tpl_host_fuzzy_test),"i");var c=[];function d(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach(function(t){var n=e.__schemas__[t];if(null!==n){var o={validate:null,link:null};if(e.__compiled__[t]=o,function(e){return"[object Object]"===i(e)}(n))return!function(e){return"[object RegExp]"===i(e)}(n.validate)?r(n.validate)?o.validate=n.validate:d(t,n):o.validate=function(e){return function(t,n){var o=t.slice(n);return e.test(o)?o.match(e)[0].length:0}}(n.validate),void(r(n.normalize)?o.normalize=n.normalize:n.normalize?d(t,n):o.normalize=function(e,t){t.normalize(e)});!function(e){return"[object String]"===i(e)}(n)?d(t,n):c.push(t)}}),c.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[""]={validate:null,normalize:function(e,t){t.normalize(e)}};var u=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(s).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+u+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+u+")","ig"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),function(e){e.__index__=-1,e.__text_cache__=""}(e)}function h(e,t){var n=new function(e,t){var n=e.__index__,o=e.__last_index__,i=e.__text_cache__.slice(n,o);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=o+t,this.raw=i,this.text=i,this.url=i}(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function f(e,t){if(!(this instanceof f))return new f(e,t);t||function(e){return Object.keys(e||{}).reduce(function(e,t){return e||a.hasOwnProperty(t)},!1)}(e)&&(t=e,e={}),this.__opts__=o({},a,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=o({},c,e),this.__compiled__={},this.__tlds__=d,this.__tlds_replaced__=!1,this.re={},u(this)}f.prototype.add=function(e,t){return this.__schemas__[e]=t,u(this),this},f.prototype.set=function(e){return this.__opts__=o(this.__opts__,e),this},f.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var t,n,o,i,r,s,a,c;if(this.re.schema_test.test(e))for((a=this.re.schema_search).lastIndex=0;null!==(t=a.exec(e));)if(i=this.testSchemaAt(e,t[2],a.lastIndex)){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=e.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||c<this.__index__)&&null!==(n=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))&&(r=n.index+n[1].length,(this.__index__<0||r<this.__index__)&&(this.__schema__="",this.__index__=r,this.__last_index__=n.index+n[0].length)),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&null!==(o=e.match(this.re.email_fuzzy))&&(r=o.index+o[1].length,s=o.index+o[0].length,(this.__index__<0||r<this.__index__||r===this.__index__&&s>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=r,this.__last_index__=s)),this.__index__>=0},f.prototype.pretest=function(e){return this.re.pretest.test(e)},f.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},f.prototype.match=function(e){var t=0,n=[];this.__index__>=0&&this.__text_cache__===e&&(n.push(h(this,t)),t=this.__last_index__);for(var o=t?e.slice(t):e;this.test(o);)n.push(h(this,t)),o=o.slice(this.__last_index__),t+=this.__last_index__;return n.length?n:null},f.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),u(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,u(this),this)},f.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},f.prototype.onCompile=function(){},e.exports=f},function(e,t,n){"use strict";e.exports=function(e){var t={};t.src_Any=n(24).source,t.src_Cc=n(25).source,t.src_Z=n(26).source,t.src_P=n(13).source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");return t.src_pseudo_letter="(?:(?![><|]|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|[><|]|"+t.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|[><|]|[()[\\]{}.,\"'?!\\-]).|\\[(?:(?!"+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-]).|\\.{2,3}[a-zA-Z0-9%/]|\\.(?!"+t.src_ZCc+"|[.]).|"+(e&&e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+t.src_ZCc+").|\\!(?!"+t.src_ZCc+"|[!]).|\\?(?!"+t.src_ZCc+"|[?]).)+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]+',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|[><|]|\\(|"+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}},function(e,t,n){(function(e,o){var i;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(r){t&&t.nodeType,e&&e.nodeType;var s="object"==typeof o&&o;s.global!==s&&s.window!==s&&s.self;var a,c=2147483647,l=36,d=1,u=26,h=38,f=700,p=72,m=128,g="-",b=/^xn--/,w=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,k={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},v=l-d,y=Math.floor,x=String.fromCharCode;function C(e){throw new RangeError(k[e])}function A(e,t){for(var n=e.length,o=[];n--;)o[n]=t(e[n]);return o}function P(e,t){var n=e.split("@"),o="";return n.length>1&&(o=n[0]+"@",e=n[1]),o+A((e=e.replace(_,".")).split("."),t).join(".")}function E(e){for(var t,n,o=[],i=0,r=e.length;i<r;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<r?56320==(64512&(n=e.charCodeAt(i++)))?o.push(((1023&t)<<10)+(1023&n)+65536):(o.push(t),i--):o.push(t);return o}function T(e){return A(e,function(e){var t="";return e>65535&&(t+=x((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=x(e)}).join("")}function S(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:l}function R(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function O(e,t,n){var o=0;for(e=n?y(e/f):e>>1,e+=y(e/t);e>v*u>>1;o+=l)e=y(e/v);return y(o+(v+1)*e/(e+h))}function I(e){var t,n,o,i,r,s,a,h,f,b,w=[],_=e.length,k=0,v=m,x=p;for((n=e.lastIndexOf(g))<0&&(n=0),o=0;o<n;++o)e.charCodeAt(o)>=128&&C("not-basic"),w.push(e.charCodeAt(o));for(i=n>0?n+1:0;i<_;){for(r=k,s=1,a=l;i>=_&&C("invalid-input"),((h=S(e.charCodeAt(i++)))>=l||h>y((c-k)/s))&&C("overflow"),k+=h*s,!(h<(f=a<=x?d:a>=x+u?u:a-x));a+=l)s>y(c/(b=l-f))&&C("overflow"),s*=b;x=O(k-r,t=w.length+1,0==r),y(k/t)>c-v&&C("overflow"),v+=y(k/t),k%=t,w.splice(k++,0,v)}return T(w)}function D(e){var t,n,o,i,r,s,a,h,f,b,w,_,k,v,A,P=[];for(_=(e=E(e)).length,t=m,n=0,r=p,s=0;s<_;++s)(w=e[s])<128&&P.push(x(w));for(o=i=P.length,i&&P.push(g);o<_;){for(a=c,s=0;s<_;++s)(w=e[s])>=t&&w<a&&(a=w);for(a-t>y((c-n)/(k=o+1))&&C("overflow"),n+=(a-t)*k,t=a,s=0;s<_;++s)if((w=e[s])<t&&++n>c&&C("overflow"),w==t){for(h=n,f=l;!(h<(b=f<=r?d:f>=r+u?u:f-r));f+=l)A=h-b,v=l-b,P.push(x(R(b+A%v,0))),h=y(A/v);P.push(x(R(h,0))),r=O(n,k,o==i),n=0,++o}++n,++t}return P.join("")}a={version:"1.4.1",ucs2:{decode:E,encode:T},decode:I,encode:D,toASCII:function(e){return P(e,function(e){return w.test(e)?"xn--"+D(e):e})},toUnicode:function(e){return P(e,function(e){return b.test(e)?I(e.slice(4).toLowerCase()):e})}},void 0===(i=function(){return a}.call(t,n,t,e))||(e.exports=i)}()}).call(this,n(185)(e),n(11))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}}},function(e,t,n){"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","text_collapse"]}}}},function(e,t,n){"use strict";e.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","text_collapse"]}}}},function(e,t,n){var o=n(190);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=":root{--ck-mention-list-max-height:300px}.ck.ck-mentions{max-height:var(--ck-mention-list-max-height);overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain}.ck.ck-mentions>.ck-list__item{overflow:hidden;flex-shrink:0}"},function(e,t,n){var o=n(192);"string"==typeof o&&(o=[[e.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=":root{--ck-color-mention-background:rgba(153,0,48,0.1);--ck-color-mention-text:#990030}.ck-content .mention{background:var(--ck-color-mention-background);color:var(--ck-color-mention-text)}"},function(e,t,n){"use strict";n.r(t);var o=n(5),i=o.a.Symbol,r=Object.prototype,s=r.hasOwnProperty,a=r.toString,c=i?i.toStringTag:void 0;var l=function(e){var t=s.call(e,c),n=e[c];try{e[c]=void 0;var o=!0}catch(e){}var i=a.call(e);return o&&(t?e[c]=n:delete e[c]),i},d=Object.prototype.toString;var u=function(e){return d.call(e)},h="[object Null]",f="[object Undefined]",p=i?i.toStringTag:void 0;var m=function(e){return null==e?void 0===e?f:h:p&&p in Object(e)?l(e):u(e)};var g=function(e,t){return function(n){return e(t(n))}},b=g(Object.getPrototypeOf,Object);var w=function(e){return null!=e&&"object"==typeof e},k="[object Object]",v=Function.prototype,y=Object.prototype,x=v.toString,C=y.hasOwnProperty,A=x.call(Object);var P=function(e){if(!w(e)||m(e)!=k)return!1;var t=b(e);if(null===t)return!0;var n=C.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&x.call(n)==A};var E=function(){this.__data__=[],this.size=0};var T=function(e,t){return e===t||e!=e&&t!=t};var S=function(e,t){for(var n=e.length;n--;)if(T(e[n][0],t))return n;return-1},R=Array.prototype.splice;var O=function(e){var t=this.__data__,n=S(t,e);return!(n<0||(n==t.length-1?t.pop():R.call(t,n,1),--this.size,0))};var I=function(e){var t=this.__data__,n=S(t,e);return n<0?void 0:t[n][1]};var D=function(e){return S(this.__data__,e)>-1};var M=function(e,t){var n=this.__data__,o=S(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this};function N(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}N.prototype.clear=E,N.prototype.delete=O,N.prototype.get=I,N.prototype.has=D,N.prototype.set=M;var F=N;var B=function(){this.__data__=new F,this.size=0};var V=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var L=function(e){return this.__data__.get(e)};var z=function(e){return this.__data__.has(e)};var q=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},j="[object AsyncFunction]",H="[object Function]",U="[object GeneratorFunction]",W="[object Proxy]";var $=function(e){if(!q(e))return!1;var t=m(e);return t==H||t==U||t==j||t==W},G=o.a["__core-js_shared__"],K=function(){var e=/[^.]+$/.exec(G&&G.keys&&G.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var J=function(e){return!!K&&K in e},Z=Function.prototype.toString;var Q=function(e){if(null!=e){try{return Z.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Y=/^\[object .+?Constructor\]$/,X=Function.prototype,ee=Object.prototype,te=X.toString,ne=ee.hasOwnProperty,oe=RegExp("^"+te.call(ne).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var ie=function(e){return!(!q(e)||J(e))&&($(e)?oe:Y).test(Q(e))};var re=function(e,t){return null==e?void 0:e[t]};var se=function(e,t){var n=re(e,t);return ie(n)?n:void 0},ae=se(o.a,"Map"),ce=se(Object,"create");var le=function(){this.__data__=ce?ce(null):{},this.size=0};var de=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ue="__lodash_hash_undefined__",he=Object.prototype.hasOwnProperty;var fe=function(e){var t=this.__data__;if(ce){var n=t[e];return n===ue?void 0:n}return he.call(t,e)?t[e]:void 0},pe=Object.prototype.hasOwnProperty;var me=function(e){var t=this.__data__;return ce?void 0!==t[e]:pe.call(t,e)},ge="__lodash_hash_undefined__";var be=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ce&&void 0===t?ge:t,this};function we(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}we.prototype.clear=le,we.prototype.delete=de,we.prototype.get=fe,we.prototype.has=me,we.prototype.set=be;var _e=we;var ke=function(){this.size=0,this.__data__={hash:new _e,map:new(ae||F),string:new _e}};var ve=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var ye=function(e,t){var n=e.__data__;return ve(t)?n["string"==typeof t?"string":"hash"]:n.map};var xe=function(e){var t=ye(this,e).delete(e);return this.size-=t?1:0,t};var Ce=function(e){return ye(this,e).get(e)};var Ae=function(e){return ye(this,e).has(e)};var Pe=function(e,t){var n=ye(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this};function Ee(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}Ee.prototype.clear=ke,Ee.prototype.delete=xe,Ee.prototype.get=Ce,Ee.prototype.has=Ae,Ee.prototype.set=Pe;var Te=Ee,Se=200;var Re=function(e,t){var n=this.__data__;if(n instanceof F){var o=n.__data__;if(!ae||o.length<Se-1)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new Te(o)}return n.set(e,t),this.size=n.size,this};function Oe(e){var t=this.__data__=new F(e);this.size=t.size}Oe.prototype.clear=B,Oe.prototype.delete=V,Oe.prototype.get=L,Oe.prototype.has=z,Oe.prototype.set=Re;var Ie=Oe;var De=function(e,t){for(var n=-1,o=null==e?0:e.length;++n<o&&!1!==t(e[n],n,e););return e},Me=function(){try{var e=se(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Ne=function(e,t,n){"__proto__"==t&&Me?Me(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Fe=Object.prototype.hasOwnProperty;var Be=function(e,t,n){var o=e[t];Fe.call(e,t)&&T(o,n)&&(void 0!==n||t in e)||Ne(e,t,n)};var Ve=function(e,t,n,o){var i=!n;n||(n={});for(var r=-1,s=t.length;++r<s;){var a=t[r],c=o?o(n[a],e[a],a,n,e):void 0;void 0===c&&(c=e[a]),i?Ne(n,a,c):Be(n,a,c)}return n};var Le=function(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o},ze="[object Arguments]";var qe=function(e){return w(e)&&m(e)==ze},je=Object.prototype,He=je.hasOwnProperty,Ue=je.propertyIsEnumerable,We=qe(function(){return arguments}())?qe:function(e){return w(e)&&He.call(e,"callee")&&!Ue.call(e,"callee")},$e=Array.isArray,Ge=n(7),Ke=9007199254740991,Je=/^(?:0|[1-9]\d*)$/;var Ze=function(e,t){var n=typeof e;return!!(t=null==t?Ke:t)&&("number"==n||"symbol"!=n&&Je.test(e))&&e>-1&&e%1==0&&e<t},Qe=9007199254740991;var Ye=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Qe},Xe={};Xe["[object Float32Array]"]=Xe["[object Float64Array]"]=Xe["[object Int8Array]"]=Xe["[object Int16Array]"]=Xe["[object Int32Array]"]=Xe["[object Uint8Array]"]=Xe["[object Uint8ClampedArray]"]=Xe["[object Uint16Array]"]=Xe["[object Uint32Array]"]=!0,Xe["[object Arguments]"]=Xe["[object Array]"]=Xe["[object ArrayBuffer]"]=Xe["[object Boolean]"]=Xe["[object DataView]"]=Xe["[object Date]"]=Xe["[object Error]"]=Xe["[object Function]"]=Xe["[object Map]"]=Xe["[object Number]"]=Xe["[object Object]"]=Xe["[object RegExp]"]=Xe["[object Set]"]=Xe["[object String]"]=Xe["[object WeakMap]"]=!1;var et=function(e){return w(e)&&Ye(e.length)&&!!Xe[m(e)]};var tt=function(e){return function(t){return e(t)}},nt=n(6),ot=nt.a&&nt.a.isTypedArray,it=ot?tt(ot):et,rt=Object.prototype.hasOwnProperty;var st=function(e,t){var n=$e(e),o=!n&&We(e),i=!n&&!o&&Object(Ge.a)(e),r=!n&&!o&&!i&&it(e),s=n||o||i||r,a=s?Le(e.length,String):[],c=a.length;for(var l in e)!t&&!rt.call(e,l)||s&&("length"==l||i&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Ze(l,c))||a.push(l);return a},at=Object.prototype;var ct=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||at)},lt=g(Object.keys,Object),dt=Object.prototype.hasOwnProperty;var ut=function(e){if(!ct(e))return lt(e);var t=[];for(var n in Object(e))dt.call(e,n)&&"constructor"!=n&&t.push(n);return t};var ht=function(e){return null!=e&&Ye(e.length)&&!$(e)};var ft=function(e){return ht(e)?st(e):ut(e)};var pt=function(e,t){return e&&Ve(t,ft(t),e)};var mt=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},gt=Object.prototype.hasOwnProperty;var bt=function(e){if(!q(e))return mt(e);var t=ct(e),n=[];for(var o in e)("constructor"!=o||!t&&gt.call(e,o))&&n.push(o);return n};var wt=function(e){return ht(e)?st(e,!0):bt(e)};var _t=function(e,t){return e&&Ve(t,wt(t),e)},kt=n(31);var vt=function(e,t){var n=-1,o=e.length;for(t||(t=Array(o));++n<o;)t[n]=e[n];return t};var yt=function(e,t){for(var n=-1,o=null==e?0:e.length,i=0,r=[];++n<o;){var s=e[n];t(s,n,e)&&(r[i++]=s)}return r};var xt=function(){return[]},Ct=Object.prototype.propertyIsEnumerable,At=Object.getOwnPropertySymbols,Pt=At?function(e){return null==e?[]:(e=Object(e),yt(At(e),function(t){return Ct.call(e,t)}))}:xt;var Et=function(e,t){return Ve(e,Pt(e),t)};var Tt=function(e,t){for(var n=-1,o=t.length,i=e.length;++n<o;)e[i+n]=t[n];return e},St=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Tt(t,Pt(e)),e=b(e);return t}:xt;var Rt=function(e,t){return Ve(e,St(e),t)};var Ot=function(e,t,n){var o=t(e);return $e(e)?o:Tt(o,n(e))};var It=function(e){return Ot(e,ft,Pt)};var Dt=function(e){return Ot(e,wt,St)},Mt=se(o.a,"DataView"),Nt=se(o.a,"Promise"),Ft=se(o.a,"Set"),Bt=se(o.a,"WeakMap"),Vt=Q(Mt),Lt=Q(ae),zt=Q(Nt),qt=Q(Ft),jt=Q(Bt),Ht=m;(Mt&&"[object DataView]"!=Ht(new Mt(new ArrayBuffer(1)))||ae&&"[object Map]"!=Ht(new ae)||Nt&&"[object Promise]"!=Ht(Nt.resolve())||Ft&&"[object Set]"!=Ht(new Ft)||Bt&&"[object WeakMap]"!=Ht(new Bt))&&(Ht=function(e){var t=m(e),n="[object Object]"==t?e.constructor:void 0,o=n?Q(n):"";if(o)switch(o){case Vt:return"[object DataView]";case Lt:return"[object Map]";case zt:return"[object Promise]";case qt:return"[object Set]";case jt:return"[object WeakMap]"}return t});var Ut=Ht,Wt=Object.prototype.hasOwnProperty;var $t=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Wt.call(e,"index")&&(n.index=e.index,n.input=e.input),n},Gt=o.a.Uint8Array;var Kt=function(e){var t=new e.constructor(e.byteLength);return new Gt(t).set(new Gt(e)),t};var Jt=function(e,t){var n=t?Kt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},Zt=/\w*$/;var Qt=function(e){var t=new e.constructor(e.source,Zt.exec(e));return t.lastIndex=e.lastIndex,t},Yt=i?i.prototype:void 0,Xt=Yt?Yt.valueOf:void 0;var en=function(e){return Xt?Object(Xt.call(e)):{}};var tn=function(e,t){var n=t?Kt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)},nn="[object Boolean]",on="[object Date]",rn="[object Map]",sn="[object Number]",an="[object RegExp]",cn="[object Set]",ln="[object String]",dn="[object Symbol]",un="[object ArrayBuffer]",hn="[object DataView]",fn="[object Float32Array]",pn="[object Float64Array]",mn="[object Int8Array]",gn="[object Int16Array]",bn="[object Int32Array]",wn="[object Uint8Array]",_n="[object Uint8ClampedArray]",kn="[object Uint16Array]",vn="[object Uint32Array]";var yn=function(e,t,n){var o=e.constructor;switch(t){case un:return Kt(e);case nn:case on:return new o(+e);case hn:return Jt(e,n);case fn:case pn:case mn:case gn:case bn:case wn:case _n:case kn:case vn:return tn(e,n);case rn:return new o;case sn:case ln:return new o(e);case an:return Qt(e);case cn:return new o;case dn:return en(e)}},xn=Object.create,Cn=function(){function e(){}return function(t){if(!q(t))return{};if(xn)return xn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var An=function(e){return"function"!=typeof e.constructor||ct(e)?{}:Cn(b(e))},Pn="[object Map]";var En=function(e){return w(e)&&Ut(e)==Pn},Tn=nt.a&&nt.a.isMap,Sn=Tn?tt(Tn):En,Rn="[object Set]";var On=function(e){return w(e)&&Ut(e)==Rn},In=nt.a&&nt.a.isSet,Dn=In?tt(In):On,Mn=1,Nn=2,Fn=4,Bn="[object Arguments]",Vn="[object Function]",Ln="[object GeneratorFunction]",zn="[object Object]",qn={};qn[Bn]=qn["[object Array]"]=qn["[object ArrayBuffer]"]=qn["[object DataView]"]=qn["[object Boolean]"]=qn["[object Date]"]=qn["[object Float32Array]"]=qn["[object Float64Array]"]=qn["[object Int8Array]"]=qn["[object Int16Array]"]=qn["[object Int32Array]"]=qn["[object Map]"]=qn["[object Number]"]=qn[zn]=qn["[object RegExp]"]=qn["[object Set]"]=qn["[object String]"]=qn["[object Symbol]"]=qn["[object Uint8Array]"]=qn["[object Uint8ClampedArray]"]=qn["[object Uint16Array]"]=qn["[object Uint32Array]"]=!0,qn["[object Error]"]=qn[Vn]=qn["[object WeakMap]"]=!1;var jn=function e(t,n,o,i,r,s){var a,c=n&Mn,l=n&Nn,d=n&Fn;if(o&&(a=r?o(t,i,r,s):o(t)),void 0!==a)return a;if(!q(t))return t;var u=$e(t);if(u){if(a=$t(t),!c)return vt(t,a)}else{var h=Ut(t),f=h==Vn||h==Ln;if(Object(Ge.a)(t))return Object(kt.a)(t,c);if(h==zn||h==Bn||f&&!r){if(a=l||f?{}:An(t),!c)return l?Rt(t,_t(a,t)):Et(t,pt(a,t))}else{if(!qn[h])return r?t:{};a=yn(t,h,c)}}s||(s=new Ie);var p=s.get(t);if(p)return p;if(s.set(t,a),Dn(t))return t.forEach(function(i){a.add(e(i,n,o,i,t,s))}),a;if(Sn(t))return t.forEach(function(i,r){a.set(r,e(i,n,o,r,t,s))}),a;var m=d?l?Dt:It:l?keysIn:ft,g=u?void 0:m(t);return De(g||t,function(i,r){g&&(i=t[r=i]),Be(a,r,e(i,n,o,r,t,s))}),a},Hn=1,Un=4;var Wn=function(e,t){return jn(e,Hn|Un,t="function"==typeof t?t:void 0)};var $n=function(e){return w(e)&&1===e.nodeType&&!P(e)};class Gn{constructor(e,t){this._config={},t&&this.define(t),e&&this._setObjectToTarget(this._config,e)}set(e,t){this._setToTarget(this._config,e,t)}define(e,t){this._setToTarget(this._config,e,t,!0)}get(e){return this._getFromSource(this._config,e)}_setToTarget(e,t,n,o=!1){if(P(t))return void this._setObjectToTarget(e,t,o);const i=t.split(".");t=i.pop();for(const t of i)P(e[t])||(e[t]={}),e=e[t];if(P(n))return P(e[t])||(e[t]={}),e=e[t],void this._setObjectToTarget(e,n,o);o&&void 0!==e[t]||(e[t]=n)}_getFromSource(e,t){const n=t.split(".");t=n.pop();for(const t of n){if(!P(e[t])){e=null;break}e=e[t]}return e?function(e){return Wn(e,Kn)}(e[t]):void 0}_setObjectToTarget(e,t,n){Object.keys(t).forEach(o=>{this._setToTarget(e,o,t[o],n)})}}function Kn(e){return $n(e)?e:void 0}var Jn=n(0);var Zn=function(){return function e(){e.called=!0}};class Qn{constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=Zn(),this.off=Zn()}}function Yn(){let e="e";for(let t=0;t<8;t++)e+=Math.floor(65536*(1+Math.random())).toString(16).substring(1);return e}var Xn={get(e){return"number"!=typeof e?this[e]||this.normal:e},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};n(8);const eo=Symbol("listeningTo"),to=Symbol("emitterId");var no={on(e,t,n={}){this.listenTo(this,e,t,n)},once(e,t,n){let o=!1;this.listenTo(this,e,function(e,...n){o||(o=!0,e.off(),t.call(this,e,...n))},n)},off(e,t){this.stopListening(this,e,t)},listenTo(e,t,n,o={}){let i,r;this[eo]||(this[eo]={});const s=this[eo];io(e)||oo(e);const a=io(e);(i=s[a])||(i=s[a]={emitter:e,callbacks:{}}),(r=i.callbacks[t])||(r=i.callbacks[t]=[]),r.push(n),function(e,t){const n=ro(e);if(n[t])return;let o=t,i=null;const r=[];for(;""!==o&&!n[o];)n[o]={callbacks:[],childEvents:[]},r.push(n[o]),i&&n[o].childEvents.push(i),i=o,o=o.substr(0,o.lastIndexOf(":"));if(""!==o){for(const e of r)e.callbacks=n[o].callbacks.slice();n[o].childEvents.push(i)}}(e,t);const c=so(e,t),l=Xn.get(o.priority),d={callback:n,priority:l};for(const e of c){let t=!1;for(let n=0;n<e.length;n++)if(e[n].priority<l){e.splice(n,0,d),t=!0;break}t||e.push(d)}},stopListening(e,t,n){const o=this[eo];let i=e&&io(e);const r=o&&i&&o[i],s=r&&t&&r.callbacks[t];if(!(!o||e&&!r||t&&!s))if(n)co(e,t,n);else if(s){for(;n=s.pop();)co(e,t,n);delete r.callbacks[t]}else if(r){for(t in r.callbacks)this.stopListening(e,t);delete o[i]}else{for(i in o)this.stopListening(o[i].emitter);delete this[eo]}},fire(e,...t){const n=e instanceof Qn?e:new Qn(this,e),o=n.name;let i=function e(t,n){let o;if(!t._events||!(o=t._events[n])||!o.callbacks.length)return n.indexOf(":")>-1?e(t,n.substr(0,n.lastIndexOf(":"))):null;return o.callbacks}(this,o);if(n.path.push(this),i){const e=[n,...t];i=Array.from(i);for(let t=0;t<i.length&&(i[t].callback.apply(this,e),n.off.called&&(delete n.off.called,co(this,o,i[t].callback)),!n.stop.called);t++);}if(this._delegations){const e=this._delegations.get(o),i=this._delegations.get("*");e&&ao(e,n,t),i&&ao(i,n,t)}return n.return},delegate(...e){return{to:(t,n)=>{this._delegations||(this._delegations=new Map),e.forEach(e=>{const o=this._delegations.get(e);o?o.set(t,n):this._delegations.set(e,new Map([[t,n]]))})}}},stopDelegating(e,t){if(this._delegations)if(e)if(t){const n=this._delegations.get(e);n&&n.delete(t)}else this._delegations.delete(e);else this._delegations.clear()}};function oo(e,t){e[to]||(e[to]=t||Yn())}function io(e){return e[to]}function ro(e){return e._events||Object.defineProperty(e,"_events",{value:{}}),e._events}function so(e,t){const n=ro(e)[t];if(!n)return[];let o=[n.callbacks];for(let t=0;t<n.childEvents.length;t++){const i=so(e,n.childEvents[t]);o=o.concat(i)}return o}function ao(e,t,n){for(let[o,i]of e){i?"function"==typeof i&&(i=i(t.name)):i=t.name;const e=new Qn(t.source,i);e.path=[...t.path],o.fire(e,...n)}}function co(e,t,n){const o=so(e,t);for(const e of o)for(let t=0;t<e.length;t++)e[t].callback==n&&(e.splice(t,1),t--)}function lo(e,...t){t.forEach(t=>{Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)).forEach(n=>{if(n in e.prototype)return;const o=Object.getOwnPropertyDescriptor(t,n);o.enumerable=!1,Object.defineProperty(e.prototype,n,o)})})}function uo(e,t){const n=Math.min(e.length,t.length);for(let o=0;o<n;o++)if(e[o]!=t[o])return o;return e.length==t.length?"same":e.length<t.length?"prefix":"extension"}var ho=4;var fo=function(e){return jn(e,ho)};class po{constructor(){this.parent=null}get index(){let e;if(!this.parent)return null;if(-1==(e=this.parent.getChildIndex(this)))throw new Jn.b("view-node-not-found-in-parent: The node's parent does not contain this node.");return e}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}get document(){return this.parent instanceof po?this.parent.document:null}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.index),t=t.parent;return e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}getCommonAncestor(e,t={}){const n=this.getAncestors(t),o=e.getAncestors(t);let i=0;for(;n[i]==o[i]&&n[i];)i++;return 0===i?null:n[i-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),n=e.getPath(),o=uo(t,n);switch(o){case"prefix":return!0;case"extension":return!1;default:return t[o]<n[o]}}isAfter(e){return this!=e&&(this.root===e.root&&!this.isBefore(e))}_remove(){this.parent._removeChildren(this.index)}_fireChange(e,t){this.fire("change:"+e,t),this.parent&&this.parent._fireChange(e,t)}toJSON(){const e=fo(this);return delete e.parent,e}is(e){return"node"==e}}lo(po,no);class mo extends po{constructor(e){super(),this._textData=e}is(e){return"text"==e||super.is(e)}get data(){return this._textData}get _data(){return this.data}set _data(e){this._fireChange("text",this),this._textData=e}isSimilar(e){return e instanceof mo&&(this===e||this.data===e.data)}_clone(){return new mo(this.data)}}class go{constructor(e,t,n){if(this.textNode=e,t<0||t>e.data.length)throw new Jn.b("view-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.");if(n<0||t+n>e.data.length)throw new Jn.b("view-textproxy-wrong-length: Given length value is incorrect.");this.data=e.data.substring(t,t+n),this.offsetInText=t}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(e){return"textProxy"==e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this.textNode:this.parent;for(;null!==n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}}function bo(e){const t=new Map;for(const n in e)t.set(n,e[n]);return t}function wo(e){return!(!e||!e[Symbol.iterator])}class _o{constructor(...e){this._patterns=[],this.add(...e)}add(...e){for(let t of e)("string"==typeof t||t instanceof RegExp)&&(t={name:t}),t.classes&&("string"==typeof t.classes||t.classes instanceof RegExp)&&(t.classes=[t.classes]),this._patterns.push(t)}match(...e){for(const t of e)for(const e of this._patterns){const n=ko(t,e);if(n)return{element:t,pattern:e,match:n}}return null}matchAll(...e){const t=[];for(const n of e)for(const e of this._patterns){const o=ko(n,e);o&&t.push({element:n,pattern:e,match:o})}return t.length>0?t:null}getElementName(){if(1!==this._patterns.length)return null;const e=this._patterns[0],t=e.name;return"function"==typeof e||!t||t instanceof RegExp?null:t}}function ko(e,t){if("function"==typeof t)return t(e);const n={};return t.name&&(n.name=function(e,t){if(e instanceof RegExp)return e.test(t);return e===t}(t.name,e.name),!n.name)?null:t.attributes&&(n.attributes=function(e,t){const n=[];for(const o in e){const i=e[o];if(!t.hasAttribute(o))return null;{const e=t.getAttribute(o);if(!0===i)n.push(o);else if(i instanceof RegExp){if(!i.test(e))return null;n.push(o)}else{if(e!==i)return null;n.push(o)}}}return n}(t.attributes,e),!n.attributes)?null:!(t.classes&&(n.classes=function(e,t){const n=[];for(const o of e)if(o instanceof RegExp){const e=t.getClassNames();for(const t of e)o.test(t)&&n.push(t);if(0===n.length)return null}else{if(!t.hasClass(o))return null;n.push(o)}return n}(t.classes,e),!n.classes))&&(!(t.styles&&(n.styles=function(e,t){const n=[];for(const o in e){const i=e[o];if(!t.hasStyle(o))return null;{const e=t.getStyle(o);if(i instanceof RegExp){if(!i.test(e))return null;n.push(o)}else{if(e!==i)return null;n.push(o)}}}return n}(t.styles,e),!n.styles))&&n)}class vo extends po{constructor(e,t,n){if(super(),this.name=e,this._attrs=function(e){e=P(e)?bo(e):new Map(e);for(const[t,n]of e)null===n?e.delete(t):"string"!=typeof n&&e.set(t,String(n));return e}(t),this._children=[],n&&this._insertChild(0,n),this._classes=new Set,this._attrs.has("class")){const e=this._attrs.get("class");xo(this._classes,e),this._attrs.delete("class")}this._styles=new Map,this._attrs.has("style")&&(yo(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(e,t=null){return t?"element"==e&&t==this.name:"element"==e||e==this.name||super.is(e)}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.size>0&&(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.size>0&&(yield["style",this.getAttribute("style")])}getAttribute(e){if("class"==e)return this._classes.size>0?[...this._classes].join(" "):void 0;if("style"!=e)return this._attrs.get(e);if(this._styles.size>0){let e="";for(const[t,n]of this._styles)e+=`${t}:${n};`;return e}}hasAttribute(e){return"class"==e?this._classes.size>0:"style"==e?this._styles.size>0:this._attrs.has(e)}isSimilar(e){if(!(e instanceof vo))return!1;if(this===e)return!0;if(this.name!=e.name)return!1;if(this._attrs.size!==e._attrs.size||this._classes.size!==e._classes.size||this._styles.size!==e._styles.size)return!1;for(const[t,n]of this._attrs)if(!e._attrs.has(t)||e._attrs.get(t)!==n)return!1;for(const t of this._classes)if(!e._classes.has(t))return!1;for(const[t,n]of this._styles)if(!e._styles.has(t)||e._styles.get(t)!==n)return!1;return!0}hasClass(...e){for(const t of e)if(!this._classes.has(t))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(e){return this._styles.get(e)}getStyleNames(){return this._styles.keys()}hasStyle(...e){for(const t of e)if(!this._styles.has(t))return!1;return!0}findAncestor(...e){const t=new _o(...e);let n=this.parent;for(;n;){if(t.match(n))return n;n=n.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=Array.from(this._classes).sort().join(","),t=Array.from(this._styles).map(e=>`${e[0]}:${e[1]}`).sort().join(";"),n=Array.from(this._attrs).map(e=>`${e[0]}="${e[1]}"`).sort().join(" ");return this.name+(""==e?"":` class="${e}"`)+(""==t?"":` style="${t}"`)+(""==n?"":` ${n}`)}_clone(e=!1){const t=[];if(e)for(const n of this.getChildren())t.push(n._clone(e));const n=new this.constructor(this.name,this._attrs,t);return n._classes=new Set(this._classes),n._styles=new Map(this._styles),n._customProperties=new Map(this._customProperties),n.getFillerOffset=this.getFillerOffset,n}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange("children",this);let n=0;const o=function(e){if("string"==typeof e)return[new mo(e)];wo(e)||(e=[e]);return Array.from(e).map(e=>"string"==typeof e?new mo(e):e instanceof go?new mo(e.data):e)}(t);for(const t of o)null!==t.parent&&t._remove(),t.parent=this,this._children.splice(e,0,t),e++,n++;return n}_removeChildren(e,t=1){this._fireChange("children",this);for(let n=e;n<e+t;n++)this._children[n].parent=null;return this._children.splice(e,t)}_setAttribute(e,t){t=String(t),this._fireChange("attributes",this),"class"==e?xo(this._classes,t):"style"==e?yo(this._styles,t):this._attrs.set(e,t)}_removeAttribute(e){return this._fireChange("attributes",this),"class"==e?this._classes.size>0&&(this._classes.clear(),!0):"style"==e?this._styles.size>0&&(this._styles.clear(),!0):this._attrs.delete(e)}_addClass(e){this._fireChange("attributes",this),(e=Array.isArray(e)?e:[e]).forEach(e=>this._classes.add(e))}_removeClass(e){this._fireChange("attributes",this),(e=Array.isArray(e)?e:[e]).forEach(e=>this._classes.delete(e))}_setStyle(e,t){if(this._fireChange("attributes",this),P(e)){const t=Object.keys(e);for(const n of t)this._styles.set(n,e[n])}else this._styles.set(e,t)}_removeStyle(e){this._fireChange("attributes",this),(e=Array.isArray(e)?e:[e]).forEach(e=>this._styles.delete(e))}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}function yo(e,t){let n=null,o=0,i=0,r=null;if(e.clear(),""!==t){";"!=t.charAt(t.length-1)&&(t+=";");for(let s=0;s<t.length;s++){const a=t.charAt(s);if(null===n)switch(a){case":":r||(r=t.substr(o,s-o),i=s+1);break;case'"':case"'":n=a;break;case";":{const n=t.substr(i,s-i);r&&e.set(r.trim(),n.trim()),r=null,o=s+1;break}}else a===n&&(n=null)}}}function xo(e,t){const n=t.split(/\s+/);e.clear(),n.forEach(t=>e.add(t))}class Co extends vo{constructor(e,t,n){super(e,t,n),this.getFillerOffset=Ao}is(e,t=null){return t?"containerElement"==e&&t==this.name||super.is(e,t):"containerElement"==e||super.is(e)}}function Ao(){const e=[...this.getChildren()],t=e[this.childCount-1];if(t&&t.is("element","br"))return this.childCount;for(const t of e)if(!t.is("uiElement"))return null;return this.childCount}var Po=function(e){return e};var Eo=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},To=Math.max;var So=function(e,t,n){return t=To(void 0===t?e.length-1:t,0),function(){for(var o=arguments,i=-1,r=To(o.length-t,0),s=Array(r);++i<r;)s[i]=o[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=o[i];return a[t]=n(s),Eo(e,this,a)}};var Ro=function(e){return function(){return e}},Oo=Me?function(e,t){return Me(e,"toString",{configurable:!0,enumerable:!1,value:Ro(t),writable:!0})}:Po,Io=800,Do=16,Mo=Date.now;var No=function(e){var t=0,n=0;return function(){var o=Mo(),i=Do-(o-n);if(n=o,i>0){if(++t>=Io)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Oo);var Fo=function(e,t){return No(So(e,t,Po),e+"")};var Bo=function(e,t,n){if(!q(n))return!1;var o=typeof t;return!!("number"==o?ht(n)&&Ze(t,n.length):"string"==o&&t in n)&&T(n[t],e)};var Vo=function(e){return Fo(function(t,n){var o=-1,i=n.length,r=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(r=e.length>3&&"function"==typeof r?(i--,r):void 0,s&&Bo(n[0],n[1],s)&&(r=i<3?void 0:r,i=1),t=Object(t);++o<i;){var a=n[o];a&&e(t,a,o,r)}return t})}(function(e,t){Ve(t,wt(t),e)});const Lo=Symbol("observableProperties"),zo=Symbol("boundObservables"),qo=Symbol("boundProperties"),jo={set(e,t){if(q(e))return void Object.keys(e).forEach(t=>{this.set(t,e[t])},this);Uo(this);const n=this[Lo];if(e in this&&!n.has(e))throw new Jn.b("observable-set-cannot-override: Cannot override an existing property.");Object.defineProperty(this,e,{enumerable:!0,configurable:!0,get:()=>n.get(e),set(t){const o=n.get(e);let i=this.fire("set:"+e,e,t,o);void 0===i&&(i=t),o===i&&n.has(e)||(n.set(e,i),this.fire("change:"+e,e,i,o))}}),this[e]=t},bind(...e){if(!e.length||!Go(e))throw new Jn.b("observable-bind-wrong-properties: All properties must be strings.");if(new Set(e).size!==e.length)throw new Jn.b("observable-bind-duplicate-properties: Properties must be unique.");Uo(this);const t=this[qo];e.forEach(e=>{if(t.has(e))throw new Jn.b("observable-bind-rebind: Cannot bind the same property more that once.")});const n=new Map;return e.forEach(e=>{const o={property:e,to:[]};t.set(e,o),n.set(e,o)}),{to:Wo,toMany:$o,_observable:this,_bindProperties:e,_to:[],_bindings:n}},unbind(...e){if(!(Lo in this))return;const t=this[qo],n=this[zo];if(e.length){if(!Go(e))throw new Jn.b("observable-unbind-wrong-properties: Properties must be strings.");e.forEach(e=>{const o=t.get(e);if(!o)return;let i,r,s,a;o.to.forEach(e=>{i=e[0],r=e[1],s=n.get(i),(a=s[r]).delete(o),a.size||delete s[r],Object.keys(s).length||(n.delete(i),this.stopListening(i,"change"))}),t.delete(e)})}else n.forEach((e,t)=>{this.stopListening(t,"change")}),n.clear(),t.clear()},decorate(e){const t=this[e];if(!t)throw new Jn.b("observablemixin-cannot-decorate-undefined: Cannot decorate an undefined method.",{object:this,methodName:e});this.on(e,(e,n)=>{e.return=t.apply(this,n)}),this[e]=function(...t){return this.fire(e,t)}}};Vo(jo,no);var Ho=jo;function Uo(e){Lo in e||(Object.defineProperty(e,Lo,{value:new Map}),Object.defineProperty(e,zo,{value:new Map}),Object.defineProperty(e,qo,{value:new Map}))}function Wo(...e){const t=function(...e){if(!e.length)throw new Jn.b("observable-bind-to-parse-error: Invalid argument syntax in `to()`.");const t={to:[]};let n;"function"==typeof e[e.length-1]&&(t.callback=e.pop());return e.forEach(e=>{if("string"==typeof e)n.properties.push(e);else{if("object"!=typeof e)throw new Jn.b("observable-bind-to-parse-error: Invalid argument syntax in `to()`.");n={observable:e,properties:[]},t.to.push(n)}}),t}(...e),n=Array.from(this._bindings.keys()),o=n.length;if(!t.callback&&t.to.length>1)throw new Jn.b("observable-bind-to-no-callback: Binding multiple observables only possible with callback.");if(o>1&&t.callback)throw new Jn.b("observable-bind-to-extra-callback: Cannot bind multiple properties and use a callback in one binding.");t.to.forEach(e=>{if(e.properties.length&&e.properties.length!==o)throw new Jn.b("observable-bind-to-properties-length: The number of properties must match.");e.properties.length||(e.properties=this._bindProperties)}),this._to=t.to,t.callback&&(this._bindings.get(n[0]).callback=t.callback),function(e,t){t.forEach(t=>{const n=e[zo];let o;n.get(t.observable)||e.listenTo(t.observable,"change",(i,r)=>{(o=n.get(t.observable)[r])&&o.forEach(t=>{Ko(e,t.property)})})})}(this._observable,this._to),function(e){let t;e._bindings.forEach((n,o)=>{e._to.forEach(i=>{t=i.properties[n.callback?0:e._bindProperties.indexOf(o)],n.to.push([i.observable,t]),function(e,t,n,o){const i=e[zo],r=i.get(n),s=r||{};s[o]||(s[o]=new Set);s[o].add(t),r||i.set(n,s)}(e._observable,n,i.observable,t)})})}(this),this._bindProperties.forEach(e=>{Ko(this._observable,e)})}function $o(e,t,n){if(this._bindings.size>1)throw new Jn.b("observable-bind-to-many-not-one-binding: Cannot bind multiple properties with toMany().");this.to(...function(e,t){const n=e.map(e=>[e,t]);return Array.prototype.concat.apply([],n)}(e,t),n)}function Go(e){return e.every(e=>"string"==typeof e)}function Ko(e,t){const n=e[qo].get(t);let o;o=n.callback?n.callback.apply(e,n.to.map(e=>e[0][e[1]])):(o=n.to[0])[0][o[1]],e.hasOwnProperty(t)?e[t]=o:e.set(t,o)}const Jo=Symbol("document");class Zo extends Co{constructor(e,t,n){super(e,t,n),this.set("isReadOnly",!1),this.set("isFocused",!1)}is(e,t=null){return t?"editableElement"==e&&t==this.name||super.is(e,t):"editableElement"==e||super.is(e)}destroy(){this.stopListening()}get document(){return this.getCustomProperty(Jo)}set _document(e){if(this.getCustomProperty(Jo))throw new Jn.b("view-editableelement-document-already-set: View document is already set.");this._setCustomProperty(Jo,e),this.bind("isReadOnly").to(e),this.bind("isFocused").to(e,"isFocused",t=>t&&e.selection.editableElement==this),this.listenTo(e.selection,"change",()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this})}}lo(Zo,Ho);const Qo=Symbol("rootName");class Yo extends Zo{constructor(e){super(e),this.rootName="main"}is(e,t=null){return t?"rootElement"==e&&t==this.name||super.is(e,t):"rootElement"==e||super.is(e)}get rootName(){return this.getCustomProperty(Qo)}set rootName(e){this._setCustomProperty(Qo,e)}set _name(e){this.name=e}}class Xo{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new Jn.b("view-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.");if(e.direction&&"forward"!=e.direction&&"backward"!=e.direction)throw new Jn.b("view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.",{direction:e.direction});this.boundaries=e.boundaries||null,e.startPosition?this.position=ei._createAt(e.startPosition):this.position=ei._createAt(e.boundaries["backward"==e.direction?"end":"start"]),this.direction=e.direction||"forward",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(e){let t,n,o;do{o=this.position,({done:t,value:n}=this.next())}while(!t&&e(n));t||(this.position=o)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let e=this.position.clone();const t=this.position,n=e.parent;if(null===n.parent&&e.offset===n.childCount)return{done:!0};if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0};let o;if(n instanceof mo){if(e.isAtEnd)return this.position=ei._createAfter(n),this._next();o=n.data[e.offset]}else o=n.getChild(e.offset);if(o instanceof vo)return this.shallow?e.offset++:e=new ei(o,0),this.position=e,this._formatReturnValue("elementStart",o,t,e,1);if(o instanceof mo){if(this.singleCharacters)return e=new ei(o,0),this.position=e,this._next();{let n,i=o.data.length;return o==this._boundaryEndParent?(i=this.boundaries.end.offset,n=new go(o,0,i),e=ei._createAfter(n)):(n=new go(o,0,o.data.length),e.offset++),this.position=e,this._formatReturnValue("text",n,t,e,i)}}if("string"==typeof o){let o;if(this.singleCharacters)o=1;else{o=(n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length)-e.offset}const i=new go(n,e.offset,o);return e.offset+=o,this.position=e,this._formatReturnValue("text",i,t,e,o)}return e=ei._createAfter(n),this.position=e,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",n,t,e)}_previous(){let e=this.position.clone();const t=this.position,n=e.parent;if(null===n.parent&&0===e.offset)return{done:!0};if(n==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0};let o;if(n instanceof mo){if(e.isAtStart)return this.position=ei._createBefore(n),this._previous();o=n.data[e.offset-1]}else o=n.getChild(e.offset-1);if(o instanceof vo)return this.shallow?(e.offset--,this.position=e,this._formatReturnValue("elementStart",o,t,e,1)):(e=new ei(o,o.childCount),this.position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",o,t,e));if(o instanceof mo){if(this.singleCharacters)return e=new ei(o,o.data.length),this.position=e,this._previous();{let n,i=o.data.length;if(o==this._boundaryStartParent){const t=this.boundaries.start.offset;i=(n=new go(o,t,o.data.length-t)).data.length,e=ei._createBefore(n)}else n=new go(o,0,o.data.length),e.offset--;return this.position=e,this._formatReturnValue("text",n,t,e,i)}}if("string"==typeof o){let o;if(this.singleCharacters)o=1;else{const t=n===this._boundaryStartParent?this.boundaries.start.offset:0;o=e.offset-t}e.offset-=o;const i=new go(n,e.offset,o);return this.position=e,this._formatReturnValue("text",i,t,e,o)}return e=ei._createBefore(n),this.position=e,this._formatReturnValue("elementStart",n,t,e,1)}_formatReturnValue(e,t,n,o,i){return t instanceof go&&(t.offsetInText+t.data.length==t.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=ei._createAfter(t.textNode):(o=ei._createAfter(t.textNode),this.position=o)),0===t.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=ei._createBefore(t.textNode):(o=ei._createBefore(t.textNode),this.position=o))),{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:o,length:i}}}}class ei{constructor(e,t){this.parent=e,this.offset=t}get nodeAfter(){return this.parent.is("text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){const e=this.parent.is("text")?this.parent.data.length:this.parent.childCount;return this.offset===e}get root(){return this.parent.root}get editableElement(){let e=this.parent;for(;!(e instanceof Zo);){if(!e.parent)return null;e=e.parent}return e}getShiftedBy(e){const t=ei._createAt(this),n=t.offset+e;return t.offset=n<0?0:n,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const n=new Xo(t);return n.skip(e),n.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){const t=this.getAncestors(),n=e.getAncestors();let o=0;for(;t[o]==n[o]&&t[o];)o++;return 0===o?null:t[o-1]}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return"before"==this.compareWith(e)}isAfter(e){return"after"==this.compareWith(e)}compareWith(e){if(this.root!==e.root)return"different";if(this.isEqual(e))return"same";const t=this.parent.is("node")?this.parent.getPath():[],n=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset),n.push(e.offset);const o=uo(t,n);switch(o){case"prefix":return"before";case"extension":return"after";default:return t[o]<n[o]?"before":"after"}}getWalker(e={}){return e.startPosition=this,new Xo(e)}clone(){return new ei(this.parent,this.offset)}static _createAt(e,t){if(e instanceof ei)return new this(e.parent,e.offset);{const n=e;if("end"==t)t=n.is("text")?n.data.length:n.childCount;else{if("before"==t)return this._createBefore(n);if("after"==t)return this._createAfter(n);if(0!==t&&!t)throw new Jn.b("view-createPositionAt-offset-required: View#createPositionAt() requires the offset when the first parameter is a view item.")}return new ei(n,t)}}static _createAfter(e){if(e.is("textProxy"))return new ei(e.textNode,e.offsetInText+e.data.length);if(!e.parent)throw new Jn.b("view-position-after-root: You can not make position after root.",{root:e});return new ei(e.parent,e.index+1)}static _createBefore(e){if(e.is("textProxy"))return new ei(e.textNode,e.offsetInText);if(!e.parent)throw new Jn.b("view-position-before-root: You can not make position before root.",{root:e});return new ei(e.parent,e.index)}}class ti{constructor(e,t=null){this.start=e.clone(),this.end=t?t.clone():e.clone()}*[Symbol.iterator](){yield*new Xo({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 e=this.start.getLastMatchingPosition(ni,{direction:"backward"}),t=this.end.getLastMatchingPosition(ni);return e.parent.is("text")&&e.isAtStart&&(e=ei._createBefore(e.parent)),t.parent.is("text")&&t.isAtEnd&&(t=ei._createAfter(t.parent)),new ti(e,t)}getTrimmed(){let e=this.start.getLastMatchingPosition(ni);if(e.isAfter(this.end)||e.isEqual(this.end))return new ti(e,e);let t=this.end.getLastMatchingPosition(ni,{direction:"backward"});const n=e.nodeAfter,o=t.nodeBefore;return n&&n.is("text")&&(e=new ei(n,0)),o&&o.is("text")&&(t=new ei(o,o.data.length)),new ti(e,t)}isEqual(e){return this==e||this.start.isEqual(e.start)&&this.end.isEqual(e.end)}containsPosition(e){return e.isAfter(this.start)&&e.isBefore(this.end)}containsRange(e,t=!1){e.isCollapsed&&(t=!1);const n=this.containsPosition(e.start)||t&&this.start.isEqual(e.start),o=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return n&&o}getDifference(e){const t=[];return this.isIntersecting(e)?(this.containsPosition(e.start)&&t.push(new ti(this.start,e.start)),this.containsPosition(e.end)&&t.push(new ti(e.end,this.end))):t.push(this.clone()),t}getIntersection(e){if(this.isIntersecting(e)){let t=this.start,n=this.end;return this.containsPosition(e.start)&&(t=e.start),this.containsPosition(e.end)&&(n=e.end),new ti(t,n)}return null}getWalker(e={}){return e.boundaries=this,new Xo(e)}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}clone(){return new ti(this.start,this.end)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new Xo(e);for(const e of t)yield e.item}*getPositions(e={}){e.boundaries=this;const t=new Xo(e);yield t.position;for(const e of t)yield e.nextPosition}isIntersecting(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}static _createFromParentsAndOffsets(e,t,n,o){return new this(new ei(e,t),new ei(n,o))}static _createFromPositionAndShift(e,t){const n=e,o=e.getShiftedBy(t);return t>0?new this(n,o):new this(o,n)}static _createIn(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}static _createOn(e){const t=e.is("textProxy")?e.offsetSize:1;return this._createFromPositionAndShift(ei._createBefore(e),t)}}function ni(e){return!(!e.item.is("attributeElement")&&!e.item.is("uiElement"))}function oi(e){let t=0;for(const n of e)t++;return t}class ii{constructor(e=null,t,n){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(e,t,n)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.end:e.start).clone()}get focus(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.start:e.end).clone()}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}*getRanges(){for(const e of this._ranges)yield e.clone()}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?e.clone():null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}isEqual(e){if(this.isFake!=e.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel)return!1;if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let n=!1;for(const o of e._ranges)if(t.isEqual(o)){n=!0;break}if(!n)return!1}return!0}isSimilar(e){if(this.isBackward!=e.isBackward)return!1;const t=oi(this.getRanges());if(t!=oi(e.getRanges()))return!1;if(0==t)return!0;for(let t of this.getRanges()){t=t.getTrimmed();let n=!1;for(let o of e.getRanges())if(o=o.getTrimmed(),t.start.isEqual(o.start)&&t.end.isEqual(o.end)){n=!0;break}if(!n)return!1}return!0}getSelectedElement(){if(1!==this.rangeCount)return null;const e=this.getFirstRange();let t=e.start.nodeAfter,n=e.end.nodeBefore;return e.start.parent.is("text")&&e.start.isAtEnd&&e.start.parent.nextSibling&&(t=e.start.parent.nextSibling),e.end.parent.is("text")&&e.end.isAtStart&&e.end.parent.previousSibling&&(n=e.end.parent.previousSibling),t instanceof vo&&t==n?t:null}setTo(e,t,n){if(null===e)this._setRanges([]),this._setFakeOptions(t);else if(e instanceof ii||e instanceof ri)this._setRanges(e.getRanges(),e.isBackward),this._setFakeOptions({fake:e.isFake,label:e.fakeSelectionLabel});else if(e instanceof ti)this._setRanges([e],t&&t.backward),this._setFakeOptions(t);else if(e instanceof ei)this._setRanges([new ti(e)]),this._setFakeOptions(t);else if(e instanceof po){const o=!!n&&!!n.backward;let i;if(void 0===t)throw new Jn.b("view-selection-setTo-required-second-parameter: selection.setTo requires the second parameter when the first parameter is a node.");i="in"==t?ti._createIn(e):"on"==t?ti._createOn(e):new ti(ei._createAt(e,t)),this._setRanges([i],o),this._setFakeOptions(n)}else{if(!wo(e))throw new Jn.b("view-selection-setTo-not-selectable: Cannot set selection to given place.");this._setRanges(e,t&&t.backward),this._setFakeOptions(t)}this.fire("change")}setFocus(e,t){if(null===this.anchor)throw new Jn.b("view-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.");const n=ei._createAt(e,t);if("same"==n.compareWith(this.focus))return;const o=this.anchor;this._ranges.pop(),"before"==n.compareWith(o)?this._addRange(new ti(n,o),!0):this._addRange(new ti(o,n)),this.fire("change")}is(e){return"selection"==e}_setRanges(e,t=!1){e=Array.from(e),this._ranges=[];for(const t of e)this._addRange(t);this._lastRangeBackward=!!t}_setFakeOptions(e={}){this._isFake=!!e.fake,this._fakeSelectionLabel=e.fake&&e.label||""}_addRange(e,t=!1){if(!(e instanceof ti))throw new Jn.b("view-selection-add-range-not-range: Selection range set to an object that is not an instance of view.Range");this._pushRange(e),this._lastRangeBackward=!!t}_pushRange(e){for(const t of this._ranges)if(e.isIntersecting(t))throw new Jn.b("view-selection-range-intersects: Trying to add a range that intersects with another range from selection.",{addedRange:e,intersectingRange:t});this._ranges.push(new ti(e.start,e.end))}}lo(ii,no);class ri{constructor(e=null,t,n){this._selection=new ii,this._selection.delegate("change").to(this),this._selection.setTo(e,t,n)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}is(e){return"selection"==e||"documentSelection"==e}_setTo(e,t,n){this._selection.setTo(e,t,n)}_setFocus(e,t){this._selection.setFocus(e,t)}}lo(ri,no);class si{constructor(e={}){this._items=[],this._itemMap=new Map,this._idProperty=e.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[]}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(e,t){let n;const o=this._idProperty;if(o in e){if("string"!=typeof(n=e[o]))throw new Jn.b("collection-add-invalid-id");if(this.get(n))throw new Jn.b("collection-add-item-already-exists")}else e[o]=n=Yn();if(void 0===t)t=this._items.length;else if(t>this._items.length||t<0)throw new Jn.b("collection-add-item-invalid-index");return this._items.splice(t,0,e),this._itemMap.set(n,e),this.fire("add",e,t),this}get(e){let t;if("string"==typeof e)t=this._itemMap.get(e);else{if("number"!=typeof e)throw new Jn.b("collection-get-invalid-arg: Index or id must be given.");t=this._items[e]}return t||null}has(e){if("string"==typeof e)return this._itemMap.has(e);{const t=e[this._idProperty];return this._itemMap.has(t)}}getIndex(e){let t;return t="string"==typeof e?this._itemMap.get(e):e,this._items.indexOf(t)}remove(e){let t,n,o,i=!1;const r=this._idProperty;if("string"==typeof e?(n=e,i=!(o=this._itemMap.get(n)),o&&(t=this._items.indexOf(o))):"number"==typeof e?(t=e,i=!(o=this._items[t]),o&&(n=o[r])):(n=(o=e)[r],i=-1==(t=this._items.indexOf(o))||!this._itemMap.get(n)),i)throw new Jn.b("collection-remove-404: Item not found.");this._items.splice(t,1),this._itemMap.delete(n);const s=this._bindToInternalToExternalMap.get(o);return this._bindToInternalToExternalMap.delete(o),this._bindToExternalToInternalMap.delete(s),this.fire("remove",o,t),o}map(e,t){return this._items.map(e,t)}find(e,t){return this._items.find(e,t)}filter(e,t){return this._items.filter(e,t)}clear(){for(this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);this.length;)this.remove(0)}bindTo(e){if(this._bindToCollection)throw new Jn.b("collection-bind-to-rebind: The collection cannot be bound more than once.");return this._bindToCollection=e,{as:e=>{this._setUpBindToBinding(t=>new e(t))},using:e=>{"function"==typeof e?this._setUpBindToBinding(t=>e(t)):this._setUpBindToBinding(t=>t[e])}}}_setUpBindToBinding(e){const t=this._bindToCollection,n=(n,o,i)=>{const r=t._bindToCollection==this,s=t._bindToInternalToExternalMap.get(o);if(r&&s)this._bindToExternalToInternalMap.set(o,s),this._bindToInternalToExternalMap.set(s,o);else{const n=e(o);if(!n)return void this._skippedIndexesFromExternal.push(i);let r=i;for(const e of this._skippedIndexesFromExternal)i>e&&r--;for(const e of t._skippedIndexesFromExternal)r>=e&&r++;this._bindToExternalToInternalMap.set(o,n),this._bindToInternalToExternalMap.set(n,o),this.add(n,r);for(let e=0;e<t._skippedIndexesFromExternal.length;e++)r<=t._skippedIndexesFromExternal[e]&&t._skippedIndexesFromExternal[e]++}};for(const e of t)n(0,e,t.getIndex(e));this.listenTo(t,"add",n),this.listenTo(t,"remove",(e,t,n)=>{const o=this._bindToExternalToInternalMap.get(t);o&&this.remove(o),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((e,t)=>(n<t&&e.push(t-1),n>t&&e.push(t),e),[])})}[Symbol.iterator](){return this._items[Symbol.iterator]()}}lo(si,no);class ai{constructor(){this.selection=new ri,this.roots=new si({idProperty:"rootName"}),this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isComposing",!1),this._postFixers=new Set}getRoot(e="main"){return this.roots.get(e)}registerPostFixer(e){this._postFixers.add(e)}destroy(){this.roots.map(e=>e.destroy()),this.stopListening()}_callPostFixers(e){let t=!1;do{for(const n of this._postFixers)if(t=n(e))break}while(t)}}lo(ai,Ho);const ci=10;class li extends vo{constructor(e,t,n){super(e,t,n),this.getFillerOffset=di,this._priority=ci,this._id=null,this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new Jn.b("attribute-element-get-elements-with-same-id-no-id: Cannot get elements with the same id for an attribute element without id.");return new Set(this._clonesGroup)}is(e,t=null){return t?"attributeElement"==e&&t==this.name||super.is(e,t):"attributeElement"==e||super.is(e)}isSimilar(e){return null!==this.id||null!==e.id?this.id===e.id:super.isSimilar(e)&&this.priority==e.priority}_clone(e){const t=super._clone(e);return t._priority=this._priority,t._id=this._id,t}}function di(){if(ui(this))return null;let e=this.parent;for(;e&&e.is("attributeElement");){if(ui(e)>1)return null;e=e.parent}return!e||ui(e)>1?null:this.childCount}function ui(e){return Array.from(e.getChildren()).filter(e=>!e.is("uiElement")).length}li.DEFAULT_PRIORITY=ci;class hi extends vo{constructor(e,t,n){super(e,t,n),this.getFillerOffset=fi}is(e,t=null){return t?"emptyElement"==e&&t==this.name||super.is(e,t):"emptyElement"==e||super.is(e)}_insertChild(e,t){if(t&&(t instanceof po||Array.from(t).length>0))throw new Jn.b("view-emptyelement-cannot-add: Cannot add child nodes to EmptyElement instance.")}}function fi(){return null}const pi=navigator.userAgent.toLowerCase();var mi={isMac:function(e){return e.indexOf("macintosh")>-1}(pi),isEdge:function(e){return!!e.match(/edge\/(\d+.?\d*)/)}(pi),isGecko:function(e){return!!e.match(/gecko\/\d+/)}(pi),isSafari:function(e){return e.indexOf(" applewebkit/")>-1&&-1===e.indexOf("chrome")}(pi)};const gi={"⌘":"ctrl","⇧":"shift","⌥":"alt"},bi={ctrl:"⌘",shift:"⇧",alt:"⌥"},wi=function(){const e={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,cmd:1114112,shift:2228224,alt:4456448};for(let t=65;t<=90;t++){const n=String.fromCharCode(t);e[n.toLowerCase()]=t}for(let t=48;t<=57;t++)e[t-48]=t;for(let t=112;t<=123;t++)e["f"+(t-111)]=t;return e}();function _i(e){let t;if("string"==typeof e){if(!(t=wi[e.toLowerCase()]))throw new Jn.b("keyboard-unknown-key: Unknown key name.",{key:e})}else t=e.keyCode+(e.altKey?wi.alt:0)+(e.ctrlKey?wi.ctrl:0)+(e.shiftKey?wi.shift:0);return t}function ki(e){return"string"==typeof e&&(e=vi(e)),e.map(e=>"string"==typeof e?_i(e):e).reduce((e,t)=>t+e,0)}function vi(e){return e.split(/\s*\+\s*/)}class yi extends vo{constructor(e,t,n){super(e,t,n),this.getFillerOffset=Ci}is(e,t=null){return t?"uiElement"==e&&t==this.name||super.is(e,t):"uiElement"==e||super.is(e)}_insertChild(e,t){if(t&&(t instanceof po||Array.from(t).length>0))throw new Jn.b("view-uielement-cannot-add: Cannot add child nodes to UIElement instance.")}render(e){return this.toDomElement(e)}toDomElement(e){const t=e.createElement(this.name);for(const e of this.getAttributeKeys())t.setAttribute(e,this.getAttribute(e));return t}}function xi(e){e.document.on("keydown",(t,n)=>(function(e,t,n){if(t.keyCode==wi.arrowright){const e=t.domTarget.ownerDocument.defaultView.getSelection(),o=1==e.rangeCount&&e.getRangeAt(0).collapsed;if(o||t.shiftKey){const t=e.focusNode,i=e.focusOffset,r=n.domPositionToView(t,i);if(null===r)return;let s=!1;const a=r.getLastMatchingPosition(e=>(e.item.is("uiElement")&&(s=!0),!(!e.item.is("uiElement")&&!e.item.is("attributeElement"))));if(s){const t=n.viewPositionToDom(a);o?e.collapse(t.parent,t.offset):e.extend(t.parent,t.offset)}}}})(0,n,e.domConverter))}function Ci(){return null}class Ai{constructor(e){this._children=[],e&&this._insertChild(0,e)}[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(e){return"documentFragment"==e}_appendChild(e){return this._insertChild(this.childCount,e)}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(e,t){this._fireChange("children",this);let n=0;const o=function(e){if("string"==typeof e)return[new mo(e)];wo(e)||(e=[e]);return Array.from(e).map(e=>"string"==typeof e?new mo(e):e instanceof go?new mo(e.data):e)}(t);for(const t of o)null!==t.parent&&t._remove(),t.parent=this,this._children.splice(e,0,t),e++,n++;return n}_removeChildren(e,t=1){this._fireChange("children",this);for(let n=e;n<e+t;n++)this._children[n].parent=null;return this._children.splice(e,t)}_fireChange(e,t){this.fire("change:"+e,t)}}lo(Ai,no);class Pi{constructor(e){this.document=e,this._cloneGroups=new Map}setSelection(e,t,n){this.document.selection._setTo(e,t,n)}setSelectionFocus(e,t){this.document.selection._setFocus(e,t)}createText(e){return new mo(e)}createAttributeElement(e,t,n={}){const o=new li(e,t);return n.priority&&(o._priority=n.priority),n.id&&(o._id=n.id),o}createContainerElement(e,t){return new Co(e,t)}createEditableElement(e,t){const n=new Zo(e,t);return n._document=this.document,n}createEmptyElement(e,t){return new hi(e,t)}createUIElement(e,t,n){const o=new yi(e,t);return n&&(o.render=n),o}setAttribute(e,t,n){n._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,n){P(e)&&void 0===n&&(n=t),n._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,n){n._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}breakAttributes(e){return e instanceof ei?this._breakAttributes(e):this._breakAttributesRange(e)}breakContainer(e){const t=e.parent;if(!t.is("containerElement"))throw new Jn.b("view-writer-break-non-container-element: Trying to break an element which is not a container element.");if(!t.parent)throw new Jn.b("view-writer-break-root: Trying to break root element.");if(e.isAtStart)return ei._createBefore(t);if(!e.isAtEnd){const n=t._clone(!1);this.insert(ei._createAfter(t),n);const o=new ti(e,ei._createAt(t,"end")),i=new ei(n,0);this.move(o,i)}return ei._createAfter(t)}mergeAttributes(e){const t=e.offset,n=e.parent;if(n.is("text"))return e;if(n.is("attributeElement")&&0===n.childCount){const e=n.parent,t=n.index;return n._remove(),this._removeFromClonedElementsGroup(n),this.mergeAttributes(new ei(e,t))}const o=n.getChild(t-1),i=n.getChild(t);if(!o||!i)return e;if(o.is("text")&&i.is("text"))return Oi(o,i);if(o.is("attributeElement")&&i.is("attributeElement")&&o.isSimilar(i)){const e=o.childCount;return o._appendChild(i.getChildren()),i._remove(),this._removeFromClonedElementsGroup(i),this.mergeAttributes(new ei(o,e))}return e}mergeContainers(e){const t=e.nodeBefore,n=e.nodeAfter;if(!(t&&n&&t.is("containerElement")&&n.is("containerElement")))throw new Jn.b("view-writer-merge-containers-invalid-position: Element before and after given position cannot be merged.");const o=t.getChild(t.childCount-1),i=o instanceof mo?ei._createAt(o,"end"):ei._createAt(t,"end");return this.move(ti._createIn(n),ei._createAt(t,"end")),this.remove(ti._createOn(n)),i}insert(e,t){(function e(t){for(const n of t){if(!Ii.some(e=>n instanceof e))throw new Jn.b("view-writer-insert-invalid-node");n.is("text")||e(n.getChildren())}})(t=wo(t)?[...t]:[t]);const n=Ei(e);if(!n)throw new Jn.b("view-writer-invalid-position-container");const o=this._breakAttributes(e,!0),i=n._insertChild(o.offset,t);for(const e of t)this._addToClonedElementsGroup(e);const r=o.getShiftedBy(i),s=this.mergeAttributes(o);if(0===i)return new ti(s,s);{s.isEqual(o)||r.offset--;const e=this.mergeAttributes(r);return new ti(s,e)}}remove(e){const t=e instanceof ti?e:ti._createOn(e);if(Mi(t),t.isCollapsed)return new Ai;const{start:n,end:o}=this._breakAttributesRange(t,!0),i=n.parent,r=o.offset-n.offset,s=i._removeChildren(n.offset,r);for(const e of s)this._removeFromClonedElementsGroup(e);const a=this.mergeAttributes(n);return t.start=a,t.end=a.clone(),new Ai(s)}clear(e,t){Mi(e);const n=e.getWalker({direction:"backward",ignoreElementEnd:!0});for(const o of n){const n=o.item;let i;if(n.is("element")&&t.isSimilar(n))i=ti._createOn(n);else if(!o.nextPosition.isAfter(e.start)&&n.is("textProxy")){const e=n.getAncestors().find(e=>e.is("element")&&t.isSimilar(e));e&&(i=ti._createIn(e))}i&&(i.end.isAfter(e.end)&&(i.end=e.end),i.start.isBefore(e.start)&&(i.start=e.start),this.remove(i))}}move(e,t){let n;if(t.isAfter(e.end)){const o=(t=this._breakAttributes(t,!0)).parent,i=o.childCount;e=this._breakAttributesRange(e,!0),n=this.remove(e),t.offset+=o.childCount-i}else n=this.remove(e);return this.insert(t,n)}wrap(e,t){if(!(t instanceof li))throw new Jn.b("view-writer-wrap-invalid-attribute");if(Mi(e),e.isCollapsed){let n=e.start;n.parent.is("element")&&!function(e){return Array.from(e.getChildren()).some(e=>!e.is("uiElement"))}(n.parent)&&(n=n.getLastMatchingPosition(e=>e.item.is("uiElement"))),n=this._wrapPosition(n,t);const o=this.document.selection;return o.isCollapsed&&o.getFirstPosition().isEqual(e.start)&&this.setSelection(n),new ti(n)}return this._wrapRange(e,t)}unwrap(e,t){if(!(t instanceof li))throw new Jn.b("view-writer-unwrap-invalid-attribute");if(Mi(e),e.isCollapsed)return e;const{start:n,end:o}=this._breakAttributesRange(e,!0),i=n.parent,r=this._unwrapChildren(i,n.offset,o.offset,t),s=this.mergeAttributes(r.start);s.isEqual(r.start)||r.end.offset--;const a=this.mergeAttributes(r.end);return new ti(s,a)}rename(e,t){const n=new Co(e,t.getAttributes());return this.insert(ei._createAfter(t),n),this.move(ti._createIn(t),ei._createAt(n,0)),this.remove(ti._createOn(t)),n}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return ei._createAt(e,t)}createPositionAfter(e){return ei._createAfter(e)}createPositionBefore(e){return ei._createBefore(e)}createRange(e,t){return new ti(e,t)}createRangeOn(e){return ti._createOn(e)}createRangeIn(e){return ti._createIn(e)}createSelection(e,t,n){return new ii(e,t,n)}_wrapChildren(e,t,n,o){let i=t;const r=[];for(;i<n;){const t=e.getChild(i),n=t.is("text"),s=t.is("attributeElement"),a=t.is("emptyElement"),c=t.is("uiElement");if(s&&this._wrapAttributeElement(o,t))r.push(new ei(e,i));else if(n||a||c||s&&Ti(o,t)){const n=o._clone();t._remove(),n._appendChild(t),e._insertChild(i,n),this._addToClonedElementsGroup(n),r.push(new ei(e,i))}else s&&this._wrapChildren(t,0,t.childCount,o);i++}let s=0;for(const e of r){if(e.offset-=s,e.offset==t)continue;this.mergeAttributes(e).isEqual(e)||(s++,n--)}return ti._createFromParentsAndOffsets(e,t,e,n)}_unwrapChildren(e,t,n,o){let i=t;const r=[];for(;i<n;){const t=e.getChild(i);if(t.is("attributeElement"))if(t.isSimilar(o)){const o=t.getChildren(),s=t.childCount;t._remove(),e._insertChild(i,o),this._removeFromClonedElementsGroup(t),r.push(new ei(e,i),new ei(e,i+s)),i+=s,n+=s-1}else this._unwrapAttributeElement(o,t)?(r.push(new ei(e,i),new ei(e,i+1)),i++):(this._unwrapChildren(t,0,t.childCount,o),i++);else i++}let s=0;for(const e of r){if(e.offset-=s,e.offset==t||e.offset==n)continue;this.mergeAttributes(e).isEqual(e)||(s++,n--)}return ti._createFromParentsAndOffsets(e,t,e,n)}_wrapRange(e,t){const{start:n,end:o}=this._breakAttributesRange(e,!0),i=n.parent,r=this._wrapChildren(i,n.offset,o.offset,t),s=this.mergeAttributes(r.start);s.isEqual(r.start)||r.end.offset--;const a=this.mergeAttributes(r.end);return new ti(s,a)}_wrapPosition(e,t){if(t.isSimilar(e.parent))return Si(e.clone());e.parent.is("text")&&(e=Ri(e));const n=this.createAttributeElement();n._priority=Number.POSITIVE_INFINITY,n.isSimilar=(()=>!1),e.parent._insertChild(e.offset,n);const o=new ti(e,e.getShiftedBy(1));this.wrap(o,t);const i=new ei(n.parent,n.index);n._remove();const r=i.nodeBefore,s=i.nodeAfter;return r instanceof mo&&s instanceof mo?Oi(r,s):Si(i)}_wrapAttributeElement(e,t){if(!Ni(e,t))return!1;if(e.name!==t.name||e.priority!==t.priority)return!1;for(const n of e.getAttributeKeys())if("class"!==n&&"style"!==n&&t.hasAttribute(n)&&t.getAttribute(n)!==e.getAttribute(n))return!1;for(const n of e.getStyleNames())if(t.hasStyle(n)&&t.getStyle(n)!==e.getStyle(n))return!1;for(const n of e.getAttributeKeys())"class"!==n&&"style"!==n&&(t.hasAttribute(n)||this.setAttribute(n,e.getAttribute(n),t));for(const n of e.getStyleNames())t.hasStyle(n)||this.setStyle(n,e.getStyle(n),t);for(const n of e.getClassNames())t.hasClass(n)||this.addClass(n,t);return!0}_unwrapAttributeElement(e,t){if(!Ni(e,t))return!1;if(e.name!==t.name||e.priority!==t.priority)return!1;for(const n of e.getAttributeKeys())if("class"!==n&&"style"!==n&&(!t.hasAttribute(n)||t.getAttribute(n)!==e.getAttribute(n)))return!1;if(!t.hasClass(...e.getClassNames()))return!1;for(const n of e.getStyleNames())if(!t.hasStyle(n)||t.getStyle(n)!==e.getStyle(n))return!1;for(const n of e.getAttributeKeys())"class"!==n&&"style"!==n&&this.removeAttribute(n,t);return this.removeClass(Array.from(e.getClassNames()),t),this.removeStyle(Array.from(e.getStyleNames()),t),!0}_breakAttributesRange(e,t=!1){const n=e.start,o=e.end;if(Mi(e),e.isCollapsed){const n=this._breakAttributes(e.start,t);return new ti(n,n)}const i=this._breakAttributes(o,t),r=i.parent.childCount,s=this._breakAttributes(n,t);return i.offset+=i.parent.childCount-r,new ti(s,i)}_breakAttributes(e,t=!1){const n=e.offset,o=e.parent;if(e.parent.is("emptyElement"))throw new Jn.b("view-writer-cannot-break-empty-element");if(e.parent.is("uiElement"))throw new Jn.b("view-writer-cannot-break-ui-element");if(!t&&o.is("text")&&Di(o.parent))return e.clone();if(Di(o))return e.clone();if(o.is("text"))return this._breakAttributes(Ri(e),t);if(n==o.childCount){const e=new ei(o.parent,o.index+1);return this._breakAttributes(e,t)}if(0===n){const e=new ei(o.parent,o.index);return this._breakAttributes(e,t)}{const e=o.index+1,i=o._clone();o.parent._insertChild(e,i),this._addToClonedElementsGroup(i);const r=o.childCount-n,s=o._removeChildren(n,r);i._appendChild(s);const a=new ei(o.parent,e);return this._breakAttributes(a,t)}}_addToClonedElementsGroup(e){if(!e.root.is("rootElement"))return;if(e.is("element"))for(const t of e.getChildren())this._addToClonedElementsGroup(t);const t=e.id;if(!t)return;let n=this._cloneGroups.get(t);n||(n=new Set,this._cloneGroups.set(t,n)),n.add(e),e._clonesGroup=n}_removeFromClonedElementsGroup(e){if(e.is("element"))for(const t of e.getChildren())this._removeFromClonedElementsGroup(t);const t=e.id;if(!t)return;const n=this._cloneGroups.get(t);n&&n.delete(e)}}function Ei(e){let t=e.parent;for(;!Di(t);){if(!t)return;t=t.parent}return t}function Ti(e,t){return e.priority<t.priority||!(e.priority>t.priority)&&e.getIdentity()<t.getIdentity()}function Si(e){const t=e.nodeBefore;if(t&&t.is("text"))return new ei(t,t.data.length);const n=e.nodeAfter;return n&&n.is("text")?new ei(n,0):e}function Ri(e){if(e.offset==e.parent.data.length)return new ei(e.parent.parent,e.parent.index+1);if(0===e.offset)return new ei(e.parent.parent,e.parent.index);const t=e.parent.data.slice(e.offset);return e.parent._data=e.parent.data.slice(0,e.offset),e.parent.parent._insertChild(e.parent.index+1,new mo(t)),new ei(e.parent.parent,e.parent.index+1)}function Oi(e,t){const n=e.data.length;return e._data+=t.data,t._remove(),new ei(e,n)}const Ii=[mo,li,Co,hi,yi];function Di(e){return e&&(e.is("containerElement")||e.is("documentFragment"))}function Mi(e){const t=Ei(e.start),n=Ei(e.end);if(!t||!n||t!==n)throw new Jn.b("view-writer-invalid-range-container")}function Ni(e,t){return null===e.id&&null===t.id}function Fi(e){return"[object Text]"==Object.prototype.toString.call(e)}const Bi=e=>{const t=e.createElement("br");return t.dataset.ckeFiller=!0,t},Vi=e=>e.createTextNode(" "),Li=7;let zi="";for(let e=0;e<Li;e++)zi+="";function qi(e){return Fi(e)&&e.data.substr(0,Li)===zi}function ji(e){return e.data.length==Li&&qi(e)}function Hi(e){return qi(e)?e.data.slice(Li):e.data}const Ui=new WeakMap;function Wi(e,t){let n=Ui.get(t);return n||(n=t(window.document),Ui.set(t,n)),e.isEqualNode(n)}function $i(e,t){if(t.keyCode==wi.arrowleft){const e=t.domTarget.ownerDocument.defaultView.getSelection();if(1==e.rangeCount&&e.getRangeAt(0).collapsed){const t=e.getRangeAt(0).startContainer,n=e.getRangeAt(0).startOffset;qi(t)&&n<=Li&&e.collapse(t,0)}}}function Gi(e,t,n,o=!1){n=n||function(e,t){return e===t},Array.isArray(e)||(e=Array.from(e)),Array.isArray(t)||(t=Array.from(t));const i=function(e,t,n){const o=Ki(e,t,n);if(-1===o)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const i=Ji(e,o),r=Ji(t,o),s=Ki(i,r,n),a=e.length-s,c=t.length-s;return{firstIndex:o,lastIndexOld:a,lastIndexNew:c}}(e,t,n);return o?function(e,t){const{firstIndex:n,lastIndexOld:o,lastIndexNew:i}=e;if(-1===n)return Array(t).fill("equal");let r=[];n>0&&(r=r.concat(Array(n).fill("equal")));i-n>0&&(r=r.concat(Array(i-n).fill("insert")));o-n>0&&(r=r.concat(Array(o-n).fill("delete")));i<t&&(r=r.concat(Array(t-i).fill("equal")));return r}(i,t.length):function(e,t){const n=[],{firstIndex:o,lastIndexOld:i,lastIndexNew:r}=t;r-o>0&&n.push({index:o,type:"insert",values:e.slice(o,r)});i-o>0&&n.push({index:o+(r-o),type:"delete",howMany:i-o});return n}(t,i)}function Ki(e,t,n){for(let o=0;o<Math.max(e.length,t.length);o++)if(void 0===e[o]||void 0===t[o]||!n(e[o],t[o]))return o;return-1}function Ji(e,t){return e.slice(t).reverse()}function Zi(e,t,n){n=n||function(e,t){return e===t};const o=e.length,i=t.length;if(o>200||i>200||o+i>300)return Zi.fastDiff(e,t,n,!0);let r,s;if(i<o){const n=e;e=t,t=n,r="delete",s="insert"}else r="insert",s="delete";const a=e.length,c=t.length,l=c-a,d={},u={};function h(o){const i=(void 0!==u[o-1]?u[o-1]:-1)+1,l=void 0!==u[o+1]?u[o+1]:-1,h=i>l?-1:1;d[o+h]&&(d[o]=d[o+h].slice(0)),d[o]||(d[o]=[]),d[o].push(i>l?r:s);let f=Math.max(i,l),p=f-o;for(;p<a&&f<c&&n(e[p],t[f]);)p++,f++,d[o].push("equal");return f}let f,p=0;do{for(f=-p;f<l;f++)u[f]=h(f);for(f=l+p;f>l;f--)u[f]=h(f);u[l]=h(l),p++}while(u[l]!==c);return d[l].slice(1)}function Qi(e,t,n){e.insertBefore(n,e.childNodes[t]||null)}function Yi(e){const t=e.parentNode;t&&t.removeChild(e)}function Xi(e){if(e){if(e.defaultView)return e instanceof e.defaultView.Document;if(e.ownerDocument&&e.ownerDocument.defaultView)return e instanceof e.ownerDocument.defaultView.Node}return!1}Zi.fastDiff=Gi;class er{constructor(e,t){this.domDocuments=new Set,this.domConverter=e,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=t,this.isFocused=!1,this._inlineFiller=null,this._fakeSelectionContainer=null}markToSync(e,t){if("text"===e)this.domConverter.mapViewToDom(t.parent)&&this.markedTexts.add(t);else{if(!this.domConverter.mapViewToDom(t))return;if("attributes"===e)this.markedAttributes.add(t);else{if("children"!==e)throw new Jn.b("view-renderer-unknown-type: Unknown type passed to Renderer.markToSync.");this.markedChildren.add(t)}}}render(){let e;for(const e of this.markedChildren)this._updateChildrenMappings(e);this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?e=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(e=this.selection.getFirstPosition(),this.markedChildren.add(e.parent));for(const e of this.markedAttributes)this._updateAttrs(e);for(const t of this.markedChildren)this._updateChildren(t,{inlineFillerPosition:e});for(const t of this.markedTexts)!this.markedChildren.has(t.parent)&&this.domConverter.mapViewToDom(t.parent)&&this._updateText(t,{inlineFillerPosition:e});if(e){const t=this.domConverter.viewPositionToDom(e),n=t.parent.ownerDocument;qi(t.parent)?this._inlineFiller=t.parent:this._inlineFiller=tr(n,t.parent,t.offset)}else this._inlineFiller=null;this._updateSelection(),this._updateFocus(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const n=this.domConverter.mapViewToDom(e).childNodes,o=Array.from(this.domConverter.viewChildrenToDom(e,t.ownerDocument,{withChildren:!1})),i=this._diffNodeLists(n,o),r=this._findReplaceActions(i,n,o);if(-1!==r.indexOf("replace")){const t={equal:0,insert:0,delete:0};for(const i of r)if("replace"===i){const i=t.equal+t.insert,r=t.equal+t.delete,s=e.getChild(i);s&&!s.is("uiElement")&&this._updateElementMappings(s,n[r]),Yi(o[i]),t.equal++}else t[i]++}}_updateElementMappings(e,t){this.domConverter.unbindDomElement(t),this.domConverter.bindElements(t,e),this.markedChildren.add(e),this.markedAttributes.add(e)}_getInlineFillerPosition(){const e=this.selection.getFirstPosition();return e.parent.is("text")?ei._createBefore(this.selection.getFirstPosition().parent):e}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=this.domConverter.viewPositionToDom(e);return!!(t&&Fi(t.parent)&&qi(t.parent))}_removeInlineFiller(){const e=this._inlineFiller;if(!qi(e))throw new Jn.b("view-renderer-filler-was-lost: The inline filler node was lost.");ji(e)?e.parentNode.removeChild(e):e.data=e.data.substr(Li),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=e.parent,n=e.offset;if(!this.domConverter.mapViewToDom(t.root))return!1;if(!t.is("element"))return!1;if(!function(e){if("false"==e.getAttribute("contenteditable"))return!1;const t=e.findAncestor(e=>e.hasAttribute("contenteditable"));return!t||"true"==t.getAttribute("contenteditable")}(t))return!1;if(n===t.getFillerOffset())return!1;const o=e.nodeBefore,i=e.nodeAfter;return!(o instanceof mo||i instanceof mo)}_updateText(e,t){const n=this.domConverter.findCorrespondingDomText(e),o=this.domConverter.viewToDom(e,n.ownerDocument),i=n.data;let r=o.data;const s=t.inlineFillerPosition;if(s&&s.parent==e.parent&&s.offset==e.index&&(r=zi+r),i!=r){const e=Gi(i,r);for(const t of e)"insert"===t.type?n.insertData(t.index,t.values.join("")):n.deleteData(t.index,t.howMany)}}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const n=Array.from(t.attributes).map(e=>e.name),o=e.getAttributeKeys();for(const n of o)t.setAttribute(n,e.getAttribute(n));for(const o of n)e.hasAttribute(o)||t.removeAttribute(o)}_updateChildren(e,t){const n=this.domConverter.mapViewToDom(e);if(!n)return;const o=t.inlineFillerPosition,i=this.domConverter.mapViewToDom(e).childNodes,r=Array.from(this.domConverter.viewChildrenToDom(e,n.ownerDocument,{bind:!0,inlineFillerPosition:o}));o&&o.parent===e&&tr(n.ownerDocument,r,o.offset);const s=this._diffNodeLists(i,r);let a=0;const c=new Set;for(const e of s)"insert"===e?(Qi(n,a,r[a]),a++):"delete"===e?(c.add(i[a]),Yi(i[a])):(this._markDescendantTextToSync(this.domConverter.domToView(r[a])),a++);for(const e of c)e.parentNode||this.domConverter.unbindDomElement(e)}_diffNodeLists(e,t){return Zi(e=function(e,t){const n=Array.from(e);if(0==n.length||!t)return n;n[n.length-1]==t&&n.pop();return n}(e,this._fakeSelectionContainer),t,function(e,t,n){if(t===n)return!0;if(Fi(t)&&Fi(n))return t.data===n.data;if(Wi(t,e)&&Wi(n,e))return!0;return!1}.bind(null,this.domConverter.blockFiller))}_findReplaceActions(e,t,n){if(-1===e.indexOf("insert")||-1===e.indexOf("delete"))return e;let o=[],i=[],r=[];const s={equal:0,insert:0,delete:0};for(const a of e)"insert"===a?r.push(n[s.equal+s.insert]):"delete"===a?i.push(t[s.equal+s.delete]):((o=o.concat(Zi(i,r,nr).map(e=>"equal"===e?"replace":e))).push("equal"),i=[],r=[]),s[a]++;return o.concat(Zi(i,r,nr).map(e=>"equal"===e?"replace":e))}_markDescendantTextToSync(e){if(e)if(e.is("text"))this.markedTexts.add(e);else if(e.is("element"))for(const t of e.getChildren())this._markDescendantTextToSync(t)}_updateSelection(){if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const e=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&e&&(this.selection.isFake?this._updateFakeSelection(e):(this._removeFakeSelection(),this._updateDomSelection(e)))}_updateFakeSelection(e){const t=e.ownerDocument;let n=this._fakeSelectionContainer;n||(this._fakeSelectionContainer=n=t.createElement("div"),Object.assign(n.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),n.textContent=" "),n.parentElement&&n.parentElement==e||e.appendChild(n),n.textContent=this.selection.fakeSelectionLabel||" ";const o=t.getSelection(),i=t.createRange();o.removeAllRanges(),i.selectNodeContents(n),o.addRange(i),this.domConverter.bindFakeSelection(n,this.selection)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t))return;const n=this.domConverter.viewPositionToDom(this.selection.anchor),o=this.domConverter.viewPositionToDom(this.selection.focus);e.focus(),t.collapse(n.parent,n.offset),t.extend(o.parent,o.offset),mi.isGecko&&function(e,t){const n=e.parent;if(n.nodeType!=Node.ELEMENT_NODE||e.offset!=n.childNodes.length-1)return;const o=n.childNodes[e.offset];o&&"BR"==o.tagName&&t.addRange(t.getRangeAt(0))}(o,t)}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;const t=e&&this.domConverter.domSelectionToView(e);return(!t||!this.selection.isEqual(t))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(t))}_removeDomSelection(){for(const e of this.domDocuments){if(e.getSelection().rangeCount){const t=e.activeElement,n=this.domConverter.mapDomToView(t);t&&n&&e.getSelection().removeAllRanges()}}}_removeFakeSelection(){const e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;e&&this.domConverter.focus(e)}}}function tr(e,t,n){const o=t instanceof Array?t:t.childNodes,i=o[n];if(Fi(i))return i.data=zi+i.data,i;{const i=e.createTextNode(zi);return Array.isArray(t)?o.splice(n,0,i):Qi(t,n,i),i}}function nr(e,t){return Xi(e)&&Xi(t)&&!Fi(e)&&!Fi(t)&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}lo(er,Ho);var or={window:window,document:document};function ir(e){let t=0;for(;e.previousSibling;)e=e.previousSibling,t++;return t}function rr(e){const t=[];for(;e&&e.nodeType!=Node.DOCUMENT_NODE;)t.unshift(e),e=e.parentNode;return t}class sr{constructor(e={}){this.blockFiller=e.blockFiller||Bi,this.preElements=["pre"],this.blockElements=["p","div","h1","h2","h3","h4","h5","h6"],this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new ii(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}unbindDomElement(e){const t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);for(const t of Array.from(e.childNodes))this.unbindDomElement(t)}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}viewToDom(e,t,n={}){if(e.is("text")){const n=this._processDataFromViewText(e);return t.createTextNode(n)}{if(this.mapViewToDom(e))return this.mapViewToDom(e);let o;if(e.is("documentFragment"))o=t.createDocumentFragment(),n.bind&&this.bindDocumentFragments(o,e);else{if(e.is("uiElement"))return o=e.render(t),n.bind&&this.bindElements(o,e),o;o=t.createElement(e.name),n.bind&&this.bindElements(o,e);for(const t of e.getAttributeKeys())o.setAttribute(t,e.getAttribute(t))}if(n.withChildren||void 0===n.withChildren)for(const i of this.viewChildrenToDom(e,t,n))o.appendChild(i);return o}}*viewChildrenToDom(e,t,n={}){const o=e.getFillerOffset&&e.getFillerOffset();let i=0;for(const r of e.getChildren())o===i&&(yield this.blockFiller(t)),yield this.viewToDom(r,t,n),i++;o===i&&(yield this.blockFiller(t))}viewRangeToDom(e){const t=this.viewPositionToDom(e.start),n=this.viewPositionToDom(e.end),o=document.createRange();return o.setStart(t.parent,t.offset),o.setEnd(n.parent,n.offset),o}viewPositionToDom(e){const t=e.parent;if(t.is("text")){const n=this.findCorrespondingDomText(t);if(!n)return null;let o=e.offset;return qi(n)&&(o+=Li),{parent:n,offset:o}}{let n,o,i;if(0===e.offset){if(!(n=this.mapViewToDom(t)))return null;i=n.childNodes[0]}else{const t=e.nodeBefore;if(!(o=t.is("text")?this.findCorrespondingDomText(t):this.mapViewToDom(e.nodeBefore)))return null;n=o.parentNode,i=o.nextSibling}if(Fi(i)&&qi(i))return{parent:i,offset:Li};return{parent:n,offset:o?ir(o)+1:0}}}domToView(e,t={}){if(Wi(e,this.blockFiller))return null;const n=this.getParentUIElement(e,this._domToViewMapping);if(n)return n;if(Fi(e)){if(ji(e))return null;{const t=this._processDataFromDomText(e);return""===t?null:new mo(t)}}if(this.isComment(e))return null;{if(this.mapDomToView(e))return this.mapDomToView(e);let n;if(this.isDocumentFragment(e))n=new Ai,t.bind&&this.bindDocumentFragments(e,n);else{const o=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();n=new vo(o),t.bind&&this.bindElements(e,n);const i=e.attributes;for(let e=i.length-1;e>=0;e--)n._setAttribute(i[e].name,i[e].value)}if(t.withChildren||void 0===t.withChildren)for(const o of this.domChildrenToView(e,t))n._appendChild(o);return n}}*domChildrenToView(e,t={}){for(let n=0;n<e.childNodes.length;n++){const o=e.childNodes[n],i=this.domToView(o,t);null!==i&&(yield i)}}domSelectionToView(e){if(1===e.rangeCount){let t=e.getRangeAt(0).startContainer;Fi(t)&&(t=t.parentNode);const n=this.fakeSelectionToView(t);if(n)return n}const t=this.isDomSelectionBackward(e),n=[];for(let t=0;t<e.rangeCount;t++){const o=e.getRangeAt(t),i=this.domRangeToView(o);i&&n.push(i)}return new ii(n,{backward:t})}domRangeToView(e){const t=this.domPositionToView(e.startContainer,e.startOffset),n=this.domPositionToView(e.endContainer,e.endOffset);return t&&n?new ti(t,n):null}domPositionToView(e,t){if(Wi(e,this.blockFiller))return this.domPositionToView(e.parentNode,ir(e));const n=this.mapDomToView(e);if(n&&n.is("uiElement"))return ei._createBefore(n);if(Fi(e)){if(ji(e))return this.domPositionToView(e.parentNode,ir(e));const n=this.findCorrespondingViewText(e);let o=t;return n?(qi(e)&&(o=(o-=Li)<0?0:o),new ei(n,o)):null}if(0===t){const t=this.mapDomToView(e);if(t)return new ei(t,0)}else{const n=e.childNodes[t-1],o=Fi(n)?this.findCorrespondingViewText(n):this.mapDomToView(n);if(o&&o.parent)return new ei(o.parent,o.index+1)}return null}mapDomToView(e){return this.getParentUIElement(e)||this._domToViewMapping.get(e)}findCorrespondingViewText(e){if(ji(e))return null;const t=this.getParentUIElement(e);if(t)return t;const n=e.previousSibling;if(n){if(!this.isElement(n))return null;const e=this.mapDomToView(n);if(e){return e.nextSibling instanceof mo?e.nextSibling:null}}else{const t=this.mapDomToView(e.parentNode);if(t){const e=t.getChild(0);return e instanceof mo?e:null}}return null}mapViewToDom(e){return this._viewToDomMapping.get(e)}findCorrespondingDomText(e){const t=e.previousSibling;return t&&this.mapViewToDom(t)?this.mapViewToDom(t).nextSibling:!t&&e.parent&&this.mapViewToDom(e.parent)?this.mapViewToDom(e.parent).childNodes[0]:null}focus(e){const t=this.mapViewToDom(e);if(t&&t.ownerDocument.activeElement!==t){const{scrollX:e,scrollY:n}=or.window,o=[];cr(t,e=>{const{scrollLeft:t,scrollTop:n}=e;o.push([t,n])}),t.focus(),cr(t,e=>{const[t,n]=o.shift();e.scrollLeft=t,e.scrollTop=n}),or.window.scrollTo(e,n)}}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isComment(e){return e&&e.nodeType==Node.COMMENT_NODE}isDomSelectionBackward(e){if(e.isCollapsed)return!1;const t=document.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset);const n=t.collapsed;return t.detach(),n}getParentUIElement(e){const t=rr(e);for(t.pop();t.length;){const e=t.pop(),n=this._domToViewMapping.get(e);if(n&&n.is("uiElement"))return n}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}_isDomSelectionPositionCorrect(e,t){if(Fi(e)&&qi(e)&&t<Li)return!1;if(this.isElement(e)&&qi(e.childNodes[t]))return!1;const n=this.mapDomToView(e);return!n||!n.is("uiElement")}_processDataFromViewText(e){let t=e.data;if(e.getAncestors().some(e=>this.preElements.includes(e.name)))return t;if(" "==t.charAt(0)){const n=this._getTouchingViewTextNode(e,!1);!(n&&this._nodeEndsWithSpace(n))&&n||(t=" "+t.substr(1))}if(" "==t.charAt(t.length-1)){this._getTouchingViewTextNode(e,!0)||(t=t.substr(0,t.length-1)+" ")}return t.replace(/ {2}/g,"  ")}_nodeEndsWithSpace(e){if(e.getAncestors().some(e=>this.preElements.includes(e.name)))return!1;const t=this._processDataFromViewText(e);return" "==t.charAt(t.length-1)}_processDataFromDomText(e){let t=e.data;if(ar(e,this.preElements))return Hi(e);t=t.replace(/[ \n\t\r]{1,}/g," ");const n=this._getTouchingInlineDomNode(e,!1),o=this._getTouchingInlineDomNode(e,!0),i=this._checkShouldLeftTrimDomText(n),r=this._checkShouldRightTrimDomText(e,o);return i&&(t=t.replace(/^ /,"")),r&&(t=t.replace(/ $/,"")),t=(t=Hi(new Text(t))).replace(/ \u00A0/g," "),i&&(t=t.replace(/^\u00A0/," ")),Fi(o)&&" "!=o.data.charAt(0)||(t=t.replace(/\u00A0( *)$/," $1")),t}_checkShouldLeftTrimDomText(e){return!e||(!!$n(e)||/[^\S\u00A0]/.test(e.data.charAt(e.data.length-1)))}_checkShouldRightTrimDomText(e,t){return!t&&!qi(e)}_getTouchingViewTextNode(e,t){const n=new Xo({startPosition:t?ei._createAfter(e):ei._createBefore(e),direction:t?"forward":"backward"});for(const e of n){if(e.item.is("containerElement"))return null;if(e.item.is("br"))return null;if(e.item.is("textProxy"))return e.item}return null}_getTouchingInlineDomNode(e,t){if(!e.parentNode)return null;const n=t?"nextNode":"previousNode",o=e.ownerDocument,i=rr(e)[0],r=o.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,{acceptNode:e=>Fi(e)?NodeFilter.FILTER_ACCEPT:"BR"==e.tagName?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});r.currentNode=e;const s=r[n]();if(null!==s){const t=function(e,t){const n=rr(e),o=rr(t);let i=0;for(;n[i]==o[i]&&n[i];)i++;return 0===i?null:n[i-1]}(e,s);if(t&&!ar(e,this.blockElements,t)&&!ar(s,this.blockElements,t))return s}return null}}function ar(e,t,n){let o=rr(e);return n&&(o=o.slice(o.indexOf(n)+1)),o.some(e=>e.tagName&&t.includes(e.tagName.toLowerCase()))}function cr(e,t){for(;e&&e!=or.document;)t(e),e=e.parentNode}function lr(e){const t=Object.prototype.toString.apply(e);return"[object Window]"==t||"[object global]"==t}var dr=Vo({},no,{listenTo(e,...t){if(Xi(e)||lr(e)){const n=this._getProxyEmitter(e)||new ur(e);n.attach(...t),e=n}no.listenTo.call(this,e,...t)},stopListening(e,t,n){if(Xi(e)||lr(e)){const t=this._getProxyEmitter(e);if(!t)return;e=t}no.stopListening.call(this,e,t,n),e instanceof ur&&e.detach(t)},_getProxyEmitter(e){return function(e,t){return e[eo]&&e[eo][t]?e[eo][t].emitter:null}(this,hr(e))}});class ur{constructor(e){oo(this,hr(e)),this._domNode=e}}function hr(e){return e["data-ck-expando"]||(e["data-ck-expando"]=Yn())}Vo(ur.prototype,no,{attach(e,t,n={}){if(this._domListeners&&this._domListeners[e])return;const o=this._createDomListener(e,!!n.useCapture);this._domNode.addEventListener(e,o,!!n.useCapture),this._domListeners||(this._domListeners={}),this._domListeners[e]=o},detach(e){let t;!this._domListeners[e]||(t=this._events[e])&&t.callbacks.length||this._domListeners[e].removeListener()},_createDomListener(e,t){const n=t=>{this.fire(e,t)};return n.removeListener=(()=>{this._domNode.removeEventListener(e,n,t),delete this._domListeners[e]}),n}});class fr{constructor(e){this.view=e,this.document=e.document,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}}lo(fr,dr);var pr="__lodash_hash_undefined__";var mr=function(e){return this.__data__.set(e,pr),this};var gr=function(e){return this.__data__.has(e)};function br(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Te;++t<n;)this.add(e[t])}br.prototype.add=br.prototype.push=mr,br.prototype.has=gr;var wr=br;var _r=function(e,t){for(var n=-1,o=null==e?0:e.length;++n<o;)if(t(e[n],n,e))return!0;return!1};var kr=function(e,t){return e.has(t)},vr=1,yr=2;var xr=function(e,t,n,o,i,r){var s=n&vr,a=e.length,c=t.length;if(a!=c&&!(s&&c>a))return!1;var l=r.get(e);if(l&&r.get(t))return l==t;var d=-1,u=!0,h=n&yr?new wr:void 0;for(r.set(e,t),r.set(t,e);++d<a;){var f=e[d],p=t[d];if(o)var m=s?o(p,f,d,t,e,r):o(f,p,d,e,t,r);if(void 0!==m){if(m)continue;u=!1;break}if(h){if(!_r(t,function(e,t){if(!kr(h,t)&&(f===e||i(f,e,n,o,r)))return h.push(t)})){u=!1;break}}else if(f!==p&&!i(f,p,n,o,r)){u=!1;break}}return r.delete(e),r.delete(t),u};var Cr=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,o){n[++t]=[o,e]}),n};var Ar=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n},Pr=1,Er=2,Tr="[object Boolean]",Sr="[object Date]",Rr="[object Error]",Or="[object Map]",Ir="[object Number]",Dr="[object RegExp]",Mr="[object Set]",Nr="[object String]",Fr="[object Symbol]",Br="[object ArrayBuffer]",Vr="[object DataView]",Lr=i?i.prototype:void 0,zr=Lr?Lr.valueOf:void 0;var qr=function(e,t,n,o,i,r,s){switch(n){case Vr:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Br:return!(e.byteLength!=t.byteLength||!r(new Gt(e),new Gt(t)));case Tr:case Sr:case Ir:return T(+e,+t);case Rr:return e.name==t.name&&e.message==t.message;case Dr:case Nr:return e==t+"";case Or:var a=Cr;case Mr:var c=o&Pr;if(a||(a=Ar),e.size!=t.size&&!c)return!1;var l=s.get(e);if(l)return l==t;o|=Er,s.set(e,t);var d=xr(a(e),a(t),o,i,r,s);return s.delete(e),d;case Fr:if(zr)return zr.call(e)==zr.call(t)}return!1},jr=1,Hr=Object.prototype.hasOwnProperty;var Ur=function(e,t,n,o,i,r){var s=n&jr,a=It(e),c=a.length;if(c!=It(t).length&&!s)return!1;for(var l=c;l--;){var d=a[l];if(!(s?d in t:Hr.call(t,d)))return!1}var u=r.get(e);if(u&&r.get(t))return u==t;var h=!0;r.set(e,t),r.set(t,e);for(var f=s;++l<c;){var p=e[d=a[l]],m=t[d];if(o)var g=s?o(m,p,d,t,e,r):o(p,m,d,e,t,r);if(!(void 0===g?p===m||i(p,m,n,o,r):g)){h=!1;break}f||(f="constructor"==d)}if(h&&!f){var b=e.constructor,w=t.constructor;b!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(h=!1)}return r.delete(e),r.delete(t),h},Wr=1,$r="[object Arguments]",Gr="[object Array]",Kr="[object Object]",Jr=Object.prototype.hasOwnProperty;var Zr=function(e,t,n,o,i,r){var s=$e(e),a=$e(t),c=s?Gr:Ut(e),l=a?Gr:Ut(t),d=(c=c==$r?Kr:c)==Kr,u=(l=l==$r?Kr:l)==Kr,h=c==l;if(h&&Object(Ge.a)(e)){if(!Object(Ge.a)(t))return!1;s=!0,d=!1}if(h&&!d)return r||(r=new Ie),s||it(e)?xr(e,t,n,o,i,r):qr(e,t,c,n,o,i,r);if(!(n&Wr)){var f=d&&Jr.call(e,"__wrapped__"),p=u&&Jr.call(t,"__wrapped__");if(f||p){var m=f?e.value():e,g=p?t.value():t;return r||(r=new Ie),i(m,g,n,o,r)}}return!!h&&(r||(r=new Ie),Ur(e,t,n,o,i,r))};var Qr=function e(t,n,o,i,r){return t===n||(null==t||null==n||!w(t)&&!w(n)?t!=t&&n!=n:Zr(t,n,o,i,e,r))};var Yr=function(e,t,n){var o=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===o?Qr(e,t,void 0,n):!!o};class Xr extends fr{constructor(e){super(e),this._config={childList:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},this.domConverter=e.domConverter,this.renderer=e._renderer,this._domElements=[],this._mutationObserver=new window.MutationObserver(this._onMutations.bind(this))}flush(){this._onMutations(this._mutationObserver.takeRecords())}observe(e){this._domElements.push(e),this.isEnabled&&this._mutationObserver.observe(e,this._config)}enable(){super.enable();for(const e of this._domElements)this._mutationObserver.observe(e,this._config)}disable(){super.disable(),this._mutationObserver.disconnect()}destroy(){super.destroy(),this._mutationObserver.disconnect()}_onMutations(e){if(0===e.length)return;const t=this.domConverter,n=new Map,o=new Set;for(const n of e)if("childList"===n.type){const e=t.mapDomToView(n.target);if(e&&e.is("uiElement"))continue;e&&!this._isBogusBrMutation(n)&&o.add(e)}for(const i of e){const e=t.mapDomToView(i.target);if((!e||!e.is("uiElement"))&&"characterData"===i.type){const e=t.findCorrespondingViewText(i.target);e&&!o.has(e.parent)?n.set(e,{type:"text",oldText:e.data,newText:Hi(i.target),node:e}):!e&&qi(i.target)&&o.add(t.mapDomToView(i.target.parentNode))}}const i=[];for(const e of n.values())this.renderer.markToSync("text",e.node),i.push(e);for(const e of o){const n=t.mapViewToDom(e),o=Array.from(e.getChildren()),r=Array.from(t.domChildrenToView(n,{withChildren:!1}));Yr(o,r,a)||(this.renderer.markToSync("children",e),i.push({type:"children",oldChildren:o,newChildren:r,node:e}))}const r=e[0].target.ownerDocument.getSelection();let s=null;if(r&&r.anchorNode){const e=t.domPositionToView(r.anchorNode,r.anchorOffset),n=t.domPositionToView(r.focusNode,r.focusOffset);e&&n&&(s=new ii(e)).setFocus(n)}function a(e,t){if(!Array.isArray(e))return e===t||!(!e.is("text")||!t.is("text"))&&e.data===t.data}this.document.fire("mutations",i,s),this.view.forceRender()}_isBogusBrMutation(e){let t=null;return null===e.nextSibling&&0===e.removedNodes.length&&1==e.addedNodes.length&&(t=this.domConverter.domToView(e.addedNodes[0],{withChildren:!1})),t&&t.is("element","br")}}class es{constructor(e,t,n){this.view=e,this.document=e.document,this.domEvent=t,this.domTarget=t.target,Vo(this,n)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class ts extends fr{constructor(e){super(e),this.useCapture=!1}observe(e){("string"==typeof this.domEventType?[this.domEventType]:this.domEventType).forEach(t=>{this.listenTo(e,t,(e,t)=>{this.isEnabled&&this.onDomEvent(t)},{useCapture:this.useCapture})})}fire(e,t,n){this.isEnabled&&this.document.fire(e,new es(this.view,t,n))}}class ns extends ts{constructor(e){super(e),this.domEventType=["keydown","keyup"]}onDomEvent(e){this.fire(e.type,e,{keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey||e.metaKey,shiftKey:e.shiftKey,get keystroke(){return _i(this)}})}}var os=function(){return o.a.Date.now()},is="[object Symbol]";var rs=function(e){return"symbol"==typeof e||w(e)&&m(e)==is},ss=NaN,as=/^\s+|\s+$/g,cs=/^[-+]0x[0-9a-f]+$/i,ls=/^0b[01]+$/i,ds=/^0o[0-7]+$/i,us=parseInt;var hs=function(e){if("number"==typeof e)return e;if(rs(e))return ss;if(q(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=q(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(as,"");var n=ls.test(e);return n||ds.test(e)?us(e.slice(2),n?2:8):cs.test(e)?ss:+e},fs="Expected a function",ps=Math.max,ms=Math.min;var gs=function(e,t,n){var o,i,r,s,a,c,l=0,d=!1,u=!1,h=!0;if("function"!=typeof e)throw new TypeError(fs);function f(t){var n=o,r=i;return o=i=void 0,l=t,s=e.apply(r,n)}function p(e){var n=e-c;return void 0===c||n>=t||n<0||u&&e-l>=r}function m(){var e=os();if(p(e))return g(e);a=setTimeout(m,function(e){var n=t-(e-c);return u?ms(n,r-(e-l)):n}(e))}function g(e){return a=void 0,h&&o?f(e):(o=i=void 0,s)}function b(){var e=os(),n=p(e);if(o=arguments,i=this,c=e,n){if(void 0===a)return function(e){return l=e,a=setTimeout(m,t),d?f(e):s}(c);if(u)return a=setTimeout(m,t),f(c)}return void 0===a&&(a=setTimeout(m,t)),s}return t=hs(t)||0,q(n)&&(d=!!n.leading,r=(u="maxWait"in n)?ps(hs(n.maxWait)||0,t):r,h="trailing"in n?!!n.trailing:h),b.cancel=function(){void 0!==a&&clearTimeout(a),l=0,o=c=i=a=void 0},b.flush=function(){return void 0===a?s:g(os())},b};class bs extends fr{constructor(e){super(e),this._fireSelectionChangeDoneDebounced=gs(e=>this.document.fire("selectionChangeDone",e),200)}observe(){const e=this.document;e.on("keydown",(t,n)=>{e.selection.isFake&&function(e){return e==wi.arrowright||e==wi.arrowleft||e==wi.arrowup||e==wi.arrowdown}(n.keyCode)&&this.isEnabled&&(n.preventDefault(),this._handleSelectionMove(n.keyCode))},{priority:"lowest"})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection,n=new ii(t.getRanges(),{backward:t.isBackward,fake:!1});e!=wi.arrowleft&&e!=wi.arrowup||n.setTo(n.getFirstPosition()),e!=wi.arrowright&&e!=wi.arrowdown||n.setTo(n.getLastPosition());const o={oldSelection:t,newSelection:n,domSelection:null};this.document.fire("selectionChange",o),this._fireSelectionChangeDoneDebounced(o)}}var ws=n(2);class _s extends fr{constructor(e){super(e),this.mutationObserver=e.getObserver(Xr),this.selection=this.document.selection,this.domConverter=e.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=gs(e=>this.document.fire("selectionChangeDone",e),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._loopbackCounter=0}observe(e){const t=e.ownerDocument;this._documents.has(t)||(this.listenTo(t,"selectionchange",()=>{this._handleSelectionChange(t)}),this._documents.add(t))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(e){if(!this.isEnabled||!this.document.isFocused&&!this.document.isReadOnly)return;this.mutationObserver.flush();const t=e.defaultView.getSelection(),n=this.domConverter.domSelectionToView(t);if(!this.selection.isEqual(n)||!this.domConverter.isDomSelectionCorrect(t))if(++this._loopbackCounter>60)ws.a.warn("selectionchange-infinite-loop: Selection change observer detected an infinite rendering loop.");else if(this.selection.isSimilar(n))this.view.forceRender();else{const e={oldSelection:this.selection,newSelection:n,domSelection:t};this.document.fire("selectionChange",e),this._fireSelectionChangeDoneDebounced(e)}}_clearInfiniteLoop(){this._loopbackCounter=0}}class ks extends ts{constructor(e){super(e),this.domEventType=["focus","blur"],this.useCapture=!0;const t=this.document;t.on("focus",()=>{t.isFocused=!0,this._renderTimeoutId=setTimeout(()=>e.forceRender(),50)}),t.on("blur",(n,o)=>{const i=t.selection.editableElement;null!==i&&i!==o.target||(t.isFocused=!1,e.forceRender())})}onDomEvent(e){this.fire(e.type,e)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class vs extends ts{constructor(e){super(e),this.domEventType=["compositionstart","compositionupdate","compositionend"];const t=this.document;t.on("compositionstart",()=>{t.isComposing=!0}),t.on("compositionend",()=>{t.isComposing=!1})}onDomEvent(e){this.fire(e.type,e)}}function ys(e){return"[object Range]"==Object.prototype.toString.apply(e)}function xs(e){const t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}const Cs=["top","right","bottom","left","width","height"];class As{constructor(e){const t=ys(e);if(Object.defineProperty(this,"_source",{value:e._source||e,writable:!0,enumerable:!1}),$n(e)||t){const n=t?e.startContainer:e;n.ownerDocument&&n.ownerDocument.body.contains(n)||ws.a.warn("rect-source-not-in-dom: The source of this rect does not belong to any rendered DOM tree.",{source:e}),Ps(this,t?As.getDomRangeRects(e)[0]:e.getBoundingClientRect())}else if(lr(e)){const{innerWidth:t,innerHeight:n}=e;Ps(this,{top:0,right:t,bottom:n,left:0,width:t,height:n})}else Ps(this,e)}clone(){return new As(this)}moveTo(e,t){return this.top=t,this.right=e+this.width,this.bottom=t+this.height,this.left=e,this}moveBy(e,t){return this.top+=t,this.right+=e,this.left+=e,this.bottom+=t,this}getIntersection(e){const t={top:Math.max(this.top,e.top),right:Math.min(this.right,e.right),bottom:Math.min(this.bottom,e.bottom),left:Math.max(this.left,e.left)};return t.width=t.right-t.left,t.height=t.bottom-t.top,t.width<0||t.height<0?null:new As(t)}getIntersectionArea(e){const t=this.getIntersection(e);return t?t.getArea():0}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(!Es(e)){let n=e.parentNode||e.commonAncestorContainer;for(;n&&!Es(n);){const e=new As(n),o=t.getIntersection(e);if(!o)return null;o.getArea()<t.getArea()&&(t=o),n=n.parentNode}}return t}isEqual(e){for(const t of Cs)if(this[t]!==e[t])return!1;return!0}contains(e){const t=this.getIntersection(e);return!(!t||!t.isEqual(e))}excludeScrollbarsAndBorders(){const e=this._source;let t,n;if(lr(e))t=e.innerWidth-e.document.documentElement.clientWidth,n=e.innerHeight-e.document.documentElement.clientHeight;else{const o=xs(this._source);t=e.offsetWidth-e.clientWidth,n=e.offsetHeight-e.clientHeight,this.moveBy(o.left,o.top)}return this.width-=t,this.right-=t,this.height-=n,this.bottom-=n,this}static getDomRangeRects(e){const t=[],n=Array.from(e.getClientRects());if(n.length)for(const e of n)t.push(new As(e));else{let n=e.startContainer;Fi(n)&&(n=n.parentNode);const o=new As(n.getBoundingClientRect());o.right=o.left,o.width=0,t.push(o)}return t}}function Ps(e,t){for(const n of Cs)e[n]=t[n]}function Es(e){return!!$n(e)&&e===e.ownerDocument.body}function Ts({target:e,viewportOffset:t=0}){const n=Ns(e);let o=n,i=null;for(;o;){let r;Rs(r=Fs(o==n?e:i),()=>Bs(e,o));const s=Bs(e,o);if(Ss(o,s,t),o.parent!=o){if(i=o.frameElement,o=o.parent,!i)return}else o=null}}function Ss(e,t,n){const o=t.clone().moveBy(0,n),i=t.clone().moveBy(0,-n),r=new As(e).excludeScrollbarsAndBorders();if(![i,o].every(e=>r.contains(e))){let{scrollX:s,scrollY:a}=e;Is(i,r)?a-=r.top-t.top+n:Os(o,r)&&(a+=t.bottom-r.bottom+n),Ds(t,r)?s-=r.left-t.left+n:Ms(t,r)&&(s+=t.right-r.right+n),e.scrollTo(s,a)}}function Rs(e,t){const n=Ns(e);let o,i;for(;e!=n.document.body;)i=t(),(o=new As(e).excludeScrollbarsAndBorders()).contains(i)||(Is(i,o)?e.scrollTop-=o.top-i.top:Os(i,o)&&(e.scrollTop+=i.bottom-o.bottom),Ds(i,o)?e.scrollLeft-=o.left-i.left:Ms(i,o)&&(e.scrollLeft+=i.right-o.right)),e=e.parentNode}function Os(e,t){return e.bottom>t.bottom}function Is(e,t){return e.top<t.top}function Ds(e,t){return e.left<t.left}function Ms(e,t){return e.right>t.right}function Ns(e){return ys(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function Fs(e){if(ys(e)){let t=e.commonAncestorContainer;return Fi(t)&&(t=t.parentNode),t}return e.parentNode}function Bs(e,t){const n=Ns(e),o=new As(e);if(n===t)return o;{let e=n;for(;e!=t;){const t=e.frameElement,n=new As(t).excludeScrollbarsAndBorders();o.moveBy(n.left,n.top),e=e.parent}}return o}Object.assign({},{scrollViewportToShowTarget:Ts,scrollAncestorsToShowTarget:function(e){Rs(Fs(e),()=>new As(e))}});class Vs{constructor(){this.document=new ai,this.domConverter=new sr,this.domRoots=new Map,this.set("isRenderingInProgress",!1),this._renderer=new er(this.domConverter,this.document.selection),this._renderer.bind("isFocused").to(this.document),this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this._writer=new Pi(this.document),this.addObserver(Xr),this.addObserver(_s),this.addObserver(ks),this.addObserver(ns),this.addObserver(bs),this.addObserver(vs),function(e){e.document.on("keydown",$i)}(this),xi(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0})}attachDomRoot(e,t="main"){const n=this.document.getRoot(t);n._name=e.tagName.toLowerCase();const o={};for(const{name:t,value:i}of Array.from(e.attributes))o[t]=i,"class"===t?this._writer.addClass(i.split(" "),n):this._writer.setAttribute(t,i,n);this._initialDomRootAttributes.set(e,o);const i=()=>{this._writer.setAttribute("contenteditable",!n.isReadOnly,n),n.isReadOnly?this._writer.addClass("ck-read-only",n):this._writer.removeClass("ck-read-only",n)};i(),this.domRoots.set(t,e),this.domConverter.bindElements(e,n),this._renderer.markToSync("children",n),this._renderer.markToSync("attributes",n),this._renderer.domDocuments.add(e.ownerDocument),n.on("change:children",(e,t)=>this._renderer.markToSync("children",t)),n.on("change:attributes",(e,t)=>this._renderer.markToSync("attributes",t)),n.on("change:text",(e,t)=>this._renderer.markToSync("text",t)),n.on("change:isReadOnly",()=>this.change(i)),n.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const n of this._observers.values())n.observe(e,t)}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach(({name:e})=>t.removeAttribute(e));const n=this._initialDomRootAttributes.get(t);for(const e in n)t.setAttribute(e,n[e]);this.domRoots.delete(e),this.domConverter.unbindDomElement(t)}getDomRoot(e="main"){return this.domRoots.get(e)}addObserver(e){let t=this._observers.get(e);if(t)return t;t=new e(this),this._observers.set(e,t);for(const[e,n]of this.domRoots)t.observe(n,e);return t.enable(),t}getObserver(e){return this._observers.get(e)}disableObservers(){for(const e of this._observers.values())e.disable()}enableObservers(){for(const e of this._observers.values())e.enable()}scrollToTheSelection(){const e=this.document.selection.getFirstRange();e&&Ts({target:this.domConverter.viewRangeToDom(e),viewportOffset:20})}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;e?(this.domConverter.focus(e),this.forceRender()):ws.a.warn("view-focus-no-selection: There is no selection in any editable to focus.")}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new Jn.b("cannot-change-view-tree: Attempting to make changes to the view when it is in an incorrect state: rendering or post-fixers are in progress. This may cause some unexpected behavior and inconsistency between the DOM and the view.");if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;const t=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),t}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.change(()=>{})}destroy(){for(const e of this._observers.values())e.destroy();this.document.destroy(),this.stopListening()}createPositionAt(e,t){return ei._createAt(e,t)}createPositionAfter(e){return ei._createAfter(e)}createPositionBefore(e){return ei._createBefore(e)}createRange(e,t){return new ti(e,t)}createRangeOn(e){return ti._createOn(e)}createRangeIn(e){return ti._createIn(e)}createSelection(e,t,n){return new ii(e,t,n)}_disableRendering(e){this._renderingDisabled=e,0==e&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}function Ls(e){return P(e)?bo(e):new Map(e)}lo(Vs,Ho);class zs{constructor(e){this.parent=null,this._attrs=Ls(e)}get index(){let e;if(!this.parent)return null;if(null===(e=this.parent.getChildIndex(this)))throw new Jn.b("model-node-not-found-in-parent: The node's parent does not contain this node.");return e}get startOffset(){let e;if(!this.parent)return null;if(null===(e=this.parent.getChildStartOffset(this)))throw new Jn.b("model-node-not-found-in-parent: The node's parent does not contain this node.");return e}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}get document(){return this.root==this?null:this.root.document||null}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}getCommonAncestor(e,t={}){const n=this.getAncestors(t),o=e.getAncestors(t);let i=0;for(;n[i]==o[i]&&n[i];)i++;return 0===i?null:n[i-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),n=e.getPath(),o=uo(t,n);switch(o){case"prefix":return!0;case"extension":return!1;default:return t[o]<n[o]}}isAfter(e){return this!=e&&(this.root===e.root&&!this.isBefore(e))}hasAttribute(e){return this._attrs.has(e)}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}toJSON(){const e={};return this._attrs.size&&(e.attributes=Array.from(this._attrs).reduce((e,t)=>(e[t[0]]=t[1],e),{})),e}_clone(){return new zs(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=Ls(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}is(e){return"node"==e}}class qs extends zs{constructor(e,t){super(t),this._data=e||""}get offsetSize(){return this.data.length}get data(){return this._data}is(e){return"text"==e||super.is(e)}toJSON(){const e=super.toJSON();return e.data=this.data,e}_clone(){return new qs(this.data,this.getAttributes())}static fromJSON(e){return new qs(e.data,e.attributes)}}class js{constructor(e,t,n){if(this.textNode=e,t<0||t>e.offsetSize)throw new Jn.b("model-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.");if(n<0||t+n>e.offsetSize)throw new Jn.b("model-textproxy-wrong-length: Given length value is incorrect.");this.data=e.data.substring(t,t+n),this.offsetInText=t}get startOffset(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(e){return"textProxy"==e}getPath(){const e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}hasAttribute(e){return this.textNode.hasAttribute(e)}getAttribute(e){return this.textNode.getAttribute(e)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}class Hs{constructor(e){this._nodes=[],e&&this._insertNodes(0,e)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((e,t)=>e+t.offsetSize,0)}getNode(e){return this._nodes[e]||null}getNodeIndex(e){const t=this._nodes.indexOf(e);return-1==t?null:t}getNodeStartOffset(e){const t=this.getNodeIndex(e);return null===t?null:this._nodes.slice(0,t).reduce((e,t)=>e+t.offsetSize,0)}indexToOffset(e){if(e==this._nodes.length)return this.maxOffset;const t=this._nodes[e];if(!t)throw new Jn.b("model-nodelist-index-out-of-bounds: Given index cannot be found in the node list.");return this.getNodeStartOffset(t)}offsetToIndex(e){let t=0;for(const n of this._nodes){if(e>=t&&e<t+n.offsetSize)return this.getNodeIndex(n);t+=n.offsetSize}if(t!=e)throw new Jn.b("model-nodelist-offset-out-of-bounds: Given offset cannot be found in the node list.",{offset:e,nodeList:this});return this.length}_insertNodes(e,t){for(const e of t)if(!(e instanceof zs))throw new Jn.b("model-nodelist-insertNodes-not-node: Trying to insert an object which is not a Node instance.");this._nodes.splice(e,0,...t)}_removeNodes(e,t=1){return this._nodes.splice(e,t)}toJSON(){return this._nodes.map(e=>e.toJSON())}}class Us extends zs{constructor(e,t,n){super(t),this.name=e,this._children=new Hs,n&&this._insertChild(0,n)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}is(e,t=null){return t?"element"==e&&t==this.name:"element"==e||e==this.name||super.is(e)}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}offsetToIndex(e){return this._children.offsetToIndex(e)}getNodeByPath(e){let t=this;for(const n of e)t=t.getChild(t.offsetToIndex(n));return t}toJSON(){const e=super.toJSON();if(e.name=this.name,this._children.length>0){e.children=[];for(const t of this._children)e.children.push(t.toJSON())}return e}_clone(e=!1){const t=e?Array.from(this._children).map(e=>e._clone(!0)):null;return new Us(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=function(e){if("string"==typeof e)return[new qs(e)];wo(e)||(e=[e]);return Array.from(e).map(e=>"string"==typeof e?new qs(e):e instanceof js?new qs(e.data,e.getAttributes()):e)}(t);for(const e of n)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const e of n)e.parent=null;return n}static fromJSON(e){let t=null;if(e.children){t=[];for(const n of e.children)n.name?t.push(Us.fromJSON(n)):t.push(qs.fromJSON(n))}return new Us(e.name,e.attributes,t)}}class Ws{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new Jn.b("model-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.");const t=e.direction||"forward";if("forward"!=t&&"backward"!=t)throw new Jn.b("model-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.",{direction:t});this.direction=t,this.boundaries=e.boundaries||null,e.startPosition?this.position=e.startPosition.clone():this.position=Ks._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}skip(e){let t,n,o,i;do{o=this.position,i=this._visitedParent,({done:t,value:n}=this.next())}while(!t&&e(n));t||(this.position=o,this._visitedParent=i)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const e=this.position,t=this.position.clone(),n=this._visitedParent;if(null===n.parent&&t.offset===n.maxOffset)return{done:!0};if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};const o=t.textNode?t.textNode:t.nodeAfter;if(o instanceof Us)return this.shallow?t.offset++:(t.path.push(0),this._visitedParent=o),this.position=t,$s("elementStart",o,e,t,1);if(o instanceof qs){let i;if(this.singleCharacters)i=1;else{let e=o.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offset<e&&(e=this.boundaries.end.offset),i=e-t.offset}const r=t.offset-o.startOffset,s=new js(o,r,i);return t.offset+=i,this.position=t,$s("text",s,e,t,i)}return t.path.pop(),t.offset++,this.position=t,this._visitedParent=n.parent,this.ignoreElementEnd?this._next():$s("elementEnd",n,e,t)}_previous(){const e=this.position,t=this.position.clone(),n=this._visitedParent;if(null===n.parent&&0===t.offset)return{done:!0};if(n==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0};const o=t.textNode?t.textNode:t.nodeBefore;if(o instanceof Us)return t.offset--,this.shallow?(this.position=t,$s("elementStart",o,e,t,1)):(t.path.push(o.maxOffset),this.position=t,this._visitedParent=o,this.ignoreElementEnd?this._previous():$s("elementEnd",o,e,t));if(o instanceof qs){let i;if(this.singleCharacters)i=1;else{let e=o.startOffset;this._boundaryStartParent==n&&this.boundaries.start.offset>e&&(e=this.boundaries.start.offset),i=t.offset-e}const r=t.offset-o.startOffset,s=new js(o,r-i,i);return t.offset-=i,this.position=t,$s("text",s,e,t,i)}return t.path.pop(),this.position=t,this._visitedParent=n.parent,$s("elementStart",n,e,t,1)}}function $s(e,t,n,o,i){return{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:o,length:i}}}var Gs=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};class Ks{constructor(e,t,n="toNone"){if(!e.is("element")&&!e.is("documentFragment"))throw new Jn.b("model-position-root-invalid: Position root invalid.");if(!(t instanceof Array)||0===t.length)throw new Jn.b("model-position-path-incorrect: Position path must be an array with at least one item.",{path:t});t=e.getPath().concat(t),e=e.root,this.root=e,this.path=t,this.stickiness=n}get offset(){return Gs(this.path)}set offset(e){this.path[this.path.length-1]=e}get parent(){let e=this.root;for(let t=0;t<this.path.length-1;t++)e=e.getChild(e.offsetToIndex(this.path[t]));return e}get index(){return this.parent.offsetToIndex(this.offset)}get textNode(){const e=this.parent.getChild(this.index);return e instanceof qs&&e.startOffset<this.offset?e: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(e){if(this.root!=e.root)return"different";const t=uo(this.path,e.path);switch(t){case"same":return"same";case"prefix":return"before";case"extension":return"after";default:return this.path[t]<e.path[t]?"before":"after"}}getLastMatchingPosition(e,t={}){t.startPosition=this;const n=new Ws(t);return n.skip(e),n.position}getParentPath(){return this.path.slice(0,-1)}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonPath(e){if(this.root!=e.root)return[];const t=uo(this.path,e.path),n="string"==typeof t?Math.min(this.path.length,e.path.length):t;return this.path.slice(0,n)}getCommonAncestor(e){const t=this.getAncestors(),n=e.getAncestors();let o=0;for(;t[o]==n[o]&&t[o];)o++;return 0===o?null:t[o-1]}getShiftedBy(e){const t=this.clone(),n=t.offset+e;return t.offset=n<0?0:n,t}isAfter(e){return"after"==this.compareWith(e)}isBefore(e){return"before"==this.compareWith(e)}isEqual(e){return"same"==this.compareWith(e)}isTouching(e){let t=null,n=null;switch(this.compareWith(e)){case"same":return!0;case"before":t=Ks._createAt(this),n=Ks._createAt(e);break;case"after":t=Ks._createAt(e),n=Ks._createAt(this);break;default:return!1}let o=t.parent;for(;t.path.length+n.path.length;){if(t.isEqual(n))return!0;if(t.path.length>n.path.length){if(t.offset!==o.maxOffset)return!1;t.path=t.path.slice(0,-1),o=o.parent,t.offset++}else{if(0!==n.offset)return!1;n.path=n.path.slice(0,-1)}}}hasSameParentAs(e){if(this.root!==e.root)return!1;return"same"==uo(this.getParentPath(),e.getParentPath())}getTransformedByOperation(e){let t;switch(e.type){case"insert":t=this._getTransformedByInsertOperation(e);break;case"move":case"remove":case"reinsert":t=this._getTransformedByMoveOperation(e);break;case"split":t=this._getTransformedBySplitOperation(e);break;case"merge":t=this._getTransformedByMergeOperation(e);break;default:t=Ks._createAt(this)}return t}_getTransformedByInsertOperation(e){return this._getTransformedByInsertion(e.position,e.howMany)}_getTransformedByMoveOperation(e){return this._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}_getTransformedBySplitOperation(e){const t=e.movedRange;return t.containsPosition(this)||t.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(e.splitPosition,e.moveTargetPosition):e.graveyardPosition?this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1):this._getTransformedByInsertion(e.insertionPosition,1)}_getTransformedByMergeOperation(e){const t=e.movedRange;let n;return t.containsPosition(this)||t.start.isEqual(this)?(n=this._getCombined(e.sourcePosition,e.targetPosition),e.sourcePosition.isBefore(e.targetPosition)&&(n=n._getTransformedByDeletion(e.deletionPosition,1))):n=this.isEqual(e.deletionPosition)?Ks._createAt(e.deletionPosition):this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1),n}_getTransformedByDeletion(e,t){const n=Ks._createAt(this);if(this.root!=e.root)return n;if("same"==uo(e.getParentPath(),this.getParentPath())){if(e.offset<this.offset){if(e.offset+t>this.offset)return null;n.offset-=t}}else if("prefix"==uo(e.getParentPath(),this.getParentPath())){const o=e.path.length-1;if(e.offset<=this.path[o]){if(e.offset+t>this.path[o])return null;n.path[o]-=t}}return n}_getTransformedByInsertion(e,t){const n=Ks._createAt(this);if(this.root!=e.root)return n;if("same"==uo(e.getParentPath(),this.getParentPath()))(e.offset<this.offset||e.offset==this.offset&&"toPrevious"!=this.stickiness)&&(n.offset+=t);else if("prefix"==uo(e.getParentPath(),this.getParentPath())){const o=e.path.length-1;e.offset<=this.path[o]&&(n.path[o]+=t)}return n}_getTransformedByMove(e,t,n){if(t=t._getTransformedByDeletion(e,n),e.isEqual(t))return Ks._createAt(this);const o=this._getTransformedByDeletion(e,n);return null===o||e.isEqual(this)&&"toNext"==this.stickiness||e.getShiftedBy(n).isEqual(this)&&"toPrevious"==this.stickiness?this._getCombined(e,t):o._getTransformedByInsertion(t,n)}_getCombined(e,t){const n=e.path.length-1,o=Ks._createAt(t);return o.stickiness=this.stickiness,o.offset=o.offset+this.path[n]-e.offset,o.path=o.path.concat(this.path.slice(n+1)),o}toJSON(){return{root:this.root.toJSON(),path:Array.from(this.path),stickiness:this.stickiness}}clone(){return new this.constructor(this.root,this.path,this.stickiness)}static _createAt(e,t,n="toNone"){if(e instanceof Ks)return new Ks(e.root,e.path,e.stickiness);{const o=e;if("end"==t)t=o.maxOffset;else{if("before"==t)return this._createBefore(o,n);if("after"==t)return this._createAfter(o,n);if(0!==t&&!t)throw new Jn.b("model-createPositionAt-offset-required: Model#createPositionAt() requires the offset when the first parameter is a model item.")}if(!o.is("element")&&!o.is("documentFragment"))throw new Jn.b("model-position-parent-incorrect: Position parent have to be a element or document fragment.");const i=o.getPath();return i.push(t),new this(o.root,i,n)}}static _createAfter(e,t){if(!e.parent)throw new Jn.b("model-position-after-root: You cannot make a position after root.",{root:e});return this._createAt(e.parent,e.endOffset,t)}static _createBefore(e,t){if(!e.parent)throw new Jn.b("model-position-before-root: You cannot make a position before root.",{root:e});return this._createAt(e.parent,e.startOffset,t)}static fromJSON(e,t){if("$graveyard"===e.root){const n=new Ks(t.graveyard,e.path);return n.stickiness=e.stickiness,n}if(!t.getRoot(e.root))throw new Jn.b("model-position-fromjson-no-root: Cannot create position for document. Root with specified name does not exist.",{rootName:e.root});return new Ks(t.getRoot(e.root),e.path,e.stickiness)}}class Js{constructor(e,t=null){this.start=Ks._createAt(e),this.end=t?Ks._createAt(t):Ks._createAt(e),this.start.stickiness=this.isCollapsed?"toNone":"toNext",this.end.stickiness=this.isCollapsed?"toNone":"toPrevious"}*[Symbol.iterator](){yield*new Ws({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return"same"==uo(this.start.getParentPath(),this.end.getParentPath())}get root(){return this.start.root}containsPosition(e){return e.isAfter(this.start)&&e.isBefore(this.end)}containsRange(e,t=!1){e.isCollapsed&&(t=!1);const n=this.containsPosition(e.start)||t&&this.start.isEqual(e.start),o=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return n&&o}containsItem(e){const t=Ks._createBefore(e);return this.containsPosition(t)||this.start.isEqual(t)}isEqual(e){return this.start.isEqual(e.start)&&this.end.isEqual(e.end)}isIntersecting(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}getDifference(e){const t=[];return this.isIntersecting(e)?(this.containsPosition(e.start)&&t.push(new Js(this.start,e.start)),this.containsPosition(e.end)&&t.push(new Js(e.end,this.end))):t.push(new Js(this.start,this.end)),t}getIntersection(e){if(this.isIntersecting(e)){let t=this.start,n=this.end;return this.containsPosition(e.start)&&(t=e.start),this.containsPosition(e.end)&&(n=e.end),new Js(t,n)}return null}getMinimalFlatRanges(){const e=[],t=this.start.getCommonPath(this.end).length,n=Ks._createAt(this.start);let o=n.parent;for(;n.path.length>t+1;){const t=o.maxOffset-n.offset;0!==t&&e.push(new Js(n,n.getShiftedBy(t))),n.path=n.path.slice(0,-1),n.offset++,o=o.parent}for(;n.path.length<=this.end.path.length;){const t=this.end.path[n.path.length-1],o=t-n.offset;0!==o&&e.push(new Js(n,n.getShiftedBy(o))),n.offset=t,n.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new Ws(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new Ws(e);for(const e of t)yield e.item}*getPositions(e={}){e.boundaries=this;const t=new Ws(e);yield t.position;for(const e of t)yield e.nextPosition}getTransformedByOperation(e){switch(e.type){case"insert":return this._getTransformedByInsertOperation(e);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(e);case"split":return[this._getTransformedBySplitOperation(e)];case"merge":return[this._getTransformedByMergeOperation(e)]}return[new Js(this.start,this.end)]}getTransformedByOperations(e){const t=[new Js(this.start,this.end)];for(const n of e)for(let e=0;e<t.length;e++){const o=t[e].getTransformedByOperation(n);t.splice(e,1,...o),e+=o.length-1}for(let e=0;e<t.length;e++){const n=t[e];for(let o=e+1;o<t.length;o++){const e=t[o];(n.containsRange(e)||e.containsRange(n)||n.isEqual(e))&&t.splice(o,1)}}return t}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}clone(){return new this.constructor(this.start,this.end)}_getTransformedByInsertOperation(e,t=!1){return this._getTransformedByInsertion(e.position,e.howMany,t)}_getTransformedByMoveOperation(e,t=!1){const n=e.sourcePosition,o=e.howMany,i=e.targetPosition;return this._getTransformedByMove(n,i,o,t)}_getTransformedBySplitOperation(e){const t=this.start._getTransformedBySplitOperation(e);let n=this.end._getTransformedBySplitOperation(e);return this.end.isEqual(e.insertionPosition)&&(n=this.end.getShiftedBy(1)),t.root!=n.root&&(n=this.end.getShiftedBy(-1)),new Js(t,n)}_getTransformedByMergeOperation(e){if(this.start.isEqual(e.targetPosition)&&this.end.isEqual(e.deletionPosition))return new Js(this.start);let t=this.start._getTransformedByMergeOperation(e),n=this.end._getTransformedByMergeOperation(e);return t.root!=n.root&&(n=this.end.getShiftedBy(-1)),t.isAfter(n)?(e.sourcePosition.isBefore(e.targetPosition)?(t=Ks._createAt(n)).offset=0:(e.deletionPosition.isEqual(t)||(n=e.deletionPosition),t=e.targetPosition),new Js(t,n)):new Js(t,n)}_getTransformedByInsertion(e,t,n=!1){if(n&&this.containsPosition(e))return[new Js(this.start,e),new Js(e.getShiftedBy(t),this.end._getTransformedByInsertion(e,t))];{const n=new Js(this.start,this.end);return n.start=n.start._getTransformedByInsertion(e,t),n.end=n.end._getTransformedByInsertion(e,t),[n]}}_getTransformedByMove(e,t,n,o=!1){if(this.isCollapsed){const o=this.start._getTransformedByMove(e,t,n);return[new Js(o)]}const i=Js._createFromPositionAndShift(e,n),r=t._getTransformedByDeletion(e,n);if(this.containsPosition(t)&&!o&&(i.containsPosition(this.start)||i.containsPosition(this.end))){const o=this.start._getTransformedByMove(e,t,n),i=this.end._getTransformedByMove(e,t,n);return[new Js(o,i)]}let s;const a=this.getDifference(i);let c=null;const l=this.getIntersection(i);if(1==a.length?c=new Js(a[0].start._getTransformedByDeletion(e,n),a[0].end._getTransformedByDeletion(e,n)):2==a.length&&(c=new Js(this.start,this.end._getTransformedByDeletion(e,n))),s=c?c._getTransformedByInsertion(r,n,null!==l||o):[],l){const e=new Js(l.start._getCombined(i.start,r),l.end._getCombined(i.start,r));2==s.length?s.splice(1,0,e):s.push(e)}return s}_getTransformedByDeletion(e,t){let n=this.start._getTransformedByDeletion(e,t),o=this.end._getTransformedByDeletion(e,t);return null==n&&null==o?null:(null==n&&(n=e),null==o&&(o=e),new Js(n,o))}static _createFromPositionAndShift(e,t){const n=e,o=e.getShiftedBy(t);return t>0?new this(n,o):new this(o,n)}static _createIn(e){return new this(Ks._createAt(e,0),Ks._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(Ks._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(0===e.length)throw new Jn.b("range-create-from-ranges-empty-array: At least one range has to be passed.");if(1==e.length)return e[0].clone();const t=e[0];e.sort((e,t)=>e.start.isAfter(t.start)?1:-1);const n=e.indexOf(t),o=new this(t.start,t.end);if(n>0)for(let t=n-1;e[t].end.isEqual(o.start);t++)o.start=Ks._createAt(e[t].start);for(let t=n+1;t<e.length&&e[t].start.isEqual(o.end);t++)o.end=Ks._createAt(e[t].end);return o}static fromJSON(e,t){return new this(Ks.fromJSON(e.start,t),Ks.fromJSON(e.end,t))}}class Zs{constructor(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._viewToModelLengthCallbacks=new Map,this._markerNameToElements=new Map,this.on("modelToViewPosition",(e,t)=>{if(t.viewPosition)return;const n=this._modelToViewMapping.get(t.modelPosition.parent);t.viewPosition=this._findPositionIn(n,t.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(e,t)=>{if(t.modelPosition)return;const n=this.findMappedViewAncestor(t.viewPosition),o=this._viewToModelMapping.get(n),i=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,n);t.modelPosition=Ks._createAt(o,i)},{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t),this._viewToModelMapping.set(t,e)}unbindViewElement(e){const t=this.toModelElement(e);this._viewToModelMapping.delete(e),this._modelToViewMapping.get(t)==e&&this._modelToViewMapping.delete(t)}unbindModelElement(e){const t=this.toViewElement(e);this._modelToViewMapping.delete(e),this._viewToModelMapping.get(t)==e&&this._viewToModelMapping.delete(t)}bindElementToMarker(e,t){const n=this._markerNameToElements.get(t)||new Set;n.add(e),this._markerNameToElements.set(t,n)}unbindElementsFromMarkerName(e){this._markerNameToElements.delete(e)}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new Js(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new ti(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};return this.fire("viewToModelPosition",t),t.modelPosition}toViewPosition(e,t={isPhantom:!1}){const n={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",n),n.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t)return null;const n=new Set;for(const e of t)if(e.is("attributeElement"))for(const t of e.getElementsWithSameId())n.add(t);else n.add(e);return n}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;for(;!this._viewToModelMapping.has(t);)t=t.parent;return t}_toModelOffset(e,t,n){if(n!=e){return this._toModelOffset(e.parent,e.index,n)+this._toModelOffset(e,t,e)}if(e.is("text"))return t;let o=0;for(let n=0;n<t;n++)o+=this.getModelLength(e.getChild(n));return o}getModelLength(e){if(this._viewToModelLengthCallbacks.get(e.name)){return this._viewToModelLengthCallbacks.get(e.name)(e)}if(this._viewToModelMapping.has(e))return 1;if(e.is("text"))return e.data.length;if(e.is("uiElement"))return 0;{let t=0;for(const n of e.getChildren())t+=this.getModelLength(n);return t}}_findPositionIn(e,t){let n,o=0,i=0,r=0;if(e.is("text"))return new ei(e,t);for(;i<t;)n=e.getChild(r),i+=o=this.getModelLength(n),r++;return i==t?this._moveViewPositionToTextNode(new ei(e,r)):this._findPositionIn(n,t-(i-o))}_moveViewPositionToTextNode(e){const t=e.nodeBefore,n=e.nodeAfter;return t instanceof mo?new ei(t,t.data.length):n instanceof mo?new ei(n,0):e}}lo(Zs,no);class Qs{constructor(){this._consumable=new Map,this._textProxyRegistry=new Map}add(e,t){t=Ys(t),e instanceof js&&(e=this._getSymbolForTextProxy(e)),this._consumable.has(e)||this._consumable.set(e,new Map),this._consumable.get(e).set(t,!0)}consume(e,t){return t=Ys(t),e instanceof js&&(e=this._getSymbolForTextProxy(e)),!!this.test(e,t)&&(this._consumable.get(e).set(t,!1),!0)}test(e,t){t=Ys(t),e instanceof js&&(e=this._getSymbolForTextProxy(e));const n=this._consumable.get(e);if(void 0===n)return null;const o=n.get(t);return void 0===o?null:o}revert(e,t){t=Ys(t),e instanceof js&&(e=this._getSymbolForTextProxy(e));const n=this.test(e,t);return!1===n?(this._consumable.get(e).set(t,!0),!0):!0!==n&&null}_getSymbolForTextProxy(e){let t=null;const n=this._textProxyRegistry.get(e.startOffset);if(n){const o=n.get(e.endOffset);o&&(t=o.get(e.parent))}return t||(t=this._addSymbolForTextProxy(e.startOffset,e.endOffset,e.parent)),t}_addSymbolForTextProxy(e,t,n){const o=Symbol("textProxySymbol");let i,r;return(i=this._textProxyRegistry.get(e))||(i=new Map,this._textProxyRegistry.set(e,i)),(r=i.get(t))||(r=new Map,i.set(t,r)),r.set(n,o),o}}function Ys(e){const t=e.split(":");return t.length>1?t[0]+":"+t[1]:t[0]}class Xs{constructor(e={}){this.conversionApi=Vo({dispatcher:this},e)}convertChanges(e,t){for(const n of e.getMarkersToRemove())this.convertMarkerRemove(n.name,n.range,t);for(const n of e.getChanges())"insert"==n.type?this.convertInsert(Js._createFromPositionAndShift(n.position,n.length),t):"remove"==n.type?this.convertRemove(n.position,n.length,n.name,t):this.convertAttribute(n.range,n.attributeKey,n.attributeOldValue,n.attributeNewValue,t);for(const n of e.getMarkersToAdd())this.convertMarkerAdd(n.name,n.range,t)}convertInsert(e,t){this.conversionApi.writer=t,this.conversionApi.consumable=this._createInsertConsumable(e);for(const t of e){const e=t.item,n={item:e,range:Js._createFromPositionAndShift(t.previousPosition,t.length)};this._testAndFire("insert",n);for(const t of e.getAttributeKeys())n.attributeKey=t,n.attributeOldValue=null,n.attributeNewValue=e.getAttribute(t),this._testAndFire(`attribute:${t}`,n)}this._clearConversionApi()}convertRemove(e,t,n,o){this.conversionApi.writer=o,this.fire("remove:"+n,{position:e,length:t},this.conversionApi),this._clearConversionApi()}convertAttribute(e,t,n,o,i){this.conversionApi.writer=i,this.conversionApi.consumable=this._createConsumableForRange(e,`attribute:${t}`);for(const i of e){const e={item:i.item,range:Js._createFromPositionAndShift(i.previousPosition,i.length),attributeKey:t,attributeOldValue:n,attributeNewValue:o};this._testAndFire(`attribute:${t}`,e)}this._clearConversionApi()}convertSelection(e,t,n){const o=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));if(this.conversionApi.writer=n,this.conversionApi.consumable=this._createSelectionConsumable(e,o),this.fire("selection",{selection:e},this.conversionApi),e.isCollapsed){for(const t of o){const n=t.getRange();if(!ea(e.getFirstPosition(),t,this.conversionApi.mapper))continue;const o={item:e,markerName:t.name,markerRange:n};this.conversionApi.consumable.test(e,"addMarker:"+t.name)&&this.fire("addMarker:"+t.name,o,this.conversionApi)}for(const t of e.getAttributeKeys()){const n={item:e,range:e.getFirstRange(),attributeKey:t,attributeOldValue:null,attributeNewValue:e.getAttribute(t)};this.conversionApi.consumable.test(e,"attribute:"+n.attributeKey)&&this.fire("attribute:"+n.attributeKey+":$text",n,this.conversionApi)}this._clearConversionApi()}}convertMarkerAdd(e,t,n){if(!t.root.document||"$graveyard"==t.root.rootName)return;this.conversionApi.writer=n;const o="addMarker:"+e,i=new Qs;if(i.add(t,o),this.conversionApi.consumable=i,this.fire(o,{markerName:e,markerRange:t},this.conversionApi),i.test(t,o)){this.conversionApi.consumable=this._createConsumableForRange(t,o);for(const n of t.getItems()){if(!this.conversionApi.consumable.test(n,o))continue;const i={item:n,range:Js._createOn(n),markerName:e,markerRange:t};this.fire(o,i,this.conversionApi)}this._clearConversionApi()}}convertMarkerRemove(e,t,n){t.root.document&&"$graveyard"!=t.root.rootName&&(this.conversionApi.writer=n,this.fire("removeMarker:"+e,{markerName:e,markerRange:t},this.conversionApi),this._clearConversionApi())}_createInsertConsumable(e){const t=new Qs;for(const n of e){const e=n.item;t.add(e,"insert");for(const n of e.getAttributeKeys())t.add(e,"attribute:"+n)}return t}_createConsumableForRange(e,t){const n=new Qs;for(const o of e.getItems())n.add(o,t);return n}_createSelectionConsumable(e,t){const n=new Qs;n.add(e,"selection");for(const o of t)n.add(e,"addMarker:"+o.name);for(const t of e.getAttributeKeys())n.add(e,"attribute:"+t);return n}_testAndFire(e,t){if(!this.conversionApi.consumable.test(t.item,e))return;const n=t.item.name||"$text";this.fire(e+":"+n,t,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer,delete this.conversionApi.consumable}}function ea(e,t,n){const o=t.getRange(),i=Array.from(e.getAncestors());return i.shift(),i.reverse(),!i.some(e=>{if(o.containsItem(e)){return!!n.toViewElement(e).getCustomProperty("addHighlight")}})}lo(Xs,no);class ta{constructor(e,t,n){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map,e&&this.setTo(e,t,n)}get anchor(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}get focus(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}get isCollapsed(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let n=!1;for(const o of e._ranges)if(t.isEqual(o)){n=!0;break}if(!n)return!1}return!0}*getRanges(){for(const e of this._ranges)yield new Js(e.start,e.end)}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?new Js(e.start,e.end):null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?new Js(e.start,e.end):null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}setTo(e,t,n){if(null===e)this._setRanges([]);else if(e instanceof ta)this._setRanges(e.getRanges(),e.isBackward);else if(e&&"function"==typeof e.getRanges)this._setRanges(e.getRanges(),e.isBackward);else if(e instanceof Js)this._setRanges([e],!!t&&!!t.backward);else if(e instanceof Ks)this._setRanges([new Js(e)]);else if(e instanceof zs){const o=!!n&&!!n.backward;let i;if("in"==t)i=Js._createIn(e);else if("on"==t)i=Js._createOn(e);else{if(void 0===t)throw new Jn.b("model-selection-setTo-required-second-parameter: selection.setTo requires the second parameter when the first parameter is a node.");i=new Js(Ks._createAt(e,t))}this._setRanges([i],o)}else{if(!wo(e))throw new Jn.b("model-selection-setTo-not-selectable: Cannot set the selection to the given place.");this._setRanges(e,t&&!!t.backward)}}_setRanges(e,t=!1){const n=(e=Array.from(e)).some(e=>{if(!(e instanceof Js))throw new Jn.b("model-selection-set-ranges-not-range: Selection range set to an object that is not an instance of model.Range.");return this._ranges.every(t=>!t.isEqual(e))});if(e.length!==this._ranges.length||n){this._removeAllRanges();for(const t of e)this._pushRange(t);this._lastRangeBackward=!!t,this.fire("change:range",{directChange:!0})}}setFocus(e,t){if(null===this.anchor)throw new Jn.b("model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.");const n=Ks._createAt(e,t);if("same"==n.compareWith(this.focus))return;const o=this.anchor;this._ranges.length&&this._popRange(),"before"==n.compareWith(o)?(this._pushRange(new Js(n,o)),this._lastRangeBackward=!0):(this._pushRange(new Js(o,n)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(e){return this._attrs.has(e)}removeAttribute(e){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}setAttribute(e,t){this.getAttribute(e)!==t&&(this._attrs.set(e,t),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}getSelectedElement(){if(1!==this.rangeCount)return null;const e=this.getFirstRange(),t=e.start.nodeAfter,n=e.end.nodeBefore;return t instanceof Us&&t==n?t:null}is(e){return"selection"==e}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const n=oa(t.start,e);n&&(yield n);for(const n of t.getWalker())"elementEnd"==n.type&&na(n.item,e)&&(yield n.item);const o=oa(t.end,e);o&&!t.end.isTouching(Ks._createAt(o,0))&&(yield o)}}*getTopMostBlocks(){const e=Array.from(this.getSelectedBlocks());for(const t of e){const n=ia(t);n&&e.includes(n)||(yield t)}}containsEntireContent(e=this.anchor.root){const t=Ks._createAt(e,0),n=Ks._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e),this._ranges.push(new Js(e.start,e.end))}_checkRange(e){for(let t=0;t<this._ranges.length;t++)if(e.isIntersecting(this._ranges[t]))throw new Jn.b("model-selection-range-intersects: Trying to add a range that intersects with another range in the selection.",{addedRange:e,intersectingRange:this._ranges[t]})}_removeAllRanges(){for(;this._ranges.length>0;)this._popRange()}_popRange(){this._ranges.pop()}}function na(e,t){return!t.has(e)&&(t.add(e),e.document.model.schema.isBlock(e)&&e.parent)}function oa(e,t){const n=e.parent.document.model.schema,o=e.parent.getAncestors({parentFirst:!0,includeSelf:!0});let i=!1;const r=o.find(e=>!i&&(!(i=n.isLimit(e))&&na(e,t)));return o.forEach(e=>t.add(e)),r}function ia(e){const t=e.document.model.schema;let n=e.parent;for(;n;){if(t.isBlock(n))return n;n=n.parent}}lo(ta,no);class ra extends Js{constructor(e,t){super(e,t),function(){this.listenTo(this.root.document.model,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&function(e){const t=this.getTransformedByOperation(e),n=Js._createFromRanges(t),o=!n.isEqual(this),i=function(e,t){switch(t.type){case"insert":return e.containsPosition(t.position);case"move":case"remove":case"reinsert":case"merge":return e.containsPosition(t.sourcePosition)||e.start.isEqual(t.sourcePosition)||e.containsPosition(t.targetPosition);case"split":return e.containsPosition(t.splitPosition)||e.containsPosition(t.insertionPosition)}return!1}(this,e);let r=null;if(o){"$graveyard"==n.root.rootName&&(r="remove"==e.type?e.sourcePosition:e.deletionPosition);const t=this.toRange();this.start=n.start,this.end=n.end,this.fire("change:range",t,{deletionPosition:r})}else i&&this.fire("change:content",this.toRange(),{deletionPosition:r})}.call(this,n)},{priority:"low"})}.call(this)}detach(){this.stopListening()}toRange(){return new Js(this.start,this.end)}static fromRange(e){return new ra(e.start,e.end)}}lo(ra,no);const sa="selection:";class aa{constructor(e){this._selection=new ca(e),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getTopMostBlocks(){return this._selection.getTopMostBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(e){return this._selection.containsEntireContent(e)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(e){return this._selection.getAttribute(e)}hasAttribute(e){return this._selection.hasAttribute(e)}is(e){return"selection"==e||"documentSelection"==e}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(e,t,n){this._selection.setTo(e,t,n)}_setAttribute(e,t){this._selection.setAttribute(e,t)}_removeAttribute(e){this._selection.removeAttribute(e)}_getStoredAttributes(){return this._selection._getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(e){this._selection.restoreGravity(e)}static _getStoreAttributeKey(e){return sa+e}static _isStoreAttributeKey(e){return e.startsWith(sa)}}lo(aa,no);class ca extends ta{constructor(e){super(),this.markers=new si({idProperty:"name"}),this._model=e.model,this._document=e,this._attributePriority=new Map,this._fixGraveyardRangesData=[],this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this.on("change:range",()=>{for(const e of this.getRanges())if(!this._document._validateSelectionRange(e))throw new Jn.b("document-selection-wrong-position: Range from document selection starts or ends at incorrect position.",{range:e});this._updateMarkers(),this._updateAttributes(!1)}),this.listenTo(this._model.markers,"update",()=>this._updateMarkers()),this.listenTo(this._model,"applyOperation",(e,t)=>{const n=t[0];if(n.isDocumentOperation&&"marker"!=n.type&&"rename"!=n.type&&"noop"!=n.type){for(;this._fixGraveyardRangesData.length;){const{liveRange:e,sourcePosition:t}=this._fixGraveyardRangesData.shift();this._fixGraveyardSelection(e,t)}this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})),this._updateMarkers(),this._updateAttributes(!1)}},{priority:"lowest"}),this.listenTo(this._document,"change",(e,t)=>{!function(e,t){const n=e.document.differ;for(const o of n.getChanges()){if("insert"!=o.type)continue;const n=o.position.parent,i=o.length===n.maxOffset;i&&e.enqueueChange(t,e=>{const t=Array.from(n.getAttributeKeys()).filter(e=>e.startsWith(sa));for(const o of t)e.removeAttribute(o,n)})}}(this._model,t)})}get isCollapsed(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let e=0;e<this._ranges.length;e++)this._ranges[e].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()}setTo(e,t,n){super.setTo(e,t,n),this._refreshAttributes()}setFocus(e,t){super.setFocus(e,t),this._refreshAttributes()}setAttribute(e,t){if(this._setAttribute(e,t)){const t=[e];this.fire("change:attribute",{attributeKeys:t,directChange:!0})}}removeAttribute(e){if(this._removeAttribute(e)){const t=[e];this.fire("change:attribute",{attributeKeys:t,directChange:!0})}}overrideGravity(){const e=Yn();return this._overriddenGravityRegister.add(e),1===this._overriddenGravityRegister.size&&this._refreshAttributes(),e}restoreGravity(e){if(!this._overriddenGravityRegister.has(e))throw new Jn.b("document-selection-gravity-wrong-restore: Attempting to restore the selection gravity for an unknown UID.",{uid:e});this._overriddenGravityRegister.delete(e),this.isGravityOverridden||this._refreshAttributes()}_refreshAttributes(){this._updateAttributes(!0)}_popRange(){this._ranges.pop().detach()}_pushRange(e){const t=this._prepareRange(e);t&&this._ranges.push(t)}_prepareRange(e){if(this._checkRange(e),e.root==this._document.graveyard)return void ws.a.warn("model-selection-range-in-graveyard: Trying to add a Range that is in the graveyard root. Range rejected.");const t=ra.fromRange(e);return t.on("change:range",(e,n,o)=>{this._hasChangedRange=!0,t.root==this._document.graveyard&&this._fixGraveyardRangesData.push({liveRange:t,sourcePosition:o.deletionPosition})}),t}_updateMarkers(){const e=[];for(const t of this._model.markers){const n=t.getRange();for(const o of this.getRanges())n.containsRange(o,!o.isCollapsed)&&e.push(t)}for(const t of e)this.markers.has(t)||this.markers.add(t);for(const t of Array.from(this.markers))e.includes(t)||this.markers.remove(t)}_updateAttributes(e){const t=Ls(this._getSurroundingAttributes()),n=Ls(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(const[e,t]of this._attributePriority)"low"==t&&(this._attrs.delete(e),this._attributePriority.delete(e));this._setAttributesTo(t);const o=[];for(const[e,t]of this.getAttributes())n.has(e)&&n.get(e)===t||o.push(e);for(const[e]of n)this.hasAttribute(e)||o.push(e);o.length>0&&this.fire("change:attribute",{attributeKeys:o,directChange:!1})}_setAttribute(e,t,n=!0){const o=n?"normal":"low";return("low"!=o||"normal"!=this._attributePriority.get(e))&&(super.getAttribute(e)!==t&&(this._attrs.set(e,t),this._attributePriority.set(e,o),!0))}_removeAttribute(e,t=!0){const n=t?"normal":"low";return("low"!=n||"normal"!=this._attributePriority.get(e))&&(this._attributePriority.set(e,n),!!super.hasAttribute(e)&&(this._attrs.delete(e),!0))}_setAttributesTo(e){const t=new Set;for(const[t,n]of this.getAttributes())e.get(t)!==n&&this._removeAttribute(t,!1);for(const[n,o]of e){this._setAttribute(n,o,!1)&&t.add(n)}return t}*_getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(const t of e.getAttributeKeys())if(t.startsWith(sa)){yield[t.substr(sa.length),e.getAttribute(t)]}}_getSurroundingAttributes(){const e=this.getFirstPosition(),t=this._model.schema;let n=null;if(this.isCollapsed){const t=e.textNode?e.textNode:e.nodeBefore,o=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(n=la(t)),n||(n=la(o)),!this.isGravityOverridden&&!n){let e=t;for(;e&&!n;)n=la(e=e.previousSibling)}if(!n){let e=o;for(;e&&!n;)n=la(e=e.nextSibling)}n||(n=this._getStoredAttributes())}else{const e=this.getFirstRange();for(const o of e){if(o.item.is("element")&&t.isObject(o.item))break;if("text"==o.type){n=o.item.getAttributes();break}}}return n}_fixGraveyardSelection(e,t){const n=t.clone(),o=this._model.schema.getNearestSelectionRange(n),i=this._ranges.indexOf(e);if(this._ranges.splice(i,1),e.detach(),o){const e=this._prepareRange(o);this._ranges.splice(i,0,e)}}}function la(e){return e instanceof js||e instanceof qs?e.getAttributes():null}class da{constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers)e(t);return this}}var ua=1,ha=4;var fa=function(e){return jn(e,ua|ha)};class pa extends da{elementToElement(e){return this.add(function(e){return(e=fa(e)).view=ga(e.view,"container"),t=>{t.on("insert:"+e.model,function(e){return(t,n,o)=>{const i=e(n.item,o.writer);if(!i)return;if(!o.consumable.consume(n.item,"insert"))return;const r=o.mapper.toViewPosition(n.range.start);o.mapper.bindElements(n.item,i),o.writer.insert(r,i)}}(e.view),{priority:e.converterPriority||"normal"})}}(e))}attributeToElement(e){return this.add(function(e){let t="attribute:"+((e=fa(e)).model.key?e.model.key:e.model);e.model.name&&(t+=":"+e.model.name);if(e.model.values)for(const t of e.model.values)e.view[t]=ga(e.view[t],"attribute");else e.view=ga(e.view,"attribute");const n=ba(e);return o=>{o.on(t,function(e){return(t,n,o)=>{const i=e(n.attributeOldValue,o.writer),r=e(n.attributeNewValue,o.writer);if(!i&&!r)return;if(!o.consumable.consume(n.item,t.name))return;const s=o.writer,a=s.document.selection;if(n.item instanceof ta||n.item instanceof aa)s.wrap(a.getFirstRange(),r);else{let e=o.mapper.toViewRange(n.range);null!==n.attributeOldValue&&i&&(e=s.unwrap(e,i)),null!==n.attributeNewValue&&r&&s.wrap(e,r)}}}(n),{priority:e.converterPriority||"normal"})}}(e))}attributeToAttribute(e){return this.add(function(e){let t="attribute:"+((e=fa(e)).model.key?e.model.key:e.model);e.model.name&&(t+=":"+e.model.name);if(e.model.values)for(const t of e.model.values)e.view[t]=wa(e.view[t]);else e.view=wa(e.view);const n=ba(e);return o=>{o.on(t,function(e){return(t,n,o)=>{const i=e(n.attributeOldValue,n),r=e(n.attributeNewValue,n);if(!i&&!r)return;if(!o.consumable.consume(n.item,t.name))return;const s=o.mapper.toViewElement(n.item),a=o.writer;if(s){if(null!==n.attributeOldValue&&i)if("class"==i.key){const e=Array.isArray(i.value)?i.value:[i.value];for(const t of e)a.removeClass(t,s)}else if("style"==i.key){const e=Object.keys(i.value);for(const t of e)a.removeStyle(t,s)}else a.removeAttribute(i.key,s);if(null!==n.attributeNewValue&&r)if("class"==r.key){const e=Array.isArray(r.value)?r.value:[r.value];for(const t of e)a.addClass(t,s)}else if("style"==r.key){const e=Object.keys(r.value);for(const t of e)a.setStyle(t,r.value[t],s)}else a.setAttribute(r.key,r.value,s)}else ws.a.warn("conversion-attribute-to-attribute-on-text: Trying to convert text node's attribute with attribute-to-attribute converter.")}}(n),{priority:e.converterPriority||"normal"})}}(e))}markerToElement(e){return this.add(function(e){return(e=fa(e)).view=ga(e.view,"ui"),t=>{t.on("addMarker:"+e.model,function(e){return(t,n,o)=>{n.isOpening=!0;const i=e(n,o.writer);n.isOpening=!1;const r=e(n,o.writer);if(!i||!r)return;const s=n.markerRange;if(s.isCollapsed&&!o.consumable.consume(s,t.name))return;for(const e of s)if(!o.consumable.consume(e.item,t.name))return;const a=o.mapper,c=o.writer;c.insert(a.toViewPosition(s.start),i),o.mapper.bindElementToMarker(i,n.markerName),s.isCollapsed||(c.insert(a.toViewPosition(s.end),r),o.mapper.bindElementToMarker(r,n.markerName)),t.stop()}}(e.view),{priority:e.converterPriority||"normal"}),t.on("removeMarker:"+e.model,(e.view,(e,t,n)=>{const o=n.mapper.markerNameToElements(t.markerName);if(o){n.mapper.unbindElementsFromMarkerName(t.markerName);for(const e of o)n.writer.clear(n.writer.createRangeOn(e),e);n.writer.clearClonedElementsGroup(t.markerName),e.stop()}}),{priority:e.converterPriority||"normal"})}}(e))}markerToHighlight(e){return this.add(function(e){return t=>{t.on("addMarker:"+e.model,function(e){return(t,n,o)=>{if(!n.item)return;if(!(n.item instanceof ta||n.item instanceof aa||n.item.is("textProxy")))return;const i=_a(e,n,o);if(!i)return;if(!o.consumable.consume(n.item,t.name))return;const r=ma(i),s=o.writer,a=s.document.selection;if(n.item instanceof ta||n.item instanceof aa)s.wrap(a.getFirstRange(),r,a);else{const e=o.mapper.toViewRange(n.range),t=s.wrap(e,r);for(const e of t.getItems())if(e.is("attributeElement")&&e.isSimilar(r)){o.mapper.bindElementToMarker(e,n.markerName);break}}}}(e.view),{priority:e.converterPriority||"normal"}),t.on("addMarker:"+e.model,function(e){return(t,n,o)=>{if(!n.item)return;if(!(n.item instanceof Us))return;const i=_a(e,n,o);if(!i)return;if(!o.consumable.test(n.item,t.name))return;const r=o.mapper.toViewElement(n.item);if(r&&r.getCustomProperty("addHighlight")){o.consumable.consume(n.item,t.name);for(const e of Js._createIn(n.item))o.consumable.consume(e.item,t.name);r.getCustomProperty("addHighlight")(r,i,o.writer),o.mapper.bindElementToMarker(r,n.markerName)}}}(e.view),{priority:e.converterPriority||"normal"}),t.on("removeMarker:"+e.model,function(e){return(t,n,o)=>{if(n.markerRange.isCollapsed)return;const i=_a(e,n,o);if(!i)return;const r=ma(i),s=o.mapper.markerNameToElements(n.markerName);if(s){o.mapper.unbindElementsFromMarkerName(n.markerName);for(const e of s)e.is("attributeElement")?o.writer.unwrap(o.writer.createRangeOn(e),r):e.getCustomProperty("removeHighlight")(e,i.id,o.writer);o.writer.clearClonedElementsGroup(n.markerName),t.stop()}}}(e.view),{priority:e.converterPriority||"normal"})}}(e))}}function ma(e){const t=new li("span",e.attributes);return e.classes&&t._addClass(e.classes),e.priority&&(t._priority=e.priority),t._id=e.id,t}function ga(e,t){return"function"==typeof e?e:(n,o)=>(function(e,t,n){"string"==typeof e&&(e={name:e});let o;const i=Object.assign({},e.attributes);if("container"==n)o=t.createContainerElement(e.name,i);else if("attribute"==n){const n={priority:e.priority||li.DEFAULT_PRIORITY};o=t.createAttributeElement(e.name,i,n)}else o=t.createUIElement(e.name,i);if(e.styles){const n=Object.keys(e.styles);for(const i of n)t.setStyle(i,e.styles[i],o)}if(e.classes){const n=e.classes;if("string"==typeof n)t.addClass(n,o);else for(const e of n)t.addClass(e,o)}return o})(e,o,t)}function ba(e){return e.model.values?(t,n)=>{const o=e.view[t];return o?o(t,n):null}:e.view}function wa(e){return"string"==typeof e?t=>({key:e,value:t}):"object"==typeof e?e.value?()=>e:t=>({key:e.key,value:t}):e}function _a(e,t,n){const o="function"==typeof e?e(t,n):e;return o?(o.priority||(o.priority=10),o.id||(o.id=t.markerName),o):null}class ka extends da{elementToElement(e){return this.add(va(e))}elementToAttribute(e){return this.add(function(e){xa(e=fa(e));const t=Ca(e,!1),n=ya(e),o=n?"element:"+n:"element";return n=>{n.on(o,t,{priority:e.converterPriority||"low"})}}(e))}attributeToAttribute(e){return this.add(function(e){let t=null;("string"==typeof(e=fa(e)).view||e.view.key)&&(t=function(e){"string"==typeof e.view&&(e.view={key:e.view});const t=e.view.key;let n;if("class"==t||"style"==t){const o="class"==t?"classes":"styles";n={[o]:e.view.value}}else{const o=void 0===e.view.value?/[\s\S]*/:e.view.value;n={attributes:{[t]:o}}}e.view.name&&(n.name=e.view.name);return e.view=n,t}(e));xa(e,t);const n=Ca(e,!0);return t=>{t.on("element",n,{priority:e.converterPriority||"low"})}}(e))}elementToMarker(e){return this.add(function(e){return function(e){const t=e.model;e.model=((e,n)=>{const o="string"==typeof t?t:t(e);return n.createElement("$marker",{"data-name":o})})}(e=fa(e)),va(e)}(e))}}function va(e){const t=function(e){const t=e.view?new _o(e.view):null;return(n,o,i)=>{let r={};if(t){const e=t.match(o.viewItem);if(!e)return;r=e.match}r.name=!0;const s=function(e,t,n){return e instanceof Function?e(t,n):n.createElement(e)}(e.model,o.viewItem,i.writer);if(!s)return;if(!i.consumable.test(o.viewItem,r))return;const a=i.splitToAllowedParent(s,o.modelCursor);if(!a)return;i.writer.insert(s,a.position),i.convertChildren(o.viewItem,i.writer.createPositionAt(s,0)),i.consumable.consume(o.viewItem,r);const c=i.getSplitParts(s);o.modelRange=new Js(i.writer.createPositionBefore(s),i.writer.createPositionAfter(c[c.length-1])),a.cursorParent?o.modelCursor=i.writer.createPositionAt(a.cursorParent,0):o.modelCursor=o.modelRange.end}}(e=fa(e)),n=ya(e),o=n?"element:"+n:"element";return n=>{n.on(o,t,{priority:e.converterPriority||"normal"})}}function ya(e){return"string"==typeof e.view?e.view:"object"==typeof e.view&&"string"==typeof e.view.name?e.view.name:null}function xa(e,t=null){const n=null===t||(e=>e.getAttribute(t)),o="object"!=typeof e.model?e.model:e.model.key,i="object"!=typeof e.model||void 0===e.model.value?n:e.model.value;e.model={key:o,value:i}}function Ca(e,t){const n=new _o(e.view);return(o,i,r)=>{const s=n.match(i.viewItem);if(!s)return;const a=e.model.key,c="function"==typeof e.model.value?e.model.value(i.viewItem):e.model.value;null!==c&&(!function(e){if("object"==typeof e.view&&!ya(e))return!1;return!e.view.classes&&!e.view.attributes&&!e.view.styles}(e)?delete s.match.name:s.match.name=!0,r.consumable.test(i.viewItem,s.match)&&(i.modelRange||(i=Object.assign(i,r.convertChildren(i.viewItem,i.modelCursor))),function(e,t,n,o){let i=!1;for(const r of Array.from(e.getItems({shallow:n})))o.schema.checkAttribute(r,t.key)&&(o.writer.setAttribute(t.key,t.value,r),i=!0);return i}(i.modelRange,{key:a,value:c},t,r)&&r.consumable.consume(i.viewItem,s.match)))}}class Aa{constructor(e){this.model=e,this.view=new Vs,this.mapper=new Zs,this.downcastDispatcher=new Xs({mapper:this.mapper});const t=this.model.document,n=t.selection,o=this.model.markers;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(!0)},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(!1)},{priority:"lowest"}),this.listenTo(t,"change",()=>{this.view.change(e=>{this.downcastDispatcher.convertChanges(t.differ,e),this.downcastDispatcher.convertSelection(n,o,e)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(e,t){return(n,o)=>{const i=o.newSelection,r=new ta,s=[];for(const e of i.getRanges())s.push(t.toModelRange(e));r.setTo(s,{backward:i.isBackward}),r.isEqual(e.document.selection)||e.change(e=>{e.setSelection(r)})}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",(e,t,n)=>{if(!n.consumable.consume(t.item,"insert"))return;const o=n.writer,i=n.mapper.toViewPosition(t.range.start),r=o.createText(t.item.data);o.insert(i,r)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(e,t,n)=>{const o=n.mapper.toViewPosition(t.position),i=t.position.getShiftedBy(t.length),r=n.mapper.toViewPosition(i,{isPhantom:!0}),s=n.writer.createRange(o,r),a=n.writer.remove(s.getTrimmed());for(const e of n.writer.createRangeIn(a).getItems())n.mapper.unbindViewElement(e)},{priority:"low"}),this.downcastDispatcher.on("selection",(e,t,n)=>{const o=n.writer,i=o.document.selection;for(const e of i.getRanges())e.isCollapsed&&e.end.parent.document&&n.writer.mergeAttributes(e.start);o.setSelection(null)},{priority:"low"}),this.downcastDispatcher.on("selection",(e,t,n)=>{const o=t.selection;if(o.isCollapsed)return;if(!n.consumable.consume(o,"selection"))return;const i=[];for(const e of o.getRanges()){const t=n.mapper.toViewRange(e);i.push(t)}n.writer.setSelection(i,{backward:o.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(e,t,n)=>{const o=t.selection;if(!o.isCollapsed)return;if(!n.consumable.consume(o,"selection"))return;const i=n.writer,r=o.getFirstPosition(),s=n.mapper.toViewPosition(r),a=i.breakAttributes(s);i.setSelection(a)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(e=>{if("$graveyard"==e.rootName)return null;const t=new Yo(e.name);return t.rootName=e.rootName,t._document=this.view.document,this.mapper.bindElements(e,t),t})}destroy(){this.view.destroy(),this.stopListening()}}lo(Aa,Ho);class Pa{constructor(e,t=[]){this._editor=e,this._availablePlugins=new Map,this._plugins=new Map;for(const e of t)this._availablePlugins.set(e,e),e.pluginName&&this._availablePlugins.set(e.pluginName,e)}*[Symbol.iterator](){for(const e of this._plugins)"function"==typeof e[0]&&(yield e)}get(e){const t=this._plugins.get(e);if(!t){const t="plugincollection-plugin-not-loaded: The requested plugin is not loaded.";let n=e;throw"function"==typeof e&&(n=e.pluginName||e.name),new Jn.b(t,{plugin:n})}return t}has(e){return this._plugins.has(e)}init(e,t=[]){const n=this,o=this._editor,i=new Set,r=[],s=h(e),a=h(t),c=function(e){const t=[];for(const n of e)u(n)||t.push(n);return t.length?t:null}(e);if(c){const e="plugincollection-plugin-not-found: Some plugins are not available and could not be loaded.";return ws.a.error(e,{plugins:c}),Promise.reject(new Jn.b(e,{plugins:c}))}return Promise.all(s.map(l)).then(()=>d(r,"init")).then(()=>d(r,"afterInit")).then(()=>r);function l(e){if(!a.includes(e)&&!n._plugins.has(e)&&!i.has(e))return function(e){return new Promise(s=>{i.add(e),e.requires&&e.requires.forEach(n=>{const o=u(n);if(t.includes(o))throw new Jn.b("plugincollection-required: Cannot load a plugin because one of its dependencies is listed inthe `removePlugins` option.",{plugin:o,requiredBy:e});l(o)});const a=new e(o);n._add(e,a),r.push(a),s()})}(e).catch(t=>{throw ws.a.error("plugincollection-load: It was not possible to load the plugin.",{plugin:e}),t})}function d(e,t){return e.reduce((e,n)=>n[t]?e.then(n[t].bind(n)):e,Promise.resolve())}function u(e){return"function"==typeof e?e:n._availablePlugins.get(e)}function h(e){return e.map(e=>u(e)).filter(e=>!!e)}}destroy(){const e=Array.from(this).map(([,e])=>e).filter(e=>"function"==typeof e.destroy).map(e=>e.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const n=e.pluginName;n&&(this._plugins.has(n)?ws.a.warn("plugincollection-plugin-name-conflict: Two plugins with the same name were loaded.",{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:e}):this._plugins.set(n,t))}}lo(Pa,no);class Ea{constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const n=this.get(e);if(!n)throw new Jn.b("commandcollection-command-not-found: Command does not exist.",{commandName:e});n.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands())e.destroy()}}function Ta(e,t){const n=Object.keys(window.CKEDITOR_TRANSLATIONS).length;return 1===n&&(e=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]),0!==n&&function(e,t){return e in window.CKEDITOR_TRANSLATIONS&&t in window.CKEDITOR_TRANSLATIONS[e]}(e,t)?window.CKEDITOR_TRANSLATIONS[e][t].replace(/ \[context: [^\]]+\]$/,""):t.replace(/ \[context: [^\]]+\]$/,"")}window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={});class Sa{constructor(e){this.language=e||"en",this.t=((...e)=>this._t(...e))}_t(e,t){let n=Ta(this.language,e);return t&&(n=n.replace(/%(\d+)/g,(e,n)=>n<t.length?t[n]:e)),n}}class Ra{constructor(){this._consumables=new Map}add(e,t){let n;e.is("text")||e.is("documentFragment")?this._consumables.set(e,!0):(this._consumables.has(e)?n=this._consumables.get(e):(n=new Oa,this._consumables.set(e,n)),n.add(t))}test(e,t){const n=this._consumables.get(e);return void 0===n?null:e.is("text")||e.is("documentFragment")?n:n.test(t)}consume(e,t){return!!this.test(e,t)&&(e.is("text")||e.is("documentFragment")?this._consumables.set(e,!1):this._consumables.get(e).consume(t),!0)}revert(e,t){const n=this._consumables.get(e);void 0!==n&&(e.is("text")||e.is("documentFragment")?this._consumables.set(e,!0):n.revert(t))}static consumablesFromElement(e){const t={name:!0,attributes:[],classes:[],styles:[]},n=e.getAttributeKeys();for(const e of n)"style"!=e&&"class"!=e&&t.attributes.push(e);const o=e.getClassNames();for(const e of o)t.classes.push(e);const i=e.getStyleNames();for(const e of i)t.styles.push(e);return t}static createFrom(e,t){if(t||(t=new Ra),e.is("text"))return t.add(e),t;e.is("element")&&t.add(e,Ra.consumablesFromElement(e)),e.is("documentFragment")&&t.add(e);for(const n of e.getChildren())t=Ra.createFrom(n,t);return t}}class Oa{constructor(){this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(e){e.name&&(this._canConsumeName=!0);for(const t in this._consumables)t in e&&this._add(t,e[t])}test(e){if(e.name&&!this._canConsumeName)return this._canConsumeName;for(const t in this._consumables)if(t in e){const n=this._test(t,e[t]);if(!0!==n)return n}return!0}consume(e){e.name&&(this._canConsumeName=!1);for(const t in this._consumables)t in e&&this._consume(t,e[t])}revert(e){e.name&&(this._canConsumeName=!0);for(const t in this._consumables)t in e&&this._revert(t,e[t])}_add(e,t){const n=$e(t)?t:[t],o=this._consumables[e];for(const t of n){if("attributes"===e&&("class"===t||"style"===t))throw new Jn.b("viewconsumable-invalid-attribute: Classes and styles should be handled separately.");o.set(t,!0)}}_test(e,t){const n=$e(t)?t:[t],o=this._consumables[e];for(const t of n)if("attributes"!==e||"class"!==t&&"style"!==t){const e=o.get(t);if(void 0===e)return null;if(!e)return!1}else{const e="class"==t?"classes":"styles",n=this._test(e,[...this._consumables[e].keys()]);if(!0!==n)return n}return!0}_consume(e,t){const n=$e(t)?t:[t],o=this._consumables[e];for(const t of n)if("attributes"!==e||"class"!==t&&"style"!==t)o.set(t,!1);else{const e="class"==t?"classes":"styles";this._consume(e,[...this._consumables[e].keys()])}}_revert(e,t){const n=$e(t)?t:[t],o=this._consumables[e];for(const t of n)if("attributes"!==e||"class"!==t&&"style"!==t){!1===o.get(t)&&o.set(t,!0)}else{const e="class"==t?"classes":"styles";this._revert(e,[...this._consumables[e].keys()])}}}class Ia{constructor(){this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(e,t)=>{t[0]=new Da(t[0])},{priority:"highest"}),this.on("checkChild",(e,t)=>{t[0]=new Da(t[0]),t[1]=this.getDefinition(t[1])},{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e])throw new Jn.b("schema-cannot-register-item-twice: A single item cannot be registered twice in the schema.",{itemName:e});this._sourceDefinitions[e]=[Object.assign({},t)],this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e])throw new Jn.b("schema-cannot-extend-missing-item: Cannot extend an item which was not registered yet.",{itemName:e});this._sourceDefinitions[e].push(Object.assign({},t)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(e){let t;return t="string"==typeof e?e:e.is&&(e.is("text")||e.is("textProxy"))?"$text":e.name,this.getDefinitions()[t]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){const t=this.getDefinition(e);return!(!t||!t.isBlock)}isLimit(e){const t=this.getDefinition(e);return!!t&&!(!t.isLimit&&!t.isObject)}isObject(e){const t=this.getDefinition(e);return!(!t||!t.isObject)}isInline(e){const t=this.getDefinition(e);return!(!t||!t.isInline)}checkChild(e,t){return!!t&&this._checkContextMatch(t,e)}checkAttribute(e,t){const n=this.getDefinition(e.last);return!!n&&n.allowAttributes.includes(t)}checkMerge(e,t=null){if(e instanceof Ks){const t=e.nodeBefore,n=e.nodeAfter;if(!(t instanceof Us))throw new Jn.b("schema-check-merge-no-element-before: The node before the merge position must be an element.");if(!(n instanceof Us))throw new Jn.b("schema-check-merge-no-element-after: The node after the merge position must be an element.");return this.checkMerge(t,n)}for(const n of t.getChildren())if(!this.checkChild(e,n))return!1;return!0}addChildCheck(e){this.on("checkChild",(t,[n,o])=>{if(!o)return;const i=e(n,o);"boolean"==typeof i&&(t.stop(),t.return=i)},{priority:"high"})}addAttributeCheck(e){this.on("checkAttribute",(t,[n,o])=>{const i=e(n,o);"boolean"==typeof i&&(t.stop(),t.return=i)},{priority:"high"})}setAttributeProperties(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}getAttributeProperties(e){return this._attributeProperties[e]||{}}getLimitElement(e){let t;if(e instanceof Ks)t=e.parent;else{t=(e instanceof Js?[e]:Array.from(e.getRanges())).reduce((e,t)=>{const n=t.getCommonAncestor();return e?e.getCommonAncestor(n,{includeSelf:!0}):n},null)}for(;!this.isLimit(t)&&t.parent;)t=t.parent;return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const n=[...e.getFirstPosition().getAncestors(),new qs("",e.getAttributes())];return this.checkAttribute(n,t)}{const n=e.getRanges();for(const e of n)for(const n of e)if(this.checkAttribute(n.item,t))return!0}return!1}*getValidRanges(e,t){e=function*(e){for(const t of e)yield*t.getMinimalFlatRanges()}(e);for(const n of e)yield*this._getValidRangesForRange(n,t)}getNearestSelectionRange(e,t="both"){if(this.checkChild(e,"$text"))return new Js(e);let n,o;"both"!=t&&"backward"!=t||(n=new Ws({startPosition:e,direction:"backward"})),"both"!=t&&"forward"!=t||(o=new Ws({startPosition:e}));for(const e of function*(e,t){let n=!1;for(;!n;){if(n=!0,e){const t=e.next();t.done||(n=!1,yield{walker:e,value:t.value})}if(t){const e=t.next();e.done||(n=!1,yield{walker:t,value:e.value})}}}(n,o)){const t=e.walker==n?"elementEnd":"elementStart",o=e.value;if(o.type==t&&this.isObject(o.item))return Js._createOn(o.item);if(this.checkChild(o.nextPosition,"$text"))return new Js(o.nextPosition)}return null}findAllowedParent(e,t){let n=e.parent;for(;n;){if(this.checkChild(n,t))return n;if(this.isLimit(n))return null;n=n.parent}return null}removeDisallowedAttributes(e,t){for(const n of e){for(const e of n.getAttributeKeys())this.checkAttribute(n,e)||t.removeAttribute(e,n);n.is("element")&&this.removeDisallowedAttributes(n.getChildren(),t)}}createContext(e){return new Da(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={},t=this._sourceDefinitions,n=Object.keys(t);for(const o of n)e[o]=Ma(t[o],o);for(const t of n)Na(e,t);for(const t of n)Fa(e,t);for(const t of n)Ba(e,t),Va(e,t);for(const t of n)La(e,t),za(e,t);this._compiledDefinitions=e}_checkContextMatch(e,t,n=t.length-1){const o=t.getItem(n);if(e.allowIn.includes(o.name)){if(0==n)return!0;{const e=this.getDefinition(o);return this._checkContextMatch(e,t,n-1)}}return!1}*_getValidRangesForRange(e,t){let n=e.start,o=e.start;for(const i of e.getItems({shallow:!0}))i.is("element")&&(yield*this._getValidRangesForRange(Js._createIn(i),t)),this.checkAttribute(i,t)||(n.isEqual(o)||(yield new Js(n,o)),n=Ks._createAfter(i)),o=Ks._createAfter(i);n.isEqual(o)||(yield new Js(n,o))}}lo(Ia,Ho);class Da{constructor(e){if(e instanceof Da)return e;"string"==typeof e?e=[e]:Array.isArray(e)||(e=e.getAncestors({includeSelf:!0})),e[0]&&"string"!=typeof e[0]&&e[0].is("documentFragment")&&e.shift(),this._items=e.map(Ha)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(e){const t=new Da([e]);return t._items=[...this._items,...t._items],t}getItem(e){return this._items[e]}*getNames(){yield*this._items.map(e=>e.name)}endsWith(e){return Array.from(this.getNames()).join(" ").endsWith(e)}}function Ma(e,t){const n={name:t,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};return function(e,t){for(const n of e){const e=Object.keys(n).filter(e=>e.startsWith("is"));for(const o of e)t[o]=n[o]}}(e,n),qa(e,n,"allowIn"),qa(e,n,"allowContentOf"),qa(e,n,"allowWhere"),qa(e,n,"allowAttributes"),qa(e,n,"allowAttributesOf"),qa(e,n,"inheritTypesFrom"),function(e,t){for(const n of e){const e=n.inheritAllFrom;e&&(t.allowContentOf.push(e),t.allowWhere.push(e),t.allowAttributesOf.push(e),t.inheritTypesFrom.push(e))}}(e,n),n}function Na(e,t){for(const n of e[t].allowContentOf)if(e[n]){ja(e,n).forEach(e=>{e.allowIn.push(t)})}delete e[t].allowContentOf}function Fa(e,t){for(const n of e[t].allowWhere){const o=e[n];if(o){const n=o.allowIn;e[t].allowIn.push(...n)}}delete e[t].allowWhere}function Ba(e,t){for(const n of e[t].allowAttributesOf){const o=e[n];if(o){const n=o.allowAttributes;e[t].allowAttributes.push(...n)}}delete e[t].allowAttributesOf}function Va(e,t){const n=e[t];for(const t of n.inheritTypesFrom){const o=e[t];if(o){const e=Object.keys(o).filter(e=>e.startsWith("is"));for(const t of e)t in n||(n[t]=o[t])}}delete n.inheritTypesFrom}function La(e,t){const n=e[t],o=n.allowIn.filter(t=>e[t]);n.allowIn=Array.from(new Set(o))}function za(e,t){const n=e[t];n.allowAttributes=Array.from(new Set(n.allowAttributes))}function qa(e,t,n){for(const o of e)"string"==typeof o[n]?t[n].push(o[n]):Array.isArray(o[n])&&t[n].push(...o[n])}function ja(e,t){const n=e[t];return function(e){return Object.keys(e).map(t=>e[t])}(e).filter(e=>e.allowIn.includes(n.name))}function Ha(e){return"string"==typeof e?{name:e,*getAttributeKeys(){},getAttribute(){}}:{name:e.is("element")?e.name:"$text",*getAttributeKeys(){yield*e.getAttributeKeys()},getAttribute:t=>e.getAttribute(t)}}class Ua{constructor(e={}){this._splitParts=new Map,this._modelCursor=null,this.conversionApi=Object.assign({},e),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this),this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this),this.conversionApi.getSplitParts=this._getSplitParts.bind(this)}convert(e,t,n=["$root"]){this.fire("viewCleanup",e),this._modelCursor=function(e,t){let n;for(const o of new Da(e)){const e={};for(const t of o.getAttributeKeys())e[t]=o.getAttribute(t);const i=t.createElement(o.name,e);n&&t.append(i,n),n=Ks._createAt(i,0)}return n}(n,t),this.conversionApi.writer=t,this.conversionApi.consumable=Ra.createFrom(e),this.conversionApi.store={};const{modelRange:o}=this._convertItem(e,this._modelCursor),i=t.createDocumentFragment();if(o){this._removeEmptyElements();for(const e of Array.from(this._modelCursor.parent.getChildren()))t.append(e,i);i.markers=function(e,t){const n=new Set,o=new Map,i=Js._createIn(e).getItems();for(const e of i)"$marker"==e.name&&n.add(e);for(const e of n){const n=e.getAttribute("data-name"),i=t.createPositionBefore(e);o.has(n)?o.get(n).end=i.clone():o.set(n,new Js(i.clone())),t.remove(e)}return o}(i,t)}return this._modelCursor=null,this._splitParts.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,i}_convertItem(e,t){const n=Object.assign({viewItem:e,modelCursor:t,modelRange:null});if(e.is("element")?this.fire("element:"+e.name,n,this.conversionApi):e.is("text")?this.fire("text",n,this.conversionApi):this.fire("documentFragment",n,this.conversionApi),n.modelRange&&!(n.modelRange instanceof Js))throw new Jn.b("view-conversion-dispatcher-incorrect-result: Incorrect conversion result was dropped.");return{modelRange:n.modelRange,modelCursor:n.modelCursor}}_convertChildren(e,t){const n=new Js(t);let o=t;for(const t of Array.from(e.getChildren())){const e=this._convertItem(t,o);e.modelRange instanceof Js&&(n.end=e.modelRange.end,o=e.modelCursor)}return{modelRange:n,modelCursor:o}}_splitToAllowedParent(e,t){const n=this.conversionApi.schema.findAllowedParent(t,e);if(!n)return null;if(n===t.parent)return{position:t};if(this._modelCursor.parent.getAncestors().includes(n))return null;const o=this.conversionApi.writer.split(t,n),i=[];for(const e of o.range.getWalker())if("elementEnd"==e.type)i.push(e.item);else{const t=i.pop(),n=e.item;this._registerSplitPair(t,n)}return{position:o.position,cursorParent:o.range.end.parent}}_registerSplitPair(e,t){this._splitParts.has(e)||this._splitParts.set(e,[e]);const n=this._splitParts.get(e);this._splitParts.set(t,n),n.push(t)}_getSplitParts(e){let t;return t=this._splitParts.has(e)?this._splitParts.get(e):[e]}_removeEmptyElements(){let e=!1;for(const t of this._splitParts.keys())t.isEmpty&&(this.conversionApi.writer.remove(t),this._splitParts.delete(t),e=!0);e&&this._removeEmptyElements()}}lo(Ua,no);class Wa{constructor(e,t){this.model=e,this.processor=t,this.mapper=new Zs,this.downcastDispatcher=new Xs({mapper:this.mapper}),this.downcastDispatcher.on("insert:$text",(e,t,n)=>{if(!n.consumable.consume(t.item,"insert"))return;const o=n.writer,i=n.mapper.toViewPosition(t.range.start),r=o.createText(t.item.data);o.insert(i,r)},{priority:"lowest"}),this.upcastDispatcher=new Ua({schema:e.schema}),this.upcastDispatcher.on("text",(e,t,n)=>{if(n.schema.checkChild(t.modelCursor,"$text")&&n.consumable.consume(t.viewItem)){const e=n.writer.createText(t.viewItem.data);n.writer.insert(e,t.modelCursor),t.modelRange=Js._createFromPositionAndShift(t.modelCursor,e.offsetSize),t.modelCursor=t.modelRange.end}},{priority:"lowest"}),this.upcastDispatcher.on("element",(e,t,n)=>{if(!t.modelRange&&n.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:o}=n.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=o}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(e,t,n)=>{if(!t.modelRange&&n.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:o}=n.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=o}},{priority:"lowest"}),this.decorate("init"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"})}get(e){const{rootName:t="main",trim:n="empty"}=e||{};if(!this._checkIfRootsExists([t]))throw new Jn.b("datacontroller-get-non-existent-root: Attempting to get data from a non-existing root.");const o=this.model.document.getRoot(t);return"empty"!==n||this.model.hasContent(o,{ignoreWhitespaces:!0})?this.stringify(o):""}stringify(e){const t=this.toView(e);return this.processor.toData(t)}toView(e){this.mapper.clearBindings();const t=Js._createIn(e),n=new Ai,o=new Pi(new ai);if(this.mapper.bindElements(e,n),this.downcastDispatcher.convertInsert(t,o),!e.is("documentFragment")){const t=function(e){const t=[],n=e.root.document;if(!n)return[];const o=Js._createIn(e);for(const e of n.model.markers){const n=o.getIntersection(e.getRange());n&&t.push([e.name,n])}return t}(e);for(const[e,n]of t)this.downcastDispatcher.convertMarkerAdd(e,n,o)}return n}init(e){if(this.model.document.version)throw new Jn.b("datacontroller-init-document-not-empty: Trying to set initial data to not empty document.");let t={};if("string"==typeof e?t.main=e:t=e,!this._checkIfRootsExists(Object.keys(t)))throw new Jn.b("datacontroller-init-non-existent-root: Attempting to init data on a non-existing root.");return this.model.enqueueChange("transparent",e=>{for(const n of Object.keys(t)){const o=this.model.document.getRoot(n);e.insert(this.parse(t[n],o),o,0)}}),Promise.resolve()}set(e){let t={};if("string"==typeof e?t.main=e:t=e,!this._checkIfRootsExists(Object.keys(t)))throw new Jn.b("datacontroller-set-non-existent-root: Attempting to set data on a non-existing root.");this.model.enqueueChange("transparent",e=>{e.setSelection(null),e.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const n of Object.keys(t)){const o=this.model.document.getRoot(n);e.remove(e.createRangeIn(o)),e.insert(this.parse(t[n],o),o,0)}})}parse(e,t="$root"){const n=this.processor.toView(e);return this.toModel(n,t)}toModel(e,t="$root"){return this.model.change(n=>this.upcastDispatcher.convert(e,n,t))}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e)if(!this.model.document.getRootNames().includes(t))return!1;return!0}}lo(Wa,Ho);class $a{constructor(e,t){this._helpers=new Map,this._downcast=Array.isArray(e)?e:[e],this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Array.isArray(t)?t:[t],this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(e,t){const n=this._downcast.includes(t);if(!this._upcast.includes(t)&&!n)throw new Jn.b("conversion-add-alias-dispatcher-not-registered: Trying to register and alias for a dispatcher that nas not been registered.");this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:n})}for(e){if(!this._helpers.has(e))throw new Jn.b("conversion-for-unknown-group: Trying to add a converter to an unknown dispatchers group.");return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(const{model:t,view:n}of Ga(e))this.for("upcast").elementToElement({model:t,view:n,converterPriority:e.converterPriority})}attributeToElement(e){this.for("downcast").attributeToElement(e);for(const{model:t,view:n}of Ga(e))this.for("upcast").elementToAttribute({view:n,model:t,converterPriority:e.converterPriority})}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(const{model:t,view:n}of Ga(e))this.for("upcast").attributeToAttribute({view:n,model:t})}_createConversionHelpers({name:e,dispatchers:t,isDowncast:n}){if(this._helpers.has(e))throw new Jn.b("conversion-group-exists: Trying to register a group name that has already been registered.");const o=n?new pa(t):new ka(t);this._helpers.set(e,o)}}function*Ga(e){if(e.model.values)for(const t of e.model.values){yield*Ka({key:e.model.key,value:t},e.view[t],e.upcastAlso?e.upcastAlso[t]:void 0)}else yield*Ka(e.model,e.view,e.upcastAlso)}function*Ka(e,t,n){if(yield{model:e,view:t},n){n=Array.isArray(n)?n:[n];for(const t of n)yield{model:e,view:t}}}class Ja{constructor(e="default"){this.operations=[],this.type=e}get baseVersion(){for(const e of this.operations)if(null!==e.baseVersion)return e.baseVersion;return null}addOperation(e){return e.batch=this,this.operations.push(e),e}}class Za{constructor(e){this.baseVersion=e,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const e=Object.assign({},this);return e.__className=this.constructor.className,delete e.batch,delete e.isDocumentOperation,e}static get className(){return"Operation"}static fromJSON(e){return new this(e.baseVersion)}}class Qa{constructor(e){this.markers=new Map,this._children=new Hs,e&&this._insertChild(0,e)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(e){return"documentFragment"==e}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}getPath(){return[]}getNodeByPath(e){let t=this;for(const n of e)t=t.getChild(t.offsetToIndex(n));return t}offsetToIndex(e){return this._children.offsetToIndex(e)}toJSON(){const e=[];for(const t of this._children)e.push(t.toJSON());return e}static fromJSON(e){const t=[];for(const n of e)n.name?t.push(Us.fromJSON(n)):t.push(qs.fromJSON(n));return new Qa(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=function(e){if("string"==typeof e)return[new qs(e)];wo(e)||(e=[e]);return Array.from(e).map(e=>"string"==typeof e?new qs(e):e instanceof js?new qs(e.data,e.getAttributes()):e)}(t);for(const e of n)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const e of n)e.parent=null;return n}}function Ya(e,t){const n=(t=tc(t)).reduce((e,t)=>e+t.offsetSize,0),o=e.parent;oc(e);const i=e.index;return o._insertChild(i,t),nc(o,i+t.length),nc(o,i),new Js(e,e.getShiftedBy(n))}function Xa(e){if(!e.isFlat)throw new Jn.b("operation-utils-remove-range-not-flat: Trying to remove a range which starts and ends in different element.");const t=e.start.parent;oc(e.start),oc(e.end);const n=t._removeChildren(e.start.index,e.end.index-e.start.index);return nc(t,e.start.index),n}function ec(e,t){if(!e.isFlat)throw new Jn.b("operation-utils-move-range-not-flat: Trying to move a range which starts and ends in different element.");const n=Xa(e);return Ya(t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset),n)}function tc(e){const t=[];e instanceof Array||(e=[e]);for(let n=0;n<e.length;n++)if("string"==typeof e[n])t.push(new qs(e[n]));else if(e[n]instanceof js)t.push(new qs(e[n].data,e[n].getAttributes()));else if(e[n]instanceof Qa||e[n]instanceof Hs)for(const o of e[n])t.push(o);else e[n]instanceof zs&&t.push(e[n]);for(let e=1;e<t.length;e++){const n=t[e],o=t[e-1];n instanceof qs&&o instanceof qs&&ic(n,o)&&(t.splice(e-1,2,new qs(o.data+n.data,o.getAttributes())),e--)}return t}function nc(e,t){const n=e.getChild(t-1),o=e.getChild(t);if(n&&o&&n.is("text")&&o.is("text")&&ic(n,o)){const i=new qs(n.data+o.data,n.getAttributes());e._removeChildren(t-1,2),e._insertChild(t-1,i)}}function oc(e){const t=e.textNode,n=e.parent;if(t){const o=e.offset-t.startOffset,i=t.index;n._removeChildren(i,1);const r=new qs(t.data.substr(0,o),t.getAttributes()),s=new qs(t.data.substr(o),t.getAttributes());n._insertChild(i,[r,s])}}function ic(e,t){const n=e.getAttributes(),o=t.getAttributes();for(const e of n){if(e[1]!==t.getAttribute(e[0]))return!1;o.next()}return o.next().done}var rc=function(e,t){return Qr(e,t)};class sc extends Za{constructor(e,t,n,o,i){super(i),this.range=e.clone(),this.key=t,this.oldValue=void 0===n?null:n,this.newValue=void 0===o?null:o}get type(){return null===this.oldValue?"addAttribute":null===this.newValue?"removeAttribute":"changeAttribute"}clone(){return new sc(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new sc(this.range,this.key,this.newValue,this.oldValue,this.baseVersion+1)}toJSON(){const e=super.toJSON();return e.range=this.range.toJSON(),e}_validate(){if(!this.range.isFlat)throw new Jn.b("attribute-operation-range-not-flat: The range to change is not flat.");for(const e of this.range.getItems({shallow:!0})){if(null!==this.oldValue&&!rc(e.getAttribute(this.key),this.oldValue))throw new Jn.b("attribute-operation-wrong-old-value: Changed node has different attribute value than operation's old attribute value.",{item:e,key:this.key,value:this.oldValue});if(null===this.oldValue&&null!==this.newValue&&e.hasAttribute(this.key))throw new Jn.b("attribute-operation-attribute-exists: The attribute with given key already exists.",{node:e,key:this.key})}}_execute(){rc(this.oldValue,this.newValue)||function(e,t,n){oc(e.start),oc(e.end);for(const o of e.getItems({shallow:!0})){const e=o.is("textProxy")?o.textNode:o;null!==n?e._setAttribute(t,n):e._removeAttribute(t),nc(e.parent,e.index)}nc(e.end.parent,e.end.index)}(this.range,this.key,this.newValue)}static get className(){return"AttributeOperation"}static fromJSON(e,t){return new sc(Js.fromJSON(e.range,t),e.key,e.oldValue,e.newValue,e.baseVersion)}}class ac extends Za{constructor(e,t){super(null),this.sourcePosition=e.clone(),this.howMany=t}get type(){return"detach"}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e}_validate(){if(this.sourcePosition.root.document)throw new Jn.b("detach-operation-on-document-node: Cannot detach document node.")}_execute(){Xa(Js._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class cc extends Za{constructor(e,t,n,o){super(o),this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toNext",this.howMany=t,this.targetPosition=n.clone(),this.targetPosition.stickiness="toNone"}get type(){return"$graveyard"==this.targetPosition.root.rootName?"remove":"$graveyard"==this.sourcePosition.root.rootName?"reinsert":"move"}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.baseVersion)}getMovedRangeStart(){return this.targetPosition._getTransformedByDeletion(this.sourcePosition,this.howMany)}getReversed(){const e=this.sourcePosition._getTransformedByInsertion(this.targetPosition,this.howMany);return new this.constructor(this.getMovedRangeStart(),this.howMany,e,this.baseVersion+1)}_validate(){const e=this.sourcePosition.parent,t=this.targetPosition.parent,n=this.sourcePosition.offset,o=this.targetPosition.offset;if(!e||!t)throw new Jn.b("move-operation-position-invalid: Source position or target position is invalid.");if(n+this.howMany>e.maxOffset)throw new Jn.b("move-operation-nodes-do-not-exist: The nodes which should be moved do not exist.");if(e===t&&n<o&&o<n+this.howMany)throw new Jn.b("move-operation-range-into-itself: Trying to move a range of nodes to the inside of that range.");if(this.sourcePosition.root==this.targetPosition.root&&"prefix"==uo(this.sourcePosition.getParentPath(),this.targetPosition.getParentPath())){const e=this.sourcePosition.path.length-1;if(this.targetPosition.path[e]>=n&&this.targetPosition.path[e]<n+this.howMany)throw new Jn.b("move-operation-node-into-itself: Trying to move a range of nodes into one of nodes from that range.")}}_execute(){ec(Js._createFromPositionAndShift(this.sourcePosition,this.howMany),this.targetPosition)}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e.targetPosition=this.targetPosition.toJSON(),e}static get className(){return"MoveOperation"}static fromJSON(e,t){const n=Ks.fromJSON(e.sourcePosition,t),o=Ks.fromJSON(e.targetPosition,t);return new this(n,e.howMany,o,e.baseVersion)}}class lc extends Za{constructor(e,t,n){super(n),this.position=e.clone(),this.position.stickiness="toNone",this.nodes=new Hs(tc(t)),this.shouldReceiveAttributes=!1}get type(){return"insert"}get howMany(){return this.nodes.maxOffset}clone(){const e=new Hs([...this.nodes].map(e=>e._clone(!0))),t=new lc(this.position,e,this.baseVersion);return t.shouldReceiveAttributes=this.shouldReceiveAttributes,t}getReversed(){const e=this.position.root.document.graveyard,t=new Ks(e,[0]);return new cc(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffset<this.position.offset)throw new Jn.b("insert-operation-position-invalid: Insertion position is invalid.")}_execute(){const e=this.nodes;this.nodes=new Hs([...e].map(e=>e._clone(!0))),Ya(this.position,e)}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e.nodes=this.nodes.toJSON(),e}static get className(){return"InsertOperation"}static fromJSON(e,t){const n=[];for(const t of e.nodes)t.name?n.push(Us.fromJSON(t)):n.push(qs.fromJSON(t));const o=new lc(Ks.fromJSON(e.position,t),n,e.baseVersion);return o.shouldReceiveAttributes=e.shouldReceiveAttributes,o}}class dc extends Za{constructor(e,t,n,o,i,r){super(r),this.name=e,this.oldRange=t?t.clone():null,this.newRange=n?n.clone():null,this.affectsData=i,this._markers=o}get type(){return"marker"}clone(){return new dc(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new dc(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){const e=this.newRange?"_set":"_remove";this._markers[e](this.name,this.newRange,!0,this.affectsData)}toJSON(){const e=super.toJSON();return this.oldRange&&(e.oldRange=this.oldRange.toJSON()),this.newRange&&(e.newRange=this.newRange.toJSON()),delete e._markers,e}static get className(){return"MarkerOperation"}static fromJSON(e,t){return new dc(e.name,e.oldRange?Js.fromJSON(e.oldRange,t):null,e.newRange?Js.fromJSON(e.newRange,t):null,t.model.markers,e.affectsData,e.baseVersion)}}class uc extends Za{constructor(e,t,n,o){super(o),this.position=e,this.position.stickiness="toNext",this.oldName=t,this.newName=n}get type(){return"rename"}clone(){return new uc(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new uc(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(!(e instanceof Us))throw new Jn.b("rename-operation-wrong-position: Given position is invalid or node after it is not an instance of Element.");if(e.name!==this.oldName)throw new Jn.b("rename-operation-wrong-name: Element to change has different name than operation's old name.")}_execute(){this.position.nodeAfter.name=this.newName}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e}static get className(){return"RenameOperation"}static fromJSON(e,t){return new uc(Ks.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class hc extends Za{constructor(e,t,n,o,i){super(i),this.root=e,this.key=t,this.oldValue=n,this.newValue=o}get type(){return null===this.oldValue?"addRootAttribute":null===this.newValue?"removeRootAttribute":"changeRootAttribute"}clone(){return new hc(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new hc(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new Jn.b("rootattribute-operation-not-a-root: The element to change is not a root element.",{root:this.root,key:this.key});if(null!==this.oldValue&&this.root.getAttribute(this.key)!==this.oldValue)throw new Jn.b("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 Jn.b("rootattribute-operation-attribute-exists: The attribute with given key already exists.",{root:this.root,key:this.key})}_execute(){null!==this.newValue?this.root._setAttribute(this.key,this.newValue):this.root._removeAttribute(this.key)}toJSON(){const e=super.toJSON();return e.root=this.root.toJSON(),e}static get className(){return"RootAttributeOperation"}static fromJSON(e,t){if(!t.getRoot(e.root))throw new Jn.b("rootattribute-operation-fromjson-no-root: Cannot create RootAttributeOperation. Root with specified name does not exist.",{rootName:e.root});return new hc(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}class fc extends Za{constructor(e,t,n,o,i){super(i),this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=t,this.targetPosition=n.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=o.clone()}get type(){return"merge"}get deletionPosition(){return new Ks(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const e=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Js(this.sourcePosition,e)}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.targetPosition._getTransformedByMergeOperation(this),t=this.sourcePosition.path.slice(0,-1),n=new Ks(this.sourcePosition.root,t)._getTransformedByMergeOperation(this),o=new pc(e,this.howMany,this.graveyardPosition,this.baseVersion+1);return o.insertionPosition=n,o}_validate(){const e=this.sourcePosition.parent,t=this.targetPosition.parent;if(!(e&&e.is("element")&&e.parent))throw new Jn.b("merge-operation-source-position-invalid: Merge source position is invalid.");if(!(t&&t.is("element")&&t.parent))throw new Jn.b("merge-operation-target-position-invalid: Merge target position is invalid.");if(this.howMany!=e.maxOffset)throw new Jn.b("merge-operation-how-many-invalid: Merge operation specifies wrong number of nodes to move.")}_execute(){const e=this.sourcePosition.parent;ec(Js._createIn(e),this.targetPosition),ec(Js._createOn(e),this.graveyardPosition)}toJSON(){const e=super.toJSON();return e.sourcePosition=e.sourcePosition.toJSON(),e.targetPosition=e.targetPosition.toJSON(),e.graveyardPosition=e.graveyardPosition.toJSON(),e}static get className(){return"MergeOperation"}static fromJSON(e,t){const n=Ks.fromJSON(e.sourcePosition,t),o=Ks.fromJSON(e.targetPosition,t),i=Ks.fromJSON(e.graveyardPosition,t);return new this(n,e.howMany,o,i,e.baseVersion)}}class pc extends Za{constructor(e,t,n,o){super(o),this.splitPosition=e.clone(),this.splitPosition.stickiness="toNext",this.howMany=t,this.insertionPosition=pc.getInsertionPosition(e),this.insertionPosition.stickiness="toNone",this.graveyardPosition=n?n.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();return e.push(0),new Ks(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Js(this.splitPosition,e)}clone(){const e=new this.constructor(this.splitPosition,this.howMany,this.graveyardPosition,this.baseVersion);return e.insertionPosition=this.insertionPosition,e}getReversed(){const e=this.splitPosition.root.document.graveyard,t=new Ks(e,[0]);return new fc(this.moveTargetPosition,this.howMany,this.splitPosition,t,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent,t=this.splitPosition.offset;if(!e||e.maxOffset<t)throw new Jn.b("split-operation-position-invalid: Split position is invalid.");if(!e.parent)throw new Jn.b("split-operation-split-in-root: Cannot split root element.");if(this.howMany!=e.maxOffset-this.splitPosition.offset)throw new Jn.b("split-operation-how-many-invalid: Split operation specifies wrong number of nodes to move.");if(this.graveyardPosition&&!this.graveyardPosition.nodeAfter)throw new Jn.b("split-operation-graveyard-position-invalid: Graveyard position invalid.")}_execute(){const e=this.splitPosition.parent;if(this.graveyardPosition)ec(Js._createFromPositionAndShift(this.graveyardPosition,1),this.insertionPosition);else{const t=e._clone();Ya(this.insertionPosition,t)}ec(new Js(Ks._createAt(e,this.splitPosition.offset),Ks._createAt(e,e.maxOffset)),this.moveTargetPosition)}toJSON(){const e=super.toJSON();return e.splitPosition=this.splitPosition.toJSON(),e.insertionPosition=this.insertionPosition.toJSON(),this.graveyardPosition&&(e.graveyardPosition=this.graveyardPosition.toJSON()),e}static get className(){return"SplitOperation"}static getInsertionPosition(e){const t=e.path.slice(0,-1);return t[t.length-1]++,new Ks(e.root,t)}static fromJSON(e,t){const n=Ks.fromJSON(e.splitPosition,t),o=Ks.fromJSON(e.insertionPosition,t),i=e.graveyardPosition?Ks.fromJSON(e.graveyardPosition,t):null,r=new this(n,e.howMany,i,e.baseVersion);return r.insertionPosition=o,r}}class mc extends Us{constructor(e,t,n="main"){super(t),this._doc=e,this.rootName=n}get document(){return this._doc}is(e,t){return t?"rootElement"==e&&t==this.name||super.is(e,t):"rootElement"==e||super.is(e)}toJSON(){return this.rootName}}class gc{constructor(e,t){this.model=e,this.batch=t}createText(e,t){return new qs(e,t)}createElement(e,t){return new Us(e,t)}createDocumentFragment(){return new Qa}insert(e,t,n=0){if(this._assertWriterUsedCorrectly(),e instanceof qs&&""==e.data)return;const o=Ks._createAt(t,n);if(e.parent){if(vc(e.root,o.root))return void this.move(Js._createOn(e),o);if(e.root.document)throw new Error("model-writer-insert-forbidden-move: Cannot move a node from a document to a different tree.");this.remove(e)}const i=o.root.document?o.root.document.version:null,r=new lc(o,e,i);if(e instanceof qs&&(r.shouldReceiveAttributes=!0),this.batch.addOperation(r),this.model.applyOperation(r),e instanceof Qa)for(const[t,n]of e.markers){const e=Ks._createAt(n.root,0),i=new Js(n.start._getCombined(e,o),n.end._getCombined(e,o));this.addMarker(t,{range:i,usingOperation:!0,affectsData:!0})}}insertText(e,t,n,o){t instanceof Qa||t instanceof Us||t instanceof Ks?this.insert(this.createText(e),t,n):this.insert(this.createText(e,t),n,o)}insertElement(e,t,n,o){t instanceof Qa||t instanceof Us||t instanceof Ks?this.insert(this.createElement(e),t,n):this.insert(this.createElement(e,t),n,o)}append(e,t){this.insert(e,t,"end")}appendText(e,t,n){t instanceof Qa||t instanceof Us?this.insert(this.createText(e),t,"end"):this.insert(this.createText(e,t),n,"end")}appendElement(e,t,n){t instanceof Qa||t instanceof Us?this.insert(this.createElement(e),t,"end"):this.insert(this.createElement(e,t),n,"end")}setAttribute(e,t,n){if(this._assertWriterUsedCorrectly(),n instanceof Js){const o=n.getMinimalFlatRanges();for(const n of o)bc(this,e,t,n)}else wc(this,e,t,n)}setAttributes(e,t){for(const[n,o]of Ls(e))this.setAttribute(n,o,t)}removeAttribute(e,t){if(this._assertWriterUsedCorrectly(),t instanceof Js){const n=t.getMinimalFlatRanges();for(const t of n)bc(this,e,null,t)}else wc(this,e,null,t)}clearAttributes(e){this._assertWriterUsedCorrectly();const t=e=>{for(const t of e.getAttributeKeys())this.removeAttribute(t,e)};if(e instanceof Js)for(const n of e.getItems())t(n);else t(e)}move(e,t,n){if(this._assertWriterUsedCorrectly(),!(e instanceof Js))throw new Jn.b("writer-move-invalid-range: Invalid range to move.");if(!e.isFlat)throw new Jn.b("writer-move-range-not-flat: Range to move is not flat.");const o=Ks._createAt(t,n);if(o.isEqual(e.start))return;if(this._addOperationForAffectedMarkers("move",e),!vc(e.root,o.root))throw new Jn.b("writer-move-different-document: Range is going to be moved between different documents.");const i=e.root.document?e.root.document.version:null,r=new cc(e.start,e.end.offset-e.start.offset,o,i);this.batch.addOperation(r),this.model.applyOperation(r)}remove(e){this._assertWriterUsedCorrectly();const t=(e instanceof Js?e:Js._createOn(e)).getMinimalFlatRanges().reverse();for(const e of t)this._addOperationForAffectedMarkers("move",e),kc(e.start,e.end.offset-e.start.offset,this.batch,this.model)}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore,n=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof Us))throw new Jn.b("writer-merge-no-element-before: Node before merge position must be an element.");if(!(n instanceof Us))throw new Jn.b("writer-merge-no-element-after: Node after merge position must be an element.");e.root.document?this._merge(e):this._mergeDetached(e)}createPositionFromPath(e,t,n){return this.model.createPositionFromPath(e,t,n)}createPositionAt(e,t){return this.model.createPositionAt(e,t)}createPositionAfter(e){return this.model.createPositionAfter(e)}createPositionBefore(e){return this.model.createPositionBefore(e)}createRange(e,t){return this.model.createRange(e,t)}createRangeIn(e){return this.model.createRangeIn(e)}createRangeOn(e){return this.model.createRangeOn(e)}createSelection(e,t,n){return this.model.createSelection(e,t,n)}_mergeDetached(e){const t=e.nodeBefore,n=e.nodeAfter;this.move(Js._createIn(n),Ks._createAt(t,"end")),this.remove(n)}_merge(e){const t=Ks._createAt(e.nodeBefore,"end"),n=Ks._createAt(e.nodeAfter,0),o=e.root.document.graveyard,i=new Ks(o,[0]),r=e.root.document.version,s=new fc(n,e.nodeAfter.maxOffset,t,i,r);this.batch.addOperation(s),this.model.applyOperation(s)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof Us))throw new Jn.b("writer-rename-not-element-instance: Trying to rename an object which is not an instance of Element.");const n=e.root.document?e.root.document.version:null,o=new uc(Ks._createBefore(e),e.name,t,n);this.batch.addOperation(o),this.model.applyOperation(o)}split(e,t){this._assertWriterUsedCorrectly();let n,o,i=e.parent;if(!i.parent)throw new Jn.b("writer-split-element-no-parent: Element with no parent can not be split.");if(t||(t=i.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new Jn.b("writer-split-invalid-limit-element: Limit element is not a position ancestor.");do{const t=i.root.document?i.root.document.version:null,r=i.maxOffset-e.offset,s=new pc(e,r,null,t);this.batch.addOperation(s),this.model.applyOperation(s),n||o||(n=i,o=e.parent.nextSibling),i=(e=this.createPositionAfter(e.parent)).parent}while(i!==t);return{position:e,range:new Js(Ks._createAt(n,"end"),Ks._createAt(o,0))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new Jn.b("writer-wrap-range-not-flat: Range to wrap is not flat.");const n=t instanceof Us?t:new Us(t);if(n.childCount>0)throw new Jn.b("writer-wrap-element-not-empty: Element to wrap with is not empty.");if(null!==n.parent)throw new Jn.b("writer-wrap-element-attached: Element to wrap with is already attached to tree model.");this.insert(n,e.start);const o=new Js(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(o,Ks._createAt(n,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),null===e.parent)throw new Jn.b("writer-unwrap-element-no-parent: Trying to unwrap an element which has no parent.");this.move(Js._createIn(e),this.createPositionAfter(e)),this.remove(e)}addMarker(e,t){if(this._assertWriterUsedCorrectly(),!t||"boolean"!=typeof t.usingOperation)throw new Jn.b("writer-addMarker-no-usingOperation: The options.usingOperation parameter is required when adding a new marker.");const n=t.usingOperation,o=t.range,i=void 0!==t.affectsData&&t.affectsData;if(this.model.markers.has(e))throw new Jn.b("writer-addMarker-marker-exists: Marker with provided name already exists.");if(!o)throw new Jn.b("writer-addMarker-no-range: Range parameter is required when adding a new marker.");return n?(_c(this,e,null,o,i),this.model.markers.get(e)):this.model.markers._set(e,o,n,i)}updateMarker(e,t){this._assertWriterUsedCorrectly();const n="string"==typeof e?e:e.name,o=this.model.markers.get(n);if(!o)throw new Jn.b("writer-updateMarker-marker-not-exists: Marker with provided name does not exists.");if(!t)return void this.model.markers._refresh(o);const i="boolean"==typeof t.usingOperation,r="boolean"==typeof t.affectsData,s=r?t.affectsData:o.affectsData;if(!i&&!t.range&&!r)throw new Jn.b("writer-updateMarker-wrong-options: One of the options is required - provide range, usingOperations or affectsData.");const a=o.getRange(),c=t.range?t.range:a;i&&t.usingOperation!==o.managedUsingOperations?t.usingOperation?_c(this,n,null,c,s):(_c(this,n,a,null,s),this.model.markers._set(n,c,void 0,s)):o.managedUsingOperations?_c(this,n,a,c,s):this.model.markers._set(n,c,void 0,s)}removeMarker(e){this._assertWriterUsedCorrectly();const t="string"==typeof e?e:e.name;if(!this.model.markers.has(t))throw new Jn.b("writer-removeMarker-no-marker: Trying to remove marker which does not exist.");const n=this.model.markers.get(t);n.managedUsingOperations?_c(this,t,n.getRange(),null,n.affectsData):this.model.markers._remove(t)}setSelection(e,t,n){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(e,t,n)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._setSelectionAttribute(e,t);else for(const[t,n]of Ls(e))this._setSelectionAttribute(t,n)}removeSelectionAttribute(e){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._removeSelectionAttribute(e);else for(const t of e)this._removeSelectionAttribute(t)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(e){this.model.document.selection._restoreGravity(e)}_setSelectionAttribute(e,t){const n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){const o=aa._getStoreAttributeKey(e);this.setAttribute(o,t,n.anchor.parent)}n._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const n=aa._getStoreAttributeKey(e);this.removeAttribute(n,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new Jn.b("writer-incorrect-use: Trying to use a writer outside the change() block.")}_addOperationForAffectedMarkers(e,t){for(const n of this.model.markers){if(!n.managedUsingOperations)continue;const o=n.getRange();let i=!1;if("move"==e)i=t.containsPosition(o.start)||t.start.isEqual(o.start)||t.containsPosition(o.end)||t.end.isEqual(o.end);else{const e=t.nodeBefore,n=t.nodeAfter,r=o.start.parent==e&&o.start.isAtEnd,s=o.end.parent==n&&0==o.end.offset;i=r||s}i&&this.updateMarker(n.name,{range:o})}}}function bc(e,t,n,o){const i=e.model,r=i.document;let s,a,c,l=o.start;for(const e of o.getWalker({shallow:!0}))c=e.item.getAttribute(t),s&&a!=c&&(a!=n&&d(),l=s),s=e.nextPosition,a=c;function d(){const o=new Js(l,s),c=o.root.document?r.version:null,d=new sc(o,t,a,n,c);e.batch.addOperation(d),i.applyOperation(d)}s instanceof Ks&&s!=l&&a!=n&&d()}function wc(e,t,n,o){const i=e.model,r=i.document,s=o.getAttribute(t);let a,c;if(s!=n){if(o.root===o){const e=o.document?r.version:null;c=new hc(o,t,s,n,e)}else{const i=(a=new Js(Ks._createBefore(o),e.createPositionAfter(o))).root.document?r.version:null;c=new sc(a,t,s,n,i)}e.batch.addOperation(c),i.applyOperation(c)}}function _c(e,t,n,o,i){const r=e.model,s=r.document,a=new dc(t,n,o,r.markers,i,s.version);e.batch.addOperation(a),r.applyOperation(a)}function kc(e,t,n,o){let i;if(e.root.document){const n=o.document,r=new Ks(n.graveyard,[0]);i=new cc(e,t,r,n.version)}else i=new ac(e,t);n.addOperation(i),o.applyOperation(i)}function vc(e,t){return e===t||e instanceof mc&&t instanceof mc}class yc{constructor(e){this._markerCollection=e,this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null}get isEmpty(){return 0==this._changesInElement.size&&0==this._changedMarkers.size}bufferOperation(e){switch(e.type){case"insert":if(this._isInInsertedElement(e.position.parent))return;this._markInsert(e.position.parent,e.position.offset,e.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const t of e.range.getItems())this._isInInsertedElement(t.parent)||this._markAttribute(t);break;case"remove":case"move":case"reinsert":{if(e.sourcePosition.isEqual(e.targetPosition)||e.sourcePosition.getShiftedBy(e.howMany).isEqual(e.targetPosition))return;const t=this._isInInsertedElement(e.sourcePosition.parent),n=this._isInInsertedElement(e.targetPosition.parent);t||this._markRemove(e.sourcePosition.parent,e.sourcePosition.offset,e.howMany),n||this._markInsert(e.targetPosition.parent,e.getMovedRangeStart().offset,e.howMany);break}case"rename":{if(this._isInInsertedElement(e.position.parent))return;this._markRemove(e.position.parent,e.position.offset,1),this._markInsert(e.position.parent,e.position.offset,1);const t=Js._createFromPositionAndShift(e.position,1);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getRange();this.bufferMarkerChange(e.name,t,t,e.affectsData)}break}case"split":{const t=e.splitPosition.parent;this._isInInsertedElement(t)||this._markRemove(t,e.splitPosition.offset,e.howMany),this._isInInsertedElement(e.insertionPosition.parent)||this._markInsert(e.insertionPosition.parent,e.insertionPosition.offset,1),e.graveyardPosition&&this._markRemove(e.graveyardPosition.parent,e.graveyardPosition.offset,1);break}case"merge":{const t=e.sourcePosition.parent;this._isInInsertedElement(t.parent)||this._markRemove(t.parent,t.startOffset,1);const n=e.graveyardPosition.parent;this._markInsert(n,e.graveyardPosition.offset,1);const o=e.targetPosition.parent;this._isInInsertedElement(o)||this._markInsert(o,e.targetPosition.offset,t.maxOffset);break}}this._cachedChanges=null}bufferMarkerChange(e,t,n,o){const i=this._changedMarkers.get(e);i?(i.newRange=n,i.affectsData=o,null==i.oldRange&&null==i.newRange&&this._changedMarkers.delete(e)):this._changedMarkers.set(e,{oldRange:t,newRange:n,affectsData:o})}getMarkersToRemove(){const e=[];for(const[t,n]of this._changedMarkers)null!=n.oldRange&&e.push({name:t,range:n.oldRange});return e}getMarkersToAdd(){const e=[];for(const[t,n]of this._changedMarkers)null!=n.newRange&&e.push({name:t,range:n.newRange});return e}getChangedMarkers(){return Array.from(this._changedMarkers).map(e=>({name:e[0],data:{oldRange:e[1].oldRange,newRange:e[1].newRange}}))}hasDataChanges(){for(const[,e]of this._changedMarkers)if(e.affectsData)return!0;return this._changesInElement.size>0}getChanges(e={includeChangesInGraveyard:!1}){if(this._cachedChanges)return e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();const t=[];for(const e of this._changesInElement.keys()){const n=this._changesInElement.get(e).sort((e,t)=>e.offset===t.offset?e.type!=t.type?"remove"==e.type?-1:1:0:e.offset<t.offset?-1:1),o=this._elementSnapshots.get(e),i=xc(e.getChildren()),r=Cc(o.length,n);let s=0,a=0;for(const n of r)if("i"===n)t.push(this._getInsertDiff(e,s,i[s].name)),s++;else if("r"===n)t.push(this._getRemoveDiff(e,s,o[a].name)),a++;else if("a"===n){const n=i[s].attributes,r=o[a].attributes;let c;if("$text"==i[s].name)c=new Js(Ks._createAt(e,s),Ks._createAt(e,s+1));else{const t=e.offsetToIndex(s);c=new Js(Ks._createAt(e,s),Ks._createAt(e.getChild(t),0))}t.push(...this._getAttributesDiff(c,r,n)),s++,a++}else s++,a++}t.sort((e,t)=>e.position.root!=t.position.root?e.position.root.rootName<t.position.root.rootName?-1:1:e.position.isEqual(t.position)?e.changeCount-t.changeCount:e.position.isBefore(t.position)?-1:1);for(let e=1;e<t.length;e++){const n=t[e-1],o=t[e],i="remove"==n.type&&"remove"==o.type&&"$text"==n.name&&"$text"==o.name&&n.position.isEqual(o.position),r="insert"==n.type&&"insert"==o.type&&"$text"==n.name&&"$text"==o.name&&n.position.parent==o.position.parent&&n.position.offset+n.length==o.position.offset,s="attribute"==n.type&&"attribute"==o.type&&n.position.parent==o.position.parent&&n.range.isFlat&&o.range.isFlat&&n.position.offset+n.length==o.position.offset&&n.attributeKey==o.attributeKey&&n.attributeOldValue==o.attributeOldValue&&n.attributeNewValue==o.attributeNewValue;(i||r||s)&&(t[e-1].length++,s&&(t[e-1].range.end=t[e-1].range.end.getShiftedBy(1)),t.splice(e,1),e--)}for(const e of t)delete e.changeCount,"attribute"==e.type&&(delete e.position,delete e.length);return this._changeCount=0,this._cachedChangesWithGraveyard=t.slice(),this._cachedChanges=t.slice().filter(Ac),e.includeChangesInGraveyard?this._cachedChangesWithGraveyard:this._cachedChanges}reset(){this._changesInElement.clear(),this._elementSnapshots.clear(),this._changedMarkers.clear(),this._cachedChanges=null}_markInsert(e,t,n){const o={type:"insert",offset:t,howMany:n,count:this._changeCount++};this._markChange(e,o)}_markRemove(e,t,n){const o={type:"remove",offset:t,howMany:n,count:this._changeCount++};this._markChange(e,o),this._removeAllNestedChanges(e,t,n)}_markAttribute(e){const t={type:"attribute",offset:e.startOffset,howMany:e.offsetSize,count:this._changeCount++};this._markChange(e.parent,t)}_markChange(e,t){this._makeSnapshot(e);const n=this._getChangesForElement(e);this._handleChange(t,n),n.push(t);for(let e=0;e<n.length;e++)n[e].howMany<1&&(n.splice(e,1),e--)}_getChangesForElement(e){let t;return this._changesInElement.has(e)?t=this._changesInElement.get(e):(t=[],this._changesInElement.set(e,t)),t}_makeSnapshot(e){this._elementSnapshots.has(e)||this._elementSnapshots.set(e,xc(e.getChildren()))}_handleChange(e,t){e.nodesToHandle=e.howMany;for(const n of t){const o=e.offset+e.howMany,i=n.offset+n.howMany;if("insert"==e.type&&("insert"==n.type&&(e.offset<=n.offset?n.offset+=e.howMany:e.offset<i&&(n.howMany+=e.nodesToHandle,e.nodesToHandle=0)),"remove"==n.type&&e.offset<n.offset&&(n.offset+=e.howMany),"attribute"==n.type))if(e.offset<=n.offset)n.offset+=e.howMany;else if(e.offset<i){const i=n.howMany;n.howMany=e.offset-n.offset,t.unshift({type:"attribute",offset:o,howMany:i-n.howMany,count:this._changeCount++})}if("remove"==e.type){if("insert"==n.type)if(o<=n.offset)n.offset-=e.howMany;else if(o<=i)if(e.offset<n.offset){const t=o-n.offset;n.offset=e.offset,n.howMany-=t,e.nodesToHandle-=t}else n.howMany-=e.nodesToHandle,e.nodesToHandle=0;else if(e.offset<=n.offset)e.nodesToHandle-=n.howMany,n.howMany=0;else if(e.offset<i){const t=i-e.offset;n.howMany-=t,e.nodesToHandle-=t}if("remove"==n.type&&(o<=n.offset?n.offset-=e.howMany:e.offset<n.offset&&(e.nodesToHandle+=n.howMany,n.howMany=0)),"attribute"==n.type)if(o<=n.offset)n.offset-=e.howMany;else if(e.offset<n.offset){const t=o-n.offset;n.offset=e.offset,n.howMany-=t}else if(e.offset<i)if(o<=i){const o=n.howMany;n.howMany=e.offset-n.offset;const i=o-n.howMany-e.nodesToHandle;t.unshift({type:"attribute",offset:e.offset,howMany:i,count:this._changeCount++})}else n.howMany-=i-e.offset}if("attribute"==e.type){if("insert"==n.type)if(e.offset<n.offset&&o>n.offset){if(o>i){const e={type:"attribute",offset:i,howMany:o-i,count:this._changeCount++};this._handleChange(e,t),t.push(e)}e.nodesToHandle=n.offset-e.offset,e.howMany=e.nodesToHandle}else e.offset>=n.offset&&e.offset<i&&(o>i?(e.nodesToHandle=o-i,e.offset=i):e.nodesToHandle=0);if("remove"==n.type&&e.offset<n.offset&&o>n.offset){const i={type:"attribute",offset:n.offset,howMany:o-n.offset,count:this._changeCount++};this._handleChange(i,t),t.push(i),e.nodesToHandle=n.offset-e.offset,e.howMany=e.nodesToHandle}"attribute"==n.type&&(e.offset>=n.offset&&o<=i?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=n.offset&&o>=i&&(n.howMany=0))}}e.howMany=e.nodesToHandle,delete e.nodesToHandle}_getInsertDiff(e,t,n){return{type:"insert",position:Ks._createAt(e,t),name:n,length:1,changeCount:this._changeCount++}}_getRemoveDiff(e,t,n){return{type:"remove",position:Ks._createAt(e,t),name:n,length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,n){const o=[];n=new Map(n);for(const[i,r]of t){const t=n.has(i)?n.get(i):null;t!==r&&o.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:i,attributeOldValue:r,attributeNewValue:t,changeCount:this._changeCount++}),n.delete(i)}for(const[t,i]of n)o.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:t,attributeOldValue:null,attributeNewValue:i,changeCount:this._changeCount++});return o}_isInInsertedElement(e){const t=e.parent;if(!t)return!1;const n=this._changesInElement.get(t),o=e.startOffset;if(n)for(const e of n)if("insert"==e.type&&o>=e.offset&&o<e.offset+e.howMany)return!0;return this._isInInsertedElement(t)}_removeAllNestedChanges(e,t,n){const o=new Js(Ks._createAt(e,t),Ks._createAt(e,t+n));for(const e of o.getItems({shallow:!0}))e.is("element")&&(this._elementSnapshots.delete(e),this._changesInElement.delete(e),this._removeAllNestedChanges(e,0,e.maxOffset))}}function xc(e){const t=[];for(const n of e)if(n.is("text"))for(let e=0;e<n.data.length;e++)t.push({name:"$text",attributes:new Map(n.getAttributes())});else t.push({name:n.name,attributes:new Map(n.getAttributes())});return t}function Cc(e,t){const n=[];let o=0,i=0;for(const e of t)e.offset>o&&(n.push(..."e".repeat(e.offset-o).split("")),i+=e.offset-o),"insert"==e.type?(n.push(..."i".repeat(e.howMany).split("")),o=e.offset+e.howMany):"remove"==e.type?(n.push(..."r".repeat(e.howMany).split("")),o=e.offset,i+=e.howMany):(n.push(..."a".repeat(e.howMany).split("")),o=e.offset+e.howMany,i+=e.howMany);return i<e&&n.push(..."e".repeat(e-i).split("")),n}function Ac(e){const t=e.position&&"$graveyard"==e.position.root.rootName,n=e.range&&"$graveyard"==e.range.root.rootName;return!t&&!n}class Pc{constructor(){this._operations=[],this._undoPairs=new Map,this._undoneOperations=new Set}addOperation(e){this._operations.includes(e)||this._operations.push(e)}getOperations(e=0,t=Number.POSITIVE_INFINITY){return e<0?[]:this._operations.slice(e,t)}getOperation(e){return this._operations[e]}setOperationAsUndone(e,t){this._undoPairs.set(t,e),this._undoneOperations.add(e)}isUndoingOperation(e){return this._undoPairs.has(e)}isUndoneOperation(e){return this._undoneOperations.has(e)}getUndoneOperation(e){return this._undoPairs.get(e)}}function Ec(e,t){return function(e){return!!e&&1==e.length&&/[\ud800-\udbff]/.test(e)}(e.charAt(t-1))&&function(e){return!!e&&1==e.length&&/[\udc00-\udfff]/.test(e)}(e.charAt(t))}function Tc(e,t){return function(e){return!!e&&1==e.length&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(e)}(e.charAt(t))}const Sc="$graveyard";class Rc{constructor(e){this.model=e,this.version=0,this.history=new Pc(this),this.selection=new aa(this),this.roots=new si({idProperty:"rootName"}),this.differ=new yc(e.markers),this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root",Sc),this.listenTo(e,"applyOperation",(e,t)=>{const n=t[0];if(n.isDocumentOperation&&n.baseVersion!==this.version)throw new Jn.b("model-document-applyOperation-wrong-version: Only operations with matching versions can be applied.",{operation:n})},{priority:"highest"}),this.listenTo(e,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&this.differ.bufferOperation(n)},{priority:"high"}),this.listenTo(e,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&(this.version++,this.history.addOperation(n))},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(e.markers,"update",(e,t,n,o)=>{this.differ.bufferMarkerChange(t.name,n,o,t.affectsData),null===n&&t.on("change",(e,n)=>{this.differ.bufferMarkerChange(t.name,n,t.getRange(),t.affectsData)})})}get graveyard(){return this.getRoot(Sc)}createRoot(e="$root",t="main"){if(this.roots.get(t))throw new Jn.b("model-document-createRoot-name-exists: Root with specified name already exists.",{name:t});const n=new mc(this,e,t);return this.roots.add(n),n}destroy(){this.selection.destroy(),this.stopListening()}getRoot(e="main"){return this.roots.get(e)}getRootNames(){return Array.from(this.roots,e=>e.rootName).filter(e=>e!=Sc)}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=fo(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}_handleChangeBlock(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const e of this.roots)if(e!==this.graveyard)return e;return this.graveyard}_getDefaultRange(){const e=this._getDefaultRoot(),t=this.model,n=t.schema,o=t.createPositionFromPath(e,[0]);return n.getNearestSelectionRange(o)||t.createRange(o)}_validateSelectionRange(e){return Oc(e.start)&&Oc(e.end)}_callPostFixers(e){let t=!1;do{for(const n of this._postFixers)if(t=n(e))break}while(t)}}function Oc(e){const t=e.textNode;if(t){const n=t.data,o=e.offset-t.startOffset;return!Ec(n,o)&&!Tc(n,o)}return!0}lo(Rc,no);class Ic{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(e){return this._markers.has(e)}get(e){return this._markers.get(e)||null}_set(e,t,n=!1,o=!1){const i=e instanceof Dc?e.name:e,r=this._markers.get(i);if(r){const e=r.getRange();let s=!1;return e.isEqual(t)||(r._attachLiveRange(ra.fromRange(t)),s=!0),n!=r.managedUsingOperations&&(r._managedUsingOperations=n,s=!0),"boolean"==typeof o&&o!=r.affectsData&&(r._affectsData=o,s=!0),s&&this.fire("update:"+i,r,e,t),r}const s=ra.fromRange(t),a=new Dc(i,s,n,o);return this._markers.set(i,a),this.fire("update:"+i,a,null,t),a}_remove(e){const t=e instanceof Dc?e.name:e,n=this._markers.get(t);return!!n&&(this._markers.delete(t),this.fire("update:"+t,n,n.getRange(),null),this._destroyMarker(n),!0)}_refresh(e){const t=e instanceof Dc?e.name:e,n=this._markers.get(t);if(!n)throw new Jn.b("markercollection-refresh-marker-not-exists: Marker with provided name does not exists.");const o=n.getRange();this.fire("update:"+t,n,o,o,n.managedUsingOperations,n.affectsData)}*getMarkersAtPosition(e){for(const t of this)t.getRange().containsPosition(e)&&(yield t)}*getMarkersIntersectingRange(e){for(const t of this)null!==t.getRange().getIntersection(e)&&(yield t)}destroy(){for(const e of this._markers.values())this._destroyMarker(e);this._markers=null,this.stopListening()}*getMarkersGroup(e){for(const t of this._markers.values())t.name.startsWith(e+":")&&(yield t)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}}lo(Ic,no);class Dc{constructor(e,t,n,o){this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=n,this._affectsData=o}get managedUsingOperations(){if(!this._liveRange)throw new Jn.b("marker-destroyed: Cannot use a destroyed marker instance.");return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new Jn.b("marker-destroyed: Cannot use a destroyed marker instance.");return this._affectsData}getStart(){if(!this._liveRange)throw new Jn.b("marker-destroyed: Cannot use a destroyed marker instance.");return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new Jn.b("marker-destroyed: Cannot use a destroyed marker instance.");return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new Jn.b("marker-destroyed: Cannot use a destroyed marker instance.");return this._liveRange.toRange()}_attachLiveRange(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e,e}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}lo(Dc,no);class Mc extends Ks{constructor(e,t,n="toNone"){if(super(e,t,n),!this.root.is("rootElement"))throw new Jn.b("model-liveposition-root-not-rootelement: LivePosition's root has to be an instance of RootElement.");(function(){this.listenTo(this.root.document.model,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&function(e){const t=this.getTransformedByOperation(e);if(!this.isEqual(t)){const e=this.toPosition();this.path=t.path,this.root=t.root,this.fire("change",e)}}.call(this,n)},{priority:"low"})}).call(this)}detach(){this.stopListening()}toPosition(){return new Ks(this.root,this.path.slice(),this.stickiness)}static fromPosition(e,t){return new this(e.root,e.path.slice(),t||e.stickiness)}}lo(Mc,no);class Nc{constructor(e,t,n){this.model=e,this.writer=t,this.position=n,this.canMergeWith=new Set([this.position.parent]),this.schema=e.schema,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null}handleNodes(e,t){e=Array.from(e);for(let n=0;n<e.length;n++){const o=e[n];this._handleNode(o,{isFirst:0===n&&t.isFirst,isLast:n===e.length-1&&t.isLast})}this.schema.removeDisallowedAttributes(this._filterAttributesOf,this.writer),this._filterAttributesOf=[]}getSelectionRange(){return this.nodeToSelect?Js._createOn(this.nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new Js(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(e,t){if(this.schema.isObject(e))return void this._handleObject(e,t);this._checkAndSplitToAllowedPosition(e,t)?(this._insert(e),this._mergeSiblingsOf(e,t)):this._handleDisallowedNode(e,t)}_handleObject(e,t){this._checkAndSplitToAllowedPosition(e)?this._insert(e):this._tryAutoparagraphing(e,t)}_handleDisallowedNode(e,t){e.is("element")?this.handleNodes(e.getChildren(),t):this._tryAutoparagraphing(e,t)}_insert(e){if(!this.schema.checkChild(this.position,e))return void ws.a.error("insertcontent-wrong-position: The node cannot be inserted on the given position.",{node:e,position:this.position});const t=Mc.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this.writer.insert(e,this.position),this.position=t.toPosition(),t.detach(),this.schema.isObject(e)&&!this.schema.checkChild(this.position,"$text")?this.nodeToSelect=e:this.nodeToSelect=null,this._filterAttributesOf.push(e)}_setAffectedBoundaries(e){this._affectedStart||(this._affectedStart=Mc.fromPosition(e,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(e)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=Mc.fromPosition(e,"toNext"))}_mergeSiblingsOf(e,t){if(!(e instanceof Us))return;const n=this._canMergeLeft(e,t),o=this._canMergeRight(e,t),i=Mc._createBefore(e);i.stickiness="toNext";const r=Mc._createAfter(e);if(r.stickiness="toNext",n){const e=Mc.fromPosition(this.position);e.stickiness="toNext",this._affectedStart.isEqual(i)&&(this._affectedStart.detach(),this._affectedStart=Mc._createAt(i.nodeBefore,"end","toPrevious")),this.writer.merge(i),i.isEqual(this._affectedEnd)&&t.isLast&&(this._affectedEnd.detach(),this._affectedEnd=Mc._createAt(i.nodeBefore,"end","toNext")),this.position=e.toPosition(),e.detach()}if(o){this.position.isEqual(r)||ws.a.error("insertcontent-wrong-position-on-merge: The insertion position should equal the merge position"),this.position=Ks._createAt(r.nodeBefore,"end");const e=Mc.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(r)&&(this._affectedEnd.detach(),this._affectedEnd=Mc._createAt(r.nodeBefore,"end","toNext")),this.writer.merge(r),r.getShiftedBy(-1).isEqual(this._affectedStart)&&t.isFirst&&(this._affectedStart.detach(),this._affectedStart=Mc._createAt(r.nodeBefore,0,"toPrevious")),this.position=e.toPosition(),e.detach()}(n||o)&&this._filterAttributesOf.push(this.position.parent),i.detach(),r.detach()}_canMergeLeft(e,t){const n=e.previousSibling;return t.isFirst&&n instanceof Us&&this.canMergeWith.has(n)&&this.model.schema.checkMerge(n,e)}_canMergeRight(e,t){const n=e.nextSibling;return t.isLast&&n instanceof Us&&this.canMergeWith.has(n)&&this.model.schema.checkMerge(e,n)}_tryAutoparagraphing(e,t){const n=this.writer.createElement("paragraph");this._getAllowedIn(n,this.position.parent)&&this.schema.checkChild(n,e)&&(n._appendChild(e),this._handleNode(n,t))}_checkAndSplitToAllowedPosition(e){const t=this._getAllowedIn(e,this.position.parent);if(!t)return!1;for(;t!=this.position.parent;){if(this.schema.isLimit(this.position.parent))return!1;if(this.position.isAtStart){const e=this.position.parent;this.position=this.writer.createPositionBefore(e),e.isEmpty&&this.writer.remove(e)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const e=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=e,this.canMergeWith.add(this.position.nodeAfter)}}return!0}_getAllowedIn(e,t){return this.schema.checkChild(t,e)?t:t.parent?this._getAllowedIn(e,t.parent):null}}function Fc(e,t,n={}){if(t.isCollapsed)return;const o=t.getFirstRange();if("$graveyard"==o.root.rootName)return;const i=e.schema;e.change(e=>{if(!n.doNotResetEntireContent&&function(e,t){const n=e.getLimitElement(t);if(!t.containsEntireContent(n))return!1;const o=t.getFirstRange();if(o.start.parent==o.end.parent)return!1;return e.checkChild(n,"paragraph")}(i,t))return void function(e,t){const n=e.model.schema.getLimitElement(t);e.remove(e.createRangeIn(n)),Bc(e,e.createPositionAt(n,0),t)}(e,t);const r=o.start,s=Mc.fromPosition(o.end,"toNext");if(o.start.isTouching(o.end)||e.remove(o),n.leaveUnmerged||(!function e(t,n,o){const i=n.parent;const r=o.parent;if(i==r)return;if(t.model.schema.isLimit(i)||t.model.schema.isLimit(r))return;if(!function(e,t,n){const o=new Js(e,t);for(const e of o.getWalker())if(n.isLimit(e.item))return!1;return!0}(n,o,t.model.schema))return;n=t.createPositionAfter(i);o=t.createPositionBefore(r);o.isEqual(n)||t.insert(r,n);t.merge(n);for(;o.parent.isEmpty;){const e=o.parent;o=t.createPositionBefore(e),t.remove(e)}e(t,n,o)}(e,r,s),i.removeDisallowedAttributes(r.parent.getChildren(),e)),Vc(e,t,r),function(e,t){const n=e.checkChild(t,"$text"),o=e.checkChild(t,"paragraph");return!n&&o}(i,r)){const o=i.getNearestSelectionRange(r);n.doNotAutoparagraph&&o?Vc(e,t,o):Bc(e,r,t)}s.detach()})}function Bc(e,t,n){const o=e.createElement("paragraph");e.insert(o,t),Vc(e,n,e.createPositionAt(o,0))}function Vc(e,t,n){t instanceof aa?e.setSelection(n):t.setTo(n)}const Lc=' ,.?!:;"-()';function zc(e,t,n={}){const o=e.schema,i="backward"!=n.direction,r=n.unit?n.unit:"character",s=t.focus,a=new Ws({boundaries:function(e,t){const n=e.root,o=Ks._createAt(n,t?"end":0);return t?new Js(e,o):new Js(o,e)}(s,i),singleCharacters:!0,direction:i?"forward":"backward"}),c={walker:a,schema:o,isForward:i,unit:r};let l;for(;l=a.next();){if(l.done)return;const n=qc(c,l.value);if(n)return void(t instanceof aa?e.change(e=>{e.setSelectionFocus(n)}):t.setFocus(n))}}function qc(e,t){if("text"==t.type)return"word"===e.unit?function(e,t){let n=e.position.textNode;if(n){let o=e.position.offset-n.startOffset;for(;!jc(n.data,o,t)&&!Hc(n,o,t);){e.next();const i=t?e.position.nodeAfter:e.position.nodeBefore;if(i&&i.is("text")){const o=i.data.charAt(t?0:i.data.length-1);Lc.includes(o)||(e.next(),n=e.position.textNode)}o=e.position.offset-n.startOffset}}return e.position}(e.walker,e.isForward):function(e,t){const n=e.position.textNode;if(n){const o=n.data;let i=e.position.offset-n.startOffset;for(;Ec(o,i)||"character"==t&&Tc(o,i);)e.next(),i=e.position.offset-n.startOffset}return e.position}(e.walker,e.unit,e.isForward);if(t.type==(e.isForward?"elementStart":"elementEnd")){if(e.schema.isObject(t.item))return Ks._createAt(t.item,e.isForward?"after":"before");if(e.schema.checkChild(t.nextPosition,"$text"))return t.nextPosition}else{if(e.schema.isLimit(t.item))return void e.walker.skip(()=>!0);if(e.schema.checkChild(t.nextPosition,"$text"))return t.nextPosition}}function jc(e,t,n){const o=t+(n?0:-1);return Lc.includes(e.charAt(o))}function Hc(e,t,n){return t===(n?e.endOffset:0)}function Uc(e,t){const n=[];Array.from(e.getItems({direction:"backward"})).map(e=>t.createRangeOn(e)).filter(t=>{return(t.start.isAfter(e.start)||t.start.isEqual(e.start))&&(t.end.isBefore(e.end)||t.end.isEqual(e.end))}).forEach(e=>{n.push(e.start.parent),t.remove(e)}),n.forEach(e=>{let n=e;for(;n.parent&&n.isEmpty;){const e=t.createRangeOn(n);n=n.parent,t.remove(e)}})}function Wc(e){e.document.registerPostFixer(t=>(function(e,t){const n=t.document.selection,o=t.schema,i=[];let r=!1;for(const e of n.getRanges()){const t=$c(e,o);t?(i.push(t),r=!0):i.push(e)}if(r){let t=i;if(i.length>1){const e=i[0].start,n=i[i.length-1].end;t=[new Js(e,n)]}e.setSelection(t,{backward:n.isBackward})}})(t,e))}function $c(e,t){return e.isCollapsed?function(e,t){const n=e.start,o=t.getNearestSelectionRange(n);if(!o)return null;const i=o.start;if(n.isEqual(i))return null;if(i.nodeAfter&&t.isLimit(i.nodeAfter))return new Js(i,Ks._createAfter(i.nodeAfter));return new Js(i)}(e,t):function(e,t){const n=e.start,o=e.end,i=t.checkChild(n,"$text"),r=t.checkChild(o,"$text"),s=t.getLimitElement(n),a=t.getLimitElement(o);if(s===a){if(i&&r)return null;if(function(e,t,n){const o=e.nodeAfter&&!n.isLimit(e.nodeAfter)||n.checkChild(e,"$text"),i=t.nodeBefore&&!n.isLimit(t.nodeBefore)||n.checkChild(t,"$text");return o||i}(n,o,t)){const e=n.nodeAfter&&t.isObject(n.nodeAfter),i=e?null:t.getNearestSelectionRange(n,"forward"),r=o.nodeBefore&&t.isObject(o.nodeBefore),s=r?null:t.getNearestSelectionRange(o,"backward"),a=i?i.start:n,c=s?s.start:o;return new Js(a,c)}}const c=s&&!s.is("rootElement"),l=a&&!a.is("rootElement");if(c||l){const e=n.nodeAfter&&o.nodeBefore&&n.nodeAfter.parent===o.nodeBefore.parent,i=c&&(!e||!Kc(n.nodeAfter,t)),r=l&&(!e||!Kc(o.nodeBefore,t));let d=n,u=o;return i&&(d=Ks._createBefore(Gc(s,t))),r&&(u=Ks._createAfter(Gc(a,t))),new Js(d,u)}return null}(e,t)}function Gc(e,t){let n=e,o=n;for(;t.isLimit(o)&&o.parent;)n=o,o=o.parent;return n}function Kc(e,t){return e&&t.isObject(e)}class Jc{constructor(){this.markers=new Ic,this.document=new Rc(this),this.schema=new Ia,this._pendingChanges=[],this._currentWriter=null,["insertContent","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(e=>this.decorate(e)),this.on("applyOperation",(e,t)=>{t[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$block",{allowIn:"$root",isBlock:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",isLimit:!0}),this.schema.extend("$text",{allowIn:"$clipboardHolder"}),this.schema.register("$marker"),this.schema.addChildCheck((e,t)=>{if("$marker"===t.name)return!0}),Wc(this)}change(e){return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new Ja,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}enqueueChange(e,t){"string"==typeof e?e=new Ja(e):"function"==typeof e&&(t=e,e=new Ja),this._pendingChanges.push({batch:e,callback:t}),1==this._pendingChanges.length&&this._runPendingChanges()}applyOperation(e){e._execute()}insertContent(e,t,n){return function(e,t,n,o){return e.change(i=>{let r;const s=(r=n?n instanceof ta||n instanceof aa?n:i.createSelection(n,o):e.document.selection).getFirstPosition();r.isCollapsed||e.deleteContent(r,{doNotAutoparagraph:!0});const a=new Nc(e,i,s);let c;c=t.is("documentFragment")?t.getChildren():[t],a.handleNodes(c,{isFirst:!0,isLast:!0});const l=a.getSelectionRange();l?r instanceof aa?i.setSelection(l):r.setTo(l):ws.a.warn("insertcontent-no-range: Cannot determine a proper selection range after insertion.");const d=a.getAffectedRange()||e.createRange(s);return a.destroy(),d})}(this,e,t,n)}deleteContent(e,t){Fc(this,e,t)}modifySelection(e,t){zc(this,e,t)}getSelectedContent(e){return function(e,t){return e.change(e=>{const n=e.createDocumentFragment(),o=t.getFirstRange();if(!o||o.isCollapsed)return n;const i=o.start.root,r=o.start.getCommonPath(o.end),s=i.getNodeByPath(r);let a;const c=(a=o.start.parent==o.end.parent?o:e.createRange(e.createPositionAt(s,o.start.path[r.length]),e.createPositionAt(s,o.end.path[r.length]+1))).end.offset-a.start.offset;for(const t of a.getItems({shallow:!0}))t.is("textProxy")?e.appendText(t.data,t.getAttributes(),n):e.append(t._clone(!0),n);if(a!=o){const t=o._getTransformedByMove(a.start,e.createPositionAt(n,0),c)[0],i=e.createRange(e.createPositionAt(n,0),t.start);Uc(e.createRange(t.end,e.createPositionAt(n,"end")),e),Uc(i,e)}return n})}(this,e)}hasContent(e,t){const n=e instanceof Us?Js._createIn(e):e;if(n.isCollapsed)return!1;for(const e of this.markers.getMarkersIntersectingRange(n))if(e.affectsData)return!0;const{ignoreWhitespaces:o=!1}=t||{};for(const e of n.getItems())if(e.is("textProxy")){if(!o)return!0;if(-1!==e.data.search(/\S/))return!0}else if(this.schema.isObject(e))return!0;return!1}createPositionFromPath(e,t,n){return new Ks(e,t,n)}createPositionAt(e,t){return Ks._createAt(e,t)}createPositionAfter(e){return Ks._createAfter(e)}createPositionBefore(e){return Ks._createBefore(e)}createRange(e,t){return new Js(e,t)}createRangeIn(e){return Js._createIn(e)}createRangeOn(e){return Js._createOn(e)}createSelection(e,t,n){return new ta(e,t,n)}createBatch(){return new Ja}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const e=[];for(this.fire("_beforeChanges");this._pendingChanges.length;){const t=this._pendingChanges[0].batch;this._currentWriter=new gc(this,t);const n=this._pendingChanges[0].callback(this._currentWriter);e.push(n),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return this.fire("_afterChanges"),e}}lo(Jc,Ho);class Zc{constructor(){this._listener=Object.create(dr)}listenTo(e){this._listener.listenTo(e,"keydown",(e,t)=>{this._listener.fire("_keydown:"+_i(t),t)})}set(e,t,n={}){const o=ki(e),i=n.priority;this._listener.listenTo(this._listener,"_keydown:"+o,(e,n)=>{t(n,()=>{n.preventDefault(),n.stopPropagation(),e.stop()}),e.return=!0},{priority:i})}press(e){return!!this._listener.fire("_keydown:"+_i(e),e)}destroy(){this._listener.stopListening()}}class Qc extends Zc{constructor(e){super(),this.editor=e}set(e,t,n={}){if("string"==typeof t){const e=t;t=((t,n)=>{this.editor.execute(e),n()})}super.set(e,t,n)}}class Yc{constructor(e){const t=this.constructor.builtinPlugins;this.config=new Gn(e,this.constructor.defaultConfig),this.config.define("plugins",t),this.plugins=new Pa(this,t),this.commands=new Ea,this.locale=new Sa(this.config.get("language")),this.t=this.locale.t,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.set("isReadOnly",!1),this.model=new Jc,this.data=new Wa(this.model),this.editing=new Aa(this.model),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new $a([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new Qc(this),this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const e=this.config,t=e.get("plugins")||[],n=e.get("removePlugins")||[],o=e.get("extraPlugins")||[];return this.plugins.init(t.concat(o),n)}destroy(){let e=Promise.resolve();return"initializing"==this.state&&(e=new Promise(e=>this.once("ready",e))),e.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()})}execute(...e){this.commands.execute(...e)}}lo(Yc,Ho);var Xc={setData(e){this.data.set(e)},getData(e){return this.data.get(e)}};var el={updateSourceElement(){if(!this.sourceElement)throw new Jn.b("editor-missing-sourceelement: Cannot update the source element of a detached editor.");!function(e,t){e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=t}(this.sourceElement,this.data.get())}};class tl{getHtml(e){const t=document.implementation.createHTMLDocument("").createElement("div");return t.appendChild(e),t.innerHTML}}class nl{constructor(){this._domParser=new DOMParser,this._domConverter=new sr({blockFiller:Vi}),this._htmlWriter=new tl}toData(e){const t=this._domConverter.viewToDom(e,document);return this._htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this._domConverter.domToView(t)}_toDom(e){const t=this._domParser.parseFromString(e,"text/html"),n=t.createDocumentFragment(),o=t.body.childNodes;for(;o.length>0;)n.appendChild(o[0]);return n}}class ol{constructor(e){this.editor=e,this._components=new Map}*names(){for(const e of this._components.values())yield e.originalName}add(e,t){if(this.has(e))throw new Jn.b("componentfactory-item-exists: The item already exists in the component factory.",{name:e});this._components.set(il(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new Jn.b("componentfactory-item-missing: The required component is not registered in the factory.",{name:e});return this._components.get(il(e)).callback(this.editor.locale)}has(e){return this._components.has(il(e))}}function il(e){return String(e).toLowerCase()}class rl{constructor(){this.set("isFocused",!1),this.set("focusedElement",null),this._elements=new Set,this._nextEventLoopTimeout=null}add(e){if(this._elements.has(e))throw new Jn.b("focusTracker-add-element-already-exist");this.listenTo(e,"focus",()=>this._focus(e),{useCapture:!0}),this.listenTo(e,"blur",()=>this._blur(),{useCapture:!0}),this._elements.add(e)}remove(e){e===this.focusedElement&&this._blur(e),this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e))}destroy(){this.stopListening()}_focus(e){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=e,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}lo(rl,dr),lo(rl,Ho);class sl{constructor(e){this.editor=e,this.componentFactory=new ol(e),this.focusTracker=new rl,this._editableElements=new Map,this.listenTo(e.editing.view.document,"layoutChanged",()=>this.update())}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy(),this._editableElements=new Map}getEditableElement(e="main"){return this._editableElements.get(e)}getEditableElementsNames(){return this._editableElements.keys()}}lo(sl,no);n(63);const al=new WeakMap;function cl(e){const{view:t,element:n,text:o,isDirectHost:i=!0}=e,r=t.document;al.has(r)||(al.set(r,new Map),r.registerPostFixer(e=>dl(r,e))),al.get(r).set(n,{text:o,isDirectHost:i}),t.change(e=>dl(r,e))}function ll(e,t){return!!t.hasClass("ck-placeholder")&&(e.removeClass("ck-placeholder",t),!0)}function dl(e,t){const n=al.get(e);let o=!1;for(const[e,i]of n)ul(t,e,i)&&(o=!0);return o}function ul(e,t,n){const{text:o,isDirectHost:i}=n,r=i?t:function(e){if(1===e.childCount){const t=e.getChild(0);if(t.is("element")&&!t.is("uiElement"))return t}return null}(t);let s=!1;return!!r&&(n.hostElement=r,r.getAttribute("data-placeholder")!==o&&(e.setAttribute("data-placeholder",o,r),s=!0),!function(e){const t=e.document;if(!t)return!1;const n=!Array.from(e.getChildren()).some(e=>!e.is("uiElement"));if(!t.isFocused&&n)return!0;const o=t.selection.anchor;return!(!n||!o||o.parent===e)}(r)?ll(e,r)&&(s=!0):function(e,t){return!t.hasClass("ck-placeholder")&&(e.addClass("ck-placeholder",t),!0)}(e,r)&&(s=!0),s)}class hl{constructor(){this._replacedElements=[]}replace(e,t){this._replacedElements.push({element:e,newElement:t}),e.style.display="none",t&&e.parentNode.insertBefore(t,e.nextSibling)}restore(){this._replacedElements.forEach(({element:e,newElement:t})=>{e.style.display="",t&&t.remove()}),this._replacedElements=[]}}class fl extends sl{constructor(e,t){super(e),this.view=t,this._toolbarConfig=function(e){return Array.isArray(e)?{items:e}:e?Object.assign({items:[]},e):{items:[]}}(e.config.get("toolbar")),this._elementReplacer=new hl}get element(){return this.view.element}init(e){const t=this.editor,n=this.view,o=t.editing.view,i=n.editable,r=o.document.getRoot();i.name=r.rootName,n.render();const s=i.element;this._editableElements.set(i.name,s),this.focusTracker.add(s),n.editable.bind("isFocused").to(this.focusTracker),o.attachDomRoot(s),e&&this._elementReplacer.replace(e,this.element),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const e=this.view,t=this.editor.editing.view;this._elementReplacer.restore(),t.detachDomRoot(e.editable.name),e.destroy(),super.destroy()}_initToolbar(){const e=this.editor,t=this.view,n=e.editing.view;t.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),t.stickyPanel.limiterElement=t.element,this._toolbarConfig.viewportTopOffset&&(t.stickyPanel.viewportTopOffset=this._toolbarConfig.viewportTopOffset),t.toolbar.fillFromConfig(this._toolbarConfig.items,this.componentFactory),function({origin:e,originKeystrokeHandler:t,originFocusTracker:n,toolbar:o,beforeFocus:i,afterBlur:r}){n.add(o.element),t.set("Alt+F10",(e,t)=>{n.isFocused&&!o.focusTracker.isFocused&&(i&&i(),o.focus(),t())}),o.keystrokes.set("Esc",(t,n)=>{o.focusTracker.isFocused&&(e.focus(),r&&r(),n())})}({origin:n,originFocusTracker:this.focusTracker,originKeystrokeHandler:e.keystrokes,toolbar:t.toolbar})}_initPlaceholder(){const e=this.editor,t=e.editing.view,n=t.document.getRoot(),o=e.sourceElement,i=e.config.get("placeholder")||o&&"textarea"===o.tagName.toLowerCase()&&o.getAttribute("placeholder");i&&cl({view:t,element:n,text:i,isDirectHost:!1})}}class pl extends si{constructor(e){super({idProperty:"viewUid"}),this.on("add",(e,t,n)=>{t.isRendered||t.render(),t.element&&this._parentElement&&this._parentElement.insertBefore(t.element,this._parentElement.children[n])}),this.on("remove",(e,t)=>{t.element&&this._parentElement&&t.element.remove()}),this.locale=e,this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e}delegate(...e){if(!e.length||!function(e){return e.every(e=>"string"==typeof e)}(e))throw new Jn.b("ui-viewcollection-delegate-wrong-events: All event names must be strings.");return{to:t=>{for(const n of this)for(const o of e)n.delegate(o).to(t);this.on("add",(n,o)=>{for(const n of e)o.delegate(n).to(t)}),this.on("remove",(n,o)=>{for(const n of e)o.stopDelegating(n,t)})}}}}lo(si,Ho);const ml="http://www.w3.org/1999/xhtml";class gl{constructor(e){Object.assign(this,Al(Cl(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:e,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new Jn.b("ui-template-revert-not-applied: Attempting to revert a template which has not been applied yet.");this._revertTemplateFromNode(e,this._revertData)}*getViews(){yield*function*e(t){if(t.children)for(const n of t.children)Rl(n)?yield n:Ol(n)&&(yield*e(n))}(this)}static bind(e,t){return{to:(n,o)=>new wl({eventNameOrFunction:n,attribute:n,observable:e,emitter:t,callback:o}),if:(n,o,i)=>new _l({observable:e,emitter:t,attribute:n,valueIfTrue:o,callback:i})}}static extend(e,t){e._isRendered&&ws.a.warn("template-extend-render: Attempting to extend a template which has already been rendered."),function e(t,n){n.attributes&&(t.attributes||(t.attributes={}),Tl(t.attributes,n.attributes));n.eventListeners&&(t.eventListeners||(t.eventListeners={}),Tl(t.eventListeners,n.eventListeners));n.text&&t.text.push(...n.text);if(n.children&&n.children.length){if(t.children.length!=n.children.length)throw new Jn.b("ui-template-extend-children-mismatch: The number of children in extended definition does not match.");let o=0;for(const i of n.children)e(t.children[o++],i)}}(e,Al(Cl(t)))}_renderNode(e){let t;if(t=e.node?this.tag&&this.text:this.tag?this.text:!this.text)throw new Jn.b('ui-template-wrong-syntax: Node definition must have either "tag" or "text" when rendering a new Node.');return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||ml,this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),kl(this.text)?this._bindToObservable({schema:this.text,updater:function(e){return{set(t){e.textContent=t},remove(){e.textContent=""}}}(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){let t,n,o,i;if(!this.attributes)return;const r=e.node,s=e.revertData;for(t in this.attributes)if(o=r.getAttribute(t),n=this.attributes[t],s&&(s.attributes[t]=o),i=q(n[0])&&n[0].ns?n[0].ns:null,kl(n)){const a=i?n[0].value:n;s&&Dl(t)&&a.unshift(o),this._bindToObservable({schema:a,updater:yl(r,t,i),data:e})}else"style"==t&&"string"!=typeof n[0]?this._renderStyleAttribute(n[0],e):(s&&o&&Dl(t)&&n.unshift(o),Sl(n=n.map(e=>e&&e.value||e).reduce((e,t)=>e.concat(t),[]).reduce(El,""))||r.setAttributeNS(i,t,n))}_renderStyleAttribute(e,t){const n=t.node;for(const o in e){const i=e[o];kl(i)?this._bindToObservable({schema:[i],updater:xl(n,o),data:t}):n.style[o]=i}}_renderElementChildren(e){const t=e.node,n=e.intoFragment?document.createDocumentFragment():t,o=e.isApplying;let i=0;for(const r of this.children)if(Il(r)){if(!o){r.setParent(t);for(const e of r)n.appendChild(e.element)}}else if(Rl(r))o||(r.isRendered||r.render(),n.appendChild(r.element));else if(Xi(r))n.appendChild(r);else if(o){const t={children:[],bindings:[],attributes:{}};e.revertData.children.push(t),r._renderNode({node:n.childNodes[i++],isApplying:!0,revertData:t})}else n.appendChild(r.render());e.intoFragment&&t.appendChild(n)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const n=this.eventListeners[t].map(n=>{const[o,i]=t.split("@");return n.activateDomEventListener(o,i,e)});e.revertData&&e.revertData.bindings.push(n)}}_bindToObservable({schema:e,updater:t,data:n}){const o=n.revertData;vl(e,t,n);const i=e.filter(e=>!Sl(e)).filter(e=>e.observable).map(o=>o.activateAttributeListener(e,t,n));o&&o.bindings.push(i)}_revertTemplateFromNode(e,t){for(const e of t.bindings)for(const t of e)t();if(t.text)e.textContent=t.text;else{for(const n in t.attributes){const o=t.attributes[n];null===o?e.removeAttribute(n):e.setAttribute(n,o)}for(let n=0;n<t.children.length;++n)this._revertTemplateFromNode(e.childNodes[n],t.children[n])}}}lo(gl,no);class bl{constructor(e){Object.assign(this,e)}getValue(e){const t=this.observable[this.attribute];return this.callback?this.callback(t,e):t}activateAttributeListener(e,t,n){const o=()=>vl(e,t,n);return this.emitter.listenTo(this.observable,"change:"+this.attribute,o),()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,o)}}}class wl extends bl{activateDomEventListener(e,t,n){const o=(e,n)=>{t&&!n.target.matches(t)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(n):this.observable.fire(this.eventNameOrFunction,n))};return this.emitter.listenTo(n.node,e,o),()=>{this.emitter.stopListening(n.node,e,o)}}}class _l extends bl{getValue(e){return!Sl(super.getValue(e))&&(this.valueIfTrue||!0)}}function kl(e){return!!e&&(e.value&&(e=e.value),Array.isArray(e)?e.some(kl):e instanceof bl)}function vl(e,t,{node:n}){let o=function(e,t){return e.map(e=>e instanceof bl?e.getValue(t):e)}(e,n);Sl(o=1==e.length&&e[0]instanceof _l?o[0]:o.reduce(El,""))?t.remove():t.set(o)}function yl(e,t,n){return{set(o){e.setAttributeNS(n,t,o)},remove(){e.removeAttributeNS(n,t)}}}function xl(e,t){return{set(n){e.style[t]=n},remove(){e.style[t]=null}}}function Cl(e){return Wn(e,e=>{if(e&&(e instanceof bl||Ol(e)||Rl(e)||Il(e)))return e})}function Al(e){if("string"==typeof e?e=function(e){return{text:[e]}}(e):e.text&&function(e){Array.isArray(e.text)||(e.text=[e.text])}(e),e.on&&(e.eventListeners=function(e){for(const t in e)Pl(e,t);return e}(e.on),delete e.on),!e.text){e.attributes&&function(e){for(const t in e)e[t].value&&(e[t].value=[].concat(e[t].value)),Pl(e,t)}(e.attributes);const t=[];if(e.children)if(Il(e.children))t.push(e.children);else for(const n of e.children)Ol(n)||Rl(n)||Xi(n)?t.push(n):t.push(new gl(n));e.children=t}return e}function Pl(e,t){Array.isArray(e[t])||(e[t]=[e[t]])}function El(e,t){return Sl(t)?e:Sl(e)?t:`${e} ${t}`}function Tl(e,t){for(const n in t)e[n]?e[n].push(...t[n]):e[n]=t[n]}function Sl(e){return!e&&0!==e}function Rl(e){return e instanceof Ml}function Ol(e){return e instanceof gl}function Il(e){return e instanceof pl}function Dl(e){return"class"==e||"style"==e}n(66);class Ml{constructor(e){this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new si,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(t,n)=>{n.locale=e}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=gl.bind(this,this)}createCollection(){const e=new pl;return this._viewCollections.add(e),e}registerChild(e){wo(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){wo(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new gl(e)}extendTemplate(e){gl.extend(this.template,e)}render(){if(this.isRendered)throw new Jn.b("ui-view-render-already-rendered: This View has already been rendered.");this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(e=>e.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}lo(Ml,dr),lo(Ml,Ho);n(68);class Nl extends Ml{constructor(e){super(e),this.body=this.createCollection()}render(){super.render(),this._renderBodyCollection()}destroy(){return this._bodyCollectionContainer.remove(),super.destroy()}_renderBodyCollection(){const e=this._bodyCollectionContainer=new gl({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"]},children:this.body}).render();document.body.appendChild(e)}}n(70);class Fl extends Ml{constructor(e){super(e),this.set("text"),this.set("for");const t=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],for:t.to("for")},children:[{text:t.to("text")}]})}}class Bl extends Nl{constructor(e){super(e);const t=Yn();this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-editor","ck-rounded-corners"],role:"application",dir:"ltr",lang:e.language,"aria-labelledby":`ck-editor__aria-label_${t}`},children:[this._voiceLabelView,{tag:"div",attributes:{class:["ck","ck-editor__top","ck-reset_all"],role:"presentation"},children:this.top},{tag:"div",attributes:{class:["ck","ck-editor__main"],role:"presentation"},children:this.main}]})}_createVoiceLabel(e){const t=this.t,n=new Fl;return n.text=t("x"),n.extendTemplate({attributes:{id:`ck-editor__aria-label_${e}`,class:"ck-voice-label"}}),n}}class Vl extends Ml{constructor(e,t,n){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"]}}),this.name=null,this.set("isFocused",!1),this._editableElement=n,this._hasExternalElement=!!this._editableElement,this._editingView=t}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}_updateIsFocusedClasses(){const e=this._editingView;function t(t){e.change(n=>{const o=e.document.getRoot(t.name);n.addClass(t.isFocused?"ck-focused":"ck-blurred",o),n.removeClass(t.isFocused?"ck-blurred":"ck-focused",o)})}e.isRenderingInProgress?function n(o){e.once("change:isRenderingInProgress",(e,i,r)=>{r?n(o):t(o)})}(this):t(this)}}class Ll extends Vl{constructor(e,t,n){super(e,t,n),this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const e=this._editingView,t=this.t;e.change(n=>{const o=e.document.getRoot(this.name);n.setAttribute("aria-label",t("ad",[this.name]),o)})}}function zl(e){return t=>t+e}n(72);const ql=zl("px");class jl extends Ml{constructor(e){super(e);const t=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheLimiter",!1),this.set("_hasViewportTopOffset",!1),this.content=this.createCollection(),this._contentPanelPlaceholder=new gl({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",e=>e?"block":"none"),height:t.to("isSticky",e=>e?ql(this._panelRect.height):null)}}}).render(),this._contentPanel=new gl({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",t.if("isSticky","ck-sticky-panel__content_sticky"),t.if("_isStickyToTheLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:t.to("isSticky",e=>e?ql(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to("_hasViewportTopOffset",e=>e?ql(this.viewportTopOffset):null),bottom:t.to("_isStickyToTheLimiter",e=>e?ql(this.limiterBottomOffset):null),marginLeft:t.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this._contentPanel]})}render(){super.render(),this._checkIfShouldBeSticky(),this.listenTo(or.window,"scroll",()=>{this._checkIfShouldBeSticky()}),this.listenTo(this,"change:isActive",()=>{this._checkIfShouldBeSticky()})}_checkIfShouldBeSticky(){const e=this._panelRect=this._contentPanel.getBoundingClientRect();let t;this.limiterElement?(t=this._limiterRect=this.limiterElement.getBoundingClientRect(),this.isSticky=this.isActive&&t.top<this.viewportTopOffset&&this._panelRect.height+this.limiterBottomOffset<t.height):this.isSticky=!1,this.isSticky?(this._isStickyToTheLimiter=t.bottom<e.height+this.limiterBottomOffset+this.viewportTopOffset,this._hasViewportTopOffset=!this._isStickyToTheLimiter&&!!this.viewportTopOffset,this._marginLeft=this._isStickyToTheLimiter?null:ql(-or.window.scrollX)):(this._isStickyToTheLimiter=!1,this._hasViewportTopOffset=!1,this._marginLeft=null)}}class Hl{constructor(e){if(Object.assign(this,e),e.actions&&e.keystrokeHandler)for(const t in e.actions){let n=e.actions[t];"string"==typeof n&&(n=[n]);for(const o of n)e.keystrokeHandler.set(o,(e,n)=>{this[t](),n()})}}get first(){return this.focusables.find(Ul)||null}get last(){return this.focusables.filter(Ul).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let e=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((t,n)=>{const o=t.element===this.focusTracker.focusedElement;return o&&(e=n),o}),e)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(e){e&&e.focus()}_getFocusableItem(e){const t=this.current,n=this.focusables.length;if(!n)return null;if(null===t)return this[1===e?"first":"last"];let o=(t+n+e)%n;do{const t=this.focusables.get(o);if(Ul(t))return t;o=(o+n+e)%n}while(o!==t);return null}}function Ul(e){return!(!e.focus||"none"==or.window.getComputedStyle(e.element).display)}class Wl extends Ml{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}n(74);class $l extends Ml{constructor(e){super(e);const t=this.bindTemplate;this.items=this.createCollection(),this.focusTracker=new rl,this.keystrokes=new Zc,this.set("isVertical",!1),this.set("class"),this._focusCycler=new Hl({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:["arrowleft","arrowup"],focusNext:["arrowright","arrowdown"]}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar",t.if("isVertical","ck-toolbar_vertical"),t.to("class")]},children:this.items,on:{mousedown:function(e){return e.bindTemplate.to(t=>{t.target===e.element&&t.preventDefault()})}(this)}})}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t){e.map(e=>{"|"==e?this.items.add(new Wl):t.has(e)?this.items.add(t.create(e)):ws.a.warn("toolbarview-item-unavailable: The requested toolbar item is unavailable.",{name:e})})}}n(76);class Gl extends Bl{constructor(e,t){super(e),this.stickyPanel=new jl(e),this.toolbar=new $l(e),this.editable=new Ll(e,t)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class Kl extends Yc{constructor(e,t){super(t),$n(e)&&(this.sourceElement=e),this.data.processor=new nl,this.model.document.createRoot(),this.ui=new fl(this,new Gl(this.locale,this.editing.view)),function(e){if(!$(e.updateSourceElement))throw new Jn.b("attachtoform-missing-elementapi-interface: Editor passed to attachToForm() must implement ElementApi.");const t=e.sourceElement;if(t&&"textarea"===t.tagName.toLowerCase()&&t.form){let n;const o=t.form,i=()=>e.updateSourceElement();$(o.submit)&&(n=o.submit,o.submit=(()=>{i(),n.apply(o)})),o.addEventListener("submit",i),e.on("destroy",()=>{o.removeEventListener("submit",i),n&&(o.submit=n)})}}(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(e,t={}){return new Promise(n=>{const o=new this(e,t);n(o.initPlugins().then(()=>o.ui.init($n(e)?e:null)).then(()=>{if(!$n(e)&&t.initialData)throw new Jn.b("editor-create-initial-data: The config.initialData option cannot be used together with initial data passed in Editor.create().");const n=t.initialData||function(e){return $n(e)?function(e){return e instanceof HTMLTextAreaElement?e.value:e.innerHTML}(e):e}(e);return o.data.init(n)}).then(()=>o.fire("ready")).then(()=>o))})}}lo(Kl,Xc),lo(Kl,el);n(78);class Jl extends Ml{constructor(){super();const e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon"],viewBox:e.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const e=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),t=e.getAttribute("viewBox");for(t&&(this.viewBox=t),this.element.innerHTML="";e.childNodes.length>0;)this.element.appendChild(e.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(e=>{e.style.fill=this.fillColor})}}n(80);class Zl extends Ml{constructor(e){super(e),this.set("text",""),this.set("position","s");const t=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip",t.to("position",e=>"ck-tooltip_"+e),t.if("text","ck-hidden",e=>!e.trim())]},children:[{tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:t.to("text")}]}]})}}n(82);class Ql extends Ml{constructor(e){super(e);const t=this.bindTemplate,n=Yn();this.set("class"),this.set("labelStyle"),this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("keystroke"),this.set("label"),this.set("tabindex",-1),this.set("tooltip"),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.tooltipView=this._createTooltipView(),this.labelView=this._createLabelView(n),this.iconView=new Jl,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this)),this.setTemplate({tag:"button",attributes:{class:["ck","ck-button",t.to("class"),t.if("isEnabled","ck-disabled",e=>!e),t.if("isVisible","ck-hidden",e=>!e),t.to("isOn",e=>e?"ck-on":"ck-off"),t.if("withText","ck-button_with-text")],type:t.to("type",e=>e||"button"),tabindex:t.to("tabindex"),"aria-labelledby":`ck-editor__aria-label_${n}`,"aria-disabled":t.if("isEnabled",!0,e=>!e),"aria-pressed":t.if("isOn",!0)},children:this.children,on:{mousedown:t.to(e=>{e.preventDefault()}),click:t.to(e=>{this.isEnabled?this.fire("execute"):e.preventDefault()})}})}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.tooltipView),this.children.add(this.labelView)}focus(){this.element.focus()}_createTooltipView(){const e=new Zl;return e.bind("text").to(this,"_tooltipString"),e.bind("position").to(this,"tooltipPosition"),e}_createLabelView(e){const t=new Ml,n=this.bindTemplate;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:n.to("labelStyle"),id:`ck-editor__aria-label_${e}`},children:[{text:this.bindTemplate.to("label")}]}),t}_getTooltipString(e,t,n){return e?"string"==typeof e?e:(n&&(n=function(e){return mi.isMac?vi(e).map(e=>bi[e.toLowerCase()]||e).reduce((e,t)=>e.slice(-1)in gi?e+t:e+"+"+t):e}(n)),e instanceof Function?e(t,n):`${t}${n?` (${n})`:""}`):""}}var Yl=function(){return function e(){e.called=!0}};class Xl{constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=Yl(),this.off=Yl()}}var ed={get(e){return"number"!=typeof e?this[e]||this.normal:e},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};const td=Symbol("listeningTo"),nd=Symbol("emitterId");var od={on(e,t,n={}){this.listenTo(this,e,t,n)},once(e,t,n){this.listenTo(this,e,function(e,...n){e.off(),t.call(this,e,...n)},n)},off(e,t){this.stopListening(this,e,t)},listenTo(e,t,n,o={}){let i,r;this[td]||(this[td]={});const s=this[td];id(e)||function(e,t){e[nd]||(e[nd]=t||function(){let e="e";for(let t=0;t<8;t++)e+=Math.floor(65536*(1+Math.random())).toString(16).substring(1);return e}())}(e);const a=id(e);(i=s[a])||(i=s[a]={emitter:e,callbacks:{}}),(r=i.callbacks[t])||(r=i.callbacks[t]=[]),r.push(n),function(e,t){const n=rd(e);if(n[t])return;let o=t,i=null;const r=[];for(;""!==o&&!n[o];)n[o]={callbacks:[],childEvents:[]},r.push(n[o]),i&&n[o].childEvents.push(i),i=o,o=o.substr(0,o.lastIndexOf(":"));if(""!==o){for(const e of r)e.callbacks=n[o].callbacks.slice();n[o].childEvents.push(i)}}(e,t);const c=sd(e,t),l=ed.get(o.priority),d={callback:n,priority:l};for(const e of c){let t=!1;for(let n=0;n<e.length;n++)if(e[n].priority<l){e.splice(n,0,d),t=!0;break}t||e.push(d)}},stopListening(e,t,n){const o=this[td];let i=e&&id(e);const r=o&&i&&o[i],s=r&&t&&r.callbacks[t];if(!(!o||e&&!r||t&&!s))if(n)cd(e,t,n);else if(s){for(;n=s.pop();)cd(e,t,n);delete r.callbacks[t]}else if(r){for(t in r.callbacks)this.stopListening(e,t);delete o[i]}else{for(i in o)this.stopListening(o[i].emitter);delete this[td]}},fire(e,...t){const n=e instanceof Xl?e:new Xl(this,e),o=n.name;let i=function e(t,n){let o;if(!t._events||!(o=t._events[n])||!o.callbacks.length)return n.indexOf(":")>-1?e(t,n.substr(0,n.lastIndexOf(":"))):null;return o.callbacks}(this,o);if(n.path.push(this),i){const e=[n,...t];i=Array.from(i);for(let t=0;t<i.length&&(i[t].callback.apply(this,e),n.off.called&&(delete n.off.called,cd(this,o,i[t].callback)),!n.stop.called);t++);}if(this._delegations){const e=this._delegations.get(o),i=this._delegations.get("*");e&&ad(e,n,t),i&&ad(i,n,t)}return n.return},delegate(...e){return{to:(t,n)=>{this._delegations||(this._delegations=new Map);for(const o of e){const e=this._delegations.get(o);e?e.set(t,n):this._delegations.set(o,new Map([[t,n]]))}}}},stopDelegating(e,t){if(this._delegations)if(e)if(t){const n=this._delegations.get(e);n&&n.delete(t)}else this._delegations.delete(e);else this._delegations.clear()}};function id(e){return e[nd]}function rd(e){return e._events||Object.defineProperty(e,"_events",{value:{}}),e._events}function sd(e,t){const n=rd(e)[t];if(!n)return[];let o=[n.callbacks];for(let t=0;t<n.childEvents.length;t++){const i=sd(e,n.childEvents[t]);o=o.concat(i)}return o}function ad(e,t,n){for(let[o,i]of e){i?"function"==typeof i&&(i=i(t.name)):i=t.name;const e=new Xl(t.source,i);e.path=[...t.path],o.fire(e,...n)}}function cd(e,t,n){const o=sd(e,t);for(const e of o)for(let t=0;t<e.length;t++)e[t].callback==n&&(e.splice(t,1),t--)}const ld="https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html";class dd extends Error{constructor(e,t){e=function(e){const t=e.match(/^([^:]+):/);if(!t)return e;return e+` Read more: ${ld}#error-${t[1]}\n`}(e),t&&(e+=" "+JSON.stringify(t)),super(e),this.name="CKEditorError",this.data=t}static isCKEditorError(e){return e instanceof dd}}const ud=Symbol("observableProperties"),hd=Symbol("boundObservables"),fd=Symbol("boundProperties"),pd={set(e,t){if(q(e))return void Object.keys(e).forEach(t=>{this.set(t,e[t])},this);gd(this);const n=this[ud];if(e in this&&!n.has(e))throw new dd("observable-set-cannot-override: Cannot override an existing property.");Object.defineProperty(this,e,{enumerable:!0,configurable:!0,get:()=>n.get(e),set(t){const o=n.get(e);let i=this.fire("set:"+e,e,t,o);void 0===i&&(i=t),o===i&&n.has(e)||(n.set(e,i),this.fire("change:"+e,e,i,o))}}),this[e]=t},bind(...e){if(!e.length||!_d(e))throw new dd("observable-bind-wrong-properties: All properties must be strings.");if(new Set(e).size!==e.length)throw new dd("observable-bind-duplicate-properties: Properties must be unique.");gd(this);const t=this[fd];e.forEach(e=>{if(t.has(e))throw new dd("observable-bind-rebind: Cannot bind the same property more that once.")});const n=new Map;return e.forEach(e=>{const o={property:e,to:[]};t.set(e,o),n.set(e,o)}),{to:bd,toMany:wd,_observable:this,_bindProperties:e,_to:[],_bindings:n}},unbind(...e){if(!(ud in this))return;const t=this[fd],n=this[hd];if(e.length){if(!_d(e))throw new dd("observable-unbind-wrong-properties: Properties must be strings.");e.forEach(e=>{const o=t.get(e);if(!o)return;let i,r,s,a;o.to.forEach(e=>{i=e[0],r=e[1],s=n.get(i),(a=s[r]).delete(o),a.size||delete s[r],Object.keys(s).length||(n.delete(i),this.stopListening(i,"change"))}),t.delete(e)})}else n.forEach((e,t)=>{this.stopListening(t,"change")}),n.clear(),t.clear()},decorate(e){const t=this[e];if(!t)throw new dd("observablemixin-cannot-decorate-undefined: Cannot decorate an undefined method.",{object:this,methodName:e});this.on(e,(e,n)=>{e.return=t.apply(this,n)}),this[e]=function(...t){return this.fire(e,t)}}};Vo(pd,od);var md=pd;function gd(e){ud in e||(Object.defineProperty(e,ud,{value:new Map}),Object.defineProperty(e,hd,{value:new Map}),Object.defineProperty(e,fd,{value:new Map}))}function bd(...e){const t=function(...e){if(!e.length)throw new dd("observable-bind-to-parse-error: Invalid argument syntax in `to()`.");const t={to:[]};let n;"function"==typeof e[e.length-1]&&(t.callback=e.pop());return e.forEach(e=>{if("string"==typeof e)n.properties.push(e);else{if("object"!=typeof e)throw new dd("observable-bind-to-parse-error: Invalid argument syntax in `to()`.");n={observable:e,properties:[]},t.to.push(n)}}),t}(...e),n=Array.from(this._bindings.keys()),o=n.length;if(!t.callback&&t.to.length>1)throw new dd("observable-bind-to-no-callback: Binding multiple observables only possible with callback.");if(o>1&&t.callback)throw new dd("observable-bind-to-extra-callback: Cannot bind multiple properties and use a callback in one binding.");t.to.forEach(e=>{if(e.properties.length&&e.properties.length!==o)throw new dd("observable-bind-to-properties-length: The number of properties must match.");e.properties.length||(e.properties=this._bindProperties)}),this._to=t.to,t.callback&&(this._bindings.get(n[0]).callback=t.callback),function(e,t){t.forEach(t=>{const n=e[hd];let o;n.get(t.observable)||e.listenTo(t.observable,"change",(i,r)=>{(o=n.get(t.observable)[r])&&o.forEach(t=>{kd(e,t.property)})})})}(this._observable,this._to),function(e){let t;e._bindings.forEach((n,o)=>{e._to.forEach(i=>{t=i.properties[n.callback?0:e._bindProperties.indexOf(o)],n.to.push([i.observable,t]),function(e,t,n,o){const i=e[hd],r=i.get(n),s=r||{};s[o]||(s[o]=new Set);s[o].add(t),r||i.set(n,s)}(e._observable,n,i.observable,t)})})}(this),this._bindProperties.forEach(e=>{kd(this._observable,e)})}function wd(e,t,n){if(this._bindings.size>1)throw new dd("observable-bind-to-many-not-one-binding: Cannot bind multiple properties with toMany().");this.to(...function(e,t){const n=e.map(e=>[e,t]);return Array.prototype.concat.apply([],n)}(e,t),n)}function _d(e){return e.every(e=>"string"==typeof e)}function kd(e,t){const n=e[fd].get(t);let o;o=n.callback?n.callback.apply(e,n.to.map(e=>e[0][e[1]])):(o=n.to[0])[0][o[1]],e.hasOwnProperty(t)?e[t]=o:e.set(t,o)}function vd(e,...t){t.forEach(t=>{Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)).forEach(n=>{if(n in e.prototype)return;const o=Object.getOwnPropertyDescriptor(t,n);o.enumerable=!1,Object.defineProperty(e.prototype,n,o)})})}class yd{constructor(e){this.editor=e}destroy(){this.stopListening()}}vd(yd,md);class xd{constructor(){this._stack=[]}add(e,t){const n=this._stack,o=n[0];this._insertDescriptor(e);const i=n[0];o===i||Cd(o,i)||this.fire("change:top",{oldDescriptor:o,newDescriptor:i,writer:t})}remove(e,t){const n=this._stack,o=n[0];this._removeDescriptor(e);const i=n[0];o===i||Cd(o,i)||this.fire("change:top",{oldDescriptor:o,newDescriptor:i,writer:t})}_insertDescriptor(e){const t=this._stack,n=t.findIndex(t=>t.id===e.id);if(Cd(e,t[n]))return;n>-1&&t.splice(n,1);let o=0;for(;t[o]&&Ad(t[o],e);)o++;t.splice(o,0,e)}_removeDescriptor(e){const t=this._stack,n=t.findIndex(t=>t.id===e);n>-1&&t.splice(n,1)}}function Cd(e,t){return e&&t&&e.priority==t.priority&&Pd(e.classes)==Pd(t.classes)}function Ad(e,t){return e.priority>t.priority||!(e.priority<t.priority)&&Pd(e.classes)>Pd(t.classes)}function Pd(e){return Array.isArray(e)?e.sort().join(","):e}lo(xd,no);var Ed=n(33),Td=n.n(Ed);const Sd="ck-widget",Rd="ck-widget_selected";function Od(e){return!!e.is("element")&&!!e.getCustomProperty("widget")}function Id(e,t,n={}){return mi.isEdge||t.setAttribute("contenteditable","false",e),t.addClass(Sd,e),t.setCustomProperty("widget",!0,e),e.getFillerOffset=Fd,n.label&&function(e,t,n){n.setCustomProperty("widgetLabel",t,e)}(e,n.label,t),n.hasSelectionHandler&&function(e,t){const n=t.createUIElement("div",{class:"ck ck-widget__selection-handler"},function(e){const t=this.toDomElement(e),n=new Jl;return n.set("content",Td.a),n.render(),t.appendChild(n.element),t});t.insert(t.createPositionAt(e,0),n),t.addClass(["ck-widget_with-selection-handler"],e)}(e,t),function(e,t,n,o){const i=new xd;i.on("change:top",(t,i)=>{i.oldDescriptor&&o(e,i.oldDescriptor,i.writer),i.newDescriptor&&n(e,i.newDescriptor,i.writer)}),t.setCustomProperty("addHighlight",(e,t,n)=>i.add(t,n),e),t.setCustomProperty("removeHighlight",(e,t,n)=>i.remove(t,n),e)}(e,t,(e,t,n)=>n.addClass(o(t.classes),e),(e,t,n)=>n.removeClass(o(t.classes),e)),e;function o(e){return Array.isArray(e)?e:[e]}}function Dd(e){const t=e.getCustomProperty("widgetLabel");return t?"function"==typeof t?t():t:""}function Md(e,t){return t.addClass(["ck-editor__editable","ck-editor__nested-editable"],e),mi.isEdge||(t.setAttribute("contenteditable",e.isReadOnly?"false":"true",e),e.on("change:isReadOnly",(n,o,i)=>{t.setAttribute("contenteditable",i?"false":"true",e)})),e.on("change:isFocused",(n,o,i)=>{i?t.addClass("ck-editor__nested-editable_focused",e):t.removeClass("ck-editor__nested-editable_focused",e)}),e}function Nd(e,t){const n=e.getSelectedElement();if(n&&t.schema.isBlock(n))return t.createPositionAfter(n);const o=e.getSelectedBlocks().next().value;if(o){if(o.isEmpty)return t.createPositionAt(o,0);const n=t.createPositionAfter(o);return e.focus.isTouching(n)?n:t.createPositionBefore(o)}return e.focus}function Fd(){return null}class Bd extends yd{static get pluginName(){return"OPMacroToc"}static get buttonName(){return"insertToc"}init(){const e=this.editor,t=e.model,n=e.conversion;t.schema.register("op-macro-toc",{allowWhere:"$block",isBlock:!0,isLimit:!0}),n.for("upcast").elementToElement({view:{name:"macro",classes:"toc"},model:"op-macro-toc"}),n.for("editingDowncast").elementToElement({model:"op-macro-toc",view:(e,t)=>Id(this.createTocViewElement(t),t,{label:this.label})}),n.for("dataDowncast").elementToElement({model:"op-macro-toc",view:(e,t)=>this.createTocDataElement(t)}),e.ui.componentFactory.add(Bd.buttonName,t=>{const n=new Ql(t);return n.set({label:this.label,withText:!0}),n.on("execute",()=>{e.model.change(t=>{const n=t.createElement("op-macro-toc",{});e.model.insertContent(n,e.model.document.selection)})}),n})}get label(){return window.I18n.t("js.editor.macro.toc")}createTocViewElement(e){const t=e.createText(this.label),n=e.createContainerElement("div",{class:"macro -toc"});return e.insert(e.createPositionAt(n,0),t),n}createTocDataElement(e){return e.createContainerElement("macro",{class:"toc"})}}const Vd=Symbol("isOPEmbeddedTable");function Ld(e){const t=e.getSelectedElement();return!(!t||!function(e){return!!e.getCustomProperty(Vd)&&Od(e)}(t))}function zd(e,t){return qd(e).services[t]}function qd(e){return _.get(e.config,"_config.openProject.pluginContext")}function jd(e){return _.get(e.config,"_config.openProject.context.resource")}function Hd(e,t){return zd(e,"pathHelperService")}class Ud extends yd{static get pluginName(){return"EmbeddedTableEditing"}static get buttonName(){return"insertEmbeddedTable"}init(){const e=this.editor,t=e.model,n=e.conversion,o=qd(e);this.text={button:window.I18n.t("js.editor.macro.embedded_table.button"),macro_text:window.I18n.t("js.editor.macro.embedded_table.text")},t.schema.register("op-macro-embedded-table",{allowWhere:"$block",allowAttributes:["opEmbeddedTableQuery"],isBlock:!0,isObject:!0}),n.for("upcast").elementToElement({view:{name:"macro",classes:"embedded-table"},model:(e,t)=>{const n=e.getAttribute("data-query-props");return t.createElement("op-macro-embedded-table",{opEmbeddedTableQuery:n?JSON.parse(n):{}})}}),n.for("editingDowncast").elementToElement({model:"op-macro-embedded-table",view:(e,t)=>(function(e,t,n){return t.setCustomProperty(Vd,!0,e),Id(e,t,{label:"your label here"})})(this.createEmbeddedTableView(t),t,this.label)}),n.for("dataDowncast").elementToElement({model:"op-macro-embedded-table",view:(e,t)=>this.createEmbeddedTableDataElement(e,t)}),e.ui.componentFactory.add(Ud.buttonName,t=>{const n=new Ql(t);return n.set({label:this.text.button,withText:!0}),n.on("execute",()=>o.runInZone(()=>{o.services.externalQueryConfiguration.show({},t=>e.model.change(n=>{const o=n.createElement("op-macro-embedded-table",{opEmbeddedTableQuery:t});e.model.insertContent(o,e.model.document.selection)}))})),n})}createEmbeddedTableView(e){const t=e.createText(this.text.macro_text),n=e.createContainerElement("div",{class:"macro -embedded-table"});return e.insert(e.createPositionAt(n,0),t),n}createEmbeddedTableDataElement(e,t){const n=e.getAttribute("opEmbeddedTableQuery")||{};return t.createContainerElement("macro",{class:"embedded-table","data-query-props":JSON.stringify(n)})}}class Wd{constructor(e){this.editor=e}destroy(){this.stopListening()}}lo(Wd,Ho);class $d extends ts{constructor(e){super(e),this.domEventType="mousedown"}onDomEvent(e){this.fire(e.type,e)}}n(84);const Gd=ki("Ctrl+A");class Kd extends Wd{static get pluginName(){return"Widget"}init(){const e=this.editor.editing.view,t=e.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",(e,t,n)=>{this._clearPreviouslySelectedWidgets(n.writer);const o=n.writer,i=o.document.selection,r=i.getSelectedElement();let s=null;for(const e of i.getRanges())for(const t of e){const e=t.item;Od(e)&&!Jd(e,s)&&(o.addClass(Rd,e),this._previouslySelected.add(e),s=e,e==r&&o.setSelection(i.getRanges(),{fake:!0,label:Dd(r)}))}},{priority:"low"}),e.addObserver($d),this.listenTo(t,"mousedown",(...e)=>this._onMousedown(...e)),this.listenTo(t,"keydown",(...e)=>this._onKeydown(...e),{priority:"high"}),this.listenTo(t,"delete",(e,t)=>{this._handleDelete("forward"==t.direction)&&(t.preventDefault(),e.stop())},{priority:"high"})}_onMousedown(e,t){const n=this.editor,o=n.editing.view,i=o.document;let r=t.target;if(function(e){for(;e;){if(e.is("editableElement")&&!e.is("rootElement"))return!0;if(Od(e))return!1;e=e.parent}return!1}(r)){if(mi.isSafari&&t.domEvent.detail>=3){const e=n.editing.mapper.toModelElement(r);this.editor.model.change(n=>{t.preventDefault(),n.setSelection(e,"in")})}return}if(!Od(r)&&!(r=r.findAncestor(Od)))return;t.preventDefault(),i.isFocused||o.focus();const s=n.editing.mapper.toModelElement(r);this._setSelectionOverElement(s)}_onKeydown(e,t){const n=t.keyCode,o=n==wi.arrowdown||n==wi.arrowright;let i=!1;!function(e){return e==wi.arrowright||e==wi.arrowleft||e==wi.arrowup||e==wi.arrowdown}(n)?!function(e){return _i(e)==Gd}(t)?n===wi.enter&&(i=this._handleEnterKey(t.shiftKey)):i=this._selectAllNestedEditableContent()||this._selectAllContent():i=this._handleArrowKeys(o),i&&(t.preventDefault(),e.stop())}_handleDelete(e){if(this.editor.isReadOnly)return;const t=this.editor.model.document.selection;if(!t.isCollapsed)return;const n=this._getObjectElementNextToSelection(e);return n?(this.editor.model.change(e=>{let o=t.anchor.parent;for(;o.isEmpty;){const t=o;o=t.parent,e.remove(t)}this._setSelectionOverElement(n)}),!0):void 0}_handleArrowKeys(e){const t=this.editor.model,n=t.schema,o=t.document.selection,i=o.getSelectedElement();if(i&&n.isObject(i)){const i=e?o.getLastPosition():o.getFirstPosition(),r=n.getNearestSelectionRange(i,e?"forward":"backward");return r&&t.change(e=>{e.setSelection(r)}),!0}if(!o.isCollapsed)return;const r=this._getObjectElementNextToSelection(e);return r&&n.isObject(r)?(this._setSelectionOverElement(r),!0):void 0}_handleEnterKey(e){const t=this.editor.model,n=t.document.selection.getSelectedElement();if(function(e,t){return e&&t.isObject(e)&&!t.isInline(e)}(n,t.schema))return t.change(o=>{let i=o.createPositionAt(n,e?"before":"after");const r=o.createElement("paragraph");if(t.schema.isBlock(n.parent)){const e=t.schema.findAllowedParent(i,r);i=o.split(i,e).position}o.insert(r,i),o.setSelection(r,"in")}),!0}_selectAllNestedEditableContent(){const e=this.editor.model,t=e.document.selection,n=e.schema.getLimitElement(t);return t.getFirstRange().root!=n&&(e.change(e=>{e.setSelection(e.createRangeIn(n))}),!0)}_selectAllContent(){const e=this.editor.model,t=this.editor.editing,n=t.view.document.selection.getSelectedElement();if(n&&Od(n)){const o=t.mapper.toModelElement(n.parent);return e.change(e=>{e.setSelection(e.createRangeIn(o))}),!0}return!1}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model,n=t.schema,o=t.document.selection,i=t.createSelection(o);t.modifySelection(i,{direction:e?"forward":"backward"});const r=e?i.focus.nodeBefore:i.focus.nodeAfter;return r&&n.isObject(r)?r:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass(Rd,t);this._previouslySelected.clear()}}function Jd(e,t){return!!t&&Array.from(e.getAncestors()).includes(t)}class Zd{constructor(e){this.editor=e}destroy(){this.stopListening()}}function Qd({element:e,target:t,positions:n,limiter:o,fitInViewport:i}){$(t)&&(t=t()),$(o)&&(o=o());const r=function(e){for(;e&&"html"!=e.tagName.toLowerCase();){if("static"!=or.window.getComputedStyle(e).position)return e;e=e.parentElement}return null}(e.parentElement),s=new As(e),a=new As(t);let c,l;if(o||i){const e=o&&new As(o).getVisible(),t=i&&new As(or.window);[l,c]=function(e,t,n,o,i){let r,s,a=0,c=0;const l=n.getArea();return e.some(e=>{const[d,u]=Yd(e,t,n);let h,f;if(o)if(i){const e=o.getIntersection(i);h=e?e.getIntersectionArea(u):0}else h=o.getIntersectionArea(u);function p(){c=f,a=h,r=u,s=d}return i&&(f=i.getIntersectionArea(u)),i&&!o?f>c&&p():!i&&o?h>a&&p():f>c&&h>=a?p():f>=c&&h>a&&p(),h===l}),r?[s,r]:null}(n,a,s,e,t)||Yd(n[0],a,s)}else[l,c]=Yd(n[0],a,s);let{left:d,top:u}=Xd(c);if(r){const e=Xd(new As(r)),t=xs(r);d-=e.left,u-=e.top,d+=r.scrollLeft,u+=r.scrollTop,d-=t.left,u-=t.top}return{left:d,top:u,name:l}}function Yd(e,t,n){const{left:o,top:i,name:r}=e(t,n);return[r,n.clone().moveTo(o,i)]}function Xd({left:e,top:t}){const{scrollX:n,scrollY:o}=or.window;return{left:e+n,top:t+o}}lo(Zd,Ho);n(86);const eu=zl("px"),tu=or.document.body;class nu extends Ml{constructor(e){super(e);const t=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class"),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",t.to("position",e=>`ck-balloon-panel_${e}`),t.if("isVisible","ck-balloon-panel_visible"),t.if("withArrow","ck-balloon-panel_with-arrow"),t.to("class")],style:{top:t.to("top",eu),left:t.to("left",eu)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){this.show();const t=nu.defaultPositions,n=Object.assign({},{element:this.element,positions:[t.southArrowNorth,t.southArrowNorthWest,t.southArrowNorthEast,t.northArrowSouth,t.northArrowSouthWest,t.northArrowSouthEast],limiter:tu,fitInViewport:!0},e),{top:o,left:i,name:r}=nu._getOptimalPosition(n);Object.assign(this,{top:o,left:i,position:r})}pin(e){this.unpin(),this._pinWhenIsVisibleCallback=(()=>{this.isVisible?this._startPinning(e):this._stopPinning()}),this._startPinning(e),this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(e){this.attachTo(e);const t=ou(e.target),n=e.limiter?ou(e.limiter):tu;this.listenTo(or.document,"scroll",(o,i)=>{const r=i.target,s=t&&r.contains(t),a=n&&r.contains(n);!s&&!a&&t&&n||this.attachTo(e)},{useCapture:!0}),this.listenTo(or.window,"resize",()=>{this.attachTo(e)})}_stopPinning(){this.stopListening(or.document,"scroll"),this.stopListening(or.window,"resize")}}function ou(e){return $n(e)?e:ys(e)?e.commonAncestorContainer:"function"==typeof e?ou(e()):null}function iu(e,t){return e.top-t.height-nu.arrowVerticalOffset}function ru(e){return e.bottom+nu.arrowVerticalOffset}nu.arrowHorizontalOffset=25,nu.arrowVerticalOffset=10,nu._getOptimalPosition=Qd,nu.defaultPositions={northArrowSouth:(e,t)=>({top:iu(e,t),left:e.left+e.width/2-t.width/2,name:"arrow_s"}),northArrowSouthEast:(e,t)=>({top:iu(e,t),left:e.left+e.width/2-t.width+nu.arrowHorizontalOffset,name:"arrow_se"}),northArrowSouthWest:(e,t)=>({top:iu(e,t),left:e.left+e.width/2-nu.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouth:(e,t)=>({top:iu(e,t),left:e.left-t.width/2,name:"arrow_s"}),northWestArrowSouthWest:(e,t)=>({top:iu(e,t),left:e.left-nu.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouthEast:(e,t)=>({top:iu(e,t),left:e.left-t.width+nu.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouth:(e,t)=>({top:iu(e,t),left:e.right-t.width/2,name:"arrow_s"}),northEastArrowSouthEast:(e,t)=>({top:iu(e,t),left:e.right-t.width+nu.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouthWest:(e,t)=>({top:iu(e,t),left:e.right-nu.arrowHorizontalOffset,name:"arrow_sw"}),southArrowNorth:(e,t)=>({top:ru(e),left:e.left+e.width/2-t.width/2,name:"arrow_n"}),southArrowNorthEast:(e,t)=>({top:ru(e),left:e.left+e.width/2-t.width+nu.arrowHorizontalOffset,name:"arrow_ne"}),southArrowNorthWest:(e,t)=>({top:ru(e),left:e.left+e.width/2-nu.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorth:(e,t)=>({top:ru(e),left:e.left-t.width/2,name:"arrow_n"}),southWestArrowNorthWest:(e,t)=>({top:ru(e),left:e.left-nu.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorthEast:(e,t)=>({top:ru(e),left:e.left-t.width+nu.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorth:(e,t)=>({top:ru(e),left:e.right-t.width/2,name:"arrow_n"}),southEastArrowNorthEast:(e,t)=>({top:ru(e),left:e.right-t.width+nu.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorthWest:(e,t)=>({top:ru(e),left:e.right-nu.arrowHorizontalOffset,name:"arrow_nw"})};class su extends Zd{static get pluginName(){return"ContextualBalloon"}init(){this.view=new nu,this.positionLimiter=(()=>{const e=this.editor.editing.view,t=e.document.selection.editableElement;return t?e.domConverter.mapViewToDom(t.root):null}),this._stack=new Map,this.editor.ui.view.body.add(this.view),this.editor.ui.focusTracker.add(this.view.element)}get visibleView(){const e=this._stack.get(this.view.content.get(0));return e?e.view:null}hasView(e){return this._stack.has(e)}add(e){if(this.hasView(e.view))throw new Jn.b("contextualballoon-add-view-exist: Cannot add configuration of the same view twice.");this.visibleView&&this.view.content.remove(this.visibleView),this._stack.set(e.view,e),this._show(e)}remove(e){if(!this.hasView(e))throw new Jn.b("contextualballoon-remove-view-not-exist: Cannot remove configuration of not existing view.");if(this.visibleView===e){this.view.content.remove(e),this._stack.delete(e);const t=Array.from(this._stack.values()).pop();t?this._show(t):this.view.hide()}else this._stack.delete(e)}updatePosition(e){e&&(this._stack.get(this.visibleView).position=e),this.view.pin(this._getBalloonPosition())}_show({view:e,balloonClassName:t=""}){this.view.class=t,this.view.content.add(e),this.view.pin(this._getBalloonPosition())}_getBalloonPosition(){let e=Array.from(this._stack.values()).pop().position;return e&&!e.limiter&&(e=Object.assign({},e,{limiter:this.positionLimiter})),e}}var au=n(34),cu=n.n(au);function lu(e,t,n){e.ui.componentFactory.add(t,t=>{const o=new Ql(t);return o.set({label:I18n.t("js.button_edit"),icon:cu.a,tooltip:!0}),o.on("execute",()=>{const t=e.model.document.selection.getSelectedElement();t&&n(t)}),o})}const du="ck-toolbar-container";function uu(e,t,n,o){const i=t.config.get(n+".toolbar");if(!i||!i.length)return;const r=t.plugins.get("ContextualBalloon"),s=new $l;function a(){t.ui.focusTracker.isFocused&&o(t.editing.view.document.selection)?l()?function(e,t){const n=e.plugins.get("ContextualBalloon");if(t(e.editing.view.document.selection)){const t=hu(e);n.updatePosition(t)}}(t,o):r.hasView(s)||r.add({view:s,position:hu(t),balloonClassName:du}):c()}function c(){l()&&r.remove(s)}function l(){return r.visibleView==s}s.fillFromConfig(i,t.ui.componentFactory),e.listenTo(t.editing.view,"render",a),e.listenTo(t.ui.focusTracker,"change:isFocused",a,{priority:"low"})}function hu(e){const t=e.editing.view,n=nu.defaultPositions;return{target:t.domConverter.viewToDom(t.document.selection.getSelectedElement()),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}}class fu extends yd{static get requires(){return[su]}static get pluginName(){return"EmbeddedTableToolbar"}init(){const e=this.editor,t=this.editor.model,n=qd(e);lu(e,"opEditEmbeddedTableQuery",e=>{const o=n.services.externalQueryConfiguration,i=e.getAttribute("opEmbeddedTableQuery")||{};n.runInZone(()=>{o.show(i,n=>t.change(t=>{t.setAttribute("opEmbeddedTableQuery",n,e)}))})})}afterInit(){uu(this,this.editor,"OPMacroEmbeddedTable",Ld)}}const pu=Symbol("isWpButtonMacroSymbol");function mu(e){const t=e.getSelectedElement();return!(!t||!function(e){return!!e.getCustomProperty(pu)&&Od(e)}(t))}class gu extends yd{static get pluginName(){return"OPMacroWpButtonEditing"}static get buttonName(){return"insertWorkPackageButton"}init(){const e=this.editor,t=e.model,n=e.conversion,o=qd(e);t.schema.register("op-macro-wp-button",{allowWhere:["$block"],allowAttributes:["type","classes"],isBlock:!0,isLimit:!0}),n.for("upcast").elementToElement({view:{name:"macro",classes:"create_work_package_link"},model:(e,t)=>{const n=e.getAttribute("data-type")||"",o=e.getAttribute("data-classes")||"";return t.createElement("op-macro-wp-button",{type:n,classes:o})}}),n.for("editingDowncast").elementToElement({model:"op-macro-wp-button",view:(e,t)=>this.createMacroViewElement(e,t)}),n.for("dataDowncast").elementToElement({model:"op-macro-wp-button",view:(e,t)=>{return t.createContainerElement("macro",{class:"create_work_package_link","data-type":e.getAttribute("type")||"","data-classes":e.getAttribute("classes")||""})}}),e.ui.componentFactory.add(gu.buttonName,t=>{const n=new Ql(t);return n.set({label:window.I18n.t("js.editor.macro.work_package_button.button"),withText:!0}),n.on("execute",()=>{o.services.macros.configureWorkPackageButton().then(t=>e.model.change(n=>{const o=n.createElement("op-macro-wp-button",{});n.setAttribute("type",t.type,o),n.setAttribute("classes",t.classes,o),e.model.insertContent(o,e.model.document.selection)}))}),n})}macroLabel(e){return e?window.I18n.t("js.editor.macro.work_package_button.with_type",{typename:e}):window.I18n.t("js.editor.macro.work_package_button.without_type")}createMacroViewElement(e,t){e.getAttribute("type");const n=e.getAttribute("classes")||"",o=this.macroLabel(),i=t.createText(o),r=t.createContainerElement("span",{class:"macro -create_work_package_link "+n});return t.insert(t.createPositionAt(r,0),i),function(e,t,n){return t.setCustomProperty(pu,!0,e),Id(e,t,{label:n})}(r,t,{label:o})}}class bu extends yd{static get requires(){return[su]}static get pluginName(){return"OPMacroWpButtonToolbar"}init(){const e=this.editor,t=(this.editor.model,qd(e));lu(e,"opEditWpMacroButton",n=>{const o=t.services.macros,i=n.getAttribute("type"),r=n.getAttribute("classes");o.configureWorkPackageButton(i,r).then(t=>e.model.change(e=>{e.setAttribute("classes",t.classes,n),e.setAttribute("type",t.type,n)}))})}afterInit(){uu(this,this.editor,"OPMacroWpButton",mu)}}const wu=Symbol("isWpButtonMacroSymbol");function _u(e){const t=e.getSelectedElement();return!(!t||!function(e){return!!e.getCustomProperty(wu)&&Od(e)}(t))}class ku extends yd{static get pluginName(){return"OPWikiIncludePageEditing"}static get buttonName(){return"insertWikiPageInclude"}init(){const e=this.editor,t=e.model,n=e.conversion,o=qd(e);t.schema.register("op-macro-wiki-page-include",{allowWhere:["$block"],allowAttributes:["page"],isBlock:!0,isLimit:!0}),n.for("upcast").elementToElement({view:{name:"macro",classes:"include_wiki_page"},model:(e,t)=>{const n=e.getAttribute("data-page")||"";return t.createElement("op-macro-wiki-page-include",{page:n})}}),n.for("editingDowncast").elementToElement({model:"op-macro-wiki-page-include",view:(e,t)=>this.createMacroViewElement(e,t)}).add(e=>e.on("attribute:page",this.modelAttributeToView.bind(this))),n.for("dataDowncast").elementToElement({model:"op-macro-wiki-page-include",view:(e,t)=>{return t.createContainerElement("macro",{class:"include_wiki_page","data-page":e.getAttribute("page")||""})}}),e.ui.componentFactory.add(ku.buttonName,t=>{const n=new Ql(t);return n.set({label:window.I18n.t("js.editor.macro.wiki_page_include.button"),withText:!0}),n.on("execute",()=>{o.services.macros.configureWikiPageInclude().then(t=>e.model.change(n=>{const o=n.createElement("op-macro-wiki-page-include",{});n.setAttribute("page",t,o),e.model.insertContent(o,e.model.document.selection)}))}),n})}modelAttributeToView(e,t,n){const o=t.item;if(!o.is("op-macro-wiki-page-include"))return;n.consumable.consume(t.item,e.name);const i=n.mapper.toViewElement(o);n.writer.remove(n.writer.createRangeIn(i)),this.setPlaceholderContent(n.writer,o,i)}macroLabel(){return window.I18n.t("js.editor.macro.wiki_page_include.text")}pageLabel(e){return e&&e.length>0?e:window.I18n.t("js.editor.macro.wiki_page_include.not_set")}createMacroViewElement(e,t){const n=t.createContainerElement("div",{class:"macro -wiki_page_include"});return this.setPlaceholderContent(t,e,n),function(e,t,n){return t.setCustomProperty(wu,!0,e),Id(e,t,{label:n})}(n,t,{label:this.macroLabel()})}setPlaceholderContent(e,t,n){const o=t.getAttribute("page"),i=this.macroLabel(),r=this.pageLabel(o),s=e.createContainerElement("span",{class:"macro-value"});let a=[e.createText(`${i} `)];e.insert(e.createPositionAt(s,0),e.createText(`${r}`)),a.push(s),e.insert(e.createPositionAt(n,0),a)}}class vu extends yd{static get requires(){return[su]}static get pluginName(){return"OPWikiIncludePageToolbar"}init(){const e=this.editor,t=(this.editor.model,qd(e));lu(e,"opEditWikiIncludeMacroButton",n=>{const o=t.services.macros,i=n.getAttribute("page");o.configureWikiPageInclude(i).then(t=>e.model.change(e=>{e.setAttribute("page",t,n)}))})}afterInit(){uu(this,this.editor,"OPWikiIncludePage",_u)}}class yu{constructor(e){this.editor=e}destroy(){this.stopListening()}}lo(yu,Ho);class xu extends yu{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new si({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if("string"!=typeof e)throw new Jn.b("pendingactions-add-invalid-message: The message must be a string.");const t=Object.create(Ho);return t.set("message",e),this._actions.add(t),this.hasAny=!0,t}remove(e){this._actions.remove(e),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}class Cu{constructor(){const e=new window.FileReader;this._reader=e,this.set("loaded",0),e.onprogress=(e=>{this.loaded=e.loaded})}get error(){return this._reader.error}read(e){const t=this._reader;return this.total=e.size,new Promise((n,o)=>{t.onload=(()=>{n(t.result)}),t.onerror=(()=>{o("error")}),t.onabort=(()=>{o("aborted")}),this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}lo(Cu,Ho);class Au extends yu{static get pluginName(){return"FileRepository"}static get requires(){return[xu]}init(){this.loaders=new si,this.loaders.on("add",()=>this._updatePendingAction()),this.loaders.on("remove",()=>this._updatePendingAction()),this._loadersMap=new Map,this._pendingAction=null,this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return ws.a.error("filerepository-no-upload-adapter: Upload adapter is not defined."),null;const t=new Pu(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then(e=>{this._loadersMap.set(e,t)}),t.file.catch(()=>{}),t.on("change:uploaded",()=>{let e=0;for(const t of this.loaders)e+=t.uploaded;this.uploaded=e}),t.on("change:uploadTotal",()=>{let e=0;for(const t of this.loaders)t.uploadTotal&&(e+=t.uploadTotal);this.uploadTotal=e}),t}destroyLoader(e){const t=e instanceof Pu?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((e,n)=>{e===t&&this._loadersMap.delete(n)})}_updatePendingAction(){const e=this.editor.plugins.get(xu);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,n=e=>`${t("d")} ${parseInt(e)}%.`;this._pendingAction=e.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else e.remove(this._pendingAction),this._pendingAction=null}}lo(Au,Ho);class Pu{constructor(e,t){this.id=Yn(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new Cu,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}read(){if("idle"!=this.status)throw new Jn.b("filerepository-read-wrong-status: You cannot call read if the status is different than idle.");return this.status="reading",this._filePromiseWrapper.promise.then(e=>this._reader.read(e)).then(e=>(this.status="idle",e)).catch(e=>{if("aborted"===e)throw this.status="aborted","aborted";throw this.status="error",this._reader.error?this._reader.error:e})}upload(){if("idle"!=this.status)throw new Jn.b("filerepository-upload-wrong-status: You cannot call upload if the status is different than idle.");return this.status="uploading",this._filePromiseWrapper.promise.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{if("aborted"===this.status)throw"aborted";throw this.status="error",e})}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==e?this._reader.abort():"uploading"==e&&this._adapter.abort&&this._adapter.abort():this._filePromiseWrapper.rejecter("aborted"),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.data=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const t={};return t.promise=new Promise((n,o)=>{t.resolver=n,t.rejecter=o,t.isFulfilled=!1,e.then(e=>{t.isFulfilled=!0,n(e)}).catch(e=>{t.isFulfilled=!0,o(e)})}),t}}lo(Pu,Ho);class Eu{constructor(e,t,n){this.loader=e,this.resource=t,this.editor=n}upload(){const e=this.resource;if(!e||!e.uploadAttachments){const t=e?e.name:"Missing context";return console.warn(`uploadAttachments not present on context: ${t}`),Promise.reject("You're not allowed to upload attachments on this resource.")}return this.loader.file.then(t=>e.uploadAttachments([t]).then(e=>(this.editor.model.fire("op:attachment-added",e),this.buildResponse(e[0]))).catch(e=>{console.error("Failed upload %O",e)}))}buildResponse(e){return{default:e.uploadUrl}}abort(){return!1}}class Tu{constructor(e){this.editor=e}destroy(){this.stopListening()}}lo(Tu,Ho);class Su extends Ml{constructor(e){super(e),this.buttonView=new Ql(e),this._fileInputView=new Ru(e),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.setTemplate({tag:"span",attributes:{class:"ck-file-dialog-button"},children:[this.buttonView,this._fileInputView]}),this.buttonView.on("execute",()=>{this._fileInputView.open()})}focus(){this.buttonView.focus()}}class Ru extends Ml{constructor(e){super(e),this.set("acceptedType"),this.set("allowMultipleFiles",!1);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:t.to("acceptedType"),multiple:t.to("allowMultipleFiles")},on:{change:t.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}var Ou=n(35),Iu=n.n(Ou);function Du(e){return/^image\/(jpeg|png|gif|bmp)$/.test(e.type)}function Mu(e){return new Promise((t,n)=>{const o=e.getAttribute("src");fetch(o).then(e=>e.blob()).then(e=>{const i=function(e,t){return e.type?e.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}(e,o),r=function(e,t,n){try{return new File([e],t,{type:n})}catch(e){return null}}(e,`image.${i.replace("image/","")}`,i);r?t(r):n()}).catch(n)})}class Nu extends Tu{init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageUpload",n=>{const o=new Su(n),i=e.commands.get("imageUpload");return o.set({acceptedType:"image/*",allowMultipleFiles:!0}),o.buttonView.set({label:t("ah"),icon:Iu.a,tooltip:!0}),o.buttonView.bind("isEnabled").to(i),o.on("done",(t,n)=>{const o=Array.from(n).filter(Du);o.length&&e.execute("imageUpload",{file:o})}),o})}}var Fu=n(36),Bu=n.n(Fu);n(88),n(90),n(92);class Vu extends Tu{constructor(e){super(e),this.placeholder="data:image/svg+xml;utf8,"+encodeURIComponent(Bu.a)}init(){this.editor.editing.downcastDispatcher.on("attribute:uploadStatus:image",(...e)=>this.uploadStatusChange(...e))}uploadStatusChange(e,t,n){const o=this.editor,i=t.item,r=i.getAttribute("uploadId");if(!n.consumable.consume(t.item,e.name))return;const s=o.plugins.get(Au),a=r?t.attributeNewValue:null,c=this.placeholder,l=o.editing.mapper.toViewElement(i),d=n.writer;if("reading"==a)return Lu(l,d),void zu(c,l,d);if("uploading"==a){const e=s.loaders.get(r);return Lu(l,d),void(e?(qu(l,d),function(e,t,n,o){const i=function(e){const t=e.createUIElement("div",{class:"ck-progress-bar"});return e.setCustomProperty("progressBar",!0,t),t}(t);t.insert(t.createPositionAt(e,"end"),i),n.on("change:uploadedPercent",(e,t,n)=>{o.change(e=>{e.setStyle("width",n+"%",i)})})}(l,d,e,o.editing.view)):zu(c,l,d))}"complete"==a&&s.loaders.get(r)&&!mi.isEdge&&function(e,t,n){const o=t.createUIElement("div",{class:"ck-image-upload-complete-icon"});t.insert(t.createPositionAt(e,"end"),o),setTimeout(()=>{n.change(e=>e.remove(e.createRangeOn(o)))},3e3)}(l,d,o.editing.view),function(e,t){Hu(e,t,"progressBar")}(l,d),qu(l,d),function(e,t){t.removeClass("ck-appear",e)}(l,d)}}function Lu(e,t){e.hasClass("ck-appear")||t.addClass("ck-appear",e)}function zu(e,t,n){t.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",t);const o=t.getChild(0);o.getAttribute("src")!==e&&n.setAttribute("src",e,o),ju(t,"placeholder")||n.insert(n.createPositionAfter(o),function(e){const t=e.createUIElement("div",{class:"ck-upload-placeholder-loader"});return e.setCustomProperty("placeholder",!0,t),t}(n))}function qu(e,t){e.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",e),Hu(e,t,"placeholder")}function ju(e,t){for(const n of e.getChildren())if(n.getCustomProperty(t))return n}function Hu(e,t,n){const o=ju(e,n);o&&t.remove(t.createRangeOn(o))}class Uu extends Zd{static get pluginName(){return"Notification"}init(){this.on("show:warning",(e,t)=>{window.alert(t.message)},{priority:"lowest"})}showSuccess(e,t={}){this._showNotification({message:e,type:"success",namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:"info",namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:"warning",namespace:t.namespace,title:t.title})}_showNotification(e){const t=`show:${e.type}`+(e.namespace?`:${e.namespace}`:"");this.fire(t,{message:e.message,type:e.type,title:e.title||""})}}class Wu{createDocumentFragment(e){return new Ai(e)}createElement(e,t,n){return new vo(e,t,n)}createText(e){return new mo(e)}clone(e,t=!1){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,n){return n._insertChild(e,t)}removeChildren(e,t,n){return n._removeChildren(e,t)}remove(e){const t=e.parent;return t?this.removeChildren(t.getChildIndex(e),1,t):[]}replace(e,t){const n=e.parent;if(n){const o=n.getChildIndex(e);return this.removeChildren(o,1,n),this.insertChild(o,t,n),!0}return!1}rename(e,t){const n=new vo(e,t.getAttributes(),t.getChildren());return this.replace(t,n)?n:null}setAttribute(e,t,n){n._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,n){P(e)&&void 0===n&&(n=t),n._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,n){n._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return ei._createAt(e,t)}createPositionAfter(e){return ei._createAfter(e)}createPositionBefore(e){return ei._createBefore(e)}createRange(e,t){return new ti(e,t)}createRangeOn(e){return ti._createOn(e)}createRangeIn(e){return ti._createIn(e)}createSelection(e,t,n){return new ii(e,t,n)}}class $u{constructor(e){this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",e=>{this.isEnabled||e.stop()},{priority:"high"}),this.listenTo(e,"change:isReadOnly",(e,t,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",Gu,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",Gu),this.refresh())}execute(){}destroy(){this.stopListening()}}function Gu(e){e.return=!1,e.stop()}function Ku(e){const t=e.getSelectedElement();return t&&function(e){return!!e.getCustomProperty("image")&&Od(e)}(t)?t:null}function Ju(e){return!!e&&e.is("image")}function Zu(e,t,n={}){const o=e.createElement("image",n),i=Nd(t.document.selection,t);t.insertContent(o,i),o.parent&&e.setSelection(o,"on")}function Qu(e){const t=e.schema,n=e.document.selection;return function(e,t,n){const o=function(e,t){const n=Nd(e,t).parent;if(n.isEmpty&&!n.is("$root"))return n.parent;return n}(e,n);return t.checkChild(o,"image")}(n,t,e)&&!function(e,t){const n=e.getSelectedElement();return n&&t.isObject(n)}(n,t)&&function(e){return[...e.focus.getAncestors()].every(e=>!e.is("image"))}(n)}lo($u,Ho);class Yu extends $u{refresh(){this.isEnabled=Qu(this.editor.model)}execute(e){const t=this.editor,n=t.model,o=t.plugins.get(Au);n.change(t=>{const i=Array.isArray(e.file)?e.file:[e.file];for(const e of i)Xu(t,n,o,e)})}}function Xu(e,t,n,o){const i=n.createLoader(o);i&&Zu(e,t,{uploadId:i.id})}class eh extends Tu{static get requires(){return[Au,Uu]}init(){const e=this.editor,t=e.model.document,n=e.model.schema,o=e.conversion,i=e.plugins.get(Au);n.extend("image",{allowAttributes:["uploadId","uploadStatus"]}),e.commands.add("imageUpload",new Yu(e)),o.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(e.editing.view.document,"clipboardInput",(t,n)=>{if(function(e){return Array.from(e.types).includes("text/html")&&""!==e.getData("text/html")}(n.dataTransfer))return;const o=Array.from(n.dataTransfer.files).filter(e=>!!e&&Du(e)),i=n.targetRanges.map(t=>e.editing.mapper.toModelRange(t));e.model.change(n=>{n.setSelection(i),o.length&&(t.stop(),e.model.enqueueChange("default",()=>{e.execute("imageUpload",{file:o})}))})}),e.plugins.has("Clipboard")&&this.listenTo(e.plugins.get("Clipboard"),"inputTransformation",(t,n)=>{const o=Array.from(e.editing.view.createRangeIn(n.content)).filter(e=>(function(e){return!(!e.is("element","img")||!e.getAttribute("src"))&&(e.getAttribute("src").match(/^data:image\/\w+;base64,/g)||e.getAttribute("src").match(/^blob:/g))})(e.item)&&!e.item.getAttribute("uploadProcessed")).map(e=>({promise:Mu(e.item),imageElement:e.item}));if(!o.length)return;const r=new Wu;for(const e of o){r.setAttribute("uploadProcessed",!0,e.imageElement);const t=i.createLoader(e.promise);t&&(r.setAttribute("src","",e.imageElement),r.setAttribute("uploadId",t.id,e.imageElement))}}),e.editing.view.document.on("dragover",(e,t)=>{t.preventDefault()}),t.on("change",()=>{const e=t.differ.getChanges({includeChangesInGraveyard:!0});for(const t of e)if("insert"==t.type&&"image"==t.name){const e=t.position.nodeAfter,n="$graveyard"==t.position.root.rootName,o=e.getAttribute("uploadId");if(!o)continue;const r=i.loaders.get(o);if(!r)continue;n?r.abort():"idle"==r.status&&this._readAndUpload(r,e)}})}_readAndUpload(e,t){const n=this.editor,o=n.model,i=n.locale.t,r=n.plugins.get(Au),s=n.plugins.get(Uu);return o.enqueueChange("transparent",e=>{e.setAttribute("uploadStatus","reading",t)}),e.read().then(i=>{const r=n.editing.mapper.toViewElement(t).getChild(0),s=e.upload();return n.editing.view.change(e=>{e.setAttribute("src",i,r)}),o.enqueueChange("transparent",e=>{e.setAttribute("uploadStatus","uploading",t)}),s}).then(e=>{o.enqueueChange("transparent",n=>{n.setAttributes({uploadStatus:"complete",src:e.default},t),this._parseAndSetSrcsetAttributeOnImage(e,t,n)}),a()}).catch(n=>{if("error"!==e.status&&"aborted"!==e.status)throw n;"error"==e.status&&n&&s.showWarning(n,{title:i("ag"),namespace:"upload"}),a(),o.enqueueChange("transparent",e=>{e.remove(t)})});function a(){o.enqueueChange("transparent",e=>{e.removeAttribute("uploadId",t),e.removeAttribute("uploadStatus",t)}),r.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,n){let o=0;const i=Object.keys(e).filter(e=>{const t=parseInt(e,10);if(!isNaN(t))return o=Math.max(o,t),!0}).map(t=>`${e[t]} ${t}w`).join(", ");""!=i&&n.setAttribute("srcset",{data:i,width:o},t)}}class th extends Tu{static get pluginName(){return"ImageUpload"}static get requires(){return[eh,Nu,Vu]}}const nh=Symbol("isWpButtonMacroSymbol");function oh(e){const t=e.getSelectedElement();return!(!t||!function(e){return!!e.getCustomProperty(nh)&&Od(e)}(t))}class ih extends yd{static get pluginName(){return"OPChildPagesEditing"}static get buttonName(){return"insertChildPages"}init(){const e=this.editor,t=e.model,n=e.conversion;t.schema.register("op-macro-child-pages",{allowWhere:["$block"],allowAttributes:["page"],isBlock:!0,isLimit:!0}),n.for("upcast").elementToElement({view:{name:"macro",classes:"child_pages"},model:(e,t)=>{const n=e.getAttribute("data-page")||"",o="true"==e.getAttribute("data-include-parent");return t.createElement("op-macro-child-pages",{page:n,includeParent:o})}}),n.for("editingDowncast").elementToElement({model:"op-macro-child-pages",view:(e,t)=>this.createMacroViewElement(e,t)}).add(e=>e.on("attribute:page",this.modelAttributeToView.bind(this))).add(e=>e.on("attribute:includeParent",this.modelAttributeToView.bind(this))),n.for("dataDowncast").elementToElement({model:"op-macro-child-pages",view:(e,t)=>{return t.createContainerElement("macro",{class:"child_pages","data-page":e.getAttribute("page")||"","data-include-parent":e.getAttribute("includeParent")||""})}}),e.ui.componentFactory.add(ih.buttonName,t=>{const n=new Ql(t);return n.set({label:window.I18n.t("js.editor.macro.child_pages.button"),withText:!0}),n.on("execute",()=>{e.model.change(t=>{const n=t.createElement("op-macro-child-pages",{});e.model.insertContent(n,e.model.document.selection)})}),n})}modelAttributeToView(e,t,n){const o=t.item;if(!o.is("op-macro-child-pages"))return;n.consumable.consume(t.item,e.name);const i=n.mapper.toViewElement(o);n.writer.remove(n.writer.createRangeIn(i)),this.setPlaceholderContent(n.writer,o,i)}macroLabel(){return window.I18n.t("js.editor.macro.child_pages.text")}pageLabel(e){return e&&e.length>0?e:window.I18n.t("js.editor.macro.child_pages.this_page")}includeParentText(e){return e?` (${window.I18n.t("js.editor.macro.child_pages.include_parent")})`:""}createMacroViewElement(e,t){const n=t.createContainerElement("div",{class:"macro -child_pages"});return this.setPlaceholderContent(t,e,n),function(e,t,n){return t.setCustomProperty(nh,!0,e),Id(e,t,{label:n})}(n,t,{label:this.macroLabel()})}setPlaceholderContent(e,t,n){const o=t.getAttribute("page"),i=t.getAttribute("includeParent"),r=this.macroLabel(),s=this.pageLabel(o),a=e.createContainerElement("span",{class:"macro-value"});let c=[e.createText(`${r} `)];e.insert(e.createPositionAt(a,0),e.createText(`${s}`)),c.push(a),c.push(e.createText(this.includeParentText(i))),e.insert(e.createPositionAt(n,0),c)}}class rh extends yd{static get requires(){return[su]}static get pluginName(){return"OPChildPagesToolbar"}init(){const e=this.editor,t=this.editor.model,n=qd(e);lu(e,"opEditChildPagesMacroButton",e=>{const o=n.services.macros,i=e.getAttribute("page"),r=e.getAttribute("includeParent"),s=i&&i.length>0?i:"";o.configureChildPages(s,r).then(n=>t.change(t=>{t.setAttribute("page",n.page,e),t.setAttribute("includeParent",n.includeParent,e)}))})}afterInit(){uu(this,this.editor,"OPChildPages",oh)}}class sh{constructor(e){this.editor=e}destroy(){this.stopListening()}}lo(sh,Ho);class ah{constructor(e){this.editor=e}destroy(){this.stopListening()}}lo(ah,Ho);class ch{constructor(e){this.files=function(e){const t=e.files?Array.from(e.files):[],n=e.items?Array.from(e.items):[];if(t.length)return t;return n.filter(e=>"file"===e.kind).map(e=>e.getAsFile())}(e),this._native=e}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,t){this._native.setData(e,t)}}class lh extends ts{constructor(e){super(e);const t=this.document;function n(e,n){n.preventDefault();const o=n.dropRange?[n.dropRange]:Array.from(t.selection.getRanges()),i=new Qn(t,"clipboardInput");t.fire(i,{dataTransfer:n.dataTransfer,targetRanges:o}),i.stop.called&&n.stopPropagation()}this.domEventType=["paste","copy","cut","drop","dragover"],this.listenTo(t,"paste",n,{priority:"low"}),this.listenTo(t,"drop",n,{priority:"low"})}onDomEvent(e){const t={dataTransfer:new ch(e.clipboardData?e.clipboardData:e.dataTransfer)};"drop"==e.type&&(t.dropRange=function(e,t){const n=t.target.ownerDocument,o=t.clientX,i=t.clientY;let r;n.caretRangeFromPoint&&n.caretRangeFromPoint(o,i)?r=n.caretRangeFromPoint(o,i):t.rangeParent&&((r=n.createRange()).setStart(t.rangeParent,t.rangeOffset),r.collapse(!0));return r?e.domConverter.domRangeToView(r):e.document.selection.getFirstRange()}(this.view,e)),this.fire(e.type,e,t)}}const dh=["figcaption","li"];class uh extends ah{static get pluginName(){return"Clipboard"}init(){const e=this.editor,t=e.model.document,n=e.editing.view,o=n.document;function i(n,i){const r=i.dataTransfer;i.preventDefault();const s=e.data.toView(e.model.getSelectedContent(t.selection));o.fire("clipboardOutput",{dataTransfer:r,content:s,method:n.name})}this._htmlDataProcessor=new nl,n.addObserver(lh),this.listenTo(o,"clipboardInput",t=>{e.isReadOnly&&t.stop()},{priority:"highest"}),this.listenTo(o,"clipboardInput",(e,t)=>{const o=t.dataTransfer;let i="";o.getData("text/html")?i=function(e){return e.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(e,t)=>1==t.length?" ":t)}(o.getData("text/html")):o.getData("text/plain")&&(i=function(e){return(e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>").replace(/^\s/,"&nbsp;").replace(/\s$/,"&nbsp;").replace(/\s\s/g," &nbsp;")).indexOf("</p><p>")>-1&&(e=`<p>${e}</p>`),e}(o.getData("text/plain"))),i=this._htmlDataProcessor.toView(i),this.fire("inputTransformation",{content:i,dataTransfer:o}),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(e,t)=>{if(!t.content.isEmpty){const e=this.editor.data,n=this.editor.model,o=e.toModel(t.content,"$clipboardHolder");if(0==o.childCount)return;n.insertContent(o)}},{priority:"low"}),this.listenTo(o,"copy",i,{priority:"low"}),this.listenTo(o,"cut",(t,n)=>{e.isReadOnly?n.preventDefault():i(t,n)},{priority:"low"}),this.listenTo(o,"clipboardOutput",(n,o)=>{o.content.isEmpty||(o.dataTransfer.setData("text/html",this._htmlDataProcessor.toData(o.content)),o.dataTransfer.setData("text/plain",function e(t){let n="";if(t.is("text")||t.is("textProxy"))n=t.data;else if(t.is("img")&&t.hasAttribute("alt"))n=t.getAttribute("alt");else{let o=null;for(const i of t.getChildren()){const t=e(i);o&&(o.is("containerElement")||i.is("containerElement"))&&(dh.includes(o.name)||dh.includes(i.name)?n+="\n":n+="\n\n"),n+=t,o=i}}return n}(o.content))),"cut"==o.method&&e.model.deleteContent(t.selection)},{priority:"low"})}}class hh{constructor(e){this.editor=e}destroy(){this.stopListening()}}lo(hh,Ho);class fh{constructor(e){this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",e=>{this.isEnabled||e.stop()},{priority:"high"}),this.listenTo(e,"change:isReadOnly",(e,t,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",ph,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",ph),this.refresh())}execute(){}destroy(){this.stopListening()}}function ph(e){e.return=!1,e.stop()}lo(fh,Ho);class mh extends fh{execute(){const e=this.editor.model,t=e.document;e.change(n=>{!function(e,t,n,o){const i=n.isCollapsed,r=n.getFirstRange(),s=r.start.parent,a=r.end.parent;if(o.isLimit(s)||o.isLimit(a))return void(i||s!=a||e.deleteContent(n));if(i)gh(t,r.start);else{const o=!(r.start.isAtStart&&r.end.isAtEnd),i=s==a;e.deleteContent(n,{leaveUnmerged:o}),o&&(i?gh(t,n.focus):t.setSelection(a,0))}}(this.editor.model,n,t.selection,e.schema),this.fire("afterExecute",{writer:n})})}}function gh(e,t){e.split(t),e.setSelection(t.parent.nextSibling,0)}class bh extends fr{constructor(e){super(e);const t=this.document;t.on("keydown",(e,n)=>{if(this.isEnabled&&n.keyCode==wi.enter){let o;t.once("enter",e=>o=e,{priority:"highest"}),t.fire("enter",new es(t,n.domEvent,{isSoft:n.shiftKey})),o&&o.stop.called&&e.stop()}})}observe(){}}class wh extends hh{static get pluginName(){return"Enter"}init(){const e=this.editor,t=e.editing.view,n=t.document;t.addObserver(bh),e.commands.add("enter",new mh(e)),this.listenTo(n,"enter",(n,o)=>{o.preventDefault(),o.isSoft||(e.execute("enter"),t.scrollToTheSelection())},{priority:"low"})}}class _h extends fh{execute(){const e=this.editor.model,t=e.document;e.change(n=>{!function(e,t,n){const o=n.isCollapsed,i=n.getFirstRange(),r=i.start.parent,s=i.end.parent,a=r==s;if(o)kh(t,i.end);else{const o=!(i.start.isAtStart&&i.end.isAtEnd);e.deleteContent(n,{leaveUnmerged:o}),a?kh(t,n.focus):o&&t.setSelection(s,0)}}(e,n,t.selection),this.fire("afterExecute",{writer:n})})}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=function(e,t){if(t.rangeCount>1)return!1;const n=t.anchor;if(!n||!e.checkChild(n,"softBreak"))return!1;const o=t.getFirstRange(),i=o.start.parent,r=o.end.parent;if((vh(i,e)||vh(r,e))&&i!==r)return!1;return!0}(e.schema,t.selection)}}function kh(e,t){const n=e.createElement("softBreak");e.insert(n,t),e.setSelection(n,"after")}function vh(e,t){return!e.is("rootElement")&&(t.isLimit(e)||vh(e.parent,t))}class yh extends hh{static get pluginName(){return"ShiftEnter"}init(){const e=this.editor,t=e.model.schema,n=e.conversion,o=e.editing.view,i=o.document;t.register("softBreak",{allowWhere:"$text",isInline:!0}),n.for("upcast").elementToElement({model:"softBreak",view:"br"}),n.for("downcast").elementToElement({model:"softBreak",view:(e,t)=>t.createEmptyElement("br")}),o.addObserver(bh),e.commands.add("shiftEnter",new _h(e)),this.listenTo(i,"enter",(t,n)=>{n.preventDefault(),n.isSoft&&(e.execute("shiftEnter"),o.scrollToTheSelection())},{priority:"low"})}}class xh{constructor(e){this.editor=e}destroy(){this.stopListening()}}lo(xh,Ho);class Ch{constructor(e){this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",e=>{this.isEnabled||e.stop()},{priority:"high"}),this.listenTo(e,"change:isReadOnly",(e,t,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",Ah,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",Ah),this.refresh())}execute(){}destroy(){this.stopListening()}}function Ah(e){e.return=!1,e.stop()}lo(Ch,Ho);class Ph{constructor(e,t=20){this.model=e,this.size=0,this.limit=t,this.isLocked=!1,this._changeCallback=((e,t)=>{"transparent"!=t.type&&t!==this._batch&&this._reset(!0)}),this._selectionChangeCallback=(()=>{this._reset()}),this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch()),this._batch}input(e){this.size+=e,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(e){this.isLocked&&!e||(this._batch=null,this.size=0)}}class Eh extends Ch{constructor(e,t){super(e),this._buffer=new Ph(e.model,t)}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,n=t.document,o=e.text||"",i=o.length,r=e.range||n.selection.getFirstRange(),s=e.resultRange;t.enqueueChange(this._buffer.batch,e=>{const a=r.isCollapsed;this._buffer.lock(),a||t.deleteContent(t.createSelection(r)),o&&e.insertText(o,n.selection.getAttributes(),r.start),s?e.setSelection(s):a&&e.setSelection(r.start.getShiftedBy(i)),this._buffer.unlock(),this._buffer.input(i)})}}function Th(e){let t=null;const n=e.model,o=e.editing.view,i=e.commands.get("input");function r(){const e=i.buffer;e.lock(),n.enqueueChange(e.batch,()=>{n.deleteContent(n.document.selection)}),e.unlock()}o.document.on("keydown",(e,s)=>(function(e){const s=n.document,a=o.document.isComposing,c=t&&t.isEqual(s.selection);if(t=null,!i.isEnabled)return;if(function(e){if(e.ctrlKey)return!0;return Sh.includes(e.keyCode)}(e)||s.selection.isCollapsed)return;if(a&&229===e.keyCode)return;if(!a&&229===e.keyCode&&c)return;r()})(s),{priority:"lowest"}),o.document.on("compositionstart",function(){const e=n.document,t=1!==e.selection.rangeCount||e.selection.getFirstRange().isFlat;if(e.selection.isCollapsed||t)return;r()},{priority:"lowest"}),o.document.on("compositionend",()=>{t=n.createSelection(n.document.selection)},{priority:"lowest"})}const Sh=[_i("arrowUp"),_i("arrowRight"),_i("arrowDown"),_i("arrowLeft"),9,16,17,18,19,20,27,33,34,35,36,45,91,93,144,145,173,174,175,176,177,178,179,255];for(let e=112;e<=135;e++)Sh.push(e);function Rh(e){if(0==e.length)return!1;for(const t of e)if("children"===t.type&&!Oh(t))return!0;return!1}function Oh(e){if(e.newChildren.length-e.oldChildren.length!=1)return;const t=function(e,t){const n=[];let o,i=0;return e.forEach(e=>{"equal"==e?(r(),i++):"insert"==e?(s("insert")?o.values.push(t[i]):(r(),o={type:"insert",index:i,values:[t[i]]}),i++):s("delete")?o.howMany++:(r(),o={type:"delete",index:i,howMany:1})}),r(),n;function r(){o&&(n.push(o),o=null)}function s(e){return o&&o.type==e}}(Zi(e.oldChildren,e.newChildren,Ih),e.newChildren);if(t.length>1)return;const n=t[0];return n.values[0]&&n.values[0].is("text")?n:void 0}function Ih(e,t){return e&&e.is("text")&&t&&t.is("text")?e.data===t.data:e===t}class Dh{constructor(e){this.editor=e,this.editing=this.editor.editing}handle(e,t){if(Rh(e))this._handleContainerChildrenMutations(e,t);else for(const n of e)this._handleTextMutation(n,t),this._handleTextNodeInsertion(n)}_handleContainerChildrenMutations(e,t){const n=function(e){const t=e.map(e=>e.node).reduce((e,t)=>e.getCommonAncestor(t,{includeSelf:!0}));if(!t)return;return t.getAncestors({includeSelf:!0,parentFirst:!0}).find(e=>e.is("containerElement")||e.is("rootElement"))}(e);if(!n)return;const o=this.editor.editing.view.domConverter.mapViewToDom(n),i=new sr,r=this.editor.data.toModel(i.domToView(o)).getChild(0),s=this.editor.editing.mapper.toModelElement(n);if(!s)return;const a=Array.from(r.getChildren()),c=Array.from(s.getChildren()),l=a[a.length-1],d=c[c.length-1];l&&l.is("softBreak")&&d&&!d.is("softBreak")&&a.pop();const u=this.editor.model.schema;if(!Mh(a,u)||!Mh(c,u))return;const h=a.map(e=>e.is("text")?e.data:"@").join("").replace(/\u00A0/g," "),f=c.map(e=>e.is("text")?e.data:"@").join("").replace(/\u00A0/g," ");if(f===h)return;const p=Zi(f,h),{firstChangeAt:m,insertions:g,deletions:b}=Nh(p);let w=null;t&&(w=this.editing.mapper.toModelRange(t.getFirstRange()));const _=h.substr(m,g),k=this.editor.model.createRange(this.editor.model.createPositionAt(s,m),this.editor.model.createPositionAt(s,m+b));this.editor.execute("input",{text:_,range:k,resultRange:w})}_handleTextMutation(e,t){if("text"!=e.type)return;const n=e.newText.replace(/\u00A0/g," "),o=e.oldText.replace(/\u00A0/g," ");if(o===n)return;const i=Zi(o,n),{firstChangeAt:r,insertions:s,deletions:a}=Nh(i);let c=null;t&&(c=this.editing.mapper.toModelRange(t.getFirstRange()));const l=this.editing.view.createPositionAt(e.node,r),d=this.editing.mapper.toModelPosition(l),u=this.editor.model.createRange(d,d.getShiftedBy(a)),h=n.substr(r,s);this.editor.execute("input",{text:h,range:u,resultRange:c})}_handleTextNodeInsertion(e){if("children"!=e.type)return;const t=Oh(e),n=this.editing.view.createPositionAt(e.node,t.index),o=this.editing.mapper.toModelPosition(n),i=t.values[0].data;this.editor.execute("input",{text:i.replace(/\u00A0/g," "),range:this.editor.model.createRange(o)})}}function Mh(e,t){return e.every(e=>t.isInline(e))}function Nh(e){let t=null,n=null;for(let o=0;o<e.length;o++){"equal"!=e[o]&&(t=null===t?o:t,n=o)}let o=0,i=0;for(let r=t;r<=n;r++)"insert"!=e[r]&&o++,"delete"!=e[r]&&i++;return{insertions:i,deletions:o,firstChangeAt:t}}class Fh extends xh{static get pluginName(){return"Input"}init(){const e=this.editor,t=new Eh(e,e.config.get("typing.undoStep")||20);e.commands.add("input",t),Th(e),function(e){e.editing.view.document.on("mutations",(t,n,o)=>{new Dh(e).handle(n,o)})}(e)}}class Bh extends Ch{constructor(e,t){super(e),this.direction=t,this._buffer=new Ph(e.model,e.config.get("typing.undoStep"))}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model,n=t.document;t.enqueueChange(this._buffer.batch,o=>{this._buffer.lock();const i=o.createSelection(n.selection),r=i.isCollapsed;if(i.isCollapsed&&t.modifySelection(i,{direction:this.direction,unit:e.unit}),this._shouldEntireContentBeReplacedWithParagraph(e.sequence||1))return void this._replaceEntireContentWithParagraph(o);if(i.isCollapsed)return;let s=0;i.getFirstRange().getMinimalFlatRanges().forEach(e=>{s+=oi(e.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),t.deleteContent(i,{doNotResetEntireContent:r}),this._buffer.input(s),o.setSelection(i),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const t=this.editor.model,n=t.document.selection,o=t.schema.getLimitElement(n);if(!(n.isCollapsed&&n.containsEntireContent(o)))return!1;if(!t.schema.checkChild(o,"paragraph"))return!1;const i=o.getChild(0);return!i||"paragraph"!==i.name}_replaceEntireContentWithParagraph(e){const t=this.editor.model,n=t.document.selection,o=t.schema.getLimitElement(n),i=e.createElement("paragraph");e.remove(e.createRangeIn(o)),e.insert(i,o),e.setSelection(i,0)}}class Vh extends fr{constructor(e){super(e);const t=e.document;let n=0;t.on("keyup",(e,t)=>{t.keyCode!=wi.delete&&t.keyCode!=wi.backspace||(n=0)}),t.on("keydown",(e,o)=>{const i={};if(o.keyCode==wi.delete)i.direction="forward",i.unit="character";else{if(o.keyCode!=wi.backspace)return;i.direction="backward",i.unit="codePoint"}const r=mi.isMac?o.altKey:o.ctrlKey;let s;i.unit=r?"word":i.unit,i.sequence=++n,t.once("delete",e=>s=e,{priority:Number.POSITIVE_INFINITY});const a=new es(t,o.domEvent,i);t.fire("delete",a),s&&s.stop.called&&e.stop()})}observe(){}}function Lh(e){const t=e.model,n=e.editing.view,o=200;let i=null,r=t.createSelection(t.document.selection),s=Date.now();t.document.selection.on("change",function(e){const n=t.createSelection(e.source);r.isEqual(n)||(i=r,r=n,s=Date.now())}),n.document.on("mutations",function(n,a){Rh(a)&&function(e){for(const t of e){if("children"!==t.type)continue;const e=t.oldChildren,n=t.newChildren;if(!zh(e))continue;const o=Zi(e,n),i=o.some(e=>"delete"===e),r=o.some(e=>"insert"===e);if(i&&!r)return!0}return!1}(a)&&(!function(){Date.now()-s<o&&i&&!i.isCollapsed&&r.isCollapsed&&r.getLastPosition().isEqual(i.getLastPosition())&&t.enqueueChange(e=>{e.setSelection(i)});e.execute("delete")}(),n.stop())},{priority:"highest"})}function zh(e){return e.every(e=>e.is("containerElement"))}class qh extends xh{static get pluginName(){return"Delete"}init(){const e=this.editor,t=e.editing.view,n=t.document;t.addObserver(Vh),e.commands.add("forwardDelete",new Bh(e,"forward")),e.commands.add("delete",new Bh(e,"backward")),this.listenTo(n,"delete",(n,o)=>{e.execute("forward"==o.direction?"forwardDelete":"delete",{unit:o.unit,sequence:o.sequence}),o.preventDefault(),t.scrollToTheSelection()}),Lh(e)}}class jh extends xh{static get requires(){return[Fh,qh]}static get pluginName(){return"Typing"}}class Hh{constructor(e){this.editor=e}destroy(){this.stopListening()}}lo(Hh,Ho);class Uh{constructor(e){this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",e=>{this.isEnabled||e.stop()},{priority:"high"}),this.listenTo(e,"change:isReadOnly",(e,t,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",Wh,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",Wh),this.refresh())}execute(){}destroy(){this.stopListening()}}function Wh(e){e.return=!1,e.stop()}lo(Uh,Ho);class $h extends Za{get type(){return"noop"}clone(){return new $h(this.baseVersion)}getReversed(){return new $h(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}const Gh=new Map;function Kh(e,t,n){let o=Gh.get(e);o||(o=new Map,Gh.set(e,o)),o.set(t,n)}function Jh(e){return[e]}function Zh(e,t,n={}){const o=function(e,t){const n=Gh.get(e);return n&&n.has(t)?n.get(t):Jh}(e.constructor,t.constructor);try{return o(e=e.clone(),t,n)}catch(o){throw ws.a.error("Error during operation transformation!",o.message),ws.a.error("Transformed operation",e),ws.a.error("Operation transformed by",t),ws.a.error("context.aIsStrong",n.aIsStrong),ws.a.error("context.aWasUndone",n.aWasUndone),ws.a.error("context.bWasUndone",n.bWasUndone),ws.a.error("context.abRelation",n.abRelation),ws.a.error("context.baRelation",n.baRelation),o}}function Qh(e,t,n){if(e=e.slice(),t=t.slice(),0==e.length||0==t.length)return{operationsA:e,operationsB:t};const o=new WeakMap;for(const t of e)o.set(t,0);const i={nextBaseVersionA:e[e.length-1].baseVersion+1,nextBaseVersionB:t[t.length-1].baseVersion+1,originalOperationsACount:e.length,originalOperationsBCount:t.length},r=new Yh(n.document,n.useRelations,n.forceWeakRemove);r.setOriginalOperations(e),r.setOriginalOperations(t);let s=0;for(;s<e.length;){const n=e[s],i=o.get(n);if(i==t.length){s++;continue}const a=t[i],c=Zh(n,a,r.getContext(n,a,!0)),l=Zh(a,n,r.getContext(a,n,!1));r.updateRelation(n,a),r.setOriginalOperations(c,n),r.setOriginalOperations(l,a);for(const e of c)o.set(e,i+l.length);e.splice(s,1,...c),t.splice(i,1,...l)}if(n.padWithNoOps){const n=e.length-i.originalOperationsACount,o=t.length-i.originalOperationsBCount;ef(e,o-n),ef(t,n-o)}return Xh(e,i.nextBaseVersionB),Xh(t,i.nextBaseVersionA),{operationsA:e,operationsB:t}}class Yh{constructor(e,t,n=!1){this._history=e.history,this._useRelations=t,this._forceWeakRemove=!!n,this._originalOperations=new Map,this._relations=new Map}setOriginalOperations(e,t=null){const n=t?this._originalOperations.get(t):null;for(const t of e)this._originalOperations.set(t,n||t)}updateRelation(e,t){switch(e.constructor){case cc:switch(t.constructor){case fc:e.targetPosition.isEqual(t.sourcePosition)||t.movedRange.containsPosition(e.targetPosition)?this._setRelation(e,t,"insertAtSource"):e.targetPosition.isEqual(t.deletionPosition)?this._setRelation(e,t,"insertBetween"):e.targetPosition.isAfter(t.sourcePosition)&&this._setRelation(e,t,"moveTargetAfter");break;case cc:e.targetPosition.isEqual(t.sourcePosition)||e.targetPosition.isBefore(t.sourcePosition)?this._setRelation(e,t,"insertBefore"):this._setRelation(e,t,"insertAfter")}break;case pc:switch(t.constructor){case fc:e.splitPosition.isBefore(t.sourcePosition)&&this._setRelation(e,t,"splitBefore");break;case cc:(e.splitPosition.isEqual(t.sourcePosition)||e.splitPosition.isBefore(t.sourcePosition))&&this._setRelation(e,t,"splitBefore")}break;case fc:switch(t.constructor){case fc:e.targetPosition.isEqual(t.sourcePosition)||this._setRelation(e,t,"mergeTargetNotMoved"),e.sourcePosition.isEqual(t.targetPosition)&&this._setRelation(e,t,"mergeSourceNotMoved"),e.sourcePosition.isEqual(t.sourcePosition)&&this._setRelation(e,t,"mergeSameElement");break;case pc:e.sourcePosition.isEqual(t.splitPosition)&&this._setRelation(e,t,"splitAtSource")}break;case dc:{const n=e.newRange;if(!n)return;switch(t.constructor){case cc:{const o=Js._createFromPositionAndShift(t.sourcePosition,t.howMany),i=o.containsPosition(n.start)||o.start.isEqual(n.start),r=o.containsPosition(n.end)||o.end.isEqual(n.end);!i&&!r||o.containsRange(n)||this._setRelation(e,t,{side:i?"left":"right",path:i?n.start.path.slice():n.end.path.slice()});break}case fc:{const o=n.start.isEqual(t.targetPosition),i=n.start.isEqual(t.deletionPosition),r=n.end.isEqual(t.deletionPosition),s=n.end.isEqual(t.sourcePosition);(o||i||r||s)&&this._setRelation(e,t,{wasInLeftElement:o,wasStartBeforeMergedElement:i,wasEndBeforeMergedElement:r,wasInRightElement:s});break}}break}}}getContext(e,t,n){return{aIsStrong:n,aWasUndone:this._wasUndone(e),bWasUndone:this._wasUndone(t),abRelation:this._useRelations?this._getRelation(e,t):null,baRelation:this._useRelations?this._getRelation(t,e):null,forceWeakRemove:this._forceWeakRemove}}_wasUndone(e){const t=this._originalOperations.get(e);return t.wasUndone||this._history.isUndoneOperation(t)}_getRelation(e,t){const n=this._originalOperations.get(t),o=this._history.getUndoneOperation(n);if(!o)return null;const i=this._originalOperations.get(e),r=this._relations.get(i);return r&&r.get(o)||null}_setRelation(e,t,n){const o=this._originalOperations.get(e),i=this._originalOperations.get(t);let r=this._relations.get(o);r||(r=new Map,this._relations.set(o,r)),r.set(i,n)}}function Xh(e,t){for(const n of e)n.baseVersion=t++}function ef(e,t){for(let n=0;n<t;n++)e.push(new $h(0))}function tf(e,t,n){const o=e.nodes.getNode(0).getAttribute(t);if(o==n)return null;const i=new Js(e.position,e.position.getShiftedBy(e.howMany));return new sc(i,t,o,n,0)}function nf(e,t){return null===e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany)}function of(e,t){const n=[];for(let o=0;o<e.length;o++){const i=e[o],r=new cc(i.start,i.end.offset-i.start.offset,t,0);n.push(r);for(let t=o+1;t<e.length;t++)e[t]=e[t]._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)[0];t=t._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)}return n}Kh(sc,sc,(e,t,n)=>{if(e.key===t.key){const o=e.range.getDifference(t.range).map(t=>new sc(t,e.key,e.oldValue,e.newValue,0)),i=e.range.getIntersection(t.range);return i&&n.aIsStrong&&o.push(new sc(i,t.key,t.newValue,e.newValue,0)),0==o.length?[new $h(0)]:o}return[e]}),Kh(sc,lc,(e,t)=>{if(e.range.start.hasSameParentAs(t.position)&&e.range.containsPosition(t.position)){const n=e.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes).map(t=>new sc(t,e.key,e.oldValue,e.newValue,e.baseVersion));if(t.shouldReceiveAttributes){const o=tf(t,e.key,e.oldValue);o&&n.unshift(o)}return n}return e.range=e.range._getTransformedByInsertion(t.position,t.howMany,!1)[0],[e]}),Kh(sc,fc,(e,t)=>{const n=[];e.range.start.hasSameParentAs(t.deletionPosition)&&(e.range.containsPosition(t.deletionPosition)||e.range.start.isEqual(t.deletionPosition))&&n.push(Js._createFromPositionAndShift(t.graveyardPosition,1));const o=e.range._getTransformedByMergeOperation(t);return o.isCollapsed||n.push(o),n.map(t=>new sc(t,e.key,e.oldValue,e.newValue,e.baseVersion))}),Kh(sc,cc,(e,t)=>{return function(e,t){const n=Js._createFromPositionAndShift(t.sourcePosition,t.howMany);let o=null,i=[];n.containsRange(e,!0)?o=e:e.start.hasSameParentAs(n.start)?(i=e.getDifference(n),o=e.getIntersection(n)):i=[e];const r=[];for(let e of i){e=e._getTransformedByDeletion(t.sourcePosition,t.howMany);const n=t.getMovedRangeStart(),o=e.start.hasSameParentAs(n);e=e._getTransformedByInsertion(n,t.howMany,o),r.push(...e)}o&&r.push(o._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,!1)[0]);return r}(e.range,t).map(t=>new sc(t,e.key,e.oldValue,e.newValue,e.baseVersion))}),Kh(sc,pc,(e,t)=>{if(e.range.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.range.end.offset++,[e];if(e.range.start.hasSameParentAs(t.splitPosition)&&e.range.containsPosition(t.splitPosition)){const n=e.clone();return n.range=new Js(t.moveTargetPosition.clone(),e.range.end._getCombined(t.splitPosition,t.moveTargetPosition)),e.range.end=t.splitPosition.clone(),e.range.end.stickiness="toPrevious",[e,n]}return e.range=e.range._getTransformedBySplitOperation(t),[e]}),Kh(lc,sc,(e,t)=>{const n=[e];if(e.shouldReceiveAttributes&&e.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(e.position)){const o=tf(e,t.key,t.newValue);o&&n.push(o)}return n}),Kh(lc,lc,(e,t,n)=>e.position.isEqual(t.position)&&n.aIsStrong?[e]:(e.position=e.position._getTransformedByInsertOperation(t),[e])),Kh(lc,cc,(e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e])),Kh(lc,pc,(e,t)=>(e.position=e.position._getTransformedBySplitOperation(t),[e])),Kh(lc,fc,(e,t)=>(e.position=e.position._getTransformedByMergeOperation(t),[e])),Kh(dc,lc,(e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByInsertOperation(t)[0]),e.newRange&&(e.newRange=e.newRange._getTransformedByInsertOperation(t)[0]),[e])),Kh(dc,dc,(e,t,n)=>{if(e.name==t.name){if(!n.aIsStrong)return[new $h(0)];e.oldRange=t.newRange?t.newRange.clone():null}return[e]}),Kh(dc,fc,(e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByMergeOperation(t)),e.newRange&&(e.newRange=e.newRange._getTransformedByMergeOperation(t)),[e])),Kh(dc,cc,(e,t,n)=>{if(e.oldRange&&(e.oldRange=Js._createFromRanges(e.oldRange._getTransformedByMoveOperation(t))),e.newRange){if(n.abRelation){const o=Js._createFromRanges(e.newRange._getTransformedByMoveOperation(t));if("left"==n.abRelation.side&&t.targetPosition.isEqual(e.newRange.start))return e.newRange.start.path=n.abRelation.path,e.newRange.end=o.end,[e];if("right"==n.abRelation.side&&t.targetPosition.isEqual(e.newRange.end))return e.newRange.start=o.start,e.newRange.end.path=n.abRelation.path,[e]}e.newRange=Js._createFromRanges(e.newRange._getTransformedByMoveOperation(t))}return[e]}),Kh(dc,pc,(e,t,n)=>{if(e.oldRange&&(e.oldRange=e.oldRange._getTransformedBySplitOperation(t)),e.newRange){if(n.abRelation){const o=e.newRange._getTransformedBySplitOperation(t);return e.newRange.start.isEqual(t.splitPosition)&&n.abRelation.wasStartBeforeMergedElement?e.newRange.start=Ks._createAt(t.insertionPosition):e.newRange.start.isEqual(t.splitPosition)&&!n.abRelation.wasInLeftElement&&(e.newRange.start=Ks._createAt(t.moveTargetPosition)),e.newRange.end.isEqual(t.splitPosition)&&n.abRelation.wasInRightElement?e.newRange.end=Ks._createAt(t.moveTargetPosition):e.newRange.end.isEqual(t.splitPosition)&&n.abRelation.wasEndBeforeMergedElement?e.newRange.end=Ks._createAt(t.insertionPosition):e.newRange.end=o.end,[e]}e.newRange=e.newRange._getTransformedBySplitOperation(t)}return[e]}),Kh(fc,lc,(e,t)=>(e.sourcePosition.hasSameParentAs(t.position)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByInsertOperation(t),e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t),[e])),Kh(fc,fc,(e,t,n)=>{if(e.sourcePosition.isEqual(t.sourcePosition)&&e.targetPosition.isEqual(t.targetPosition)){if(n.bWasUndone){const n=t.graveyardPosition.path.slice();return n.push(0),e.sourcePosition=new Ks(t.graveyardPosition.root,n),e.howMany=0,[e]}return[new $h(0)]}if(e.sourcePosition.isEqual(t.sourcePosition)&&!e.targetPosition.isEqual(t.targetPosition)&&!n.bWasUndone&&"splitAtSource"!=n.abRelation){const o="$graveyard"==e.targetPosition.root.rootName,i="$graveyard"==t.targetPosition.root.rootName;if(i&&!o||!(o&&!i)&&n.aIsStrong){const n=t.targetPosition._getTransformedByMergeOperation(t),o=e.targetPosition._getTransformedByMergeOperation(t);return[new cc(n,e.howMany,o,0)]}return[new $h(0)]}return e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMergeOperation(t),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),e.graveyardPosition.isEqual(t.graveyardPosition)&&n.aIsStrong||(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]}),Kh(fc,cc,(e,t,n)=>{const o=Js._createFromPositionAndShift(t.sourcePosition,t.howMany);return"remove"==t.type&&!n.bWasUndone&&!n.forceWeakRemove&&e.deletionPosition.hasSameParentAs(t.sourcePosition)&&o.containsPosition(e.sourcePosition)?[new $h(0)]:(e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition.hasSameParentAs(t.sourcePosition)&&(e.howMany-=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMoveOperation(t),e.targetPosition=e.targetPosition._getTransformedByMoveOperation(t),e.graveyardPosition.isEqual(t.targetPosition)||(e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)),[e])}),Kh(fc,pc,(e,t,n)=>{if(t.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1),e.deletionPosition.isEqual(t.graveyardPosition)&&(e.howMany=t.howMany)),e.targetPosition.isEqual(t.splitPosition)){const o=0!=t.howMany,i=t.graveyardPosition&&e.deletionPosition.isEqual(t.graveyardPosition);if(o||i||"mergeTargetNotMoved"==n.abRelation)return e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),[e]}if(e.sourcePosition.isEqual(t.splitPosition)){if("mergeSourceNotMoved"==n.abRelation)return e.howMany=0,e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e];if("mergeSameElement"==n.abRelation||e.sourcePosition.offset>0)return e.sourcePosition=t.moveTargetPosition.clone(),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}return e.sourcePosition.hasSameParentAs(t.splitPosition)&&(e.howMany=t.splitPosition.offset),e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}),Kh(cc,lc,(e,t)=>{const n=Js._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByInsertOperation(t,!1)[0];return e.sourcePosition=n.start,e.howMany=n.end.offset-n.start.offset,e.targetPosition.isEqual(t.position)||(e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)),[e]}),Kh(cc,cc,(e,t,n)=>{const o=Js._createFromPositionAndShift(e.sourcePosition,e.howMany),i=Js._createFromPositionAndShift(t.sourcePosition,t.howMany);let r,s=n.aIsStrong,a=!n.aIsStrong;if("insertBefore"==n.abRelation||"insertAfter"==n.baRelation?a=!0:"insertAfter"!=n.abRelation&&"insertBefore"!=n.baRelation||(a=!1),r=e.targetPosition.isEqual(t.targetPosition)&&a?e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany):e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),nf(e,t)&&nf(t,e))return[t.getReversed()];if(o.containsPosition(t.targetPosition)&&o.containsRange(i,!0))return o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),of([o],r);if(i.containsPosition(e.targetPosition)&&i.containsRange(o,!0))return o.start=o.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),o.end=o.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),of([o],r);const c=uo(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if("prefix"==c||"extension"==c)return o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),of([o],r);"remove"!=e.type||"remove"==t.type||n.aWasUndone||n.forceWeakRemove?"remove"==e.type||"remove"!=t.type||n.bWasUndone||n.forceWeakRemove||(s=!1):s=!0;const l=[],d=o.getDifference(i);for(const e of d){e.start=e.start._getTransformedByDeletion(t.sourcePosition,t.howMany),e.end=e.end._getTransformedByDeletion(t.sourcePosition,t.howMany);const n="same"==uo(e.start.getParentPath(),t.getMovedRangeStart().getParentPath()),o=e._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,n);l.push(...o)}const u=o.getIntersection(i);return null!==u&&s&&(u.start=u.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),u.end=u.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),0===l.length?l.push(u):1==l.length?i.start.isBefore(o.start)||i.start.isEqual(o.start)?l.unshift(u):l.push(u):l.splice(1,0,u)),0===l.length?[new $h(e.baseVersion)]:of(l,r)}),Kh(cc,pc,(e,t,n)=>{let o=e.targetPosition.clone();e.targetPosition.isEqual(t.insertionPosition)&&t.graveyardPosition&&"moveTargetAfter"!=n.abRelation||(o=e.targetPosition._getTransformedBySplitOperation(t));const i=Js._createFromPositionAndShift(e.sourcePosition,e.howMany);if(i.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.howMany++,e.targetPosition=o,[e];if(i.start.hasSameParentAs(t.splitPosition)&&i.containsPosition(t.splitPosition)){let e=new Js(t.splitPosition,i.end);return e=e._getTransformedBySplitOperation(t),of([new Js(i.start,t.splitPosition),e],o)}e.targetPosition.isEqual(t.splitPosition)&&"insertAtSource"==n.abRelation&&(o=t.moveTargetPosition),e.targetPosition.isEqual(t.insertionPosition)&&"insertBetween"==n.abRelation&&(o=e.targetPosition);const r=[i._getTransformedBySplitOperation(t)];if(t.graveyardPosition){const o=i.start.isEqual(t.graveyardPosition)||i.containsPosition(t.graveyardPosition);e.howMany>1&&o&&!n.aWasUndone&&r.push(Js._createFromPositionAndShift(t.insertionPosition,1))}return of(r,o)}),Kh(cc,fc,(e,t,n)=>{const o=Js._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&o.containsPosition(t.sourcePosition))if("remove"!=e.type||n.forceWeakRemove){if(1==e.howMany)return n.bWasUndone?(e.sourcePosition=t.graveyardPosition.clone(),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]):[new $h(0)]}else if(!n.aWasUndone){const n=[];let o=t.graveyardPosition.clone(),i=t.targetPosition._getTransformedByMergeOperation(t);e.howMany>1&&(n.push(new cc(e.sourcePosition,e.howMany-1,e.targetPosition,0)),o=o._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1),i=i._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1));const r=t.deletionPosition._getCombined(e.sourcePosition,e.targetPosition),s=new cc(o,1,r,0),a=s.getMovedRangeStart().path.slice();a.push(0);const c=new Ks(s.targetPosition.root,a);i=i._getTransformedByMove(o,r,1);const l=new cc(i,t.howMany,c,0);return n.push(s),n.push(l),n}const i=Js._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByMergeOperation(t);return e.sourcePosition=i.start,e.howMany=i.end.offset-i.start.offset,e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]}),Kh(uc,lc,(e,t)=>(e.position=e.position._getTransformedByInsertOperation(t),[e])),Kh(uc,fc,(e,t)=>e.position.isEqual(t.deletionPosition)?(e.position=t.graveyardPosition.clone(),e.position.stickiness="toNext",[e]):(e.position=e.position._getTransformedByMergeOperation(t),[e])),Kh(uc,cc,(e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e])),Kh(uc,uc,(e,t,n)=>{if(e.position.isEqual(t.position)){if(!n.aIsStrong)return[new $h(0)];e.oldName=t.newName}return[e]}),Kh(uc,pc,(e,t)=>{if("same"==uo(e.position.path,t.splitPosition.getParentPath())&&!t.graveyardPosition){return[e,new uc(e.position.getShiftedBy(1),e.oldName,e.newName,0)]}return e.position=e.position._getTransformedBySplitOperation(t),[e]}),Kh(hc,hc,(e,t,n)=>{if(e.root===t.root&&e.key===t.key){if(!n.aIsStrong||e.newValue===t.newValue)return[new $h(0)];e.oldValue=t.newValue}return[e]}),Kh(pc,lc,(e,t)=>(e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset<t.position.offset&&(e.howMany+=t.howMany),e.splitPosition=e.splitPosition._getTransformedByInsertOperation(t),e.insertionPosition=pc.getInsertionPosition(e.splitPosition),[e])),Kh(pc,fc,(e,t,n)=>{if(!e.graveyardPosition&&!n.bWasUndone&&e.splitPosition.hasSameParentAs(t.sourcePosition)){const n=t.graveyardPosition.path.slice();n.push(0);const o=new Ks(t.graveyardPosition.root,n),i=pc.getInsertionPosition(new Ks(t.graveyardPosition.root,n)),r=new pc(o,0,null,0);return r.insertionPosition=i,e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=pc.getInsertionPosition(e.splitPosition),e.graveyardPosition=r.insertionPosition.clone(),e.graveyardPosition.stickiness="toNext",[r,e]}return e.splitPosition.hasSameParentAs(t.deletionPosition)&&!e.splitPosition.isAfter(t.deletionPosition)&&e.howMany--,e.splitPosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=pc.getInsertionPosition(e.splitPosition),e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]}),Kh(pc,cc,(e,t,n)=>{const o=Js._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.graveyardPosition){const i=o.start.isEqual(e.graveyardPosition)||o.containsPosition(e.graveyardPosition);if(!n.bWasUndone&&i){const n=e.splitPosition._getTransformedByMoveOperation(t),o=e.graveyardPosition._getTransformedByMoveOperation(t),i=o.path.slice();i.push(0);const r=new Ks(o.root,i);return[new cc(n,e.howMany,r,0)]}e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&o.containsPosition(e.splitPosition)){const n=t.howMany-(e.splitPosition.offset-t.sourcePosition.offset);return e.howMany-=n,e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset<t.targetPosition.offset&&(e.howMany+=t.howMany),e.splitPosition=t.sourcePosition.clone(),e.insertionPosition=pc.getInsertionPosition(e.splitPosition),[e]}return!e.splitPosition.isEqual(t.targetPosition)||"insertAtSource"!=n.baRelation&&"splitBefore"!=n.abRelation?(t.sourcePosition.isEqual(t.targetPosition)||(e.splitPosition.hasSameParentAs(t.sourcePosition)&&e.splitPosition.offset<=t.sourcePosition.offset&&(e.howMany-=t.howMany),e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset<t.targetPosition.offset&&(e.howMany+=t.howMany)),e.splitPosition.stickiness="toNone",e.splitPosition=e.splitPosition._getTransformedByMoveOperation(t),e.splitPosition.stickiness="toNext",e.graveyardPosition?e.insertionPosition=e.insertionPosition._getTransformedByMoveOperation(t):e.insertionPosition=pc.getInsertionPosition(e.splitPosition),[e]):(e.howMany+=t.howMany,e.splitPosition=e.splitPosition._getTransformedByDeletion(t.sourcePosition,t.howMany),e.insertionPosition=pc.getInsertionPosition(e.splitPosition),[e])}),Kh(pc,pc,(e,t,n)=>{if(e.splitPosition.isEqual(t.splitPosition)){if(!e.graveyardPosition&&!t.graveyardPosition)return[new $h(0)];if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition))return[new $h(0)];if("splitBefore"==n.abRelation)return e.howMany=0,e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t),[e]}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){const o="$graveyard"==e.splitPosition.root.rootName,i="$graveyard"==t.splitPosition.root.rootName;if(i&&!o||!(o&&!i)&&n.aIsStrong){const n=[];return t.howMany&&n.push(new cc(t.moveTargetPosition,t.howMany,t.splitPosition,0)),e.howMany&&n.push(new cc(e.splitPosition,e.howMany,e.moveTargetPosition,0)),n}return[new $h(0)]}if(e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t)),e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==n.abRelation)return e.howMany++,[e];if(t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==n.baRelation){const n=t.insertionPosition.path.slice();n.push(0);const o=new Ks(t.insertionPosition.root,n);return[e,new cc(e.insertionPosition,1,o,0)]}return e.splitPosition.hasSameParentAs(t.splitPosition)&&e.splitPosition.offset<t.splitPosition.offset&&(e.howMany-=t.howMany),e.splitPosition=e.splitPosition._getTransformedBySplitOperation(t),e.insertionPosition=pc.getInsertionPosition(e.splitPosition),[e]});class rf extends Uh{constructor(e){super(e),this._stack=[],this._createdBatches=new WeakSet,this.refresh()}refresh(){this.isEnabled=this._stack.length>0}addBatch(e){const t=this.editor.model.document.selection,n={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,n){const o=this.editor.model,i=o.document,r=[];for(const t of e){const e=sf(t,n).find(e=>e.start.root!=i.graveyard);e&&r.push(e)}r.length&&o.change(e=>{e.setSelection(r,{backward:t})})}_undo(e,t){const n=this.editor.model,o=n.document;this._createdBatches.add(t);const i=e.operations.slice().filter(e=>e.isDocumentOperation);i.reverse();for(const e of i){const i=e.baseVersion+1,r=Array.from(o.history.getOperations(i)),s=Qh([e.getReversed()],r,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const i of s)t.addOperation(i),n.applyOperation(i),o.history.setOperationAsUndone(e,i)}}}function sf(e,t){const n=e.getTransformedByOperations(t);n.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let e=1;e<n.length;e++){const t=n[e-1],o=n[e];t.end.isTouching(o.start)&&(t.end=o.end,n.splice(e,1),e--)}return n}class af extends rf{execute(e=null){const t=e?this._stack.findIndex(t=>t.batch==e):this._stack.length-1,n=this._stack.splice(t,1)[0],o=this.editor.model.createBatch();this.editor.model.enqueueChange(o,()=>{this._undo(n.batch,o);const e=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,e),this.fire("revert",n.batch,o)}),this.refresh()}}class cf extends rf{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch();this.editor.model.enqueueChange(t,()=>{const n=e.batch.operations[e.batch.operations.length-1].baseVersion+1,o=this.editor.model.document.history.getOperations(n);this._restoreSelection(e.selection.ranges,e.selection.isBackward,o),this._undo(e.batch,t)}),this.refresh()}}class lf extends Hh{constructor(e){super(e),this._batchRegistry=new WeakSet}init(){const e=this.editor;this._undoCommand=new af(e),this._redoCommand=new cf(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",(e,t)=>{const n=t[0];if(!n.isDocumentOperation)return;const o=n.batch;this._batchRegistry.has(o)||"transparent"==o.type||(this._redoCommand._createdBatches.has(o)?this._undoCommand.addBatch(o):this._undoCommand._createdBatches.has(o)||(this._undoCommand.addBatch(o),this._redoCommand.clearStack()),this._batchRegistry.add(o))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(e,t,n)=>{this._redoCommand.addBatch(n)}),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo")}}var df=n(37),uf=n.n(df),hf=n(38),ff=n.n(hf);class pf extends Hh{init(){const e=this.editor.t;this._addButton("undo",e("ae"),"CTRL+Z",uf.a),this._addButton("redo",e("af"),"CTRL+Y",ff.a)}_addButton(e,t,n,o){const i=this.editor;i.ui.componentFactory.add(e,r=>{const s=i.commands.get(e),a=new Ql(r);return a.set({label:t,icon:o,keystroke:n,tooltip:!0}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",()=>i.execute(e)),a})}}class mf extends Hh{static get requires(){return[lf,pf]}static get pluginName(){return"Undo"}}class gf{constructor(e){this.editor=e}destroy(){this.stopListening()}}lo(gf,Ho);const bf="ckCsrfToken",wf=40,_f="abcdefghijklmnopqrstuvwxyz0123456789";function kf(){let e=function(e){e=e.toLowerCase();const t=document.cookie.split(";");for(const n of t){const t=n.split("="),o=decodeURIComponent(t[0].trim().toLowerCase());if(o===e)return decodeURIComponent(t[1])}return null}(bf);return e&&e.length==wf||(e=function(e){let t="";const n=new Uint8Array(e);window.crypto.getRandomValues(n);for(let e=0;e<n.length;e++){const o=_f.charAt(n[e]%_f.length);t+=Math.random()>.5?o.toUpperCase():o}return t}(wf),function(e,t){document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path=/"}(bf,e)),e}class vf{constructor(e,t,n){this.loader=e,this.url=t,this.t=n}upload(){return this.loader.file.then(e=>new Promise((t,n)=>{this._initRequest(),this._initListeners(t,n,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json"}_initListeners(e,t,n){const o=this.xhr,i=this.loader,r=(0,this.t)("a")+` ${n.name}.`;o.addEventListener("error",()=>t(r)),o.addEventListener("abort",()=>t()),o.addEventListener("load",()=>{const n=o.response;if(!n||!n.uploaded)return t(n&&n.error&&n.error.message?n.error.message:r);e({default:n.url})}),o.upload&&o.upload.addEventListener("progress",e=>{e.lengthComputable&&(i.uploadTotal=e.total,i.uploaded=e.loaded)})}_sendRequest(e){const t=new FormData;t.append("upload",e),t.append("ckCsrfToken",kf()),this.xhr.send(t)}}class yf{constructor(e,t,n){let o,i=null;"function"==typeof n?o=n:(i=e.commands.get(n),o=(()=>{e.execute(n)})),e.model.document.on("change",(n,r)=>{if(i&&!i.isEnabled)return;if("transparent"==r.type)return;const s=Array.from(e.model.document.differ.getChanges()),a=s[0];if(1!=s.length||"insert"!==a.type||"$text"!=a.name||1!=a.length)return;const c=a.position.textNode||a.position.nodeAfter;if(!c.parent.is("paragraph"))return;const l=t.exec(c.data);l&&e.model.enqueueChange(e=>{const t=e.createPositionAt(c.parent,0),n=e.createPositionAt(c.parent,l[0].length),i=new ra(t,n);!1!==o({match:l})&&e.remove(i),i.detach()})})}}class xf{constructor(e,t,n){let o,i,r,s;t instanceof RegExp?o=t:r=t,"string"==typeof n?i=n:s=n,r=r||(e=>{let t;const n=[],i=[];for(;null!==(t=o.exec(e))&&!(t&&t.length<4);){let{index:e,1:o,2:r,3:s}=t;const a=o+r+s,c=[e+=t[0].length-a.length,e+o.length],l=[e+o.length+r.length,e+o.length+r.length+s.length];n.push(c),n.push(l),i.push([e+o.length,e+o.length+r.length])}return{remove:n,format:i}}),s=s||((t,n)=>{const o=e.model.schema.getValidRanges(n,i);for(const e of o)t.setAttribute(i,!0,e);t.removeSelectionAttribute(i)}),e.model.document.on("change",(t,n)=>{if("transparent"==n.type)return;const o=e.model.document.selection;if(!o.isCollapsed)return;const i=Array.from(e.model.document.differ.getChanges()),a=i[0];if(1!=i.length||"insert"!==a.type||"$text"!=a.name||1!=a.length)return;const c=o.focus.parent,l=function(e){return Array.from(e.getChildren()).reduce((e,t)=>e+t.data,"")}(c).slice(0,o.focus.offset),d=r(l),u=Cf(c,d.format,e.model),h=Cf(c,d.remove,e.model);u.length&&h.length&&e.model.enqueueChange(e=>{if(!1!==s(e,u))for(const t of h.reverse())e.remove(t)})})}}function Cf(e,t,n){return t.filter(e=>void 0!==e[0]&&void 0!==e[1]).map(t=>n.createRange(n.createPositionAt(e,t[0]),n.createPositionAt(e,t[1])))}class Af{constructor(e){this.editor=e}destroy(){this.stopListening()}}lo(Af,Ho);function Pf(e,t){return(n,o)=>{if(!e.commands.get(t).isEnabled)return!1;const i=e.model.schema.getValidRanges(o,t);for(const e of i)n.setAttribute(t,!0,e);n.removeSelectionAttribute(t)}}class Ef{constructor(e){this.editor=e}destroy(){this.stopListening()}}lo(Ef,Ho);class Tf{constructor(e){this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",e=>{this.isEnabled||e.stop()},{priority:"high"}),this.listenTo(e,"change:isReadOnly",(e,t,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",Sf,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",Sf),this.refresh())}execute(){}destroy(){this.stopListening()}}function Sf(e){e.return=!1,e.stop()}lo(Tf,Ho);class Rf extends Tf{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,n=t.document.selection,o=void 0===e.forceValue?!this.value:e.forceValue;t.change(e=>{if(n.isCollapsed)o?e.setSelectionAttribute(this.attributeKey,!0):e.removeSelectionAttribute(this.attributeKey);else{const i=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const t of i)o?e.setAttribute(this.attributeKey,o,t):e.removeAttribute(this.attributeKey,t)}})}_getValueFromFirstAllowedNode(){const e=this.editor.model,t=e.schema,n=e.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);for(const e of n.getRanges())for(const n of e.getItems())if(t.checkAttribute(n,this.attributeKey))return n.hasAttribute(this.attributeKey);return!1}}const Of="bold";class If extends Ef{init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Of}),e.model.schema.setAttributeProperties(Of,{isFormatting:!0}),e.conversion.attributeToElement({model:Of,view:"strong",upcastAlso:["b",{styles:{"font-weight":"bold"}}]}),e.commands.add(Of,new Rf(e,Of)),e.keystrokes.set("CTRL+B",Of)}}var Df=n(39),Mf=n.n(Df);const Nf="bold";class Ff extends Ef{init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(Nf,n=>{const o=e.commands.get(Nf),i=new Ql(n);return i.set({label:t("b"),icon:Mf.a,keystroke:"CTRL+B",tooltip:!0}),i.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(i,"execute",()=>e.execute(Nf)),i})}}const Bf="code";class Vf extends Ef{init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Bf}),e.model.schema.setAttributeProperties(Bf,{isFormatting:!0}),e.conversion.attributeToElement({model:Bf,view:"code",upcastAlso:{styles:{"word-wrap":"break-word"}}}),e.commands.add(Bf,new Rf(e,Bf))}}var Lf=n(40),zf=n.n(Lf);n(20);const qf="code";class jf extends Ef{init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(qf,n=>{const o=e.commands.get(qf),i=new Ql(n);return i.set({label:t("c"),icon:zf.a,tooltip:!0}),i.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(i,"execute",()=>e.execute(qf)),i})}}const Hf="strikethrough";class Uf extends Ef{init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Hf}),e.model.schema.setAttributeProperties(Hf,{isFormatting:!0}),e.conversion.attributeToElement({model:Hf,view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),e.commands.add(Hf,new Rf(e,Hf)),e.keystrokes.set("CTRL+SHIFT+X","strikethrough")}}var Wf=n(41),$f=n.n(Wf);const Gf="strikethrough";class Kf extends Ef{init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(Gf,n=>{const o=e.commands.get(Gf),i=new Ql(n);return i.set({label:t("aq"),icon:$f.a,keystroke:"CTRL+SHIFT+X",tooltip:!0}),i.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(i,"execute",()=>e.execute(Gf)),i})}}const Jf="italic";class Zf extends Ef{init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Jf}),e.model.schema.setAttributeProperties(Jf,{isFormatting:!0}),e.conversion.attributeToElement({model:Jf,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add(Jf,new Rf(e,Jf)),e.keystrokes.set("CTRL+I",Jf)}}var Qf=n(42),Yf=n.n(Qf);const Xf="italic";class ep extends Ef{init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(Xf,n=>{const o=e.commands.get(Xf),i=new Ql(n);return i.set({label:t("ap"),icon:Yf.a,keystroke:"CTRL+I",tooltip:!0}),i.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(i,"execute",()=>e.execute(Xf)),i})}}class tp{constructor(e){this.editor=e}destroy(){this.stopListening()}}lo(tp,Ho);class np{constructor(e){this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",e=>{this.isEnabled||e.stop()},{priority:"high"}),this.listenTo(e,"change:isReadOnly",(e,t,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",op,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",op),this.refresh())}execute(){}destroy(){this.stopListening()}}function op(e){e.return=!1,e.stop()}function ip(e){const t=e.next();return t.done?null:t.value}lo(np,Ho);class rp extends np{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=e.schema,n=e.document.selection,o=Array.from(n.getTopMostBlocks());e.change(e=>{if(this.value)this._removeQuote(e,o.filter(sp));else{const n=o.filter(e=>sp(e)||cp(t,e));this._applyQuote(e,n)}})}_getValue(){const e=ip(this.editor.model.document.selection.getTopMostBlocks());return!(!e||!sp(e))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,n=ip(e.getSelectedBlocks());return!!n&&cp(t,n)}_removeQuote(e,t){ap(e,t).reverse().forEach(t=>{if(t.start.isAtStart&&t.end.isAtEnd)return void e.unwrap(t.start.parent);if(t.start.isAtStart){const n=e.createPositionBefore(t.start.parent);return void e.move(t,n)}t.end.isAtEnd||e.split(t.end);const n=e.createPositionAfter(t.end.parent);e.move(t,n)})}_applyQuote(e,t){const n=[];ap(e,t).reverse().forEach(t=>{let o=sp(t.start);o||(o=e.createElement("blockQuote"),e.wrap(t,o)),n.push(o)}),n.reverse().reduce((t,n)=>t.nextSibling==n?(e.merge(e.createPositionAfter(t)),t):n)}}function sp(e){return"blockQuote"==e.parent.name?e.parent:null}function ap(e,t){let n,o=0;const i=[];for(;o<t.length;){const r=t[o],s=t[o+1];n||(n=e.createPositionBefore(r)),s&&r.nextSibling==s||(i.push(e.createRange(n,e.createPositionAfter(r))),n=null),o++}return i}function cp(e,t){const n=e.checkChild(t.parent,"blockQuote"),o=e.checkChild(["$root","blockQuote"],t);return n&&o}class lp extends tp{init(){const e=this.editor,t=e.model.schema;e.commands.add("blockQuote",new rp(e)),t.register("blockQuote",{allowWhere:"$block",allowContentOf:"$root"}),t.addChildCheck((e,t)=>{if(e.endsWith("blockQuote")&&"blockQuote"==t.name)return!1}),e.conversion.elementToElement({model:"blockQuote",view:"blockquote"}),e.model.document.registerPostFixer(n=>{const o=e.model.document.differ.getChanges();for(const e of o)if("insert"==e.type){const o=e.position.nodeAfter;if(!o)continue;if(o.is("blockQuote")&&o.isEmpty)return n.remove(o),!0;if(o.is("blockQuote")&&!t.checkChild(e.position,o))return n.unwrap(o),!0;if(o.is("element")){const e=n.createRangeIn(o);for(const o of e.getItems())if(o.is("blockQuote")&&!t.checkChild(n.createPositionBefore(o),o))return n.unwrap(o),!0}}else if("remove"==e.type){const t=e.position.parent;if(t.is("blockQuote")&&t.isEmpty)return n.remove(t),!0}return!1})}afterInit(){const e=this.editor.commands.get("blockQuote");this.listenTo(this.editor.editing.view.document,"enter",(t,n)=>{const o=this.editor.model.document,i=o.selection.getLastPosition().parent;o.selection.isCollapsed&&i.isEmpty&&e.value&&(this.editor.execute("blockQuote"),this.editor.editing.view.scrollToTheSelection(),n.preventDefault(),t.stop())})}}var dp=n(43),up=n.n(dp);n(95);class hp extends tp{init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("blockQuote",n=>{const o=e.commands.get("blockQuote"),i=new Ql(n);return i.set({label:t("e"),icon:up.a,tooltip:!0}),i.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(i,"execute",()=>e.execute("blockQuote")),i})}}class fp{constructor(e){this.editor=e}destroy(){this.stopListening()}}lo(fp,Ho);class pp{constructor(e){this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",e=>{this.isEnabled||e.stop()},{priority:"high"}),this.listenTo(e,"change:isReadOnly",(e,t,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",mp,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",mp),this.refresh())}execute(){}destroy(){this.stopListening()}}function mp(e){e.return=!1,e.stop()}lo(pp,Ho);class gp extends pp{refresh(){const e=this.editor.model,t=ip(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("paragraph"),this.isEnabled=!!t&&bp(t,e.schema)}execute(e={}){const t=this.editor.model,n=t.document;t.change(o=>{const i=(e.selection||n.selection).getSelectedBlocks();for(const e of i)!e.is("paragraph")&&bp(e,t.schema)&&o.rename(e,"paragraph")})}}function bp(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}class wp{constructor(e){this.editor=e}destroy(){this.stopListening()}}lo(wp,Ho);class _p extends wp{static get pluginName(){return"Paragraph"}init(){const e=this.editor,t=e.model,n=e.data;e.commands.add("paragraph",new gp(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(e,t)=>_p.paragraphLikeElements.has(e.name)?e.isEmpty?null:t.createElement("paragraph"):null,converterPriority:"low"}),n.upcastDispatcher.on("element",(e,t,n)=>{n.consumable.test(t.viewItem,{name:t.viewItem.name})&&vp(t.viewItem,t.modelCursor,n.schema)&&Object.assign(t,kp(t.viewItem,t.modelCursor,n))},{priority:"low"}),n.upcastDispatcher.on("text",(e,t,n)=>{t.modelRange||vp(t.viewItem,t.modelCursor,n.schema)&&Object.assign(t,kp(t.viewItem,t.modelCursor,n))},{priority:"lowest"}),t.document.registerPostFixer(e=>this._autoparagraphEmptyRoots(e)),e.data.on("ready",()=>{t.enqueueChange("transparent",e=>this._autoparagraphEmptyRoots(e))},{priority:"lowest"})}_autoparagraphEmptyRoots(e){const t=this.editor.model;for(const n of t.document.getRootNames()){const o=t.document.getRoot(n);if(o.isEmpty&&"$graveyard"!=o.rootName&&t.schema.checkChild(o,"paragraph"))return e.insertElement("paragraph",o),!0}}}function kp(e,t,n){const o=n.writer.createElement("paragraph");return n.writer.insert(o,t),n.convertItem(e,n.writer.createPositionAt(o,0))}function vp(e,t,n){const o=n.createContext(t);return!!n.checkChild(o,"paragraph")&&!!n.checkChild(o.push("paragraph"),e)}_p.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td"]);class yp{constructor(e){this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",e=>{this.isEnabled||e.stop()},{priority:"high"}),this.listenTo(e,"change:isReadOnly",(e,t,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",xp,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",xp),this.refresh())}execute(){}destroy(){this.stopListening()}}function xp(e){e.return=!1,e.stop()}lo(yp,Ho);class Cp extends yp{constructor(e,t){super(e),this.modelElements=t}refresh(){const e=ip(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(t=>Ap(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model,n=t.document,o=e.value;t.change(e=>{const i=Array.from(n.selection.getSelectedBlocks()).filter(e=>Ap(e,o,t.schema));for(const t of i)t.is(o)||e.rename(t,o)})}}function Ap(e,t,n){return n.checkChild(e.parent,t)&&!n.isObject(e)}const Pp="paragraph";class Ep extends fp{constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[_p]}init(){const e=this.editor,t=e.config.get("heading.options"),n=[];for(const o of t)o.model!==Pp&&(e.model.schema.register(o.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(o),n.push(o.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new Cp(e,n))}afterInit(){const e=this.editor,t=e.commands.get("enter"),n=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",(t,o)=>{const i=e.model.document.selection.getFirstPosition().parent;n.some(e=>i.is(e.model))&&!i.is(Pp)&&0===i.childCount&&o.writer.rename(i,Pp)})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:Xn.get("low")+1})}}class Tp{constructor(e,t){t&&Vo(this,t),e&&this.set(e)}}lo(Tp,Ho);class Sp extends Ml{constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",t.to("position",e=>`ck-dropdown__panel_${e}`),t.if("isVisible","ck-dropdown__panel-visible")]},children:this.children,on:{selectstart:t.to(e=>e.preventDefault())}})}focus(){this.children.length&&this.children.first.focus()}focusLast(){if(this.children.length){const e=this.children.last;"function"==typeof e.focusLast?e.focusLast():e.focus()}}}n(97);class Rp extends Ml{constructor(e,t,n){super(e);const o=this.bindTemplate;this.buttonView=t,this.panelView=n,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class"),this.set("panelPosition","auto"),this.focusTracker=new rl,this.keystrokes=new Zc,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",o.to("class"),o.if("isEnabled","ck-disabled",e=>!e)]},children:[t,n]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"]}})}render(){super.render(),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.panelView.bind("isVisible").to(this,"isOpen"),this.on("change:isOpen",()=>{if(this.isOpen)if("auto"===this.panelPosition){const e=Rp.defaultPanelPositions;this.panelView.position=Qd({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:[e.southEast,e.southWest,e.northEast,e.northWest]}).name}else this.panelView.position=this.panelPosition}),this.keystrokes.listenTo(this.element),this.focusTracker.add(this.element);const e=(e,t)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,t())};this.keystrokes.set("arrowdown",(e,t)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,t())}),this.keystrokes.set("arrowright",(e,t)=>{this.isOpen&&t()}),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}}Rp.defaultPanelPositions={southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.bottom-t.height,left:e.left-t.width+e.width,name:"nw"})};var Op=n(44),Ip=n.n(Op);class Dp extends Ql{constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new Jl;return e.content=Ip.a,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}n(99);class Mp extends Ml{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new rl,this.keystrokes=new Zc,this._focusCycler=new Hl({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"]},children:this.items})}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class Np extends Ml{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item"]},children:this.children})}focus(){this.children.first.focus()}}class Fp extends Ml{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}n(101);class Bp extends Ql{constructor(e){super(e),this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new Ml;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}function Vp({emitter:e,activator:t,callback:n,contextElements:o}){e.listenTo(document,"mousedown",(e,{target:i})=>{if(t()){for(const e of o)if(e.contains(i))return;n()}})}n(103),n(105);function Lp(e,t=Dp){const n=new t(e),o=new Sp(e),i=new Rp(e,n,o);return n.bind("isEnabled").to(i),n instanceof Dp?n.bind("isOn").to(i,"isOpen"):n.arrowView.bind("isOn").to(i,"isOpen"),function(e){(function(e){e.on("render",()=>{Vp({emitter:e,activator:()=>e.isOpen,callback:()=>{e.isOpen=!1},contextElements:[e.element]})})})(e),function(e){e.on("execute",t=>{t.source instanceof Bp||(e.isOpen=!1)})}(e),function(e){e.keystrokes.set("arrowdown",(t,n)=>{e.isOpen&&(e.panelView.focus(),n())}),e.keystrokes.set("arrowup",(t,n)=>{e.isOpen&&(e.panelView.focusLast(),n())})}(e)}(i),i}function zp(e,t){const n=e.locale,o=e.listView=new Mp(n);o.items.bindTo(t).using(({type:e,model:t})=>{if("separator"===e)return new Fp(n);if("button"===e||"switchbutton"===e){const o=new Np(n);let i;return(i="button"===e?new Ql(n):new Bp(n)).bind(...Object.keys(t)).to(t),i.delegate("execute").to(o),o.children.add(i),o}}),e.panelView.children.add(o),o.items.delegate("execute").to(e)}n(21);class qp extends fp{init(){const e=this.editor,t=e.t,n=function(e){const t=e.t,n={Paragraph:t("as"),"Heading 1":t("at"),"Heading 2":t("au"),"Heading 3":t("av"),"Heading 4":t("aw"),"Heading 5":t("ax"),"Heading 6":t("ay")};return e.config.get("heading.options").map(e=>{const t=n[e.title];return t&&t!=e.title&&(e.title=t),e})}(e),o=t("an"),i=t("ao");e.ui.componentFactory.add("heading",t=>{const r={},s=new si,a=e.commands.get("heading"),c=e.commands.get("paragraph"),l=[a];for(const e of n){const t={type:"button",model:new Tp({label:e.title,class:e.class,withText:!0})};"paragraph"===e.model?(t.model.bind("isOn").to(c,"value"),t.model.set("commandName","paragraph"),l.push(c)):(t.model.bind("isOn").to(a,"value",t=>t===e.model),t.model.set({commandName:"heading",commandValue:e.model})),s.add(t),r[e.model]=e.title}const d=Lp(t);return zp(d,s),d.buttonView.set({isOn:!1,withText:!0,tooltip:i}),d.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),d.bind("isEnabled").toMany(l,"isEnabled",(...e)=>e.some(e=>e)),d.buttonView.bind("label").to(a,"value",c,"value",(e,t)=>{const n=e||t&&"paragraph";return r[n]?r[n]:o}),this.listenTo(d,"execute",t=>{e.execute(t.source.commandName,t.source.commandValue?{value:t.source.commandValue}:void 0),e.editing.view.focus()}),d})}}class jp extends fr{constructor(e){super(e),this._observedElements=new Set}observe(e,t){this.document.getRoot(t).on("change:children",(t,n)=>{this.view.once("render",()=>this._updateObservedElements(e,n))})}_updateObservedElements(e,t){if(!t.is("element")||t.is("attributeElement"))return;const n=this.view.domConverter.mapViewToDom(t);if(n){for(const e of n.querySelectorAll("img"))this._observedElements.has(e)||(this.listenTo(e,"load",(e,t)=>this._fireEvents(t)),this._observedElements.add(e));for(const t of this._observedElements)e.contains(t)||(this.stopListening(t),this._observedElements.delete(t))}}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}destroy(){this._observedElements.clear(),super.destroy()}}function Hp(e){return n=>{n.on(`attribute:${e}:image`,t)};function t(e,t,n){if(!n.consumable.consume(t.item,e.name))return;const o=n.writer,i=n.mapper.toViewElement(t.item).getChild(0);null!==t.attributeNewValue?o.setAttribute(t.attributeKey,t.attributeNewValue,i):o.removeAttribute(t.attributeKey,i)}}class Up extends $u{refresh(){this.isEnabled=Qu(this.editor.model)}execute(e){const t=this.editor.model;t.change(n=>{const o=Array.isArray(e.source)?e.source:[e.source];for(const e of o)Zu(n,t,{src:e})})}}class Wp extends Tu{init(){const e=this.editor,t=e.model.schema,n=e.t,o=e.conversion;e.editing.view.addObserver(jp),t.register("image",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["alt","src","srcset"]}),o.for("dataDowncast").elementToElement({model:"image",view:(e,t)=>$p(t)}),o.for("editingDowncast").elementToElement({model:"image",view:(e,t)=>(function(e,t,n){return t.setCustomProperty("image",!0,e),Id(e,t,{label:function(){const t=e.getChild(0).getAttribute("alt");return t?`${t} ${n}`:n}})})($p(t),t,n("aj"))}),o.for("downcast").add(Hp("src")).add(Hp("alt")).add(function(){return t=>{t.on("attribute:srcset:image",e)};function e(e,t,n){if(!n.consumable.consume(t.item,e.name))return;const o=n.writer,i=n.mapper.toViewElement(t.item).getChild(0);if(null===t.attributeNewValue){const e=t.attributeOldValue;e.data&&(o.removeAttribute("srcset",i),o.removeAttribute("sizes",i),e.width&&o.removeAttribute("width",i))}else{const e=t.attributeNewValue;e.data&&(o.setAttribute("srcset",e.data,i),o.setAttribute("sizes","100vw",i),e.width&&o.setAttribute("width",e.width,i))}}}()),o.for("upcast").elementToElement({view:{name:"img",attributes:{src:!0}},model:(e,t)=>t.createElement("image",{src:e.getAttribute("src")})}).attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:e=>{const t={data:e.getAttribute("srcset")};return e.hasAttribute("width")&&(t.width=e.getAttribute("width")),t}}}).add(function(){return t=>{t.on("element:figure",e)};function e(e,t,n){if(!n.consumable.test(t.viewItem,{name:!0,classes:"image"}))return;const o=Array.from(t.viewItem.getChildren()).find(e=>e.is("img"));if(!o||!o.hasAttribute("src")||!n.consumable.test(o,{name:!0}))return;const i=n.convertItem(o,t.modelCursor),r=ip(i.modelRange.getItems());r&&(n.convertChildren(t.viewItem,n.writer.createPositionAt(r,0)),t.modelRange=i.modelRange,t.modelCursor=i.modelCursor)}}()),e.commands.add("imageInsert",new Up(e))}}function $p(e){const t=e.createEmptyElement("img"),n=e.createContainerElement("figure",{class:"image"});return e.insert(e.createPositionAt(n,0),t),n}class Gp extends $u{refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=Ju(e),Ju(e)&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){const t=this.editor.model,n=t.document.selection.getSelectedElement();t.change(t=>{t.setAttribute("alt",e.newValue,n)})}}class Kp extends Tu{init(){this.editor.commands.add("imageTextAlternative",new Gp(this.editor))}}n(108);class Jp extends Ml{constructor(e,t){super(e);const n=`ck-input-${Yn()}`,o=`ck-status-${Yn()}`;this.set("label"),this.set("value"),this.set("isReadOnly",!1),this.set("errorText",null),this.set("infoText",null),this.labelView=this._createLabelView(n),this.inputView=this._createInputView(t,n,o),this.statusView=this._createStatusView(o),this.bind("_statusText").to(this,"errorText",this,"infoText",(e,t)=>e||t);const i=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-input",i.if("isReadOnly","ck-disabled")]},children:[this.labelView,this.inputView,this.statusView]})}_createLabelView(e){const t=new Fl(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createInputView(e,t,n){const o=new e(this.locale,n);return o.id=t,o.ariaDesribedById=n,o.bind("value").to(this),o.bind("isReadOnly").to(this),o.bind("hasError").to(this,"errorText",e=>!!e),o.on("input",()=>{this.errorText=null}),o}_createStatusView(e){const t=new Ml(this.locale),n=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-input__status",n.if("errorText","ck-labeled-input__status_error"),n.if("_statusText","ck-hidden",e=>!e)],id:e},children:[{text:n.to("_statusText")}]}),t}select(){this.inputView.select()}focus(){this.inputView.focus()}}n(110);class Zp extends Ml{constructor(e){super(e),this.set("value"),this.set("id"),this.set("placeholder"),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDesribedById");const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{type:"text",class:["ck","ck-input","ck-input-text",t.if("hasError","ck-error")],id:t.to("id"),placeholder:t.to("placeholder"),readonly:t.to("isReadOnly"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDesribedById")},on:{input:t.to("input")}})}render(){super.render();const e=e=>{this.element.value=e||0===e?e:""};e(this.value),this.on("change:value",(t,n,o)=>{e(o)})}select(){this.element.select()}focus(){this.element.focus()}}function Qp({view:e}){e.listenTo(e.element,"submit",(t,n)=>{n.preventDefault(),e.fire("submit")},{useCapture:!0})}var Yp=n(45),Xp=n.n(Yp),em=n(46),tm=n.n(em);n(112);class nm extends Ml{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new rl,this.keystrokes=new Zc,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(t("az"),Xp.a,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("ba"),tm.a,"ck-button-cancel","cancel"),this._focusables=new pl,this._focusCycler=new Hl({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),this.keystrokes.listenTo(this.element),Qp({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)})}_createButton(e,t,n,o){const i=new Ql(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i.extendTemplate({attributes:{class:n}}),o&&i.delegate("execute").to(this,o),i}_createLabeledInputView(){const e=this.locale.t,t=new Jp(this.locale,Zp);return t.label=e("bg"),t.inputView.placeholder=e("bg"),t}}var om=n(47),im=n.n(om);function rm(e){const t=e.editing.view,n=nu.defaultPositions;return{target:t.domConverter.viewToDom(t.document.selection.getSelectedElement()),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}}class sm extends Tu{static get requires(){return[su]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton(),this._createForm()}destroy(){super.destroy(),this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",n=>{const o=e.commands.get("imageTextAlternative"),i=new Ql(n);return i.set({label:t("ar"),icon:im.a,tooltip:!0}),i.bind("isEnabled").to(o,"isEnabled"),this.listenTo(i,"execute",()=>this._showForm()),i})}_createForm(){const e=this.editor,t=e.editing.view.document;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new nm(e.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.inputView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(e,t)=>{this._hideForm(!0),t()}),this.listenTo(e.ui,"update",()=>{Ku(t.selection)?this._isVisible&&function(e){const t=e.plugins.get("ContextualBalloon");if(Ku(e.editing.view.document.selection)){const n=rm(e);t.updatePosition(n)}}(e):this._hideForm(!0)}),Vp({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._form.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const e=this.editor,t=e.commands.get("imageTextAlternative"),n=this._form.labeledInput;this._balloon.hasView(this._form)||this._balloon.add({view:this._form,position:rm(e)}),n.value=n.inputView.element.value=t.value||"",this._form.labeledInput.select()}_hideForm(e){this._isVisible&&(this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView==this._form}}class am extends Tu{static get requires(){return[Kp,sm]}static get pluginName(){return"ImageTextAlternative"}}n(114);function cm(e){for(const t of e.getChildren())if(t&&t.is("caption"))return t;return null}function lm(e){const t=e.parent;return"figcaption"==e.name&&t&&"figure"==t.name&&t.hasClass("image")?{name:!0}:null}class dm extends Tu{init(){const e=this.editor,t=e.editing.view,n=e.model.schema,o=e.data,i=e.editing,r=e.t;n.register("caption",{allowIn:"image",allowContentOf:"$block",isLimit:!0}),e.model.document.registerPostFixer(e=>this._insertMissingModelCaptionElement(e)),e.conversion.for("upcast").elementToElement({view:lm,model:"caption"});o.downcastDispatcher.on("insert:caption",um(e=>e.createContainerElement("figcaption"),!1));const s=function(e,t){return n=>{const o=n.createEditableElement("figcaption");return n.setCustomProperty("imageCaption",!0,o),cl({view:e,element:o,text:t}),Md(o,n)}}(t,r("ai"));i.downcastDispatcher.on("insert:caption",um(s)),i.downcastDispatcher.on("insert",this._fixCaptionVisibility(e=>e.item),{priority:"high"}),i.downcastDispatcher.on("remove",this._fixCaptionVisibility(e=>e.position.parent),{priority:"high"}),t.document.registerPostFixer(e=>this._updateCaptionVisibility(e))}_updateCaptionVisibility(e){const t=this.editor.editing.mapper,n=this._lastSelectedCaption;let o;const i=this.editor.model.document.selection,r=i.getSelectedElement();if(r&&r.is("image")){const e=cm(r);o=t.toViewElement(e)}const s=hm(i.getFirstPosition().parent);if(s&&(o=t.toViewElement(s)),o)return n?n===o?pm(o,e):(fm(n,e),this._lastSelectedCaption=o,pm(o,e)):(this._lastSelectedCaption=o,pm(o,e));if(n){const t=fm(n,e);return this._lastSelectedCaption=null,t}return!1}_fixCaptionVisibility(e){return(t,n,o)=>{const i=hm(e(n)),r=this.editor.editing.mapper,s=o.writer;if(i){const e=r.toViewElement(i);e&&(i.childCount?s.removeClass("ck-hidden",e):s.addClass("ck-hidden",e))}}}_insertMissingModelCaptionElement(e){const t=this.editor.model,n=t.document.differ.getChanges(),o=[];for(const e of n)if("insert"==e.type&&"$text"!=e.name){const n=e.position.nodeAfter;if(n.is("image")&&!cm(n)&&o.push(n),!n.is("image")&&n.childCount)for(const e of t.createRangeIn(n).getItems())e.is("image")&&!cm(e)&&o.push(e)}for(const t of o)e.appendElement("caption",t);return!!o.length}}function um(e,t=!0){return(n,o,i)=>{const r=o.item;if((r.childCount||t)&&Ju(r.parent)){if(!i.consumable.consume(o.item,"insert"))return;const t=i.mapper.toViewElement(o.range.start.parent),n=e(i.writer),s=i.writer;r.childCount||s.addClass("ck-hidden",n),function(e,t,n,o){const i=o.writer.createPositionAt(n,"end");o.writer.insert(i,e),o.mapper.bindElements(t,e)}(n,o.item,t,i)}}}function hm(e){const t=e.getAncestors({includeSelf:!0}).find(e=>"caption"==e.name);return t&&t.parent&&"image"==t.parent.name?t:null}function fm(e,t){return!e.childCount&&!e.hasClass("ck-hidden")&&(t.addClass("ck-hidden",e),!0)}function pm(e,t){return!!e.hasClass("ck-hidden")&&(t.removeClass("ck-hidden",e),!0)}n(116);class mm extends $u{constructor(e,t){super(e),this._defaultStyle=!1,this.styles=t.reduce((e,t)=>(e[t.name]=t,t.isDefault&&(this._defaultStyle=t.name),e),{})}refresh(){const e=this.editor.model.document.selection.getSelectedElement();if(this.isEnabled=Ju(e),e)if(e.hasAttribute("imageStyle")){const t=e.getAttribute("imageStyle");this.value=!!this.styles[t]&&t}else this.value=this._defaultStyle;else this.value=!1}execute(e){const t=e.value,n=this.editor.model,o=n.document.selection.getSelectedElement();n.change(e=>{this.styles[t].isDefault?e.removeAttribute("imageStyle",o):e.setAttribute("imageStyle",t,o)})}}function gm(e,t){for(const n of t)if(n.name===e)return n}var bm=n(16),wm=n.n(bm),_m=n(17),km=n.n(_m),vm=n(18),ym=n.n(vm),xm=n(10),Cm=n.n(xm);const Am={full:{name:"full",title:"Full size image",icon:wm.a,isDefault:!0},side:{name:"side",title:"Side image",icon:Cm.a,className:"image-style-side"},alignLeft:{name:"alignLeft",title:"Left aligned image",icon:km.a,className:"image-style-align-left"},alignCenter:{name:"alignCenter",title:"Centered image",icon:ym.a,className:"image-style-align-center"},alignRight:{name:"alignRight",title:"Right aligned image",icon:Cm.a,className:"image-style-align-right"}},Pm={full:wm.a,left:km.a,right:Cm.a,center:ym.a};function Em(e=[]){return e.map(Tm)}function Tm(e){if("string"==typeof e){const t=e;Am[t]?e=Object.assign({},Am[t]):(ws.a.warn("image-style-not-found: There is no such image style of given name.",{name:t}),e={name:t})}else if(Am[e.name]){const t=Am[e.name],n=Object.assign({},e);for(const o in t)e.hasOwnProperty(o)||(n[o]=t[o]);e=n}return"string"==typeof e.icon&&Pm[e.icon]&&(e.icon=Pm[e.icon]),e}class Sm extends Tu{static get pluginName(){return"ImageStyleEditing"}init(){const e=this.editor,t=e.model.schema,n=e.data,o=e.editing;e.config.define("image.styles",["full","side"]);const i=Em(e.config.get("image.styles"));t.extend("image",{allowAttributes:"imageStyle"});const r=function(e){return(t,n,o)=>{if(!o.consumable.consume(n.item,t.name))return;const i=gm(n.attributeNewValue,e),r=gm(n.attributeOldValue,e),s=o.mapper.toViewElement(n.item),a=o.writer;r&&a.removeClass(r.className,s),i&&a.addClass(i.className,s)}}(i);o.downcastDispatcher.on("attribute:imageStyle:image",r),n.downcastDispatcher.on("attribute:imageStyle:image",r),n.upcastDispatcher.on("element:figure",function(e){const t=e.filter(e=>!e.isDefault);return(e,n,o)=>{if(!n.modelRange)return;const i=n.viewItem,r=ip(n.modelRange.getItems());if(o.schema.checkAttribute(r,"imageStyle"))for(const e of t)o.consumable.consume(i,{classes:e.className})&&o.writer.setAttribute("imageStyle",e.name,r)}}(i),{priority:"low"}),e.commands.add("imageStyle",new mm(e,i))}}n(118);class Rm extends Tu{static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const e=this.editor.t;return{"Full size image":e("y"),"Side image":e("z"),"Left aligned image":e("aa"),"Centered image":e("ab"),"Right aligned image":e("ac")}}init(){const e=function(e,t){for(const n of e)t[n.title]&&(n.title=t[n.title]);return e}(Em(this.editor.config.get("image.styles")),this.localizedDefaultStylesTitles);for(const t of e)this._createButton(t)}_createButton(e){const t=this.editor,n=`imageStyle:${e.name}`;t.ui.componentFactory.add(n,n=>{const o=t.commands.get("imageStyle"),i=new Ql(n);return i.set({label:e.title,icon:e.icon,tooltip:!0}),i.bind("isEnabled").to(o,"isEnabled"),i.bind("isOn").to(o,"value",t=>t===e.name),this.listenTo(i,"execute",()=>t.execute("imageStyle",{value:e.name})),i})}}class Om extends Wd{static get requires(){return[su]}static get pluginName(){return"WidgetToolbarRepository"}init(){const e=this.editor;if(e.plugins.has("BalloonToolbar")){const t=e.plugins.get("BalloonToolbar");this.listenTo(t,"show",t=>{(function(e){const t=e.getSelectedElement();return!(!t||!Od(t))})(e.editing.view.document.selection)&&t.stop()},{priority:"high"})}this._toolbarDefinitions=new Map,this._balloon=this.editor.plugins.get("ContextualBalloon"),this.listenTo(e.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const e of this._toolbarDefinitions.values())e.view.destroy()}register(e,{items:t,getRelatedElement:n,balloonClassName:o="ck-toolbar-container"}){const i=this.editor,r=new $l;if(this._toolbarDefinitions.has(e))throw new Jn.b("widget-toolbar-duplicated: Toolbar with the given id was already added.",{toolbarId:e});r.fillFromConfig(t,i.ui.componentFactory),this._toolbarDefinitions.set(e,{view:r,getRelatedElement:n,balloonClassName:o})}_updateToolbarsVisibility(){let e=0,t=null,n=null;for(const o of this._toolbarDefinitions.values()){const i=o.getRelatedElement(this.editor.editing.view.document.selection);if(this.editor.ui.focusTracker.isFocused&&i){const r=i.getAncestors().length;r>e&&(e=r,t=i,n=o)}else this._hideToolbar(o)}n&&this._showToolbar(n,t)}_hideToolbar(e){this._isToolbarVisible(e)&&this._balloon.remove(e.view)}_showToolbar(e,t){this._isToolbarVisible(e)?function(e,t){const n=e.plugins.get("ContextualBalloon"),o=Im(e,t);n.updatePosition(o)}(this.editor,t):this._balloon.hasView(e.view)||this._balloon.add({view:e.view,position:Im(this.editor,t),balloonClassName:e.balloonClassName})}_isToolbarVisible(e){return this._balloon.visibleView==e.view}}function Im(e,t){const n=e.editing.view,o=nu.defaultPositions;return{target:n.domConverter.viewToDom(t),positions:[o.northArrowSouth,o.northArrowSouthWest,o.northArrowSouthEast,o.southArrowNorth,o.southArrowNorthWest,o.southArrowNorthEast]}}class Dm{constructor(e){this.editor=e}destroy(){this.stopListening()}}lo(Dm,Ho);class Mm{constructor(e){this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",e=>{this.isEnabled||e.stop()},{priority:"high"}),this.listenTo(e,"change:isReadOnly",(e,t,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",Nm,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",Nm),this.refresh())}execute(){}destroy(){this.stopListening()}}function Nm(e){e.return=!1,e.stop()}function Fm(e,t,n){return n.createRange(Bm(e,t,!0,n),Bm(e,t,!1,n))}function Bm(e,t,n,o){let i=e.textNode||(n?e.nodeBefore:e.nodeAfter),r=null;for(;i&&i.getAttribute("linkHref")==t;)r=i,i=n?i.previousSibling:i.nextSibling;return r?o.createPositionAt(r,n?"before":"after"):e}lo(Mm,Ho);class Vm extends Mm{refresh(){const e=this.editor.model,t=e.document;this.value=t.selection.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,"linkHref")}execute(e){const t=this.editor.model,n=t.document.selection;t.change(o=>{if(n.isCollapsed){const i=n.getFirstPosition();if(n.hasAttribute("linkHref")){const i=Fm(n.getFirstPosition(),n.getAttribute("linkHref"),t);o.setAttribute("linkHref",e,i),o.setSelection(i)}else if(""!==e){const t=Ls(n.getAttributes());t.set("linkHref",e);const r=o.createText(e,t);o.insert(r,i),o.setSelection(o.createRangeOn(r))}}else{const i=t.schema.getValidRanges(n.getRanges(),"linkHref");for(const t of i)o.setAttribute("linkHref",e,t)}})}}class Lm extends Mm{refresh(){this.isEnabled=this.editor.model.document.selection.hasAttribute("linkHref")}execute(){const e=this.editor.model,t=e.document.selection;e.change(n=>{const o=t.isCollapsed?[Fm(t.getFirstPosition(),t.getAttribute("linkHref"),e)]:t.getRanges();for(const e of o)n.removeAttribute("linkHref",e)})}}const zm=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,qm=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;function jm(e,t){const n=t.createAttributeElement("a",{href:e},{priority:5});return t.setCustomProperty("link",!0,n),n}function Hm(e){return function(e){return e.replace(zm,"").match(qm)}(e=String(e))?e:"#"}class Um{constructor(e,t,n){this.model=e,this.attribute=n,this._modelSelection=e.document.selection,this._overrideUid=null,this._isNextGravityRestorationSkipped=!1,t.listenTo(this._modelSelection,"change:range",(e,t)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!t.directChange&&Wm(this._modelSelection.getFirstPosition(),n)||this._restoreGravity())})}handleForwardMovement(e,t){const n=this.attribute;if(!(this._isGravityOverridden||e.isAtStart&&this._hasSelectionAttribute))return Km(e,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(t),this._removeSelectionAttribute(),!0):$m(e,n)?(this._preventCaretMovement(t),this._overrideGravity(),!0):Gm(e,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(t),this._overrideGravity(),!0):void 0}handleBackwardMovement(e,t){const n=this.attribute;return this._isGravityOverridden?Km(e,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(t),this._restoreGravity(),this._removeSelectionAttribute(),!0):(this._preventCaretMovement(t),this._restoreGravity(),e.isAtStart&&this._removeSelectionAttribute(),!0):Km(e,n)&&!this._hasSelectionAttribute?(this._preventCaretMovement(t),this._setSelectionAttributeFromTheNodeBefore(e),!0):e.isAtEnd&&Gm(e,n)?this._hasSelectionAttribute?void(Jm(e,n)&&(this._skipNextAutomaticGravityRestoration(),this._overrideGravity())):(this._preventCaretMovement(t),this._setSelectionAttributeFromTheNodeBefore(e),!0):e.isAtStart?this._hasSelectionAttribute?(this._removeSelectionAttribute(),this._preventCaretMovement(t),!0):void 0:void(Jm(e,n)&&(this._skipNextAutomaticGravityRestoration(),this._overrideGravity()))}get _isGravityOverridden(){return!!this._overrideUid}get _hasSelectionAttribute(){return this._modelSelection.hasAttribute(this.attribute)}_overrideGravity(){this._overrideUid=this.model.change(e=>e.overrideSelectionGravity())}_restoreGravity(){this.model.change(e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}_preventCaretMovement(e){e.preventDefault()}_removeSelectionAttribute(){this.model.change(e=>{e.removeSelectionAttribute(this.attribute)})}_setSelectionAttributeFromTheNodeBefore(e){const t=this.attribute;this.model.change(n=>{n.setSelectionAttribute(this.attribute,e.nodeBefore.getAttribute(t))})}_skipNextAutomaticGravityRestoration(){this._isNextGravityRestorationSkipped=!0}}function Wm(e,t){return $m(e,t)||Gm(e,t)}function $m(e,t){const{nodeBefore:n,nodeAfter:o}=e,i=!!n&&n.hasAttribute(t);return!!o&&o.hasAttribute(t)&&(!i||n.getAttribute(t)!==o.getAttribute(t))}function Gm(e,t){const{nodeBefore:n,nodeAfter:o}=e,i=!!n&&n.hasAttribute(t),r=!!o&&o.hasAttribute(t);return i&&(!r||n.getAttribute(t)!==o.getAttribute(t))}function Km(e,t){const{nodeBefore:n,nodeAfter:o}=e,i=!!n&&n.hasAttribute(t);if(!!o&&o.hasAttribute(t)&&i)return o.getAttribute(t)!==n.getAttribute(t)}function Jm(e,t){return Wm(e.getShiftedBy(-1),t)}n(120);const Zm="ck-link_selected";class Qm extends Dm{init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:jm}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(e,t)=>jm(Hm(e),t)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:e=>e.getAttribute("href")}}),e.commands.add("link",new Vm(e)),e.commands.add("unlink",new Lm(e)),function(e,t,n,o){const i=new Um(t,n,o),r=t.document.selection;n.listenTo(e.document,"keydown",(e,t)=>{if(!r.isCollapsed)return;if(t.shiftKey||t.altKey||t.ctrlKey)return;const n=t.keyCode==wi.arrowright,o=t.keyCode==wi.arrowleft;if(!n&&!o)return;const s=r.getFirstPosition();let a;(a=n?i.handleForwardMovement(s,t):i.handleBackwardMovement(s,t))&&e.stop()},{priority:Xn.get("high")+1})}(e.editing.view,e.model,this,"linkHref"),this._setupLinkHighlight()}_setupLinkHighlight(){const e=this.editor,t=e.editing.view,n=new Set;t.document.registerPostFixer(t=>{const o=e.model.document.selection;if(o.hasAttribute("linkHref")){const i=Fm(o.getFirstPosition(),o.getAttribute("linkHref"),e.model),r=e.editing.mapper.toViewRange(i);for(const e of r.getItems())e.is("a")&&(t.addClass(Zm,e),n.add(e))}}),e.conversion.for("editingDowncast").add(e=>{function o(){t.change(e=>{for(const t of n.values())e.removeClass(Zm,t),n.delete(t)})}e.on("insert",o,{priority:"highest"}),e.on("remove",o,{priority:"highest"}),e.on("attribute",o,{priority:"highest"}),e.on("selection",o,{priority:"highest"})})}}class Ym extends ts{constructor(e){super(e),this.domEventType="click"}onDomEvent(e){this.fire(e.type,e)}}var Xm=n(48),eg=n.n(Xm),tg=n(49),ng=n.n(tg);n(122);class og extends Ml{constructor(e){super(e);const t=e.t;this.focusTracker=new rl,this.keystrokes=new Zc,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(t("az"),eg.a,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("ba"),ng.a,"ck-button-cancel","cancel"),this._focusables=new pl,this._focusCycler=new Hl({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-link-form"],tabindex:"-1"},children:[this.urlInputView,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),Qp({view:this}),[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const e=this.locale.t,t=new Jp(this.locale,Zp);return t.label=e("bb"),t.inputView.placeholder="https://example.com",t}_createButton(e,t,n,o){const i=new Ql(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i.extendTemplate({attributes:{class:n}}),o&&i.delegate("execute").to(this,o),i}}var ig=n(50),rg=n.n(ig),sg=n(51),ag=n.n(sg);n(124);class cg extends Ml{constructor(e){super(e);const t=e.t;this.focusTracker=new rl,this.keystrokes=new Zc,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(t("bc"),rg.a,"unlink"),this.editButtonView=this._createButton(t("bd"),ag.a,"edit"),this.set("href"),this._focusables=new pl,this._focusCycler=new Hl({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render(),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createButton(e,t,n){const o=new Ql(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.delegate("execute").to(this,n),o}_createPreviewButton(){const e=new Ql(this.locale),t=this.bindTemplate,n=this.t;return e.set({withText:!0,tooltip:n("be")}),e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",e=>e&&Hm(e)),target:"_blank"}}),e.bind("label").to(this,"href",e=>e||n("bf")),e.bind("isEnabled").to(this,"href",e=>!!e),e.template.tag="a",e.template.eventListeners={},e}}var lg=n(52),dg=n.n(lg);const ug="Ctrl+K";class hg extends Dm{static get requires(){return[su]}static get pluginName(){return"LinkUI"}init(){const e=this.editor;e.editing.view.addObserver(Ym),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=e.plugins.get(su),this._createToolbarLinkButton(),this._enableUserBalloonInteractions()}destroy(){super.destroy(),this.formView.destroy()}_createActionsView(){const e=this.editor,t=new cg(e.locale),n=e.commands.get("link"),o=e.commands.get("unlink");return t.bind("href").to(n,"value"),t.editButtonView.bind("isEnabled").to(n),t.unlinkButtonView.bind("isEnabled").to(o),this.listenTo(t,"edit",()=>{this._addFormView()}),this.listenTo(t,"unlink",()=>{e.execute("unlink"),this._hideUI()}),t.keystrokes.set("Esc",(e,t)=>{this._hideUI(),t()}),t.keystrokes.set(ug,(e,t)=>{this._addFormView(),t()}),t}_createFormView(){const e=this.editor,t=new og(e.locale),n=e.commands.get("link");return t.urlInputView.bind("value").to(n,"value"),t.urlInputView.bind("isReadOnly").to(n,"isEnabled",e=>!e),t.saveButtonView.bind("isEnabled").to(n),this.listenTo(t,"submit",()=>{e.execute("link",t.urlInputView.inputView.element.value),this._removeFormView()}),this.listenTo(t,"cancel",()=>{this._removeFormView()}),t.keystrokes.set("Esc",(e,t)=>{this._removeFormView(),t()}),t}_createToolbarLinkButton(){const e=this.editor,t=e.commands.get("link"),n=e.t;e.keystrokes.set(ug,(e,n)=>{n(),t.isEnabled&&this._showUI()}),e.ui.componentFactory.add("link",e=>{const o=new Ql(e);return o.isEnabled=!0,o.label=n("ak"),o.icon=dg.a,o.keystroke=ug,o.tooltip=!0,o.bind("isOn","isEnabled").to(t,"value","isEnabled"),this.listenTo(o,"execute",()=>this._showUI()),o})}_enableUserBalloonInteractions(){const e=this.editor.editing.view.document;this.listenTo(e,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),this.editor.keystrokes.set("Tab",(e,t)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),t())},{priority:"high"}),this.editor.keystrokes.set("Esc",(e,t)=>{this._isUIVisible&&(this._hideUI(),t())}),Vp({emitter:this.formView,activator:()=>this._isUIVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel)return;const e=this.editor.commands.get("link");this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.formView.urlInputView.select(),this.formView.urlInputView.inputView.element.value=e.value||""}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus())}_showUI(){this.editor.commands.get("link").isEnabled&&(this._getSelectedLinkElement()?this._areActionsVisible?this._addFormView():this._addActionsView():(this._addActionsView(),this._addFormView()),this._startUpdatingUI())}_hideUI(){if(!this._isUIInPanel)return;const e=this.editor;this.stopListening(e.ui,"update"),e.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView)}_startUpdatingUI(){const e=this.editor,t=e.editing.view.document;let n=this._getSelectedLinkElement(),o=i();function i(){return t.selection.focus.getAncestors().reverse().find(e=>e.is("element"))}this.listenTo(e.ui,"update",()=>{const e=this._getSelectedLinkElement(),t=i();n&&!e||!n&&t!==o?this._hideUI():this._balloon.updatePosition(this._getBalloonPositionData()),n=e,o=t})}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=e.document,n=this._getSelectedLinkElement();return{target:n?e.domConverter.mapViewToDom(n):e.domConverter.viewRangeToDom(t.selection.getFirstRange())}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection;if(t.isCollapsed)return fg(t.getFirstPosition());{const n=t.getFirstRange().getTrimmed(),o=fg(n.start),i=fg(n.end);return o&&o==i&&e.createRangeIn(o).getTrimmed().isEqual(n)?o:null}}}function fg(e){return e.getAncestors().find(e=>(function(e){return e.is("attributeElement")&&!!e.getCustomProperty("link")})(e))}class pg{constructor(e){this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",e=>{this.isEnabled||e.stop()},{priority:"high"}),this.listenTo(e,"change:isReadOnly",(e,t,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",mg,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",mg),this.refresh())}execute(){}destroy(){this.stopListening()}}function mg(e){e.return=!1,e.stop()}lo(pg,Ho);class gg extends pg{constructor(e,t){super(e),this.type="bulleted"==t?"bulleted":"numbered"}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=e.document,n=Array.from(t.selection.getSelectedBlocks()).filter(t=>wg(t,e.schema)),o=!0===this.value;e.change(e=>{if(o){let t=n[n.length-1].nextSibling,o=Number.POSITIVE_INFINITY,i=[];for(;t&&"listItem"==t.name&&0!==t.getAttribute("listIndent");){const e=t.getAttribute("listIndent");e<o&&(o=e);const n=e-o;i.push({element:t,listIndent:n}),t=t.nextSibling}i=i.reverse();for(const t of i)e.setAttribute("listIndent",t.listIndent,t.element)}if(!o){let e=Number.POSITIVE_INFINITY;for(const t of n)t.is("listItem")&&t.getAttribute("listIndent")<e&&(e=t.getAttribute("listIndent"));bg(n,!0,e=0===e?1:e),bg(n,!1,e)}for(const t of n.reverse())o&&"listItem"==t.name?e.rename(t,"paragraph"):o||"listItem"==t.name?o||"listItem"!=t.name||t.getAttribute("listType")==this.type||e.setAttribute("listType",this.type,t):(e.setAttributes({listType:this.type,listIndent:0},t),e.rename(t,"listItem"))})}_getValue(){const e=ip(this.editor.model.document.selection.getSelectedBlocks());return!!e&&e.is("listItem")&&e.getAttribute("listType")==this.type}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,n=ip(e.getSelectedBlocks());return!!n&&wg(n,t)}}function bg(e,t,n){const o=t?e[0]:e[e.length-1];if(o.is("listItem")){let i=o[t?"previousSibling":"nextSibling"],r=o.getAttribute("listIndent");for(;i&&i.is("listItem")&&i.getAttribute("listIndent")>=n;)r>i.getAttribute("listIndent")&&(r=i.getAttribute("listIndent")),i.getAttribute("listIndent")==r&&e[t?"unshift":"push"](i),i=i[t?"previousSibling":"nextSibling"]}}function wg(e,t){return t.checkChild(e.parent,"listItem")&&!t.isObject(e)}class _g extends pg{constructor(e,t){super(e),this._indentBy="forward"==t?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=e.document;let n=Array.from(t.selection.getSelectedBlocks());e.change(e=>{const t=n[n.length-1];let o=t.nextSibling;for(;o&&"listItem"==o.name&&o.getAttribute("listIndent")>t.getAttribute("listIndent");)n.push(o),o=o.nextSibling;this._indentBy<0&&(n=n.reverse());for(const t of n){const n=t.getAttribute("listIndent")+this._indentBy;n<0?e.rename(t,"paragraph"):e.setAttribute("listIndent",n,t)}})}_checkEnabled(){const e=ip(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is("listItem"))return!1;if(this._indentBy>0){const t=e.getAttribute("listIndent"),n=e.getAttribute("listType");let o=e.previousSibling;for(;o&&o.is("listItem")&&o.getAttribute("listIndent")>=t;){if(o.getAttribute("listIndent")==t)return o.getAttribute("listType")==n;o=o.previousSibling}return!1}return!0}}class kg{constructor(e){this.editor=e}destroy(){this.stopListening()}}function vg(){const e=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||e?0:Ao.call(this)}function yg(e){return(t,n,o)=>{const i=o.consumable;if(!i.test(n.item,"insert")||!i.test(n.item,"attribute:listType")||!i.test(n.item,"attribute:listIndent"))return;i.consume(n.item,"insert"),i.consume(n.item,"attribute:listType"),i.consume(n.item,"attribute:listIndent");const r=n.item;Fg(r,function(e,t){const n=t.mapper,o=t.writer,i="numbered"==e.getAttribute("listType")?"ol":"ul",r=function(e){const t=e.createContainerElement("li");return t.getFillerOffset=vg,t}(o),s=o.createContainerElement(i,null);return o.insert(o.createPositionAt(s,0),r),n.bindElements(e,r),r}(r,o),o,e)}}function xg(e){return(t,n,o)=>{const i=o.mapper.toViewPosition(n.position).getLastMatchingPosition(e=>!e.item.is("li")).nodeAfter,r=o.writer;r.breakContainer(r.createPositionBefore(i)),r.breakContainer(r.createPositionAfter(i));const s=i.parent,a=s.previousSibling,c=r.createRangeOn(s),l=r.remove(c);a&&a.nextSibling&&Ng(r,a,a.nextSibling),Bg(o.mapper.toModelElement(i).getAttribute("listIndent")+1,n.position,c.start,i,o,e);for(const e of r.createRangeIn(l).getItems())o.mapper.unbindViewElement(e);t.stop()}}function Cg(e,t,n){if(!n.consumable.consume(t.item,"attribute:listType"))return;const o=n.mapper.toViewElement(t.item),i=n.writer;i.breakContainer(i.createPositionBefore(o)),i.breakContainer(i.createPositionAfter(o));let r=o.parent;const s="numbered"==t.attributeNewValue?"ol":"ul";Ng(i,r=i.rename(s,r),r.nextSibling),Ng(i,r.previousSibling,r);for(const e of t.item.getChildren())n.consumable.consume(e,"insert")}function Ag(e){return(t,n,o)=>{if(!o.consumable.consume(n.item,"attribute:listIndent"))return;const i=o.mapper.toViewElement(n.item),r=o.writer;r.breakContainer(r.createPositionBefore(i)),r.breakContainer(r.createPositionAfter(i));const s=i.parent,a=s.previousSibling,c=r.createRangeOn(s);r.remove(c),a&&a.nextSibling&&Ng(r,a,a.nextSibling),Bg(n.attributeOldValue+1,n.range.start,c.start,i,o,e),Fg(n.item,i,o,e);for(const e of n.item.getChildren())o.consumable.consume(e,"insert")}}function Pg(e,t,n){if("listItem"!=t.item.name){let e=n.mapper.toViewPosition(t.range.start);const o=n.writer,i=[];for(;("ul"==e.parent.name||"ol"==e.parent.name)&&"li"==(e=o.breakContainer(e)).parent.name;){const t=e,n=o.createPositionAt(e.parent,"end");if(!t.isEqual(n)){const e=o.remove(o.createRange(t,n));i.push(e)}e=o.createPositionAfter(e.parent)}if(i.length>0){for(let t=0;t<i.length;t++){const n=e.nodeBefore;if(e=o.insert(e,i[t]).end,t>0){const t=Ng(o,n,n.nextSibling);t&&t.parent==n&&e.offset--}}Ng(o,e.nodeBefore,e.nodeAfter)}}}function Eg(e,t,n){const o=n.mapper.toViewPosition(t.position),i=o.nodeBefore,r=o.nodeAfter;Ng(n.writer,i,r)}function Tg(e,t,n){if(n.consumable.consume(t.viewItem,{name:!0})){const e=n.writer,o=this.conversionApi.store,i=e.createElement("listItem");o.indent=o.indent||0,e.setAttribute("listIndent",o.indent,i);const r=t.viewItem.parent&&"ol"==t.viewItem.parent.name?"numbered":"bulleted";e.setAttribute("listType",r,i),o.indent++;const s=n.splitToAllowedParent(i,t.modelCursor);if(!s)return;e.insert(i,s.position);const a=function(e,t,n){const{writer:o,schema:i}=n;let r=o.createPositionAfter(e);for(const s of t)if("ul"==s.name||"ol"==s.name)r=n.convertItem(s,r).modelCursor;else{const t=n.convertItem(s,o.createPositionAt(e,"end")),a=t.modelRange.start.nodeAfter,c=a&&a.is("element")&&!i.checkChild(e,a.name);c&&(e=t.modelCursor.parent.is("listItem")?t.modelCursor.parent:Dg(t.modelCursor),r=o.createPositionAfter(e))}return r}(i,t.viewItem.getChildren(),n);o.indent--,t.modelRange=e.createRange(t.modelCursor,a),s.cursorParent?t.modelCursor=e.createPositionAt(s.cursorParent,0):t.modelCursor=t.modelRange.end}}function Sg(e,t,n){if(n.consumable.test(t.viewItem,{name:!0})){const e=Array.from(t.viewItem.getChildren());for(const t of e)t.is("li")||t._remove()}}function Rg(e,t,n){if(n.consumable.test(t.viewItem,{name:!0})){if(0===t.viewItem.childCount)return;const e=[...t.viewItem.getChildren()];let n=!1,o=!0;for(const t of e)!n||t.is("ul")||t.is("ol")||t._remove(),t.is("text")?(o&&(t._data=t.data.replace(/^\s+/,"")),(!t.nextSibling||t.nextSibling.is("ul")||t.nextSibling.is("ol"))&&(t._data=t.data.replace(/\s+$/,""))):(t.is("ul")||t.is("ol"))&&(n=!0),o=!1}}function Og(e){return(t,n)=>{if(n.isPhantom)return;const o=n.modelPosition.nodeBefore;if(o&&o.is("listItem")){const t=n.mapper.toViewElement(o),i=t.getAncestors().find(e=>e.is("ul")||e.is("ol")),r=e.createPositionAt(t,0).getWalker();for(const e of r){if("elementStart"==e.type&&e.item.is("li")){n.viewPosition=e.previousPosition;break}if("elementEnd"==e.type&&e.item==i){n.viewPosition=e.nextPosition;break}}}}}function Ig(e,[t,n]){let o,i=t.is("documentFragment")?t.getChild(0):t;if(o=n?this.createSelection(n):this.document.selection,i&&i.is("listItem")){const e=o.getFirstPosition();let t=null;if(e.parent.is("listItem")?t=e.parent:e.nodeBefore&&e.nodeBefore.is("listItem")&&(t=e.nodeBefore),t){const e=t.getAttribute("listIndent");if(e>0)for(;i&&i.is("listItem");)i._setAttribute("listIndent",i.getAttribute("listIndent")+e),i=i.nextSibling}}}function Dg(e){const t=new Ws({startPosition:e});let n;do{n=t.next()}while(!n.value.item.is("listItem"));return n.value.item}function Mg(e,t){const n=!!t.sameIndent,o=!!t.smallerIndent,i=t.listIndent;let r=e;for(;r&&"listItem"==r.name;){const e=r.getAttribute("listIndent");if(n&&i==e||o&&i>e)return r;r=r.previousSibling}return null}function Ng(e,t,n){return t&&n&&("ul"==t.name||"ol"==t.name)&&t.name==n.name?e.mergeContainers(e.createPositionAfter(t)):null}function Fg(e,t,n,o){const i=t.parent,r=n.mapper,s=n.writer;let a=r.toViewPosition(o.createPositionBefore(e));const c=Mg(e.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:e.getAttribute("listIndent")}),l=e.previousSibling;if(c&&c.getAttribute("listIndent")==e.getAttribute("listIndent")){const e=r.toViewElement(c);a=s.breakContainer(s.createPositionAfter(e))}else a=l&&"listItem"==l.name?r.toViewPosition(o.createPositionAt(l,"end")):r.toViewPosition(o.createPositionBefore(e));if(a=Vg(a),s.insert(a,i),l&&"listItem"==l.name){const e=r.toViewElement(l),n=s.createRange(s.createPositionAt(e,0),a).getWalker({ignoreElementEnd:!0});for(const e of n)if(e.item.is("li")){const o=s.breakContainer(s.createPositionBefore(e.item)),i=e.item.parent,r=s.createPositionAt(t,"end");Ng(s,r.nodeBefore,r.nodeAfter),s.move(s.createRangeOn(i),r),n.position=o}}else{const n=i.nextSibling;if(n&&(n.is("ul")||n.is("ol"))){let o=null;for(const t of n.getChildren()){const n=r.toModelElement(t);if(!(n&&n.getAttribute("listIndent")>e.getAttribute("listIndent")))break;o=t}o&&(s.breakContainer(s.createPositionAfter(o)),s.move(s.createRangeOn(o.parent),s.createPositionAt(t,"end")))}}Ng(s,i,i.nextSibling),Ng(s,i.previousSibling,i)}function Bg(e,t,n,o,i,r){const s=Mg(t.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:e,foo:"b"}),a=i.mapper,c=i.writer,l=s?s.getAttribute("listIndent"):null;let d;if(s)if(l==e){const e=a.toViewElement(s).parent;d=c.createPositionAfter(e)}else{const e=r.createPositionAt(s,"end");d=a.toViewPosition(e)}else d=n;d=Vg(d);for(const e of[...o.getChildren()])(e.is("ul")||e.is("ol"))&&(d=c.move(c.createRangeOn(e),d).end,Ng(c,e,e.nextSibling),Ng(c,e.previousSibling,e))}function Vg(e){return e.getLastMatchingPosition(e=>e.item.is("uiElement"))}lo(kg,Ho);class Lg extends kg{static get requires(){return[_p]}init(){const e=this.editor;e.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const t=e.data,n=e.editing;e.model.document.registerPostFixer(t=>(function(e,t){const n=e.document.differ.getChanges(),o=new Map;let i=!1;for(const e of n)if("insert"==e.type&&"listItem"==e.name)r(e.position);else if("insert"==e.type&&"listItem"!=e.name){if("$text"!=e.name){const n=e.position.nodeAfter;n.hasAttribute("listIndent")&&(t.removeAttribute("listIndent",n),i=!0),n.hasAttribute("listType")&&(t.removeAttribute("listType",n),i=!0)}r(e.position.getShiftedBy(e.length))}else"remove"==e.type&&"listItem"==e.name?r(e.position):"attribute"==e.type&&"listIndent"==e.attributeKey?r(e.range.start):"attribute"==e.type&&"listType"==e.attributeKey&&r(e.range.start);for(const e of o.values())s(e),a(e);return i;function r(e){const t=e.nodeBefore;if(t&&t.is("listItem")){let n=t;if(o.has(n))return;for(;n.previousSibling&&n.previousSibling.is("listItem");)if(n=n.previousSibling,o.has(n))return;o.set(e.nodeBefore,n)}else{const t=e.nodeAfter;t&&t.is("listItem")&&o.set(t,t)}}function s(e){let n=0,o=null;for(;e&&e.is("listItem");){const r=e.getAttribute("listIndent");if(r>n){let s;null===o?(o=r-n,s=n):(o>r&&(o=r),s=r-o),t.setAttribute("listIndent",s,e),i=!0}else o=null,n=e.getAttribute("listIndent")+1;e=e.nextSibling}}function a(e){let n=[],o=null;for(;e&&e.is("listItem");){const r=e.getAttribute("listIndent");if(o&&o.getAttribute("listIndent")>r&&(n=n.slice(0,r+1)),0!=r)if(n[r]){const o=n[r];e.getAttribute("listType")!=o&&(t.setAttribute("listType",o,e),i=!0)}else n[r]=e.getAttribute("listType");o=e,e=e.nextSibling}}})(e.model,t)),n.mapper.registerViewToModelLength("li",zg),t.mapper.registerViewToModelLength("li",zg),n.mapper.on("modelToViewPosition",Og(n.view)),n.mapper.on("viewToModelPosition",function(e){return(t,n)=>{const o=n.viewPosition,i=o.parent,r=n.mapper;if("ul"==i.name||"ol"==i.name){if(o.isAtEnd){const t=r.toModelElement(o.nodeBefore),i=r.getModelLength(o.nodeBefore);n.modelPosition=e.createPositionBefore(t).getShiftedBy(i)}else{const t=r.toModelElement(o.nodeAfter);n.modelPosition=e.createPositionBefore(t)}t.stop()}else if("li"==i.name&&o.nodeBefore&&("ul"==o.nodeBefore.name||"ol"==o.nodeBefore.name)){const s=r.toModelElement(i);let a=1,c=o.nodeBefore;for(;c&&(c.is("ul")||c.is("ol"));)a+=r.getModelLength(c),c=c.previousSibling;n.modelPosition=e.createPositionBefore(s).getShiftedBy(a),t.stop()}}}(e.model)),t.mapper.on("modelToViewPosition",Og(n.view)),n.downcastDispatcher.on("insert",Pg,{priority:"high"}),n.downcastDispatcher.on("insert:listItem",yg(e.model)),t.downcastDispatcher.on("insert",Pg,{priority:"high"}),t.downcastDispatcher.on("insert:listItem",yg(e.model)),n.downcastDispatcher.on("attribute:listType:listItem",Cg),t.downcastDispatcher.on("attribute:listType:listItem",Cg),n.downcastDispatcher.on("attribute:listIndent:listItem",Ag(e.model)),t.downcastDispatcher.on("attribute:listIndent:listItem",Ag(e.model)),n.downcastDispatcher.on("remove:listItem",xg(e.model)),n.downcastDispatcher.on("remove",Eg,{priority:"low"}),t.downcastDispatcher.on("remove:listItem",xg(e.model)),t.downcastDispatcher.on("remove",Eg,{priority:"low"}),t.upcastDispatcher.on("element:ul",Sg,{priority:"high"}),t.upcastDispatcher.on("element:ol",Sg,{priority:"high"}),t.upcastDispatcher.on("element:li",Rg,{priority:"high"}),t.upcastDispatcher.on("element:li",Tg),e.model.on("insertContent",Ig,{priority:"high"}),e.commands.add("numberedList",new gg(e,"numbered")),e.commands.add("bulletedList",new gg(e,"bulleted")),e.commands.add("indentList",new _g(e,"forward")),e.commands.add("outdentList",new _g(e,"backward"));const o=this.editor.editing.view.document;this.listenTo(o,"enter",(e,t)=>{const n=this.editor.model.document,o=n.selection.getLastPosition().parent;n.selection.isCollapsed&&"listItem"==o.name&&o.isEmpty&&(this.editor.execute("outdentList"),t.preventDefault(),e.stop())}),this.listenTo(o,"delete",(e,t)=>{if("backward"!==t.direction)return;const n=this.editor.model.document.selection;if(!n.isCollapsed)return;const o=n.getFirstPosition();if(!o.isAtStart)return;const i=o.parent;"listItem"===i.name&&(i.previousSibling&&"listItem"===i.previousSibling.name||(this.editor.execute("outdentList"),t.preventDefault(),e.stop()))},{priority:"high"});const i=e=>(t,n)=>{this.editor.commands.get(e).isEnabled&&(this.editor.execute(e),n())};this.editor.keystrokes.set("Tab",i("indentList")),this.editor.keystrokes.set("Shift+Tab",i("outdentList"))}}function zg(e){let t=1;for(const n of e.getChildren())if("ul"==n.name||"ol"==n.name)for(const e of n.getChildren())t+=zg(e);return t}var qg=n(53),jg=n.n(qg),Hg=n(54),Ug=n.n(Hg);class Wg extends kg{init(){const e=this.editor.t;this._addButton("numberedList",e("al"),jg.a),this._addButton("bulletedList",e("am"),Ug.a)}_addButton(e,t,n){const o=this.editor;o.ui.componentFactory.add(e,i=>{const r=o.commands.get(e),s=new Ql(i);return s.set({label:t,icon:n,tooltip:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),this.listenTo(s,"execute",()=>o.execute(e)),s})}}var $g=n(55),Gg=n.n($g);var Kg=n(56),Jg=n.n(Kg);const Zg=Symbol("isOPCodeBlock");function Qg(e){return!!e.getCustomProperty(Zg)&&Od(e)}function Yg(e){const t=e.getSelectedElement();return!(!t||!Qg(t))}function Xg(e,t,n){const o=t.createContainerElement("div",{class:"op-ckeditor--code-block",title:window.I18n.t("js.editor.macro.toolbar_help")});return eb(t,e,o),function(e,t,n){return t.setCustomProperty(Zg,!0,e),Id(e,t,{label:n})}(o,t,n)}function eb(e,t,n){const o=(t.getAttribute("opCodeblockLanguage")||"language-text").replace(/^language-/,""),i=e.createContainerElement("div",{class:"op-ckeditor--code-block-language"});tb(e,o,i,"text"),e.insert(e.createPositionAt(n,0),i),tb(e,t.getAttribute("opCodeblockContent"),n,"(empty)")}function tb(e,t,n,o){const i=e.createText(t||o);e.insert(e.createPositionAt(n,0),i)}class nb extends ts{constructor(e){super(e),this.domEventType="dblclick"}onDomEvent(e){this.fire(e.type,e)}}class ob extends yd{static get pluginName(){return"CodeBlockEditing"}init(){const e=this.editor,t=e.model.schema,n=e.conversion,o=e.editing.view,i=o.document,r=qd(e);t.register("codeblock",{isObject:!0,isBlock:!0,allowContentOf:"$block",allowWhere:["$root","$block"],allowIn:["$root"],allowAttributes:["opCodeblockLanguage","opCodeblockContent"]}),n.for("upcast").add(function(){return t=>{t.on("element:pre",e,{priority:"high"})};function e(e,t,n){if(!n.consumable.test(t.viewItem,{name:!0}))return;const o=Array.from(t.viewItem.getChildren()).find(e=>e.is("code"));if(!o||!n.consumable.consume(o,{name:!0}))return;const i=n.writer.createElement("codeblock");n.writer.setAttribute("opCodeblockLanguage",o.getAttribute("class"),i);const r=n.splitToAllowedParent(i,t.modelCursor);if(r){n.writer.insert(i,r.position);const e=o.getChild(0);n.consumable.consume(e,{name:!0});const s=e.data.replace(/\n$/,"");n.writer.setAttribute("opCodeblockContent",s,i),t.modelRange=new Js(n.writer.createPositionBefore(i),n.writer.createPositionAfter(i)),t.modelCursor=t.modelRange.end}}}()),n.for("editingDowncast").elementToElement({model:"codeblock",view:(e,t)=>Xg(e,t,"Code block")}).add(function(){return t=>{t.on("attribute:opCodeblockContent",e),t.on("attribute:opCodeblockLanguage",e)};function e(e,t,n){const o=t.item;n.consumable.consume(t.item,e.name);const i=n.mapper.toViewElement(o);n.writer.remove(n.writer.createRangeOn(i.getChild(1))),n.writer.remove(n.writer.createRangeOn(i.getChild(0))),eb(n.writer,o,i)}}()),n.for("dataDowncast").add(function(){return t=>{t.on("insert:codeblock",e,{priority:"high"})};function e(e,t,n){const o=t.item,i=o.getAttribute("opCodeblockLanguage")||"language-text",r=o.getAttribute("opCodeblockContent");n.consumable.consume(o,"insert");const s=n.writer,a=s.createContainerElement("pre"),c=s.createContainerElement("div",{class:"op-ckeditor--code-block-language"}),l=s.createContainerElement("code",{class:i}),d=s.createText(i),u=s.createText(r);s.insert(s.createPositionAt(l,0),u),s.insert(s.createPositionAt(c,0),d),s.insert(s.createPositionAt(a,0),c),s.insert(s.createPositionAt(a,0),l),n.mapper.bindElements(o,l),n.mapper.bindElements(o,a);const h=n.mapper.toViewPosition(t.range.start);s.insert(h,a),e.stop()}}()),o.addObserver(nb),this.listenTo(i,"dblclick",(t,n)=>{let o=n.target,i=n.domEvent;if(i.shiftKey||i.altKey||i.metaKey)return;if(!Qg(o)&&!(o=o.findAncestor(Qg)))return;n.preventDefault(),n.stopPropagation();const s=e.editing.mapper.toModelElement(o),a=r.services.macros,c=s.getAttribute("opCodeblockLanguage"),l=s.getAttribute("opCodeblockContent");a.editCodeBlock(l,c).then(t=>e.model.change(e=>{e.setAttribute("opCodeblockLanguage",t.languageClass,s),e.setAttribute("opCodeblockContent",t.content,s)}))}),e.ui.componentFactory.add("insertCodeBlock",t=>{const n=new Ql(t);return n.set({label:window.I18n.t("js.editor.macro.code_block.button"),icon:Jg.a,tooltip:!0}),n.on("execute",()=>{r.services.macros.editCodeBlock().then(t=>e.model.change(n=>{const o=n.createElement("codeblock");n.setAttribute("opCodeblockLanguage",t.languageClass,o),n.setAttribute("opCodeblockContent",t.content,o),e.model.insertContent(o,e.model.document.selection)}))}),n})}}class ib extends yd{static get requires(){return[su]}static get pluginName(){return"CodeBlockToolbar"}init(){const e=this.editor,t=this.editor.model,n=qd(e);lu(e,"opEditCodeBlock",e=>{const o=n.services.macros,i=e.getAttribute("opCodeblockLanguage"),r=e.getAttribute("opCodeblockContent");o.editCodeBlock(r,i).then(n=>t.change(t=>{t.setAttribute("opCodeblockLanguage",n.languageClass,e),t.setAttribute("opCodeblockContent",n.content,e)}))})}afterInit(){uu(this,this.editor,"OPCodeBlock",Yg)}}var rb=n(57),sb=n.n(rb);function ab(e){return e.__currentlyDisabled=e.__currentlyDisabled||[],e.ui.view.toolbar?e.ui.view.toolbar.items._items:[]}function cb(e,t){jQuery.each(ab(e),function(n,o){let i=o;o instanceof Su?i=o.buttonView:o!==t&&o.hasOwnProperty("isEnabled")||(i=null),i&&(i.isEnabled?i.isEnabled=!1:e.__currentlyDisabled.push(i))})}function lb(e){jQuery.each(ab(e),function(t,n){let o=n;n instanceof Su&&(o=n.buttonView),e.__currentlyDisabled.indexOf(o)<0&&(o.isEnabled=!0)}),e.__currentlyDisabled=[]}class db{constructor(e){this.editor=e}destroy(){this.stopListening()}}function ub(e,t){let n=t.parent;for(;n;){if(n.name===e)return n;n=n.parent}}function hb(e,t,n,o,i=1){t>i?o.setAttribute(e,t,n):o.removeAttribute(e,n)}function fb(e,t,n={}){const o=e.createElement("tableCell",n);e.insertElement("paragraph",o),e.insert(o,t)}function pb(){return e=>{e.on("element:table",(e,t,n)=>{const o=t.viewItem;if(!n.consumable.test(o,{name:!0}))return;const{rows:i,headingRows:r,headingColumns:s}=function(e){const t={headingRows:0,headingColumns:0},n=[],o=[];let i;for(const r of Array.from(e.getChildren()))if("tbody"===r.name||"thead"===r.name||"tfoot"===r.name){"thead"!==r.name||i||(i=r);const e=Array.from(r.getChildren()).filter(e=>e.is("element","tr"));for(const r of e)if("thead"===r.parent.name&&r.parent===i)t.headingRows++,n.push(r);else{o.push(r);const e=gb(r);e>t.headingColumns&&(t.headingColumns=e)}}return t.rows=[...n,...o],t}(o),a={};s&&(a.headingColumns=s),r&&(a.headingRows=r);const c=n.writer.createElement("table",a),l=n.splitToAllowedParent(c,t.modelCursor);if(l){if(n.writer.insert(c,l.position),n.consumable.consume(o,{name:!0}),i.length)i.forEach(e=>n.convertItem(e,n.writer.createPositionAt(c,"end")));else{const e=n.writer.createElement("tableRow");n.writer.insert(e,n.writer.createPositionAt(c,"end")),fb(n.writer,n.writer.createPositionAt(e,"end"))}t.modelRange=n.writer.createRange(n.writer.createPositionBefore(c),n.writer.createPositionAfter(c)),l.cursorParent?t.modelCursor=n.writer.createPositionAt(l.cursorParent,0):t.modelCursor=t.modelRange.end}})}}function mb(e){return t=>{t.on(`element:${e}`,(e,t,n)=>{const o=t.viewItem;if(!n.consumable.test(o,{name:!0}))return;const i=n.writer.createElement("tableCell"),r=n.splitToAllowedParent(i,t.modelCursor);if(!r)return;n.writer.insert(i,r.position),n.consumable.consume(o,{name:!0});const s=n.writer.createPositionAt(i,0);n.convertChildren(o,s),i.childCount||n.writer.insertElement("paragraph",s),t.modelRange=n.writer.createRange(n.writer.createPositionBefore(i),n.writer.createPositionAfter(i)),t.modelCursor=t.modelRange.end})}}function gb(e){let t=0,n=0;const o=Array.from(e.getChildren()).filter(e=>"th"===e.name||"td"===e.name);for(;n<o.length&&"th"===o[n].name;){const e=o[n];t+=parseInt(e.getAttribute("colspan")||1),n++}return t}lo(db,Ho);class bb{constructor(e,t={}){this.table=e,this.startRow=t.startRow||0,this.endRow="number"==typeof t.endRow?t.endRow:void 0,this.includeSpanned=!!t.includeSpanned,this.column="number"==typeof t.column?t.column:void 0,this._skipRows=new Set,this._row=0,this._column=0,this._cell=0,this._spannedCells=new Map}[Symbol.iterator](){return this}next(){const e=this.table.getChild(this._row);if(!e||this._isOverEndRow())return{done:!0};if(this._isSpanned(this._row,this._column)){const e=this._column,t=this._formatOutValue(void 0,e);return this._column++,!this.includeSpanned||this._shouldSkipRow()||this._shouldSkipColumn(e,1)?this.next():t}const t=e.getChild(this._cell);if(!t)return this._row++,this._column=0,this._cell=0,this.next();const n=parseInt(t.getAttribute("colspan")||1),o=parseInt(t.getAttribute("rowspan")||1);(n>1||o>1)&&this._recordSpans(this._row,this._column,o,n);const i=this._column,r=this._formatOutValue(t,i,o,n);return this._column++,this._cell++,this._shouldSkipRow()||this._shouldSkipColumn(i,n)?this.next():r}skipRow(e){this._skipRows.add(e)}_isOverEndRow(){return void 0!==this.endRow&&this._row>this.endRow}_formatOutValue(e,t,n=1,o=1){return{done:!1,value:{cell:e,row:this._row,column:t,rowspan:n,colspan:o,cellIndex:this._cell}}}_shouldSkipRow(){const e=this._row<this.startRow,t=this._skipRows.has(this._row);return e||t}_shouldSkipColumn(e,t){if(void 0===this.column)return!1;const n=e===this.column,o=e<this.column&&e+t>this.column;return!n&&!o}_isSpanned(e,t){if(!this._spannedCells.has(e))return!1;return this._spannedCells.get(e).has(t)}_recordSpans(e,t,n,o){for(let n=t+1;n<=t+o-1;n++)this._markSpannedCell(e,n);for(let i=e+1;i<e+n;i++)for(let e=t;e<=t+o-1;e++)this._markSpannedCell(i,e)}_markSpannedCell(e,t){this._spannedCells.has(e)||this._spannedCells.set(e,new Map),this._spannedCells.get(e).set(t,!0)}}function wb(e){return!!e.getCustomProperty("table")&&Od(e)}function _b(e){const t=e.getSelectedElement();return t&&wb(t)?t:null}function kb(e){const t=ub("table",e.getFirstPosition());return t&&wb(t.parent)?t.parent:null}function vb(e={}){return t=>t.on("insert:table",(t,n,o)=>{const i=n.item;if(!o.consumable.consume(i,"insert"))return;o.consumable.consume(i,"attribute:headingRows:table"),o.consumable.consume(i,"attribute:headingColumns:table");const r=e&&e.asWidget,s=o.writer.createContainerElement("figure",{class:"table"}),a=o.writer.createContainerElement("table");let c;o.writer.insert(o.writer.createPositionAt(s,0),a),r&&(c=function(e,t){return t.setCustomProperty("table",!0,e),Id(e,t,{hasSelectionHandler:!0})}(s,o.writer));const l=new bb(i),d={headingRows:i.getAttribute("headingRows")||0,headingColumns:i.getAttribute("headingColumns")||0},u=new Map;for(const t of l){const{row:n,cell:r}=t,s=Ib(Ob(n,d),a,o),c=i.getChild(n),l=u.get(n)||Sb(c,n,s,o);u.set(n,l),o.consumable.consume(r,"insert"),Tb(t,d,o.writer.createPositionAt(l,"end"),o,e)}const h=o.mapper.toViewPosition(n.range.start);o.mapper.bindElements(i,r?c:s),o.writer.insert(h,r?c:s)})}function yb(e={}){return t=>t.on("insert:tableRow",(t,n,o)=>{const i=n.item;if(!o.consumable.consume(i,"insert"))return;const r=i.parent,s=Fb(o.mapper.toViewElement(r)),a=r.getChildIndex(i),c=new bb(r,{startRow:a,endRow:a}),l={headingRows:r.getAttribute("headingRows")||0,headingColumns:r.getAttribute("headingColumns")||0},d=new Map;for(const t of c){const n=Ib(Ob(a,l),s,o),r=d.get(a)||Sb(i,a,n,o);d.set(a,r),o.consumable.consume(t.cell,"insert"),Tb(t,l,o.writer.createPositionAt(r,"end"),o,e)}})}function xb(e={}){return t=>t.on("insert:tableCell",(t,n,o)=>{const i=n.item;if(!o.consumable.consume(i,"insert"))return;const r=i.parent,s=r.parent,a=s.getChildIndex(r),c=new bb(s,{startRow:a,endRow:a}),l={headingRows:s.getAttribute("headingRows")||0,headingColumns:s.getAttribute("headingColumns")||0};for(const t of c)if(t.cell===i){const n=o.mapper.toViewElement(r);return void Tb(t,l,o.writer.createPositionAt(n,r.getChildIndex(i)),o,e)}})}function Cb(e={}){const t=!!e.asWidget;return e=>e.on("attribute:headingRows:table",(e,n,o)=>{const i=n.item;if(!o.consumable.consume(n.item,e.name))return;const r=Fb(o.mapper.toViewElement(i)),s=n.attributeOldValue,a=n.attributeNewValue;if(a>s){const e=Array.from(i.getChildren()).filter(({index:e})=>c(e,s-1,a));Nb(e,Ib("thead",r,o),o,"end");for(const n of e)for(const e of n.getChildren())Pb(e,"th",o,t);Mb("tbody",r,o)}else{Nb(Array.from(i.getChildren()).filter(({index:e})=>c(e,a-1,s)).reverse(),Ib("tbody",r,o),o,0);const e=new bb(i,{startRow:a?a-1:a,endRow:s-1}),n={headingRows:i.getAttribute("headingRows")||0,headingColumns:i.getAttribute("headingColumns")||0};for(const i of e)Eb(i,n,o,t);Mb("thead",r,o)}function c(e,t,n){return e>t&&e<n}})}function Ab(e={}){const t=!!e.asWidget;return e=>e.on("attribute:headingColumns:table",(e,n,o)=>{const i=n.item;if(!o.consumable.consume(n.item,e.name))return;const r={headingRows:i.getAttribute("headingRows")||0,headingColumns:i.getAttribute("headingColumns")||0},s=n.attributeOldValue,a=n.attributeNewValue,c=(s>a?s:a)-1;for(const e of new bb(i))e.column>c||Eb(e,r,o,t)})}function Pb(e,t,n,o){const i=n.writer,r=n.mapper.toViewElement(e);if(!r)return;let s;if(o){s=Md(i.createEditableElement(t,r.getAttributes()),i),i.insert(i.createPositionAfter(r),s),i.move(i.createRangeIn(r),i.createPositionAt(s,0)),i.remove(i.createRangeOn(r))}else s=i.rename(t,r);n.mapper.bindElements(e,s)}function Eb(e,t,n,o){const{cell:i}=e,r=Rb(e,t),s=n.mapper.toViewElement(i);s&&s.name!==r&&Pb(i,r,n,o)}function Tb(e,t,n,o,i){const r=i&&i.asWidget,s=Rb(e,t),a=r?Md(o.writer.createEditableElement(s),o.writer):o.writer.createContainerElement(s),c=e.cell,l=c.getChild(0),d=1===c.childCount&&"paragraph"===l.name;if(o.writer.insert(n,a),d&&!function(e){return!![...e.getAttributeKeys()].length}(l)){const e=c.getChild(0),t=o.writer.createPositionAt(a,"end");if(o.consumable.consume(e,"insert"),i.asWidget){const n=o.writer.createContainerElement("span");o.mapper.bindElements(e,n),o.writer.insert(t,n),o.mapper.bindElements(c,a)}else o.mapper.bindElements(c,a),o.mapper.bindElements(e,a)}else o.mapper.bindElements(c,a)}function Sb(e,t,n,o){o.consumable.consume(e,"insert");const i=o.writer.createContainerElement("tr");o.mapper.bindElements(e,i);const r=e.parent.getAttribute("headingRows")||0,s=r>0&&t>=r?t-r:t,a=o.writer.createPositionAt(n,s);return o.writer.insert(a,i),i}function Rb(e,t){const{row:n,column:o}=e,{headingColumns:i,headingRows:r}=t;return r&&r>n?"th":i&&i>o?"th":"td"}function Ob(e,t){return e<t.headingRows?"thead":"tbody"}function Ib(e,t,n){const o=Db(e,t);return o||function(e,t,n){const o=n.writer.createContainerElement(e),i=n.writer.createPositionAt(t,"tbody"==e?"end":0);return n.writer.insert(i,o),o}(e,t,n)}function Db(e,t){for(const n of t.getChildren())if(n.name==e)return n}function Mb(e,t,n){const o=Db(e,t);o&&0===o.childCount&&n.writer.remove(n.writer.createRangeOn(o))}function Nb(e,t,n,o){for(const i of e){const e=n.mapper.toViewElement(i);e&&n.writer.move(n.writer.createRangeOn(e),n.writer.createPositionAt(t,o))}}function Fb(e){for(const t of e.getChildren())if("table"===t.name)return t}class Bb{constructor(e){this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",e=>{this.isEnabled||e.stop()},{priority:"high"}),this.listenTo(e,"change:isReadOnly",(e,t,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",Vb,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",Vb),this.refresh())}execute(){}destroy(){this.stopListening()}}function Vb(e){e.return=!1,e.stop()}lo(Bb,Ho);class Lb extends Bb{refresh(){const e=this.editor.model,t=e.document.selection,n=e.schema,o=function(e){const t=e.parent;return t===t.root?t:t.parent}(t.getFirstPosition());this.isEnabled=n.checkChild(o,"table")}execute(e={}){const t=this.editor.model,n=t.document.selection,o=this.editor.plugins.get("TableUtils"),i=parseInt(e.rows)||2,r=parseInt(e.columns)||2,s=Nd(n,t);t.change(e=>{const n=o.createTable(e,i,r);t.insertContent(n,s),e.setSelection(e.createPositionAt(n.getNodeByPath([0,0,0]),0))})}}class zb extends Bb{constructor(e,t={}){super(e),this.order=t.order||"below"}refresh(){const e=ub("table",this.editor.model.document.selection.getFirstPosition());this.isEnabled=!!e}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),o=ub("tableCell",t.getFirstPosition()).parent,i=o.parent,r=i.getChildIndex(o),s="below"===this.order?r+1:r;n.insertRows(i,{rows:1,at:s})}}class qb extends Bb{constructor(e,t={}){super(e),this.order=t.order||"right"}refresh(){const e=ub("table",this.editor.model.document.selection.getFirstPosition());this.isEnabled=!!e}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),o=ub("tableCell",t.getFirstPosition()),i=o.parent.parent,{column:r}=n.getCellLocation(o),s="right"===this.order?r+1:r;n.insertColumns(i,{columns:1,at:s})}}class jb extends Bb{constructor(e,t={}){super(e),this.direction=t.direction||"horizontally"}refresh(){const e=ub("tableCell",this.editor.model.document.selection.getFirstPosition());this.isEnabled=!!e}execute(){const e=ub("tableCell",this.editor.model.document.selection.getFirstPosition()),t="horizontally"===this.direction,n=this.editor.plugins.get("TableUtils");t?n.splitCellHorizontally(e,2):n.splitCellVertically(e,2)}}class Hb extends Bb{constructor(e,t){super(e),this.direction=t.direction,this.isHorizontal="right"==this.direction||"left"==this.direction}refresh(){const e=this._getMergeableCell();this.isEnabled=!!e,this.value=e}execute(){const e=this.editor.model,t=ub("tableCell",e.document.selection.getFirstPosition()),n=this.value,o=this.direction;e.change(e=>{const i="right"==o||"down"==o,r=i?t:n,s=i?n:t,a=s.parent;!function(e,t,n){Ub(e)||(Ub(t)&&n.remove(n.createRangeIn(t)),n.move(n.createRangeIn(e),n.createPositionAt(t,"end")));n.remove(e)}(s,r,e);const c=this.isHorizontal?"colspan":"rowspan",l=parseInt(t.getAttribute(c)||1),d=parseInt(n.getAttribute(c)||1);e.setAttribute(c,l+d,r),e.setSelection(e.createRangeIn(r)),a.childCount||function(e,t){const n=e.parent,o=n.getChildIndex(e);for(const{cell:e,row:i,rowspan:r}of new bb(n,{endRow:o})){const n=i+r-1>=o;n&&hb("rowspan",r-1,e,t)}t.remove(e)}(a,e)})}_getMergeableCell(){const e=ub("tableCell",this.editor.model.document.selection.getFirstPosition());if(!e)return;const t=this.editor.plugins.get("TableUtils"),n=this.isHorizontal?function(e,t,n){const o="right"==t?e.nextSibling:e.previousSibling;if(!o)return;const i="right"==t?e:o,r="right"==t?o:e,{column:s}=n.getCellLocation(i),{column:a}=n.getCellLocation(r),c=parseInt(i.getAttribute("colspan")||1);return s+c===a?o:void 0}(e,this.direction,t):function(e,t){const n=e.parent,o=n.parent,i=o.getChildIndex(n);if("down"==t&&i===o.childCount-1||"up"==t&&0===i)return;const r=parseInt(e.getAttribute("rowspan")||1),s=o.getAttribute("headingRows")||0;if(s&&("down"==t&&i+r===s||"up"==t&&i===s))return;const a=parseInt(e.getAttribute("rowspan")||1),c="down"==t?i+a:i,l=[...new bb(o,{endRow:c})],d=l.find(t=>t.cell===e).column,u=l.find(({row:e,rowspan:n,column:o})=>o===d&&("down"==t?e===c:c===e+n));return u&&u.cell}(e,this.direction);if(!n)return;const o=this.isHorizontal?"rowspan":"colspan",i=parseInt(e.getAttribute(o)||1);return parseInt(n.getAttribute(o)||1)===i?n:void 0}}function Ub(e){return 1==e.childCount&&e.getChild(0).is("paragraph")&&e.getChild(0).isEmpty}class Wb extends Bb{refresh(){const e=ub("tableCell",this.editor.model.document.selection.getFirstPosition());this.isEnabled=!!e&&e.parent.parent.childCount>1}execute(){const e=this.editor.model,t=ub("tableCell",e.document.selection.getFirstPosition()).parent,n=t.parent,o=n.getChildIndex(t),i=n.getAttribute("headingRows")||0;e.change(e=>{i&&o<=i&&hb("headingRows",i-1,n,e,0);const r=[...new bb(n,{endRow:o})],s=new Map;r.filter(({row:e,rowspan:t})=>e===o&&t>1).forEach(({column:e,cell:t,rowspan:n})=>s.set(e,{cell:t,rowspanToSet:n-1})),r.filter(({row:e,rowspan:t})=>e<=o-1&&e+t>o).forEach(({cell:t,rowspan:n})=>hb("rowspan",n-1,t,e));const a=o+1,c=new bb(n,{includeSpanned:!0,startRow:a,endRow:a});let l;for(const{row:t,column:o,cell:i}of[...c])if(s.has(o)){const{cell:i,rowspanToSet:r}=s.get(o),a=l?e.createPositionAfter(l):e.createPositionAt(n.getChild(t),0);e.move(e.createRangeOn(i),a),hb("rowspan",r,i,e),l=i}else l=i;e.remove(t)})}}class $b extends Bb{refresh(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),o=ub("tableCell",t.getFirstPosition());this.isEnabled=!!o&&n.getColumns(o.parent.parent)>1}execute(){const e=this.editor.model,t=ub("tableCell",e.document.selection.getFirstPosition()),n=t.parent,o=n.parent,i=o.getAttribute("headingColumns")||0,r=o.getChildIndex(n),s=[...new bb(o)],a=s.find(e=>e.cell===t).column;e.change(e=>{i&&r<=i&&e.setAttribute("headingColumns",i-1,o);for(const{cell:t,column:n,colspan:o}of s)n<=a&&o>1&&n+o>a?hb("colspan",o-1,t,e):n===a&&e.remove(t)})}}class Gb extends Bb{refresh(){const e=ub("tableCell",this.editor.model.document.selection.getFirstPosition()),t=!!e;this.isEnabled=t,this.value=t&&this._isInHeading(e,e.parent.parent)}execute(){const e=this.editor.model,t=ub("tableCell",e.document.selection.getFirstPosition()).parent,n=t.parent,o=n.getAttribute("headingRows")||0,i=t.index,r=o>i?i:i+1;e.change(e=>{if(r){const t=function(e,t,n){const o=[],i=new bb(e,{startRow:t>n?n:0,endRow:t-1});for(const{row:e,rowspan:n,cell:r}of i)n>1&&e+n>t&&o.push(r);return o}(n,r,o);for(const n of t)Kb(n,r,e)}hb("headingRows",r,n,e,0)})}_isInHeading(e,t){const n=parseInt(t.getAttribute("headingRows")||0);return!!n&&e.parent.index<n}}function Kb(e,t,n){const o=e.parent,i=o.parent,r=t-o.index,s={},a=parseInt(e.getAttribute("rowspan"))-r;a>1&&(s.rowspan=a);const c=i.getChildIndex(o),l=c+r,d=[...new bb(i,{startRow:c,endRow:l,includeSpanned:!0})];let u;for(const{row:t,column:o,cell:r,colspan:a,cellIndex:c}of d)if(r===e&&(u=o,a>1&&(s.colspan=a)),void 0!==u&&u===o&&t===l){const e=i.getChild(t);fb(n,n.createPositionAt(e,c),s)}hb("rowspan",r,e,n)}class Jb extends Bb{refresh(){const e=ub("tableCell",this.editor.model.document.selection.getFirstPosition()),t=!!e;this.isEnabled=t,this.value=t&&this._isInHeading(e,e.parent.parent)}execute(){const e=this.editor.model,t=e.document.selection,n=this.editor.plugins.get("TableUtils"),o=ub("tableCell",t.getFirstPosition().parent),i=o.parent.parent,r=parseInt(i.getAttribute("headingColumns")||0),{column:s}=n.getCellLocation(o),a=r>s?s:s+1;e.change(e=>{hb("headingColumns",a,i,e,0)})}_isInHeading(e,t){const n=parseInt(t.getAttribute("headingColumns")||0),o=this.editor.plugins.get("TableUtils"),{column:i}=o.getCellLocation(e);return!!n&&i<n}}class Zb extends db{static get pluginName(){return"TableUtils"}getCellLocation(e){const t=e.parent,n=t.parent,o=n.getChildIndex(t),i=new bb(n,{startRow:o,endRow:o});for(const{cell:t,row:n,column:o}of i)if(t===e)return{row:n,column:o}}createTable(e,t,n){const o=e.createElement("table");return Qb(e,o,0,t,n),o}insertRows(e,t={}){const n=this.editor.model,o=t.at||0,i=t.rows||1;n.change(t=>{const n=e.getAttribute("headingRows")||0;if(n>o&&t.setAttribute("headingRows",n+i,e),0===o||o===e.childCount)return void Qb(t,e,o,i,this.getColumns(e));const r=new bb(e,{endRow:o});let s=0;for(const{row:e,rowspan:n,colspan:a,cell:c}of r){e<o&&e+n>o&&t.setAttribute("rowspan",n+i,c),e===o&&(s+=a)}Qb(t,e,o,i,s)})}insertColumns(e,t={}){const n=this.editor.model,o=t.at||0,i=t.columns||1;n.change(t=>{const n=e.getAttribute("headingColumns");o<n&&t.setAttribute("headingColumns",n+i,e);const r=this.getColumns(e);if(0===o||r===o){for(const n of e.getChildren())Yb(i,t,t.createPositionAt(n,o?"end":0));return}const s=new bb(e,{column:o,includeSpanned:!0});for(const{row:n,column:r,cell:a,colspan:c,rowspan:l,cellIndex:d}of s)if(r!==o){if(t.setAttribute("colspan",c+i,a),s.skipRow(n),l>1)for(let e=n+1;e<n+l;e++)s.skipRow(e)}else{const o=t.createPositionAt(e.getChild(n),d);Yb(i,t,o)}})}splitCellVertically(e,t=2){const n=this.editor.model,o=e.parent.parent,i=parseInt(e.getAttribute("rowspan")||1),r=parseInt(e.getAttribute("colspan")||1);n.change(n=>{if(r>1){const{newCellsSpan:o,updatedSpan:s}=Xb(r,t);hb("colspan",s,e,n);const a={};o>1&&(a.colspan=o),i>1&&(a.rowspan=i),Yb(r>t?t-1:r-1,n,n.createPositionAfter(e),a)}if(r<t){const s=t-r,a=[...new bb(o)],{column:c}=a.find(({cell:t})=>t===e),l=a.filter(({cell:t,colspan:n,column:o})=>{return t!==e&&o===c||o<c&&o+n>c});for(const{cell:e,colspan:t}of l)n.setAttribute("colspan",t+s,e);const d={};i>1&&(d.rowspan=i),Yb(s,n,n.createPositionAfter(e),d);const u=o.getAttribute("headingColumns")||0;u>c&&hb("headingColumns",u+s,o,n)}})}splitCellHorizontally(e,t=2){const n=this.editor.model,o=e.parent,i=o.parent,r=i.getChildIndex(o),s=parseInt(e.getAttribute("rowspan")||1),a=parseInt(e.getAttribute("colspan")||1);n.change(n=>{if(s>1){const o=[...new bb(i,{startRow:r,endRow:r+s-1,includeSpanned:!0})],{newCellsSpan:c,updatedSpan:l}=Xb(s,t);hb("rowspan",l,e,n);const{column:d}=o.find(({cell:t})=>t===e),u={};c>1&&(u.rowspan=c),a>1&&(u.colspan=a);for(const{column:e,row:t,cellIndex:s}of o){if(t>=r+l&&e===d&&(t+r+l)%c==0){Yb(1,n,n.createPositionAt(i.getChild(t),s),u)}}}if(s<t){const o=t-s,c=[...new bb(i,{startRow:0,endRow:r})];for(const{cell:t,rowspan:i,row:s}of c)if(t!==e&&s+i>r){const e=i+o;n.setAttribute("rowspan",e,t)}const l={};a>1&&(l.colspan=a),Qb(n,i,r+1,o,1,l);const d=i.getAttribute("headingRows")||0;d>r&&hb("headingRows",d+o,i,n)}})}getColumns(e){return[...e.getChild(0).getChildren()].reduce((e,t)=>{return e+parseInt(t.getAttribute("colspan")||1)},0)}}function Qb(e,t,n,o,i,r={}){for(let s=0;s<o;s++){const o=e.createElement("tableRow");e.insert(o,t,n),Yb(i,e,e.createPositionAt(o,"end"),r)}}function Yb(e,t,n,o={}){for(let i=0;i<e;i++)fb(t,n,o)}function Xb(e,t){if(e<t)return{newCellsSpan:1,updatedSpan:1};const n=Math.floor(e/t);return{newCellsSpan:n,updatedSpan:e-n*t+n}}function ew(e){e.document.registerPostFixer(t=>(function(e,t){const n=t.document.differ.getChanges();let o=!1;const i=new Set;for(const t of n){let n;"table"==t.name&&"insert"==t.type&&(n=t.position.nodeAfter),"tableRow"!=t.name&&"tableCell"!=t.name||(n=ub("table",t.position)),ow(t)&&(n=ub("table",t.range.start)),n&&!i.has(n)&&(o=tw(n,e)||o,o=nw(n,e)||o,i.add(n))}return o})(t,e))}function tw(e,t){let n=!1;const o=function(e){const t=parseInt(e.getAttribute("headingRows")||0),n=e.childCount,o=[];for(const{row:i,rowspan:r,cell:s}of new bb(e)){if(r<2)continue;const e=i<t,a=e?t:n;if(i+r>a){const e=a-i;o.push({cell:s,rowspan:e})}}return o}(e);if(o.length){n=!0;for(const e of o)hb("rowspan",e.rowspan,e.cell,t,1)}return n}function nw(e,t){let n=!1;const o=function(e){const t={};for(const{row:n}of new bb(e,{includeSpanned:!0}))t[n]||(t[n]=0),t[n]+=1;return t}(e),i=o[0];if(!Object.values(o).every(e=>e===i)){const i=Object.values(o).reduce((e,t)=>t>e?t:e,0);for(const[r,s]of Object.entries(o)){const o=i-s;if(o){for(let n=0;n<o;n++)fb(t,t.createPositionAt(e.getChild(r),"end"));n=!0}}}return n}function ow(e){const t="attribute"===e.type,n=e.attributeKey;return t&&("headingRows"===n||"colspan"===n||"rowspan"===n)}function iw(e){e.document.registerPostFixer(t=>(function(e,t){const n=t.document.differ.getChanges();let o=!1;for(const t of n)"remove"==t.type&&t.position.parent.is("tableCell")&&(o=aw(t.position.parent,e)||o),"insert"==t.type&&("table"==t.name&&(o=rw(t.position.nodeAfter,e)||o),"tableRow"==t.name&&(o=sw(t.position.nodeAfter,e)||o),"tableCell"==t.name&&(o=aw(t.position.nodeAfter,e)||o));return o})(t,e))}function rw(e,t){let n=!1;for(const o of e.getChildren())n=sw(o,t)||n;return n}function sw(e,t){let n=!1;for(const o of e.getChildren())n=aw(o,t)||n;return n}function aw(e,t){if(0==e.childCount)return t.insertElement("paragraph",e),!0;const n=Array.from(e.getChildren()).filter(e=>e.is("text"));for(const e of n)t.wrap(t.createRangeOn(e),"paragraph");return!!n.length}function cw(e,t){t.view.document.registerPostFixer(n=>(function(e,t,n,o){let i=!1;const r=function(e){const t=Array.from(e._renderer.markedAttributes).filter(e=>!!e.parent).filter(dw).filter(e=>uw(e.parent)),n=Array.from(e._renderer.markedChildren).filter(e=>!!e.parent).filter(uw).reduce((e,t)=>{const n=Array.from(t.getChildren()).filter(dw);return[...e,...n]},[]);return[...t,...n]}(o);for(const t of r)i=lw(t,n,e)||i;i&&function(e,t,n){const o=Array.from(e.getRanges()).map(e=>t.toViewRange(e));n.setSelection(o,{backward:e.isBackward})}(t.document.selection,n,e);return i})(n,e,t.mapper,t.view))}function lw(e,t,n){const o=t.toModelElement(e),i=function(e,t){const n=e.childCount>1,o=!![...t.getAttributes()].length;return n||o?"p":"span"}(o.parent,o);if(e.name!==i){t.unbindViewElement(e);const r=n.rename(i,e);return t.bindElements(o,r),!0}return!1}function dw(e){return e.is("p")||e.is("span")}function uw(e){return e.is("td")||e.is("th")}n(126);class hw extends db{init(){const e=this.editor,t=e.model,n=t.schema,o=e.conversion;n.register("table",{allowWhere:"$block",allowAttributes:["headingRows","headingColumns"],isLimit:!0,isObject:!0,isBlock:!0}),n.register("tableRow",{allowIn:"table",isLimit:!0}),n.register("tableCell",{allowIn:"tableRow",allowAttributes:["colspan","rowspan"],isLimit:!0}),n.extend("$block",{allowIn:"tableCell"}),n.addChildCheck((e,t)=>{if("table"==t.name&&Array.from(e.getNames()).includes("table"))return!1}),o.for("upcast").add(pb()),o.for("editingDowncast").add(vb({asWidget:!0})),o.for("dataDowncast").add(vb()),o.for("upcast").elementToElement({model:"tableRow",view:"tr"}),o.for("editingDowncast").add(yb({asWidget:!0})),o.for("dataDowncast").add(yb()),o.for("downcast").add(e=>e.on("remove:tableRow",(e,t,n)=>{e.stop();const o=n.writer,i=n.mapper,r=i.toViewPosition(t.position).getLastMatchingPosition(e=>!e.item.is("tr")).nodeAfter,s=r.parent,a=o.createRangeOn(r),c=o.remove(a);for(const e of o.createRangeIn(c).getItems())i.unbindViewElement(e);s.childCount||o.remove(o.createRangeOn(s))},{priority:"higher"})),o.for("upcast").add(mb("td")),o.for("upcast").add(mb("th")),o.for("editingDowncast").add(xb({asWidget:!0})),o.for("dataDowncast").add(xb()),o.attributeToAttribute({model:"colspan",view:"colspan"}),o.attributeToAttribute({model:"rowspan",view:"rowspan"}),o.for("editingDowncast").add(Ab({asWidget:!0})),o.for("dataDowncast").add(Ab()),o.for("editingDowncast").add(Cb({asWidget:!0})),o.for("dataDowncast").add(Cb()),cw(e.model,e.editing),e.commands.add("insertTable",new Lb(e)),e.commands.add("insertTableRowAbove",new zb(e,{order:"above"})),e.commands.add("insertTableRowBelow",new zb(e,{order:"below"})),e.commands.add("insertTableColumnLeft",new qb(e,{order:"left"})),e.commands.add("insertTableColumnRight",new qb(e,{order:"right"})),e.commands.add("removeTableRow",new Wb(e)),e.commands.add("removeTableColumn",new $b(e)),e.commands.add("splitTableCellVertically",new jb(e,{direction:"vertically"})),e.commands.add("splitTableCellHorizontally",new jb(e,{direction:"horizontally"})),e.commands.add("mergeTableCellRight",new Hb(e,{direction:"right"})),e.commands.add("mergeTableCellLeft",new Hb(e,{direction:"left"})),e.commands.add("mergeTableCellDown",new Hb(e,{direction:"down"})),e.commands.add("mergeTableCellUp",new Hb(e,{direction:"up"})),e.commands.add("setTableColumnHeader",new Jb(e)),e.commands.add("setTableRowHeader",new Gb(e)),ew(t),iw(t),this.editor.keystrokes.set("Tab",(...e)=>this._handleTabOnSelectedTable(...e),{priority:"low"}),this.editor.keystrokes.set("Tab",this._getTabHandler(!0),{priority:"low"}),this.editor.keystrokes.set("Shift+Tab",this._getTabHandler(!1),{priority:"low"})}static get requires(){return[Zb]}_handleTabOnSelectedTable(e,t){const n=this.editor,o=n.model.document.selection;if(!o.isCollapsed&&1===o.rangeCount&&o.getFirstRange().isFlat){const e=o.getSelectedElement();if(!e||!e.is("table"))return;t(),n.model.change(t=>{t.setSelection(t.createRangeIn(e.getChild(0).getChild(0)))})}}_getTabHandler(e){const t=this.editor;return(n,o)=>{const i=ub("tableCell",t.model.document.selection.getFirstPosition());if(!i)return;o();const r=i.parent,s=r.parent,a=s.getChildIndex(r),c=r.getChildIndex(i),l=0===c;if(!e&&l&&0===a)return;const d=c===r.childCount-1,u=a===s.childCount-1;let h;if(e&&u&&d&&t.plugins.get("TableUtils").insertRows(s,{at:s.childCount}),e&&d){const e=s.getChild(a+1);h=e.getChild(0)}else if(!e&&l){const e=s.getChild(a-1);h=e.getChild(e.childCount-1)}else h=r.getChild(c+(e?1:-1));t.model.change(e=>{e.setSelection(e.createRangeIn(h))})}}}n(128);class fw extends Ml{constructor(e){super(e);const t=this.bindTemplate;this.items=this.createCollection(),this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",(e,t)=>`${t} x ${e}`),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},children:this.items},{tag:"div",attributes:{class:["ck-insert-table-dropdown__label"]},children:[{text:t.to("label")}]}],on:{mousedown:t.to(e=>{e.preventDefault()}),click:t.to(()=>{this.fire("execute")})}});for(let e=0;e<100;e++){const t=new pw;t.on("over",()=>{const t=Math.floor(e/10),n=e%10;this.set("rows",t+1),this.set("columns",n+1)}),this.items.add(t)}this.on("change:columns",()=>{this._highlightGridBoxes()}),this.on("change:rows",()=>{this._highlightGridBoxes()})}focus(){}focusLast(){}_highlightGridBoxes(){const e=this.rows,t=this.columns;this.items.map((n,o)=>{const i=Math.floor(o/10)<e&&o%10<t;n.set("isOn",i)})}}class pw extends Ml{constructor(e){super(e);const t=this.bindTemplate;this.set("isOn",!1),this.setTemplate({tag:"div",attributes:{class:["ck-insert-table-dropdown-grid-box",t.if("isOn","ck-on")]},on:{mouseover:t.to("over")}})}}var mw=n(58),gw=n.n(mw),bw=n(59),ww=n.n(bw),_w=n(60),kw=n.n(_w),vw=n(61),yw=n.n(vw);class xw extends db{init(){const e=this.editor,t=this.editor.t;e.ui.componentFactory.add("insertTable",n=>{const o=e.commands.get("insertTable"),i=Lp(n);i.bind("isEnabled").to(o),i.buttonView.set({icon:gw.a,label:t("f"),tooltip:!0});const r=new fw(n);return i.panelView.children.add(r),r.delegate("execute").to(i),i.buttonView.on("open",()=>{r.rows=0,r.columns=0}),i.on("execute",()=>{e.execute("insertTable",{rows:r.rows,columns:r.columns}),e.editing.view.focus()}),i}),e.ui.componentFactory.add("tableColumn",e=>{const n=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:t("g"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableColumnLeft",label:t("h")}},{type:"button",model:{commandName:"insertTableColumnRight",label:t("i")}},{type:"button",model:{commandName:"removeTableColumn",label:t("j")}}];return this._prepareDropdown(t("k"),ww.a,n,e)}),e.ui.componentFactory.add("tableRow",e=>{const n=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:t("l"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowBelow",label:t("m")}},{type:"button",model:{commandName:"insertTableRowAbove",label:t("n")}},{type:"button",model:{commandName:"removeTableRow",label:t("o")}}];return this._prepareDropdown(t("p"),kw.a,n,e)}),e.ui.componentFactory.add("mergeTableCells",e=>{const n=[{type:"button",model:{commandName:"mergeTableCellUp",label:t("q")}},{type:"button",model:{commandName:"mergeTableCellRight",label:t("r")}},{type:"button",model:{commandName:"mergeTableCellDown",label:t("s")}},{type:"button",model:{commandName:"mergeTableCellLeft",label:t("t")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:t("u")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:t("v")}}];return this._prepareDropdown(t("w"),yw.a,n,e)})}_prepareDropdown(e,t,n,o){const i=this.editor,r=Lp(o),s=[],a=new si;for(const e of n)Cw(e,i,s,a);return zp(r,a),r.buttonView.set({label:e,icon:t,tooltip:!0}),r.bind("isEnabled").toMany(s,"isEnabled",(...e)=>e.some(e=>e)),this.listenTo(r,"execute",e=>{i.execute(e.source.commandName),i.editing.view.focus()}),r}}function Cw(e,t,n,o){const i=e.model=new Tp(e.model),{commandName:r,bindIsOn:s}=e.model;if("separator"!==e.type){const e=t.commands.get(r);n.push(e),i.set({commandName:r}),i.bind("isEnabled").to(e),s&&i.bind("isOn").to(e,"value")}i.set({withText:!0}),o.add(e)}n(130);var Aw=/highlight-(?:text|source)-([a-z0-9]+)/;function Pw(e){e.addRule("highlightedCodeBlock",{filter:function(e){var t=e.firstChild;return"DIV"===e.nodeName&&Aw.test(e.className)&&t&&"PRE"===t.nodeName},replacement:function(e,t,n){var o=((t.className||"").match(Aw)||[null,""])[1];return"\n\n"+n.fence+o+"\n"+t.firstChild.textContent+"\n"+n.fence+"\n\n"}})}var Ew=Array.prototype.indexOf,Tw=Array.prototype.every,Sw={};function Rw(e){var t=e.parentNode;return"THEAD"===t.nodeName||t.firstChild===e&&("TABLE"===t.nodeName||function(e){var t=e.previousSibling;return"TBODY"===e.nodeName&&(!t||"THEAD"===t.nodeName&&/^\s*$/i.test(t.textContent))}(t))&&Tw.call(e.childNodes,function(e){return"TH"===e.nodeName})}function Ow(e,t){var n=" ";return 0===Ew.call(t.parentNode.childNodes,t)&&(n="| "),n+e+" |"}function Iw(e){e.addRule("taskListItems",{filter:function(e){return"checkbox"===e.type&&"LI"===e.parentNode.nodeName},replacement:function(e,t){return(t.checked?"[x]":"[ ]")+" "}})}function Dw(e,t){return Array(t+1).join(e)}Sw.tableCell={filter:["th","td"],replacement:function(e,t){return Ow(e,t)}},Sw.tableRow={filter:"tr",replacement:function(e,t){var n="",o={left:":--",right:"--:",center:":-:"};if(Rw(t))for(var i=0;i<t.childNodes.length;i++){var r="---",s=(t.childNodes[i].getAttribute("align")||"").toLowerCase();s&&(r=o[s]||r),n+=Ow(r,t.childNodes[i])}return"\n"+e+(n?"\n"+n:"")}},Sw.table={filter:function(e){return"TABLE"===e.nodeName&&Rw(e.rows[0])},replacement:function(e){return"\n\n"+(e=e.replace("\n\n","\n"))+"\n\n"}},Sw.tableSection={filter:["thead","tbody","tfoot"],replacement:function(e){return e}};var Mw=["address","article","aside","audio","blockquote","body","canvas","center","dd","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frameset","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","isindex","li","main","menu","nav","noframes","noscript","ol","output","p","pre","section","table","tbody","td","tfoot","th","thead","tr","ul"];function Nw(e){return-1!==Mw.indexOf(e.nodeName.toLowerCase())}var Fw=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];function Bw(e){return-1!==Fw.indexOf(e.nodeName.toLowerCase())}var Vw=Fw.join();var Lw={};function zw(e){for(var t in this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[],e.rules)this.array.push(e.rules[t])}function qw(e,t,n){for(var o=0;o<e.length;o++){var i=e[o];if(jw(i,t,n))return i}}function jw(e,t,n){var o=e.filter;if("string"==typeof o){if(o===t.nodeName.toLowerCase())return!0}else if(Array.isArray(o)){if(o.indexOf(t.nodeName.toLowerCase())>-1)return!0}else{if("function"!=typeof o)throw new TypeError("`filter` needs to be a string, array, or function");if(o.call(e,t,n))return!0}}function Hw(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function Uw(e,t,n){return e&&e.parentNode===t||n(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}Lw.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},Lw.lineBreak={filter:"br",replacement:function(e,t,n){return n.br+"\n"}},Lw.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,n){var o=Number(t.nodeName.charAt(1));return"setext"===n.headingStyle&&o<3?"\n\n"+e+"\n"+Dw(1===o?"=":"-",e.length)+"\n\n":"\n\n"+Dw("#",o)+" "+e+"\n\n"}},Lw.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=(e=e.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},Lw.list={filter:["ul","ol"],replacement:function(e,t){var n=t.parentNode;return"LI"===n.nodeName&&n.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}},Lw.listItem={filter:"li",replacement:function(e,t,n){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var o=n.bulletListMarker+" ",i=t.parentNode;if("OL"===i.nodeName){var r=i.getAttribute("start"),s=Array.prototype.indexOf.call(i.children,t);o=(r?Number(r)+s:s+1)+". "}return o+e+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}},Lw.indentedCodeBlock={filter:function(e,t){return"indented"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,n){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},Lw.fencedCodeBlock={filter:function(e,t){return"fenced"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,n){var o=((t.firstChild.className||"").match(/language-(\S+)/)||[null,""])[1];return"\n\n"+n.fence+o+"\n"+t.firstChild.textContent+"\n"+n.fence+"\n\n"}},Lw.horizontalRule={filter:"hr",replacement:function(e,t,n){return"\n\n"+n.hr+"\n\n"}},Lw.inlineLink={filter:function(e,t){return"inlined"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){return"["+e+"]("+t.getAttribute("href")+(t.title?' "'+t.title+'"':"")+")"}},Lw.referenceLink={filter:function(e,t){return"referenced"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t,n){var o,i,r=t.getAttribute("href"),s=t.title?' "'+t.title+'"':"";switch(n.linkReferenceStyle){case"collapsed":o="["+e+"][]",i="["+e+"]: "+r+s;break;case"shortcut":o="["+e+"]",i="["+e+"]: "+r+s;break;default:var a=this.references.length+1;o="["+e+"]["+a+"]",i="["+a+"]: "+r+s}return this.references.push(i),o},references:[],append:function(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}},Lw.emphasis={filter:["em","i"],replacement:function(e,t,n){return e.trim()?n.emDelimiter+e+n.emDelimiter:""}},Lw.strong={filter:["strong","b"],replacement:function(e,t,n){return e.trim()?n.strongDelimiter+e+n.strongDelimiter:""}},Lw.code={filter:function(e){var t=e.previousSibling||e.nextSibling,n="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!n},replacement:function(e){if(!e.trim())return"";var t="`",n="",o="",i=e.match(/`+/gm);if(i)for(/^`/.test(e)&&(n=" "),/`$/.test(e)&&(o=" ");-1!==i.indexOf(t);)t+="`";return t+n+e+o+t}},Lw.image={filter:"img",replacement:function(e,t){var n=t.alt||"",o=t.getAttribute("src")||"",i=t.title||"";return o?"!["+n+"]("+o+(i?' "'+i+'"':"")+")":""}},zw.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){return e.isBlank?this.blankRule:(t=qw(this.array,e,this.options))?t:(t=qw(this._keep,e,this.options))?t:(t=qw(this._remove,e,this.options))?t:this.defaultRule;var t},forEach:function(e){for(var t=0;t<this.array.length;t++)e(this.array[t],t)}};var Ww="undefined"!=typeof window?window:{};var $w,Gw=function(){var e=Ww.DOMParser,t=!1;try{(new e).parseFromString("","text/html")&&(t=!0)}catch(e){}return t}()?Ww.DOMParser:function(){var e=function(){},t=n(132).JSDOM;return e.prototype.parseFromString=function(e){return new t(e).window.document},e}();function Kw(e){var t;"string"==typeof e?t=($w=$w||new Gw).parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html").getElementById("turndown-root"):t=e.cloneNode(!0);return function(e){var t=e.element,n=e.isBlock,o=e.isVoid,i=e.isPre||function(e){return"PRE"===e.nodeName};if(t.firstChild&&!i(t)){for(var r=null,s=!1,a=null,c=Uw(a,t,i);c!==t;){if(3===c.nodeType||4===c.nodeType){var l=c.data.replace(/[ \r\n\t]+/g," ");if(r&&!/ $/.test(r.data)||s||" "!==l[0]||(l=l.substr(1)),!l){c=Hw(c);continue}c.data=l,r=c}else{if(1!==c.nodeType){c=Hw(c);continue}n(c)||"BR"===c.nodeName?(r&&(r.data=r.data.replace(/ $/,"")),r=null,s=!1):o(c)&&(r=null,s=!0)}var d=Uw(a,c,i);a=c,c=d}r&&(r.data=r.data.replace(/ $/,""),r.data||Hw(r))}}({element:t,isBlock:Nw,isVoid:Bw}),t}function Jw(e){return e.isBlock=Nw(e),e.isCode="code"===e.nodeName.toLowerCase()||e.parentNode.isCode,e.isBlank=function(e){return-1===["A","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"].indexOf(e.nodeName)&&/^\s*$/i.test(e.textContent)&&!Bw(e)&&!function(e){return e.querySelector&&e.querySelector(Vw)}(e)}(e),e.flankingWhitespace=function(e){var t="",n="";if(!e.isBlock){var o=/^[ \r\n\t]/.test(e.textContent),i=/[ \r\n\t]$/.test(e.textContent);o&&!Zw("left",e)&&(t=" "),i&&!Zw("right",e)&&(n=" ")}return{leading:t,trailing:n}}(e),e}function Zw(e,t){var n,o,i;return"left"===e?(n=t.previousSibling,o=/ $/):(n=t.nextSibling,o=/^ /),n&&(3===n.nodeType?i=o.test(n.nodeValue):1!==n.nodeType||Nw(n)||(i=o.test(n.textContent))),i}var Qw=Array.prototype.reduce,Yw=/^\n*/,Xw=/\n*$/,e_=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function t_(e){if(!(this instanceof t_))return new t_(e);var t={rules:Lw,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",blankReplacement:function(e,t){return t.isBlock?"\n\n":""},keepReplacement:function(e,t){return t.isBlock?"\n\n"+t.outerHTML+"\n\n":t.outerHTML},defaultReplacement:function(e,t){return t.isBlock?"\n\n"+e+"\n\n":e}};this.options=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)n.hasOwnProperty(o)&&(e[o]=n[o])}return e}({},t,e),this.rules=new zw(this.options)}function n_(e){var t=this;return Qw.call(e.childNodes,function(e,n){var o="";return 3===(n=new Jw(n)).nodeType?o=n.isCode?n.nodeValue:t.escape(n.nodeValue):1===n.nodeType&&(o=function(e){var t=this.rules.forNode(e),n=n_.call(this,e),o=e.flankingWhitespace;(o.leading||o.trailing)&&(n=n.trim());return o.leading+t.replacement(n,e,this.options)+o.trailing}.call(t,n)),o_(e,o)},"")}function o_(e,t){var n=function(e,t){var n=[e.match(Xw)[0],t.match(Yw)[0]].sort(),o=n[n.length-1];return o.length<2?o:"\n\n"}(e,t);return(e=e.replace(Xw,""))+n+(t=t.replace(Yw,""))}t_.prototype={turndown:function(e){if(!function(e){return null!=e&&("string"==typeof e||e.nodeType&&(1===e.nodeType||9===e.nodeType||11===e.nodeType))}(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(""===e)return"";var t=n_.call(this,new Kw(e));return function(e){var t=this;return this.rules.forEach(function(n){"function"==typeof n.append&&(e=o_(e,n.append(t.options)))}),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.use(e[t]);else{if("function"!=typeof e)throw new TypeError("plugin must be a Function or an Array of Functions");e(this)}return this},addRule:function(e,t){return this.rules.add(e,t),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return e_.reduce(function(e,t){return e.replace(t[0],t[1])},e)}};var i_=t_;function r_(e,t){let n=e.parentElement;for(;n;){if(t.indexOf(n.tagName)>=0)return!0;n=n.parentElement}return!1}const s_="data-original-src";class a_{constructor(){this._htmlDP=new nl,this._domConverter=new sr}toView(e){const t=n(133)({html:!0,langPrefix:"language-"}).render(e),o=this._htmlDP._toDom(t);return function(e){let t,n=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){if("P"===e.tagName&&e.parentElement&&"LI"===e.parentElement.tagName)return NodeFilter.FILTER_ACCEPT}},!1);for(;t=n.nextNode();)t.outerHTML=t.innerHTML}(o),this._domConverter.domToView(o)}toData(e){const t=this._domConverter.viewToDom(e,document);!function(e,t,n){t=t.map(e=>e.toUpperCase()),n=n.map(e=>e.toUpperCase());let o,i=document.createNodeIterator(e,NodeFilter.SHOW_TEXT);for(;o=i.nextNode();)o.parentElement&&t.indexOf(o.parentElement.nodeName)>=0&&(o.nodeValue=o.nodeValue.replace(/^[\u00a0]+/g," ").replace(/[\u00a0]+$/g," ")),r_(o,n)||(o.nodeValue=_.escape(o.nodeValue))}(t,["strong","em"],["pre","code","table"]),function(e,t,n){let o,i=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT,function(e){return"a"===e.nodeName.toLowerCase()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});for(;o=i.nextNode();)o.setAttribute("href",o.href)}(t);const n=new i_({headingStyle:"atx",codeBlockStyle:"fenced"});return n.use([Pw,Iw]),n.addRule("img",{filter:"img",replacement:function(e,t){var n=t.alt||"",o=t.getAttribute(s_)||t.getAttribute("src")||"",i=t.title||"";return o?"!["+n+"]("+o+(i?' "'+i+'"':"")+")":""}}),n.addRule("htmlTables",{filter:["table"],replacement:function(e,t){return t.querySelectorAll("td br[data-cke-filler]").forEach(e=>e.remove()),t.outerHTML}}),n.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return"~~"+e+"~~"}}),n.addRule("openProjectMacros",{filter:["macro"],replacement:(e,t)=>{return t.innerHTML="",t.outerHTML.replace("</macro>","\n</macro>")}}),n.turndown(t)}}var c_=n(19),l_=n.n(c_),d_=n(62),u_=n.n(d_);class h_{constructor(e){this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",e=>{this.isEnabled||e.stop()},{priority:"high"}),this.listenTo(e,"change:isReadOnly",(e,t,n)=>{n?(this.on("set:isEnabled",f_,{priority:"highest"}),this.isEnabled=!1):(this.off("set:isEnabled",f_),this.refresh())})}refresh(){this.isEnabled=!0}execute(){}destroy(){this.stopListening()}}function f_(e){e.return=!1,e.stop()}vd(h_,md);class p_ extends h_{refresh(){const e=this.editor.model,t=e.document;this.isEnabled=e.schema.checkAttributeInSelection(t.selection,"mention")}execute(e){const t=this.editor.model,n=t.document.selection,o="string"==typeof e.mention?{id:e.mention}:e.mention,i=o.id,r=e.range||n.getFirstRange(),s=e.text||i,a=g_({_text:s,id:i},o);if(1!=e.marker.length)throw new Jn.b("mentioncommand-incorrect-marker: The marker must be a single character.");if(i.charAt(0)!=e.marker)throw new Jn.b("mentioncommand-incorrect-id: The item id must start with the marker character.");t.change(e=>{const o=Ls(n.getAttributes()),i=new Map(o.entries());i.set("mention",a),e.remove(r),e.insertText(s,i,r.start),e.insertText(" ",o,t.document.selection.focus)})}}class m_ extends yd{static get pluginName(){return"MentionEditing"}init(){const e=this.editor,t=e.model,n=t.document;t.schema.extend("$text",{allowAttributes:"mention"}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",key:"data-mention",classes:"mention"},model:{key:"mention",value:b_}}),e.conversion.for("downcast").attributeToElement({model:"mention",view:w_}),n.registerPostFixer(e=>(function(e,t,n){const o=t.differ.getChanges();let i=!1;for(const t of o){const o=t.position;if("$text"==t.name){const t=o.textNode&&o.textNode.nextSibling;i=k_(o.textNode,e)||i,i=k_(t,e)||i,i=k_(o.nodeBefore,e)||i,i=k_(o.nodeAfter,e)||i}if("$text"!=t.name&&"insert"==t.type){const t=o.nodeAfter;for(const n of e.createRangeIn(t).getItems())i=k_(n,e)||i}if("insert"==t.type&&n.isInline(t.name)){const t=o.nodeAfter&&o.nodeAfter.nextSibling;i=k_(o.nodeBefore,e)||i,i=k_(t,e)||i}}return i})(e,n,t.schema)),n.registerPostFixer(e=>(function(e,t){const n=t.differ.getChanges();let o=!1;for(const t of n)if("attribute"===t.type&&"mention"!=t.attributeKey){const n=t.range.start.nodeBefore,i=t.range.end.nodeAfter;for(const r of[n,i])__(r)&&r.getAttribute(t.attributeKey)!=t.attributeNewValue&&(e.setAttribute(t.attributeKey,t.attributeNewValue,r),o=!0)}return o})(e,n)),n.registerPostFixer(e=>(function(e,t){const n=t.selection,o=n.focus;if(n.isCollapsed&&n.hasAttribute("mention")&&function(e){return e.nodeBefore&&e.nodeBefore.is("text")}(o))return e.removeSelectionAttribute("mention"),!0})(e,n)),e.commands.add("mention",new p_(e))}}function g_(e,t){return Object.assign({_uid:Yn()},e,t||{})}function b_(e,t){const n=e.getAttribute("data-mention"),o=e.getChild(0);if(o)return g_({id:n,_text:o.data},t)}function w_(e,t){if(!e)return;const n={class:"mention","data-mention":e.id},o={id:e._uid,priority:20};return t.createAttributeElement("span",n,o)}function __(e){if(!e||!e.is("text")&&!e.is("textProxy")||!e.hasAttribute("mention"))return!1;return e.data!=e.getAttribute("mention")._text}function k_(e,t){return!!__(e)&&(t.removeAttribute("mention",e),!0)}class v_{constructor(e,t,n){this.editor=e,this.testCallback=t,this.textMatcher=n,this.debouncedMatcher=_.debounce((e,t)=>this.fire("matched",{text:e,matched:t}),100),this.hasMatch=!1,this._startListening()}get last(){return this._getText()}_startListening(){const e=this.editor;e.model.document.selection.on("change",(e,{directChange:t})=>{t&&this._evaluateTextBeforeSelection()}),e.model.document.on("change:data",(e,t)=>{if("transparent"==t.type)return!1;this._evaluateTextBeforeSelection()})}_evaluateTextBeforeSelection(){const e=this._getText(),t=this.testCallback(e);if(!t&&this.hasMatch&&this.fire("unmatched"),this.hasMatch=t,t){const t=this.textMatcher(e);this.debouncedMatcher(e,t)}}_getText(){const e=this.editor,t=e.model.document.selection;if(!t.isCollapsed)return;const n=t.focus.parent;return function(e){return Array.from(e.getItems()).reduce((e,t)=>e+t.data,"")}(e.model.createRangeIn(n)).slice(0,t.focus.offset)}}lo(v_,no);n(189);class y_ extends Mp{constructor(e){super(e),this.extendTemplate({attributes:{class:["ck-mentions"],tabindex:"-1"}})}selectFirst(){this.select(0)}selectNext(){const e=this.selected,t=this.items.getIndex(e);this.select(t+1)}selectPrevious(){const e=this.selected,t=this.items.getIndex(e);this.select(t-1)}select(e){let t=0;e>0&&e<this.items.length?t=e:e<0&&(t=this.items.length-1);const n=this.items.get(t);n.highlight(),this._isItemVisibleInScrolledArea(n)||(this.element.scrollTop=n.element.offsetTop),this.selected&&this.selected.removeHighlight(),this.selected=n}executeSelected(){this.selected.fire("execute")}_isItemVisibleInScrolledArea(e){return new As(this.element).contains(new As(e.element))}}class x_ extends Ml{constructor(e,t){super(e),this.template=!1,this.domElement=t,this.domElement.classList.add("ck-button"),this.set("isOn",!1),this.on("change:isOn",(e,t,n)=>{n?(this.domElement.classList.add("ck-on"),this.domElement.classList.remove("ck-off")):(this.domElement.classList.add("ck-off"),this.domElement.classList.remove("ck-on"))}),this.listenTo(this.domElement,"click",()=>{this.fire("execute")})}render(){super.render(),this.element=this.domElement}}class C_ extends Np{highlight(){this.children.first.isOn=!0}removeHighlight(){this.children.first.isOn=!1}}const A_=3;class P_ extends yd{static get pluginName(){return"MentionUI"}constructor(e){super(e),this.panelView=this._creatPanelView(),this._mentionsView=this._createMentionView(),this._mentionsConfigurations=new Map,e.config.define("mention",{feeds:[]})}init(){this.editor.editing.view.document.on("keydown",(e,t)=>{(function(e){return[wi.arrowup,wi.arrowdown,wi.enter,wi.tab,wi.space,wi.esc].includes(e)})(t.keyCode)&&this.panelView.isVisible&&(t.preventDefault(),e.stop(),t.keyCode==wi.arrowdown&&this._mentionsView.selectNext(),t.keyCode==wi.arrowup&&this._mentionsView.selectPrevious(),t.keyCode!=wi.enter&&t.keyCode!=wi.tab&&t.keyCode!=wi.space||this._mentionsView.executeSelected(),t.keyCode==wi.esc&&this._hidePanelAndRemoveMarker())},{priority:"highest"}),Vp({emitter:this.panelView,contextElements:[this.panelView.element],activator:()=>this.panelView.isVisible,callback:()=>this._hidePanelAndRemoveMarker()});const e=this.editor.config.get("mention.feeds");this.feeds={};for(const t of e){const e=t.feed,n=t.marker;if(!n||1!=n.length)throw new Jn.b("mentionconfig-incorrect-marker: The marker must be provided and be a single character.");const o=t.minimumCharacters||0,i=t.allowedPrefixes||[],r="function"==typeof e?e.bind(this):S_(e),s={watcher:this._setupTextWatcherForFeed(n,i,o),marker:n,feedCallback:r,allowedPrefixes:i,itemRenderer:t.itemRenderer};this._mentionsConfigurations.set(n,s)}}destroy(){super.destroy(),this.panelView.destroy()}_creatPanelView(){const e=new nu(this.editor.locale);return e.withArrow=!1,e.render(),this.editor.ui.view.body.add(e),e}_createMentionView(){const e=this.editor.locale,t=new y_(e);return this._items=new si,this.panelView.content.add(t),t.items.bindTo(this._items).using(n=>{const{item:o,marker:i}=n,r=new C_(e),s=this._renderItem(o,i);return s.delegate("execute").to(r),r.children.add(s),r.item=o,r.marker=i,r.on("execute",()=>{t.fire("execute",{item:o,marker:i})}),r}),t.on("execute",(e,t)=>{const n=this.editor,o=n.model,i=t.item,r=t.marker,s=this._getWatcher(r).last,a=T_(r,this._mentionsConfigurations.get(r).allowedPrefixes)(s),c=a.prefix+i.text,l=a.total.length,d=o.createPositionAt(o.document.selection.focus),u=d.getShiftedBy(-l),h=o.createRange(u,d);this._hidePanelAndRemoveMarker(),n.execute("mention",{mention:i,text:c,marker:r,range:h}),n.editing.view.focus()}),t}_getItemRenderer(e){const{itemRenderer:t}=this._mentionsConfigurations.get(e);return t}_getFeed(e,t){const{feedCallback:n}=this._mentionsConfigurations.get(e);return Promise.resolve().then(()=>n(t))}_setupTextWatcherForFeed(e,t,n){const o=this.editor,i=new v_(o,function(e,t,n){const o=new RegExp(E_(e,t,n));return e=>o.test(e)}(e,t,n),T_(e,t));return i.on("matched",(e,t)=>{const n=t.matched,i=o.model.document.selection,r=i.hasAttribute("mention"),s=i.focus.nodeBefore;if(r||s&&s.is("text")&&s.hasAttribute("mention"))return;const{feedText:a,marker:c}=n,l=c.length+a.length,d=i.focus.getShiftedBy(-l),u=i.focus.getShiftedBy(-a.length),h=o.model.createRange(d,u);let f;f=o.model.markers.has("mention")?o.model.markers.get("mention"):o.model.change(e=>e.addMarker("mention",{range:h,usingOperation:!1,affectsData:!1})),this._getFeed(c,a).then(e=>{this._items.clear();for(const t of e){const e="object"!=typeof t?{id:t,text:t}:t;this._items.add({item:e,marker:c})}this._items.length?this._showPanel(f):this._hidePanelAndRemoveMarker()})}),i.on("unmatched",()=>{this._hidePanelAndRemoveMarker()}),i}_getWatcher(e){const{watcher:t}=this._mentionsConfigurations.get(e);return t}_showPanel(e){this.panelView.pin(this._getBalloonPanelPositionData(e,this.panelView.position)),this.panelView.show(),this._mentionsView.selectFirst()}_hidePanelAndRemoveMarker(){this.editor.model.markers.has("mention")&&this.editor.model.change(e=>e.removeMarker("mention")),this.panelView.unpin(),this.panelView.position=void 0,this.panelView.hide()}_renderItem(e,t){const n=this.editor;let o,i=e.id;const r=this._getItemRenderer(t);if(r){const t=r(e);"string"!=typeof t?o=new x_(n.locale,t):i=t}if(!o){const e=new Ql(n.locale);e.label=i,e.withText=!0,o=e}return o}_getBalloonPanelPositionData(e,t){const n=this.editor.editing,o=n.view.domConverter,i=n.mapper;return{target:()=>{const t=i.toViewRange(e.getRange());return As.getDomRangeRects(o.viewRangeToDom(t)).pop()},limiter:()=>{const e=this.editor.editing.view,t=e.document.selection.editableElement;return t?e.domConverter.mapViewToDom(t.root):null},positions:function(e){const t={caret_se:e=>({top:e.bottom+A_,left:e.right,name:"caret_se"}),caret_ne:(e,t)=>({top:e.top-t.height-A_,left:e.right,name:"caret_ne"}),caret_sw:(e,t)=>({top:e.bottom+A_,left:e.right-t.width,name:"caret_sw"}),caret_nw:(e,t)=>({top:e.top-t.height-A_,left:e.right-t.width,name:"caret_nw"})};if(t.hasOwnProperty(e))return[t[e]];return[t.caret_se,t.caret_ne,t.caret_sw,t.caret_nw]}(t),fitInViewport:!0}}}function E_(e,t,n){return(t=t||[]).push("^"),t.push(" "),`(${(t||[]).join("|")})(\\${e})([_a-zA-Z0-9À-ž]${0==n?"*":`{${n},}`}?)$`}function T_(e,t){const n=new RegExp(E_(e,t,0));return e=>{const t=e.match(n);return{marker:t[2],feedText:t[3],total:t[0],prefix:t[1]}}}function S_(e){return t=>{const n=e.filter(e=>{return("string"==typeof e?e:String(e.id)).toLowerCase().includes(t.toLowerCase())}).slice(0,10);return Promise.resolve(n)}}n(191);const R_=[Bd,class extends yd{static get requires(){return[Ud,Kd,fu]}static get pluginName(){return"OPMacroEmbeddedTable"}static get buttonName(){return Ud.buttonName}},class extends yd{static get requires(){return[gu,Kd,bu]}static get pluginName(){return"OPMacroWpButton"}static get buttonName(){return gu.buttonName}},class extends yd{static get requires(){return[ku,Kd,vu]}static get pluginName(){return"OPWikiIncludePage"}static get buttonName(){return ku.buttonName}},class extends yd{static get requires(){return[ih,Kd,rh]}static get pluginName(){return"OPChildPages"}static get buttonName(){return ih.buttonName}}],O_=[class extends yd{static get requires(){return[Au,th]}static get pluginName(){return"OpUploadPlugin"}init(){this.editor.plugins.get("FileRepository").createUploadAdapter=(e=>{const t=jd(this.editor);return new Eu(e,t,this.editor)})}},class extends yd{static get pluginName(){return"OPAttachmentListener"}init(){this.editor.model.on("op:attachment-removed",(e,t)=>{this.removeDeletedImage(t)})}removeDeletedImage(e){let t=this.editor.model.document.getRoot();for(const n of Array.from(t.getChildren()))if("image"===n.name&&e.indexOf(n.getAttribute("src"))>-1){const e=new ta(n,"on");this.editor.model.deleteContent(e)}}}],I_=[class extends sh{static get requires(){return[uh,wh,yh,jh,mf]}static get pluginName(){return"Essentials"}},class extends gf{static get requires(){return[Au]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const e=this.editor.config.get("ckfinder.uploadUrl");e&&(this.editor.plugins.get(Au).createUploadAdapter=(t=>new vf(t,e,this.editor.t)))}},class extends Af{static get pluginName(){return"Autoformat"}afterInit(){this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats()}_addListAutoformats(){const e=this.editor.commands;e.get("bulletedList")&&new yf(this.editor,/^[*-]\s$/,"bulletedList"),e.get("numberedList")&&new yf(this.editor,/^1[.|)]\s$/,"numberedList")}_addBasicStylesAutoformats(){const e=this.editor.commands;if(e.get("bold")){const e=Pf(this.editor,"bold");new xf(this.editor,/(\*\*)([^*]+)(\*\*)$/g,e),new xf(this.editor,/(__)([^_]+)(__)$/g,e)}if(e.get("italic")){const e=Pf(this.editor,"italic");new xf(this.editor,/(?:^|[^*])(\*)([^*_]+)(\*)$/g,e),new xf(this.editor,/(?:^|[^_])(_)([^_]+)(_)$/g,e)}if(e.get("code")){const e=Pf(this.editor,"code");new xf(this.editor,/(`)([^`]+)(`)$/g,e)}}_addHeadingAutoformats(){const e=this.editor.commands.get("heading");e&&e.modelElements.filter(e=>e.match(/^heading[1-6]$/)).forEach(t=>{const n=t[7],o=new RegExp(`^(#{${n}})\\s$`);new yf(this.editor,o,()=>{if(!e.isEnabled)return!1;this.editor.execute("heading",{value:t})})})}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&new yf(this.editor,/^>\s$/,"blockQuote")}},class extends Ef{static get requires(){return[If,Ff]}static get pluginName(){return"Bold"}},class extends Ef{static get requires(){return[Vf,jf]}static get pluginName(){return"Code"}},class extends Ef{static get requires(){return[Zf,ep]}static get pluginName(){return"Italic"}},class extends Ef{static get requires(){return[Uf,Kf]}static get pluginName(){return"Strikethrough"}},class extends tp{static get requires(){return[lp,hp]}static get pluginName(){return"BlockQuote"}},class extends fp{static get requires(){return[Ep,qp]}static get pluginName(){return"Heading"}},class extends Tu{static get requires(){return[Wp,Kd,am]}static get pluginName(){return"Image"}},class extends Tu{static get requires(){return[dm]}static get pluginName(){return"ImageCaption"}},class extends Tu{static get requires(){return[Sm,Rm]}static get pluginName(){return"ImageStyle"}},class extends Tu{static get requires(){return[Om]}static get pluginName(){return"ImageToolbar"}afterInit(){const e=this.editor;e.plugins.get(Om).register("image",{items:e.config.get("image.toolbar")||[],getRelatedElement:Ku})}},class extends yd{static get pluginName(){return"OpImageAttachmentLookup"}init(){const e=this.editor,t=e.conversion,n=jd(e);t.for("editingDowncast").add(function(e){return e=>{e.on("attribute:src:image",t,{priority:"highest"})};function t(t,n,o){let i=n.attributeNewValue;if(!i||!e.lookupDownloadLocationByName)return;const r=e.lookupDownloadLocationByName(i);n.attributeNewValue=r||i}}(n)),t.for("dataDowncast").add(function(e){return e=>{e.on("attribute:src:image",t,{priority:"highest"})};function t(t,n,o){let i=n.attributeNewValue;if(!i||!e.lookupDownloadLocationByName)return;const r=e.lookupDownloadLocationByName(i);n.attributeNewValue=r||i;const s=o.writer,a=o.mapper.toViewElement(n.item).getChild(0);r&&s.setAttribute(s_,i,a)}}(n))}},class extends Dm{static get requires(){return[Qm,hg]}static get pluginName(){return"Link"}},class extends kg{static get requires(){return[Lg,Wg]}static get pluginName(){return"List"}},_p,jh,class extends yd{toMentionAttribute(e,t){return b_(e,t)}static get pluginName(){return"Mention"}static get requires(){return[m_,P_]}},function(e){e.conversion.for("upcast").elementToAttribute({view:{name:"a",key:"data-mention",classes:"mention",attributes:{href:!0,"data-user-id":!0}},model:{key:"mention",value:t=>e.plugins.get("Mention").toMentionAttribute(t,{link:t.getAttribute("href"),userId:t.getAttribute("data-user-id")})},converterPriority:"high"}),e.conversion.for("downcast").attributeToElement({model:"mention",converterPriority:"high",view:(e,t)=>{if(e)return t.createAttributeElement("span",{class:"mention","data-type":e.type||""})}})},class extends yd{static get pluginName(){return"OPHelpLinkPlugin"}init(){const e=this.editor,t=(e.model,e.config.get("openProject.helpURL"));e.ui.componentFactory.add("openProjectShowFormattingHelp",e=>{const n=new Ql(e);return n.set({label:window.I18n.t("js.inplace.link_formatting_help"),icon:Gg.a,tooltip:!0}),n.on("execute",()=>{window.open(t,"_blank")}),n})}},class extends yd{static get pluginName(){return"CodeBlock"}static get requires(){return[ob,ib]}},class extends yd{static get pluginName(){return"OPPreview"}init(){const e=this.editor;let t=!1,n=null;e.ui.componentFactory.add("preview",o=>{const i=new Ql(o);i.set({label:this.label,icon:sb.a,tooltip:!0});let r=function(t){let o,r=jQuery(e.ui.element),s=r.find(".ck-editor__main");o=s.length?s:r;let a=jQuery('<div class="ck-editor__preview"></div>');o.siblings(".ck-editor__preview").remove();const c=zd(e,"ckEditorPreview");n=c.render(a[0],t),o.hide(),o.after(a),cb(e,i)},s=function(){let t=function(e){return _.get(e.config,"_config.openProject.context.previewContext")}(e),n=Hd(e).api.v3.previewMarkup(t);jQuery.ajax({data:e.getData(),url:n,response_type:"text",contentType:"text/plain; charset=UTF-8",method:"POST"}).done(r)};return i.on("execute",()=>{t?(t=!1,function(){let t=jQuery(e.ui.element).find(".ck-editor__main");n(),t.siblings(".ck-editor__preview").remove(),t.show(),lb(e)}()):(t=!0,s())}),i})}get label(){return window.I18n.t("js.editor.preview")}},class extends yd{static get pluginName(){return"OPSourceCode"}init(){const e=this.editor;let t=!1,n={source:window.I18n.t("js.editor.mode.manual"),wysiwyg:window.I18n.t("js.editor.mode.wysiwyg")};e.ui.componentFactory.add("opShowSource",o=>{const i=new Ql(o);return i.set({label:n.source,class:"",icon:l_.a,tooltip:!0}),i.on("execute",()=>{t?(t=!1,function(){let t=jQuery(e.ui.element).find(".ck-editor__main");e.fire("op:source-code-disabled"),t.siblings(".ck-editor__source").remove(),t.show(),lb(e),i.set({label:n.source,class:"",icon:l_.a,tooltip:!0})}()):(t=!0,function(t){let o,r=jQuery(e.ui.element),s=r.find(".ck-editor__main");o=s.length?s:r;let a=jQuery('<div class="ck-editor__source"></div>');o.siblings(".ck-editor__source").remove(),o.hide(),o.after(a),cb(e,i),e.fire("op:source-code-enabled"),i.set({label:n.wysiwyg,class:"-source-enabled",icon:u_.a,tooltip:!0})}())}),i})}},function(e){e.data.processor=new a_},class extends db{static get requires(){return[hw,xw,Kd]}static get pluginName(){return"Table"}},class extends db{static get requires(){return[Om]}static get pluginName(){return"TableToolbar"}afterInit(){const e=this.editor,t=e.plugins.get(Om),n=e.config.get("table.contentToolbar"),o=e.config.get("table.toolbar"),i=e.config.get("table.tableToolbar");o&&console.warn("`config.table.toolbar` is deprecated and will be removed in the next major release. Use `config.table.contentToolbar` instead."),(n||o)&&t.register("tableContent",{items:n||o,getRelatedElement:kb}),i&&t.register("table",{items:i,getRelatedElement:_b})}},class extends yd{init(){const e=this.editor,t=(e.config.get("removePlugins")||[]).map(e=>e.pluginName),n=window.I18n.t("js.editor.macro.dropdown.chose_macro");!0!==e.config.get("openProject.disableAllMacros")&&e.ui.componentFactory.add("macroList",o=>{const i=[];for(const n of R_){if(-1!==t.indexOf(n.pluginName))continue;const o=e.ui.componentFactory.create(n.buttonName);i.push(o)}const r=Lp(o);return function(e,t){const n=e.toolbarView=new $l;e.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),t.map(e=>n.items.add(e)),e.panelView.children.add(n),n.items.delegate("execute").to(e)}(r,i),r.buttonView.set({isOn:!1,withText:!0,tooltip:n,label:window.I18n.t("js.editor.macro.dropdown.macros")}),r.toolbarView.isVertical=!0,r.toolbarView.className="op-macro-list-button",r})}}].concat(R_,O_);function D_(e){return(t,n)=>{const o=n.openProject.context;n.removePlugins=n.removePlugins||[];const i=o.resource;if(i&&i.canAddAttachments||n.removePlugins.push(...O_.map(e=>e.pluginName)),!1===o.macros&&(n.openProject.disableAllMacros=!0,n.removePlugins.push(...R_.map(e=>e.pluginName))),Array.isArray(o.macros)){const e=R_.filter(e=>-1===o.macros.indexOf(e.pluginName));n.removePlugins.push(...e)}return e.create(t,n)}}function M_(e){const t=document.createElement("span");return t.classList.add("mention-list-item"),t.textContent=e.name,t}const N_={heading:{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h1",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h2",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h3",title:"Heading 3",class:"ck-heading_heading3"},{model:"heading4",view:"h4",title:"Heading 4",class:"ck-heading_heading4"},{model:"heading5",view:"h5",title:"Heading 5",class:"ck-heading_heading5"}]},toolbar:{},OPMacroEmbeddedTable:{toolbar:["opEditEmbeddedTableQuery"]},OPMacroWpButton:{toolbar:["opEditWpMacroButton"]},OPWikiIncludePage:{toolbar:["opEditWikiIncludeMacroButton"]},OPCodeBlock:{toolbar:["opEditCodeBlock"]},OPChildPages:{toolbar:["opEditChildPagesMacroButton"]},image:{toolbar:["imageStyle:full","|","imageTextAlternative"]},table:{toolbar:["tableColumn","tableRow"]},mention:{feeds:[{marker:"@",feed:function(e){let t=jd(this.editor);if(!t||"WorkPackage"!==t._type)return[];const n=t.project.idFromLink,o=Hd(this.editor).api.v3.principals(n,e);let i=window.OpenProject.urlRoot+"/users/";return new Promise((e,t)=>{jQuery.getJSON(o,t=>{e(t._embedded.elements.map(e=>{const t=`${e._type.toLowerCase()}#${e.id}`;return{type:"user",id:`@${e.id}`,text:t,name:e.name,link:i+e.id}}))})})},itemRenderer:M_,minimumCharacters:0},{marker:"#",allowedPrefixes:["#","##"],feed:function(e){const t=window.OpenProject.urlRoot+"/work_packages/auto_complete.json";let n=window.OpenProject.urlRoot+"/work_packages/";return new Promise((o,i)=>{jQuery.getJSON(t,{q:e,scope:"all"},e=>{o(e.map(e=>{const t=`#${e.id}`;return{type:"work_package",id:t,text:t,name:e.to_s,link:n+e.id}}))})})},itemRenderer:M_,minimumCharacters:1}]},language:"en"};n.d(t,"ConstrainedEditor",function(){return F_}),n.d(t,"FullEditor",function(){return B_});class F_ extends Kl{}class B_ extends Kl{}window.OPConstrainedEditor=F_,window.OPClassicEditor=B_,B_.createCustomized=D_(B_),B_.builtinPlugins=I_,B_.defaultConfig=Object.assign({},N_),B_.defaultConfig.toolbar={items:["heading","|","bold","italic","strikethrough","code","insertCodeBlock","link","bulletedList","numberedList","imageUpload","blockQuote","|","insertTable","macroList","|","undo","redo","openProjectShowFormattingHelp","|","preview","opShowSource"]},F_.createCustomized=D_(F_),F_.builtinPlugins=I_,F_.defaultConfig=Object.assign({},N_),F_.defaultConfig.toolbar={items:["bold","italic","strikethrough","code","insertCodeBlock","link","bulletedList","numberedList","imageUpload","blockQuote","|","openProjectShowFormattingHelp","preview","opShowSource"]}}]).default});
//# sourceMappingURL=ckeditor.js.map