/*! * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */ !function(t){t.en=Object.assign(t.en||{},{a:"Cannot upload file:",b:"Upload in progress",c:"Rich Text Editor",d:"Insert table",e:"Header column",f:"Insert column before",g:"Insert column after",h:"Delete column",i:"Column",j:"Header row",k:"Insert row below",l:"Insert row above",m:"Delete row",n:"Row",o:"Merge cell up",p:"Merge cell right",q:"Merge cell down",r:"Merge cell left",s:"Split cell vertically",t:"Split cell horizontally",u:"Merge cells",v:"Numbered List",w:"Bulleted List",x:"Link",y:"Full size image",z:"Side image",aa:"Left aligned image",ab:"Centered image",ac:"Right aligned image",ad:"Choose heading",ae:"Heading",af:"Enter image caption",ag:"image widget",ah:"Block quote",ai:"Italic",aj:"Rich Text Editor, %0",ak:"Upload failed",al:"Change image text alternative",am:"Paragraph",an:"Heading 1",ao:"Heading 2",ap:"Heading 3",aq:"Unlink",ar:"Edit link",as:"Open link in new tab",at:"This link has no URL",au:"Save",av:"Cancel",aw:"Link URL",ax:"Text alternative",ay:"Insert image",az:"Bold",ba:"Code",bb:"Strikethrough",bc:"Undo",bd:"Redo"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.OPEditor=e():t.OPEditor=e()}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=182)}([function(t,e,n){"use strict";n.d(e,"b",function(){return o}),n.d(e,"a",function(){return i});const r="https://docs.ckeditor.com/ckeditor5/latest/framework/guides/support/error-codes.html";class o extends Error{constructor(t,e){t=i(t),e&&(t+=" "+JSON.stringify(e)),super(t),this.name="CKEditorError",this.data=e}static isCKEditorError(t){return t instanceof o}}function i(t){const e=t.match(/^([^:]+):/);return e?t+` Read more: ${r}#error-${e[1]}\n`:t}},function(t,e,n){var r={},o=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}}(function(){return window&&document&&document.all&&!window.atob}),i=function(t){var e={};return function(t){if("function"==typeof t)return t();if(void 0===e[t]){var n=function(t){return document.querySelector(t)}.call(this,t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}}(),s=null,a=0,c=[],l=n(60);function u(t,e){for(var n=0;n=0&&c.splice(e,1)}function p(t){var e=document.createElement("style");return void 0===t.attrs.type&&(t.attrs.type="text/css"),m(e,t.attrs),h(t,e),e}function m(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function g(t,e){var n,r,o,i;if(e.transform&&t.css){if(!(i=e.transform(t.css)))return function(){};t.css=i}if(e.singleton){var c=a++;n=s||(s=p(e)),r=w.bind(null,n,c,!1),o=w.bind(null,n,c,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",m(e,t.attrs),h(t,e),e}(e),r=function(t,e,n){var r=n.css,o=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&o;(e.convertToAbsoluteUrls||i)&&(r=l(r));o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var s=new Blob([r],{type:"text/css"}),a=t.href;t.href=URL.createObjectURL(s),a&&URL.revokeObjectURL(a)}.bind(null,n,e),o=function(){f(n),n.href&&URL.revokeObjectURL(n.href)}):(n=p(e),r=function(t,e){var n=e.css,r=e.media;r&&t.setAttribute("media",r);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),o=function(){f(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else o()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=o()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=d(t,e);return u(n,e),function(t){for(var o=[],i=0;i=55296&&t<=57343)&&(!(t>=64976&&t<=65007)&&(65535!=(65535&t)&&65534!=(65535&t)&&(!(t>=0&&t<=8)&&(11!==t&&(!(t>=14&&t<=31)&&(!(t>=127&&t<=159)&&!(t>1114111)))))))}function s(t){if(t>65535){var e=55296+((t-=65536)>>10),n=56320+(1023&t);return String.fromCharCode(e,n)}return String.fromCharCode(t)}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,u=n(21);var d=/[&<>"]/,h=/[&<>"]/g,f={"&":"&","<":"<",">":">",'"':"""};function p(t){return f[t]}var m=/[.?*+^$[\]\\(){}|-]/g;var g=n(10);e.lib={},e.lib.mdurl=n(22),e.lib.ucmicro=n(133),e.assign=function(t){return Array.prototype.slice.call(arguments,1).forEach(function(e){if(e){if("object"!=typeof e)throw new TypeError(e+"must be object");Object.keys(e).forEach(function(n){t[n]=e[n]})}}),t},e.isString=function(t){return"[object String]"===function(t){return Object.prototype.toString.call(t)}(t)},e.has=o,e.unescapeMd=function(t){return t.indexOf("\\")<0?t:t.replace(a,"$1")},e.unescapeAll=function(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(c,function(t,e,n){return e||function(t,e){var n=0;return o(u,e)?u[e]:35===e.charCodeAt(0)&&l.test(e)&&i(n="x"===e[1].toLowerCase()?parseInt(e.slice(2),16):parseInt(e.slice(1),10))?s(n):t}(t,n)})},e.isValidEntityCode=i,e.fromCodePoint=s,e.escapeHtml=function(t){return d.test(t)?t.replace(h,p):t},e.arrayReplaceAt=function(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))},e.isSpace=function(t){switch(t){case 9:case 32:return!0}return!1},e.isWhiteSpace=function(t){if(t>=8192&&t<=8202)return!0;switch(t){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},e.isMdAsciiPunct=function(t){switch(t){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}},e.isPunctChar=function(t){return g.test(t)},e.escapeRE=function(t){return t.replace(m,"\\$&")},e.normalizeReference=function(t){return t.trim().replace(/\s+/g," ").toUpperCase()}},function(t,e,n){"use strict";var r=n(0);const o={error(t,e){console.error(Object(r.a)(t),e)},warn(t,e){console.warn(Object(r.a)(t),e)}};e.a=o},function(t,e,n){"use strict";(function(t,r){var o=n(5),i={function:!0,object:!0},s=i[typeof exports]&&exports&&!exports.nodeType?exports:void 0,a=i[typeof t]&&t&&!t.nodeType?t:void 0,c=Object(o.a)(s&&a&&"object"==typeof r&&r),l=Object(o.a)(i[typeof self]&&self),u=Object(o.a)(i[typeof window]&&window),d=Object(o.a)(i[void 0]&&void 0),h=c||u!==(d&&d.window)&&u||l||d||Function("return this")();e.a=h}).call(this,n(18)(t),n(9))},function(t,e,n){"use strict";e.a=function(t){return t&&t.Object===Object?t:null}},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports='\n'},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.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\u0AF0\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-\u2E49\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]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/},function(t,e,n){"use strict";function r(){this.__rules__=[],this.__cache__=null}r.prototype.__find__=function(t){for(var e=0;e=0&&(n=this.attrs[e][1]),n},r.prototype.attrJoin=function(t,e){var n=this.attrIndex(t);n<0?this.attrPush([t,e]):this.attrs[n][1]=this.attrs[n][1]+" "+e},t.exports=r},function(t){t.exports={a:"11.0.1"}},function(t,e){t.exports='\n'},function(t,e){t.exports=''},function(t,e){t.exports='\n'},function(t,e){t.exports='\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n image/svg+xml\n \n \n \n \n \n\n'},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);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}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e,n){var r=n(87);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e,n){var r=n(100);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e,n){"use strict";t.exports=n(128)},function(t,e,n){"use strict";t.exports.encode=n(129),t.exports.decode=n(130),t.exports.format=n(131),t.exports.parse=n(132)},function(t,e){t.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/},function(t,e){t.exports=/[\0-\x1F\x7F-\x9F]/},function(t,e){t.exports=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/},function(t,e,n){"use strict";var r="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",o="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",i=new RegExp("^(?:"+r+"|"+o+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|<[?].*?[?]>|]*>|)"),s=new RegExp("^(?:"+r+"|"+o+")");t.exports.HTML_TAG_RE=i,t.exports.HTML_OPEN_CLOSE_TAG_RE=s},function(t,e,n){"use strict";t.exports.tokenize=function(t,e){var n,r,o,i,s=t.pos,a=t.src.charCodeAt(s);if(e)return!1;if(126!==a)return!1;if(o=(r=t.scanDelims(t.pos,!0)).length,i=String.fromCharCode(a),o<2)return!1;for(o%2&&(t.push("text","",0).content=i,o--),n=0;n=0;e--)95!==(n=a[e]).marker&&42!==n.marker||-1!==n.end&&(r=a[n.end],s=e>0&&a[e-1].end===n.end+1&&a[e-1].token===n.token-1&&a[n.end+1].token===r.token+1&&a[e-1].marker===n.marker,i=String.fromCharCode(n.marker),(o=t.tokens[n.token]).type=s?"strong_open":"em_open",o.tag=s?"strong":"em",o.nesting=1,o.markup=s?i+i:i,o.content="",(o=t.tokens[r.token]).type=s?"strong_close":"em_close",o.tag=s?"strong":"em",o.nesting=-1,o.markup=s?i+i:i,o.content="",s&&(t.tokens[a[e-1].token].content="",t.tokens[a[n.end+1].token].content="",e--))}},function(t,e,n){"use strict";(function(t){var r=n(30),o=n(4),i={function:!0,object:!0},s=i[typeof exports]&&exports&&!exports.nodeType?exports:void 0,a=i[typeof t]&&t&&!t.nodeType?t:void 0,c=(a&&a.exports===s?s:void 0)?o.a.Buffer:void 0,l=c?function(t){return t instanceof c}:Object(r.a)(!1);e.a=l}).call(this,n(18)(t))},function(t,e,n){"use strict";e.a=function(t){return function(){return t}}},function(t,e){t.exports='\n'},function(t,e){t.exports='\n'},function(t,e){t.exports='\n'},function(t,e){t.exports='\n'},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports='\n'},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports='\n'},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports='\n'},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports='\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n image/svg+xml\n \n \n \n \n\n'},function(t,e){t.exports='\n'},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports='\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n \n\n'},function(t,e,n){"use strict";(function(t){var e=n(3),r=n(13);const o="object"==typeof window?window:t;o.CKEDITOR_VERSION?e.a.error("ckeditor-version-collision: The global CKEDITOR_VERSION constant has already been set.",{collidingVersion:o.CKEDITOR_VERSION,version:r.a}):o.CKEDITOR_VERSION=r.a}).call(this,n(9))},function(t,e,n){var r=n(59);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.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-focus-border:#47a4f5;--ck-color-focus-shadow:rgba(119,186,248,.5);--ck-color-focus-disabled-shadow:rgba(119,186,248,.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,.15);--ck-color-shadow-inner:rgba(0,0,0,.1);--ck-color-button-default-background:transparent;--ck-color-button-default-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-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-base-foreground);--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:#c2c2c2;--ck-color-upload-bar-background:#6cb5f9;--ck-color-upload-infinite-background:rgba(0,0,0,.1);--ck-color-link-default:#0000f0;--ck-color-link-selected-background:#ebf8ff;--ck-disabled-opacity:.5;--ck-focus-outer-shadow-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-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{margin:0;padding:0;border:0;background:transparent;text-decoration:none;vertical-align:middle;transition:none;word-wrap:break-word}.ck.ck-reset_all,.ck.ck-reset_all *{border-collapse:collapse;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);color:var(--ck-color-text);text-align:left;white-space:nowrap;cursor:auto;float:none}.ck.ck-reset_all .ck-rtl *{text-align:right}.ck.ck-reset_all iframe{vertical-align:inherit}.ck.ck-reset_all textarea{white-space:pre-wrap}.ck.ck-reset_all input[type=password],.ck.ck-reset_all input[type=text],.ck.ck-reset_all textarea{cursor:text}.ck.ck-reset_all input[type=password][disabled],.ck.ck-reset_all input[type=text][disabled],.ck.ck-reset_all textarea[disabled]{cursor:default}.ck.ck-reset_all fieldset{padding:10px;border:2px groove #dfdee3}.ck.ck-reset_all button::-moz-focus-inner{padding:0;border:0}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit) * 1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit) * 0.8);--ck-spacing-small:calc(var(--ck-spacing-unit) * 0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit) * 0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit) * 0.16)}"},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,r=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var o,i=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?t:(o=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")})}},function(t,e,n){var r=n(62);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.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(t,e,n){var r=n(64);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.exports=".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"},function(t,e,n){var r=n(66);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.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(t,e,n){var r=n(68);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.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(t,e,n){var r=n(70);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.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(t,e,n){var r=n(72);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.exports=".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base) * var(--ck-font-size-normal))}.ck.ck-icon{width:var(--ck-icon-size);height:var(--ck-icon-size);font-size:.8333350694em;will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon *{fill:currentColor}"},function(t,e,n){var r=n(74);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.exports='.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck-tooltip{visibility:hidden;opacity:0;display:none;z-index:var(--ck-z-modal)}.ck-tooltip .ck-tooltip__text{display:inline-block}.ck-tooltip .ck-tooltip__text:after{content:"";width:0;height:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%}.ck.ck-tooltip.ck-tooltip_s{bottom:calc(-1 * var(--ck-tooltip-arrow-size));transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after{top:calc(-1 * var(--ck-tooltip-arrow-size));transform:translateX(-50%);border-color:transparent transparent var(--ck-color-tooltip-background);border-width:0 var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_n{top:calc(-1 * var(--ck-tooltip-arrow-size));transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(-1 * var(--ck-tooltip-arrow-size));transform:translateX(-50%);border-color:var(--ck-color-tooltip-background) transparent transparent;border-width:var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size) 0}.ck.ck-tooltip .ck-tooltip__text{border-radius:0}.ck-rounded-corners .ck.ck-tooltip .ck-tooltip__text,.ck.ck-tooltip .ck-tooltip__text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-tooltip .ck-tooltip__text{font-size:.9em;line-height:1.5;color:var(--ck-color-tooltip-text);padding:var(--ck-spacing-small) var(--ck-spacing-medium);background:var(--ck-color-tooltip-background);position:relative;left:-50%}.ck.ck-tooltip .ck-tooltip__text:after{border-style:solid;left:50%}.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{transition:opacity .2s ease-in-out .2s}'},function(t,e,n){var r=n(76);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.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}.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(t,e,n){var r=n(78);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.exports=".ck .ck-widget.ck-widget_selectable{position:relative}.ck .ck-widget.ck-widget_selectable .ck-widget__selection-handler{visibility:hidden;position:absolute}.ck .ck-widget.ck-widget_selectable .ck-widget__selection-handler .ck-icon{display:block}.ck .ck-widget.ck-widget_selectable.ck-widget_selected .ck-widget__selection-handler,.ck .ck-widget.ck-widget_selectable: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{margin:var(--ck-spacing-standard) 0;padding:0;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 .ck-widget.ck-widget_selectable .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_selectable .ck-widget__selection-handler:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_selectable .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_selectable .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_selectable.ck-widget_selected .ck-widget__selection-handler,.ck .ck-widget.ck-widget_selectable.ck-widget_selected:hover .ck-widget__selection-handler{opacity:1;background-color:var(--ck-color-focus-border)}.ck .ck-widget.ck-widget_selectable.ck-widget_selected .ck-widget__selection-handler .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_selectable.ck-widget_selected:hover .ck-widget__selection-handler .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_selectable: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)}"},function(t,e,n){var r=n(80);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.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-width:0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_n]:before{border-color:transparent transparent var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_n]:after{border-color:transparent transparent var(--ck-color-panel-background);margin-top:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-width:var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0}.ck.ck-balloon-panel[class*=arrow_s]:before{border-color:var(--ck-color-panel-border) transparent transparent}.ck.ck-balloon-panel[class*=arrow_s]:after{border-color:var(--ck-color-panel-background) transparent transparent;margin-bottom:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(-1 * var(--ck-balloon-arrow-half-width));top:calc(-1 * var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(2 * var(--ck-balloon-arrow-half-width));top:calc(-1 * var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(2 * var(--ck-balloon-arrow-half-width));top:calc(-1 * var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{left:50%;margin-left:calc(-1 * var(--ck-balloon-arrow-half-width));bottom:calc(-1 * var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{left:calc(2 * var(--ck-balloon-arrow-half-width));bottom:calc(-1 * var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{right:calc(2 * var(--ck-balloon-arrow-half-width));bottom:calc(-1 * var(--ck-balloon-arrow-height))}'},function(t,e,n){var r=n(82);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.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(t,e,n){var r=n(84);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.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(t,e,n){var r=n(86);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.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(t,e){t.exports=".ck-content code{background-color:hsla(0,0%,78%,.3);padding:.15em;border-radius:2px}"},function(t,e,n){var r=n(89);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.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(t,e,n){var r=n(91);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.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;left:0;transform:translate3d(0,100%,0)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block;will-change:transform}:root{--ck-dropdown-arrow-size:calc(0.5 * var(--ck-icon-size))}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{right:var(--ck-spacing-standard);width:var(--ck-dropdown-arrow-size);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{border-radius:0;box-shadow:var(--ck-drop-shadow),0 0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;min-width:100%}"},function(t,e,n){var r=n(93);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.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(.2*var(--ck-line-height-base)*var(--ck-font-size-base)) calc(.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(t,e,n){var r=n(95);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.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(.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(t,e,n){var r=n(97);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.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(t,e,n){var r=n(99);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.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(t,e){t.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(t,e,n){var r=n(102);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.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)}"},function(t,e,n){var r=n(104);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.exports=".ck.ck-text-alternative-form .ck-labeled-input{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}.ck.ck-text-alternative-form{padding:var(--ck-spacing-standard)}.ck.ck-text-alternative-form:focus{outline:none}.ck.ck-text-alternative-form>:not(:first-child){margin-left:var(--ck-spacing-standard)}"},function(t,e,n){var r=n(106);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.exports=".ck-content .image{clear:both;text-align:center}.ck-content .image>img{display:block;margin:0 auto;max-width:100%}"},function(t,e,n){var r=n(108);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.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(t,e,n){var r=n(110);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.exports=".ck-content .image>figcaption{color:#333;background-color:#f7f7f7;padding:.6em;font-size:.75em;outline-offset:-1px}"},function(t,e,n){var r=n(112);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.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(t,e,n){var r=n(114);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.exports=".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}"},function(t,e,n){var r=n(116);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.exports=".ck.ck-link-form .ck-labeled-input{display:inline-block}.ck.ck-link-form .ck-label{display:none}.ck.ck-link-form{padding:var(--ck-spacing-standard)}.ck.ck-link-form:focus{outline:none}.ck.ck-link-form>:not(:first-child){margin-left:var(--ck-spacing-standard)}"},function(t,e,n){var r=n(118);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.exports=".ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}.ck.ck-link-actions{padding:var(--ck-spacing-standard)}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{padding:0 var(--ck-spacing-medium);color:var(--ck-color-link-default);text-overflow:ellipsis;cursor:pointer;max-width:var(--ck-input-text-width);min-width:3em;text-align:center}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions:focus{outline:none}.ck.ck-link-actions>:not(:first-child){margin-left:var(--ck-spacing-standard)}"},function(t,e,n){var r=n(120);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.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(t,e,n){var r=n(122);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.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(t,e,n){var r=n(124);"string"==typeof r&&(r=[[t.i,r,""]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(r,o);r.locals&&(t.exports=r.locals)},function(t,e){t.exports=".ck-content .table{margin:1em auto;display:table}.ck-content .table table{border-collapse:collapse;border-spacing:0;border:1px double #b3b3b3}.ck-content .table table td,.ck-content .table table th{min-width:2em;padding:.4em;text-align:center;border-color:#d9d9d9}.ck-content .table table th{font-weight:700;background:#fafafa}"},function(t,e){},function(t,e,n){"use strict";t.exports=n(127)},function(t,e,n){"use strict";var r=n(2),o=n(135),i=n(139),s=n(140),a=n(148),c=n(162),l=n(175),u=n(22),d=n(177),h={default:n(179),zero:n(180),commonmark:n(181)},f=/^(vbscript|javascript|file|data):/,p=/^data:image\/(gif|png|jpeg|webp);/;function m(t){var e=t.trim().toLowerCase();return!f.test(e)||!!p.test(e)}var g=["http:","https:","mailto:"];function b(t){var e=u.parse(t,!0);if(e.hostname&&(!e.protocol||g.indexOf(e.protocol)>=0))try{e.hostname=d.toASCII(e.hostname)}catch(t){}return u.encode(u.format(e))}function w(t){var e=u.parse(t,!0);if(e.hostname&&(!e.protocol||g.indexOf(e.protocol)>=0))try{e.hostname=d.toUnicode(e.hostname)}catch(t){}return u.decode(u.format(e))}function v(t,e){if(!(this instanceof v))return new v(t,e);e||r.isString(t)||(e=t||{},t="default"),this.inline=new c,this.block=new a,this.core=new s,this.renderer=new i,this.linkify=new l,this.validateLink=m,this.normalizeLink=b,this.normalizeLinkText=w,this.utils=r,this.helpers=r.assign({},o),this.options={},this.configure(t),e&&this.set(e)}v.prototype.set=function(t){return r.assign(this.options,t),this},v.prototype.configure=function(t){var e,n=this;if(r.isString(t)&&!(t=h[e=t]))throw new Error('Wrong `markdown-it` preset "'+e+'", check name');if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&n.set(t.options),t.components&&Object.keys(t.components).forEach(function(e){t.components[e].rules&&n[e].ruler.enableOnly(t.components[e].rules),t.components[e].rules2&&n[e].ruler2.enableOnly(t.components[e].rules2)}),this},v.prototype.enable=function(t,e){var n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(e){n=n.concat(this[e].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));var r=t.filter(function(t){return n.indexOf(t)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},v.prototype.disable=function(t,e){var n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(e){n=n.concat(this[e].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));var r=t.filter(function(t){return n.indexOf(t)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},v.prototype.use=function(t){var e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this},v.prototype.parse=function(t,e){if("string"!=typeof t)throw new Error("Input data should be a String");var n=new this.core.State(t,this,e);return this.core.process(n),n.tokens},v.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)},v.prototype.parseInline=function(t,e){var n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens},v.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)},t.exports=v},function(t){t.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(t,e,n){"use strict";var r={};function o(t,e,n){var i,s,a,c,l,u="";for("string"!=typeof e&&(n=e,e=o.defaultChars),void 0===n&&(n=!0),l=function(t){var e,n,o=r[t];if(o)return o;for(o=r[t]=[],e=0;e<128;e++)n=String.fromCharCode(e),/^[0-9a-z]$/i.test(n)?o.push(n):o.push("%"+("0"+e.toString(16).toUpperCase()).slice(-2));for(e=0;e=55296&&a<=57343){if(a>=55296&&a<=56319&&i+1=56320&&c<=57343){u+=encodeURIComponent(t[i]+t[i+1]),i++;continue}u+="%EF%BF%BD"}else u+=encodeURIComponent(t[i]);return u}o.defaultChars=";/?:@&=+$,-_.!~*'()#",o.componentChars="-_.!~*'()",t.exports=o},function(t,e,n){"use strict";var r={};function o(t,e){var n;return"string"!=typeof e&&(e=o.defaultChars),n=function(t){var e,n,o=r[t];if(o)return o;for(o=r[t]=[],e=0;e<128;e++)n=String.fromCharCode(e),o.push(n);for(e=0;e=55296&&c<=57343?"���":String.fromCharCode(c),e+=6):240==(248&o)&&e+91114111?l+="����":(c-=65536,l+=String.fromCharCode(55296+(c>>10),56320+(1023&c))),e+=9):l+="�";return l})}o.defaultChars=";/?:@&=+$,#",o.componentChars="",t.exports=o},function(t,e,n){"use strict";t.exports=function(t){var e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&-1!==t.hostname.indexOf(":")?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||""}},function(t,e,n){"use strict";function r(){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 o=/^([a-z0-9.+-]+:)/i,i=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,a=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(a),l=["%","/","?",";","#"].concat(c),u=["/","?","#"],d=/^[+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};r.prototype.parse=function(t,e){var n,r,i,a,c,m=t;if(m=m.trim(),!e&&1===t.split("#").length){var g=s.exec(m);if(g)return this.pathname=g[1],g[2]&&(this.search=g[2]),this}var b=o.exec(m);if(b&&(i=(b=b[0]).toLowerCase(),this.protocol=b,m=m.substr(b.length)),(e||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,v,_=-1;for(n=0;n127?A+="x":A+=C[T];if(!A.match(d)){var S=x.slice(0,n),P=x.slice(n+1),O=C.match(h);O&&(S.push(O[1]),P.unshift(O[2])),P.length&&(m=P.join(".")+m),this.hostname=S.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var R=m.indexOf("#");-1!==R&&(this.hash=m.substr(R),m=m.slice(0,R));var D=m.indexOf("?");return-1!==D&&(this.search=m.substr(D),m=m.slice(0,D)),m&&(this.pathname=m),p[i]&&this.hostname&&!this.pathname&&(this.pathname=""),this},r.prototype.parseHost=function(t){var e=i.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},t.exports=function(t,e){if(t&&t instanceof r)return t;var n=new r;return n.parse(t,e),n}},function(t,e,n){"use strict";e.Any=n(23),e.Cc=n(24),e.Cf=n(134),e.P=n(10),e.Z=n(25)},function(t,e){t.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804\uDCBD|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/},function(t,e,n){"use strict";e.parseLinkLabel=n(136),e.parseLinkDestination=n(137),e.parseLinkTitle=n(138)},function(t,e,n){"use strict";t.exports=function(t,e,n){var r,o,i,s,a=-1,c=t.posMax,l=t.pos;for(t.pos=e+1,r=1;t.pos=n)return c;if(34!==(i=t.charCodeAt(e))&&39!==i&&40!==i)return c;for(e++,40===i&&(i=41);e"+i(t[e].content)+""},s.code_block=function(t,e,n,r,o){var s=t[e];return""+i(t[e].content)+"\n"},s.fence=function(t,e,n,r,s){var a,c,l,u,d=t[e],h=d.info?o(d.info).trim():"",f="";return h&&(f=h.split(/\s+/g)[0]),0===(a=n.highlight&&n.highlight(d.content,f)||i(d.content)).indexOf(""+a+"\n"):"
"+a+"
\n"},s.image=function(t,e,n,r,o){var i=t[e];return i.attrs[i.attrIndex("alt")][1]=o.renderInlineAsText(i.children,n,r),o.renderToken(t,e,n)},s.hardbreak=function(t,e,n){return n.xhtmlOut?"
\n":"
\n"},s.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?"
\n":"
\n":"\n"},s.text=function(t,e){return i(t[e].content)},s.html_block=function(t,e){return t[e].content},s.html_inline=function(t,e){return t[e].content},a.prototype.renderAttrs=function(t){var e,n,r;if(!t.attrs)return"";for(r="",e=0,n=t.attrs.length;e\n":">")},a.prototype.renderInline=function(t,e,n){for(var r,o="",i=this.rules,s=0,a=t.length;s\s]/i.test(t)}function i(t){return/^<\/a\s*>/i.test(t)}t.exports=function(t){var e,n,s,a,c,l,u,d,h,f,p,m,g,b,w,v,_,k=t.tokens;if(t.md.options.linkify)for(n=0,s=k.length;n=0;e--)if("link_close"!==(l=a[e]).type){if("html_inline"===l.type&&(o(l.content)&&g>0&&g--,i(l.content)&&g++),!(g>0)&&"text"===l.type&&t.md.linkify.test(l.content)){for(h=l.content,_=t.md.linkify.match(h),u=[],m=l.level,p=0,d=0;d<_.length;d++)b=_[d].url,w=t.md.normalizeLink(b),t.md.validateLink(w)&&(v=_[d].text,v=_[d].schema?"mailto:"!==_[d].schema||/^mailto:/i.test(v)?t.md.normalizeLinkText(v):t.md.normalizeLinkText("mailto:"+v).replace(/^mailto:/,""):t.md.normalizeLinkText("http://"+v).replace(/^http:\/\//,""),(f=_[d].index)>p&&((c=new t.Token("text","",0)).content=h.slice(p,f),c.level=m,u.push(c)),(c=new t.Token("link_open","a",1)).attrs=[["href",w]],c.level=m++,c.markup="linkify",c.info="auto",u.push(c),(c=new t.Token("text","",0)).content=v,c.level=m,u.push(c),(c=new t.Token("link_close","a",-1)).level=--m,c.markup="linkify",c.info="auto",u.push(c),p=_[d].lastIndex);p=0;e--)"text"!==(n=t[e]).type||r||(n.content=n.content.replace(i,a)),"link_open"===n.type&&"auto"===n.info&&r--,"link_close"===n.type&&"auto"===n.info&&r++}function l(t){var e,n,o=0;for(e=t.length-1;e>=0;e--)"text"!==(n=t[e]).type||o||r.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&&o--,"link_close"===n.type&&"auto"===n.info&&o++}t.exports=function(t){var e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)"inline"===t.tokens[e].type&&(o.test(t.tokens[e].content)&&c(t.tokens[e].children),r.test(t.tokens[e].content)&&l(t.tokens[e].children))}},function(t,e,n){"use strict";var r=n(2).isWhiteSpace,o=n(2).isPunctChar,i=n(2).isMdAsciiPunct,s=/['"]/,a=/['"]/g,c="’";function l(t,e,n){return t.substr(0,e)+n+t.substr(e+1)}function u(t,e){var n,s,u,d,h,f,p,m,g,b,w,v,_,k,y,x,C,A,T,E,S;for(T=[],n=0;n=0&&!(T[C].level<=p);C--);if(T.length=C+1,"text"===s.type){h=0,f=(u=s.content).length;t:for(;h=0)g=u.charCodeAt(d.index-1);else for(C=n-1;C>=0&&("softbreak"!==t[C].type&&"hardbreak"!==t[C].type);C--)if("text"===t[C].type){g=t[C].content.charCodeAt(t[C].content.length-1);break}if(b=32,h=48&&g<=57&&(x=y=!1),y&&x&&(y=!1,x=v),y||x){if(x)for(C=T.length-1;C>=0&&(m=T[C],!(T[C].level=0;e--)"inline"===t.tokens[e].type&&s.test(t.tokens[e].content)&&u(t.tokens[e].children,t)}},function(t,e,n){"use strict";var r=n(12);function o(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}o.prototype.Token=r,t.exports=o},function(t,e,n){"use strict";var r=n(11),o=[["table",n(149),["paragraph","reference"]],["code",n(150)],["fence",n(151),["paragraph","reference","blockquote","list"]],["blockquote",n(152),["paragraph","reference","blockquote","list"]],["hr",n(153),["paragraph","reference","blockquote","list"]],["list",n(154),["paragraph","reference","blockquote"]],["reference",n(155)],["heading",n(156),["paragraph","reference","blockquote"]],["lheading",n(157)],["html_block",n(158),["paragraph","reference","blockquote"]],["paragraph",n(160)]];function i(){this.ruler=new r;for(var t=0;t=n))&&!(t.sCount[s]=c){t.line=n;break}for(r=0;rn)return!1;if(d=e+1,t.sCount[d]=4)return!1;if((l=t.bMarks[d]+t.tShift[d])>=t.eMarks[d])return!1;if(124!==(a=t.src.charCodeAt(l++))&&45!==a&&58!==a)return!1;for(;l=4)return!1;if((f=(h=i(c.replace(/^\||\|$/g,""))).length)>m.length)return!1;if(s)return!0;for((p=t.push("table_open","table",1)).map=b=[e,0],(p=t.push("thead_open","thead",1)).map=[e,e+1],(p=t.push("tr_open","tr",1)).map=[e,e+1],u=0;u=4);d++){for(h=i(c.replace(/^\||\|$/g,"")),p=t.push("tr_open","tr",1),u=0;u=4))break;o=++r}return t.line=o,(i=t.push("code_block","code",0)).content=t.getLines(e,o,4+t.blkIndent,!0),i.map=[e,t.line],!0}},function(t,e,n){"use strict";t.exports=function(t,e,n,r){var o,i,s,a,c,l,u,d=!1,h=t.bMarks[e]+t.tShift[e],f=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(h+3>f)return!1;if(126!==(o=t.src.charCodeAt(h))&&96!==o)return!1;if(c=h,(i=(h=t.skipChars(h,o))-c)<3)return!1;if(u=t.src.slice(c,h),(s=t.src.slice(h,f)).indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;for(a=e;!(++a>=n)&&!((h=c=t.bMarks[a]+t.tShift[a])<(f=t.eMarks[a])&&t.sCount[a]=4||(h=t.skipChars(h,o))-c=4)return!1;if(62!==t.src.charCodeAt(T++))return!1;if(o)return!0;for(c=f=t.sCount[e]+T-(t.bMarks[e]+t.tShift[e]),32===t.src.charCodeAt(T)?(T++,c++,f++,i=!1,_=!0):9===t.src.charCodeAt(T)?(_=!0,(t.bsCount[e]+f)%4==3?(T++,c++,f++,i=!1):i=!0):_=!1,p=[t.bMarks[e]],t.bMarks[e]=T;T=E,w=[t.sCount[e]],t.sCount[e]=f-c,v=[t.tShift[e]],t.tShift[e]=T-t.bMarks[e],y=t.md.block.ruler.getRules("blockquote"),b=t.parentType,t.parentType="blockquote",C=!1,h=e+1;h=(E=t.eMarks[h])));h++)if(62!==t.src.charCodeAt(T++)||C){if(u)break;for(k=!1,a=0,l=y.length;a=E,m.push(t.bsCount[h]),t.bsCount[h]=t.sCount[h]+1+(_?1:0),w.push(t.sCount[h]),t.sCount[h]=f-c,v.push(t.tShift[h]),t.tShift[h]=T-t.bMarks[h]}for(g=t.blkIndent,t.blkIndent=0,(x=t.push("blockquote_open","blockquote",1)).markup=">",x.map=d=[e,0],t.md.block.tokenize(t,e,h),(x=t.push("blockquote_close","blockquote",-1)).markup=">",t.lineMax=A,t.parentType=b,d[1]=t.line,a=0;a=4)return!1;if(42!==(i=t.src.charCodeAt(l++))&&45!==i&&95!==i)return!1;for(s=1;l=s)return-1;if((n=t.src.charCodeAt(i++))<48||n>57)return-1;for(;;){if(i>=s)return-1;if(!((n=t.src.charCodeAt(i++))>=48&&n<=57)){if(41===n||46===n)break;return-1}if(i-o>=10)return-1}return i=4)return!1;if(r&&"paragraph"===t.parentType&&t.tShift[e]>=t.blkIndent&&(F=!0),(S=i(t,e))>=0){if(h=!0,O=t.bMarks[e]+t.tShift[e],w=Number(t.src.substr(O,S-O-1)),F&&1!==w)return!1}else{if(!((S=o(t,e))>=0))return!1;h=!1}if(F&&t.skipSpaces(S)>=t.eMarks[e])return!1;if(b=t.src.charCodeAt(S-1),r)return!0;for(g=t.tokens.length,h?(I=t.push("ordered_list_open","ol",1),1!==w&&(I.attrs=[["start",w]])):I=t.push("bullet_list_open","ul",1),I.map=m=[e,0],I.markup=String.fromCharCode(b),_=e,P=!1,D=t.md.block.ruler.getRules("list"),C=t.parentType,t.parentType="list";_=v?1:k-d)>4&&(u=1),l=d+u,(I=t.push("list_item_open","li",1)).markup=String.fromCharCode(b),I.map=f=[e,0],y=t.blkIndent,T=t.tight,A=t.tShift[e],x=t.sCount[e],t.blkIndent=l,t.tight=!0,t.tShift[e]=a-t.bMarks[e],t.sCount[e]=k,a>=v&&t.isEmpty(e+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,e,n,!0),t.tight&&!P||(N=!1),P=t.line-e>1&&t.isEmpty(t.line-1),t.blkIndent=y,t.tShift[e]=A,t.sCount[e]=x,t.tight=T,(I=t.push("list_item_close","li",-1)).markup=String.fromCharCode(b),_=e=t.line,f[1]=_,a=t.bMarks[e],_>=n)break;if(t.sCount[_]=4)return!1;if(91!==t.src.charCodeAt(x))return!1;for(;++x3||t.sCount[A]<0)){for(v=!1,d=0,h=_.length;d=4)return!1;if(35!==(i=t.src.charCodeAt(l))||l>=u)return!1;for(s=1,i=t.src.charCodeAt(++l);35===i&&l6||ll&&r(t.src.charCodeAt(a-1))&&(u=a),t.line=e+1,(c=t.push("heading_open","h"+String(s),1)).markup="########".slice(0,s),c.map=[e,t.line],(c=t.push("inline","",0)).content=t.src.slice(l,u).trim(),c.map=[e,t.line],c.children=[],(c=t.push("heading_close","h"+String(s),-1)).markup="########".slice(0,s),!0))}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r,o,i,s,a,c,l,u,d,h,f=e+1,p=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;for(h=t.parentType,t.parentType="paragraph";f3)){if(t.sCount[f]>=t.blkIndent&&(c=t.bMarks[f]+t.tShift[f])<(l=t.eMarks[f])&&(45===(d=t.src.charCodeAt(c))||61===d)&&(c=t.skipChars(c,d),(c=t.skipSpaces(c))>=l)){u=61===d?1:2;break}if(!(t.sCount[f]<0)){for(o=!1,i=0,s=p.length;i|$))/i,/<\/(script|pre|style)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(o.source+"\\s*$"),/^$/,!1]];t.exports=function(t,e,n,r){var o,s,a,c,l=t.bMarks[e]+t.tShift[e],u=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(!t.md.options.html)return!1;if(60!==t.src.charCodeAt(l))return!1;for(c=t.src.slice(l,u),o=0;o3||t.sCount[c]<0)){for(r=!1,o=0,i=l.length;o0&&this.level++,this.tokens.push(o),o},i.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},i.prototype.skipEmptyLines=function(t){for(var e=this.lineMax;te;)if(!o(this.src.charCodeAt(--t)))return t+1;return t},i.prototype.skipChars=function(t,e){for(var n=this.src.length;tn;)if(e!==this.src.charCodeAt(--t))return t+1;return t},i.prototype.getLines=function(t,e,n,r){var i,s,a,c,l,u,d,h=t;if(t>=e)return"";for(u=new Array(e-t),i=0;hn?new Array(s-n+1).join(" ")+this.src.slice(c,l):this.src.slice(c,l)}return u.join("")},i.prototype.Token=r,t.exports=i},function(t,e,n){"use strict";var r=n(11),o=[["text",n(163)],["newline",n(164)],["escape",n(165)],["backticks",n(166)],["strikethrough",n(27).tokenize],["emphasis",n(28).tokenize],["link",n(167)],["image",n(168)],["autolink",n(169)],["html_inline",n(170)],["entity",n(171)]],i=[["balance_pairs",n(172)],["strikethrough",n(27).postProcess],["emphasis",n(28).postProcess],["text_collapse",n(173)]];function s(){var t;for(this.ruler=new r,t=0;t=i)break}else t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},s.prototype.parse=function(t,e,n,r){var o,i,s,a=new this.State(t,e,n,r);for(this.tokenize(a),s=(i=this.ruler2.getRules("")).length,o=0;o=0&&32===t.pending.charCodeAt(n)?n>=1&&32===t.pending.charCodeAt(n-1)?(t.pending=t.pending.replace(/ +$/,""),t.push("hardbreak","br",0)):(t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0)):t.push("softbreak","br",0)),i++;i?@[]^_`{|}~-".split("").forEach(function(t){o[t.charCodeAt(0)]=1}),t.exports=function(t,e){var n,i=t.pos,s=t.posMax;if(92!==t.src.charCodeAt(i))return!1;if(++i=m)return!1;for(g=l,(u=t.md.helpers.parseLinkDestination(t.src,l,t.posMax)).ok&&(f=t.md.normalizeLink(u.str),t.md.validateLink(f)?l=u.pos:f=""),g=l;l=m||41!==t.src.charCodeAt(l))&&(b=!0),l++}if(b){if(void 0===t.env.references)return!1;if(l=0?s=t.src.slice(g,l++):l=a+1):l=a+1,s||(s=t.src.slice(c,a)),!(d=t.env.references[r(s)]))return t.pos=p,!1;f=d.href,h=d.title}return e||(t.pos=c,t.posMax=a,t.push("link_open","a",1).attrs=n=[["href",f]],h&&n.push(["title",h]),t.md.inline.tokenize(t),t.push("link_close","a",-1)),t.pos=l,t.posMax=m,!0}},function(t,e,n){"use strict";var r=n(2).normalizeReference,o=n(2).isSpace;t.exports=function(t,e){var n,i,s,a,c,l,u,d,h,f,p,m,g,b="",w=t.pos,v=t.posMax;if(33!==t.src.charCodeAt(t.pos))return!1;if(91!==t.src.charCodeAt(t.pos+1))return!1;if(l=t.pos+2,(c=t.md.helpers.parseLinkLabel(t,t.pos+1,!1))<0)return!1;if((u=c+1)=v)return!1;for(g=u,(h=t.md.helpers.parseLinkDestination(t.src,u,t.posMax)).ok&&(b=t.md.normalizeLink(h.str),t.md.validateLink(b)?u=h.pos:b=""),g=u;u=v||41!==t.src.charCodeAt(u))return t.pos=w,!1;u++}else{if(void 0===t.env.references)return!1;if(u=0?a=t.src.slice(g,u++):u=c+1):u=c+1,a||(a=t.src.slice(l,c)),!(d=t.env.references[r(a)]))return t.pos=w,!1;b=d.href,f=d.title}return e||(s=t.src.slice(l,c),t.md.inline.parse(s,t.md,t.env,m=[]),(p=t.push("image","img",0)).attrs=n=[["src",b],["alt",""]],p.children=m,p.content=s,f&&n.push(["title",f])),t.pos=u,t.posMax=v,!0}},function(t,e,n){"use strict";var r=/^<([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])?)*)>/,o=/^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/;t.exports=function(t,e){var n,i,s,a,c,l,u=t.pos;return 60===t.src.charCodeAt(u)&&(!((n=t.src.slice(u)).indexOf(">")<0)&&(o.test(n)?(a=(i=n.match(o))[0].slice(1,-1),c=t.md.normalizeLink(a),!!t.md.validateLink(c)&&(e||((l=t.push("link_open","a",1)).attrs=[["href",c]],l.markup="autolink",l.info="auto",(l=t.push("text","",0)).content=t.md.normalizeLinkText(a),(l=t.push("link_close","a",-1)).markup="autolink",l.info="auto"),t.pos+=i[0].length,!0)):!!r.test(n)&&(a=(s=n.match(r))[0].slice(1,-1),c=t.md.normalizeLink("mailto:"+a),!!t.md.validateLink(c)&&(e||((l=t.push("link_open","a",1)).attrs=[["href",c]],l.markup="autolink",l.info="auto",(l=t.push("text","",0)).content=t.md.normalizeLinkText(a),(l=t.push("link_close","a",-1)).markup="autolink",l.info="auto"),t.pos+=s[0].length,!0))))}},function(t,e,n){"use strict";var r=n(26).HTML_TAG_RE;t.exports=function(t,e){var n,o,i,s=t.pos;return!!t.md.options.html&&(i=t.posMax,!(60!==t.src.charCodeAt(s)||s+2>=i)&&(!(33!==(n=t.src.charCodeAt(s+1))&&63!==n&&47!==n&&!function(t){var e=32|t;return e>=97&&e<=122}(n))&&(!!(o=t.src.slice(s).match(r))&&(e||(t.push("html_inline","",0).content=t.src.slice(s,s+o[0].length)),t.pos+=o[0].length,!0))))}},function(t,e,n){"use strict";var r=n(21),o=n(2).has,i=n(2).isValidEntityCode,s=n(2).fromCodePoint,a=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,c=/^&([a-z][a-z0-9]{1,31});/i;t.exports=function(t,e){var n,l,u=t.pos,d=t.posMax;if(38!==t.src.charCodeAt(u))return!1;if(u+1=0;){if((o=i[n]).open&&o.marker===r.marker&&o.end<0&&o.level===r.level)if(!((o.close||r.open)&&void 0!==o.length&&void 0!==r.length&&(o.length+r.length)%3==0)){r.jump=e-n,r.open=!1,o.end=e,o.jump=0;break}n-=o.jump+1}}},function(t,e,n){"use strict";t.exports=function(t){var e,n,r=0,o=t.tokens,i=t.tokens.length;for(e=n=0;e0&&this.level++,this.pendingLevel=this.level,this.tokens.push(o),o},a.prototype.scanDelims=function(t,e){var n,r,a,c,l,u,d,h,f,p=t,m=!0,g=!0,b=this.posMax,w=this.src.charCodeAt(t);for(n=t>0?this.src.charCodeAt(t-1):32;p=3&&":"===t[e-3]?0:e>=3&&"/"===t[e-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){var r=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.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]",u="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function d(t){var e=t.re=n(176)(t.__opts__),r=t.__tlds__.slice();function a(t){return t.replace("%TLDS%",e.src_tlds)}t.onCompile(),t.__tlds_replaced__||r.push(l),r.push(e.src_xn),e.src_tlds=r.join("|"),e.email_fuzzy=RegExp(a(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(a(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(a(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(a(e.tpl_host_fuzzy_test),"i");var c=[];function u(t,e){throw new Error('(LinkifyIt) Invalid schema "'+t+'": '+e)}t.__compiled__={},Object.keys(t.__schemas__).forEach(function(e){var n=t.__schemas__[e];if(null!==n){var r={validate:null,link:null};if(t.__compiled__[e]=r,function(t){return"[object Object]"===o(t)}(n))return!function(t){return"[object RegExp]"===o(t)}(n.validate)?i(n.validate)?r.validate=n.validate:u(e,n):r.validate=function(t){return function(e,n){var r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}(n.validate),void(i(n.normalize)?r.normalize=n.normalize:n.normalize?u(e,n):r.normalize=function(t,e){e.normalize(t)});!function(t){return"[object String]"===o(t)}(n)?u(e,n):c.push(e)}}),c.forEach(function(e){t.__compiled__[t.__schemas__[e]]&&(t.__compiled__[e].validate=t.__compiled__[t.__schemas__[e]].validate,t.__compiled__[e].normalize=t.__compiled__[t.__schemas__[e]].normalize)}),t.__compiled__[""]={validate:null,normalize:function(t,e){e.normalize(t)}};var d=Object.keys(t.__compiled__).filter(function(e){return e.length>0&&t.__compiled__[e]}).map(s).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+d+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+d+")","ig"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),function(t){t.__index__=-1,t.__text_cache__=""}(t)}function h(t,e){var n=new function(t,e){var n=t.__index__,r=t.__last_index__,o=t.__text_cache__.slice(n,r);this.schema=t.__schema__.toLowerCase(),this.index=n+e,this.lastIndex=r+e,this.raw=o,this.text=o,this.url=o}(t,e);return t.__compiled__[n.schema].normalize(n,t),n}function f(t,e){if(!(this instanceof f))return new f(t,e);e||function(t){return Object.keys(t||{}).reduce(function(t,e){return t||a.hasOwnProperty(e)},!1)}(t)&&(e=t,t={}),this.__opts__=r({},a,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=r({},c,t),this.__compiled__={},this.__tlds__=u,this.__tlds_replaced__=!1,this.re={},d(this)}f.prototype.add=function(t,e){return this.__schemas__[t]=e,d(this),this},f.prototype.set=function(t){return this.__opts__=r(this.__opts__,t),this},f.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;var e,n,r,o,i,s,a,c;if(this.re.schema_test.test(t))for((a=this.re.schema_search).lastIndex=0;null!==(e=a.exec(t));)if(o=this.testSchemaAt(t,e[2],a.lastIndex)){this.__schema__=e[2],this.__index__=e.index+e[1].length,this.__last_index__=e.index+e[0].length+o;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=t.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||c=0&&null!==(r=t.match(this.re.email_fuzzy))&&(i=r.index+r[1].length,s=r.index+r[0].length,(this.__index__<0||ithis.__last_index__)&&(this.__schema__="mailto:",this.__index__=i,this.__last_index__=s)),this.__index__>=0},f.prototype.pretest=function(t){return this.re.pretest.test(t)},f.prototype.testSchemaAt=function(t,e,n){return this.__compiled__[e.toLowerCase()]?this.__compiled__[e.toLowerCase()].validate(t,n,this):0},f.prototype.match=function(t){var e=0,n=[];this.__index__>=0&&this.__text_cache__===t&&(n.push(h(this,e)),e=this.__last_index__);for(var r=e?t.slice(e):t;this.test(r);)n.push(h(this,e)),r=r.slice(this.__last_index__),e+=this.__last_index__;return n.length?n:null},f.prototype.tlds=function(t,e){return t=Array.isArray(t)?t:[t],e?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(t,e,n){return t!==n[e-1]}).reverse(),d(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,d(this),this)},f.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),"mailto:"!==t.schema||/^mailto:/i.test(t.url)||(t.url="mailto:"+t.url)},f.prototype.onCompile=function(){},t.exports=f},function(t,e,n){"use strict";t.exports=function(t){var e={};e.src_Any=n(23).source,e.src_Cc=n(24).source,e.src_Z=n(25).source,e.src_P=n(10).source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");return e.src_pseudo_letter="(?:(?![><|]|"+e.src_ZPCc+")"+e.src_Any+")",e.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]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|[><|]|"+e.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|[><|]|[()[\\]{}.,\"'?!\\-]).|\\[(?:(?!"+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-]).|\\.{2,3}[a-zA-Z0-9%/]|\\.(?!"+e.src_ZCc+"|[.]).|"+(t&&t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+e.src_ZCc+").|\\!(?!"+e.src_ZCc+"|[!]).|\\?(?!"+e.src_ZCc+"|[?]).)+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]+',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-(?!-)|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy="(^|[><|]|\\(|"+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}},function(t,e,n){(function(t,r){var o;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(i){"object"==typeof e&&e&&e.nodeType,"object"==typeof t&&t&&t.nodeType;var s="object"==typeof r&&r;s.global!==s&&s.window!==s&&s.self;var a,c=2147483647,l=36,u=1,d=26,h=38,f=700,p=72,m=128,g="-",b=/^xn--/,w=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=l-u,y=Math.floor,x=String.fromCharCode;function C(t){throw new RangeError(_[t])}function A(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function T(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),r+A((t=t.replace(v,".")).split("."),e).join(".")}function E(t){for(var e,n,r=[],o=0,i=t.length;o=55296&&e<=56319&&o65535&&(e+=x((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=x(t)}).join("")}function P(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:l}function O(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function R(t,e,n){var r=0;for(t=n?y(t/f):t>>1,t+=y(t/e);t>k*d>>1;r+=l)t=y(t/k);return y(r+(k+1)*t/(t+h))}function D(t){var e,n,r,o,i,s,a,h,f,b,w=[],v=t.length,_=0,k=m,x=p;for((n=t.lastIndexOf(g))<0&&(n=0),r=0;r=128&&C("not-basic"),w.push(t.charCodeAt(r));for(o=n>0?n+1:0;o=v&&C("invalid-input"),((h=P(t.charCodeAt(o++)))>=l||h>y((c-_)/s))&&C("overflow"),_+=h*s,!(h<(f=a<=x?u:a>=x+d?d:a-x));a+=l)s>y(c/(b=l-f))&&C("overflow"),s*=b;x=R(_-i,e=w.length+1,0==i),y(_/e)>c-k&&C("overflow"),k+=y(_/e),_%=e,w.splice(_++,0,k)}return S(w)}function I(t){var e,n,r,o,i,s,a,h,f,b,w,v,_,k,A,T=[];for(v=(t=E(t)).length,e=m,n=0,i=p,s=0;s=e&&wy((c-n)/(_=r+1))&&C("overflow"),n+=(a-e)*_,e=a,s=0;sc&&C("overflow"),w==e){for(h=n,f=l;!(h<(b=f<=i?u:f>=i+d?d:f-i));f+=l)A=h-b,k=l-b,T.push(x(O(b+A%k,0))),h=y(A/k);T.push(x(O(h,0))),i=R(n,_,r==o),n=0,++r}++n,++e}return T.join("")}a={version:"1.4.1",ucs2:{decode:E,encode:S},decode:D,encode:I,toASCII:function(t){return T(t,function(t){return w.test(t)?"xn--"+I(t):t})},toUnicode:function(t){return T(t,function(t){return b.test(t)?D(t.slice(4).toLowerCase()):t})}},void 0===(o=function(){return a}.call(e,n,e,t))||(t.exports=o)}()}).call(this,n(178)(t),n(9))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],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}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}}},function(t,e,n){"use strict";t.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(t,e,n){"use strict";t.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(t,e,n){"use strict";n.r(e);var r=Object.getPrototypeOf;var o=function(t){return r(Object(t))};var i=function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e};var s=function(t){return!!t&&"object"==typeof t},a="[object Object]",c=Object.prototype,l=Function.prototype.toString,u=c.hasOwnProperty,d=l.call(Object),h=c.toString;var f=function(t){if(!s(t)||h.call(t)!=a||i(t))return!1;var e=o(t);if(null===e)return!0;var n=u.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==d};class p{constructor(t,e){this._config={},e&&this.define(e),t&&this._setObjectToTarget(this._config,t)}set(t,e){this._setToTarget(this._config,t,e)}define(t,e){this._setToTarget(this._config,t,e,!0)}get(t){return this._getFromSource(this._config,t)}_setToTarget(t,e,n,r=!1){if(f(e))return void this._setObjectToTarget(t,e,r);const o=e.split(".");e=o.pop();for(const e of o)f(t[e])||(t[e]={}),t=t[e];if(f(n))return f(t[e])||(t[e]={}),t=t[e],void this._setObjectToTarget(t,n,r);r&&void 0!==t[e]||(t[e]=n)}_getFromSource(t,e){const n=e.split(".");e=n.pop();for(const e of n){if(!f(t[e])){t=null;break}t=t[e]}return t?t[e]:void 0}_setObjectToTarget(t,e,n){Object.keys(e).forEach(r=>{this._setToTarget(t,r,e[r],n)})}}var m=n(0);var g=function(){return function t(){t.called=!0}};class b{constructor(t,e){this.source=t,this.name=e,this.path=[],this.stop=g(),this.off=g()}}function w(){let t="e";for(let e=0;e<8;e++)t+=Math.floor(65536*(1+Math.random())).toString(16).substring(1);return t}var v={get(t){return"number"!=typeof t?this[t]||this.normal:t},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};const _=Symbol("listeningTo"),k=Symbol("emitterId");var y={on(t,e,n={}){this.listenTo(this,t,e,n)},once(t,e,n){this.listenTo(this,t,function(t,...n){t.off(),e.call(this,t,...n)},n)},off(t,e){this.stopListening(this,t,e)},listenTo(t,e,n,r={}){let o,i;this[_]||(this[_]={});const s=this[_];C(t)||x(t);const a=C(t);(o=s[a])||(o=s[a]={emitter:t,callbacks:{}}),(i=o.callbacks[e])||(i=o.callbacks[e]=[]),i.push(n),function(t,e){const n=A(t);if(n[e])return;let r=e,o=null;const i=[];for(;""!==r&&!n[r];)n[r]={callbacks:[],childEvents:[]},i.push(n[r]),o&&n[r].childEvents.push(o),o=r,r=r.substr(0,r.lastIndexOf(":"));if(""!==r){for(const t of i)t.callbacks=n[r].callbacks.slice();n[r].childEvents.push(o)}}(t,e);const c=T(t,e),l=v.get(r.priority),u={callback:n,priority:l};for(const t of c){let e=!1;for(let n=0;n-1?t(e,n.substr(0,n.lastIndexOf(":"))):null;return r.callbacks}(this,r);if(n.path.push(this),o){const t=[n,...e];o=Array.from(o);for(let e=0;e{this._delegations||(this._delegations=new Map);for(const r of t){const t=this._delegations.get(r);t?t.set(e,n):this._delegations.set(r,new Map([[e,n]]))}}}},stopDelegating(t,e){if(this._delegations)if(t)if(e){const n=this._delegations.get(t);n&&n.delete(e)}else this._delegations.delete(t);else this._delegations.clear()}};function x(t,e){t[k]||(t[k]=e||w())}function C(t){return t[k]}function A(t){return t._events||Object.defineProperty(t,"_events",{value:{}}),t._events}function T(t,e){const n=A(t)[e];if(!n)return[];let r=[n.callbacks];for(let e=0;e{Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e)).forEach(n=>{if(n in t.prototype)return;const r=Object.getOwnPropertyDescriptor(e,n);r.enumerable=!1,Object.defineProperty(t.prototype,n,r)})})}var O=function(){this.__data__=[]};var R=function(t,e){return t===e||t!=t&&e!=e};var D=function(t,e){for(var n=t.length;n--;)if(R(t[n][0],e))return n;return-1},I=Array.prototype.splice;var F=function(t){var e=this.__data__,n=D(e,t);return!(n<0||(n==e.length-1?e.pop():I.call(e,n,1),0))};var N=function(t){var e=this.__data__,n=D(e,t);return n<0?void 0:e[n][1]};var M=function(t){return D(this.__data__,t)>-1};var V=function(t,e){var n=this.__data__,r=D(n,t);return r<0?n.push([t,e]):n[r][1]=e,this};function B(t){var e=-1,n=t?t.length:0;for(this.clear();++e-1&&t%1==0&&t<=jt};var $t=function(t){return null!=t&&Ht(qt(t))&&!K(t)};var Ut=function(t){return s(t)&&$t(t)},Wt="[object Arguments]",Gt=Object.prototype,Kt=Gt.hasOwnProperty,Jt=Gt.toString,Zt=Gt.propertyIsEnumerable;var Qt=function(t){return Ut(t)&&Kt.call(t,"callee")&&(!Zt.call(t,"callee")||Jt.call(t)==Wt)},Yt=Array.isArray,Xt="[object String]",te=Object.prototype.toString;var ee=function(t){return"string"==typeof t||!Yt(t)&&s(t)&&te.call(t)==Xt};var ne=function(t){var e=t?t.length:void 0;return Ht(e)&&(Yt(t)||ee(t)||Qt(t))?Lt(e,String):null},re=9007199254740991,oe=/^(?:0|[1-9]\d*)$/;var ie=function(t,e){return!!(e=null==e?re:e)&&("number"==typeof t||oe.test(t))&&t>-1&&t%1==0&&tt.data.length)throw new m.b("view-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.");if(n<0||e+n>t.data.length)throw new m.b("view-textproxy-wrong-length: Given length value is incorrect.");this.data=t.data.substring(e,e+n),this.offsetInText=e}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(t){return"textProxy"==t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let n=t.includeSelf?this.textNode:this.parent;for(;null!==n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}}function Dn(t){const e=new Map;for(const n in t)e.set(n,t[n]);return e}function In(t){return!(!t||!t[Symbol.iterator])}class Fn{constructor(...t){this._patterns=[],this.add(...t)}add(...t){for(let e of t)("string"==typeof e||e instanceof RegExp)&&(e={name:e}),e.classes&&("string"==typeof e.classes||e.classes instanceof RegExp)&&(e.classes=[e.classes]),this._patterns.push(e)}match(...t){for(const e of t)for(const t of this._patterns){const n=Nn(e,t);if(n)return{element:e,pattern:t,match:n}}return null}matchAll(...t){const e=[];for(const n of t)for(const t of this._patterns){const r=Nn(n,t);r&&e.push({element:n,pattern:t,match:r})}return e.length>0?e:null}getElementName(){if(1!==this._patterns.length)return null;const t=this._patterns[0],e=t.name;return"function"==typeof t||!e||e instanceof RegExp?null:e}}function Nn(t,e){if("function"==typeof e)return e(t);const n={};return e.name&&(n.name=function(t,e){if(t instanceof RegExp)return t.test(e);return t===e}(e.name,t.name),!n.name)?null:e.attributes&&(n.attributes=function(t,e){const n=[];for(const r in t){const o=t[r];if(!e.hasAttribute(r))return null;{const t=e.getAttribute(r);if(!0===o)n.push(r);else if(o instanceof RegExp){if(!o.test(t))return null;n.push(r)}else{if(t!==o)return null;n.push(r)}}}return n}(e.attributes,t),!n.attributes)?null:!(e.classes&&(n.classes=function(t,e){const n=[];for(const r of t)if(r instanceof RegExp){const t=e.getClassNames();for(const e of t)r.test(e)&&n.push(e);if(0===n.length)return null}else{if(!e.hasClass(r))return null;n.push(r)}return n}(e.classes,t),!n.classes))&&(!(e.styles&&(n.styles=function(t,e){const n=[];for(const r in t){const o=t[r];if(!e.hasStyle(r))return null;{const t=e.getStyle(r);if(o instanceof RegExp){if(!o.test(t))return null;n.push(r)}else{if(t!==o)return null;n.push(r)}}}return n}(e.styles,t),!n.styles))&&n)}class Mn extends Pn{constructor(t,e,n){if(super(),this.name=t,this._attrs=function(t){t=f(t)?Dn(t):new Map(t);for(const[e,n]of t)null===n?t.delete(e):"string"!=typeof n&&t.set(e,String(n));return t}(e),this._children=[],n&&this._insertChild(0,n),this._classes=new Set,this._attrs.has("class")){const t=this._attrs.get("class");Bn(this._classes,t),this._attrs.delete("class")}this._styles=new Map,this._attrs.has("style")&&(Vn(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(t,e=null){return e?"element"==t&&e==this.name:"element"==t||t==this.name||super.is(t)}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.size>0&&(yield"style");for(const t of this._attrs.keys())yield t}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.size>0&&(yield["style",this.getAttribute("style")])}getAttribute(t){if("class"==t)return this._classes.size>0?[...this._classes].join(" "):void 0;if("style"!=t)return this._attrs.get(t);if(this._styles.size>0){let t="";for(const[e,n]of this._styles)t+=`${e}:${n};`;return t}}hasAttribute(t){return"class"==t?this._classes.size>0:"style"==t?this._styles.size>0:this._attrs.has(t)}isSimilar(t){if(!(t instanceof Mn))return!1;if(this===t)return!0;if(this.name!=t.name)return!1;if(this._attrs.size!==t._attrs.size||this._classes.size!==t._classes.size||this._styles.size!==t._styles.size)return!1;for(const[e,n]of this._attrs)if(!t._attrs.has(e)||t._attrs.get(e)!==n)return!1;for(const e of this._classes)if(!t._classes.has(e))return!1;for(const[e,n]of this._styles)if(!t._styles.has(e)||t._styles.get(e)!==n)return!1;return!0}hasClass(...t){for(const e of t)if(!this._classes.has(e))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(t){return this._styles.get(t)}getStyleNames(){return this._styles.keys()}hasStyle(...t){for(const e of t)if(!this._styles.has(e))return!1;return!0}findAncestor(...t){const e=new Fn(...t);let n=this.parent;for(;n;){if(e.match(n))return n;n=n.parent}return null}getCustomProperty(t){return this._customProperties.get(t)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const t=Array.from(this._classes).sort().join(","),e=Array.from(this._styles).map(t=>`${t[0]}:${t[1]}`).sort().join(";"),n=Array.from(this._attrs).map(t=>`${t[0]}="${t[1]}"`).sort().join(" ");return this.name+(""==t?"":` class="${t}"`)+(""==e?"":` style="${e}"`)+(""==n?"":` ${n}`)}_clone(t=!1){const e=[];if(t)for(const n of this.getChildren())e.push(n._clone(t));const n=new this.constructor(this.name,this._attrs,e);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(t){return this._insertChild(this.childCount,t)}_insertChild(t,e){this._fireChange("children",this);let n=0;const r=function(t){if("string"==typeof t)return[new On(t)];In(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new On(t):t instanceof Rn?new On(t.data):t)}(e);for(const e of r)null!==e.parent&&e._remove(),e.parent=this,this._children.splice(t,0,e),t++,n++;return n}_removeChildren(t,e=1){this._fireChange("children",this);for(let n=t;n0&&(this._classes.clear(),!0):"style"==t?this._styles.size>0&&(this._styles.clear(),!0):this._attrs.delete(t)}_addClass(t){this._fireChange("attributes",this),(t=Array.isArray(t)?t:[t]).forEach(t=>this._classes.add(t))}_removeClass(t){this._fireChange("attributes",this),(t=Array.isArray(t)?t:[t]).forEach(t=>this._classes.delete(t))}_setStyle(t,e){if(this._fireChange("attributes",this),f(t)){const e=Object.keys(t);for(const n of e)this._styles.set(n,t[n])}else this._styles.set(t,e)}_removeStyle(t){this._fireChange("attributes",this),(t=Array.isArray(t)?t:[t]).forEach(t=>this._styles.delete(t))}_setCustomProperty(t,e){this._customProperties.set(t,e)}_removeCustomProperty(t){return this._customProperties.delete(t)}}function Vn(t,e){let n=null,r=0,o=0,i=null;if(t.clear(),""!==e){";"!=e.charAt(e.length-1)&&(e+=";");for(let s=0;st.add(e))}class Ln extends Mn{constructor(t,e,n){super(t,e,n),this.getFillerOffset=zn}is(t,e=null){return e?"containerElement"==t&&e==this.name||super.is(t,e):"containerElement"==t||super.is(t)}}function zn(){const t=[...this.getChildren()],e=t[this.childCount-1];if(e&&e.is("element","br"))return this.childCount;for(const e of t)if(!e.is("uiElement"))return null;return this.childCount}var qn=function(t,e,n){if(!$(n))return!1;var r=typeof e;return!!("number"==r?$t(n)&&ie(e,n.length):"string"==r&&e in n)&&R(n[e],t)};var jn=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)},Hn="[object Symbol]",$n=Object.prototype.toString;var Un=function(t){return"symbol"==typeof t||s(t)&&$n.call(t)==Hn},Wn=NaN,Gn=/^\s+|\s+$/g,Kn=/^[-+]0x[0-9a-f]+$/i,Jn=/^0b[01]+$/i,Zn=/^0o[0-7]+$/i,Qn=parseInt;var Yn=function(t){if("number"==typeof t)return t;if(Un(t))return Wn;if($(t)){var e=K(t.valueOf)?t.valueOf():t;t=$(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Gn,"");var n=Jn.test(t);return n||Zn.test(t)?Qn(t.slice(2),n?2:8):Kn.test(t)?Wn:+t},Xn=1/0,tr=1.7976931348623157e308;var er=function(t){return t?(t=Yn(t))===Xn||t===-Xn?(t<0?-1:1)*tr:t==t?t:0:0===t?t:0};var nr=function(t){var e=er(t),n=e%1;return e==e?n?e-n:e:0},rr="Expected a function",or=Math.max;var ir=function(t,e){if("function"!=typeof t)throw new TypeError(rr);return e=or(void 0===e?t.length-1:nr(e),0),function(){for(var n=arguments,r=-1,o=or(n.length-e,0),i=Array(o);++r1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(i=t.length>3&&"function"==typeof i?(o--,i):void 0,s&&qn(n[0],n[1],s)&&(i=o<3?void 0:i,o=1),e=Object(e);++r{this.set(e,t[e])},this);xr(this);const n=this[wr];if(t in this&&!n.has(t))throw new m.b("observable-set-cannot-override: Cannot override an existing property.");Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get:()=>n.get(t),set(e){const r=n.get(t);let o=this.fire("set:"+t,t,e,r);void 0===o&&(o=e),r===o&&n.has(t)||(n.set(t,o),this.fire("change:"+t,t,o,r))}}),this[t]=e},bind(...t){if(!t.length||!Tr(t))throw new m.b("observable-bind-wrong-properties: All properties must be strings.");if(new Set(t).size!==t.length)throw new m.b("observable-bind-duplicate-properties: Properties must be unique.");xr(this);const e=this[_r];t.forEach(t=>{if(e.has(t))throw new m.b("observable-bind-rebind: Cannot bind the same property more that once.")});const n=new Map;return t.forEach(t=>{const r={property:t,to:[]};e.set(t,r),n.set(t,r)}),{to:Cr,toMany:Ar,_observable:this,_bindProperties:t,_to:[],_bindings:n}},unbind(...t){if(!(wr in this))return;const e=this[_r],n=this[vr];if(t.length){if(!Tr(t))throw new m.b("observable-unbind-wrong-properties: Properties must be strings.");t.forEach(t=>{const r=e.get(t);if(!r)return;let o,i,s,a;r.to.forEach(t=>{o=t[0],i=t[1],s=n.get(o),(a=s[i]).delete(r),a.size||delete s[i],Object.keys(s).length||(n.delete(o),this.stopListening(o,"change"))}),e.delete(t)})}else n.forEach((t,e)=>{this.stopListening(e,"change")}),n.clear(),e.clear()},decorate(t){const e=this[t];if(!e)throw new m.b("observablemixin-cannot-decorate-undefined: Cannot decorate an undefined method.",{object:this,methodName:t});this.on(t,(t,n)=>{t.return=e.apply(this,n)}),this[t]=function(...e){return this.fire(t,e)}}};br(kr,y);var yr=kr;function xr(t){wr in t||(Object.defineProperty(t,wr,{value:new Map}),Object.defineProperty(t,vr,{value:new Map}),Object.defineProperty(t,_r,{value:new Map}))}function Cr(...t){const e=function(...t){if(!t.length)throw new m.b("observable-bind-to-parse-error: Invalid argument syntax in `to()`.");const e={to:[]};let n;"function"==typeof t[t.length-1]&&(e.callback=t.pop());return t.forEach(t=>{if("string"==typeof t)n.properties.push(t);else{if("object"!=typeof t)throw new m.b("observable-bind-to-parse-error: Invalid argument syntax in `to()`.");n={observable:t,properties:[]},e.to.push(n)}}),e}(...t),n=Array.from(this._bindings.keys()),r=n.length;if(!e.callback&&e.to.length>1)throw new m.b("observable-bind-to-no-callback: Binding multiple observables only possible with callback.");if(r>1&&e.callback)throw new m.b("observable-bind-to-extra-callback: Cannot bind multiple properties and use a callback in one binding.");e.to.forEach(t=>{if(t.properties.length&&t.properties.length!==r)throw new m.b("observable-bind-to-properties-length: The number of properties must match.");t.properties.length||(t.properties=this._bindProperties)}),this._to=e.to,e.callback&&(this._bindings.get(n[0]).callback=e.callback),function(t,e){e.forEach(e=>{const n=t[vr];let r;n.get(e.observable)||t.listenTo(e.observable,"change",(o,i)=>{(r=n.get(e.observable)[i])&&r.forEach(e=>{Er(t,e.property)})})})}(this._observable,this._to),function(t){let e;t._bindings.forEach((n,r)=>{t._to.forEach(o=>{e=o.properties[n.callback?0:t._bindProperties.indexOf(r)],n.to.push([o.observable,e]),function(t,e,n,r){const o=t[vr],i=o.get(n),s=i||{};s[r]||(s[r]=new Set);s[r].add(e),i||o.set(n,s)}(t._observable,n,o.observable,e)})})}(this),this._bindProperties.forEach(t=>{Er(this._observable,t)})}function Ar(t,e,n){if(this._bindings.size>1)throw new m.b("observable-bind-to-many-not-one-binding: Cannot bind multiple properties with toMany().");this.to(...function(t,e){const n=t.map(t=>[t,e]);return Array.prototype.concat.apply([],n)}(t,e),n)}function Tr(t){return t.every(t=>"string"==typeof t)}function Er(t,e){const n=t[_r].get(e);let r;r=n.callback?n.callback.apply(t,n.to.map(t=>t[0][t[1]])):(r=n.to[0])[0][r[1]],t.hasOwnProperty(e)?t[e]=r:t.set(e,r)}const Sr=Symbol("document");class Pr extends Ln{constructor(t,e,n){super(t,e,n),this.set("isReadOnly",!1),this.set("isFocused",!1)}get document(){return this.getCustomProperty(Sr)}set _document(t){if(this.getCustomProperty(Sr))throw new m.b("view-editableelement-document-already-set: View document is already set.");this._setCustomProperty(Sr,t),this.bind("isReadOnly").to(t),this.bind("isFocused").to(t,"isFocused",e=>e&&t.selection.editableElement==this),this.listenTo(t.selection,"change",()=>{this.isFocused=t.isFocused&&t.selection.editableElement==this})}}P(Pr,yr);const Or=Symbol("rootName");class Rr extends Pr{constructor(t){super(t),this.rootName="main"}is(t,e=null){return e?"rootElement"==t&&e==this.name||super.is(t,e):"rootElement"==t||super.is(t)}get rootName(){return this.getCustomProperty(Or)}set rootName(t){this._setCustomProperty(Or,t)}set _name(t){this.name=t}}class Dr{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new m.b("view-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.");if(t.direction&&"forward"!=t.direction&&"backward"!=t.direction)throw new m.b("view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.",{direction:t.direction});this.boundaries=t.boundaries||null,t.startPosition?this.position=Ir.createFromPosition(t.startPosition):this.position=Ir.createFromPosition(t.boundaries["backward"==t.direction?"end":"start"]),this.direction=t.direction||"forward",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(t){let e,n,r;do{r=this.position,({done:e,value:n}=this.next())}while(!e&&t(n));e||(this.position=r)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let t=Ir.createFromPosition(this.position);const e=this.position,n=t.parent;if(null===n.parent&&t.offset===n.childCount)return{done:!0};if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};let r;if(n instanceof On){if(t.isAtEnd)return this.position=Ir.createAfter(n),this._next();r=n.data[t.offset]}else r=n.getChild(t.offset);if(r instanceof Mn)return this.shallow?t.offset++:t=new Ir(r,0),this.position=t,this._formatReturnValue("elementStart",r,e,t,1);if(r instanceof On){if(this.singleCharacters)return t=new Ir(r,0),this.position=t,this._next();{let n,o=r.data.length;return r==this._boundaryEndParent?(o=this.boundaries.end.offset,n=new Rn(r,0,o),t=Ir.createAfter(n)):(n=new Rn(r,0,r.data.length),t.offset++),this.position=t,this._formatReturnValue("text",n,e,t,o)}}if("string"==typeof r){let r;if(this.singleCharacters)r=1;else{r=(n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length)-t.offset}const o=new Rn(n,t.offset,r);return t.offset+=r,this.position=t,this._formatReturnValue("text",o,e,t,r)}return t=Ir.createAfter(n),this.position=t,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",n,e,t)}_previous(){let t=Ir.createFromPosition(this.position);const e=this.position,n=t.parent;if(null===n.parent&&0===t.offset)return{done:!0};if(n==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0};let r;if(n instanceof On){if(t.isAtStart)return this.position=Ir.createBefore(n),this._previous();r=n.data[t.offset-1]}else r=n.getChild(t.offset-1);if(r instanceof Mn)return this.shallow?(t.offset--,this.position=t,this._formatReturnValue("elementStart",r,e,t,1)):(t=new Ir(r,r.childCount),this.position=t,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",r,e,t));if(r instanceof On){if(this.singleCharacters)return t=new Ir(r,r.data.length),this.position=t,this._previous();{let n,o=r.data.length;if(r==this._boundaryStartParent){const e=this.boundaries.start.offset;o=(n=new Rn(r,e,r.data.length-e)).data.length,t=Ir.createBefore(n)}else n=new Rn(r,0,r.data.length),t.offset--;return this.position=t,this._formatReturnValue("text",n,e,t,o)}}if("string"==typeof r){let r;if(this.singleCharacters)r=1;else{const e=n===this._boundaryStartParent?this.boundaries.start.offset:0;r=t.offset-e}t.offset-=r;const o=new Rn(n,t.offset,r);return this.position=t,this._formatReturnValue("text",o,e,t,r)}return t=Ir.createBefore(n),this.position=t,this._formatReturnValue("elementStart",n,e,t,1)}_formatReturnValue(t,e,n,r,o){return e instanceof Rn&&(e.offsetInText+e.data.length==e.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=Ir.createAfter(e.textNode):(r=Ir.createAfter(e.textNode),this.position=r)),0===e.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=Ir.createBefore(e.textNode):(r=Ir.createBefore(e.textNode),this.position=r))),{done:!1,value:{type:t,item:e,previousPosition:n,nextPosition:r,length:o}}}}class Ir{constructor(t,e){this.parent=t,this.offset=e}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 t=this.parent.is("text")?this.parent.data.length:this.parent.childCount;return this.offset===t}get root(){return this.parent.root}get editableElement(){let t=this.parent;for(;!(t instanceof Pr);){if(!t.parent)return null;t=t.parent}return t}getShiftedBy(t){const e=Ir.createFromPosition(this),n=e.offset+t;return e.offset=n<0?0:n,e}getLastMatchingPosition(t,e={}){e.startPosition=this;const n=new Dr(e);return n.skip(t),n.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(t){const e=this.getAncestors(),n=t.getAncestors();let r=0;for(;e[r]==n[r]&&e[r];)r++;return 0===r?null:e[r-1]}isEqual(t){return this.parent==t.parent&&this.offset==t.offset}isBefore(t){return"before"==this.compareWith(t)}isAfter(t){return"after"==this.compareWith(t)}compareWith(t){if(this.root!==t.root)return"different";if(this.isEqual(t))return"same";const e=this.parent.is("node")?this.parent.getPath():[],n=t.parent.is("node")?t.parent.getPath():[];e.push(this.offset),n.push(t.offset);const r=Sn(e,n);switch(r){case"prefix":return"before";case"extension":return"after";default:return e[r]0?new this(n,r):new this(r,n)}static createIn(t){return this.createFromParentsAndOffsets(t,0,t,t.childCount)}static createOn(t){const e=t.is("textProxy")?t.offsetSize:1;return this.createFromPositionAndShift(Ir.createBefore(t),e)}static createCollapsedAt(t,e){const n=Ir.createAt(t,e),r=Ir.createFromPosition(n);return new Fr(n,r)}}function Nr(t){return!(!t.item.is("attributeElement")&&!t.item.is("uiElement"))}function Mr(t){let e=0;for(const n of t)e++;return e}class Vr{constructor(t=null,e,n){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(t,e,n)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1],e=this._lastRangeBackward?t.end:t.start;return Ir.createFromPosition(e)}get focus(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1],e=this._lastRangeBackward?t.start:t.end;return Ir.createFromPosition(e)}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 t of this._ranges)yield Fr.createFromRange(t)}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?Fr.createFromRange(t):null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?Fr.createFromRange(t):null}getFirstPosition(){const t=this.getFirstRange();return t?Ir.createFromPosition(t.start):null}getLastPosition(){const t=this.getLastRange();return t?Ir.createFromPosition(t.end):null}isEqual(t){if(this.isFake!=t.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=t.fakeSelectionLabel)return!1;if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let n=!1;for(const r of t._ranges)if(e.isEqual(r)){n=!0;break}if(!n)return!1}return!0}isSimilar(t){if(this.isBackward!=t.isBackward)return!1;const e=Mr(this.getRanges());if(e!=Mr(t.getRanges()))return!1;if(0==e)return!0;for(let e of this.getRanges()){e=e.getTrimmed();let n=!1;for(let r of t.getRanges())if(r=r.getTrimmed(),e.start.isEqual(r.start)&&e.end.isEqual(r.end)){n=!0;break}if(!n)return!1}return!0}getSelectedElement(){if(1!==this.rangeCount)return null;const t=this.getFirstRange(),e=t.start.nodeAfter,n=t.end.nodeBefore;return e instanceof Mn&&e==n?e:null}setTo(t,e,n){if(null===t)this._setRanges([]),this._setFakeOptions(e);else if(t instanceof Vr||t instanceof Br)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof Fr)this._setRanges([t],e&&e.backward),this._setFakeOptions(e);else if(t instanceof Ir)this._setRanges([new Fr(t)]),this._setFakeOptions(e);else if(t instanceof Pn){const r=!!n&&!!n.backward;let o;if(void 0===e)throw new m.b("view-selection-setTo-required-second-parameter: selection.setTo requires the second parameter when the first parameter is a node.");o="in"==e?Fr.createIn(t):"on"==e?Fr.createOn(t):Fr.createCollapsedAt(t,e),this._setRanges([o],r),this._setFakeOptions(n)}else{if(!In(t))throw new m.b("view-selection-setTo-not-selectable: Cannot set selection to given place.");this._setRanges(t,e&&e.backward),this._setFakeOptions(e)}this.fire("change")}setFocus(t,e){if(null===this.anchor)throw new m.b("view-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.");const n=Ir.createAt(t,e);if("same"==n.compareWith(this.focus))return;const r=this.anchor;this._ranges.pop(),"before"==n.compareWith(r)?this._addRange(new Fr(n,r),!0):this._addRange(new Fr(r,n)),this.fire("change")}_setRanges(t,e=!1){t=Array.from(t),this._ranges=[];for(const e of t)this._addRange(e);this._lastRangeBackward=!!e}_setFakeOptions(t={}){this._isFake=!!t.fake,this._fakeSelectionLabel=t.fake&&t.label||""}_addRange(t,e=!1){if(!(t instanceof Fr))throw new m.b("view-selection-invalid-range: Invalid Range.");this._pushRange(t),this._lastRangeBackward=!!e}_pushRange(t){for(const e of this._ranges)if(t.isIntersecting(e))throw new m.b("view-selection-range-intersects: Trying to add a range that intersects with another range from selection.",{addedRange:t,intersectingRange:e});this._ranges.push(Fr.createFromRange(t))}}P(Vr,y);class Br{constructor(t=null,e,n){this._selection=new Vr,this._selection.delegate("change").to(this),this._selection.setTo(t,e,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(t){return this._selection.isEqual(t)}isSimilar(t){return this._selection.isSimilar(t)}_setTo(t,e,n){this._selection.setTo(t,e,n)}_setFocus(t,e){this._selection.setFocus(t,e)}}P(Br,y);class Lr{constructor(t={}){this._items=[],this._itemMap=new Map,this._idProperty=t.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(t,e){let n;const r=this._idProperty;if(r in t){if("string"!=typeof(n=t[r]))throw new m.b("collection-add-invalid-id");if(this.get(n))throw new m.b("collection-add-item-already-exists")}else t[r]=n=w();if(void 0===e)e=this._items.length;else if(e>this._items.length||e<0)throw new m.b("collection-add-item-invalid-index");return this._items.splice(e,0,t),this._itemMap.set(n,t),this.fire("add",t,e),this}get(t){let e;if("string"==typeof t)e=this._itemMap.get(t);else{if("number"!=typeof t)throw new m.b("collection-get-invalid-arg: Index or id must be given.");e=this._items[t]}return e||null}getIndex(t){let e;return e="string"==typeof t?this._itemMap.get(t):t,this._items.indexOf(e)}remove(t){let e,n,r,o=!1;const i=this._idProperty;if("string"==typeof t?(n=t,o=!(r=this._itemMap.get(n)),r&&(e=this._items.indexOf(r))):"number"==typeof t?(e=t,o=!(r=this._items[e]),r&&(n=r[i])):(n=(r=t)[i],o=-1==(e=this._items.indexOf(r))||!this._itemMap.get(n)),o)throw new m.b("collection-remove-404: Item not found.");this._items.splice(e,1),this._itemMap.delete(n);const s=this._bindToInternalToExternalMap.get(r);return this._bindToInternalToExternalMap.delete(r),this._bindToExternalToInternalMap.delete(s),this.fire("remove",r,e),r}map(t,e){return this._items.map(t,e)}find(t,e){return this._items.find(t,e)}filter(t,e){return this._items.filter(t,e)}clear(){for(this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);this.length;)this.remove(0)}bindTo(t){if(this._bindToCollection)throw new m.b("collection-bind-to-rebind: The collection cannot be bound more than once.");return this._bindToCollection=t,{as:t=>{this._setUpBindToBinding(e=>new t(e))},using:t=>{"function"==typeof t?this._setUpBindToBinding(e=>t(e)):this._setUpBindToBinding(e=>e[t])}}}_setUpBindToBinding(t){const e=this._bindToCollection,n=(n,r,o)=>{const i=e._bindToCollection==this,s=e._bindToInternalToExternalMap.get(r);if(i&&s)this._bindToExternalToInternalMap.set(r,s),this._bindToInternalToExternalMap.set(s,r);else{const n=t(r);if(!n)return void this._skippedIndexesFromExternal.push(o);let i=o;for(const t of this._skippedIndexesFromExternal)o>t&&i--;for(const t of e._skippedIndexesFromExternal)i>=t&&i++;this._bindToExternalToInternalMap.set(r,n),this._bindToInternalToExternalMap.set(n,r),this.add(n,i);for(let t=0;t{const r=this._bindToExternalToInternalMap.get(e);r&&this.remove(r),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((t,e)=>(ne&&t.push(e),t),[])})}[Symbol.iterator](){return this._items[Symbol.iterator]()}}P(Lr,y);class zr{constructor(){this.selection=new Br,this.roots=new Lr({idProperty:"rootName"}),this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isComposing",!1),this._postFixers=new Set}getRoot(t="main"){return this.roots.get(t)}registerPostFixer(t){this._postFixers.add(t)}_callPostFixers(t){let e=!1;do{for(const n of this._postFixers)if(e=n(t))break}while(e)}}P(zr,yr);const qr=10;class jr extends Mn{constructor(t,e,n){super(t,e,n),this.getFillerOffset=Hr,this._priority=qr,this._id=null,this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new m.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(t,e=null){return e?"attributeElement"==t&&e==this.name||super.is(t,e):"attributeElement"==t||super.is(t)}isSimilar(t){return null!==this.id||null!==t.id?this.id===t.id:super.isSimilar(t)&&this.priority==t.priority}_clone(t){const e=super._clone(t);return e._priority=this._priority,e._id=this._id,e}}function Hr(){if($r(this))return null;let t=this.parent;for(;t&&t.is("attributeElement");){if($r(t)>1)return null;t=t.parent}return!t||$r(t)>1?null:this.childCount}function $r(t){return Array.from(t.getChildren()).filter(t=>!t.is("uiElement")).length}jr.DEFAULT_PRIORITY=qr;class Ur extends Mn{constructor(t,e,n){super(t,e,n),this.getFillerOffset=Wr}is(t,e=null){return e?"emptyElement"==t&&e==this.name||super.is(t,e):"emptyElement"==t||super.is(t)}_insertChild(t,e){if(e&&(e instanceof Pn||Array.from(e).length>0))throw new m.b("view-emptyelement-cannot-add: Cannot add child nodes to EmptyElement instance.")}}function Wr(){return null}const Gr=navigator.userAgent.toLowerCase();var Kr={isMac:function(t){return t.indexOf("macintosh")>-1}(Gr),isEdge:function(t){return!!t.match(/edge\/(\d+.?\d*)/)}(Gr)};const Jr={"⌘":"ctrl","⇧":"shift","⌥":"alt"},Zr={ctrl:"⌘",shift:"⇧",alt:"⌥"},Qr=function(){const t={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 e=65;e<=90;e++){const n=String.fromCharCode(e);t[n.toLowerCase()]=e}for(let e=48;e<=57;e++)t[e-48]=e;for(let e=112;e<=123;e++)t["f"+(e-111)]=e;return t}();function Yr(t){let e;if("string"==typeof t){if(!(e=Qr[t.toLowerCase()]))throw new m.b("keyboard-unknown-key: Unknown key name.",{key:t})}else e=t.keyCode+(t.altKey?Qr.alt:0)+(t.ctrlKey?Qr.ctrl:0)+(t.shiftKey?Qr.shift:0);return e}function Xr(t){return"string"==typeof t&&(t=to(t)),t.map(t=>"string"==typeof t?Yr(t):t).reduce((t,e)=>e+t,0)}function to(t){return t.split(/\s*\+\s*/)}class eo extends Mn{constructor(t,e,n){super(t,e,n),this.getFillerOffset=ro}is(t,e=null){return e?"uiElement"==t&&e==this.name||super.is(t,e):"uiElement"==t||super.is(t)}_insertChild(t,e){if(e&&(e instanceof Pn||Array.from(e).length>0))throw new m.b("view-uielement-cannot-add: Cannot add child nodes to UIElement instance.")}render(t){return this.toDomElement(t)}toDomElement(t){const e=t.createElement(this.name);for(const t of this.getAttributeKeys())e.setAttribute(t,this.getAttribute(t));return e}}function no(t){t.document.on("keydown",(e,n)=>(function(t,e,n){if(e.keyCode==Qr.arrowright){const t=e.domTarget.ownerDocument.defaultView.getSelection(),r=1==t.rangeCount&&t.getRangeAt(0).collapsed;if(r||e.shiftKey){const e=t.focusNode,o=t.focusOffset,i=n.domPositionToView(e,o);if(null===i)return;let s=!1;const a=i.getLastMatchingPosition(t=>(t.item.is("uiElement")&&(s=!0),!(!t.item.is("uiElement")&&!t.item.is("attributeElement"))));if(s){const e=n.viewPositionToDom(a);r?t.collapse(e.parent,e.offset):t.extend(e.parent,e.offset)}}}})(0,n,t.domConverter))}function ro(){return null}class oo{constructor(t){this._children=[],t&&this._insertChild(0,t)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(t){return"documentFragment"==t}_appendChild(t){return this._insertChild(this.childCount,t)}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(t,e){this._fireChange("children",this);let n=0;const r=function(t){if("string"==typeof t)return[new On(t)];In(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new On(t):t instanceof Rn?new On(t.data):t)}(e);for(const e of r)null!==e.parent&&e._remove(),e.parent=this,this._children.splice(t,0,e),t++,n++;return n}_removeChildren(t,e=1){this._fireChange("children",this);for(let n=t;nn instanceof t))throw new m.b("view-writer-insert-invalid-node");n.is("text")||t(n.getChildren())}})(e=In(e)?[...e]:[e]);const n=so(t);if(!n)throw new m.b("view-writer-invalid-position-container");const r=this._breakAttributes(t,!0),o=n._insertChild(r.offset,e);for(const t of e)this._addToClonedElementsGroup(t);const i=r.getShiftedBy(o),s=this.mergeAttributes(r);if(0===o)return new Fr(s,s);{s.isEqual(r)||i.offset--;const t=this.mergeAttributes(i);return new Fr(s,t)}}remove(t){if(po(t),t.isCollapsed)return new oo;const{start:e,end:n}=this._breakAttributesRange(t,!0),r=e.parent,o=n.offset-e.offset,i=r._removeChildren(e.offset,o);for(const t of i)this._removeFromClonedElementsGroup(t);const s=this.mergeAttributes(e);return t.start=s,t.end=Ir.createFromPosition(s),new oo(i)}clear(t,e){po(t);const n=t.getWalker({direction:"backward",ignoreElementEnd:!0});for(const r of n){const n=r.item;let o;if(n.is("element")&&e.isSimilar(n))o=Fr.createOn(n);else if(!r.nextPosition.isAfter(t.start)&&n.is("textProxy")){const t=n.getAncestors().find(t=>t.is("element")&&e.isSimilar(t));t&&(o=Fr.createIn(t))}o&&(o.end.isAfter(t.end)&&(o.end=t.end),o.start.isBefore(t.start)&&(o.start=t.start),this.remove(o))}}move(t,e){let n;if(e.isAfter(t.end)){const r=(e=this._breakAttributes(e,!0)).parent,o=r.childCount;t=this._breakAttributesRange(t,!0),n=this.remove(t),e.offset+=r.childCount-o}else n=this.remove(t);return this.insert(e,n)}wrap(t,e){if(!(e instanceof jr))throw new m.b("view-writer-wrap-invalid-attribute");if(po(t),t.isCollapsed){let n=t.start;n.parent.is("element")&&!function(t){return Array.from(t.getChildren()).some(t=>!t.is("uiElement"))}(n.parent)&&(n=n.getLastMatchingPosition(t=>t.item.is("uiElement"))),n=this._wrapPosition(n,e);const r=this.document.selection;return r.isCollapsed&&r.getFirstPosition().isEqual(t.start)&&this.setSelection(n),new Fr(n)}return this._wrapRange(t,e)}unwrap(t,e){if(!(e instanceof jr))throw new m.b("view-writer-unwrap-invalid-attribute");if(po(t),t.isCollapsed)return t;const{start:n,end:r}=this._breakAttributesRange(t,!0);if(r.isEqual(n.getShiftedBy(1))){const t=n.nodeAfter;if(!e.isSimilar(t)&&t instanceof jr&&this._unwrapAttributeElement(e,t)){const t=this.mergeAttributes(n);t.isEqual(n)||r.offset--;const e=this.mergeAttributes(r);return new Fr(t,e)}}const o=n.parent,i=this._unwrapChildren(o,n.offset,r.offset,e),s=this.mergeAttributes(i.start);s.isEqual(i.start)||i.end.offset--;const a=this.mergeAttributes(i.end);return new Fr(s,a)}rename(t,e){const n=new Ln(e,t.getAttributes());return this.insert(Ir.createAfter(t),n),this.move(Fr.createIn(t),Ir.createAt(n)),this.remove(Fr.createOn(t)),n}_wrapChildren(t,e,n,r){let o=e;const i=[];for(;o!1),t.parent._insertChild(t.offset,n);const r=new Fr(t,t.getShiftedBy(1));this.wrap(r,e);const o=new Ir(n.parent,n.index);n._remove();const i=o.nodeBefore,s=o.nodeAfter;return i instanceof On&&s instanceof On?uo(i,s):co(o)}_wrapAttributeElement(t,e){if(!mo(t,e))return!1;if(t.name!==e.name||t.priority!==e.priority)return!1;for(const n of t.getAttributeKeys())if("class"!==n&&"style"!==n&&e.hasAttribute(n)&&e.getAttribute(n)!==t.getAttribute(n))return!1;for(const n of t.getStyleNames())if(e.hasStyle(n)&&e.getStyle(n)!==t.getStyle(n))return!1;for(const n of t.getAttributeKeys())"class"!==n&&"style"!==n&&(e.hasAttribute(n)||this.setAttribute(n,t.getAttribute(n),e));for(const n of t.getStyleNames())e.hasStyle(n)||this.setStyle(n,t.getStyle(n),e);for(const n of t.getClassNames())e.hasClass(n)||this.addClass(n,e);return!0}_unwrapAttributeElement(t,e){if(!mo(t,e))return!1;if(t.name!==e.name||t.priority!==e.priority)return!1;for(const n of t.getAttributeKeys())if("class"!==n&&"style"!==n&&(!e.hasAttribute(n)||e.getAttribute(n)!==t.getAttribute(n)))return!1;if(!e.hasClass(...t.getClassNames()))return!1;for(const n of t.getStyleNames())if(!e.hasStyle(n)||e.getStyle(n)!==t.getStyle(n))return!1;for(const n of t.getAttributeKeys())"class"!==n&&"style"!==n&&this.removeAttribute(n,e);return this.removeClass(Array.from(t.getClassNames()),e),this.removeStyle(Array.from(t.getStyleNames()),e),!0}_breakAttributesRange(t,e=!1){const n=t.start,r=t.end;if(po(t),t.isCollapsed){const n=this._breakAttributes(t.start,e);return new Fr(n,n)}const o=this._breakAttributes(r,e),i=o.parent.childCount,s=this._breakAttributes(n,e);return o.offset+=o.parent.childCount-i,new Fr(s,o)}_breakAttributes(t,e=!1){const n=t.offset,r=t.parent;if(t.parent.is("emptyElement"))throw new m.b("view-writer-cannot-break-empty-element");if(t.parent.is("uiElement"))throw new m.b("view-writer-cannot-break-ui-element");if(!e&&r.is("text")&&fo(r.parent))return Ir.createFromPosition(t);if(fo(r))return Ir.createFromPosition(t);if(r.is("text"))return this._breakAttributes(lo(t),e);if(n==r.childCount){const t=new Ir(r.parent,r.index+1);return this._breakAttributes(t,e)}if(0===n){const t=new Ir(r.parent,r.index);return this._breakAttributes(t,e)}{const t=r.index+1,o=r._clone();r.parent._insertChild(t,o),this._addToClonedElementsGroup(o);const i=r.childCount-n,s=r._removeChildren(n,i);o._appendChild(s);const a=new Ir(r.parent,t);return this._breakAttributes(a,e)}}_addToClonedElementsGroup(t){if(!t.root.is("rootElement"))return;if(t.is("element"))for(const e of t.getChildren())this._addToClonedElementsGroup(e);const e=t.id;if(!e)return;let n=this._cloneGroups.get(e);n||(n=new Set,this._cloneGroups.set(e,n)),n.add(t),t._clonesGroup=n}_removeFromClonedElementsGroup(t){if(t.is("element"))for(const e of t.getChildren())this._removeFromClonedElementsGroup(e);const e=t.id;if(!e)return;const n=this._cloneGroups.get(e);n&&(n.delete(t),0===n.size&&this._cloneGroups.delete(e))}}function so(t){let e=t.parent;for(;!fo(e);){if(!e)return;e=e.parent}return e}function ao(t,e){return t.prioritye.priority)&&t.getIdentity(){const e=t.createElement("br");return e.dataset.ckeFiller=!0,e},bo=t=>t.createTextNode(" "),wo=7;let vo="";for(let t=0;td?-1:1;c[a+h]&&(c[a]=c[a+h].slice(0)),c[a]||(c[a]=[]),c[a].push(u>d?r:o);let f=Math.max(u,d),p=f-a;for(;pa;d--)l[d]=u(d);l[a]=u(a),h++}while(l[a]!==s);return c[a].slice(1)}function Eo(t,e,n){t.insertBefore(n,t.childNodes[e]||null)}function So(t){const e=t.parentNode;e&&e.removeChild(t)}function Po(t){return"[object Text]"==Object.prototype.toString.call(t)}function Oo(t){if(t){if(t.defaultView)return t instanceof t.defaultView.Document;if(t.ownerDocument&&t.ownerDocument.defaultView)return t instanceof t.ownerDocument.defaultView.Node}return!1}function Ro(t,e){if(t===e)return[];return function(t,e){const n=[],{firstIndex:r,lastIndexOld:o,lastIndexNew:i}=e;i-r>0&&n.push({index:r,type:"insert",values:t.substring(r,i).split("")});o-r>0&&n.push({index:r+(i-r),type:"delete",howMany:o-r});return n}(e,function(t,e){const n=Do(t,e),r=Io(t,n),o=Io(e,n),i=Do(r,o),s=t.length-i,a=e.length-i;return{firstIndex:n,lastIndexOld:s,lastIndexNew:a}}(t,e))}function Do(t,e){for(let n=0;nt.hasAttribute("contenteditable"));return!e||"true"==e.getAttribute("contenteditable")}(e))return!1;if(n===e.getFillerOffset())return!1;const r=t.nodeBefore,o=t.nodeAfter;return!(r instanceof On||o instanceof On)}_updateText(t,e){const n=this.domConverter.findCorrespondingDomText(t),r=this.domConverter.viewToDom(t,n.ownerDocument),o=n.data;let i=r.data;const s=e.inlineFillerPosition;if(s&&s.parent==t.parent&&s.offset==t.index&&(i=vo+i),o!=i){const t=Ro(o,i);for(const e of t)"insert"===e.type?n.insertData(e.index,e.values.join("")):n.deleteData(e.index,e.howMany)}}_updateAttrs(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const n=Array.from(e.attributes).map(t=>t.name),r=t.getAttributeKeys();for(const n of r)e.setAttribute(n,t.getAttribute(n));for(const r of n)t.hasAttribute(r)||e.removeAttribute(r)}_updateChildren(t,e){const n=this.domConverter.mapViewToDom(t);if(!n)return;const r=e.inlineFillerPosition,o=this.domConverter.mapViewToDom(t).childNodes,i=Array.from(this.domConverter.viewChildrenToDom(t,n.ownerDocument,{bind:!0,inlineFillerPosition:r}));r&&r.parent===t&&No(n.ownerDocument,i,r.offset);const s=this._diffNodeLists(o,i);let a=0;const c=new Set;for(const t of s)"insert"===t?(Eo(n,a,i[a]),a++):"delete"===t?(c.add(o[a]),So(o[a])):(this._markDescendantTextToSync(this.domConverter.domToView(i[a])),a++);for(const t of c)t.parentNode||this.domConverter.unbindDomElement(t)}_diffNodeLists(t,e){return To(t,e,function(t,e,n){if(e===n)return!0;if(Po(e)&&Po(n))return e.data===n.data;if(Co(e,t)&&Co(n,t))return!0;return!1}.bind(null,this.domConverter.blockFiller))}_findReplaceActions(t,e,n){if(-1===t.indexOf("insert")||-1===t.indexOf("delete"))return t;let r=[],o=[],i=[];const s={equal:0,insert:0,delete:0};for(const a of t)"insert"===a?i.push(n[s.equal+s.insert]):"delete"===a?o.push(e[s.equal+s.delete]):((r=r.concat(To(o,i,Mo).map(t=>"equal"===t?"replace":t))).push("equal"),o=[],i=[]),s[a]++;return r.concat(To(o,i,Mo).map(t=>"equal"===t?"replace":t))}_markDescendantTextToSync(t){if(t)if(t.is("text"))this.markedTexts.add(t);else if(t.is("element"))for(const e of t.getChildren())this._markDescendantTextToSync(e)}_updateSelection(){if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const t=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&t&&(this.selection.isFake?this._updateFakeSelection(t):(this._removeFakeSelection(),this._updateDomSelection(t)))}_updateFakeSelection(t){const e=t.ownerDocument;let n=this._fakeSelectionContainer;n||(this._fakeSelectionContainer=n=e.createElement("div"),Object.assign(n.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),n.appendChild(e.createTextNode(" "))),n.parentElement||t.appendChild(n),n.firstChild.data=this.selection.fakeSelectionLabel||" ";const r=e.getSelection(),o=e.createRange();r.removeAllRanges(),o.selectNodeContents(n),r.addRange(o),this.domConverter.bindFakeSelection(n,this.selection)}_updateDomSelection(t){const e=t.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(e))return;const n=this.domConverter.viewPositionToDom(this.selection.anchor),r=this.domConverter.viewPositionToDom(this.selection.focus);t.focus(),e.collapse(n.parent,n.offset),e.extend(r.parent,r.offset)}_domSelectionNeedsUpdate(t){if(!this.domConverter.isDomSelectionCorrect(t))return!0;const e=t&&this.domConverter.domSelectionToView(t);return(!e||!this.selection.isEqual(e))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(e))}_removeDomSelection(){for(const t of this.domDocuments){if(t.getSelection().rangeCount){const e=t.activeElement,n=this.domConverter.mapDomToView(e);e&&n&&t.getSelection().removeAllRanges()}}}_removeFakeSelection(){const t=this._fakeSelectionContainer;t&&t.remove()}_updateFocus(){if(this.isFocused){const t=this.selection.editableElement;t&&this.domConverter.focus(t)}}}function No(t,e,n){const r=e instanceof Array?e:e.childNodes,o=r[n];if(Po(o))return o.data=vo+o.data,o;{const o=t.createTextNode(vo);return Array.isArray(e)?r.splice(n,0,o):Eo(e,n,o),o}}function Mo(t,e){return Oo(t)&&Oo(e)&&!Po(t)&&!Po(e)&&t.tagName.toLowerCase()===e.tagName.toLowerCase()}P(Fo,yr);var Vo={window:window,document:document};function Bo(t){let e=0;for(;t.previousSibling;)t=t.previousSibling,e++;return e}function Lo(t){const e=[];for(;t&&t.nodeType!=Node.DOCUMENT_NODE;)e.unshift(t),t=t.parentNode;return e}var zo=function(t){return!!t&&1===t.nodeType&&s(t)&&!f(t)};class qo{constructor(t={}){this.blockFiller=t.blockFiller||go,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(t,e){this._fakeSelectionMapping.set(t,new Vr(e))}fakeSelectionToView(t){return this._fakeSelectionMapping.get(t)}bindElements(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}unbindDomElement(t){const e=this._domToViewMapping.get(t);if(e){this._domToViewMapping.delete(t),this._viewToDomMapping.delete(e);for(const e of Array.from(t.childNodes))this.unbindDomElement(e)}}bindDocumentFragments(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}viewToDom(t,e,n={}){if(t.is("text")){const n=this._processDataFromViewText(t);return e.createTextNode(n)}{if(this.mapViewToDom(t))return this.mapViewToDom(t);let r;if(t.is("documentFragment"))r=e.createDocumentFragment(),n.bind&&this.bindDocumentFragments(r,t);else{if(t.is("uiElement"))return r=t.render(e),n.bind&&this.bindElements(r,t),r;r=e.createElement(t.name),n.bind&&this.bindElements(r,t);for(const e of t.getAttributeKeys())r.setAttribute(e,t.getAttribute(e))}if(n.withChildren||void 0===n.withChildren)for(const o of this.viewChildrenToDom(t,e,n))r.appendChild(o);return r}}*viewChildrenToDom(t,e,n={}){const r=t.getFillerOffset&&t.getFillerOffset();let o=0;for(const i of t.getChildren())r===o&&(yield this.blockFiller(e)),yield this.viewToDom(i,e,n),o++;r===o&&(yield this.blockFiller(e))}viewRangeToDom(t){const e=this.viewPositionToDom(t.start),n=this.viewPositionToDom(t.end),r=document.createRange();return r.setStart(e.parent,e.offset),r.setEnd(n.parent,n.offset),r}viewPositionToDom(t){const e=t.parent;if(e.is("text")){const n=this.findCorrespondingDomText(e);if(!n)return null;let r=t.offset;return _o(n)&&(r+=wo),{parent:n,offset:r}}{let n,r,o;if(0===t.offset){if(!(n=this.mapViewToDom(e)))return null;o=n.childNodes[0]}else{const e=t.nodeBefore;if(!(r=e.is("text")?this.findCorrespondingDomText(e):this.mapViewToDom(t.nodeBefore)))return null;n=r.parentNode,o=r.nextSibling}if(Po(o)&&_o(o))return{parent:o,offset:wo};return{parent:n,offset:r?Bo(r)+1:0}}}domToView(t,e={}){if(Co(t,this.blockFiller))return null;const n=this.getParentUIElement(t,this._domToViewMapping);if(n)return n;if(Po(t)){if(ko(t))return null;{const e=this._processDataFromDomText(t);return""===e?null:new On(e)}}if(this.isComment(t))return null;{if(this.mapDomToView(t))return this.mapDomToView(t);let n;if(this.isDocumentFragment(t))n=new oo,e.bind&&this.bindDocumentFragments(t,n);else{const r=e.keepOriginalCase?t.tagName:t.tagName.toLowerCase();n=new Mn(r),e.bind&&this.bindElements(t,n);const o=t.attributes;for(let t=o.length-1;t>=0;t--)n._setAttribute(o[t].name,o[t].value)}if(e.withChildren||void 0===e.withChildren)for(const r of this.domChildrenToView(t,e))n._appendChild(r);return n}}*domChildrenToView(t,e={}){for(let n=0;n{const{scrollLeft:e,scrollTop:n}=t;r.push([e,n])}),e.focus(),Ho(e,t=>{const[e,n]=r.shift();t.scrollLeft=e,t.scrollTop=n}),Vo.window.scrollTo(t,n)}}isElement(t){return t&&t.nodeType==Node.ELEMENT_NODE}isDocumentFragment(t){return t&&t.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isComment(t){return t&&t.nodeType==Node.COMMENT_NODE}isDomSelectionBackward(t){if(t.isCollapsed)return!1;const e=document.createRange();e.setStart(t.anchorNode,t.anchorOffset),e.setEnd(t.focusNode,t.focusOffset);const n=e.collapsed;return e.detach(),n}getParentUIElement(t){const e=Lo(t);for(e.pop();e.length;){const t=e.pop(),n=this._domToViewMapping.get(t);if(n&&n.is("uiElement"))return n}return null}isDomSelectionCorrect(t){return this._isDomSelectionPositionCorrect(t.anchorNode,t.anchorOffset)&&this._isDomSelectionPositionCorrect(t.focusNode,t.focusOffset)}_isDomSelectionPositionCorrect(t,e){if(Po(t)&&_o(t)&&ethis.preElements.includes(t.name)))return e;if(" "==e.charAt(0)){const n=this._getTouchingViewTextNode(t,!1);!(n&&this._nodeEndsWithSpace(n))&&n||(e=" "+e.substr(1))}if(" "==e.charAt(e.length-1)){this._getTouchingViewTextNode(t,!0)||(e=e.substr(0,e.length-1)+" ")}return e.replace(/ {2}/g,"  ")}_nodeEndsWithSpace(t){if(t.getAncestors().some(t=>this.preElements.includes(t.name)))return!1;const e=this._processDataFromViewText(t);return" "==e.charAt(e.length-1)}_processDataFromDomText(t){let e=t.data;if(jo(t,this.preElements))return yo(t);e=e.replace(/[ \n\t\r]{1,}/g," ");const n=this._getTouchingInlineDomNode(t,!1),r=this._getTouchingInlineDomNode(t,!0),o=this._checkShouldLeftTrimDomText(n),i=this._checkShouldRightTrimDomText(t,r);return o&&(e=e.replace(/^ /,"")),i&&(e=e.replace(/ $/,"")),e=(e=yo(new Text(e))).replace(/ \u00A0/g," "),o&&(e=e.replace(/^\u00A0/," ")),Po(r)&&" "!=r.data.charAt(0)||(e=e.replace(/\u00A0( *)$/," $1")),e}_checkShouldLeftTrimDomText(t){return!t||(!!zo(t)||/[^\S\u00A0]/.test(t.data.charAt(t.data.length-1)))}_checkShouldRightTrimDomText(t,e){return!e&&!_o(t)}_getTouchingViewTextNode(t,e){const n=new Dr({startPosition:e?Ir.createAfter(t):Ir.createBefore(t),direction:e?"forward":"backward"});for(const t of n){if(t.item.is("containerElement"))return null;if(t.item.is("br"))return null;if(t.item.is("textProxy"))return t.item}return null}_getTouchingInlineDomNode(t,e){if(!t.parentNode)return null;const n=e?"nextNode":"previousNode",r=t.ownerDocument,o=Lo(t)[0],i=r.createTreeWalker(o,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,{acceptNode:t=>Po(t)?NodeFilter.FILTER_ACCEPT:"BR"==t.tagName?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});i.currentNode=t;const s=i[n]();if(null!==s){const e=function(t,e){const n=Lo(t),r=Lo(e);let o=0;for(;n[o]==r[o]&&n[o];)o++;return 0===o?null:n[o-1]}(t,s);if(e&&!jo(t,this.blockElements,e)&&!jo(s,this.blockElements,e))return s}return null}}function jo(t,e,n){let r=Lo(t);return n&&(r=r.slice(r.indexOf(n)+1)),r.some(t=>t.tagName&&e.includes(t.tagName.toLowerCase()))}function Ho(t,e){for(;t&&t!=Vo.document;)e(t),t=t.parentNode}function $o(t){const e=Object.prototype.toString.apply(t);return"[object Window]"==e||"[object global]"==e}var Uo=br({},y,{listenTo(t,...e){if(Oo(t)||$o(t)){const n=this._getProxyEmitter(t)||new Wo(t);n.attach(...e),t=n}y.listenTo.call(this,t,...e)},stopListening(t,e,n){if(Oo(t)||$o(t)){const e=this._getProxyEmitter(t);if(!e)return;t=e}y.stopListening.call(this,t,e,n),t instanceof Wo&&t.detach(e)},_getProxyEmitter(t){return function(t,e){return t[_]&&t[_][e]?t[_][e].emitter:null}(this,Go(t))}});class Wo{constructor(t){x(this,Go(t)),this._domNode=t}}function Go(t){return t["data-ck-expando"]||(t["data-ck-expando"]=w())}br(Wo.prototype,y,{attach(t,e,n={}){if(this._domListeners&&this._domListeners[t])return;const r=this._createDomListener(t,!!n.useCapture);this._domNode.addEventListener(t,r,!!n.useCapture),this._domListeners||(this._domListeners={}),this._domListeners[t]=r},detach(t){let e;!this._domListeners[t]||(e=this._events[t])&&e.callbacks.length||this._domListeners[t].removeListener()},_createDomListener(t,e){const n=e=>{this.fire(t,e)};return n.removeListener=(()=>{this._domNode.removeEventListener(t,n,e),delete this._domListeners[t]}),n}});class Ko{constructor(t){this.view=t,this.document=t.document,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}}P(Ko,Uo);var Jo="__lodash_hash_undefined__";var Zo=function(t){return this.__data__.set(t,Jo),this};var Qo=function(t){return this.__data__.has(t)};function Yo(t){var e=-1,n=t?t.length:0;for(this.__data__=new Tt;++ea))return!1;var l=i.get(t);if(l)return l==e;var u=-1,d=!0,h=o&ei?new Xo:void 0;for(i.set(t,e);++u{this.listenTo(t,e,(t,e)=>{this.isEnabled&&this.onDomEvent(e)},{useCapture:this.useCapture})})}fire(t,e,n){this.isEnabled&&this.document.fire(t,new Fi(this.view,e,n))}}class Mi extends Ni{constructor(t){super(t),this.domEventType=["keydown","keyup"]}onDomEvent(t){this.fire(t.type,t,{keyCode:t.keyCode,altKey:t.altKey,ctrlKey:t.ctrlKey||t.metaKey,shiftKey:t.shiftKey,get keystroke(){return Yr(this)}})}}var Vi=Date.now,Bi="Expected a function",Li=Math.max,zi=Math.min;var qi=function(t,e,n){var r,o,i,s,a,c=0,l=0,u=!1,d=!1,h=!0;if("function"!=typeof t)throw new TypeError(Bi);function f(e){var n=r,i=o;return r=o=void 0,l=e,s=t.apply(i,n)}function p(t){var n=t-c;return!c||n>=e||n<0||d&&t-l>=i}function m(){var t=Vi();if(p(t))return g(t);a=setTimeout(m,function(t){var n=e-(t-c);return d?zi(n,i-(t-l)):n}(t))}function g(t){return clearTimeout(a),a=void 0,h&&r?f(t):(r=o=void 0,s)}function b(){var t=Vi(),n=p(t);if(r=arguments,o=this,c=t,n){if(void 0===a)return function(t){return l=t,a=setTimeout(m,e),u?f(t):s}(c);if(d)return clearTimeout(a),a=setTimeout(m,e),f(c)}return void 0===a&&(a=setTimeout(m,e)),s}return e=Yn(e)||0,$(n)&&(u=!!n.leading,i=(d="maxWait"in n)?Li(Yn(n.maxWait)||0,e):i,h="trailing"in n?!!n.trailing:h),b.cancel=function(){void 0!==a&&clearTimeout(a),c=l=0,r=o=a=void 0},b.flush=function(){return void 0===a?s:g(Vi())},b};class ji extends Ko{constructor(t){super(t),this._fireSelectionChangeDoneDebounced=qi(t=>this.document.fire("selectionChangeDone",t),200)}observe(){const t=this.document;t.on("keydown",(e,n)=>{t.selection.isFake&&function(t){return t==Qr.arrowright||t==Qr.arrowleft||t==Qr.arrowup||t==Qr.arrowdown}(n.keyCode)&&this.isEnabled&&(n.preventDefault(),this._handleSelectionMove(n.keyCode))},{priority:"lowest"})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(t){const e=this.document.selection,n=new Vr(e.getRanges(),{backward:e.isBackward,fake:!1});t!=Qr.arrowleft&&t!=Qr.arrowup||n.setTo(n.getFirstPosition()),t!=Qr.arrowright&&t!=Qr.arrowdown||n.setTo(n.getLastPosition());const r={oldSelection:e,newSelection:n,domSelection:null};this.document.fire("selectionChange",r),this._fireSelectionChangeDoneDebounced(r)}}var Hi=n(3);class $i extends Ko{constructor(t){super(t),this.mutationObserver=t.getObserver(Ii),this.selection=this.document.selection,this.domConverter=t.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=qi(t=>this.document.fire("selectionChangeDone",t),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._loopbackCounter=0}observe(t){const e=t.ownerDocument;this._documents.has(e)||(this.listenTo(e,"selectionchange",()=>{this._handleSelectionChange(e)}),this._documents.add(e))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(t){if(!this.isEnabled||!this.document.isFocused&&!this.document.isReadOnly)return;this.mutationObserver.flush();const e=t.defaultView.getSelection(),n=this.domConverter.domSelectionToView(e);if(!this.selection.isEqual(n)||!this.domConverter.isDomSelectionCorrect(e))if(++this._loopbackCounter>60)Hi.a.warn("selectionchange-infinite-loop: Selection change observer detected an infinite rendering loop.");else if(this.selection.isSimilar(n))this.view.render();else{const t={oldSelection:this.selection,newSelection:n,domSelection:e};this.document.fire("selectionChange",t),this._fireSelectionChangeDoneDebounced(t)}}_clearInfiniteLoop(){this._loopbackCounter=0}}class Ui extends Ni{constructor(t){super(t),this.domEventType=["focus","blur"],this.useCapture=!0;const e=this.document;e.on("focus",()=>{e.isFocused=!0,this._renderTimeoutId=setTimeout(()=>t.render(),50)}),e.on("blur",(n,r)=>{const o=e.selection.editableElement;null!==o&&o!==r.target||(e.isFocused=!1,t.render())})}onDomEvent(t){this.fire(t.type,t)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class Wi extends Ni{constructor(t){super(t),this.domEventType=["compositionstart","compositionupdate","compositionend"];const e=this.document;e.on("compositionstart",()=>{e.isComposing=!0}),e.on("compositionend",()=>{e.isComposing=!1})}onDomEvent(t){this.fire(t.type,t)}}function Gi(t){return"[object Range]"==Object.prototype.toString.apply(t)}function Ki(t){const e=t.ownerDocument.defaultView.getComputedStyle(t);return{top:parseInt(e.borderTopWidth,10),right:parseInt(e.borderRightWidth,10),bottom:parseInt(e.borderBottomWidth,10),left:parseInt(e.borderLeftWidth,10)}}class Ji{constructor(t){const e=Gi(t);if(Object.defineProperty(this,"_source",{value:t._source||t,writable:!0,enumerable:!1}),zo(t)||e){const n=e?t.startContainer:t;n.ownerDocument&&n.ownerDocument.body.contains(n)||Hi.a.warn("rect-source-not-in-dom: The source of this rect does not belong to any rendered DOM tree.",{source:t}),Qi(this,e?Ji.getDomRangeRects(t)[0]:t.getBoundingClientRect())}else if($o(t)){const{innerWidth:e,innerHeight:n}=t;Qi(this,{top:0,right:e,bottom:n,left:0,width:e,height:n})}else Qi(this,t)}clone(){return new Ji(this)}moveTo(t,e){return this.top=e,this.right=t+this.width,this.bottom=e+this.height,this.left=t,this}moveBy(t,e){return this.top+=e,this.right+=t,this.left+=t,this.bottom+=e,this}getIntersection(t){const e={top:Math.max(this.top,t.top),right:Math.min(this.right,t.right),bottom:Math.min(this.bottom,t.bottom),left:Math.max(this.left,t.left)};return e.width=e.right-e.left,e.height=e.bottom-e.top,e.width<0||e.height<0?null:new Ji(e)}getIntersectionArea(t){const e=this.getIntersection(t);return e?e.getArea():0}getArea(){return this.width*this.height}getVisible(){const t=this._source;let e=this.clone();if(!Yi(t)){let n=t.parentNode||t.commonAncestorContainer;for(;n&&!Yi(n);){const t=new Ji(n),r=e.getIntersection(t);if(!r)return null;r.getArea()cs(t,r));const s=cs(t,r);if(ts(r,s,e),r.parent!=r){if(o=r.frameElement,r=r.parent,!o)return}else r=null}}function ts(t,e,n){const r=e.clone().moveBy(0,n),o=e.clone().moveBy(0,-n),i=new Ji(t).excludeScrollbarsAndBorders();if(![o,r].every(t=>i.contains(t))){let{scrollX:s,scrollY:a}=t;rs(o,i)?a-=i.top-e.top+n:ns(r,i)&&(a+=e.bottom-i.bottom+n),os(e,i)?s-=i.left-e.left+n:is(e,i)&&(s+=e.right-i.right+n),t.scrollTo(s,a)}}function es(t,e){const n=ss(t);let r,o;for(;t!=n.document.body;)o=e(),(r=new Ji(t).excludeScrollbarsAndBorders()).contains(o)||(rs(o,r)?t.scrollTop-=r.top-o.top:ns(o,r)&&(t.scrollTop+=o.bottom-r.bottom),os(o,r)?t.scrollLeft-=r.left-o.left:is(o,r)&&(t.scrollLeft+=o.right-r.right)),t=t.parentNode}function ns(t,e){return t.bottom>e.bottom}function rs(t,e){return t.tope.right}function ss(t){return Gi(t)?t.startContainer.ownerDocument.defaultView:t.ownerDocument.defaultView}function as(t){if(Gi(t)){let e=t.commonAncestorContainer;return Po(e)&&(e=e.parentNode),e}return t.parentNode}function cs(t,e){const n=ss(t),r=new Ji(t);if(n===e)return r;{let t=n;for(;t!=e;){const e=t.frameElement,n=new Ji(e).excludeScrollbarsAndBorders();r.moveBy(n.left,n.top),t=t.parent}}return r}Object.assign({},{scrollViewportToShowTarget:Xi,scrollAncestorsToShowTarget:function(t){es(as(t),()=>new Ji(t))}});class ls{constructor(){this.document=new zr,this.domConverter=new qo,this._renderer=new Fo(this.domConverter,this.document.selection),this._renderer.bind("isFocused").to(this.document),this.domRoots=new Map,this._observers=new Map,this._ongoingChange=!1,this._renderingInProgress=!1,this._postFixersInProgress=!1,this._writer=new io(this.document),this.addObserver(Ii),this.addObserver($i),this.addObserver(Ui),this.addObserver(Mi),this.addObserver(ji),this.addObserver(Wi),function(t){t.document.on("keydown",Ao)}(this),no(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged")})}attachDomRoot(t,e="main"){const n=this.document.getRoot(e);n._name=t.tagName.toLowerCase(),this.domRoots.set(e,t),this.domConverter.bindElements(t,n),this._renderer.markToSync("children",n),this._renderer.domDocuments.add(t.ownerDocument),n.on("change:children",(t,e)=>this._renderer.markToSync("children",e)),n.on("change:attributes",(t,e)=>this._renderer.markToSync("attributes",e)),n.on("change:text",(t,e)=>this._renderer.markToSync("text",e));for(const n of this._observers.values())n.observe(t,e)}getDomRoot(t="main"){return this.domRoots.get(t)}addObserver(t){let e=this._observers.get(t);if(e)return e;e=new t(this),this._observers.set(t,e);for(const[t,n]of this.domRoots)e.observe(n,t);return e.enable(),e}getObserver(t){return this._observers.get(t)}disableObservers(){for(const t of this._observers.values())t.disable()}enableObservers(){for(const t of this._observers.values())t.enable()}scrollToTheSelection(){const t=this.document.selection.getFirstRange();t&&Xi({target:this.domConverter.viewRangeToDom(t),viewportOffset:20})}focus(){if(!this.document.isFocused){const t=this.document.selection.editableElement;t?(this.domConverter.focus(t),this.render()):Hi.a.warn("view-focus-no-selection: There is no selection in any editable to focus.")}}change(t){if(this._renderingInProgress||this._postFixersInProgress)throw new m.b("cannot-change-view-tree: Attempting to make changes to the view when it is in incorrect state: rendering or post-fixers are in progress. This may cause some unexpected behaviour and inconsistency between the DOM and the view.");this._ongoingChange?t(this._writer):(this._ongoingChange=!0,t(this._writer),this._ongoingChange=!1,this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render"))}render(){this.change(()=>{})}destroy(){for(const t of this._observers.values())t.destroy();this.stopListening()}_render(){this._renderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this._renderingInProgress=!1}}function us(t){return f(t)?Dn(t):new Map(t)}P(ls,yr);class ds{constructor(t){this.parent=null,this._attrs=us(t)}get index(){let t;if(!this.parent)return null;if(null===(t=this.parent.getChildIndex(this)))throw new m.b("model-node-not-found-in-parent: The node's parent does not contain this node.");return t}get startOffset(){let t;if(!this.parent)return null;if(null===(t=this.parent.getChildStartOffset(this)))throw new m.b("model-node-not-found-in-parent: The node's parent does not contain this node.");return t}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const t=this.index;return null!==t&&this.parent.getChild(t+1)||null}get previousSibling(){const t=this.index;return null!==t&&this.parent.getChild(t-1)||null}get root(){let t=this;for(;t.parent;)t=t.parent;return t}get document(){return this.root==this?null:this.root.document||null}getPath(){const t=[];let e=this;for(;e.parent;)t.unshift(e.startOffset),e=e.parent;return t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let n=t.includeSelf?this:this.parent;for(;n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}getCommonAncestor(t,e={}){const n=this.getAncestors(e),r=t.getAncestors(e);let o=0;for(;n[o]==r[o]&&n[o];)o++;return 0===o?null:n[o-1]}isBefore(t){if(this==t)return!1;if(this.root!==t.root)return!1;const e=this.getPath(),n=t.getPath(),r=Sn(e,n);switch(r){case"prefix":return!0;case"extension":return!1;default:return e[r]t.offsetSize)throw new m.b("model-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.");if(n<0||e+n>t.offsetSize)throw new m.b("model-textproxy-wrong-length: Given length value is incorrect.");this.data=t.data.substring(e,e+n),this.offsetInText=e}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(t){return"textProxy"==t}getPath(){const t=this.textNode.getPath();return t.length>0&&(t[t.length-1]+=this.offsetInText),t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let n=t.includeSelf?this:this.parent;for(;n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}hasAttribute(t){return this.textNode.hasAttribute(t)}getAttribute(t){return this.textNode.getAttribute(t)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}class ps{constructor(t){this._nodes=[],t&&this._insertNodes(0,t)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((t,e)=>t+e.offsetSize,0)}getNode(t){return this._nodes[t]||null}getNodeIndex(t){const e=this._nodes.indexOf(t);return-1==e?null:e}getNodeStartOffset(t){const e=this.getNodeIndex(t);return null===e?null:this._nodes.slice(0,e).reduce((t,e)=>t+e.offsetSize,0)}indexToOffset(t){if(t==this._nodes.length)return this.maxOffset;const e=this._nodes[t];if(!e)throw new m.b("model-nodelist-index-out-of-bounds: Given index cannot be found in the node list.");return this.getNodeStartOffset(e)}offsetToIndex(t){let e=0;for(const n of this._nodes){if(t>=e&&tt.toJSON())}}class ms extends ds{constructor(t,e,n){super(e),this.name=t,this._children=new ps,n&&this._insertChild(0,n)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}is(t,e=null){return e?"element"==t&&e==this.name:"element"==t||t==this.name||super.is(t)}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}offsetToIndex(t){return this._children.offsetToIndex(t)}getNodeByPath(t){let e=this;for(const n of t)e=e.getChild(e.offsetToIndex(n));return e}toJSON(){const t=super.toJSON();if(t.name=this.name,this._children.length>0){t.children=[];for(const e of this._children)t.children.push(e.toJSON())}return t}_clone(t=!1){const e=t?Array.from(this._children).map(t=>t._clone(!0)):null;return new ms(this.name,this.getAttributes(),e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const n=function(t){if("string"==typeof t)return[new hs(t)];In(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new hs(t):t instanceof fs?new hs(t.data,t.getAttributes()):t)}(e);for(const t of n)null!==t.parent&&t._remove(),t.parent=this;this._children._insertNodes(t,n)}_removeChildren(t,e=1){const n=this._children._removeNodes(t,e);for(const t of n)t.parent=null;return n}static fromJSON(t){let e=null;if(t.children){e=[];for(const n of t.children)n.name?e.push(ms.fromJSON(n)):e.push(hs.fromJSON(n))}return new ms(t.name,t.attributes,e)}}class gs{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new m.b("model-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.");const e=t.direction||"forward";if("forward"!=e&&"backward"!=e)throw new m.b("model-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.",{direction:e});this.direction=e,this.boundaries=t.boundaries||null,t.startPosition?this.position=vs.createFromPosition(t.startPosition):this.position=vs.createFromPosition(this.boundaries["backward"==this.direction?"end":"start"]),this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}skip(t){let e,n,r,o;do{r=this.position,o=this._visitedParent,({done:e,value:n}=this.next())}while(!e&&t(n));e||(this.position=r,this._visitedParent=o)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const t=this.position,e=vs.createFromPosition(this.position),n=this._visitedParent;if(null===n.parent&&e.offset===n.maxOffset)return{done:!0};if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0};const r=e.textNode?e.textNode:e.nodeAfter;if(r instanceof ms)return this.shallow?e.offset++:(e.path.push(0),this._visitedParent=r),this.position=e,bs("elementStart",r,t,e,1);if(r instanceof hs){let o;if(this.singleCharacters)o=1;else{let t=r.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offsett&&(t=this.boundaries.start.offset),o=e.offset-t}const i=e.offset-r.startOffset,s=new fs(r,i-o,o);return e.offset-=o,this.position=e,bs("text",s,t,e,o)}return e.path.pop(),this.position=e,this._visitedParent=n.parent,bs("elementStart",n,t,e,1)}}function bs(t,e,n,r,o){return{done:!1,value:{type:t,item:e,previousPosition:n,nextPosition:r,length:o}}}var ws=function(t){var e=t?t.length:0;return e?t[e-1]:void 0};class vs{constructor(t,e){if(!t.is("element")&&!t.is("documentFragment"))throw new m.b("model-position-root-invalid: Position root invalid.");if(!(e instanceof Array)||0===e.length)throw new m.b("model-position-path-incorrect: Position path must be an array with at least one item.",{path:e});e=t.getPath().concat(e),t=t.root,this.root=t,this.path=e}get offset(){return ws(this.path)}set offset(t){this.path[this.path.length-1]=t}get parent(){let t=this.root;for(let e=0;en.path.length){if(e.offset!==r.maxOffset)return!1;e.path=e.path.slice(0,-1),r=r.parent,e.offset++}else{if(0!==n.offset)return!1;n.path=n.path.slice(0,-1)}}}_getTransformedByDeletion(t,e){const n=vs.createFromPosition(this);if(this.root!=t.root)return n;if("same"==Sn(t.getParentPath(),this.getParentPath())){if(t.offsetthis.offset)return null;n.offset-=e}}else if("prefix"==Sn(t.getParentPath(),this.getParentPath())){const r=t.path.length-1;if(t.offset<=this.path[r]){if(t.offset+e>this.path[r])return null;n.path[r]-=e}}return n}_getTransformedByInsertion(t,e,n){const r=vs.createFromPosition(this);if(this.root!=t.root)return r;if("same"==Sn(t.getParentPath(),this.getParentPath()))(t.offsete+1;){const e=r.maxOffset-n.offset;0!==e&&t.push(new _s(n,n.getShiftedBy(e))),n.path=n.path.slice(0,-1),n.offset++,r=r.parent}for(;n.path.length<=this.end.path.length;){const e=this.end.path[n.path.length-1],r=e-n.offset;0!==r&&t.push(new _s(n,n.getShiftedBy(r))),n.offset=e,n.path.push(0)}return t}getWalker(t={}){return t.boundaries=this,new gs(t)}*getItems(t={}){t.boundaries=this,t.ignoreElementEnd=!0;const e=new gs(t);for(const t of e)yield t.item}*getPositions(t={}){t.boundaries=this;const e=new gs(t);yield e.position;for(const t of e)yield t.nextPosition}getTransformedByDelta(t){const e=[_s.createFromRange(this)],n=new Set(["insert","move","remove","reinsert"]);for(const r of t.operations)if(n.has(r.type))for(let n=0;n0?new this(n,r):new this(r,n)}static createFromParentsAndOffsets(t,e,n,r){return new this(vs.createFromParentAndOffset(t,e),vs.createFromParentAndOffset(n,r))}static createFromRange(t){return new this(t.start,t.end)}static createIn(t){return this.createFromParentsAndOffsets(t,0,t,t.maxOffset)}static createOn(t){return this.createFromPositionAndShift(vs.createBefore(t),t.offsetSize)}static createCollapsedAt(t,e){const n=vs.createAt(t,e),r=vs.createFromPosition(n);return new _s(n,r)}static createFromRanges(t){if(0===t.length)throw new m.b("range-create-from-ranges-empty-array: At least one range has to be passed.");if(1==t.length)return this.createFromRange(t[0]);const e=t[0];t.sort((t,e)=>t.start.isAfter(e.start)?1:-1);const n=t.indexOf(e),r=new this(e.start,e.end);for(let e=n-1;e>=0&&t[e].end.isEqual(r.start);e++)r.start=vs.createFromPosition(t[e].start);for(let e=n+1;e{if(e.viewPosition)return;const n=this._modelToViewMapping.get(e.modelPosition.parent);e.viewPosition=this._findPositionIn(n,e.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(t,e)=>{if(e.modelPosition)return;let n=e.viewPosition.parent,r=this._viewToModelMapping.get(n);for(;!r;)n=n.parent,r=this._viewToModelMapping.get(n);const o=this._toModelOffset(e.viewPosition.parent,e.viewPosition.offset,n);e.modelPosition=vs.createFromParentAndOffset(r,o)},{priority:"low"})}bindElements(t,e){this._modelToViewMapping.set(t,e),this._viewToModelMapping.set(e,t)}unbindViewElement(t){const e=this.toModelElement(t);this._viewToModelMapping.delete(t),this._modelToViewMapping.get(e)==t&&this._modelToViewMapping.delete(e)}unbindModelElement(t){const e=this.toViewElement(t);this._modelToViewMapping.delete(t),this._viewToModelMapping.get(e)==t&&this._viewToModelMapping.delete(e)}bindElementToMarker(t,e){const n=this._markerNameToElements.get(e)||new Set;n.add(t),this._markerNameToElements.set(e,n)}unbindElementsFromMarkerName(t){this._markerNameToElements.delete(t)}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map}toModelElement(t){return this._viewToModelMapping.get(t)}toViewElement(t){return this._modelToViewMapping.get(t)}toModelRange(t){return new _s(this.toModelPosition(t.start),this.toModelPosition(t.end))}toViewRange(t){return new Fr(this.toViewPosition(t.start),this.toViewPosition(t.end))}toModelPosition(t){const e={viewPosition:t,mapper:this};return this.fire("viewToModelPosition",e),e.modelPosition}toViewPosition(t,e={isPhantom:!1}){const n={modelPosition:t,mapper:this,isPhantom:e.isPhantom};return this.fire("modelToViewPosition",n),n.viewPosition}markerNameToElements(t){const e=this._markerNameToElements.get(t);if(!e)return null;const n=new Set;for(const t of e)if(t.is("attributeElement"))for(const e of t.getElementsWithSameId())n.add(e);else n.add(t);return n}registerViewToModelLength(t,e){this._viewToModelLengthCallbacks.set(t,e)}_toModelOffset(t,e,n){if(n!=t){return this._toModelOffset(t.parent,t.index,n)+this._toModelOffset(t,e,t)}if(t.is("text"))return e;let r=0;for(let n=0;n1?e[0]+":"+e[1]:e[0]}class Cs{constructor(t={}){this.conversionApi=br({dispatcher:this},t)}convertChanges(t,e){for(const n of t.getMarkersToRemove())this.convertMarkerRemove(n.name,n.range,e);for(const n of t.getChanges())"insert"==n.type?this.convertInsert(_s.createFromPositionAndShift(n.position,n.length),e):"remove"==n.type?this.convertRemove(n.position,n.length,n.name,e):this.convertAttribute(n.range,n.attributeKey,n.attributeOldValue,n.attributeNewValue,e);for(const n of t.getMarkersToAdd())this.convertMarkerAdd(n.name,n.range,e)}convertInsert(t,e){this.conversionApi.writer=e,this.conversionApi.consumable=this._createInsertConsumable(t);for(const e of t){const t=e.item,n={item:t,range:_s.createFromPositionAndShift(e.previousPosition,e.length)};this._testAndFire("insert",n);for(const e of t.getAttributeKeys())n.attributeKey=e,n.attributeOldValue=null,n.attributeNewValue=t.getAttribute(e),this._testAndFire(`attribute:${e}`,n)}this._clearConversionApi()}convertRemove(t,e,n,r){this.conversionApi.writer=r,this.fire("remove:"+n,{position:t,length:e},this.conversionApi),this._clearConversionApi()}convertAttribute(t,e,n,r,o){this.conversionApi.writer=o,this.conversionApi.consumable=this._createConsumableForRange(t,`attribute:${e}`);for(const o of t){const t={item:o.item,range:_s.createFromPositionAndShift(o.previousPosition,o.length),attributeKey:e,attributeOldValue:n,attributeNewValue:r};this._testAndFire(`attribute:${e}`,t)}this._clearConversionApi()}convertSelection(t,e,n){const r=Array.from(e.getMarkersAtPosition(t.getFirstPosition()));if(this.conversionApi.writer=n,this.conversionApi.consumable=this._createSelectionConsumable(t,r),this.fire("selection",{selection:t},this.conversionApi),t.isCollapsed){for(const e of r){const n=e.getRange();if(!As(t.getFirstPosition(),e,this.conversionApi.mapper))continue;const r={item:t,markerName:e.name,markerRange:n};this.conversionApi.consumable.test(t,"addMarker:"+e.name)&&this.fire("addMarker:"+e.name,r,this.conversionApi)}for(const e of t.getAttributeKeys()){const n={item:t,range:t.getFirstRange(),attributeKey:e,attributeOldValue:null,attributeNewValue:t.getAttribute(e)};this.conversionApi.consumable.test(t,"attribute:"+n.attributeKey)&&this.fire("attribute:"+n.attributeKey,n,this.conversionApi)}this._clearConversionApi()}}convertMarkerAdd(t,e,n){if(!e.root.document||"$graveyard"==e.root.rootName)return;this.conversionApi.writer=n;const r="addMarker:"+t;if(e.isCollapsed){const n=new ys;return n.add(e,r),this.conversionApi.consumable=n,void this.fire(r,{markerName:t,markerRange:e},this.conversionApi)}this.conversionApi.consumable=this._createConsumableForRange(e,r);for(const n of e.getItems()){if(!this.conversionApi.consumable.test(n,r))continue;const o={item:n,range:_s.createOn(n),markerName:t,markerRange:e};this.fire(r,o,this.conversionApi)}this._clearConversionApi()}convertMarkerRemove(t,e,n){e.root.document&&"$graveyard"!=e.root.rootName&&(this.conversionApi.writer=n,this.fire("removeMarker:"+t,{markerName:t,markerRange:e},this.conversionApi),this._clearConversionApi())}_createInsertConsumable(t){const e=new ys;for(const n of t){const t=n.item;e.add(t,"insert");for(const n of t.getAttributeKeys())e.add(t,"attribute:"+n)}return e}_createConsumableForRange(t,e){const n=new ys;for(const r of t.getItems())n.add(r,e);return n}_createSelectionConsumable(t,e){const n=new ys;n.add(t,"selection");for(const r of e)n.add(t,"addMarker:"+r.name);for(const e of t.getAttributeKeys())n.add(t,"attribute:"+e);return n}_testAndFire(t,e){if(!this.conversionApi.consumable.test(e.item,t))return;const n=e.item.name||"$text";this.fire(t+":"+n,e,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer,delete this.conversionApi.consumable}}function As(t,e,n){const r=e.getRange(),o=Array.from(t.getAncestors());return o.shift(),o.reverse(),!o.some(t=>{if(r.containsItem(t)){return!!n.toViewElement(t).getCustomProperty("addHighlight")}})}P(Cs,y);class Ts{constructor(t,e,n){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map,t&&this.setTo(t,e,n)}get anchor(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.end:t.start}return null}get focus(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.start:t.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(t){if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let n=!1;for(const r of t._ranges)if(e.isEqual(r)){n=!0;break}if(!n)return!1}return!0}*getRanges(){for(const t of this._ranges)yield _s.createFromRange(t)}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?_s.createFromRange(t):null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?_s.createFromRange(t):null}getFirstPosition(){const t=this.getFirstRange();return t?vs.createFromPosition(t.start):null}getLastPosition(){const t=this.getLastRange();return t?vs.createFromPosition(t.end):null}setTo(t,e,n){if(null===t)this._setRanges([]);else if(t instanceof Ts)this._setRanges(t.getRanges(),t.isBackward);else if(t&&"function"==typeof t.getRanges)this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof _s)this._setRanges([t],!!e&&!!e.backward);else if(t instanceof vs)this._setRanges([new _s(t)]);else if(t instanceof ds){const r=!!n&&!!n.backward;let o;if("in"==e)o=_s.createIn(t);else if("on"==e)o=_s.createOn(t);else{if(void 0===e)throw new m.b("model-selection-setTo-required-second-parameter: selection.setTo requires the second parameter when the first parameter is a node.");o=_s.createCollapsedAt(t,e)}this._setRanges([o],r)}else{if(!In(t))throw new m.b("model-selection-setTo-not-selectable: Cannot set selection to given place.");this._setRanges(t,e&&!!e.backward)}}_setRanges(t,e=!1){const n=(t=Array.from(t)).some(t=>{if(!(t instanceof _s))throw new m.b("model-selection-added-not-range: Trying to add an object that is not an instance of Range.");return this._ranges.every(e=>!e.isEqual(t))});if(t.length!==this._ranges.length||n){this._removeAllRanges();for(const e of t)this._pushRange(e);this._lastRangeBackward=!!e,this.fire("change:range",{directChange:!0})}}setFocus(t,e){if(null===this.anchor)throw new m.b("model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.");const n=vs.createAt(t,e);if("same"==n.compareWith(this.focus))return;const r=this.anchor;this._ranges.length&&this._popRange(),"before"==n.compareWith(r)?(this._pushRange(new _s(n,r)),this._lastRangeBackward=!0):(this._pushRange(new _s(r,n)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(t){return this._attrs.get(t)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(t){return this._attrs.has(t)}removeAttribute(t){this.hasAttribute(t)&&(this._attrs.delete(t),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}setAttribute(t,e){this.getAttribute(t)!==e&&(this._attrs.set(t,e),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}getSelectedElement(){if(1!==this.rangeCount)return null;const t=this.getFirstRange(),e=t.start.nodeAfter,n=t.end.nodeBefore;return e instanceof ms&&e==n?e:null}*getSelectedBlocks(){const t=new WeakSet;for(const e of this.getRanges()){const n=Ss(e.start,t);n&&(yield n);for(const n of e.getWalker())"elementEnd"==n.type&&Es(n.item,t)&&(yield n.item);const r=Ss(e.end,t);r&&!e.end.isTouching(vs.createAt(r))&&(yield r)}}containsEntireContent(t=this.anchor.root){const e=vs.createAt(t),n=vs.createAt(t,"end");return e.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(t){this._checkRange(t),this._ranges.push(_s.createFromRange(t))}_checkRange(t){for(let e=0;e0;)this._popRange()}_popRange(){this._ranges.pop()}}function Es(t,e){return!e.has(t)&&(e.add(t),t.document.model.schema.isBlock(t)&&t.parent)}function Ss(t,e){const n=t.parent.getAncestors({parentFirst:!0,includeSelf:!0}),r=n.find(t=>Es(t,e));return n.forEach(t=>e.add(t)),r}P(Ts,y);class Ps extends _s{constructor(t,e){super(t,e),function(){const t=new Set(["insert","move","remove","reinsert"]);this.listenTo(this.root.document.model,"applyOperation",(e,n)=>{const r=n[0];r.isDocumentOperation&&t.has(r.type)&&function(t){const e=t.type,n=t.delta.batch;let r,o;"insert"==e?r=_s.createFromPositionAndShift(t.position,t.nodes.maxOffset):(r=_s.createFromPositionAndShift(t.getMovedRangeStart(),t.howMany),o=t.sourcePosition);const i=r.end.offset-r.start.offset;let s=r.start;"move"!=e&&"remove"!=e&&"reinsert"!=e||(s=s._getTransformedByInsertion(o,i));const a=this._getTransformedByDocumentChange(e,t.delta.type,s,i,o);"move"!=e&&"remove"!=e&&"reinsert"!=e||3!=a.length||(a[2]=r);const c=_s.createFromRanges(a),l=!c.isEqual(this),u=this.containsPosition(s),d=o&&(this.containsPosition(o)||this.start.isEqual(o)),h=u||d;if(l){const t=_s.createFromRange(this);this.start=c.start,this.end=c.end,this.fire("change:range",t,{type:e,batch:n,range:r,sourcePosition:o})}else h&&this.fire("change:content",_s.createFromRange(this),{type:e,batch:n,range:r,sourcePosition:o})}.call(this,r)},{priority:"low"})}.call(this)}detach(){this.stopListening()}}P(Ps,y);const Os="selection:";class Rs{constructor(t){this._selection=new Ds(t),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 _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()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(t){return this._selection.containsEntireContent(t)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(t){return this._selection.getAttribute(t)}hasAttribute(t){return this._selection.hasAttribute(t)}_setFocus(t,e){this._selection.setFocus(t,e)}_setTo(t,e,n){this._selection.setTo(t,e,n)}_setAttribute(t,e){this._selection.setAttribute(t,e)}_removeAttribute(t){this._selection.removeAttribute(t)}_getStoredAttributes(){return this._selection._getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(t){this._selection.restoreGravity(t)}static _getStoreAttributeKey(t){return Os+t}static _isStoreAttributeKey(t){return t.startsWith(Os)}}P(Rs,y);class Ds extends Ts{constructor(t){super(),this._model=t.model,this._document=t,this._attributePriority=new Map,this._fixGraveyardRangesData=[],this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this.on("change:range",()=>{for(const t of this.getRanges())if(!this._document._validateSelectionRange(t))throw new m.b("document-selection-wrong-position: Range from document selection starts or ends at incorrect position.",{range:t})}),this.listenTo(this._document,"change",(t,e)=>{this._updateAttributes(!1),function(t,e){const n=t.document.differ;for(const r of n.getChanges()){if("insert"!=r.type)continue;const n=r.position.parent,o=r.length===n.maxOffset;o&&t.enqueueChange(e,t=>{const e=Array.from(n.getAttributeKeys()).filter(t=>t.startsWith(Os));for(const r of e)t.removeAttribute(r,n)})}}(this._model,e)}),this.listenTo(this._model,"applyOperation",()=>{for(;this._fixGraveyardRangesData.length;){const{liveRange:t,sourcePosition:e}=this._fixGraveyardRangesData.shift();this._fixGraveyardSelection(t,e)}this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1}))},{priority:"lowest"})}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 t=0;t{this._hasChangedRange=!0,e.root==this._document.graveyard&&this._fixGraveyardRangesData.push({liveRange:e,sourcePosition:r.sourcePosition})}),e}_updateAttributes(t){const e=us(this._getSurroundingAttributes()),n=us(this.getAttributes());if(t)this._attributePriority=new Map,this._attrs=new Map;else for(const[t,e]of this._attributePriority)"low"==e&&(this._attrs.delete(t),this._attributePriority.delete(t));this._setAttributesTo(e);const r=[];for(const[t,e]of this.getAttributes())n.has(t)&&n.get(t)===e||r.push(t);for(const[t]of n)this.hasAttribute(t)||r.push(t);r.length>0&&this.fire("change:attribute",{attributeKeys:r,directChange:!1})}_setAttribute(t,e,n=!0){const r=n?"normal":"low";return("low"!=r||"normal"!=this._attributePriority.get(t))&&(super.getAttribute(t)!==e&&(this._attrs.set(t,e),this._attributePriority.set(t,r),!0))}_removeAttribute(t,e=!0){const n=e?"normal":"low";return("low"!=n||"normal"!=this._attributePriority.get(t))&&(this._attributePriority.set(t,n),!!super.hasAttribute(t)&&(this._attrs.delete(t),!0))}_setAttributesTo(t){const e=new Set;for(const[e,n]of this.getAttributes())t.get(e)!==n&&this._removeAttribute(e,!1);for(const[n,r]of t){this._setAttribute(n,r,!1)&&e.add(n)}return e}*_getStoredAttributes(){const t=this.getFirstPosition().parent;if(this.isCollapsed&&t.isEmpty)for(const e of t.getAttributeKeys())if(e.startsWith(Os)){yield[e.substr(Os.length),t.getAttribute(e)]}}_getSurroundingAttributes(){const t=this.getFirstPosition(),e=this._model.schema;let n=null;if(this.isCollapsed){const e=t.textNode?t.textNode:t.nodeBefore,r=t.textNode?t.textNode:t.nodeAfter;if(this.isGravityOverridden||(n=Is(e)),n||(n=Is(r)),!this.isGravityOverridden&&!n){let t=e;for(;t&&!n;)n=Is(t=t.previousSibling)}if(!n){let t=r;for(;t&&!n;)n=Is(t=t.nextSibling)}n||(n=this._getStoredAttributes())}else{const t=this.getFirstRange();for(const r of t){if(r.item.is("element")&&e.isObject(r.item))break;"text"==r.type&&null===n&&(n=r.item.getAttributes())}}return n}_fixGraveyardSelection(t,e){const n=vs.createFromPosition(e),r=this._model.schema.getNearestSelectionRange(n),o=this._ranges.indexOf(t);if(this._ranges.splice(o,1),t.detach(),r){const t=this._prepareRange(r);this._ranges.splice(o,0,t)}}}function Is(t){return t instanceof fs||t instanceof hs?t.getAttributes():null}var Fs=function(t){return Tn(t,!0,!0)};function Ns(t){return(t=Fs(t)).view=Bs(t.view,"container"),e=>{e.on("insert:"+t.model,function(t){return(e,n,r)=>{const o=t(n.item,r.writer);if(!o)return;if(!r.consumable.consume(n.item,"insert"))return;const i=r.mapper.toViewPosition(n.range.start);r.mapper.bindElements(n.item,o),r.writer.insert(i,o)}}(t.view),{priority:t.converterPriority||"normal"})}}function Ms(t){let e="attribute:"+((t=Fs(t)).model.key?t.model.key:t.model);if(t.model.name&&(e+=":"+t.model.name),t.model.values)for(const e of t.model.values)t.view[e]=Bs(t.view[e],"attribute");else t.view=Bs(t.view,"attribute");const n=Ls(t);return r=>{r.on(e,function(t){return(e,n,r)=>{const o=t(n.attributeOldValue,r.writer),i=t(n.attributeNewValue,r.writer);if(!o&&!i)return;if(!r.consumable.consume(n.item,e.name))return;const s=r.writer,a=s.document.selection;if(n.item instanceof Ts||n.item instanceof Rs)s.wrap(a.getFirstRange(),i);else{let t=r.mapper.toViewRange(n.range);null!==n.attributeOldValue&&o&&(t=s.unwrap(t,o)),null!==n.attributeNewValue&&i&&s.wrap(t,i)}}}(n),{priority:t.converterPriority||"normal"})}}function Vs(t){let e="attribute:"+((t=Fs(t)).model.key?t.model.key:t.model);if(t.model.name&&(e+=":"+t.model.name),t.model.values)for(const e of t.model.values)t.view[e]=zs(t.view[e]);else t.view=zs(t.view);const n=Ls(t);return r=>{r.on(e,function(t){return t=t||((t,e)=>({value:t,key:e.attributeKey})),(e,n,r)=>{const o=t(n.attributeOldValue,n),i=t(n.attributeNewValue,n);if(!o&&!i)return;if(!r.consumable.consume(n.item,e.name))return;const s=r.mapper.toViewElement(n.item),a=r.writer;if(null!==n.attributeOldValue&&o)if("class"==o.key){const t=Array.isArray(o.value)?o.value:[o.value];for(const e of t)a.removeClass(e,s)}else if("style"==o.key){const t=Object.keys(o.value);for(const e of t)a.removeStyle(e,s)}else a.removeAttribute(o.key,s);if(null!==n.attributeNewValue&&i)if("class"==i.key){const t=Array.isArray(i.value)?i.value:[i.value];for(const e of t)a.addClass(e,s)}else if("style"==i.key){const t=Object.keys(i.value);for(const e of t)a.setStyle(e,i.value[e],s)}else a.setAttribute(i.key,i.value,s)}}(n),{priority:t.converterPriority||"normal"})}}function Bs(t,e){return"function"==typeof t?t:(n,r)=>(function(t,e,n){"string"==typeof t&&(t={name:t});let r;const o=Object.assign({},t.attributes);if("container"==n)r=e.createContainerElement(t.name,o);else if("attribute"==n){const n={priority:t.priority||jr.DEFAULT_PRIORITY};r=e.createAttributeElement(t.name,o,n)}else r=e.createUIElement(t.name,o);if(t.styles){const n=Object.keys(t.styles);for(const o of n)e.setStyle(o,t.styles[o],r)}if(t.classes){const n=t.classes;if("string"==typeof n)e.addClass(n,r);else for(const t of n)e.addClass(t,r)}return r})(t,r,e)}function Ls(t){return t.model.values?(e,n)=>{const r=t.view[e];return r?r(e,n):null}:t.view}function zs(t){return"string"==typeof t?e=>({key:t,value:e}):"object"==typeof t?t.value?()=>t:e=>({key:t.key,value:e}):t}class qs{constructor(t){this.model=t,this.view=new ls,this.mapper=new ks,this.downcastDispatcher=new Cs({mapper:this.mapper});const e=this.model.document,n=e.selection,r=this.model.markers;this.listenTo(e,"change",()=>{this.view.change(t=>{this.downcastDispatcher.convertChanges(e.differ,t),this.downcastDispatcher.convertSelection(n,r,t)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(t,e){return(n,r)=>{const o=r.newSelection,i=new Ts,s=[];for(const t of o.getRanges())s.push(e.toModelRange(t));i.setTo(s,{backward:o.isBackward}),i.isEqual(t.document.selection)||t.change(t=>{t.setSelection(i)})}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",(t,e,n)=>{if(!n.consumable.consume(e.item,"insert"))return;const r=n.writer,o=n.mapper.toViewPosition(e.range.start),i=r.createText(e.item.data);r.insert(o,i)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(t,e,n)=>{const r=n.mapper.toViewPosition(e.position),o=e.position.getShiftedBy(e.length),i=n.mapper.toViewPosition(o,{isPhantom:!0}),s=new Fr(r,i),a=n.writer.remove(s.getTrimmed());for(const t of Fr.createIn(a).getItems())n.mapper.unbindViewElement(t)},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,n)=>{const r=n.writer,o=r.document.selection;for(const t of o.getRanges())t.isCollapsed&&t.end.parent.document&&n.writer.mergeAttributes(t.start);r.setSelection(null)},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,n)=>{const r=e.selection;if(r.isCollapsed)return;if(!n.consumable.consume(r,"selection"))return;const o=[];for(const t of r.getRanges()){const e=n.mapper.toViewRange(t);o.push(e)}n.writer.setSelection(o,{backward:r.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,n)=>{const r=e.selection;if(!r.isCollapsed)return;if(!n.consumable.consume(r,"selection"))return;const o=n.writer,i=r.getFirstPosition(),s=n.mapper.toViewPosition(i),a=o.breakAttributes(s);o.setSelection(a)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(t=>{if("$graveyard"==t.rootName)return null;const e=new Rr(t.name);return e.rootName=t.rootName,e._document=this.view.document,this.mapper.bindElements(t,e),e})}destroy(){this.view.destroy(),this.stopListening()}}P(qs,yr);class js{constructor(t,e=[]){this._editor=t,this._availablePlugins=new Map,this._plugins=new Map;for(const t of e)this._availablePlugins.set(t,t),t.pluginName&&this._availablePlugins.set(t.pluginName,t)}*[Symbol.iterator](){for(const t of this._plugins)"function"==typeof t[0]&&(yield t)}get(t){return this._plugins.get(t)}load(t,e=[]){const n=this,r=this._editor,o=new Set,i=[],s=d(t),a=d(e),c=function(t){const e=[];for(const n of t)u(n)||e.push(n);return e.length?e:null}(t);if(c){const t="plugincollection-plugin-not-found: Some plugins are not available and could not be loaded.";return Hi.a.error(t,{plugins:c}),Promise.reject(new m.b(t,{plugins:c}))}return Promise.all(s.map(l)).then(()=>i);function l(t){if(!a.includes(t)&&!n.get(t)&&!o.has(t))return function(t){return new Promise(s=>{o.add(t),t.requires&&t.requires.forEach(n=>{const r=u(n);if(e.includes(r))throw new m.b("plugincollection-required: Cannot load a plugin because one of its dependencies is listed inthe `removePlugins` option.",{plugin:r,requiredBy:t});l(r)});const a=new t(r);n._add(t,a),i.push(a),s()})}(t).catch(e=>{throw Hi.a.error("plugincollection-load: It was not possible to load the plugin.",{plugin:t}),e})}function u(t){return"function"==typeof t?t:n._availablePlugins.get(t)}function d(t){return t.map(t=>u(t)).filter(t=>!!t)}}destroy(){const t=Array.from(this).map(([,t])=>t).filter(t=>"function"==typeof t.destroy).map(t=>t.destroy());return Promise.all(t)}_add(t,e){this._plugins.set(t,e);const n=t.pluginName;n&&(this._plugins.has(n)?Hi.a.warn("plugincollection-plugin-name-conflict: Two plugins with the same name were loaded.",{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:t}):this._plugins.set(n,e))}}class Hs{constructor(){this._commands=new Map}add(t,e){this._commands.set(t,e)}get(t){return this._commands.get(t)}execute(t,...e){const n=this.get(t);if(!n)throw new m.b("commandcollection-command-not-found: Command does not exist.",{commandName:t});n.execute(...e)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const t of this.commands())t.destroy()}}function $s(t,e){const n=Object.keys(window.CKEDITOR_TRANSLATIONS).length;return 1===n&&(t=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]),0!==n&&function(t,e){return t in window.CKEDITOR_TRANSLATIONS&&e in window.CKEDITOR_TRANSLATIONS[t]}(t,e)?window.CKEDITOR_TRANSLATIONS[t][e].replace(/ \[context: [^\]]+\]$/,""):e.replace(/ \[context: [^\]]+\]$/,"")}window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={});class Us{constructor(t){this.language=t||"en",this.t=((...t)=>this._t(...t))}_t(t,e){let n=$s(this.language,t);return e&&(n=n.replace(/%(\d+)/g,(t,n)=>n{e[0]=new Js(e[0])},{priority:"highest"}),this.on("checkChild",(t,e)=>{e[0]=new Js(e[0]),e[1]=this.getDefinition(e[1])},{priority:"highest"})}register(t,e){if(this._sourceDefinitions[t])throw new m.b("schema-cannot-register-item-twice: A single item cannot be registered twice in the schema.",{itemName:t});this._sourceDefinitions[t]=[Object.assign({},e)],this._clearCache()}extend(t,e){if(!this._sourceDefinitions[t])throw new m.b("schema-cannot-extend-missing-item: Cannot extend an item which was not registered yet.",{itemName:t});this._sourceDefinitions[t].push(Object.assign({},e)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(t){let e;return e="string"==typeof t?t:t.is&&(t.is("text")||t.is("textProxy"))?"$text":t.name,this.getDefinitions()[e]}isRegistered(t){return!!this.getDefinition(t)}isBlock(t){const e=this.getDefinition(t);return!(!e||!e.isBlock)}isLimit(t){const e=this.getDefinition(t);return!!e&&!(!e.isLimit&&!e.isObject)}isObject(t){const e=this.getDefinition(t);return!(!e||!e.isObject)}checkChild(t,e){return!!e&&this._checkContextMatch(e,t)}checkAttribute(t,e){const n=this.getDefinition(t.last);return!!n&&n.allowAttributes.includes(e)}checkMerge(t,e=null){if(t instanceof vs){const e=t.nodeBefore,n=t.nodeAfter;if(!(e instanceof ms))throw new m.b("schema-check-merge-no-element-before: The node before the merge position must be an element.");if(!(n instanceof ms))throw new m.b("schema-check-merge-no-element-after: The node after the merge position must be an element.");return this.checkMerge(e,n)}for(const n of e.getChildren())if(!this.checkChild(t,n))return!1;return!0}addChildCheck(t){this.on("checkChild",(e,[n,r])=>{if(!r)return;const o=t(n,r);"boolean"==typeof o&&(e.stop(),e.return=o)},{priority:"high"})}addAttributeCheck(t){this.on("checkAttribute",(e,[n,r])=>{const o=t(n,r);"boolean"==typeof o&&(e.stop(),e.return=o)},{priority:"high"})}getLimitElement(t){let e;if(t instanceof vs)e=t.parent;else{e=(t instanceof _s?[t]:Array.from(t.getRanges())).reduce((t,e)=>{const n=e.getCommonAncestor();return t?t.getCommonAncestor(n,{includeSelf:!0}):n},null)}for(;!this.isLimit(e)&&e.parent;)e=e.parent;return e}checkAttributeInSelection(t,e){if(t.isCollapsed)return this.checkAttribute([...t.getFirstPosition().getAncestors(),"$text"],e);{const n=t.getRanges();for(const t of n)for(const n of t)if(this.checkAttribute(n.item,e))return!0}return!1}getValidRanges(t,e){const n=[];for(const r of t){let t=r.start,o=r.start;const i=r.end;for(const i of r.getWalker())this.checkAttribute(i.item,e)||(o.isEqual(t)||n.push(new _s(o,t)),o=i.nextPosition),t=i.nextPosition;o&&!o.isEqual(i)&&n.push(new _s(o,i))}return n}getNearestSelectionRange(t,e="both"){if(this.checkChild(t,"$text"))return new _s(t);let n,r;"both"!=e&&"backward"!=e||(n=new gs({startPosition:t,direction:"backward"})),"both"!=e&&"forward"!=e||(r=new gs({startPosition:t}));for(const t of function*(t,e){let n=!1;for(;!n;){if(n=!0,t){const e=t.next();e.done||(n=!1,yield{walker:t,value:e.value})}if(e){const t=e.next();t.done||(n=!1,yield{walker:e,value:t.value})}}}(n,r)){const e=t.walker==n?"elementEnd":"elementStart",r=t.value;if(r.type==e&&this.isObject(r.item))return _s.createOn(r.item);if(this.checkChild(r.nextPosition,"$text"))return new _s(r.nextPosition)}return null}findAllowedParent(t,e){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(t,e){for(const n of t){for(const t of n.getAttributeKeys())this.checkAttribute(n,t)||e.removeAttribute(t,n);n.is("element")&&this.removeDisallowedAttributes(n.getChildren(),e)}}_clearCache(){this._compiledDefinitions=null}_compile(){const t={},e=this._sourceDefinitions,n=Object.keys(e);for(const r of n)t[r]=Zs(e[r],r);for(const e of n)Qs(t,e);for(const e of n)Ys(t,e);for(const e of n)Xs(t,e),ta(t,e);for(const e of n)ea(t,e),na(t,e);this._compiledDefinitions=t}_checkContextMatch(t,e,n=e.length-1){const r=e.getItem(n);if(t.allowIn.includes(r.name)){if(0==n)return!0;{const t=this.getDefinition(r);return this._checkContextMatch(t,e,n-1)}}return!1}}P(Ks,yr);class Js{constructor(t){if(t instanceof Js)return t;"string"==typeof t?t=[t]:Array.isArray(t)||(t=t.getAncestors({includeSelf:!0})),t[0]&&"string"!=typeof t[0]&&t[0].is("documentFragment")&&t.shift(),this._items=t.map(ia)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(t){const e=new Js([t]);return e._items=[...this._items,...e._items],e}getItem(t){return this._items[t]}*getNames(){yield*this._items.map(t=>t.name)}endsWith(t){return Array.from(this.getNames()).join(" ").endsWith(t)}}function Zs(t,e){const n={name:e,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};return function(t,e){for(const n of t){const t=Object.keys(n).filter(t=>t.startsWith("is"));for(const r of t)e[r]=n[r]}}(t,n),ra(t,n,"allowIn"),ra(t,n,"allowContentOf"),ra(t,n,"allowWhere"),ra(t,n,"allowAttributes"),ra(t,n,"allowAttributesOf"),ra(t,n,"inheritTypesFrom"),function(t,e){for(const n of t){const t=n.inheritAllFrom;t&&(e.allowContentOf.push(t),e.allowWhere.push(t),e.allowAttributesOf.push(t),e.inheritTypesFrom.push(t))}}(t,n),n}function Qs(t,e){for(const n of t[e].allowContentOf)if(t[n]){oa(t,n).forEach(t=>{t.allowIn.push(e)})}delete t[e].allowContentOf}function Ys(t,e){for(const n of t[e].allowWhere){const r=t[n];if(r){const n=r.allowIn;t[e].allowIn.push(...n)}}delete t[e].allowWhere}function Xs(t,e){for(const n of t[e].allowAttributesOf){const r=t[n];if(r){const n=r.allowAttributes;t[e].allowAttributes.push(...n)}}delete t[e].allowAttributesOf}function ta(t,e){const n=t[e];for(const e of n.inheritTypesFrom){const r=t[e];if(r){const t=Object.keys(r).filter(t=>t.startsWith("is"));for(const e of t)e in n||(n[e]=r[e])}}delete n.inheritTypesFrom}function ea(t,e){const n=t[e],r=n.allowIn.filter(e=>t[e]);n.allowIn=Array.from(new Set(r))}function na(t,e){const n=t[e];n.allowAttributes=Array.from(new Set(n.allowAttributes))}function ra(t,e,n){for(const r of t)"string"==typeof r[n]?e[n].push(r[n]):Array.isArray(r[n])&&e[n].push(...r[n])}function oa(t,e){const n=t[e];return function(t){return Object.keys(t).map(e=>t[e])}(t).filter(t=>t.allowIn.includes(n.name))}function ia(t){return"string"==typeof t?{name:t,*getAttributeKeys(){},getAttribute(){}}:{name:t.is("element")?t.name:"$text",*getAttributeKeys(){yield*t.getAttributeKeys()},getAttribute:e=>t.getAttribute(e)}}class sa{constructor(t={}){this._removeIfEmpty=new Set,this._modelCursor=null,this.conversionApi=Object.assign({},t),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this),this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this)}convert(t,e,n=["$root"]){this.fire("viewCleanup",t),this._modelCursor=function(t,e){let n;for(const r of new Js(t)){const t={};for(const e of r.getAttributeKeys())t[e]=r.getAttribute(e);const o=e.createElement(r.name,t);n&&e.append(o,n),n=vs.createAt(o)}return n}(n,e),this.conversionApi.writer=e,this.conversionApi.consumable=Ws.createFrom(t),this.conversionApi.store={};const{modelRange:r}=this._convertItem(t,this._modelCursor),o=e.createDocumentFragment();if(r){this._removeEmptyElements();for(const t of Array.from(this._modelCursor.parent.getChildren()))e.append(t,o);o.markers=function(t,e){const n=new Set,r=new Map,o=_s.createIn(t).getItems();for(const t of o)"$marker"==t.name&&n.add(t);for(const t of n){const n=t.getAttribute("data-name"),o=vs.createBefore(t);r.has(n)?r.get(n).end=vs.createFromPosition(o):r.set(n,new _s(vs.createFromPosition(o))),e.remove(t)}return r}(o,e)}return this._modelCursor=null,this._removeIfEmpty.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,o}_convertItem(t,e){const n=Object.assign({viewItem:t,modelCursor:e,modelRange:null});if(t.is("element")?this.fire("element:"+t.name,n,this.conversionApi):t.is("text")?this.fire("text",n,this.conversionApi):this.fire("documentFragment",n,this.conversionApi),n.modelRange&&!(n.modelRange instanceof _s))throw new m.b("view-conversion-dispatcher-incorrect-result: Incorrect conversion result was dropped.");return{modelRange:n.modelRange,modelCursor:n.modelCursor}}_convertChildren(t,e){const n=new _s(e);let r=e;for(const e of Array.from(t.getChildren())){const t=this._convertItem(e,r);t.modelRange instanceof _s&&(n.end=t.modelRange.end,r=t.modelCursor)}return{modelRange:n,modelCursor:r}}_splitToAllowedParent(t,e){const n=this.conversionApi.schema.findAllowedParent(t,e);if(!n)return null;if(n===e.parent)return{position:e};if(this._modelCursor.parent.getAncestors().includes(n))return null;const r=this.conversionApi.writer.split(e,n);for(const t of r.range.getPositions())t.isEqual(r.position)||this._removeIfEmpty.add(t.parent);return{position:r.position,cursorParent:r.range.end.parent}}_removeEmptyElements(){let t=!1;for(const e of this._removeIfEmpty)e.isEmpty&&(this.conversionApi.writer.remove(e),this._removeIfEmpty.delete(e),t=!0);t&&this._removeEmptyElements()}}function aa(t){const e=function(t){const e=new Fn(t.view);return(n,r,o)=>{const i=e.match(r.viewItem);if(!i)return;i.match.name=!0;const s=function(t,e,n){return t instanceof Function?t(e,n):n.createElement(t)}(t.model,r.viewItem,o.writer);if(!s)return;if(!o.consumable.test(r.viewItem,i.match))return;const a=o.splitToAllowedParent(s,r.modelCursor);if(!a)return;o.writer.insert(s,a.position);const c=o.convertChildren(r.viewItem,vs.createAt(s));o.consumable.consume(r.viewItem,i.match),r.modelRange=new _s(vs.createBefore(s),vs.createAfter(c.modelCursor.parent)),a.cursorParent?r.modelCursor=vs.createAt(a.cursorParent):r.modelCursor=r.modelRange.end}}(t=Fs(t)),n=ua(t),r=n?"element:"+n:"element";return n=>{n.on(r,e,{priority:t.converterPriority||"normal"})}}function ca(t){da(t=Fs(t));const e=ha(t,!1),n=ua(t),r=n?"element:"+n:"element";return n=>{n.on(r,e,{priority:t.converterPriority||"normal"})}}function la(t){let e=null;("string"==typeof(t=Fs(t)).view||t.view.key)&&(e=function(t){"string"==typeof t.view&&(t.view={key:t.view});const e=t.view.key;let n;if("class"==e||"style"==e){const r="class"==e?"classes":"styles";n={[r]:t.view.value}}else{const r=void 0===t.view.value?/[\s\S]*/:t.view.value;n={attributes:{[e]:r}}}t.view.name&&(n.name=t.view.name);return t.view=n,e}(t)),da(t,e);const n=ha(t,!0);return e=>{e.on("element",n,{priority:t.converterPriority||"low"})}}function ua(t){return"string"==typeof t.view?t.view:"object"==typeof t.view&&"string"==typeof t.view.name?t.view.name:null}function da(t,e=null){const n=null===e||(t=>t.getAttribute(e)),r="object"!=typeof t.model?t.model:t.model.key,o="object"!=typeof t.model||void 0===t.model.value?n:t.model.value;t.model={key:r,value:o}}function ha(t,e){const n=new Fn(t.view);return(r,o,i)=>{const s=n.match(o.viewItem);if(!s)return;const a=t.model.key,c="function"==typeof t.model.value?t.model.value(o.viewItem):t.model.value;null!==c&&(!function(t){if("object"==typeof t.view&&!ua(t))return!1;return!t.view.classes&&!t.view.attributes&&!t.view.styles}(t)?delete s.match.name:s.match.name=!0,i.consumable.test(o.viewItem,s.match)&&(o.modelRange||(o=Object.assign(o,i.convertChildren(o.viewItem,o.modelCursor))),function(t,e,n,r){let o=!1;for(const i of Array.from(t.getItems({shallow:n})))r.schema.checkAttribute(i,e.key)&&(r.writer.setAttribute(e.key,e.value,i),o=!0);return o}(o.modelRange,{key:a,value:c},e,i)&&i.consumable.consume(o.viewItem,s.match)))}}P(sa,y);class fa{constructor(t,e){this.model=t,this.processor=e,this.mapper=new ks,this.downcastDispatcher=new Cs({mapper:this.mapper}),this.downcastDispatcher.on("insert:$text",(t,e,n)=>{if(!n.consumable.consume(e.item,"insert"))return;const r=n.writer,o=n.mapper.toViewPosition(e.range.start),i=r.createText(e.item.data);r.insert(o,i)},{priority:"lowest"}),this.upcastDispatcher=new sa({schema:t.schema}),this.upcastDispatcher.on("text",(t,e,n)=>{if(n.schema.checkChild(e.modelCursor,"$text")&&n.consumable.consume(e.viewItem)){const t=n.writer.createText(e.viewItem.data);n.writer.insert(t,e.modelCursor),e.modelRange=_s.createFromPositionAndShift(e.modelCursor,t.offsetSize),e.modelCursor=e.modelRange.end}},{priority:"lowest"}),this.upcastDispatcher.on("element",(t,e,n)=>{if(!e.modelRange&&n.consumable.consume(e.viewItem,{name:!0})){const{modelRange:t,modelCursor:r}=n.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t,e.modelCursor=r}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(t,e,n)=>{if(!e.modelRange&&n.consumable.consume(e.viewItem,{name:!0})){const{modelRange:t,modelCursor:r}=n.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t,e.modelCursor=r}},{priority:"lowest"}),this.decorate("init")}get(t="main"){return this.stringify(this.model.document.getRoot(t))}stringify(t){const e=this.toView(t);return this.processor.toData(e)}toView(t){const e=_s.createIn(t),n=new oo,r=new io(new zr);if(this.mapper.bindElements(t,n),this.downcastDispatcher.convertInsert(e,r),!t.is("documentFragment")){const e=function(t){const e=[],n=t.root.document;if(!n)return[];const r=_s.createIn(t);for(const t of n.model.markers){const n=r.getIntersection(t.getRange());n&&e.push([t.name,n])}return e}(t);for(const[t,n]of e)this.downcastDispatcher.convertMarkerAdd(t,n,r)}return this.mapper.clearBindings(),n}init(t,e="main"){if(this.model.document.version)throw new m.b("datacontroller-init-document-not-empty: Trying to set initial data to not empty document.");const n=this.model.document.getRoot(e);return this.model.enqueueChange("transparent",e=>{e.insert(this.parse(t,n),n)}),Promise.resolve()}set(t,e="main"){const n=this.model.document.getRoot(e);this.model.enqueueChange("transparent",e=>{e.setSelection(null),e.removeSelectionAttribute(this.model.document.selection.getAttributeKeys()),e.remove(_s.createIn(n)),e.insert(this.parse(t,n),n)})}parse(t,e="$root"){const n=this.processor.toView(t);return this.toModel(n,e)}toModel(t,e="$root"){return this.model.change(n=>this.upcastDispatcher.convert(t,n,e))}destroy(){}}P(fa,yr);class pa{constructor(){this._dispatchersGroups=new Map}register(t,e){if(this._dispatchersGroups.has(t))throw new m.b("conversion-register-group-exists: Trying to register a group name that was already registered.");this._dispatchersGroups.set(t,e)}for(t){const e=this._getDispatchers(t);return{add(t){return function(t,e){for(const n of t)e(n)}(e,t),this}}}elementToElement(t){this.for("downcast").add(Ns(t));for(const{model:e,view:n}of ma(t))this.for("upcast").add(aa({model:e,view:n,converterPriority:t.converterPriority}))}attributeToElement(t){this.for("downcast").add(Ms(t));for(const{model:e,view:n}of ma(t))this.for("upcast").add(ca({view:n,model:e,priority:t.priority}))}attributeToAttribute(t){this.for("downcast").add(Vs(t));for(const{model:e,view:n}of ma(t))this.for("upcast").add(la({view:n,model:e}))}_getDispatchers(t){const e=this._dispatchersGroups.get(t);if(!e)throw new m.b("conversion-for-unknown-group: Trying to add a converter to an unknown dispatchers group.");return e}}function*ma(t){if(t.model.values)for(const e of t.model.values){yield*ga({key:t.model.key,value:e},t.view[e],t.upcastAlso?t.upcastAlso[e]:void 0)}else yield*ga(t.model,t.view,t.upcastAlso)}function*ga(t,e,n){if(yield{model:t,view:e},n){n=Array.isArray(n)?n:[n];for(const e of n)yield{model:t,view:e}}}class ba{constructor(t){this.baseVersion=t,this.isDocumentOperation=null!==this.baseVersion}_validate(){}toJSON(){const t=En(this,!0);return t.__className=this.constructor.className,delete t.delta,delete t.isDocumentOperation,t}static get className(){return"engine.model.operation.Operation"}static fromJSON(t){return new this(t.baseVersion)}}class wa{constructor(t){this.markers=new Map,this._children=new ps,t&&this._insertChild(0,t)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(t){return"documentFragment"==t}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}getPath(){return[]}getNodeByPath(t){let e=this;for(const n of t)e=e.getChild(e.offsetToIndex(n));return e}offsetToIndex(t){return this._children.offsetToIndex(t)}toJSON(){const t=[];for(const e of this._children)t.push(e.toJSON());return t}static fromJSON(t){const e=[];for(const n of t)n.name?e.push(ms.fromJSON(n)):e.push(hs.fromJSON(n));return new wa(e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const n=function(t){if("string"==typeof t)return[new hs(t)];In(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new hs(t):t instanceof fs?new hs(t.data,t.getAttributes()):t)}(e);for(const t of n)null!==t.parent&&t._remove(),t.parent=this;this._children._insertNodes(t,n)}_removeChildren(t,e=1){const n=this._children._removeNodes(t,e);for(const t of n)t.parent=null;return n}}function va(t,e){const n=(e=ka(e)).reduce((t,e)=>t+e.offsetSize,0),r=t.parent;xa(t);const o=t.index;return r._insertChild(o,e),ya(r,o+e.length),ya(r,o),new _s(t,t.getShiftedBy(n))}function _a(t){if(!t.isFlat)throw new m.b("operation-utils-remove-range-not-flat: Trying to remove a range which starts and ends in different element.");const e=t.start.parent;xa(t.start),xa(t.end);const n=e._removeChildren(t.start.index,t.end.index-t.start.index);return ya(e,t.start.index),n}function ka(t){const e=[];t instanceof Array||(t=[t]);for(let n=0;nt.maxOffset)throw new m.b("move-operation-nodes-do-not-exist: The nodes which should be moved do not exist.");if(t===e&&n=n&&this.targetPosition.path[t]t._clone(!0)));return new Oa(this.position,t,this.baseVersion)}getReversed(){const t=this.position.root.document.graveyard,e=new vs(t,[0]);return new Pa(this.position,this.nodes.maxOffset,e,this.baseVersion+1)}_validate(){const t=this.position.parent;if(!t||t.maxOffsett._clone(!0))),va(this.position,t)}static get className(){return"engine.model.operation.InsertOperation"}static fromJSON(t,e){const n=[];for(const e of t.nodes)e.name?n.push(ms.fromJSON(e)):n.push(hs.fromJSON(e));return new Oa(vs.fromJSON(t.position,e),n,t.baseVersion)}}class Ra extends ba{constructor(t,e,n,r,o,i){super(o),this.name=t,this.oldRange=e?_s.createFromRange(e):null,this.newRange=n?_s.createFromRange(n):null,this.affectsData=i,this._markers=r}get type(){return"marker"}clone(){return new Ra(this.name,this.oldRange,this.newRange,this._markers,this.baseVersion,this.affectsData)}getReversed(){return new Ra(this.name,this.newRange,this.oldRange,this._markers,this.baseVersion+1,this.affectsData)}_execute(){const t=this.newRange?"_set":"_remove";this._markers[t](this.name,this.newRange,!0,this.affectsData)}toJSON(){const t=super.toJSON();return delete t._markers,t}static get className(){return"engine.model.operation.MarkerOperation"}static fromJSON(t,e){return new Ra(t.name,t.oldRange?_s.fromJSON(t.oldRange,e):null,t.newRange?_s.fromJSON(t.newRange,e):null,e.model.markers,t.baseVersion,t.affectsData)}}class Da extends ba{get type(){return"noop"}clone(){return new Da(this.baseVersion)}getReversed(){return new Da(this.baseVersion+1)}_execute(){}static get className(){return"engine.model.operation.NoOperation"}}class Ia extends ba{constructor(t,e,n,r){super(r),this.position=t,this.oldName=e,this.newName=n}get type(){return"rename"}clone(){return new Ia(vs.createFromPosition(this.position),this.oldName,this.newName,this.baseVersion)}getReversed(){return new Ia(vs.createFromPosition(this.position),this.newName,this.oldName,this.baseVersion+1)}_validate(){const t=this.position.nodeAfter;if(!(t instanceof ms))throw new m.b("rename-operation-wrong-position: Given position is invalid or node after it is not an instance of Element.");if(t.name!==this.oldName)throw new m.b("rename-operation-wrong-name: Element to change has different name than operation's old name.")}_execute(){this.position.nodeAfter.name=this.newName}static get className(){return"engine.model.operation.RenameOperation"}static fromJSON(t,e){return new Ia(vs.fromJSON(t.position,e),t.oldName,t.newName,t.baseVersion)}}class Fa extends ba{constructor(t,e,n,r,o){super(o),this.root=t,this.key=e,this.oldValue=n,this.newValue=r}get type(){return null===this.oldValue?"addRootAttribute":null===this.newValue?"removeRootAttribute":"changeRootAttribute"}clone(){return new Fa(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Fa(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new m.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 m.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 m.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)}static get className(){return"engine.model.operation.RootAttributeOperation"}static fromJSON(t,e){if(!e.getRoot(t.root))throw new m.b("rootattribute-operation-fromjson-no-root: Cannot create RootAttributeOperation. Root with specified name does not exist.",{rootName:t});return new Fa(e.getRoot(t.root),t.key,t.oldValue,t.newValue,t.baseVersion)}}const Na={};Na[Ta.className]=Ta,Na[Oa.className]=Oa,Na[Ra.className]=Ra,Na[Ea.className]=Ea,Na[Da.className]=Da,Na[ba.className]=ba,Na[Sa.className]=Sa,Na[Pa.className]=Pa,Na[Ia.className]=Ia,Na[Fa.className]=Fa;class Ma{static fromJSON(t,e){return Na[t.__className].fromJSON(t,e)}}const Va=new Map;class Ba{static fromJSON(t,e){if(!Va.has(t.__className))throw new m.b("delta-fromjson-no-deserializer: This delta has no defined deserializer",{name:t.__className});const n=new(Va.get(t.__className));for(const r of t.operations)n.addOperation(Ma.fromJSON(r,e));for(const e in t)"__className"!=e&&void 0===n[e]&&(n[e]=t[e]);return n}static register(t){Va.set(t.className,t)}}class La{constructor(){this.batch=null,this.operations=[]}get baseVersion(){return this.operations.length>0?this.operations[0].baseVersion:null}set baseVersion(t){for(const e of this.operations)e.baseVersion=t++}get _reverseDeltaClass(){return La}addOperation(t){return t.delta=this,this.operations.push(t),t}clone(){const t=new this.constructor;for(const e of this.operations)t.addOperation(e.clone());return t}getReversed(){const t=new this._reverseDeltaClass;for(const e of this.operations)t.addOperation(e.getReversed());t.operations.reverse();for(let e=0;et.range._getTransformedByInsertion(e.position,e.nodes.maxOffset,!0,!1).reverse().map(e=>new Ta(e,t.key,t.oldValue,t.newValue,t.baseVersion)),AttributeOperation(t,e,n){if(t.key===e.key){const r=t.range.getDifference(e.range).map(e=>new Ta(e,t.key,t.oldValue,t.newValue,t.baseVersion)),o=t.range.getIntersection(e.range);return o&&(n.isStrong?r.push(new Ta(o,e.key,e.newValue,t.newValue,t.baseVersion)):0===r.length&&r.push(new Da(0))),r}return[t.clone()]},RootAttributeOperation:Ya,RenameOperation:Ya,MarkerOperation:Ya,MoveOperation(t,e){const n=_s.createFromPositionAndShift(e.sourcePosition,e.howMany);let r=[];const o=function(t){return 0===t.length?null:1==t.length?t[0]:(t[0].end=t[t.length-1].end,t[0])}(t.range.getDifference(n)),i=t.range.getIntersection(n);return null!==o&&(o.start=o.start._getTransformedByDeletion(e.sourcePosition,e.howMany),o.end=o.end._getTransformedByDeletion(e.sourcePosition,e.howMany),r=o._getTransformedByInsertion(e.getMovedRangeStart(),e.howMany,!0,!1).reverse()),null!==i&&(i.start=i.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),i.end=i.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),r.push(i)),r.map(e=>new Ta(e,t.key,t.oldValue,t.newValue,t.baseVersion))}},RootAttributeOperation:{InsertOperation:Ya,AttributeOperation:Ya,RootAttributeOperation:(t,e,n)=>t.root!==e.root||t.key!==e.key||(t.newValue===e.newValue||n.isStrong)&&t.newValue!==e.newValue?[t.clone()]:[new Da(t.baseVersion)],RenameOperation:Ya,MarkerOperation:Ya,MoveOperation:Ya},RenameOperation:{InsertOperation(t,e){const n=t.clone();return n.position=n.position._getTransformedByInsertion(e.position,e.nodes.maxOffset,!0),[n]},AttributeOperation:Ya,RootAttributeOperation:Ya,RenameOperation(t,e,n){const r=t.clone();if(t.position.isEqual(e.position)){if(!n.isStrong)return[new Da(t.baseVersion)];r.oldName=e.newName}return[r]},MarkerOperation:Ya,MoveOperation(t,e){const n=t.clone(),r=n.position.isEqual(e.sourcePosition);return n.position=n.position._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany,!0,r),[n]}},MarkerOperation:{InsertOperation(t,e){const n=t.clone();return n.oldRange&&(n.oldRange=n.oldRange._getTransformedByInsertion(e.position,e.nodes.maxOffset,!1,!1)[0]),n.newRange&&(n.newRange=n.newRange._getTransformedByInsertion(e.position,e.nodes.maxOffset,!1,!1)[0]),[n]},AttributeOperation:Ya,RootAttributeOperation:Ya,RenameOperation:Ya,MarkerOperation(t,e,n){const r=t.clone();if(t.name==e.name){if(!n.isStrong)return[new Da(t.baseVersion)];r.oldRange=e.newRange}return[r]},MoveOperation(t,e){const n=t.clone();if(n.oldRange){const t=n.oldRange._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany);n.oldRange=_s.createFromRanges(t)}if(n.newRange){const t=n.newRange._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany);n.newRange=_s.createFromRanges(t)}return[n]}},MoveOperation:{InsertOperation(t,e,n){let r=_s.createFromPositionAndShift(t.sourcePosition,t.howMany);const o=t.isSticky&&!n.forceNotSticky;r=r._getTransformedByInsertion(e.position,e.nodes.maxOffset,!1,o)[0];const i=void 0===n.insertBefore?!n.isStrong:n.insertBefore,s=new t.constructor(r.start,r.end.offset-r.start.offset,t.targetPosition._getTransformedByInsertion(e.position,e.nodes.maxOffset,i),t.baseVersion);return s.isSticky=t.isSticky,[s]},AttributeOperation:Ya,RootAttributeOperation:Ya,RenameOperation:Ya,MarkerOperation:Ya,MoveOperation(t,e,n){const r=_s.createFromPositionAndShift(t.sourcePosition,t.howMany),o=_s.createFromPositionAndShift(e.sourcePosition,e.howMany);let i=n.isStrong;const s=t.isSticky&&!n.forceNotSticky,a=void 0===n.insertBefore?!i:n.insertBefore,c=t.targetPosition._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany,a,e.isSticky&&!n.forceNotSticky);if(Xa(t,e)&&Xa(e,t))return[e.getReversed()];const l=r.containsPosition(e.targetPosition)||r.start.isEqual(e.targetPosition)&&s||r.end.isEqual(e.targetPosition)&&s;if(l&&r.containsRange(o,!0))return r.start=r.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany,!s),r.end=r.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany,s),tc([r],c,t);if((o.containsPosition(t.targetPosition)||o.start.isEqual(t.targetPosition)&&e.isSticky&&!n.forceNotSticky||o.end.isEqual(t.targetPosition)&&e.isSticky&&!n.forceNotSticky)&&o.containsRange(r,!0))return r.start=r.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),r.end=r.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),tc([r],c,t);const u=Sn(t.sourcePosition.getParentPath(),e.sourcePosition.getParentPath());if("prefix"==u||"extension"==u)return r.start=r.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany,!s),r.end=r.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany,s),tc([r],c,t);n.forceWeakRemove||(t instanceof Pa&&!(e instanceof Pa)?i=!0:!(t instanceof Pa)&&e instanceof Pa&&(i=!1));const d=[],h=r.getDifference(o);for(const t of h){t.start=t.start._getTransformedByDeletion(e.sourcePosition,e.howMany),t.end=t.end._getTransformedByDeletion(e.sourcePosition,e.howMany);const n="same"==Sn(t.start.getParentPath(),e.getMovedRangeStart().getParentPath()),r=t._getTransformedByInsertion(e.getMovedRangeStart(),e.howMany,n,s);d.push(...r)}const f=r.getIntersection(o);return null!==f&&i&&!l&&(f.start=f.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),f.end=f.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),0===d.length?d.push(f):1==d.length?o.start.isBefore(r.start)||o.start.isEqual(r.start)?d.unshift(f):d.push(f):d.splice(1,0,f)),0===d.length?[new Da(t.baseVersion)]:tc(d,c,t)}}};function Ya(t){return[t.clone()]}function Xa(t,e){return null===t.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany)}function tc(t,e,n){const r=[];for(let o=0;oo?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r0&&r(c)?n>1?t(c,n-1,r,o,i):ge(i,c):o||(i[i.length]=c)}return i};var lc=function(){for(var t=arguments.length,e=Array(t?t-1:0),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return t?ge(Yt(n)?de(n):[n],cc(e,1)):[]};var uc=function(t,e,n){for(var r=t.length,o=e+(n?0:-1);n?o--:++o-1};var fc=function(t,e,n){for(var r=-1,o=t.length;++r=bc&&(i=gc,s=!1,e=new Xo(e));t:for(;++o=e?t:e)),t},ml=4294967295;var gl=function(t){return t?pl(nr(t),0,ml):0};var bl=function(t,e,n,r){var o=t.length;for((n=nr(n))<0&&(n=-n>o?0:o+n),(r=void 0===r||r>o?o:nr(r))<0&&(r+=o),r=n>r?0:gl(r);n=120&&u.length>=120)?new Xo(s&&u):void 0}u=t[0];var d=-1,h=a[0];t:for(;++d-1;)a!==t&&Ul.call(a,c,1),Ul.call(t,c,1);return t};var Gl=function(t,e){return t&&t.length&&e&&e.length?Wl(t,e):t},Kl=ir(Gl);var Jl=function(t,e,n){return t&&t.length&&e&&e.length?Wl(t,e,sl(n)):t};var Zl=function(t,e,n){return t&&t.length&&e&&e.length?Wl(t,e,void 0,n):t};var Ql=function(t,e){for(var n=-1,r=null==t,o=e.length,i=Array(o);++ne||i&&s&&c&&!a&&!l||r&&s&&c||!n&&c||!o)return 1;if(!r&&!i&&!l&&t>>1,s=t[i];null!==s&&!Un(s)&&(n?s<=e:s=Pu){var l=e?null:Su(t);if(l)return He(l);s=!1,o=gc,c=new Xo}else c=e?[]:a;t:for(;++r1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,zu(t,n)}),Yu={chunk:ic,compact:sc,concat:lc,difference:vc,differenceBy:al,differenceWith:cl,drop:ll,dropRight:ul,dropRightWhile:hl,dropWhile:fl,fill:wl,findIndex:_l,findLastIndex:kl,first:yl,flatten:xl,flattenDeep:Al,flattenDepth:Tl,fromPairs:El,head:yl,indexOf:Pl,initial:Ol,intersection:Fl,intersectionBy:Nl,intersectionWith:Ml,join:Bl,last:ws,lastIndexOf:ql,nth:Hl,pull:Kl,pullAll:Gl,pullAllBy:Jl,pullAllWith:Zl,pullAt:nu,remove:ru,reverse:iu,slice:su,sortedIndex:fu,sortedIndexBy:pu,sortedIndexOf:mu,sortedLastIndex:gu,sortedLastIndexBy:bu,sortedLastIndexOf:wu,sortedUniq:_u,sortedUniqBy:ku,tail:yu,take:xu,takeRight:Cu,takeRightWhile:Au,takeWhile:Tu,union:Ru,unionBy:Du,unionWith:Iu,uniq:Fu,uniqBy:Nu,uniqWith:Mu,unzip:Lu,unzipWith:zu,without:qu,xor:Hu,xorBy:$u,xorWith:Uu,zip:Wu,zipObject:Ku,zipObjectDeep:Zu,zipWith:Qu};const Xu=new Map,td={transform(t,e,n){const r=(td.getTransformationCase(t,e)||td.defaultTransform)(t,e,Object.assign({},n));return function(t,e){for(const n of e)for(const e of n.operations)e.baseVersion=++t;return e}(Yu.last(e.operations).baseVersion,r)},defaultTransform(t,e,n){const r=[];let o=e.operations,i=[];for(const e of t.operations){const t=[e];for(const e of o)for(let r=0;rt+e.operations.length,0)}function rd(t,e){const n=t[t.length-1];let r=n.operations.length+n.baseVersion;const o=new La;for(let t=0;t{const r=ld(t,e,n);return t.range.containsPosition(e.position)&&r.push(dd(e,t)),r}),cd(za,qa,(t,e,n)=>{if(!e.position)return ld(t,e,n);const r=n.undoMode,o=new vs(e.position.root,e.position.path.slice(0,-1)),i=ld(t,e,n);if(r||!(e._cloneOperation instanceof Oa))return i;for(const n of t.operations)if(n.range.containsPosition(o)||n.range.start.isEqual(o)){const t=new za,r=o.getShiftedBy(1),s=vs.createFromPosition(r);s.path.push(0);const a=e._cloneOperation.nodes.getNode(0).getAttribute(n.key);t.addOperation(new Ta(new _s(r,s),n.key,void 0===a?null:a,n.newValue,0)),i.push(t);break}return i}),cd(Ka,ja,(t,e,n)=>{if(!e.position)return ld(t,e,n);return!n.undoMode&&t.position.isEqual(e.position)?[e.getReversed(),t.clone()]:ld(t,e,n)}),cd(ad,qa,ud),cd(ad,ja,ud),cd(ad,Wa,ud),cd(ad,Ga,ud),cd(ad,Ha,ud),cd(ad,Ua,ud),cd(Ha,ja,(t,e,n)=>{if(n.undoMode||!e.position)return ld(t,e,n);const r=t.sourcePosition.root==e.position.root&&"same"===Sn(t.sourcePosition.getParentPath(),e.position.getParentPath()),o=t.sourcePosition.offset<=e.position.offset&&t.sourcePosition.offset+t.howMany>e.position.offset;return r&&o?[e.getReversed(),t.clone()]:ld(t,e,n)}),cd(ja,Ka,(t,e,n)=>{if(!t.position)return ld(t,e,n);return!n.undoMode&&t.position.isEqual(e.position)?[hd()]:ld(t,e,n)}),cd(ja,Ha,(t,e,n)=>{if(n.undoMode||!t.position)return ld(t,e,n);const r=t.position.root==e.sourcePosition.root&&"same"===Sn(t.position.getParentPath(),e.sourcePosition.getParentPath()),o=e.sourcePosition.offset<=t.position.offset&&e.sourcePosition.offset+e.howMany>t.position.offset;return r&&o?[hd()]:ld(t,e,n)}),cd(qa,qa,(t,e,n)=>{if(n.undoMode)return ld(t,e,n);if(!t.position||!e.position)return ld(t,e,n);const r=t.position.getParentPath(),o=e.position.getParentPath();if(t.position.root==e.position.root&&"same"==Sn(r,o)){if((t=t.clone()).position.offsete._cloneOperation.sourcePosition.offset&&t._cloneOperation.sourcePosition.offset--;const n=_s.createFromPositionAndShift(t.position,t._moveOperation.howMany),r=_s.createFromPositionAndShift(e.position,e._moveOperation.howMany),o=n.getDifference(r);let i=0;for(const t of o)i+=t.end.offset-t.start.offset;return 0===i?(t.operations.pop(),t.addOperation(new Da(t.operations[0].baseVersion+1))):t.operations[1].howMany=i,[t]}{const r=Object.assign({},n);return r.isStrong=!0,r.insertBefore=!0,ld(t,e,r)}}return ld(t,e,n)}),cd(qa,Ga,(t,e,n)=>t.position&&t.position.root==e.position.root&&"same"===Sn(e.position.path,t.position.getParentPath())?[hd()]:ld(t,e,n)),cd(qa,Wa,(t,e,n)=>{if(!t.position)return ld(t,e,n);const r=t.position.root==e.range.start.root,o=r&&"same"===Sn(t.position.getParentPath(),e.range.start.getParentPath()),i=e.range.start.offset=t.position.offset;if(o&&i)return[hd()];if(r&&"same"===Sn(t.position.getParentPath(),e.range.end.getShiftedBy(-1).path)){const n=t.clone(),r=vs.createFromPosition(e.range.start);r.path.push(e.howMany-1);const o=r.getShiftedBy(1);n._cloneOperation.position=o;const i=vs.createFromPosition(r);i.path.push(t.position.offset),n._moveOperation.sourcePosition=i;const s=vs.createFromPosition(o);return s.path.push(0),n._moveOperation.targetPosition=s,[n]}return ld(t,e,n)}),cd(qa,za,(t,e,n)=>{if(!t.position)return ld(t,e,n);t=t.clone();const r=n.undoMode,o=new vs(t.position.root,t.position.path.slice(0,-1));if(r||!(t._cloneOperation instanceof Oa))return[t];for(const n of e.operations)if(n.range.containsPosition(o)||n.range.start.isEqual(o)){null!==n.newValue?t._cloneOperation.nodes.getNode(0)._setAttribute(n.key,n.newValue):t._cloneOperation.nodes.getNode(0)._removeAttribute(n.key);break}return[t]}),cd(Ga,qa,(t,e,n)=>e.position&&t.position.root==e.position.root&&"same"===Sn(t.position.path,e.position.getParentPath())?[e.getReversed(),t.clone()]:ld(t,e,n)),cd(Ja,za,(t,e)=>{const n=[t.clone()];return e.range.containsPosition(t.position)&&n.push(dd(t,e)),n}),cd(Wa,qa,(t,e,n)=>{if(!e.position)return ld(t,e,n);const r=t.range.start.root==e.position.root,o=r&&"same"===Sn(t.range.start.getParentPath(),e.position.getParentPath()),i=t.range.start.offset=e.position.offset;if(o&&i)return[e.getReversed(),t.clone()];if(r&&"same"===Sn(e.position.getParentPath(),t.range.end.getShiftedBy(-1).path)){const e=t.clone();return e._insertOperation.position.offset++,e._moveOperation.howMany++,e._moveOperation.targetPosition.path[e._moveOperation.targetPosition.path.length-2]++,[e]}return ld(t,e,n)}),cd(Ua,qa,(t,e,n)=>{const r=n.undoMode,o=ld(t,e,n);if(r||!(e._cloneOperation instanceof Oa))return o;const i=e._cloneOperation.position.getShiftedBy(-1);if(i&&t.operations[0].position.isEqual(i)){const e=t.clone();e.operations[0].position=i.getShiftedBy(1),o.push(e)}return o}),cd(qa,Ua,(t,e,n)=>{t=t.clone();const r=n.undoMode;if(r||!(t._cloneOperation instanceof Oa))return[t];const o=t._cloneOperation.position.getShiftedBy(-1);if(o&&!r&&e.operations[0].position.isEqual(o)){const n=e.clone();return n.operations[0].position=o.getShiftedBy(1),n.operations[0].oldName=t._cloneOperation.nodes.getNode(0).name,[t,n]}return[t]}),cd($a,qa,(t,e,n)=>{const r=ld(t,e,n),o=e._cloneOperation.position||e._cloneOperation.targetPosition;if(!o)return ld(t,e,n);if(n.undoMode)return r;for(const t of r)if(t instanceof $a){const e=t._moveOperation;e.sourcePosition.getShiftedBy(e.howMany).isEqual(o)&&(e.howMany+=1)}return r}),cd(qa,$a,(t,e,n)=>{if(n.undoMode)return ld(t,e,n);const r=t._cloneOperation.position||t._cloneOperation.targetPosition;if(!r)return ld(t,e,n);const o=(e=e.clone())._moveOperation;return o.sourcePosition.getShiftedBy(o.howMany).isEqual(r)&&(o.howMany+=1),ld(t,e,n)});class fd{constructor(t="default"){this.deltas=[],this.type=t}get baseVersion(){for(const t of this.deltas)if(null!==t.baseVersion)return t.baseVersion;return null}addDelta(t){return t.batch=this,this.deltas.push(t),t}*getOperations(){for(const t of this.deltas)yield*t.operations}}class pd extends La{static get className(){return"engine.model.delta.RootAttributeDelta"}}Ba.register(pd);class md extends ba{constructor(t,e){super(null),this.sourcePosition=vs.createFromPosition(t),this.howMany=e}get type(){return"detach"}_validate(){if(this.sourcePosition.root.document)throw new m.b("detach-operation-on-document-node: Cannot detach document node.")}_execute(){_a(_s.createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"engine.model.operation.DetachOperation"}}class gd extends ms{constructor(t,e,n="main"){super(e),this._doc=t,this.rootName=n}get document(){return this._doc}is(t,e){return e?"rootElement"==t&&e==this.name||super.is(t,e):"rootElement"==t||super.is(t)}toJSON(){return this.rootName}}class bd{constructor(t,e){this.model=t,this.batch=e}createText(t,e){return new hs(t,e)}createElement(t,e){return new ms(t,e)}createDocumentFragment(){return new wa}insert(t,e,n){this._assertWriterUsedCorrectly();const r=vs.createAt(e,n),o=t instanceof hs&&!t.parent?new Ja:new Ka;if(t.parent){if(yd(t.root,r.root))return void this.move(_s.createOn(t),r);if(t.root.document)throw new Error("model-writer-insert-forbidden-move: Cannot move a node from a document to a different tree.");this.remove(t)}const i=r.root.document?r.root.document.version:null,s=new Oa(r,t,i);if(this.batch.addDelta(o),o.addOperation(s),this.model.applyOperation(s),t instanceof wa)for(const[e,n]of t.markers){const t=vs.createAt(n.root),o=new _s(n.start._getCombined(t,r),n.end._getCombined(t,r));this.addMarker(e,{range:o,usingOperation:!0})}}insertText(t,e,n,r){e instanceof wa||e instanceof ms||e instanceof vs?this.insert(this.createText(t),e,n):this.insert(this.createText(t,e),n,r)}insertElement(t,e,n,r){e instanceof wa||e instanceof ms||e instanceof vs?this.insert(this.createElement(t),e,n):this.insert(this.createElement(t,e),n,r)}append(t,e){this.insert(t,e,"end")}appendText(t,e,n){e instanceof wa||e instanceof ms?this.insert(this.createText(t),e,"end"):this.insert(this.createText(t,e),n,"end")}appendElement(t,e,n){e instanceof wa||e instanceof ms?this.insert(this.createElement(t),e,"end"):this.insert(this.createElement(t,e),n,"end")}setAttribute(t,e,n){this._assertWriterUsedCorrectly(),n instanceof _s?wd(this,t,e,n):vd(this,t,e,n)}setAttributes(t,e){for(const[n,r]of us(t))this.setAttribute(n,r,e)}removeAttribute(t,e){this._assertWriterUsedCorrectly(),e instanceof _s?wd(this,t,null,e):vd(this,t,null,e)}clearAttributes(t){this._assertWriterUsedCorrectly();const e=t=>{for(const e of t.getAttributeKeys())this.removeAttribute(e,t)};if(t instanceof _s)for(const n of t.getItems())e(n);else e(t)}move(t,e,n){if(this._assertWriterUsedCorrectly(),!(t instanceof _s))throw new m.b("writer-move-invalid-range: Invalid range to move.");if(!t.isFlat)throw new m.b("writer-move-range-not-flat: Range to move is not flat.");const r=vs.createAt(e,n);if(!yd(t.root,r.root))throw new m.b("writer-move-different-document: Range is going to be moved between different documents.");const o=new Ha;this.batch.addDelta(o);const i=t.root.document?t.root.document.version:null,s=new Ea(t.start,t.end.offset-t.start.offset,r,i);o.addOperation(s),this.model.applyOperation(s)}remove(t){this._assertWriterUsedCorrectly();const e=(t,e)=>{const n=new $a;this.batch.addDelta(n),kd(t,e,n,this.model)};if(t instanceof _s){const n=t.getMinimalFlatRanges().reverse();for(const t of n)e(t.start,t.end.offset-t.start.offset)}else{const n=t.is("text")?t.offsetSize:1;e(vs.createBefore(t),n)}}merge(t){this._assertWriterUsedCorrectly();const e=new ja;this.batch.addDelta(e);const n=t.nodeBefore,r=t.nodeAfter;if(!(n instanceof ms))throw new m.b("writer-merge-no-element-before: Node before merge position must be an element.");if(!(r instanceof ms))throw new m.b("writer-merge-no-element-after: Node after merge position must be an element.");const o=vs.createFromParentAndOffset(r,0),i=vs.createFromParentAndOffset(n,n.maxOffset),s=t.root.document?t.root.document.version:null,a=new Ea(o,r.maxOffset,i,s);a.isSticky=!0,e.addOperation(a),this.model.applyOperation(a),kd(t,1,e,this.model)}rename(t,e){if(this._assertWriterUsedCorrectly(),!(t instanceof ms))throw new m.b("writer-rename-not-element-instance: Trying to rename an object which is not an instance of Element.");const n=new Ua;this.batch.addDelta(n);const r=t.root.document?t.root.document.version:null,o=new Ia(vs.createBefore(t),t.name,e,r);n.addOperation(o),this.model.applyOperation(o)}split(t,e){this._assertWriterUsedCorrectly();let n,r,o=t.parent;if(!o.parent)throw new m.b("writer-split-element-no-parent: Element with no parent can not be split.");if(e||(e=o.parent),!t.parent.getAncestors({includeSelf:!0}).includes(e))throw new m.b("writer-split-invalid-limit-element: Limit element is not a position ancestor.");do{const e=new qa;this.batch.addDelta(e);const i=new ms(o.name,o.getAttributes()),s=o.root.document?o.root.document.version:null,a=new Oa(vs.createAfter(o),i,s);e.addOperation(a),this.model.applyOperation(a);const c=null!==s?s+1:null,l=new Ea(t,o.maxOffset-t.offset,vs.createFromParentAndOffset(i,0),c);l.isSticky=!0,e.addOperation(l),this.model.applyOperation(l),n||r||(n=o,r=i),o=(t=vs.createBefore(i)).parent}while(o!==e);return{position:t,range:new _s(vs.createAt(n,"end"),vs.createAt(r))}}wrap(t,e){if(this._assertWriterUsedCorrectly(),!t.isFlat)throw new m.b("writer-wrap-range-not-flat: Range to wrap is not flat.");const n=e instanceof ms?e:new ms(e);if(n.childCount>0)throw new m.b("writer-wrap-element-not-empty: Element to wrap with is not empty.");if(null!==n.parent)throw new m.b("writer-wrap-element-attached: Element to wrap with is already attached to tree model.");const r=new Wa;this.batch.addDelta(r);const o=t.root.document?t.root.document.version:null,i=new Oa(t.end,n,o);r.addOperation(i),this.model.applyOperation(i);const s=null!==o?o+1:null,a=vs.createFromParentAndOffset(n,0),c=new Ea(t.start,t.end.offset-t.start.offset,a,s);r.addOperation(c),this.model.applyOperation(c)}unwrap(t){if(this._assertWriterUsedCorrectly(),null===t.parent)throw new m.b("writer-unwrap-element-no-parent: Trying to unwrap an element which has no parent.");const e=new Ga;this.batch.addDelta(e);const n=vs.createFromParentAndOffset(t,0),r=n.root.document?n.root.document.version:null,o=new Ea(n,t.maxOffset,vs.createBefore(t),r);o.isSticky=!0,e.addOperation(o),this.model.applyOperation(o),kd(vs.createBefore(t),1,e,this.model)}addMarker(t,e){if(this._assertWriterUsedCorrectly(),!e||"boolean"!=typeof e.usingOperation)throw new m.b("writer-addMarker-no-usingOperations: The options.usingOperations parameter is required when adding a new marker.");const n=e.usingOperation,r=e.range,o=void 0!==e.affectsData&&e.affectsData;if(this.model.markers.has(t))throw new m.b("writer-addMarker-marker-exists: Marker with provided name already exists.");if(!r)throw new m.b("writer-addMarker-no-range: Range parameter is required when adding a new marker.");return n?(_d(this,t,null,r,o),this.model.markers.get(t)):this.model.markers._set(t,r,n,o)}updateMarker(t,e={}){this._assertWriterUsedCorrectly();const n="string"==typeof t?t:t.name,r=this.model.markers.get(n);if(!r)throw new m.b("writer-updateMarker-marker-not-exists: Marker with provided name does not exists.");const o="boolean"==typeof e.usingOperation,i="boolean"==typeof e.affectsData,s=i?e.affectsData:r.affectsData;if(!o&&!e.range&&!i)throw new m.b("writer-updateMarker-wrong-options: One of the options is required - provide range, usingOperations or affectsData.");const a=r.getRange(),c=e.range?e.range:a;o&&e.usingOperation!==r.managedUsingOperations?e.usingOperation?_d(this,n,null,c,s):(_d(this,n,a,null,s),this.model.markers._set(n,c,void 0,s)):r.managedUsingOperations?_d(this,n,a,c,s):this.model.markers._set(n,c,void 0,s)}removeMarker(t){this._assertWriterUsedCorrectly();const e="string"==typeof t?t:t.name;if(!this.model.markers.has(e))throw new m.b("writer-removeMarker-no-marker: Trying to remove marker which does not exist.");const n=this.model.markers.get(e);n.managedUsingOperations?_d(this,e,n.getRange(),null,n.affectsData):this.model.markers._remove(e)}setSelection(t,e,n){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(t,e,n)}setSelectionFocus(t,e){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(t,e)}setSelectionAttribute(t,e){if(this._assertWriterUsedCorrectly(),"string"==typeof t)this._setSelectionAttribute(t,e);else for(const[e,n]of us(t))this._setSelectionAttribute(e,n)}removeSelectionAttribute(t){if(this._assertWriterUsedCorrectly(),"string"==typeof t)this._removeSelectionAttribute(t);else for(const e of t)this._removeSelectionAttribute(e)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(t){this.model.document.selection._restoreGravity(t)}_setSelectionAttribute(t,e){const n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){const r=Rs._getStoreAttributeKey(t);this.setAttribute(r,e,n.anchor.parent)}n._setAttribute(t,e)}_removeSelectionAttribute(t){const e=this.model.document.selection;if(e.isCollapsed&&e.anchor.parent.isEmpty){const n=Rs._getStoreAttributeKey(t);this.removeAttribute(n,e.anchor.parent)}e._removeAttribute(t)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new m.b("writer-incorrect-use: Trying to use a writer outside the change() block.")}}function wd(t,e,n,r){const o=new za,i=t.model,s=i.document;let a,c,l,u=r.start;for(const t of r)l=t.item.getAttribute(e),a&&c!=l&&(c!=n&&d(),u=a),a=t.nextPosition,c=l;function d(){0===o.operations.length&&t.batch.addDelta(o);const r=new _s(u,a),l=r.root.document?s.version:null,d=new Ta(r,e,c,n,l);o.addOperation(d),i.applyOperation(d)}a instanceof vs&&a!=u&&c!=n&&d()}function vd(t,e,n,r){const o=t.model,i=o.document,s=r.getAttribute(e);let a,c;if(s!=n){const l=r.root===r,u=l?new pd:new za;if(t.batch.addDelta(u),l){const t=r.document?i.version:null;c=new Fa(r,e,s,n,t)}else{const t=(a=r.is("element")?new _s(vs.createBefore(r),vs.createFromParentAndOffset(r,0)):new _s(vs.createBefore(r),vs.createAfter(r))).root.document?i.version:null;c=new Ta(a,e,s,n,t)}u.addOperation(c),o.applyOperation(c)}}function _d(t,e,n,r,o){const i=t.model,s=i.document,a=new ad,c=new Ra(e,n,r,i.markers,s.version,o);t.batch.addDelta(a),a.addOperation(c),i.applyOperation(c)}function kd(t,e,n,r){let o;if(t.root.document){const n=r.document,i=new vs(n.graveyard,[0]);o=new Pa(t,e,i,n.version)}else o=new md(t,e);n.addOperation(o),r.applyOperation(o)}function yd(t,e){return t===e||t instanceof gd&&e instanceof gd}class xd{constructor(t){this._markerCollection=t,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(t){switch(t.type){case"insert":if(this._isInInsertedElement(t.position.parent))return;this._markInsert(t.position.parent,t.position.offset,t.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const e of t.range.getItems())this._isInInsertedElement(e.parent)||this._markAttribute(e);break;case"remove":case"move":case"reinsert":{const e=this._isInInsertedElement(t.sourcePosition.parent),n=this._isInInsertedElement(t.targetPosition.parent);e||this._markRemove(t.sourcePosition.parent,t.sourcePosition.offset,t.howMany),n||this._markInsert(t.targetPosition.parent,t.getMovedRangeStart().offset,t.howMany);break}case"rename":{if(this._isInInsertedElement(t.position.parent))return;this._markRemove(t.position.parent,t.position.offset,1),this._markInsert(t.position.parent,t.position.offset,1);const e=_s.createFromPositionAndShift(t.position,1);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getRange();this.bufferMarkerChange(t.name,e,e,t.affectsData)}break}}this._cachedChanges=null}bufferMarkerChange(t,e,n,r){const o=this._changedMarkers.get(t);o?(o.newRange=n,o.affectsData=r,null==o.oldRange&&null==o.newRange&&this._changedMarkers.delete(t)):this._changedMarkers.set(t,{oldRange:e,newRange:n,affectsData:r})}getMarkersToRemove(){const t=[];for(const[e,n]of this._changedMarkers)null!=n.oldRange&&t.push({name:e,range:n.oldRange});return t}getMarkersToAdd(){const t=[];for(const[e,n]of this._changedMarkers)null!=n.newRange&&t.push({name:e,range:n.newRange});return t}hasDataChanges(){for(const[,t]of this._changedMarkers)if(t.affectsData)return!0;return this._changesInElement.size>0}getChanges(t={includeChangesInGraveyard:!1}){if(this._cachedChanges)return t.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();const e=[];for(const t of this._changesInElement.keys()){const n=this._changesInElement.get(t).sort((t,e)=>t.offset===e.offset?t.type!=e.type?"remove"==t.type?-1:1:0:t.offsett.position.root!=e.position.root?t.position.root.rootNamen.offset){if(r>o){const t={type:"attribute",offset:o,howMany:r-o,count:this._changeCount++};this._handleChange(t,e),e.push(t)}t.nodesToHandle=n.offset-t.offset,t.howMany=t.nodesToHandle}else t.offset>=n.offset&&t.offseto?(t.nodesToHandle=r-o,t.offset=o):t.nodesToHandle=0);"attribute"==n.type&&(t.offset>=n.offset&&r<=o?(t.nodesToHandle=0,t.howMany=0,t.offset=0):t.offset<=n.offset&&r>=o&&(n.howMany=0))}}t.howMany=t.nodesToHandle,delete t.nodesToHandle}_getInsertDiff(t,e,n){return{type:"insert",position:vs.createFromParentAndOffset(t,e),name:n,length:1,changeCount:this._changeCount++}}_getRemoveDiff(t,e,n){return{type:"remove",position:vs.createFromParentAndOffset(t,e),name:n,length:1,changeCount:this._changeCount++}}_getAttributesDiff(t,e,n){const r=[];n=new Map(n);for(const[o,i]of e){const e=n.has(o)?n.get(o):null;e!==i&&r.push({type:"attribute",position:t.start,range:_s.createFromRange(t),length:1,attributeKey:o,attributeOldValue:i,attributeNewValue:e,changeCount:this._changeCount++}),n.delete(o)}for(const[e,o]of n)r.push({type:"attribute",position:t.start,range:_s.createFromRange(t),length:1,attributeKey:e,attributeOldValue:null,attributeNewValue:o,changeCount:this._changeCount++});return r}_isInInsertedElement(t){const e=t.parent;if(!e)return!1;const n=this._changesInElement.get(e),r=t.startOffset;if(n)for(const t of n)if("insert"==t.type&&r>=t.offset&&rr&&(n.push(..."e".repeat(t.offset-r).split("")),o+=t.offset-r),"insert"==t.type?(n.push(..."i".repeat(t.howMany).split("")),r=t.offset+t.howMany):"remove"==t.type?(n.push(..."r".repeat(t.howMany).split("")),r=t.offset,o+=t.howMany):(n.push(..."a".repeat(t.howMany).split("")),r=t.offset+t.howMany,o+=t.howMany);return o0&&!this._historyPoints.has(t.baseVersion)){const e=this._deltas.length;this._deltas[e]=t,this._historyPoints.set(t.baseVersion,e)}}*getDeltas(t=0,e=Number.POSITIVE_INFINITY){if(0===this._deltas.length)return;let n=this._getIndex(t);if(-1!=n)for(;n=e)break;yield t}}getDelta(t){const e=this._historyPoints.get(t);return void 0===e?null:this._deltas[e]}setDeltaAsUndone(t,e){this._undoPairs.set(e,t),this._undoneDeltas.add(t)}isUndoingDelta(t){return this._undoPairs.has(t)}isUndoneDelta(t){return this._undoneDeltas.has(t)}getUndoneDelta(t){return this._undoPairs.get(t)}_getIndex(t){const e=this._historyPoints.get(t);if(void 0===e){const e=this._deltas[this._deltas.length-1],n=e.baseVersion+e.operations.length;if(t<0||t>=n)return-1;throw new m.b("model-history-wrong-version: Given base version points to the middle of a delta.")}return e}}function Sd(t,e){return function(t){return!!t&&1==t.length&&/[\ud800-\udbff]/.test(t)}(t.charAt(e-1))&&function(t){return!!t&&1==t.length&&/[\udc00-\udfff]/.test(t)}(t.charAt(e))}function Pd(t,e){return function(t){return!!t&&1==t.length&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(t)}(t.charAt(e))}const Od="$graveyard";class Rd{constructor(t){this.model=t,this.version=0,this.history=new Ed(this),this.selection=new Rs(this),this.roots=new Lr({idProperty:"rootName"}),this.differ=new xd(t.markers),this._postFixers=new Set,this.createRoot("$root",Od),this.listenTo(t,"applyOperation",(t,e)=>{const n=e[0];if(n.isDocumentOperation&&n.baseVersion!==this.version)throw new m.b("model-document-applyOperation-wrong-version: Only operations with matching versions can be applied.",{operation:n})},{priority:"highest"}),this.listenTo(t,"applyOperation",(t,e)=>{const n=e[0];n.isDocumentOperation&&this.differ.bufferOperation(n)},{priority:"high"}),this.listenTo(t,"applyOperation",(t,e)=>{const n=e[0];n.isDocumentOperation&&(this.version++,this.history.addDelta(n.delta))},{priority:"low"});let e=!1;this.listenTo(this.selection,"change",()=>{e=!0}),this.listenTo(t,"_change",(t,n)=>{this.differ.isEmpty&&!e||(this._callPostFixers(n),this.differ.hasDataChanges()?this.fire("change:data",n.batch):this.fire("change",n.batch),this.differ.reset(),e=!1)}),this.listenTo(t.markers,"update",(t,e,n,r)=>{this.differ.bufferMarkerChange(e.name,n,r,e.affectsData),null===n&&e.on("change",(t,n)=>{this.differ.bufferMarkerChange(e.name,n,e.getRange(),e.affectsData)})})}get graveyard(){return this.getRoot(Od)}createRoot(t="$root",e="main"){if(this.roots.get(e))throw new m.b("model-document-createRoot-name-exists: Root with specified name already exists.",{name:e});const n=new gd(this,t,e);return this.roots.add(n),n}destroy(){this.selection.destroy(),this.stopListening()}getRoot(t="main"){return this.roots.get(t)}getRootNames(){return Array.from(this.roots,t=>t.rootName).filter(t=>t!=Od)}registerPostFixer(t){this._postFixers.add(t)}toJSON(){const t=En(this);return t.selection="[engine.model.DocumentSelection]",t.model="[engine.model.Model]",t}_getDefaultRoot(){for(const t of this.roots)if(t!==this.graveyard)return t;return this.graveyard}_getDefaultRange(){const t=this._getDefaultRoot(),e=this.model.schema,n=new vs(t,[0]);return e.getNearestSelectionRange(n)||new _s(n)}_validateSelectionRange(t){return Dd(t.start)&&Dd(t.end)}_callPostFixers(t){let e=!1;do{for(const n of this._postFixers)if(e=n(t))break}while(e)}}function Dd(t){const e=t.textNode;if(e){const n=e.data,r=t.offset-e.startOffset;return!Sd(n,r)&&!Pd(n,r)}return!0}P(Rd,y);class Id{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(t){return this._markers.has(t)}get(t){return this._markers.get(t)||null}_set(t,e,n=!1,r=!1){const o=t instanceof Fd?t.name:t,i=this._markers.get(o);if(i){const t=i.getRange();let s=!1;return t.isEqual(e)||(i._attachLiveRange(Ps.createFromRange(e)),s=!0),n!=i.managedUsingOperations&&(i._managedUsingOperations=n,s=!0),"boolean"==typeof r&&r!=i.affectsData&&(i._affectsData=r,s=!0),s&&this.fire("update:"+o,i,t,e),i}const s=Ps.createFromRange(e),a=new Fd(o,s,n,r);return this._markers.set(o,a),this.fire("update:"+o,a,null,e),a}_remove(t){const e=t instanceof Fd?t.name:t,n=this._markers.get(e);return!!n&&(this._markers.delete(e),this.fire("update:"+e,n,n.getRange(),null),this._destroyMarker(n),!0)}*getMarkersAtPosition(t){for(const e of this)e.getRange().containsPosition(t)&&(yield e)}*getMarkersIntersectingRange(t){for(const e of this)null!==e.getRange().getIntersection(t)&&(yield e)}destroy(){for(const t of this._markers.values())this._destroyMarker(t);this._markers=null,this.stopListening()}*getMarkersGroup(t){for(const e of this._markers.values())e.name.startsWith(t+":")&&(yield e)}_destroyMarker(t){t.stopListening(),t._detachLiveRange()}}P(Id,y);class Fd{constructor(t,e,n,r){this.name=t,this._liveRange=this._attachLiveRange(e),this._managedUsingOperations=n,this._affectsData=r}get managedUsingOperations(){if(!this._liveRange)throw new m.b("marker-destroyed: Cannot use a destroyed marker instance.");return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new m.b("marker-destroyed: Cannot use a destroyed marker instance.");return this._affectsData}getStart(){if(!this._liveRange)throw new m.b("marker-destroyed: Cannot use a destroyed marker instance.");return vs.createFromPosition(this._liveRange.start)}getEnd(){if(!this._liveRange)throw new m.b("marker-destroyed: Cannot use a destroyed marker instance.");return vs.createFromPosition(this._liveRange.end)}getRange(){if(!this._liveRange)throw new m.b("marker-destroyed: Cannot use a destroyed marker instance.");return _s.createFromRange(this._liveRange)}_attachLiveRange(t){return this._liveRange&&this._detachLiveRange(),t.delegate("change:range").to(this),t.delegate("change:content").to(this),this._liveRange=t,t}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}P(Fd,y);class Nd extends vs{constructor(t,e,n){if(super(t,e),!this.root.is("rootElement"))throw new m.b("model-liveposition-root-not-rootelement: LivePosition's root has to be an instance of RootElement.");this.stickiness=n||"sticksToNext",function(){const t=new Set(["insert","move","remove","reinsert"]);this.listenTo(this.root.document.model,"applyOperation",(e,n)=>{const r=n[0];r.isDocumentOperation&&t.has(r.type)&&function(t){let e,n;"insert"==t.type?e=_s.createFromPositionAndShift(t.position,t.nodes.maxOffset):(e=_s.createFromPositionAndShift(t.getMovedRangeStart(),t.howMany),n=t.sourcePosition);const r=e.end.offset-e.start.offset;let o;switch(t.type){case"insert":const i="sticksToNext"==this.stickiness;o=this._getTransformedByInsertion(e.start,r,i);break;case"move":case"remove":case"reinsert":const s=_s.createFromPositionAndShift(n,r),a=s.containsPosition(this)||s.start.isEqual(this)&&"sticksToNext"==this.stickiness||s.end.isEqual(this)&&"sticksToPrevious"==this.stickiness;if(a)o=this._getCombined(n,e.start);else{const t="sticksToNext"==this.stickiness,i=e.start._getTransformedByInsertion(n,r);o=this._getTransformedByMove(n,i,r,t)}}if(!this.isEqual(o)){const t=vs.createFromPosition(this);this.path=o.path,this.root=o.root,this.fire("change",t)}}.call(this,r)},{priority:"low"})}.call(this)}detach(){this.stopListening()}}P(Nd,y);class Md{constructor(t,e,n){this.model=t,this.writer=e,this.position=n,this.canMergeWith=new Set([this.position.parent]),this.schema=t.schema,this._filterAttributesOf=[]}handleNodes(t,e){t=Array.from(t);for(let n=0;n{if(!n.doNotResetEntireContent&&function(t,e){const n=t.getLimitElement(e);if(!e.containsEntireContent(n))return!1;const r=e.getFirstRange();if(r.start.parent==r.end.parent)return!1;return t.checkChild(n,"paragraph")}(r,e))return void function(t,e){const n=t.model.schema.getLimitElement(e);t.remove(_s.createIn(n)),Bd(t,vs.createAt(n),e)}(t,e);const o=e.getFirstRange(),i=o.start,s=Nd.createFromPosition(o.end);o.start.isTouching(o.end)||t.remove(o),n.leaveUnmerged||(!function t(e,n,r){const o=n.parent;const i=r.parent;if(o==i)return;if(!o.parent||!i.parent)return;if(!function(t,e,n){const r=new _s(t,e);for(const t of r.getWalker())if(n.isLimit(t.item))return!1;return!0}(n,r,e.model.schema))return;n=vs.createAfter(o);r=vs.createBefore(i);r.isEqual(n)||e.insert(i,n);e.merge(n);for(;r.parent.isEmpty;){const t=r.parent;r=vs.createBefore(t),e.remove(t)}t(e,n,r)}(t,i,s),r.removeDisallowedAttributes(i.parent.getChildren(),t)),e instanceof Rs?t.setSelection(i):e.setTo(i),function(t,e){const n=t.checkChild(e,"$text"),r=t.checkChild(e,"paragraph");return!n&&r}(r,i)&&Bd(t,i,e),s.detach()})}function Bd(t,e,n){const r=t.createElement("paragraph");t.insert(r,e),n instanceof Rs?t.setSelection(r,0):n.setTo(r,0)}const Ld=' ,.?!:;"-()';function zd(t,e,n={}){const r=t.schema,o="backward"!=n.direction,i=n.unit?n.unit:"character",s=e.focus,a=new gs({boundaries:function(t,e){const n=t.root,r=vs.createAt(n,e?"end":0);return e?new _s(t,r):new _s(r,t)}(s,o),singleCharacters:!0,direction:o?"forward":"backward"}),c={walker:a,schema:r,isForward:o,unit:i};let l;for(;l=a.next();){if(l.done)return;const n=qd(c,l.value);if(n)return void(e instanceof Rs?t.change(t=>{t.setSelectionFocus(n)}):e.setFocus(n))}}function qd(t,e){if("text"==e.type)return"word"===t.unit?function(t,e){let n=t.position.textNode;if(n){let r=t.position.offset-n.startOffset;for(;!jd(n.data,r,e)&&!Hd(n,r,e);){t.next();const o=e?t.position.nodeAfter:t.position.nodeBefore;if(o&&o.is("text")){const r=o.data.charAt(e?0:o.data.length-1);Ld.includes(r)||(t.next(),n=t.position.textNode)}r=t.position.offset-n.startOffset}}return t.position}(t.walker,t.isForward):function(t,e){const n=t.position.textNode;if(n){const r=n.data;let o=t.position.offset-n.startOffset;for(;Sd(r,o)||"character"==e&&Pd(r,o);)t.next(),o=t.position.offset-n.startOffset}return t.position}(t.walker,t.unit,t.isForward);if(e.type==(t.isForward?"elementStart":"elementEnd")){if(t.schema.isObject(e.item))return vs.createAt(e.item,t.isForward?"after":"before");if(t.schema.checkChild(e.nextPosition,"$text"))return e.nextPosition}else{if(t.schema.isLimit(e.item))return void t.walker.skip(()=>!0);if(t.schema.checkChild(e.nextPosition,"$text"))return e.nextPosition}}function jd(t,e,n){const r=e+(n?0:-1);return Ld.includes(t.charAt(r))}function Hd(t,e,n){return e===(n?t.endOffset:0)}function $d(t,e){const n=[];Array.from(t.getItems({direction:"backward"})).map(t=>_s.createOn(t)).filter(e=>{return(e.start.isAfter(t.start)||e.start.isEqual(t.start))&&(e.end.isBefore(t.end)||e.end.isEqual(t.end))}).forEach(t=>{n.push(t.start.parent),e.remove(t)}),n.forEach(t=>{let n=t;for(;n.parent&&n.isEmpty;){const t=_s.createOn(n);n=n.parent,e.remove(t)}})}function Ud(t){t.document.registerPostFixer(e=>(function(t,e){const n=e.document.selection,r=e.schema,o=[];let i=!1;for(const t of n.getRanges()){const e=Wd(t,r);e?(o.push(e),i=!0):o.push(t)}if(i){let e=o;if(o.length>1){const t=o[0].start,n=o[o.length-1].end;e=[new _s(t,n)]}t.setSelection(e,{backward:n.isBackward})}})(e,t))}function Wd(t,e){return t.isCollapsed?function(t,e){const n=t.start,r=e.getNearestSelectionRange(n);if(!r)return null;const o=r.start;if(n.isEqual(o))return null;if(o.nodeAfter&&e.isLimit(o.nodeAfter))return new _s(o,vs.createAfter(o.nodeAfter));return new _s(o)}(t,e):function(t,e){const n=t.start,r=t.end,o=e.checkChild(n,"$text"),i=e.checkChild(r,"$text"),s=e.getLimitElement(n),a=e.getLimitElement(r);if(s===a){if(o&&i)return null;if(function(t,e,n){const r=t.nodeAfter&&!n.isLimit(t.nodeAfter)||n.checkChild(t,"$text"),o=e.nodeBefore&&!n.isLimit(e.nodeBefore)||n.checkChild(e,"$text");return r&&o}(n,r,e)){const t=e.getNearestSelectionRange(n,"forward"),o=e.getNearestSelectionRange(r,"backward");return new _s(t?t.start:n,o?o.start:r)}}const c=s&&!s.is("rootElement"),l=a&&!a.is("rootElement");if(c||l){const t=c?Gd(vs.createAt(s),e,"start"):n,o=l?Gd(vs.createAt(a),e,"end"):r;return new _s(t,o)}return null}(t,e)}function Gd(t,e,n){let r=t.parent,o=r;for(;e.isLimit(o)&&o.parent;)r=o,o=o.parent;return"start"===n?vs.createBefore(r):vs.createAfter(r)}class Kd{constructor(){this.markers=new Id,this.document=new Rd(this),this.schema=new Ks,this._pendingChanges=[],this._currentWriter=null,["insertContent","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(t=>this.decorate(t)),this.on("applyOperation",(t,e)=>{e[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$block",{allowIn:"$root",isBlock:!0}),this.schema.register("$text",{allowIn:"$block"}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",isLimit:!0}),this.schema.extend("$text",{allowIn:"$clipboardHolder"}),this.schema.register("$marker",{allowIn:["$root","$block"]}),Ud(this)}change(t){return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new fd,callback:t}),this._runPendingChanges()[0]):t(this._currentWriter)}enqueueChange(t,e){"string"==typeof t?t=new fd(t):"function"==typeof t&&(e=t,t=new fd),this._pendingChanges.push({batch:t,callback:e}),1==this._pendingChanges.length&&this._runPendingChanges()}applyOperation(t){t._execute()}transformDeltas(t,e,n=!1){return ed.transformDeltaSets(t,e,n?this.document:null)}insertContent(t,e){!function(t,e,n){t.change(r=>{n.isCollapsed||t.deleteContent(n);const o=new Md(t,r,n.anchor);let i;i=e.is("documentFragment")?e.getChildren():[e],o.handleNodes(i,{isFirst:!0,isLast:!0});const s=o.getSelectionRange();s?n instanceof Rs?r.setSelection(s):n.setTo(s):Hi.a.warn("insertcontent-no-range: Cannot determine a proper selection range after insertion.")})}(this,t,e)}deleteContent(t,e){Vd(this,t,e)}modifySelection(t,e){zd(this,t,e)}getSelectedContent(t){return function(t,e){return t.change(t=>{const n=t.createDocumentFragment(),r=e.getFirstRange();if(!r||r.isCollapsed)return n;const o=r.start.root,i=r.start.getCommonPath(r.end),s=o.getNodeByPath(i);let a;const c=(a=r.start.parent==r.end.parent?r:_s.createFromParentsAndOffsets(s,r.start.path[i.length],s,r.end.path[i.length]+1)).end.offset-a.start.offset;for(const e of a.getItems({shallow:!0}))e.is("textProxy")?t.appendText(e.data,e.getAttributes(),n):t.append(e._clone(!0),n);if(a!=r){const e=r._getTransformedByMove(a.start,vs.createAt(n,0),c)[0],o=new _s(vs.createAt(n),e.start);$d(new _s(e.end,vs.createAt(n,"end")),t),$d(o,t)}return n})}(this,t)}hasContent(t){if(t instanceof ms&&(t=_s.createIn(t)),t.isCollapsed)return!1;for(const e of t.getItems())if(e.is("textProxy")||this.schema.isObject(e))return!0;return!1}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const t=[];for(;this._pendingChanges.length;){const e=this._pendingChanges[0].batch;this._currentWriter=new bd(this,e);const n=this._pendingChanges[0].callback(this._currentWriter);t.push(n),this.fire("_change",this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return t}}P(Kd,yr);class Jd{constructor(){this._listener=Object.create(Uo)}listenTo(t){this._listener.listenTo(t,"keydown",(t,e)=>{this._listener.fire("_keydown:"+Yr(e),e)})}set(t,e,n={}){const r=Xr(t),o=n.priority;this._listener.listenTo(this._listener,"_keydown:"+r,(t,n)=>{e(n,()=>{n.preventDefault(),n.stopPropagation(),t.stop()}),t.return=!0},{priority:o})}press(t){return!!this._listener.fire("_keydown:"+Yr(t),t)}destroy(){this._listener.stopListening()}}class Zd extends Jd{constructor(t){super(),this.editor=t}set(t,e,n={}){if("string"==typeof e){const t=e;e=((e,n)=>{this.editor.execute(t),n()})}super.set(t,e,n)}}n(57);class Qd{constructor(t){const e=this.constructor.builtinPlugins;this.config=new p(t,this.constructor.defaultConfig),this.config.define("plugins",e),this.plugins=new js(this,e),this.commands=new Hs,this.locale=new Us(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 Kd,this.data=new fa(this.model),this.editing=new qs(this.model),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new pa,this.conversion.register("downcast",[this.editing.downcastDispatcher,this.data.downcastDispatcher]),this.conversion.register("editingDowncast",[this.editing.downcastDispatcher]),this.conversion.register("dataDowncast",[this.data.downcastDispatcher]),this.conversion.register("upcast",[this.data.upcastDispatcher]),this.keystrokes=new Zd(this),this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const t=this,e=this.config;return function(){const n=e.get("plugins")||[],r=e.get("removePlugins")||[];return t.plugins.load(n,r)}().then(t=>n(t,"init").then(()=>n(t,"afterInit"))).then(()=>this.fire("pluginsReady"));function n(t,e){return t.reduce((t,n)=>n[e]?t.then(n[e].bind(n)):t,Promise.resolve())}}destroy(){let t=Promise.resolve();return"initializing"==this.state&&(t=new Promise(t=>this.once("ready",t))),t.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(...t){this.commands.execute(...t)}static create(t){return new Promise(e=>{const n=new this(t);e(n.initPlugins().then(()=>{n.fire("dataReady"),n.fire("ready")}).then(()=>n))})}}P(Qd,yr);var Yd={setData(t){this.data.set(t)},getData(){return this.data.get()}};var Xd={updateSourceElement(){if(!this.sourceElement)throw new m.b("editor-missing-sourceelement: Cannot update the source element of a detached editor.");!function(t,e){t instanceof HTMLTextAreaElement&&(t.value=e),t.innerHTML=e}(this.sourceElement,this.data.get())}};class th{getHtml(t){const e=document.implementation.createHTMLDocument("").createElement("div");return e.appendChild(t),e.innerHTML}}class eh{constructor(){this._domParser=new DOMParser,this._domConverter=new qo({blockFiller:bo}),this._htmlWriter=new th}toData(t){const e=this._domConverter.viewToDom(t,document);return this._htmlWriter.getHtml(e)}toView(t){const e=this._toDom(t);return this._domConverter.domToView(e)}_toDom(t){const e=this._domParser.parseFromString(t,"text/html"),n=e.createDocumentFragment(),r=e.body.childNodes;for(;r.length>0;)n.appendChild(r[0]);return n}}class nh{constructor(t){this.editor=t,this._components=new Map}*names(){for(const t of this._components.values())yield t.originalName}add(t,e){if(this.has(t))throw new m.b("componentfactory-item-exists: The item already exists in the component factory.",{name:t});this._components.set(rh(t),{callback:e,originalName:t})}create(t){if(!this.has(t))throw new m.b("componentfactory-item-missing: The required component is not registered in the factory.",{name:t});return this._components.get(rh(t)).callback(this.editor.locale)}has(t){return this._components.has(rh(t))}}function rh(t){return String(t).toLowerCase()}class oh{constructor(){this.set("isFocused",!1),this.focusedElement=null,this._elements=new Set,this._nextEventLoopTimeout=null}add(t){if(this._elements.has(t))throw new m.b("focusTracker-add-element-already-exist");this.listenTo(t,"focus",()=>this._focus(t),{useCapture:!0}),this.listenTo(t,"blur",()=>this._blur(),{useCapture:!0}),this._elements.add(t)}remove(t){t===this.focusedElement&&this._blur(t),this._elements.has(t)&&(this.stopListening(t),this._elements.delete(t))}_focus(t){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=t,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}P(oh,Uo),P(oh,yr);class ih{constructor(t,e){this.editor=t,this.view=e,this.componentFactory=new nh(t),this.focusTracker=new oh,this.listenTo(t.editing.view.document,"layoutChanged",()=>this.update())}update(){this.fire("update")}destroy(){this.stopListening(),this.view.destroy()}}P(ih,y);class sh extends ih{constructor(t,e){super(t,e),this._toolbarConfig=function(t){return Array.isArray(t)?{items:t}:t?Object.assign({items:[]},t):{items:[]}}(t.config.get("toolbar"))}init(){const t=this.editor,e=this.view;e.render(),e.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),e.stickyPanel.limiterElement=e.element,this._toolbarConfig.viewportTopOffset&&(e.stickyPanel.viewportTopOffset=this._toolbarConfig.viewportTopOffset);const n=t.editing.view.document.getRoot();e.editable.bind("isReadOnly").to(n),e.editable.bind("isFocused").to(t.editing.view.document),e.editable.name=n.rootName,this.focusTracker.add(this.view.editableElement),this.view.toolbar.fillFromConfig(this._toolbarConfig.items,this.componentFactory),function({origin:t,originKeystrokeHandler:e,originFocusTracker:n,toolbar:r,beforeFocus:o,afterBlur:i}){n.add(r.element),e.set("Alt+F10",(t,e)=>{n.isFocused&&!r.focusTracker.isFocused&&(o&&o(),r.focus(),e())}),r.keystrokes.set("Esc",(e,n)=>{r.focusTracker.isFocused&&(t.focus(),i&&i(),n())})}({origin:t.editing.view,originFocusTracker:this.focusTracker,originKeystrokeHandler:t.keystrokes,toolbar:this.view.toolbar})}}class ah extends Lr{constructor(t){super({idProperty:"viewUid"}),this.on("add",(t,e,n)=>{e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[n])}),this.on("remove",(t,e)=>{e.element&&this._parentElement&&e.element.remove()}),this.locale=t,this._parentElement=null}destroy(){this.map(t=>t.destroy())}setParent(t){this._parentElement=t}delegate(...t){if(!t.length||!function(t){return t.every(t=>"string"==typeof t)}(t))throw new m.b("ui-viewcollection-delegate-wrong-events: All event names must be strings.");return{to:e=>{for(const n of this)for(const r of t)n.delegate(r).to(e);this.on("add",(n,r)=>{for(const n of t)r.delegate(n).to(e)}),this.on("remove",(n,r)=>{for(const n of t)r.stopDelegating(n,e)})}}}}P(Lr,yr);var ch=function(t,e){return Tn(t,!0,!0,e)};const lh="http://www.w3.org/1999/xhtml";class uh{constructor(t){Object.assign(this,vh(wh(t))),this._isRendered=!1,this._revertData=null}render(){const t=this._renderNode({intoFragment:!0});return this._isRendered=!0,t}apply(t){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:t,isApplying:!0,revertData:this._revertData}),t}revert(t){if(!this._revertData)throw new m.b("ui-template-revert-not-applied: Attempting to revert a template which has not been applied yet.");this._revertTemplateFromNode(t,this._revertData)}*getViews(){yield*function*t(e){if(e.children)for(const n of e.children)Ch(n)?yield n:Ah(n)&&(yield*t(n))}(this)}static bind(t,e){return{to:(n,r)=>new hh({eventNameOrFunction:n,attribute:n,observable:t,emitter:e,callback:r}),if:(n,r,o)=>new fh({observable:t,emitter:e,attribute:n,valueIfTrue:r,callback:o})}}static extend(t,e){t._isRendered&&Hi.a.warn("template-extend-render: Attempting to extend a template which has already been rendered."),function t(e,n){n.attributes&&(e.attributes||(e.attributes={}),yh(e.attributes,n.attributes));n.eventListeners&&(e.eventListeners||(e.eventListeners={}),yh(e.eventListeners,n.eventListeners));n.text&&e.text.push(...n.text);if(n.children&&n.children.length){if(e.children.length!=n.children.length)throw new m.b("ui-template-extend-children-mismatch: The number of children in extended definition does not match.");let r=0;for(const o of n.children)t(e.children[r++],o)}}(t,vh(wh(e)))}_renderNode(t){let e;if(e=t.node?this.tag&&this.text:this.tag?this.text:!this.text)throw new m.b('ui-template-wrong-syntax: Node definition must have either "tag" or "text" when rendering a new Node.');return this.text?this._renderText(t):this._renderElement(t)}_renderElement(t){let e=t.node;return e||(e=t.node=document.createElementNS(this.ns||lh,this.tag)),this._renderAttributes(t),this._renderElementChildren(t),this._setUpListeners(t),e}_renderText(t){let e=t.node;return e?t.revertData.text=e.textContent:e=t.node=document.createTextNode(""),ph(this.text)?this._bindToObservable({schema:this.text,updater:function(t){return{set(e){t.textContent=e},remove(){t.textContent=""}}}(e),data:t}):e.textContent=this.text.join(""),e}_renderAttributes(t){let e,n,r,o;if(!this.attributes)return;const i=t.node,s=t.revertData;for(e in this.attributes)if(r=i.getAttribute(e),n=this.attributes[e],s&&(s.attributes[e]=r),o=$(n[0])&&n[0].ns?n[0].ns:null,ph(n)){const a=o?n[0].value:n;s&&Eh(e)&&a.unshift(r),this._bindToObservable({schema:a,updater:gh(i,e,o),data:t})}else"style"==e&&"string"!=typeof n[0]?this._renderStyleAttribute(n[0],t):(s&&r&&Eh(e)&&n.unshift(r),xh(n=n.map(t=>t&&t.value||t).reduce((t,e)=>t.concat(e),[]).reduce(kh,""))||i.setAttributeNS(o,e,n))}_renderStyleAttribute(t,e){const n=e.node;for(const r in t){const o=t[r];ph(o)?this._bindToObservable({schema:[o],updater:bh(n,r),data:e}):n.style[r]=o}}_renderElementChildren(t){const e=t.node,n=t.intoFragment?document.createDocumentFragment():e,r=t.isApplying;let o=0;for(const i of this.children)if(Th(i)){if(!r){i.setParent(e);for(const t of i)n.appendChild(t.element)}}else if(Ch(i))r||(i.isRendered||i.render(),n.appendChild(i.element));else if(Oo(i))n.appendChild(i);else if(r){const e={children:[],bindings:[],attributes:{}};t.revertData.children.push(e),i._renderNode({node:n.childNodes[o++],isApplying:!0,revertData:e})}else n.appendChild(i.render());t.intoFragment&&e.appendChild(n)}_setUpListeners(t){if(this.eventListeners)for(const e in this.eventListeners){const n=this.eventListeners[e].map(n=>{const[r,o]=e.split("@");return n.activateDomEventListener(r,o,t)});t.revertData&&t.revertData.bindings.push(n)}}_bindToObservable({schema:t,updater:e,data:n}){const r=n.revertData;mh(t,e,n);const o=t.filter(t=>!xh(t)).filter(t=>t.observable).map(r=>r.activateAttributeListener(t,e,n));r&&r.bindings.push(o)}_revertTemplateFromNode(t,e){for(const t of e.bindings)for(const e of t)e();if(e.text)t.textContent=e.text;else{for(const n in e.attributes){const r=e.attributes[n];null===r?t.removeAttribute(n):t.setAttribute(n,r)}for(let n=0;nmh(t,e,n);return this.emitter.listenTo(this.observable,"change:"+this.attribute,r),()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,r)}}}class hh extends dh{activateDomEventListener(t,e,n){const r=(t,n)=>{e&&!n.target.matches(e)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(n):this.observable.fire(this.eventNameOrFunction,n))};return this.emitter.listenTo(n.node,t,r),()=>{this.emitter.stopListening(n.node,t,r)}}}class fh extends dh{getValue(t){return!xh(super.getValue(t))&&(this.valueIfTrue||!0)}}function ph(t){return!!t&&(t.value&&(t=t.value),Array.isArray(t)?t.some(ph):t instanceof dh)}function mh(t,e,{node:n}){let r=function(t,e){return t.map(t=>t instanceof dh?t.getValue(e):t)}(t,n);xh(r=1==t.length&&t[0]instanceof fh?r[0]:r.reduce(kh,""))?e.remove():e.set(r)}function gh(t,e,n){return{set(r){t.setAttributeNS(n,e,r)},remove(){t.removeAttributeNS(n,e)}}}function bh(t,e){return{set(n){t.style[e]=n},remove(){t.style[e]=null}}}function wh(t){return ch(t,t=>{if(t&&(t instanceof dh||Ah(t)||Ch(t)||Th(t)))return t})}function vh(t){if("string"==typeof t?t=function(t){return{text:[t]}}(t):t.text&&function(t){Array.isArray(t.text)||(t.text=[t.text])}(t),t.on&&(t.eventListeners=function(t){for(const e in t)_h(t,e);return t}(t.on),delete t.on),!t.text){t.attributes&&function(t){for(const e in t)t[e].value&&(t[e].value=[].concat(t[e].value)),_h(t,e)}(t.attributes);const e=[];if(t.children)if(Th(t.children))e.push(t.children);else for(const n of t.children)Ah(n)||Ch(n)||Oo(n)?e.push(n):e.push(new uh(n));t.children=e}return t}function _h(t,e){Array.isArray(t[e])||(t[e]=[t[e]])}function kh(t,e){return xh(e)?t:xh(t)?e:`${t} ${e}`}function yh(t,e){for(const n in e)t[n]?t[n].push(...e[n]):t[n]=e[n]}function xh(t){return!t&&0!==t}function Ch(t){return t instanceof Sh}function Ah(t){return t instanceof uh}function Th(t){return t instanceof ah}function Eh(t){return"class"==t||"style"==t}n(58);class Sh{constructor(t){this.element=null,this.isRendered=!1,this.locale=t,this.t=t&&t.t,this._viewCollections=new Lr,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(e,n)=>{n.locale=t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=uh.bind(this,this)}createCollection(){const t=new ah;return this._viewCollections.add(t),t}registerChild(t){In(t)||(t=[t]);for(const e of t)this._unboundChildren.add(e)}deregisterChild(t){In(t)||(t=[t]);for(const e of t)this._unboundChildren.remove(e)}setTemplate(t){this.template=new uh(t)}extendTemplate(t){uh.extend(this.template,t)}render(){if(this.isRendered)throw new m.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(t=>t.destroy())}}P(Sh,Uo),P(Sh,yr);n(61);class Ph extends Sh{constructor(t){super(t),this.body=this.createCollection()}render(){super.render(),this._renderBodyCollection()}destroy(){return this._bodyCollectionContainer.remove(),super.destroy()}_renderBodyCollection(){const t=this._bodyCollectionContainer=new uh({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"]},children:this.body}).render();document.body.appendChild(t)}}n(63);class Oh extends Sh{constructor(t){super(t),this.set("text"),this.set("for");const e=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],for:e.to("for")},children:[{text:e.to("text")}]})}}class Rh extends Ph{constructor(t){super(t);const e=w();this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-editor","ck-rounded-corners"],role:"application",dir:"ltr",lang:t.language,"aria-labelledby":`ck-editor__aria-label_${e}`},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(t){const e=this.t,n=new Oh;return n.text=e("c"),n.extendTemplate({attributes:{id:`ck-editor__aria-label_${t}`,class:"ck-voice-label"}}),n}}class Dh extends Sh{constructor(t,e){super(t);const n=this.bindTemplate;e&&(this.element=this.editableElement=e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners",n.to("isFocused",t=>t?"ck-focused":"ck-blurred")],contenteditable:n.to("isReadOnly",t=>!t)}}),this.set("isReadOnly",!1),this.set("isFocused",!1),this.externalElement=e}render(){super.render(),this.externalElement?this.template.apply(this.element=this.externalElement):this.editableElement=this.element}destroy(){this.externalElement&&this.template.revert(this.externalElement),super.destroy()}}class Ih extends Dh{constructor(t,e){super(t,e);const n=this.bindTemplate,r=this.t;this.set("name",null);this.extendTemplate({attributes:{role:"textbox","aria-label":n.to("name",t=>r("aj",[t])),class:"ck-editor__editable_inline"}})}}function Fh(t){return e=>e+t}n(65);const Nh=Fh("px");class Mh extends Sh{constructor(t){super(t);const e=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 uh({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:e.to("isSticky",t=>t?"block":"none"),height:e.to("isSticky",t=>t?Nh(this._panelRect.height):null)}}}).render(),this._contentPanel=new uh({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",e.if("isSticky","ck-sticky-panel__content_sticky"),e.if("_isStickyToTheLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:e.to("isSticky",t=>t?Nh(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:e.to("_hasViewportTopOffset",t=>t?Nh(this.viewportTopOffset):null),bottom:e.to("_isStickyToTheLimiter",t=>t?Nh(this.limiterBottomOffset):null),marginLeft:e.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(Vo.window,"scroll",()=>{this._checkIfShouldBeSticky()}),this.listenTo(this,"change:isActive",()=>{this._checkIfShouldBeSticky()})}_checkIfShouldBeSticky(){const t=this._panelRect=this._contentPanel.getBoundingClientRect();let e;this.limiterElement?(e=this._limiterRect=this.limiterElement.getBoundingClientRect(),this.isSticky=this.isActive&&e.top{this[e](),n()})}}get first(){return this.focusables.find(Bh)||null}get last(){return this.focusables.filter(Bh).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let t=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((e,n)=>{const r=e.element===this.focusTracker.focusedElement;return r&&(t=n),r}),t)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(t){t&&t.focus()}_getFocusableItem(t){const e=this.current,n=this.focusables.length;if(!n)return null;if(null===e)return this[1===t?"first":"last"];let r=(e+n+t)%n;do{const e=this.focusables.get(r);if(Bh(e))return e;r=(r+n+t)%n}while(r!==e);return null}}function Bh(t){return!(!t.focus||"none"==Vo.window.getComputedStyle(t.element).display)}class Lh extends Sh{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}n(67);class zh extends Sh{constructor(t){super(t);const e=this.bindTemplate;this.items=this.createCollection(),this.focusTracker=new oh,this.keystrokes=new Jd,this.set("isVertical",!1),this.set("className"),this._focusCycler=new Vh({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",e.if("isVertical","ck-toolbar_vertical"),e.to("className")]},children:this.items,on:{mousedown:function(t){return t.bindTemplate.to(e=>{e.target===t.element&&e.preventDefault()})}(this)}})}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(t,e){t.map(t=>{"|"==t?this.items.add(new Lh):e.has(t)?this.items.add(e.create(t)):Hi.a.warn("toolbarview-item-unavailable: The requested toolbar item is unavailable.",{name:t})})}}n(69);class qh extends Rh{constructor(t){super(t),this.stickyPanel=new Mh(t),this.toolbar=new zh(t),this.editable=new Ih(t)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}get editableElement(){return this.editable.element}}class jh{constructor(){this._replacedElements=[]}replace(t,e){this._replacedElements.push({element:t,newElement:e}),t.style.display="none",e&&t.parentNode.insertBefore(e,t.nextSibling)}restore(){this._replacedElements.forEach(({element:t,newElement:e})=>{t.style.display="",e&&e.remove()}),this._replacedElements=[]}}class Hh extends Qd{constructor(t,e){super(e),zo(t)&&(this.sourceElement=t),this._elementReplacer=new jh,this.data.processor=new eh,this.model.document.createRoot(),this.ui=new sh(this,new qh(this.locale)),function(t){if(!K(t.updateSourceElement))throw new m.b("attachtoform-missing-elementapi-interface: Editor passed to attachToForm() must implement ElementApi.");const e=t.sourceElement;if(e&&"textarea"===e.tagName.toLowerCase()&&e.form){let n;const r=e.form,o=()=>t.updateSourceElement();K(r.submit)&&(n=r.submit,r.submit=(()=>{o(),n.apply(r)})),r.addEventListener("submit",o),t.on("destroy",()=>{r.removeEventListener("submit",o),n&&(r.submit=n)})}}(this)}get element(){return this.ui.view.element}destroy(){return this.sourceElement&&this.updateSourceElement(),this._elementReplacer.restore(),this.ui.destroy(),super.destroy()}static create(t,e){return new Promise(n=>{const r=new this(t,e);n(r.initPlugins().then(()=>r.ui.init()).then(()=>{zo(t)&&r._elementReplacer.replace(t,r.element),r.fire("uiReady")}).then(()=>r.editing.view.attachDomRoot(r.ui.view.editableElement)).then(()=>{const e=zo(t)?function(t){return t instanceof HTMLTextAreaElement?t.value:t.innerHTML}(t):t;return r.data.init(e)}).then(()=>{r.fire("dataReady"),r.fire("ready")}).then(()=>r))})}}P(Hh,Yd),P(Hh,Xd);n(71);class $h extends Sh{constructor(){super();const t=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:t.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 t=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),e=t.getAttribute("viewBox");for(e&&(this.viewBox=e),this.element.innerHTML="";t.childNodes.length>0;)this.element.appendChild(t.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(t=>{t.style.fill=this.fillColor})}}n(73);class Uh extends Sh{constructor(t){super(t),this.set("text",""),this.set("position","s");const e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip",e.to("position",t=>"ck-tooltip_"+t),e.if("text","ck-hidden",t=>!t.trim())]},children:[{tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:e.to("text")}]}]})}}n(75);class Wh extends Sh{constructor(t){super(t);const e=this.bindTemplate,n=w();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 $h,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",e.to("class"),e.if("isEnabled","ck-disabled",t=>!t),e.if("isVisible","ck-hidden",t=>!t),e.to("isOn",t=>t?"ck-on":"ck-off"),e.if("withText","ck-button_with-text")],type:e.to("type",t=>t||"button"),tabindex:e.to("tabindex"),"aria-labelledby":`ck-editor__aria-label_${n}`,"aria-disabled":e.if("isEnabled",!0,t=>!t),"aria-pressed":e.if("isOn",!0)},children:this.children,on:{mousedown:e.to(t=>{t.preventDefault()}),click:e.to(t=>{this.isEnabled?this.fire("execute"):t.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 t=new Uh;return t.bind("text").to(this,"_tooltipString"),t.bind("position").to(this,"tooltipPosition"),t}_createLabelView(t){const e=new Sh,n=this.bindTemplate;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:n.to("labelStyle"),id:`ck-editor__aria-label_${t}`},children:[{text:this.bindTemplate.to("label")}]}),e}_getTooltipString(t,e,n){return t?"string"==typeof t?t:(n&&(n=function(t){return Kr.isMac?to(t).map(t=>Zr[t.toLowerCase()]||t).reduce((t,e)=>t.slice(-1)in Jr?t+e:t+"+"+e):t}(n)),t instanceof Function?t(e,n):`${e}${n?` (${n})`:""}`):""}}class Gh{constructor(t){this.editor=t}destroy(){this.stopListening()}}P(Gh,yr);class Kh{constructor(){this._stack=[]}add(t,e){const n=this._stack,r=n[0];this._insertDescriptor(t);const o=n[0];r===o||Jh(r,o)||this.fire("change:top",{oldDescriptor:r,newDescriptor:o,writer:e})}remove(t,e){const n=this._stack,r=n[0];this._removeDescriptor(t);const o=n[0];r===o||Jh(r,o)||this.fire("change:top",{oldDescriptor:r,newDescriptor:o,writer:e})}_insertDescriptor(t){const e=this._stack,n=e.findIndex(e=>e.id===t.id);if(Jh(t,e[n]))return;n>-1&&e.splice(n,1);let r=0;for(;e[r]&&Zh(e[r],t);)r++;e.splice(r,0,t)}_removeDescriptor(t){const e=this._stack,n=e.findIndex(e=>e.id===t);n>-1&&e.splice(n,1)}}function Jh(t,e){return t&&e&&t.priority==e.priority&&Qh(t.classes)==Qh(e.classes)}function Zh(t,e){return t.priority>e.priority||!(t.priorityQh(e.classes)}function Qh(t){return Array.isArray(t)?t.sort().join(","):t}P(Kh,y);var Yh=n(31),Xh=n.n(Yh);const tf=Symbol("isWidget"),ef=Symbol("label"),nf="ck-widget",rf="ck-widget_selected";function of(t){return!!t.getCustomProperty(tf)}function sf(t,e,n={}){return Kr.isEdge||e.setAttribute("contenteditable","false",t),e.addClass(nf,t),e.setCustomProperty(tf,!0,t),t.getFillerOffset=lf,n.label&&function(t,e,n){n.setCustomProperty(ef,e,t)}(t,n.label,e),n.hasSelectionHandler&&function(t,e){const n=e.createUIElement("div",{class:"ck ck-widget__selection-handler"},function(t){const e=this.toDomElement(t),n=new $h;return n.set("content",Xh.a),n.render(),e.appendChild(n.element),e});e.insert(Ir.createAt(t),n),e.addClass(["ck-widget_selectable"],t)}(t,e),function(t,e,n,r){const o=new Kh;o.on("change:top",(e,o)=>{o.oldDescriptor&&r(t,o.oldDescriptor,o.writer),o.newDescriptor&&n(t,o.newDescriptor,o.writer)}),e.setCustomProperty("addHighlight",(t,e,n)=>o.add(e,n),t),e.setCustomProperty("removeHighlight",(t,e,n)=>o.remove(e,n),t)}(t,e,(t,e,n)=>n.addClass(r(e.classes),t),(t,e,n)=>n.removeClass(r(e.classes),t)),t;function r(t){return Array.isArray(t)?t:[t]}}function af(t){const e=t.getCustomProperty(ef);return e?"function"==typeof e?e():e:""}function cf(t,e){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],t),Kr.isEdge||(e.setAttribute("contenteditable",t.isReadOnly?"false":"true",t),t.on("change:isReadOnly",(n,r,o)=>{e.setAttribute("contenteditable",o?"false":"true",t)})),t.on("change:isFocused",(n,r,o)=>{o?e.addClass("ck-editor__nested-editable_focused",t):e.removeClass("ck-editor__nested-editable_focused",t)}),t}function lf(){return null}class uf extends Gh{static get pluginName(){return"OPMacroToc"}static get buttonName(){return"insertToc"}init(){const t=this.editor,e=t.model,n=t.conversion;e.schema.register("op-macro-toc",{allowWhere:"$block",isBlock:!0,isLimit:!0}),n.for("upcast").add(aa({view:{name:"macro",classes:"toc"},model:"op-macro-toc"})),n.for("editingDowncast").add(Ns({model:"op-macro-toc",view:(t,e)=>sf(this.createTocViewElement(e),e,{label:this.label})})),n.for("dataDowncast").add(Ns({model:"op-macro-toc",view:(t,e)=>this.createTocDataElement(e)})),t.ui.componentFactory.add(uf.buttonName,e=>{const n=new Wh(e);return n.set({label:this.label,withText:!0}),n.on("execute",()=>{t.model.change(e=>{const n=e.createElement("op-macro-toc",{});t.model.insertContent(n,t.model.document.selection)})}),n})}get label(){return window.I18n.t("js.editor.macro.toc")}createTocViewElement(t){const e=t.createText(this.label),n=t.createContainerElement("div",{class:"macro -toc"});return t.insert(Ir.createAt(n),e),n}createTocDataElement(t){return t.createContainerElement("macro",{class:"toc"})}}const df=Symbol("isOPEmbeddedTable");function hf(t){const e=t.getSelectedElement();return!(!e||!function(t){return!!t.getCustomProperty(df)&&of(t)}(e))}class ff extends Gh{static get pluginName(){return"EmbeddedTableEditing"}static get buttonName(){return"insertEmbeddedTable"}init(){const t=this.editor,e=t.model,n=t.conversion,r=t.config.get("openProject.pluginContext");this.text={button:window.I18n.t("js.editor.macro.embedded_table.button"),macro_text:window.I18n.t("js.editor.macro.embedded_table.text")},e.schema.register("op-macro-embedded-table",{allowWhere:"$block",allowAttributes:["opEmbeddedTableQuery"],isBlock:!0,isObject:!0}),n.for("upcast").add(aa({view:{name:"macro",classes:"embedded-table"},model:(t,e)=>{const n=t.getAttribute("data-query-props");return e.createElement("op-macro-embedded-table",{opEmbeddedTableQuery:n?JSON.parse(n):{}})}})),n.for("editingDowncast").add(Ns({model:"op-macro-embedded-table",view:(t,e)=>(function(t,e,n){return e.setCustomProperty(df,!0,t),sf(t,e,{label:"your label here"})})(this.createEmbeddedTableView(e),e,this.label)})),n.for("dataDowncast").add(Ns({model:"op-macro-embedded-table",view:(t,e)=>this.createEmbeddedTableDataElement(t,e)})),t.ui.componentFactory.add(ff.buttonName,e=>{const n=new Wh(e);return n.set({label:this.text.button,withText:!0}),n.on("execute",()=>{r.services.externalQueryConfiguration.show({},e=>t.model.change(n=>{const r=n.createElement("op-macro-embedded-table",{opEmbeddedTableQuery:e});t.model.insertContent(r,t.model.document.selection)}))}),n})}createEmbeddedTableView(t){const e=t.createText(this.text.macro_text),n=t.createContainerElement("div",{class:"macro -embedded-table"});return t.insert(Ir.createAt(n),e),n}createEmbeddedTableDataElement(t,e){const n=t.getAttribute("opEmbeddedTableQuery")||{};return e.createContainerElement("macro",{class:"embedded-table","data-query-props":JSON.stringify(n)})}}class pf extends Ni{constructor(t){super(t),this.domEventType="mousedown"}onDomEvent(t){this.fire(t.type,t)}}n(77);const mf=Xr("Ctrl+A");class gf extends Gh{static get pluginName(){return"Widget"}init(){const t=this.editor.editing.view,e=t.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",(t,e,n)=>{this._clearPreviouslySelectedWidgets(n.writer);const r=n.writer,o=r.document.selection,i=o.getSelectedElement();for(const t of o.getRanges())for(const e of t){const t=e.item;t.is("element")&&of(t)&&(r.addClass(rf,t),this._previouslySelected.add(t),t==i&&r.setSelection(o.getRanges(),{fake:!0,label:af(i)}))}},{priority:"low"}),t.addObserver(pf),this.listenTo(e,"mousedown",(...t)=>this._onMousedown(...t)),this.listenTo(e,"keydown",(...t)=>this._onKeydown(...t),{priority:"high"}),this.listenTo(e,"delete",(t,e)=>{this._handleDelete("forward"==e.direction)&&(e.preventDefault(),t.stop())},{priority:"high"})}_onMousedown(t,e){const n=this.editor,r=n.editing.view,o=r.document;let i=e.target;if(function(t){for(;t;){if(t instanceof Pr&&!(t instanceof Rr))return!0;t=t.parent}return!1}(i))return;if(!of(i)&&!(i=i.findAncestor(of)))return;e.preventDefault(),o.isFocused||r.focus();const s=n.editing.mapper.toModelElement(i);this._setSelectionOverElement(s)}_onKeydown(t,e){const n=e.keyCode,r=n==Qr.delete||n==Qr.arrowdown||n==Qr.arrowright;let o=!1;!function(t){return t==Qr.arrowright||t==Qr.arrowleft||t==Qr.arrowup||t==Qr.arrowdown}(n)?!function(t){return Yr(t)==mf}(e)?n===Qr.enter&&(o=this._handleEnterKey(e.shiftKey)):o=this._selectAllNestedEditableContent()||this._selectAllContent():o=this._handleArrowKeys(r),o&&(e.preventDefault(),t.stop())}_handleDelete(t){if(this.editor.isReadOnly)return;const e=this.editor.model.document.selection;if(!e.isCollapsed)return;const n=this._getObjectElementNextToSelection(t);return n?(this.editor.model.change(t=>{let r=e.anchor.parent;for(;r.isEmpty;){const e=r;r=e.parent,t.remove(e)}this._setSelectionOverElement(n)}),!0):void 0}_handleArrowKeys(t){const e=this.editor.model,n=e.schema,r=e.document.selection,o=r.getSelectedElement();if(o&&n.isObject(o)){const o=t?r.getLastPosition():r.getFirstPosition(),i=n.getNearestSelectionRange(o,t?"forward":"backward");return i&&e.change(t=>{t.setSelection(i)}),!0}if(!r.isCollapsed)return;const i=this._getObjectElementNextToSelection(t);return i instanceof ms&&n.isObject(i)?(this._setSelectionOverElement(i),!0):void 0}_handleEnterKey(t){const e=this.editor.model,n=e.document.selection.getSelectedElement();if(n&&e.schema.isObject(n))return e.change(e=>{const r=e.createElement("paragraph");e.insert(r,n,t?"before":"after"),e.setSelection(r,"in")}),!0}_selectAllNestedEditableContent(){const t=this.editor.model,e=t.document.selection,n=t.schema.getLimitElement(e);return e.getFirstRange().root!=n&&(t.change(t=>{t.setSelection(_s.createIn(n))}),!0)}_selectAllContent(){const t=this.editor.model,e=this.editor.editing,n=e.view.document.selection.getSelectedElement();if(n&&of(n)){const r=e.mapper.toModelElement(n.parent);return t.change(t=>{t.setSelection(_s.createIn(r))}),!0}return!1}_setSelectionOverElement(t){this.editor.model.change(e=>{e.setSelection(_s.createOn(t))})}_getObjectElementNextToSelection(t){const e=this.editor.model,n=e.schema,r=e.document.selection,o=new Ts(r);e.modifySelection(o,{direction:t?"forward":"backward"});const i=t?o.focus.nodeBefore:o.focus.nodeAfter;return i instanceof ms&&n.isObject(i)?i:null}_clearPreviouslySelectedWidgets(t){for(const e of this._previouslySelected)t.removeClass(rf,e);this._previouslySelected.clear()}}function bf(t,e,n){const{left:r,top:o,name:i}=t(e,n);return[i,n.clone().moveTo(r,o)]}function wf({left:t,top:e}){const{scrollX:n,scrollY:r}=Vo.window;return{left:t+n,top:e+r}}n(79);const vf=Fh("px"),_f=Vo.document.body;class kf extends Sh{constructor(t){super(t);const e=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("className"),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",e.to("position",t=>`ck-balloon-panel_${t}`),e.if("isVisible","ck-balloon-panel_visible"),e.if("withArrow","ck-balloon-panel_with-arrow"),e.to("className")],style:{top:e.to("top",vf),left:e.to("left",vf)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(t){this.show();const e=kf.defaultPositions,n=Object.assign({},{element:this.element,positions:[e.southArrowNorth,e.southArrowNorthWest,e.southArrowNorthEast,e.northArrowSouth,e.northArrowSouthWest,e.northArrowSouthEast],limiter:_f,fitInViewport:!0},t),{top:r,left:o,name:i}=kf._getOptimalPosition(n);Object.assign(this,{top:r,left:o,position:i})}pin(t){this.unpin(),this._pinWhenIsVisibleCallback=(()=>{this.isVisible?this._startPinning(t):this._stopPinning()}),this._startPinning(t),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(t){this.attachTo(t);const e=yf(t.target),n=t.limiter?yf(t.limiter):_f;this.listenTo(Vo.document,"scroll",(r,o)=>{const i=o.target,s=e&&i.contains(e),a=n&&i.contains(n);!s&&!a&&e&&n||this.attachTo(t)},{useCapture:!0}),this.listenTo(Vo.window,"resize",()=>{this.attachTo(t)})}_stopPinning(){this.stopListening(Vo.document,"scroll"),this.stopListening(Vo.window,"resize")}}function yf(t){return zo(t)?t:Gi(t)?t.commonAncestorContainer:"function"==typeof t?yf(t()):null}function xf(t,e){return t.top-e.height-kf.arrowVerticalOffset}function Cf(t){return t.bottom+kf.arrowVerticalOffset}kf.arrowHorizontalOffset=25,kf.arrowVerticalOffset=10,kf._getOptimalPosition=function({element:t,target:e,positions:n,limiter:r,fitInViewport:o}){K(e)&&(e=e()),K(r)&&(r=r());const i=function(t){for(;t&&"html"!=t.tagName.toLowerCase();){if("static"!=Vo.window.getComputedStyle(t).position)return t;t=t.parentElement}return null}(t.parentElement),s=new Ji(t),a=new Ji(e);let c,l;if(r||o){const t=r&&new Ji(r).getVisible(),e=o&&new Ji(Vo.window);[l,c]=function(t,e,n,r,o){let i,s,a=0,c=0;const l=n.getArea();return t.some(t=>{const[u,d]=bf(t,e,n);let h,f;if(r)if(o){const t=r.getIntersection(o);h=t?t.getIntersectionArea(d):0}else h=r.getIntersectionArea(d);function p(){c=f,a=h,i=d,s=u}return o&&(f=o.getIntersectionArea(d)),o&&!r?f>c&&p():!o&&r?h>a&&p():f>c&&h>=a?p():f>=c&&h>a&&p(),h===l}),i?[s,i]:null}(n,a,s,t,e)||bf(n[0],a,s)}else[l,c]=bf(n[0],a,s);let{left:u,top:d}=wf(c);if(i){const t=wf(new Ji(i)),e=Ki(i);u-=t.left,d-=t.top,u+=i.scrollLeft,d+=i.scrollTop,u-=e.left,d-=e.top}return{left:u,top:d,name:l}},kf.defaultPositions={northArrowSouth:(t,e)=>({top:xf(t,e),left:t.left+t.width/2-e.width/2,name:"arrow_s"}),northArrowSouthEast:(t,e)=>({top:xf(t,e),left:t.left+t.width/2-e.width+kf.arrowHorizontalOffset,name:"arrow_se"}),northArrowSouthWest:(t,e)=>({top:xf(t,e),left:t.left+t.width/2-kf.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouth:(t,e)=>({top:xf(t,e),left:t.left-e.width/2,name:"arrow_s"}),northWestArrowSouthWest:(t,e)=>({top:xf(t,e),left:t.left-kf.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouthEast:(t,e)=>({top:xf(t,e),left:t.left-e.width+kf.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouth:(t,e)=>({top:xf(t,e),left:t.right-e.width/2,name:"arrow_s"}),northEastArrowSouthEast:(t,e)=>({top:xf(t,e),left:t.right-e.width+kf.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouthWest:(t,e)=>({top:xf(t,e),left:t.right-kf.arrowHorizontalOffset,name:"arrow_sw"}),southArrowNorth:(t,e)=>({top:Cf(t),left:t.left+t.width/2-e.width/2,name:"arrow_n"}),southArrowNorthEast:(t,e)=>({top:Cf(t),left:t.left+t.width/2-e.width+kf.arrowHorizontalOffset,name:"arrow_ne"}),southArrowNorthWest:(t,e)=>({top:Cf(t),left:t.left+t.width/2-kf.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorth:(t,e)=>({top:Cf(t),left:t.left-e.width/2,name:"arrow_n"}),southWestArrowNorthWest:(t,e)=>({top:Cf(t),left:t.left-kf.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorthEast:(t,e)=>({top:Cf(t),left:t.left-e.width+kf.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorth:(t,e)=>({top:Cf(t),left:t.right-e.width/2,name:"arrow_n"}),southEastArrowNorthEast:(t,e)=>({top:Cf(t),left:t.right-e.width+kf.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorthWest:(t,e)=>({top:Cf(t),left:t.right-kf.arrowHorizontalOffset,name:"arrow_nw"})};class Af extends Gh{static get pluginName(){return"ContextualBalloon"}init(){this.view=new kf,this.positionLimiter=(()=>{const t=this.editor.editing.view,e=t.document.selection.editableElement;return e?t.domConverter.mapViewToDom(e.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 t=this._stack.get(this.view.content.get(0));return t?t.view:null}hasView(t){return this._stack.has(t)}add(t){if(this.hasView(t.view))throw new m.b("contextualballoon-add-view-exist: Cannot add configuration of the same view twice.");this.visibleView&&this.view.content.remove(this.visibleView),this._stack.set(t.view,t),this._show(t)}remove(t){if(!this.hasView(t))throw new m.b("contextualballoon-remove-view-not-exist: Cannot remove configuration of not existing view.");if(this.visibleView===t){this.view.content.remove(t),this._stack.delete(t);const e=Array.from(this._stack.values()).pop();e?this._show(e):this.view.hide()}else this._stack.delete(t)}updatePosition(t){t&&(this._stack.get(this.visibleView).position=t),this.view.pin(this._getBalloonPosition())}_show({view:t,balloonClassName:e=""}){this.view.className=e,this.view.content.add(t),this.view.pin(this._getBalloonPosition())}_getBalloonPosition(){let t=Array.from(this._stack.values()).pop().position;return t&&!t.limiter&&(t=Object.assign({},t,{limiter:this.positionLimiter})),t}}var Tf=n(32),Ef=n.n(Tf);function Sf(t,e,n){t.ui.componentFactory.add(e,e=>{const r=new Wh(e);return r.set({label:I18n.t("js.button_edit"),icon:Ef.a,tooltip:!0}),r.on("execute",()=>{const e=t.model.document.selection.getSelectedElement();e&&n(e)}),r})}const Pf="ck-toolbar-container";function Of(t,e,n,r){const o=e.config.get(n+".toolbar");if(!o||!o.length)return;const i=e.plugins.get("ContextualBalloon"),s=new zh;function a(){e.ui.focusTracker.isFocused&&r(e.editing.view.document.selection)?l()?function(t,e){const n=t.plugins.get("ContextualBalloon");if(e(t.editing.view.document.selection)){const e=Rf(t);n.updatePosition(e)}}(e,r):i.hasView(s)||i.add({view:s,position:Rf(e),balloonClassName:Pf}):c()}function c(){l()&&i.remove(s)}function l(){return i.visibleView==s}s.fillFromConfig(o,e.ui.componentFactory),t.listenTo(e.editing.view,"render",a),t.listenTo(e.ui.focusTracker,"change:isFocused",a,{priority:"low"})}function Rf(t){const e=t.editing.view,n=kf.defaultPositions;return{target:e.domConverter.viewToDom(e.document.selection.getSelectedElement()),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}}class Df extends Gh{static get requires(){return[Af]}static get pluginName(){return"EmbeddedTableToolbar"}init(){const t=this.editor,e=this.editor.model,n=t.config.get("openProject.pluginContext");Sf(t,"opEditEmbeddedTableQuery",t=>{const r=n.services.externalQueryConfiguration,o=t.getAttribute("opEmbeddedTableQuery")||{};r.show(o,n=>e.change(e=>{e.setAttribute("opEmbeddedTableQuery",n,t)}))})}afterInit(){Of(this,this.editor,"OPMacroEmbeddedTable",hf)}}const If=Symbol("isWpButtonMacroSymbol");function Ff(t){const e=t.getSelectedElement();return!(!e||!function(t){return!!t.getCustomProperty(If)&&of(t)}(e))}class Nf extends Gh{static get pluginName(){return"OPMacroWpButtonEditing"}static get buttonName(){return"insertWorkPackageButton"}init(){const t=this.editor,e=t.model,n=t.conversion,r=t.config.get("openProject.pluginContext");e.schema.register("op-macro-wp-button",{allowWhere:["$block"],allowAttributes:["type","classes"],isBlock:!0,isLimit:!0}),n.for("upcast").add(aa({view:{name:"macro",classes:"create_work_package_link"},model:(t,e)=>{const n=t.getAttribute("data-type")||"",r=t.getAttribute("data-classes")||"";return e.createElement("op-macro-wp-button",{type:n,classes:r})}})),n.for("editingDowncast").add(Ns({model:"op-macro-wp-button",view:(t,e)=>this.createMacroViewElement(t,e)})),n.for("dataDowncast").add(Ns({model:"op-macro-wp-button",view:(t,e)=>{return e.createContainerElement("macro",{class:"create_work_package_link","data-type":t.getAttribute("type")||"","data-classes":t.getAttribute("classes")||""})}})),t.ui.componentFactory.add(Nf.buttonName,e=>{const n=new Wh(e);return n.set({label:window.I18n.t("js.editor.macro.work_package_button.button"),withText:!0}),n.on("execute",()=>{r.services.macros.configureWorkPackageButton().then(e=>t.model.change(n=>{const r=n.createElement("op-macro-wp-button",{});n.setAttribute("type",e.type,r),n.setAttribute("classes",e.classes,r),t.model.insertContent(r,t.model.document.selection)}))}),n})}macroLabel(t){return t?window.I18n.t("js.editor.macro.work_package_button.with_type",{typename:t}):window.I18n.t("js.editor.macro.work_package_button.without_type")}createMacroViewElement(t,e){t.getAttribute("type");const n=t.getAttribute("classes")||"",r=this.macroLabel(),o=e.createText(r),i=e.createContainerElement("span",{class:"macro -create_work_package_link "+n});return e.insert(Ir.createAt(i),o),function(t,e,n){return e.setCustomProperty(If,!0,t),sf(t,e,{label:n})}(i,e,{label:r})}}class Mf extends Gh{static get requires(){return[Af]}static get pluginName(){return"OPMacroWpButtonToolbar"}init(){const t=this.editor,e=(this.editor.model,t.config.get("openProject.pluginContext"));Sf(t,"opEditWpMacroButton",n=>{const r=e.services.macros,o=n.getAttribute("type"),i=n.getAttribute("classes");r.configureWorkPackageButton(o,i).then(e=>t.model.change(t=>{t.setAttribute("classes",e.classes,n),t.setAttribute("type",e.type,n)}))})}afterInit(){Of(this,this.editor,"OPMacroWpButton",Ff)}}const Vf=Symbol("isWpButtonMacroSymbol");function Bf(t){const e=t.getSelectedElement();return!(!e||!function(t){return!!t.getCustomProperty(Vf)&&of(t)}(e))}class Lf extends Gh{static get pluginName(){return"OPWikiIncludePageEditing"}static get buttonName(){return"insertWikiPageInclude"}init(){const t=this.editor,e=t.model,n=t.conversion,r=t.config.get("openProject.pluginContext");e.schema.register("op-macro-wiki-page-include",{allowWhere:["$block"],allowAttributes:["page"],isBlock:!0,isLimit:!0}),n.for("upcast").add(aa({view:{name:"macro",classes:"include_wiki_page"},model:(t,e)=>{const n=t.getAttribute("data-page")||"";return e.createElement("op-macro-wiki-page-include",{page:n})}})),n.for("editingDowncast").add(Ns({model:"op-macro-wiki-page-include",view:(t,e)=>this.createMacroViewElement(t,e)})).add(t=>t.on("attribute:page",this.modelAttributeToView.bind(this))),n.for("dataDowncast").add(Ns({model:"op-macro-wiki-page-include",view:(t,e)=>{return e.createContainerElement("macro",{class:"include_wiki_page","data-page":t.getAttribute("page")||""})}})),t.ui.componentFactory.add(Lf.buttonName,e=>{const n=new Wh(e);return n.set({label:window.I18n.t("js.editor.macro.wiki_page_include.button"),withText:!0}),n.on("execute",()=>{r.services.macros.configureWikiPageInclude().then(e=>t.model.change(n=>{const r=n.createElement("op-macro-wiki-page-include",{});n.setAttribute("page",e,r),t.model.insertContent(r,t.model.document.selection)}))}),n})}modelAttributeToView(t,e,n){const r=e.item;if(!r.is("op-macro-wiki-page-include"))return;n.consumable.consume(e.item,t.name);const o=n.mapper.toViewElement(r);n.writer.remove(Fr.createIn(o)),this.setPlaceholderContent(n.writer,r,o)}macroLabel(){return window.I18n.t("js.editor.macro.wiki_page_include.text")}pageLabel(t){return t&&t.length>0?t:window.I18n.t("js.editor.macro.wiki_page_include.not_set")}createMacroViewElement(t,e){const n=e.createContainerElement("div",{class:"macro -wiki_page_include"});return this.setPlaceholderContent(e,t,n),function(t,e,n){return e.setCustomProperty(Vf,!0,t),sf(t,e,{label:n})}(n,e,{label:this.macroLabel()})}setPlaceholderContent(t,e,n){const r=e.getAttribute("page"),o=this.macroLabel(),i=this.pageLabel(r),s=t.createContainerElement("span",{class:"macro-value"});let a=[t.createText(`${o} `)];t.insert(Ir.createAt(s),t.createText(`${i}`)),a.push(s),t.insert(Ir.createAt(n),a)}}class zf extends Gh{static get requires(){return[Af]}static get pluginName(){return"OPWikiIncludePageToolbar"}init(){const t=this.editor,e=(this.editor.model,t.config.get("openProject.pluginContext"));Sf(t,"opEditWikiIncludeMacroButton",n=>{const r=e.services.macros,o=n.getAttribute("page");r.configureWikiPageInclude(o).then(e=>t.model.change(t=>{t.setAttribute("page",e,n)}))})}afterInit(){Of(this,this.editor,"OPWikiIncludePage",Bf)}}class qf{constructor(t){this.editor=t,this.set("value",void 0),this.set("isEnabled",!1),this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",t=>{this.isEnabled||t.stop()},{priority:"high"}),this.listenTo(t,"change:isReadOnly",(t,e,n)=>{n?(this.on("set:isEnabled",jf,{priority:"highest"}),this.isEnabled=!1):(this.off("set:isEnabled",jf),this.refresh())})}refresh(){this.isEnabled=!0}execute(){}destroy(){this.stopListening()}}function jf(t){t.return=!1,t.stop()}P(qf,yr);class Hf extends qf{execute(){const t=this.editor.model,e=t.document;t.change(n=>{!function(t,e,n,r){const o=n.isCollapsed,i=n.getFirstRange(),s=i.start.parent,a=i.end.parent;if(r.isLimit(s)||r.isLimit(a))return void(o||s!=a||t.deleteContent(n));if(o)$f(e,n,i.start);else{const r=!(i.start.isAtStart&&i.end.isAtEnd),o=s==a;t.deleteContent(n,{leaveUnmerged:r}),r&&(o?$f(e,n,n.focus):e.setSelection(a,0))}}(this.editor.model,n,e.selection,t.schema),this.fire("afterExecute",{writer:n})})}}function $f(t,e,n){const r=n.parent,o=new r.constructor(r.name,r.getAttributes());n.isAtEnd?t.insert(o,n.parent,"after"):n.isAtStart?t.insert(o,n.parent,"before"):t.split(n),t.setSelection(n.parent.nextSibling,0)}class Uf extends Hf{execute(){this.atJsOpen||super.execute()}get isAtJsOpen(){return this.atJsOpen}set isAtJsOpen(t){this.atJsOpen=t}}function Wf(t,e){let n,r=function(t){return jQuery("",t).addClass("atwho-query")},o=jQuery.extend({},{at:"#",startWithSpace:!1,searchKey:"id_subject",displayTpl:'
  • ${to_s}
  • ',insertTpl:"${atwho-at}${id}",limit:10,callbacks:{matcher:function(t,n,r,o){if(e.ignorePrefix&&n.match(e.ignorePrefix))return null;return jQuery.fn.atwho.default.callbacks.matcher.call(this,t,n,r,o)},remoteFilter:function(t,e){let o=this;this.getOpt("remoteUrl")(t,function(i){i&&(i=o.getOpt("remoteDataPreparation").call(o,i),o.query.el=function(t){let e=r(this.app.document),n=this._getRange(),o=n.startOffset-this.at.length-t.length;return n.setStart(n.startContainer,o),this.currentRangeProperties={current:n,start:o,end:n.endOffset},n.surroundContents(e.get(0)),e}.call(o,t),jQuery(n).is(":visible")?e(i):e([]))})},sorter:function(t,e,n){return e},beforeInsert:function(t,e,n){return this.query.el=function(){let t=r(this.app.document),e=this.currentRangeProperties.current,n=e.cloneRange(),o=e.startContainer.childNodes[0],i=e.endContainer.childNodes[0];return n.setStart(o,this.currentRangeProperties.start),n.setEnd(i,this.currentRangeProperties.end),n.surroundContents(t.get(0)),t}.call(this),t}},functionOverrides:{insert:function(t,e){let n,r,o,i;return o=""===(o=this.getOpt("suffix"))?o:o||" ",n=e.data("item-data"),this.query.el.removeClass("atwho-query").addClass("atwho-inserted").html(t).attr("data-atwho-at-query",""+n["atwho-at"]+this.query.text).attr("contenteditable","false"),(r=this._getRange())&&(this.query.el.length&&r.setEndAfter(this.query.el[0]),r.collapse(!1),r.insertNode(i=this.app.document.createTextNode(""+o)),this._setRange("after",i,r)),this.$inputor.change()}}},e);t.model.document.once("change",()=>{e.isSupportedContext&&!e.isSupportedContext()||((n=jQuery(t.element)).is(".ck-editor__editable")||(n=n.closest(".op-ckeditor--wrapper").find(".ck-editor__editable")),n.atwho(o),jQuery(n).on("shown.atwho",()=>{t.commands.get("enter").isAtJsOpen=!0}).on("hidden.atwho",()=>{t.commands.get("enter").isAtJsOpen=!1}))})}function Gf(t,e){return t.config.get("openProject.pluginContext").services[e]}function Kf(t){return t.config.get("openProject.context.resource")}function Jf(t,e){return Gf(t,"pathHelperService")}class Zf extends Gh{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new Lr({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(t){if("string"!=typeof t)throw new m.b("pendingactions-add-invalid-message: The message must be a string.");const e=Object.create(yr);return e.set("message",t),this._actions.add(e),this.hasAny=!0,e}remove(t){this._actions.remove(t),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}class Qf{constructor(){const t=new window.FileReader;this._reader=t,this.set("loaded",0),t.onprogress=(t=>{this.loaded=t.loaded})}get error(){return this._reader.error}read(t){const e=this._reader;return this.total=t.size,new Promise((n,r)=>{e.onload=(()=>{n(e.result)}),e.onerror=(()=>{r("error")}),e.onabort=(()=>{r("aborted")}),this._reader.readAsDataURL(t)})}abort(){this._reader.abort()}}P(Qf,yr);class Yf extends Gh{static get pluginName(){return"FileRepository"}static get requires(){return[Zf]}init(){this.loaders=new Lr,this.loaders.on("add",()=>this._updatePendingAction()),this.loaders.on("remove",()=>this._updatePendingAction()),this._pendingAction=null,this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(t,e)=>e?t/e*100:0)}getLoader(t){for(const e of this.loaders)if(e.file==t)return e;return null}createLoader(t){if(!this.createUploadAdapter)return Hi.a.error("filerepository-no-upload-adapter: Upload adapter is not defined."),null;const e=new Xf(t);return e._adapter=this.createUploadAdapter(e),this.loaders.add(e),e.on("change:uploaded",()=>{let t=0;for(const e of this.loaders)t+=e.uploaded;this.uploaded=t}),e.on("change:uploadTotal",()=>{let t=0;for(const e of this.loaders)e.uploadTotal&&(t+=e.uploadTotal);this.uploadTotal=t}),e}destroyLoader(t){const e=t instanceof Xf?t:this.getLoader(t);e._destroy(),this.loaders.remove(e)}_updatePendingAction(){const t=this.editor.plugins.get(Zf);if(this.loaders.length){if(!this._pendingAction){const e=this.editor.t,n=t=>`${e("b")} ${parseInt(t)}%.`;this._pendingAction=t.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else t.remove(this._pendingAction),this._pendingAction=null}}P(Yf,yr);class Xf{constructor(t,e){this.id=w(),this.file=t,this._adapter=e,this._reader=new Qf,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(t,e)=>e?t/e*100:0),this.set("uploadResponse",null)}read(){if("idle"!=this.status)throw new m.b("filerepository-read-wrong-status: You cannot call read if the status is different than idle.");return this.status="reading",this._reader.read(this.file).then(t=>(this.status="idle",t)).catch(t=>{if("aborted"===t)throw this.status="aborted","aborted";throw this.status="error",this._reader.error})}upload(){if("idle"!=this.status)throw new m.b("filerepository-upload-wrong-status: You cannot call upload if the status is different than idle.");return this.status="uploading",this._adapter.upload().then(t=>(this.uploadResponse=t,this.status="idle",t)).catch(t=>{if("aborted"===this.status)throw"aborted";throw this.status="error",t})}abort(){const t=this.status;this.status="aborted","reading"==t&&this._reader.abort(),"uploading"==t&&this._adapter.abort&&this._adapter.abort(),this._destroy()}_destroy(){this._reader=void 0,this._adapter=void 0,this.data=void 0,this.uploadResponse=void 0,this.file=void 0}}P(Xf,yr);class tp{constructor(t,e,n){this.loader=t,this.resource=e,this.editor=n}upload(){const t=this.resource;if(!t||!t.uploadAttachments){const e=t?t.name:"Missing context";return console.warn(`uploadAttachments not present on context: ${e}`),Promise.reject("You're not allowed to upload attachments on this resource.")}return t.uploadAttachments([this.loader.file]).then(t=>(this.editor.model.fire("op:attachment-added",t),this.buildResponse(t[0]))).catch(t=>{console.error("Failed upload %O",t)})}buildResponse(t){return{default:t.uploadUrl}}abort(){return!1}}class ep extends Sh{constructor(t){super(t),this.buttonView=new Wh(t),this._fileInputView=new np(t),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 np extends Sh{constructor(t){super(t),this.set("acceptedType"),this.set("allowMultipleFiles",!1);const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:e.to("acceptedType"),multiple:e.to("allowMultipleFiles")},on:{change:e.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}var rp=n(33),op=n.n(rp);function ip(t){return/^image\/(jpeg|png|gif|bmp)$/.test(t.type)}function sp(t){const e=t.getSelectedElement();if(e)return vs.createAfter(e);const n=t.getSelectedBlocks().next().value;if(n){if(n.isEmpty)return vs.createAt(n);const e=vs.createAfter(n);return t.focus.isTouching(e)?e:vs.createBefore(n)}return t.focus}class ap extends Gh{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("imageUpload",n=>{const r=new ep(n),o=t.commands.get("imageUpload");return r.set({acceptedType:"image/*",allowMultipleFiles:!0}),r.buttonView.set({label:e("ay"),icon:op.a,tooltip:!0}),r.buttonView.bind("isEnabled").to(o),r.on("done",(e,n)=>{for(const e of Array.from(n)){const n=sp(t.model.document.selection);ip(e)&&t.execute("imageUpload",{file:e,insertAt:n})}}),r})}}var cp=n(34),lp=n.n(cp);n(81),n(83),n(85);class up extends Gh{constructor(t){super(t),this.placeholder="data:image/svg+xml;utf8,"+encodeURIComponent(lp.a)}init(){this.editor.editing.downcastDispatcher.on("attribute:uploadStatus:image",(...t)=>this.uploadStatusChange(...t))}uploadStatusChange(t,e,n){const r=this.editor,o=e.item,i=o.getAttribute("uploadId");if(!n.consumable.consume(e.item,t.name))return;const s=r.plugins.get(Yf),a=i?e.attributeNewValue:null,c=this.placeholder,l=r.editing.mapper.toViewElement(o),u=n.writer;if("reading"==a)return fp(l,u),void pp(c,l,u);if("uploading"==a){const t=s.loaders.get(i);return fp(l,u),void(t?(mp(l,u),function(t,e,n,r){const o=function(t){const e=t.createUIElement("div",{class:"ck-progress-bar"});return t.setCustomProperty(dp,!0,e),e}(e);e.insert(Ir.createAt(t,"end"),o),n.on("change:uploadedPercent",(t,e,n)=>{r.change(t=>{t.setStyle("width",n+"%",o)})})}(l,u,t,r.editing.view)):pp(c,l,u))}"complete"==a&&s.loaders.get(i)&&!Kr.isEdge&&function(t,e,n){const r=new eo("div",{class:"ck-image-upload-complete-icon"});e.insert(Ir.createAt(t,"end"),r),setTimeout(()=>{n.change(t=>t.remove(Fr.createOn(r)))},3e3)}(l,u,r.editing.view),function(t,e){bp(t,e,dp)}(l,u),mp(l,u),function(t,e){e.removeClass("ck-appear",t)}(l,u)}}const dp=Symbol("progress-bar"),hp=Symbol("placeholder");function fp(t,e){t.hasClass("ck-appear")||e.addClass("ck-appear",t)}function pp(t,e,n){e.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",e);const r=e.getChild(0);r.getAttribute("src")!==t&&n.setAttribute("src",t,r),gp(e,hp)||n.insert(Ir.createAfter(r),function(t){const e=t.createUIElement("div",{class:"ck-upload-placeholder-loader"});return t.setCustomProperty(hp,!0,e),e}(n))}function mp(t,e){t.hasClass("ck-image-upload-placeholder")&&e.removeClass("ck-image-upload-placeholder",t),bp(t,e,hp)}function gp(t,e){for(const n of t.getChildren())if(n.getCustomProperty(e))return n}function bp(t,e,n){const r=gp(t,n);r&&e.remove(Fr.createOn(r))}class wp extends qf{execute(t){const e=this.editor,n=e.model.document,r=t.file,o=e.plugins.get(Yf);e.model.change(i=>{const s=o.createLoader(r);if(!s)return;const a=i.createElement("image",{uploadId:s.id});let c;c=t.insertAt?new Ts([new _s(t.insertAt)]):n.selection,e.model.insertContent(a,c),a.parent&&i.setSelection(a,"on")})}}class vp extends Gh{static get pluginName(){return"Notification"}init(){this.on("show:warning",(t,e)=>{window.alert(e.message)},{priority:"lowest"})}showSuccess(t,e={}){this._showNotification({message:t,type:"success",namespace:e.namespace,title:e.title})}showInfo(t,e={}){this._showNotification({message:t,type:"info",namespace:e.namespace,title:e.title})}showWarning(t,e={}){this._showNotification({message:t,type:"warning",namespace:e.namespace,title:e.title})}_showNotification(t){const e=`show:${t.type}`+(t.namespace?`:${t.namespace}`:"");this.fire(e,{message:t.message,type:t.type,title:t.title||""})}}class _p extends Gh{static get requires(){return[Yf,vp]}init(){const t=this.editor,e=t.model.document,n=t.model.schema,r=t.plugins.get(Yf);n.extend("image",{allowAttributes:["uploadId","uploadStatus"]}),t.commands.add("imageUpload",new wp(t)),this.listenTo(t.editing.view.document,"clipboardInput",(n,o)=>{if(function(t){return Array.from(t.types).includes("text/html")&&""!==t.getData("text/html")}(o.dataTransfer))return;let i=new Ts(o.targetRanges.map(e=>t.editing.mapper.toModelRange(e)));for(const s of o.dataTransfer.files){if(ip(s)){const e=sp(i);t.model.change(n=>{const o=r.createLoader(s);if(!o)return;const i=n.createElement("image",{uploadId:o.id}),a=new Ts([new _s(e)]);t.model.insertContent(i,a),i.parent&&n.setSelection(i,"on")}),n.stop()}i=e.selection}}),t.editing.view.document.on("dragover",(t,e)=>{e.preventDefault()}),e.on("change",()=>{const t=e.differ.getChanges({includeChangesInGraveyard:!0});for(const e of t)if("insert"==e.type&&"image"==e.name){const t=e.position.nodeAfter,n="$graveyard"==e.position.root.rootName,o=t.getAttribute("uploadId");if(!o)continue;const i=r.loaders.get(o);if(!i)continue;n?i.abort():"idle"==i.status&&this._load(i,t)}})}_load(t,e){const n=this.editor,r=n.model,o=n.locale.t,i=n.plugins.get(Yf),s=n.plugins.get(vp);return r.enqueueChange("transparent",t=>{t.setAttribute("uploadStatus","reading",e)}),t.read().then(o=>{const i=n.editing.mapper.toViewElement(e).getChild(0),s=t.upload();return n.editing.view.change(t=>{t.setAttribute("src",o,i)}),r.enqueueChange("transparent",t=>{t.setAttribute("uploadStatus","uploading",e)}),s}).then(t=>{r.enqueueChange("transparent",n=>{n.setAttributes({uploadStatus:"complete",src:t.default},e);let r=0;const o=Object.keys(t).filter(t=>{const e=parseInt(t,10);if(!isNaN(e))return r=Math.max(r,e),!0}).map(e=>`${t[e]} ${e}w`).join(", ");""!=o&&n.setAttribute("srcset",{data:o,width:r},e)}),a()}).catch(n=>{if("error"!==t.status&&"aborted"!==t.status)throw n;"error"==t.status&&s.showWarning(n,{title:o("ak"),namespace:"upload"}),a(),r.enqueueChange("transparent",t=>{t.remove(e)})});function a(){r.enqueueChange("transparent",t=>{t.removeAttribute("uploadId",e),t.removeAttribute("uploadStatus",e)}),i.destroyLoader(t)}}}class kp extends Gh{static get pluginName(){return"ImageUpload"}static get requires(){return[_p,ap,up]}}const yp=Symbol("isWpButtonMacroSymbol");function xp(t){const e=t.getSelectedElement();return!(!e||!function(t){return!!t.getCustomProperty(yp)&&of(t)}(e))}class Cp extends Gh{static get pluginName(){return"OPChildPagesEditing"}static get buttonName(){return"insertChildPages"}init(){const t=this.editor,e=t.model,n=t.conversion;e.schema.register("op-macro-child-pages",{allowWhere:["$block"],allowAttributes:["page"],isBlock:!0,isLimit:!0}),n.for("upcast").add(aa({view:{name:"macro",classes:"child_pages"},model:(t,e)=>{const n=t.getAttribute("data-page")||"",r="true"==t.getAttribute("data-include-parent");return e.createElement("op-macro-child-pages",{page:n,includeParent:r})}})),n.for("editingDowncast").add(Ns({model:"op-macro-child-pages",view:(t,e)=>this.createMacroViewElement(t,e)})).add(t=>t.on("attribute:page",this.modelAttributeToView.bind(this))).add(t=>t.on("attribute:includeParent",this.modelAttributeToView.bind(this))),n.for("dataDowncast").add(Ns({model:"op-macro-child-pages",view:(t,e)=>{return e.createContainerElement("macro",{class:"child_pages","data-page":t.getAttribute("page")||"","data-include-parent":t.getAttribute("includeParent")||""})}})),t.ui.componentFactory.add(Cp.buttonName,e=>{const n=new Wh(e);return n.set({label:window.I18n.t("js.editor.macro.child_pages.button"),withText:!0}),n.on("execute",()=>{t.model.change(e=>{const n=e.createElement("op-macro-child-pages",{});t.model.insertContent(n,t.model.document.selection)})}),n})}modelAttributeToView(t,e,n){const r=e.item;if(!r.is("op-macro-child-pages"))return;n.consumable.consume(e.item,t.name);const o=n.mapper.toViewElement(r);n.writer.remove(Fr.createIn(o)),this.setPlaceholderContent(n.writer,r,o)}macroLabel(){return window.I18n.t("js.editor.macro.child_pages.text")}pageLabel(t){return t&&t.length>0?t:window.I18n.t("js.editor.macro.child_pages.this_page")}includeParentText(t){return t?` (${window.I18n.t("js.editor.macro.child_pages.include_parent")})`:""}createMacroViewElement(t,e){const n=e.createContainerElement("div",{class:"macro -child_pages"});return this.setPlaceholderContent(e,t,n),function(t,e,n){return e.setCustomProperty(yp,!0,t),sf(t,e,{label:n})}(n,e,{label:this.macroLabel()})}setPlaceholderContent(t,e,n){const r=e.getAttribute("page"),o=e.getAttribute("includeParent"),i=this.macroLabel(),s=this.pageLabel(r),a=t.createContainerElement("span",{class:"macro-value"});let c=[t.createText(`${i} `)];t.insert(Ir.createAt(a),t.createText(`${s}`)),c.push(a),c.push(t.createText(this.includeParentText(o))),t.insert(Ir.createAt(n),c)}}class Ap extends Gh{static get requires(){return[Af]}static get pluginName(){return"OPChildPagesToolbar"}init(){const t=this.editor,e=this.editor.model,n=t.config.get("openProject.pluginContext");Sf(t,"opEditChildPagesMacroButton",t=>{const r=n.services.macros,o=t.getAttribute("page"),i=t.getAttribute("includeParent"),s=o&&o.length>0?o:"";r.configureChildPages(s,i).then(n=>e.change(e=>{e.setAttribute("page",n.page,t),e.setAttribute("includeParent",n.includeParent,t)}))})}afterInit(){Of(this,this.editor,"OPChildPages",xp)}}class Tp{constructor(t){this.files=function(t){const e=t.files?Array.from(t.files):[],n=t.items?Array.from(t.items):[];if(e.length)return e;return n.filter(t=>"file"===t.kind).map(t=>t.getAsFile())}(t),this._native=t}get types(){return this._native.types}getData(t){return this._native.getData(t)}setData(t,e){this._native.setData(t,e)}}class Ep extends Ni{constructor(t){super(t);const e=this.document;function n(t,n){n.preventDefault();const r=n.dropRange?[n.dropRange]:Array.from(e.selection.getRanges());e.fire("clipboardInput",{dataTransfer:n.dataTransfer,targetRanges:r})}this.domEventType=["paste","copy","cut","drop","dragover"],this.listenTo(e,"paste",n,{priority:"low"}),this.listenTo(e,"drop",n,{priority:"low"})}onDomEvent(t){const e={dataTransfer:new Tp(t.clipboardData?t.clipboardData:t.dataTransfer)};"drop"==t.type&&(e.dropRange=function(t,e){const n=e.target.ownerDocument,r=e.clientX,o=e.clientY;let i;n.caretRangeFromPoint&&n.caretRangeFromPoint(r,o)?i=n.caretRangeFromPoint(r,o):e.rangeParent&&((i=n.createRange()).setStart(e.rangeParent,e.rangeOffset),i.collapse(!0));return i?t.domConverter.domRangeToView(i):t.document.selection.getFirstRange()}(this.view,t)),this.fire(t.type,t,e)}}const Sp=["figcaption","li"];class Pp extends Gh{static get pluginName(){return"Clipboard"}init(){const t=this.editor,e=t.model.document,n=t.editing.view,r=n.document;function o(n,o){const i=o.dataTransfer;o.preventDefault();const s=t.data.toView(t.model.getSelectedContent(e.selection));r.fire("clipboardOutput",{dataTransfer:i,content:s,method:n.name})}this._htmlDataProcessor=new eh,n.addObserver(Ep),this.listenTo(r,"clipboardInput",e=>{t.isReadOnly&&e.stop()},{priority:"highest"}),this.listenTo(r,"clipboardInput",(t,e)=>{const r=e.dataTransfer;let o="";r.getData("text/html")?o=function(t){return t.replace(/(\s+)<\/span>/g,(t,e)=>1==e.length?" ":e)}(r.getData("text/html")):r.getData("text/plain")&&(o=function(t){return(t=t.replace(//g,">").replace(/\n\n/g,"

    ").replace(/\n/g,"
    ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  ")).indexOf("

    ")>-1&&(t=`

    ${t}

    `),t}(r.getData("text/plain"))),o=this._htmlDataProcessor.toView(o),this.fire("inputTransformation",{content:o}),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(t,n)=>{if(!n.content.isEmpty){const t=this.editor.data,r=this.editor.model,o=t.toModel(n.content,"$clipboardHolder");if(0==o.childCount)return;r.insertContent(o,e.selection)}},{priority:"low"}),this.listenTo(r,"copy",o,{priority:"low"}),this.listenTo(r,"cut",(e,n)=>{t.isReadOnly?n.preventDefault():o(e,n)},{priority:"low"}),this.listenTo(r,"clipboardOutput",(n,r)=>{r.content.isEmpty||(r.dataTransfer.setData("text/html",this._htmlDataProcessor.toData(r.content)),r.dataTransfer.setData("text/plain",function t(e){let n="";if(e.is("text")||e.is("textProxy"))n=e.data;else if(e.is("img")&&e.hasAttribute("alt"))n=e.getAttribute("alt");else{let r=null;for(const o of e.getChildren()){const e=t(o);r&&(r.is("containerElement")||o.is("containerElement"))&&(Sp.includes(r.name)||Sp.includes(o.name)?n+="\n":n+="\n\n"),n+=e,r=o}}return n}(r.content))),"cut"==r.method&&t.model.deleteContent(e.selection)},{priority:"low"})}}class Op extends Ko{constructor(t){super(t);const e=this.document;e.on("keydown",(t,n)=>{if(this.isEnabled&&n.keyCode==Qr.enter){let r;e.once("enter",t=>r=t,{priority:"highest"}),e.fire("enter",new Fi(e,n.domEvent,{isSoft:n.shiftKey})),r&&r.stop.called&&t.stop()}})}observe(){}}class Rp extends Gh{static get pluginName(){return"Enter"}init(){const t=this.editor,e=t.editing.view,n=e.document;e.addObserver(Op),t.commands.add("enter",new Hf(t)),this.listenTo(n,"enter",(n,r)=>{r.isSoft||(t.execute("enter"),r.preventDefault(),e.scrollToTheSelection())},{priority:"low"})}}class Dp extends qf{execute(){const t=this.editor.model,e=t.document;t.change(n=>{!function(t,e,n){const r=n.isCollapsed,o=n.getFirstRange(),i=o.start.parent,s=o.end.parent,a=i==s;if(r)Ip(e,o.end);else{const r=!(o.start.isAtStart&&o.end.isAtEnd);t.deleteContent(n,{leaveUnmerged:r}),a?Ip(e,n.focus):r&&e.setSelection(s,0)}}(t,n,e.selection),this.fire("afterExecute",{writer:n})})}refresh(){const t=this.editor.model,e=t.document;this.isEnabled=function(t,e){if(e.rangeCount>1)return!1;const n=e.anchor;if(!n||!t.checkChild(n,"softBreak"))return!1;const r=e.getFirstRange(),o=r.start.parent,i=r.end.parent;if((Fp(o,t)||Fp(i,t))&&o!==i)return!1;return!0}(t.schema,e.selection)}}function Ip(t,e){const n=t.createElement("softBreak");t.insert(n,e),t.setSelection(n,"after")}function Fp(t,e){return!t.is("rootElement")&&(e.isLimit(t)||Fp(t.parent,e))}class Np extends Gh{static get pluginName(){return"ShiftEnter"}init(){const t=this.editor,e=t.model.schema,n=t.conversion,r=t.editing.view,o=r.document;e.register("softBreak",{allowWhere:"$text"}),n.for("upcast").add(aa({model:"softBreak",view:"br"})),n.for("downcast").add(Ns({model:"softBreak",view:(t,e)=>e.createEmptyElement("br")})),r.addObserver(Op),t.commands.add("shiftEnter",new Dp(t)),this.listenTo(o,"enter",(e,n)=>{n.isSoft&&(t.execute("shiftEnter"),n.preventDefault(),r.scrollToTheSelection())},{priority:"low"})}}class Mp{constructor(t,e=20){this.model=t,this.size=0,this.limit=e,this.isLocked=!1,this._changeCallback=((t,e)=>{"transparent"!=e.type&&e!==this._batch&&this._reset(!0)}),this._selectionChangeCallback=(()=>{this._reset()}),this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=new fd),this._batch}input(t){this.size+=t,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(t){this.isLocked&&!t||(this._batch=null,this.size=0)}}class Vp extends qf{constructor(t,e){super(t),this._buffer=new Mp(t.model,e)}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(t={}){const e=this.editor.model,n=e.document,r=t.text||"",o=r.length,i=t.range||n.selection.getFirstRange(),s=t.resultRange;e.enqueueChange(this._buffer.batch,t=>{const e=i.isCollapsed;this._buffer.lock(),e||t.remove(i),r&&t.insertText(r,n.selection.getAttributes(),i.start),s?t.setSelection(s):e&&t.setSelection(i.start.getShiftedBy(o)),this._buffer.unlock(),this._buffer.input(o)})}}function Bp(t){let e=null;const n=t.model,r=t.editing.view,o=t.commands.get("input");function i(){const t=o.buffer;t.lock(),n.enqueueChange(t.batch,()=>{n.deleteContent(n.document.selection)}),t.unlock()}r.document.on("keydown",(t,s)=>(function(t){const s=n.document,a=r.document.isComposing,c=e&&e.isEqual(s.selection);if(e=null,!o.isEnabled)return;if(function(t){if(t.ctrlKey)return!0;return Lp.includes(t.keyCode)}(t)||s.selection.isCollapsed)return;if(a&&229===t.keyCode)return;if(!a&&229===t.keyCode&&c)return;i()})(s),{priority:"lowest"}),r.document.on("compositionstart",function(){const t=n.document,e=1!==t.selection.rangeCount||t.selection.getFirstRange().isFlat;if(t.selection.isCollapsed||e)return;i()},{priority:"lowest"}),r.document.on("compositionend",()=>{e=new Ts(n.document.selection)},{priority:"lowest"})}const Lp=[Yr("arrowUp"),Yr("arrowRight"),Yr("arrowDown"),Yr("arrowLeft"),9,16,17,18,20,27,33,34,35,36];for(let t=112;t<=135;t++)Lp.push(t);function zp(t){if(0==t.length)return!1;for(const e of t)if("children"===e.type&&!qp(e))return!0;return!1}function qp(t){if(t.newChildren.length-t.oldChildren.length!=1)return;const e=function(t,e){const n=[];let r,o=0;return t.forEach(t=>{"equal"==t?(i(),o++):"insert"==t?(s("insert")?r.values.push(e[o]):(i(),r={type:"insert",index:o,values:[e[o]]}),o++):s("delete")?r.howMany++:(i(),r={type:"delete",index:o,howMany:1})}),i(),n;function i(){r&&(n.push(r),r=null)}function s(t){return r&&r.type==t}}(To(t.oldChildren,t.newChildren,jp),t.newChildren);if(e.length>1)return;const n=e[0];return n.values[0]instanceof On?n:void 0}function jp(t,e){return t instanceof On&&e instanceof On?t.data===e.data:t===e}class Hp{constructor(t){this.editor=t,this.editing=this.editor.editing}handle(t,e){if(zp(t))this._handleContainerChildrenMutations(t,e);else for(const n of t)this._handleTextMutation(n,e),this._handleTextNodeInsertion(n)}_handleContainerChildrenMutations(t,e){const n=function(t){const e=t.map(t=>t.node).reduce((t,e)=>t.getCommonAncestor(e,{includeSelf:!0}));if(!e)return;return e.getAncestors({includeSelf:!0,parentFirst:!0}).find(t=>t.is("containerElement")||t.is("rootElement"))}(t);if(!n)return;const r=this.editor.editing.view.domConverter.mapViewToDom(n),o=new qo,i=this.editor.data.toModel(o.domToView(r)).getChild(0),s=this.editor.editing.mapper.toModelElement(n);if(!s)return;const a=Array.from(i.getChildren()),c=Array.from(s.getChildren()),l=a[a.length-1],u=c[c.length-1];if(l&&l.is("softBreak")&&u&&!u.is("softBreak")&&a.pop(),!$p(a)||!$p(c))return;const d=a.map(t=>t.is("text")?t.data:"@").join("").replace(/\u00A0/g," "),h=c.map(t=>t.is("text")?t.data:"@").join("");if(h===d)return;const f=To(h,d),{firstChangeAt:p,insertions:m,deletions:g}=Up(f);let b=null;e&&(b=this.editing.mapper.toModelRange(e.getFirstRange()));const w=d.substr(p,m),v=_s.createFromParentsAndOffsets(s,p,s,p+g);this.editor.execute("input",{text:w,range:v,resultRange:b})}_handleTextMutation(t,e){if("text"!=t.type)return;const n=t.newText.replace(/\u00A0/g," "),r=To(t.oldText.replace(/\u00A0/g," "),n),{firstChangeAt:o,insertions:i,deletions:s}=Up(r);let a=null;e&&(a=this.editing.mapper.toModelRange(e.getFirstRange()));const c=new Ir(t.node,o),l=this.editing.mapper.toModelPosition(c),u=_s.createFromPositionAndShift(l,s),d=n.substr(o,i);this.editor.execute("input",{text:d,range:u,resultRange:a})}_handleTextNodeInsertion(t){if("children"!=t.type)return;const e=qp(t),n=new Ir(t.node,e.index),r=this.editing.mapper.toModelPosition(n),o=e.values[0].data;this.editor.execute("input",{text:o.replace(/\u00A0/g," "),range:new _s(r)})}}function $p(t){return t.every(t=>t.is("text")||t.is("softBreak"))}function Up(t){let e=null,n=null;for(let r=0;r{new Hp(t).handle(n,r)})}(t)}}class Gp extends qf{constructor(t,e){super(t),this.direction=e,this._buffer=new Mp(t.model,t.config.get("typing.undoStep"))}execute(t={}){const e=this.editor.model,n=e.document;e.enqueueChange(this._buffer.batch,r=>{this._buffer.lock();const o=new Ts(n.selection),i=o.isCollapsed;if(o.isCollapsed&&e.modifySelection(o,{direction:this.direction,unit:t.unit}),this._shouldEntireContentBeReplacedWithParagraph(t.sequence||1))return void this._replaceEntireContentWithParagraph(r);if(o.isCollapsed)return;let s=0;o.getFirstRange().getMinimalFlatRanges().forEach(t=>{s+=Mr(t.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),e.deleteContent(o,{doNotResetEntireContent:i}),this._buffer.input(s),r.setSelection(o),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(t){if(t>1)return!1;const e=this.editor.model,n=e.document.selection,r=e.schema.getLimitElement(n);if(!(n.isCollapsed&&n.containsEntireContent(r)))return!1;if(!e.schema.checkChild(r,"paragraph"))return!1;const o=r.getChild(0);return!o||"paragraph"!==o.name}_replaceEntireContentWithParagraph(t){const e=this.editor.model,n=e.document.selection,r=e.schema.getLimitElement(n),o=new ms("paragraph");t.remove(_s.createIn(r)),t.insert(o,r),t.setSelection(o,0)}}class Kp extends Ko{constructor(t){super(t);const e=t.document;let n=0;e.on("keyup",(t,e)=>{e.keyCode!=Qr.delete&&e.keyCode!=Qr.backspace||(n=0)}),e.on("keydown",(t,r)=>{const o={};if(r.keyCode==Qr.delete)o.direction="forward",o.unit="character";else{if(r.keyCode!=Qr.backspace)return;o.direction="backward",o.unit="codePoint"}const i=Kr.isMac?r.altKey:r.ctrlKey;let s;o.unit=i?"word":o.unit,o.sequence=++n,e.once("delete",t=>s=t,{priority:"highest"}),e.fire("delete",new Fi(e,r.domEvent,o)),s&&s.stop.called&&t.stop()})}observe(){}}function Jp(t){const e=t.model,n=t.editing.view,r=200;let o=null,i=new Ts(e.document.selection),s=Date.now();e.document.selection.on("change",function(t){const e=new Ts(t.source);i.isEqual(e)||(o=i,i=e,s=Date.now())}),n.document.on("mutations",function(n,a){zp(a)&&function(t){for(const e of t){if("children"!==e.type)continue;const t=e.oldChildren,n=e.newChildren;if(!Zp(t))continue;const r=To(t,n),o=r.some(t=>"delete"===t),i=r.some(t=>"insert"===t);if(o&&!i)return!0}return!1}(a)&&(!function(){Date.now()-s{t.setSelection(o)});t.execute("delete")}(),n.stop())},{priority:"highest"})}function Zp(t){return t.every(t=>t.is("containerElement"))}class Qp extends Gh{static get pluginName(){return"Delete"}init(){const t=this.editor,e=t.editing.view,n=e.document;e.addObserver(Kp),t.commands.add("forwardDelete",new Gp(t,"forward")),t.commands.add("delete",new Gp(t,"backward")),this.listenTo(n,"delete",(n,r)=>{t.execute("forward"==r.direction?"forwardDelete":"delete",{unit:r.unit,sequence:r.sequence}),r.preventDefault(),e.scrollToTheSelection()}),Jp(t)}}class Yp extends Gh{static get requires(){return[Wp,Qp]}static get pluginName(){return"Typing"}}class Xp extends qf{constructor(t){super(t),this._stack=[],this._createdBatches=new WeakSet,this.refresh()}refresh(){this.isEnabled=this._stack.length>0}addBatch(t){const e=this.editor.model.document.selection,n={ranges:e.hasOwnRange?Array.from(e.getRanges()):[],isBackward:e.isBackward};this._stack.push({batch:t,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(t,e,n){const r=this.editor.model,o=r.document,i=[];for(const e of t){const t=tm(e,n).find(t=>t.start.root!=o.graveyard);t&&i.push(t)}i.length&&r.change(t=>{t.setSelection(i,{backward:e})})}_undo(t,e){const n=this.editor.model,r=n.document;this._createdBatches.add(e);const o=t.deltas.slice();o.reverse();for(const t of o)if(t.operations.some(t=>t.isDocumentOperation)){const o=t.baseVersion+t.operations.length,i=Array.from(r.history.getDeltas(o)),s=n.transformDeltas([t.getReversed()],i,!0).deltasA;for(const o of s){o.baseVersion=r.version,e.addDelta(o);for(const t of o.operations)n.applyOperation(t);r.history.setDeltaAsUndone(t,o)}}}}function tm(t,e){const n=function(t,e){for(const n of e)for(const e of n.operations)for(let n=0;nt.start.isBefore(e.start)?-1:1);for(let t=1;te.batch==t):this._stack.length-1,n=this._stack.splice(e,1)[0],r=new fd;this.editor.model.enqueueChange(r,()=>{this._undo(n.batch,r);const t=this.editor.model.document.history.getDeltas(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,t),this.fire("revert",n.batch,r)}),this.refresh()}}class nm extends Xp{execute(){const t=this._stack.pop(),e=new fd;this.editor.model.enqueueChange(e,()=>{const n=t.batch.deltas[t.batch.deltas.length-1],r=n.baseVersion+n.operations.length,o=this.editor.model.document.history.getDeltas(r);this._restoreSelection(t.selection.ranges,t.selection.isBackward,o),this._undo(t.batch,e)}),this.refresh()}}class rm extends Gh{constructor(t){super(t),this._batchRegistry=new WeakSet}init(){const t=this.editor;this._undoCommand=new em(t),this._redoCommand=new nm(t),t.commands.add("undo",this._undoCommand),t.commands.add("redo",this._redoCommand),this.listenTo(t.model,"applyOperation",(t,e)=>{const n=e[0];if(!n.isDocumentOperation)return;const r=n.delta.batch;this._batchRegistry.has(r)||"transparent"==r.type||(this._redoCommand._createdBatches.has(r)?this._undoCommand.addBatch(r):this._undoCommand._createdBatches.has(r)||(this._undoCommand.addBatch(r),this._redoCommand.clearStack()),this._batchRegistry.add(r))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(t,e,n)=>{this._redoCommand.addBatch(n)}),t.keystrokes.set("CTRL+Z","undo"),t.keystrokes.set("CTRL+Y","redo"),t.keystrokes.set("CTRL+SHIFT+Z","redo")}}var om=n(35),im=n.n(om),sm=n(36),am=n.n(sm);class cm extends Gh{init(){const t=this.editor.t;this._addButton("undo",t("bc"),"CTRL+Z",im.a),this._addButton("redo",t("bd"),"CTRL+Y",am.a)}_addButton(t,e,n,r){const o=this.editor;o.ui.componentFactory.add(t,i=>{const s=o.commands.get(t),a=new Wh(i);return a.set({label:e,icon:r,keystroke:n,tooltip:!0}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",()=>o.execute(t)),a})}}class lm extends Gh{static get requires(){return[rm,cm]}static get pluginName(){return"Undo"}}const um="ckCsrfToken",dm=40,hm="abcdefghijklmnopqrstuvwxyz0123456789";function fm(){let t=function(t){t=t.toLowerCase();const e=document.cookie.split(";");for(const n of e){const e=n.split("="),r=decodeURIComponent(e[0].trim().toLowerCase());if(r===t)return decodeURIComponent(e[1])}return null}(um);return t&&t.length==dm||(t=function(t){let e="";const n=new Uint8Array(t);window.crypto.getRandomValues(n);for(let t=0;t.5?r.toUpperCase():r}return e}(dm),function(t,e){document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(e)+";path=/"}(um,t)),t}class pm{constructor(t,e,n){this.loader=t,this.url=e,this.t=n}upload(){return new Promise((t,e)=>{this._initRequest(),this._initListeners(t,e),this._sendRequest()})}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const t=this.xhr=new XMLHttpRequest;t.open("POST",this.url,!0),t.responseType="json"}_initListeners(t,e){const n=this.xhr,r=this.loader,o=(0,this.t)("a")+` ${r.file.name}.`;n.addEventListener("error",()=>e(o)),n.addEventListener("abort",()=>e()),n.addEventListener("load",()=>{const r=n.response;if(!r||!r.uploaded)return e(r&&r.error&&r.error.message?r.error.message:o);t({default:r.url})}),n.upload&&n.upload.addEventListener("progress",t=>{t.lengthComputable&&(r.uploadTotal=t.total,r.uploaded=t.loaded)})}_sendRequest(){const t=new FormData;t.append("upload",this.loader.file),t.append("ckCsrfToken",fm()),this.xhr.send(t)}}class mm{constructor(t,e,n){let r;if("function"==typeof n)r=n;else{const e=n;r=(()=>{t.execute(e)})}t.model.document.on("change",(n,o)=>{if("transparent"==o.type)return;const i=Array.from(t.model.document.differ.getChanges()),s=i[0];if(1!=i.length||"insert"!==s.type||"$text"!=s.name||1!=s.length)return;const a=s.position.textNode||s.position.nodeAfter;if(!a.parent.is("paragraph"))return;const c=e.exec(a.data);c&&t.model.enqueueChange(t=>{const e=_s.createFromParentsAndOffsets(a.parent,0,a.parent,c[0].length);t.remove(e),r({match:c})})})}}class gm{constructor(t,e,n){let r,o,i,s;e instanceof RegExp?r=e:i=e,"string"==typeof n?o=n:s=n,i=i||(t=>{let e;const n=[],o=[];for(;null!==(e=r.exec(t))&&!(e&&e.length<4);){let{index:t,1:r,2:i,3:s}=e;const a=r+i+s,c=[t+=e[0].length-a.length,t+r.length],l=[t+r.length+i.length,t+r.length+i.length+s.length];n.push(c),n.push(l),o.push([t+r.length,t+r.length+i.length])}return{remove:n,format:o}}),s=s||((t,e)=>{for(const n of e)t.setAttribute(o,!0,n);t.removeSelectionAttribute(o)}),t.model.document.on("change",(e,n)=>{if("transparent"==n.type)return;const r=t.model.document.selection;if(!r.isCollapsed)return;const a=Array.from(t.model.document.differ.getChanges()),c=a[0];if(1!=a.length||"insert"!==c.type||"$text"!=c.name||1!=c.length)return;const l=r.focus.parent,u=function(t){return Array.from(t.getChildren()).reduce((t,e)=>t+e.data,"")}(l).slice(0,r.focus.offset),d=i(u),h=bm(l,d.format),f=bm(l,d.remove);h.length&&f.length&&t.model.enqueueChange(e=>{const n=t.model.schema.getValidRanges(h,o);s(e,n);for(const t of f.reverse())e.remove(t)})})}}function bm(t,e){return e.filter(t=>void 0!==t[0]&&void 0!==t[1]).map(e=>_s.createFromParentsAndOffsets(t,e[0],t,e[1]))}class wm extends qf{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,n=e.document.selection,r=void 0===t.forceValue?!this.value:t.forceValue;e.change(t=>{if(n.isCollapsed)r?t.setSelectionAttribute(this.attributeKey,!0):t.removeSelectionAttribute(this.attributeKey);else{const o=e.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const e of o)r?t.setAttribute(this.attributeKey,r,e):t.removeAttribute(this.attributeKey,e)}})}_getValueFromFirstAllowedNode(){const t=this.editor.model,e=t.schema,n=t.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);for(const t of n.getRanges())for(const n of t.getItems())if(e.checkAttribute(n,this.attributeKey))return n.hasAttribute(this.attributeKey);return!1}}const vm="bold";class _m extends Gh{init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:vm}),t.conversion.attributeToElement({model:vm,view:"strong",upcastAlso:["b",{styles:{"font-weight":"bold"}}]}),t.commands.add(vm,new wm(t,vm)),t.keystrokes.set("CTRL+B",vm)}}var km=n(37),ym=n.n(km);const xm="bold";class Cm extends Gh{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(xm,n=>{const r=t.commands.get(xm),o=new Wh(n);return o.set({label:e("az"),icon:ym.a,keystroke:"CTRL+B",tooltip:!0}),o.bind("isOn","isEnabled").to(r,"value","isEnabled"),this.listenTo(o,"execute",()=>t.execute(xm)),o})}}const Am="code";class Tm extends Gh{init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:Am}),t.conversion.attributeToElement({model:Am,view:"code",upcastAlso:{styles:{"word-wrap":"break-word"}}}),t.commands.add(Am,new wm(t,Am))}}var Em=n(38),Sm=n.n(Em);n(19);const Pm="code";class Om extends Gh{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(Pm,n=>{const r=t.commands.get(Pm),o=new Wh(n);return o.set({label:e("ba"),icon:Sm.a,tooltip:!0}),o.bind("isOn","isEnabled").to(r,"value","isEnabled"),this.listenTo(o,"execute",()=>t.execute(Pm)),o})}}const Rm="strikethrough";class Dm extends Gh{init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:Rm}),t.conversion.attributeToElement({model:Rm,view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),t.commands.add(Rm,new wm(t,Rm)),t.keystrokes.set("CTRL+SHIFT+X","strikethrough")}}var Im=n(39),Fm=n.n(Im);const Nm="strikethrough";class Mm extends Gh{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(Nm,n=>{const r=t.commands.get(Nm),o=new Wh(n);return o.set({label:e("bb"),icon:Fm.a,keystroke:"CTRL+SHIFT+X",tooltip:!0}),o.bind("isOn","isEnabled").to(r,"value","isEnabled"),this.listenTo(o,"execute",()=>t.execute(Nm)),o})}}const Vm="italic";class Bm extends Gh{init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:Vm}),t.conversion.attributeToElement({model:Vm,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),t.commands.add(Vm,new wm(t,Vm)),t.keystrokes.set("CTRL+I",Vm)}}var Lm=n(40),zm=n.n(Lm);const qm="italic";class jm extends Gh{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(qm,n=>{const r=t.commands.get(qm),o=new Wh(n);return o.set({label:e("ai"),icon:zm.a,keystroke:"CTRL+I",tooltip:!0}),o.bind("isOn","isEnabled").to(r,"value","isEnabled"),this.listenTo(o,"execute",()=>t.execute(qm)),o})}}function Hm(t){const e=t.next();return e.done?null:e.value}class $m extends qf{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document,n=t.schema,r=Array.from(e.selection.getSelectedBlocks());t.change(t=>{if(this.value)this._removeQuote(t,r.filter(Um));else{const e=r.filter(t=>Um(t)||Gm(n,t));this._applyQuote(t,e)}})}_getValue(){const t=Hm(this.editor.model.document.selection.getSelectedBlocks());return!(!t||!Um(t))}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,n=Hm(t.getSelectedBlocks());return!!n&&Gm(e,n)}_removeQuote(t,e){Wm(e).reverse().forEach(e=>{if(e.start.isAtStart&&e.end.isAtEnd)return void t.unwrap(e.start.parent);if(e.start.isAtStart){const n=vs.createBefore(e.start.parent);return void t.move(e,n)}e.end.isAtEnd||t.split(e.end);const n=vs.createAfter(e.end.parent);t.move(e,n)})}_applyQuote(t,e){const n=[];Wm(e).reverse().forEach(e=>{let r=Um(e.start);r||(r=new ms("blockQuote"),t.wrap(e,r)),n.push(r)}),n.reverse().reduce((e,n)=>e.nextSibling==n?(t.merge(vs.createAfter(e)),e):n)}}function Um(t){return"blockQuote"==t.parent.name?t.parent:null}function Wm(t){let e,n=0;const r=[];for(;n{if(t.endsWith("blockQuote")&&"blockQuote"==e.name)return!1}),t.conversion.elementToElement({model:"blockQuote",view:"blockquote"})}afterInit(){const t=this.editor.commands.get("blockQuote");this.listenTo(this.editor.editing.view.document,"enter",(e,n)=>{const r=this.editor.model.document,o=r.selection.getLastPosition().parent;r.selection.isCollapsed&&o.isEmpty&&t.value&&(this.editor.execute("blockQuote"),this.editor.editing.view.scrollToTheSelection(),n.preventDefault(),e.stop())})}}var Jm=n(41),Zm=n.n(Jm);n(88);class Qm extends Gh{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("blockQuote",n=>{const r=t.commands.get("blockQuote"),o=new Wh(n);return o.set({label:e("ah"),icon:Zm.a,tooltip:!0}),o.bind("isOn","isEnabled").to(r,"value","isEnabled"),this.listenTo(o,"execute",()=>t.execute("blockQuote")),o})}}class Ym extends qf{refresh(){const t=this.editor.model,e=Hm(t.document.selection.getSelectedBlocks());this.value=!!e&&e.is("paragraph"),this.isEnabled=!!e&&Xm(e,t.schema)}execute(t={}){const e=this.editor.model,n=e.document;e.change(r=>{const o=(t.selection||n.selection).getSelectedBlocks();for(const t of o)!t.is("paragraph")&&Xm(t,e.schema)&&r.rename(t,"paragraph")})}}function Xm(t,e){return e.checkChild(t.parent,"paragraph")&&!e.isObject(t)}class tg extends Gh{static get pluginName(){return"Paragraph"}init(){const t=this.editor,e=t.model,n=t.data;t.commands.add("paragraph",new Ym(t)),e.schema.register("paragraph",{inheritAllFrom:"$block"}),t.conversion.elementToElement({model:"paragraph",view:"p"}),n.upcastDispatcher.on("element",(t,e,n)=>{if(n.consumable.test(e.viewItem,{name:e.viewItem.name}))if(tg.paragraphLikeElements.has(e.viewItem.name)){if(e.viewItem.isEmpty)return;const t=n.writer.createElement("paragraph"),r=n.splitToAllowedParent(t,e.modelCursor);if(!r)return;n.writer.insert(t,r.position);const{modelRange:o}=n.convertChildren(e.viewItem,vs.createAt(t));e.modelRange=new _s(vs.createBefore(t),o.end),e.modelCursor=e.modelRange.end}else ng(e.viewItem,e.modelCursor,n.schema)&&(e=Object.assign(e,eg(e.viewItem,e.modelCursor,n)))},{priority:"low"}),n.upcastDispatcher.on("text",(t,e,n)=>{e.modelRange||ng(e.viewItem,e.modelCursor,n.schema)&&(e=Object.assign(e,eg(e.viewItem,e.modelCursor,n)))},{priority:"lowest"}),e.document.registerPostFixer(t=>this._autoparagraphEmptyRoots(t)),t.on("dataReady",()=>{e.enqueueChange("transparent",t=>this._autoparagraphEmptyRoots(t))},{priority:"lowest"})}_autoparagraphEmptyRoots(t){const e=this.editor.model;for(const n of e.document.getRootNames()){const r=e.document.getRoot(n);if(r.isEmpty&&"$graveyard"!=r.rootName&&e.schema.checkChild(r,"paragraph"))return t.insertElement("paragraph",r),!0}}}function eg(t,e,n){const r=n.writer.createElement("paragraph");return n.writer.insert(r,e),n.convertItem(t,vs.createAt(r))}function ng(t,e,n){const r=new Js(e);return!!n.checkChild(r,"paragraph")&&!!n.checkChild(r.push("paragraph"),t)}tg.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td"]);class rg extends qf{constructor(t,e){super(t),this.modelElements=e}refresh(){const t=Hm(this.editor.model.document.selection.getSelectedBlocks());this.value=!!t&&this.modelElements.includes(t.name)&&t.name,this.isEnabled=!!t&&this.modelElements.some(e=>og(t,e,this.editor.model.schema))}execute(t){const e=this.editor.model,n=e.document,r=t.value;e.change(t=>{const o=Array.from(n.selection.getSelectedBlocks()).filter(t=>og(t,r,e.schema));for(const e of o)e.is(r)||t.rename(e,r)})}}function og(t,e,n){return n.checkChild(t.parent,e)&&!n.isObject(t)}const ig="paragraph";class sg extends Gh{constructor(t){super(t),t.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[tg]}init(){const t=this.editor,e=t.config.get("heading.options"),n=[];for(const r of e)r.model!==ig&&(t.model.schema.register(r.model,{inheritAllFrom:"$block"}),t.conversion.elementToElement(r),n.push(r.model));t.commands.add("heading",new rg(t,n))}afterInit(){const t=this.editor,e=t.commands.get("enter"),n=t.config.get("heading.options");e&&this.listenTo(e,"afterExecute",(e,r)=>{const o=t.model.document.selection.getFirstPosition().parent;n.some(t=>o.is(t.model))&&!o.is(ig)&&0===o.childCount&&r.writer.rename(o,ig)})}}class ag{constructor(t,e){e&&br(this,e),t&&this.set(t)}}P(ag,yr);class cg extends Sh{constructor(t){super(t);const e=this.bindTemplate;this.set("isVisible",!1),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",e.if("isVisible","ck-dropdown__panel-visible")]},children:this.children,on:{selectstart:e.to(t=>t.preventDefault())}})}focus(){this.children.length&&this.children.first.focus()}focusLast(){if(this.children.length){const t=this.children.last;"function"==typeof t.focusLast?t.focusLast():t.focus()}}}n(90);class lg extends Sh{constructor(t,e,n){super(t);const r=this.bindTemplate;this.buttonView=e,this.panelView=n,this.set("isOpen",!1),this.set("isEnabled",!0),this.focusTracker=new oh,this.keystrokes=new Jd,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",r.if("isEnabled","ck-disabled",t=>!t)]},children:[e,n]}),e.extendTemplate({attributes:{class:["ck-dropdown__button"]}})}render(){super.render(),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes.listenTo(this.element),this.focusTracker.add(this.element);const t=(t,e)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,e())};this.keystrokes.set("arrowdown",(t,e)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,e())}),this.keystrokes.set("arrowright",(t,e)=>{this.isOpen&&e()}),this.keystrokes.set("arrowleft",t),this.keystrokes.set("esc",t)}focus(){this.buttonView.focus()}}var ug=n(42),dg=n.n(ug);class hg extends Wh{constructor(t){super(t),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 t=new $h;return t.content=dg.a,t.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),t}}n(92);class fg extends Sh{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new oh,this.keystrokes=new Jd,this._focusCycler=new Vh({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 t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class pg extends Sh{constructor(t){super(t),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item"]},children:this.children})}focus(){this.children.first.focus()}}class mg extends Sh{constructor(t){super(t),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}n(94);class gg extends Wh{constructor(t){super(t),this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const t=new Sh;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),t}}function bg({emitter:t,activator:e,callback:n,contextElements:r}){t.listenTo(document,"mousedown",(t,{target:o})=>{if(e()){for(const t of r)if(t.contains(o))return;n()}})}n(96),n(98);function wg(t,e=hg){const n=new e(t),r=new cg(t),o=new lg(t,n,r);return n.bind("isEnabled").to(o),n instanceof hg?n.bind("isOn").to(o,"isOpen"):n.arrowView.bind("isOn").to(o,"isOpen"),function(t){(function(t){t.on("render",()=>{bg({emitter:t,activator:()=>t.isOpen,callback:()=>{t.isOpen=!1},contextElements:[t.element]})})})(t),function(t){t.on("execute",e=>{e.source instanceof gg||(t.isOpen=!1)})}(t),function(t){t.keystrokes.set("arrowdown",(e,n)=>{t.isOpen&&(t.panelView.focus(),n())}),t.keystrokes.set("arrowup",(e,n)=>{t.isOpen&&(t.panelView.focusLast(),n())})}(t)}(o),o}function vg(t,e){const n=t.locale,r=t.listView=new fg(n);r.items.bindTo(e).using(({type:t,model:e})=>{if("separator"===t)return new mg(n);if("button"===t||"switchbutton"===t){const r=new pg(n);let o;return(o="button"===t?new Wh(n):new gg(n)).bind(...Object.keys(e)).to(e),o.delegate("execute").to(r),r.children.add(o),r}}),t.panelView.children.add(r),r.items.delegate("execute").to(t)}n(20);class _g extends Gh{init(){const t=this.editor,e=t.t,n=function(t){const e=t.t,n={Paragraph:e("am"),"Heading 1":e("an"),"Heading 2":e("ao"),"Heading 3":e("ap")};return t.config.get("heading.options").map(t=>{const e=n[t.title];return e&&e!=t.title&&(t=Object.assign({},t,{title:e})),t})}(t),r=e("ad"),o=e("ae");t.ui.componentFactory.add("heading",e=>{const i={},s=new Lr,a=t.commands.get("heading"),c=t.commands.get("paragraph"),l=[a];for(const t of n){const e={type:"button",model:new ag({label:t.title,class:t.class,withText:!0})};"paragraph"===t.model?(e.model.bind("isOn").to(c,"value"),e.model.set("commandName","paragraph"),l.push(c)):(e.model.bind("isOn").to(a,"value",e=>e===t.model),e.model.set({commandName:"heading",commandValue:t.model})),s.add(e),i[t.model]=t.title}const u=wg(e);return vg(u,s),u.buttonView.set({isOn:!1,withText:!0,tooltip:o}),u.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),u.bind("isEnabled").toMany(l,"isEnabled",(...t)=>t.some(t=>t)),u.buttonView.bind("label").to(a,"value",c,"value",(t,e)=>{const n=t||e&&"paragraph";return i[n]?i[n]:r}),this.listenTo(u,"execute",e=>{t.execute(e.source.commandName,e.source.commandValue?{value:e.source.commandValue}:void 0),t.editing.view.focus()}),u})}}class kg extends Ko{constructor(t){super(t),this._observedElements=new Set}observe(t,e){this.document.getRoot(e).on("change:children",(e,n)=>{this.view.once("render",()=>this._updateObservedElements(t,n))})}_updateObservedElements(t,e){if(!e.is("element")||e.is("attributeElement"))return;const n=this.view.domConverter.mapViewToDom(e);if(n){for(const t of n.querySelectorAll("img"))this._observedElements.has(t)||(this.listenTo(t,"load",(t,e)=>this._fireEvents(e)),this._observedElements.add(t));for(const e of this._observedElements)t.contains(e)||(this.stopListening(e),this._observedElements.delete(e))}}_fireEvents(t){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",t))}destroy(){this._observedElements.clear(),super.destroy()}}function yg(t){return n=>{n.on(`attribute:${t}:image`,e)};function e(t,e,n){if(!n.consumable.consume(e.item,t.name))return;const r=n.writer,o=n.mapper.toViewElement(e.item).getChild(0);null!==e.attributeNewValue?r.setAttribute(e.attributeKey,e.attributeNewValue,o):r.removeAttribute(e.attributeKey,o)}}const xg=Symbol("isImage");function Cg(t){const e=t.getSelectedElement();return!(!e||!function(t){return!!t.getCustomProperty(xg)&&of(t)}(e))}function Ag(t){return t instanceof ms&&"image"==t.name}class Tg extends Gh{init(){const t=this.editor,e=t.model.schema,n=t.t,r=t.conversion;t.editing.view.addObserver(kg),e.register("image",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["alt","src","srcset"]}),r.for("dataDowncast").add(Ns({model:"image",view:(t,e)=>Eg(e)})),r.for("editingDowncast").add(Ns({model:"image",view:(t,e)=>(function(t,e,n){return e.setCustomProperty(xg,!0,t),sf(t,e,{label:function(){const e=t.getChild(0).getAttribute("alt");return e?`${e} ${n}`:n}})})(Eg(e),e,n("ag"))})),r.for("downcast").add(yg("src")).add(yg("alt")).add(function(){return e=>{e.on("attribute:srcset:image",t)};function t(t,e,n){if(!n.consumable.consume(e.item,t.name))return;const r=n.writer,o=n.mapper.toViewElement(e.item).getChild(0);if(null===e.attributeNewValue){const t=e.attributeOldValue;t.data&&(r.removeAttribute("srcset",o),r.removeAttribute("sizes",o),t.width&&r.removeAttribute("width",o))}else{const t=e.attributeNewValue;t.data&&(r.setAttribute("srcset",t.data,o),r.setAttribute("sizes","100vw",o),t.width&&r.setAttribute("width",t.width,o))}}}()),r.for("upcast").add(aa({view:{name:"img",attributes:{src:!0}},model:(t,e)=>e.createElement("image",{src:t.getAttribute("src")})})).add(la({view:{name:"img",key:"alt"},model:"alt"})).add(la({view:{name:"img",key:"srcset"},model:{key:"srcset",value:t=>{const e={data:t.getAttribute("srcset")};return t.hasAttribute("width")&&(e.width=t.getAttribute("width")),e}}})).add(function(){return e=>{e.on("element:figure",t)};function t(t,e,n){if(!n.consumable.test(e.viewItem,{name:!0,classes:"image"}))return;const r=Array.from(e.viewItem.getChildren()).find(t=>t.is("img"));if(!r||!r.hasAttribute("src")||!n.consumable.test(r,{name:!0}))return;const o=n.convertItem(r,e.modelCursor),i=Hm(o.modelRange.getItems());i&&(n.convertChildren(e.viewItem,vs.createAt(i)),e.modelRange=o.modelRange,e.modelCursor=o.modelCursor)}}())}}function Eg(t){const e=t.createEmptyElement("img"),n=t.createContainerElement("figure",{class:"image"});return t.insert(Ir.createAt(n),e),n}class Sg extends qf{refresh(){const t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=Ag(t),Ag(t)&&t.hasAttribute("alt")?this.value=t.getAttribute("alt"):this.value=!1}execute(t){const e=this.editor.model,n=e.document.selection.getSelectedElement();e.change(e=>{e.setAttribute("alt",t.newValue,n)})}}class Pg extends Gh{init(){this.editor.commands.add("imageTextAlternative",new Sg(this.editor))}}class Og extends Sh{constructor(t,e){super(t);const n=`ck-input-${w()}`;this.set("label"),this.set("value"),this.set("isReadOnly",!1),this.labelView=this._createLabelView(n),this.inputView=this._createInputView(e,n);const r=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-input",r.if("isReadOnly","ck-disabled")]},children:[this.labelView,this.inputView]})}_createLabelView(t){const e=new Oh(this.locale);return e.for=t,e.bind("text").to(this,"label"),e}_createInputView(t,e){const n=new t(this.locale);return n.id=e,n.bind("value").to(this),n.bind("isReadOnly").to(this),n}select(){this.inputView.select()}focus(){this.inputView.focus()}}n(101);class Rg extends Sh{constructor(t){super(t),this.set("value"),this.set("id"),this.set("placeholder"),this.set("isReadOnly",!1);const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{type:"text",class:["ck","ck-input","ck-input-text"],id:e.to("id"),placeholder:e.to("placeholder"),readonly:e.to("isReadOnly")}})}render(){super.render();const t=t=>{this.element.value=t||0===t?t:""};t(this.value),this.on("change:value",(e,n,r)=>{t(r)})}select(){this.element.select()}focus(){this.element.focus()}}function Dg({view:t}){t.listenTo(t.element,"submit",(e,n)=>{n.preventDefault(),t.fire("submit")},{useCapture:!0})}var Ig=n(6),Fg=n.n(Ig),Ng=n(7),Mg=n.n(Ng);n(103);class Vg extends Sh{constructor(t){super(t);const e=this.locale.t;this.focusTracker=new oh,this.keystrokes=new Jd,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(e("au"),Fg.a,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(e("av"),Mg.a,"ck-button-cancel","cancel"),this._focusables=new ah,this._focusCycler=new Vh({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),Dg({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)})}_createButton(t,e,n,r){const o=new Wh(this.locale);return o.set({label:t,icon:e,tooltip:!0}),o.extendTemplate({attributes:{class:n}}),r&&o.delegate("execute").to(this,r),o}_createLabeledInputView(){const t=this.locale.t,e=new Og(this.locale,Rg);return e.label=t("ax"),e.inputView.placeholder=t("ax"),e}}var Bg=n(43),Lg=n.n(Bg);function zg(t){const e=t.plugins.get("ContextualBalloon");if(Cg(t.editing.view.document.selection)){const n=qg(t);e.updatePosition(n)}}function qg(t){const e=t.editing.view,n=kf.defaultPositions;return{target:e.domConverter.viewToDom(e.document.selection.getSelectedElement()),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}}class jg extends Gh{static get requires(){return[Af]}init(){this._createButton(),this._createForm()}_createButton(){const t=this.editor,e=t.t;t.ui.componentFactory.add("imageTextAlternative",n=>{const r=t.commands.get("imageTextAlternative"),o=new Wh(n);return o.set({label:e("al"),icon:Lg.a,tooltip:!0}),o.bind("isEnabled").to(r,"isEnabled"),this.listenTo(o,"execute",()=>this._showForm()),o})}_createForm(){const t=this.editor,e=t.editing.view.document;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new Vg(t.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{t.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",(t,e)=>{this._hideForm(!0),e()}),this.listenTo(t.ui,"update",()=>{Cg(e.selection)?this._isVisible&&zg(t):this._hideForm(!0)}),bg({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._form.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const t=this.editor,e=t.commands.get("imageTextAlternative"),n=this._form.labeledInput;this._balloon.hasView(this._form)||this._balloon.add({view:this._form,position:qg(t)}),n.value=n.inputView.element.value=e.value||"",this._form.labeledInput.select()}_hideForm(t){this._isVisible&&(this._balloon.remove(this._form),t&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView==this._form}}class Hg extends Gh{static get requires(){return[Pg,jg]}static get pluginName(){return"ImageTextAlternative"}}n(105);n(107);const $g=new WeakMap;function Ug(t,e,n,r){const o=t.document;$g.has(o)||($g.set(o,new Map),o.registerPostFixer(t=>(function(t,e){const n=$g.get(t);let r=!1;for(const[t,o]of n)Wg(e,t,o)&&(r=!0);return r})(o,t))),$g.get(o).set(e,{placeholderText:n,checkFunction:r}),t.render()}function Wg(t,e,n){const r=e.document,o=n.placeholderText;let i=!1;if(!r)return!1;e.getAttribute("data-placeholder")!==o&&(t.setAttribute("data-placeholder",o,e),i=!0);const s=r.selection.anchor,a=n.checkFunction;if(a&&!a())return e.hasClass("ck-placeholder")&&(t.removeClass("ck-placeholder",e),i=!0),i;const c=!Array.from(e.getChildren()).some(t=>!t.is("uiElement"));return!r.isFocused&&c?(e.hasClass("ck-placeholder")||(t.addClass("ck-placeholder",e),i=!0),i):(c&&s&&s.parent!==e?e.hasClass("ck-placeholder")||(t.addClass("ck-placeholder",e),i=!0):e.hasClass("ck-placeholder")&&(t.removeClass("ck-placeholder",e),i=!0),i)}const Gg=Symbol("imageCaption");function Kg(t){for(const e of t.getChildren())if(e instanceof ms&&"caption"==e.name)return e;return null}function Jg(t){const e=t.parent;return"figcaption"==t.name&&e&&"figure"==e.name&&e.hasClass("image")?{name:!0}:null}class Zg extends Gh{init(){const t=this.editor,e=t.editing.view,n=t.model.schema,r=t.data,o=t.editing,i=t.t;n.register("caption",{allowIn:"image",allowContentOf:"$block",isLimit:!0}),t.model.document.registerPostFixer(t=>this._insertMissingModelCaptionElement(t)),t.conversion.for("upcast").add(aa({view:Jg,model:"caption"}));r.downcastDispatcher.on("insert:caption",Qg(t=>t.createContainerElement("figcaption"),!1));const s=function(t,e){return n=>{const r=n.createEditableElement("figcaption");return n.setCustomProperty(Gg,!0,r),Ug(t,r,e),cf(r,n)}}(e,i("af"));o.downcastDispatcher.on("insert:caption",Qg(s)),o.downcastDispatcher.on("insert",this._fixCaptionVisibility(t=>t.item),{priority:"high"}),o.downcastDispatcher.on("remove",this._fixCaptionVisibility(t=>t.position.parent),{priority:"high"}),e.document.registerPostFixer(t=>this._updateCaptionVisibility(t))}_updateCaptionVisibility(t){const e=this.editor.editing.mapper,n=this._lastSelectedCaption;let r;const o=this.editor.model.document.selection,i=o.getSelectedElement();if(i&&i.is("image")){const t=Kg(i);r=e.toViewElement(t)}const s=Yg(o.getFirstPosition().parent);if(s&&(r=e.toViewElement(s)),r)return n?n===r?tb(r,t):(Xg(n,t),this._lastSelectedCaption=r,tb(r,t)):(this._lastSelectedCaption=r,tb(r,t));if(n){const e=Xg(n,t);return this._lastSelectedCaption=null,e}return!1}_fixCaptionVisibility(t){return(e,n,r)=>{const o=Yg(t(n)),i=this.editor.editing.mapper,s=r.writer;if(o){const t=i.toViewElement(o);t&&(o.childCount?s.removeClass("ck-hidden",t):s.addClass("ck-hidden",t))}}}_insertMissingModelCaptionElement(t){const e=this.editor.model.document.differ.getChanges();for(const n of e)if("insert"==n.type&&"image"==n.name){const e=n.position.nodeAfter;if(!Kg(e))return t.appendElement("caption",e),!0}}}function Qg(t,e=!0){return(n,r,o)=>{const i=r.item;if((i.childCount||e)&&Ag(i.parent)){if(!o.consumable.consume(r.item,"insert"))return;const e=o.mapper.toViewElement(r.range.start.parent),n=t(o.writer),s=o.writer;i.childCount||s.addClass("ck-hidden",n),function(t,e,n,r){const o=Ir.createAt(n,"end");r.writer.insert(o,t),r.mapper.bindElements(e,t)}(n,r.item,e,o)}}}function Yg(t){const e=t.getAncestors({includeSelf:!0}).find(t=>"caption"==t.name);return e&&e.parent&&"image"==e.parent.name?e:null}function Xg(t,e){return!t.childCount&&!t.hasClass("ck-hidden")&&(e.addClass("ck-hidden",t),!0)}function tb(t,e){return!!t.hasClass("ck-hidden")&&(e.removeClass("ck-hidden",t),!0)}n(109);class eb extends qf{constructor(t,e){super(t),this._defaultStyle=!1,this.styles=e.reduce((t,e)=>(t[e.name]=e,e.isDefault&&(this._defaultStyle=e.name),t),{})}refresh(){const t=this.editor.model.document.selection.getSelectedElement();if(this.isEnabled=Ag(t),t)if(t.hasAttribute("imageStyle")){const e=t.getAttribute("imageStyle");this.value=!!this.styles[e]&&e}else this.value=this._defaultStyle;else this.value=!1}execute(t){const e=t.value,n=this.editor.model,r=n.document.selection.getSelectedElement();n.change(t=>{this.styles[e].isDefault?t.removeAttribute("imageStyle",r):t.setAttribute("imageStyle",e,r)})}}function nb(t,e){for(const n of e)if(n.name===t)return n}var rb=n(14),ob=n.n(rb),ib=n(15),sb=n.n(ib),ab=n(16),cb=n.n(ab),lb=n(8),ub=n.n(lb);const db={full:{name:"full",title:"Full size image",icon:ob.a,isDefault:!0},side:{name:"side",title:"Side image",icon:ub.a,className:"image-style-side"},alignLeft:{name:"alignLeft",title:"Left aligned image",icon:sb.a,className:"image-style-align-left"},alignCenter:{name:"alignCenter",title:"Centered image",icon:cb.a,className:"image-style-align-center"},alignRight:{name:"alignRight",title:"Right aligned image",icon:ub.a,className:"image-style-align-right"}},hb={full:ob.a,left:sb.a,right:ub.a,center:cb.a};function fb(t=[]){return t.map(pb).map(t=>Object.assign({},t))}function pb(t){if("string"==typeof t){const e=t;db[e]?t=Object.assign({},db[e]):(Hi.a.warn("image-style-not-found: There is no such image style of given name.",{name:e}),t={name:e})}else if(db[t.name]){const e=db[t.name],n=Object.assign({},t);for(const r in e)t.hasOwnProperty(r)||(n[r]=e[r]);t=n}return"string"==typeof t.icon&&hb[t.icon]&&(t.icon=hb[t.icon]),t}class mb extends Gh{static get requires(){return[Tg]}static get pluginName(){return"ImageStyleEditing"}init(){const t=this.editor,e=t.model.schema,n=t.data,r=t.editing;t.config.define("image.styles",["full","side"]);const o=fb(t.config.get("image.styles"));e.extend("image",{allowAttributes:"imageStyle"});const i=function(t){return(e,n,r)=>{if(!r.consumable.consume(n.item,e.name))return;const o=nb(n.attributeNewValue,t),i=nb(n.attributeOldValue,t),s=r.mapper.toViewElement(n.item),a=r.writer;i&&a.removeClass(i.className,s),o&&a.addClass(o.className,s)}}(o);r.downcastDispatcher.on("attribute:imageStyle:image",i),n.downcastDispatcher.on("attribute:imageStyle:image",i),n.upcastDispatcher.on("element:figure",function(t){const e=t.filter(t=>!t.isDefault);return(t,n,r)=>{if(!n.modelRange)return;const o=n.viewItem,i=Hm(n.modelRange.getItems());if(r.schema.checkAttribute(i,"imageStyle"))for(const t of e)r.consumable.consume(o,{classes:t.className})&&r.writer.setAttribute("imageStyle",t.name,i)}}(o),{priority:"low"}),t.commands.add("imageStyle",new eb(t,o))}}n(111);class gb extends Gh{get localizedDefaultStylesTitles(){const t=this.editor.t;return{"Full size image":t("y"),"Side image":t("z"),"Left aligned image":t("aa"),"Centered image":t("ab"),"Right aligned image":t("ac")}}init(){const t=function(t,e){for(const n of t)e[n.title]&&(n.title=e[n.title]);return t}(fb(this.editor.config.get("image.styles")),this.localizedDefaultStylesTitles);for(const e of t)this._createButton(e)}_createButton(t){const e=this.editor,n=`imageStyle:${t.name}`;e.ui.componentFactory.add(n,n=>{const r=e.commands.get("imageStyle"),o=new Wh(n);return o.set({label:t.title,icon:t.icon,tooltip:!0}),o.bind("isEnabled").to(r,"isEnabled"),o.bind("isOn").to(r,"value",e=>e===t.name),this.listenTo(o,"execute",()=>e.execute("imageStyle",{value:t.name})),o})}}const bb="ck-toolbar-container";function wb(t,e){return new _s(vb(t,e,!0),vb(t,e,!1))}function vb(t,e,n){let r=t.textNode||(n?t.nodeBefore:t.nodeAfter),o=null;for(;r&&r.getAttribute("linkHref")==e;)o=r,r=n?r.previousSibling:r.nextSibling;return o?vs.createAt(o,n?"before":"after"):t}class _b extends qf{refresh(){const t=this.editor.model,e=t.document;this.value=e.selection.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,"linkHref")}execute(t){const e=this.editor.model,n=e.document.selection;e.change(r=>{if(n.isCollapsed){const e=n.getFirstPosition();if(n.hasAttribute("linkHref")){const e=wb(n.getFirstPosition(),n.getAttribute("linkHref"));r.setAttribute("linkHref",t,e),r.setSelection(e)}else if(""!==t){const o=us(n.getAttributes());o.set("linkHref",t);const i=r.createText(t,o);r.insert(i,e),r.setSelection(_s.createOn(i))}}else{const o=e.schema.getValidRanges(n.getRanges(),"linkHref");for(const e of o)r.setAttribute("linkHref",t,e)}})}}class kb extends qf{refresh(){this.isEnabled=this.editor.model.document.selection.hasAttribute("linkHref")}execute(){const t=this.editor.model,e=t.document.selection;t.change(t=>{const n=e.isCollapsed?[wb(e.getFirstPosition(),e.getAttribute("linkHref"))]:e.getRanges();for(const e of n)t.removeAttribute("linkHref",e)})}}const yb=Symbol("linkElement"),xb=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Cb=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;function Ab(t,e){const n=e.createAttributeElement("a",{href:t},{priority:5});return e.setCustomProperty(yb,!0,n),n}function Tb(t){return function(t){return t.replace(xb,"").match(Cb)}(t=String(t))?t:"#"}class Eb{constructor(t,e,n){this.model=t,this.attribute=n,this._modelSelection=t.document.selection,this._overrideUid=null,this._isNextGravityRestorationSkipped=!1,e.listenTo(this._modelSelection,"change:range",(t,e)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!e.directChange&&Sb(this._modelSelection.getFirstPosition(),n)||this._restoreGravity())})}handleForwardMovement(t,e){const n=this.attribute;if(!(this._isGravityOverridden||t.isAtStart&&this._hasSelectionAttribute))return Rb(t,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(e),this._removeSelectionAttribute(),!0):Pb(t,n)?(this._preventCaretMovement(e),this._overrideGravity(),!0):Ob(t,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(e),this._overrideGravity(),!0):void 0}handleBackwardMovement(t,e){const n=this.attribute;return this._isGravityOverridden?Rb(t,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(e),this._restoreGravity(),this._removeSelectionAttribute(),!0):(this._preventCaretMovement(e),this._restoreGravity(),t.isAtStart&&this._removeSelectionAttribute(),!0):Rb(t,n)&&!this._hasSelectionAttribute?(this._preventCaretMovement(e),this._setSelectionAttributeFromTheNodeBefore(t),!0):t.isAtEnd&&Ob(t,n)?this._hasSelectionAttribute?void(Db(t,n)&&(this._skipNextAutomaticGravityRestoration(),this._overrideGravity())):(this._preventCaretMovement(e),this._setSelectionAttributeFromTheNodeBefore(t),!0):t.isAtStart?this._hasSelectionAttribute?(this._removeSelectionAttribute(),this._preventCaretMovement(e),!0):void 0:void(Db(t,n)&&(this._skipNextAutomaticGravityRestoration(),this._overrideGravity()))}get _isGravityOverridden(){return!!this._overrideUid}get _hasSelectionAttribute(){return this._modelSelection.hasAttribute(this.attribute)}_overrideGravity(){this._overrideUid=this.model.change(t=>t.overrideSelectionGravity())}_restoreGravity(){this.model.change(t=>{t.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}_preventCaretMovement(t){t.preventDefault()}_removeSelectionAttribute(){this.model.change(t=>{t.removeSelectionAttribute(this.attribute)})}_setSelectionAttributeFromTheNodeBefore(t){const e=this.attribute;this.model.change(n=>{n.setSelectionAttribute(this.attribute,t.nodeBefore.getAttribute(e))})}_skipNextAutomaticGravityRestoration(){this._isNextGravityRestorationSkipped=!0}}function Sb(t,e){return Pb(t,e)||Ob(t,e)}function Pb(t,e){const{nodeBefore:n,nodeAfter:r}=t,o=!!n&&n.hasAttribute(e);return!!r&&r.hasAttribute(e)&&(!o||n.getAttribute(e)!==r.getAttribute(e))}function Ob(t,e){const{nodeBefore:n,nodeAfter:r}=t,o=!!n&&n.hasAttribute(e),i=!!r&&r.hasAttribute(e);return o&&(!i||n.getAttribute(e)!==r.getAttribute(e))}function Rb(t,e){const{nodeBefore:n,nodeAfter:r}=t,o=!!n&&n.hasAttribute(e);if(!!r&&r.hasAttribute(e)&&o)return r.getAttribute(e)!==n.getAttribute(e)}function Db(t,e){return Sb(t.getShiftedBy(-1),e)}n(113);const Ib="ck-link_selected";class Fb extends Gh{init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"linkHref"}),t.conversion.for("dataDowncast").add(Ms({model:"linkHref",view:Ab})),t.conversion.for("editingDowncast").add(Ms({model:"linkHref",view:(t,e)=>Ab(Tb(t),e)})),t.conversion.for("upcast").add(ca({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:t=>t.getAttribute("href")}})),t.commands.add("link",new _b(t)),t.commands.add("unlink",new kb(t)),function(t,e,n,r){const o=new Eb(e,n,r),i=e.document.selection;n.listenTo(t.document,"keydown",(t,e)=>{if(!i.isCollapsed)return;if(e.shiftKey||e.altKey||e.ctrlKey)return;const n=e.keyCode==Qr.arrowright,r=e.keyCode==Qr.arrowleft;if(!n&&!r)return;const s=i.getFirstPosition();let a;(a=n?o.handleForwardMovement(s,e):o.handleBackwardMovement(s,e))&&t.stop()},{priority:v.get("high")+1})}(t.editing.view,t.model,this,"linkHref"),this._setupLinkHighlight()}_setupLinkHighlight(){const t=this.editor,e=t.editing.view,n=new Set;e.document.registerPostFixer(e=>{const r=t.model.document.selection;if(r.hasAttribute("linkHref")){const o=wb(r.getFirstPosition(),r.getAttribute("linkHref")),i=t.editing.mapper.toViewRange(o);for(const t of i.getItems())t.is("a")&&(e.addClass(Ib,t),n.add(t))}}),t.conversion.for("editingDowncast").add(t=>{function r(){e.change(t=>{for(const e of n.values())t.removeClass(Ib,e),n.delete(e)})}t.on("insert",r,{priority:"highest"}),t.on("remove",r,{priority:"highest"}),t.on("attribute",r,{priority:"highest"}),t.on("selection",r,{priority:"highest"})})}}class Nb extends Ni{constructor(t){super(t),this.domEventType="click"}onDomEvent(t){this.fire(t.type,t)}}n(115);class Mb extends Sh{constructor(t){super(t);const e=t.t;this.focusTracker=new oh,this.keystrokes=new Jd,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(e("au"),Fg.a,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(e("av"),Mg.a,"ck-button-cancel","cancel"),this._focusables=new ah,this._focusCycler=new Vh({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(),Dg({view:this}),[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const t=this.locale.t,e=new Og(this.locale,Rg);return e.label=t("aw"),e.inputView.placeholder="https://example.com",e}_createButton(t,e,n,r){const o=new Wh(this.locale);return o.set({label:t,icon:e,tooltip:!0}),o.extendTemplate({attributes:{class:n}}),r&&o.delegate("execute").to(this,r),o}}var Vb=n(44),Bb=n.n(Vb),Lb=n(45),zb=n.n(Lb);n(117);class qb extends Sh{constructor(t){super(t);const e=t.t;this.focusTracker=new oh,this.keystrokes=new Jd,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(e("aq"),Bb.a,"unlink"),this.editButtonView=this._createButton(e("ar"),zb.a,"edit"),this.set("href"),this._focusables=new ah,this._focusCycler=new Vh({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(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createButton(t,e,n){const r=new Wh(this.locale);return r.set({label:t,icon:e,tooltip:!0}),r.delegate("execute").to(this,n),r}_createPreviewButton(){const t=new Wh(this.locale),e=this.bindTemplate,n=this.t;return t.set({withText:!0,tooltip:n("as")}),t.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:e.to("href",t=>t&&Tb(t)),target:"_blank"}}),t.bind("label").to(this,"href",t=>t||n("at")),t.bind("isEnabled").to(this,"href",t=>!!t),t.template.tag="a",t.template.eventListeners={},t}}var jb=n(46),Hb=n.n(jb);const $b="Ctrl+K";class Ub extends Gh{static get requires(){return[Af]}init(){const t=this.editor;t.editing.view.addObserver(Nb),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=t.plugins.get(Af),this._createToolbarLinkButton(),this._enableUserBalloonInteractions()}_createActionsView(){const t=this.editor,e=new qb(t.locale),n=t.commands.get("link"),r=t.commands.get("unlink");return e.bind("href").to(n,"value"),e.editButtonView.bind("isEnabled").to(n),e.unlinkButtonView.bind("isEnabled").to(r),this.listenTo(e,"edit",()=>{this._addFormView()}),this.listenTo(e,"unlink",()=>{t.execute("unlink"),this._hideUI()}),e.keystrokes.set("Esc",(t,e)=>{this._hideUI(),e()}),e.keystrokes.set($b,(t,e)=>{this._addFormView(),e()}),e}_createFormView(){const t=this.editor,e=new Mb(t.locale),n=t.commands.get("link");return e.urlInputView.bind("value").to(n,"value"),e.urlInputView.bind("isReadOnly").to(n,"isEnabled",t=>!t),e.saveButtonView.bind("isEnabled").to(n),this.listenTo(e,"submit",()=>{t.execute("link",e.urlInputView.inputView.element.value),this._removeFormView()}),this.listenTo(e,"cancel",()=>{this._removeFormView()}),e.keystrokes.set("Esc",(t,e)=>{this._removeFormView(),e()}),e}_createToolbarLinkButton(){const t=this.editor,e=t.commands.get("link"),n=t.t;t.keystrokes.set($b,(t,n)=>{n(),e.isEnabled&&this._showUI()}),t.ui.componentFactory.add("link",t=>{const r=new Wh(t);return r.isEnabled=!0,r.label=n("x"),r.icon=Hb.a,r.keystroke=$b,r.tooltip=!0,r.bind("isEnabled").to(e,"isEnabled"),this.listenTo(r,"execute",()=>this._showUI()),r})}_enableUserBalloonInteractions(){const t=this.editor.editing.view.document;this.listenTo(t,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),this.editor.keystrokes.set("Tab",(t,e)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),e())},{priority:"high"}),this.editor.keystrokes.set("Esc",(t,e)=>{this._isUIVisible&&(this._hideUI(),e())}),bg({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 t=this.editor.commands.get("link");this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.formView.urlInputView.select(),this.formView.urlInputView.inputView.element.value=t.value||""}_removeFormView(){this._isFormInPanel&&(this._balloon.remove(this.formView),this.editor.editing.view.focus())}_showUI(){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 t=this.editor;this.stopListening(t.ui,"update"),this._removeFormView(),this._balloon.remove(this.actionsView),t.editing.view.focus()}_startUpdatingUI(){const t=this.editor,e=t.editing.view.document;let n=this._getSelectedLinkElement(),r=o();function o(){return e.selection.focus.getAncestors().reverse().find(t=>t.is("element"))}this.listenTo(t.ui,"update",()=>{const t=this._getSelectedLinkElement(),e=o();n&&!t||!n&&e!==r?this._hideUI():this._balloon.updatePosition(this._getBalloonPositionData()),n=t,r=e})}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const t=this.editor.editing.view,e=t.document,n=this._getSelectedLinkElement();return{target:n?t.domConverter.mapViewToDom(n):t.domConverter.viewRangeToDom(e.selection.getFirstRange())}}_getSelectedLinkElement(){const t=this.editor.editing.view.document.selection;if(t.isCollapsed)return Wb(t.getFirstPosition());{const e=t.getFirstRange().getTrimmed(),n=Wb(e.start),r=Wb(e.end);return n&&n==r&&Fr.createIn(n).getTrimmed().isEqual(e)?n:null}}}function Wb(t){return t.getAncestors().find(t=>(function(t){return t.is("attributeElement")&&!!t.getCustomProperty(yb)})(t))}class Gb extends qf{constructor(t,e){super(t),this.type="bulleted"==e?"bulleted":"numbered"}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document,n=Array.from(e.selection.getSelectedBlocks()).filter(e=>Jb(e,t.schema)),r=!0===this.value;t.change(t=>{if(r){let e=n[n.length-1].nextSibling,r=Number.POSITIVE_INFINITY,o=[];for(;e&&"listItem"==e.name&&0!==e.getAttribute("listIndent");){const t=e.getAttribute("listIndent");t=n;)i>o.getAttribute("listIndent")&&(i=o.getAttribute("listIndent")),o.getAttribute("listIndent")==i&&t[e?"unshift":"push"](o),o=o[e?"previousSibling":"nextSibling"]}}function Jb(t,e){return e.checkChild(t.parent,"listItem")&&!e.isObject(t)}class Zb extends qf{constructor(t,e){super(t),this._indentBy="forward"==e?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document;let n=Array.from(e.selection.getSelectedBlocks());t.change(t=>{const e=n[n.length-1];let r=e.nextSibling;for(;r&&"listItem"==r.name&&r.getAttribute("listIndent")>e.getAttribute("listIndent");)n.push(r),r=r.nextSibling;this._indentBy<0&&(n=n.reverse());for(const e of n){const n=e.getAttribute("listIndent")+this._indentBy;n<0?t.rename(e,"paragraph"):t.setAttribute("listIndent",n,e)}})}_checkEnabled(){const t=Hm(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is("listItem"))return!1;if(this._indentBy>0){const e=t.getAttribute("listIndent"),n=t.getAttribute("listType");let r=t.previousSibling;for(;r&&r.is("listItem")&&r.getAttribute("listIndent")>=e;){if(r.getAttribute("listIndent")==e)return r.getAttribute("listType")==n;r=r.previousSibling}return!1}return!0}}function Qb(){const t=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||t?0:null}function Yb(t,e,n){const r=n.consumable;if(!r.test(e.item,"insert")||!r.test(e.item,"attribute:listType")||!r.test(e.item,"attribute:listIndent"))return;r.consume(e.item,"insert"),r.consume(e.item,"attribute:listType"),r.consume(e.item,"attribute:listIndent");const o=e.item;hw(o,function(t,e){const n=e.mapper,r=e.writer,o="numbered"==t.getAttribute("listType")?"ol":"ul",i=function(t){const e=t.createContainerElement("li");return e.getFillerOffset=Qb,e}(r),s=r.createContainerElement(o,null);return r.insert(Ir.createAt(s),i),n.bindElements(t,i),i}(o,n),n)}function Xb(t,e,n){const r=n.mapper.toViewPosition(e.position).getLastMatchingPosition(t=>!t.item.is("li")).nodeAfter,o=n.writer;o.breakContainer(Ir.createBefore(r)),o.breakContainer(Ir.createAfter(r));const i=r.parent,s=i.previousSibling,a=Fr.createOn(i),c=o.remove(a);s&&s.nextSibling&&dw(o,s,s.nextSibling),fw(n.mapper.toModelElement(r).getAttribute("listIndent")+1,e.position,a.start,r,n);for(const t of Fr.createIn(c).getItems())n.mapper.unbindViewElement(t);t.stop()}function tw(t,e,n){if(!n.consumable.consume(e.item,"attribute:listType"))return;const r=n.mapper.toViewElement(e.item),o=n.writer;o.breakContainer(Ir.createBefore(r)),o.breakContainer(Ir.createAfter(r));let i=r.parent;const s="numbered"==e.attributeNewValue?"ol":"ul";dw(o,i=o.rename(i,s),i.nextSibling),dw(o,i.previousSibling,i);for(const t of e.item.getChildren())n.consumable.consume(t,"insert")}function ew(t,e,n){if(!n.consumable.consume(e.item,"attribute:listIndent"))return;const r=n.mapper.toViewElement(e.item),o=n.writer;o.breakContainer(Ir.createBefore(r)),o.breakContainer(Ir.createAfter(r));const i=r.parent,s=i.previousSibling,a=Fr.createOn(i);o.remove(a),s&&s.nextSibling&&dw(o,s,s.nextSibling),fw(e.attributeOldValue+1,e.range.start,a.start,r,n),hw(e.item,r,n);for(const t of e.item.getChildren())n.consumable.consume(t,"insert")}function nw(t,e,n){if("listItem"!=e.item.name){let t=n.mapper.toViewPosition(e.range.start);const r=n.writer,o=[];for(;("ul"==t.parent.name||"ol"==t.parent.name)&&"li"==(t=r.breakContainer(t)).parent.name;){const e=t,n=Ir.createAt(t.parent,"end");if(!e.isEqual(n)){const t=r.remove(new Fr(e,n));o.push(t)}t=Ir.createAfter(t.parent)}if(o.length>0){for(let e=0;e0){const e=dw(r,n,n.nextSibling);e&&e.parent==n&&t.offset--}}dw(r,t.nodeBefore,t.nodeAfter)}}}function rw(t,e,n){const r=n.mapper.toViewPosition(e.position),o=r.nodeBefore,i=r.nodeAfter;dw(n.writer,o,i)}function ow(t,e,n){if(n.consumable.consume(e.viewItem,{name:!0})){const t=n.writer,r=this.conversionApi.store,o=t.createElement("listItem");r.indent=r.indent||0,t.setAttribute("listIndent",r.indent,o);const i=e.viewItem.parent&&"ol"==e.viewItem.parent.name?"numbered":"bulleted";t.setAttribute("listType",i,o),r.indent++;const s=n.splitToAllowedParent(o,e.modelCursor);if(!s)return;t.insert(o,s.position);let a=vs.createAfter(o);for(const t of e.viewItem.getChildren())"ul"==t.name||"ol"==t.name?a=n.convertItem(t,a).modelCursor:n.convertItem(t,vs.createAt(o,"end"));r.indent--,e.modelRange=new _s(e.modelCursor,a),s.cursorParent?e.modelCursor=vs.createAt(s.cursorParent):e.modelCursor=e.modelRange.end}}function iw(t,e,n){if(n.consumable.test(e.viewItem,{name:!0})){const t=Array.from(e.viewItem.getChildren());for(const e of t)e.is("li")||e._remove()}}function sw(t,e,n){if(n.consumable.test(e.viewItem,{name:!0})){if(0===e.viewItem.childCount)return;const t=[...e.viewItem.getChildren()];let n=!1,r=!0;for(const e of t)!n||e.is("ul")||e.is("ol")||e._remove(),e.is("text")?(r&&(e._data=e.data.replace(/^\s+/,"")),(!e.nextSibling||e.nextSibling.is("ul")||e.nextSibling.is("ol"))&&(e._data=e.data.replace(/\s+$/,""))):(e.is("ul")||e.is("ol"))&&(n=!0),r=!1}}function aw(t,e){if(e.isPhantom)return;const n=e.modelPosition.nodeBefore;if(n&&n.is("listItem")){const t=e.mapper.toViewElement(n),r=t.getAncestors().find(t=>t.is("ul")||t.is("ol")),o=new Dr({startPosition:Ir.createAt(t,0)});for(const t of o){if("elementStart"==t.type&&t.item.is("li")){e.viewPosition=t.previousPosition;break}if("elementEnd"==t.type&&t.item==r){e.viewPosition=t.nextPosition;break}}}}function cw(t,e){const n=e.viewPosition,r=n.parent,o=e.mapper;if("ul"==r.name||"ol"==r.name){if(n.isAtEnd){const t=o.toModelElement(n.nodeBefore),r=o.getModelLength(n.nodeBefore);e.modelPosition=vs.createBefore(t).getShiftedBy(r)}else{const t=o.toModelElement(n.nodeAfter);e.modelPosition=vs.createBefore(t)}t.stop()}else if("li"==r.name&&n.nodeBefore&&("ul"==n.nodeBefore.name||"ol"==n.nodeBefore.name)){const i=o.toModelElement(r);let s=1,a=n.nodeBefore;for(;a&&(a.is("ul")||a.is("ol"));)s+=o.getModelLength(a),a=a.previousSibling;e.modelPosition=vs.createBefore(i).getShiftedBy(s),t.stop()}}function lw(t,[e,n]){let r=e.is("documentFragment")?e.getChild(0):e;if(r&&r.is("listItem")){const t=n.getFirstPosition();let e=null;if(t.parent.is("listItem")?e=t.parent:t.nodeBefore&&t.nodeBefore.is("listItem")&&(e=t.nodeBefore),e){const t=e.getAttribute("listIndent");if(t>0)for(;r&&r.is("listItem");)r._setAttribute("listIndent",r.getAttribute("listIndent")+t),r=r.nextSibling}}}function uw(t,e){const n=!!e.sameIndent,r=!!e.smallerIndent,o=t instanceof ms?t.getAttribute("listIndent"):e.listIndent;let i=t instanceof ms?t.previousSibling:t.nodeBefore;for(;i&&"listItem"==i.name;){const t=i.getAttribute("listIndent");if(n&&o==t||r&&o>t)return i;i=i.previousSibling}return null}function dw(t,e,n){return e&&n&&("ul"==e.name||"ol"==e.name)&&e.name==n.name?t.mergeContainers(Ir.createAfter(e)):null}function hw(t,e,n){const r=e.parent,o=n.mapper,i=n.writer;let s=o.toViewPosition(vs.createBefore(t));const a=uw(t,{sameIndent:!0,smallerIndent:!0}),c=t.previousSibling;if(a&&a.getAttribute("listIndent")==t.getAttribute("listIndent")){const t=o.toViewElement(a);s=i.breakContainer(Ir.createAfter(t))}else s=c&&"listItem"==c.name?o.toViewPosition(vs.createAt(c,"end")):o.toViewPosition(vs.createBefore(t));if(s=pw(s),i.insert(s,r),c&&"listItem"==c.name){const t=o.toViewElement(c),n=new Dr({boundaries:new Fr(Ir.createAt(t,0),s),ignoreElementEnd:!0});for(const t of n)if(t.item.is("li")){const r=i.breakContainer(Ir.createBefore(t.item)),o=t.item.parent,s=Ir.createAt(e,"end");dw(i,s.nodeBefore,s.nodeAfter),i.move(Fr.createOn(o),s),n.position=r}}else{const n=r.nextSibling;if(n&&(n.is("ul")||n.is("ol"))){let r=null;for(const e of n.getChildren()){const n=o.toModelElement(e);if(!(n&&n.getAttribute("listIndent")>t.getAttribute("listIndent")))break;r=e}r&&(i.breakContainer(Ir.createAfter(r)),i.move(Fr.createOn(r.parent),Ir.createAt(e,"end")))}}dw(i,r,r.nextSibling),dw(i,r.previousSibling,r)}function fw(t,e,n,r,o){const i=uw(e,{sameIndent:!0,smallerIndent:!0,listIndent:t}),s=o.mapper,a=o.writer,c=i?i.getAttribute("listIndent"):null;let l;if(i)if(c==t){const t=s.toViewElement(i).parent;l=Ir.createAfter(t)}else{const t=vs.createAt(i,"end");l=s.toViewPosition(t)}else l=n;l=pw(l);for(const t of[...r.getChildren()])(t.is("ul")||t.is("ol"))&&(l=a.move(Fr.createOn(t),l).end,dw(a,t,t.nextSibling),dw(a,t.previousSibling,t))}function pw(t){return t.getLastMatchingPosition(t=>t.item.is("uiElement"))}class mw extends Gh{static get requires(){return[tg]}init(){const t=this.editor;t.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const e=t.data,n=t.editing;t.model.document.registerPostFixer(e=>(function(t,e){const n=t.document.differ.getChanges(),r=new Map;let o=!1;for(const t of n)if("insert"==t.type&&"listItem"==t.name)i(t.position);else if("insert"==t.type&&"listItem"!=t.name){if("$text"!=t.name){const n=t.position.nodeAfter;n.hasAttribute("listIndent")&&(e.removeAttribute("listIndent",n),o=!0),n.hasAttribute("listType")&&(e.removeAttribute("listType",n),o=!0)}i(t.position.getShiftedBy(t.length))}else"remove"==t.type&&"listItem"==t.name?i(t.position):"attribute"==t.type&&"listIndent"==t.attributeKey?i(t.range.start):"attribute"==t.type&&"listType"==t.attributeKey&&i(t.range.start);for(const t of r.values())s(t),a(t);return o;function i(t){const e=t.nodeBefore;if(e&&e.is("listItem")){let n=e;if(r.has(n))return;for(;n.previousSibling&&n.previousSibling.is("listItem");)if(n=n.previousSibling,r.has(n))return;r.set(t.nodeBefore,n)}else{const e=t.nodeAfter;e&&e.is("listItem")&&r.set(e,e)}}function s(t){let n=0,r=null;for(;t&&t.is("listItem");){const i=t.getAttribute("listIndent");if(i>n){let s;null===r?(r=i-n,s=n):(r>i&&(r=i),s=i-r),e.setAttribute("listIndent",s,t),o=!0}else r=null,n=t.getAttribute("listIndent")+1;t=t.nextSibling}}function a(t){let n=[],r=null;for(;t&&t.is("listItem");){const i=t.getAttribute("listIndent");if(r&&r.getAttribute("listIndent")>i&&(n=n.slice(0,i+1)),0!=i)if(n[i]){const r=n[i];t.getAttribute("listType")!=r&&(e.setAttribute("listType",r,t),o=!0)}else n[i]=t.getAttribute("listType");r=t,t=t.nextSibling}}})(t.model,e)),n.mapper.registerViewToModelLength("li",gw),e.mapper.registerViewToModelLength("li",gw),n.mapper.on("modelToViewPosition",aw),n.mapper.on("viewToModelPosition",cw),e.mapper.on("modelToViewPosition",aw),n.downcastDispatcher.on("insert",nw,{priority:"high"}),n.downcastDispatcher.on("insert:listItem",Yb),e.downcastDispatcher.on("insert",nw,{priority:"high"}),e.downcastDispatcher.on("insert:listItem",Yb),n.downcastDispatcher.on("attribute:listType:listItem",tw),e.downcastDispatcher.on("attribute:listType:listItem",tw),n.downcastDispatcher.on("attribute:listIndent:listItem",ew),e.downcastDispatcher.on("attribute:listIndent:listItem",ew),n.downcastDispatcher.on("remove:listItem",Xb),n.downcastDispatcher.on("remove",rw,{priority:"low"}),e.downcastDispatcher.on("remove:listItem",Xb),e.downcastDispatcher.on("remove",rw,{priority:"low"}),e.upcastDispatcher.on("element:ul",iw,{priority:"high"}),e.upcastDispatcher.on("element:ol",iw,{priority:"high"}),e.upcastDispatcher.on("element:li",sw,{priority:"high"}),e.upcastDispatcher.on("element:li",ow),t.model.on("insertContent",lw,{priority:"high"}),t.commands.add("numberedList",new Gb(t,"numbered")),t.commands.add("bulletedList",new Gb(t,"bulleted")),t.commands.add("indentList",new Zb(t,"forward")),t.commands.add("outdentList",new Zb(t,"backward"));const r=this.editor.editing.view.document;this.listenTo(r,"enter",(t,e)=>{const n=this.editor.model.document,r=n.selection.getLastPosition().parent;n.selection.isCollapsed&&"listItem"==r.name&&r.isEmpty&&(this.editor.execute("outdentList"),e.preventDefault(),t.stop())}),this.listenTo(r,"delete",(t,e)=>{if("backward"!==e.direction)return;const n=this.editor.model.document.selection;if(!n.isCollapsed)return;const r=n.getFirstPosition();if(!r.isAtStart)return;const o=r.parent;"listItem"===o.name&&(o.previousSibling&&"listItem"===o.previousSibling.name||(this.editor.execute("outdentList"),e.preventDefault(),t.stop()))},{priority:"high"});const o=t=>(e,n)=>{this.editor.commands.get(t).isEnabled&&(this.editor.execute(t),n())};this.editor.keystrokes.set("Tab",o("indentList")),this.editor.keystrokes.set("Shift+Tab",o("outdentList"))}}function gw(t){let e=1;for(const n of t.getChildren())if("ul"==n.name||"ol"==n.name)for(const t of n.getChildren())e+=gw(t);return e}var bw=n(47),ww=n.n(bw),vw=n(48),_w=n.n(vw);class kw extends Gh{init(){const t=this.editor.t;this._addButton("numberedList",t("v"),ww.a),this._addButton("bulletedList",t("w"),_w.a)}_addButton(t,e,n){const r=this.editor;r.ui.componentFactory.add(t,o=>{const i=r.commands.get(t),s=new Wh(o);return s.set({label:e,icon:n,tooltip:!0}),s.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(s,"execute",()=>r.execute(t)),s})}}var yw=n(49),xw=n.n(yw);var Cw=n(50),Aw=n.n(Cw);const Tw=Symbol("isOPCodeBlock");function Ew(t){return!!t.getCustomProperty(Tw)&&of(t)}function Sw(t){const e=t.getSelectedElement();return!(!e||!Ew(e))}function Pw(t,e,n){const r=e.createContainerElement("div",{class:"op-ckeditor--code-block",title:window.I18n.t("js.editor.macro.toolbar_help")});return Ow(e,t,r),function(t,e,n){return e.setCustomProperty(Tw,!0,t),sf(t,e,{label:n})}(r,e,n)}function Ow(t,e,n){const r=(e.getAttribute("opCodeblockLanguage")||"language-text").replace(/^language-/,""),o=t.createContainerElement("div",{class:"op-ckeditor--code-block-language"});Rw(t,r,o,"text"),t.insert(Ir.createAt(n),o),Rw(t,e.getAttribute("opCodeblockContent"),n,"(empty)")}function Rw(t,e,n,r){const o=t.createText(e||r);t.insert(Ir.createAt(n),o)}class Dw extends Ni{constructor(t){super(t),this.domEventType="dblclick"}onDomEvent(t){this.fire(t.type,t)}}class Iw extends Gh{static get pluginName(){return"CodeBlockEditing"}init(){const t=this.editor,e=t.model.schema,n=t.conversion,r=t.editing.view,o=r.document,i=t.config.get("openProject.pluginContext");e.register("codeblock",{isObject:!0,isBlock:!0,allowContentOf:"$block",allowWhere:["$root","$block"],allowIn:["$root"],allowAttributes:["opCodeblockLanguage","opCodeblockContent"]}),n.for("upcast").add(function(){return e=>{e.on("element:pre",t,{priority:"high"})};function t(t,e,n){if(!n.consumable.test(e.viewItem,{name:!0}))return;const r=Array.from(e.viewItem.getChildren()).find(t=>t.is("code"));if(!r||!n.consumable.consume(r,{name:!0}))return;const o=n.writer.createElement("codeblock");n.writer.setAttribute("opCodeblockLanguage",r.getAttribute("class"),o);const i=n.splitToAllowedParent(o,e.modelCursor);if(i){n.writer.insert(o,i.position);const t=r.getChild(0);n.consumable.consume(t,{name:!0});const s=t.data.replace(/\n$/,"");n.writer.setAttribute("opCodeblockContent",s,o),e.modelRange=new _s(vs.createBefore(o),vs.createAfter(o)),e.modelCursor=e.modelRange.end}}}()),n.for("editingDowncast").add(Ns({model:"codeblock",view:(t,e)=>Pw(t,e,"Code block")})).add(function(){return e=>{e.on("attribute:opCodeblockContent",t),e.on("attribute:opCodeblockLanguage",t)};function t(t,e,n){const r=e.item;n.consumable.consume(e.item,t.name);const o=n.mapper.toViewElement(r);n.writer.remove(Fr.createOn(o.getChild(1))),n.writer.remove(Fr.createOn(o.getChild(0))),Ow(n.writer,r,o)}}()),n.for("dataDowncast").add(function(){return e=>{e.on("insert:codeblock",t,{priority:"high"})};function t(t,e,n){const r=e.item,o=r.getAttribute("opCodeblockLanguage")||"language-text",i=r.getAttribute("opCodeblockContent");n.consumable.consume(r,"insert");const s=n.writer,a=s.createContainerElement("pre"),c=s.createContainerElement("div",{class:"op-ckeditor--code-block-language"}),l=s.createContainerElement("code",{class:o}),u=s.createText(o),d=s.createText(i);s.insert(Ir.createAt(l),d),s.insert(Ir.createAt(c),u),s.insert(Ir.createAt(a),c),s.insert(Ir.createAt(a),l),n.mapper.bindElements(r,l),n.mapper.bindElements(r,a);const h=n.mapper.toViewPosition(e.range.start);s.insert(h,a),t.stop()}}()),r.addObserver(Dw),this.listenTo(o,"dblclick",(e,n)=>{let r=n.target,o=n.domEvent;if(o.shiftKey||o.altKey||o.metaKey)return;if(!Ew(r)&&!(r=r.findAncestor(Ew)))return;n.preventDefault(),n.stopPropagation();const s=t.editing.mapper.toModelElement(r),a=i.services.macros,c=s.getAttribute("opCodeblockLanguage"),l=s.getAttribute("opCodeblockContent");a.editCodeBlock(l,c).then(e=>t.model.change(t=>{t.setAttribute("opCodeblockLanguage",e.languageClass,s),t.setAttribute("opCodeblockContent",e.content,s)}))}),t.ui.componentFactory.add("insertCodeBlock",e=>{const n=new Wh(e);return n.set({label:window.I18n.t("js.editor.macro.code_block.button"),icon:Aw.a,tooltip:!0}),n.on("execute",()=>{i.services.macros.editCodeBlock().then(e=>t.model.change(n=>{const r=n.createElement("codeblock");n.setAttribute("opCodeblockLanguage",e.languageClass,r),n.setAttribute("opCodeblockContent",e.content,r),t.model.insertContent(r,t.model.document.selection)}))}),n})}}class Fw extends Gh{static get requires(){return[Af]}static get pluginName(){return"CodeBlockToolbar"}init(){const t=this.editor,e=this.editor.model,n=t.config.get("openProject.pluginContext");Sf(t,"opEditCodeBlock",t=>{const r=n.services.macros,o=t.getAttribute("opCodeblockLanguage"),i=t.getAttribute("opCodeblockContent");r.editCodeBlock(i,o).then(n=>e.change(e=>{e.setAttribute("opCodeblockLanguage",n.languageClass,t),e.setAttribute("opCodeblockContent",n.content,t)}))})}afterInit(){Of(this,this.editor,"OPCodeBlock",Sw)}}var Nw=n(51),Mw=n.n(Nw);function Vw(t){return t.__currentlyDisabled=t.__currentlyDisabled||[],t.ui.view.toolbar?t.ui.view.toolbar.items._items:[]}function Bw(t,e){jQuery.each(Vw(t),function(n,r){let o=r;r instanceof ep?o=r.buttonView:r!==e&&r.hasOwnProperty("isEnabled")||(o=null),o&&(o.isEnabled?o.isEnabled=!1:t.__currentlyDisabled.push(o))})}function Lw(t){jQuery.each(Vw(t),function(e,n){let r=n;n instanceof ep&&(r=n.buttonView),t.__currentlyDisabled.indexOf(r)<0&&(r.isEnabled=!0)}),t.__currentlyDisabled=[]}function zw(){return t=>{t.on("element:table",(t,e,n)=>{const r=e.viewItem;if(!n.consumable.test(r,{name:!0}))return;const{rows:o,headingRows:i,headingColumns:s}=function(t){const e={headingRows:0,headingColumns:0},n=[],r=[];let o;for(const i of Array.from(t.getChildren()))if("tbody"===i.name||"thead"===i.name||"tfoot"===i.name){"thead"!==i.name||o||(o=i);for(const t of Array.from(i.getChildren()))if("thead"===t.parent.name&&t.parent===o)e.headingRows++,n.push(t);else{r.push(t);const n=qw(t);n>e.headingColumns&&(e.headingColumns=n)}}return e.rows=[...n,...r],e}(r),a={};s&&(a.headingColumns=s),i&&(a.headingRows=i);const c=n.writer.createElement("table",a),l=n.splitToAllowedParent(c,e.modelCursor);if(n.writer.insert(c,l.position),n.consumable.consume(r,{name:!0}),o.length)o.forEach(t=>n.convertItem(t,vs.createAt(c,"end")));else{const t=n.writer.createElement("tableRow");n.writer.insert(t,vs.createAt(c,"end")),n.writer.insertElement("tableCell",vs.createAt(t,"end"))}e.modelRange=new _s(vs.createBefore(c),vs.createAfter(c)),l.cursorParent?e.modelCursor=vs.createAt(l.cursorParent):e.modelCursor=e.modelRange.end},{priority:"normal"})}}function qw(t){let e=0,n=0;const r=Array.from(t.getChildren()).filter(t=>"th"===t.name||"td"===t.name);for(;n1||r>1)&&this._recordSpans(this._row,this._column,r,n);const o=this._column,i=this._formatOutValue(e,o,r,n);return this._column++,this._cell++,this._shouldSkipRow()||this._shouldSkipColumn(o,n)?this.next():i}skipRow(t){this._skipRows.add(t)}_isOverEndRow(){return void 0!==this.endRow&&this._row>this.endRow}_formatOutValue(t,e,n=1,r=1){return{done:!1,value:{cell:t,row:this._row,column:e,rowspan:n,colspan:r,cellIndex:this._cell}}}_shouldSkipRow(){const t=this._rowthis.column;return!n&&!r}_isSpanned(t,e){if(!this._spannedCells.has(t))return!1;return this._spannedCells.get(t).has(e)}_recordSpans(t,e,n,r){for(let n=e+1;n<=e+r-1;n++)this._markSpannedCell(t,n);for(let o=t+1;oo?r.setAttribute(t,e,n):r.removeAttribute(t,n)}const Uw=Symbol("isTable");function Ww(t){return!!t.getCustomProperty(Uw)&&of(t)}function Gw(t={}){return e=>e.on("insert:table",(e,n,r)=>{const o=n.item;if(!r.consumable.consume(o,"insert"))return;r.consumable.consume(o,"attribute:headingRows:table"),r.consumable.consume(o,"attribute:headingColumns:table");const i=t&&t.asWidget,s=r.writer.createContainerElement("figure",{class:"table"}),a=r.writer.createContainerElement("table");let c;r.writer.insert(Ir.createAt(s),a),i&&(c=function(t,e){return e.setCustomProperty(Uw,!0,t),sf(t,e,{hasSelectionHandler:!0})}(s,r.writer));const l=new jw(o),u={headingRows:o.getAttribute("headingRows")||0,headingColumns:o.getAttribute("headingColumns")||0};for(const e of l){const{row:n,cell:i}=e,s=ov(rv(n,u),a,r),c=ev(o.getChild(n),n,s,r);r.consumable.consume(i,"insert"),tv(e,u,Ir.createAt(c,"end"),r,t)}const d=r.mapper.toViewPosition(n.range.start);r.mapper.bindElements(o,i?c:s),r.writer.insert(d,i?c:s)},{priority:"normal"})}function Kw(t={}){return e=>e.on("insert:tableRow",(e,n,r)=>{const o=n.item;if(!r.consumable.consume(o,"insert"))return;const i=o.parent,s=cv(r.mapper.toViewElement(i)),a=i.getChildIndex(o),c=new jw(i,{startRow:a,endRow:a}),l={headingRows:i.getAttribute("headingRows")||0,headingColumns:i.getAttribute("headingColumns")||0};for(const e of c){const n=ev(o,a,ov(rv(a,l),s,r),r);r.consumable.consume(e.cell,"insert"),tv(e,l,Ir.createAt(n,"end"),r,t)}},{priority:"normal"})}function Jw(t={}){return e=>e.on("insert:tableCell",(e,n,r)=>{const o=n.item;if(!r.consumable.consume(o,"insert"))return;const i=o.parent,s=i.parent,a=s.getChildIndex(i),c=new jw(s,{startRow:a,endRow:a}),l={headingRows:s.getAttribute("headingRows")||0,headingColumns:s.getAttribute("headingColumns")||0};for(const e of c)if(e.cell===o){const n=r.mapper.toViewElement(i);return void tv(e,l,Ir.createAt(n,i.getChildIndex(o)),r,t)}},{priority:"normal"})}function Zw(t={}){const e=!!t.asWidget;return t=>t.on("attribute:headingRows:table",(t,n,r)=>{const o=n.item;if(!r.consumable.consume(n.item,t.name))return;const i=cv(r.mapper.toViewElement(o)),s=n.attributeOldValue,a=n.attributeNewValue;if(a>s){const t=Array.from(o.getChildren()).filter(({index:t})=>c(t,s-1,a));av(t,ov("thead",i,r),r,"end");for(const n of t)for(const t of n.getChildren())Yw(t,"th",r,e);sv("tbody",i,r)}else{av(Array.from(o.getChildren()).filter(({index:t})=>c(t,a-1,s)).reverse(),ov("tbody",i,r),r);const t=new jw(o,{startRow:a?a-1:a,endRow:s-1}),n={headingRows:o.getAttribute("headingRows")||0,headingColumns:o.getAttribute("headingColumns")||0};for(const o of t)Xw(o,n,r,e);sv("thead",i,r)}function c(t,e,n){return t>e&&tt.on("attribute:headingColumns:table",(t,n,r)=>{const o=n.item;if(!r.consumable.consume(n.item,t.name))return;const i={headingRows:o.getAttribute("headingRows")||0,headingColumns:o.getAttribute("headingColumns")||0},s=n.attributeOldValue,a=n.attributeNewValue,c=(s>a?s:a)-1;for(const t of new jw(o))t.column>c||Xw(t,i,r,e)},{priority:"normal"})}function Yw(t,e,n,r){const o=n.mapper.toViewElement(t);let i;if(r){i=cf(n.writer.createEditableElement(e,o.getAttributes()),n.writer),n.writer.insert(Ir.createAfter(o),i),n.writer.move(Fr.createIn(o),Ir.createAt(i)),n.writer.remove(Fr.createOn(o))}else i=n.writer.rename(o,e);n.mapper.bindElements(t,i)}function Xw(t,e,n,r){const{cell:o}=t,i=nv(t,e),s=n.mapper.toViewElement(o);s&&s.name!==i&&Yw(o,i,n,r)}function tv(t,e,n,r,o){const i=o&&o.asWidget,s=nv(t,e),a=i?cf(r.writer.createEditableElement(s),r.writer):r.writer.createContainerElement(s),c=t.cell;r.mapper.bindElements(c,a),r.writer.insert(n,a)}function ev(t,e,n,r){let o=r.mapper.toViewElement(t);if(!o){r.consumable.consume(t,"insert"),o=r.writer.createContainerElement("tr"),r.mapper.bindElements(t,o);const i=t.parent.getAttribute("headingRows")||0,s=i>0&&e>=i?e-i:e,a=Ir.createAt(n,s);r.writer.insert(a,o)}return o}function nv(t,e){const{row:n,column:r}=t,{headingColumns:o,headingRows:i}=e;return i&&i>n?"th":o&&o>r?"th":"td"}function rv(t,e){return t{const o=r.createElement("table");return r.insert(o,t),uv(r,o,0,e,n),o})}insertRows(t,e={}){const n=this.editor.model,r=e.at||0,o=e.rows||1;n.change(e=>{const n=t.getAttribute("headingRows")||0;if(n>r&&e.setAttribute("headingRows",n+o,t),0===r||r===t.childCount)return void uv(e,t,r,o,this.getColumns(t));const i=new jw(t,{endRow:r});let s=0;for(const{row:t,rowspan:n,colspan:a,cell:c}of i){tr&&e.setAttribute("rowspan",n+o,c),t===r&&(s+=a)}uv(e,t,r,o,s)})}insertColumns(t,e={}){const n=this.editor.model,r=e.at||0,o=e.columns||1;n.change(e=>{const n=t.getAttribute("headingColumns");r1)for(let t=n+1;t{if(i>1){const{newCellsSpan:r,updatedSpan:s}=hv(i,e);$w("colspan",s,t,n);const a={};r>1&&(a.colspan=r),o>1&&(a.rowspan=o),dv(i>e?e-1:i-1,n,vs.createAfter(t),a)}if(ie===t),l=a.filter(({cell:e,colspan:n,column:r})=>{return e!==t&&r===c||rc});for(const{cell:t,colspan:e}of l)n.setAttribute("colspan",e+s,t);const u={};o>1&&(u.rowspan=o),dv(s,n,vs.createAfter(t),u);const d=r.getAttribute("headingColumns")||0;d>c&&$w("headingColumns",d+s,r,n)}})}splitCellHorizontally(t,e=2){const n=this.editor.model,r=Hw(t),o=r.getChildIndex(t.parent),i=parseInt(t.getAttribute("rowspan")||1),s=parseInt(t.getAttribute("colspan")||1);n.change(n=>{if(i>1){const a=[...new jw(r,{startRow:o,endRow:o+i-1,includeSpanned:!0})],{newCellsSpan:c,updatedSpan:l}=hv(i,e);$w("rowspan",l,t,n);const{column:u}=a.find(({cell:e})=>e===t),d={};c>1&&(d.rowspan=c),s>1&&(d.colspan=s);for(const{column:t,row:e,cellIndex:i}of a){if(e>=o+l&&t===u&&(e+o+l)%c==0){const t=vs.createFromParentAndOffset(r.getChild(e),i);n.insertElement("tableCell",d,t)}}}if(io){const t=r+a;n.setAttribute("rowspan",t,e)}const l={};s>1&&(l.colspan=s),uv(n,r,o+1,a,1,l);const u=r.getAttribute("headingRows")||0;u>o&&$w("headingRows",u+a,r,n)}})}getColumns(t){return[...t.getChild(0).getChildren()].reduce((t,e)=>{return t+parseInt(e.getAttribute("colspan")||1)},0)}}function uv(t,e,n,r,o,i={}){for(let s=0;s{const e=r.createTable(a,o,i);t.setSelection(vs.createAt(e.getChild(0).getChild(0)))})}}class pv extends qf{constructor(t,e={}){super(t),this.order=e.order||"below"}refresh(){const t=Hw(this.editor.model.document.selection.getFirstPosition());this.isEnabled=!!t}execute(){const t=this.editor,e=t.model.document.selection,n=t.plugins.get(lv),r=e.getFirstPosition().parent,o=Hw(e.getFirstPosition()),i=o.getChildIndex(r.parent),s="below"===this.order?i+1:i;n.insertRows(o,{rows:1,at:s})}}class mv extends qf{constructor(t,e={}){super(t),this.order=e.order||"after"}refresh(){const t=Hw(this.editor.model.document.selection.getFirstPosition());this.isEnabled=!!t}execute(){const t=this.editor,e=t.model.document.selection,n=t.plugins.get(lv),r=Hw(e.getFirstPosition()),o=e.getFirstPosition().parent,{column:i}=n.getCellLocation(o),s="after"===this.order?i+1:i;n.insertColumns(r,{columns:1,at:s})}}class gv extends qf{constructor(t,e={}){super(t),this.direction=e.direction||"horizontally"}refresh(){const t=this.editor.model.document.selection.getFirstPosition().parent;this.isEnabled=t.is("tableCell")}execute(){const t=this.editor.model.document.selection.getFirstPosition().parent,e="horizontally"===this.direction,n=this.editor.plugins.get(lv);e?n.splitCellHorizontally(t,2):n.splitCellVertically(t,2)}}class bv extends qf{constructor(t,e){super(t),this.direction=e.direction,this.isHorizontal="right"==this.direction||"left"==this.direction}refresh(){const t=this._getMergeableCell();this.isEnabled=!!t,this.value=t}execute(){const t=this.editor.model,e=t.document.selection.getFirstPosition().parent,n=this.value,r=this.direction;t.change(t=>{const o="right"==r||"down"==r,i=o?e:n,s=o?n:e,a=s.parent;t.move(_s.createIn(s),vs.createAt(i,"end")),t.remove(s);const c=this.isHorizontal?"colspan":"rowspan",l=parseInt(e.getAttribute(c)||1),u=parseInt(n.getAttribute(c)||1);t.setAttribute(c,l+u,i),t.setSelection(_s.createIn(i)),a.childCount||function(t,e){const n=t.parent,r=n.getChildIndex(t);for(const{cell:t,row:o,rowspan:i}of new jw(n,{endRow:r})){const n=o+i-1>=r;n&&$w("rowspan",i-1,t,e)}e.remove(t)}(a,t)})}_getMergeableCell(){const t=this.editor.model.document.selection.getFirstPosition().parent;if(!t.is("tableCell"))return;const e=this.editor.plugins.get(lv),n=this.isHorizontal?function(t,e,n){const r="right"==e?t.nextSibling:t.previousSibling;if(!r)return;const o="right"==e?t:r,i="right"==e?r:t,{column:s}=n.getCellLocation(o),{column:a}=n.getCellLocation(i),c=parseInt(o.getAttribute("colspan")||1);return s+c===a?r:void 0}(t,this.direction,e):function(t,e){const n=t.parent,r=n.parent,o=r.getChildIndex(n);if("down"==e&&o===r.childCount-1||"up"==e&&0===o)return;const i=r.getAttribute("headingRows")||0;if(i&&("down"==e&&o===i-1||"up"==e&&o===i))return;const s=parseInt(t.getAttribute("rowspan")||1),a="down"==e?o+s:o,c=[...new jw(r,{endRow:a})],l=c.find(e=>e.cell===t).column,u=c.find(({row:t,rowspan:n,column:r})=>r===l&&("down"==e?t===a:a===t+n));return u&&u.cell}(t,this.direction);if(!n)return;const r=this.isHorizontal?"rowspan":"colspan",o=parseInt(t.getAttribute(r)||1);return parseInt(n.getAttribute(r)||1)===o?n:void 0}}class wv extends qf{refresh(){const t=this.editor.model.document.selection.getFirstPosition().parent;this.isEnabled=t.is("tableCell")&&t.parent.parent.childCount>1}execute(){const t=this.editor.model,e=t.document.selection.getFirstPosition().parent.parent,n=e.parent,r=n.getChildIndex(e),o=n.getAttribute("headingRows")||0;t.change(t=>{o&&r<=o&&$w("headingRows",o-1,n,t,0);const i=[...new jw(n,{endRow:r})],s=new Map;i.filter(({row:t,rowspan:e})=>t===r&&e>1).forEach(({column:t,cell:e,rowspan:n})=>s.set(t,{cell:e,rowspanToSet:n-1})),i.filter(({row:t,rowspan:e})=>t<=r-1&&t+e>r).forEach(({cell:e,rowspan:n})=>$w("rowspan",n-1,e,t));const a=r+1,c=new jw(n,{includeSpanned:!0,startRow:a,endRow:a});let l;for(const{row:e,column:r,cell:o}of[...c])if(s.has(r)){const{cell:o,rowspanToSet:i}=s.get(r),a=l?vs.createAfter(l):vs.createAt(n.getChild(e));t.move(_s.createOn(o),a),$w("rowspan",i,o,t),l=o}else l=o;t.remove(e)})}}class vv extends qf{refresh(){const t=this.editor,e=t.model.document.selection,n=t.plugins.get(lv),r=e.getFirstPosition().parent;this.isEnabled=r.is("tableCell")&&n.getColumns(r.parent.parent)>1}execute(){const t=this.editor.model,e=t.document.selection.getFirstPosition().parent,n=e.parent,r=n.parent,o=r.getAttribute("headingColumns")||0,i=r.getChildIndex(n),s=[...new jw(r)],a=s.find(t=>t.cell===e).column;t.change(t=>{o&&i<=o&&t.setAttribute("headingColumns",o-1,r);for(const{cell:e,column:n,colspan:r}of s)n<=a&&r>1&&n+r>a?$w("colspan",r-1,e,t):n===a&&t.remove(e)})}}class _v extends qf{refresh(){const t=this.editor.model.document.selection.getFirstPosition(),e=Hw(t),n=!!e;this.isEnabled=n,this.value=n&&this._isInHeading(t.parent,e)}execute(){const t=this.editor.model,e=t.document.selection.getFirstPosition().parent.parent,n=e.parent,r=n.getAttribute("headingRows")||0;let o=e.index;o+1!==r&&o++,t.change(t=>{if(o){const e=function(t,e,n){const r=[],o=new jw(t,{startRow:e>n?n:0,endRow:e-1});for(const{row:t,rowspan:n,cell:i}of o)n>1&&t+n>e&&r.push(i);return r}(n,o,r);for(const n of e)kv(n,o,t)}$w("headingRows",o,n,t,0)})}_isInHeading(t,e){const n=parseInt(e.getAttribute("headingRows")||0);return!!n&&t.parent.index1&&(s.rowspan=a);const c=o.getChildIndex(r),l=c+i,u=[...new jw(o,{startRow:c,endRow:l,includeSpanned:!0})];let d;for(const{row:e,column:r,cell:i,colspan:a,cellIndex:c}of u)if(i===t&&(d=r,a>1&&(s.colspan=a)),void 0!==d&&d===r&&e===l){const t=o.getChild(e);n.insertElement("tableCell",s,vs.createFromParentAndOffset(t,c))}$w("rowspan",i,t,n)}class yv extends qf{refresh(){const t=this.editor.model.document.selection.getFirstPosition(),e=Hw(t),n=!!e;this.isEnabled=n,this.value=n&&this._isInHeading(t.parent,e)}execute(){const t=this.editor.model,e=t.document.selection,n=this.editor.plugins.get("TableUtils"),r=e.getFirstPosition().parent,o=r.parent.parent,i=parseInt(o.getAttribute("headingColumns")||0);let{column:s}=n.getCellLocation(r);s+1!==i&&s++,t.change(t=>{$w("headingColumns",s,o,t,0)})}_isInHeading(t,e){const n=parseInt(e.getAttribute("headingColumns")||0),r=this.editor.plugins.get("TableUtils"),{column:o}=r.getCellLocation(t);return!!n&&ot.on("remove:tableRow",(t,e,n)=>{t.stop();const r=n.mapper.toViewPosition(e.position).getLastMatchingPosition(t=>!t.item.is("tr")).nodeAfter,o=r.parent,i=Fr.createOn(r),s=n.writer.remove(i);for(const t of Fr.createIn(s).getItems())n.mapper.unbindViewElement(t);o.childCount||n.writer.remove(Fr.createOn(o))},{priority:"higher"})),n.for("upcast").add(aa({model:"tableCell",view:"td"})),n.for("upcast").add(aa({model:"tableCell",view:"th"})),n.for("editingDowncast").add(Jw({asWidget:!0})),n.for("dataDowncast").add(Jw()),n.attributeToAttribute({model:"colspan",view:"colspan"}),n.attributeToAttribute({model:"rowspan",view:"rowspan"}),n.for("editingDowncast").add(Qw({asWidget:!0})),n.for("dataDowncast").add(Qw()),n.for("editingDowncast").add(Zw({asWidget:!0})),n.for("dataDowncast").add(Zw()),t.commands.add("insertTable",new fv(t)),t.commands.add("insertTableRowAbove",new pv(t,{order:"above"})),t.commands.add("insertTableRowBelow",new pv(t,{order:"below"})),t.commands.add("insertTableColumnBefore",new mv(t,{order:"before"})),t.commands.add("insertTableColumnAfter",new mv(t,{order:"after"})),t.commands.add("removeTableRow",new wv(t)),t.commands.add("removeTableColumn",new vv(t)),t.commands.add("splitTableCellVertically",new gv(t,{direction:"vertically"})),t.commands.add("splitTableCellHorizontally",new gv(t,{direction:"horizontally"})),t.commands.add("mergeTableCellRight",new bv(t,{direction:"right"})),t.commands.add("mergeTableCellLeft",new bv(t,{direction:"left"})),t.commands.add("mergeTableCellDown",new bv(t,{direction:"down"})),t.commands.add("mergeTableCellUp",new bv(t,{direction:"up"})),t.commands.add("setTableColumnHeader",new yv(t)),t.commands.add("setTableRowHeader",new _v(t)),this.listenTo(t.editing.view.document,"keydown",(...t)=>this._handleTabOnSelectedTable(...t)),this.listenTo(t.editing.view.document,"keydown",(...t)=>this._handleTabInsideTable(...t))}static get requires(){return[lv]}_handleTabOnSelectedTable(t,e){if(!(e.keyCode==Qr.tab)||e.ctrlKey)return;const n=this.editor,r=n.model.document.selection;if(!r.isCollapsed&&1===r.rangeCount&&r.getFirstRange().isFlat){const o=r.getSelectedElement();if(!o||"table"!=o.name)return;t.stop(),e.preventDefault(),e.stopPropagation(),n.model.change(t=>{t.setSelection(_s.createIn(o.getChild(0).getChild(0)))})}}_handleTabInsideTable(t,e){if(!(e.keyCode==Qr.tab)||e.ctrlKey)return;const n=this.editor,r=n.model.document.selection,o=Hw(r.getFirstPosition());if(!o)return;e.preventDefault(),e.stopPropagation();const i=r.focus.parent,s=i.parent,a=o.getChildIndex(s),c=s.getChildIndex(i),l=!e.shiftKey,u=0===c;if(!l&&u&&0===a)return;const d=c===s.childCount-1,h=a===o.childCount-1;let f;if(l&&h&&d&&n.plugins.get(lv).insertRows(o,{at:o.childCount}),l&&d){const t=o.getChild(a+1);f=t.getChild(0)}else if(!l&&u){const t=o.getChild(a-1);f=t.getChild(t.childCount-1)}else f=s.getChild(c+(l?1:-1));n.model.change(t=>{t.setSelection(_s.createIn(f))})}}n(121);class Cv extends Sh{constructor(t){super(t);const e=this.bindTemplate;this.items=this.createCollection(),this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",(t,e)=>`${e} x ${t}`),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:e.to("label")}]}],on:{mousedown:e.to(t=>{t.preventDefault()}),click:e.to(()=>{this.fire("execute")})}});for(let t=0;t<100;t++){const e=new Av;e.on("over",()=>{const e=Math.floor(t/10),n=t%10;this.set("rows",e+1),this.set("columns",n+1)}),this.items.add(e)}this.on("change:columns",()=>{this._highlightGridBoxes()}),this.on("change:rows",()=>{this._highlightGridBoxes()})}focus(){}focusLast(){}_highlightGridBoxes(){const t=this.rows,e=this.columns;this.items.map((n,r)=>{const o=Math.floor(r/10){const r=t.commands.get("insertTable"),o=wg(n);o.bind("isEnabled").to(r),o.buttonView.set({icon:Ev.a,label:e("d"),tooltip:!0});const i=new Cv(n);return o.panelView.children.add(i),i.delegate("execute").to(o),o.buttonView.on("open",()=>{i.rows=0,i.columns=0}),o.on("execute",()=>{t.execute("insertTable",{rows:i.rows,columns:i.columns}),t.editing.view.focus()}),o}),t.ui.componentFactory.add("tableColumn",t=>{const n=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:e("e"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableColumnBefore",label:e("f")}},{type:"button",model:{commandName:"insertTableColumnAfter",label:e("g")}},{type:"button",model:{commandName:"removeTableColumn",label:e("h")}}];return this._prepareDropdown(e("i"),Pv.a,n,t)}),t.ui.componentFactory.add("tableRow",t=>{const n=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:e("j"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowBelow",label:e("k")}},{type:"button",model:{commandName:"insertTableRowAbove",label:e("l")}},{type:"button",model:{commandName:"removeTableRow",label:e("m")}}];return this._prepareDropdown(e("n"),Rv.a,n,t)}),t.ui.componentFactory.add("mergeTableCells",t=>{const n=[{type:"button",model:{commandName:"mergeTableCellUp",label:e("o")}},{type:"button",model:{commandName:"mergeTableCellRight",label:e("p")}},{type:"button",model:{commandName:"mergeTableCellDown",label:e("q")}},{type:"button",model:{commandName:"mergeTableCellLeft",label:e("r")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:e("s")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:e("t")}}];return this._prepareDropdown(e("u"),Iv.a,n,t)})}_prepareDropdown(t,e,n,r){const o=this.editor,i=wg(r),s=[],a=new Lr;for(const t of n)Nv(t,o,s,a);return vg(i,a),i.buttonView.set({label:t,icon:e,tooltip:!0}),i.bind("isEnabled").toMany(s,"isEnabled",(...t)=>t.some(t=>t)),this.listenTo(i,"execute",t=>{o.execute(t.source.commandName),o.editing.view.focus()}),i}}function Nv(t,e,n,r){const o=t.model=new ag(t.model),{commandName:i,bindIsOn:s}=t.model;if("separator"!==t.type){const t=e.commands.get(i);n.push(t),o.set({commandName:i}),o.bind("isEnabled").to(t),s&&o.bind("isOn").to(t,"value")}o.set({withText:!0}),r.add(t)}n(123);function Mv(t){const e=t.editing.view,n=kf.defaultPositions,r=Hw(e.document.selection.getFirstPosition());return{target:e.domConverter.viewToDom(r),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}}const Vv="ck-toolbar-container";var Bv=/highlight-(?:text|source)-([a-z0-9]+)/;function Lv(t){t.addRule("highlightedCodeBlock",{filter:function(t){var e=t.firstChild;return"DIV"===t.nodeName&&Bv.test(t.className)&&e&&"PRE"===e.nodeName},replacement:function(t,e,n){var r=((e.className||"").match(Bv)||[null,""])[1];return"\n\n"+n.fence+r+"\n"+e.firstChild.textContent+"\n"+n.fence+"\n\n"}})}var zv=Array.prototype.indexOf,qv=Array.prototype.every,jv={};function Hv(t){var e=t.parentNode;return"THEAD"===e.nodeName||e.firstChild===t&&("TABLE"===e.nodeName||function(t){var e=t.previousSibling;return"TBODY"===t.nodeName&&(!e||"THEAD"===e.nodeName&&/^\s*$/i.test(e.textContent))}(e))&&qv.call(t.childNodes,function(t){return"TH"===t.nodeName})}function $v(t,e){var n=" ";return 0===zv.call(e.parentNode.childNodes,e)&&(n="| "),n+t+" |"}function Uv(t){t.addRule("taskListItems",{filter:function(t){return"checkbox"===t.type&&"LI"===t.parentNode.nodeName},replacement:function(t,e){return(e.checked?"[x]":"[ ]")+" "}})}function Wv(t,e){return Array(e+1).join(t)}jv.tableCell={filter:["th","td"],replacement:function(t,e){return $v(t,e)}},jv.tableRow={filter:"tr",replacement:function(t,e){var n="",r={left:":--",right:"--:",center:":-:"};if(Hv(e))for(var o=0;o-1)return!0}else{if("function"!=typeof r)throw new TypeError("`filter` needs to be a string, array, or function");if(r.call(t,e,n))return!0}}function n_(t){var e=t.nextSibling||t.parentNode;return t.parentNode.removeChild(t),e}function r_(t,e,n){return t&&t.parentNode===e||n(e)?e.nextSibling||e.parentNode:e.firstChild||e.nextSibling||e.parentNode}Yv.paragraph={filter:"p",replacement:function(t){return"\n\n"+t+"\n\n"}},Yv.lineBreak={filter:"br",replacement:function(t,e,n){return n.br+"\n"}},Yv.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(t,e,n){var r=Number(e.nodeName.charAt(1));return"setext"===n.headingStyle&&r<3?"\n\n"+t+"\n"+Wv(1===r?"=":"-",t.length)+"\n\n":"\n\n"+Wv("#",r)+" "+t+"\n\n"}},Yv.blockquote={filter:"blockquote",replacement:function(t){return"\n\n"+(t=(t=t.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},Yv.list={filter:["ul","ol"],replacement:function(t,e){var n=e.parentNode;return"LI"===n.nodeName&&n.lastElementChild===e?"\n"+t:"\n\n"+t+"\n\n"}},Yv.listItem={filter:"li",replacement:function(t,e,n){t=t.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var r=n.bulletListMarker+" ",o=e.parentNode;if("OL"===o.nodeName){var i=o.getAttribute("start"),s=Array.prototype.indexOf.call(o.children,e);r=(i?Number(i)+s:s+1)+". "}return r+t+(e.nextSibling&&!/\n$/.test(t)?"\n":"")}},Yv.indentedCodeBlock={filter:function(t,e){return"indented"===e.codeBlockStyle&&"PRE"===t.nodeName&&t.firstChild&&"CODE"===t.firstChild.nodeName},replacement:function(t,e,n){return"\n\n "+e.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},Yv.fencedCodeBlock={filter:function(t,e){return"fenced"===e.codeBlockStyle&&"PRE"===t.nodeName&&t.firstChild&&"CODE"===t.firstChild.nodeName},replacement:function(t,e,n){var r=((e.firstChild.className||"").match(/language-(\S+)/)||[null,""])[1];return"\n\n"+n.fence+r+"\n"+e.firstChild.textContent+"\n"+n.fence+"\n\n"}},Yv.horizontalRule={filter:"hr",replacement:function(t,e,n){return"\n\n"+n.hr+"\n\n"}},Yv.inlineLink={filter:function(t,e){return"inlined"===e.linkStyle&&"A"===t.nodeName&&t.getAttribute("href")},replacement:function(t,e){return"["+t+"]("+e.getAttribute("href")+(e.title?' "'+e.title+'"':"")+")"}},Yv.referenceLink={filter:function(t,e){return"referenced"===e.linkStyle&&"A"===t.nodeName&&t.getAttribute("href")},replacement:function(t,e,n){var r,o,i=e.getAttribute("href"),s=e.title?' "'+e.title+'"':"";switch(n.linkReferenceStyle){case"collapsed":r="["+t+"][]",o="["+t+"]: "+i+s;break;case"shortcut":r="["+t+"]",o="["+t+"]: "+i+s;break;default:var a=this.references.length+1;r="["+t+"]["+a+"]",o="["+a+"]: "+i+s}return this.references.push(o),r},references:[],append:function(t){var e="";return this.references.length&&(e="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),e}},Yv.emphasis={filter:["em","i"],replacement:function(t,e,n){return t.trim()?n.emDelimiter+t+n.emDelimiter:""}},Yv.strong={filter:["strong","b"],replacement:function(t,e,n){return t.trim()?n.strongDelimiter+t+n.strongDelimiter:""}},Yv.code={filter:function(t){var e=t.previousSibling||t.nextSibling,n="PRE"===t.parentNode.nodeName&&!e;return"CODE"===t.nodeName&&!n},replacement:function(t){if(!t.trim())return"";var e="`",n="",r="",o=t.match(/`+/gm);if(o)for(/^`/.test(t)&&(n=" "),/`$/.test(t)&&(r=" ");-1!==o.indexOf(e);)e+="`";return e+n+t+r+e}},Yv.image={filter:"img",replacement:function(t,e){var n=e.alt||"",r=e.getAttribute("src")||"",o=e.title||"";return r?"!["+n+"]("+r+(o?' "'+o+'"':"")+")":""}},Xv.prototype={add:function(t,e){this.array.unshift(e)},keep:function(t){this._keep.unshift({filter:t,replacement:this.keepReplacement})},remove:function(t){this._remove.unshift({filter:t,replacement:function(){return""}})},forNode:function(t){return t.isBlank?this.blankRule:(e=t_(this.array,t,this.options))?e:(e=t_(this._keep,t,this.options))?e:(e=t_(this._remove,t,this.options))?e:this.defaultRule;var e},forEach:function(t){for(var e=0;e'+t+"","text/html").getElementById("turndown-root"):e=t.cloneNode(!0);return function(t){var e=t.element,n=t.isBlock,r=t.isVoid,o=t.isPre||function(t){return"PRE"===t.nodeName};if(e.firstChild&&!o(e)){for(var i=null,s=!1,a=null,c=r_(a,e,o);c!==e;){if(3===c.nodeType||4===c.nodeType){var l=c.data.replace(/[ \r\n\t]+/g," ");if(i&&!/ $/.test(i.data)||s||" "!==l[0]||(l=l.substr(1)),!l){c=n_(c);continue}c.data=l,i=c}else{if(1!==c.nodeType){c=n_(c);continue}n(c)||"BR"===c.nodeName?(i&&(i.data=i.data.replace(/ $/,"")),i=null,s=!1):r(c)&&(i=null,s=!0)}var u=r_(a,c,o);a=c,c=u}i&&(i.data=i.data.replace(/ $/,""),i.data||n_(i))}}({element:e,isBlock:Kv,isVoid:Zv}),e}function c_(t){return t.isBlock=Kv(t),t.isCode="code"===t.nodeName.toLowerCase()||t.parentNode.isCode,t.isBlank=function(t){return-1===["A","TH","TD"].indexOf(t.nodeName)&&/^\s*$/i.test(t.textContent)&&!Zv(t)&&!function(t){return t.querySelector&&t.querySelector(Qv)}(t)}(t),t.flankingWhitespace=function(t){var e="",n="";if(!t.isBlock){var r=/^[ \r\n\t]/.test(t.textContent),o=/[ \r\n\t]$/.test(t.textContent);r&&!l_("left",t)&&(e=" "),o&&!l_("right",t)&&(n=" ")}return{leading:e,trailing:n}}(t),t}function l_(t,e){var n,r,o;return"left"===t?(n=e.previousSibling,r=/ $/):(n=e.nextSibling,r=/^ /),n&&(3===n.nodeType?o=r.test(n.nodeValue):1!==n.nodeType||Kv(n)||(o=r.test(n.textContent))),o}var u_=Array.prototype.reduce,d_=/^\n*/,h_=/\n*$/;function f_(t){if(!(this instanceof f_))return new f_(t);var e={rules:Yv,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",blankReplacement:function(t,e){return e.isBlock?"\n\n":""},keepReplacement:function(t,e){return e.isBlock?"\n\n"+e.outerHTML+"\n\n":e.outerHTML},defaultReplacement:function(t,e){return e.isBlock?"\n\n"+t+"\n\n":t}};this.options=function(t){for(var e=1;e /gm,"$1\\> ").replace(/\*+(?![*\s\W]).+?\*+/g,function(t){return t.replace(/\*/g,"\\*")}).replace(/_+(?![_\s\W]).+?_+/g,function(t){return t.replace(/_/g,"\\_")}).replace(/`+(?![`\s\W]).+?`+/g,function(t){return t.replace(/`/g,"\\`")}).replace(/[\[\]]/g,"\\$&")}};var g_=f_;const b_="data-original-src";class w_{constructor(){this._htmlDP=new eh,this._domConverter=new qo}toView(t){const e=n(126)({html:!0,langPrefix:"language-"}).render(t);return this._htmlDP.toView(e)}toData(t){const e=this._domConverter.viewToDom(t,document);!function(t,e){e=e.map(t=>t.toUpperCase());let n,r=document.createNodeIterator(t,NodeFilter.SHOW_TEXT,{acceptNode:function(t){if(t.parentElement&&e.indexOf(t.parentElement.nodeName)>=0)return NodeFilter.FILTER_ACCEPT}},!1);for(;n=r.nextNode();)n.nodeValue=n.nodeValue.replace(/^[\u00a0]+/g," ").replace(/[\u00a0]+$/g," ")}(e,["strong","em"]);const n=new g_({headingStyle:"atx",codeBlockStyle:"fenced"});return n.use([Lv,Uv]),n.addRule("img",{filter:"img",replacement:function(t,e){var n=e.alt||"",r=e.getAttribute(b_)||e.getAttribute("src")||"",o=e.title||"";return r?"!["+n+"]("+r+(o?' "'+o+'"':"")+")":""}}),n.addRule("htmlTables",{filter:["table"],replacement:function(t,e){return e.querySelectorAll("td br[data-cke-filler]").forEach(t=>t.remove()),e.outerHTML}}),n.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(t){return"~~"+t+"~~"}}),n.addRule("openProjectMacros",{filter:["macro"],replacement:(t,e)=>(e.innerHTML="",e.outerHTML)}),n.turndown(e)}}var v_=n(17),__=n.n(v_),k_=n(56),y_=n.n(k_);const x_=[uf,class extends Gh{static get requires(){return[ff,gf,Df]}static get pluginName(){return"OPMacroEmbeddedTable"}static get buttonName(){return ff.buttonName}},class extends Gh{static get requires(){return[Nf,gf,Mf]}static get pluginName(){return"OPMacroWpButton"}static get buttonName(){return Nf.buttonName}},class extends Gh{static get requires(){return[Lf,gf,zf]}static get pluginName(){return"OPWikiIncludePage"}static get buttonName(){return Lf.buttonName}},class extends Gh{static get requires(){return[Cp,gf,Ap]}static get pluginName(){return"OPChildPages"}static get buttonName(){return Cp.buttonName}}],C_=[class extends Gh{static get requires(){return[Yf,kp]}static get pluginName(){return"OpUploadPlugin"}init(){this.editor.plugins.get("FileRepository").createUploadAdapter=(t=>{const e=Kf(this.editor);return new tp(t,e,this.editor)})}},class extends Gh{static get pluginName(){return"OPAttachmentListener"}init(){this.editor.model.on("op:attachment-removed",(t,e)=>{this.removeDeletedImage(e)})}removeDeletedImage(t){let e=this.editor.model.document.getRoot();for(const n of Array.from(e.getChildren()))if("image"===n.name&&t.indexOf(n.getAttribute("src"))>-1){const t=new Ts(n,"on");this.editor.model.deleteContent(t)}}}],A_=[class extends Gh{static get requires(){return[Pp,Rp,Np,Yp,lm]}static get pluginName(){return"Essentials"}},class extends Gh{static get requires(){return[Yf]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const t=this.editor.config.get("ckfinder.uploadUrl");t&&(this.editor.plugins.get(Yf).createUploadAdapter=(e=>new pm(e,t,this.editor.t)))}},class extends Gh{static get pluginName(){return"Autoformat"}afterInit(){this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats()}_addListAutoformats(){const t=this.editor.commands;t.get("bulletedList")&&new mm(this.editor,/^[*-]\s$/,"bulletedList"),t.get("numberedList")&&new mm(this.editor,/^\d+[.|)]\s$/,"numberedList")}_addBasicStylesAutoformats(){const t=this.editor.commands;t.get("bold")&&(new gm(this.editor,/(\*\*)([^*]+)(\*\*)$/g,"bold"),new gm(this.editor,/(__)([^_]+)(__)$/g,"bold")),t.get("italic")&&(new gm(this.editor,/(?:^|[^*])(\*)([^*_]+)(\*)$/g,"italic"),new gm(this.editor,/(?:^|[^_])(_)([^_]+)(_)$/g,"italic")),t.get("code")&&new gm(this.editor,/(`)([^`]+)(`)$/g,"code")}_addHeadingAutoformats(){const t=this.editor.commands.get("heading");t&&t.modelElements.filter(t=>t.match(/^heading[1-6]$/)).forEach(t=>{const e=t[7],n=new RegExp(`^(#{${e}})\\s$`);new mm(this.editor,n,()=>{this.editor.execute("heading",{value:t})})})}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&new mm(this.editor,/^>\s$/,"blockQuote")}},class extends Gh{static get requires(){return[_m,Cm]}static get pluginName(){return"Bold"}},class extends Gh{static get requires(){return[Tm,Om]}static get pluginName(){return"Code"}},class extends Gh{static get requires(){return[Bm,jm]}static get pluginName(){return"Italic"}},class extends Gh{static get requires(){return[Dm,Mm]}static get pluginName(){return"Strikethrough"}},class extends Gh{static get requires(){return[Km,Qm]}static get pluginName(){return"BlockQuote"}},class extends Gh{static get requires(){return[sg,_g]}static get pluginName(){return"Heading"}},class extends Gh{static get requires(){return[Tg,gf,Hg]}static get pluginName(){return"Image"}},class extends Gh{static get requires(){return[Zg]}static get pluginName(){return"ImageCaption"}},class extends Gh{static get requires(){return[mb,gb]}static get pluginName(){return"ImageStyle"}},class extends Gh{static get requires(){return[Af]}static get pluginName(){return"ImageToolbar"}init(){const t=this.editor,e=t.plugins.get("BalloonToolbar");e&&this.listenTo(e,"show",e=>{Cg(t.editing.view.document.selection)&&e.stop()},{priority:"high"})}afterInit(){const t=this.editor,e=t.config.get("image.toolbar");e&&e.length&&(this._balloon=this.editor.plugins.get("ContextualBalloon"),this._toolbar=new zh,this._toolbar.fillFromConfig(e,t.ui.componentFactory),this.listenTo(t.ui,"update",()=>{this._checkIsVisible()}),this.listenTo(t.ui.focusTracker,"change:isFocused",()=>{this._checkIsVisible()},{priority:"low"}))}_checkIsVisible(){const t=this.editor;t.ui.focusTracker.isFocused&&Cg(t.editing.view.document.selection)?this._showToolbar():this._hideToolbar()}_showToolbar(){const t=this.editor;this._isVisible?zg(t):this._balloon.hasView(this._toolbar)||this._balloon.add({view:this._toolbar,position:qg(t),balloonClassName:bb})}_hideToolbar(){this._isVisible&&this._balloon.remove(this._toolbar)}get _isVisible(){return this._balloon.visibleView==this._toolbar}},class extends Gh{static get pluginName(){return"OpImageAttachmentLookup"}init(){const t=this.editor,e=t.conversion,n=Kf(t);e.for("editingDowncast").add(function(t){return t=>{t.on("attribute:src:image",e,{priority:"highest"})};function e(e,n,r){let o=n.attributeNewValue;if(!o||!t.lookupDownloadLocationByName)return;const i=t.lookupDownloadLocationByName(o);n.attributeNewValue=i||o}}(n)),e.for("dataDowncast").add(function(t){return t=>{t.on("attribute:src:image",e,{priority:"highest"})};function e(e,n,r){let o=n.attributeNewValue;if(!o||!t.lookupDownloadLocationByName)return;const i=t.lookupDownloadLocationByName(o);n.attributeNewValue=i||o;const s=r.writer,a=r.mapper.toViewElement(n.item).getChild(0);i&&s.setAttribute(b_,o,a)}}(n))}},class extends Gh{static get requires(){return[Fb,Ub]}static get pluginName(){return"Link"}},class extends Gh{static get requires(){return[mw,kw]}static get pluginName(){return"List"}},tg,Yp,class extends Gh{static get pluginName(){return"OPHelpLinkPlugin"}init(){const t=this.editor,e=(t.model,t.config.get("openProject.helpURL"));t.ui.componentFactory.add("openProjectShowFormattingHelp",t=>{const n=new Wh(t);return n.set({label:window.I18n.t("js.inplace.link_formatting_help"),icon:xw.a,tooltip:!0}),n.on("execute",()=>{window.open(e,"_blank")}),n})}},class extends Gh{static get pluginName(){return"CodeBlock"}static get requires(){return[Iw,Fw]}},class extends Gh{static get pluginName(){return"OPPreview"}init(){const t=this.editor;let e=!1,n=null;t.ui.componentFactory.add("preview",r=>{const o=new Wh(r);o.set({label:this.label,icon:Mw.a,tooltip:!0});let i=function(e){let r,i=jQuery(t.element),s=i.find(".ck-editor__main");r=s.length?s:i;let a=jQuery('
    ');r.siblings(".ck-editor__preview").remove();const c=Gf(t,"ckEditorPreview");n=c.render(a[0],e),r.hide(),r.after(a),Bw(t,o)};return o.on("execute",()=>{e?(e=!1,function(){let e=jQuery(t.element).find(".ck-editor__main");n(),e.siblings(".ck-editor__preview").remove(),e.show(),Lw(t)}()):(e=!0,function(){let e=function(t){return t.config.get("openProject.context.previewContext")}(t),n=Jf(t).api.v3.previewMarkup(e);jQuery.ajax({data:t.getData(),url:n,response_type:"text",contentType:"text/plain; charset=UTF-8",method:"POST"}).done(i)}())}),o})}get label(){return window.I18n.t("js.editor.preview")}},class extends Gh{static get pluginName(){return"OPSourceCode"}init(){const t=this.editor;let e=!1,n={source:window.I18n.t("js.editor.mode.manual"),wysiwyg:window.I18n.t("js.editor.mode.wysiwyg")};t.ui.componentFactory.add("opShowSource",r=>{const o=new Wh(r);return o.set({label:n.source,class:"",icon:__.a,tooltip:!0}),o.on("execute",()=>{e?(e=!1,function(){let e=jQuery(t.element).find(".ck-editor__main");t.fire("op:source-code-disabled"),e.siblings(".ck-editor__source").remove(),e.show(),Lw(t),o.set({label:n.source,class:"",icon:__.a,tooltip:!0})}()):(e=!0,function(e){let r,i=jQuery(t.element),s=i.find(".ck-editor__main");r=s.length?s:i;let a=jQuery('
    ');r.siblings(".ck-editor__source").remove(),r.hide(),r.after(a),Bw(t,o),t.fire("op:source-code-enabled"),o.set({label:n.wysiwyg,class:"-source-enabled",icon:y_.a,tooltip:!0})}())}),o})}},function(t){t.data.processor=new w_},class extends Gh{static get requires(){return[xv,Fv,gf]}static get pluginName(){return"Table"}},class extends Gh{static get requires(){return[Af]}static get pluginName(){return"TableToolbar"}init(){const t=this.editor,e=t.plugins.get("BalloonToolbar");e&&this.listenTo(e,"show",e=>{(function(t){const e=t.getSelectedElement();return!(!e||!Ww(e))})(t.editing.view.document.selection)&&e.stop()},{priority:"high"})}afterInit(){const t=this.editor,e=t.config.get("table.toolbar");e&&e.length&&(this._balloon=this.editor.plugins.get("ContextualBalloon"),this._toolbar=new zh,this._toolbar.fillFromConfig(e,t.ui.componentFactory),this.listenTo(t.ui,"update",()=>{this._checkIsVisible()}),this.listenTo(t.ui.focusTracker,"change:isFocused",()=>{this._checkIsVisible()},{priority:"low"}))}_checkIsVisible(){const t=this.editor,e=t.editing.view.document.selection;t.ui.focusTracker.isFocused&&function(t){const e=Hw(t.getFirstPosition());return!(!e||!Ww(e.parent))}(e)?this._showToolbar():this._hideToolbar()}_showToolbar(){const t=this.editor;this._isVisible?function(t){t.plugins.get("ContextualBalloon").updatePosition(Mv(t))}(t):this._balloon.hasView(this._toolbar)||this._balloon.add({view:this._toolbar,position:Mv(t),balloonClassName:Vv})}_hideToolbar(){this._isVisible&&this._balloon.remove(this._toolbar)}get _isVisible(){return this._balloon.visibleView==this._toolbar}},class extends Gh{init(){const t=this.editor,e=(t.config.get("removePlugins")||[]).map(t=>t.pluginName),n=window.I18n.t("js.editor.macro.dropdown.chose_macro");!0!==t.config.get("openProject.disableAllMacros")&&t.ui.componentFactory.add("macroList",r=>{const o=[];for(const n of x_){if(-1!==e.indexOf(n.pluginName))continue;const r=t.ui.componentFactory.create(n.buttonName);o.push(r)}const i=wg(r);return function(t,e){const n=t.toolbarView=new zh;t.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.map(t=>n.items.add(t)),t.panelView.children.add(n),n.items.delegate("execute").to(t)}(i,o),i.buttonView.set({isOn:!1,withText:!0,tooltip:n,label:window.I18n.t("js.editor.macro.dropdown.macros")}),i.toolbarView.isVertical=!0,i.toolbarView.className="op-macro-list-button",i})}}].concat(x_,[class extends Gh{static get pluginName(){return"atjs"}static get requires(){return[Uf]}init(){const t=this.editor;t.commands.get("enter").destroy(),t.commands.add("enter",new Uf(t))}},class extends Gh{static get pluginName(){return"OPLinkingWp"}init(){Wf(this.editor,{ignorePrefix:/user\#/,remoteUrl:function(t,e){let n=window.OpenProject.urlRoot+"/work_packages/auto_complete.json";jQuery.getJSON(n,{q:t,scope:"all"},e)},remoteDataPreparation:function(t){for(let e=t.length-1;e>=0;e--)t[e].id_subject=t[e].id.toString()+" "+t[e].subject;return t}})}},class extends Gh{static get pluginName(){return"OPMentioning"}init(){const t=this.editor;Wf(t,{searchKey:"id_principal",displayTpl:'
  • ${name}
  • ',insertTpl:"${typePrefix}#${id}",startWithSpace:!0,suffix:"",acceptSpaceBar:!0,highlightFirst:!0,at:"@",remoteDataPreparation:function(e){const n=e._embedded.elements,r=Gf(t,"htmlSanitizeService");for(let t=n.length-1;t>=0;t--)n[t].id_principal=r.sanitize(n[t].id.toString()+" "+n[t].name),n[t].typePrefix=n[t]._type.toLowerCase();return n},isSupportedContext:function(){let e=Kf(t);return e&&"WorkPackage"===e._type},remoteUrl:function(e,n){const r=Kf(t).project.idFromLink,o=Jf(t).api.v3.principals(r,e);jQuery.getJSON(o,n)}})}}],C_);function T_(t){return(e,n)=>{const r=n.openProject.context;n.removePlugins=n.removePlugins||[];const o=r.resource;if(o&&o.canAddAttachments||n.removePlugins.push(...C_.map(t=>t.pluginName)),!1===r.macros&&(n.openProject.disableAllMacros=!0,n.removePlugins.push(...x_.map(t=>t.pluginName))),Array.isArray(r.macros)){const t=x_.filter(t=>-1===r.macros.indexOf(t.pluginName));n.removePlugins.push(...t)}return t.create(e,n)}}const E_={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"]},language:"en"};n.d(e,"ConstrainedEditor",function(){return S_}),n.d(e,"FullEditor",function(){return P_});class S_ extends Hh{}class P_ extends Hh{}window.OPConstrainedEditor=S_,window.OPClassicEditor=P_,P_.createCustomized=T_(P_),P_.builtinPlugins=A_,P_.defaultConfig=Object.assign({},E_),P_.defaultConfig.toolbar={items:["heading","|","bold","italic","strikethrough","code","insertCodeBlock","link","bulletedList","numberedList","imageUpload","blockQuote","|","insertTable","macroList","|","undo","redo","openProjectShowFormattingHelp","|","preview","opShowSource"]},S_.createCustomized=T_(S_),S_.builtinPlugins=A_,S_.defaultConfig=Object.assign({},E_),S_.defaultConfig.toolbar={items:["bold","italic","strikethrough","code","insertCodeBlock","link","bulletedList","numberedList","imageUpload","blockQuote","|","openProjectShowFormattingHelp","preview","opShowSource"]}}]).default}); //# sourceMappingURL=ckeditor.js.map