diff --git a/packages/markdown-editor/dist/ckeditor.js b/packages/markdown-editor/dist/ckeditor.js
index e2b59b09a7..30ee1b97b4 100644
--- a/packages/markdown-editor/dist/ckeditor.js
+++ b/packages/markdown-editor/dist/ckeditor.js
@@ -1,7 +1,7 @@
!function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"%0 of %1":"%0 of %1","Almost equal to":"Almost equal to",Angle:"Angle","Approximately equal to":"Approximately equal to",Aquamarine:"Aquamarine","Asterisk operator":"Asterisk operator","Austral sign":"Austral sign","back with leftwards arrow above":"back with leftwards arrow above","Bitcoin sign":"Bitcoin sign",Black:"Black","Block quote":"Block quote",Blue:"Blue",Bold:"Bold","Bulleted List":"Bulleted List",Cancel:"Cancel","Cedi sign":"Cedi sign","Cent sign":"Cent sign","Change image text alternative":"Change image text alternative","Character categories":"Character categories","Choose heading":"Choose heading","Colon sign":"Colon sign",Column:"Column","Contains as member":"Contains as member","Copyright sign":"Copyright sign","Cruzeiro sign":"Cruzeiro sign","Currency sign":"Currency sign","Decrease indent":"Decrease indent","Degree sign":"Degree sign","Delete column":"Delete column","Delete row":"Delete row","Dim grey":"Dim grey","Division sign":"Division sign","Dollar sign":"Dollar sign","Dong sign":"Dong sign","Double dagger":"Double dagger","Double exclamation mark":"Double exclamation mark","Double low-9 quotation mark":"Double low-9 quotation mark","Double question mark":"Double question mark",Downloadable:"Downloadable","downwards arrow to bar":"downwards arrow to bar","downwards dashed arrow":"downwards dashed arrow","downwards double arrow":"downwards double arrow","Drachma sign":"Drachma sign","Dropdown toolbar":"Dropdown toolbar","Edit block":"Edit block","Edit link":"Edit link","Editor toolbar":"Editor toolbar","Element of":"Element of","Em dash":"Em dash","Empty set":"Empty set","En dash":"En dash","end with leftwards arrow above":"end with leftwards arrow above","Euro sign":"Euro sign","Euro-currency sign":"Euro-currency sign","Exclamation question mark":"Exclamation question mark","For all":"For all","Fraction slash":"Fraction slash","French franc sign":"French franc sign","German penny sign":"German penny sign","Greater-than or equal to":"Greater-than or equal to","Greater-than sign":"Greater-than sign",Green:"Green",Grey:"Grey","Guarani sign":"Guarani sign","Header column":"Header column","Header row":"Header row",Heading:"Heading","Heading 1":"Heading 1","Heading 2":"Heading 2","Heading 3":"Heading 3","Heading 4":"Heading 4","Heading 5":"Heading 5","Heading 6":"Heading 6","Horizontal ellipsis":"Horizontal ellipsis","Hryvnia sign":"Hryvnia sign","Identical to":"Identical to","image widget":"image widget","Increase indent":"Increase indent","Indian rupee sign":"Indian rupee sign",Infinity:"Infinity","Insert column left":"Insert column left","Insert column right":"Insert column right","Insert paragraph after block":"Insert paragraph after block","Insert paragraph before block":"Insert paragraph before block","Insert row above":"Insert row above","Insert row below":"Insert row below","Insert table":"Insert table",Integral:"Integral",Intersection:"Intersection","Inverted exclamation mark":"Inverted exclamation mark","Inverted question mark":"Inverted question mark",Italic:"Italic","Kip sign":"Kip sign","Latin capital letter a with breve":"Latin capital letter a with breve","Latin capital letter a with macron":"Latin capital letter a with macron","Latin capital letter a with ogonek":"Latin capital letter a with ogonek","Latin capital letter c with acute":"Latin capital letter c with acute","Latin capital letter c with caron":"Latin capital letter c with caron","Latin capital letter c with circumflex":"Latin capital letter c with circumflex","Latin capital letter c with dot above":"Latin capital letter c with dot above","Latin capital letter d with caron":"Latin capital letter d with caron","Latin capital letter d with stroke":"Latin capital letter d with stroke","Latin capital letter e with breve":"Latin capital letter e with breve","Latin capital letter e with caron":"Latin capital letter e with caron","Latin capital letter e with dot above":"Latin capital letter e with dot above","Latin capital letter e with macron":"Latin capital letter e with macron","Latin capital letter e with ogonek":"Latin capital letter e with ogonek","Latin capital letter eng":"Latin capital letter eng","Latin capital letter g with breve":"Latin capital letter g with breve","Latin capital letter g with cedilla":"Latin capital letter g with cedilla","Latin capital letter g with circumflex":"Latin capital letter g with circumflex","Latin capital letter g with dot above":"Latin capital letter g with dot above","Latin capital letter h with circumflex":"Latin capital letter h with circumflex","Latin capital letter h with stroke":"Latin capital letter h with stroke","Latin capital letter i with breve":"Latin capital letter i with breve","Latin capital letter i with dot above":"Latin capital letter i with dot above","Latin capital letter i with macron":"Latin capital letter i with macron","Latin capital letter i with ogonek":"Latin capital letter i with ogonek","Latin capital letter i with tilde":"Latin capital letter i with tilde","Latin capital letter j with circumflex":"Latin capital letter j with circumflex","Latin capital letter k with cedilla":"Latin capital letter k with cedilla","Latin capital letter l with acute":"Latin capital letter l with acute","Latin capital letter l with caron":"Latin capital letter l with caron","Latin capital letter l with cedilla":"Latin capital letter l with cedilla","Latin capital letter l with middle dot":"Latin capital letter l with middle dot","Latin capital letter l with stroke":"Latin capital letter l with stroke","Latin capital letter n with acute":"Latin capital letter n with acute","Latin capital letter n with caron":"Latin capital letter n with caron","Latin capital letter n with cedilla":"Latin capital letter n with cedilla","Latin capital letter o with breve":"Latin capital letter o with breve","Latin capital letter o with double acute":"Latin capital letter o with double acute","Latin capital letter o with macron":"Latin capital letter o with macron","Latin capital letter r with acute":"Latin capital letter r with acute","Latin capital letter r with caron":"Latin capital letter r with caron","Latin capital letter r with cedilla":"Latin capital letter r with cedilla","Latin capital letter s with acute":"Latin capital letter s with acute","Latin capital letter s with caron":"Latin capital letter s with caron","Latin capital letter s with cedilla":"Latin capital letter s with cedilla","Latin capital letter s with circumflex":"Latin capital letter s with circumflex","Latin capital letter t with caron":"Latin capital letter t with caron","Latin capital letter t with cedilla":"Latin capital letter t with cedilla","Latin capital letter t with stroke":"Latin capital letter t with stroke","Latin capital letter u with breve":"Latin capital letter u with breve","Latin capital letter u with double acute":"Latin capital letter u with double acute","Latin capital letter u with macron":"Latin capital letter u with macron","Latin capital letter u with ogonek":"Latin capital letter u with ogonek","Latin capital letter u with ring above":"Latin capital letter u with ring above","Latin capital letter u with tilde":"Latin capital letter u with tilde","Latin capital letter w with circumflex":"Latin capital letter w with circumflex","Latin capital letter y with circumflex":"Latin capital letter y with circumflex","Latin capital letter y with diaeresis":"Latin capital letter y with diaeresis","Latin capital letter z with acute":"Latin capital letter z with acute","Latin capital letter z with caron":"Latin capital letter z with caron","Latin capital letter z with dot above":"Latin capital letter z with dot above","Latin capital ligature ij":"Latin capital ligature ij","Latin capital ligature oe":"Latin capital ligature oe","Latin small letter a with breve":"Latin small letter a with breve","Latin small letter a with macron":"Latin small letter a with macron","Latin small letter a with ogonek":"Latin small letter a with ogonek","Latin small letter c with acute":"Latin small letter c with acute","Latin small letter c with caron":"Latin small letter c with caron","Latin small letter c with circumflex":"Latin small letter c with circumflex","Latin small letter c with dot above":"Latin small letter c with dot above","Latin small letter d with caron":"Latin small letter d with caron","Latin small letter d with stroke":"Latin small letter d with stroke","Latin small letter dotless i":"Latin small letter dotless i","Latin small letter e with breve":"Latin small letter e with breve","Latin small letter e with caron":"Latin small letter e with caron","Latin small letter e with dot above":"Latin small letter e with dot above","Latin small letter e with macron":"Latin small letter e with macron","Latin small letter e with ogonek":"Latin small letter e with ogonek","Latin small letter eng":"Latin small letter eng","Latin small letter f with hook":"Latin small letter f with hook","Latin small letter g with breve":"Latin small letter g with breve","Latin small letter g with cedilla":"Latin small letter g with cedilla","Latin small letter g with circumflex":"Latin small letter g with circumflex","Latin small letter g with dot above":"Latin small letter g with dot above","Latin small letter h with circumflex":"Latin small letter h with circumflex","Latin small letter h with stroke":"Latin small letter h with stroke","Latin small letter i with breve":"Latin small letter i with breve","Latin small letter i with macron":"Latin small letter i with macron","Latin small letter i with ogonek":"Latin small letter i with ogonek","Latin small letter i with tilde":"Latin small letter i with tilde","Latin small letter j with circumflex":"Latin small letter j with circumflex","Latin small letter k with cedilla":"Latin small letter k with cedilla","Latin small letter kra":"Latin small letter kra","Latin small letter l with acute":"Latin small letter l with acute","Latin small letter l with caron":"Latin small letter l with caron","Latin small letter l with cedilla":"Latin small letter l with cedilla","Latin small letter l with middle dot":"Latin small letter l with middle dot","Latin small letter l with stroke":"Latin small letter l with stroke","Latin small letter long s":"Latin small letter long s","Latin small letter n preceded by apostrophe":"Latin small letter n preceded by apostrophe","Latin small letter n with acute":"Latin small letter n with acute","Latin small letter n with caron":"Latin small letter n with caron","Latin small letter n with cedilla":"Latin small letter n with cedilla","Latin small letter o with breve":"Latin small letter o with breve","Latin small letter o with double acute":"Latin small letter o with double acute","Latin small letter o with macron":"Latin small letter o with macron","Latin small letter r with acute":"Latin small letter r with acute","Latin small letter r with caron":"Latin small letter r with caron","Latin small letter r with cedilla":"Latin small letter r with cedilla","Latin small letter s with acute":"Latin small letter s with acute","Latin small letter s with caron":"Latin small letter s with caron","Latin small letter s with cedilla":"Latin small letter s with cedilla","Latin small letter s with circumflex":"Latin small letter s with circumflex","Latin small letter t with caron":"Latin small letter t with caron","Latin small letter t with cedilla":"Latin small letter t with cedilla","Latin small letter t with stroke":"Latin small letter t with stroke","Latin small letter u with breve":"Latin small letter u with breve","Latin small letter u with double acute":"Latin small letter u with double acute","Latin small letter u with macron":"Latin small letter u with macron","Latin small letter u with ogonek":"Latin small letter u with ogonek","Latin small letter u with ring above":"Latin small letter u with ring above","Latin small letter u with tilde":"Latin small letter u with tilde","Latin small letter w with circumflex":"Latin small letter w with circumflex","Latin small letter y with circumflex":"Latin small letter y with circumflex","Latin small letter z with acute":"Latin small letter z with acute","Latin small letter z with caron":"Latin small letter z with caron","Latin small letter z with dot above":"Latin small letter z with dot above","Latin small ligature ij":"Latin small ligature ij","Latin small ligature oe":"Latin small ligature oe","Left double quotation mark":"Left double quotation mark","Left single quotation mark":"Left single quotation mark","Left-pointing double angle quotation mark":"Left-pointing double angle quotation mark","leftwards arrow to bar":"leftwards arrow to bar","leftwards dashed arrow":"leftwards dashed arrow","leftwards double arrow":"leftwards double arrow","Less-than or equal to":"Less-than or equal to","Less-than sign":"Less-than sign","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey",Link:"Link","Link URL":"Link URL","Lira sign":"Lira sign","Livre tournois sign":"Livre tournois sign","Logical and":"Logical and","Logical or":"Logical or",Macron:"Macron","Manat sign":"Manat sign","Merge cell down":"Merge cell down","Merge cell left":"Merge cell left","Merge cell right":"Merge cell right","Merge cell up":"Merge cell up","Merge cells":"Merge cells","Mill sign":"Mill sign","Minus sign":"Minus sign","Multiplication sign":"Multiplication sign","N-ary product":"N-ary product","N-ary summation":"N-ary summation",Nabla:"Nabla","Naira sign":"Naira sign","New sheqel sign":"New sheqel sign",Next:"Next","Nordic mark sign":"Nordic mark sign","Not an element of":"Not an element of","Not equal to":"Not equal to","Not sign":"Not sign","Numbered List":"Numbered List","on with exclamation mark with left right arrow above":"on with exclamation mark with left right arrow above","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab",Orange:"Orange",Overline:"Overline",Paragraph:"Paragraph","Paragraph sign":"Paragraph sign","Partial differential":"Partial differential","Per mille sign":"Per mille sign","Per ten thousand sign":"Per ten thousand sign","Peseta sign":"Peseta sign","Peso sign":"Peso sign","Plus-minus sign":"Plus-minus sign","Pound sign":"Pound sign",Previous:"Previous","Proportional to":"Proportional to",Purple:"Purple","Question exclamation mark":"Question exclamation mark",Red:"Red",Redo:"Redo","Registered sign":"Registered sign","Reversed paragraph sign":"Reversed paragraph sign","Rich Text Editor":"Rich Text Editor","Rich Text Editor, %0":"Rich Text Editor, %0","Right double quotation mark":"Right double quotation mark","Right single quotation mark":"Right single quotation mark","Right-pointing double angle quotation mark":"Right-pointing double angle quotation mark","rightwards arrow to bar":"rightwards arrow to bar","rightwards dashed arrow":"rightwards dashed arrow","rightwards double arrow":"rightwards double arrow",Row:"Row","Ruble sign":"Ruble sign","Rupee sign":"Rupee sign",Save:"Save","Section sign":"Section sign","Select all":"Select all","Select column":"Select column","Select row":"Select row","Show more items":"Show more items","Single left-pointing angle quotation mark":"Single left-pointing angle quotation mark","Single low-9 quotation mark":"Single low-9 quotation mark","Single right-pointing angle quotation mark":"Single right-pointing angle quotation mark","soon with rightwards arrow above":"soon with rightwards arrow above","Special characters":"Special characters","Spesmilo sign":"Spesmilo sign","Split cell horizontally":"Split cell horizontally","Split cell vertically":"Split cell vertically","Square root":"Square root",Strikethrough:"Strikethrough","Table toolbar":"Table toolbar","Tenge sign":"Tenge sign","Text alternative":"Text alternative","There exists":"There exists","This link has no URL":"This link has no URL","Tilde operator":"Tilde operator","top with upwards arrow above":"top with upwards arrow above","Trade mark sign":"Trade mark sign","Tugrik sign":"Tugrik sign","Turkish lira sign":"Turkish lira sign",Turquoise:"Turquoise","Two dot leader":"Two dot leader",Undo:"Undo",Union:"Union",Unlink:"Unlink","up down arrow with base":"up down arrow with base","upwards arrow to bar":"upwards arrow to bar","upwards dashed arrow":"upwards dashed arrow","upwards double arrow":"upwards double arrow","Vulgar fraction one half":"Vulgar fraction one half","Vulgar fraction one quarter":"Vulgar fraction one quarter","Vulgar fraction three quarters":"Vulgar fraction three quarters",White:"White","Widget toolbar":"Widget toolbar","Won sign":"Won sign",Yellow:"Yellow","Yen sign":"Yen sign"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),
/*!
- * @license Copyright (c) 2003-2023, CKSource - Frederico Knabben. All rights reserved.
+ * @license Copyright (c) 2003-2024, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/
-function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.MarkdownEditor=e():t.MarkdownEditor=e()}(self,(function(){return(()=>{var t={3917:function(t){t.exports=function(){"use strict";function t(t,e){for(var i=0;it.length)&&(e=t.length);for(var i=0,r=new Array(e);i=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=t[Symbol.iterator]()).next.bind(r)}function o(t,e){return t(e={exports:{}},e.exports),e.exports}var s=o((function(t){function e(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function i(e){t.exports.defaults=e}t.exports={defaults:e(),getDefaults:e,changeDefaults:i}})),a=(s.defaults,s.getDefaults,s.changeDefaults,/[&<>"']/),c=/[&<>"']/g,l=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,d={"&":"&","<":"<",">":">",'"':""","'":"'"},u=function(t){return d[t]};function g(t,e){if(e){if(a.test(t))return t.replace(c,u)}else if(l.test(t))return t.replace(h,u);return t}var f=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function m(t){return t.replace(f,(function(t,e){return"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""}))}var p=/(^|[^\[])\^/g;function b(t,e){t=t.source||t,e=e||"";var i={replace:function(e,r){return r=(r=r.source||r).replace(p,"$1"),t=t.replace(e,r),i},getRegex:function(){return new RegExp(t,e)}};return i}var w=/[^\w:]/g,_=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function k(t,e,i){if(t){var r;try{r=decodeURIComponent(m(i)).replace(w,"").toLowerCase()}catch(t){return null}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return null}e&&!_.test(i)&&(i=C(e,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(t){return null}return i}var v={},y=/^[^:]+:\/*[^/]*$/,x=/^([^:]+:)[\s\S]*$/,A=/^([^:]+:\/*[^/]*)[\s\S]*$/;function C(t,e){v[" "+t]||(y.test(t)?v[" "+t]=t+"/":v[" "+t]=E(t,"/",!0));var i=-1===(t=v[" "+t]).indexOf(":");return"//"===e.substring(0,2)?i?e:t.replace(x,"$1")+e:"/"===e.charAt(0)?i?e:t.replace(A,"$1")+e:t+e}function T(t){for(var e,i,r=1;r=0&&"\\"===i[n];)r=!r;return r?"|":" |"})).split(/ \|/),r=0;if(i.length>e)i.splice(e);else for(;i.length=r.length?t.slice(r.length):t})).join("\n")}var z=function(){function t(t){this.options=t||O}var e=t.prototype;return e.space=function(t){var e=this.rules.block.newline.exec(t);if(e)return e[0].length>1?{type:"space",raw:e[0]}:{raw:"\n"}},e.code=function(t,e){var i=this.rules.block.code.exec(t);if(i){var r=e[e.length-1];if(r&&"paragraph"===r.type)return{raw:i[0],text:i[0].trimRight()};var n=i[0].replace(/^ {4}/gm,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?n:M(n,"\n")}}},e.fences=function(t){var e=this.rules.block.fences.exec(t);if(e){var i=e[0],r=B(i,e[3]||"");return{type:"code",raw:i,lang:e[2]?e[2].trim():e[2],text:r}}},e.heading=function(t){var e=this.rules.block.heading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[1].length,text:e[2]}},e.nptable=function(t){var e=this.rules.block.nptable.exec(t);if(e){var i={type:"table",header:N(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[],raw:e[0]};if(i.header.length===i.align.length){var r,n=i.align.length;for(r=0;r ?/gm,"");return{type:"blockquote",raw:e[0],text:i}}},e.list=function(t){var e=this.rules.block.list.exec(t);if(e){for(var i,r,n,o,s,a,c,l=e[0],h=e[2],d=h.length>1,u=")"===h[h.length-1],g={type:"list",raw:l,ordered:d,start:d?+h.slice(0,-1):"",loose:!1,items:[]},f=e[0].match(this.rules.block.item),m=!1,p=f.length,b=0;b1||this.options.smartLists&&n!==h)&&(o=f.slice(b+1).join("\n"),g.raw=g.raw.substring(0,g.raw.length-o.length),b=p-1)),s=m||/\n\n(?!\s*$)/.test(i),b!==p-1&&(m="\n"===i.charAt(i.length-1),s||(s=m)),s&&(g.loose=!0),c=void 0,(a=/^\[[ xX]\] /.test(i))&&(c=" "!==i[1],i=i.replace(/^\[[ xX]\] +/,"")),g.items.push({type:"list_item",raw:l,task:a,checked:c,loose:s,text:i});return g}},e.html=function(t){var e=this.rules.block.html.exec(t);if(e)return{type:this.options.sanitize?"paragraph":"html",raw:e[0],pre:!this.options.sanitizer&&("pre"===e[1]||"script"===e[1]||"style"===e[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):L(e[0]):e[0]}},e.def=function(t){var e=this.rules.block.def.exec(t);if(e)return e[3]&&(e[3]=e[3].substring(1,e[3].length-1)),{tag:e[1].toLowerCase().replace(/\s+/g," "),raw:e[0],href:e[2],title:e[3]}},e.table=function(t){var e=this.rules.block.table.exec(t);if(e){var i={type:"table",header:N(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[]};if(i.header.length===i.align.length){i.raw=e[0];var r,n=i.align.length;for(r=0;r/i.test(r[0])&&(e=!1),!i&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?i=!0:i&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(i=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:e,inRawBlock:i,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):L(r[0]):r[0]}},e.link=function(t){var e=this.rules.inline.link.exec(t);if(e){var i=V(e[2],"()");if(i>-1){var r=(0===e[0].indexOf("!")?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,r).trim(),e[3]=""}var n=e[2],o="";if(this.options.pedantic){var s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);s?(n=s[1],o=s[3]):o=""}else o=e[3]?e[3].slice(1,-1):"";return D(e,{href:(n=n.trim().replace(/^<([\s\S]*)>$/,"$1"))?n.replace(this.rules.inline._escapes,"$1"):n,title:o?o.replace(this.rules.inline._escapes,"$1"):o},e[0])}},e.reflink=function(t,e){var i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){var r=(i[2]||i[1]).replace(/\s+/g," ");if(!(r=e[r.toLowerCase()])||!r.href){var n=i[0].charAt(0);return{type:"text",raw:n,text:n}}return D(i,r,i[0])}},e.strong=function(t,e,i){void 0===i&&(i="");var r=this.rules.inline.strong.start.exec(t);if(r&&(!r[1]||r[1]&&(""===i||this.rules.inline.punctuation.exec(i)))){e=e.slice(-1*t.length);var n,o="**"===r[0]?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;for(o.lastIndex=0;null!=(r=o.exec(e));)if(n=this.rules.inline.strong.middle.exec(e.slice(0,r.index+3)))return{type:"strong",raw:t.slice(0,n[0].length),text:t.slice(2,n[0].length-2)}}},e.em=function(t,e,i){void 0===i&&(i="");var r=this.rules.inline.em.start.exec(t);if(r&&(!r[1]||r[1]&&(""===i||this.rules.inline.punctuation.exec(i)))){e=e.slice(-1*t.length);var n,o="*"===r[0]?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;for(o.lastIndex=0;null!=(r=o.exec(e));)if(n=this.rules.inline.em.middle.exec(e.slice(0,r.index+2)))return{type:"em",raw:t.slice(0,n[0].length),text:t.slice(1,n[0].length-1)}}},e.codespan=function(t){var e=this.rules.inline.code.exec(t);if(e){var i=e[2].replace(/\n/g," "),r=/[^ ]/.test(i),n=i.startsWith(" ")&&i.endsWith(" ");return r&&n&&(i=i.substring(1,i.length-1)),i=L(i,!0),{type:"codespan",raw:e[0],text:i}}},e.br=function(t){var e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}},e.del=function(t){var e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[1]}},e.autolink=function(t,e){var i,r,n=this.rules.inline.autolink.exec(t);if(n)return r="@"===n[2]?"mailto:"+(i=L(this.options.mangle?e(n[1]):n[1])):i=L(n[1]),{type:"link",raw:n[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}},e.url=function(t,e){var i;if(i=this.rules.inline.url.exec(t)){var r,n;if("@"===i[2])n="mailto:"+(r=L(this.options.mangle?e(i[0]):i[0]));else{var o;do{o=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0]}while(o!==i[0]);r=L(i[0]),n="www."===i[1]?"http://"+r:r}return{type:"link",raw:i[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}},e.inlineText=function(t,e,i){var r,n=this.rules.inline.text.exec(t);if(n)return r=e?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):L(n[0]):n[0]:L(this.options.smartypants?i(n[0]):n[0]),{type:"text",raw:n[0],text:r}},t}(),F=I.noopTest,q=I.edit,j=I.merge,$={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:F,table:F,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};$.def=q($.def).replace("label",$._label).replace("title",$._title).getRegex(),$.bullet=/(?:[*+-]|\d{1,9}[.)])/,$.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,$.item=q($.item,"gm").replace(/bull/g,$.bullet).getRegex(),$.list=q($.list).replace(/bull/g,$.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+$.def.source+")").getRegex(),$._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",$._comment=//,$.html=q($.html,"i").replace("comment",$._comment).replace("tag",$._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$.paragraph=q($._paragraph).replace("hr",$.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",$._tag).getRegex(),$.blockquote=q($.blockquote).replace("paragraph",$.paragraph).getRegex(),$.normal=j({},$),$.gfm=j({},$.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),$.gfm.nptable=q($.gfm.nptable).replace("hr",$.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",$._tag).getRegex(),$.gfm.table=q($.gfm.table).replace("hr",$.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",$._tag).getRegex(),$.pedantic=j({},$.normal,{html:q("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)| \\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",$._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:F,paragraph:q($.normal._paragraph).replace("hr",$.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",$.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var H={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:F,tag:"^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:F,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};H.punctuation=q(H.punctuation).replace(/punctuation/g,H._punctuation).getRegex(),H._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",H._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",H.em.start=q(H.em.start).replace(/punctuation/g,H._punctuation).getRegex(),H.em.middle=q(H.em.middle).replace(/punctuation/g,H._punctuation).replace(/overlapSkip/g,H._overlapSkip).getRegex(),H.em.endAst=q(H.em.endAst,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.em.endUnd=q(H.em.endUnd,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.strong.start=q(H.strong.start).replace(/punctuation/g,H._punctuation).getRegex(),H.strong.middle=q(H.strong.middle).replace(/punctuation/g,H._punctuation).replace(/blockSkip/g,H._blockSkip).getRegex(),H.strong.endAst=q(H.strong.endAst,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.strong.endUnd=q(H.strong.endUnd,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.blockSkip=q(H._blockSkip,"g").getRegex(),H.overlapSkip=q(H._overlapSkip,"g").getRegex(),H._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,H._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,H._email=/[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])?)+(?![-_])/,H.autolink=q(H.autolink).replace("scheme",H._scheme).replace("email",H._email).getRegex(),H._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,H.tag=q(H.tag).replace("comment",$._comment).replace("attribute",H._attribute).getRegex(),H._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,H._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,H._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,H.link=q(H.link).replace("label",H._label).replace("href",H._href).replace("title",H._title).getRegex(),H.reflink=q(H.reflink).replace("label",H._label).getRegex(),H.reflinkSearch=q(H.reflinkSearch,"g").replace("reflink",H.reflink).replace("nolink",H.nolink).getRegex(),H.normal=j({},H),H.pedantic=j({},H.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:q(/^!?\[(label)\]\((.*?)\)/).replace("label",H._label).getRegex(),reflink:q(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",H._label).getRegex()}),H.gfm=j({},H.normal,{escape:q(H.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),r+=""+i+";";return r}var Q=function(){function t(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||U,this.options.tokenizer=this.options.tokenizer||new z,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var e={block:K.normal,inline:G.normal};this.options.pedantic?(e.block=K.pedantic,e.inline=G.pedantic):this.options.gfm&&(e.block=K.gfm,this.options.breaks?e.inline=G.breaks:e.inline=G.gfm),this.tokenizer.rules=e}t.lex=function(e,i){return new t(i).lex(e)};var i=t.prototype;return i.lex=function(t){return t=t.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(t,this.tokens,!0),this.inline(this.tokens),this.tokens},i.blockTokens=function(t,e,i){var r,n,o,s;for(void 0===e&&(e=[]),void 0===i&&(i=!0),t=t.replace(/^ +$/gm,"");t;)if(r=this.tokenizer.space(t))t=t.substring(r.raw.length),r.type&&e.push(r);else if(r=this.tokenizer.code(t,e))t=t.substring(r.raw.length),r.type?e.push(r):((s=e[e.length-1]).raw+="\n"+r.raw,s.text+="\n"+r.text);else if(r=this.tokenizer.fences(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.heading(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.nptable(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.hr(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.blockquote(t))t=t.substring(r.raw.length),r.tokens=this.blockTokens(r.text,[],i),e.push(r);else if(r=this.tokenizer.list(t)){for(t=t.substring(r.raw.length),o=r.items.length,n=0;n0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(a));)c.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;t;)if(o=this.tokenizer.escape(t))t=t.substring(o.raw.length),e.push(o);else if(o=this.tokenizer.tag(t,i,r))t=t.substring(o.raw.length),i=o.inLink,r=o.inRawBlock,e.push(o);else if(o=this.tokenizer.link(t))t=t.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,r)),e.push(o);else if(o=this.tokenizer.reflink(t,this.tokens.links))t=t.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,r)),e.push(o);else if(o=this.tokenizer.strong(t,a,n))t=t.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],i,r),e.push(o);else if(o=this.tokenizer.em(t,a,n))t=t.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],i,r),e.push(o);else if(o=this.tokenizer.codespan(t))t=t.substring(o.raw.length),e.push(o);else if(o=this.tokenizer.br(t))t=t.substring(o.raw.length),e.push(o);else if(o=this.tokenizer.del(t))t=t.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],i,r),e.push(o);else if(o=this.tokenizer.autolink(t,Y))t=t.substring(o.raw.length),e.push(o);else if(i||!(o=this.tokenizer.url(t,Y))){if(o=this.tokenizer.inlineText(t,r,J))t=t.substring(o.raw.length),n=o.raw.slice(-1),e.push(o);else if(t){var l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}throw new Error(l)}}else t=t.substring(o.raw.length),e.push(o);return e},e(t,null,[{key:"rules",get:function(){return{block:K,inline:G}}}]),t}(),X=s.defaults,Z=I.cleanUrl,tt=I.escape,et=function(){function t(t){this.options=t||X}var e=t.prototype;return e.code=function(t,e,i){var r=(e||"").match(/\S*/)[0];if(this.options.highlight){var n=this.options.highlight(t,r);null!=n&&n!==t&&(i=!0,t=n)}return r?''+(i?t:tt(t,!0))+"
\n":""+(i?t:tt(t,!0))+"
\n"},e.blockquote=function(t){return"\n"+t+" \n"},e.html=function(t){return t},e.heading=function(t,e,i,r){return this.options.headerIds?"\n":""+t+" \n"},e.hr=function(){return this.options.xhtml?" \n":" \n"},e.list=function(t,e,i){var r=e?"ol":"ul";return"<"+r+(e&&1!==i?' start="'+i+'"':"")+">\n"+t+""+r+">\n"},e.listitem=function(t){return""+t+" \n"},e.checkbox=function(t){return" "},e.paragraph=function(t){return""+t+"
\n"},e.table=function(t,e){return e&&(e=""+e+" "),"\n"},e.tablerow=function(t){return"\n"+t+" \n"},e.tablecell=function(t,e){var i=e.header?"th":"td";return(e.align?"<"+i+' align="'+e.align+'">':"<"+i+">")+t+""+i+">\n"},e.strong=function(t){return""+t+" "},e.em=function(t){return""+t+" "},e.codespan=function(t){return""+t+"
"},e.br=function(){return this.options.xhtml?" ":" "},e.del=function(t){return""+t+""},e.link=function(t,e,i){if(null===(t=Z(this.options.sanitize,this.options.baseUrl,t)))return i;var r='"+i+" "},e.image=function(t,e,i){if(null===(t=Z(this.options.sanitize,this.options.baseUrl,t)))return i;var r=' ":">"},e.text=function(t){return t},t}(),it=function(){function t(){}var e=t.prototype;return e.strong=function(t){return t},e.em=function(t){return t},e.codespan=function(t){return t},e.del=function(t){return t},e.html=function(t){return t},e.text=function(t){return t},e.link=function(t,e,i){return""+i},e.image=function(t,e,i){return""+i},e.br=function(){return""},t}(),rt=function(){function t(){this.seen={}}return t.prototype.slug=function(t){var e=t.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(e)){var i=e;do{this.seen[i]++,e=i+"-"+this.seen[i]}while(this.seen.hasOwnProperty(e))}return this.seen[e]=0,e},t}(),nt=s.defaults,ot=I.unescape,st=function(){function t(t){this.options=t||nt,this.options.renderer=this.options.renderer||new et,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new it,this.slugger=new rt}t.parse=function(e,i){return new t(i).parse(e)};var e=t.prototype;return e.parse=function(t,e){void 0===e&&(e=!0);var i,r,n,o,s,a,c,l,h,d,u,g,f,m,p,b,w,_,k="",v=t.length;for(i=0;i0&&"text"===p.tokens[0].type?(p.tokens[0].text=_+" "+p.tokens[0].text,p.tokens[0].tokens&&p.tokens[0].tokens.length>0&&"text"===p.tokens[0].tokens[0].type&&(p.tokens[0].tokens[0].text=_+" "+p.tokens[0].tokens[0].text)):p.tokens.unshift({type:"text",text:_}):m+=_),m+=this.parse(p.tokens,f),h+=this.renderer.listitem(m,w,b);k+=this.renderer.list(h,u,g);continue;case"html":k+=this.renderer.html(d.text);continue;case"paragraph":k+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(h=d.tokens?this.parseInline(d.tokens):d.text;i+1An error occurred:
"+lt(t.message+"",!0)+" ";throw t}}return gt.options=gt.setOptions=function(t){return at(gt.defaults,t),dt(gt.defaults),gt},gt.getDefaults=ht,gt.defaults=ut,gt.use=function(t){var e=at({},t);if(t.renderer&&function(){var i=gt.defaults.renderer||new et,r=function(e){var r=i[e];i[e]=function(){for(var n=arguments.length,o=new Array(n),s=0;s{t.exports=".ck-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;margin-right:0;font-style:italic;border-left:5px solid #ccc}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}"},1785:t=>{t.exports='.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position{display:inline;position:relative;pointer-events:none}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{position:absolute;width:0}.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__selection-handle,.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__type-around{display:none}:root{--ck-clipboard-drop-target-dot-width:12px;--ck-clipboard-drop-target-dot-height:8px;--ck-clipboard-drop-target-color:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{bottom:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);top:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);border:1px solid var(--ck-clipboard-drop-target-color);background:var(--ck-clipboard-drop-target-color);margin-left:-1px}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span:after{content:"";width:0;height:0;display:block;position:absolute;left:50%;top:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);transform:translateX(-50%);border-left:calc(var(--ck-clipboard-drop-target-dot-width)*0.5) solid transparent;border-bottom:0 solid transparent;border-right:calc(var(--ck-clipboard-drop-target-dot-width)*0.5) solid transparent;border-top:calc(var(--ck-clipboard-drop-target-dot-height)) solid var(--ck-clipboard-drop-target-color)}.ck.ck-editor__editable .ck-widget.ck-clipboard-drop-target-range{outline:var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color)!important}.ck.ck-editor__editable .ck-widget:-webkit-drag{zoom:.6;outline:none!important}'},1422:t=>{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)}"},800:t=>{t.exports=".ck.ck-placeholder,.ck .ck-placeholder{position:relative}.ck.ck-placeholder:before,.ck .ck-placeholder:before{position:absolute;left:0;right:0;content:attr(data-placeholder);pointer-events:none}.ck.ck-read-only .ck-placeholder:before{display:none}.ck.ck-placeholder:before,.ck .ck-placeholder:before{cursor:text;color:var(--ck-color-engine-placeholder-text)}"},2616:t=>{t.exports=".ck.ck-editor__editable span[data-ck-hidden]{display:none}"},8945:t=>{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}"},6650:t=>{t.exports=".ck-content .image{display:table;clear:both;text-align:center;margin:.9em auto;min-width:50px}.ck-content .image img{display:block;margin:0 auto;max-width:100%;min-width:100%}.ck-content .image-inline{display:inline-flex;max-width:100%;align-items:flex-start}.ck-content .image-inline picture{display:flex}.ck-content .image-inline img,.ck-content .image-inline picture{flex-grow:1;flex-shrink:1;max-width:100%}.ck.ck-editor__editable .image>figcaption.ck-placeholder:before{padding-left:inherit;padding-right:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ck.ck-editor__editable .image-inline.ck-widget_selected,.ck.ck-editor__editable .image.ck-widget_selected{z-index:1}.ck.ck-editor__editable .image-inline.ck-widget_selected ::selection{display:none}.ck.ck-editor__editable td .image-inline img,.ck.ck-editor__editable th .image-inline img{max-width:none}"},5396:t=>{t.exports=".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-field-view{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}"},273:t=>{t.exports=".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-link_selected span.image-inline{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{height:100%;border-right:1px solid var(--ck-color-base-text);margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}"},1323:t=>{t.exports=".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.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 .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}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{min-width:0;max-width:100%}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview),[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}}"},8283:t=>{t.exports=".ck.ck-link-form{display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form_layout-vertical .ck-button.ck-button-cancel,.ck.ck-link-form_layout-vertical .ck-button.ck-button-save{margin-top:var(--ck-spacing-medium)}.ck.ck-link-form_layout-vertical{padding:0;min-width:var(--ck-input-text-width)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical .ck-button{padding:var(--ck-spacing-standard);margin:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border);width:50%}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button,[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin:var(--ck-spacing-standard) var(--ck-spacing-large)}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{border:0;padding:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}"},5743:t=>{t.exports=":root{--ck-color-mention-background:rgba(153,0,48,0.1);--ck-color-mention-text:#990030}.ck-content .mention{background:var(--ck-color-mention-background);color:var(--ck-color-mention-text)}"},5137:t=>{t.exports=":root{--ck-mention-list-max-height:300px}.ck.ck-mentions{max-height:var(--ck-mention-list-max-height);overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain}.ck.ck-mentions>.ck-list__item{overflow:hidden;flex-shrink:0}"},2957:t=>{t.exports=".ck.ck-character-grid{max-width:100%}.ck.ck-character-grid .ck-character-grid__tiles{display:grid}:root{--ck-character-grid-tile-size:24px}.ck.ck-character-grid{overflow-y:auto;overflow-x:hidden;width:350px;max-height:200px}.ck.ck-character-grid .ck-character-grid__tiles{grid-template-columns:repeat(auto-fit,minmax(var(--ck-character-grid-tile-size),1fr));margin:var(--ck-spacing-standard) var(--ck-spacing-large);grid-gap:var(--ck-spacing-standard)}.ck.ck-character-grid .ck-character-grid__tile{width:var(--ck-character-grid-tile-size);height:var(--ck-character-grid-tile-size);min-width:var(--ck-character-grid-tile-size);min-height:var(--ck-character-grid-tile-size);font-size:1.2em;padding:0;transition:box-shadow .2s ease;border:0}.ck.ck-character-grid .ck-character-grid__tile:focus:not(.ck-disabled),.ck.ck-character-grid .ck-character-grid__tile:hover:not(.ck-disabled){border:0;box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-character-grid .ck-character-grid__tile .ck-button__label{line-height:var(--ck-character-grid-tile-size);width:100%;text-align:center}"},1287:t=>{t.exports=".ck.ck-character-info{display:flex;justify-content:space-between;padding:var(--ck-spacing-small) var(--ck-spacing-large);border-top:1px solid var(--ck-color-base-border)}.ck.ck-character-info>*{text-transform:uppercase;font-size:var(--ck-font-size-small)}.ck.ck-character-info .ck-character-info__name{max-width:280px;text-overflow:ellipsis;overflow:hidden}.ck.ck-character-info .ck-character-info__code{opacity:.6}"},3779:t=>{t.exports=".ck.ck-special-characters-navigation>.ck-label{max-width:160px;text-overflow:ellipsis;overflow:hidden}.ck.ck-special-characters-navigation>.ck-dropdown .ck-dropdown__panel{max-height:250px;overflow-y:auto;overflow-x:hidden}"},9582:t=>{t.exports=".ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}: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 .ck-insert-table-dropdown__grid{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-color-base-border);border-radius:1px}.ck .ck-insert-table-dropdown-grid-box.ck-on{border-color:var(--ck-color-focus-border);background:var(--ck-color-focus-outer-shadow)}"},6654:t=>{t.exports=".ck-content .table{margin:.9em auto;display:table}.ck-content .table table{border-collapse:collapse;border-spacing:0;width:100%;height:100%;border:1px double #b3b3b3}.ck-content .table table td,.ck-content .table table th{min-width:2em;padding:.4em;border:1px solid #bfbfbf}.ck-content .table table th{font-weight:700;background:hsla(0,0%,0%,5%)}.ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}.ck-editor__editable .ck-table-bogus-paragraph{display:inline-block;width:100%}"},1285:t=>{t.exports=":root{--ck-color-table-focused-cell-background:rgba(158,207,250,0.3)}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table td.ck-editor__nested-editable:focus,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable:focus{background:var(--ck-color-table-focused-cell-background);border-style:none;outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}"},7519:t=>{t.exports=':root{--ck-table-selected-cell-background:rgba(158,207,250,0.3)}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{position:relative;caret-color:transparent;outline:unset;box-shadow:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected:after,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:after{content:"";pointer-events:none;background-color:var(--ck-table-selected-cell-background);position:absolute;top:0;left:0;right:0;bottom:0}.ck.ck-editor__editable .table table td.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table td.ck-editor__editable_selected:focus,.ck.ck-editor__editable .table table th.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:focus{background-color:transparent}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget{outline:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle{display:none}'},3081:t=>{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__label,a.ck.ck-button .ck-button__label{display:none}.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:focus:not(:hover) .ck-tooltip,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,border .2s ease-in-out;-webkit-appearance:none}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0}.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}[dir=ltr] .ck.ck-button .ck-button__label,[dir=ltr] a.ck.ck-button .ck-button__label{text-align:left}[dir=rtl] .ck.ck-button .ck-button__label,[dir=rtl] a.ck.ck-button .ck-button__label{text-align:right}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{color:inherit}[dir=ltr] .ck.ck-button .ck-button__keystroke,[dir=ltr] a.ck.ck-button .ck-button__keystroke{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-button .ck-button__keystroke,[dir=rtl] a.ck.ck-button .ck-button__keystroke{margin-right:var(--ck-spacing-large)}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{font-weight:700;opacity:.7}.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-disabled .ck-button__keystroke,a.ck.ck-button.ck-disabled .ck-button__keystroke{opacity:.3}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}[dir=ltr] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=ltr] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=rtl] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-right:calc(var(--ck-spacing-small)*-1);margin-left:var(--ck-spacing-small)}.ck.ck-button.ck-button_with-keystroke .ck-button__label,a.ck.ck-button.ck-button_with-keystroke .ck-button__label{flex-grow:1}.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-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}"},6869:t=>{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-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - var(--ck-switch-button-toggle-spacing)*2)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(var(--ck-spacing-large)*2)}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(var(--ck-spacing-large)*2)}.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)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-right:auto}.ck.ck-button.ck-switchbutton .ck-button__toggle{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(var(--ck-border-radius)*0.5)}.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:all .3s ease}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover{background:var(--ck-color-switch-button-off-hover-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover .ck-button__toggle__inner{box-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.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:hover{background:var(--ck-color-switch-button-on-hover-background)}[dir=ltr] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(var(--ck-switch-button-translation))}[dir=rtl] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(calc(var(--ck-switch-button-translation)*-1))}"},8717:t=>{t.exports=".ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#000}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{width:var(--ck-color-grid-tile-size);height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);padding:0;transition:box-shadow .2s ease;border:0}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile.ck-color-table__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.ck.ck-color-grid__tile .ck.ck-icon{display:none;color:var(--ck-color-color-grid-check-icon)}.ck.ck-color-grid__tile.ck-on{box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-base-text)}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__tile.ck-on,.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){border:0}.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}"},4479:t=>{t.exports=":root{--ck-dropdown-max-width:75vw}.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);max-width:var(--ck-dropdown-max-width);position:absolute}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{top:100%;bottom:auto}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s{left:50%;transform:translateX(-50%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw{left:75%;transform:translateX(-75%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme{left:25%;transform:translateX(-25%)}.ck.ck-toolbar .ck-dropdown__panel{z-index:calc(var(--ck-z-modal) + 1)}:root{--ck-dropdown-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-dropdown .ck-dropdown__arrow{right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-dropdown .ck-dropdown__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{width:7em;overflow:hidden;text-overflow:ellipsis}.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-dropdown__button_label-width_auto .ck-button__label{width:auto}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active{box-shadow:none}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active:focus,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-dropdown__panel{border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dropdown__panel{box-shadow:var(--ck-drop-shadow),0 0;background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;min-width:100%}.ck.ck-dropdown__panel.ck-dropdown__panel_se{border-top-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_sw{border-top-right-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_ne{border-bottom-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_nw{border-bottom-right-radius:0}"},257:t=>{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}"},4963:t=>{t.exports='.ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button .ck-tooltip{display:none}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-top-right-radius:unset;border-bottom-right-radius:unset}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-top-left-radius:unset;border-bottom-left-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow{min-width:unset}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-top-left-radius:unset;border-bottom-left-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-top-right-radius:unset;border-bottom-right-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow svg{width:var(--ck-dropdown-arrow-size)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover),.ck.ck-splitbutton:hover>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover){background:var(--ck-color-split-button-hover-background)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{content:"";position:absolute;width:1px;height:100%;background-color:var(--ck-color-split-button-hover-border)}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{left:-1px}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{right:-1px}.ck.ck-splitbutton.ck-splitbutton_open{border-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__action{border-bottom-left-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__arrow{border-bottom-right-radius:0}'},894:t=>{t.exports=":root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown>.ck-dropdown__panel{width:max-content;max-width:var(--ck-toolbar-dropdown-max-width)}.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}"},1786:t=>{t.exports=":root{--ck-color-editable-blur-selection:#d9d9d9}.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[dir=ltr]{text-align:left}.ck.ck-editor__editable_inline[dir=rtl]{text-align:right}.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-editor__editable_inline.ck-blurred ::selection{background:var(--ck-color-editable-blur-selection)}.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)}"},3869:t=>{t.exports=".ck.ck-form__header{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between}:root{--ck-form-header-height:38px}.ck.ck-form__header{padding:var(--ck-spacing-small) var(--ck-spacing-large);height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-form__header .ck-form__header__label{font-weight:700}"},4473:t=>{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 :not([fill]){fill:currentColor}"},4661:t=>{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{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:box-shadow .1s ease-in-out,border .1s ease-in-out}.ck.ck-input-text:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0}.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),0 0}.ck.ck-input-text.ck-error{border-color:var(--ck-color-input-error-border);animation:ck-text-input-shake .3s ease both}.ck.ck-input-text.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),0 0}@keyframes ck-text-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}"},6735:t=>{t.exports=".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"},3259:t=>{t.exports=".ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}.ck.ck-labeled-field-view .ck.ck-label{display:block;position:absolute}:root{--ck-labeled-field-view-transition:.1s cubic-bezier(0,0,0.24,0.95);--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-spacing-medium);--ck-color-labeled-field-label-background:var(--ck-color-base-background)}.ck.ck-labeled-field-view{border-radius:0}.ck-rounded-corners .ck.ck-labeled-field-view,.ck.ck-labeled-field-view.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{width:100%}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{top:0}[dir=ltr] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{left:0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{pointer-events:none;transform-origin:0 0;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);background:var(--ck-color-labeled-field-label-background);padding:0 calc(var(--ck-font-size-tiny)*0.5);line-height:normal;font-weight:400;text-overflow:ellipsis;overflow:hidden;max-width:100%;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}.ck.ck-labeled-field-view.ck-error .ck-input:not([readonly])+.ck.ck-label,.ck.ck-labeled-field-view.ck-error>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status.ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-input-disabled-text)}[dir=ltr] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=ltr] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(var(--ck-spacing-medium),calc(var(--ck-font-size-base)*0.6)) scale(1)}[dir=rtl] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=rtl] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(calc(var(--ck-spacing-medium)*-1),calc(var(--ck-font-size-base)*0.6)) scale(1)}.ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));background:transparent;padding:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck.ck-button{background:transparent}.ck.ck-labeled-field-view.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck-button>.ck-button__label{opacity:0}.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown+.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard))}"},5057:t=>{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;padding:calc(var(--ck-line-height-base)*0.2*var(--ck-font-size-base)) calc(var(--ck-line-height-base)*0.4*var(--ck-font-size-base))}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(var(--ck-line-height-base)*1.2*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:active{box-shadow:none}.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:focus:not(.ck-disabled){border-color:var(--ck-color-base-background)}.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)}"},6140:t=>{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-balloon-arrow-drop-shadow:0 2px 2px var(--ck-color-shadow-drop)}.ck.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{width:0;height:0;border-style:solid}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:var(--ck-balloon-arrow-height);border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:0}.ck.ck-balloon-panel[class*=arrow_n]:before{border-bottom-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-color:transparent;border-right-color:transparent;border-top-color:transparent}.ck.ck-balloon-panel[class*=arrow_n]:after{border-bottom-color:var(--ck-color-panel-background);margin-top:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:0;border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-top-color:var(--ck-color-panel-border);filter:drop-shadow(var(--ck-balloon-arrow-drop-shadow))}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent}.ck.ck-balloon-panel[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background);margin-bottom:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.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(var(--ck-balloon-arrow-half-width)*-1);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{right:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{right:25%;margin-right:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{right:25%;margin-right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}'},2747:t=>{t.exports=".ck .ck-balloon-rotator__navigation{display:flex;align-items:center;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-small)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}"},3715:t=>{t.exports=".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-modal) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{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);border-radius:var(--ck-border-radius);width:100%;height:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}"},151:t=>{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}"},9972:t=>{t.exports='.ck-vertical-form .ck-button:after{content:"";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{content:"";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-text-width)*0.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-large);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after,[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}'},6438:t=>{t.exports=".ck.ck-block-toolbar-button{position:absolute;z-index:var(--ck-z-default)}:root{--ck-color-block-toolbar-button:var(--ck-color-text);--ck-block-toolbar-button-size:var(--ck-font-size-normal)}.ck.ck-block-toolbar-button{color:var(--ck-color-block-toolbar-button);font-size:var(--ck-block-toolbar-size)}"},168:t=>{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 nowrap;align-items:center}.ck.ck-toolbar>.ck-toolbar__items{display:flex;flex-flow:row wrap;align-items:center;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar .ck-toolbar__line-break{flex-basis:100%}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.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 .ck.ck-toolbar__separator{align-self:stretch;width:1px;min-width:1px;background:var(--ck-color-toolbar-border);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar .ck-toolbar__line-break{height:0}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break){margin-right:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items:empty+.ck.ck-toolbar__separator{display:none}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break),.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{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>.ck-toolbar__items>.ck{width:100%;margin:0;border-radius:0;border:0}.ck.ck-toolbar.ck-toolbar_compact{padding:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>*{margin:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>:not(:first-child):not(:last-child){border-radius:0}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck{margin-right:0}.ck.ck-toolbar[dir=rtl]:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-left:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-right:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-right:var(--ck-spacing-small)}"},2614:t=>{t.exports='.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck.ck-tooltip{visibility:hidden;opacity:0;display:none;z-index:var(--ck-z-modal)}.ck.ck-tooltip .ck-tooltip__text{display:inline-block}.ck.ck-tooltip .ck-tooltip__text:after{content:"";width:0;height:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%;top:0;transition:opacity .2s ease-in-out .2s}.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{transition:opacity .2s ease-in-out .2s;border-style:solid;left:50%}.ck.ck-tooltip.ck-tooltip_s,.ck.ck-tooltip.ck-tooltip_se,.ck.ck-tooltip.ck-tooltip_sw{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{top:calc(var(--ck-tooltip-arrow-size)*-1 + 1px);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:var(--ck-color-tooltip-background);border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:0}.ck.ck-tooltip.ck-tooltip_sw{right:50%;left:auto}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text{left:auto;right:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{left:auto;right:0}.ck.ck-tooltip.ck-tooltip_se{left:50%;right:auto}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text{right:auto;left:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after{right:auto;left:0;transform:translateX(50%)}.ck.ck-tooltip.ck-tooltip_n{top:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;border-top-color:var(--ck-color-tooltip-background);border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:0;border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_e{left:calc(100% + var(--ck-tooltip-arrow-size));top:50%}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text:after{left:calc(var(--ck-tooltip-arrow-size)*-1);top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:transparent;border-bottom-color:transparent;border-right-color:var(--ck-color-tooltip-background);border-top-color:transparent;border-left-width:0;border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_w{right:calc(100% + var(--ck-tooltip-arrow-size));left:auto;top:50%}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text:after{left:100%;top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:var(--ck-color-tooltip-background);border-bottom-color:transparent;border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:0;border-top-width:var(--ck-tooltip-arrow-size)}'},4777:t=>{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-transitions-disabled,.ck-transitions-disabled *{transition:none!important}:root{--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#c4c4c4;--ck-color-base-action:#61b045;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#198cf0;--ck-color-base-active-focus:#0e7fe1;--ck-color-base-error:#db3700;--ck-color-focus-border-coordinates:208,79%,51%;--ck-color-focus-border:hsl(var(--ck-color-focus-border-coordinates));--ck-color-focus-outer-shadow:#bcdefb;--ck-color-focus-disabled-shadow:rgba(119,186,248,0.3);--ck-color-focus-error-shadow:rgba(255,64,31,0.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,0.15);--ck-color-shadow-drop-active:rgba(0,0,0,0.2);--ck-color-shadow-inner:rgba(0,0,0,0.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#e6e6e6;--ck-color-button-default-active-background:#d9d9d9;--ck-color-button-default-active-shadow:#bfbfbf;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#dedede;--ck-color-button-on-hover-background:#c4c4c4;--ck-color-button-on-active-background:#bababa;--ck-color-button-on-active-shadow:#a1a1a1;--ck-color-button-on-disabled-background:#dedede;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#579e3d;--ck-color-button-action-active-background:#53973b;--ck-color-button-action-active-shadow:#498433;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#b0b0b0;--ck-color-switch-button-off-hover-background:#a3a3a3;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-on-hover-background:#579e3d;--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-switch-button-inner-shadow:rgba(0,0,0,0.1);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:#c7c7c7;--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:#c7c7c7;--ck-color-input-disabled-text:#757575;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-base-active);--ck-color-list-button-on-background-focus:var(--ck-color-base-active-focus);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-foreground);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,177,255,0.1);--ck-color-link-fake-selection:rgba(31,177,255,0.3);--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-outer-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{margin:0;padding:0;border:0;background:transparent;text-decoration:none;vertical-align:middle;transition:none;word-wrap:break-word}.ck.ck-reset_all,.ck.ck-reset_all *{border-collapse:collapse;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);color:var(--ck-color-text);text-align:left;white-space:nowrap;cursor:auto;float:none}.ck.ck-reset_all .ck-rtl *{text-align:right}.ck.ck-reset_all iframe{vertical-align:inherit}.ck.ck-reset_all textarea{white-space:pre-wrap}.ck.ck-reset_all input[type=password],.ck.ck-reset_all input[type=text],.ck.ck-reset_all textarea{cursor:text}.ck.ck-reset_all input[type=password][disabled],.ck.ck-reset_all input[type=text][disabled],.ck.ck-reset_all textarea[disabled]{cursor:default}.ck.ck-reset_all fieldset{padding:10px;border:2px groove #dfdee3}.ck.ck-reset_all button::-moz-focus-inner{padding:0;border:0}.ck[dir=rtl],.ck[dir=rtl] .ck{text-align:right}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}"},2900:t=>{t.exports=":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2;--ck-resizer-border-radius:var(--ck-border-radius);--ck-resizer-tooltip-offset:10px;--ck-resizer-tooltip-height:calc(var(--ck-spacing-small)*2 + 10px)}.ck .ck-widget,.ck .ck-widget.ck-widget_with-selection-handle{position:relative}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{position:absolute}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{visibility:visible}.ck .ck-size-view{background:var(--ck-color-resizer-tooltip-background);color:var(--ck-color-resizer-tooltip-text);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);font-size:var(--ck-font-size-tiny);display:block;padding:0 var(--ck-spacing-small);height:var(--ck-resizer-tooltip-height);line-height:var(--ck-resizer-tooltip-height)}.ck .ck-size-view.ck-orientation-above-center,.ck .ck-size-view.ck-orientation-bottom-left,.ck .ck-size-view.ck-orientation-bottom-right,.ck .ck-size-view.ck-orientation-top-left,.ck .ck-size-view.ck-orientation-top-right{position:absolute}.ck .ck-size-view.ck-orientation-top-left{top:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{top:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-right{bottom:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-left{bottom:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-above-center{top:calc(var(--ck-resizer-tooltip-height)*-1);left:50%;transform:translate(-50%)}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{outline-width:var(--ck-widget-outline-thickness);outline-style:solid;outline-color:transparent;transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;background-color:var(--ck-color-widget-editable-focus-background)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{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));top:0}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{width:var(--ck-widget-handler-icon-size);height:var(--ck-widget-handler-icon-size);color:var(--ck-color-widget-drag-handler-icon-color)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-focus-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:1}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck.ck-editor__editable.ck-read-only .ck-widget{transition:none}.ck.ck-editor__editable.ck-read-only .ck-widget:not(.ck-widget_selected){--ck-widget-outline-thickness:0px}.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}"},1163:t=>{t.exports=".ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;position:absolute;pointer-events:none;left:0;top:0}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{position:absolute;pointer-events:all}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{cursor:nesw-resize}:root{--ck-resizer-size:10px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-border-width:1px}.ck .ck-widget__resizer{outline:1px solid var(--ck-color-resizer)}.ck .ck-widget__resizer__handle{width:var(--ck-resizer-size);height:var(--ck-resizer-size);background:var(--ck-color-focus-border);border:var(--ck-resizer-border-width) solid #fff;border-radius:var(--ck-resizer-border-radius)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{top:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{top:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}"},3228:t=>{t.exports='.ck .ck-widget .ck-widget__type-around__button{display:block;position:absolute;overflow:hidden;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{position:absolute;top:50%;left:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{top:calc(var(--ck-widget-outline-thickness)*-0.5);left:min(10%,30px);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-0.5);right:min(10%,30px);transform:translateY(50%)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{content:"";display:block;position:absolute;top:1px;left:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;position:absolute;left:0;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{top:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none}:root{--ck-widget-type-around-button-size:20px;--ck-color-widget-type-around-button-active:var(--ck-color-focus-border);--ck-color-widget-type-around-button-hover:var(--ck-color-widget-hover-border);--ck-color-widget-type-around-button-blurred-editable:var(--ck-color-widget-blurred-border);--ck-color-widget-type-around-button-radar-start-alpha:0;--ck-color-widget-type-around-button-radar-end-alpha:.3;--ck-color-widget-type-around-button-icon:var(--ck-color-base-background)}.ck .ck-widget .ck-widget__type-around__button{width:var(--ck-widget-type-around-button-size);height:var(--ck-widget-type-around-button-size);background:var(--ck-color-widget-type-around-button);border-radius:100px;transition:opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);opacity:0;pointer-events:none}.ck .ck-widget .ck-widget__type-around__button svg{width:10px;height:8px;transform:translate(-50%,-50%);transition:transform .5s ease;margin-top:1px}.ck .ck-widget .ck-widget__type-around__button svg *{stroke-dasharray:10;stroke-dashoffset:0;fill:none;stroke:var(--ck-color-widget-type-around-button-icon);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.ck .ck-widget .ck-widget__type-around__button svg line{stroke-dasharray:7}.ck .ck-widget .ck-widget__type-around__button:hover{animation:ck-widget-type-around-button-sonar 1s ease infinite}.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:ck-widget-type-around-arrow-dash 2s linear}.ck .ck-widget .ck-widget__type-around__button:hover svg line{animation:ck-widget-type-around-arrow-tip-dash 2s linear}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:1;pointer-events:auto}.ck .ck-widget:not(.ck-widget_selected)>.ck-widget__type-around>.ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button-hover)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover{background:var(--ck-color-widget-type-around-button-active)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{width:calc(var(--ck-widget-type-around-button-size) - 2px);height:calc(var(--ck-widget-type-around-button-size) - 2px);border-radius:100px;background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3))}.ck .ck-widget.ck-widget_with-selection-handle>.ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:20px}.ck .ck-widget .ck-widget__type-around__fake-caret{pointer-events:none;height:1px;animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;outline:1px solid hsla(0,0%,100%,.5);background:var(--ck-color-base-text)}.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_after,.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_before{outline-color:transparent}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected:hover,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:0}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer{opacity:0}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:0;margin-right:20px}.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover){background:var(--ck-color-widget-type-around-button-blurred-editable)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover) svg *{stroke:#999}@keyframes ck-widget-type-around-arrow-dash{0%{stroke-dashoffset:10}20%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-arrow-tip-dash{0%,20%{stroke-dashoffset:7}40%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-button-sonar{0%{box-shadow:0 0 0 0 hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}50%{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-end-alpha))}to{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}}@keyframes ck-widget-type-around-fake-caret-pulse{0%{opacity:1}49%{opacity:1}50%{opacity:0}99%{opacity:0}to{opacity:1}}'},321:(t,e,i)=>{var r=i(6062),n=i(2333);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},901:(t,e,i)=>{var r=i(6062),n=i(1785);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},6045:(t,e,i)=>{var r=i(6062),n=i(1422);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},3047:(t,e,i)=>{var r=i(6062),n=i(800);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},9835:(t,e,i)=>{var r=i(6062),n=i(2616);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},6846:(t,e,i)=>{var r=i(6062),n=i(8945);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},4364:(t,e,i)=>{var r=i(6062),n=i(6650);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},758:(t,e,i)=>{var r=i(6062),n=i(5396);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},1306:(t,e,i)=>{var r=i(6062),n=i(273);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},554:(t,e,i)=>{var r=i(6062),n=i(1323);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},7512:(t,e,i)=>{var r=i(6062),n=i(8283);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},2647:(t,e,i)=>{var r=i(6062),n=i(5743);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},1310:(t,e,i)=>{var r=i(6062),n=i(5137);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},1626:(t,e,i)=>{var r=i(6062),n=i(2957);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},191:(t,e,i)=>{var r=i(6062),n=i(1287);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},6434:(t,e,i)=>{var r=i(6062),n=i(3779);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},28:(t,e,i)=>{var r=i(6062),n=i(9582);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},4567:(t,e,i)=>{var r=i(6062),n=i(6654);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},3275:(t,e,i)=>{var r=i(6062),n=i(1285);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},5873:(t,e,i)=>{var r=i(6062),n=i(7519);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},9852:(t,e,i)=>{var r=i(6062),n=i(3081);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},285:(t,e,i)=>{var r=i(6062),n=i(6869);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},218:(t,e,i)=>{var r=i(6062),n=i(8717);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},6775:(t,e,i)=>{var r=i(6062),n=i(4479);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},9607:(t,e,i)=>{var r=i(6062),n=i(257);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},8295:(t,e,i)=>{var r=i(6062),n=i(4963);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},6390:(t,e,i)=>{var r=i(6062),n=i(894);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},996:(t,e,i)=>{var r=i(6062),n=i(1786);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},9350:(t,e,i)=>{var r=i(6062),n=i(3869);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},7835:(t,e,i)=>{var r=i(6062),n=i(4473);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},5728:(t,e,i)=>{var r=i(6062),n=i(4661);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},480:(t,e,i)=>{var r=i(6062),n=i(6735);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},5872:(t,e,i)=>{var r=i(6062),n=i(3259);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},2547:(t,e,i)=>{var r=i(6062),n=i(5057);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},2653:(t,e,i)=>{var r=i(6062),n=i(6140);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},5165:(t,e,i)=>{var r=i(6062),n=i(2747);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},3423:(t,e,i)=>{var r=i(6062),n=i(3715);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},7372:(t,e,i)=>{var r=i(6062),n=i(151);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},49:(t,e,i)=>{var r=i(6062),n=i(9972);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},7964:(t,e,i)=>{var r=i(6062),n=i(6438);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},3171:(t,e,i)=>{var r=i(6062),n=i(168);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},9314:(t,e,i)=>{var r=i(6062),n=i(2614);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},7770:(t,e,i)=>{var r=i(6062),n=i(4777);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},4936:(t,e,i)=>{var r=i(6062),n=i(2900);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},353:(t,e,i)=>{var r=i(6062),n=i(1163);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},2928:(t,e,i)=>{var r=i(6062),n=i(3228);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.id,n,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(n,o);t.exports=n.locals||{}},6062:(t,e,i)=>{"use strict";var r,n=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var t={};return function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}t[e]=i}return t[e]}}(),s=[];function a(t){for(var e=-1,i=0;i{"use strict";i.d(e,{default:()=>Q_});const r=function(){return function t(){t.called=!0}};class n{constructor(t,e){this.source=t,this.name=e,this.path=[],this.stop=r(),this.off=r()}}const o=new Array(256).fill().map(((t,e)=>("0"+e.toString(16)).slice(-2)));function s(){const t=4294967296*Math.random()>>>0,e=4294967296*Math.random()>>>0,i=4294967296*Math.random()>>>0,r=4294967296*Math.random()>>>0;return"e"+o[t>>0&255]+o[t>>8&255]+o[t>>16&255]+o[t>>24&255]+o[e>>0&255]+o[e>>8&255]+o[e>>16&255]+o[e>>24&255]+o[i>>0&255]+o[i>>8&255]+o[i>>16&255]+o[i>>24&255]+o[r>>0&255]+o[r>>8&255]+o[r>>16&255]+o[r>>24&255]}const a={get(t){return"number"!=typeof t?this[t]||this.normal:t},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};class c extends Error{constructor(t,e,i){super(function(t,e){const i=new WeakSet,r=(t,e)=>{if("object"==typeof e&&null!==e){if(i.has(e))return`[object ${e.constructor.name}]`;i.add(e)}return e},n=e?` ${JSON.stringify(e,r)}`:"",o=h(t);return t+n+o}(t,i)),this.name="CKEditorError",this.context=e,this.data=i}is(t){return"CKEditorError"===t}static rethrowUnexpectedError(t,e){if(t.is&&t.is("CKEditorError"))throw t;const i=new c(t.message,e);throw i.stack=t.stack,i}}function l(t,e){console.warn(...d(t,e))}function h(t){return`\nRead more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-${t}`}function d(t,e){const i=h(t);return e?[t,e,i]:[t,i]}const u="31.0.0",g="object"==typeof window?window:i.g;if(g.CKEDITOR_VERSION)throw new c("ckeditor-duplicated-modules",null);g.CKEDITOR_VERSION=u;const f=Symbol("listeningTo"),m=Symbol("emitterId"),p={on(t,e,i={}){this.listenTo(this,t,e,i)},once(t,e,i){let r=!1;this.listenTo(this,t,(function(t,...i){r||(r=!0,t.off(),e.call(this,t,...i))}),i)},off(t,e){this.stopListening(this,t,e)},listenTo(t,e,i,r={}){let n,o;this[f]||(this[f]={});const s=this[f];w(t)||b(t);const a=w(t);(n=s[a])||(n=s[a]={emitter:t,callbacks:{}}),(o=n.callbacks[e])||(o=n.callbacks[e]=[]),o.push(i),function(t,e,i,r,n){e._addEventListener?e._addEventListener(i,r,n):t._addEventListener.call(e,i,r,n)}(this,t,e,i,r)},stopListening(t,e,i){const r=this[f];let n=t&&w(t);const o=r&&n&&r[n],s=o&&e&&o.callbacks[e];if(!(!r||t&&!o||e&&!s))if(i){x(this,t,e,i);-1!==s.indexOf(i)&&(1===s.length?delete o.callbacks[e]:x(this,t,e,i))}else if(s){for(;i=s.pop();)x(this,t,e,i);delete o.callbacks[e]}else if(o){for(e in o.callbacks)this.stopListening(t,e);delete r[n]}else{for(n in r)this.stopListening(r[n].emitter);delete this[f]}},fire(t,...e){try{const i=t instanceof n?t:new n(this,t),r=i.name;let o=v(this,r);if(i.path.push(this),o){const t=[i,...e];o=Array.from(o);for(let e=0;e{this._delegations||(this._delegations=new Map),t.forEach((t=>{const r=this._delegations.get(t);r?r.set(e,i):this._delegations.set(t,new Map([[e,i]]))}))}}},stopDelegating(t,e){if(this._delegations)if(t)if(e){const i=this._delegations.get(t);i&&i.delete(e)}else this._delegations.delete(t);else this._delegations.clear()},_addEventListener(t,e,i){!function(t,e){const i=_(t);if(i[e])return;let r=e,n=null;const o=[];for(;""!==r&&!i[r];)i[r]={callbacks:[],childEvents:[]},o.push(i[r]),n&&i[r].childEvents.push(n),n=r,r=r.substr(0,r.lastIndexOf(":"));if(""!==r){for(const t of o)t.callbacks=i[r].callbacks.slice();i[r].childEvents.push(n)}}(this,t);const r=k(this,t),n=a.get(i.priority),o={callback:e,priority:n};for(const t of r){let e=!1;for(let i=0;i-1?v(t,e.substr(0,e.lastIndexOf(":"))):null}function y(t,e,i){for(let[r,o]of t){o?"function"==typeof o&&(o=o(e.name)):o=e.name;const t=new n(e.source,o);t.path=[...e.path],r.fire(t,...i)}}function x(t,e,i,r){e._removeEventListener?e._removeEventListener(i,r):t._removeEventListener.call(e,i,r)}const A=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};const C="object"==typeof global&&global&&global.Object===Object&&global;var T="object"==typeof self&&self&&self.Object===Object&&self;const P=C||T||Function("return this")();const E=P.Symbol;var S=Object.prototype,R=S.hasOwnProperty,I=S.toString,O=E?E.toStringTag:void 0;const M=function(t){var e=R.call(t,O),i=t[O];try{t[O]=void 0;var r=!0}catch(t){}var n=I.call(t);return r&&(e?t[O]=i:delete t[O]),n};var N=Object.prototype.toString;const L=function(t){return N.call(t)};var V=E?E.toStringTag:void 0;const D=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":V&&V in Object(t)?M(t):L(t)};const B=function(t){if(!A(t))return!1;var e=D(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e};const z=P["__core-js_shared__"];var F=function(){var t=/[^.]+$/.exec(z&&z.keys&&z.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();const q=function(t){return!!F&&F in t};var j=Function.prototype.toString;const $=function(t){if(null!=t){try{return j.call(t)}catch(t){}try{return t+""}catch(t){}}return""};var H=/^\[object .+?Constructor\]$/,W=Function.prototype,U=Object.prototype,K=W.toString,G=U.hasOwnProperty,J=RegExp("^"+K.call(G).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Y=function(t){return!(!A(t)||q(t))&&(B(t)?J:H).test($(t))};const Q=function(t,e){return null==t?void 0:t[e]};const X=function(t,e){var i=Q(t,e);return Y(i)?i:void 0};const Z=function(){try{var t=X(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();const tt=function(t,e,i){"__proto__"==e&&Z?Z(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i};const et=function(t,e){return t===e||t!=t&&e!=e};var it=Object.prototype.hasOwnProperty;const rt=function(t,e,i){var r=t[e];it.call(t,e)&&et(r,i)&&(void 0!==i||e in t)||tt(t,e,i)};const nt=function(t,e,i,r){var n=!i;i||(i={});for(var o=-1,s=e.length;++o0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}};const gt=ut(ht);const ft=function(t,e){return gt(ct(t,e,ot),t+"")};const mt=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};const pt=function(t){return null!=t&&mt(t.length)&&!B(t)};var bt=/^(?:0|[1-9]\d*)$/;const wt=function(t,e){var i=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==i||"symbol"!=i&&bt.test(t))&&t>-1&&t%1==0&&t1?i[n-1]:void 0,s=n>2?i[2]:void 0;for(o=t.length>3&&"function"==typeof o?(n--,o):void 0,s&&_t(i[0],i[1],s)&&(o=n<3?void 0:o,n=1),e=Object(e);++r{this.set(e,t[e])}),this);se(this);const i=this[Zt];if(t in this&&!i.has(t))throw new c("observable-set-cannot-override",this);Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get:()=>i.get(t),set(e){const r=i.get(t);let n=this.fire("set:"+t,t,e,r);void 0===n&&(n=e),r===n&&i.has(t)||(i.set(t,n),this.fire("change:"+t,t,n,r))}}),this[t]=e},bind(...t){if(!t.length||!le(t))throw new c("observable-bind-wrong-properties",this);if(new Set(t).size!==t.length)throw new c("observable-bind-duplicate-properties",this);se(this);const e=this[ee];t.forEach((t=>{if(e.has(t))throw new c("observable-bind-rebind",this)}));const i=new Map;return t.forEach((t=>{const r={property:t,to:[]};e.set(t,r),i.set(t,r)})),{to:ae,toMany:ce,_observable:this,_bindProperties:t,_to:[],_bindings:i}},unbind(...t){if(!this[Zt])return;const e=this[ee],i=this[te];if(t.length){if(!le(t))throw new c("observable-unbind-wrong-properties",this);t.forEach((t=>{const r=e.get(t);if(!r)return;let n,o,s,a;r.to.forEach((t=>{n=t[0],o=t[1],s=i.get(n),a=s[o],a.delete(r),a.size||delete s[o],Object.keys(s).length||(i.delete(n),this.stopListening(n,"change"))})),e.delete(t)}))}else i.forEach(((t,e)=>{this.stopListening(e,"change")})),i.clear(),e.clear()},decorate(t){const e=this[t];if(!e)throw new c("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:t});this.on(t,((t,i)=>{t.return=e.apply(this,i)})),this[t]=function(...e){return this.fire(t,e)},this[t][re]=e,this[ie]||(this[ie]=[]),this[ie].push(t)}};Xt(ne,p),ne.stopListening=function(t,e,i){if(!t&&this[ie]){for(const t of this[ie])this[t]=this[t][re];delete this[ie]}p.stopListening.call(this,t,e,i)};const oe=ne;function se(t){t[Zt]||(Object.defineProperty(t,Zt,{value:new Map}),Object.defineProperty(t,te,{value:new Map}),Object.defineProperty(t,ee,{value:new Map}))}function ae(...t){const e=function(...t){if(!t.length)throw new c("observable-bind-to-parse-error",null);const e={to:[]};let i;"function"==typeof t[t.length-1]&&(e.callback=t.pop());return t.forEach((t=>{if("string"==typeof t)i.properties.push(t);else{if("object"!=typeof t)throw new c("observable-bind-to-parse-error",null);i={observable:t,properties:[]},e.to.push(i)}})),e}(...t),i=Array.from(this._bindings.keys()),r=i.length;if(!e.callback&&e.to.length>1)throw new c("observable-bind-to-no-callback",this);if(r>1&&e.callback)throw new c("observable-bind-to-extra-callback",this);var n;e.to.forEach((t=>{if(t.properties.length&&t.properties.length!==r)throw new c("observable-bind-to-properties-length",this);t.properties.length||(t.properties=this._bindProperties)})),this._to=e.to,e.callback&&(this._bindings.get(i[0]).callback=e.callback),n=this._observable,this._to.forEach((t=>{const e=n[te];let i;e.get(t.observable)||n.listenTo(t.observable,"change",((r,o)=>{i=e.get(t.observable)[o],i&&i.forEach((t=>{he(n,t.property)}))}))})),function(t){let e;t._bindings.forEach(((i,r)=>{t._to.forEach((n=>{e=n.properties[i.callback?0:t._bindProperties.indexOf(r)],i.to.push([n.observable,e]),function(t,e,i,r){const n=t[te],o=n.get(i),s=o||{};s[r]||(s[r]=new Set);s[r].add(e),o||n.set(i,s)}(t._observable,i,n.observable,e)}))}))}(this),this._bindProperties.forEach((t=>{he(this._observable,t)}))}function ce(t,e,i){if(this._bindings.size>1)throw new c("observable-bind-to-many-not-one-binding",this);this.to(...function(t,e){const i=t.map((t=>[t,e]));return Array.prototype.concat.apply([],i)}(t,e),i)}function le(t){return t.every((t=>"string"==typeof t))}function he(t,e){const i=t[ee].get(e);let r;i.callback?r=i.callback.apply(t,i.to.map((t=>t[0][t[1]]))):(r=i.to[0],r=r[0][r[1]]),Object.prototype.hasOwnProperty.call(t,e)?t[e]=r:t.set(e,r)}function de(t,...e){e.forEach((e=>{Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e)).forEach((i=>{if(i in t.prototype)return;const r=Object.getOwnPropertyDescriptor(e,i);r.enumerable=!1,Object.defineProperty(t.prototype,i,r)}))}))}class ue{constructor(t){this.editor=t,this.set("isEnabled",!0),this._disableStack=new Set}forceDisabled(t){this._disableStack.add(t),1==this._disableStack.size&&(this.on("set:isEnabled",ge,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(t){this._disableStack.delete(t),0==this._disableStack.size&&(this.off("set:isEnabled",ge),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}function ge(t){t.return=!1,t.stop()}de(ue,oe);class fe{constructor(t){this.editor=t,this.set("value",void 0),this.set("isEnabled",!1),this.affectsData=!0,this._disableStack=new Set,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,i)=>{i&&this.affectsData?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}))}refresh(){this.isEnabled=!0}forceDisabled(t){this._disableStack.add(t),1==this._disableStack.size&&(this.on("set:isEnabled",me,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(t){this._disableStack.delete(t),0==this._disableStack.size&&(this.off("set:isEnabled",me),this.refresh())}execute(){}destroy(){this.stopListening()}}function me(t){t.return=!1,t.stop()}de(fe,oe);class pe extends fe{constructor(t){super(t),this._childCommands=[]}refresh(){}execute(...t){const e=this._getFirstEnabledCommand();return null!=e&&e.execute(t)}registerChildCommand(t){this._childCommands.push(t),t.on("change:isEnabled",(()=>this._checkEnabled())),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){return this._childCommands.find((t=>t.isEnabled))}}const be=function(t,e){return function(i){return t(e(i))}};const we=be(Object.getPrototypeOf,Object);var _e=Function.prototype,ke=Object.prototype,ve=_e.toString,ye=ke.hasOwnProperty,xe=ve.call(Object);const Ae=function(t){if(!yt(t)||"[object Object]"!=D(t))return!1;var e=we(t);if(null===e)return!0;var i=ye.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&ve.call(i)==xe};const Ce=function(){this.__data__=[],this.size=0};const Te=function(t,e){for(var i=t.length;i--;)if(et(t[i][0],e))return i;return-1};var Pe=Array.prototype.splice;const Ee=function(t){var e=this.__data__,i=Te(e,t);return!(i<0)&&(i==e.length-1?e.pop():Pe.call(e,i,1),--this.size,!0)};const Se=function(t){var e=this.__data__,i=Te(e,t);return i<0?void 0:e[i][1]};const Re=function(t){return Te(this.__data__,t)>-1};const Ie=function(t,e){var i=this.__data__,r=Te(i,t);return r<0?(++this.size,i.push([t,e])):i[r][1]=e,this};function Oe(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e{this._setToTarget(t,r,e[r],i)}))}}function xr(t){return kr(t,Ar)}function Ar(t){return vr(t)?t:void 0}function Cr(t){return!(!t||!t[Symbol.iterator])}class Tr{constructor(t={},e={}){const i=Cr(t);if(i||(e=t),this._items=[],this._itemMap=new Map,this._idProperty=e.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],i)for(const e of t)this._items.push(e),this._itemMap.set(this._getItemIdBeforeAdding(e),e)}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){return this.addMany([t],e)}addMany(t,e){if(void 0===e)e=this._items.length;else if(e>this._items.length||e<0)throw new c("collection-add-item-invalid-index",this);for(let i=0;i{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,i=(i,r,n)=>{const o=e._bindToCollection==this,s=e._bindToInternalToExternalMap.get(r);if(o&&s)this._bindToExternalToInternalMap.set(r,s),this._bindToInternalToExternalMap.set(s,r);else{const i=t(r);if(!i)return void this._skippedIndexesFromExternal.push(n);let o=n;for(const t of this._skippedIndexesFromExternal)n>t&&o--;for(const t of e._skippedIndexesFromExternal)o>=t&&o++;this._bindToExternalToInternalMap.set(r,i),this._bindToInternalToExternalMap.set(i,r),this.add(i,o);for(let t=0;t{const r=this._bindToExternalToInternalMap.get(e);r&&this.remove(r),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce(((t,e)=>(ie&&t.push(e),t)),[])}))}_getItemIdBeforeAdding(t){const e=this._idProperty;let i;if(e in t){if(i=t[e],"string"!=typeof i)throw new c("collection-add-invalid-id",this);if(this.get(i))throw new c("collection-add-item-already-exists",this)}else t[e]=i=s();return i}_remove(t){let e,i,r,n=!1;const o=this._idProperty;if("string"==typeof t?(i=t,r=this._itemMap.get(i),n=!r,r&&(e=this._items.indexOf(r))):"number"==typeof t?(e=t,r=this._items[e],n=!r,r&&(i=r[o])):(r=t,i=r[o],e=this._items.indexOf(r),n=-1==e||!this._itemMap.get(i)),n)throw new c("collection-remove-404",this);this._items.splice(e,1),this._itemMap.delete(i);const s=this._bindToInternalToExternalMap.get(r);return this._bindToInternalToExternalMap.delete(r),this._bindToExternalToInternalMap.delete(s),this.fire("remove",r,e),[r,e]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}de(Tr,p);class Pr{constructor(t,e=[],i=[]){this._context=t,this._plugins=new Map,this._availablePlugins=new Map;for(const t of e)t.pluginName&&this._availablePlugins.set(t.pluginName,t);this._contextPlugins=new Map;for(const[t,e]of i)this._contextPlugins.set(t,e),this._contextPlugins.set(e,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){const e=this._plugins.get(t);if(!e){let e=t;throw"function"==typeof t&&(e=t.pluginName||t.name),new c("plugincollection-plugin-not-loaded",this._context,{plugin:e})}return e}has(t){return this._plugins.has(t)}init(t,e=[],i=[]){const r=this,n=this._context;!function t(e,i=new Set){e.forEach((e=>{a(e)&&(i.has(e)||(i.add(e),e.pluginName&&!r._availablePlugins.has(e.pluginName)&&r._availablePlugins.set(e.pluginName,e),e.requires&&t(e.requires,i)))}))}(t),u(t);const o=[...function t(e,i=new Set){return e.map((t=>a(t)?t:r._availablePlugins.get(t))).reduce(((e,r)=>i.has(r)?e:(i.add(r),r.requires&&(u(r.requires,r),t(r.requires,i).forEach((t=>e.add(t)))),e.add(r))),new Set)}(t.filter((t=>!h(t,e))))];!function(t,e){for(const i of e){if("function"!=typeof i)throw new c("plugincollection-replace-plugin-invalid-type",null,{pluginItem:i});const e=i.pluginName;if(!e)throw new c("plugincollection-replace-plugin-missing-name",null,{pluginItem:i});if(i.requires&&i.requires.length)throw new c("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:e});const n=r._availablePlugins.get(e);if(!n)throw new c("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:e});const o=t.indexOf(n);if(-1===o){if(r._contextPlugins.has(n))return;throw new c("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:e})}if(n.requires&&n.requires.length)throw new c("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:e});t.splice(o,1,i),r._availablePlugins.set(e,i)}}(o,i);const s=function(t){return t.map((t=>{const e=r._contextPlugins.get(t)||new t(n);return r._add(t,e),e}))}(o);return g(s,"init").then((()=>g(s,"afterInit"))).then((()=>s));function a(t){return"function"==typeof t}function l(t){return a(t)&&t.isContextPlugin}function h(t,e){return e.some((e=>e===t||(d(t)===e||d(e)===t)))}function d(t){return a(t)?t.pluginName||t.name:t}function u(t,i=null){t.map((t=>a(t)?t:r._availablePlugins.get(t)||t)).forEach((t=>{!function(t,e){if(a(t))return;if(e)throw new c("plugincollection-soft-required",n,{missingPlugin:t,requiredBy:d(e)});throw new c("plugincollection-plugin-not-found",n,{plugin:t})}(t,i),function(t,e){if(!l(e))return;if(l(t))return;throw new c("plugincollection-context-required",n,{plugin:d(t),requiredBy:d(e)})}(t,i),function(t,i){if(!i)return;if(!h(t,e))return;throw new c("plugincollection-required",n,{plugin:d(t),requiredBy:d(i)})}(t,i)}))}function g(t,e){return t.reduce(((t,i)=>i[e]?r._contextPlugins.has(i)?t:t.then(i[e].bind(i)):t),Promise.resolve())}}destroy(){const t=[];for(const[,e]of this)"function"!=typeof e.destroy||this._contextPlugins.has(e)||t.push(e.destroy());return Promise.all(t)}_add(t,e){this._plugins.set(t,e);const i=t.pluginName;if(i){if(this._plugins.has(i))throw new c("plugincollection-plugin-name-conflict",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:t});this._plugins.set(i,e)}}}function Er(t){return Array.isArray(t)?t:[t]}function Sr(t,e,i=1){if("number"!=typeof i)throw new c("translation-service-quantity-not-a-number",null,{quantity:i});const r=Object.keys(window.CKEDITOR_TRANSLATIONS).length;1===r&&(t=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]);const n=e.id||e.string;if(0===r||!function(t,e){return!!window.CKEDITOR_TRANSLATIONS[t]&&!!window.CKEDITOR_TRANSLATIONS[t].dictionary[e]}(t,n))return 1!==i?e.plural:e.string;const o=window.CKEDITOR_TRANSLATIONS[t].dictionary,s=window.CKEDITOR_TRANSLATIONS[t].getPluralForm||(t=>1===t?0:1);if("string"==typeof o[n])return o[n];const a=Number(s(i));return o[n][a]}de(Pr,p),window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={});const Rr=["ar","ara","fa","per","fas","he","heb","ku","kur","ug","uig"];function Ir(t){return Rr.includes(t)?"rtl":"ltr"}class Or{constructor(t={}){this.uiLanguage=t.uiLanguage||"en",this.contentLanguage=t.contentLanguage||this.uiLanguage,this.uiLanguageDirection=Ir(this.uiLanguage),this.contentLanguageDirection=Ir(this.contentLanguage),this.t=(t,e)=>this._t(t,e)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(t,e=[]){e=Er(e),"string"==typeof t&&(t={string:t});const i=!!t.plural?e[0]:1;return function(t,e){return t.replace(/%(\d+)/g,((t,i)=>it.destroy()))).then((()=>this.plugins.destroy()))}_addEditor(t,e){if(this._contextOwner)throw new c("context-addeditor-private-context");this.editors.add(t),e&&(this._contextOwner=t)}_removeEditor(t){return this.editors.has(t)&&this.editors.remove(t),this._contextOwner===t?this.destroy():Promise.resolve()}_getEditorConfig(){const t={};for(const e of this.config.names())["plugins","removePlugins","extraPlugins"].includes(e)||(t[e]=this.config.get(e));return t}static create(t){return new Promise((e=>{const i=new this(t);e(i.initPlugins().then((()=>i)))}))}}function Nr(t,e){const i=Math.min(t.length,e.length);for(let r=0;rt.data.length)throw new c("view-textproxy-wrong-offsetintext",this);if(i<0||e+i>t.data.length)throw new c("view-textproxy-wrong-length",this);this.data=t.data.substring(e,e+i),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||"view:$textProxy"===t||"textProxy"===t||"view:textProxy"===t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let i=t.includeSelf?this.textNode:this.parent;for(;null!==i;)e[t.parentFirst?"push":"unshift"](i),i=i.parent;return e}}function zr(t){return Cr(t)?new Map(t):function(t){const e=new Map;for(const i in t)e.set(i,t[i]);return e}(t)}class Fr{constructor(...t){this._patterns=[],this.add(...t)}add(...t){for(let e of t)("string"==typeof e||e instanceof RegExp)&&(e={name:e}),this._patterns.push(e)}match(...t){for(const e of t)for(const t of this._patterns){const i=qr(e,t);if(i)return{element:e,pattern:t,match:i}}return null}matchAll(...t){const e=[];for(const i of t)for(const t of this._patterns){const r=qr(i,t);r&&e.push({element:i,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 qr(t,e){if("function"==typeof e)return e(t);const i={};return e.name&&(i.name=function(t,e){if(t instanceof RegExp)return!!e.match(t);return t===e}(e.name,t.name),!i.name)||e.attributes&&(i.attributes=function(t,e){const i=new Set(e.getAttributeKeys());Ae(t)?(void 0!==t.style&&l("matcher-pattern-deprecated-attributes-style-key",t),void 0!==t.class&&l("matcher-pattern-deprecated-attributes-class-key",t)):(i.delete("style"),i.delete("class"));return jr(t,i,(t=>e.getAttribute(t)))}(e.attributes,t),!i.attributes)?null:!(e.classes&&(i.classes=function(t,e){return jr(t,e.getClassNames())}(e.classes,t),!i.classes))&&(!(e.styles&&(i.styles=function(t,e){return jr(t,e.getStyleNames(!0),(t=>e.getStyle(t)))}(e.styles,t),!i.styles))&&i)}function jr(t,e,i){const r=function(t){if(Array.isArray(t))return t.map((t=>Ae(t)?(void 0!==t.key&&void 0!==t.value||l("matcher-pattern-missing-key-or-value",t),[t.key,t.value]):[t,!0]));if(Ae(t))return Object.entries(t);return[[t,!0]]}(t),n=Array.from(e),o=[];return r.forEach((([t,e])=>{n.forEach((r=>{(function(t,e){return!0===t||t===e||t instanceof RegExp&&e.match(t)})(t,r)&&function(t,e,i){if(!0===t)return!0;const r=i(e);return t===r||t instanceof RegExp&&!!String(r).match(t)}(e,r,i)&&o.push(r)}))})),!r.length||o.lengthn?0:n+e),(i=i>n?n:i)<0&&(i+=n),n=e>i?0:i-e>>>0,e>>>=0;for(var o=Array(n);++re===t));return Array.isArray(e)}set(t,e){if(A(t))for(const[e,i]of Object.entries(t))this._styleProcessor.toNormalizedForm(e,i,this._styles);else this._styleProcessor.toNormalizedForm(t,e,this._styles)}remove(t){const e=Tn(t);un(this._styles,e),delete this._styles[t],this._cleanEmptyObjectsOnPath(e)}getNormalized(t){return this._styleProcessor.getNormalized(t,this._styles)}toString(){return this.isEmpty?"":this._getStylesEntries().map((t=>t.join(":"))).sort().join(";")+";"}getAsString(t){if(this.isEmpty)return;if(this._styles[t]&&!A(this._styles[t]))return this._styles[t];const e=this._styleProcessor.getReducedForm(t,this._styles).find((([e])=>e===t));return Array.isArray(e)?e[1]:void 0}getStyleNames(t=!1){if(this.isEmpty)return[];if(t)return this._styleProcessor.getStyleNames(this._styles);return this._getStylesEntries().map((([t])=>t))}clear(){this._styles={}}_getStylesEntries(){const t=[],e=Object.keys(this._styles);for(const i of e)t.push(...this._styleProcessor.getReducedForm(i,this._styles));return t}_cleanEmptyObjectsOnPath(t){const e=t.split(".");if(!(e.length>1))return;const i=e.splice(0,e.length-1).join("."),r=gn(this._styles,i);if(!r)return;!Array.from(Object.keys(r)).length&&this.remove(i)}}class Cn{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(t,e,i){if(A(e))Pn(i,Tn(t),e);else if(this._normalizers.has(t)){const r=this._normalizers.get(t),{path:n,value:o}=r(e);Pn(i,n,o)}else Pn(i,t,e)}getNormalized(t,e){if(!t)return vn({},e);if(void 0!==e[t])return e[t];if(this._extractors.has(t)){const i=this._extractors.get(t);if("string"==typeof i)return gn(e,i);const r=i(t,e);if(r)return r}return gn(e,Tn(t))}getReducedForm(t,e){const i=this.getNormalized(t,e);if(void 0===i)return[];if(this._reducers.has(t)){return this._reducers.get(t)(i)}return[[t,i]]}getStyleNames(t){const e=Array.from(this._consumables.keys()).filter((e=>{const i=this.getNormalized(e,t);return i&&"object"==typeof i?Object.keys(i).length:i})),i=new Set([...e,...Object.keys(t)]);return Array.from(i.values())}getRelatedStyles(t){return this._consumables.get(t)||[]}setNormalizer(t,e){this._normalizers.set(t,e)}setExtractor(t,e){this._extractors.set(t,e)}setReducer(t,e){this._reducers.set(t,e)}setStyleRelation(t,e){this._mapStyleNames(t,e);for(const i of e)this._mapStyleNames(i,[t])}_mapStyleNames(t,e){this._consumables.has(t)||this._consumables.set(t,[]),this._consumables.get(t).push(...e)}}function Tn(t){return t.replace("-",".")}function Pn(t,e,i){let r=i;A(i)&&(r=vn({},gn(t,e),i)),xn(t,e,r)}class En extends Vr{constructor(t,e,i,r){if(super(t),this.name=e,this._attrs=function(t){t=zr(t);for(const[e,i]of t)null===i?t.delete(e):"string"!=typeof i&&t.set(e,String(i));return t}(i),this._children=[],r&&this._insertChild(0,r),this._classes=new Set,this._attrs.has("class")){const t=this._attrs.get("class");Sn(this._classes,t),this._attrs.delete("class")}this._styles=new An(this.document.stylesProcessor),this._attrs.has("style")&&(this._styles.setTo(this._attrs.get("style")),this._attrs.delete("style")),this._customProperties=new Map,this._isAllowedInsideAttributeElement=!1}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}get isAllowedInsideAttributeElement(){return this._isAllowedInsideAttributeElement}is(t,e=null){return e?e===this.name&&("element"===t||"view:element"===t):"element"===t||"view:element"===t||"node"===t||"view:node"===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.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(t){if("class"==t)return this._classes.size>0?[...this._classes].join(" "):void 0;if("style"==t){const t=this._styles.toString();return""==t?void 0:t}return this._attrs.get(t)}hasAttribute(t){return"class"==t?this._classes.size>0:"style"==t?!this._styles.isEmpty:this._attrs.has(t)}isSimilar(t){if(!(t instanceof En))return!1;if(this===t)return!0;if(this.name!=t.name)return!1;if(this.isAllowedInsideAttributeElement!=t.isAllowedInsideAttributeElement)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,i]of this._attrs)if(!t._attrs.has(e)||t._attrs.get(e)!==i)return!1;for(const e of this._classes)if(!t._classes.has(e))return!1;for(const e of this._styles.getStyleNames())if(!t._styles.has(e)||t._styles.getAsString(e)!==this._styles.getAsString(e))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.getAsString(t)}getNormalizedStyle(t){return this._styles.getNormalized(t)}getStyleNames(t=!1){return this._styles.getStyleNames(t)}hasStyle(...t){for(const e of t)if(!this._styles.has(e))return!1;return!0}findAncestor(...t){const e=new Fr(...t);let i=this.parent;for(;i;){if(e.match(i))return i;i=i.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=this._styles.toString(),i=Array.from(this._attrs).map((t=>`${t[0]}="${t[1]}"`)).sort().join(" ");return this.name+(""==t?"":` class="${t}"`)+(e?` style="${e}"`:"")+(""==i?"":` ${i}`)}_clone(t=!1){const e=[];if(t)for(const i of this.getChildren())e.push(i._clone(t));const i=new this.constructor(this.document,this.name,this._attrs,e);return i._classes=new Set(this._classes),i._styles.set(this._styles.getNormalized()),i._customProperties=new Map(this._customProperties),i.getFillerOffset=this.getFillerOffset,i._isAllowedInsideAttributeElement=this.isAllowedInsideAttributeElement,i}_appendChild(t){return this._insertChild(this.childCount,t)}_insertChild(t,e){this._fireChange("children",this);let i=0;const r=function(t,e){if("string"==typeof e)return[new Dr(t,e)];Cr(e)||(e=[e]);return Array.from(e).map((e=>"string"==typeof e?new Dr(t,e):e instanceof Br?new Dr(t,e.data):e))}(this.document,e);for(const e of r)null!==e.parent&&e._remove(),e.parent=this,e.document=this.document,this._children.splice(t,0,e),t++,i++;return i}_removeChildren(t,e=1){this._fireChange("children",this);for(let i=t;i0&&(this._classes.clear(),!0):"style"==t?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(t)}_addClass(t){this._fireChange("attributes",this);for(const e of Er(t))this._classes.add(e)}_removeClass(t){this._fireChange("attributes",this);for(const e of Er(t))this._classes.delete(e)}_setStyle(t,e){this._fireChange("attributes",this),this._styles.set(t,e)}_removeStyle(t){this._fireChange("attributes",this);for(const e of Er(t))this._styles.remove(e)}_setCustomProperty(t,e){this._customProperties.set(t,e)}_removeCustomProperty(t){return this._customProperties.delete(t)}}function Sn(t,e){const i=e.split(/\s+/);t.clear(),i.forEach((e=>t.add(e)))}class Rn extends En{constructor(t,e,i,r){super(t,e,i,r),this.getFillerOffset=In}is(t,e=null){return e?e===this.name&&("containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}}function In(){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}class On extends Rn{constructor(t,e,i,r){super(t,e,i,r),this.set("isReadOnly",!1),this.set("isFocused",!1),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}))}is(t,e=null){return e?e===this.name&&("editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}destroy(){this.stopListening()}}de(On,oe);const Mn=Symbol("rootName");class Nn extends On{constructor(t,e){super(t,e),this.rootName="main"}is(t,e=null){return e?e===this.name&&("rootElement"===t||"view:rootElement"===t||"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"rootElement"===t||"view:rootElement"===t||"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}get rootName(){return this.getCustomProperty(Mn)}set rootName(t){this._setCustomProperty(Mn,t)}set _name(t){this.name=t}}class Ln{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new c("view-tree-walker-no-start-position",null);if(t.direction&&"forward"!=t.direction&&"backward"!=t.direction)throw new c("view-tree-walker-unknown-direction",t.startPosition,{direction:t.direction});this.boundaries=t.boundaries||null,t.startPosition?this.position=Vn._createAt(t.startPosition):this.position=Vn._createAt(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,i,r;do{r=this.position,({done:e,value:i}=this.next())}while(!e&&t(i));e||(this.position=r)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let t=this.position.clone();const e=this.position,i=t.parent;if(null===i.parent&&t.offset===i.childCount)return{done:!0};if(i===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};let r;if(i instanceof Dr){if(t.isAtEnd)return this.position=Vn._createAfter(i),this._next();r=i.data[t.offset]}else r=i.getChild(t.offset);if(r instanceof En)return this.shallow?t.offset++:t=new Vn(r,0),this.position=t,this._formatReturnValue("elementStart",r,e,t,1);if(r instanceof Dr){if(this.singleCharacters)return t=new Vn(r,0),this.position=t,this._next();{let i,n=r.data.length;return r==this._boundaryEndParent?(n=this.boundaries.end.offset,i=new Br(r,0,n),t=Vn._createAfter(i)):(i=new Br(r,0,r.data.length),t.offset++),this.position=t,this._formatReturnValue("text",i,e,t,n)}}if("string"==typeof r){let r;if(this.singleCharacters)r=1;else{r=(i===this._boundaryEndParent?this.boundaries.end.offset:i.data.length)-t.offset}const n=new Br(i,t.offset,r);return t.offset+=r,this.position=t,this._formatReturnValue("text",n,e,t,r)}return t=Vn._createAfter(i),this.position=t,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",i,e,t)}_previous(){let t=this.position.clone();const e=this.position,i=t.parent;if(null===i.parent&&0===t.offset)return{done:!0};if(i==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0};let r;if(i instanceof Dr){if(t.isAtStart)return this.position=Vn._createBefore(i),this._previous();r=i.data[t.offset-1]}else r=i.getChild(t.offset-1);if(r instanceof En)return this.shallow?(t.offset--,this.position=t,this._formatReturnValue("elementStart",r,e,t,1)):(t=new Vn(r,r.childCount),this.position=t,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",r,e,t));if(r instanceof Dr){if(this.singleCharacters)return t=new Vn(r,r.data.length),this.position=t,this._previous();{let i,n=r.data.length;if(r==this._boundaryStartParent){const e=this.boundaries.start.offset;i=new Br(r,e,r.data.length-e),n=i.data.length,t=Vn._createBefore(i)}else i=new Br(r,0,r.data.length),t.offset--;return this.position=t,this._formatReturnValue("text",i,e,t,n)}}if("string"==typeof r){let r;if(this.singleCharacters)r=1;else{const e=i===this._boundaryStartParent?this.boundaries.start.offset:0;r=t.offset-e}t.offset-=r;const n=new Br(i,t.offset,r);return this.position=t,this._formatReturnValue("text",n,e,t,r)}return t=Vn._createBefore(i),this.position=t,this._formatReturnValue("elementStart",i,e,t,1)}_formatReturnValue(t,e,i,r,n){return e instanceof Br&&(e.offsetInText+e.data.length==e.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?i=Vn._createAfter(e.textNode):(r=Vn._createAfter(e.textNode),this.position=r)),0===e.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?i=Vn._createBefore(e.textNode):(r=Vn._createBefore(e.textNode),this.position=r))),{done:!1,value:{type:t,item:e,previousPosition:i,nextPosition:r,length:n}}}}class Vn{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 On);){if(!t.parent)return null;t=t.parent}return t}getShiftedBy(t){const e=Vn._createAt(this),i=e.offset+t;return e.offset=i<0?0:i,e}getLastMatchingPosition(t,e={}){e.startPosition=this;const i=new Ln(e);return i.skip(t),i.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(t){const e=this.getAncestors(),i=t.getAncestors();let r=0;for(;e[r]==i[r]&&e[r];)r++;return 0===r?null:e[r-1]}is(t){return"position"===t||"view:position"===t}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():[],i=t.parent.is("node")?t.parent.getPath():[];e.push(this.offset),i.push(t.offset);const r=Nr(e,i);switch(r){case"prefix":return"before";case"extension":return"after";default:return e[r]0?new this(i,r):new this(r,i)}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(Vn._createBefore(t),e)}}function Bn(t){return!(!t.item.is("attributeElement")&&!t.item.is("uiElement"))}function zn(t){let e=0;for(const i of t)e++;return e}class Fn{constructor(t=null,e,i){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(t,e,i)}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];return(this._lastRangeBackward?t.end:t.start).clone()}get focus(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.start:t.end).clone()}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const t of this._ranges)yield t.clone()}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?t.clone():null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?t.clone():null}getFirstPosition(){const t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){const t=this.getLastRange();return t?t.end.clone():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 i=!1;for(const r of t._ranges)if(e.isEqual(r)){i=!0;break}if(!i)return!1}return!0}isSimilar(t){if(this.isBackward!=t.isBackward)return!1;const e=zn(this.getRanges());if(e!=zn(t.getRanges()))return!1;if(0==e)return!0;for(let e of this.getRanges()){e=e.getTrimmed();let i=!1;for(let r of t.getRanges())if(r=r.getTrimmed(),e.start.isEqual(r.start)&&e.end.isEqual(r.end)){i=!0;break}if(!i)return!1}return!0}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}setTo(t,e,i){if(null===t)this._setRanges([]),this._setFakeOptions(e);else if(t instanceof Fn||t instanceof qn)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof Dn)this._setRanges([t],e&&e.backward),this._setFakeOptions(e);else if(t instanceof Vn)this._setRanges([new Dn(t)]),this._setFakeOptions(e);else if(t instanceof Vr){const r=!!i&&!!i.backward;let n;if(void 0===e)throw new c("view-selection-setto-required-second-parameter",this);n="in"==e?Dn._createIn(t):"on"==e?Dn._createOn(t):new Dn(Vn._createAt(t,e)),this._setRanges([n],r),this._setFakeOptions(i)}else{if(!Cr(t))throw new c("view-selection-setto-not-selectable",this);this._setRanges(t,e&&e.backward),this._setFakeOptions(e)}this.fire("change")}setFocus(t,e){if(null===this.anchor)throw new c("view-selection-setfocus-no-ranges",this);const i=Vn._createAt(t,e);if("same"==i.compareWith(this.focus))return;const r=this.anchor;this._ranges.pop(),"before"==i.compareWith(r)?this._addRange(new Dn(i,r),!0):this._addRange(new Dn(r,i)),this.fire("change")}is(t){return"selection"===t||"view:selection"===t}_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 Dn))throw new c("view-selection-add-range-not-range",this);this._pushRange(t),this._lastRangeBackward=!!e}_pushRange(t){for(const e of this._ranges)if(t.isIntersecting(e))throw new c("view-selection-range-intersects",this,{addedRange:t,intersectingRange:e});this._ranges.push(new Dn(t.start,t.end))}}de(Fn,p);class qn{constructor(t=null,e,i){this._selection=new Fn,this._selection.delegate("change").to(this),this._selection.setTo(t,e,i)}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)}is(t){return"selection"===t||"documentSelection"==t||"view:selection"==t||"view:documentSelection"==t}_setTo(t,e,i){this._selection.setTo(t,e,i)}_setFocus(t,e){this._selection.setFocus(t,e)}}de(qn,p);class jn extends n{constructor(t,e,i){super(t,e),this.startRange=i,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const $n=Symbol("bubbling contexts"),Hn={fire(t,...e){try{const i=t instanceof n?t:new n(this,t),r=Gn(this);if(!r.size)return;if(Wn(i,"capturing",this),Un(r,"$capture",i,...e))return i.return;const o=i.startRange||this.selection.getFirstRange(),s=o?o.getContainedElement():null,a=!!s&&Boolean(Kn(r,s));let c=s||function(t){if(!t)return null;const e=t.start.parent,i=t.end.parent,r=e.getPath(),n=i.getPath();return r.length>n.length?e:i}(o);if(Wn(i,"atTarget",c),!a){if(Un(r,"$text",i,...e))return i.return;Wn(i,"bubbling",c)}for(;c;){if(c.is("rootElement")){if(Un(r,"$root",i,...e))return i.return}else if(c.is("element")&&Un(r,c.name,i,...e))return i.return;if(Un(r,c,i,...e))return i.return;c=c.parent,Wn(i,"bubbling",c)}return Wn(i,"bubbling",this),Un(r,"$document",i,...e),i.return}catch(t){c.rethrowUnexpectedError(t,this)}},_addEventListener(t,e,i){const r=Er(i.context||"$document"),n=Gn(this);for(const o of r){let r=n.get(o);r||(r=Object.create(p),n.set(o,r)),this.listenTo(r,t,e,i)}},_removeEventListener(t,e){const i=Gn(this);for(const r of i.values())this.stopListening(r,t,e)}};function Wn(t,e,i){t instanceof jn&&(t._eventPhase=e,t._currentTarget=i)}function Un(t,e,i,...r){const n="string"==typeof e?t.get(e):Kn(t,e);return!!n&&(n.fire(i,...r),i.stop.called)}function Kn(t,e){for(const[i,r]of t)if("function"==typeof i&&i(e))return r;return null}function Gn(t){return t[$n]||(t[$n]=new Map),t[$n]}class Jn{constructor(t){this.selection=new qn,this.roots=new Tr({idProperty:"rootName"}),this.stylesProcessor=t,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1),this._postFixers=new Set}getRoot(t="main"){return this.roots.get(t)}registerPostFixer(t){this._postFixers.add(t)}destroy(){this.roots.map((t=>t.destroy())),this.stopListening()}_callPostFixers(t){let e=!1;do{for(const i of this._postFixers)if(e=i(t),e)break}while(e)}}de(Jn,Hn),de(Jn,oe);class Yn extends En{constructor(t,e,i,r){super(t,e,i,r),this.getFillerOffset=Qn,this._priority=10,this._id=null,this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new c("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}is(t,e=null){return e?e===this.name&&("attributeElement"===t||"view:attributeElement"===t||"element"===t||"view:element"===t):"attributeElement"===t||"view:attributeElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===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 Qn(){if(Xn(this))return null;let t=this.parent;for(;t&&t.is("attributeElement");){if(Xn(t)>1)return null;t=t.parent}return!t||Xn(t)>1?null:this.childCount}function Xn(t){return Array.from(t.getChildren()).filter((t=>!t.is("uiElement"))).length}Yn.DEFAULT_PRIORITY=10;class Zn extends En{constructor(t,e,i,r){super(t,e,i,r),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=to}is(t,e=null){return e?e===this.name&&("emptyElement"===t||"view:emptyElement"===t||"element"===t||"view:element"===t):"emptyElement"===t||"view:emptyElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}_insertChild(t,e){if(e&&(e instanceof Vr||Array.from(e).length>0))throw new c("view-emptyelement-cannot-add",[this,e])}}function to(){return null}const eo=navigator.userAgent.toLowerCase(),io={isMac:function(t){return t.indexOf("macintosh")>-1}(eo),isGecko:function(t){return!!t.match(/gecko\/\d+/)}(eo),isSafari:function(t){return t.indexOf(" applewebkit/")>-1&&-1===t.indexOf("chrome")}(eo),isAndroid:function(t){return t.indexOf("android")>-1}(eo),isBlink:function(t){return t.indexOf("chrome/")>-1&&t.indexOf("edge/")<0}(eo),features:{isRegExpUnicodePropertySupported:function(){let t=!1;try{t=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch(t){}return t}()}},ro=io;const no={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},oo={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},so=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,shift:2228224,alt:4456448,cmd:8912896};for(let e=65;e<=90;e++){const i=String.fromCharCode(e);t[i.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;for(const e of"`-=[];',./\\")t[e]=e.charCodeAt(0);return t}(),ao=Object.fromEntries(Object.entries(so).map((([t,e])=>[e,t.charAt(0).toUpperCase()+t.slice(1)])));function co(t){let e;if("string"==typeof t){if(e=so[t.toLowerCase()],!e)throw new c("keyboard-unknown-key",null,{key:t})}else e=t.keyCode+(t.altKey?so.alt:0)+(t.ctrlKey?so.ctrl:0)+(t.shiftKey?so.shift:0)+(t.metaKey?so.cmd:0);return e}function lo(t){return"string"==typeof t&&(t=function(t){return t.split("+").map((t=>t.trim()))}(t)),t.map((t=>"string"==typeof t?function(t){if(t.endsWith("!"))return co(t.slice(0,-1));const e=co(t);return ro.isMac&&e==so.ctrl?so.cmd:e}(t):t)).reduce(((t,e)=>e+t),0)}function ho(t){let e=lo(t);return Object.entries(ro.isMac?no:oo).reduce(((t,[i,r])=>(0!=(e&so[i])&&(e&=~so[i],t+=r),t)),"")+(e?ao[e]:"")}function uo(t,e){const i="ltr"===e;switch(t){case so.arrowleft:return i?"left":"right";case so.arrowright:return i?"right":"left";case so.arrowup:return"up";case so.arrowdown:return"down"}}class go extends En{constructor(t,e,i,r){super(t,e,i,r),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=mo}is(t,e=null){return e?e===this.name&&("uiElement"===t||"view:uiElement"===t||"element"===t||"view:element"===t):"uiElement"===t||"view:uiElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}_insertChild(t,e){if(e&&(e instanceof Vr||Array.from(e).length>0))throw new c("view-uielement-cannot-add",this)}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 fo(t){t.document.on("arrowKey",((e,i)=>function(t,e,i){if(e.keyCode==so.arrowright){const t=e.domTarget.ownerDocument.defaultView.getSelection(),r=1==t.rangeCount&&t.getRangeAt(0).collapsed;if(r||e.shiftKey){const e=t.focusNode,n=t.focusOffset,o=i.domPositionToView(e,n);if(null===o)return;let s=!1;const a=o.getLastMatchingPosition((t=>(t.item.is("uiElement")&&(s=!0),!(!t.item.is("uiElement")&&!t.item.is("attributeElement")))));if(s){const e=i.viewPositionToDom(a);r?t.collapse(e.parent,e.offset):t.extend(e.parent,e.offset)}}}}(0,i,t.domConverter)),{priority:"low"})}function mo(){return null}class po extends En{constructor(t,e,i,r){super(t,e,i,r),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=bo}is(t,e=null){return e?e===this.name&&("rawElement"===t||"view:rawElement"===t||"element"===t||"view:element"===t):"rawElement"===t||"view:rawElement"===t||t===this.name||t==="view:"+this.name||"element"===t||"view:element"===t||"node"===t||"view:node"===t}_insertChild(t,e){if(e&&(e instanceof Vr||Array.from(e).length>0))throw new c("view-rawelement-cannot-add",[this,e])}}function bo(){return null}class wo{constructor(t,e){this.document=t,this._children=[],e&&this._insertChild(0,e)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(t){return"documentFragment"===t||"view: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 i=0;const r=function(t,e){if("string"==typeof e)return[new Dr(t,e)];Cr(e)||(e=[e]);return Array.from(e).map((e=>"string"==typeof e?new Dr(t,e):e instanceof Br?new Dr(t,e.data):e))}(this.document,e);for(const e of r)null!==e.parent&&e._remove(),e.parent=this,this._children.splice(t,0,e),t++,i++;return i}_removeChildren(t,e=1){this._fireChange("children",this);for(let i=t;i{}),void 0!==r.isAllowedInsideAttributeElement&&(n._isAllowedInsideAttributeElement=r.isAllowedInsideAttributeElement),n}setAttribute(t,e,i){i._setAttribute(t,e)}removeAttribute(t,e){e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,i){Ae(t)&&void 0===i&&(i=e),i._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,i){i._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}breakAttributes(t){return t instanceof Vn?this._breakAttributes(t):this._breakAttributesRange(t)}breakContainer(t){const e=t.parent;if(!e.is("containerElement"))throw new c("view-writer-break-non-container-element",this.document);if(!e.parent)throw new c("view-writer-break-root",this.document);if(t.isAtStart)return Vn._createBefore(e);if(!t.isAtEnd){const i=e._clone(!1);this.insert(Vn._createAfter(e),i);const r=new Dn(t,Vn._createAt(e,"end")),n=new Vn(i,0);this.move(r,n)}return Vn._createAfter(e)}mergeAttributes(t){const e=t.offset,i=t.parent;if(i.is("$text"))return t;if(i.is("attributeElement")&&0===i.childCount){const t=i.parent,e=i.index;return i._remove(),this._removeFromClonedElementsGroup(i),this.mergeAttributes(new Vn(t,e))}const r=i.getChild(e-1),n=i.getChild(e);if(!r||!n)return t;if(r.is("$text")&&n.is("$text"))return Ao(r,n);if(r.is("attributeElement")&&n.is("attributeElement")&&r.isSimilar(n)){const t=r.childCount;return r._appendChild(n.getChildren()),n._remove(),this._removeFromClonedElementsGroup(n),this.mergeAttributes(new Vn(r,t))}return t}mergeContainers(t){const e=t.nodeBefore,i=t.nodeAfter;if(!(e&&i&&e.is("containerElement")&&i.is("containerElement")))throw new c("view-writer-merge-containers-invalid-position",this.document);const r=e.getChild(e.childCount-1),n=r instanceof Dr?Vn._createAt(r,"end"):Vn._createAt(e,"end");return this.move(Dn._createIn(i),Vn._createAt(e,"end")),this.remove(Dn._createOn(i)),n}insert(t,e){Co(e=Cr(e)?[...e]:[e],this.document);const i=e.reduce(((t,e)=>{const i=t[t.length-1],r=!(e.is("uiElement")&&e.isAllowedInsideAttributeElement);return i&&i.breakAttributes==r?i.nodes.push(e):t.push({breakAttributes:r,nodes:[e]}),t}),[]);let r=null,n=t;for(const{nodes:t,breakAttributes:e}of i){const i=this._insertNodes(n,t,e);r||(r=i.start),n=i.end}return r?new Dn(r,n):new Dn(t)}remove(t){const e=t instanceof Dn?t:Dn._createOn(t);if(Eo(e,this.document),e.isCollapsed)return new wo(this.document);const{start:i,end:r}=this._breakAttributesRange(e,!0),n=i.parent,o=r.offset-i.offset,s=n._removeChildren(i.offset,o);for(const t of s)this._removeFromClonedElementsGroup(t);const a=this.mergeAttributes(i);return e.start=a,e.end=a.clone(),new wo(this.document,s)}clear(t,e){Eo(t,this.document);const i=t.getWalker({direction:"backward",ignoreElementEnd:!0});for(const r of i){const i=r.item;let n;if(i.is("element")&&e.isSimilar(i))n=Dn._createOn(i);else if(!r.nextPosition.isAfter(t.start)&&i.is("$textProxy")){const t=i.getAncestors().find((t=>t.is("element")&&e.isSimilar(t)));t&&(n=Dn._createIn(t))}n&&(n.end.isAfter(t.end)&&(n.end=t.end),n.start.isBefore(t.start)&&(n.start=t.start),this.remove(n))}}move(t,e){let i;if(e.isAfter(t.end)){const r=(e=this._breakAttributes(e,!0)).parent,n=r.childCount;t=this._breakAttributesRange(t,!0),i=this.remove(t),e.offset+=r.childCount-n}else i=this.remove(t);return this.insert(e,i)}wrap(t,e){if(!(e instanceof Yn))throw new c("view-writer-wrap-invalid-attribute",this.document);if(Eo(t,this.document),t.isCollapsed){let r=t.start;r.parent.is("element")&&(i=r.parent,!Array.from(i.getChildren()).some((t=>!t.is("uiElement"))))&&(r=r.getLastMatchingPosition((t=>t.item.is("uiElement")))),r=this._wrapPosition(r,e);const n=this.document.selection;return n.isCollapsed&&n.getFirstPosition().isEqual(t.start)&&this.setSelection(r),new Dn(r)}return this._wrapRange(t,e);var i}unwrap(t,e){if(!(e instanceof Yn))throw new c("view-writer-unwrap-invalid-attribute",this.document);if(Eo(t,this.document),t.isCollapsed)return t;const{start:i,end:r}=this._breakAttributesRange(t,!0),n=i.parent,o=this._unwrapChildren(n,i.offset,r.offset,e),s=this.mergeAttributes(o.start);s.isEqual(o.start)||o.end.offset--;const a=this.mergeAttributes(o.end);return new Dn(s,a)}rename(t,e){const i=new Rn(this.document,t,e.getAttributes());return this.insert(Vn._createAfter(e),i),this.move(Dn._createIn(e),Vn._createAt(i,0)),this.remove(Dn._createOn(e)),i}clearClonedElementsGroup(t){this._cloneGroups.delete(t)}createPositionAt(t,e){return Vn._createAt(t,e)}createPositionAfter(t){return Vn._createAfter(t)}createPositionBefore(t){return Vn._createBefore(t)}createRange(t,e){return new Dn(t,e)}createRangeOn(t){return Dn._createOn(t)}createRangeIn(t){return Dn._createIn(t)}createSelection(t,e,i){return new Fn(t,e,i)}_insertNodes(t,e,i){let r,n;if(r=i?ko(t):t.parent.is("$text")?t.parent.parent:t.parent,!r)throw new c("view-writer-invalid-position-container",this.document);n=i?this._breakAttributes(t,!0):t.parent.is("$text")?xo(t):t;const o=r._insertChild(n.offset,e);for(const t of e)this._addToClonedElementsGroup(t);const s=n.getShiftedBy(o),a=this.mergeAttributes(n);a.isEqual(n)||s.offset--;const l=this.mergeAttributes(s);return new Dn(a,l)}_wrapChildren(t,e,i,r){let n=e;const o=[];for(;n!1,t.parent._insertChild(t.offset,i);const r=new Dn(t,t.getShiftedBy(1));this.wrap(r,e);const n=new Vn(i.parent,i.index);i._remove();const o=n.nodeBefore,s=n.nodeAfter;return o instanceof Dr&&s instanceof Dr?Ao(o,s):yo(n)}_wrapAttributeElement(t,e){if(!So(t,e))return!1;if(t.name!==e.name||t.priority!==e.priority)return!1;for(const i of t.getAttributeKeys())if("class"!==i&&"style"!==i&&e.hasAttribute(i)&&e.getAttribute(i)!==t.getAttribute(i))return!1;for(const i of t.getStyleNames())if(e.hasStyle(i)&&e.getStyle(i)!==t.getStyle(i))return!1;for(const i of t.getAttributeKeys())"class"!==i&&"style"!==i&&(e.hasAttribute(i)||this.setAttribute(i,t.getAttribute(i),e));for(const i of t.getStyleNames())e.hasStyle(i)||this.setStyle(i,t.getStyle(i),e);for(const i of t.getClassNames())e.hasClass(i)||this.addClass(i,e);return!0}_unwrapAttributeElement(t,e){if(!So(t,e))return!1;if(t.name!==e.name||t.priority!==e.priority)return!1;for(const i of t.getAttributeKeys())if("class"!==i&&"style"!==i&&(!e.hasAttribute(i)||e.getAttribute(i)!==t.getAttribute(i)))return!1;if(!e.hasClass(...t.getClassNames()))return!1;for(const i of t.getStyleNames())if(!e.hasStyle(i)||e.getStyle(i)!==t.getStyle(i))return!1;for(const i of t.getAttributeKeys())"class"!==i&&"style"!==i&&this.removeAttribute(i,e);return this.removeClass(Array.from(t.getClassNames()),e),this.removeStyle(Array.from(t.getStyleNames()),e),!0}_breakAttributesRange(t,e=!1){const i=t.start,r=t.end;if(Eo(t,this.document),t.isCollapsed){const i=this._breakAttributes(t.start,e);return new Dn(i,i)}const n=this._breakAttributes(r,e),o=n.parent.childCount,s=this._breakAttributes(i,e);return n.offset+=n.parent.childCount-o,new Dn(s,n)}_breakAttributes(t,e=!1){const i=t.offset,r=t.parent;if(t.parent.is("emptyElement"))throw new c("view-writer-cannot-break-empty-element",this.document);if(t.parent.is("uiElement"))throw new c("view-writer-cannot-break-ui-element",this.document);if(t.parent.is("rawElement"))throw new c("view-writer-cannot-break-raw-element",this.document);if(!e&&r.is("$text")&&Po(r.parent))return t.clone();if(Po(r))return t.clone();if(r.is("$text"))return this._breakAttributes(xo(t),e);if(i==r.childCount){const t=new Vn(r.parent,r.index+1);return this._breakAttributes(t,e)}if(0===i){const t=new Vn(r.parent,r.index);return this._breakAttributes(t,e)}{const t=r.index+1,n=r._clone();r.parent._insertChild(t,n),this._addToClonedElementsGroup(n);const o=r.childCount-i,s=r._removeChildren(i,o);n._appendChild(s);const a=new Vn(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 i=this._cloneGroups.get(e);i||(i=new Set,this._cloneGroups.set(e,i)),i.add(t),t._clonesGroup=i}_removeFromClonedElementsGroup(t){if(t.is("element"))for(const e of t.getChildren())this._removeFromClonedElementsGroup(e);const e=t.id;if(!e)return;const i=this._cloneGroups.get(e);i&&i.delete(t)}}function ko(t){let e=t.parent;for(;!Po(e);){if(!e)return;e=e.parent}return e}function vo(t,e){return t.prioritye.priority)&&t.getIdentity()i instanceof t)))throw new c("view-writer-insert-invalid-node-type",e);i.is("$text")||Co(i.getChildren(),e)}}const To=[Dr,Yn,Rn,Zn,po,go];function Po(t){return t&&(t.is("containerElement")||t.is("documentFragment"))}function Eo(t,e){const i=ko(t.start),r=ko(t.end);if(!i||!r||i!==r)throw new c("view-writer-invalid-range-container",e)}function So(t,e){return null===t.id&&null===e.id}function Ro(t){return"[object Text]"==Object.prototype.toString.call(t)}const Io=t=>t.createTextNode(" "),Oo=t=>{const e=t.createElement("span");return e.dataset.ckeFiller=!0,e.innerHTML=" ",e},Mo=t=>{const e=t.createElement("br");return e.dataset.ckeFiller=!0,e},No="".repeat(7);function Lo(t){return Ro(t)&&t.data.substr(0,7)===No}function Vo(t){return 7==t.data.length&&Lo(t)}function Do(t){return Lo(t)?t.data.slice(7):t.data}function Bo(t,e){if(e.keyCode==so.arrowleft){const t=e.domTarget.ownerDocument.defaultView.getSelection();if(1==t.rangeCount&&t.getRangeAt(0).collapsed){const e=t.getRangeAt(0).startContainer,i=t.getRangeAt(0).startOffset;Lo(e)&&i<=7&&t.collapse(e,0)}}}function zo(t,e,i,r=!1){i=i||function(t,e){return t===e},Array.isArray(t)||(t=Array.prototype.slice.call(t)),Array.isArray(e)||(e=Array.prototype.slice.call(e));const n=function(t,e,i){const r=Fo(t,e,i);if(-1===r)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const n=qo(t,r),o=qo(e,r),s=Fo(n,o,i),a=t.length-s,c=e.length-s;return{firstIndex:r,lastIndexOld:a,lastIndexNew:c}}(t,e,i);return r?function(t,e){const{firstIndex:i,lastIndexOld:r,lastIndexNew:n}=t;if(-1===i)return Array(e).fill("equal");let o=[];i>0&&(o=o.concat(Array(i).fill("equal")));n-i>0&&(o=o.concat(Array(n-i).fill("insert")));r-i>0&&(o=o.concat(Array(r-i).fill("delete")));n0&&i.push({index:r,type:"insert",values:t.slice(r,o)});n-r>0&&i.push({index:r+(o-r),type:"delete",howMany:n-r});return i}(e,n)}function Fo(t,e,i){for(let r=0;r200||n>200||r+n>300)return jo.fastDiff(t,e,i,!0);let o,s;if(nl?-1:1;h[r+u]&&(h[r]=h[r+u].slice(0)),h[r]||(h[r]=[]),h[r].push(n>l?o:s);let g=Math.max(n,l),f=g-r;for(;fl;g--)d[g]=u(g);d[l]=u(l),f++}while(d[l]!==c);return h[l].slice(1)}function $o(t,e,i){t.insertBefore(i,t.childNodes[e]||null)}function Ho(t){const e=t.parentNode;e&&e.removeChild(t)}function Wo(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}jo.fastDiff=zo;i(9835);class Uo{constructor(t,e){this.domDocuments=new Set,this.domConverter=t,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=e,this.set("isFocused",!1),this.set("isSelecting",!1),ro.isBlink&&!ro.isAndroid&&this.on("change:isSelecting",(()=>{this.isSelecting||this.render()})),this._inlineFiller=null,this._fakeSelectionContainer=null}markToSync(t,e){if("text"===t)this.domConverter.mapViewToDom(e.parent)&&this.markedTexts.add(e);else{if(!this.domConverter.mapViewToDom(e))return;if("attributes"===t)this.markedAttributes.add(e);else{if("children"!==t)throw new c("view-renderer-unknown-type",this);this.markedChildren.add(e)}}}render(){let t;const e=!(ro.isBlink&&!ro.isAndroid)||!this.isSelecting;for(const t of this.markedChildren)this._updateChildrenMappings(t);e?(this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?t=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(t=this.selection.getFirstPosition(),this.markedChildren.add(t.parent))):this._inlineFiller&&this._inlineFiller.parentNode&&(t=this.domConverter.domPositionToView(this._inlineFiller));for(const t of this.markedAttributes)this._updateAttrs(t);for(const e of this.markedChildren)this._updateChildren(e,{inlineFillerPosition:t});for(const e of this.markedTexts)!this.markedChildren.has(e.parent)&&this.domConverter.mapViewToDom(e.parent)&&this._updateText(e,{inlineFillerPosition:t});if(e)if(t){const e=this.domConverter.viewPositionToDom(t),i=e.parent.ownerDocument;Lo(e.parent)?this._inlineFiller=e.parent:this._inlineFiller=Ko(i,e.parent,e.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const i=Array.from(this.domConverter.mapViewToDom(t).childNodes),r=Array.from(this.domConverter.viewChildrenToDom(t,e.ownerDocument,{withChildren:!1})),n=this._diffNodeLists(i,r),o=this._findReplaceActions(n,i,r);if(-1!==o.indexOf("replace")){const e={equal:0,insert:0,delete:0};for(const n of o)if("replace"===n){const n=e.equal+e.insert,o=e.equal+e.delete,s=t.getChild(n);!s||s.is("uiElement")||s.is("rawElement")||this._updateElementMappings(s,i[o]),Ho(r[n]),e.equal++}else e[n]++}}_updateElementMappings(t,e){this.domConverter.unbindDomElement(e),this.domConverter.bindElements(e,t),this.markedChildren.add(t),this.markedAttributes.add(t)}_getInlineFillerPosition(){const t=this.selection.getFirstPosition();return t.parent.is("$text")?Vn._createBefore(this.selection.getFirstPosition().parent):t}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=this.domConverter.viewPositionToDom(t);return!!(e&&Ro(e.parent)&&Lo(e.parent))}_removeInlineFiller(){const t=this._inlineFiller;if(!Lo(t))throw new c("view-renderer-filler-was-lost",this);Vo(t)?t.remove():t.data=t.data.substr(7),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=t.parent,i=t.offset;if(!this.domConverter.mapViewToDom(e.root))return!1;if(!e.is("element"))return!1;if(!function(t){if("false"==t.getAttribute("contenteditable"))return!1;const e=t.findAncestor((t=>t.hasAttribute("contenteditable")));return!e||"true"==e.getAttribute("contenteditable")}(e))return!1;if(i===e.getFillerOffset())return!1;const r=t.nodeBefore,n=t.nodeAfter;return!(r instanceof Dr||n instanceof Dr)}_updateText(t,e){const i=this.domConverter.findCorrespondingDomText(t),r=this.domConverter.viewToDom(t,i.ownerDocument),n=i.data;let o=r.data;const s=e.inlineFillerPosition;if(s&&s.parent==t.parent&&s.offset==t.index&&(o=No+o),n!=o){const t=zo(n,o);for(const e of t)"insert"===e.type?i.insertData(e.index,e.values.join("")):i.deleteData(e.index,e.howMany)}}_updateAttrs(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const i=Array.from(e.attributes).map((t=>t.name)),r=t.getAttributeKeys();for(const i of r){const r=t.getAttribute(i);this.domConverter.shouldRenderAttribute(i,r)?e.setAttribute(i,r):e.removeAttribute(i)}for(const r of i)"script"===t.name&&"data-ck-hidden"===r||t.hasAttribute(r)||e.removeAttribute(r)}_updateChildren(t,e){const i=this.domConverter.mapViewToDom(t);if(!i)return;const r=e.inlineFillerPosition,n=this.domConverter.mapViewToDom(t).childNodes,o=Array.from(this.domConverter.viewChildrenToDom(t,i.ownerDocument,{bind:!0}));r&&r.parent===t&&Ko(i.ownerDocument,o,r.offset);const s=this._diffNodeLists(n,o);let a=0;const c=new Set;for(const t of s)"delete"===t?(c.add(n[a]),Ho(n[a])):"equal"===t&&a++;a=0;for(const t of s)"insert"===t?($o(i,a,o[a]),a++):"equal"===t&&(this._markDescendantTextToSync(this.domConverter.domToView(o[a])),a++);for(const t of c)t.parentNode||this.domConverter.unbindDomElement(t)}_diffNodeLists(t,e){return jo(t=function(t,e){const i=Array.from(t);if(0==i.length||!e)return i;i[i.length-1]==e&&i.pop();return i}(t,this._fakeSelectionContainer),e,Jo.bind(null,this.domConverter))}_findReplaceActions(t,e,i){if(-1===t.indexOf("insert")||-1===t.indexOf("delete"))return t;let r=[],n=[],o=[];const s={equal:0,insert:0,delete:0};for(const a of t)"insert"===a?o.push(i[s.equal+s.insert]):"delete"===a?n.push(e[s.equal+s.delete]):(r=r.concat(jo(n,o,Go).map((t=>"equal"===t?"replace":t))),r.push("equal"),n=[],o=[]),s[a]++;return r.concat(jo(n,o,Go).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(ro.isBlink&&!ro.isAndroid&&this.isSelecting&&!this.markedChildren.size)return;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;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(t){const e=t.createElement("div");return e.className="ck-fake-selection-container",Object.assign(e.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),e.textContent=" ",e}(e));const i=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(i,this.selection),!this._fakeSelectionNeedsUpdate(t))return;i.parentElement&&i.parentElement==t||t.appendChild(i),i.textContent=this.selection.fakeSelectionLabel||" ";const r=e.getSelection(),n=e.createRange();r.removeAllRanges(),n.selectNodeContents(i),r.addRange(n)}_updateDomSelection(t){const e=t.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(e))return;const i=this.domConverter.viewPositionToDom(this.selection.anchor),r=this.domConverter.viewPositionToDom(this.selection.focus);e.collapse(i.parent,i.offset),e.extend(r.parent,r.offset),ro.isGecko&&function(t,e){const i=t.parent;if(i.nodeType!=Node.ELEMENT_NODE||t.offset!=i.childNodes.length-1)return;const r=i.childNodes[t.offset];r&&"BR"==r.tagName&&e.addRange(e.getRangeAt(0))}(r,e)}_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))}_fakeSelectionNeedsUpdate(t){const e=this._fakeSelectionContainer,i=t.ownerDocument.getSelection();return!e||e.parentElement!==t||(i.anchorNode!==e&&!e.contains(i.anchorNode)||e.textContent!==this.selection.fakeSelectionLabel)}_removeDomSelection(){for(const t of this.domDocuments){if(t.getSelection().rangeCount){const e=t.activeElement,i=this.domConverter.mapDomToView(e);e&&i&&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 Ko(t,e,i){const r=e instanceof Array?e:e.childNodes,n=r[i];if(Ro(n))return n.data=No+n.data,n;{const n=t.createTextNode(No);return Array.isArray(e)?r.splice(i,0,n):$o(e,i,n),n}}function Go(t,e){return Wo(t)&&Wo(e)&&!Ro(t)&&!Ro(e)&&t.nodeType!==Node.COMMENT_NODE&&e.nodeType!==Node.COMMENT_NODE&&t.tagName.toLowerCase()===e.tagName.toLowerCase()}function Jo(t,e,i){return e===i||(Ro(e)&&Ro(i)?e.data===i.data:!(!t.isBlockFiller(e)||!t.isBlockFiller(i)))}de(Uo,oe);const Yo={window,document};function Qo(t){let e=0;for(;t.previousSibling;)t=t.previousSibling,e++;return e}function Xo(t){const e=[];for(;t&&t.nodeType!=Node.DOCUMENT_NODE;)e.unshift(t),t=t.parentNode;return e}const Zo=Mo(document),ts=Io(document),es=Oo(document);class is{constructor(t,e={}){this.document=t,this.renderingMode=e.renderingMode||"editing",this.experimentalRenderingMode=!1,this.blockFillerMode=e.blockFillerMode||("editing"===this.renderingMode?"br":"nbsp"),this.preElements=["pre"],this.blockElements=["address","article","aside","blockquote","caption","center","dd","details","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","legend","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"],this.inlineObjectElements=["object","iframe","input","button","textarea","select","option","video","embed","audio","img","canvas"],this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap,this._rawContentElementMatcher=new Fr,this._encounteredRawContentDomNodes=new WeakSet}bindFakeSelection(t,e){this._fakeSelectionMapping.set(t,new Fn(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 t.childNodes)this.unbindDomElement(e)}}bindDocumentFragments(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}shouldRenderAttribute(t,e){return!this.experimentalRenderingMode||"data"===this.renderingMode||!(t.toLowerCase().startsWith("on")||e.match(/(\b)(on\S+)(\s*)=|javascript:|(<\s*)(\/*)script/i)||e.match(/data:(?!image\/(png|jpeg|gif|webp))/i))}setContentOf(t,e){if(!this.experimentalRenderingMode||"data"===this.renderingMode)return void(t.innerHTML=e);const i=(new DOMParser).parseFromString(e,"text/html"),r=i.createDocumentFragment(),n=i.body.childNodes;for(;n.length>0;)r.appendChild(n[0]);const o=i.createTreeWalker(r,NodeFilter.SHOW_ELEMENT),s=[];let a;for(;a=o.nextNode();)s.push(a);for(const t of s){for(const e of t.getAttributeNames()){const i=t.getAttribute(e);this.shouldRenderAttribute(e,i)||t.removeAttribute(e)}const e=t.tagName.toLowerCase();this._shouldRenameElement(e)&&t.replaceWith(this._createReplacementDomElement(e,t))}for(;t.firstChild;)t.firstChild.remove();t.append(r)}viewToDom(t,e,i={}){if(t.is("$text")){const i=this._processDataFromViewText(t);return e.createTextNode(i)}{if(this.mapViewToDom(t))return this.mapViewToDom(t);let r;if(t.is("documentFragment"))r=e.createDocumentFragment(),i.bind&&this.bindDocumentFragments(r,t);else{if(t.is("uiElement"))return r="$comment"===t.name?e.createComment(t.getCustomProperty("$rawContent")):t.render(e,this),i.bind&&this.bindElements(r,t),r;r=this._shouldRenameElement(t.name)?this._createReplacementDomElement(t.name):t.hasAttribute("xmlns")?e.createElementNS(t.getAttribute("xmlns"),t.name):e.createElement(t.name),t.is("rawElement")&&t.render(r,this),i.bind&&this.bindElements(r,t);for(const e of t.getAttributeKeys()){const i=t.getAttribute(e);this.shouldRenderAttribute(e,i)&&r.setAttribute(e,i)}}if(!1!==i.withChildren)for(const n of this.viewChildrenToDom(t,e,i))r.appendChild(n);return r}}*viewChildrenToDom(t,e,i={}){const r=t.getFillerOffset&&t.getFillerOffset();let n=0;for(const o of t.getChildren())r===n&&(yield this._getBlockFiller(e)),yield this.viewToDom(o,e,i),n++;r===n&&(yield this._getBlockFiller(e))}viewRangeToDom(t){const e=this.viewPositionToDom(t.start),i=this.viewPositionToDom(t.end),r=document.createRange();return r.setStart(e.parent,e.offset),r.setEnd(i.parent,i.offset),r}viewPositionToDom(t){const e=t.parent;if(e.is("$text")){const i=this.findCorrespondingDomText(e);if(!i)return null;let r=t.offset;return Lo(i)&&(r+=7),{parent:i,offset:r}}{let i,r,n;if(0===t.offset){if(i=this.mapViewToDom(e),!i)return null;n=i.childNodes[0]}else{const e=t.nodeBefore;if(r=e.is("$text")?this.findCorrespondingDomText(e):this.mapViewToDom(t.nodeBefore),!r)return null;i=r.parentNode,n=r.nextSibling}if(Ro(n)&&Lo(n))return{parent:n,offset:7};return{parent:i,offset:r?Qo(r)+1:0}}}domToView(t,e={}){if(this.isBlockFiller(t))return null;const i=this.getHostViewElement(t);if(i)return i;if(this.isComment(t)&&e.skipComments)return null;if(Ro(t)){if(Vo(t))return null;{const e=this._processDataFromDomText(t);return""===e?null:new Dr(this.document,e)}}{if(this.mapDomToView(t))return this.mapDomToView(t);let i;if(this.isDocumentFragment(t))i=new wo(this.document),e.bind&&this.bindDocumentFragments(t,i);else{i=this._createViewElement(t,e),e.bind&&this.bindElements(t,i);const r=t.attributes;if(r)for(let t=r.length-1;t>=0;t--)i._setAttribute(r[t].name,r[t].value);if(this._isViewElementWithRawContent(i,e)||this.isComment(t)){const e=this.isComment(t)?t.data:t.innerHTML;return i._setCustomProperty("$rawContent",e),this._encounteredRawContentDomNodes.add(t),i}}if(!1!==e.withChildren)for(const r of this.domChildrenToView(t,e))i._appendChild(r);return i}}*domChildrenToView(t,e={}){for(let i=0;i{const{scrollLeft:e,scrollTop:i}=t;r.push([e,i])})),e.focus(),rs(e,(t=>{const[e,i]=r.shift();t.scrollLeft=e,t.scrollTop=i})),Yo.window.scrollTo(t,i)}}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}isBlockFiller(t){return"br"==this.blockFillerMode?t.isEqualNode(Zo):!("BR"!==t.tagName||!ns(t,this.blockElements)||1!==t.parentNode.childNodes.length)||(t.isEqualNode(es)||function(t,e){return t.isEqualNode(ts)&&ns(t,e)&&1===t.parentNode.childNodes.length}(t,this.blockElements))}isDomSelectionBackward(t){if(t.isCollapsed)return!1;const e=document.createRange();e.setStart(t.anchorNode,t.anchorOffset),e.setEnd(t.focusNode,t.focusOffset);const i=e.collapsed;return e.detach(),i}getHostViewElement(t){const e=Xo(t);for(e.pop();e.length;){const t=e.pop(),i=this._domToViewMapping.get(t);if(i&&(i.is("uiElement")||i.is("rawElement")))return i}return null}isDomSelectionCorrect(t){return this._isDomSelectionPositionCorrect(t.anchorNode,t.anchorOffset)&&this._isDomSelectionPositionCorrect(t.focusNode,t.focusOffset)}registerRawContentMatcher(t){this._rawContentElementMatcher.add(t)}_getBlockFiller(t){switch(this.blockFillerMode){case"nbsp":return Io(t);case"markedNbsp":return Oo(t);case"br":return Mo(t)}}_isDomSelectionPositionCorrect(t,e){if(Ro(t)&&Lo(t)&&e<7)return!1;if(this.isElement(t)&&Lo(t.childNodes[e]))return!1;const i=this.mapDomToView(t);return!i||!i.is("uiElement")&&!i.is("rawElement")}_processDataFromViewText(t){let e=t.data;if(t.getAncestors().some((t=>this.preElements.includes(t.name))))return e;if(" "==e.charAt(0)){const i=this._getTouchingInlineViewNode(t,!1);!(i&&i.is("$textProxy")&&this._nodeEndsWithSpace(i))&&i||(e=" "+e.substr(1))}if(" "==e.charAt(e.length-1)){const i=this._getTouchingInlineViewNode(t,!0),r=i&&i.is("$textProxy")&&" "==i.data.charAt(0);" "!=e.charAt(e.length-2)&&i&&!r||(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(function(t,e){return Xo(t).some((t=>t.tagName&&e.includes(t.tagName.toLowerCase())))}(t,this.preElements))return Do(t);e=e.replace(/[ \n\t\r]{1,}/g," ");const i=this._getTouchingInlineDomNode(t,!1),r=this._getTouchingInlineDomNode(t,!0),n=this._checkShouldLeftTrimDomText(t,i),o=this._checkShouldRightTrimDomText(t,r);n&&(e=e.replace(/^ /,"")),o&&(e=e.replace(/ $/,"")),e=Do(new Text(e)),e=e.replace(/ \u00A0/g," ");const s=r&&this.isElement(r)&&"BR"!=r.tagName,a=r&&Ro(r)&&" "==r.data.charAt(0);return(/( |\u00A0)\u00A0$/.test(e)||!r||s||a)&&(e=e.replace(/\u00A0$/," ")),(n||i&&this.isElement(i)&&"BR"!=i.tagName)&&(e=e.replace(/^\u00A0/," ")),e}_checkShouldLeftTrimDomText(t,e){return!e||(this.isElement(e)?"BR"===e.tagName:!this._encounteredRawContentDomNodes.has(t.previousSibling)&&/[^\S\u00A0]/.test(e.data.charAt(e.data.length-1)))}_checkShouldRightTrimDomText(t,e){return!e&&!Lo(t)}_getTouchingInlineViewNode(t,e){const i=new Ln({startPosition:e?Vn._createAfter(t):Vn._createBefore(t),direction:e?"forward":"backward"});for(const t of i){if(t.item.is("element")&&this.inlineObjectElements.includes(t.item.name))return t.item;if(t.item.is("containerElement"))return null;if(t.item.is("element","br"))return null;if(t.item.is("$textProxy"))return t.item}return null}_getTouchingInlineDomNode(t,e){if(!t.parentNode)return null;const i=e?"firstChild":"lastChild",r=e?"nextSibling":"previousSibling";let n=!0;do{if(!n&&t[i]?t=t[i]:t[r]?(t=t[r],n=!1):(t=t.parentNode,n=!0),!t||this._isBlockElement(t))return null}while(!Ro(t)&&"BR"!=t.tagName&&!this._isInlineObjectElement(t));return t}_isBlockElement(t){return this.isElement(t)&&this.blockElements.includes(t.tagName.toLowerCase())}_isInlineObjectElement(t){return this.isElement(t)&&this.inlineObjectElements.includes(t.tagName.toLowerCase())}_createViewElement(t,e){if(this.isComment(t))return new go(this.document,"$comment");const i=e.keepOriginalCase?t.tagName:t.tagName.toLowerCase();return new En(this.document,i)}_isViewElementWithRawContent(t,e){return!1!==e.withChildren&&this._rawContentElementMatcher.match(t)}_shouldRenameElement(t){return this.experimentalRenderingMode&&"editing"==this.renderingMode&&"script"==t}_createReplacementDomElement(t,e=null){const i=document.createElement("span");if(i.setAttribute("data-ck-hidden",t),e){for(;e.firstChild;)i.appendChild(e.firstChild);for(const t of e.getAttributeNames())i.setAttribute(t,e.getAttribute(t))}return i}}function rs(t,e){for(;t&&t!=Yo.document;)e(t),t=t.parentNode}function ns(t,e){const i=t.parentNode;return i&&i.tagName&&e.includes(i.tagName.toLowerCase())}function os(t){const e=Object.prototype.toString.apply(t);return"[object Window]"==e||"[object global]"==e}const ss=Xt({},p,{listenTo(t,...e){if(Wo(t)||os(t)){const i=this._getProxyEmitter(t)||new as(t);i.attach(...e),t=i}p.listenTo.call(this,t,...e)},stopListening(t,e,i){if(Wo(t)||os(t)){const e=this._getProxyEmitter(t);if(!e)return;t=e}p.stopListening.call(this,t,e,i),t instanceof as&&t.detach(e)},_getProxyEmitter(t){return e=this,i=cs(t),e[f]&&e[f][i]?e[f][i].emitter:null;var e,i}});class as{constructor(t){b(this,cs(t)),this._domNode=t}}function cs(t){return t["data-ck-expando"]||(t["data-ck-expando"]=s())}Xt(as.prototype,p,{attach(t,e,i={}){if(this._domListeners&&this._domListeners[t])return;const r={capture:!!i.useCapture,passive:!!i.usePassive},n=this._createDomListener(t,r);this._domNode.addEventListener(t,n,r),this._domListeners||(this._domListeners={}),this._domListeners[t]=n},detach(t){let e;!this._domListeners[t]||(e=this._events[t])&&e.callbacks.length||this._domListeners[t].removeListener()},_createDomListener(t,e){const i=e=>{this.fire(t,e)};return i.removeListener=()=>{this._domNode.removeEventListener(t,i,e),delete this._domListeners[t]},i}});class ls{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()}checkShouldIgnoreEventFromTarget(t){return t&&3===t.nodeType&&(t=t.parentNode),!(!t||1!==t.nodeType)&&t.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}de(ls,ss);const hs=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};const ds=function(t){return this.__data__.has(t)};function us(t){var e=-1,i=null==t?0:t.length;for(this.__data__=new ri;++ea))return!1;var l=o.get(t),h=o.get(e);if(l&&h)return l==e&&h==t;var d=-1,u=!0,g=2&i?new gs:void 0;for(o.set(t,e),o.set(e,t);++d{this.listenTo(t,e,((t,e)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(e.target)&&this.onDomEvent(e)}),{useCapture:this.useCapture})}))}fire(t,e,i){this.isEnabled&&this.document.fire(t,new Os(this.view,e,i))}}class Ns extends Ms{constructor(t){super(t),this.domEventType=["keydown","keyup"]}onDomEvent(t){this.fire(t.type,t,{keyCode:t.keyCode,altKey:t.altKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,metaKey:t.metaKey,get keystroke(){return co(this)}})}}const Ls=function(){return P.Date.now()};var Vs=/\s/;const Ds=function(t){for(var e=t.length;e--&&Vs.test(t.charAt(e)););return e};var Bs=/^\s+/;const zs=function(t){return t?t.slice(0,Ds(t)+1).replace(Bs,""):t};var Fs=/^[-+]0x[0-9a-f]+$/i,qs=/^0b[01]+$/i,js=/^0o[0-7]+$/i,$s=parseInt;const Hs=function(t){if("number"==typeof t)return t;if($r(t))return NaN;if(A(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=A(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=zs(t);var i=qs.test(t);return i||js.test(t)?$s(t.slice(2),i?2:8):Fs.test(t)?NaN:+t};var Ws=Math.max,Us=Math.min;const Ks=function(t,e,i){var r,n,o,s,a,c,l=0,h=!1,d=!1,u=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){var i=r,o=n;return r=n=void 0,l=e,s=t.apply(o,i)}function f(t){return l=t,a=setTimeout(p,e),h?g(t):s}function m(t){var i=t-c;return void 0===c||i>=e||i<0||d&&t-l>=o}function p(){var t=Ls();if(m(t))return b(t);a=setTimeout(p,function(t){var i=e-(t-c);return d?Us(i,o-(t-l)):i}(t))}function b(t){return a=void 0,u&&r?g(t):(r=n=void 0,s)}function w(){var t=Ls(),i=m(t);if(r=arguments,n=this,c=t,i){if(void 0===a)return f(c);if(d)return clearTimeout(a),a=setTimeout(p,e),g(c)}return void 0===a&&(a=setTimeout(p,e)),s}return e=Hs(e)||0,A(i)&&(h=!!i.leading,o=(d="maxWait"in i)?Ws(Hs(i.maxWait)||0,e):o,u="trailing"in i?!!i.trailing:u),w.cancel=function(){void 0!==a&&clearTimeout(a),l=0,r=c=n=a=void 0},w.flush=function(){return void 0===a?s:b(Ls())},w};class Gs extends ls{constructor(t){super(t),this._fireSelectionChangeDoneDebounced=Ks((t=>this.document.fire("selectionChangeDone",t)),200)}observe(){const t=this.document;t.on("arrowKey",((e,i)=>{t.selection.isFake&&this.isEnabled&&i.preventDefault()}),{context:"$capture"}),t.on("arrowKey",((e,i)=>{t.selection.isFake&&this.isEnabled&&this._handleSelectionMove(i.keyCode)}),{priority:"lowest"})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(t){const e=this.document.selection,i=new Fn(e.getRanges(),{backward:e.isBackward,fake:!1});t!=so.arrowleft&&t!=so.arrowup||i.setTo(i.getFirstPosition()),t!=so.arrowright&&t!=so.arrowdown||i.setTo(i.getLastPosition());const r={oldSelection:e,newSelection:i,domSelection:null};this.document.fire("selectionChange",r),this._fireSelectionChangeDoneDebounced(r)}}class Js extends ls{constructor(t){super(t),this.mutationObserver=t.getObserver(Is),this.selection=this.document.selection,this.domConverter=t.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=Ks((t=>this.document.fire("selectionChangeDone",t)),200),this._clearInfiniteLoopInterval=setInterval((()=>this._clearInfiniteLoop()),1e3),this._documentIsSelectingInactivityTimeoutDebounced=Ks((()=>this.document.isSelecting=!1),5e3),this._loopbackCounter=0}observe(t){const e=t.ownerDocument,i=()=>{this.document.isSelecting=!1,this._documentIsSelectingInactivityTimeoutDebounced.cancel()};this.listenTo(t,"selectstart",(()=>{this.document.isSelecting=!0,this._documentIsSelectingInactivityTimeoutDebounced()}),{priority:"highest"}),this.listenTo(t,"keydown",i,{priority:"highest"}),this.listenTo(t,"keyup",i,{priority:"highest"}),this._documents.has(e)||(this.listenTo(e,"mouseup",i,{priority:"highest"}),this.listenTo(e,"selectionchange",((t,i)=>{this._handleSelectionChange(i,e),this._documentIsSelectingInactivityTimeoutDebounced()})),this._documents.add(e))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel(),this._documentIsSelectingInactivityTimeoutDebounced.cancel()}_handleSelectionChange(t,e){if(!this.isEnabled)return;const i=e.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(i.anchorNode))return;this.mutationObserver.flush();const r=this.domConverter.domSelectionToView(i);if(0!=r.rangeCount){if(this.view.hasDomSelection=!0,!(this.selection.isEqual(r)&&this.domConverter.isDomSelectionCorrect(i)||++this._loopbackCounter>60))if(this.selection.isSimilar(r))this.view.forceRender();else{const t={oldSelection:this.selection,newSelection:r,domSelection:i};this.document.fire("selectionChange",t),this._fireSelectionChangeDoneDebounced(t)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class Ys extends Ms{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.change((()=>{}))),50)})),e.on("blur",((i,r)=>{const n=e.selection.editableElement;null!==n&&n!==r.target||(e.isFocused=!1,t.change((()=>{})))}))}onDomEvent(t){this.fire(t.type,t)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class Qs extends Ms{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)}}class Xs extends Ms{constructor(t){super(t),this.domEventType=["beforeinput"]}onDomEvent(t){this.fire(t.type,t)}}class Zs{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=[]}}function ta(t){return t instanceof HTMLTextAreaElement?t.value:t.innerHTML}function ea(t){return"[object Range]"==Object.prototype.toString.apply(t)}function ia(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)}}const ra=["top","right","bottom","left","width","height"];class na{constructor(t){const e=ea(t);if(Object.defineProperty(this,"_source",{value:t._source||t,writable:!0,enumerable:!1}),vr(t)||e)if(e){const e=na.getDomRangeRects(t);oa(this,na.getBoundingRect(e))}else oa(this,t.getBoundingClientRect());else if(os(t)){const{innerWidth:e,innerHeight:i}=t;oa(this,{top:0,right:e,bottom:i,left:0,width:e,height:i})}else oa(this,t)}clone(){return new na(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 na(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(!sa(t)){let i=t.parentNode||t.commonAncestorContainer;for(;i&&!sa(i);){const t=new na(i),r=e.getIntersection(t);if(!r)return null;r.getArea(){for(const e of t){const t=aa._getElementCallbacks(e.target);if(t)for(const i of t)i(e)}}))}}aa._observerInstance=null,aa._elementCallbacks=null;class ca{constructor(t){this._callback=t,this._elements=new Set,this._previousRects=new Map,this._periodicCheckTimeout=null}observe(t){this._elements.add(t),this._checkElementRectsAndExecuteCallback(),1===this._elements.size&&this._startPeriodicCheck()}unobserve(t){this._elements.delete(t),this._previousRects.delete(t),this._elements.size||this._stopPeriodicCheck()}_startPeriodicCheck(){const t=()=>{this._checkElementRectsAndExecuteCallback(),this._periodicCheckTimeout=setTimeout(t,100)};this.listenTo(Yo.window,"resize",(()=>{this._checkElementRectsAndExecuteCallback()})),this._periodicCheckTimeout=setTimeout(t,100)}_stopPeriodicCheck(){clearTimeout(this._periodicCheckTimeout),this.stopListening(),this._previousRects.clear()}_checkElementRectsAndExecuteCallback(){const t=[];for(const e of this._elements)this._hasRectChanged(e)&&t.push({target:e,contentRect:this._previousRects.get(e)});t.length&&this._callback(t)}_hasRectChanged(t){if(!t.ownerDocument.body.contains(t))return!1;const e=new na(t),i=this._previousRects.get(t),r=!i||!i.isEqual(e);return this._previousRects.set(t,e),r}}function la(t,e){t instanceof HTMLTextAreaElement&&(t.value=e),t.innerHTML=e}function ha(t){return e=>e+t}function da(t){const e=t.next();return e.done?null:e.value}de(ca,ss);class ua{constructor(){this.set("isFocused",!1),this.set("focusedElement",null),this._elements=new Set,this._nextEventLoopTimeout=null}add(t){if(this._elements.has(t))throw new c("focustracker-add-element-already-exist",this);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))}destroy(){this.stopListening()}_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)}}de(ua,ss),de(ua,oe);class ga{constructor(){this._listener=Object.create(ss)}listenTo(t){this._listener.listenTo(t,"keydown",((t,e)=>{this._listener.fire("_keydown:"+co(e),e)}))}set(t,e,i={}){const r=lo(t),n=i.priority;this._listener.listenTo(this._listener,"_keydown:"+r,((t,i)=>{e(i,(()=>{i.preventDefault(),i.stopPropagation(),t.stop()})),t.return=!0}),{priority:n})}press(t){return!!this._listener.fire("_keydown:"+co(t),t)}destroy(){this._listener.stopListening()}}class fa extends ls{constructor(t){super(t),this.document.on("keydown",((t,e)=>{if(this.isEnabled&&((i=e.keyCode)==so.arrowright||i==so.arrowleft||i==so.arrowup||i==so.arrowdown)){const i=new jn(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(i,e),i.stop.called&&t.stop()}var i}))}observe(){}}function ma({target:t,viewportOffset:e=0}){const i=ya(t);let r=i,n=null;for(;r;){let o;o=xa(r==i?t:n),ba(o,(()=>Aa(t,r)));const s=Aa(t,r);if(pa(r,s,e),r.parent!=r){if(n=r.frameElement,r=r.parent,!n)return}else r=null}}function pa(t,e,i){const r=e.clone().moveBy(0,i),n=e.clone().moveBy(0,-i),o=new na(t).excludeScrollbarsAndBorders();if(![n,r].every((t=>o.contains(t)))){let{scrollX:s,scrollY:a}=t;_a(n,o)?a-=o.top-e.top+i:wa(r,o)&&(a+=e.bottom-o.bottom+i),ka(e,o)?s-=o.left-e.left+i:va(e,o)&&(s+=e.right-o.right+i),t.scrollTo(s,a)}}function ba(t,e){const i=ya(t);let r,n;for(;t!=i.document.body;)n=e(),r=new na(t).excludeScrollbarsAndBorders(),r.contains(n)||(_a(n,r)?t.scrollTop-=r.top-n.top:wa(n,r)&&(t.scrollTop+=n.bottom-r.bottom),ka(n,r)?t.scrollLeft-=r.left-n.left:va(n,r)&&(t.scrollLeft+=n.right-r.right)),t=t.parentNode}function wa(t,e){return t.bottom>e.bottom}function _a(t,e){return t.tope.right}function ya(t){return ea(t)?t.startContainer.ownerDocument.defaultView:t.ownerDocument.defaultView}function xa(t){if(ea(t)){let e=t.commonAncestorContainer;return Ro(e)&&(e=e.parentNode),e}return t.parentNode}function Aa(t,e){const i=ya(t),r=new na(t);if(i===e)return r;{let t=i;for(;t!=e;){const e=t.frameElement,i=new na(e).excludeScrollbarsAndBorders();r.moveBy(i.left,i.top),t=t.parent}}return r}Object.assign({},{scrollViewportToShowTarget:ma,scrollAncestorsToShowTarget:function(t){ba(xa(t),(()=>new na(t)))}});class Ca{constructor(t){this.document=new Jn(t),this.domConverter=new is(this.document),this.domRoots=new Map,this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new Uo(this.domConverter,this.document.selection),this._renderer.bind("isFocused","isSelecting").to(this.document),this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this._writer=new _o(this.document),this.addObserver(Is),this.addObserver(Js),this.addObserver(Ys),this.addObserver(Ns),this.addObserver(Gs),this.addObserver(Qs),this.addObserver(fa),ro.isAndroid&&this.addObserver(Xs),this.document.on("arrowKey",Bo,{priority:"low"}),fo(this),this.on("render",(()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1})),this.listenTo(this.document.selection,"change",(()=>{this._hasChangedSinceTheLastRendering=!0})),this.listenTo(this.document,"change:isFocused",(()=>{this._hasChangedSinceTheLastRendering=!0}))}attachDomRoot(t,e="main"){const i=this.document.getRoot(e);i._name=t.tagName.toLowerCase();const r={};for(const{name:e,value:n}of Array.from(t.attributes))r[e]=n,"class"===e?this._writer.addClass(n.split(" "),i):this._writer.setAttribute(e,n,i);this._initialDomRootAttributes.set(t,r);const n=()=>{this._writer.setAttribute("contenteditable",!i.isReadOnly,i),i.isReadOnly?this._writer.addClass("ck-read-only",i):this._writer.removeClass("ck-read-only",i)};n(),this.domRoots.set(e,t),this.domConverter.bindElements(t,i),this._renderer.markToSync("children",i),this._renderer.markToSync("attributes",i),this._renderer.domDocuments.add(t.ownerDocument),i.on("change:children",((t,e)=>this._renderer.markToSync("children",e))),i.on("change:attributes",((t,e)=>this._renderer.markToSync("attributes",e))),i.on("change:text",((t,e)=>this._renderer.markToSync("text",e))),i.on("change:isReadOnly",(()=>this.change(n))),i.on("change",(()=>{this._hasChangedSinceTheLastRendering=!0}));for(const i of this._observers.values())i.observe(t,e)}detachDomRoot(t){const e=this.domRoots.get(t);Array.from(e.attributes).forEach((({name:t})=>e.removeAttribute(t)));const i=this._initialDomRootAttributes.get(e);for(const t in i)e.setAttribute(t,i[t]);this.domRoots.delete(t),this.domConverter.unbindDomElement(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,i]of this.domRoots)e.observe(i,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&&ma({target:this.domConverter.viewRangeToDom(t),viewportOffset:20})}focus(){if(!this.document.isFocused){const t=this.document.selection.editableElement;t&&(this.domConverter.focus(t),this.forceRender())}}change(t){if(this.isRenderingInProgress||this._postFixersInProgress)throw new c("cannot-change-view-tree",this);try{if(this._ongoingChange)return t(this._writer);this._ongoingChange=!0;const e=t(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),e}catch(t){c.rethrowUnexpectedError(t,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.change((()=>{}))}destroy(){for(const t of this._observers.values())t.destroy();this.document.destroy(),this.stopListening()}createPositionAt(t,e){return Vn._createAt(t,e)}createPositionAfter(t){return Vn._createAfter(t)}createPositionBefore(t){return Vn._createBefore(t)}createRange(t,e){return new Dn(t,e)}createRangeOn(t){return Dn._createOn(t)}createRangeIn(t){return Dn._createIn(t)}createSelection(t,e,i){return new Fn(t,e,i)}_disableRendering(t){this._renderingDisabled=t,0==t&&this.change((()=>{}))}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}de(Ca,oe);class Ta{constructor(t){this.parent=null,this._attrs=zr(t)}get index(){let t;if(!this.parent)return null;if(null===(t=this.parent.getChildIndex(this)))throw new c("model-node-not-found-in-parent",this);return t}get startOffset(){let t;if(!this.parent)return null;if(null===(t=this.parent.getChildStartOffset(this)))throw new c("model-node-not-found-in-parent",this);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}isAttached(){return this.root.is("rootElement")}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 i=t.includeSelf?this:this.parent;for(;i;)e[t.parentFirst?"push":"unshift"](i),i=i.parent;return e}getCommonAncestor(t,e={}){const i=this.getAncestors(e),r=t.getAncestors(e);let n=0;for(;i[n]==r[n]&&i[n];)n++;return 0===n?null:i[n-1]}isBefore(t){if(this==t)return!1;if(this.root!==t.root)return!1;const e=this.getPath(),i=t.getPath(),r=Nr(e,i);switch(r){case"prefix":return!0;case"extension":return!1;default:return e[r](t[e[0]]=e[1],t)),{})),t}is(t){return"node"===t||"model:node"===t}_clone(){return new Ta(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(t,e){this._attrs.set(t,e)}_setAttributesTo(t){this._attrs=zr(t)}_removeAttribute(t){return this._attrs.delete(t)}_clearAttributes(){this._attrs.clear()}}class Pa extends Ta{constructor(t,e){super(e),this._data=t||""}get offsetSize(){return this.data.length}get data(){return this._data}is(t){return"$text"===t||"model:$text"===t||"text"===t||"model:text"===t||"node"===t||"model:node"===t}toJSON(){const t=super.toJSON();return t.data=this.data,t}_clone(){return new Pa(this.data,this.getAttributes())}static fromJSON(t){return new Pa(t.data,t.attributes)}}class Ea{constructor(t,e,i){if(this.textNode=t,e<0||e>t.offsetSize)throw new c("model-textproxy-wrong-offsetintext",this);if(i<0||e+i>t.offsetSize)throw new c("model-textproxy-wrong-length",this);this.data=t.data.substring(e,e+i),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}is(t){return"$textProxy"===t||"model:$textProxy"===t||"textProxy"===t||"model: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 i=t.includeSelf?this:this.parent;for(;i;)e[t.parentFirst?"push":"unshift"](i),i=i.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 Sa{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 c("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(e)}offsetToIndex(t){let e=0;for(const i of this._nodes){if(t>=e&&tt.toJSON()))}}class Ra extends Ta{constructor(t,e,i){super(e),this.name=t,this._children=new Sa,i&&this._insertChild(0,i)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}is(t,e=null){return e?e===this.name&&("element"===t||"model:element"===t):"element"===t||"model:element"===t||"node"===t||"model:node"===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 i of t)e=e.getChild(e.offsetToIndex(i));return e}findAncestor(t,e={includeSelf:!1}){let i=e.includeSelf?this:this.parent;for(;i;){if(i.name===t)return i;i=i.parent}return null}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 Ra(this.name,this.getAttributes(),e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const i=function(t){if("string"==typeof t)return[new Pa(t)];Cr(t)||(t=[t]);return Array.from(t).map((t=>"string"==typeof t?new Pa(t):t instanceof Ea?new Pa(t.data,t.getAttributes()):t))}(e);for(const t of i)null!==t.parent&&t._remove(),t.parent=this;this._children._insertNodes(t,i)}_removeChildren(t,e=1){const i=this._children._removeNodes(t,e);for(const t of i)t.parent=null;return i}static fromJSON(t){let e=null;if(t.children){e=[];for(const i of t.children)i.name?e.push(Ra.fromJSON(i)):e.push(Pa.fromJSON(i))}return new Ra(t.name,t.attributes,e)}}class Ia{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new c("model-tree-walker-no-start-position",null);const e=t.direction||"forward";if("forward"!=e&&"backward"!=e)throw new c("model-tree-walker-unknown-direction",t,{direction:e});this.direction=e,this.boundaries=t.boundaries||null,t.startPosition?this.position=t.startPosition.clone():this.position=Ma._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",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,i,r,n;do{r=this.position,n=this._visitedParent,({done:e,value:i}=this.next())}while(!e&&t(i));e||(this.position=r,this._visitedParent=n)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const t=this.position,e=this.position.clone(),i=this._visitedParent;if(null===i.parent&&e.offset===i.maxOffset)return{done:!0};if(i===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0};const r=e.parent,n=Na(e,r),o=n||La(e,r,n);if(o instanceof Ra)return this.shallow?e.offset++:(e.path.push(0),this._visitedParent=o),this.position=e,Oa("elementStart",o,t,e,1);if(o instanceof Pa){let r;if(this.singleCharacters)r=1;else{let t=o.endOffset;this._boundaryEndParent==i&&this.boundaries.end.offsett&&(t=this.boundaries.start.offset),r=e.offset-t}const n=e.offset-o.startOffset,s=new Ea(o,n-r,r);return e.offset-=r,this.position=e,Oa("text",s,t,e,r)}return e.path.pop(),this.position=e,this._visitedParent=i.parent,Oa("elementStart",i,t,e,1)}}function Oa(t,e,i,r,n){return{done:!1,value:{type:t,item:e,previousPosition:i,nextPosition:r,length:n}}}class Ma{constructor(t,e,i="toNone"){if(!t.is("element")&&!t.is("documentFragment"))throw new c("model-position-root-invalid",t);if(!(e instanceof Array)||0===e.length)throw new c("model-position-path-incorrect-format",t,{path:e});t.is("rootElement")?e=e.slice():(e=[...t.getPath(),...e],t=t.root),this.root=t,this.path=e,this.stickiness=i}get offset(){return this.path[this.path.length-1]}set offset(t){this.path[this.path.length-1]=t}get parent(){let t=this.root;for(let e=0;ei.path.length){if(e.offset!==r.maxOffset)return!1;e.path=e.path.slice(0,-1),r=r.parent,e.offset++}else{if(0!==i.offset)return!1;i.path=i.path.slice(0,-1)}}}is(t){return"position"===t||"model:position"===t}hasSameParentAs(t){if(this.root!==t.root)return!1;return"same"==Nr(this.getParentPath(),t.getParentPath())}getTransformedByOperation(t){let e;switch(t.type){case"insert":e=this._getTransformedByInsertOperation(t);break;case"move":case"remove":case"reinsert":e=this._getTransformedByMoveOperation(t);break;case"split":e=this._getTransformedBySplitOperation(t);break;case"merge":e=this._getTransformedByMergeOperation(t);break;default:e=Ma._createAt(this)}return e}_getTransformedByInsertOperation(t){return this._getTransformedByInsertion(t.position,t.howMany)}_getTransformedByMoveOperation(t){return this._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany)}_getTransformedBySplitOperation(t){const e=t.movedRange;return e.containsPosition(this)||e.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(t.splitPosition,t.moveTargetPosition):t.graveyardPosition?this._getTransformedByMove(t.graveyardPosition,t.insertionPosition,1):this._getTransformedByInsertion(t.insertionPosition,1)}_getTransformedByMergeOperation(t){const e=t.movedRange;let i;return e.containsPosition(this)||e.start.isEqual(this)?(i=this._getCombined(t.sourcePosition,t.targetPosition),t.sourcePosition.isBefore(t.targetPosition)&&(i=i._getTransformedByDeletion(t.deletionPosition,1))):i=this.isEqual(t.deletionPosition)?Ma._createAt(t.deletionPosition):this._getTransformedByMove(t.deletionPosition,t.graveyardPosition,1),i}_getTransformedByDeletion(t,e){const i=Ma._createAt(this);if(this.root!=t.root)return i;if("same"==Nr(t.getParentPath(),this.getParentPath())){if(t.offsetthis.offset)return null;i.offset-=e}}else if("prefix"==Nr(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;i.path[r]-=e}}return i}_getTransformedByInsertion(t,e){const i=Ma._createAt(this);if(this.root!=t.root)return i;if("same"==Nr(t.getParentPath(),this.getParentPath()))(t.offsete+1;){const e=r.maxOffset-i.offset;0!==e&&t.push(new Da(i,i.getShiftedBy(e))),i.path=i.path.slice(0,-1),i.offset++,r=r.parent}for(;i.path.length<=this.end.path.length;){const e=this.end.path[i.path.length-1],r=e-i.offset;0!==r&&t.push(new Da(i,i.getShiftedBy(r))),i.offset=e,i.path.push(0)}return t}getWalker(t={}){return t.boundaries=this,new Ia(t)}*getItems(t={}){t.boundaries=this,t.ignoreElementEnd=!0;const e=new Ia(t);for(const t of e)yield t.item}*getPositions(t={}){t.boundaries=this;const e=new Ia(t);yield e.position;for(const t of e)yield t.nextPosition}getTransformedByOperation(t){switch(t.type){case"insert":return this._getTransformedByInsertOperation(t);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(t);case"split":return[this._getTransformedBySplitOperation(t)];case"merge":return[this._getTransformedByMergeOperation(t)]}return[new Da(this.start,this.end)]}getTransformedByOperations(t){const e=[new Da(this.start,this.end)];for(const i of t)for(let t=0;t0?new this(i,r):new this(r,i)}static _createIn(t){return new this(Ma._createAt(t,0),Ma._createAt(t,t.maxOffset))}static _createOn(t){return this._createFromPositionAndShift(Ma._createBefore(t),t.offsetSize)}static _createFromRanges(t){if(0===t.length)throw new c("range-create-from-ranges-empty-array",null);if(1==t.length)return t[0].clone();const e=t[0];t.sort(((t,e)=>t.start.isAfter(e.start)?1:-1));const i=t.indexOf(e),r=new this(e.start,e.end);if(i>0)for(let e=i-1;t[e].end.isEqual(r.start);e++)r.start=Ma._createAt(t[e].start);for(let e=i+1;e{if(e.viewPosition)return;const i=this._modelToViewMapping.get(e.modelPosition.parent);e.viewPosition=this.findPositionIn(i,e.modelPosition.offset)}),{priority:"low"}),this.on("viewToModelPosition",((t,e)=>{if(e.modelPosition)return;const i=this.findMappedViewAncestor(e.viewPosition),r=this._viewToModelMapping.get(i),n=this._toModelOffset(e.viewPosition.parent,e.viewPosition.offset,i);e.modelPosition=Ma._createAt(r,n)}),{priority:"low"})}bindElements(t,e){this._modelToViewMapping.set(t,e),this._viewToModelMapping.set(e,t)}unbindViewElement(t){const e=this.toModelElement(t);if(this._viewToModelMapping.delete(t),this._elementToMarkerNames.has(t))for(const e of this._elementToMarkerNames.get(t))this._unboundMarkerNames.add(e);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 i=this._markerNameToElements.get(e)||new Set;i.add(t);const r=this._elementToMarkerNames.get(t)||new Set;r.add(e),this._markerNameToElements.set(e,i),this._elementToMarkerNames.set(t,r)}unbindElementFromMarkerName(t,e){const i=this._markerNameToElements.get(e);i&&(i.delete(t),0==i.size&&this._markerNameToElements.delete(e));const r=this._elementToMarkerNames.get(t);r&&(r.delete(e),0==r.size&&this._elementToMarkerNames.delete(t))}flushUnboundMarkerNames(){const t=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),t}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set}toModelElement(t){return this._viewToModelMapping.get(t)}toViewElement(t){return this._modelToViewMapping.get(t)}toModelRange(t){return new Da(this.toModelPosition(t.start),this.toModelPosition(t.end))}toViewRange(t){return new Dn(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 i={modelPosition:t,mapper:this,isPhantom:e.isPhantom};return this.fire("modelToViewPosition",i),i.viewPosition}markerNameToElements(t){const e=this._markerNameToElements.get(t);if(!e)return null;const i=new Set;for(const t of e)if(t.is("attributeElement"))for(const e of t.getElementsWithSameId())i.add(e);else i.add(t);return i}registerViewToModelLength(t,e){this._viewToModelLengthCallbacks.set(t,e)}findMappedViewAncestor(t){let e=t.parent;for(;!this._viewToModelMapping.has(e);)e=e.parent;return e}_toModelOffset(t,e,i){if(i!=t){return this._toModelOffset(t.parent,t.index,i)+this._toModelOffset(t,e,t)}if(t.is("$text"))return e;let r=0;for(let i=0;i1?e[0]+":"+e[1]:e[0]}class qa{constructor(t){this.conversionApi=Object.assign({dispatcher:this},t),this._reconversionEventsMapping=new Map}convertChanges(t,e,i){for(const e of t.getMarkersToRemove())this.convertMarkerRemove(e.name,e.range,i);const r=this._mapChangesWithAutomaticReconversion(t);for(const t of r)"insert"===t.type?this.convertInsert(Da._createFromPositionAndShift(t.position,t.length),i):"remove"===t.type?this.convertRemove(t.position,t.length,t.name,i):"reconvert"===t.type?this.reconvertElement(t.element,i):this.convertAttribute(t.range,t.attributeKey,t.attributeOldValue,t.attributeNewValue,i);for(const t of this.conversionApi.mapper.flushUnboundMarkerNames()){const r=e.get(t).getRange();this.convertMarkerRemove(t,r,i),this.convertMarkerAdd(t,r,i)}for(const e of t.getMarkersToAdd())this.convertMarkerAdd(e.name,e.range,i)}convertInsert(t,e){this.conversionApi.writer=e,this.conversionApi.consumable=this._createInsertConsumable(t);for(const e of Array.from(t).map($a))this._convertInsertWithAttributes(e);this._clearConversionApi()}convertRemove(t,e,i,r){this.conversionApi.writer=r,this.fire("remove:"+i,{position:t,length:e},this.conversionApi),this._clearConversionApi()}convertAttribute(t,e,i,r,n){this.conversionApi.writer=n,this.conversionApi.consumable=this._createConsumableForRange(t,`attribute:${e}`);for(const n of t){const t={item:n.item,range:Da._createFromPositionAndShift(n.previousPosition,n.length),attributeKey:e,attributeOldValue:i,attributeNewValue:r};this._testAndFire(`attribute:${e}`,t)}this._clearConversionApi()}reconvertElement(t,e){const i=Da._createOn(t);this.conversionApi.writer=e,this.conversionApi.consumable=this._createInsertConsumable(i);const r=this.conversionApi.mapper,n=r.toViewElement(t);e.remove(n),this._convertInsertWithAttributes({item:t,range:i});const o=r.toViewElement(t);for(const i of Da._createIn(t)){const{item:t}=i,n=Ha(t,r);n?n.root!==o.root&&e.move(e.createRangeOn(n),r.toViewPosition(Ma._createBefore(t))):this._convertInsertWithAttributes($a(i))}r.unbindViewElement(n),this._clearConversionApi()}convertSelection(t,e,i){const r=Array.from(e.getMarkersAtPosition(t.getFirstPosition()));if(this.conversionApi.writer=i,this.conversionApi.consumable=this._createSelectionConsumable(t,r),this.fire("selection",{selection:t},this.conversionApi),t.isCollapsed){for(const e of r){const i=e.getRange();if(!ja(t.getFirstPosition(),e,this.conversionApi.mapper))continue;const r={item:t,markerName:e.name,markerRange:i};this.conversionApi.consumable.test(t,"addMarker:"+e.name)&&this.fire("addMarker:"+e.name,r,this.conversionApi)}for(const e of t.getAttributeKeys()){const i={item:t,range:t.getFirstRange(),attributeKey:e,attributeOldValue:null,attributeNewValue:t.getAttribute(e)};this.conversionApi.consumable.test(t,"attribute:"+i.attributeKey)&&this.fire("attribute:"+i.attributeKey+":$text",i,this.conversionApi)}this._clearConversionApi()}else this._clearConversionApi()}convertMarkerAdd(t,e,i){if("$graveyard"==e.root.rootName)return;this.conversionApi.writer=i;const r="addMarker:"+t,n=new za;if(n.add(e,r),this.conversionApi.consumable=n,this.fire(r,{markerName:t,markerRange:e},this.conversionApi),n.test(e,r)){this.conversionApi.consumable=this._createConsumableForRange(e,r);for(const i of e.getItems()){if(!this.conversionApi.consumable.test(i,r))continue;const n={item:i,range:Da._createOn(i),markerName:t,markerRange:e};this.fire(r,n,this.conversionApi)}this._clearConversionApi()}else this._clearConversionApi()}convertMarkerRemove(t,e,i){"$graveyard"!=e.root.rootName&&(this.conversionApi.writer=i,this.fire("removeMarker:"+t,{markerName:t,markerRange:e},this.conversionApi),this._clearConversionApi())}_mapReconversionTriggerEvent(t,e){this._reconversionEventsMapping.set(e,t)}_createInsertConsumable(t){const e=new za;for(const i of t){const t=i.item;e.add(t,"insert");for(const i of t.getAttributeKeys())e.add(t,"attribute:"+i)}return e}_createConsumableForRange(t,e){const i=new za;for(const r of t.getItems())i.add(r,e);return i}_createSelectionConsumable(t,e){const i=new za;i.add(t,"selection");for(const r of e)i.add(t,"addMarker:"+r.name);for(const e of t.getAttributeKeys())i.add(t,"attribute:"+e);return i}_testAndFire(t,e){this.conversionApi.consumable.test(e.item,t)&&this.fire(function(t,e){const i=e.item.name||"$text";return`${t}:${i}`}(t,e),e,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer,delete this.conversionApi.consumable}_convertInsertWithAttributes(t){this._testAndFire("insert",t);for(const e of t.item.getAttributeKeys())t.attributeKey=e,t.attributeOldValue=null,t.attributeNewValue=t.item.getAttribute(e),this._testAndFire(`attribute:${e}`,t)}_mapChangesWithAutomaticReconversion(t){const e=new Set,i=[];for(const r of t.getChanges()){const t=r.position||r.range.start,n=t.parent;if(Na(t,n)){i.push(r);continue}const o="attribute"===r.type?La(t,n,null):n;if(o.is("$text")){i.push(r);continue}let s;if(s="attribute"===r.type?`attribute:${r.attributeKey}:${o.name}`:`${r.type}:${r.name}`,this._isReconvertTriggerEvent(s,o.name)){if(e.has(o))continue;e.add(o),i.push({type:"reconvert",element:o})}else i.push(r)}return i}_isReconvertTriggerEvent(t,e){return this._reconversionEventsMapping.get(t)===e}}function ja(t,e,i){const r=e.getRange(),n=Array.from(t.getAncestors());n.shift(),n.reverse();return!n.some((t=>{if(r.containsItem(t)){return!!i.toViewElement(t).getCustomProperty("addHighlight")}}))}function $a(t){return{item:t.item,range:Da._createFromPositionAndShift(t.previousPosition,t.length)}}function Ha(t,e){if(t.is("textProxy")){const i=e.toViewPosition(Ma._createBefore(t)).parent;return i.is("$text")?i:null}return e.toViewElement(t)}de(qa,p);class Wa{constructor(t,e,i){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map,t&&this.setTo(t,e,i)}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 i=!1;for(const r of t._ranges)if(e.isEqual(r)){i=!0;break}if(!i)return!1}return!0}*getRanges(){for(const t of this._ranges)yield new Da(t.start,t.end)}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?new Da(t.start,t.end):null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?new Da(t.start,t.end):null}getFirstPosition(){const t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){const t=this.getLastRange();return t?t.end.clone():null}setTo(t,e,i){if(null===t)this._setRanges([]);else if(t instanceof Wa)this._setRanges(t.getRanges(),t.isBackward);else if(t&&"function"==typeof t.getRanges)this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof Da)this._setRanges([t],!!e&&!!e.backward);else if(t instanceof Ma)this._setRanges([new Da(t)]);else if(t instanceof Ta){const r=!!i&&!!i.backward;let n;if("in"==e)n=Da._createIn(t);else if("on"==e)n=Da._createOn(t);else{if(void 0===e)throw new c("model-selection-setto-required-second-parameter",[this,t]);n=new Da(Ma._createAt(t,e))}this._setRanges([n],r)}else{if(!Cr(t))throw new c("model-selection-setto-not-selectable",[this,t]);this._setRanges(t,e&&!!e.backward)}}_setRanges(t,e=!1){const i=(t=Array.from(t)).some((e=>{if(!(e instanceof Da))throw new c("model-selection-set-ranges-not-range",[this,t]);return this._ranges.every((t=>!t.isEqual(e)))}));if(t.length!==this._ranges.length||i){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 c("model-selection-setfocus-no-ranges",[this,t]);const i=Ma._createAt(t,e);if("same"==i.compareWith(this.focus))return;const r=this.anchor;this._ranges.length&&this._popRange(),"before"==i.compareWith(r)?(this._pushRange(new Da(i,r)),this._lastRangeBackward=!0):(this._pushRange(new Da(r,i)),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(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}is(t){return"selection"===t||"model:selection"===t}*getSelectedBlocks(){const t=new WeakSet;for(const e of this.getRanges()){const i=Ga(e.start,t);i&&Ja(i,e)&&(yield i);for(const i of e.getWalker()){const r=i.item;"elementEnd"==i.type&&Ka(r,t,e)&&(yield r)}const r=Ga(e.end,t);r&&!e.end.isTouching(Ma._createAt(r,0))&&Ja(r,e)&&(yield r)}}containsEntireContent(t=this.anchor.root){const e=Ma._createAt(t,0),i=Ma._createAt(t,"end");return e.isTouching(this.getFirstPosition())&&i.isTouching(this.getLastPosition())}_pushRange(t){this._checkRange(t),this._ranges.push(new Da(t.start,t.end))}_checkRange(t){for(let e=0;e0;)this._popRange()}_popRange(){this._ranges.pop()}}function Ua(t,e){return!e.has(t)&&(e.add(t),t.root.document.model.schema.isBlock(t)&&t.parent)}function Ka(t,e,i){return Ua(t,e)&&Ja(t,i)}function Ga(t,e){const i=t.parent.root.document.model.schema,r=t.parent.getAncestors({parentFirst:!0,includeSelf:!0});let n=!1;const o=r.find((t=>!n&&(n=i.isLimit(t),!n&&Ua(t,e))));return r.forEach((t=>e.add(t))),o}function Ja(t,e){const i=function(t){const e=t.root.document.model.schema;let i=t.parent;for(;i;){if(e.isBlock(i))return i;i=i.parent}}(t);if(!i)return!0;return!e.containsRange(Da._createOn(i),!0)}de(Wa,p);class Ya extends Da{constructor(t,e){super(t,e),Qa.call(this)}detach(){this.stopListening()}is(t){return"liveRange"===t||"model:liveRange"===t||"range"==t||"model:range"===t}toRange(){return new Da(this.start,this.end)}static fromRange(t){return new Ya(t.start,t.end)}}function Qa(){this.listenTo(this.root.document.model,"applyOperation",((t,e)=>{const i=e[0];i.isDocumentOperation&&Xa.call(this,i)}),{priority:"low"})}function Xa(t){const e=this.getTransformedByOperation(t),i=Da._createFromRanges(e),r=!i.isEqual(this),n=function(t,e){switch(e.type){case"insert":return t.containsPosition(e.position);case"move":case"remove":case"reinsert":case"merge":return t.containsPosition(e.sourcePosition)||t.start.isEqual(e.sourcePosition)||t.containsPosition(e.targetPosition);case"split":return t.containsPosition(e.splitPosition)||t.containsPosition(e.insertionPosition)}return!1}(this,t);let o=null;if(r){"$graveyard"==i.root.rootName&&(o="remove"==t.type?t.sourcePosition:t.deletionPosition);const e=this.toRange();this.start=i.start,this.end=i.end,this.fire("change:range",e,{deletionPosition:o})}else n&&this.fire("change:content",this.toRange(),{deletionPosition:o})}de(Ya,p);const Za="selection:";class tc{constructor(t){this._selection=new ec(t),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}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)}refresh(){this._selection._updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(t){this._selection.observeMarkers(t)}is(t){return"selection"===t||"model:selection"==t||"documentSelection"==t||"model:documentSelection"==t}_setFocus(t,e){this._selection.setFocus(t,e)}_setTo(t,e,i){this._selection.setTo(t,e,i)}_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 Za+t}static _isStoreAttributeKey(t){return t.startsWith(Za)}}de(tc,p);class ec extends Wa{constructor(t){super(),this.markers=new Tr({idProperty:"name"}),this._model=t.model,this._document=t,this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this._observedMarkers=new Set,this.listenTo(this._model,"applyOperation",((t,e)=>{const i=e[0];i.isDocumentOperation&&"marker"!=i.type&&"rename"!=i.type&&"noop"!=i.type&&(0==this._ranges.length&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))}),{priority:"lowest"}),this.on("change:range",(()=>{for(const t of this.getRanges())if(!this._document._validateSelectionRange(t))throw new c("document-selection-wrong-position",this,{range:t})})),this.listenTo(this._model.markers,"update",((t,e,i,r)=>{this._updateMarker(e,r)})),this.listenTo(this._document,"change",((t,e)=>{!function(t,e){const i=t.document.differ;for(const r of i.getChanges()){if("insert"!=r.type)continue;const i=r.position.parent;r.length===i.maxOffset&&t.enqueueChange(e,(t=>{const e=Array.from(i.getAttributeKeys()).filter((t=>t.startsWith(Za)));for(const r of e)t.removeAttribute(r,i)}))}}(this._model,e)}))}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{if(this._hasChangedRange=!0,e.root==this._document.graveyard){this._selectionRestorePosition=r.deletionPosition;const t=this._ranges.indexOf(e);this._ranges.splice(t,1),e.detach()}})),e}_updateMarkers(){if(!this._observedMarkers.size)return;const t=[];let e=!1;for(const e of this._model.markers){const i=e.name.split(":",1)[0];if(!this._observedMarkers.has(i))continue;const r=e.getRange();for(const i of this.getRanges())r.containsRange(i,!i.isCollapsed)&&t.push(e)}const i=Array.from(this.markers);for(const i of t)this.markers.has(i)||(this.markers.add(i),e=!0);for(const i of Array.from(this.markers))t.includes(i)||(this.markers.remove(i),e=!0);e&&this.fire("change:marker",{oldMarkers:i,directChange:!1})}_updateMarker(t,e){const i=t.name.split(":",1)[0];if(!this._observedMarkers.has(i))return;let r=!1;const n=Array.from(this.markers),o=this.markers.has(t);if(e){let i=!1;for(const t of this.getRanges())if(e.containsRange(t,!t.isCollapsed)){i=!0;break}i&&!o?(this.markers.add(t),r=!0):!i&&o&&(this.markers.remove(t),r=!0)}else o&&(this.markers.remove(t),r=!0);r&&this.fire("change:marker",{oldMarkers:n,directChange:!1})}_updateAttributes(t){const e=zr(this._getSurroundingAttributes()),i=zr(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())i.has(t)&&i.get(t)===e||r.push(t);for(const[t]of i)this.hasAttribute(t)||r.push(t);r.length>0&&this.fire("change:attribute",{attributeKeys:r,directChange:!1})}_setAttribute(t,e,i=!0){const r=i?"normal":"low";if("low"==r&&"normal"==this._attributePriority.get(t))return!1;return super.getAttribute(t)!==e&&(this._attrs.set(t,e),this._attributePriority.set(t,r),!0)}_removeAttribute(t,e=!0){const i=e?"normal":"low";return("low"!=i||"normal"!=this._attributePriority.get(t))&&(this._attributePriority.set(t,i),!!super.hasAttribute(t)&&(this._attrs.delete(t),!0))}_setAttributesTo(t){const e=new Set;for(const[e,i]of this.getAttributes())t.get(e)!==i&&this._removeAttribute(e,!1);for(const[i,r]of t){this._setAttribute(i,r,!1)&&e.add(i)}return e}*_getStoredAttributes(){const t=this.getFirstPosition().parent;if(this.isCollapsed&&t.isEmpty)for(const e of t.getAttributeKeys())if(e.startsWith(Za)){const i=e.substr(Za.length);yield[i,t.getAttribute(e)]}}_getSurroundingAttributes(){const t=this.getFirstPosition(),e=this._model.schema;let i=null;if(this.isCollapsed){const r=t.textNode?t.textNode:t.nodeBefore,n=t.textNode?t.textNode:t.nodeAfter;if(this.isGravityOverridden||(i=ic(r)),i||(i=ic(n)),!this.isGravityOverridden&&!i){let t=r;for(;t&&!e.isInline(t)&&!i;)t=t.previousSibling,i=ic(t)}if(!i){let t=n;for(;t&&!e.isInline(t)&&!i;)t=t.nextSibling,i=ic(t)}i||(i=this._getStoredAttributes())}else{const t=this.getFirstRange();for(const r of t){if(r.item.is("element")&&e.isObject(r.item))break;if("text"==r.type){i=r.item.getAttributes();break}}}return i}_fixGraveyardSelection(t){const e=this._model.schema.getNearestSelectionRange(t);e&&this._pushRange(e)}}function ic(t){return t instanceof Ea||t instanceof Pa?t.getAttributes():null}class rc{constructor(t){this._dispatchers=t}add(t){for(const e of this._dispatchers)t(e);return this}}const nc=function(t){return _r(t,5)};class oc extends rc{elementToElement(t){return this.add(function(t){return(t=nc(t)).view=cc(t.view,"container"),e=>{var i;if(e.on("insert:"+t.model,(i=t.view,(t,e,r)=>{const n=i(e.item,r);if(!n)return;if(!r.consumable.consume(e.item,"insert"))return;const o=r.mapper.toViewPosition(e.range.start);r.mapper.bindElements(e.item,n),r.writer.insert(o,n)}),{priority:t.converterPriority||"normal"}),t.triggerBy){if(t.triggerBy.attributes)for(const i of t.triggerBy.attributes)e._mapReconversionTriggerEvent(t.model,`attribute:${i}:${t.model}`);if(t.triggerBy.children)for(const i of t.triggerBy.children)e._mapReconversionTriggerEvent(t.model,`insert:${i}`),e._mapReconversionTriggerEvent(t.model,`remove:${i}`)}}}(t))}attributeToElement(t){return this.add(function(t){t=nc(t);let e="attribute:"+(t.model.key?t.model.key:t.model);t.model.name&&(e+=":"+t.model.name);if(t.model.values)for(const e of t.model.values)t.view[e]=cc(t.view[e],"attribute");else t.view=cc(t.view,"attribute");const i=lc(t);return r=>{r.on(e,function(t){return(e,i,r)=>{const n=t(i.attributeOldValue,r),o=t(i.attributeNewValue,r);if(!n&&!o)return;if(!r.consumable.consume(i.item,e.name))return;const s=r.writer,a=s.document.selection;if(i.item instanceof Wa||i.item instanceof tc)s.wrap(a.getFirstRange(),o);else{let t=r.mapper.toViewRange(i.range);null!==i.attributeOldValue&&n&&(t=s.unwrap(t,n)),null!==i.attributeNewValue&&o&&s.wrap(t,o)}}}(i),{priority:t.converterPriority||"normal"})}}(t))}attributeToAttribute(t){return this.add(function(t){t=nc(t);let e="attribute:"+(t.model.key?t.model.key:t.model);t.model.name&&(e+=":"+t.model.name);if(t.model.values)for(const e of t.model.values)t.view[e]=hc(t.view[e]);else t.view=hc(t.view);const i=lc(t);return r=>{var n;r.on(e,(n=i,(t,e,i)=>{const r=n(e.attributeOldValue,i),o=n(e.attributeNewValue,i);if(!r&&!o)return;if(!i.consumable.consume(e.item,t.name))return;const s=i.mapper.toViewElement(e.item),a=i.writer;if(!s)throw new c("conversion-attribute-to-attribute-on-text",[e,i]);if(null!==e.attributeOldValue&&r)if("class"==r.key){const t=Er(r.value);for(const e of t)a.removeClass(e,s)}else if("style"==r.key){const t=Object.keys(r.value);for(const e of t)a.removeStyle(e,s)}else a.removeAttribute(r.key,s);if(null!==e.attributeNewValue&&o)if("class"==o.key){const t=Er(o.value);for(const e of t)a.addClass(e,s)}else if("style"==o.key){const t=Object.keys(o.value);for(const e of t)a.setStyle(e,o.value[e],s)}else a.setAttribute(o.key,o.value,s)}),{priority:t.converterPriority||"normal"})}}(t))}markerToElement(t){return this.add(function(t){return(t=nc(t)).view=cc(t.view,"ui"),e=>{var i;e.on("addMarker:"+t.model,(i=t.view,(t,e,r)=>{e.isOpening=!0;const n=i(e,r);e.isOpening=!1;const o=i(e,r);if(!n||!o)return;const s=e.markerRange;if(s.isCollapsed&&!r.consumable.consume(s,t.name))return;for(const e of s)if(!r.consumable.consume(e.item,t.name))return;const a=r.mapper,c=r.writer;c.insert(a.toViewPosition(s.start),n),r.mapper.bindElementToMarker(n,e.markerName),s.isCollapsed||(c.insert(a.toViewPosition(s.end),o),r.mapper.bindElementToMarker(o,e.markerName)),t.stop()}),{priority:t.converterPriority||"normal"}),e.on("removeMarker:"+t.model,(t.view,(t,e,i)=>{const r=i.mapper.markerNameToElements(e.markerName);if(r){for(const t of r)i.mapper.unbindElementFromMarkerName(t,e.markerName),i.writer.clear(i.writer.createRangeOn(t),t);i.writer.clearClonedElementsGroup(e.markerName),t.stop()}}),{priority:t.converterPriority||"normal"})}}(t))}markerToHighlight(t){return this.add(function(t){return e=>{var i;e.on("addMarker:"+t.model,(i=t.view,(t,e,r)=>{if(!e.item)return;if(!(e.item instanceof Wa||e.item instanceof tc||e.item.is("$textProxy")))return;const n=dc(i,e,r);if(!n)return;if(!r.consumable.consume(e.item,t.name))return;const o=r.writer,s=sc(o,n),a=o.document.selection;if(e.item instanceof Wa||e.item instanceof tc)o.wrap(a.getFirstRange(),s,a);else{const t=r.mapper.toViewRange(e.range),i=o.wrap(t,s);for(const t of i.getItems())if(t.is("attributeElement")&&t.isSimilar(s)){r.mapper.bindElementToMarker(t,e.markerName);break}}}),{priority:t.converterPriority||"normal"}),e.on("addMarker:"+t.model,function(t){return(e,i,r)=>{if(!i.item)return;if(!(i.item instanceof Ra))return;const n=dc(t,i,r);if(!n)return;if(!r.consumable.test(i.item,e.name))return;const o=r.mapper.toViewElement(i.item);if(o&&o.getCustomProperty("addHighlight")){r.consumable.consume(i.item,e.name);for(const t of Da._createIn(i.item))r.consumable.consume(t.item,e.name);o.getCustomProperty("addHighlight")(o,n,r.writer),r.mapper.bindElementToMarker(o,i.markerName)}}}(t.view),{priority:t.converterPriority||"normal"}),e.on("removeMarker:"+t.model,function(t){return(e,i,r)=>{if(i.markerRange.isCollapsed)return;const n=dc(t,i,r);if(!n)return;const o=sc(r.writer,n),s=r.mapper.markerNameToElements(i.markerName);if(s){for(const t of s)r.mapper.unbindElementFromMarkerName(t,i.markerName),t.is("attributeElement")?r.writer.unwrap(r.writer.createRangeOn(t),o):t.getCustomProperty("removeHighlight")(t,n.id,r.writer);r.writer.clearClonedElementsGroup(i.markerName),e.stop()}}}(t.view),{priority:t.converterPriority||"normal"})}}(t))}markerToData(t){return this.add(function(t){const e=(t=nc(t)).model;t.view||(t.view=i=>({group:e,name:i.substr(t.model.length+1)}));return i=>{var r;i.on("addMarker:"+e,(r=t.view,(t,e,i)=>{const n=r(e.markerName,i);if(!n)return;const o=e.markerRange;i.consumable.consume(o,t.name)&&(ac(o,!1,i,e,n),ac(o,!0,i,e,n),t.stop())}),{priority:t.converterPriority||"normal"}),i.on("removeMarker:"+e,function(t){return(e,i,r)=>{const n=t(i.markerName,r);if(!n)return;const o=r.mapper.markerNameToElements(i.markerName);if(o){for(const t of o)r.mapper.unbindElementFromMarkerName(t,i.markerName),t.is("containerElement")?(s(`data-${n.group}-start-before`,t),s(`data-${n.group}-start-after`,t),s(`data-${n.group}-end-before`,t),s(`data-${n.group}-end-after`,t)):r.writer.clear(r.writer.createRangeOn(t),t);r.writer.clearClonedElementsGroup(i.markerName),e.stop()}function s(t,e){if(e.hasAttribute(t)){const i=new Set(e.getAttribute(t).split(","));i.delete(n.name),0==i.size?r.writer.removeAttribute(t,e):r.writer.setAttribute(t,Array.from(i).join(","),e)}}}}(t.view),{priority:t.converterPriority||"normal"})}}(t))}}function sc(t,e){const i=t.createAttributeElement("span",e.attributes);return e.classes&&i._addClass(e.classes),"number"==typeof e.priority&&(i._priority=e.priority),i._id=e.id,i}function ac(t,e,i,r,n){const o=e?t.start:t.end,s=o.nodeAfter&&o.nodeAfter.is("element")?o.nodeAfter:null,a=o.nodeBefore&&o.nodeBefore.is("element")?o.nodeBefore:null;if(s||a){let t,o;e&&s||!e&&!a?(t=s,o=!0):(t=a,o=!1);const c=i.mapper.toViewElement(t);if(c)return void function(t,e,i,r,n,o){const s=`data-${o.group}-${e?"start":"end"}-${i?"before":"after"}`,a=t.hasAttribute(s)?t.getAttribute(s).split(","):[];a.unshift(o.name),r.writer.setAttribute(s,a.join(","),t),r.mapper.bindElementToMarker(t,n.markerName)}(c,e,o,i,r,n)}!function(t,e,i,r,n){const o=`${n.group}-${e?"start":"end"}`,s=n.name?{name:n.name}:null,a=i.writer.createUIElement(o,s);i.writer.insert(t,a),i.mapper.bindElementToMarker(a,r.markerName)}(i.mapper.toViewPosition(o),e,i,r,n)}function cc(t,e){return"function"==typeof t?t:(i,r)=>function(t,e,i){"string"==typeof t&&(t={name:t});let r;const n=e.writer,o=Object.assign({},t.attributes);if("container"==i)r=n.createContainerElement(t.name,o);else if("attribute"==i){const e={priority:t.priority||Yn.DEFAULT_PRIORITY};r=n.createAttributeElement(t.name,o,e)}else r=n.createUIElement(t.name,o);if(t.styles){const e=Object.keys(t.styles);for(const i of e)n.setStyle(i,t.styles[i],r)}if(t.classes){const e=t.classes;if("string"==typeof e)n.addClass(e,r);else for(const t of e)n.addClass(t,r)}return r}(t,r,e)}function lc(t){return t.model.values?(e,i)=>{const r=t.view[e];return r?r(e,i):null}:t.view}function hc(t){return"string"==typeof t?e=>({key:t,value:e}):"object"==typeof t?t.value?()=>t:e=>({key:t.key,value:e}):t}function dc(t,e,i){const r="function"==typeof t?t(e,i):t;return r?(r.priority||(r.priority=10),r.id||(r.id=e.markerName),r):null}function uc(t){const{schema:e,document:i}=t.model;for(const r of i.getRootNames()){const n=i.getRoot(r);if(n.isEmpty&&!e.checkChild(n,"$text")&&e.checkChild(n,"paragraph"))return t.insertElement("paragraph",n),!0}return!1}function gc(t,e,i){const r=i.createContext(t);return!!i.checkChild(r,"paragraph")&&!!i.checkChild(r.push("paragraph"),e)}function fc(t,e){const i=e.createElement("paragraph");return e.insert(i,t),e.createPositionAt(i,0)}class mc extends rc{elementToElement(t){return this.add(pc(t))}elementToAttribute(t){return this.add(function(t){_c(t=nc(t));const e=kc(t,!1),i=bc(t.view),r=i?"element:"+i:"element";return i=>{i.on(r,e,{priority:t.converterPriority||"low"})}}(t))}attributeToAttribute(t){return this.add(function(t){t=nc(t);let e=null;("string"==typeof t.view||t.view.key)&&(e=function(t){"string"==typeof t.view&&(t.view={key:t.view});const e=t.view.key;let i;if("class"==e||"style"==e){i={["class"==e?"classes":"styles"]:t.view.value}}else{i={attributes:{[e]:void 0===t.view.value?/[\s\S]*/:t.view.value}}}t.view.name&&(i.name=t.view.name);return t.view=i,e}(t));_c(t,e);const i=kc(t,!0);return e=>{e.on("element",i,{priority:t.converterPriority||"low"})}}(t))}elementToMarker(t){return this.add(function(t){return function(t){const e=t.model;t.model=(t,i)=>{const r="string"==typeof e?e:e(t,i);return i.writer.createElement("$marker",{"data-name":r})}}(t=nc(t)),pc(t)}(t))}dataToMarker(t){return this.add(function(t){(t=nc(t)).model||(t.model=e=>e?t.view+":"+e:t.view);const e=wc(vc(t,"start")),i=wc(vc(t,"end"));return r=>{r.on("element:"+t.view+"-start",e,{priority:t.converterPriority||"normal"}),r.on("element:"+t.view+"-end",i,{priority:t.converterPriority||"normal"});const n=a.get("low"),o=a.get("highest"),s=a.get(t.converterPriority)/o;r.on("element",function(t){return(e,i,r)=>{const n=`data-${t.view}`;function o(e,n){for(const o of n){const n=t.model(o,r),s=r.writer.createElement("$marker",{"data-name":n});r.writer.insert(s,e),i.modelCursor.isEqual(e)?i.modelCursor=i.modelCursor.getShiftedBy(1):i.modelCursor=i.modelCursor._getTransformedByInsertion(e,1),i.modelRange=i.modelRange._getTransformedByInsertion(e,1)[0]}}(r.consumable.test(i.viewItem,{attributes:n+"-end-after"})||r.consumable.test(i.viewItem,{attributes:n+"-start-after"})||r.consumable.test(i.viewItem,{attributes:n+"-end-before"})||r.consumable.test(i.viewItem,{attributes:n+"-start-before"}))&&(i.modelRange||Object.assign(i,r.convertChildren(i.viewItem,i.modelCursor)),r.consumable.consume(i.viewItem,{attributes:n+"-end-after"})&&o(i.modelRange.end,i.viewItem.getAttribute(n+"-end-after").split(",")),r.consumable.consume(i.viewItem,{attributes:n+"-start-after"})&&o(i.modelRange.end,i.viewItem.getAttribute(n+"-start-after").split(",")),r.consumable.consume(i.viewItem,{attributes:n+"-end-before"})&&o(i.modelRange.start,i.viewItem.getAttribute(n+"-end-before").split(",")),r.consumable.consume(i.viewItem,{attributes:n+"-start-before"})&&o(i.modelRange.start,i.viewItem.getAttribute(n+"-start-before").split(",")))}}(t),{priority:n+s})}}(t))}}function pc(t){const e=wc(t=nc(t)),i=bc(t.view),r=i?"element:"+i:"element";return i=>{i.on(r,e,{priority:t.converterPriority||"normal"})}}function bc(t){return"string"==typeof t?t:"object"==typeof t&&"string"==typeof t.name?t.name:null}function wc(t){const e=new Fr(t.view);return(i,r,n)=>{const o=e.match(r.viewItem);if(!o)return;const s=o.match;if(s.name=!0,!n.consumable.test(r.viewItem,s))return;const a=function(t,e,i){return t instanceof Function?t(e,i):i.writer.createElement(t)}(t.model,r.viewItem,n);a&&n.safeInsert(a,r.modelCursor)&&(n.consumable.consume(r.viewItem,s),n.convertChildren(r.viewItem,a),n.updateConversionResult(a,r))}}function _c(t,e=null){const i=null===e||(t=>t.getAttribute(e)),r="object"!=typeof t.model?t.model:t.model.key,n="object"!=typeof t.model||void 0===t.model.value?i:t.model.value;t.model={key:r,value:n}}function kc(t,e){const i=new Fr(t.view);return(r,n,o)=>{const s=i.match(n.viewItem);if(!s)return;if(!function(t,e){const i="function"==typeof t?t(e):t;if("object"==typeof i&&!bc(i))return!1;return!i.classes&&!i.attributes&&!i.styles}(t.view,n.viewItem)?delete s.match.name:s.match.name=!0,!o.consumable.test(n.viewItem,s.match))return;const a=t.model.key,c="function"==typeof t.model.value?t.model.value(n.viewItem,o):t.model.value;if(null===c)return;n.modelRange||Object.assign(n,o.convertChildren(n.viewItem,n.modelCursor));const l=function(t,e,i,r){let n=!1;for(const o of Array.from(t.getItems({shallow:i})))r.schema.checkAttribute(o,e.key)&&(n=!0,o.hasAttribute(e.key)||r.writer.setAttribute(e.key,e.value,o));return n}(n.modelRange,{key:a,value:c},e,o);l&&o.consumable.consume(n.viewItem,s.match)}}function vc(t,e){const i={};return i.view=t.view+"-"+e,i.model=(e,i)=>{const r=e.getAttribute("name"),n=t.model(r,i);return i.writer.createElement("$marker",{"data-name":n})},i}class yc{constructor(t,e){this.model=t,this.view=new Ca(e),this.mapper=new Ba,this.downcastDispatcher=new qa({mapper:this.mapper,schema:t.schema});const i=this.model.document,r=i.selection,n=this.model.markers;this.listenTo(this.model,"_beforeChanges",(()=>{this.view._disableRendering(!0)}),{priority:"highest"}),this.listenTo(this.model,"_afterChanges",(()=>{this.view._disableRendering(!1)}),{priority:"lowest"}),this.listenTo(i,"change",(()=>{this.view.change((t=>{this.downcastDispatcher.convertChanges(i.differ,n,t),this.downcastDispatcher.convertSelection(r,n,t)}))}),{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(t,e){return(i,r)=>{const n=r.newSelection,o=[];for(const t of n.getRanges())o.push(e.toModelRange(t));const s=t.createSelection(o,{backward:n.isBackward});s.isEqual(t.document.selection)||t.change((t=>{t.setSelection(s)}))}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",((t,e,i)=>{if(!i.consumable.consume(e.item,"insert"))return;const r=i.writer,n=i.mapper.toViewPosition(e.range.start),o=r.createText(e.item.data);r.insert(n,o)}),{priority:"lowest"}),this.downcastDispatcher.on("remove",((t,e,i)=>{const r=i.mapper.toViewPosition(e.position),n=e.position.getShiftedBy(e.length),o=i.mapper.toViewPosition(n,{isPhantom:!0}),s=i.writer.createRange(r,o),a=i.writer.remove(s.getTrimmed());for(const t of i.writer.createRangeIn(a).getItems())i.mapper.unbindViewElement(t)}),{priority:"low"}),this.downcastDispatcher.on("selection",((t,e,i)=>{const r=i.writer,n=r.document.selection;for(const t of n.getRanges())t.isCollapsed&&t.end.parent.isAttached()&&i.writer.mergeAttributes(t.start);r.setSelection(null)}),{priority:"high"}),this.downcastDispatcher.on("selection",((t,e,i)=>{const r=e.selection;if(r.isCollapsed)return;if(!i.consumable.consume(r,"selection"))return;const n=[];for(const t of r.getRanges()){const e=i.mapper.toViewRange(t);n.push(e)}i.writer.setSelection(n,{backward:r.isBackward})}),{priority:"low"}),this.downcastDispatcher.on("selection",((t,e,i)=>{const r=e.selection;if(!r.isCollapsed)return;if(!i.consumable.consume(r,"selection"))return;const n=i.writer,o=r.getFirstPosition(),s=i.mapper.toViewPosition(o),a=n.breakAttributes(s);n.setSelection(a)}),{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using((t=>{if("$graveyard"==t.rootName)return null;const e=new Nn(this.view.document,t.name);return e.rootName=t.rootName,this.mapper.bindElements(t,e),e}))}destroy(){this.view.destroy(),this.stopListening()}}de(yc,oe);class xc{constructor(){this._commands=new Map}add(t,e){this._commands.set(t,e)}get(t){return this._commands.get(t)}execute(t,...e){const i=this.get(t);if(!i)throw new c("commandcollection-command-not-found",this,{commandName:t});return i.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()}}class Ac{constructor(){this._consumables=new Map}add(t,e){let i;t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!0):(this._consumables.has(t)?i=this._consumables.get(t):(i=new Cc(t),this._consumables.set(t,i)),i.add(e))}test(t,e){const i=this._consumables.get(t);return void 0===i?null:t.is("$text")||t.is("documentFragment")?i:i.test(e)}consume(t,e){return!!this.test(t,e)&&(t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!1):this._consumables.get(t).consume(e),!0)}revert(t,e){const i=this._consumables.get(t);void 0!==i&&(t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!0):i.revert(e))}static consumablesFromElement(t){const e={element:t,name:!0,attributes:[],classes:[],styles:[]},i=t.getAttributeKeys();for(const t of i)"style"!=t&&"class"!=t&&e.attributes.push(t);const r=t.getClassNames();for(const t of r)e.classes.push(t);const n=t.getStyleNames();for(const t of n)e.styles.push(t);return e}static createFrom(t,e){if(e||(e=new Ac(t)),t.is("$text"))return e.add(t),e;t.is("element")&&e.add(t,Ac.consumablesFromElement(t)),t.is("documentFragment")&&e.add(t);for(const i of t.getChildren())e=Ac.createFrom(i,e);return e}}class Cc{constructor(t){this.element=t,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(t){t.name&&(this._canConsumeName=!0);for(const e in this._consumables)e in t&&this._add(e,t[e])}test(t){if(t.name&&!this._canConsumeName)return this._canConsumeName;for(const e in this._consumables)if(e in t){const i=this._test(e,t[e]);if(!0!==i)return i}return!0}consume(t){t.name&&(this._canConsumeName=!1);for(const e in this._consumables)e in t&&this._consume(e,t[e])}revert(t){t.name&&(this._canConsumeName=!0);for(const e in this._consumables)e in t&&this._revert(e,t[e])}_add(t,e){const i=St(e)?e:[e],r=this._consumables[t];for(const e of i){if("attributes"===t&&("class"===e||"style"===e))throw new c("viewconsumable-invalid-attribute",this);if(r.set(e,!0),"styles"===t)for(const t of this.element.document.stylesProcessor.getRelatedStyles(e))r.set(t,!0)}}_test(t,e){const i=St(e)?e:[e],r=this._consumables[t];for(const e of i)if("attributes"!==t||"class"!==e&&"style"!==e){const t=r.get(e);if(void 0===t)return null;if(!t)return!1}else{const t="class"==e?"classes":"styles",i=this._test(t,[...this._consumables[t].keys()]);if(!0!==i)return i}return!0}_consume(t,e){const i=St(e)?e:[e],r=this._consumables[t];for(const e of i)if("attributes"!==t||"class"!==e&&"style"!==e){if(r.set(e,!1),"styles"==t)for(const t of this.element.document.stylesProcessor.getRelatedStyles(e))r.set(t,!1)}else{const t="class"==e?"classes":"styles";this._consume(t,[...this._consumables[t].keys()])}}_revert(t,e){const i=St(e)?e:[e],r=this._consumables[t];for(const e of i)if("attributes"!==t||"class"!==e&&"style"!==e){!1===r.get(e)&&r.set(e,!0)}else{const t="class"==e?"classes":"styles";this._revert(t,[...this._consumables[t].keys()])}}}class Tc{constructor(){this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",((t,e)=>{e[0]=new Pc(e[0])}),{priority:"highest"}),this.on("checkChild",((t,e)=>{e[0]=new Pc(e[0]),e[1]=this.getDefinition(e[1])}),{priority:"highest"})}register(t,e){if(this._sourceDefinitions[t])throw new c("schema-cannot-register-item-twice",this,{itemName:t});this._sourceDefinitions[t]=[Object.assign({},e)],this._clearCache()}extend(t,e){if(!this._sourceDefinitions[t])throw new c("schema-cannot-extend-missing-item",this,{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||e.isLimit&&e.isSelectable&&e.isContent)}isInline(t){const e=this.getDefinition(t);return!(!e||!e.isInline)}isSelectable(t){const e=this.getDefinition(t);return!!e&&!(!e.isSelectable&&!e.isObject)}isContent(t){const e=this.getDefinition(t);return!!e&&!(!e.isContent&&!e.isObject)}checkChild(t,e){return!!e&&this._checkContextMatch(e,t)}checkAttribute(t,e){const i=this.getDefinition(t.last);return!!i&&i.allowAttributes.includes(e)}checkMerge(t,e=null){if(t instanceof Ma){const e=t.nodeBefore,i=t.nodeAfter;if(!(e instanceof Ra))throw new c("schema-check-merge-no-element-before",this);if(!(i instanceof Ra))throw new c("schema-check-merge-no-element-after",this);return this.checkMerge(e,i)}for(const i of e.getChildren())if(!this.checkChild(t,i))return!1;return!0}addChildCheck(t){this.on("checkChild",((e,[i,r])=>{if(!r)return;const n=t(i,r);"boolean"==typeof n&&(e.stop(),e.return=n)}),{priority:"high"})}addAttributeCheck(t){this.on("checkAttribute",((e,[i,r])=>{const n=t(i,r);"boolean"==typeof n&&(e.stop(),e.return=n)}),{priority:"high"})}setAttributeProperties(t,e){this._attributeProperties[t]=Object.assign(this.getAttributeProperties(t),e)}getAttributeProperties(t){return this._attributeProperties[t]||{}}getLimitElement(t){let e;if(t instanceof Ma)e=t.parent;else{e=(t instanceof Da?[t]:Array.from(t.getRanges())).reduce(((t,e)=>{const i=e.getCommonAncestor();return t?t.getCommonAncestor(i,{includeSelf:!0}):i}),null)}for(;!this.isLimit(e)&&e.parent;)e=e.parent;return e}checkAttributeInSelection(t,e){if(t.isCollapsed){const i=[...t.getFirstPosition().getAncestors(),new Pa("",t.getAttributes())];return this.checkAttribute(i,e)}{const i=t.getRanges();for(const t of i)for(const i of t)if(this.checkAttribute(i.item,e))return!0}return!1}*getValidRanges(t,e){t=function*(t){for(const e of t)yield*e.getMinimalFlatRanges()}(t);for(const i of t)yield*this._getValidRangesForRange(i,e)}getNearestSelectionRange(t,e="both"){if(this.checkChild(t,"$text"))return new Da(t);let i,r;const n=t.getAncestors().reverse().find((t=>this.isLimit(t)))||t.root;"both"!=e&&"backward"!=e||(i=new Ia({boundaries:Da._createIn(n),startPosition:t,direction:"backward"})),"both"!=e&&"forward"!=e||(r=new Ia({boundaries:Da._createIn(n),startPosition:t}));for(const t of function*(t,e){let i=!1;for(;!i;){if(i=!0,t){const e=t.next();e.done||(i=!1,yield{walker:t,value:e.value})}if(e){const t=e.next();t.done||(i=!1,yield{walker:e,value:t.value})}}}(i,r)){const e=t.walker==i?"elementEnd":"elementStart",r=t.value;if(r.type==e&&this.isObject(r.item))return Da._createOn(r.item);if(this.checkChild(r.nextPosition,"$text"))return new Da(r.nextPosition)}return null}findAllowedParent(t,e){let i=t.parent;for(;i;){if(this.checkChild(i,e))return i;if(this.isLimit(i))return null;i=i.parent}return null}removeDisallowedAttributes(t,e){for(const i of t)if(i.is("$text"))Fc(this,i,e);else{const t=Da._createIn(i).getPositions();for(const i of t){Fc(this,i.nodeBefore||i.parent,e)}}}createContext(t){return new Pc(t)}_clearCache(){this._compiledDefinitions=null}_compile(){const t={},e=this._sourceDefinitions,i=Object.keys(e);for(const r of i)t[r]=Ec(e[r],r);for(const e of i)Sc(t,e);for(const e of i)Rc(t,e);for(const e of i)Ic(t,e);for(const e of i)Oc(t,e),Mc(t,e);for(const e of i)Nc(t,e),Lc(t,e),Vc(t,e);this._compiledDefinitions=t}_checkContextMatch(t,e,i=e.length-1){const r=e.getItem(i);if(t.allowIn.includes(r.name)){if(0==i)return!0;{const t=this.getDefinition(r);return this._checkContextMatch(t,e,i-1)}}return!1}*_getValidRangesForRange(t,e){let i=t.start,r=t.start;for(const n of t.getItems({shallow:!0}))n.is("element")&&(yield*this._getValidRangesForRange(Da._createIn(n),e)),this.checkAttribute(n,e)||(i.isEqual(r)||(yield new Da(i,r)),i=Ma._createAfter(n)),r=Ma._createAfter(n);i.isEqual(r)||(yield new Da(i,r))}}de(Tc,oe);class Pc{constructor(t){if(t instanceof Pc)return t;"string"==typeof t?t=[t]:Array.isArray(t)||(t=t.getAncestors({includeSelf:!0})),this._items=t.map(zc)}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 Pc([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)}startsWith(t){return Array.from(this.getNames()).join(" ").startsWith(t)}}function Ec(t,e){const i={name:e,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],allowChildren:[],inheritTypesFrom:[]};return function(t,e){for(const i of t){const t=Object.keys(i).filter((t=>t.startsWith("is")));for(const r of t)e[r]=i[r]}}(t,i),Dc(t,i,"allowIn"),Dc(t,i,"allowContentOf"),Dc(t,i,"allowWhere"),Dc(t,i,"allowAttributes"),Dc(t,i,"allowAttributesOf"),Dc(t,i,"allowChildren"),Dc(t,i,"inheritTypesFrom"),function(t,e){for(const i of t){const t=i.inheritAllFrom;t&&(e.allowContentOf.push(t),e.allowWhere.push(t),e.allowAttributesOf.push(t),e.inheritTypesFrom.push(t))}}(t,i),i}function Sc(t,e){const i=t[e];for(const r of i.allowChildren){const i=t[r];i&&i.allowIn.push(e)}i.allowChildren.length=0}function Rc(t,e){for(const i of t[e].allowContentOf)if(t[i]){Bc(t,i).forEach((t=>{t.allowIn.push(e)}))}delete t[e].allowContentOf}function Ic(t,e){for(const i of t[e].allowWhere){const r=t[i];if(r){const i=r.allowIn;t[e].allowIn.push(...i)}}delete t[e].allowWhere}function Oc(t,e){for(const i of t[e].allowAttributesOf){const r=t[i];if(r){const i=r.allowAttributes;t[e].allowAttributes.push(...i)}}delete t[e].allowAttributesOf}function Mc(t,e){const i=t[e];for(const e of i.inheritTypesFrom){const r=t[e];if(r){const t=Object.keys(r).filter((t=>t.startsWith("is")));for(const e of t)e in i||(i[e]=r[e])}}delete i.inheritTypesFrom}function Nc(t,e){const i=t[e],r=i.allowIn.filter((e=>t[e]));i.allowIn=Array.from(new Set(r))}function Lc(t,e){const i=t[e];for(const r of i.allowIn){t[r].allowChildren.push(e)}}function Vc(t,e){const i=t[e];i.allowAttributes=Array.from(new Set(i.allowAttributes))}function Dc(t,e,i){for(const r of t)"string"==typeof r[i]?e[i].push(r[i]):Array.isArray(r[i])&&e[i].push(...r[i])}function Bc(t,e){const i=t[e];return(r=t,Object.keys(r).map((t=>r[t]))).filter((t=>t.allowIn.includes(i.name)));var r}function zc(t){return"string"==typeof t||t.is("documentFragment")?{name:"string"==typeof t?t:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:t.is("element")?t.name:"$text",*getAttributeKeys(){yield*t.getAttributeKeys()},getAttribute:e=>t.getAttribute(e)}}function Fc(t,e,i){for(const r of e.getAttributeKeys())t.checkAttribute(e,r)||i.removeAttribute(r,e)}class qc{constructor(t={}){this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this.conversionApi=Object.assign({},t),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this),this.conversionApi.safeInsert=this._safeInsert.bind(this),this.conversionApi.updateConversionResult=this._updateConversionResult.bind(this),this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this),this.conversionApi.getSplitParts=this._getSplitParts.bind(this)}convert(t,e,i=["$root"]){this.fire("viewCleanup",t),this._modelCursor=function(t,e){let i;for(const r of new Pc(t)){const t={};for(const e of r.getAttributeKeys())t[e]=r.getAttribute(e);const n=e.createElement(r.name,t);i&&e.append(n,i),i=Ma._createAt(n,0)}return i}(i,e),this.conversionApi.writer=e,this.conversionApi.consumable=Ac.createFrom(t),this.conversionApi.store={};const{modelRange:r}=this._convertItem(t,this._modelCursor),n=e.createDocumentFragment();if(r){this._removeEmptyElements();for(const t of Array.from(this._modelCursor.parent.getChildren()))e.append(t,n);n.markers=function(t,e){const i=new Set,r=new Map,n=Da._createIn(t).getItems();for(const t of n)"$marker"==t.name&&i.add(t);for(const t of i){const i=t.getAttribute("data-name"),n=e.createPositionBefore(t);r.has(i)?r.get(i).end=n.clone():r.set(i,new Da(n.clone())),e.remove(t)}return r}(n,e)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,n}_convertItem(t,e){const i=Object.assign({viewItem:t,modelCursor:e,modelRange:null});if(t.is("element")?this.fire("element:"+t.name,i,this.conversionApi):t.is("$text")?this.fire("text",i,this.conversionApi):this.fire("documentFragment",i,this.conversionApi),i.modelRange&&!(i.modelRange instanceof Da))throw new c("view-conversion-dispatcher-incorrect-result",this);return{modelRange:i.modelRange,modelCursor:i.modelCursor}}_convertChildren(t,e){let i=e.is("position")?e:Ma._createAt(e,0);const r=new Da(i);for(const e of Array.from(t.getChildren())){const t=this._convertItem(e,i);t.modelRange instanceof Da&&(r.end=t.modelRange.end,i=t.modelCursor)}return{modelRange:r,modelCursor:i}}_safeInsert(t,e){const i=this._splitToAllowedParent(t,e);return!!i&&(this.conversionApi.writer.insert(t,i.position),!0)}_updateConversionResult(t,e){const i=this._getSplitParts(t),r=this.conversionApi.writer;e.modelRange||(e.modelRange=r.createRange(r.createPositionBefore(t),r.createPositionAfter(i[i.length-1])));const n=this._cursorParents.get(t);e.modelCursor=n?r.createPositionAt(n,0):e.modelRange.end}_splitToAllowedParent(t,e){const{schema:i,writer:r}=this.conversionApi;let n=i.findAllowedParent(e,t);if(n){if(n===e.parent)return{position:e};this._modelCursor.parent.getAncestors().includes(n)&&(n=null)}if(!n)return gc(e,t,i)?{position:fc(e,r)}:null;const o=this.conversionApi.writer.split(e,n),s=[];for(const t of o.range.getWalker())if("elementEnd"==t.type)s.push(t.item);else{const e=s.pop(),i=t.item;this._registerSplitPair(e,i)}const a=o.range.end.parent;return this._cursorParents.set(t,a),{position:o.position,cursorParent:a}}_registerSplitPair(t,e){this._splitParts.has(t)||this._splitParts.set(t,[t]);const i=this._splitParts.get(t);this._splitParts.set(e,i),i.push(e)}_getSplitParts(t){let e;return e=this._splitParts.has(t)?this._splitParts.get(t):[t],e}_removeEmptyElements(){let t=!1;for(const e of this._splitParts.keys())e.isEmpty&&(this.conversionApi.writer.remove(e),this._splitParts.delete(e),t=!0);t&&this._removeEmptyElements()}}de(qc,p);class jc{getHtml(t){const e=document.implementation.createHTMLDocument("").createElement("div");return e.appendChild(t),e.innerHTML}}class $c{constructor(t){this.domParser=new DOMParser,this.domConverter=new is(t,{renderingMode:"data"}),this.htmlWriter=new jc}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)}registerRawContentMatcher(t){this.domConverter.registerRawContentMatcher(t)}useFillerType(t){this.domConverter.blockFillerMode="marked"==t?"markedNbsp":"nbsp"}_toDom(t){const e=this.domParser.parseFromString(t,"text/html"),i=e.createDocumentFragment();let r=e.firstChild;for(;!r.isSameNode(e.documentElement);){const t=r;r=r.nextSibling,t.nodeType==Node.COMMENT_NODE&&i.appendChild(t)}const n=e.body.childNodes;for(;n.length>0;)i.appendChild(n[0]);return i}}class Hc{constructor(t,e){this.model=t,this.mapper=new Ba,this.downcastDispatcher=new qa({mapper:this.mapper,schema:t.schema}),this.downcastDispatcher.on("insert:$text",((t,e,i)=>{if(!i.consumable.consume(e.item,"insert"))return;const r=i.writer,n=i.mapper.toViewPosition(e.range.start),o=r.createText(e.item.data);r.insert(n,o)}),{priority:"lowest"}),this.upcastDispatcher=new qc({schema:t.schema}),this.viewDocument=new Jn(e),this.stylesProcessor=e,this.htmlProcessor=new $c(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new _o(this.viewDocument),this.upcastDispatcher.on("text",((t,e,{schema:i,consumable:r,writer:n})=>{let o=e.modelCursor;if(!r.test(e.viewItem))return;if(!i.checkChild(o,"$text")){if(!gc(o,"$text",i))return;o=fc(o,n)}r.consume(e.viewItem);const s=n.createText(e.viewItem.data);n.insert(s,o),e.modelRange=n.createRange(o,o.getShiftedBy(s.offsetSize)),e.modelCursor=e.modelRange.end}),{priority:"lowest"}),this.upcastDispatcher.on("element",((t,e,i)=>{if(!e.modelRange&&i.consumable.consume(e.viewItem,{name:!0})){const{modelRange:t,modelCursor:r}=i.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t,e.modelCursor=r}}),{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",((t,e,i)=>{if(!e.modelRange&&i.consumable.consume(e.viewItem,{name:!0})){const{modelRange:t,modelCursor:r}=i.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t,e.modelCursor=r}}),{priority:"lowest"}),this.decorate("init"),this.decorate("set"),this.decorate("get"),this.on("init",(()=>{this.fire("ready")}),{priority:"lowest"}),this.on("ready",(()=>{this.model.enqueueChange("transparent",uc)}),{priority:"lowest"})}get(t={}){const{rootName:e="main",trim:i="empty"}=t;if(!this._checkIfRootsExists([e]))throw new c("datacontroller-get-non-existent-root",this);const r=this.model.document.getRoot(e);return"empty"!==i||this.model.hasContent(r,{ignoreWhitespaces:!0})?this.stringify(r,t):""}stringify(t,e={}){const i=this.toView(t,e);return this.processor.toData(i)}toView(t,e={}){const i=this.viewDocument,r=this._viewWriter;this.mapper.clearBindings();const n=Da._createIn(t),o=new wo(i);this.mapper.bindElements(t,o),this.downcastDispatcher.conversionApi.options=e,this.downcastDispatcher.convertInsert(n,r);const s=t.is("documentFragment")?Array.from(t.markers):function(t){const e=[],i=t.root.document;if(!i)return[];const r=Da._createIn(t);for(const t of i.model.markers){const i=t.getRange(),n=i.isCollapsed,o=i.start.isEqual(r.start)||i.end.isEqual(r.end);if(n&&o)e.push([t.name,i]);else{const n=r.getIntersection(i);n&&e.push([t.name,n])}}return e.sort((([t,e],[i,r])=>{if("after"!==e.end.compareWith(r.start))return 1;if("before"!==e.start.compareWith(r.end))return-1;switch(e.start.compareWith(r.start)){case"before":return 1;case"after":return-1;default:switch(e.end.compareWith(r.end)){case"before":return 1;case"after":return-1;default:return i.localeCompare(t)}}}))}(t);for(const[t,e]of s)this.downcastDispatcher.convertMarkerAdd(t,e,r);return delete this.downcastDispatcher.conversionApi.options,o}init(t){if(this.model.document.version)throw new c("datacontroller-init-document-not-empty",this);let e={};if("string"==typeof t?e.main=t:e=t,!this._checkIfRootsExists(Object.keys(e)))throw new c("datacontroller-init-non-existent-root",this);return this.model.enqueueChange("transparent",(t=>{for(const i of Object.keys(e)){const r=this.model.document.getRoot(i);t.insert(this.parse(e[i],r),r,0)}})),Promise.resolve()}set(t,e={}){let i={};if("string"==typeof t?i.main=t:i=t,!this._checkIfRootsExists(Object.keys(i)))throw new c("datacontroller-set-non-existent-root",this);const r=e.batchType||"default";this.model.enqueueChange(r,(t=>{t.setSelection(null),t.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const e of Object.keys(i)){const r=this.model.document.getRoot(e);t.remove(t.createRangeIn(r)),t.insert(this.parse(i[e],r),r,0)}}))}parse(t,e="$root"){const i=this.processor.toView(t);return this.toModel(i,e)}toModel(t,e="$root"){return this.model.change((i=>this.upcastDispatcher.convert(t,i,e)))}addStyleProcessorRules(t){t(this.stylesProcessor)}registerRawContentMatcher(t){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(t),this.htmlProcessor.registerRawContentMatcher(t)}destroy(){this.stopListening()}_checkIfRootsExists(t){for(const e of t)if(!this.model.document.getRootNames().includes(e))return!1;return!0}}de(Hc,oe);class Wc{constructor(t,e){this._helpers=new Map,this._downcast=Er(t),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Er(e),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(t,e){const i=this._downcast.includes(e);if(!this._upcast.includes(e)&&!i)throw new c("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:t,dispatchers:[e],isDowncast:i})}for(t){if(!this._helpers.has(t))throw new c("conversion-for-unknown-group",this);return this._helpers.get(t)}elementToElement(t){this.for("downcast").elementToElement(t);for(const{model:e,view:i}of Uc(t))this.for("upcast").elementToElement({model:e,view:i,converterPriority:t.converterPriority})}attributeToElement(t){this.for("downcast").attributeToElement(t);for(const{model:e,view:i}of Uc(t))this.for("upcast").elementToAttribute({view:i,model:e,converterPriority:t.converterPriority})}attributeToAttribute(t){this.for("downcast").attributeToAttribute(t);for(const{model:e,view:i}of Uc(t))this.for("upcast").attributeToAttribute({view:i,model:e})}_createConversionHelpers({name:t,dispatchers:e,isDowncast:i}){if(this._helpers.has(t))throw new c("conversion-group-exists",this);const r=i?new oc(e):new mc(e);this._helpers.set(t,r)}}function*Uc(t){if(t.model.values)for(const e of t.model.values){const i={key:t.model.key,value:e},r=t.view[e],n=t.upcastAlso?t.upcastAlso[e]:void 0;yield*Kc(i,r,n)}else yield*Kc(t.model,t.view,t.upcastAlso)}function*Kc(t,e,i){if(yield{model:t,view:e},i)for(const e of Er(i))yield{model:t,view:e}}class Gc{constructor(t="default"){this.operations=[],this.type=t}get baseVersion(){for(const t of this.operations)if(null!==t.baseVersion)return t.baseVersion;return null}addOperation(t){return t.batch=this,this.operations.push(t),t}}class Jc{constructor(t){this.baseVersion=t,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const t=Object.assign({},this);return t.__className=this.constructor.className,delete t.batch,delete t.isDocumentOperation,t}static get className(){return"Operation"}static fromJSON(t){return new this(t.baseVersion)}}class Yc{constructor(t){this.markers=new Map,this._children=new Sa,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||"model: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 i of t)e=e.getChild(e.offsetToIndex(i));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 i of t)i.name?e.push(Ra.fromJSON(i)):e.push(Pa.fromJSON(i));return new Yc(e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const i=function(t){if("string"==typeof t)return[new Pa(t)];Cr(t)||(t=[t]);return Array.from(t).map((t=>"string"==typeof t?new Pa(t):t instanceof Ea?new Pa(t.data,t.getAttributes()):t))}(e);for(const t of i)null!==t.parent&&t._remove(),t.parent=this;this._children._insertNodes(t,i)}_removeChildren(t,e=1){const i=this._children._removeNodes(t,e);for(const t of i)t.parent=null;return i}}function Qc(t,e){const i=(e=tl(e)).reduce(((t,e)=>t+e.offsetSize),0),r=t.parent;il(t);const n=t.index;return r._insertChild(n,e),el(r,n+e.length),el(r,n),new Da(t,t.getShiftedBy(i))}function Xc(t){if(!t.isFlat)throw new c("operation-utils-remove-range-not-flat",this);const e=t.start.parent;il(t.start),il(t.end);const i=e._removeChildren(t.start.index,t.end.index-t.start.index);return el(e,t.start.index),i}function Zc(t,e){if(!t.isFlat)throw new c("operation-utils-move-range-not-flat",this);const i=Xc(t);return Qc(e=e._getTransformedByDeletion(t.start,t.end.offset-t.start.offset),i)}function tl(t){const e=[];t instanceof Array||(t=[t]);for(let i=0;it.maxOffset)throw new c("move-operation-nodes-do-not-exist",this);if(t===e&&i=i&&this.targetPosition.path[t]t._clone(!0)))),e=new cl(this.position,t,this.baseVersion);return e.shouldReceiveAttributes=this.shouldReceiveAttributes,e}getReversed(){const t=this.position.root.document.graveyard,e=new Ma(t,[0]);return new al(this.position,this.nodes.maxOffset,e,this.baseVersion+1)}_validate(){const t=this.position.parent;if(!t||t.maxOffsett._clone(!0)))),Qc(this.position,t)}toJSON(){const t=super.toJSON();return t.position=this.position.toJSON(),t.nodes=this.nodes.toJSON(),t}static get className(){return"InsertOperation"}static fromJSON(t,e){const i=[];for(const e of t.nodes)e.name?i.push(Ra.fromJSON(e)):i.push(Pa.fromJSON(e));const r=new cl(Ma.fromJSON(t.position,e),i,t.baseVersion);return r.shouldReceiveAttributes=t.shouldReceiveAttributes,r}}class ll extends Jc{constructor(t,e,i,r,n,o){super(o),this.name=t,this.oldRange=e?e.clone():null,this.newRange=i?i.clone():null,this.affectsData=n,this._markers=r}get type(){return"marker"}clone(){return new ll(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new ll(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){const t=this.newRange?"_set":"_remove";this._markers[t](this.name,this.newRange,!0,this.affectsData)}toJSON(){const t=super.toJSON();return this.oldRange&&(t.oldRange=this.oldRange.toJSON()),this.newRange&&(t.newRange=this.newRange.toJSON()),delete t._markers,t}static get className(){return"MarkerOperation"}static fromJSON(t,e){return new ll(t.name,t.oldRange?Da.fromJSON(t.oldRange,e):null,t.newRange?Da.fromJSON(t.newRange,e):null,e.model.markers,t.affectsData,t.baseVersion)}}class hl extends Jc{constructor(t,e,i,r){super(r),this.position=t,this.position.stickiness="toNext",this.oldName=e,this.newName=i}get type(){return"rename"}clone(){return new hl(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new hl(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const t=this.position.nodeAfter;if(!(t instanceof Ra))throw new c("rename-operation-wrong-position",this);if(t.name!==this.oldName)throw new c("rename-operation-wrong-name",this)}_execute(){this.position.nodeAfter.name=this.newName}toJSON(){const t=super.toJSON();return t.position=this.position.toJSON(),t}static get className(){return"RenameOperation"}static fromJSON(t,e){return new hl(Ma.fromJSON(t.position,e),t.oldName,t.newName,t.baseVersion)}}class dl extends Jc{constructor(t,e,i,r,n){super(n),this.root=t,this.key=e,this.oldValue=i,this.newValue=r}get type(){return null===this.oldValue?"addRootAttribute":null===this.newValue?"removeRootAttribute":"changeRootAttribute"}clone(){return new dl(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new dl(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new c("rootattribute-operation-not-a-root",this,{root:this.root,key:this.key});if(null!==this.oldValue&&this.root.getAttribute(this.key)!==this.oldValue)throw new c("rootattribute-operation-wrong-old-value",this,{root:this.root,key:this.key});if(null===this.oldValue&&null!==this.newValue&&this.root.hasAttribute(this.key))throw new c("rootattribute-operation-attribute-exists",this,{root:this.root,key:this.key})}_execute(){null!==this.newValue?this.root._setAttribute(this.key,this.newValue):this.root._removeAttribute(this.key)}toJSON(){const t=super.toJSON();return t.root=this.root.toJSON(),t}static get className(){return"RootAttributeOperation"}static fromJSON(t,e){if(!e.getRoot(t.root))throw new c("rootattribute-operation-fromjson-no-root",this,{rootName:t.root});return new dl(e.getRoot(t.root),t.key,t.oldValue,t.newValue,t.baseVersion)}}class ul extends Jc{constructor(t,e,i,r,n){super(n),this.sourcePosition=t.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=e,this.targetPosition=i.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=r.clone()}get type(){return"merge"}get deletionPosition(){return new Ma(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const t=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Da(this.sourcePosition,t)}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const t=this.targetPosition._getTransformedByMergeOperation(this),e=this.sourcePosition.path.slice(0,-1),i=new Ma(this.sourcePosition.root,e)._getTransformedByMergeOperation(this);return new gl(t,this.howMany,i,this.graveyardPosition,this.baseVersion+1)}_validate(){const t=this.sourcePosition.parent,e=this.targetPosition.parent;if(!t.parent)throw new c("merge-operation-source-position-invalid",this);if(!e.parent)throw new c("merge-operation-target-position-invalid",this);if(this.howMany!=t.maxOffset)throw new c("merge-operation-how-many-invalid",this)}_execute(){const t=this.sourcePosition.parent;Zc(Da._createIn(t),this.targetPosition),Zc(Da._createOn(t),this.graveyardPosition)}toJSON(){const t=super.toJSON();return t.sourcePosition=t.sourcePosition.toJSON(),t.targetPosition=t.targetPosition.toJSON(),t.graveyardPosition=t.graveyardPosition.toJSON(),t}static get className(){return"MergeOperation"}static fromJSON(t,e){const i=Ma.fromJSON(t.sourcePosition,e),r=Ma.fromJSON(t.targetPosition,e),n=Ma.fromJSON(t.graveyardPosition,e);return new this(i,t.howMany,r,n,t.baseVersion)}}class gl extends Jc{constructor(t,e,i,r,n){super(n),this.splitPosition=t.clone(),this.splitPosition.stickiness="toNext",this.howMany=e,this.insertionPosition=i,this.graveyardPosition=r?r.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const t=this.insertionPosition.path.slice();return t.push(0),new Ma(this.insertionPosition.root,t)}get movedRange(){const t=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Da(this.splitPosition,t)}clone(){return new this.constructor(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const t=this.splitPosition.root.document.graveyard,e=new Ma(t,[0]);return new ul(this.moveTargetPosition,this.howMany,this.splitPosition,e,this.baseVersion+1)}_validate(){const t=this.splitPosition.parent,e=this.splitPosition.offset;if(!t||t.maxOffset{for(const e of t.getAttributeKeys())this.removeAttribute(e,t)};if(t instanceof Da)for(const i of t.getItems())e(i);else e(t)}move(t,e,i){if(this._assertWriterUsedCorrectly(),!(t instanceof Da))throw new c("writer-move-invalid-range",this);if(!t.isFlat)throw new c("writer-move-range-not-flat",this);const r=Ma._createAt(e,i);if(r.isEqual(t.start))return;if(this._addOperationForAffectedMarkers("move",t),!kl(t.root,r.root))throw new c("writer-move-different-document",this);const n=t.root.document?t.root.document.version:null,o=new al(t.start,t.end.offset-t.start.offset,r,n);this.batch.addOperation(o),this.model.applyOperation(o)}remove(t){this._assertWriterUsedCorrectly();const e=(t instanceof Da?t:Da._createOn(t)).getMinimalFlatRanges().reverse();for(const t of e)this._addOperationForAffectedMarkers("move",t),_l(t.start,t.end.offset-t.start.offset,this.batch,this.model)}merge(t){this._assertWriterUsedCorrectly();const e=t.nodeBefore,i=t.nodeAfter;if(this._addOperationForAffectedMarkers("merge",t),!(e instanceof Ra))throw new c("writer-merge-no-element-before",this);if(!(i instanceof Ra))throw new c("writer-merge-no-element-after",this);t.root.document?this._merge(t):this._mergeDetached(t)}createPositionFromPath(t,e,i){return this.model.createPositionFromPath(t,e,i)}createPositionAt(t,e){return this.model.createPositionAt(t,e)}createPositionAfter(t){return this.model.createPositionAfter(t)}createPositionBefore(t){return this.model.createPositionBefore(t)}createRange(t,e){return this.model.createRange(t,e)}createRangeIn(t){return this.model.createRangeIn(t)}createRangeOn(t){return this.model.createRangeOn(t)}createSelection(t,e,i){return this.model.createSelection(t,e,i)}_mergeDetached(t){const e=t.nodeBefore,i=t.nodeAfter;this.move(Da._createIn(i),Ma._createAt(e,"end")),this.remove(i)}_merge(t){const e=Ma._createAt(t.nodeBefore,"end"),i=Ma._createAt(t.nodeAfter,0),r=t.root.document.graveyard,n=new Ma(r,[0]),o=t.root.document.version,s=new ul(i,t.nodeAfter.maxOffset,e,n,o);this.batch.addOperation(s),this.model.applyOperation(s)}rename(t,e){if(this._assertWriterUsedCorrectly(),!(t instanceof Ra))throw new c("writer-rename-not-element-instance",this);const i=t.root.document?t.root.document.version:null,r=new hl(Ma._createBefore(t),t.name,e,i);this.batch.addOperation(r),this.model.applyOperation(r)}split(t,e){this._assertWriterUsedCorrectly();let i,r,n=t.parent;if(!n.parent)throw new c("writer-split-element-no-parent",this);if(e||(e=n.parent),!t.parent.getAncestors({includeSelf:!0}).includes(e))throw new c("writer-split-invalid-limit-element",this);do{const e=n.root.document?n.root.document.version:null,o=n.maxOffset-t.offset,s=gl.getInsertionPosition(t),a=new gl(t,o,s,null,e);this.batch.addOperation(a),this.model.applyOperation(a),i||r||(i=n,r=t.parent.nextSibling),n=(t=this.createPositionAfter(t.parent)).parent}while(n!==e);return{position:t,range:new Da(Ma._createAt(i,"end"),Ma._createAt(r,0))}}wrap(t,e){if(this._assertWriterUsedCorrectly(),!t.isFlat)throw new c("writer-wrap-range-not-flat",this);const i=e instanceof Ra?e:new Ra(e);if(i.childCount>0)throw new c("writer-wrap-element-not-empty",this);if(null!==i.parent)throw new c("writer-wrap-element-attached",this);this.insert(i,t.start);const r=new Da(t.start.getShiftedBy(1),t.end.getShiftedBy(1));this.move(r,Ma._createAt(i,0))}unwrap(t){if(this._assertWriterUsedCorrectly(),null===t.parent)throw new c("writer-unwrap-element-no-parent",this);this.move(Da._createIn(t),this.createPositionAfter(t)),this.remove(t)}addMarker(t,e){if(this._assertWriterUsedCorrectly(),!e||"boolean"!=typeof e.usingOperation)throw new c("writer-addmarker-no-usingoperation",this);const i=e.usingOperation,r=e.range,n=void 0!==e.affectsData&&e.affectsData;if(this.model.markers.has(t))throw new c("writer-addmarker-marker-exists",this);if(!r)throw new c("writer-addmarker-no-range",this);return i?(wl(this,t,null,r,n),this.model.markers.get(t)):this.model.markers._set(t,r,i,n)}updateMarker(t,e){this._assertWriterUsedCorrectly();const i="string"==typeof t?t:t.name,r=this.model.markers.get(i);if(!r)throw new c("writer-updatemarker-marker-not-exists",this);if(!e)return void this.model.markers._refresh(r);const n="boolean"==typeof e.usingOperation,o="boolean"==typeof e.affectsData,s=o?e.affectsData:r.affectsData;if(!n&&!e.range&&!o)throw new c("writer-updatemarker-wrong-options",this);const a=r.getRange(),l=e.range?e.range:a;n&&e.usingOperation!==r.managedUsingOperations?e.usingOperation?wl(this,i,null,l,s):(wl(this,i,a,null,s),this.model.markers._set(i,l,void 0,s)):r.managedUsingOperations?wl(this,i,a,l,s):this.model.markers._set(i,l,void 0,s)}removeMarker(t){this._assertWriterUsedCorrectly();const e="string"==typeof t?t:t.name;if(!this.model.markers.has(e))throw new c("writer-removemarker-no-marker",this);const i=this.model.markers.get(e);if(!i.managedUsingOperations)return void this.model.markers._remove(e);wl(this,e,i.getRange(),null,i.affectsData)}setSelection(t,e,i){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(t,e,i)}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,i]of zr(t))this._setSelectionAttribute(e,i)}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 i=this.model.document.selection;if(i.isCollapsed&&i.anchor.parent.isEmpty){const r=tc._getStoreAttributeKey(t);this.setAttribute(r,e,i.anchor.parent)}i._setAttribute(t,e)}_removeSelectionAttribute(t){const e=this.model.document.selection;if(e.isCollapsed&&e.anchor.parent.isEmpty){const i=tc._getStoreAttributeKey(t);this.removeAttribute(i,e.anchor.parent)}e._removeAttribute(t)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new c("writer-incorrect-use",this)}_addOperationForAffectedMarkers(t,e){for(const i of this.model.markers){if(!i.managedUsingOperations)continue;const r=i.getRange();let n=!1;if("move"===t)n=e.containsPosition(r.start)||e.start.isEqual(r.start)||e.containsPosition(r.end)||e.end.isEqual(r.end);else{const t=e.nodeBefore,i=e.nodeAfter,o=r.start.parent==t&&r.start.isAtEnd,s=r.end.parent==i&&0==r.end.offset,a=r.end.nodeAfter==i,c=r.start.nodeAfter==i;n=o||s||a||c}n&&this.updateMarker(i.name,{range:r})}}}function pl(t,e,i,r){const n=t.model,o=n.document;let s,a,c,l=r.start;for(const t of r.getWalker({shallow:!0}))c=t.item.getAttribute(e),s&&a!=c&&(a!=i&&h(),l=s),s=t.nextPosition,a=c;function h(){const r=new Da(l,s),c=r.root.document?o.version:null,h=new ol(r,e,a,i,c);t.batch.addOperation(h),n.applyOperation(h)}s instanceof Ma&&s!=l&&a!=i&&h()}function bl(t,e,i,r){const n=t.model,o=n.document,s=r.getAttribute(e);let a,c;if(s!=i){if(r.root===r){const t=r.document?o.version:null;c=new dl(r,e,s,i,t)}else{a=new Da(Ma._createBefore(r),t.createPositionAfter(r));const n=a.root.document?o.version:null;c=new ol(a,e,s,i,n)}t.batch.addOperation(c),n.applyOperation(c)}}function wl(t,e,i,r,n){const o=t.model,s=o.document,a=new ll(e,i,r,o.markers,n,s.version);t.batch.addOperation(a),o.applyOperation(a)}function _l(t,e,i,r){let n;if(t.root.document){const i=r.document,o=new Ma(i.graveyard,[0]);n=new al(t,e,o,i.version)}else n=new sl(t,e);i.addOperation(n),r.applyOperation(n)}function kl(t,e){return t===e||t instanceof fl&&e instanceof fl}class vl{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}refreshItem(t){if(this._isInInsertedElement(t.parent))return;this._markRemove(t.parent,t.startOffset,t.offsetSize),this._markInsert(t.parent,t.startOffset,t.offsetSize);const e=Da._createOn(t);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getRange();this.bufferMarkerChange(t.name,e,e,t.affectsData)}this._cachedChanges=null}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({shallow:!0}))this._isInInsertedElement(e.parent)||this._markAttribute(e);break;case"remove":case"move":case"reinsert":{if(t.sourcePosition.isEqual(t.targetPosition)||t.sourcePosition.getShiftedBy(t.howMany).isEqual(t.targetPosition))return;const e=this._isInInsertedElement(t.sourcePosition.parent),i=this._isInInsertedElement(t.targetPosition.parent);e||this._markRemove(t.sourcePosition.parent,t.sourcePosition.offset,t.howMany),i||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=Da._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}case"split":{const e=t.splitPosition.parent;this._isInInsertedElement(e)||this._markRemove(e,t.splitPosition.offset,t.howMany),this._isInInsertedElement(t.insertionPosition.parent)||this._markInsert(t.insertionPosition.parent,t.insertionPosition.offset,1),t.graveyardPosition&&this._markRemove(t.graveyardPosition.parent,t.graveyardPosition.offset,1);break}case"merge":{const e=t.sourcePosition.parent;this._isInInsertedElement(e.parent)||this._markRemove(e.parent,e.startOffset,1);const i=t.graveyardPosition.parent;this._markInsert(i,t.graveyardPosition.offset,1);const r=t.targetPosition.parent;this._isInInsertedElement(r)||this._markInsert(r,t.targetPosition.offset,e.maxOffset);break}}this._cachedChanges=null}bufferMarkerChange(t,e,i,r){const n=this._changedMarkers.get(t);n?(n.newRange=i,n.affectsData=r,null==n.oldRange&&null==n.newRange&&this._changedMarkers.delete(t)):this._changedMarkers.set(t,{oldRange:e,newRange:i,affectsData:r})}getMarkersToRemove(){const t=[];for(const[e,i]of this._changedMarkers)null!=i.oldRange&&t.push({name:e,range:i.oldRange});return t}getMarkersToAdd(){const t=[];for(const[e,i]of this._changedMarkers)null!=i.newRange&&t.push({name:e,range:i.newRange});return t}getChangedMarkers(){return Array.from(this._changedMarkers).map((t=>({name:t[0],data:{oldRange:t[1].oldRange,newRange:t[1].newRange}})))}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();let e=[];for(const t of this._changesInElement.keys()){const i=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.rootNamet));for(const t of e)delete t.changeCount,"attribute"==t.type&&(delete t.position,delete t.length);return this._changeCount=0,this._cachedChangesWithGraveyard=e.slice(),this._cachedChanges=e.filter(Al),t.includeChangesInGraveyard?this._cachedChangesWithGraveyard:this._cachedChanges}reset(){this._changesInElement.clear(),this._elementSnapshots.clear(),this._changedMarkers.clear(),this._cachedChanges=null}_markInsert(t,e,i){const r={type:"insert",offset:e,howMany:i,count:this._changeCount++};this._markChange(t,r)}_markRemove(t,e,i){const r={type:"remove",offset:e,howMany:i,count:this._changeCount++};this._markChange(t,r),this._removeAllNestedChanges(t,e,i)}_markAttribute(t){const e={type:"attribute",offset:t.startOffset,howMany:t.offsetSize,count:this._changeCount++};this._markChange(t.parent,e)}_markChange(t,e){this._makeSnapshot(t);const i=this._getChangesForElement(t);this._handleChange(e,i),i.push(e);for(let t=0;ti.offset){if(r>n){const t={type:"attribute",offset:n,howMany:r-n,count:this._changeCount++};this._handleChange(t,e),e.push(t)}t.nodesToHandle=i.offset-t.offset,t.howMany=t.nodesToHandle}else t.offset>=i.offset&&t.offsetn?(t.nodesToHandle=r-n,t.offset=n):t.nodesToHandle=0);if("remove"==i.type&&t.offseti.offset){const n={type:"attribute",offset:i.offset,howMany:r-i.offset,count:this._changeCount++};this._handleChange(n,e),e.push(n),t.nodesToHandle=i.offset-t.offset,t.howMany=t.nodesToHandle}"attribute"==i.type&&(t.offset>=i.offset&&r<=n?(t.nodesToHandle=0,t.howMany=0,t.offset=0):t.offset<=i.offset&&r>=n&&(i.howMany=0))}}t.howMany=t.nodesToHandle,delete t.nodesToHandle}_getInsertDiff(t,e,i){return{type:"insert",position:Ma._createAt(t,e),name:i,length:1,changeCount:this._changeCount++}}_getRemoveDiff(t,e,i){return{type:"remove",position:Ma._createAt(t,e),name:i,length:1,changeCount:this._changeCount++}}_getAttributesDiff(t,e,i){const r=[];i=new Map(i);for(const[n,o]of e){const e=i.has(n)?i.get(n):null;e!==o&&r.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:n,attributeOldValue:o,attributeNewValue:e,changeCount:this._changeCount++}),i.delete(n)}for(const[e,n]of i)r.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:e,attributeOldValue:null,attributeNewValue:n,changeCount:this._changeCount++});return r}_isInInsertedElement(t){const e=t.parent;if(!e)return!1;const i=this._changesInElement.get(e),r=t.startOffset;if(i)for(const t of i)if("insert"==t.type&&r>=t.offset&&rr){for(let e=0;e=t&&r.baseVersion{const i=e[0];if(i.isDocumentOperation&&i.baseVersion!==this.version)throw new c("model-document-applyoperation-wrong-version",this,{operation:i})}),{priority:"highest"}),this.listenTo(t,"applyOperation",((t,e)=>{const i=e[0];i.isDocumentOperation&&this.differ.bufferOperation(i)}),{priority:"high"}),this.listenTo(t,"applyOperation",((t,e)=>{const i=e[0];i.isDocumentOperation&&(this.version++,this.history.addOperation(i))}),{priority:"low"}),this.listenTo(this.selection,"change",(()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0})),this.listenTo(t.markers,"update",((t,e,i,r)=>{this.differ.bufferMarkerChange(e.name,i,r,e.affectsData),null===i&&e.on("change",((t,i)=>{this.differ.bufferMarkerChange(e.name,i,e.getRange(),e.affectsData)}))}))}get graveyard(){return this.getRoot(El)}createRoot(t="$root",e="main"){if(this.roots.get(e))throw new c("model-document-createroot-name-exists",this,{name:e});const i=new fl(this,t,e);return this.roots.add(i),i}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!=El))}registerPostFixer(t){this._postFixers.add(t)}toJSON(){const t=Lr(this);return t.selection="[engine.model.DocumentSelection]",t.model="[engine.model.Model]",t}_handleChangeBlock(t){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(t),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",t.batch):this.fire("change",t.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const t of this.roots)if(t!==this.graveyard)return t;return this.graveyard}_getDefaultRange(){const t=this._getDefaultRoot(),e=this.model,i=e.schema,r=e.createPositionFromPath(t,[0]);return i.getNearestSelectionRange(r)||e.createRange(r)}_validateSelectionRange(t){return Rl(t.start)&&Rl(t.end)}_callPostFixers(t){let e=!1;do{for(const i of this._postFixers)if(this.selection.refresh(),e=i(t),e)break}while(e)}}function Rl(t){const e=t.textNode;if(e){const i=e.data,r=t.offset-e.startOffset;return!Tl(i,r)&&!Pl(i,r)}return!0}de(Sl,p);class Il{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(t){const e=t instanceof Ol?t.name:t;return this._markers.has(e)}get(t){return this._markers.get(t)||null}_set(t,e,i=!1,r=!1){const n=t instanceof Ol?t.name:t;if(n.includes(","))throw new c("markercollection-incorrect-marker-name",this);const o=this._markers.get(n);if(o){const t=o.getRange();let s=!1;return t.isEqual(e)||(o._attachLiveRange(Ya.fromRange(e)),s=!0),i!=o.managedUsingOperations&&(o._managedUsingOperations=i,s=!0),"boolean"==typeof r&&r!=o.affectsData&&(o._affectsData=r,s=!0),s&&this.fire("update:"+n,o,t,e),o}const s=Ya.fromRange(e),a=new Ol(n,s,i,r);return this._markers.set(n,a),this.fire("update:"+n,a,null,e),a}_remove(t){const e=t instanceof Ol?t.name:t,i=this._markers.get(e);return!!i&&(this._markers.delete(e),this.fire("update:"+e,i,i.getRange(),null),this._destroyMarker(i),!0)}_refresh(t){const e=t instanceof Ol?t.name:t,i=this._markers.get(e);if(!i)throw new c("markercollection-refresh-marker-not-exists",this);const r=i.getRange();this.fire("update:"+e,i,r,r,i.managedUsingOperations,i.affectsData)}*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()}}de(Il,p);class Ol{constructor(t,e,i,r){this.name=t,this._liveRange=this._attachLiveRange(e),this._managedUsingOperations=i,this._affectsData=r}get managedUsingOperations(){if(!this._liveRange)throw new c("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new c("marker-destroyed",this);return this._affectsData}getStart(){if(!this._liveRange)throw new c("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new c("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new c("marker-destroyed",this);return this._liveRange.toRange()}is(t){return"marker"===t||"model:marker"===t}_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}}de(Ol,p);class Ml extends Jc{get type(){return"noop"}clone(){return new Ml(this.baseVersion)}getReversed(){return new Ml(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}const Nl={};Nl[ol.className]=ol,Nl[cl.className]=cl,Nl[ll.className]=ll,Nl[al.className]=al,Nl[Ml.className]=Ml,Nl[Jc.className]=Jc,Nl[hl.className]=hl,Nl[dl.className]=dl,Nl[gl.className]=gl,Nl[ul.className]=ul;class Ll extends Ma{constructor(t,e,i="toNone"){if(super(t,e,i),!this.root.is("rootElement"))throw new c("model-liveposition-root-not-rootelement",t);Vl.call(this)}detach(){this.stopListening()}is(t){return"livePosition"===t||"model:livePosition"===t||"position"==t||"model:position"===t}toPosition(){return new Ma(this.root,this.path.slice(),this.stickiness)}static fromPosition(t,e){return new this(t.root,t.path.slice(),e||t.stickiness)}}function Vl(){this.listenTo(this.root.document.model,"applyOperation",((t,e)=>{const i=e[0];i.isDocumentOperation&&Dl.call(this,i)}),{priority:"low"})}function Dl(t){const e=this.getTransformedByOperation(t);if(!this.isEqual(e)){const t=this.toPosition();this.path=e.path,this.root=e.root,this.fire("change",t)}}de(Ll,p);class Bl{constructor(t,e,i){this.model=t,this.writer=e,this.position=i,this.canMergeWith=new Set([this.position.parent]),this.schema=t.schema,this._documentFragment=e.createDocumentFragment(),this._documentFragmentPosition=e.createPositionAt(this._documentFragment,0),this._firstNode=null,this._lastNode=null,this._lastAutoParagraph=null,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null}handleNodes(t){for(const e of Array.from(t))this._handleNode(e);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesOf,this.writer),this._filterAttributesOf=[]}_updateLastNodeFromAutoParagraph(t){const e=this.writer.createPositionAfter(this._lastNode),i=this.writer.createPositionAfter(t);if(i.isAfter(e)){if(this._lastNode=t,this.position.parent!=t||!this.position.isAtEnd)throw new c("insertcontent-invalid-insertion-position",this);this.position=i,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this.nodeToSelect?Da._createOn(this.nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new Da(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(t){if(this.schema.isObject(t))return void this._handleObject(t);let e=this._checkAndAutoParagraphToAllowedPosition(t);e||(e=this._checkAndSplitToAllowedPosition(t),e)?(this._appendToFragment(t),this._firstNode||(this._firstNode=t),this._lastNode=t):this._handleDisallowedNode(t)}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;const t=Ll.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=t.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=t.toPosition(),t.detach()}_handleObject(t){this._checkAndSplitToAllowedPosition(t)?this._appendToFragment(t):this._tryAutoparagraphing(t)}_handleDisallowedNode(t){t.is("element")?this.handleNodes(t.getChildren()):this._tryAutoparagraphing(t)}_appendToFragment(t){if(!this.schema.checkChild(this.position,t))throw new c("insertcontent-wrong-position",this,{node:t,position:this.position});this.writer.insert(t,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(t.offsetSize),this.schema.isObject(t)&&!this.schema.checkChild(this.position,"$text")?this.nodeToSelect=t:this.nodeToSelect=null,this._filterAttributesOf.push(t)}_setAffectedBoundaries(t){this._affectedStart||(this._affectedStart=Ll.fromPosition(t,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(t)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=Ll.fromPosition(t,"toNext"))}_mergeOnLeft(){const t=this._firstNode;if(!(t instanceof Ra))return;if(!this._canMergeLeft(t))return;const e=Ll._createBefore(t);e.stickiness="toNext";const i=Ll.fromPosition(this.position,"toNext");this._affectedStart.isEqual(e)&&(this._affectedStart.detach(),this._affectedStart=Ll._createAt(e.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=e.nodeBefore,this._lastNode=e.nodeBefore),this.writer.merge(e),e.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=Ll._createAt(e.nodeBefore,"end","toNext")),this.position=i.toPosition(),i.detach(),this._filterAttributesOf.push(this.position.parent),e.detach()}_mergeOnRight(){const t=this._lastNode;if(!(t instanceof Ra))return;if(!this._canMergeRight(t))return;const e=Ll._createAfter(t);if(e.stickiness="toNext",!this.position.isEqual(e))throw new c("insertcontent-invalid-insertion-position",this);this.position=Ma._createAt(e.nodeBefore,"end");const i=Ll.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(e)&&(this._affectedEnd.detach(),this._affectedEnd=Ll._createAt(e.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=e.nodeBefore,this._lastNode=e.nodeBefore),this.writer.merge(e),e.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=Ll._createAt(e.nodeBefore,0,"toPrevious")),this.position=i.toPosition(),i.detach(),this._filterAttributesOf.push(this.position.parent),e.detach()}_canMergeLeft(t){const e=t.previousSibling;return e instanceof Ra&&this.canMergeWith.has(e)&&this.model.schema.checkMerge(e,t)}_canMergeRight(t){const e=t.nextSibling;return e instanceof Ra&&this.canMergeWith.has(e)&&this.model.schema.checkMerge(t,e)}_tryAutoparagraphing(t){const e=this.writer.createElement("paragraph");this._getAllowedIn(this.position.parent,e)&&this.schema.checkChild(e,t)&&(e._appendChild(t),this._handleNode(e))}_checkAndAutoParagraphToAllowedPosition(t){if(this.schema.checkChild(this.position.parent,t))return!0;if(!this.schema.checkChild(this.position.parent,"paragraph")||!this.schema.checkChild("paragraph",t))return!1;this._insertPartialFragment();const e=this.writer.createElement("paragraph");return this.writer.insert(e,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=e,this.position=this.writer.createPositionAt(e,0),!0}_checkAndSplitToAllowedPosition(t){const e=this._getAllowedIn(this.position.parent,t);if(!e)return!1;for(e!=this.position.parent&&this._insertPartialFragment();e!=this.position.parent;)if(this.position.isAtStart){const t=this.position.parent;this.position=this.writer.createPositionBefore(t),t.isEmpty&&t.parent===e&&this.writer.remove(t)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const t=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=t,this.canMergeWith.add(this.position.nodeAfter)}return!0}_getAllowedIn(t,e){return this.schema.checkChild(t,e)?t:this.schema.isLimit(t)?null:this._getAllowedIn(t.parent,e)}}function zl(t,e,i={}){if(e.isCollapsed)return;const r=e.getFirstRange();if("$graveyard"==r.root.rootName)return;const n=t.schema;t.change((t=>{if(!i.doNotResetEntireContent&&function(t,e){const i=t.getLimitElement(e);if(!e.containsEntireContent(i))return!1;const r=e.getFirstRange();if(r.start.parent==r.end.parent)return!1;return t.checkChild(i,"paragraph")}(n,e))return void function(t,e){const i=t.model.schema.getLimitElement(e);t.remove(t.createRangeIn(i)),$l(t,t.createPositionAt(i,0),e)}(t,e);const[o,s]=function(t){const e=t.root.document.model,i=t.start;let r=t.end;if(e.hasContent(t,{ignoreMarkers:!0})){const i=function(t){const e=t.parent,i=e.root.document.model.schema,r=e.getAncestors({parentFirst:!0,includeSelf:!0});for(const t of r){if(i.isLimit(t))return null;if(i.isBlock(t))return t}}(r);if(i&&r.isTouching(e.createPositionAt(i,0))){const i=e.createSelection(t);e.modifySelection(i,{direction:"backward"});const n=i.getLastPosition(),o=e.createRange(n,r);e.hasContent(o,{ignoreMarkers:!0})||(r=n)}}return[Ll.fromPosition(i,"toPrevious"),Ll.fromPosition(r,"toNext")]}(r);o.isTouching(s)||t.remove(t.createRange(o,s)),i.leaveUnmerged||(!function(t,e,i){const r=t.model;if(!jl(t.model.schema,e,i))return;const[n,o]=function(t,e){const i=t.getAncestors(),r=e.getAncestors();let n=0;for(;i[n]&&i[n]==r[n];)n++;return[i[n],r[n]]}(e,i);if(!n||!o)return;!r.hasContent(n,{ignoreMarkers:!0})&&r.hasContent(o,{ignoreMarkers:!0})?ql(t,e,i,n.parent):Fl(t,e,i,n.parent)}(t,o,s),n.removeDisallowedAttributes(o.parent.getChildren(),t)),Hl(t,e,o),!i.doNotAutoparagraph&&function(t,e){const i=t.checkChild(e,"$text"),r=t.checkChild(e,"paragraph");return!i&&r}(n,o)&&$l(t,o,e),o.detach(),s.detach()}))}function Fl(t,e,i,r){const n=e.parent,o=i.parent;if(n!=r&&o!=r){for(e=t.createPositionAfter(n),(i=t.createPositionBefore(o)).isEqual(e)||t.insert(o,e),t.merge(e);i.parent.isEmpty;){const e=i.parent;i=t.createPositionBefore(e),t.remove(e)}jl(t.model.schema,e,i)&&Fl(t,e,i,r)}}function ql(t,e,i,r){const n=e.parent,o=i.parent;if(n!=r&&o!=r){for(e=t.createPositionAfter(n),(i=t.createPositionBefore(o)).isEqual(e)||t.insert(n,i);e.parent.isEmpty;){const i=e.parent;e=t.createPositionBefore(i),t.remove(i)}i=t.createPositionBefore(o),function(t,e){const i=e.nodeBefore,r=e.nodeAfter;i.name!=r.name&&t.rename(i,r.name);t.clearAttributes(i),t.setAttributes(Object.fromEntries(r.getAttributes()),i),t.merge(e)}(t,i),jl(t.model.schema,e,i)&&ql(t,e,i,r)}}function jl(t,e,i){const r=e.parent,n=i.parent;return r!=n&&(!t.isLimit(r)&&!t.isLimit(n)&&function(t,e,i){const r=new Da(t,e);for(const t of r.getWalker())if(i.isLimit(t.item))return!1;return!0}(e,i,t))}function $l(t,e,i){const r=t.createElement("paragraph");t.insert(r,e),Hl(t,i,t.createPositionAt(r,0))}function Hl(t,e,i){e instanceof tc?t.setSelection(i):e.setTo(i)}const Wl=' ,.?!:;"-()';function Ul(t,e){const{isForward:i,walker:r,unit:n,schema:o}=t,{type:s,item:a,nextPosition:c}=e;if("text"==s)return"word"===t.unit?function(t,e){let i=t.position.textNode;if(i){let r=t.position.offset-i.startOffset;for(;!Gl(i.data,r,e)&&!Jl(i,r,e);){t.next();const n=e?t.position.nodeAfter:t.position.nodeBefore;if(n&&n.is("$text")){const r=n.data.charAt(e?0:n.data.length-1);Wl.includes(r)||(t.next(),i=t.position.textNode)}r=t.position.offset-i.startOffset}}return t.position}(r,i):function(t,e){const i=t.position.textNode;if(i){const r=i.data;let n=t.position.offset-i.startOffset;for(;Tl(r,n)||"character"==e&&Pl(r,n);)t.next(),n=t.position.offset-i.startOffset}return t.position}(r,n);if(s==(i?"elementStart":"elementEnd")){if(o.isSelectable(a))return Ma._createAt(a,i?"after":"before");if(o.checkChild(c,"$text"))return c}else{if(o.isLimit(a))return void r.skip((()=>!0));if(o.checkChild(c,"$text"))return c}}function Kl(t,e){const i=t.root,r=Ma._createAt(i,e?"end":0);return e?new Da(t,r):new Da(r,t)}function Gl(t,e,i){const r=e+(i?0:-1);return Wl.includes(t.charAt(r))}function Jl(t,e,i){return e===(i?t.endOffset:0)}function Yl(t,e){const i=[];Array.from(t.getItems({direction:"backward"})).map((t=>e.createRangeOn(t))).filter((e=>(e.start.isAfter(t.start)||e.start.isEqual(t.start))&&(e.end.isBefore(t.end)||e.end.isEqual(t.end)))).forEach((t=>{i.push(t.start.parent),e.remove(t)})),i.forEach((t=>{let i=t;for(;i.parent&&i.isEmpty;){const t=e.createRangeOn(i);i=i.parent,e.remove(t)}}))}function Ql(t){t.document.registerPostFixer((e=>function(t,e){const i=e.document.selection,r=e.schema,n=[];let o=!1;for(const t of i.getRanges()){const e=Xl(t,r);e&&!e.isEqual(t)?(n.push(e),o=!0):n.push(t)}o&&t.setSelection(function(t){const e=[];e.push(t.shift());for(const i of t){const t=e.pop();if(i.isEqual(t))e.push(t);else if(i.isIntersecting(t)){const r=t.start.isAfter(i.start)?i.start:t.start,n=t.end.isAfter(i.end)?t.end:i.end,o=new Da(r,n);e.push(o)}else e.push(t),e.push(i)}return e}(n),{backward:i.isBackward})}(e,t)))}function Xl(t,e){return t.isCollapsed?function(t,e){const i=t.start,r=e.getNearestSelectionRange(i);if(!r){const t=i.getAncestors().reverse().find((t=>e.isObject(t)));return t?Da._createOn(t):null}if(!r.isCollapsed)return r;const n=r.start;if(i.isEqual(n))return null;return new Da(n)}(t,e):function(t,e){const{start:i,end:r}=t,n=e.checkChild(i,"$text"),o=e.checkChild(r,"$text"),s=e.getLimitElement(i),a=e.getLimitElement(r);if(s===a){if(n&&o)return null;if(function(t,e,i){const r=t.nodeAfter&&!i.isLimit(t.nodeAfter)||i.checkChild(t,"$text"),n=e.nodeBefore&&!i.isLimit(e.nodeBefore)||i.checkChild(e,"$text");return r||n}(i,r,e)){const t=i.nodeAfter&&e.isSelectable(i.nodeAfter)?null:e.getNearestSelectionRange(i,"forward"),n=r.nodeBefore&&e.isSelectable(r.nodeBefore)?null:e.getNearestSelectionRange(r,"backward"),o=t?t.start:i,s=n?n.end:r;return new Da(o,s)}}const c=s&&!s.is("rootElement"),l=a&&!a.is("rootElement");if(c||l){const t=i.nodeAfter&&r.nodeBefore&&i.nodeAfter.parent===r.nodeBefore.parent,n=c&&(!t||!th(i.nodeAfter,e)),o=l&&(!t||!th(r.nodeBefore,e));let h=i,d=r;return n&&(h=Ma._createBefore(Zl(s,e))),o&&(d=Ma._createAfter(Zl(a,e))),new Da(h,d)}return null}(t,e)}function Zl(t,e){let i=t,r=i;for(;e.isLimit(r)&&r.parent;)i=r,r=r.parent;return i}function th(t,e){return t&&e.isSelectable(t)}class eh{constructor(){this.markers=new Il,this.document=new Sl(this),this.schema=new Tc,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",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck(((t,e)=>{if("$marker"===e.name)return!0})),Ql(this),this.document.registerPostFixer(uc)}change(t){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new Gc,callback:t}),this._runPendingChanges()[0]):t(this._currentWriter)}catch(t){c.rethrowUnexpectedError(t,this)}}enqueueChange(t,e){try{"string"==typeof t?t=new Gc(t):"function"==typeof t&&(e=t,t=new Gc),this._pendingChanges.push({batch:t,callback:e}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(t){c.rethrowUnexpectedError(t,this)}}applyOperation(t){t._execute()}insertContent(t,e,i){return function(t,e,i,r){return t.change((n=>{let o;o=i?i instanceof Wa||i instanceof tc?i:n.createSelection(i,r):t.document.selection,o.isCollapsed||t.deleteContent(o,{doNotAutoparagraph:!0});const s=new Bl(t,n,o.anchor);let a;a=e.is("documentFragment")?e.getChildren():[e],s.handleNodes(a);const c=s.getSelectionRange();c&&(o instanceof tc?n.setSelection(c):o.setTo(c));const l=s.getAffectedRange()||t.createRange(o.anchor);return s.destroy(),l}))}(this,t,e,i)}deleteContent(t,e){zl(this,t,e)}modifySelection(t,e){!function(t,e,i={}){const r=t.schema,n="backward"!=i.direction,o=i.unit?i.unit:"character",s=e.focus,a=new Ia({boundaries:Kl(s,n),singleCharacters:!0,direction:n?"forward":"backward"}),c={walker:a,schema:r,isForward:n,unit:o};let l;for(;l=a.next();){if(l.done)return;const i=Ul(c,l.value);if(i)return void(e instanceof tc?t.change((t=>{t.setSelectionFocus(i)})):e.setFocus(i))}}(this,t,e)}getSelectedContent(t){return function(t,e){return t.change((t=>{const i=t.createDocumentFragment(),r=e.getFirstRange();if(!r||r.isCollapsed)return i;const n=r.start.root,o=r.start.getCommonPath(r.end),s=n.getNodeByPath(o);let a;a=r.start.parent==r.end.parent?r:t.createRange(t.createPositionAt(s,r.start.path[o.length]),t.createPositionAt(s,r.end.path[o.length]+1));const c=a.end.offset-a.start.offset;for(const e of a.getItems({shallow:!0}))e.is("$textProxy")?t.appendText(e.data,e.getAttributes(),i):t.append(t.cloneElement(e,!0),i);if(a!=r){const e=r._getTransformedByMove(a.start,t.createPositionAt(i,0),c)[0],n=t.createRange(t.createPositionAt(i,0),e.start);Yl(t.createRange(e.end,t.createPositionAt(i,"end")),t),Yl(n,t)}return i}))}(this,t)}hasContent(t,e={}){const i=t instanceof Ra?Da._createIn(t):t;if(i.isCollapsed)return!1;const{ignoreWhitespaces:r=!1,ignoreMarkers:n=!1}=e;if(!n)for(const t of this.markers.getMarkersIntersectingRange(i))if(t.affectsData)return!0;for(const t of i.getItems())if(this.schema.isContent(t)){if(!t.is("$textProxy"))return!0;if(!r)return!0;if(-1!==t.data.search(/\S/))return!0}return!1}createPositionFromPath(t,e,i){return new Ma(t,e,i)}createPositionAt(t,e){return Ma._createAt(t,e)}createPositionAfter(t){return Ma._createAfter(t)}createPositionBefore(t){return Ma._createBefore(t)}createRange(t,e){return new Da(t,e)}createRangeIn(t){return Da._createIn(t)}createRangeOn(t){return Da._createOn(t)}createSelection(t,e,i){return new Wa(t,e,i)}createBatch(t){return new Gc(t)}createOperationFromJSON(t){return class{static fromJSON(t,e){return Nl[t.__className].fromJSON(t,e)}}.fromJSON(t,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const t=[];for(this.fire("_beforeChanges");this._pendingChanges.length;){const e=this._pendingChanges[0].batch;this._currentWriter=new ml(this,e);const i=this._pendingChanges[0].callback(this._currentWriter);t.push(i),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return this.fire("_afterChanges"),t}}de(eh,oe);class ih extends ga{constructor(t){super(),this.editor=t}set(t,e,i={}){if("string"==typeof e){const t=e;e=(e,i)=>{this.editor.execute(t),i()}}super.set(t,e,i)}}class rh{constructor(t={}){this._context=t.context||new Mr({language:t.language}),this._context._addEditor(this,!t.context);const e=Array.from(this.constructor.builtinPlugins||[]);this.config=new yr(t,this.constructor.defaultConfig),this.config.define("plugins",e),this.config.define(this._context._getEditorConfig()),this.plugins=new Pr(this,e,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this.commands=new xc,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 eh;const i=new Cn;this.data=new Hc(this.model,i),this.editing=new yc(this.model,i),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new Wc([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new ih(this),this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const t=this.config,e=t.get("plugins"),i=t.get("removePlugins")||[],r=t.get("extraPlugins")||[],n=t.get("substitutePlugins")||[];return this.plugins.init(e.concat(r),i,n)}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()})).then((()=>this._context._removeEditor(this)))}execute(...t){try{return this.commands.execute(...t)}catch(t){c.rethrowUnexpectedError(t,this)}}focus(){this.editing.view.focus()}}de(rh,oe);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){this._components.set(oh(t),{callback:e,originalName:t})}create(t){if(!this.has(t))throw new c("componentfactory-item-missing",this,{name:t});return this._components.get(oh(t)).callback(this.editor.locale)}has(t){return this._components.has(oh(t))}}function oh(t){return String(t).toLowerCase()}class sh{constructor(t){this.editor=t,this.componentFactory=new nh(t),this.focusTracker=new ua,this.set("viewportOffset",this._readViewportOffsetFromConfig()),this._editableElementsMap=new Map,this.listenTo(t.editing.view.document,"layoutChanged",(()=>this.update()))}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy();for(const t of this._editableElementsMap.values())t.ckeditorInstance=null;this._editableElementsMap=new Map}setEditableElement(t,e){this._editableElementsMap.set(t,e),e.ckeditorInstance||(e.ckeditorInstance=this.editor)}getEditableElement(t="main"){return this._editableElementsMap.get(t)}getEditableElementsNames(){return this._editableElementsMap.keys()}get _editableElements(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}_readViewportOffsetFromConfig(){const t=this.editor,e=t.config.get("ui.viewportOffset");if(e)return e;const i=t.config.get("toolbar.viewportTopOffset");return i?(console.warn("editor-ui-deprecated-viewport-offset-config: The `toolbar.vieportTopOffset` configuration option is deprecated. It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead."),{top:i}):{top:0}}}function ah(t){if(!B(t.updateSourceElement))throw new c("attachtoform-missing-elementapi-interface",t);const e=t.sourceElement;if(e&&"textarea"===e.tagName.toLowerCase()&&e.form){let i;const r=e.form,n=()=>t.updateSourceElement();B(r.submit)&&(i=r.submit,r.submit=()=>{n(),i.apply(r)}),r.addEventListener("submit",n),t.on("destroy",(()=>{r.removeEventListener("submit",n),i&&(r.submit=i)}))}}de(sh,oe);const ch={setData(t){this.data.set(t)},getData(t){return this.data.get(t)}},lh={updateSourceElement(){if(!this.sourceElement)throw new c("editor-missing-sourceelement",this);la(this.sourceElement,this.data.get())}};Symbol.iterator;const hh=' ',dh=' ',uh=' ',gh=' ',fh=' ',mh=' ';class ph{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=this.model.createBatch()),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 bh extends fe{constructor(t,e){super(t),this._buffer=new ph(t.model,e),this._batches=new WeakSet}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(t={}){const e=this.editor.model,i=e.document,r=t.text||"",n=r.length,o=t.range?e.createSelection(t.range):i.selection,s=t.resultRange;e.enqueueChange(this._buffer.batch,(t=>{this._buffer.lock(),this._batches.add(this._buffer.batch),e.deleteContent(o),r&&e.insertContent(t.createText(r,i.selection.getAttributes()),o),s?t.setSelection(s):o.is("documentSelection")||t.setSelection(o),this._buffer.unlock(),this._buffer.input(n)}))}}const wh=[co("arrowUp"),co("arrowRight"),co("arrowDown"),co("arrowLeft"),9,16,17,18,19,20,27,33,34,35,36,45,91,93,144,145,173,174,175,176,177,178,179,255];for(let t=112;t<=135;t++)wh.push(t);function _h(t){return!(!t.ctrlKey&&!t.metaKey)||wh.includes(t.keyCode)}function kh(t){if(t.newChildren.length-t.oldChildren.length!=1)return;const e=function(t,e){const i=[];let r,n=0;return t.forEach((t=>{"equal"==t?(o(),n++):"insert"==t?(s("insert")?r.values.push(e[n]):(o(),r={type:"insert",index:n,values:[e[n]]}),n++):s("delete")?r.howMany++:(o(),r={type:"delete",index:n,howMany:1})})),o(),i;function o(){r&&(i.push(r),r=null)}function s(t){return r&&r.type==t}}(jo(t.oldChildren,t.newChildren,vh),t.newChildren);if(e.length>1)return;const i=e[0];return i.values[0]&&i.values[0].is("$text")?i:void 0}function vh(t,e){return t&&t.is("$text")&&e&&e.is("$text")?t.data===e.data:t===e}class yh{constructor(t){this.editor=t,this.editing=this.editor.editing}handle(t,e){if(function(t){if(0==t.length)return!1;for(const e of t)if("children"===e.type&&!kh(e))return!0;return!1}(t))this._handleContainerChildrenMutations(t,e);else for(const i of t)this._handleTextMutation(i,e),this._handleTextNodeInsertion(i)}_handleContainerChildrenMutations(t,e){const i=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(!i)return;const r=this.editor.editing.view.domConverter.mapViewToDom(i),n=new is(this.editor.editing.view.document),o=this.editor.data.toModel(n.domToView(r)).getChild(0),s=this.editor.editing.mapper.toModelElement(i);if(!s)return;const a=Array.from(o.getChildren()),c=Array.from(s.getChildren()),l=a[a.length-1],h=c[c.length-1],d=l&&l.is("element","softBreak"),u=h&&!h.is("element","softBreak");d&&u&&a.pop();const g=this.editor.model.schema;if(!xh(a,g)||!xh(c,g))return;const f=a.map((t=>t.is("$text")?t.data:"@")).join("").replace(/\u00A0/g," "),m=c.map((t=>t.is("$text")?t.data:"@")).join("").replace(/\u00A0/g," ");if(m===f)return;const p=jo(m,f),{firstChangeAt:b,insertions:w,deletions:_}=Ah(p);let k=null;e&&(k=this.editing.mapper.toModelRange(e.getFirstRange()));const v=f.substr(b,w),y=this.editor.model.createRange(this.editor.model.createPositionAt(s,b),this.editor.model.createPositionAt(s,b+_));this.editor.execute("input",{text:v,range:y,resultRange:k})}_handleTextMutation(t,e){if("text"!=t.type)return;const i=t.newText.replace(/\u00A0/g," "),r=t.oldText.replace(/\u00A0/g," ");if(r===i)return;const n=jo(r,i),{firstChangeAt:o,insertions:s,deletions:a}=Ah(n);let c=null;e&&(c=this.editing.mapper.toModelRange(e.getFirstRange()));const l=this.editing.view.createPositionAt(t.node,o),h=this.editing.mapper.toModelPosition(l),d=this.editor.model.createRange(h,h.getShiftedBy(a)),u=i.substr(o,s);this.editor.execute("input",{text:u,range:d,resultRange:c})}_handleTextNodeInsertion(t){if("children"!=t.type)return;const e=kh(t),i=this.editing.view.createPositionAt(t.node,e.index),r=this.editing.mapper.toModelPosition(i),n=e.values[0].data;this.editor.execute("input",{text:n.replace(/\u00A0/g," "),range:this.editor.model.createRange(r)})}}function xh(t,e){return t.every((t=>e.isInline(t)))}function Ah(t){let e=null,i=null;for(let r=0;r{i.deleteContent(i.document.selection)})),t.unlock()}ro.isAndroid?r.document.on("beforeinput",((t,e)=>o(e)),{priority:"lowest"}):r.document.on("keydown",((t,e)=>o(e)),{priority:"lowest"}),r.document.on("compositionstart",(function(){const t=i.document,e=1!==t.selection.rangeCount||t.selection.getFirstRange().isFlat;t.selection.isCollapsed||e||s()}),{priority:"lowest"}),r.document.on("compositionend",(()=>{e=i.createSelection(i.document.selection)}),{priority:"lowest"})}(t),function(t){t.editing.view.document.on("mutations",((e,i,r)=>{new yh(t).handle(i,r)}))}(t)}isInput(t){return this.editor.commands.get("input")._batches.has(t)}}class Th extends fe{constructor(t,e){super(t),this.direction=e,this._buffer=new ph(t.model,t.config.get("typing.undoStep"))}get buffer(){return this._buffer}execute(t={}){const e=this.editor.model,i=e.document;e.enqueueChange(this._buffer.batch,(r=>{this._buffer.lock();const n=r.createSelection(t.selection||i.selection),o=t.sequence||1,s=n.isCollapsed;if(n.isCollapsed&&e.modifySelection(n,{direction:this.direction,unit:t.unit}),this._shouldEntireContentBeReplacedWithParagraph(o))return void this._replaceEntireContentWithParagraph(r);if(this._shouldReplaceFirstBlockWithParagraph(n,o))return void this.editor.execute("paragraph",{selection:n});if(n.isCollapsed)return;let a=0;n.getFirstRange().getMinimalFlatRanges().forEach((t=>{a+=zn(t.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))})),e.deleteContent(n,{doNotResetEntireContent:s,direction:this.direction}),this._buffer.input(a),r.setSelection(n),this._buffer.unlock()}))}_shouldEntireContentBeReplacedWithParagraph(t){if(t>1)return!1;const e=this.editor.model,i=e.document.selection,r=e.schema.getLimitElement(i);if(!(i.isCollapsed&&i.containsEntireContent(r)))return!1;if(!e.schema.checkChild(r,"paragraph"))return!1;const n=r.getChild(0);return!n||"paragraph"!==n.name}_replaceEntireContentWithParagraph(t){const e=this.editor.model,i=e.document.selection,r=e.schema.getLimitElement(i),n=t.createElement("paragraph");t.remove(t.createRangeIn(r)),t.insert(n,r),t.setSelection(n,0)}_shouldReplaceFirstBlockWithParagraph(t,e){const i=this.editor.model;if(e>1||"backward"!=this.direction)return!1;if(!t.isCollapsed)return!1;const r=t.getFirstPosition(),n=i.schema.getLimitElement(r),o=n.getChild(0);return r.parent==o&&(!!t.containsEntireContent(o)&&(!!i.schema.checkChild(n,"paragraph")&&"paragraph"!=o.name))}}class Ph extends ls{constructor(t){super(t);const e=t.document;let i=0;function r(t,i,r){const n=new jn(e,"delete",e.selection.getFirstRange());e.fire(n,new Os(e,i,r)),n.stop.called&&t.stop()}e.on("keyup",((t,e)=>{e.keyCode!=so.delete&&e.keyCode!=so.backspace||(i=0)})),e.on("keydown",((t,e)=>{const n={};if(e.keyCode==so.delete)n.direction="forward",n.unit="character";else{if(e.keyCode!=so.backspace)return;n.direction="backward",n.unit="codePoint"}const o=ro.isMac?e.altKey:e.ctrlKey;n.unit=o?"word":n.unit,n.sequence=++i,r(t,e.domEvent,n)})),ro.isAndroid&&e.on("beforeinput",((e,i)=>{if("deleteContentBackward"!=i.domEvent.inputType)return;const n={unit:"codepoint",direction:"backward",sequence:1},o=i.domTarget.ownerDocument.defaultView.getSelection();o.anchorNode==o.focusNode&&o.anchorOffset+1!=o.focusOffset&&(n.selectionToRemove=t.domConverter.domSelectionToView(o)),r(e,i.domEvent,n)}))}observe(){}}class Eh extends ue{static get pluginName(){return"Delete"}init(){const t=this.editor,e=t.editing.view,i=e.document,r=t.model.document;e.addObserver(Ph),this._undoOnBackspace=!1;const n=new Th(t,"forward");if(t.commands.add("deleteForward",n),t.commands.add("forwardDelete",n),t.commands.add("delete",new Th(t,"backward")),this.listenTo(i,"delete",((i,r)=>{const n={unit:r.unit,sequence:r.sequence};if(r.selectionToRemove){const e=t.model.createSelection(),i=[];for(const e of r.selectionToRemove.getRanges())i.push(t.editing.mapper.toModelRange(e));e.setTo(i),n.selection=e}t.execute("forward"==r.direction?"deleteForward":"delete",n),r.preventDefault(),e.scrollToTheSelection()}),{priority:"low"}),ro.isAndroid){let t=null;this.listenTo(i,"delete",((e,i)=>{const r=i.domTarget.ownerDocument.defaultView.getSelection();t={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}}),{priority:"lowest"}),this.listenTo(i,"keyup",((e,i)=>{if(t){const e=i.domTarget.ownerDocument.defaultView.getSelection();e.collapse(t.anchorNode,t.anchorOffset),e.extend(t.focusNode,t.focusOffset),t=null}}))}this.editor.plugins.has("UndoEditing")&&(this.listenTo(i,"delete",((e,i)=>{this._undoOnBackspace&&"backward"==i.direction&&1==i.sequence&&"codePoint"==i.unit&&(this._undoOnBackspace=!1,t.execute("undo"),i.preventDefault(),e.stop())}),{context:"$capture"}),this.listenTo(r,"change",(()=>{this._undoOnBackspace=!1})))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class Sh extends ue{static get requires(){return[Ch,Eh]}static get pluginName(){return"Typing"}}function Rh(t,e){let i=t.start;return{text:Array.from(t.getItems()).reduce(((t,r)=>r.is("$text")||r.is("$textProxy")?t+r.data:(i=e.createPositionAfter(r),"")),""),range:e.createRange(i,t.end)}}class Ih{constructor(t,e){this.model=t,this.testCallback=e,this.hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",(()=>{this.isEnabled?this._startListening():(this.stopListening(t.document.selection),this.stopListening(t.document))})),this._startListening()}_startListening(){const t=this.model.document;this.listenTo(t.selection,"change:range",((e,{directChange:i})=>{i&&(t.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this.hasMatch=!1))})),this.listenTo(t,"change:data",((t,e)=>{"transparent"!=e.type&&this._evaluateTextBeforeSelection("data",{batch:e})}))}_evaluateTextBeforeSelection(t,e={}){const i=this.model,r=i.document.selection,n=i.createRange(i.createPositionAt(r.focus.parent,0),r.focus),{text:o,range:s}=Rh(n,i),a=this.testCallback(o);if(!a&&this.hasMatch&&this.fire("unmatched"),this.hasMatch=!!a,a){const i=Object.assign(e,{text:o,range:s});"object"==typeof a&&Object.assign(i,a),this.fire(`matched:${t}`,i)}}}de(Ih,oe);class Oh extends ue{static get pluginName(){return"TwoStepCaretMovement"}constructor(t){super(t),this.attributes=new Set,this._overrideUid=null}init(){const t=this.editor,e=t.model,i=t.editing.view,r=t.locale,n=e.document.selection;this.listenTo(i.document,"arrowKey",((t,e)=>{if(!n.isCollapsed)return;if(e.shiftKey||e.altKey||e.ctrlKey)return;const i=e.keyCode==so.arrowright,o=e.keyCode==so.arrowleft;if(!i&&!o)return;const s=r.contentLanguageDirection;let a=!1;a="ltr"===s&&i||"rtl"===s&&o?this._handleForwardMovement(e):this._handleBackwardMovement(e),!0===a&&t.stop()}),{context:"$text",priority:"highest"}),this._isNextGravityRestorationSkipped=!1,this.listenTo(n,"change:range",((t,e)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!e.directChange&&Vh(n.getFirstPosition(),this.attributes)||this._restoreGravity())}))}registerAttribute(t){this.attributes.add(t)}_handleForwardMovement(t){const e=this.attributes,i=this.editor.model.document.selection,r=i.getFirstPosition();return!this._isGravityOverridden&&((!r.isAtStart||!Mh(i,e))&&(Vh(r,e)?(Lh(t),this._overrideGravity(),!0):void 0))}_handleBackwardMovement(t){const e=this.attributes,i=this.editor.model,r=i.document.selection,n=r.getFirstPosition();return this._isGravityOverridden?(Lh(t),this._restoreGravity(),Nh(i,e,n),!0):n.isAtStart?!!Mh(r,e)&&(Lh(t),Nh(i,e,n),!0):function(t,e){return Vh(t.getShiftedBy(-1),e)}(n,e)?n.isAtEnd&&!Mh(r,e)&&Vh(n,e)?(Lh(t),Nh(i,e,n),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1):void 0}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change((t=>t.overrideSelectionGravity()))}_restoreGravity(){this.editor.model.change((t=>{t.restoreSelectionGravity(this._overrideUid),this._overrideUid=null}))}}function Mh(t,e){for(const i of e)if(t.hasAttribute(i))return!0;return!1}function Nh(t,e,i){const r=i.nodeBefore;t.change((t=>{r?t.setSelectionAttribute(r.getAttributes()):t.removeSelectionAttribute(e)}))}function Lh(t){t.preventDefault()}function Vh(t,e){const{nodeBefore:i,nodeAfter:r}=t;for(const t of e){const e=i?i.getAttribute(t):void 0;if((r?r.getAttribute(t):void 0)!==e)return!0}return!1}var Dh=/[\\^$.*+?()[\]{}|]/g,Bh=RegExp(Dh.source);const zh=function(t){return(t=nn(t))&&Bh.test(t)?t.replace(Dh,"\\$&"):t},Fh={copyright:{from:"(c)",to:"©"},registeredTrademark:{from:"(r)",to:"®"},trademark:{from:"(tm)",to:"™"},oneHalf:{from:/(^|[^/a-z0-9])(1\/2)([^/a-z0-9])$/i,to:[null,"½",null]},oneThird:{from:/(^|[^/a-z0-9])(1\/3)([^/a-z0-9])$/i,to:[null,"⅓",null]},twoThirds:{from:/(^|[^/a-z0-9])(2\/3)([^/a-z0-9])$/i,to:[null,"⅔",null]},oneForth:{from:/(^|[^/a-z0-9])(1\/4)([^/a-z0-9])$/i,to:[null,"¼",null]},threeQuarters:{from:/(^|[^/a-z0-9])(3\/4)([^/a-z0-9])$/i,to:[null,"¾",null]},lessThanOrEqual:{from:"<=",to:"≤"},greaterThanOrEqual:{from:">=",to:"≥"},notEqual:{from:"!=",to:"≠"},arrowLeft:{from:"<-",to:"←"},arrowRight:{from:"->",to:"→"},horizontalEllipsis:{from:"...",to:"…"},enDash:{from:/(^| )(--)( )$/,to:[null,"–",null]},emDash:{from:/(^| )(---)( )$/,to:[null,"—",null]},quotesPrimary:{from:Uh('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:Uh("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:Uh("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:Uh('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:Uh('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:Uh("'"),to:[null,"‚",null,"’"]}},qh={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},jh=["symbols","mathematical","typography","quotes"];function $h(t){return"string"==typeof t?new RegExp(`(${zh(t)})$`):t}function Hh(t){return"string"==typeof t?()=>[t]:t instanceof Array?()=>t:t}function Wh(t){return(t.textNode?t.textNode:t.nodeAfter).getAttributes()}function Uh(t){return new RegExp(`(^|\\s)(${t})([^${t}]*)(${t})$`)}function Kh(t,e,i,r){return r.createRange(Gh(t,e,i,!0,r),Gh(t,e,i,!1,r))}function Gh(t,e,i,r,n){let o=t.textNode||(r?t.nodeBefore:t.nodeAfter),s=null;for(;o&&o.getAttribute(e)==i;)s=o,o=r?o.previousSibling:o.nextSibling;return s?n.createPositionAt(s,r?"before":"after"):t}i(3047);const Jh=new WeakMap;function Yh(t){const{view:e,element:i,text:r,isDirectHost:n=!0,keepOnFocus:o=!1}=t,s=e.document;Jh.has(s)||(Jh.set(s,new Map),s.registerPostFixer((t=>Xh(s,t)))),Jh.get(s).set(i,{text:r,isDirectHost:n,keepOnFocus:o,hostElement:n?i:null}),e.change((t=>Xh(s,t)))}function Qh(t,e){return!!e.hasClass("ck-placeholder")&&(t.removeClass("ck-placeholder",e),!0)}function Xh(t,e){const i=Jh.get(t),r=[];let n=!1;for(const[t,o]of i)o.isDirectHost&&(r.push(t),Zh(e,t,o)&&(n=!0));for(const[t,o]of i){if(o.isDirectHost)continue;const i=td(t);i&&(r.includes(i)||(o.hostElement=i,Zh(e,t,o)&&(n=!0)))}return n}function Zh(t,e,i){const{text:r,isDirectHost:n,hostElement:o}=i;let s=!1;o.getAttribute("data-placeholder")!==r&&(t.setAttribute("data-placeholder",r,o),s=!0);return(n||1==e.childCount)&&function(t,e){if(!t.isAttached())return!1;const i=Array.from(t.getChildren()).some((t=>!t.is("uiElement")));if(i)return!1;if(e)return!0;const r=t.document;if(!r.isFocused)return!0;const n=r.selection.anchor;return n&&n.parent!==t}(o,i.keepOnFocus)?function(t,e){return!e.hasClass("ck-placeholder")&&(t.addClass("ck-placeholder",e),!0)}(t,o)&&(s=!0):Qh(t,o)&&(s=!0),s}function td(t){if(t.childCount){const e=t.getChild(0);if(e.is("element")&&!e.is("uiElement"))return e}return null}const ed=new Map;function id(t,e,i){let r=ed.get(t);r||(r=new Map,ed.set(t,r)),r.set(e,i)}function rd(t){return[t]}function nd(t,e,i={}){const r=function(t,e){const i=ed.get(t);return i&&i.has(e)?i.get(e):rd}(t.constructor,e.constructor);try{return r(t=t.clone(),e,i)}catch(t){throw t}}function od(t,e,i){t=t.slice(),e=e.slice();const r=new sd(i.document,i.useRelations,i.forceWeakRemove);r.setOriginalOperations(t),r.setOriginalOperations(e);const n=r.originalOperations;if(0==t.length||0==e.length)return{operationsA:t,operationsB:e,originalOperations:n};const o=new WeakMap;for(const e of t)o.set(e,0);const s={nextBaseVersionA:t[t.length-1].baseVersion+1,nextBaseVersionB:e[e.length-1].baseVersion+1,originalOperationsACount:t.length,originalOperationsBCount:e.length};let a=0;for(;a{if(t.key===e.key&&t.range.start.hasSameParentAs(e.range.start)){const r=t.range.getDifference(e.range).map((e=>new ol(e,t.key,t.oldValue,t.newValue,0))),n=t.range.getIntersection(e.range);return n&&i.aIsStrong&&r.push(new ol(n,e.key,e.newValue,t.newValue,0)),0==r.length?[new Ml(0)]:r}return[t]})),id(ol,cl,((t,e)=>{if(t.range.start.hasSameParentAs(e.position)&&t.range.containsPosition(e.position)){const i=t.range._getTransformedByInsertion(e.position,e.howMany,!e.shouldReceiveAttributes).map((e=>new ol(e,t.key,t.oldValue,t.newValue,t.baseVersion)));if(e.shouldReceiveAttributes){const r=ld(e,t.key,t.oldValue);r&&i.unshift(r)}return i}return t.range=t.range._getTransformedByInsertion(e.position,e.howMany,!1)[0],[t]})),id(ol,ul,((t,e)=>{const i=[];t.range.start.hasSameParentAs(e.deletionPosition)&&(t.range.containsPosition(e.deletionPosition)||t.range.start.isEqual(e.deletionPosition))&&i.push(Da._createFromPositionAndShift(e.graveyardPosition,1));const r=t.range._getTransformedByMergeOperation(e);return r.isCollapsed||i.push(r),i.map((e=>new ol(e,t.key,t.oldValue,t.newValue,t.baseVersion)))})),id(ol,al,((t,e)=>{const i=function(t,e){const i=Da._createFromPositionAndShift(e.sourcePosition,e.howMany);let r=null,n=[];i.containsRange(t,!0)?r=t:t.start.hasSameParentAs(i.start)?(n=t.getDifference(i),r=t.getIntersection(i)):n=[t];const o=[];for(let t of n){t=t._getTransformedByDeletion(e.sourcePosition,e.howMany);const i=e.getMovedRangeStart(),r=t.start.hasSameParentAs(i);t=t._getTransformedByInsertion(i,e.howMany,r),o.push(...t)}r&&o.push(r._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany,!1)[0]);return o}(t.range,e);return i.map((e=>new ol(e,t.key,t.oldValue,t.newValue,t.baseVersion)))})),id(ol,gl,((t,e)=>{if(t.range.end.isEqual(e.insertionPosition))return e.graveyardPosition||t.range.end.offset++,[t];if(t.range.start.hasSameParentAs(e.splitPosition)&&t.range.containsPosition(e.splitPosition)){const i=t.clone();return i.range=new Da(e.moveTargetPosition.clone(),t.range.end._getCombined(e.splitPosition,e.moveTargetPosition)),t.range.end=e.splitPosition.clone(),t.range.end.stickiness="toPrevious",[t,i]}return t.range=t.range._getTransformedBySplitOperation(e),[t]})),id(cl,ol,((t,e)=>{const i=[t];if(t.shouldReceiveAttributes&&t.position.hasSameParentAs(e.range.start)&&e.range.containsPosition(t.position)){const r=ld(t,e.key,e.newValue);r&&i.push(r)}return i})),id(cl,cl,((t,e,i)=>(t.position.isEqual(e.position)&&i.aIsStrong||(t.position=t.position._getTransformedByInsertOperation(e)),[t]))),id(cl,al,((t,e)=>(t.position=t.position._getTransformedByMoveOperation(e),[t]))),id(cl,gl,((t,e)=>(t.position=t.position._getTransformedBySplitOperation(e),[t]))),id(cl,ul,((t,e)=>(t.position=t.position._getTransformedByMergeOperation(e),[t]))),id(ll,cl,((t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedByInsertOperation(e)[0]),t.newRange&&(t.newRange=t.newRange._getTransformedByInsertOperation(e)[0]),[t]))),id(ll,ll,((t,e,i)=>{if(t.name==e.name){if(!i.aIsStrong)return[new Ml(0)];t.oldRange=e.newRange?e.newRange.clone():null}return[t]})),id(ll,ul,((t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedByMergeOperation(e)),t.newRange&&(t.newRange=t.newRange._getTransformedByMergeOperation(e)),[t]))),id(ll,al,((t,e,i)=>{if(t.oldRange&&(t.oldRange=Da._createFromRanges(t.oldRange._getTransformedByMoveOperation(e))),t.newRange){if(i.abRelation){const r=Da._createFromRanges(t.newRange._getTransformedByMoveOperation(e));if("left"==i.abRelation.side&&e.targetPosition.isEqual(t.newRange.start))return t.newRange.start.path=i.abRelation.path,t.newRange.end=r.end,[t];if("right"==i.abRelation.side&&e.targetPosition.isEqual(t.newRange.end))return t.newRange.start=r.start,t.newRange.end.path=i.abRelation.path,[t]}t.newRange=Da._createFromRanges(t.newRange._getTransformedByMoveOperation(e))}return[t]})),id(ll,gl,((t,e,i)=>{if(t.oldRange&&(t.oldRange=t.oldRange._getTransformedBySplitOperation(e)),t.newRange){if(i.abRelation){const r=t.newRange._getTransformedBySplitOperation(e);return t.newRange.start.isEqual(e.splitPosition)&&i.abRelation.wasStartBeforeMergedElement?t.newRange.start=Ma._createAt(e.insertionPosition):t.newRange.start.isEqual(e.splitPosition)&&!i.abRelation.wasInLeftElement&&(t.newRange.start=Ma._createAt(e.moveTargetPosition)),t.newRange.end.isEqual(e.splitPosition)&&i.abRelation.wasInRightElement?t.newRange.end=Ma._createAt(e.moveTargetPosition):t.newRange.end.isEqual(e.splitPosition)&&i.abRelation.wasEndBeforeMergedElement?t.newRange.end=Ma._createAt(e.insertionPosition):t.newRange.end=r.end,[t]}t.newRange=t.newRange._getTransformedBySplitOperation(e)}return[t]})),id(ul,cl,((t,e)=>(t.sourcePosition.hasSameParentAs(e.position)&&(t.howMany+=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByInsertOperation(e),t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e),[t]))),id(ul,ul,((t,e,i)=>{if(t.sourcePosition.isEqual(e.sourcePosition)&&t.targetPosition.isEqual(e.targetPosition)){if(i.bWasUndone){const i=e.graveyardPosition.path.slice();return i.push(0),t.sourcePosition=new Ma(e.graveyardPosition.root,i),t.howMany=0,[t]}return[new Ml(0)]}if(t.sourcePosition.isEqual(e.sourcePosition)&&!t.targetPosition.isEqual(e.targetPosition)&&!i.bWasUndone&&"splitAtSource"!=i.abRelation){const r="$graveyard"==t.targetPosition.root.rootName,n="$graveyard"==e.targetPosition.root.rootName,o=r&&!n;if(n&&!r||!o&&i.aIsStrong){const i=e.targetPosition._getTransformedByMergeOperation(e),r=t.targetPosition._getTransformedByMergeOperation(e);return[new al(i,t.howMany,r,0)]}return[new Ml(0)]}return t.sourcePosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByMergeOperation(e),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),t.graveyardPosition.isEqual(e.graveyardPosition)&&i.aIsStrong||(t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)),[t]})),id(ul,al,((t,e,i)=>{const r=Da._createFromPositionAndShift(e.sourcePosition,e.howMany);return"remove"==e.type&&!i.bWasUndone&&!i.forceWeakRemove&&t.deletionPosition.hasSameParentAs(e.sourcePosition)&&r.containsPosition(t.sourcePosition)?[new Ml(0)]:(t.sourcePosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.sourcePosition.hasSameParentAs(e.sourcePosition)&&(t.howMany-=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByMoveOperation(e),t.targetPosition=t.targetPosition._getTransformedByMoveOperation(e),t.graveyardPosition.isEqual(e.targetPosition)||(t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)),[t])})),id(ul,gl,((t,e,i)=>{if(e.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByDeletion(e.graveyardPosition,1),t.deletionPosition.isEqual(e.graveyardPosition)&&(t.howMany=e.howMany)),t.targetPosition.isEqual(e.splitPosition)){const r=0!=e.howMany,n=e.graveyardPosition&&t.deletionPosition.isEqual(e.graveyardPosition);if(r||n||"mergeTargetNotMoved"==i.abRelation)return t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),[t]}if(t.sourcePosition.isEqual(e.splitPosition)){if("mergeSourceNotMoved"==i.abRelation)return t.howMany=0,t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t];if("mergeSameElement"==i.abRelation||t.sourcePosition.offset>0)return t.sourcePosition=e.moveTargetPosition.clone(),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]}return t.sourcePosition.hasSameParentAs(e.splitPosition)&&(t.howMany=e.splitPosition.offset),t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]})),id(al,cl,((t,e)=>{const i=Da._createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByInsertOperation(e,!1)[0];return t.sourcePosition=i.start,t.howMany=i.end.offset-i.start.offset,t.targetPosition.isEqual(e.position)||(t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e)),[t]})),id(al,al,((t,e,i)=>{const r=Da._createFromPositionAndShift(t.sourcePosition,t.howMany),n=Da._createFromPositionAndShift(e.sourcePosition,e.howMany);let o,s=i.aIsStrong,a=!i.aIsStrong;if("insertBefore"==i.abRelation||"insertAfter"==i.baRelation?a=!0:"insertAfter"!=i.abRelation&&"insertBefore"!=i.baRelation||(a=!1),o=t.targetPosition.isEqual(e.targetPosition)&&a?t.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany):t.targetPosition._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),hd(t,e)&&hd(e,t))return[e.getReversed()];if(r.containsPosition(e.targetPosition)&&r.containsRange(n,!0))return r.start=r.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),r.end=r.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),dd([r],o);if(n.containsPosition(t.targetPosition)&&n.containsRange(r,!0))return r.start=r.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),r.end=r.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),dd([r],o);const c=Nr(t.sourcePosition.getParentPath(),e.sourcePosition.getParentPath());if("prefix"==c||"extension"==c)return r.start=r.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),r.end=r.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),dd([r],o);"remove"!=t.type||"remove"==e.type||i.aWasUndone||i.forceWeakRemove?"remove"==t.type||"remove"!=e.type||i.bWasUndone||i.forceWeakRemove||(s=!1):s=!0;const l=[],h=r.getDifference(n);for(const t of h){t.start=t.start._getTransformedByDeletion(e.sourcePosition,e.howMany),t.end=t.end._getTransformedByDeletion(e.sourcePosition,e.howMany);const i="same"==Nr(t.start.getParentPath(),e.getMovedRangeStart().getParentPath()),r=t._getTransformedByInsertion(e.getMovedRangeStart(),e.howMany,i);l.push(...r)}const d=r.getIntersection(n);return null!==d&&s&&(d.start=d.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),d.end=d.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),0===l.length?l.push(d):1==l.length?n.start.isBefore(r.start)||n.start.isEqual(r.start)?l.unshift(d):l.push(d):l.splice(1,0,d)),0===l.length?[new Ml(t.baseVersion)]:dd(l,o)})),id(al,gl,((t,e,i)=>{let r=t.targetPosition.clone();t.targetPosition.isEqual(e.insertionPosition)&&e.graveyardPosition&&"moveTargetAfter"!=i.abRelation||(r=t.targetPosition._getTransformedBySplitOperation(e));const n=Da._createFromPositionAndShift(t.sourcePosition,t.howMany);if(n.end.isEqual(e.insertionPosition))return e.graveyardPosition||t.howMany++,t.targetPosition=r,[t];if(n.start.hasSameParentAs(e.splitPosition)&&n.containsPosition(e.splitPosition)){let t=new Da(e.splitPosition,n.end);t=t._getTransformedBySplitOperation(e);return dd([new Da(n.start,e.splitPosition),t],r)}t.targetPosition.isEqual(e.splitPosition)&&"insertAtSource"==i.abRelation&&(r=e.moveTargetPosition),t.targetPosition.isEqual(e.insertionPosition)&&"insertBetween"==i.abRelation&&(r=t.targetPosition);const o=[n._getTransformedBySplitOperation(e)];if(e.graveyardPosition){const r=n.start.isEqual(e.graveyardPosition)||n.containsPosition(e.graveyardPosition);t.howMany>1&&r&&!i.aWasUndone&&o.push(Da._createFromPositionAndShift(e.insertionPosition,1))}return dd(o,r)})),id(al,ul,((t,e,i)=>{const r=Da._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.deletionPosition.hasSameParentAs(t.sourcePosition)&&r.containsPosition(e.sourcePosition))if("remove"!=t.type||i.forceWeakRemove){if(1==t.howMany)return i.bWasUndone?(t.sourcePosition=e.graveyardPosition.clone(),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]):[new Ml(0)]}else if(!i.aWasUndone){const i=[];let r=e.graveyardPosition.clone(),n=e.targetPosition._getTransformedByMergeOperation(e);t.howMany>1&&(i.push(new al(t.sourcePosition,t.howMany-1,t.targetPosition,0)),r=r._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany-1),n=n._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany-1));const o=e.deletionPosition._getCombined(t.sourcePosition,t.targetPosition),s=new al(r,1,o,0),a=s.getMovedRangeStart().path.slice();a.push(0);const c=new Ma(s.targetPosition.root,a);n=n._getTransformedByMove(r,o,1);const l=new al(n,e.howMany,c,0);return i.push(s),i.push(l),i}const n=Da._createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByMergeOperation(e);return t.sourcePosition=n.start,t.howMany=n.end.offset-n.start.offset,t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]})),id(hl,cl,((t,e)=>(t.position=t.position._getTransformedByInsertOperation(e),[t]))),id(hl,ul,((t,e)=>t.position.isEqual(e.deletionPosition)?(t.position=e.graveyardPosition.clone(),t.position.stickiness="toNext",[t]):(t.position=t.position._getTransformedByMergeOperation(e),[t]))),id(hl,al,((t,e)=>(t.position=t.position._getTransformedByMoveOperation(e),[t]))),id(hl,hl,((t,e,i)=>{if(t.position.isEqual(e.position)){if(!i.aIsStrong)return[new Ml(0)];t.oldName=e.newName}return[t]})),id(hl,gl,((t,e)=>{if("same"==Nr(t.position.path,e.splitPosition.getParentPath())&&!e.graveyardPosition){const e=new hl(t.position.getShiftedBy(1),t.oldName,t.newName,0);return[t,e]}return t.position=t.position._getTransformedBySplitOperation(e),[t]})),id(dl,dl,((t,e,i)=>{if(t.root===e.root&&t.key===e.key){if(!i.aIsStrong||t.newValue===e.newValue)return[new Ml(0)];t.oldValue=e.newValue}return[t]})),id(gl,cl,((t,e)=>(t.splitPosition.hasSameParentAs(e.position)&&t.splitPosition.offset{if(!t.graveyardPosition&&!i.bWasUndone&&t.splitPosition.hasSameParentAs(e.sourcePosition)){const i=e.graveyardPosition.path.slice();i.push(0);const r=new Ma(e.graveyardPosition.root,i),n=gl.getInsertionPosition(new Ma(e.graveyardPosition.root,i)),o=new gl(r,0,n,null,0);return t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e),t.insertionPosition=gl.getInsertionPosition(t.splitPosition),t.graveyardPosition=o.insertionPosition.clone(),t.graveyardPosition.stickiness="toNext",[o,t]}return t.splitPosition.hasSameParentAs(e.deletionPosition)&&!t.splitPosition.isAfter(e.deletionPosition)&&t.howMany--,t.splitPosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e),t.insertionPosition=gl.getInsertionPosition(t.splitPosition),t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)),[t]})),id(gl,al,((t,e,i)=>{const r=Da._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.graveyardPosition){const n=r.start.isEqual(t.graveyardPosition)||r.containsPosition(t.graveyardPosition);if(!i.bWasUndone&&n){const i=t.splitPosition._getTransformedByMoveOperation(e),r=t.graveyardPosition._getTransformedByMoveOperation(e),n=r.path.slice();n.push(0);const o=new Ma(r.root,n);return[new al(i,t.howMany,o,0)]}t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)}const n=t.splitPosition.isEqual(e.targetPosition);if(n&&("insertAtSource"==i.baRelation||"splitBefore"==i.abRelation))return t.howMany+=e.howMany,t.splitPosition=t.splitPosition._getTransformedByDeletion(e.sourcePosition,e.howMany),t.insertionPosition=gl.getInsertionPosition(t.splitPosition),[t];if(n&&i.abRelation&&i.abRelation.howMany){const{howMany:e,offset:r}=i.abRelation;return t.howMany+=e,t.splitPosition=t.splitPosition.getShiftedBy(r),[t]}if(t.splitPosition.hasSameParentAs(e.sourcePosition)&&r.containsPosition(t.splitPosition)){const i=e.howMany-(t.splitPosition.offset-e.sourcePosition.offset);return t.howMany-=i,t.splitPosition.hasSameParentAs(e.targetPosition)&&t.splitPosition.offset{if(t.splitPosition.isEqual(e.splitPosition)){if(!t.graveyardPosition&&!e.graveyardPosition)return[new Ml(0)];if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition))return[new Ml(0)];if("splitBefore"==i.abRelation)return t.howMany=0,t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e),[t]}if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition)){const r="$graveyard"==t.splitPosition.root.rootName,n="$graveyard"==e.splitPosition.root.rootName,o=r&&!n;if(n&&!r||!o&&i.aIsStrong){const i=[];return e.howMany&&i.push(new al(e.moveTargetPosition,e.howMany,e.splitPosition,0)),t.howMany&&i.push(new al(t.splitPosition,t.howMany,t.moveTargetPosition,0)),i}return[new Ml(0)]}if(t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e)),t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==i.abRelation)return t.howMany++,[t];if(e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==i.baRelation){const i=e.insertionPosition.path.slice();i.push(0);const r=new Ma(e.insertionPosition.root,i);return[t,new al(t.insertionPosition,1,r,0)]}return t.splitPosition.hasSameParentAs(e.splitPosition)&&t.splitPosition.offset{t.execute(r)}),t.model.document.on("change:data",((s,a)=>{if(o&&!o.isEnabled||!e.isEnabled)return;const c=da(t.model.document.selection.getRanges());if(!c.isCollapsed)return;if("transparent"==a.type)return;const l=Array.from(t.model.document.differ.getChanges()),h=l[0];if(1!=l.length||"insert"!==h.type||"$text"!=h.name||1!=h.length)return;const d=h.position.parent;if(d.is("element","codeBlock"))return;if(d.is("element","listItem")&&"function"!=typeof r&&!["numberedList","bulletedList","todoList"].includes(r))return;if(o&&!0===o.value)return;const u=d.getChild(0),g=t.model.createRangeOn(u);if(!g.containsRange(c)&&!c.end.isEqual(g.end))return;const f=i.exec(u.data.substr(0,c.end.offset));f&&t.model.enqueueChange((e=>{const i=e.createPositionAt(d,0),r=e.createPositionAt(d,f[0].length),o=new Ya(i,r);if(!1!==n({match:f})){e.remove(o);const i=t.model.document.selection.getFirstRange(),r=e.createRangeIn(d);!d.isEmpty||r.isEqual(i)||r.containsRange(i,!0)||e.remove(d)}o.detach(),t.model.enqueueChange((()=>{t.plugins.get("Delete").requestUndoOnBackspace()}))}))}))}function pd(t,e,i,r){let n,o;i instanceof RegExp?n=i:o=i,o=o||(t=>{let e;const i=[],r=[];for(;null!==(e=n.exec(t))&&!(e&&e.length<4);){let{index:t,1:n,2:o,3:s}=e;const a=n+o+s;t+=e[0].length-a.length;const c=[t,t+n.length],l=[t+n.length+o.length,t+n.length+o.length+s.length];i.push(c),i.push(l),r.push([t+n.length,t+n.length+o.length])}return{remove:i,format:r}}),t.model.document.on("change:data",((i,n)=>{if("transparent"==n.type||!e.isEnabled)return;const s=t.model,a=s.document.selection;if(!a.isCollapsed)return;const c=Array.from(s.document.differ.getChanges()),l=c[0];if(1!=c.length||"insert"!==l.type||"$text"!=l.name||1!=l.length)return;const h=a.focus,d=h.parent,{text:u,range:g}=function(t,e){let i=t.start;return{text:Array.from(t.getItems()).reduce(((t,r)=>!r.is("$text")&&!r.is("$textProxy")||r.getAttribute("code")?(i=e.createPositionAfter(r),""):t+r.data),""),range:e.createRange(i,t.end)}}(s.createRange(s.createPositionAt(d,0),h),s),f=o(u),m=bd(g.start,f.format,s),p=bd(g.start,f.remove,s);m.length&&p.length&&s.enqueueChange((e=>{if(!1!==r(e,m)){for(const t of p.reverse())e.remove(t);s.enqueueChange((()=>{t.plugins.get("Delete").requestUndoOnBackspace()}))}}))}))}function bd(t,e,i){return e.filter((t=>void 0!==t[0]&&void 0!==t[1])).map((e=>i.createRange(t.getShiftedBy(e[0]),t.getShiftedBy(e[1]))))}function wd(t,e){return(i,r)=>{if(!t.commands.get(e).isEnabled)return!1;const n=t.model.schema.getValidRanges(r,e);for(const t of n)i.setAttribute(e,!0,t);i.removeSelectionAttribute(e)}}class _d extends fe{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,i=e.document.selection,r=void 0===t.forceValue?!this.value:t.forceValue;e.change((t=>{if(i.isCollapsed)r?t.setSelectionAttribute(this.attributeKey,!0):t.removeSelectionAttribute(this.attributeKey);else{const n=e.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const e of n)r?t.setAttribute(this.attributeKey,r,e):t.removeAttribute(this.attributeKey,e)}}))}_getValueFromFirstAllowedNode(){const t=this.editor.model,e=t.schema,i=t.document.selection;if(i.isCollapsed)return i.hasAttribute(this.attributeKey);for(const t of i.getRanges())for(const i of t.getItems())if(e.checkAttribute(i,this.attributeKey))return i.hasAttribute(this.attributeKey);return!1}}const kd="bold";class vd extends ue{static get pluginName(){return"BoldEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:kd}),t.model.schema.setAttributeProperties(kd,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:kd,view:"strong",upcastAlso:["b",t=>{const e=t.getStyle("font-weight");return e?"bold"==e||Number(e)>=600?{name:!0,styles:["font-weight"]}:void 0:null}]}),t.commands.add(kd,new _d(t,kd)),t.keystrokes.set("CTRL+B",kd)}}function yd({emitter:t,activator:e,callback:i,contextElements:r}){t.listenTo(document,"mousedown",((t,n)=>{if(!e())return;const o="function"==typeof n.composedPath?n.composedPath():[];for(const t of r)if(t.contains(n.target)||o.includes(t))return;i()}))}function xd(t){t.set("_isCssTransitionsDisabled",!1),t.disableCssTransitions=()=>{t._isCssTransitionsDisabled=!0},t.enableCssTransitions=()=>{t._isCssTransitionsDisabled=!1},t.extendTemplate({attributes:{class:[t.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}function Ad({view:t}){t.listenTo(t.element,"submit",((e,i)=>{i.preventDefault(),t.fire("submit")}),{useCapture:!0})}class Cd extends Tr{constructor(t=[]){super(t,{idProperty:"viewUid"}),this.on("add",((t,e,i)=>{this._renderViewIntoCollectionParent(e,i)})),this.on("remove",((t,e)=>{e.element&&this._parentElement&&e.element.remove()})),this._parentElement=null}destroy(){this.map((t=>t.destroy()))}setParent(t){this._parentElement=t;for(const t of this)this._renderViewIntoCollectionParent(t)}delegate(...t){if(!t.length||!t.every((t=>"string"==typeof t)))throw new c("ui-viewcollection-delegate-wrong-events",this);return{to:e=>{for(const i of this)for(const r of t)i.delegate(r).to(e);this.on("add",((i,r)=>{for(const i of t)r.delegate(i).to(e)})),this.on("remove",((i,r)=>{for(const i of t)r.stopDelegating(i,e)}))}}}_renderViewIntoCollectionParent(t,e){t.isRendered||t.render(),t.element&&this._parentElement&&this._parentElement.insertBefore(t.element,this._parentElement.children[e])}}i(7770);class Td{constructor(t){this.element=null,this.isRendered=!1,this.locale=t,this.t=t&&t.t,this._viewCollections=new Tr,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",((e,i)=>{i.locale=t})),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=Pd.bind(this,this)}createCollection(t){const e=new Cd(t);return this._viewCollections.add(e),e}registerChild(t){Cr(t)||(t=[t]);for(const e of t)this._unboundChildren.add(e)}deregisterChild(t){Cr(t)||(t=[t]);for(const e of t)this._unboundChildren.remove(e)}setTemplate(t){this.template=new Pd(t)}extendTemplate(t){Pd.extend(this.template,t)}render(){if(this.isRendered)throw new c("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map((t=>t.destroy())),this.template&&this.template._revertData&&this.template.revert(this.element)}}de(Td,ss),de(Td,oe);class Pd{constructor(t){Object.assign(this,Dd(Vd(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 c("ui-template-revert-not-applied",[this,t]);this._revertTemplateFromNode(t,this._revertData)}*getViews(){yield*function*t(e){if(e.children)for(const i of e.children)$d(i)?yield i:Hd(i)&&(yield*t(i))}(this)}static bind(t,e){return{to:(i,r)=>new Sd({eventNameOrFunction:i,attribute:i,observable:t,emitter:e,callback:r}),if:(i,r,n)=>new Rd({observable:t,emitter:e,attribute:i,valueIfTrue:r,callback:n})}}static extend(t,e){if(t._isRendered)throw new c("template-extend-render",[this,t]);qd(t,Dd(Vd(e)))}_renderNode(t){let e;if(e=t.node?this.tag&&this.text:this.tag?this.text:!this.text,e)throw new c("ui-template-wrong-syntax",this);return this.text?this._renderText(t):this._renderElement(t)}_renderElement(t){let e=t.node;return e||(e=t.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",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(""),Id(this.text)?this._bindToObservable({schema:this.text,updater:Md(e),data:t}):e.textContent=this.text.join(""),e}_renderAttributes(t){let e,i,r,n;if(!this.attributes)return;const o=t.node,s=t.revertData;for(e in this.attributes)if(r=o.getAttribute(e),i=this.attributes[e],s&&(s.attributes[e]=r),n=A(i[0])&&i[0].ns?i[0].ns:null,Id(i)){const a=n?i[0].value:i;s&&Ud(e)&&a.unshift(r),this._bindToObservable({schema:a,updater:Nd(o,e,n),data:t})}else"style"==e&&"string"!=typeof i[0]?this._renderStyleAttribute(i[0],t):(s&&r&&Ud(e)&&i.unshift(r),i=i.map((t=>t&&t.value||t)).reduce(((t,e)=>t.concat(e)),[]).reduce(zd,""),jd(i)||o.setAttributeNS(n,e,i))}_renderStyleAttribute(t,e){const i=e.node;for(const r in t){const n=t[r];Id(n)?this._bindToObservable({schema:[n],updater:Ld(i,r),data:e}):i.style[r]=n}}_renderElementChildren(t){const e=t.node,i=t.intoFragment?document.createDocumentFragment():e,r=t.isApplying;let n=0;for(const o of this.children)if(Wd(o)){if(!r){o.setParent(e);for(const t of o)i.appendChild(t.element)}}else if($d(o))r||(o.isRendered||o.render(),i.appendChild(o.element));else if(Wo(o))i.appendChild(o);else if(r){const e={children:[],bindings:[],attributes:{}};t.revertData.children.push(e),o._renderNode({node:i.childNodes[n++],isApplying:!0,revertData:e})}else i.appendChild(o.render());t.intoFragment&&e.appendChild(i)}_setUpListeners(t){if(this.eventListeners)for(const e in this.eventListeners){const i=this.eventListeners[e].map((i=>{const[r,n]=e.split("@");return i.activateDomEventListener(r,n,t)}));t.revertData&&t.revertData.bindings.push(i)}}_bindToObservable({schema:t,updater:e,data:i}){const r=i.revertData;Od(t,e,i);const n=t.filter((t=>!jd(t))).filter((t=>t.observable)).map((r=>r.activateAttributeListener(t,e,i)));r&&r.bindings.push(n)}_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 i in e.attributes){const r=e.attributes[i];null===r?t.removeAttribute(i):t.setAttribute(i,r)}for(let i=0;iOd(t,e,i);return this.emitter.listenTo(this.observable,"change:"+this.attribute,r),()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,r)}}}class Sd extends Ed{activateDomEventListener(t,e,i){const r=(t,i)=>{e&&!i.target.matches(e)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(i):this.observable.fire(this.eventNameOrFunction,i))};return this.emitter.listenTo(i.node,t,r),()=>{this.emitter.stopListening(i.node,t,r)}}}class Rd extends Ed{getValue(t){return!jd(super.getValue(t))&&(this.valueIfTrue||!0)}}function Id(t){return!!t&&(t.value&&(t=t.value),Array.isArray(t)?t.some(Id):t instanceof Ed)}function Od(t,e,{node:i}){let r=function(t,e){return t.map((t=>t instanceof Ed?t.getValue(e):t))}(t,i);r=1==t.length&&t[0]instanceof Rd?r[0]:r.reduce(zd,""),jd(r)?e.remove():e.set(r)}function Md(t){return{set(e){t.textContent=e},remove(){t.textContent=""}}}function Nd(t,e,i){return{set(r){t.setAttributeNS(i,e,r)},remove(){t.removeAttributeNS(i,e)}}}function Ld(t,e){return{set(i){t.style[e]=i},remove(){t.style[e]=null}}}function Vd(t){return kr(t,(t=>{if(t&&(t instanceof Ed||Hd(t)||$d(t)||Wd(t)))return t}))}function Dd(t){if("string"==typeof t?t=function(t){return{text:[t]}}(t):t.text&&function(t){t.text=Er(t.text)}(t),t.on&&(t.eventListeners=function(t){for(const e in t)Bd(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=Er(t[e].value)),Bd(t,e)}(t.attributes);const e=[];if(t.children)if(Wd(t.children))e.push(t.children);else for(const i of t.children)Hd(i)||$d(i)||Wo(i)?e.push(i):e.push(new Pd(i));t.children=e}return t}function Bd(t,e){t[e]=Er(t[e])}function zd(t,e){return jd(e)?t:jd(t)?e:`${t} ${e}`}function Fd(t,e){for(const i in e)t[i]?t[i].push(...e[i]):t[i]=e[i]}function qd(t,e){if(e.attributes&&(t.attributes||(t.attributes={}),Fd(t.attributes,e.attributes)),e.eventListeners&&(t.eventListeners||(t.eventListeners={}),Fd(t.eventListeners,e.eventListeners)),e.text&&t.text.push(...e.text),e.children&&e.children.length){if(t.children.length!=e.children.length)throw new c("ui-template-extend-children-mismatch",t);let i=0;for(const r of e.children)qd(t.children[i++],r)}}function jd(t){return!t&&0!==t}function $d(t){return t instanceof Td}function Hd(t){return t instanceof Pd}function Wd(t){return t instanceof Cd}function Ud(t){return"class"==t||"style"==t}const Kd=function(t){return"string"==typeof t||!St(t)&&yt(t)&&"[object String]"==D(t)};class Gd extends Cd{constructor(t,e=[]){super(e),this.locale=t}attachToDom(){this._bodyCollectionContainer=new Pd({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();let t=document.querySelector(".ck-body-wrapper");t||(t=function(t,e,i={},r=[]){const n=i&&i.xmlns,o=n?t.createElementNS(n,e):t.createElement(e);for(const t in i)o.setAttribute(t,i[t]);!Kd(r)&&Cr(r)||(r=[r]);for(let e of r)Kd(e)&&(e=t.createTextNode(e)),o.appendChild(e);return o}(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(t)),t.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const t=document.querySelector(".ck-body-wrapper");t&&0==t.childElementCount&&t.remove()}}i(7835);class Jd extends Td{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}))}}i(9314);class Yd extends Td{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")}]}]})}}i(9852);class Qd extends Td{constructor(t){super(t);const e=this.bindTemplate,i=s();this.set("class"),this.set("labelStyle"),this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),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.set("withKeystroke",!1),this.children=this.createCollection(),this.tooltipView=this._createTooltipView(),this.labelView=this._createLabelView(i),this.iconView=new Jd,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.keystrokeView=this._createKeystrokeView(),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"),e.if("withKeystroke","ck-button_with-keystroke")],type:e.to("type",(t=>t||"button")),tabindex:e.to("tabindex"),"aria-labelledby":`ck-editor__aria-label_${i}`,"aria-disabled":e.if("isEnabled",!0,(t=>!t)),"aria-pressed":e.to("isOn",(t=>!!this.isToggleable&&String(t)))},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),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}_createTooltipView(){const t=new Yd;return t.bind("text").to(this,"_tooltipString"),t.bind("position").to(this,"tooltipPosition"),t}_createLabelView(t){const e=new Td,i=this.bindTemplate;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:i.to("labelStyle"),id:`ck-editor__aria-label_${t}`},children:[{text:this.bindTemplate.to("label")}]}),e}_createKeystrokeView(){const t=new Td;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",(t=>ho(t)))}]}),t}_getTooltipString(t,e,i){return t?"string"==typeof t?t:(i&&(i=ho(i)),t instanceof Function?t(e,i):`${e}${i?` (${i})`:""}`):""}}i(285);class Xd extends Qd{constructor(t){super(t),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const t=new Td;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),t}}class Zd{constructor(t){if(Object.assign(this,t),t.actions&&t.keystrokeHandler)for(const e in t.actions){let i=t.actions[e];"string"==typeof i&&(i=[i]);for(const r of i)t.keystrokeHandler.set(r,((t,i)=>{this[e](),i()}))}}get first(){return this.focusables.find(tu)||null}get last(){return this.focusables.filter(tu).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,i)=>{const r=e.element===this.focusTracker.focusedElement;return r&&(t=i),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,i=this.focusables.length;if(!i)return null;if(null===e)return this[1===t?"first":"last"];let r=(e+i+t)%i;do{const e=this.focusables.get(r);if(tu(e))return e;r=(r+i+t)%i}while(r!==e);return null}}function tu(t){return!(!t.focus||"none"==Yo.window.getComputedStyle(t.element).display)}i(218);const eu=' ';class iu extends Qd{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 Jd;return t.content=eu,t.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),t}}i(8295);class ru extends Td{constructor(t){super(t);const e=this.bindTemplate;this.set("class"),this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!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.actionView=this._createActionView(),this.arrowView=this._createArrowView(),this.keystrokes=new ga,this.focusTracker=new ua,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",e.to("class"),e.if("isVisible","ck-hidden",(t=>!t)),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render(),this.children.add(this.actionView),this.children.add(this.arrowView),this.focusTracker.add(this.actionView.element),this.focusTracker.add(this.arrowView.element),this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",((t,e)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),e())})),this.keystrokes.set("arrowleft",((t,e)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),e())}))}focus(){this.actionView.focus()}_createActionView(){const t=new Qd;return t.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),t.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),t.delegate("execute").to(this),t}_createArrowView(){const t=new Qd,e=t.bindTemplate;return t.icon=eu,t.extendTemplate({attributes:{class:"ck-splitbutton__arrow","aria-haspopup":!0,"aria-expanded":e.to("isOn",(t=>String(t)))}}),t.bind("isEnabled").to(this),t.delegate("execute").to(this,"open"),t}}class nu extends Td{constructor(t){super(t);const e=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",e.to("position",(t=>`ck-dropdown__panel_${t}`)),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()}}}i(6775);function ou({element:t,target:e,positions:i,limiter:r,fitInViewport:n,viewportOffsetConfig:o}){B(e)&&(e=e()),B(r)&&(r=r());const s=function(t){return t&&t.parentNode?t.offsetParent===Yo.document.body?null:t.offsetParent:null}(t),a=new na(t);let c;const l={targetRect:new na(e),elementRect:a,positionedElementAncestor:s};if(r||n){const t=r&&new na(r).getVisible(),e=n&&function(t){t=Object.assign({top:0,bottom:0,left:0,right:0},t);const e=new na(Yo.window);return e.top+=t.top,e.height-=t.top,e.bottom-=t.bottom,e.height-=t.bottom,e}(o);Object.assign(l,{limiterRect:t,viewportRect:e}),c=function(t,e){const{elementRect:i}=e,r=i.getArea(),n=t.map((t=>new au(t,e))).filter((t=>!!t.name));let o=0,s=null;for(const t of n){const{_limiterIntersectionArea:e,_viewportIntersectionArea:i}=t;if(e===r)return t;const n=i**2+e**2;n>o&&(o=n,s=t)}return s}(i,l)||new au(i[0],l)}else c=new au(i[0],l);return c}function su(t){const{scrollX:e,scrollY:i}=Yo.window;return t.clone().moveBy(e,i)}class au{constructor(t,e){const i=t(e.targetRect,e.elementRect,e.viewportRect);if(!i)return;const{left:r,top:n,name:o,config:s}=i;Object.assign(this,{name:o,config:s}),this._positioningFunctionCorrdinates={left:r,top:n},this._options=e}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get _limiterIntersectionArea(){const t=this._options.limiterRect;if(t){const e=this._options.viewportRect;if(!e)return t.getIntersectionArea(this._rect);{const i=t.getIntersection(e);if(i)return i.getIntersectionArea(this._rect)}}return 0}get _viewportIntersectionArea(){const t=this._options.viewportRect;return t?t.getIntersectionArea(this._rect):0}get _rect(){return this._cachedRect||(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCorrdinates.left,this._positioningFunctionCorrdinates.top)),this._cachedRect}get _absoluteRect(){return this._cachedAbsoluteRect||(this._cachedAbsoluteRect=su(this._rect),this._options.positionedElementAncestor&&function(t,e){const i=su(new na(e)),r=ia(e);let n=0,o=0;n-=i.left,o-=i.top,n+=e.scrollLeft,o+=e.scrollTop,n-=r.left,o-=r.top,t.moveBy(n,o)}(this._cachedAbsoluteRect,this._options.positionedElementAncestor)),this._cachedAbsoluteRect}}class cu extends Td{constructor(t,e,i){super(t);const r=this.bindTemplate;this.buttonView=e,this.panelView=i,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class"),this.set("id"),this.set("panelPosition","auto"),this.keystrokes=new ga,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",r.to("class"),r.if("isEnabled","ck-disabled",(t=>!t))],id:r.to("id"),"aria-describedby":r.to("ariaDescribedById")},children:[e,i]}),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.on("change:isOpen",(()=>{this.isOpen&&("auto"===this.panelPosition?this.panelView.position=cu._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions}).name:this.panelView.position=this.panelPosition)})),this.keystrokes.listenTo(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()}get _panelPositions(){const{south:t,north:e,southEast:i,southWest:r,northEast:n,northWest:o,southMiddleEast:s,southMiddleWest:a,northMiddleEast:c,northMiddleWest:l}=cu.defaultPanelPositions;return"rtl"!==this.locale.uiLanguageDirection?[i,r,s,a,t,n,o,c,l,e]:[r,i,a,s,t,o,n,l,c,e]}}cu.defaultPanelPositions={south:(t,e)=>({top:t.bottom,left:t.left-(e.width-t.width)/2,name:"s"}),southEast:t=>({top:t.bottom,left:t.left,name:"se"}),southWest:(t,e)=>({top:t.bottom,left:t.left-e.width+t.width,name:"sw"}),southMiddleEast:(t,e)=>({top:t.bottom,left:t.left-(e.width-t.width)/4,name:"sme"}),southMiddleWest:(t,e)=>({top:t.bottom,left:t.left-3*(e.width-t.width)/4,name:"smw"}),north:(t,e)=>({top:t.top-e.height,left:t.left-(e.width-t.width)/2,name:"n"}),northEast:(t,e)=>({top:t.top-e.height,left:t.left,name:"ne"}),northWest:(t,e)=>({top:t.top-e.height,left:t.left-e.width+t.width,name:"nw"}),northMiddleEast:(t,e)=>({top:t.top-e.height,left:t.left-(e.width-t.width)/4,name:"nme"}),northMiddleWest:(t,e)=>({top:t.top-e.height,left:t.left-3*(e.width-t.width)/4,name:"nmw"})},cu._getOptimalPosition=ou;class lu extends Td{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class hu extends Td{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function du(t){return Array.isArray(t)?{items:t,removeItems:[]}:t?Object.assign({items:[],removeItems:[]},t):{items:[],removeItems:[]}}i(3171);class uu extends Td{constructor(t,e){super(t);const i=this.bindTemplate,r=this.t;this.options=e||{},this.set("ariaLabel",r("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new ua,this.keystrokes=new ga,this.set("class"),this.set("isCompact",!1),this.itemsView=new gu(t),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const n="rtl"===t.uiLanguageDirection;this._focusCycler=new Zd({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[n?"arrowright":"arrowleft","arrowup"],focusNext:[n?"arrowleft":"arrowright","arrowdown"]}});const o=["ck","ck-toolbar",i.to("class"),i.if("isCompact","ck-toolbar_compact")];var s;this.options.shouldGroupWhenFull&&this.options.isFloating&&o.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:o,role:"toolbar","aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")}},children:this.children,on:{mousedown:(s=this,s.bindTemplate.to((t=>{t.target===s.element&&t.preventDefault()})))}}),this._behavior=this.options.shouldGroupWhenFull?new mu(this):new fu(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),this._behavior.render(this)}destroy(){return this._behavior.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(t,e){const i=du(t),r=i.items.filter(((t,r,n)=>"|"===t||-1===i.removeItems.indexOf(t)&&("-"===t?!this.options.shouldGroupWhenFull||(l("toolbarview-line-break-ignored-when-grouping-items",n),!1):!!e.has(t)||(l("toolbarview-item-unavailable",{name:t}),!1)))),n=this._cleanSeparators(r).map((t=>"|"===t?new lu:"-"===t?new hu:e.create(t)));this.items.addMany(n)}_cleanSeparators(t){const e=t=>"-"!==t&&"|"!==t,i=t.length,r=t.findIndex(e),n=i-t.slice().reverse().findIndex(e);return t.slice(r,n).filter(((t,i,r)=>{if(e(t))return!0;return!(i>0&&r[i-1]===t)}))}}class gu extends Td{constructor(t){super(t),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class fu{constructor(t){const e=t.bindTemplate;t.set("isVertical",!1),t.itemsView.children.bindTo(t.items).using((t=>t)),t.focusables.bindTo(t.items).using((t=>t)),t.extendTemplate({attributes:{class:[e.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class mu{constructor(t){this.view=t,this.viewChildren=t.children,this.viewFocusables=t.focusables,this.viewItemsView=t.itemsView,this.viewFocusTracker=t.focusTracker,this.viewLocale=t.locale,this.ungroupedItems=t.createCollection(),this.groupedItems=t.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,t.itemsView.children.bindTo(this.ungroupedItems).using((t=>t)),this.ungroupedItems.on("add",this._updateFocusCycleableItems.bind(this)),this.ungroupedItems.on("remove",this._updateFocusCycleableItems.bind(this)),t.children.on("add",this._updateFocusCycleableItems.bind(this)),t.children.on("remove",this._updateFocusCycleableItems.bind(this)),t.items.on("change",((t,e)=>{const i=e.index;for(const t of e.removed)i>=this.ungroupedItems.length?this.groupedItems.remove(t):this.ungroupedItems.remove(t);for(let t=i;tthis.ungroupedItems.length?this.groupedItems.add(r,t-this.ungroupedItems.length):this.ungroupedItems.add(r,t)}this._updateGrouping()})),t.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}render(t){this.viewElement=t.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(t)}destroy(){this.groupedItemsDropdown.destroy(),this.resizeObserver.destroy()}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!this.viewElement.offsetParent)return void(this.shouldUpdateGroupingOnNextResize=!0);const t=this.groupedItems.length;let e;for(;this._areItemsOverflowing;)this._groupLastItem(),e=!0;if(!e&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==t&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const t=this.viewElement,e=this.viewLocale.uiLanguageDirection,i=new na(t.lastChild),r=new na(t);if(!this.cachedPadding){const i=Yo.window.getComputedStyle(t),r="ltr"===e?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(i[r])}return"ltr"===e?i.right>r.right-this.cachedPadding:i.left{t&&t===e.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),t=e.contentRect.width)})),this._updateGrouping()}_enableGroupingOnMaxWidthChange(t){t.on("change:maxWidth",(()=>{this._updateGrouping()}))}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new lu),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){const t=this.viewLocale,e=t.t,i=_u(t);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition="ltr"===t.uiLanguageDirection?"sw":"se",function(t,e){const i=t.locale,r=i.t,n=t.toolbarView=new uu(i);n.set("ariaLabel",r("Dropdown toolbar")),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,[]),i.buttonView.set({label:e("Show more items"),tooltip:!0,tooltipPosition:"rtl"===t.uiLanguageDirection?"se":"sw",icon:hh}),i.toolbarView.items.bindTo(this.groupedItems).using((t=>t)),i}_updateFocusCycleableItems(){this.viewFocusables.clear(),this.ungroupedItems.map((t=>{this.viewFocusables.add(t)})),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}i(2547);class pu extends Td{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new ua,this.keystrokes=new ga,this._focusCycler=new Zd({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 bu extends Td{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 wu extends Td{constructor(t){super(t),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}i(6390),i(9607);function _u(t,e=iu){const i=new e(t),r=new nu(t),n=new cu(t,i,r);return i.bind("isEnabled").to(n),i instanceof iu?i.bind("isOn").to(n,"isOpen"):i.arrowView.bind("isOn").to(n,"isOpen"),function(t){(function(t){t.on("render",(()=>{yd({emitter:t,activator:()=>t.isOpen,callback:()=>{t.isOpen=!1},contextElements:[t.element]})}))})(t),function(t){t.on("execute",(e=>{e.source instanceof Xd||(t.isOpen=!1)}))}(t),function(t){t.keystrokes.set("arrowdown",((e,i)=>{t.isOpen&&(t.panelView.focus(),i())})),t.keystrokes.set("arrowup",((e,i)=>{t.isOpen&&(t.panelView.focusLast(),i())}))}(t)}(n),n}function ku(t,e){const i=t.locale,r=t.listView=new pu(i);r.items.bindTo(e).using((({type:t,model:e})=>{if("separator"===t)return new wu(i);if("button"===t||"switchbutton"===t){const r=new bu(i);let n;return n="button"===t?new Qd(i):new Xd(i),n.bind(...Object.keys(e)).to(e),n.delegate("execute").to(r),r.children.add(n),r}})),t.panelView.children.add(r),r.items.delegate("execute").to(t)}i(996);class vu extends Td{constructor(t){super(t),this.body=new Gd(t)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}i(480);class yu extends Td{constructor(t){super(t),this.set("text"),this.set("for"),this.id=`ck-editor__label_${s()}`;const e=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:e.to("for")},children:[{text:e.to("text")}]})}}class xu extends vu{constructor(t){super(t),this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-editor","ck-rounded-corners"],role:"application",dir:t.uiLanguageDirection,lang:t.uiLanguage,"aria-labelledby":this._voiceLabelView.id},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(){const t=this.t,e=new yu;return e.text=t("Rich Text Editor"),e.extendTemplate({attributes:{class:"ck-voice-label"}}),e}}class Au extends Td{constructor(t,e,i){super(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:t.contentLanguage,dir:t.contentLanguageDirection}}),this.name=null,this.set("isFocused",!1),this._editableElement=i,this._hasExternalElement=!!this._editableElement,this._editingView=e}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",(()=>this._updateIsFocusedClasses())),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}_updateIsFocusedClasses(){const t=this._editingView;function e(e){t.change((i=>{const r=t.document.getRoot(e.name);i.addClass(e.isFocused?"ck-focused":"ck-blurred",r),i.removeClass(e.isFocused?"ck-blurred":"ck-focused",r)}))}t.isRenderingInProgress?function i(r){t.once("change:isRenderingInProgress",((t,n,o)=>{o?i(r):e(r)}))}(this):e(this)}}class Cu extends Au{constructor(t,e,i){super(t,e,i),this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const t=this._editingView,e=this.t;t.change((i=>{const r=t.document.getRoot(this.name);i.setAttribute("aria-label",e("Rich Text Editor, %0",this.name),r)}))}}i(9350);class Tu extends Td{constructor(t,e={}){super(t);const i=this.bindTemplate;this.set("label",e.label||""),this.set("class",e.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",i.to("class")]},children:this.children});const r=new Td(t);r.setTemplate({tag:"span",attributes:{class:["ck","ck-form__header__label"]},children:[{text:i.to("label")}]}),this.children.add(r)}}i(5728);class Pu extends Td{constructor(t){super(t),this.set("value"),this.set("id"),this.set("placeholder"),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById"),this.focusTracker=new ua,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{type:"text",class:["ck","ck-input","ck-input-text",e.if("isFocused","ck-input_focused"),e.if("isEmpty","ck-input-text_empty"),e.if("hasError","ck-error")],id:e.to("id"),placeholder:e.to("placeholder"),readonly:e.to("isReadOnly"),"aria-invalid":e.if("hasError",!0),"aria-describedby":e.to("ariaDescribedById")},on:{input:e.to(((...t)=>{this.fire("input",...t),this._updateIsEmpty()})),change:e.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",((t,e,i)=>{this._setDomElementValue(i),this._updateIsEmpty()}))}select(){this.element.select()}focus(){this.element.focus()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(t){this.element.value=t||0===t?t:""}}i(5872);class Eu extends Td{constructor(t,e){super(t);const i=`ck-labeled-field-view-${s()}`,r=`ck-labeled-field-view-status-${s()}`;this.fieldView=e(this,i,r),this.set("label"),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class"),this.set("placeholder"),this.labelView=this._createLabelView(i),this.statusView=this._createStatusView(r),this.bind("_statusText").to(this,"errorText",this,"infoText",((t,e)=>t||e));const n=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",n.to("class"),n.if("isEnabled","ck-disabled",(t=>!t)),n.if("isEmpty","ck-labeled-field-view_empty"),n.if("isFocused","ck-labeled-field-view_focused"),n.if("placeholder","ck-labeled-field-view_placeholder"),n.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:[this.fieldView,this.labelView]},this.statusView]})}_createLabelView(t){const e=new yu(this.locale);return e.for=t,e.bind("text").to(this,"label"),e}_createStatusView(t){const e=new Td(this.locale),i=this.bindTemplate;return e.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",i.if("errorText","ck-labeled-field-view__status_error"),i.if("_statusText","ck-hidden",(t=>!t))],id:t,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),e}focus(){this.fieldView.focus()}}function Su(t,e,i){const r=new Pu(t.locale);return r.set({id:e,ariaDescribedById:i}),r.bind("isReadOnly").to(t,"isEnabled",(t=>!t)),r.bind("hasError").to(t,"errorText",(t=>!!t)),r.on("input",(()=>{t.errorText=null})),t.bind("isEmpty","isFocused","placeholder").to(r),r}class Ru{constructor(t,e){e&&Xt(this,e),t&&this.set(t)}}de(Ru,oe);i(2653);const Iu=ha("px"),Ou=Yo.document.body;class Mu extends Td{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("class"),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("class")],style:{top:e.to("top",Iu),left:e.to("left",Iu)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(t){this.show();const e=Mu.defaultPositions,i=Object.assign({},{element:this.element,positions:[e.southArrowNorth,e.southArrowNorthMiddleWest,e.southArrowNorthMiddleEast,e.southArrowNorthWest,e.southArrowNorthEast,e.northArrowSouth,e.northArrowSouthMiddleWest,e.northArrowSouthMiddleEast,e.northArrowSouthWest,e.northArrowSouthEast,e.viewportStickyNorth],limiter:Ou,fitInViewport:!0},t),r=Mu._getOptimalPosition(i),n=parseInt(r.left),o=parseInt(r.top),{name:s,config:a={}}=r,{withArrow:c=!0}=a;Object.assign(this,{top:o,left:n,position:s,withArrow:c})}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=Nu(t.target),i=t.limiter?Nu(t.limiter):Ou;this.listenTo(Yo.document,"scroll",((r,n)=>{const o=n.target,s=e&&o.contains(e),a=i&&o.contains(i);!s&&!a&&e&&i||this.attachTo(t)}),{useCapture:!0}),this.listenTo(Yo.window,"resize",(()=>{this.attachTo(t)}))}_stopPinning(){this.stopListening(Yo.document,"scroll"),this.stopListening(Yo.window,"resize")}}function Nu(t){return vr(t)?t:ea(t)?t.commonAncestorContainer:"function"==typeof t?Nu(t()):null}function Lu(t,e){return t.top-e.height-Mu.arrowVerticalOffset}function Vu(t){return t.bottom+Mu.arrowVerticalOffset}Mu.arrowHorizontalOffset=25,Mu.arrowVerticalOffset=10,Mu.stickyVerticalOffset=20,Mu._getOptimalPosition=ou,Mu.defaultPositions={northWestArrowSouthWest:(t,e)=>({top:Lu(t,e),left:t.left-Mu.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouthMiddleWest:(t,e)=>({top:Lu(t,e),left:t.left-.25*e.width-Mu.arrowHorizontalOffset,name:"arrow_smw"}),northWestArrowSouth:(t,e)=>({top:Lu(t,e),left:t.left-e.width/2,name:"arrow_s"}),northWestArrowSouthMiddleEast:(t,e)=>({top:Lu(t,e),left:t.left-.75*e.width+Mu.arrowHorizontalOffset,name:"arrow_sme"}),northWestArrowSouthEast:(t,e)=>({top:Lu(t,e),left:t.left-e.width+Mu.arrowHorizontalOffset,name:"arrow_se"}),northArrowSouthWest:(t,e)=>({top:Lu(t,e),left:t.left+t.width/2-Mu.arrowHorizontalOffset,name:"arrow_sw"}),northArrowSouthMiddleWest:(t,e)=>({top:Lu(t,e),left:t.left+t.width/2-.25*e.width-Mu.arrowHorizontalOffset,name:"arrow_smw"}),northArrowSouth:(t,e)=>({top:Lu(t,e),left:t.left+t.width/2-e.width/2,name:"arrow_s"}),northArrowSouthMiddleEast:(t,e)=>({top:Lu(t,e),left:t.left+t.width/2-.75*e.width+Mu.arrowHorizontalOffset,name:"arrow_sme"}),northArrowSouthEast:(t,e)=>({top:Lu(t,e),left:t.left+t.width/2-e.width+Mu.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouthWest:(t,e)=>({top:Lu(t,e),left:t.right-Mu.arrowHorizontalOffset,name:"arrow_sw"}),northEastArrowSouthMiddleWest:(t,e)=>({top:Lu(t,e),left:t.right-.25*e.width-Mu.arrowHorizontalOffset,name:"arrow_smw"}),northEastArrowSouth:(t,e)=>({top:Lu(t,e),left:t.right-e.width/2,name:"arrow_s"}),northEastArrowSouthMiddleEast:(t,e)=>({top:Lu(t,e),left:t.right-.75*e.width+Mu.arrowHorizontalOffset,name:"arrow_sme"}),northEastArrowSouthEast:(t,e)=>({top:Lu(t,e),left:t.right-e.width+Mu.arrowHorizontalOffset,name:"arrow_se"}),southWestArrowNorthWest:(t,e)=>({top:Vu(t),left:t.left-Mu.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorthMiddleWest:(t,e)=>({top:Vu(t),left:t.left-.25*e.width-Mu.arrowHorizontalOffset,name:"arrow_nmw"}),southWestArrowNorth:(t,e)=>({top:Vu(t),left:t.left-e.width/2,name:"arrow_n"}),southWestArrowNorthMiddleEast:(t,e)=>({top:Vu(t),left:t.left-.75*e.width+Mu.arrowHorizontalOffset,name:"arrow_nme"}),southWestArrowNorthEast:(t,e)=>({top:Vu(t),left:t.left-e.width+Mu.arrowHorizontalOffset,name:"arrow_ne"}),southArrowNorthWest:(t,e)=>({top:Vu(t),left:t.left+t.width/2-Mu.arrowHorizontalOffset,name:"arrow_nw"}),southArrowNorthMiddleWest:(t,e)=>({top:Vu(t),left:t.left+t.width/2-.25*e.width-Mu.arrowHorizontalOffset,name:"arrow_nmw"}),southArrowNorth:(t,e)=>({top:Vu(t),left:t.left+t.width/2-e.width/2,name:"arrow_n"}),southArrowNorthMiddleEast:(t,e)=>({top:Vu(t),left:t.left+t.width/2-.75*e.width+Mu.arrowHorizontalOffset,name:"arrow_nme"}),southArrowNorthEast:(t,e)=>({top:Vu(t),left:t.left+t.width/2-e.width+Mu.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorthWest:(t,e)=>({top:Vu(t),left:t.right-Mu.arrowHorizontalOffset,name:"arrow_nw"}),southEastArrowNorthMiddleWest:(t,e)=>({top:Vu(t),left:t.right-.25*e.width-Mu.arrowHorizontalOffset,name:"arrow_nmw"}),southEastArrowNorth:(t,e)=>({top:Vu(t),left:t.right-e.width/2,name:"arrow_n"}),southEastArrowNorthMiddleEast:(t,e)=>({top:Vu(t),left:t.right-.75*e.width+Mu.arrowHorizontalOffset,name:"arrow_nme"}),southEastArrowNorthEast:(t,e)=>({top:Vu(t),left:t.right-e.width+Mu.arrowHorizontalOffset,name:"arrow_ne"}),viewportStickyNorth:(t,e,i)=>t.getIntersection(i)?{top:i.top+Mu.stickyVerticalOffset,left:t.left+t.width/2-e.width/2,name:"arrowless",config:{withArrow:!1}}:null};i(5165),i(3423);const Du=ha("px");class Bu extends ue{static get pluginName(){return"ContextualBalloon"}constructor(t){super(t),this.positionLimiter=()=>{const t=this.editor.editing.view,e=t.document.selection.editableElement;return e?t.domConverter.mapViewToDom(e.root):null},this.set("visibleView",null),this.view=new Mu(t.locale),t.ui.view.body.add(this.view),t.ui.focusTracker.add(this.view.element),this._viewToStack=new Map,this._idToStack=new Map,this.set("_numberOfStacks",0),this.set("_singleViewMode",!1),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}hasView(t){return Array.from(this._viewToStack.keys()).includes(t)}add(t){if(this.hasView(t.view))throw new c("contextualballoon-add-view-exist",[this,t]);const e=t.stackId||"main";if(!this._idToStack.has(e))return this._idToStack.set(e,new Map([[t.view,t]])),this._viewToStack.set(t.view,this._idToStack.get(e)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!t.singleViewMode||this.showStack(e));const i=this._idToStack.get(e);t.singleViewMode&&this.showStack(e),i.set(t.view,t),this._viewToStack.set(t.view,i),i===this._visibleStack&&this._showView(t)}remove(t){if(!this.hasView(t))throw new c("contextualballoon-remove-view-not-exist",[this,t]);const e=this._viewToStack.get(t);this._singleViewMode&&this.visibleView===t&&(this._singleViewMode=!1),this.visibleView===t&&(1===e.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(e.values())[e.size-2])),1===e.size?(this._idToStack.delete(this._getStackId(e)),this._numberOfStacks=this._idToStack.size):e.delete(t),this._viewToStack.delete(t)}updatePosition(t){t&&(this._visibleStack.get(this.visibleView).position=t),this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition()}showStack(t){this.visibleStack=t;const e=this._idToStack.get(t);if(!e)throw new c("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==e&&this._showView(Array.from(e.values()).pop())}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(t){return Array.from(this._idToStack.entries()).find((e=>e[1]===t))[0]}_showNextStack(){const t=Array.from(this._idToStack.values());let e=t.indexOf(this._visibleStack)+1;t[e]||(e=0),this.showStack(this._getStackId(t[e]))}_showPrevStack(){const t=Array.from(this._idToStack.values());let e=t.indexOf(this._visibleStack)-1;t[e]||(e=t.length-1),this.showStack(this._getStackId(t[e]))}_createRotatorView(){const t=new zu(this.editor.locale),e=this.editor.locale.t;return this.view.content.add(t),t.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",((t,e)=>!e&&t>1)),t.on("change:isNavigationVisible",(()=>this.updatePosition()),{priority:"low"}),t.bind("counter").to(this,"visibleView",this,"_numberOfStacks",((t,i)=>{if(i<2)return"";const r=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return e("%0 of %1",[r,i])})),t.buttonNextView.on("execute",(()=>{t.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()})),t.buttonPrevView.on("execute",(()=>{t.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()})),t}_createFakePanelsView(){const t=new Fu(this.editor.locale,this.view);return t.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",((t,e)=>!e&&t>=2?Math.min(t-1,2):0)),t.listenTo(this.view,"change:top",(()=>t.updatePosition())),t.listenTo(this.view,"change:left",(()=>t.updatePosition())),this.editor.ui.view.body.add(t),t}_showView({view:t,balloonClassName:e="",withArrow:i=!0,singleViewMode:r=!1}){this.view.class=e,this.view.withArrow=i,this._rotatorView.showView(t),this.visibleView=t,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),r&&(this._singleViewMode=!0)}_getBalloonPosition(){let t=Array.from(this._visibleStack.values()).pop().position;return t&&(t.limiter||(t=Object.assign({},t,{limiter:this.positionLimiter})),t=Object.assign({},t,{viewportOffsetConfig:this.editor.ui.viewportOffset})),t}}class zu extends Td{constructor(t){super(t);const e=t.t,i=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new ua,this.buttonPrevView=this._createButtonView(e("Previous"),' '),this.buttonNextView=this._createButtonView(e("Next"),' '),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",i.to("isNavigationVisible",(t=>t?"":"ck-hidden"))]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}showView(t){this.hideView(),this.content.add(t)}hideView(){this.content.clear()}_createButtonView(t,e){const i=new Qd(this.locale);return i.set({label:t,icon:e,tooltip:!0}),i}}class Fu extends Td{constructor(t,e){super(t);const i=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=e,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",(t=>t?"":"ck-hidden"))],style:{top:i.to("top",Du),left:i.to("left",Du),width:i.to("width",Du),height:i.to("height",Du)}},children:this.content}),this.on("change:numberOfPanels",((t,e,i,r)=>{i>r?this._addPanels(i-r):this._removePanels(r-i),this.updatePosition()}))}_addPanels(t){for(;t--;){const t=new Td;t.setTemplate({tag:"div"}),this.content.add(t),this.registerChild(t)}}_removePanels(t){for(;t--;){const t=this.content.last;this.content.remove(t),this.deregisterChild(t),t.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:t,left:e}=this._balloonPanelView,{width:i,height:r}=new na(this._balloonPanelView.element);Object.assign(this,{top:t,left:e,width:i,height:r})}}}i(7372);const qu=ha("px");class ju extends Td{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 Pd({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:e.to("isSticky",(t=>t?"block":"none")),height:e.to("isSticky",(t=>t?qu(this._panelRect.height):null))}}}).render(),this._contentPanel=new Pd({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?qu(this._contentPanelPlaceholder.getBoundingClientRect().width):null)),top:e.to("_hasViewportTopOffset",(t=>t?qu(this.viewportTopOffset):null)),bottom:e.to("_isStickyToTheLimiter",(t=>t?qu(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(Yo.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{i.isFocused&&!r.focusTracker.isFocused&&(n&&n(),r.focus(),e())})),r.keystrokes.set("Esc",((e,i)=>{r.focusTracker.isFocused&&(t.focus(),o&&o(),i())}))}ha("px");i(7964);ha("px");ha("px");const Hu="bold";class Wu extends ue{static get pluginName(){return"BoldUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(Hu,(i=>{const r=t.commands.get(Hu),n=new Qd(i);return n.set({label:e("Bold"),icon:' ',keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),n.bind("isOn","isEnabled").to(r,"value","isEnabled"),this.listenTo(n,"execute",(()=>{t.execute(Hu),t.editing.view.focus()})),n}))}}const Uu="italic";class Ku extends ue{static get pluginName(){return"ItalicEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:Uu}),t.model.schema.setAttributeProperties(Uu,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:Uu,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),t.commands.add(Uu,new _d(t,Uu)),t.keystrokes.set("CTRL+I",Uu)}}const Gu="italic";class Ju extends ue{static get pluginName(){return"ItalicUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(Gu,(i=>{const r=t.commands.get(Gu),n=new Qd(i);return n.set({label:e("Italic"),icon:' ',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),n.bind("isOn","isEnabled").to(r,"value","isEnabled"),this.listenTo(n,"execute",(()=>{t.execute(Gu),t.editing.view.focus()})),n}))}}const Yu="strikethrough";class Qu extends ue{static get pluginName(){return"StrikethroughEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:Yu}),t.model.schema.setAttributeProperties(Yu,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:Yu,view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),t.commands.add(Yu,new _d(t,Yu)),t.keystrokes.set("CTRL+SHIFT+X","strikethrough")}}const Xu="strikethrough";class Zu extends ue{static get pluginName(){return"StrikethroughUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(Xu,(i=>{const r=t.commands.get(Xu),n=new Qd(i);return n.set({label:e("Strikethrough"),icon:' ',keystroke:"CTRL+SHIFT+X",tooltip:!0,isToggleable:!0}),n.bind("isOn","isEnabled").to(r,"value","isEnabled"),this.listenTo(n,"execute",(()=>{t.execute(Xu),t.editing.view.focus()})),n}))}}function*tg(t,e){for(const i of e)i&&t.getAttributeProperties(i[0]).copyOnEnter&&(yield i)}class eg extends fe{execute(){const t=this.editor.model,e=t.document;t.change((i=>{!function(t,e,i,r){const n=i.isCollapsed,o=i.getFirstRange(),s=o.start.parent,a=o.end.parent;if(r.isLimit(s)||r.isLimit(a))return void(n||s!=a||t.deleteContent(i));if(n){const t=tg(e.model.schema,i.getAttributes());ig(e,o.start),e.setSelectionAttribute(t)}else{const r=!(o.start.isAtStart&&o.end.isAtEnd),n=s==a;t.deleteContent(i,{leaveUnmerged:r}),r&&(n?ig(e,i.focus):e.setSelection(a,0))}}(this.editor.model,i,e.selection,t.schema),this.fire("afterExecute",{writer:i})}))}}function ig(t,e){t.split(e),t.setSelection(e.parent.nextSibling,0)}class rg extends ls{constructor(t){super(t);const e=this.document;e.on("keydown",((t,i)=>{if(this.isEnabled&&i.keyCode==so.enter){const r=new jn(e,"enter",e.selection.getFirstRange());e.fire(r,new Os(e,i.domEvent,{isSoft:i.shiftKey})),r.stop.called&&t.stop()}}))}observe(){}}class ng extends ue{static get pluginName(){return"Enter"}init(){const t=this.editor,e=t.editing.view,i=e.document;e.addObserver(rg),t.commands.add("enter",new eg(t)),this.listenTo(i,"enter",((i,r)=>{r.preventDefault(),r.isSoft||(t.execute("enter"),e.scrollToTheSelection())}),{priority:"low"})}}class og extends fe{execute(){const t=this.editor.model,e=t.document;t.change((i=>{!function(t,e,i){const r=i.isCollapsed,n=i.getFirstRange(),o=n.start.parent,s=n.end.parent,a=o==s;if(r){const r=tg(t.schema,i.getAttributes());sg(t,e,n.end),e.removeSelectionAttribute(i.getAttributeKeys()),e.setSelectionAttribute(r)}else{const r=!(n.start.isAtStart&&n.end.isAtEnd);t.deleteContent(i,{leaveUnmerged:r}),a?sg(t,e,i.focus):r&&e.setSelection(s,0)}}(t,i,e.selection),this.fire("afterExecute",{writer:i})}))}refresh(){const t=this.editor.model,e=t.document;this.isEnabled=function(t,e){if(e.rangeCount>1)return!1;const i=e.anchor;if(!i||!t.checkChild(i,"softBreak"))return!1;const r=e.getFirstRange(),n=r.start.parent,o=r.end.parent;if((ag(n,t)||ag(o,t))&&n!==o)return!1;return!0}(t.schema,e.selection)}}function sg(t,e,i){const r=e.createElement("softBreak");t.insertContent(r,i),e.setSelection(r,"after")}function ag(t,e){return!t.is("rootElement")&&(e.isLimit(t)||ag(t.parent,e))}class cg extends ue{static get pluginName(){return"ShiftEnter"}init(){const t=this.editor,e=t.model.schema,i=t.conversion,r=t.editing.view,n=r.document;e.register("softBreak",{allowWhere:"$text",isInline:!0}),i.for("upcast").elementToElement({model:"softBreak",view:"br"}),i.for("downcast").elementToElement({model:"softBreak",view:(t,{writer:e})=>e.createEmptyElement("br")}),r.addObserver(rg),t.commands.add("shiftEnter",new og(t)),this.listenTo(n,"enter",((e,i)=>{i.preventDefault(),i.isSoft&&(t.execute("shiftEnter"),r.scrollToTheSelection())}),{priority:"low"})}}class lg extends fe{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.schema,r=e.document.selection,n=Array.from(r.getSelectedBlocks()),o=void 0===t.forceValue?!this.value:t.forceValue;e.change((t=>{if(o){const e=n.filter((t=>hg(t)||ug(i,t)));this._applyQuote(t,e)}else this._removeQuote(t,n.filter(hg))}))}_getValue(){const t=da(this.editor.model.document.selection.getSelectedBlocks());return!(!t||!hg(t))}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,i=da(t.getSelectedBlocks());return!!i&&ug(e,i)}_removeQuote(t,e){dg(t,e).reverse().forEach((e=>{if(e.start.isAtStart&&e.end.isAtEnd)return void t.unwrap(e.start.parent);if(e.start.isAtStart){const i=t.createPositionBefore(e.start.parent);return void t.move(e,i)}e.end.isAtEnd||t.split(e.end);const i=t.createPositionAfter(e.end.parent);t.move(e,i)}))}_applyQuote(t,e){const i=[];dg(t,e).reverse().forEach((e=>{let r=hg(e.start);r||(r=t.createElement("blockQuote"),t.wrap(e,r)),i.push(r)})),i.reverse().reduce(((e,i)=>e.nextSibling==i?(t.merge(t.createPositionAfter(e)),e):i))}}function hg(t){return"blockQuote"==t.parent.name?t.parent:null}function dg(t,e){let i,r=0;const n=[];for(;r{const r=t.model.document.differ.getChanges();for(const t of r)if("insert"==t.type){const r=t.position.nodeAfter;if(!r)continue;if(r.is("element","blockQuote")&&r.isEmpty)return i.remove(r),!0;if(r.is("element","blockQuote")&&!e.checkChild(t.position,r))return i.unwrap(r),!0;if(r.is("element")){const t=i.createRangeIn(r);for(const r of t.getItems())if(r.is("element","blockQuote")&&!e.checkChild(i.createPositionBefore(r),r))return i.unwrap(r),!0}}else if("remove"==t.type){const e=t.position.parent;if(e.is("element","blockQuote")&&e.isEmpty)return i.remove(e),!0}return!1}));const i=this.editor.editing.view.document,r=t.model.document.selection,n=t.commands.get("blockQuote");this.listenTo(i,"enter",((e,i)=>{if(!r.isCollapsed||!n.value)return;r.getLastPosition().parent.isEmpty&&(t.execute("blockQuote"),t.editing.view.scrollToTheSelection(),i.preventDefault(),e.stop())}),{context:"blockquote"}),this.listenTo(i,"delete",((e,i)=>{if("backward"!=i.direction||!r.isCollapsed||!n.value)return;const o=r.getLastPosition().parent;o.isEmpty&&!o.previousSibling&&(t.execute("blockQuote"),t.editing.view.scrollToTheSelection(),i.preventDefault(),e.stop())}),{context:"blockquote"})}}i(321);class fg extends ue{static get pluginName(){return"BlockQuoteUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("blockQuote",(i=>{const r=t.commands.get("blockQuote"),n=new Qd(i);return n.set({label:e("Block quote"),icon:mh,tooltip:!0,isToggleable:!0}),n.bind("isOn","isEnabled").to(r,"value","isEnabled"),this.listenTo(n,"execute",(()=>{t.execute("blockQuote"),t.editing.view.focus()})),n}))}}class mg extends sh{constructor(t,e){super(t),this.view=e,this._toolbarConfig=du(t.config.get("toolbar")),this._elementReplacer=new Zs}get element(){return this.view.element}init(t){const e=this.editor,i=this.view,r=e.editing.view,n=i.editable,o=r.document.getRoot();n.name=o.rootName,i.render();const s=n.element;this.setEditableElement(n.name,s),this.focusTracker.add(s),i.editable.bind("isFocused").to(this.focusTracker),r.attachDomRoot(s),t&&this._elementReplacer.replace(t,this.element),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const t=this.view,e=this.editor.editing.view;this._elementReplacer.restore(),e.detachDomRoot(t.editable.name),t.destroy(),super.destroy()}_initToolbar(){const t=this.editor,e=this.view,i=t.editing.view;e.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),e.stickyPanel.limiterElement=e.element,e.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",(({top:t})=>t)),e.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),$u({origin:i,originFocusTracker:this.focusTracker,originKeystrokeHandler:t.keystrokes,toolbar:e.toolbar})}_initPlaceholder(){const t=this.editor,e=t.editing.view,i=e.document.getRoot(),r=t.sourceElement,n=t.config.get("placeholder")||r&&"textarea"===r.tagName.toLowerCase()&&r.getAttribute("placeholder");n&&Yh({view:e,element:i,text:n,isDirectHost:!1,keepOnFocus:!0})}}i(6045);class pg extends xu{constructor(t,e,i={}){super(t),this.stickyPanel=new ju(t),this.toolbar=new uu(t,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull}),this.editable=new Cu(t,e)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class bg extends rh{constructor(t,e){super(e),vr(t)&&(this.sourceElement=t),this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),r=new pg(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:i});this.ui=new mg(this,r),ah(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(t,e={}){return new Promise((i=>{const r=new this(t,e);i(r.initPlugins().then((()=>r.ui.init(vr(t)?t:null))).then((()=>{if(!vr(t)&&e.initialData)throw new c("editor-create-initial-data",null);const i=void 0!==e.initialData?e.initialData:function(t){return vr(t)?ta(t):t}(t);return r.data.init(i)})).then((()=>r.fire("ready"))).then((()=>r)))}))}}de(bg,ch),de(bg,lh);class wg extends sh{constructor(t,e){super(t),this.view=e,this._toolbarConfig=du(t.config.get("toolbar"))}get element(){return this.view.editable.element}init(){const t=this.editor,e=this.view,i=t.editing.view,r=e.editable,n=i.document.getRoot();r.name=n.rootName,e.render();const o=r.element;this.setEditableElement(r.name,o),this.focusTracker.add(o),r.bind("isFocused").to(this.focusTracker),i.attachDomRoot(o),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const t=this.view;this.editor.editing.view.detachDomRoot(t.editable.name),t.destroy(),super.destroy()}_initToolbar(){const t=this.editor,e=this.view,i=e.editable.element,r=t.editing.view,n=e.toolbar;e.panel.bind("isVisible").to(this.focusTracker,"isFocused"),e.bind("viewportTopOffset").to(this,"viewportOffset",(({top:t})=>t)),e.listenTo(t.ui,"update",(()=>{e.panel.isVisible&&e.panel.pin({target:i,positions:e.panelPositions})})),n.fillFromConfig(this._toolbarConfig,this.componentFactory),$u({origin:r,originFocusTracker:this.focusTracker,originKeystrokeHandler:t.keystrokes,toolbar:n})}_initPlaceholder(){const t=this.editor,e=t.editing.view,i=e.document.getRoot(),r=t.sourceElement,n=t.config.get("placeholder")||r&&"textarea"===r.tagName.toLowerCase()&&r.getAttribute("placeholder");n&&Yh({view:e,element:i,text:n,isDirectHost:!1,keepOnFocus:!0})}}const _g=ha("px");class kg extends vu{constructor(t,e,i,r={}){super(t),this.toolbar=new uu(t,{shouldGroupWhenFull:r.shouldToolbarGroupWhenFull,isFloating:!0}),this.set("viewportTopOffset",0),this.panel=new Mu(t),this.panelPositions=this._getPanelPositions(),this.panel.extendTemplate({attributes:{class:"ck-toolbar-container"}}),this.editable=new Cu(t,e,i),this._resizeObserver=null}render(){super.render(),this.body.add(this.panel),this.registerChild(this.editable),this.panel.content.add(this.toolbar);if(this.toolbar.options.shouldGroupWhenFull){const t=this.editable.element;this._resizeObserver=new aa(t,(()=>{this.toolbar.maxWidth=_g(new na(t).width)}))}}destroy(){super.destroy(),this._resizeObserver&&this._resizeObserver.destroy()}_getPanelPositionTop(t,e){let i;return i=t.top>e.height+this.viewportTopOffset?t.top-e.height:t.bottom>e.height+this.viewportTopOffset+50?this.viewportTopOffset:t.bottom,i}_getPanelPositions(){const t=[(t,e)=>({top:this._getPanelPositionTop(t,e),left:t.left,name:"toolbar_west",config:{withArrow:!1}}),(t,e)=>({top:this._getPanelPositionTop(t,e),left:t.left+t.width-e.width,name:"toolbar_east",config:{withArrow:!1}})];return"ltr"===this.locale.uiLanguageDirection?t:t.reverse()}}class vg extends rh{constructor(t,e){super(e),this.model.document.createRoot(),vr(t)&&(this.sourceElement=t,function(t){const e=t.sourceElement;if(e){if(e.ckeditorInstance)throw new c("editor-source-element-already-used",t);e.ckeditorInstance=t,t.once("destroy",(()=>{delete e.ckeditorInstance}))}}(this));const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),r=new kg(this.locale,this.editing.view,this.sourceElement,{shouldToolbarGroupWhenFull:i});this.ui=new wg(this,r),ah(this)}destroy(){const t=this.getData();return this.ui.destroy(),super.destroy().then((()=>{this.sourceElement&&la(this.sourceElement,t)}))}static create(t,e={}){return new Promise((i=>{const r=vr(t);if(r&&"TEXTAREA"===t.tagName)throw new c("editor-wrong-element",null);const n=new this(t,e);i(n.initPlugins().then((()=>{n.ui.init()})).then((()=>{if(!r&&e.initialData)throw new c("editor-create-initial-data",null);const i=void 0!==e.initialData?e.initialData:function(t){return vr(t)?ta(t):t}(t);return n.data.init(i)})).then((()=>n.fire("ready"))).then((()=>n)))}))}}de(vg,ch),de(vg,lh);class yg{constructor(t){this.files=function(t){const e=Array.from(t.files||[]),i=Array.from(t.items||[]);if(e.length)return e;return i.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)}set effectAllowed(t){this._native.effectAllowed=t}get effectAllowed(){return this._native.effectAllowed}set dropEffect(t){this._native.dropEffect=t}get dropEffect(){return this._native.dropEffect}get isCanceled(){return"none"==this._native.dropEffect||!!this._native.mozUserCancelled}}class xg extends Ms{constructor(t){super(t);const e=this.document;function i(t){return(i,r)=>{r.preventDefault();const o=r.dropRange?[r.dropRange]:null,s=new n(e,t);e.fire(s,{dataTransfer:r.dataTransfer,method:i.name,targetRanges:o,target:r.target}),s.stop.called&&r.stopPropagation()}}this.domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"],this.listenTo(e,"paste",i("clipboardInput"),{priority:"low"}),this.listenTo(e,"drop",i("clipboardInput"),{priority:"low"}),this.listenTo(e,"dragover",i("dragging"),{priority:"low"})}onDomEvent(t){const e={dataTransfer:new yg(t.clipboardData?t.clipboardData:t.dataTransfer)};"drop"!=t.type&&"dragover"!=t.type||(e.dropRange=function(t,e){const i=e.target.ownerDocument,r=e.clientX,n=e.clientY;let o;i.caretRangeFromPoint&&i.caretRangeFromPoint(r,n)?o=i.caretRangeFromPoint(r,n):e.rangeParent&&(o=i.createRange(),o.setStart(e.rangeParent,e.rangeOffset),o.collapse(!0));if(o)return t.domConverter.domRangeToView(o);return null}(this.view,t)),this.fire(t.type,t,e)}}const Ag=["figcaption","li"];function Cg(t){let e="";if(t.is("$text")||t.is("$textProxy"))e=t.data;else if(t.is("element","img")&&t.hasAttribute("alt"))e=t.getAttribute("alt");else if(t.is("element","br"))e="\n";else{let i=null;for(const r of t.getChildren()){const t=Cg(r);i&&(i.is("containerElement")||r.is("containerElement"))&&(Ag.includes(i.name)||Ag.includes(r.name)?e+="\n":e+="\n\n"),e+=t,i=r}}return e}class Tg extends ue{static get pluginName(){return"ClipboardPipeline"}init(){this.editor.editing.view.addObserver(xg),this._setupPasteDrop(),this._setupCopyCut()}_setupPasteDrop(){const t=this.editor,e=t.model,i=t.editing.view,r=i.document;this.listenTo(r,"clipboardInput",(e=>{t.isReadOnly&&e.stop()}),{priority:"highest"}),this.listenTo(r,"clipboardInput",((t,e)=>{const r=e.dataTransfer;let o=e.content||"";var s;o||(r.getData("text/html")?o=function(t){return t.replace(/(\s+)<\/span>/g,((t,e)=>1==e.length?" ":e)).replace(//g,"")}(r.getData("text/html")):r.getData("text/plain")&&(((s=(s=r.getData("text/plain")).replace(//g,">").replace(/\r?\n\r?\n/g,"
").replace(/\r?\n/g," ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g," ")).includes("
")||s.includes(" "))&&(s=`
${s}
`),o=s),o=this.editor.data.htmlProcessor.toView(o));const a=new n(this,"inputTransformation");this.fire(a,{content:o,dataTransfer:r,targetRanges:e.targetRanges,method:e.method}),a.stop.called&&t.stop(),i.scrollToTheSelection()}),{priority:"low"}),this.listenTo(this,"inputTransformation",((t,i)=>{if(i.content.isEmpty)return;const r=this.editor.data.toModel(i.content,"$clipboardHolder");0!=r.childCount&&(t.stop(),e.change((()=>{this.fire("contentInsertion",{content:r,method:i.method,dataTransfer:i.dataTransfer,targetRanges:i.targetRanges})})))}),{priority:"low"}),this.listenTo(this,"contentInsertion",((t,i)=>{i.resultRange=e.insertContent(i.content)}),{priority:"low"})}_setupCopyCut(){const t=this.editor,e=t.model.document,i=t.editing.view.document;function r(r,n){const o=n.dataTransfer;n.preventDefault();const s=t.data.toView(t.model.getSelectedContent(e.selection));i.fire("clipboardOutput",{dataTransfer:o,content:s,method:r.name})}this.listenTo(i,"copy",r,{priority:"low"}),this.listenTo(i,"cut",((e,i)=>{t.isReadOnly?i.preventDefault():r(e,i)}),{priority:"low"}),this.listenTo(i,"clipboardOutput",((i,r)=>{r.content.isEmpty||(r.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(r.content)),r.dataTransfer.setData("text/plain",Cg(r.content))),"cut"==r.method&&t.model.deleteContent(e.selection)}),{priority:"low"})}}class Pg{constructor(){this._stack=[]}add(t,e){const i=this._stack,r=i[0];this._insertDescriptor(t);const n=i[0];r===n||Eg(r,n)||this.fire("change:top",{oldDescriptor:r,newDescriptor:n,writer:e})}remove(t,e){const i=this._stack,r=i[0];this._removeDescriptor(t);const n=i[0];r===n||Eg(r,n)||this.fire("change:top",{oldDescriptor:r,newDescriptor:n,writer:e})}_insertDescriptor(t){const e=this._stack,i=e.findIndex((e=>e.id===t.id));if(Eg(t,e[i]))return;i>-1&&e.splice(i,1);let r=0;for(;e[r]&&Sg(e[r],t);)r++;e.splice(r,0,t)}_removeDescriptor(t){const e=this._stack,i=e.findIndex((e=>e.id===t));i>-1&&e.splice(i,1)}}function Eg(t,e){return t&&e&&t.priority==e.priority&&Rg(t.classes)==Rg(e.classes)}function Sg(t,e){return t.priority>e.priority||!(t.priorityRg(e.classes)}function Rg(t){return Array.isArray(t)?t.sort().join(","):t}de(Pg,p);const Ig=' ',Og="ck-widget_selected";function Mg(t){return!!t.is("element")&&!!t.getCustomProperty("widget")}function Ng(t,e,i={}){if(!t.is("containerElement"))throw new c("widget-to-widget-wrong-element-type",null,{element:t});return e.setAttribute("contenteditable","false",t),e.addClass("ck-widget",t),e.setCustomProperty("widget",!0,t),t.getFillerOffset=qg,i.label&&function(t,e,i){i.setCustomProperty("widgetLabel",e,t)}(t,i.label,e),i.hasSelectionHandle&&function(t,e){const i=e.createUIElement("div",{class:"ck ck-widget__selection-handle"},(function(t){const e=this.toDomElement(t),i=new Jd;return i.set("content",Ig),i.render(),e.appendChild(i.element),e}));e.insert(e.createPositionAt(t,0),i),e.addClass(["ck-widget_with-selection-handle"],t)}(t,e),Dg(t,e),t}function Lg(t,e,i){if(e.classes&&i.addClass(Er(e.classes),t),e.attributes)for(const r in e.attributes)i.setAttribute(r,e.attributes[r],t)}function Vg(t,e,i){if(e.classes&&i.removeClass(Er(e.classes),t),e.attributes)for(const r in e.attributes)i.removeAttribute(r,t)}function Dg(t,e,i=Lg,r=Vg){const n=new Pg;n.on("change:top",((e,n)=>{n.oldDescriptor&&r(t,n.oldDescriptor,n.writer),n.newDescriptor&&i(t,n.newDescriptor,n.writer)})),e.setCustomProperty("addHighlight",((t,e,i)=>n.add(e,i)),t),e.setCustomProperty("removeHighlight",((t,e,i)=>n.remove(e,i)),t)}function Bg(t){const e=t.getCustomProperty("widgetLabel");return e?"function"==typeof e?e():e:""}function zg(t,e){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],t),e.setAttribute("contenteditable",t.isReadOnly?"false":"true",t),t.on("change:isReadOnly",((i,r,n)=>{e.setAttribute("contenteditable",n?"false":"true",t)})),t.on("change:isFocused",((i,r,n)=>{n?e.addClass("ck-editor__nested-editable_focused",t):e.removeClass("ck-editor__nested-editable_focused",t)})),Dg(t,e),t}function Fg(t,e){const i=t.getSelectedElement();if(i){const r=Hg(t);if(r)return e.createRange(e.createPositionAt(i,r));if(e.schema.isObject(i)&&!e.schema.isInline(i))return e.createRangeOn(i)}const r=t.getSelectedBlocks().next().value;if(r){if(r.isEmpty)return e.createRange(e.createPositionAt(r,0));const i=e.createPositionAfter(r);return t.focus.isTouching(i)?e.createRange(i):e.createRange(e.createPositionBefore(r))}return e.createRange(t.focus)}function qg(){return null}const jg="widget-type-around";function $g(t,e,i){return t&&Mg(t)&&!i.isInline(e)}function Hg(t){return t.getAttribute(jg)}i(2928);const Wg=["before","after"],Ug=(new DOMParser).parseFromString(' ',"image/svg+xml").firstChild,Kg="ck-widget__type-around_disabled";class Gg extends ue{static get pluginName(){return"WidgetTypeAround"}static get requires(){return[ng,Eh]}constructor(t){super(t),this._currentFakeCaretModelElement=null}init(){const t=this.editor,e=t.editing.view;this.on("change:isEnabled",((i,r,n)=>{e.change((t=>{for(const i of e.document.roots)n?t.removeClass(Kg,i):t.addClass(Kg,i)})),n||t.model.change((t=>{t.removeSelectionAttribute(jg)}))})),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableDeleteContentIntegration()}destroy(){this._currentFakeCaretModelElement=null}_insertParagraph(t,e){const i=this.editor,r=i.editing.view;i.execute("insertParagraph",{position:i.model.createPositionAt(t,e)}),r.focus(),r.scrollToTheSelection()}_listenToIfEnabled(t,e,i,r){this.listenTo(t,e,((...t)=>{this.isEnabled&&i(...t)}),r)}_insertParagraphAccordingToFakeCaretPosition(){const t=this.editor.model.document.selection,e=Hg(t);if(!e)return!1;const i=t.getSelectedElement();return this._insertParagraph(i,e),!0}_enableTypeAroundUIInjection(){const t=this.editor,e=t.model.schema,i=t.locale.t,r={before:i("Insert paragraph before block"),after:i("Insert paragraph after block")};t.editing.downcastDispatcher.on("insert",((t,i,n)=>{const o=n.mapper.toViewElement(i.item);$g(o,i.item,e)&&function(t,e,i){const r=t.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},(function(t){const i=this.toDomElement(t);return function(t,e){for(const i of Wg){const r=new Pd({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${i}`],title:e[i]},children:[t.ownerDocument.importNode(Ug,!0)]});t.appendChild(r.render())}}(i,e),function(t){const e=new Pd({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});t.appendChild(e.render())}(i),i}));t.insert(t.createPositionAt(i,"end"),r)}(n.writer,r,o)}),{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const t=this.editor,e=t.model,i=e.document.selection,r=e.schema,n=t.editing.view;function o(t){return`ck-widget_type-around_show-fake-caret_${t}`}this._listenToIfEnabled(n.document,"arrowKey",((t,e)=>{this._handleArrowKeyPress(t,e)}),{context:[Mg,"$text"],priority:"high"}),this._listenToIfEnabled(i,"change:range",((e,i)=>{i.directChange&&t.model.change((t=>{t.removeSelectionAttribute(jg)}))})),this._listenToIfEnabled(e.document,"change:data",(()=>{const e=i.getSelectedElement();if(e){if($g(t.editing.mapper.toViewElement(e),e,r))return}t.model.change((t=>{t.removeSelectionAttribute(jg)}))})),this._listenToIfEnabled(t.editing.downcastDispatcher,"selection",((t,e,i)=>{const n=i.writer;if(this._currentFakeCaretModelElement){const t=i.mapper.toViewElement(this._currentFakeCaretModelElement);t&&(n.removeClass(Wg.map(o),t),this._currentFakeCaretModelElement=null)}const s=e.selection.getSelectedElement();if(!s)return;const a=i.mapper.toViewElement(s);if(!$g(a,s,r))return;const c=Hg(e.selection);c&&(n.addClass(o(c),a),this._currentFakeCaretModelElement=s)})),this._listenToIfEnabled(t.ui.focusTracker,"change:isFocused",((e,i,r)=>{r||t.model.change((t=>{t.removeSelectionAttribute(jg)}))}))}_handleArrowKeyPress(t,e){const i=this.editor,r=i.model,n=r.document.selection,o=r.schema,s=i.editing.view,a=function(t,e){const i=uo(t,e);return"down"===i||"right"===i}(e.keyCode,i.locale.contentLanguageDirection),c=s.document.selection.getSelectedElement();let l;$g(c,i.editing.mapper.toModelElement(c),o)?l=this._handleArrowKeyPressOnSelectedWidget(a):n.isCollapsed?l=this._handleArrowKeyPressWhenSelectionNextToAWidget(a):e.shiftKey||(l=this._handleArrowKeyPressWhenNonCollapsedSelection(a)),l&&(e.preventDefault(),t.stop())}_handleArrowKeyPressOnSelectedWidget(t){const e=this.editor.model,i=Hg(e.document.selection);return e.change((e=>{if(!i)return e.setSelectionAttribute(jg,t?"after":"before"),!0;if(!(i===(t?"after":"before")))return e.removeSelectionAttribute(jg),!0;return!1}))}_handleArrowKeyPressWhenSelectionNextToAWidget(t){const e=this.editor,i=e.model,r=i.schema,n=e.plugins.get("Widget"),o=n._getObjectElementNextToSelection(t);return!!$g(e.editing.mapper.toViewElement(o),o,r)&&(i.change((e=>{n._setSelectionOverElement(o),e.setSelectionAttribute(jg,t?"before":"after")})),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(t){const e=this.editor,i=e.model,r=i.schema,n=e.editing.mapper,o=i.document.selection,s=t?o.getLastPosition().nodeBefore:o.getFirstPosition().nodeAfter;return!!$g(n.toViewElement(s),s,r)&&(i.change((e=>{e.setSelection(s,"on"),e.setSelectionAttribute(jg,t?"after":"before")})),!0)}_enableInsertingParagraphsOnButtonClick(){const t=this.editor,e=t.editing.view;this._listenToIfEnabled(e.document,"mousedown",((i,r)=>{const n=r.domTarget.closest(".ck-widget__type-around__button");if(!n)return;const o=function(t){return t.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(n),s=function(t,e){const i=t.closest(".ck-widget");return e.mapDomToView(i)}(n,e.domConverter),a=t.editing.mapper.toModelElement(s);this._insertParagraph(a,o),r.preventDefault(),i.stop()}))}_enableInsertingParagraphsOnEnterKeypress(){const t=this.editor,e=t.model.document.selection,i=t.editing.view;this._listenToIfEnabled(i.document,"enter",((i,r)=>{if("atTarget"!=i.eventPhase)return;const n=e.getSelectedElement(),o=t.editing.mapper.toViewElement(n),s=t.model.schema;let a;this._insertParagraphAccordingToFakeCaretPosition()?a=!0:$g(o,n,s)&&(this._insertParagraph(n,r.isSoft?"before":"after"),a=!0),a&&(r.preventDefault(),i.stop())}),{context:Mg})}_enableInsertingParagraphsOnTypingKeystroke(){const t=this.editor.editing.view,e=[so.enter,so.delete,so.backspace];this._listenToIfEnabled(t.document,"keydown",((t,i)=>{e.includes(i.keyCode)||_h(i)||this._insertParagraphAccordingToFakeCaretPosition()}),{priority:"high"})}_enableDeleteIntegration(){const t=this.editor,e=t.editing.view,i=t.model,r=i.schema;this._listenToIfEnabled(e.document,"delete",((e,n)=>{if("atTarget"!=e.eventPhase)return;const o=Hg(i.document.selection);if(!o)return;const s=n.direction,a=i.document.selection.getSelectedElement(),c="forward"==s;if("before"===o===c)t.execute("delete",{selection:i.createSelection(a,"on")});else{const e=r.getNearestSelectionRange(i.createPositionAt(a,o),s);if(e)if(e.isCollapsed){const n=i.createSelection(e.start);if(i.modifySelection(n,{direction:s}),n.focus.isEqual(e.start)){const t=function(t,e){let i=e;for(const r of e.getAncestors({parentFirst:!0})){if(r.childCount>1||t.isLimit(r))break;i=r}return i}(r,e.start.parent);i.deleteContent(i.createSelection(t,"on"),{doNotAutoparagraph:!0})}else i.change((i=>{i.setSelection(e),t.execute(c?"deleteForward":"delete")}))}else i.change((i=>{i.setSelection(e),t.execute(c?"deleteForward":"delete")}))}n.preventDefault(),e.stop()}),{context:Mg})}_enableInsertContentIntegration(){const t=this.editor,e=this.editor.model,i=e.document.selection;this._listenToIfEnabled(t.model,"insertContent",((t,[r,n])=>{if(n&&!n.is("documentSelection"))return;const o=Hg(i);return o?(t.stop(),e.change((t=>{const n=i.getSelectedElement(),s=e.createPositionAt(n,o),a=t.createSelection(s),c=e.insertContent(r,a);return t.setSelection(a),c}))):void 0}),{priority:"high"})}_enableDeleteContentIntegration(){const t=this.editor,e=this.editor.model.document.selection;this._listenToIfEnabled(t.model,"deleteContent",((t,[i])=>{if(i&&!i.is("documentSelection"))return;Hg(e)&&t.stop()}),{priority:"high"})}}function Jg(t){const e=t.model;return(i,r)=>{const n=r.keyCode==so.arrowup,o=r.keyCode==so.arrowdown,s=r.shiftKey,a=e.document.selection;if(!n&&!o)return;const c=o;if(s&&function(t,e){return!t.isCollapsed&&t.isBackward==e}(a,c))return;const l=function(t,e,i){const r=t.model;if(i){const t=e.isCollapsed?e.focus:e.getLastPosition(),i=Yg(r,t,"forward");if(!i)return null;const n=r.createRange(t,i),o=Qg(r.schema,n,"backward");return o?r.createRange(t,o):null}{const t=e.isCollapsed?e.focus:e.getFirstPosition(),i=Yg(r,t,"backward");if(!i)return null;const n=r.createRange(i,t),o=Qg(r.schema,n,"forward");return o?r.createRange(o,t):null}}(t,a,c);if(l){if(l.isCollapsed){if(a.isCollapsed)return;if(s)return}(l.isCollapsed||function(t,e,i){const r=t.model,n=t.view.domConverter;if(i){const t=r.createSelection(e.start);r.modifySelection(t),t.focus.isAtEnd||e.start.isEqual(t.focus)||(e=r.createRange(t.focus,e.end))}const o=t.mapper.toViewRange(e),s=n.viewRangeToDom(o),a=na.getDomRangeRects(s);let c;for(const t of a)if(void 0!==c){if(Math.round(t.top)>=c)return!1;c=Math.max(c,Math.round(t.bottom))}else c=Math.round(t.bottom);return!0}(t,l,c))&&(e.change((t=>{const i=c?l.end:l.start;if(s){const r=e.createSelection(a.anchor);r.setFocus(i),t.setSelection(r)}else t.setSelection(i)})),i.stop(),r.preventDefault(),r.stopPropagation())}}}function Yg(t,e,i){const r=t.schema,n=t.createRangeIn(e.root),o="forward"==i?"elementStart":"elementEnd";for(const{previousPosition:t,item:s,type:a}of n.getWalker({startPosition:e,direction:i})){if(r.isLimit(s)&&!r.isInline(s))return t;if(a==o&&r.isBlock(s))return null}return null}function Qg(t,e,i){const r="backward"==i?e.end:e.start;if(t.checkChild(r,"$text"))return r;for(const{nextPosition:r}of e.getWalker({direction:i}))if(t.checkChild(r,"$text"))return r;return null}i(4936);class Xg extends ue{static get pluginName(){return"Widget"}static get requires(){return[Gg,Eh]}init(){const t=this.editor,e=t.editing.view,i=e.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",((e,i,r)=>{const n=r.writer,o=i.selection;if(o.isCollapsed)return;const s=o.getSelectedElement();if(!s)return;const a=t.editing.mapper.toViewElement(s);Mg(a)&&r.consumable.consume(o,"selection")&&n.setSelection(n.createRangeOn(a),{fake:!0,label:Bg(a)})})),this.editor.editing.downcastDispatcher.on("selection",((t,e,i)=>{this._clearPreviouslySelectedWidgets(i.writer);const r=i.writer,n=r.document.selection;let o=null;for(const t of n.getRanges())for(const e of t){const t=e.item;Mg(t)&&!Zg(t,o)&&(r.addClass(Og,t),this._previouslySelected.add(t),o=t)}}),{priority:"low"}),e.addObserver(gd),this.listenTo(i,"mousedown",((...t)=>this._onMousedown(...t))),this.listenTo(i,"arrowKey",((...t)=>{this._handleSelectionChangeOnArrowKeyPress(...t)}),{context:[Mg,"$text"]}),this.listenTo(i,"arrowKey",((...t)=>{this._preventDefaultOnArrowKeyPress(...t)}),{context:"$root"}),this.listenTo(i,"arrowKey",Jg(this.editor.editing),{context:"$text"}),this.listenTo(i,"delete",((t,e)=>{this._handleDelete("forward"==e.direction)&&(e.preventDefault(),t.stop())}),{context:"$root"})}_onMousedown(t,e){const i=this.editor,r=i.editing.view,n=r.document;let o=e.target;if(function(t){for(;t;){if(t.is("editableElement")&&!t.is("rootElement"))return!0;if(Mg(t))return!1;t=t.parent}return!1}(o)){if((ro.isSafari||ro.isGecko)&&e.domEvent.detail>=3){const t=i.editing.mapper,r=o.is("attributeElement")?o.findAncestor((t=>!t.is("attributeElement"))):o,n=t.toModelElement(r);e.preventDefault(),this.editor.model.change((t=>{t.setSelection(n,"in")}))}return}if(!Mg(o)&&(o=o.findAncestor(Mg),!o))return;ro.isAndroid&&e.preventDefault(),n.isFocused||r.focus();const s=i.editing.mapper.toModelElement(o);this._setSelectionOverElement(s)}_handleSelectionChangeOnArrowKeyPress(t,e){const i=e.keyCode,r=this.editor.model,n=r.schema,o=r.document.selection,s=o.getSelectedElement(),a=uo(i,this.editor.locale.contentLanguageDirection),c="down"==a||"right"==a,l="up"==a||"down"==a;if(s&&n.isObject(s)){const i=c?o.getLastPosition():o.getFirstPosition(),s=n.getNearestSelectionRange(i,c?"forward":"backward");return void(s&&(r.change((t=>{t.setSelection(s)})),e.preventDefault(),t.stop()))}if(!o.isCollapsed&&!e.shiftKey){const i=o.getFirstPosition(),s=o.getLastPosition(),a=i.nodeAfter,l=s.nodeBefore;return void((a&&n.isObject(a)||l&&n.isObject(l))&&(r.change((t=>{t.setSelection(c?s:i)})),e.preventDefault(),t.stop()))}if(!o.isCollapsed)return;const h=this._getObjectElementNextToSelection(c);if(h&&n.isObject(h)){if(n.isInline(h)&&l)return;this._setSelectionOverElement(h),e.preventDefault(),t.stop()}}_preventDefaultOnArrowKeyPress(t,e){const i=this.editor.model,r=i.schema,n=i.document.selection.getSelectedElement();n&&r.isObject(n)&&(e.preventDefault(),t.stop())}_handleDelete(t){if(this.editor.isReadOnly)return;const e=this.editor.model.document.selection;if(!e.isCollapsed)return;const i=this._getObjectElementNextToSelection(t);return i?(this.editor.model.change((t=>{let r=e.anchor.parent;for(;r.isEmpty;){const e=r;r=e.parent,t.remove(e)}this._setSelectionOverElement(i)})),!0):void 0}_setSelectionOverElement(t){this.editor.model.change((e=>{e.setSelection(e.createRangeOn(t))}))}_getObjectElementNextToSelection(t){const e=this.editor.model,i=e.schema,r=e.document.selection,n=e.createSelection(r);if(e.modifySelection(n,{direction:t?"forward":"backward"}),n.isEqual(r))return null;const o=t?n.focus.nodeBefore:n.focus.nodeAfter;return o&&i.isObject(o)?o:null}_clearPreviouslySelectedWidgets(t){for(const e of this._previouslySelected)t.removeClass(Og,e);this._previouslySelected.clear()}}function Zg(t,e){return!!e&&Array.from(t.getAncestors()).includes(e)}const tf=function(t,e,i){var r=!0,n=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return A(i)&&(r="leading"in i?!!i.leading:r,n="trailing"in i?!!i.trailing:n),Ks(t,e,{leading:r,maxWait:e,trailing:n})};i(901);class ef extends ue{static get pluginName(){return"DragDrop"}static get requires(){return[Tg,Xg]}init(){const t=this.editor,e=t.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,this._updateDropMarkerThrottled=tf((t=>this._updateDropMarker(t)),40),this._removeDropMarkerDelayed=of((()=>this._removeDropMarker()),40),this._clearDraggableAttributesDelayed=of((()=>this._clearDraggableAttributes()),40),e.addObserver(xg),e.addObserver(gd),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDropMarker(),this._setupDraggableAttributeHandling(),this.listenTo(t,"change:isReadOnly",((t,e,i)=>{i?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})),this.on("change:isEnabled",((t,e,i)=>{i||this._finalizeDragging(!1)})),ro.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._updateDropMarkerThrottled.cancel(),this._removeDropMarkerDelayed.cancel(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const t=this.editor,e=t.model,i=e.document,r=t.editing.view,n=r.document;this.listenTo(n,"dragstart",((r,o)=>{const a=i.selection;if(o.target&&o.target.is("editableElement"))return void o.preventDefault();const c=o.target?sf(o.target):null;if(c){const i=t.editing.mapper.toModelElement(c);this._draggedRange=Ya.fromRange(e.createRangeOn(i)),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop")}else if(!n.selection.isCollapsed){const t=n.selection.getSelectedElement();t&&Mg(t)||(this._draggedRange=Ya.fromRange(a.getFirstRange()))}if(!this._draggedRange)return void o.preventDefault();this._draggingUid=s(),o.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",o.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const l=e.createSelection(this._draggedRange.toRange()),h=t.data.toView(e.getSelectedContent(l));n.fire("clipboardOutput",{dataTransfer:o.dataTransfer,content:h,method:r.name}),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")}),{priority:"low"}),this.listenTo(n,"dragend",((t,e)=>{this._finalizeDragging(!e.dataTransfer.isCanceled&&"move"==e.dataTransfer.dropEffect)}),{priority:"low"}),this.listenTo(n,"dragenter",(()=>{this.isEnabled&&r.focus()})),this.listenTo(n,"dragleave",(()=>{this._removeDropMarkerDelayed()})),this.listenTo(n,"dragging",((e,i)=>{if(!this.isEnabled)return void(i.dataTransfer.dropEffect="none");this._removeDropMarkerDelayed.cancel();const r=rf(t,i.targetRanges,i.target);this._draggedRange||(i.dataTransfer.dropEffect="copy"),ro.isGecko||("copy"==i.dataTransfer.effectAllowed?i.dataTransfer.dropEffect="copy":["all","copyMove"].includes(i.dataTransfer.effectAllowed)&&(i.dataTransfer.dropEffect="move")),r&&this._updateDropMarkerThrottled(r)}),{priority:"low"})}_setupClipboardInputIntegration(){const t=this.editor,e=t.editing.view.document;this.listenTo(e,"clipboardInput",((e,i)=>{if("drop"!=i.method)return;const r=rf(t,i.targetRanges,i.target);if(this._removeDropMarker(),!r)return this._finalizeDragging(!1),void e.stop();this._draggedRange&&this._draggingUid!=i.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="");if("move"==nf(i.dataTransfer)&&this._draggedRange&&this._draggedRange.containsRange(r,!0))return this._finalizeDragging(!1),void e.stop();i.targetRanges=[t.editing.mapper.toViewRange(r)]}),{priority:"high"})}_setupContentInsertionIntegration(){const t=this.editor.plugins.get(Tg);t.on("contentInsertion",((t,e)=>{if(!this.isEnabled||"drop"!==e.method)return;const i=e.targetRanges.map((t=>this.editor.editing.mapper.toModelRange(t)));this.editor.model.change((t=>t.setSelection(i)))}),{priority:"high"}),t.on("contentInsertion",((t,e)=>{if(!this.isEnabled||"drop"!==e.method)return;const i="move"==nf(e.dataTransfer),r=!e.resultRange||!e.resultRange.isCollapsed;this._finalizeDragging(r&&i)}),{priority:"lowest"})}_setupDraggableAttributeHandling(){const t=this.editor,e=t.editing.view,i=e.document;this.listenTo(i,"mousedown",((r,n)=>{if(ro.isAndroid||!n)return;this._clearDraggableAttributesDelayed.cancel();let o=sf(n.target);if(ro.isBlink&&!t.isReadOnly&&!o&&!i.selection.isCollapsed){const t=i.selection.getSelectedElement();t&&Mg(t)||(o=i.selection.editableElement)}o&&(e.change((t=>{t.setAttribute("draggable","true",o)})),this._draggableElement=t.editing.mapper.toModelElement(o))})),this.listenTo(i,"mouseup",(()=>{ro.isAndroid||this._clearDraggableAttributesDelayed()}))}_clearDraggableAttributes(){const t=this.editor.editing;t.view.change((e=>{this._draggableElement&&"$graveyard"!=this._draggableElement.root.rootName&&e.removeAttribute("draggable",t.mapper.toViewElement(this._draggableElement)),this._draggableElement=null}))}_setupDropMarker(){const t=this.editor;t.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),t.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(e,{writer:i})=>{if(t.model.schema.checkChild(e.markerRange.start,"$text"))return i.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},(function(t){const e=this.toDomElement(t);return e.innerHTML="⁠ ⁠",e}))}})}_updateDropMarker(t){const e=this.editor,i=e.model.markers;e.model.change((e=>{i.has("drop-target")?i.get("drop-target").getRange().isEqual(t)||e.updateMarker("drop-target",{range:t}):e.addMarker("drop-target",{range:t,usingOperation:!1,affectsData:!1})}))}_removeDropMarker(){const t=this.editor.model;this._removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),t.markers.has("drop-target")&&t.change((t=>{t.removeMarker("drop-target")}))}_finalizeDragging(t){const e=this.editor,i=e.model;this._removeDropMarker(),this._clearDraggableAttributes(),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._draggedRange&&(t&&this.isEnabled&&i.deleteContent(i.createSelection(this._draggedRange),{doNotAutoparagraph:!0}),this._draggedRange.detach(),this._draggedRange=null)}}function rf(t,e,i){const r=t.model,n=t.editing.mapper;let o=null;const s=e?e[0].start:null;if(i.is("uiElement")&&(i=i.parent),o=function(t,e){const i=t.model,r=t.editing.mapper;if(Mg(e))return i.createRangeOn(r.toModelElement(e));if(!e.is("editableElement")){const t=e.findAncestor((t=>Mg(t)||t.is("editableElement")));if(Mg(t))return i.createRangeOn(r.toModelElement(t))}return null}(t,i),o)return o;const a=function(t,e){const i=t.editing.mapper,r=t.editing.view,n=i.toModelElement(e);if(n)return n;const o=r.createPositionBefore(e),s=i.findMappedViewAncestor(o);return i.toModelElement(s)}(t,i),c=s?n.toModelPosition(s):null;return c?(o=function(t,e,i){const r=t.model;if(!r.schema.checkChild(i,"$block"))return null;const n=r.createPositionAt(i,0),o=e.path.slice(0,n.path.length),s=r.createPositionFromPath(e.root,o).nodeAfter;if(s&&r.schema.isObject(s))return r.createRangeOn(s);return null}(t,c,a),o||(o=r.schema.getNearestSelectionRange(c,ro.isGecko?"forward":"backward"),o||function(t,e){const i=t.model;for(;e;){if(i.schema.isObject(e))return i.createRangeOn(e);e=e.parent}}(t,c.parent))):function(t,e){const i=t.model,r=i.schema,n=i.createPositionAt(e,0);return r.getNearestSelectionRange(n,"forward")}(t,a)}function nf(t){return ro.isGecko?t.dropEffect:["all","copyMove"].includes(t.effectAllowed)?"move":"copy"}function of(t,e){let i;function r(...n){r.cancel(),i=setTimeout((()=>t(...n)),e)}return r.cancel=()=>{clearTimeout(i)},r}function sf(t){if(t.is("editableElement"))return null;if(t.hasClass("ck-widget__selection-handle"))return t.findAncestor(Mg);if(Mg(t))return t;const e=t.findAncestor((t=>Mg(t)||t.is("editableElement")));return Mg(e)?e:null}class af extends ue{static get pluginName(){return"PastePlainText"}static get requires(){return[Tg]}init(){const t=this.editor,e=t.model,i=t.editing.view,r=i.document,n=e.document.selection;let o=!1;i.addObserver(xg),this.listenTo(r,"keydown",((t,e)=>{o=e.shiftKey})),t.plugins.get(Tg).on("contentInsertion",((t,i)=>{(o||function(t,e){if(t.childCount>1)return!1;const i=t.getChild(0);if(e.isObject(i))return!1;return 0==[...i.getAttributeKeys()].length}(i.content,e.schema))&&e.change((t=>{const r=Array.from(n.getAttributes()).filter((([t])=>e.schema.getAttributeProperties(t).isFormatting));n.isCollapsed||e.deleteContent(n,{doNotAutoparagraph:!0}),r.push(...n.getAttributes());const o=t.createRangeIn(i.content);for(const e of o.getItems())e.is("$textProxy")&&t.setAttributes(r,e)}))}))}}class cf extends ue{static get pluginName(){return"Clipboard"}static get requires(){return[Tg,ef,af]}}class lf extends fe{constructor(t){super(t),this.affectsData=!1}execute(){const t=this.editor.model,e=t.document.selection;let i=t.schema.getLimitElement(e);if(e.containsEntireContent(i)||!hf(t.schema,i))do{if(i=i.parent,!i)return}while(!hf(t.schema,i));t.change((t=>{t.setSelection(i,"in")}))}}function hf(t,e){return t.isLimit(e)&&(t.checkChild(e,"$text")||t.checkChild(e,"paragraph"))}const df=lo("Ctrl+A");class uf extends ue{static get pluginName(){return"SelectAllEditing"}init(){const t=this.editor,e=t.editing.view.document;t.commands.add("selectAll",new lf(t)),this.listenTo(e,"keydown",((e,i)=>{co(i)===df&&(t.execute("selectAll"),i.preventDefault())}))}}class gf extends ue{static get pluginName(){return"SelectAllUI"}init(){const t=this.editor;t.ui.componentFactory.add("selectAll",(e=>{const i=t.commands.get("selectAll"),r=new Qd(e),n=e.t;return r.set({label:n("Select all"),icon:' ',keystroke:"Ctrl+A",tooltip:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",(()=>{t.execute("selectAll"),t.editing.view.focus()})),r}))}}class ff extends ue{static get requires(){return[uf,gf]}static get pluginName(){return"SelectAll"}}class mf extends fe{constructor(t){super(t),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this.listenTo(t.data,"set",((t,e)=>{e[1]={...e[1]};const i=e[1];i.batchType||(i.batchType="transparent")}),{priority:"high"}),this.listenTo(t.data,"set",((t,e)=>{"transparent"===e[1].batchType&&this.clearStack()}))}refresh(){this.isEnabled=this._stack.length>0}addBatch(t){const e=this.editor.model.document.selection,i={ranges:e.hasOwnRange?Array.from(e.getRanges()):[],isBackward:e.isBackward};this._stack.push({batch:t,selection:i}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(t,e,i){const r=this.editor.model,n=r.document,o=[],s=t.map((t=>t.getTransformedByOperations(i))),a=s.flat();for(const t of s){const e=t.filter((t=>t.root!=n.graveyard)).filter((t=>!bf(t,a)));e.length&&(pf(e),o.push(e[0]))}o.length&&r.change((t=>{t.setSelection(o,{backward:e})}))}_undo(t,e){const i=this.editor.model,r=i.document;this._createdBatches.add(e);const n=t.operations.slice().filter((t=>t.isDocumentOperation));n.reverse();for(const t of n){const n=t.baseVersion+1,o=Array.from(r.history.getOperations(n)),s=od([t.getReversed()],o,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const n of s)e.addOperation(n),i.applyOperation(n),r.history.setOperationAsUndone(t,n)}}}function pf(t){t.sort(((t,e)=>t.start.isBefore(e.start)?-1:1));for(let e=1;ee!==t&&e.containsRange(t,!0)))}class wf extends mf{execute(t=null){const e=t?this._stack.findIndex((e=>e.batch==t)):this._stack.length-1,i=this._stack.splice(e,1)[0],r=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(r,(()=>{this._undo(i.batch,r);const t=this.editor.model.document.history.getOperations(i.batch.baseVersion);this._restoreSelection(i.selection.ranges,i.selection.isBackward,t),this.fire("revert",i.batch,r)})),this.refresh()}}class _f extends mf{execute(){const t=this._stack.pop(),e=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(e,(()=>{const i=t.batch.operations[t.batch.operations.length-1].baseVersion+1,r=this.editor.model.document.history.getOperations(i);this._restoreSelection(t.selection.ranges,t.selection.isBackward,r),this._undo(t.batch,e)})),this.refresh()}}class kf extends ue{static get pluginName(){return"UndoEditing"}constructor(t){super(t),this._batchRegistry=new WeakSet}init(){const t=this.editor;this._undoCommand=new wf(t),this._redoCommand=new _f(t),t.commands.add("undo",this._undoCommand),t.commands.add("redo",this._redoCommand),this.listenTo(t.model,"applyOperation",((t,e)=>{const i=e[0];if(!i.isDocumentOperation)return;const r=i.batch,n=this._redoCommand._createdBatches.has(r),o=this._undoCommand._createdBatches.has(r);this._batchRegistry.has(r)||"transparent"==r.type&&!n&&!o||(n?this._undoCommand.addBatch(r):o||(this._undoCommand.addBatch(r),this._redoCommand.clearStack()),this._batchRegistry.add(r))}),{priority:"highest"}),this.listenTo(this._undoCommand,"revert",((t,e,i)=>{this._redoCommand.addBatch(i)})),t.keystrokes.set("CTRL+Z","undo"),t.keystrokes.set("CTRL+Y","redo"),t.keystrokes.set("CTRL+SHIFT+Z","redo")}}const vf=' ',yf=' ';class xf extends ue{static get pluginName(){return"UndoUI"}init(){const t=this.editor,e=t.locale,i=t.t,r="ltr"==e.uiLanguageDirection?vf:yf,n="ltr"==e.uiLanguageDirection?yf:vf;this._addButton("undo",i("Undo"),"CTRL+Z",r),this._addButton("redo",i("Redo"),"CTRL+Y",n)}_addButton(t,e,i,r){const n=this.editor;n.ui.componentFactory.add(t,(o=>{const s=n.commands.get(t),a=new Qd(o);return a.set({label:e,icon:r,keystroke:i,tooltip:!0}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",(()=>{n.execute(t),n.editing.view.focus()})),a}))}}class Af extends ue{static get requires(){return[kf,xf]}static get pluginName(){return"Undo"}}class Cf extends fe{refresh(){const t=this.editor.model,e=da(t.document.selection.getSelectedBlocks());this.value=!!e&&e.is("element","paragraph"),this.isEnabled=!!e&&Tf(e,t.schema)}execute(t={}){const e=this.editor.model,i=e.document;e.change((r=>{const n=(t.selection||i.selection).getSelectedBlocks();for(const t of n)!t.is("element","paragraph")&&Tf(t,e.schema)&&r.rename(t,"paragraph")}))}}function Tf(t,e){return e.checkChild(t.parent,"paragraph")&&!e.isObject(t)}class Pf extends fe{execute(t){const e=this.editor.model;let i=t.position;e.change((t=>{const r=t.createElement("paragraph");if(!e.schema.checkChild(i.parent,r)){const n=e.schema.findAllowedParent(i,r);if(!n)return;i=t.split(i,n).position}e.insertContent(r,i),t.setSelection(r,"in")}))}}class Ef extends ue{static get pluginName(){return"Paragraph"}init(){const t=this.editor,e=t.model;t.commands.add("paragraph",new Cf(t)),t.commands.add("insertParagraph",new Pf(t)),e.schema.register("paragraph",{inheritAllFrom:"$block"}),t.conversion.elementToElement({model:"paragraph",view:"p"}),t.conversion.for("upcast").elementToElement({model:(t,{writer:e})=>Ef.paragraphLikeElements.has(t.name)?t.isEmpty?null:e.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}}Ef.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class Sf extends fe{constructor(t,e){super(t),this.modelElements=e}refresh(){const t=da(this.editor.model.document.selection.getSelectedBlocks());this.value=!!t&&this.modelElements.includes(t.name)&&t.name,this.isEnabled=!!t&&this.modelElements.some((e=>Rf(t,e,this.editor.model.schema)))}execute(t){const e=this.editor.model,i=e.document,r=t.value;e.change((t=>{const n=Array.from(i.selection.getSelectedBlocks()).filter((t=>Rf(t,r,e.schema)));for(const e of n)e.is("element",r)||t.rename(e,r)}))}}function Rf(t,e,i){return i.checkChild(t.parent,e)&&!i.isObject(t)}const If="paragraph";class Of extends ue{static get pluginName(){return"HeadingEditing"}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[Ef]}init(){const t=this.editor,e=t.config.get("heading.options"),i=[];for(const r of e)r.model!==If&&(t.model.schema.register(r.model,{inheritAllFrom:"$block"}),t.conversion.elementToElement(r),i.push(r.model));this._addDefaultH1Conversion(t),t.commands.add("heading",new Sf(t,i))}afterInit(){const t=this.editor,e=t.commands.get("enter"),i=t.config.get("heading.options");e&&this.listenTo(e,"afterExecute",((e,r)=>{const n=t.model.document.selection.getFirstPosition().parent;i.some((t=>n.is("element",t.model)))&&!n.is("element",If)&&0===n.childCount&&r.writer.rename(n,If)}))}_addDefaultH1Conversion(t){t.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:a.get("low")+1})}}i(6846);class Mf extends ue{static get pluginName(){return"HeadingUI"}init(){const t=this.editor,e=t.t,i=function(t){const e=t.t,i={Paragraph:e("Paragraph"),"Heading 1":e("Heading 1"),"Heading 2":e("Heading 2"),"Heading 3":e("Heading 3"),"Heading 4":e("Heading 4"),"Heading 5":e("Heading 5"),"Heading 6":e("Heading 6")};return t.config.get("heading.options").map((t=>{const e=i[t.title];return e&&e!=t.title&&(t.title=e),t}))}(t),r=e("Choose heading"),n=e("Heading");t.ui.componentFactory.add("heading",(e=>{const o={},s=new Tr,a=t.commands.get("heading"),c=t.commands.get("paragraph"),l=[a];for(const t of i){const e={type:"button",model:new Ru({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),o[t.model]=t.title}const h=_u(e);return ku(h,s),h.buttonView.set({isOn:!1,withText:!0,tooltip:n}),h.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),h.bind("isEnabled").toMany(l,"isEnabled",((...t)=>t.some((t=>t)))),h.buttonView.bind("label").to(a,"value",c,"value",((t,e)=>{const i=t||e&&"paragraph";return o[i]?o[i]:r})),this.listenTo(h,"execute",(e=>{t.execute(e.source.commandName,e.source.commandValue?{value:e.source.commandValue}:void 0),t.editing.view.focus()})),h}))}}class Nf extends ue{static get requires(){return[Bu]}static get pluginName(){return"WidgetToolbarRepository"}init(){const t=this.editor;if(t.plugins.has("BalloonToolbar")){const e=t.plugins.get("BalloonToolbar");this.listenTo(e,"show",(e=>{(function(t){const e=t.getSelectedElement();return!(!e||!Mg(e))})(t.editing.view.document.selection)&&e.stop()}),{priority:"high"})}this._toolbarDefinitions=new Map,this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",(()=>{this._updateToolbarsVisibility()})),this.listenTo(t.ui,"update",(()=>{this._updateToolbarsVisibility()})),this.listenTo(t.ui.focusTracker,"change:isFocused",(()=>{this._updateToolbarsVisibility()}),{priority:"low"})}destroy(){super.destroy();for(const t of this._toolbarDefinitions.values())t.view.destroy()}register(t,{ariaLabel:e,items:i,getRelatedElement:r,balloonClassName:n="ck-toolbar-container"}){if(!i.length)return void l("widget-toolbar-no-items",{toolbarId:t});const o=this.editor,s=o.t,a=new uu(o.locale);if(a.ariaLabel=e||s("Widget toolbar"),this._toolbarDefinitions.has(t))throw new c("widget-toolbar-duplicated",this,{toolbarId:t});a.fillFromConfig(i,o.ui.componentFactory),this._toolbarDefinitions.set(t,{view:a,getRelatedElement:r,balloonClassName:n})}_updateToolbarsVisibility(){let t=0,e=null,i=null;for(const r of this._toolbarDefinitions.values()){const n=r.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&n)if(this.editor.ui.focusTracker.isFocused){const o=n.getAncestors().length;o>t&&(t=o,e=n,i=r)}else this._isToolbarVisible(r)&&this._hideToolbar(r);else this._isToolbarInBalloon(r)&&this._hideToolbar(r)}i&&this._showToolbar(i,e)}_hideToolbar(t){this._balloon.remove(t.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(t,e){this._isToolbarVisible(t)?Lf(this.editor,e):this._isToolbarInBalloon(t)||(this._balloon.add({view:t.view,position:Vf(this.editor,e),balloonClassName:t.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",(()=>{for(const t of this._toolbarDefinitions.values())if(this._isToolbarVisible(t)){const e=t.getRelatedElement(this.editor.editing.view.document.selection);Lf(this.editor,e)}})))}_isToolbarVisible(t){return this._balloon.visibleView===t.view}_isToolbarInBalloon(t){return this._balloon.hasView(t.view)}}function Lf(t,e){const i=t.plugins.get("ContextualBalloon"),r=Vf(t,e);i.updatePosition(r)}function Vf(t,e){const i=t.editing.view,r=Mu.defaultPositions;return{target:i.domConverter.mapViewToDom(e),positions:[r.northArrowSouth,r.northArrowSouthWest,r.northArrowSouthEast,r.southArrowNorth,r.southArrowNorthWest,r.southArrowNorthEast,r.viewportStickyNorth]}}class Df{constructor(t){this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=t,this._referenceCoordinates=null}begin(t,e,i){const r=new na(e);this.activeHandlePosition=function(t){const e=["top-left","top-right","bottom-right","bottom-left"];for(const i of e)if(t.classList.contains(Bf(i)))return i}(t),this._referenceCoordinates=function(t,e){const i=new na(t),r=e.split("-"),n={x:"right"==r[1]?i.right:i.left,y:"bottom"==r[0]?i.bottom:i.top};return n.x+=t.ownerDocument.defaultView.scrollX,n.y+=t.ownerDocument.defaultView.scrollY,n}(e,function(t){const e=t.split("-"),i={top:"bottom",bottom:"top",left:"right",right:"left"};return`${i[e[0]]}-${i[e[1]]}`}(this.activeHandlePosition)),this.originalWidth=r.width,this.originalHeight=r.height,this.aspectRatio=r.width/r.height;const n=i.style.width;n&&n.match(/^\d+(\.\d*)?%$/)?this.originalWidthPercents=parseFloat(n):this.originalWidthPercents=function(t,e){const i=t.parentElement,r=parseFloat(i.ownerDocument.defaultView.getComputedStyle(i).width);return e.width/r*100}(i,r)}update(t){this.proposedWidth=t.width,this.proposedHeight=t.height,this.proposedWidthPercents=t.widthPercents,this.proposedHandleHostWidth=t.handleHostWidth,this.proposedHandleHostHeight=t.handleHostHeight}}function Bf(t){return`ck-widget__resizer__handle-${t}`}de(Df,oe);class zf extends Td{constructor(){super();const t=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",t.to("_viewPosition",(t=>t?`ck-orientation-${t}`:""))],style:{display:t.if("_isVisible","none",(t=>!t))}},children:[{text:t.to("_label")}]})}_bindToState(t,e){this.bind("_isVisible").to(e,"proposedWidth",e,"proposedHeight",((t,e)=>null!==t&&null!==e)),this.bind("_label").to(e,"proposedHandleHostWidth",e,"proposedHandleHostHeight",e,"proposedWidthPercents",((e,i,r)=>"px"===t.unit?`${e}×${i}`:`${r}%`)),this.bind("_viewPosition").to(e,"activeHandlePosition",e,"proposedHandleHostWidth",e,"proposedHandleHostHeight",((t,e,i)=>e<50||i<50?"above-center":t))}_dismiss(){this.unbind(),this._isVisible=!1}}class Ff{constructor(t){this._options=t,this._viewResizerWrapper=null,this.set("isEnabled",!0),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",(t=>{this.state.proposedWidth||this.state.proposedWidthPercents||(this._cleanup(),t.stop())}),{priority:"high"}),this.on("change:isEnabled",(()=>{this.isEnabled&&this.redraw()}))}attach(){const t=this,e=this._options.viewElement;this._options.editor.editing.view.change((i=>{const r=i.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},(function(e){const i=this.toDomElement(e);return t._appendHandles(i),t._appendSizeUI(i),t.on("change:isEnabled",((t,e,r)=>{i.style.display=r?"":"none"})),i.style.display=t.isEnabled?"":"none",i}));i.insert(i.createPositionAt(e,"end"),r),i.addClass("ck-widget_with-resizer",e),this._viewResizerWrapper=r}))}begin(t){this.state=new Df(this._options),this._sizeView._bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(t,this._getHandleHost(),this._getResizeHost())}updateSize(t){const e=this._proposeNewSize(t);this._options.editor.editing.view.change((t=>{const i=this._options.unit||"%",r=("%"===i?e.widthPercents:e.width)+i;t.setStyle("width",r,this._options.viewElement)}));const i=this._getHandleHost(),r=new na(i);e.handleHostWidth=Math.round(r.width),e.handleHostHeight=Math.round(r.height);const n=new na(i);e.width=Math.round(n.width),e.height=Math.round(n.height),this.redraw(r),this.state.update(e)}commit(){const t=this._options.unit||"%",e=("%"===t?this.state.proposedWidthPercents:this.state.proposedWidth)+t;this._options.editor.editing.view.change((()=>{this._cleanup(),this._options.onCommit(e)}))}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(t){const e=this._domResizerWrapper;if(!((i=e)&&i.ownerDocument&&i.ownerDocument.contains(i)))return;var i;const r=e.parentElement,n=this._getHandleHost(),o=this._viewResizerWrapper,s=[o.getStyle("width"),o.getStyle("height"),o.getStyle("left"),o.getStyle("top")];let a;if(r.isSameNode(n)){const e=t||new na(n);a=[e.width+"px",e.height+"px",void 0,void 0]}else a=[n.offsetWidth+"px",n.offsetHeight+"px",n.offsetLeft+"px",n.offsetTop+"px"];"same"!==Nr(s,a)&&this._options.editor.editing.view.change((t=>{t.setStyle({width:a[0],height:a[1],left:a[2],top:a[3]},o)}))}containsHandle(t){return this._domResizerWrapper.contains(t)}static isResizeHandle(t){return t.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss();this._options.editor.editing.view.change((t=>{t.setStyle("width",this._initialViewWidth,this._options.viewElement)}))}_proposeNewSize(t){const e=this.state,i={x:(r=t).pageX,y:r.pageY};var r;const n=!this._options.isCentered||this._options.isCentered(this),o={x:e._referenceCoordinates.x-(i.x+e.originalWidth),y:i.y-e.originalHeight-e._referenceCoordinates.y};n&&e.activeHandlePosition.endsWith("-right")&&(o.x=i.x-(e._referenceCoordinates.x+e.originalWidth)),n&&(o.x*=2);const s={width:Math.abs(e.originalWidth+o.x),height:Math.abs(e.originalHeight+o.y)};s.dominant=s.width/e.aspectRatio>s.height?"width":"height",s.max=s[s.dominant];const a={width:s.width,height:s.height};return"width"==s.dominant?a.height=a.width/e.aspectRatio:a.width=a.height*e.aspectRatio,{width:Math.round(a.width),height:Math.round(a.height),widthPercents:Math.min(Math.round(e.originalWidthPercents/e.originalWidth*a.width*100)/100,100)}}_getResizeHost(){const t=this._domResizerWrapper.parentElement;return this._options.getResizeHost(t)}_getHandleHost(){const t=this._domResizerWrapper.parentElement;return this._options.getHandleHost(t)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(t){const e=["top-left","top-right","bottom-right","bottom-left"];for(const r of e)t.appendChild(new Pd({tag:"div",attributes:{class:"ck-widget__resizer__handle "+(i=r,`ck-widget__resizer__handle-${i}`)}}).render());var i}_appendSizeUI(t){this._sizeView=new zf,this._sizeView.render(),t.appendChild(this._sizeView.element)}}de(Ff,oe);i(353);function qf(t,e){const i=t.createEmptyElement("img"),r="imageBlock"===e?t.createContainerElement("figure",{class:"image"}):t.createContainerElement("span",{class:"image-inline"},{isAllowedInsideAttributeElement:!0});return t.insert(t.createPositionAt(r,0),i),r}function jf(t,e){if(t.plugins.has("ImageInlineEditing")!==t.plugins.has("ImageBlockEditing"))return{name:"img"};const i=t.plugins.get("ImageUtils");return t=>{if(!i.isInlineImageView(t))return null;return(t.findAncestor(i.isBlockImageView)?"imageBlock":"imageInline")!==e?null:{name:!0}}}function $f(t,e){const i=da(e.getSelectedBlocks());return!i||t.isObject(i)||i.isEmpty&&"listItem"!=i.name?"imageBlock":"imageInline"}de(class extends ue{static get pluginName(){return"WidgetResize"}init(){const t=this.editor.editing,e=Yo.window.document;this.set("visibleResizer",null),this.set("_activeResizer",null),this._resizers=new Map,t.view.addObserver(gd),this._observer=Object.create(ss),this.listenTo(t.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(e,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(e,"mouseup",this._mouseUpListener.bind(this));const i=()=>{this.visibleResizer&&this.visibleResizer.redraw()};this._redrawFocusedResizerThrottled=tf(i,200),this.on("change:visibleResizer",i),this.editor.ui.on("update",this._redrawFocusedResizerThrottled),this.editor.model.document.on("change",(()=>{for(const[t,e]of this._resizers)t.isAttached()||(this._resizers.delete(t),e.destroy())}),{priority:"lowest"}),this._observer.listenTo(Yo.window,"resize",this._redrawFocusedResizerThrottled);const r=this.editor.editing.view.document.selection;r.on("change",(()=>{const t=r.getSelectedElement();this.visibleResizer=this.getResizerByViewElement(t)||null}))}destroy(){this._observer.stopListening();for(const t of this._resizers.values())t.destroy();this._redrawFocusedResizerThrottled.cancel()}attachTo(t){const e=new Ff(t),i=this.editor.plugins;if(e.attach(),i.has("WidgetToolbarRepository")){const t=i.get("WidgetToolbarRepository");e.on("begin",(()=>{t.forceDisabled("resize")}),{priority:"lowest"}),e.on("cancel",(()=>{t.clearForceDisabled("resize")}),{priority:"highest"}),e.on("commit",(()=>{t.clearForceDisabled("resize")}),{priority:"highest"})}this._resizers.set(t.viewElement,e);const r=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(r)==e&&(this.visibleResizer=e),e}getResizerByViewElement(t){return this._resizers.get(t)}_getResizerByHandle(t){for(const e of this._resizers.values())if(e.containsHandle(t))return e}_mouseDownListener(t,e){const i=e.domTarget;Ff.isResizeHandle(i)&&(this._activeResizer=this._getResizerByHandle(i),this._activeResizer&&(this._activeResizer.begin(i),t.stop(),e.preventDefault()))}_mouseMoveListener(t,e){this._activeResizer&&this._activeResizer.updateSize(e)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}},oe);class Hf extends ue{static get pluginName(){return"ImageUtils"}isImage(t){return this.isInlineImage(t)||this.isBlockImage(t)}isInlineImageView(t){return!!t&&t.is("element","img")}isBlockImageView(t){return!!t&&t.is("element","figure")&&t.hasClass("image")}insertImage(t={},e=null,i=null){const r=this.editor,n=r.model,o=n.document.selection;i=Wf(r,e||o,i),t={...Object.fromEntries(o.getAttributes()),...t};for(const e in t)n.schema.checkAttribute(i,e)||delete t[e];return n.change((r=>{const s=r.createElement(i,t);return e||"imageInline"==i||(e=Fg(o,n)),n.insertContent(s,e),s.parent?(r.setSelection(s,"on"),s):null}))}getClosestSelectedImageWidget(t){const e=t.getSelectedElement();if(e&&this.isImageWidget(e))return e;let i=t.getFirstPosition().parent;for(;i;){if(i.is("element")&&this.isImageWidget(i))return i;i=i.parent}return null}getClosestSelectedImageElement(t){const e=t.getSelectedElement();return this.isImage(e)?e:t.getFirstPosition().findAncestor("imageBlock")}isImageAllowed(){const t=this.editor.model.document.selection;return function(t,e){if("imageBlock"==Wf(t,e)){const i=function(t,e){const i=Fg(t,e).start.parent;if(i.isEmpty&&!i.is("element","$root"))return i.parent;return i}(e,t.model);if(t.model.schema.checkChild(i,"imageBlock"))return!0}else if(t.model.schema.checkChild(e.focus,"imageInline"))return!0;return!1}(this.editor,t)&&function(t){return[...t.focus.getAncestors()].every((t=>!t.is("element","imageBlock")))}(t)}toImageWidget(t,e,i){e.setCustomProperty("image",!0,t);return Ng(t,e,{label:()=>{const e=this.findViewImgElement(t).getAttribute("alt");return e?`${e} ${i}`:i}})}isImageWidget(t){return!!t.getCustomProperty("image")&&Mg(t)}isBlockImage(t){return!!t&&t.is("element","imageBlock")}isInlineImage(t){return!!t&&t.is("element","imageInline")}findViewImgElement(t){if(this.isInlineImageView(t))return t;const e=this.editor.editing.view;for(const{item:i}of e.createRangeIn(t))if(this.isInlineImageView(i))return i}}function Wf(t,e,i){const r=t.model.schema,n=t.config.get("image.insert.type");return t.plugins.has("ImageBlockEditing")?t.plugins.has("ImageInlineEditing")?i||("inline"===n?"imageInline":"block"===n?"imageBlock":e.is("selection")?$f(r,e):r.checkChild(e,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}const Uf=new RegExp(String(/^(http(s)?:\/\/)?[\w-]+\.[\w.~:/[\]@!$&'()*+,;=%-]+/.source+/\.(jpg|jpeg|png|gif|ico|webp|JPG|JPEG|PNG|GIF|ICO|WEBP)/.source+/(\?[\w.~:/[\]@!$&'()*+,;=%-]*)?/.source+/(#[\w.~:/[\]@!$&'()*+,;=%-]*)?$/.source));class Kf extends fe{refresh(){const t=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!t,this.isEnabled&&t.hasAttribute("alt")?this.value=t.getAttribute("alt"):this.value=!1}execute(t){const e=this.editor,i=e.plugins.get("ImageUtils"),r=e.model,n=i.getClosestSelectedImageElement(r.document.selection);r.change((e=>{e.setAttribute("alt",t.newValue,n)}))}}class Gf extends ue{static get requires(){return[Hf]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new Kf(this.editor))}}i(758),i(49);class Jf extends Td{constructor(t){super(t);const e=this.locale.t;this.focusTracker=new ua,this.keystrokes=new ga,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(e("Save"),uh,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(e("Cancel"),dh,"ck-button-cancel","cancel"),this._focusables=new Cd,this._focusCycler=new Zd({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","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]}),xd(this)}render(){super.render(),this.keystrokes.listenTo(this.element),Ad({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach((t=>{this._focusables.add(t),this.focusTracker.add(t.element)}))}_createButton(t,e,i,r){const n=new Qd(this.locale);return n.set({label:t,icon:e,tooltip:!0}),n.extendTemplate({attributes:{class:i}}),r&&n.delegate("execute").to(this,r),n}_createLabeledInputView(){const t=this.locale.t,e=new Eu(this.locale,Su);return e.label=t("Text alternative"),e}}function Yf(t){const e=t.editing.view,i=Mu.defaultPositions,r=t.plugins.get("ImageUtils");return{target:e.domConverter.viewToDom(r.getClosestSelectedImageWidget(e.document.selection)),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast,i.viewportStickyNorth]}}class Qf extends ue{static get requires(){return[Bu]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton(),this._createForm()}destroy(){super.destroy(),this._form.destroy()}_createButton(){const t=this.editor,e=t.t;t.ui.componentFactory.add("imageTextAlternative",(i=>{const r=t.commands.get("imageTextAlternative"),n=new Qd(i);return n.set({label:e("Change image text alternative"),icon:gh,tooltip:!0}),n.bind("isEnabled").to(r,"isEnabled"),this.listenTo(n,"execute",(()=>{this._showForm()})),n}))}_createForm(){const t=this.editor,e=t.editing.view.document,i=t.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new Jf(t.locale),this._form.render(),this.listenTo(this._form,"submit",(()=>{t.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.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",(()=>{i.getClosestSelectedImageWidget(e.selection)?this._isVisible&&function(t){const e=t.plugins.get("ContextualBalloon");if(t.plugins.get("ImageUtils").getClosestSelectedImageWidget(t.editing.view.document.selection)){const i=Yf(t);e.updatePosition(i)}}(t):this._hideForm(!0)})),yd({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const t=this.editor,e=t.commands.get("imageTextAlternative"),i=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:Yf(t)}),i.fieldView.value=i.fieldView.element.value=e.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(t){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),t&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class Xf extends ue{static get requires(){return[Gf,Qf]}static get pluginName(){return"ImageTextAlternative"}}function Zf(t,e){return t=>{t.on(`attribute:srcset:${e}`,i)};function i(e,i,r){if(!r.consumable.consume(i.item,e.name))return;const n=r.writer,o=r.mapper.toViewElement(i.item),s=t.findViewImgElement(o);if(null===i.attributeNewValue){const t=i.attributeOldValue;t.data&&(n.removeAttribute("srcset",s),n.removeAttribute("sizes",s),t.width&&n.removeAttribute("width",s))}else{const t=i.attributeNewValue;t.data&&(n.setAttribute("srcset",t.data,s),n.setAttribute("sizes","100vw",s),t.width&&n.setAttribute("width",t.width,s))}}}function tm(t,e,i){return t=>{t.on(`attribute:${i}:${e}`,r)};function r(e,i,r){if(!r.consumable.consume(i.item,e.name))return;const n=r.writer,o=r.mapper.toViewElement(i.item),s=t.findViewImgElement(o);n.setAttribute(i.attributeKey,i.attributeNewValue||"",s)}}class em extends ls{observe(t){this.listenTo(t,"load",((t,e)=>{const i=e.target;this.checkShouldIgnoreEventFromTarget(i)||"IMG"==i.tagName&&this._fireEvents(e)}),{useCapture:!0})}_fireEvents(t){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",t))}}class im extends fe{constructor(t){super(t);const e=t.config.get("image.insert.type");t.plugins.has("ImageBlockEditing")||"block"===e&&l("image-block-plugin-required"),t.plugins.has("ImageInlineEditing")||"inline"===e&&l("image-inline-plugin-required")}refresh(){this.isEnabled=this.editor.plugins.get("ImageUtils").isImageAllowed()}execute(t){const e=Er(t.source),i=this.editor.model.document.selection,r=this.editor.plugins.get("ImageUtils"),n=Object.fromEntries(i.getAttributes());e.forEach(((t,e)=>{const o=i.getSelectedElement();if("string"==typeof t&&(t={src:t}),e&&o&&r.isImage(o)){const e=this.editor.model.createPositionAfter(o);r.insertImage({...t,...n},e)}else r.insertImage({...t,...n})}))}}class rm extends ue{static get requires(){return[Hf]}static get pluginName(){return"ImageEditing"}init(){const t=this.editor,e=t.conversion;t.editing.view.addObserver(em),e.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({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}}});const i=new im(t);t.commands.add("insertImage",i),t.commands.add("imageInsert",i)}}class nm extends fe{constructor(t,e){super(t),this._modelElementName=e}refresh(){const t=this.editor.plugins.get("ImageUtils"),e=t.getClosestSelectedImageElement(this.editor.model.document.selection);"imageBlock"===this._modelElementName?this.isEnabled=t.isInlineImage(e):this.isEnabled=t.isBlockImage(e)}execute(){const t=this.editor,e=this.editor.model,i=t.plugins.get("ImageUtils"),r=i.getClosestSelectedImageElement(e.document.selection),n=Object.fromEntries(r.getAttributes());return n.src||n.uploadId?e.change((t=>{const o=Array.from(e.markers).filter((t=>t.getRange().containsItem(r))),s=i.insertImage(n,e.createSelection(r,"on"),this._modelElementName);if(!s)return null;const a=t.createRangeOn(s);for(const e of o){const i=e.getRange(),r="$graveyard"!=i.root.rootName?i.getJoined(a,!0):a;t.updateMarker(e,{range:r})}return{oldElement:r,newElement:s}})):null}}class om extends ue{static get requires(){return[rm,Hf,Tg]}static get pluginName(){return"ImageBlockEditing"}init(){const t=this.editor;t.model.schema.register("imageBlock",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),t.plugins.has("ImageInlineEditing")&&(t.commands.add("imageTypeBlock",new nm(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const t=this.editor,e=t.t,i=t.conversion,r=t.plugins.get("ImageUtils");i.for("dataDowncast").elementToElement({model:"imageBlock",view:(t,{writer:e})=>qf(e,"imageBlock")}),i.for("editingDowncast").elementToElement({model:"imageBlock",view:(t,{writer:i})=>r.toImageWidget(qf(i,"imageBlock"),i,e("image widget"))}),i.for("downcast").add(tm(r,"imageBlock","src")).add(tm(r,"imageBlock","alt")).add(Zf(r,"imageBlock")),i.for("upcast").elementToElement({view:jf(t,"imageBlock"),model:(t,{writer:e})=>e.createElement("imageBlock",t.hasAttribute("src")?{src:t.getAttribute("src")}:null)}).add(function(t){return t=>{t.on("element:figure",e)};function e(e,i,r){if(!r.consumable.test(i.viewItem,{name:!0,classes:"image"}))return;const n=t.findViewImgElement(i.viewItem);if(!n||!r.consumable.test(n,{name:!0}))return;const o=da(r.convertItem(n,i.modelCursor).modelRange.getItems());o&&(r.consumable.consume(i.viewItem,{name:!0,classes:"image"}),r.convertChildren(i.viewItem,o),r.updateConversionResult(o,i))}}(r))}_setupClipboardIntegration(){const t=this.editor,e=t.model,i=t.editing.view,r=t.plugins.get("ImageUtils");this.listenTo(t.plugins.get("ClipboardPipeline"),"inputTransformation",((n,o)=>{const s=Array.from(o.content.getChildren());let a;if(!s.every(r.isInlineImageView))return;a=o.targetRanges?t.editing.mapper.toModelRange(o.targetRanges[0]):e.document.selection.getFirstRange();const c=e.createSelection(a);if("imageBlock"===$f(e.schema,c)){const t=new fd(i.document),e=s.map((e=>t.createElement("figure",{class:"image"},e)));o.content=t.createDocumentFragment(e)}}))}}i(4364);class sm extends ue{static get requires(){return[om,Xg,Xf]}static get pluginName(){return"ImageBlock"}}class am extends ue{static get requires(){return[rm,Hf,Tg]}static get pluginName(){return"ImageInlineEditing"}init(){const t=this.editor,e=t.model.schema;e.register("imageInline",{isObject:!0,isInline:!0,allowWhere:"$text",allowAttributes:["alt","src","srcset"]}),e.addChildCheck(((t,e)=>{if(t.endsWith("caption")&&"imageInline"===e.name)return!1})),this._setupConversion(),t.plugins.has("ImageBlockEditing")&&(t.commands.add("imageTypeInline",new nm(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const t=this.editor,e=t.t,i=t.conversion,r=t.plugins.get("ImageUtils");i.for("dataDowncast").elementToElement({model:"imageInline",view:(t,{writer:e})=>e.createEmptyElement("img")}),i.for("editingDowncast").elementToElement({model:"imageInline",view:(t,{writer:i})=>r.toImageWidget(qf(i,"imageInline"),i,e("image widget"))}),i.for("downcast").add(tm(r,"imageInline","src")).add(tm(r,"imageInline","alt")).add(Zf(r,"imageInline")),i.for("upcast").elementToElement({view:jf(t,"imageInline"),model:(t,{writer:e})=>e.createElement("imageInline",t.hasAttribute("src")?{src:t.getAttribute("src")}:null)})}_setupClipboardIntegration(){const t=this.editor,e=t.model,i=t.editing.view,r=t.plugins.get("ImageUtils");this.listenTo(t.plugins.get("ClipboardPipeline"),"inputTransformation",((n,o)=>{const s=Array.from(o.content.getChildren());let a;if(!s.every(r.isBlockImageView))return;a=o.targetRanges?t.editing.mapper.toModelRange(o.targetRanges[0]):e.document.selection.getFirstRange();const c=e.createSelection(a);if("imageInline"===$f(e.schema,c)){const t=new fd(i.document),e=s.map((e=>1===e.childCount?(Array.from(e.getAttributes()).forEach((i=>t.setAttribute(...i,r.findViewImgElement(e)))),e.getChild(0)):e));o.content=t.createDocumentFragment(e)}}))}}class cm extends ue{static get requires(){return[am,Xg,Xf]}static get pluginName(){return"ImageInline"}}class lm extends ue{static get pluginName(){return"IndentEditing"}init(){const t=this.editor;t.commands.add("indent",new pe(t)),t.commands.add("outdent",new pe(t))}}const hm=' ',dm=' ';class um extends ue{static get pluginName(){return"IndentUI"}init(){const t=this.editor,e=t.locale,i=t.t,r="ltr"==e.uiLanguageDirection?hm:dm,n="ltr"==e.uiLanguageDirection?dm:hm;this._defineButton("indent",i("Increase indent"),r),this._defineButton("outdent",i("Decrease indent"),n)}_defineButton(t,e,i){const r=this.editor;r.ui.componentFactory.add(t,(n=>{const o=r.commands.get(t),s=new Qd(n);return s.set({label:e,icon:i,tooltip:!0}),s.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(s,"execute",(()=>{r.execute(t),r.editing.view.focus()})),s}))}}class gm{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(t){Array.isArray(t)?t.forEach((t=>this._definitions.add(t))):this._definitions.add(t)}getDispatcher(){return t=>{t.on("attribute:linkHref",((t,e,i)=>{if(!i.consumable.test(e.item,"attribute:linkHref"))return;const r=i.writer,n=r.document.selection;for(const t of this._definitions){const o=r.createAttributeElement("a",t.attributes,{priority:5});t.classes&&r.addClass(t.classes,o);for(const e in t.styles)r.setStyle(e,t.styles[e],o);r.setCustomProperty("link",!0,o),t.callback(e.attributeNewValue)?e.item.is("selection")?r.wrap(n.getFirstRange(),o):r.wrap(i.mapper.toViewRange(e.range),o):r.unwrap(i.mapper.toViewRange(e.range),o)}}),{priority:"high"})}}getDispatcherForLinkedImage(){return t=>{t.on("attribute:linkHref:imageBlock",((t,e,{writer:i,mapper:r})=>{const n=r.toViewElement(e.item),o=Array.from(n.getChildren()).find((t=>"a"===t.name));for(const t of this._definitions){const r=zr(t.attributes);if(t.callback(e.attributeNewValue)){for(const[t,e]of r)"class"===t?i.addClass(e,o):i.setAttribute(t,e,o);t.classes&&i.addClass(t.classes,o);for(const e in t.styles)i.setStyle(e,t.styles[e],o)}else{for(const[t,e]of r)"class"===t?i.removeClass(e,o):i.removeAttribute(t,o);t.classes&&i.removeClass(t.classes,o);for(const e in t.styles)i.removeStyle(e,o)}}}))}}}const fm=function(t,e,i){var r=t.length;return i=void 0===i?r:i,!e&&i>=r?t:ln(t,e,i)};var mm=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const pm=function(t){return mm.test(t)};const bm=function(t){return t.split("")};var wm="[\\ud800-\\udfff]",_m="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",km="\\ud83c[\\udffb-\\udfff]",vm="[^\\ud800-\\udfff]",ym="(?:\\ud83c[\\udde6-\\uddff]){2}",xm="[\\ud800-\\udbff][\\udc00-\\udfff]",Am="(?:"+_m+"|"+km+")"+"?",Cm="[\\ufe0e\\ufe0f]?",Tm=Cm+Am+("(?:\\u200d(?:"+[vm,ym,xm].join("|")+")"+Cm+Am+")*"),Pm="(?:"+[vm+_m+"?",_m,ym,xm,wm].join("|")+")",Em=RegExp(km+"(?="+km+")|"+Pm+Tm,"g");const Sm=function(t){return t.match(Em)||[]};const Rm=function(t){return pm(t)?Sm(t):bm(t)};const Im=function(t){return function(e){e=nn(e);var i=pm(e)?Rm(e):void 0,r=i?i[0]:e.charAt(0),n=i?fm(i,1).join(""):e.slice(1);return r[t]()+n}}("toUpperCase"),Om=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Mm=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i,Nm=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,Lm=/^((\w+:(\/{2,})?)|(\W))/i,Vm="Ctrl+K";function Dm(t,{writer:e}){const i=e.createAttributeElement("a",{href:t},{priority:5});return e.setCustomProperty("link",!0,i),i}function Bm(t){return function(t){return t.replace(Om,"").match(Mm)}(t=String(t))?t:"#"}function zm(t,e){return!!t&&e.checkAttribute(t.name,"linkHref")}function Fm(t,e){const i=(r=t,Nm.test(r)?"mailto:":e);var r;const n=!!i&&!Lm.test(t);return t&&n?i+t:t}class qm extends fe{constructor(t){super(t),this.manualDecorators=new Tr,this.automaticDecorators=new gm}restoreManualDecoratorStates(){for(const t of this.manualDecorators)t.value=this._getDecoratorStateFromModel(t.id)}refresh(){const t=this.editor.model,e=t.document.selection,i=e.getSelectedElement()||da(e.getSelectedBlocks());zm(i,t.schema)?(this.value=i.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttribute(i,"linkHref")):(this.value=e.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttributeInSelection(e,"linkHref"));for(const t of this.manualDecorators)t.value=this._getDecoratorStateFromModel(t.id)}execute(t,e={}){const i=this.editor.model,r=i.document.selection,n=[],o=[];for(const t in e)e[t]?n.push(t):o.push(t);i.change((e=>{if(r.isCollapsed){const s=r.getFirstPosition();if(r.hasAttribute("linkHref")){const a=Kh(s,"linkHref",r.getAttribute("linkHref"),i);e.setAttribute("linkHref",t,a),n.forEach((t=>{e.setAttribute(t,!0,a)})),o.forEach((t=>{e.removeAttribute(t,a)})),e.setSelection(e.createPositionAfter(a.end.nodeBefore))}else if(""!==t){const o=zr(r.getAttributes());o.set("linkHref",t),n.forEach((t=>{o.set(t,!0)}));const{end:a}=i.insertContent(e.createText(t,o),s);e.setSelection(a)}["linkHref",...n,...o].forEach((t=>{e.removeSelectionAttribute(t)}))}else{const s=i.schema.getValidRanges(r.getRanges(),"linkHref"),a=[];for(const t of r.getSelectedBlocks())i.schema.checkAttribute(t,"linkHref")&&a.push(e.createRangeOn(t));const c=a.slice();for(const t of s)this._isRangeToUpdate(t,a)&&c.push(t);for(const i of c)e.setAttribute("linkHref",t,i),n.forEach((t=>{e.setAttribute(t,!0,i)})),o.forEach((t=>{e.removeAttribute(t,i)}))}}))}_getDecoratorStateFromModel(t){const e=this.editor.model,i=e.document.selection,r=i.getSelectedElement();return zm(r,e.schema)?r.getAttribute(t):i.getAttribute(t)}_isRangeToUpdate(t,e){for(const i of e)if(i.containsRange(t))return!1;return!0}}class jm extends fe{refresh(){const t=this.editor.model,e=t.document.selection,i=e.getSelectedElement();zm(i,t.schema)?this.isEnabled=t.schema.checkAttribute(i,"linkHref"):this.isEnabled=t.schema.checkAttributeInSelection(e,"linkHref")}execute(){const t=this.editor,e=this.editor.model,i=e.document.selection,r=t.commands.get("link");e.change((t=>{const n=i.isCollapsed?[Kh(i.getFirstPosition(),"linkHref",i.getAttribute("linkHref"),e)]:e.schema.getValidRanges(i.getRanges(),"linkHref");for(const e of n)if(t.removeAttribute("linkHref",e),r)for(const i of r.manualDecorators)t.removeAttribute(i.id,e)}))}}class $m{constructor({id:t,label:e,attributes:i,classes:r,styles:n,defaultValue:o}){this.id=t,this.set("value"),this.defaultValue=o,this.label=e,this.attributes=i,this.classes=r,this.styles=n}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}de($m,oe);i(1306);const Hm="automatic",Wm=/^(https?:)?\/\//;class Um extends ue{static get pluginName(){return"LinkEditing"}static get requires(){return[Oh,Ch,Tg]}constructor(t){super(t),t.config.define("link",{addTargetToExternalLinks:!1})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"linkHref"}),t.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:Dm}),t.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(t,e)=>Dm(Bm(t),e)}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:t=>t.getAttribute("href")}}),t.commands.add("link",new qm(t)),t.commands.add("unlink",new jm(t));const e=function(t,e){const i={"Open in a new tab":t("Open in a new tab"),Downloadable:t("Downloadable")};return e.forEach((t=>(t.label&&i[t.label]&&(t.label=i[t.label]),t))),e}(t.t,function(t){const e=[];if(t)for(const[i,r]of Object.entries(t)){const t=Object.assign({},r,{id:`link${Im(i)}`});e.push(t)}return e}(t.config.get("link.decorators")));this._enableAutomaticDecorators(e.filter((t=>t.mode===Hm))),this._enableManualDecorators(e.filter((t=>"manual"===t.mode)));t.plugins.get(Oh).registerAttribute("linkHref"),function(t,e,i,r){const n=t.editing.view,o=new Set;n.document.registerPostFixer((n=>{const s=t.model.document.selection;let a=!1;if(s.hasAttribute(e)){const c=Kh(s.getFirstPosition(),e,s.getAttribute(e),t.model),l=t.editing.mapper.toViewRange(c);for(const t of l.getItems())t.is("element",i)&&!t.hasClass(r)&&(n.addClass(r,t),o.add(t),a=!0)}return a})),t.conversion.for("editingDowncast").add((t=>{function e(){n.change((t=>{for(const e of o.values())t.removeClass(r,e),o.delete(e)}))}t.on("insert",e,{priority:"highest"}),t.on("remove",e,{priority:"highest"}),t.on("attribute",e,{priority:"highest"}),t.on("selection",e,{priority:"highest"})}))}(t,"linkHref","a","ck-link_selected"),this._enableInsertContentSelectionAttributesFixer(),this._enableClickingAfterLink(),this._enableTypingOverLink(),this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(t){const e=this.editor,i=e.commands.get("link").automaticDecorators;e.config.get("link.addTargetToExternalLinks")&&i.add({id:"linkIsExternal",mode:Hm,callback:t=>Wm.test(t),attributes:{target:"_blank",rel:"noopener noreferrer"}}),i.add(t),i.length&&e.conversion.for("downcast").add(i.getDispatcher())}_enableManualDecorators(t){if(!t.length)return;const e=this.editor,i=e.commands.get("link").manualDecorators;t.forEach((t=>{e.model.schema.extend("$text",{allowAttributes:t.id}),t=new $m(t),i.add(t),e.conversion.for("downcast").attributeToElement({model:t.id,view:(e,{writer:i})=>{if(e){const e=i.createAttributeElement("a",t.attributes,{priority:5});t.classes&&i.addClass(t.classes,e);for(const r in t.styles)i.setStyle(r,t.styles[r],e);return i.setCustomProperty("link",!0,e),e}}}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",...t._createPattern()},model:{key:t.id}})}))}_enableInsertContentSelectionAttributesFixer(){const t=this.editor.model,e=t.document.selection;this.listenTo(t,"insertContent",(()=>{const i=e.anchor.nodeBefore,r=e.anchor.nodeAfter;e.hasAttribute("linkHref")&&i&&i.hasAttribute("linkHref")&&(r&&r.hasAttribute("linkHref")||t.change((e=>{Km(e,Jm(t.schema))})))}),{priority:"low"})}_enableClickingAfterLink(){const t=this.editor,e=t.model;t.editing.view.addObserver(gd);let i=!1;this.listenTo(t.editing.view.document,"mousedown",(()=>{i=!0})),this.listenTo(t.editing.view.document,"selectionChange",(()=>{if(!i)return;i=!1;const t=e.document.selection;if(!t.isCollapsed)return;if(!t.hasAttribute("linkHref"))return;const r=t.getFirstPosition(),n=Kh(r,"linkHref",t.getAttribute("linkHref"),e);(r.isTouching(n.start)||r.isTouching(n.end))&&e.change((t=>{Km(t,Jm(e.schema))}))}))}_enableTypingOverLink(){const t=this.editor,e=t.editing.view;let i,r;this.listenTo(e.document,"delete",(()=>{r=!0}),{priority:"high"}),this.listenTo(t.model,"deleteContent",(()=>{const e=t.model.document.selection;e.isCollapsed||(r?r=!1:Gm(t)&&function(t){const e=t.document.selection,i=e.getFirstPosition(),r=e.getLastPosition(),n=i.nodeAfter;if(!n)return!1;if(!n.is("$text"))return!1;if(!n.hasAttribute("linkHref"))return!1;const o=r.textNode||r.nodeBefore;if(n===o)return!0;return Kh(i,"linkHref",n.getAttribute("linkHref"),t).containsRange(t.createRange(i,r),!0)}(t.model)&&(i=e.getAttributes()))}),{priority:"high"}),this.listenTo(t.model,"insertContent",((e,[n])=>{r=!1,Gm(t)&&i&&(t.model.change((t=>{for(const[e,r]of i)t.setAttribute(e,r,n)})),i=null)}),{priority:"high"})}_handleDeleteContentAfterLink(){const t=this.editor,e=t.model,i=e.document.selection,r=t.editing.view;let n=!1,o=!1;this.listenTo(r.document,"delete",((t,e)=>{o=e.domEvent.keyCode===so.backspace}),{priority:"high"}),this.listenTo(e,"deleteContent",(()=>{n=!1;const t=i.getFirstPosition(),r=i.getAttribute("linkHref");if(!r)return;const o=Kh(t,"linkHref",r,e);n=o.containsPosition(t)||o.end.isEqual(t)}),{priority:"high"}),this.listenTo(e,"deleteContent",(()=>{o&&(o=!1,n||t.model.enqueueChange((t=>{Km(t,Jm(e.schema))})))}),{priority:"low"})}}function Km(t,e){t.removeSelectionAttribute("linkHref");for(const i of e)t.removeSelectionAttribute(i)}function Gm(t){return t.plugins.get("Input").isInput(t.model.change((t=>t.batch)))}function Jm(t){return t.getDefinition("$text").allowAttributes.filter((t=>t.startsWith("link")))}i(7512);class Ym extends Td{constructor(t,e){super(t);const i=t.t;this.focusTracker=new ua,this.keystrokes=new ga,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(i("Save"),uh,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(i("Cancel"),dh,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(e),this.children=this._createFormChildren(e.manualDecorators),this._focusables=new Cd,this._focusCycler=new Zd({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const r=["ck","ck-link-form","ck-responsive-form"];e.manualDecorators.length&&r.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:r,tabindex:"-1"},children:this.children}),xd(this)}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce(((t,e)=>(t[e.name]=e.isOn,t)),{})}render(){super.render(),Ad({view:this});[this.urlInputView,...this._manualDecoratorSwitches,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 Eu(this.locale,Su);return e.label=t("Link URL"),e}_createButton(t,e,i,r){const n=new Qd(this.locale);return n.set({label:t,icon:e,tooltip:!0}),n.extendTemplate({attributes:{class:i}}),r&&n.delegate("execute").to(this,r),n}_createManualDecoratorSwitches(t){const e=this.createCollection();for(const i of t.manualDecorators){const r=new Xd(this.locale);r.set({name:i.id,label:i.label,withText:!0}),r.bind("isOn").toMany([i,t],"value",((t,e)=>void 0===e&&void 0===t?i.defaultValue:t)),r.on("execute",(()=>{i.set("value",!r.isOn)})),e.add(r)}return e}_createFormChildren(t){const e=this.createCollection();if(e.add(this.urlInputView),t.length){const t=new Td;t.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map((t=>({tag:"li",children:[t],attributes:{class:["ck","ck-list__item"]}}))),attributes:{class:["ck","ck-reset","ck-list"]}}),e.add(t)}return e.add(this.saveButtonView),e.add(this.cancelButtonView),e}}i(554);class Qm extends Td{constructor(t){super(t);const e=t.t;this.focusTracker=new ua,this.keystrokes=new ga,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(e("Unlink"),' ',"unlink"),this.editButtonView=this._createButton(e("Edit link"),fh,"edit"),this.set("href"),this._focusables=new Cd,this._focusCycler=new Zd({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","ck-responsive-form"],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,i){const r=new Qd(this.locale);return r.set({label:t,icon:e,tooltip:!0}),r.delegate("execute").to(this,i),r}_createPreviewButton(){const t=new Qd(this.locale),e=this.bindTemplate,i=this.t;return t.set({withText:!0,tooltip:i("Open link in new tab")}),t.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:e.to("href",(t=>t&&Bm(t))),target:"_blank",rel:"noopener noreferrer"}}),t.bind("label").to(this,"href",(t=>t||i("This link has no URL"))),t.bind("isEnabled").to(this,"href",(t=>!!t)),t.template.tag="a",t.template.eventListeners={},t}}const Xm="link-ui";class Zm extends ue{static get requires(){return[Bu]}static get pluginName(){return"LinkUI"}init(){const t=this.editor;t.editing.view.addObserver(ud),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=t.plugins.get(Bu),this._createToolbarLinkButton(),this._enableUserBalloonInteractions(),t.conversion.for("editingDowncast").markerToHighlight({model:Xm,view:{classes:["ck-fake-link-selection"]}}),t.conversion.for("editingDowncast").markerToElement({model:Xm,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy(),this.formView.destroy()}_createActionsView(){const t=this.editor,e=new Qm(t.locale),i=t.commands.get("link"),r=t.commands.get("unlink");return e.bind("href").to(i,"value"),e.editButtonView.bind("isEnabled").to(i),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(Vm,((t,e)=>{this._addFormView(),e()})),e}_createFormView(){const t=this.editor,e=t.commands.get("link"),i=t.config.get("link.defaultProtocol"),r=new Ym(t.locale,e);return r.urlInputView.fieldView.bind("value").to(e,"value"),r.urlInputView.bind("isReadOnly").to(e,"isEnabled",(t=>!t)),r.saveButtonView.bind("isEnabled").to(e),this.listenTo(r,"submit",(()=>{const{value:e}=r.urlInputView.fieldView.element,n=Fm(e,i);t.execute("link",n,r.getDecoratorSwitchesState()),this._closeFormView()})),this.listenTo(r,"cancel",(()=>{this._closeFormView()})),r.keystrokes.set("Esc",((t,e)=>{this._closeFormView(),e()})),r}_createToolbarLinkButton(){const t=this.editor,e=t.commands.get("link"),i=t.t;t.keystrokes.set(Vm,((t,i)=>{i(),e.isEnabled&&this._showUI(!0)})),t.ui.componentFactory.add("link",(t=>{const r=new Qd(t);return r.isEnabled=!0,r.label=i("Link"),r.icon=' ',r.keystroke=Vm,r.tooltip=!0,r.isToggleable=!0,r.bind("isEnabled").to(e,"isEnabled"),r.bind("isOn").to(e,"value",(t=>!!t)),this.listenTo(r,"execute",(()=>this._showUI(!0))),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())})),yd({emitter:this.formView,activator:()=>this._isUIInPanel,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.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions(),this.formView.urlInputView.fieldView.element.value=t.value||""}_closeFormView(){const t=this.editor.commands.get("link");t.restoreManualDecoratorStates(),void 0!==t.value?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(t=!1){this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),t&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),t&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const t=this.editor;this.stopListening(t.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),t.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const t=this.editor,e=t.editing.view.document;let i=this._getSelectedLinkElement(),r=o();const n=()=>{const t=this._getSelectedLinkElement(),e=o();i&&!t||!i&&e!==r?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),i=t,r=e};function o(){return e.selection.focus.getAncestors().reverse().find((t=>t.is("element")))}this.listenTo(t.ui,"update",n),this.listenTo(this._balloon,"change:visibleView",n)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const t=this.editor.editing.view,e=this.editor.model,i=t.document;let r=null;if(e.markers.has(Xm)){const e=Array.from(this.editor.editing.mapper.markerNameToElements(Xm)),i=t.createRange(t.createPositionBefore(e[0]),t.createPositionAfter(e[e.length-1]));r=t.domConverter.viewRangeToDom(i)}else r=()=>{const e=this._getSelectedLinkElement();return e?t.domConverter.mapViewToDom(e):t.domConverter.viewRangeToDom(i.selection.getFirstRange())};return{target:r}}_getSelectedLinkElement(){const t=this.editor.editing.view,e=t.document.selection,i=e.getSelectedElement();if(e.isCollapsed||i&&Mg(i))return tp(e.getFirstPosition());{const i=e.getFirstRange().getTrimmed(),r=tp(i.start),n=tp(i.end);return r&&r==n&&t.createRangeIn(r).getTrimmed().isEqual(i)?r:null}}_showFakeVisualSelection(){const t=this.editor.model;t.change((e=>{const i=t.document.selection.getFirstRange();if(t.markers.has(Xm))e.updateMarker(Xm,{range:i});else if(i.start.isAtEnd){const r=i.start.getLastMatchingPosition((({item:e})=>!t.schema.isContent(e)),{boundaries:i});e.addMarker(Xm,{usingOperation:!1,affectsData:!1,range:e.createRange(r,i.end)})}else e.addMarker(Xm,{usingOperation:!1,affectsData:!1,range:i})}))}_hideFakeVisualSelection(){const t=this.editor.model;t.markers.has(Xm)&&t.change((t=>{t.removeMarker(Xm)}))}}function tp(t){return t.getAncestors().find((t=>{return(e=t).is("attributeElement")&&!!e.getCustomProperty("link");var e}))}const ep=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class ip extends ue{static get requires(){return[Eh]}static get pluginName(){return"AutoLink"}init(){const t=this.editor.model.document.selection;t.on("change:range",(()=>{this.isEnabled=!t.anchor.parent.is("element","codeBlock")})),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling()}_enableTypingHandling(){const t=this.editor,e=new Ih(t.model,(t=>{if(!function(t){return t.length>4&&" "===t[t.length-1]&&" "!==t[t.length-2]}(t))return;const e=rp(t.substr(0,t.length-1));return e?{url:e}:void 0})),i=t.plugins.get("Input");e.on("matched:data",((e,r)=>{const{batch:n,range:o,url:s}=r;if(!i.isInput(n))return;const a=o.end.getShiftedBy(-1),c=a.getShiftedBy(-s.length),l=t.model.createRange(c,a);this._applyAutoLink(s,l)})),e.bind("isEnabled").to(this)}_enableEnterHandling(){const t=this.editor,e=t.model,i=t.commands.get("enter");i&&i.on("execute",(()=>{const t=e.document.selection.getFirstPosition();if(!t.parent.previousSibling)return;const i=e.createRangeIn(t.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(i)}))}_enableShiftEnterHandling(){const t=this.editor,e=t.model,i=t.commands.get("shiftEnter");i&&i.on("execute",(()=>{const t=e.document.selection.getFirstPosition(),i=e.createRange(e.createPositionAt(t.parent,0),t.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(i)}))}_checkAndApplyAutoLinkOnRange(t){const e=this.editor.model,{text:i,range:r}=Rh(t,e),n=rp(i);if(n){const t=e.createRange(r.end.getShiftedBy(-n.length),r.end);this._applyAutoLink(n,t)}}_applyAutoLink(t,e){const i=this.editor.model,r=this.editor.plugins.get("Delete");this.isEnabled&&function(t,e){return e.schema.checkAttributeInSelection(e.createSelection(t),"linkHref")}(e,i)&&i.enqueueChange((n=>{const o=this.editor.config.get("link.defaultProtocol"),s=Fm(t,o);n.setAttribute("linkHref",s,e),i.enqueueChange((()=>{r.requestUndoOnBackspace()}))}))}}function rp(t){const e=ep.exec(t);return e?e[2]:null}class np extends fe{constructor(t,e){super(t),this.type=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.document,r=Array.from(i.selection.getSelectedBlocks()).filter((t=>sp(t,e.schema))),n=void 0!==t.forceValue?!t.forceValue:this.value;e.change((t=>{if(n){let e=r[r.length-1].nextSibling,i=Number.POSITIVE_INFINITY,n=[];for(;e&&"listItem"==e.name&&0!==e.getAttribute("listIndent");){const t=e.getAttribute("listIndent");t=i;)o>n.getAttribute("listIndent")&&(o=n.getAttribute("listIndent")),n.getAttribute("listIndent")==o&&t[e?"unshift":"push"](n),n=n[e?"previousSibling":"nextSibling"]}}function sp(t,e){return e.checkChild(t.parent,"listItem")&&!e.isObject(t)}class ap extends fe{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 i=Array.from(e.selection.getSelectedBlocks());t.change((t=>{const e=i[i.length-1];let r=e.nextSibling;for(;r&&"listItem"==r.name&&r.getAttribute("listIndent")>e.getAttribute("listIndent");)i.push(r),r=r.nextSibling;this._indentBy<0&&(i=i.reverse());for(const e of i){const i=e.getAttribute("listIndent")+this._indentBy;i<0?t.rename(e,"paragraph"):t.setAttribute("listIndent",i,e)}this.fire("_executeCleanup",i)}))}_checkEnabled(){const t=da(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is("element","listItem"))return!1;if(this._indentBy>0){const e=t.getAttribute("listIndent"),i=t.getAttribute("listType");let r=t.previousSibling;for(;r&&r.is("element","listItem")&&r.getAttribute("listIndent")>=e;){if(r.getAttribute("listIndent")==e)return r.getAttribute("listType")==i;r=r.previousSibling}return!1}return!0}}function cp(t,e){const i=e.mapper,r=e.writer,n="numbered"==t.getAttribute("listType")?"ol":"ul",o=function(t){const e=t.createContainerElement("li");return e.getFillerOffset=fp,e}(r),s=r.createContainerElement(n,null);return r.insert(r.createPositionAt(s,0),o),i.bindElements(t,o),o}function lp(t,e,i,r){const n=e.parent,o=i.mapper,s=i.writer;let a=o.toViewPosition(r.createPositionBefore(t));const c=up(t.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:t.getAttribute("listIndent")}),l=t.previousSibling;if(c&&c.getAttribute("listIndent")==t.getAttribute("listIndent")){const t=o.toViewElement(c);a=s.breakContainer(s.createPositionAfter(t))}else if(l&&"listItem"==l.name){a=o.toViewPosition(r.createPositionAt(l,"end"));const t=o.findMappedViewAncestor(a),e=function(t){for(const e of t.getChildren())if("ul"==e.name||"ol"==e.name)return e;return null}(t);a=e?s.createPositionBefore(e):s.createPositionAt(t,"end")}else a=o.toViewPosition(r.createPositionBefore(t));if(a=dp(a),s.insert(a,n),l&&"listItem"==l.name){const t=o.toViewElement(l),i=s.createRange(s.createPositionAt(t,0),a).getWalker({ignoreElementEnd:!0});for(const t of i)if(t.item.is("element","li")){const r=s.breakContainer(s.createPositionBefore(t.item)),n=t.item.parent,o=s.createPositionAt(e,"end");hp(s,o.nodeBefore,o.nodeAfter),s.move(s.createRangeOn(n),o),i.position=r}}else{const i=n.nextSibling;if(i&&(i.is("element","ul")||i.is("element","ol"))){let r=null;for(const e of i.getChildren()){const i=o.toModelElement(e);if(!(i&&i.getAttribute("listIndent")>t.getAttribute("listIndent")))break;r=e}r&&(s.breakContainer(s.createPositionAfter(r)),s.move(s.createRangeOn(r.parent),s.createPositionAt(e,"end")))}}hp(s,n,n.nextSibling),hp(s,n.previousSibling,n)}function hp(t,e,i){return!e||!i||"ul"!=e.name&&"ol"!=e.name||e.name!=i.name||e.getAttribute("class")!==i.getAttribute("class")?null:t.mergeContainers(t.createPositionAfter(e))}function dp(t){return t.getLastMatchingPosition((t=>t.item.is("uiElement")))}function up(t,e){const i=!!e.sameIndent,r=!!e.smallerIndent,n=e.listIndent;let o=t;for(;o&&"listItem"==o.name;){const t=o.getAttribute("listIndent");if(i&&n==t||r&&n>t)return o;o="forward"===e.direction?o.nextSibling:o.previousSibling}return null}function gp(t,e,i,r){t.ui.componentFactory.add(e,(n=>{const o=t.commands.get(e),s=new Qd(n);return s.set({label:i,icon:r,tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(o,"value","isEnabled"),s.on("execute",(()=>{t.execute(e),t.editing.view.focus()})),s}))}function fp(){const t=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||t?0:In.call(this)}function mp(t){return(e,i,r)=>{const n=r.consumable;if(!n.test(i.item,"insert")||!n.test(i.item,"attribute:listType")||!n.test(i.item,"attribute:listIndent"))return;n.consume(i.item,"insert"),n.consume(i.item,"attribute:listType"),n.consume(i.item,"attribute:listIndent");const o=i.item;lp(o,cp(o,r),r,t)}}function pp(t,e,i){if(!i.consumable.consume(e.item,"attribute:listType"))return;const r=i.mapper.toViewElement(e.item),n=i.writer;n.breakContainer(n.createPositionBefore(r)),n.breakContainer(n.createPositionAfter(r));const o=r.parent,s="numbered"==e.attributeNewValue?"ol":"ul";n.rename(s,o)}function bp(t,e,i){const r=i.mapper.toViewElement(e.item).parent,n=i.writer;hp(n,r,r.nextSibling),hp(n,r.previousSibling,r);for(const t of e.item.getChildren())i.consumable.consume(t,"insert")}function wp(t,e,i){if("listItem"!=e.item.name){let t=i.mapper.toViewPosition(e.range.start);const r=i.writer,n=[];for(;("ul"==t.parent.name||"ol"==t.parent.name)&&(t=r.breakContainer(t),"li"==t.parent.name);){const e=t,i=r.createPositionAt(t.parent,"end");if(!e.isEqual(i)){const t=r.remove(r.createRange(e,i));n.push(t)}t=r.createPositionAfter(t.parent)}if(n.length>0){for(let e=0;e0){const e=hp(r,i,i.nextSibling);e&&e.parent==i&&t.offset--}}hp(r,t.nodeBefore,t.nodeAfter)}}}function _p(t,e,i){const r=i.mapper.toViewPosition(e.position),n=r.nodeBefore,o=r.nodeAfter;hp(i.writer,n,o)}function kp(t,e,i){if(i.consumable.consume(e.viewItem,{name:!0})){const t=i.writer,r=t.createElement("listItem"),n=function(t){let e=0,i=t.parent;for(;i;){if(i.is("element","li"))e++;else{const t=i.previousSibling;t&&t.is("element","li")&&e++}i=i.parent}return e}(e.viewItem);t.setAttribute("listIndent",n,r);const o=e.viewItem.parent&&"ol"==e.viewItem.parent.name?"numbered":"bulleted";if(t.setAttribute("listType",o,r),!i.safeInsert(r,e.modelCursor))return;const s=function(t,e,i){const{writer:r,schema:n}=i;let o=r.createPositionAfter(t);for(const s of e)if("ul"==s.name||"ol"==s.name)o=i.convertItem(s,o).modelCursor;else{const e=i.convertItem(s,r.createPositionAt(t,"end")),a=e.modelRange.start.nodeAfter;a&&a.is("element")&&!n.checkChild(t,a.name)&&(t=e.modelCursor.parent.is("element","listItem")?e.modelCursor.parent:Cp(e.modelCursor),o=r.createPositionAfter(t))}return o}(r,e.viewItem.getChildren(),i);e.modelRange=t.createRange(e.modelCursor,s),i.updateConversionResult(r,e)}}function vp(t,e,i){if(i.consumable.test(e.viewItem,{name:!0})){const t=Array.from(e.viewItem.getChildren());for(const e of t){!(e.is("element","li")||Pp(e))&&e._remove()}}}function yp(t,e,i){if(i.consumable.test(e.viewItem,{name:!0})){if(0===e.viewItem.childCount)return;const t=[...e.viewItem.getChildren()];let i=!1;for(const e of t)i&&!Pp(e)&&e._remove(),Pp(e)&&(i=!0)}}function xp(t){return(e,i)=>{if(i.isPhantom)return;const r=i.modelPosition.nodeBefore;if(r&&r.is("element","listItem")){const e=i.mapper.toViewElement(r),n=e.getAncestors().find(Pp),o=t.createPositionAt(e,0).getWalker();for(const t of o){if("elementStart"==t.type&&t.item.is("element","li")){i.viewPosition=t.previousPosition;break}if("elementEnd"==t.type&&t.item==n){i.viewPosition=t.nextPosition;break}}}}}function Ap(t,[e,i]){let r,n=e.is("documentFragment")?e.getChild(0):e;if(r=i?this.createSelection(i):this.document.selection,n&&n.is("element","listItem")){const t=r.getFirstPosition();let e=null;if(t.parent.is("element","listItem")?e=t.parent:t.nodeBefore&&t.nodeBefore.is("element","listItem")&&(e=t.nodeBefore),e){const t=e.getAttribute("listIndent");if(t>0)for(;n&&n.is("element","listItem");)n._setAttribute("listIndent",n.getAttribute("listIndent")+t),n=n.nextSibling}}}function Cp(t){const e=new Ia({startPosition:t});let i;do{i=e.next()}while(!i.value.item.is("element","listItem"));return i.value.item}function Tp(t,e,i,r,n,o){const s=up(e.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:t,foo:"b"}),a=n.mapper,c=n.writer,l=s?s.getAttribute("listIndent"):null;let h;if(s)if(l==t){const t=a.toViewElement(s).parent;h=c.createPositionAfter(t)}else{const t=o.createPositionAt(s,"end");h=a.toViewPosition(t)}else h=i;h=dp(h);for(const t of[...r.getChildren()])Pp(t)&&(h=c.move(c.createRangeOn(t),h).end,hp(c,t,t.nextSibling),hp(c,t.previousSibling,t))}function Pp(t){return t.is("element","ol")||t.is("element","ul")}class Ep extends ue{static get pluginName(){return"ListEditing"}static get requires(){return[ng,Eh]}init(){const t=this.editor;t.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const e=t.data,i=t.editing;var r;t.model.document.registerPostFixer((e=>function(t,e){const i=t.document.differ.getChanges(),r=new Map;let n=!1;for(const r of i)if("insert"==r.type&&"listItem"==r.name)o(r.position);else if("insert"==r.type&&"listItem"!=r.name){if("$text"!=r.name){const i=r.position.nodeAfter;i.hasAttribute("listIndent")&&(e.removeAttribute("listIndent",i),n=!0),i.hasAttribute("listType")&&(e.removeAttribute("listType",i),n=!0),i.hasAttribute("listStyle")&&(e.removeAttribute("listStyle",i),n=!0);for(const e of Array.from(t.createRangeIn(i)).filter((t=>t.item.is("element","listItem"))))o(e.previousPosition)}o(r.position.getShiftedBy(r.length))}else"remove"==r.type&&"listItem"==r.name?o(r.position):("attribute"==r.type&&"listIndent"==r.attributeKey||"attribute"==r.type&&"listType"==r.attributeKey)&&o(r.range.start);for(const t of r.values())s(t),a(t);return n;function o(t){const e=t.nodeBefore;if(e&&e.is("element","listItem")){let t=e;if(r.has(t))return;for(let e=t.previousSibling;e&&e.is("element","listItem");e=t.previousSibling)if(t=e,r.has(t))return;r.set(e,t)}else{const e=t.nodeAfter;e&&e.is("element","listItem")&&r.set(e,e)}}function s(t){let i=0,r=null;for(;t&&t.is("element","listItem");){const o=t.getAttribute("listIndent");if(o>i){let s;null===r?(r=o-i,s=i):(r>o&&(r=o),s=o-r),e.setAttribute("listIndent",s,t),n=!0}else r=null,i=t.getAttribute("listIndent")+1;t=t.nextSibling}}function a(t){let i=[],r=null;for(;t&&t.is("element","listItem");){const o=t.getAttribute("listIndent");if(r&&r.getAttribute("listIndent")>o&&(i=i.slice(0,o+1)),0!=o)if(i[o]){const r=i[o];t.getAttribute("listType")!=r&&(e.setAttribute("listType",r,t),n=!0)}else i[o]=t.getAttribute("listType");r=t,t=t.nextSibling}}}(t.model,e))),i.mapper.registerViewToModelLength("li",Sp),e.mapper.registerViewToModelLength("li",Sp),i.mapper.on("modelToViewPosition",xp(i.view)),i.mapper.on("viewToModelPosition",(r=t.model,(t,e)=>{const i=e.viewPosition,n=i.parent,o=e.mapper;if("ul"==n.name||"ol"==n.name){if(i.isAtEnd){const t=o.toModelElement(i.nodeBefore),n=o.getModelLength(i.nodeBefore);e.modelPosition=r.createPositionBefore(t).getShiftedBy(n)}else{const t=o.toModelElement(i.nodeAfter);e.modelPosition=r.createPositionBefore(t)}t.stop()}else if("li"==n.name&&i.nodeBefore&&("ul"==i.nodeBefore.name||"ol"==i.nodeBefore.name)){const s=o.toModelElement(n);let a=1,c=i.nodeBefore;for(;c&&Pp(c);)a+=o.getModelLength(c),c=c.previousSibling;e.modelPosition=r.createPositionBefore(s).getShiftedBy(a),t.stop()}})),e.mapper.on("modelToViewPosition",xp(i.view)),t.conversion.for("editingDowncast").add((e=>{e.on("insert",wp,{priority:"high"}),e.on("insert:listItem",mp(t.model)),e.on("attribute:listType:listItem",pp,{priority:"high"}),e.on("attribute:listType:listItem",bp,{priority:"low"}),e.on("attribute:listIndent:listItem",function(t){return(e,i,r)=>{if(!r.consumable.consume(i.item,"attribute:listIndent"))return;const n=r.mapper.toViewElement(i.item),o=r.writer;o.breakContainer(o.createPositionBefore(n)),o.breakContainer(o.createPositionAfter(n));const s=n.parent,a=s.previousSibling,c=o.createRangeOn(s);o.remove(c),a&&a.nextSibling&&hp(o,a,a.nextSibling),Tp(i.attributeOldValue+1,i.range.start,c.start,n,r,t),lp(i.item,n,r,t);for(const t of i.item.getChildren())r.consumable.consume(t,"insert")}}(t.model)),e.on("remove:listItem",function(t){return(e,i,r)=>{const n=r.mapper.toViewPosition(i.position).getLastMatchingPosition((t=>!t.item.is("element","li"))).nodeAfter,o=r.writer;o.breakContainer(o.createPositionBefore(n)),o.breakContainer(o.createPositionAfter(n));const s=n.parent,a=s.previousSibling,c=o.createRangeOn(s),l=o.remove(c);a&&a.nextSibling&&hp(o,a,a.nextSibling),Tp(r.mapper.toModelElement(n).getAttribute("listIndent")+1,i.position,c.start,n,r,t);for(const t of o.createRangeIn(l).getItems())r.mapper.unbindViewElement(t);e.stop()}}(t.model)),e.on("remove",_p,{priority:"low"})})),t.conversion.for("dataDowncast").add((e=>{e.on("insert",wp,{priority:"high"}),e.on("insert:listItem",mp(t.model))})),t.conversion.for("upcast").add((t=>{t.on("element:ul",vp,{priority:"high"}),t.on("element:ol",vp,{priority:"high"}),t.on("element:li",yp,{priority:"high"}),t.on("element:li",kp)})),t.model.on("insertContent",Ap,{priority:"high"}),t.commands.add("numberedList",new np(t,"numbered")),t.commands.add("bulletedList",new np(t,"bulleted")),t.commands.add("indentList",new ap(t,"forward")),t.commands.add("outdentList",new ap(t,"backward"));const n=i.view.document;this.listenTo(n,"enter",((t,e)=>{const i=this.editor.model.document,r=i.selection.getLastPosition().parent;i.selection.isCollapsed&&"listItem"==r.name&&r.isEmpty&&(this.editor.execute("outdentList"),e.preventDefault(),t.stop())}),{context:"li"}),this.listenTo(n,"delete",((t,e)=>{if("backward"!==e.direction)return;const i=this.editor.model.document.selection;if(!i.isCollapsed)return;const r=i.getFirstPosition();if(!r.isAtStart)return;const n=r.parent;if("listItem"!==n.name)return;n.previousSibling&&"listItem"===n.previousSibling.name||(this.editor.execute("outdentList"),e.preventDefault(),t.stop())}),{context:"li"});const o=t=>(e,i)=>{this.editor.commands.get(t).isEnabled&&(this.editor.execute(t),i())};t.keystrokes.set("Tab",o("indentList")),t.keystrokes.set("Shift+Tab",o("outdentList"))}afterInit(){const t=this.editor.commands,e=t.get("indent"),i=t.get("outdent");e&&e.registerChildCommand(t.get("indentList")),i&&i.registerChildCommand(t.get("outdentList"))}}function Sp(t){let e=1;for(const i of t.getChildren())if("ul"==i.name||"ol"==i.name)for(const t of i.getChildren())e+=Sp(t);return e}class Rp extends ue{static get pluginName(){return"ListUI"}init(){const t=this.editor.t;gp(this.editor,"numberedList",t("Numbered List"),' '),gp(this.editor,"bulletedList",t("Bulleted List"),' ')}}var Ip=i(3917),Op=i.n(Ip);function Mp(t,e){return Array(e+1).join(t)}Op().use({tokenizer:{autolink:()=>null,url:()=>null},renderer:{checkbox(...t){return Object.getPrototypeOf(this).checkbox.call(this,...t).trimRight()}}});var Np=["address","article","aside","audio","blockquote","body","canvas","center","dd","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frameset","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","isindex","li","main","menu","nav","noframes","noscript","ol","output","p","pre","section","table","tbody","td","tfoot","th","thead","tr","ul"];function Lp(t){return-1!==Np.indexOf(t.nodeName.toLowerCase())}var Vp=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];function Dp(t){return-1!==Vp.indexOf(t.nodeName.toLowerCase())}var Bp=Vp.join();var zp={};function Fp(t){for(var e in this.options=t,this._keep=[],this._remove=[],this.blankRule={replacement:t.blankReplacement},this.keepReplacement=t.keepReplacement,this.defaultRule={replacement:t.defaultReplacement},this.array=[],t.rules)this.array.push(t.rules[e])}function qp(t,e,i){for(var r=0;r-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,i))return!0}}function $p(t){var e=t.nextSibling||t.parentNode;return t.parentNode.removeChild(t),e}function Hp(t,e,i){return t&&t.parentNode===e||i(e)?e.nextSibling||e.parentNode:e.firstChild||e.nextSibling||e.parentNode}zp.paragraph={filter:"p",replacement:function(t){return"\n\n"+t+"\n\n"}},zp.lineBreak={filter:"br",replacement:function(t,e,i){return i.br+"\n"}},zp.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(t,e,i){var r=Number(e.nodeName.charAt(1));return"setext"===i.headingStyle&&r<3?"\n\n"+t+"\n"+Mp(1===r?"=":"-",t.length)+"\n\n":"\n\n"+Mp("#",r)+" "+t+"\n\n"}},zp.blockquote={filter:"blockquote",replacement:function(t){return"\n\n"+(t=(t=t.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},zp.list={filter:["ul","ol"],replacement:function(t,e){var i=e.parentNode;return"LI"===i.nodeName&&i.lastElementChild===e?"\n"+t:"\n\n"+t+"\n\n"}},zp.listItem={filter:"li",replacement:function(t,e,i){t=t.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var r=i.bulletListMarker+" ",n=e.parentNode;if("OL"===n.nodeName){var o=n.getAttribute("start"),s=Array.prototype.indexOf.call(n.children,e);r=(o?Number(o)+s:s+1)+". "}return r+t+(e.nextSibling&&!/\n$/.test(t)?"\n":"")}},zp.indentedCodeBlock={filter:function(t,e){return"indented"===e.codeBlockStyle&&"PRE"===t.nodeName&&t.firstChild&&"CODE"===t.firstChild.nodeName},replacement:function(t,e,i){return"\n\n "+e.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},zp.fencedCodeBlock={filter:function(t,e){return"fenced"===e.codeBlockStyle&&"PRE"===t.nodeName&&t.firstChild&&"CODE"===t.firstChild.nodeName},replacement:function(t,e,i){for(var r,n=((e.firstChild.className||"").match(/language-(\S+)/)||[null,""])[1],o=e.firstChild.textContent,s=i.fence.charAt(0),a=3,c=new RegExp("^"+s+"{3,}","gm");r=c.exec(o);)r[0].length>=a&&(a=r[0].length+1);var l=Mp(s,a);return"\n\n"+l+n+"\n"+o.replace(/\n$/,"")+"\n"+l+"\n\n"}},zp.horizontalRule={filter:"hr",replacement:function(t,e,i){return"\n\n"+i.hr+"\n\n"}},zp.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+'"':"")+")"}},zp.referenceLink={filter:function(t,e){return"referenced"===e.linkStyle&&"A"===t.nodeName&&t.getAttribute("href")},replacement:function(t,e,i){var r,n,o=e.getAttribute("href"),s=e.title?' "'+e.title+'"':"";switch(i.linkReferenceStyle){case"collapsed":r="["+t+"][]",n="["+t+"]: "+o+s;break;case"shortcut":r="["+t+"]",n="["+t+"]: "+o+s;break;default:var a=this.references.length+1;r="["+t+"]["+a+"]",n="["+a+"]: "+o+s}return this.references.push(n),r},references:[],append:function(t){var e="";return this.references.length&&(e="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),e}},zp.emphasis={filter:["em","i"],replacement:function(t,e,i){return t.trim()?i.emDelimiter+t+i.emDelimiter:""}},zp.strong={filter:["strong","b"],replacement:function(t,e,i){return t.trim()?i.strongDelimiter+t+i.strongDelimiter:""}},zp.code={filter:function(t){var e=t.previousSibling||t.nextSibling,i="PRE"===t.parentNode.nodeName&&!e;return"CODE"===t.nodeName&&!i},replacement:function(t){if(!t.trim())return"";var e="`",i="",r="",n=t.match(/`+/gm);if(n)for(/^`/.test(t)&&(i=" "),/`$/.test(t)&&(r=" ");-1!==n.indexOf(e);)e+="`";return e+i+t+r+e}},zp.image={filter:"img",replacement:function(t,e){var i=e.alt||"",r=e.getAttribute("src")||"",n=e.title||"";return r?"!["+i+"]("+r+(n?' "'+n+'"':"")+")":""}},Fp.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=qp(this.array,t,this.options))||(e=qp(this._keep,t,this.options))||(e=qp(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,i=t.isBlock,r=t.isVoid,n=t.isPre||function(t){return"PRE"===t.nodeName};if(e.firstChild&&!n(e)){for(var o=null,s=!1,a=null,c=Hp(a,e,n);c!==e;){if(3===c.nodeType||4===c.nodeType){var l=c.data.replace(/[ \r\n\t]+/g," ");if(o&&!/ $/.test(o.data)||s||" "!==l[0]||(l=l.substr(1)),!l){c=$p(c);continue}c.data=l,o=c}else{if(1!==c.nodeType){c=$p(c);continue}i(c)||"BR"===c.nodeName?(o&&(o.data=o.data.replace(/ $/,"")),o=null,s=!1):r(c)&&(o=null,s=!0)}var h=Hp(a,c,n);a=c,c=h}o&&(o.data=o.data.replace(/ $/,""),o.data||$p(o))}}({element:e,isBlock:Lp,isVoid:Dp}),e}function Qp(t){return t.isBlock=Lp(t),t.isCode="code"===t.nodeName.toLowerCase()||t.parentNode.isCode,t.isBlank=function(t){return-1===["A","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"].indexOf(t.nodeName)&&/^\s*$/i.test(t.textContent)&&!Dp(t)&&!function(t){return t.querySelector&&t.querySelector(Bp)}(t)}(t),t.flankingWhitespace=function(t){var e="",i="";if(!t.isBlock){var r=/^\s/.test(t.textContent),n=/\s$/.test(t.textContent),o=t.isBlank&&r&&n;r&&!Xp("left",t)&&(e=" "),o||!n||Xp("right",t)||(i=" ")}return{leading:e,trailing:i}}(t),t}function Xp(t,e){var i,r,n;return"left"===t?(i=e.previousSibling,r=/ $/):(i=e.nextSibling,r=/^ /),i&&(3===i.nodeType?n=r.test(i.nodeValue):1!==i.nodeType||Lp(i)||(n=r.test(i.textContent))),n}var Zp=Array.prototype.reduce,tb=/^\n*/,eb=/\n*$/,ib=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function rb(t){if(!(this instanceof rb))return new rb(t);var e={rules:zp,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;ei&&(e+=kb(t.substring(i,n)));const o=r[0];e+=o,i=n+o.length}return i"checkbox"===t.type&&("LI"===t.parentNode.nodeName||"LI"===t.parentNode.parentNode.nodeName),replacement:(t,e)=>(e.checked?"[x]":"[ ]")+" "})}]);const yb=new RegExp(/\b(?:(?:https?|ftp):\/\/|www\.)/.source+/(?![-_])(?:[-_a-z0-9\u00a1-\uffff]{1,63}\.)+(?:[a-z\u00a1-\uffff]{2,63})/.source+/(?:[^\s<>]*)/.source,"gi");function xb(t){let e=t.length;for(;e>0;){const i=t[e-1];if("?!.,:*_~'\"".includes(i))e--;else{if(")"!=i)break;{let i=0;for(let r=0;r{const r=zr(i.getAttributes()),n=new Map(r.entries());n.set("mention",a),e.insertContent(t.createText(s,n),o),e.insertContent(t.createText(" ",r),o.start.getShiftedBy(s.length))}))}}class Tb extends ue{static get pluginName(){return"MentionEditing"}init(){const t=this.editor,e=t.model,i=e.document;e.schema.extend("$text",{allowAttributes:"mention"}),t.conversion.for("upcast").elementToAttribute({view:{name:"span",key:"data-mention",classes:"mention"},model:{key:"mention",value:t=>Eb(t)}}),t.conversion.for("downcast").attributeToElement({model:"mention",view:Rb}),t.conversion.for("downcast").add(Sb),i.registerPostFixer((t=>function(t,e,i){const r=e.differ.getChanges();let n=!1;for(const e of r){const r=e.position;if("$text"==e.name){const e=r.textNode&&r.textNode.nextSibling;n=Ob(r.textNode,t)||n,n=Ob(e,t)||n,n=Ob(r.nodeBefore,t)||n,n=Ob(r.nodeAfter,t)||n}if("$text"!=e.name&&"insert"==e.type){const e=r.nodeAfter;for(const i of t.createRangeIn(e).getItems())n=Ob(i,t)||n}if("insert"==e.type&&i.isInline(e.name)){const e=r.nodeAfter&&r.nodeAfter.nextSibling;n=Ob(r.nodeBefore,t)||n,n=Ob(e,t)||n}}return n}(t,i,e.schema))),i.registerPostFixer((t=>function(t,e){const i=e.differ.getChanges();let r=!1;for(const e of i)if("attribute"===e.type&&"mention"!=e.attributeKey){const i=e.range.start.nodeBefore,n=e.range.end.nodeAfter;for(const o of[i,n])Ib(o)&&o.getAttribute(e.attributeKey)!=e.attributeNewValue&&(t.setAttribute(e.attributeKey,e.attributeNewValue,o),r=!0)}return r}(t,i))),i.registerPostFixer((t=>function(t,e){const i=e.selection,r=i.focus;if(i.isCollapsed&&i.hasAttribute("mention")&&function(t){const e=t.isAtStart;return t.nodeBefore&&t.nodeBefore.is("$text")||e}(r))return t.removeSelectionAttribute("mention"),!0}(t,i))),t.commands.add("mention",new Cb(t))}}function Pb(t,e){return Object.assign({uid:s()},t,e||{})}function Eb(t,e){const i=t.getAttribute("data-mention"),r=t.getChild(0);if(!r)return;return Pb({id:i,_text:r.data},e)}function Sb(t){t.on("attribute:mention",((t,e,i)=>{const r=e.attributeNewValue;if(!e.item.is("$textProxy")||!r)return;const n=e.range.start;(n.textNode||n.nodeAfter).data!=r._text&&i.consumable.consume(e.item,t.name)}),{priority:"highest"})}function Rb(t,{writer:e}){if(!t)return;const i={class:"mention","data-mention":t.id},r={id:t.uid,priority:20};return e.createAttributeElement("span",i,r)}function Ib(t){if(!t||!t.is("$text")&&!t.is("$textProxy")||!t.hasAttribute("mention"))return!1;return t.data!=t.getAttribute("mention")._text}function Ob(t,e){return!!Ib(t)&&(e.removeAttribute("mention",t),!0)}i(1310);class Mb extends pu{constructor(t){super(t),this.extendTemplate({attributes:{class:["ck-mentions"],tabindex:"-1"}})}selectFirst(){this.select(0)}selectNext(){const t=this.selected,e=this.items.getIndex(t);this.select(e+1)}selectPrevious(){const t=this.selected,e=this.items.getIndex(t);this.select(e-1)}select(t){let e=0;t>0&&t{i?(this.domElement.classList.add("ck-on"),this.domElement.classList.remove("ck-off")):(this.domElement.classList.add("ck-off"),this.domElement.classList.remove("ck-on"))})),this.listenTo(this.domElement,"click",(()=>{this.fire("execute")}))}render(){super.render(),this.element=this.domElement}}class Lb extends bu{highlight(){this.children.first.isOn=!0}removeHighlight(){this.children.first.isOn=!1}}const Vb=[so.arrowup,so.arrowdown,so.esc],Db=[so.enter,so.tab];class Bb extends ue{static get pluginName(){return"MentionUI"}static get requires(){return[Bu]}constructor(t){super(t),this._mentionsView=this._createMentionView(),this._mentionsConfigurations=new Map,this._requestFeedDebounced=Ks(this._requestFeed,100),t.config.define("mention",{feeds:[]})}init(){const t=this.editor,e=t.config.get("mention.commitKeys")||Db,i=Vb.concat(e);this._balloon=t.plugins.get(Bu),t.editing.view.document.on("keydown",((t,r)=>{var n;n=r.keyCode,i.includes(n)&&this._isUIVisible&&(r.preventDefault(),t.stop(),r.keyCode==so.arrowdown&&this._mentionsView.selectNext(),r.keyCode==so.arrowup&&this._mentionsView.selectPrevious(),e.includes(r.keyCode)&&this._mentionsView.executeSelected(),r.keyCode==so.esc&&this._hideUIAndRemoveMarker())}),{priority:"highest"}),yd({emitter:this._mentionsView,activator:()=>this._isUIVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideUIAndRemoveMarker()});const r=t.config.get("mention.feeds");for(const t of r){const e=t.feed,i=t.marker;if(!jb(i))throw new c("mentionconfig-incorrect-marker",null,{marker:i});const r=t.minimumCharacters||0,n="function"==typeof e?e.bind(this.editor):qb(e),o={watcher:this._setupTextWatcherForFeed(i,r),marker:i,feedCallback:n,itemRenderer:t.itemRenderer};this._mentionsConfigurations.set(i,o)}this.listenTo(t,"change:isReadOnly",(()=>{this._hideUIAndRemoveMarker()})),this.on("requestFeed:response",((t,e)=>this._handleFeedResponse(e))),this.on("requestFeed:error",(()=>this._hideUIAndRemoveMarker()))}destroy(){super.destroy(),this._mentionsView.destroy()}get _isUIVisible(){return this._balloon.visibleView===this._mentionsView}_createMentionView(){const t=this.editor.locale,e=new Mb(t);return this._items=new Tr,e.items.bindTo(this._items).using((i=>{const{item:r,marker:n}=i,o=this.editor.config.get("mention.dropdownLimit")||10;if(e.items.length>=o)return;const s=new Lb(t),a=this._renderItem(r,n);return a.delegate("execute").to(s),s.children.add(a),s.item=r,s.marker=n,s.on("execute",(()=>{e.fire("execute",{item:r,marker:n})})),s})),e.on("execute",((t,e)=>{const i=this.editor,r=i.model,n=e.item,o=e.marker,s=i.model.markers.get("mention"),a=r.createPositionAt(r.document.selection.focus),c=r.createPositionAt(s.getStart()),l=r.createRange(c,a);this._hideUIAndRemoveMarker(),i.execute("mention",{mention:n,text:n.text,marker:o,range:l}),i.editing.view.focus()})),e}_getItemRenderer(t){const{itemRenderer:e}=this._mentionsConfigurations.get(t);return e}_requestFeed(t,e){this._lastRequested=e;const{feedCallback:i}=this._mentionsConfigurations.get(t),r=i(e);r instanceof Promise?r.then((i=>{this._lastRequested==e?this.fire("requestFeed:response",{feed:i,marker:t,feedText:e}):this.fire("requestFeed:discarded",{feed:i,marker:t,feedText:e})})).catch((e=>{this.fire("requestFeed:error",{error:e}),l("mention-feed-callback-error",{marker:t})})):this.fire("requestFeed:response",{feed:r,marker:t,feedText:e})}_setupTextWatcherForFeed(t,e){const i=this.editor,r=new Ih(i.model,function(t,e){const i=Fb(t,e);return t=>i.test(t)}(t,e));r.on("matched",((e,r)=>{const n=i.model.document.selection.focus;if(function(t){const e=t.textNode&&t.textNode.hasAttribute("mention"),i=t.nodeBefore;return e||i&&i.is("$text")&&i.hasAttribute("mention")}(n))return void this._hideUIAndRemoveMarker();const o=function(t,e){const i=Fb(t,0);return e.match(i)[2]}(t,r.text),s=t.length+o.length,a=n.getShiftedBy(-s),c=n.getShiftedBy(-o.length),l=i.model.createRange(a,c);if($b(i)){const t=i.model.markers.get("mention");i.model.change((e=>{e.updateMarker(t,{range:l})}))}else i.model.change((t=>{t.addMarker("mention",{range:l,usingOperation:!1,affectsData:!1})}));this._requestFeedDebounced(t,o)})),r.on("unmatched",(()=>{this._hideUIAndRemoveMarker()}));const n=i.commands.get("mention");return r.bind("isEnabled").to(n),r}_handleFeedResponse(t){const{feed:e,marker:i}=t;if(!$b(this.editor))return;this._items.clear();for(const t of e){const e="object"!=typeof t?{id:t,text:t}:t;this._items.add({item:e,marker:i})}const r=this.editor.model.markers.get("mention");this._items.length?this._showOrUpdateUI(r):this._hideUIAndRemoveMarker()}_showOrUpdateUI(t){this._isUIVisible?this._balloon.updatePosition(this._getBalloonPanelPositionData(t,this._mentionsView.position)):this._balloon.add({view:this._mentionsView,position:this._getBalloonPanelPositionData(t,this._mentionsView.position),singleViewMode:!0}),this._mentionsView.position=this._balloon.view.position,this._mentionsView.selectFirst()}_hideUIAndRemoveMarker(){this._balloon.hasView(this._mentionsView)&&this._balloon.remove(this._mentionsView),$b(this.editor)&&this.editor.model.change((t=>t.removeMarker("mention"))),this._mentionsView.position=void 0}_renderItem(t,e){const i=this.editor;let r,n=t.id;const o=this._getItemRenderer(e);if(o){const e=o(t);"string"!=typeof e?r=new Nb(i.locale,e):n=e}if(!r){const t=new Qd(i.locale);t.label=n,t.withText=!0,r=t}return r}_getBalloonPanelPositionData(t,e){const i=this.editor,r=i.editing,n=r.view.domConverter,o=r.mapper;return{target:()=>{let e=t.getRange();"$graveyard"==e.start.root.rootName&&(e=i.model.document.selection.getFirstRange());const r=o.toViewRange(e);return na.getDomRangeRects(n.viewRangeToDom(r)).pop()},limiter:()=>{const t=this.editor.editing.view,e=t.document.selection.editableElement;return e?t.domConverter.mapViewToDom(e.root):null},positions:zb(e)}}}function zb(t){const e={caret_se:t=>({top:t.bottom+3,left:t.right,name:"caret_se",config:{withArrow:!1}}),caret_ne:(t,e)=>({top:t.top-e.height-3,left:t.right,name:"caret_ne",config:{withArrow:!1}}),caret_sw:(t,e)=>({top:t.bottom+3,left:t.right-e.width,name:"caret_sw",config:{withArrow:!1}}),caret_nw:(t,e)=>({top:t.top-e.height-3,left:t.right-e.width,name:"caret_nw",config:{withArrow:!1}})};return Object.prototype.hasOwnProperty.call(e,t)?[e[t]]:[e.caret_se,e.caret_sw,e.caret_ne,e.caret_nw]}function Fb(t,e){const i=0==e?"*":`{${e},}`,r=ro.features.isRegExpUnicodePropertySupported?"\\p{Ps}\\p{Pi}\"'":"\\(\\[{\"'";return new RegExp(`(?:^|[ ${r}])([${t}])([\\S]${i})$`,"u")}function qb(t){return e=>t.filter((t=>("string"==typeof t?t:String(t.id)).toLowerCase().includes(e.toLowerCase())))}function jb(t){return t&&1==t.length}function $b(t){return t.model.markers.has("mention")}i(2647);function Hb(t,e){if(!t.childCount)return;const i=new fd(t.document),r=function(t,e){const i=e.createRangeIn(t),r=new Fr({name:/^p|h\d+$/,styles:{"mso-list":/.*/}}),n=[];for(const t of i)if("elementStart"===t.type&&r.match(t.item)){const e=Kb(t.item);n.push({element:t.item,id:e.id,order:e.order,indent:e.indent})}return n}(t,i);if(!r.length)return;let n=null,o=1;r.forEach(((t,s)=>{const a=function(t,e){if(!t)return!0;if(t.id!==e.id)return e.indent-t.indent!=1;const i=e.element.previousSibling;if(!i)return!0;return r=i,!(r.is("element","ol")||r.is("element","ul"));var r}(r[s-1],t),c=a?null:r[s-1],l=(d=t,(h=c)?d.indent-h.indent:d.indent-1);var h,d;if(a&&(n=null,o=1),!n||0!==l){const r=function(t,e){const i=new RegExp(`@list l${t.id}:level${t.indent}\\s*({[^}]*)`,"gi"),r=/mso-level-number-format:([^;]{0,100});/gi,n=i.exec(e);let o="decimal",s="ol";if(n&&n[1]){const e=r.exec(n[1]);if(e&&e[1]&&(o=e[1].trim(),s="bullet"!==o&&"image"!==o?"ol":"ul"),"bullet"===o){const e=function(t){const e=function(t){if(t.getChild(0).is("$text"))return null;for(const e of t.getChildren()){if(!e.is("element","span"))continue;const t=e.getChild(0);return t.is("$text")?t:t.getChild(0)}}(t);if(!e)return null;const i=e._data;if("o"===i)return"circle";if("·"===i)return"disc";if("§"===i)return"square";return null}(t.element);e&&(o=e)}}return{type:s,style:Wb(o)}}(t,e);if(n){if(t.indent>o){const t=n.getChild(n.childCount-1),e=t.getChild(t.childCount-1);n=Ub(r,e,i),o+=1}else if(t.indentt.indexOf(e)>-1))?o.push(i):i.getAttribute("src")||o.push(i)}for(const t of o)i.remove(t)}(r,t,i),function(t,e){const i=e.createRangeIn(t),r=new Fr({name:/v:(.+)/}),n=[];for(const t of i)"elementStart"==t.type&&r.match(t.item)&&n.push(t.item);for(const t of n)e.remove(t)}(t,i);const n=function(t,e){const i=e.createRangeIn(t),r=new Fr({name:"img"}),n=[];for(const t of i)r.match(t.item)&&t.item.getAttribute("src").startsWith("file://")&&n.push(t.item);return n}(t,i);n.length&&function(t,e,i){if(t.length===e.length)for(let r=0;rString.fromCharCode(parseInt(t,16)))).join(""))}const Xb=/ /i,Zb=/xmlns:o="urn:schemas-microsoft-com/i;class tw{constructor(t){this.document=t}isActive(t){return Xb.test(t)||Zb.test(t)}execute(t){const{body:e,stylesString:i}=t._parsedData;Hb(e,i),Yb(e,t.dataTransfer.getData("text/rtf")),t.content=e}}function ew(t){return t.replace(/(\s+)<\/span>/g,((t,e)=>1===e.length?" ":Array(e.length+1).join(" ").substr(0,e.length)))}function iw(t,e){const i=new DOMParser,r=function(t){return ew(ew(t)).replace(/([^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<\/span>/g,"").replace(/ <\//g," ").replace(/ <\/o:p>/g," ").replace(/( |\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)<")}(function(t){const e="